Skip to content

Commit 3b0584c

Browse files
committed
add support for linux_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 efae772 commit 3b0584c

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
@@ -108,13 +108,20 @@ tasks:
108108
docker run -v `pwd`/..:/home/build -w /home/build \
109109
-e CGO_ENABLED=1 \
110110
{{.CONTAINER}}:{{.CONTAINER_TAG}} \
111-
--build-cmd "{{.BUILD_COMMAND}}" \
111+
--build-cmd "{{.BUILD_LIBUSB}}{{.BUILD_COMMAND}}" \
112112
-p "{{.BUILD_PLATFORM}}"
113113
114114
tar cz {{.PLATFORM_DIR}} -f {{.PACKAGE_NAME}}
115115
116116
vars:
117117
PLATFORM_DIR: "{{.PROJECT_NAME}}_linux_amd64"
118+
BUILD_LIBUSB: >
119+
curl -L https://github.com/libusb/libusb/releases/download/v1.0.26/libusb-1.0.26.tar.bz2 | tar xj &&
120+
cd libusb-1.0.26/ &&
121+
./configure --with-pic --disable-udev --enable-static --disable-shared &&
122+
make -j"$(nproc)" &&
123+
make install &&
124+
cd .. &&
118125
BUILD_COMMAND: "go build -o {{.DIST_DIR}}/{{.PLATFORM_DIR}}/{{.PROJECT_NAME}} {{.LDFLAGS}}"
119126
BUILD_PLATFORM: "linux/amd64"
120127
CONTAINER_TAG: "{{.GO_VERSION}}-main"

0 commit comments

Comments
 (0)