Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use libnl3-static from alpine #29

Merged
merged 1 commit into from
Oct 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 2 additions & 25 deletions .github/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,9 @@ set -x

# General updates
apk update
apk add cmake openssl openssl-dev openssl-libs-static linux-headers ninja-is-really-ninja alpine-sdk runuser sudo sed

# Setup build environment
addgroup $(whoami) abuild
mkdir -p /var/cache/distfiles
chmod a+w /var/cache/distfiles
chgrp abuild /var/cache/distfiles
chmod g+w /var/cache/distfiles
cwd=$(pwd)

# Create user to run abuild
adduser -G abuild -g "Alpine Package Builder" -s /bin/ash -D abuilder
echo "abuilder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers

# Build static libnl3
runuser -u abuilder -- /usr/bin/abuild-keygen -n -a -i -b 4096
cd /home/abuilder
runuser -u abuilder -- git clone https://gitlab.alpinelinux.org/alpine/aports.git --depth 1
cd /home/abuilder/aports/main/libnl3
# runuser -u abuilder -- /bin/sed -i "s/subpackages=\"/subpackages=\"\$pkgname-static /" APKBUILD
runuser -u abuilder -- /bin/sed -i "s/--disable-static/--enable-static/" APKBUILD
runuser -u abuilder -- /usr/bin/abuild -r
apk add /home/abuilder/packages/main/$(abuild -A)/libnl3*
apk add cmake openssl openssl-dev openssl-libs-static linux-headers ninja-is-really-ninja alpine-sdk runuser sudo sed libnl3-static libnl3-dev

# Build static DPITunnel
cd ${cwd}
cmake -B build -DCMAKE_BUILD_TYPE=RELEASE -DSTATIC_BINARY=true -G Ninja .
cmake -S . -B build -DCMAKE_BUILD_TYPE=RELEASE -DSTATIC_BINARY=true -G Ninja
cmake --build build