2 Commits

Author SHA1 Message Date
Joakim Hulthe
ddb3ed3699 Add mullvad-vpn-slint APKBUILD 2026-03-28 19:32:23 +01:00
Joakim Hulthe
16c9d48541 add scripts to build alpine packages with podman 2026-03-28 19:31:56 +01:00
9 changed files with 212 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 by podma, 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"

View File

@@ -0,0 +1,98 @@
# Contributor:
# Maintainer:
pkgname=mullvad-slint
pkgver=2026.1_git
pkgrel=0
pkgdesc="Mullvad VPN GUI"
url="https://mullvad.net/"
arch="$(uname -m)"
license="GPL-3-or-later"
# TODO: maybe depend on mullvad-vpn-daemon?
depends="
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
"
makedepends="
rustup
build-base
musl-dev
gcc
cmake
make
pkgconfig
perl
python3
curl
git
llvm
clang
clang-libclang
protobuf-dev
libc-dev
linux-headers
"
checkdepends=""
install=""
subpackages=""
source=""
builddir="$srcdir/"
options="net"
build() {
# rustup-init -y --default-toolchain stable
source "$HOME/.cargo/env"
cd "$startdir/mullvadvpn-app"
# rustup default stable
local target="$(rustup +stable show active-toolchain | sed 's/^[^-]*-//' | grep -o "^[^ ]*")"
# * Force the `stable` toolchain since it's installed in the container.
# We don't wan't to needlessly download rust while building.
# * Disable `tray-icon` feature. (TODO: figure out how to compile with libdbus)
# * Specify `--target` so that the final binary ends up in target/<target>/release.
cargo +stable build --release --locked \
--target "$target" \
--no-default-features --features map \
-p mullvad-slint
}
package() {
local cargo_target_dir="${CARGO_TARGET_DIR:-$startdir/mullvadvpn-app/target}"
local target="$(rustup +stable show active-toolchain | sed 's/^[^-]*-//' | grep -o "^[^ ]*")"
# TODO: .desktop
# TODO: icon
install -m755 -D "$cargo_target_dir/$target/release/$pkgname" \
"$pkgdir"/usr/bin/"$pkgname"
}

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