Usage example for goreleaser-cross
Demonstrates how to cross-compile Go project with CGO dependencies.
Project depends on C/C++ libraries libftdi1, libusb-1.0, opencv4.
- Executable will try to detect FTDI 2232 boards with VID: 0x0403 and PID: 0x6010 and open channel 0.
- Then it lists serial number of all detected boards.
- Afterwards it will try to open camera with OpenCV and take test picture into your terminal
Example of output
version: 0.0.4
detecting ftdi devices
detected 1 device(s) with vid: 0x0403 pid: 0x6010:
[0] serial: FT4AYSJC
detecting camera using opencv...
show your awesome face and smile 😺
capturing in 3..2..1
<your picture is here>
you've been captured!!!!
Cross-compiles for targets:
- Darwin/amd64
Note
The Linux/armhf target is currently disabled. The bundled sysroot ships
Raspberry Pi Buster glibc (~2.31), which is incompatible with the
gcc-13 / glibc-2.36 link symbols emitted by the modern
goreleaser-cross toolchain. To re-enable it, the sysroot needs to be
rebuilt against a newer Linux base.
This example is based on real working solution where Macbook is dev machine and RPI4 is end target.
Sysroots are located in separate repo and added as submodule to current repo
- Darwin sysroot is created by simply copying libraries from
homebrew - Linux sysroot is created from RPI4 using this script