Skip to content

Commit d548060

Browse files
committed
add support for linux_arm_7:
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 3b0584c commit d548060

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
@@ -138,13 +138,20 @@ tasks:
138138
docker run -v `pwd`/..:/home/build -w /home/build \
139139
-e CGO_ENABLED=1 \
140140
{{.CONTAINER}}:{{.CONTAINER_TAG}} \
141-
--build-cmd "{{.BUILD_COMMAND}}" \
141+
--build-cmd "{{.BUILD_LIBUSB}}{{.BUILD_COMMAND}}" \
142142
-p "{{.BUILD_PLATFORM}}"
143143
144144
tar cz {{.PLATFORM_DIR}} -f {{.PACKAGE_NAME}}
145145
146146
vars:
147147
PLATFORM_DIR: "{{.PROJECT_NAME}}_linux_arm_7"
148+
BUILD_LIBUSB: >
149+
curl -L https://github.com/libusb/libusb/releases/download/v1.0.26/libusb-1.0.26.tar.bz2 | tar xj &&
150+
cd libusb-1.0.26/ &&
151+
./configure --with-pic --disable-udev --enable-static --disable-shared --host=arm-linux-gnueabihf &&
152+
make -j"$(nproc)" &&
153+
make install &&
154+
cd .. &&
148155
BUILD_COMMAND: "go build -o {{.DIST_DIR}}/{{.PLATFORM_DIR}}/{{.PROJECT_NAME}} {{.LDFLAGS}}"
149156
BUILD_PLATFORM: "linux/armv7"
150157
CONTAINER_TAG: "{{.GO_VERSION}}-armhf"

0 commit comments

Comments
 (0)