Skip to content

Commit 1018eeb

Browse files
committed
add support for linux_amd32:
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 d9ed666 commit 1018eeb

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
@@ -92,13 +92,20 @@ tasks:
9292
docker run -v `pwd`/..:/home/build -w /home/build \
9393
-e CGO_ENABLED=1 \
9494
{{.CONTAINER}}:{{.CONTAINER_TAG}} \
95-
--build-cmd "{{.BUILD_COMMAND}}" \
95+
--build-cmd "{{.BUILD_LIBUSB}}{{.BUILD_COMMAND}}" \
9696
-p "{{.BUILD_PLATFORM}}"
9797
9898
tar cz {{.PLATFORM_DIR}} -f {{.PACKAGE_NAME}}
9999
100100
vars:
101101
PLATFORM_DIR: "{{.PROJECT_NAME}}_linux_amd32"
102+
BUILD_LIBUSB: >
103+
curl -L https://github.com/libusb/libusb/releases/download/v1.0.26/libusb-1.0.26.tar.bz2 | tar xj &&
104+
cd libusb-1.0.26/ &&
105+
CFLAGS=-m32 CXXFLAGS=-m32 ./configure --with-pic --disable-udev --enable-static --disable-shared --host=i386-linux-gnu &&
106+
make -j"$(nproc)" &&
107+
make install &&
108+
cd .. &&
102109
BUILD_COMMAND: "go build -o {{.DIST_DIR}}/{{.PLATFORM_DIR}}/{{.PROJECT_NAME}} {{.LDFLAGS}}"
103110
BUILD_PLATFORM: "linux/386"
104111
CONTAINER_TAG: "{{.GO_VERSION}}-main"

0 commit comments

Comments
 (0)