ci: fix github ci build for nuclei openocd (#13)

Change-Id: Id644958753ee29694824032eaf54df4eab1428bd
Signed-off-by: Huaqi Fang <578567190@qq.com>
This commit is contained in:
Huaqi Fang 2024-01-25 17:05:26 +08:00
parent 18627364f9
commit 2fbb887163
3 changed files with 24 additions and 4 deletions

View File

@ -17,7 +17,7 @@ jobs:
sudo apt-get update
sudo apt-get install clang gcc-multilib
- run: ./bootstrap
- run: ./configure --enable-remote-bitbang --enable-jtag_vpi --disable-target64
- run: ./configure --enable-remote-bitbang --enable-jtag_vpi --disable-target64 --disable-werror
- run: make -j`nproc`
- run: file src/openocd | grep 32-bit
- run: src/openocd --version
@ -40,8 +40,9 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install libusb-1.0-0 libusb-1.0-0-dev
sudo apt-get install libftdi1-2 libftdi1-dev
- run: ./bootstrap
- run: ./configure --enable-remote-bitbang --enable-jtag_vpi --enable-ftdi-cjtag --prefix /tmp/${{ env.NAME }}
- run: ./configure --enable-remote-bitbang --enable-jtag_vpi --enable-ftdi-cjtag --enable-jlink --enable-ftdi --disable-werror
- run: make -j`nproc`
- name: Check that we built something
run: |

View File

@ -16,7 +16,7 @@ jobs:
- name: Install needed packages
run: |
sudo apt-get update
sudo apt-get install autotools-dev autoconf automake libtool pkg-config cmake texinfo texlive g++-mingw-w64-i686
sudo apt-get install autotools-dev autoconf automake libtool pkg-config cmake texinfo texlive g++-mingw-w64-i686 unzip
- name: Checkout Code
uses: actions/checkout@v4
- run: ./bootstrap
@ -66,6 +66,16 @@ jobs:
cd libjaylink-${LIBJAYLINK_VER}
./autogen.sh
echo "LIBJAYLINK_SRC=$PWD" >> $GITHUB_ENV
- name: Prepare FTD2XX
env:
FTD2XX_VER: 2.12.36.4
run: |
mkdir -p $DL_DIR && cd $DL_DIR
FTD2XX_NAME=${FTD2XX_VER}
FTD2XX_FOLDER=ftd2XX-${FTD2XX_VER}
wget "https://ftdichip.com/wp-content/uploads/2023/09/CDM-v${FTD2XX_VER}-WHQL-Certified.zip"
unzip -d ${FTD2XX_FOLDER} CDM-v${FTD2XX_VER}-WHQL-Certified.zip
echo "FTD2XX_SRC=$PWD/${FTD2XX_FOLDER}" >> $GITHUB_ENV
- name: Package OpenOCD for windows
env:
MAKE_JOBS: 2
@ -87,7 +97,7 @@ jobs:
# set env and call cross-build.sh
export OPENOCD_TAG=$OPENOCD_TAG
export OPENOCD_SRC=$PWD
export OPENOCD_CONFIG=""
export OPENOCD_CONFIG="--disable-werror"
mkdir -p $BUILD_DIR && cd $BUILD_DIR
bash $OPENOCD_SRC/contrib/cross-build.sh $HOST
# add missing dlls

View File

@ -42,6 +42,7 @@ WORK_DIR=$PWD
: ${LIBFTDI_SRC:=/path/to/libftdi}
: ${CAPSTONE_SRC:=/path/to/capstone}
: ${LIBJAYLINK_SRC:=/path/to/libjaylink}
: ${FTD2XX_SRC:=/path/to/ftd2xx}
OPENOCD_SRC=`readlink -m $OPENOCD_SRC`
LIBUSB1_SRC=`readlink -m $LIBUSB1_SRC`
@ -49,6 +50,7 @@ HIDAPI_SRC=`readlink -m $HIDAPI_SRC`
LIBFTDI_SRC=`readlink -m $LIBFTDI_SRC`
CAPSTONE_SRC=`readlink -m $CAPSTONE_SRC`
LIBJAYLINK_SRC=`readlink -m $LIBJAYLINK_SRC`
FTD2XX_SRC=`readlink -m $FTD2XX_SRC`
HOST_TRIPLET=$1
BUILD_DIR=$WORK_DIR/$HOST_TRIPLET-build
@ -170,6 +172,13 @@ if [ -d $LIBJAYLINK_SRC ] ; then
$LIBJAYLINK_CONFIG
make -j $MAKE_JOBS
make install DESTDIR=$SYSROOT
# ftd2xx copy to sysroot
if [ -d $FTD2XX_SRC ] ; then
FTD2XX_LIB_SRC=${FTD2XX_SRC}/amd64
if [[ "$HOST_TRIPLET" == *"w32"* ]] ; then
FTD2XX_LIB_SRC=${FTD2XX_SRC}/i386
fi
cp -f ${FTD2XX_LIB_SRC}/* $SYSROOT/usr/lib/
fi
# OpenOCD build & install into sysroot