Skip to content

Commit 9a4bc91

Browse files
committed
add support for linux_arm_64:
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 90a5c64 commit 9a4bc91

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
@@ -177,13 +177,20 @@ tasks:
177177
docker run -v `pwd`/..:/home/build -w /home/build \
178178
-e CGO_ENABLED=1 \
179179
{{.CONTAINER}}:{{.CONTAINER_TAG}} \
180-
--build-cmd "{{.BUILD_COMMAND}}" \
180+
--build-cmd "{{.BUILD_LIBUSB}}{{.BUILD_COMMAND}}" \
181181
-p "{{.BUILD_PLATFORM}}"
182182
183183
tar cz {{.PLATFORM_DIR}} -f {{.PACKAGE_NAME}}
184184
185185
vars:
186186
PLATFORM_DIR: "{{.PROJECT_NAME}}_linux_arm_64"
187+
BUILD_LIBUSB: >
188+
curl -L https://github.com/libusb/libusb/releases/download/v1.0.26/libusb-1.0.26.tar.bz2 | tar xj &&
189+
cd libusb-1.0.26/ &&
190+
./configure --with-pic --disable-udev --enable-static --disable-shared --host=aarch64-linux-gnu &&
191+
make -j"$(nproc)" &&
192+
make install &&
193+
cd .. &&
187194
BUILD_COMMAND: "go build -o {{.DIST_DIR}}/{{.PLATFORM_DIR}}/{{.PROJECT_NAME}} {{.LDFLAGS}}"
188195
BUILD_PLATFORM: "linux/arm64"
189196
CONTAINER_TAG: "{{.GO_VERSION}}-arm"

0 commit comments

Comments
 (0)