Skip to content

Commit d9ed666

Browse files
committed
add support for windows_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 d548060 commit d9ed666

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
@@ -62,13 +62,20 @@ tasks:
6262
docker run -v `pwd`/..:/home/build -w /home/build \
6363
-e CGO_ENABLED=1 \
6464
{{.CONTAINER}}:{{.CONTAINER_TAG}} \
65-
--build-cmd "{{.BUILD_COMMAND}}" \
65+
--build-cmd "{{.BUILD_LIBUSB}}{{.BUILD_COMMAND}}" \
6666
-p "{{.BUILD_PLATFORM}}"
6767
6868
zip {{.PACKAGE_NAME}} {{.PLATFORM_DIR}}/{{.PROJECT_NAME}}.exe {{.PLATFORM_DIR}}/LICENSE.txt
6969
7070
vars:
7171
PLATFORM_DIR: "{{.PROJECT_NAME}}_windows_amd64"
72+
BUILD_LIBUSB: >
73+
curl -L https://github.com/libusb/libusb/releases/download/v1.0.26/libusb-1.0.26.tar.bz2 | tar xj &&
74+
cd libusb-1.0.26/ &&
75+
./configure --with-pic --disable-udev --enable-static --disable-shared --host=x86_64-w64-mingw32 &&
76+
make -j"$(nproc)" &&
77+
make install &&
78+
cd .. &&
7279
BUILD_COMMAND: "go build -o {{.DIST_DIR}}/{{.PLATFORM_DIR}}/{{.PROJECT_NAME}}.exe {{.LDFLAGS}}"
7380
BUILD_PLATFORM: "windows/amd64"
7481
CONTAINER_TAG: "{{.GO_VERSION}}-main"

0 commit comments

Comments
 (0)