Skip to content

Commit 3d11436

Browse files
committed
add support for darwin_amd64:
compile with the right cross-toolchain and intall libusb inside the container the `make install` places `libusb.a` in `/usr/local/include/libusb-1.0` while the `.h` file in `/usr/local/lib/`
1 parent 21cff41 commit 3d11436

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

DistTasks.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,13 +193,20 @@ tasks:
193193
docker run -v `pwd`/..:/home/build -w /home/build \
194194
-e CGO_ENABLED=1 \
195195
{{.CONTAINER}}:{{.CONTAINER_TAG}} \
196-
--build-cmd "{{.BUILD_COMMAND}}" \
196+
--build-cmd "{{.BUILD_LIBUSB}}{{.BUILD_COMMAND}}" \
197197
-p "{{.BUILD_PLATFORM}}"
198198
199199
tar cz {{.PLATFORM_DIR}} -f {{.PACKAGE_NAME}}
200200
201201
vars:
202202
PLATFORM_DIR: "{{.PROJECT_NAME}}_osx_darwin_amd64"
203+
BUILD_LIBUSB: >
204+
curl -L https://github.com/libusb/libusb/releases/download/v1.0.26/libusb-1.0.26.tar.bz2 | tar xj &&
205+
cd libusb-1.0.26/ &&
206+
./configure --with-pic --disable-udev --enable-static --disable-shared --host=x86_64-apple-darwin20.4 &&
207+
make -j"$(nproc)" &&
208+
make install &&
209+
cd .. &&
203210
BUILD_COMMAND: "go build -o {{.DIST_DIR}}/{{.PLATFORM_DIR}}/{{.PROJECT_NAME}} {{.LDFLAGS}}"
204211
BUILD_PLATFORM: "darwin/amd64"
205212
# We are experiencing the following error with macOS_64bit build:

0 commit comments

Comments
 (0)