From 8759e67c12e8fa24873a2162fa2c77310a703bdf Mon Sep 17 00:00:00 2001 From: Bernhard Nebel Date: Fri, 19 Dec 2025 14:42:36 +0100 Subject: [PATCH 1/4] Enhanced CI workflow: Problems fixed and Linus ARM and macOS Intel added --- .github/workflows/build.yml | 87 ++++++++++++++++++++++++++++++++++--- 1 file changed, 82 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 99475b9..cefbdea 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,5 +1,5 @@ name: Build Binaries -on: [push, pull_request] +on: [push, pull_request, workflow_dispatch] jobs: build-win64: @@ -61,7 +61,7 @@ jobs: with: name: AVaRICE Windows 64-bit path: avarice_installed - build-lin64: + build-linux-intel64: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -86,22 +86,60 @@ jobs: with: name: AVaRICE Linux 64-bit path: avarice.tar.gz + build-linux-arm64: + runs-on: ubuntu-24.04-arm + steps: + - uses: actions/checkout@v4 + - name: Install Dependencies + run: sudo apt-get update && sudo apt-get install -y build-essential make autotools-dev automake binutils-dev libusb-dev libhidapi-dev + - name: Build AVaRICE + run: | + ./Bootstrap + ./configure --enable-target-programming + make -j$NUMBER_OF_PROCESSORS + mkdir avarice_installed + make install DESTDIR=$(pwd)/avarice_installed/ + file avarice_installed/usr/local/bin/* + ldd avarice_installed/usr/local/bin/avarice + - name: Run AVaRICE + run: | + avarice_installed/usr/local/bin/avarice --version + avarice_installed/usr/local/bin/avarice --known-devices || true + - name: Tar files + run: tar -cvf avarice.tar.gz -C avarice_installed . + - uses: actions/upload-artifact@v4 + with: + name: AVaRICE Linux 64-bit + path: avarice.tar.gz build-darwin-arm64: runs-on: macos-latest steps: - uses: actions/checkout@v4 - name: Install Dependencies run: | - brew install gcc binutils autoconf automake mk-configure libusb libusb-compat hidapi + brew install binutils autoconf automake mk-configure libusb-compat hidapi - name: Build AVaRICE run: | ./Bootstrap + # note: we use a constant hidapi include path instead of "pkg-config --cflags hidapi" because that path include "/hidapi" at the end + # through which in turn "hidapi/hidapi.h" will not be found (it would have to be just "hidapi.h"). + # Actually, we now remove the trailing hidapi in order to account for version changes + INC=$(pkg-config --cflags hidapi) + INC=${INC%"hidapi"} + export CFLAGS="$(pkg-config --cflags libusb) $(pkg-config --cflags libusb-1.0) $INC" + export CXXFLAGS="$(pkg-config --cflags libusb) $(pkg-config --cflags libusb-1.0) $INC" + export LDFLAGS="$(pkg-config --libs-only-L libusb) $(pkg-config --libs-only-L libusb-1.0) $(pkg-config --libs-only-L hidapi)" ./configure - make -j3 + make -j$NUMBER_OF_PROCESSORS mkdir avarice_installed make install DESTDIR=$(pwd)/avarice_installed/ ls -R avarice_installed otool -L avarice_installed/usr/local/bin/avarice + install_name_tool -change /opt/homebrew/opt/hidapi/lib/libhidapi.0.dylib @executable_path/./libhidapi.0.dylib ./avarice_installed/usr/local/bin/avarice + install_name_tool -change /opt/homebrew/opt/libusb-compat/lib/libusb-0.1.4.dylib @executable_path/./libusb-0.1.4.dylib ./avarice_installed/usr/local/bin/avarice + cp /opt/homebrew/opt/hidapi/lib/libhidapi.0.dylib ./avarice_installed/usr/local/bin/. + cp /opt/homebrew/opt/libusb-compat/lib/libusb-0.1.4.dylib ./avarice_installed/usr/local/bin/. + otool -L avarice_installed/usr/local/bin/avarice - name: Run AVaRICE run: | avarice_installed/usr/local/bin/avarice --version @@ -111,4 +149,43 @@ jobs: - uses: actions/upload-artifact@v4 with: name: AVaRICE Mac OS ARM 64-bit - path: avarice.tar.gz \ No newline at end of file + path: avarice.tar.gz + build-darwin-intel64: + runs-on: macos-15-intel + steps: + - uses: actions/checkout@v4 + - name: Install Dependencies + run: | + brew install binutils autoconf automake mk-configure libusb-compat hidapi + - name: Build AVaRICE + run: | + ./Bootstrap + # note: we use a constant hidapi include path instead of "pkg-config --cflags hidapi" because that path include "/hidapi" at the end + # through which in turn "hidapi/hidapi.h" will not be found (it would have to be just "hidapi.h"). + # Actually, we now remove the trailing hidapi in order to account for version changes + INC=$(pkg-config --cflags hidapi) + INC=${INC%"hidapi"} + export CFLAGS="$(pkg-config --cflags libusb) $(pkg-config --cflags libusb-1.0) $INC" + export CXXFLAGS="$(pkg-config --cflags libusb) $(pkg-config --cflags libusb-1.0) $INC" + export LDFLAGS="$(pkg-config --libs-only-L libusb) $(pkg-config --libs-only-L libusb-1.0) $(pkg-config --libs-only-L hidapi)" + ./configure + make -j$NUMBER_OF_PROCESSORS + mkdir avarice_installed + make install DESTDIR=$(pwd)/avarice_installed/ + ls -R avarice_installed + otool -L avarice_installed/usr/local/bin/avarice + install_name_tool -change /usr/local/opt/hidapi/lib/libhidapi.0.dylib @executable_path/./libhidapi.0.dylib ./avarice_installed/usr/local/bin/avarice + install_name_tool -change /usr/local/opt/libusb-compat/lib/libusb-0.1.4.dylib @executable_path/./libusb-0.1.4.dylib ./avarice_installed/usr/local/bin/avarice + cp /usr/local/opt/hidapi/lib/libhidapi.0.dylib ./avarice_installed/usr/local/bin/. + cp /usr/local/opt/libusb-compat/lib/libusb-0.1.4.dylib ./avarice_installed/usr/local/bin/. + otool -L avarice_installed/usr/local/bin/avarice + - name: Run AVaRICE + run: | + avarice_installed/usr/local/bin/avarice --version + avarice_installed/usr/local/bin/avarice --known-devices || true + - name: Tar files + run: tar -cvf avarice.tar.gz -C avarice_installed . + - uses: actions/upload-artifact@v4 + with: + name: AVaRICE Mac OS Intel 64-bit + path: avarice.tar.gz From 285731c448e47532a2532373fc0f87cf7290ae13 Mon Sep 17 00:00:00 2001 From: Bernhard Nebel Date: Fri, 19 Dec 2025 14:45:22 +0100 Subject: [PATCH 2/4] In workflow: Names for Linux artifacts adapted --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cefbdea..63bc5bf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -84,7 +84,7 @@ jobs: run: tar -cvf avarice.tar.gz -C avarice_installed . - uses: actions/upload-artifact@v4 with: - name: AVaRICE Linux 64-bit + name: AVaRICE Linux Intel 64-bit path: avarice.tar.gz build-linux-arm64: runs-on: ubuntu-24.04-arm @@ -109,7 +109,7 @@ jobs: run: tar -cvf avarice.tar.gz -C avarice_installed . - uses: actions/upload-artifact@v4 with: - name: AVaRICE Linux 64-bit + name: AVaRICE Linux ARM 64-bit path: avarice.tar.gz build-darwin-arm64: runs-on: macos-latest From b4dc2b98de25c298a8d41feac433a0f44810c957 Mon Sep 17 00:00:00 2001 From: Bernhard Nebel Date: Fri, 19 Dec 2025 14:55:12 +0100 Subject: [PATCH 3/4] fixed extern declaration of getenv in gnu_getopt.c --- src/gnu_getopt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gnu_getopt.c b/src/gnu_getopt.c index ff2639c..9ee8eb1 100644 --- a/src/gnu_getopt.c +++ b/src/gnu_getopt.c @@ -216,7 +216,7 @@ static char *posixly_correct; whose names are inconsistent. */ #ifndef getenv -extern char *getenv (); +extern char *getenv (const char *); #endif static char * From db2e13f6f52c07940075eeb45e7a371666b4de36 Mon Sep 17 00:00:00 2001 From: Bernhard Nebel Date: Fri, 19 Dec 2025 15:53:30 +0100 Subject: [PATCH 4/4] CI workflow: added msys-usb-1.0.dll to set of libs --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 63bc5bf..a3c019c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,6 +48,7 @@ jobs: file avarice_installed/usr/bin/* ldd avarice_installed/usr/bin/avarice cp /mingw64/bin/libusb-1.0.dll avarice_installed/usr/bin/. + cp /mingw64/bin/libusb-1.0.dll avarice_installed/usr/bin/msys-usb-1.0.dll cp /usr/bin/msys-2.0.dll avarice_installed/usr/bin/. cp /usr/bin/msys-stdc++-6.dll avarice_installed/usr/bin/. cp /usr/bin/msys-gcc_s-seh-1.dll avarice_installed/usr/bin/.