Skip to content

Commit efae772

Browse files
committed
add support for windows_386:
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 9a4bc91 commit efae772

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
@@ -32,13 +32,20 @@ tasks:
3232
docker run -v `pwd`/..:/home/build -w /home/build \
3333
-e CGO_ENABLED=1 \
3434
{{.CONTAINER}}:{{.CONTAINER_TAG}} \
35-
--build-cmd "{{.BUILD_COMMAND}}" \
35+
--build-cmd "{{.BUILD_LIBUSB}}{{.BUILD_COMMAND}}" \
3636
-p "{{.BUILD_PLATFORM}}"
3737
3838
zip {{.PACKAGE_NAME}} {{.PLATFORM_DIR}}/{{.PROJECT_NAME}}.exe {{.PLATFORM_DIR}}/LICENSE.txt
3939
4040
vars:
4141
PLATFORM_DIR: "{{.PROJECT_NAME}}_windows_386"
42+
BUILD_LIBUSB: >
43+
curl -L https://github.com/libusb/libusb/releases/download/v1.0.26/libusb-1.0.26.tar.bz2 | tar xj &&
44+
cd libusb-1.0.26/ &&
45+
./configure --with-pic --disable-udev --enable-static --disable-shared --host=i686-w64-mingw32 &&
46+
make -j"$(nproc)" &&
47+
make install &&
48+
cd .. &&
4249
BUILD_COMMAND: "go build -o {{.DIST_DIR}}/{{.PLATFORM_DIR}}/{{.PROJECT_NAME}}.exe {{.LDFLAGS}}"
4350
BUILD_PLATFORM: "windows/386"
4451
CONTAINER_TAG: "{{.GO_VERSION}}-main"

0 commit comments

Comments
 (0)