Add scripts to build alpine packages with podman

This commit is contained in:
Joakim Hulthe
2026-03-30 10:19:22 +02:00
parent efbc00a679
commit d4e1042d3c
8 changed files with 114 additions and 0 deletions

1
.dockerignore Normal file
View File

@@ -0,0 +1 @@
*

4
.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
packages/*
!packages/.gitkeep
target/*
!target/.gitkeep

64
Dockerfile Normal file
View File

@@ -0,0 +1,64 @@
FROM alpine:3.21
# Install build dependencies
# TODO: trim dependencies?
RUN apk update && apk add \
build-base abuild \
rustup \
build-base \
musl-dev \
gcc \
cmake \
make \
pkgconfig \
perl \
python3 \
curl \
git \
llvm \
clang \
clang-libclang \
protobuf-dev \
libc-dev \
linux-headers \
freetype-dev \
freetype-static \
fontconfig-dev \
fontconfig-static \
bzip2-dev \
bzip2-static \
brotli-dev \
brotli-static \
expat-dev \
expat-static \
libx11-dev \
libxcursor-dev \
libxkbcommon-dev \
libxkbcommon-static \
wayland-dev \
wayland-libs-client \
wayland-libs-server \
wayland-static \
openssl-dev \
openssl-libs-static \
zlib-dev \
zlib-static \
libpng-dev \
libpng-static \
libwebp-dev \
libwebp-static \
tiff-dev \
libjpeg-turbo-dev \
libjpeg-turbo-static
RUN rustup-init -y --default-toolchain stable
# Set pkg-config to use static libraries
ENV PKG_CONFIG_ALLOW_STATIC=1
ENV PKG_CONFIG_ALL_STATIC=1
# Slint/winit does not work when statically compiled
ENV RUSTFLAGS="-C target-feature=-crt-static"
WORKDIR /build

21
README.md Normal file
View File

@@ -0,0 +1,21 @@
# Alpine packages for mullvad-vpn
## Setup
1. Install `abuild`
2. Create keys: `abuild-keygen`
The keys will end up in ~/.abuild/, and will be mounted into the build container.
3. Remember to keep keys around.
## Building
```
./podman-build.sh ./mullvad-vpn-slint
```
## Updating
1. Update submodule
2. Either update `pkgver`. If so, set `pkgrel` to 0,
or bump `pkgrel` by 1.
3. `git commit -m "update packages"`

1
abuild.conf Normal file
View File

@@ -0,0 +1 @@
PACKAGER_PRIVKEY="/key.rsa"

0
packages/.gitkeep Normal file
View File

23
podman-build.sh Normal file
View File

@@ -0,0 +1,23 @@
#!/bin/sh
set -ex
cd "$(dirname "$0")"
package="$1"
builder_image="mullvad-slint-musl-builder"
. "$HOME/.abuild/abuild.conf"
podman build . -f Dockerfile -t "$builder_image"
podman run --rm \
-v "./$package":/build \
-v ./abuild.conf:/root/.abuild/abuild.conf:ro \
-v "$PACKAGER_PRIVKEY":/key.rsa:ro \
-v "$PACKAGER_PRIVKEY.pub":/key.rsa.pub:ro \
-v "$PACKAGER_PRIVKEY.pub":/etc/apk/keys/key.rsa.pub:ro \
-v ./target:/cargo-target \
-v ./packages:/root/packages \
-e "CARGO_TARGET_DIR=/cargo-target" \
-it \
"$builder_image" \
abuild -F

0
target/.gitkeep Normal file
View File