Skip to content

Commit 6ca2ef5

Browse files
authored
Improved workflow (#116)
* Enhanced CI workflow: Problems fixed and Linus ARM and macOS Intel added * In workflow: Names for Linux artifacts adapted * fixed extern declaration of getenv in gnu_getopt.c * CI workflow: added msys-usb-1.0.dll to set of libs
1 parent 019a951 commit 6ca2ef5

File tree

2 files changed

+85
-7
lines changed

2 files changed

+85
-7
lines changed

.github/workflows/build.yml

Lines changed: 84 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Build Binaries
2-
on: [push, pull_request]
2+
on: [push, pull_request, workflow_dispatch]
33

44
jobs:
55
build-win64:
@@ -48,6 +48,7 @@ jobs:
4848
file avarice_installed/usr/bin/*
4949
ldd avarice_installed/usr/bin/avarice
5050
cp /mingw64/bin/libusb-1.0.dll avarice_installed/usr/bin/.
51+
cp /mingw64/bin/libusb-1.0.dll avarice_installed/usr/bin/msys-usb-1.0.dll
5152
cp /usr/bin/msys-2.0.dll avarice_installed/usr/bin/.
5253
cp /usr/bin/msys-stdc++-6.dll avarice_installed/usr/bin/.
5354
cp /usr/bin/msys-gcc_s-seh-1.dll avarice_installed/usr/bin/.
@@ -61,7 +62,7 @@ jobs:
6162
with:
6263
name: AVaRICE Windows 64-bit
6364
path: avarice_installed
64-
build-lin64:
65+
build-linux-intel64:
6566
runs-on: ubuntu-latest
6667
steps:
6768
- uses: actions/checkout@v4
@@ -84,24 +85,62 @@ jobs:
8485
run: tar -cvf avarice.tar.gz -C avarice_installed .
8586
- uses: actions/upload-artifact@v4
8687
with:
87-
name: AVaRICE Linux 64-bit
88+
name: AVaRICE Linux Intel 64-bit
89+
path: avarice.tar.gz
90+
build-linux-arm64:
91+
runs-on: ubuntu-24.04-arm
92+
steps:
93+
- uses: actions/checkout@v4
94+
- name: Install Dependencies
95+
run: sudo apt-get update && sudo apt-get install -y build-essential make autotools-dev automake binutils-dev libusb-dev libhidapi-dev
96+
- name: Build AVaRICE
97+
run: |
98+
./Bootstrap
99+
./configure --enable-target-programming
100+
make -j$NUMBER_OF_PROCESSORS
101+
mkdir avarice_installed
102+
make install DESTDIR=$(pwd)/avarice_installed/
103+
file avarice_installed/usr/local/bin/*
104+
ldd avarice_installed/usr/local/bin/avarice
105+
- name: Run AVaRICE
106+
run: |
107+
avarice_installed/usr/local/bin/avarice --version
108+
avarice_installed/usr/local/bin/avarice --known-devices || true
109+
- name: Tar files
110+
run: tar -cvf avarice.tar.gz -C avarice_installed .
111+
- uses: actions/upload-artifact@v4
112+
with:
113+
name: AVaRICE Linux ARM 64-bit
88114
path: avarice.tar.gz
89115
build-darwin-arm64:
90116
runs-on: macos-latest
91117
steps:
92118
- uses: actions/checkout@v4
93119
- name: Install Dependencies
94120
run: |
95-
brew install gcc binutils autoconf automake mk-configure libusb libusb-compat hidapi
121+
brew install binutils autoconf automake mk-configure libusb-compat hidapi
96122
- name: Build AVaRICE
97123
run: |
98124
./Bootstrap
125+
# note: we use a constant hidapi include path instead of "pkg-config --cflags hidapi" because that path include "/hidapi" at the end
126+
# through which in turn "hidapi/hidapi.h" will not be found (it would have to be just "hidapi.h").
127+
# Actually, we now remove the trailing hidapi in order to account for version changes
128+
INC=$(pkg-config --cflags hidapi)
129+
INC=${INC%"hidapi"}
130+
export CFLAGS="$(pkg-config --cflags libusb) $(pkg-config --cflags libusb-1.0) $INC"
131+
export CXXFLAGS="$(pkg-config --cflags libusb) $(pkg-config --cflags libusb-1.0) $INC"
132+
export LDFLAGS="$(pkg-config --libs-only-L libusb) $(pkg-config --libs-only-L libusb-1.0) $(pkg-config --libs-only-L hidapi)"
99133
./configure
100-
make -j3
134+
make -j$NUMBER_OF_PROCESSORS
101135
mkdir avarice_installed
102136
make install DESTDIR=$(pwd)/avarice_installed/
103137
ls -R avarice_installed
104138
otool -L avarice_installed/usr/local/bin/avarice
139+
install_name_tool -change /opt/homebrew/opt/hidapi/lib/libhidapi.0.dylib @executable_path/./libhidapi.0.dylib ./avarice_installed/usr/local/bin/avarice
140+
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
141+
cp /opt/homebrew/opt/hidapi/lib/libhidapi.0.dylib ./avarice_installed/usr/local/bin/.
142+
cp /opt/homebrew/opt/libusb-compat/lib/libusb-0.1.4.dylib ./avarice_installed/usr/local/bin/.
143+
otool -L avarice_installed/usr/local/bin/avarice
105144
- name: Run AVaRICE
106145
run: |
107146
avarice_installed/usr/local/bin/avarice --version
@@ -111,4 +150,43 @@ jobs:
111150
- uses: actions/upload-artifact@v4
112151
with:
113152
name: AVaRICE Mac OS ARM 64-bit
114-
path: avarice.tar.gz
153+
path: avarice.tar.gz
154+
build-darwin-intel64:
155+
runs-on: macos-15-intel
156+
steps:
157+
- uses: actions/checkout@v4
158+
- name: Install Dependencies
159+
run: |
160+
brew install binutils autoconf automake mk-configure libusb-compat hidapi
161+
- name: Build AVaRICE
162+
run: |
163+
./Bootstrap
164+
# note: we use a constant hidapi include path instead of "pkg-config --cflags hidapi" because that path include "/hidapi" at the end
165+
# through which in turn "hidapi/hidapi.h" will not be found (it would have to be just "hidapi.h").
166+
# Actually, we now remove the trailing hidapi in order to account for version changes
167+
INC=$(pkg-config --cflags hidapi)
168+
INC=${INC%"hidapi"}
169+
export CFLAGS="$(pkg-config --cflags libusb) $(pkg-config --cflags libusb-1.0) $INC"
170+
export CXXFLAGS="$(pkg-config --cflags libusb) $(pkg-config --cflags libusb-1.0) $INC"
171+
export LDFLAGS="$(pkg-config --libs-only-L libusb) $(pkg-config --libs-only-L libusb-1.0) $(pkg-config --libs-only-L hidapi)"
172+
./configure
173+
make -j$NUMBER_OF_PROCESSORS
174+
mkdir avarice_installed
175+
make install DESTDIR=$(pwd)/avarice_installed/
176+
ls -R avarice_installed
177+
otool -L avarice_installed/usr/local/bin/avarice
178+
install_name_tool -change /usr/local/opt/hidapi/lib/libhidapi.0.dylib @executable_path/./libhidapi.0.dylib ./avarice_installed/usr/local/bin/avarice
179+
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
180+
cp /usr/local/opt/hidapi/lib/libhidapi.0.dylib ./avarice_installed/usr/local/bin/.
181+
cp /usr/local/opt/libusb-compat/lib/libusb-0.1.4.dylib ./avarice_installed/usr/local/bin/.
182+
otool -L avarice_installed/usr/local/bin/avarice
183+
- name: Run AVaRICE
184+
run: |
185+
avarice_installed/usr/local/bin/avarice --version
186+
avarice_installed/usr/local/bin/avarice --known-devices || true
187+
- name: Tar files
188+
run: tar -cvf avarice.tar.gz -C avarice_installed .
189+
- uses: actions/upload-artifact@v4
190+
with:
191+
name: AVaRICE Mac OS Intel 64-bit
192+
path: avarice.tar.gz

src/gnu_getopt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ static char *posixly_correct;
216216
whose names are inconsistent. */
217217

218218
#ifndef getenv
219-
extern char *getenv ();
219+
extern char *getenv (const char *);
220220
#endif
221221

222222
static char *

0 commit comments

Comments
 (0)