Skip to content

Commit 0688928

Browse files
committed
set PKG_CONFIG_ALLOW_CROSS and PKG_CONFIG_PATH for cross builds
1 parent 49e2f82 commit 0688928

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

.github/workflows/package.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,16 @@ jobs:
124124
# and can't co-install with the host's amd64 copy; let the target arch's version win
125125
sudo apt-get install -y -o Dpkg::Options::=--force-overwrite \
126126
libpcap-dev:${{ matrix.arch }} libasound2-dev:${{ matrix.arch }}
127+
# point pkg-config at the target arch's .pc files so -sys build scripts cross-compile
128+
case "${{ matrix.arch }}" in
129+
i386) triple=i386-linux-gnu ;;
130+
armhf) triple=arm-linux-gnueabihf ;;
131+
arm64) triple=aarch64-linux-gnu ;;
132+
esac
133+
{
134+
echo "PKG_CONFIG_ALLOW_CROSS=1"
135+
echo "PKG_CONFIG_PATH=/usr/lib/$triple/pkgconfig"
136+
} >> "$GITHUB_ENV"
127137
128138
# build against glibc 2.28 so releases keep running on older distros (fixes #1256)
129139
- name: Build binary (Linux)

0 commit comments

Comments
 (0)