41 Commits

Author SHA1 Message Date
045f20a120 Make package function more compact 2026-04-26 16:40:47 +02:00
2d8dcb239a Fix review comments 2026-04-26 16:33:34 +02:00
Joakim Hulthe
3867f9acdc Don't generate relay list at build time 2026-04-24 09:23:05 +02:00
Joakim Hulthe
71776145db Don't build on loongarch64 and s390x 2026-04-24 09:09:55 +02:00
Joakim Hulthe
3f915b3120 Move relay list generation into prepare 2026-04-23 15:57:45 +02:00
Joakim Hulthe
f97907e95e Use --frozen instead of --locked 2026-04-23 15:56:29 +02:00
Joakim Hulthe
43338c3fd4 Bikeshed comments 2026-04-23 15:35:00 +02:00
Joakim Hulthe
8c8579b3f6 Move systemd stuff out of pre-deinstall 2026-04-23 15:25:50 +02:00
Joakim Hulthe
6b66146b2a Use maintainer variable 2026-04-23 14:55:15 +02:00
Joakim Hulthe
4486d6a3c1 Fix more APKBUILD issues 2026-04-23 14:46:00 +02:00
Joakim Hulthe
81862a0b80 Make APKBUILD follow style guidelines 2026-04-23 14:16:48 +02:00
Joakim Hulthe
5f355cdc1b Don't run relay_list in release mode. Debug is faster. 2026-04-23 14:03:35 +02:00
fa2c6775c0 Bikeshed comment 2026-04-23 13:57:37 +02:00
b0d79cbb26 Fix sha256sum location 2026-04-23 13:52:53 +02:00
6e88da887c Passthrough cli arguments to abuild 2026-04-23 12:25:55 +02:00
5591ae7379 Download mullvad-daemon from github 2026-04-23 12:25:48 +02:00
6e56dd1e6c Add depends to subpackages 2026-04-23 11:46:50 +02:00
c1fe3c1c9b Move mullvad-exclude into suid subpackage 2026-04-23 11:42:17 +02:00
Joakim Hulthe
7af09af8d1 Fix install-scripts, and bundle relay list 2026-04-23 11:42:08 +02:00
29043fedc1 Add wayland-dev as slint build dependency 2026-04-17 16:30:40 +02:00
6462c4e25d Update submodules to 236bbc4c 2026-04-17 16:26:59 +02:00
6899a71899 Add early-boot-blocking.service 2026-04-17 16:24:55 +02:00
3ff5cf83fc APKBUILD fixes 2026-04-12 12:52:08 +02:00
84c30e3130 Update submodule to 4470547b 2026-04-10 11:52:07 +02:00
4e232c39be Include install-scripts 2026-04-09 22:45:05 +02:00
c5383fd2c9 Work on making daemon APKBUILD follow best practices 2026-04-09 21:15:52 +02:00
374eeba758 Bump submodules to 7cd3cfe2 2026-04-09 15:32:54 +02:00
0a93fe0370 Bump submodules to 27f4b024 2026-03-31 17:26:34 +02:00
b13eac38f9 Update submodules 2026-03-30 14:52:10 +02:00
Joakim Hulthe
c92f4fbf84 Mount CARGO_HOME into build container 2026-03-30 14:46:21 +02:00
7650a60fa6 mullvad-vpn-slint: Package .desktop and icons 2026-03-30 14:38:10 +02:00
Joakim Hulthe
7aa41d7b67 Copy debian install scripts 2026-03-30 10:20:45 +02:00
Joakim Hulthe
6deccfa667 Add submodules 2026-03-30 10:20:45 +02:00
Joakim Hulthe
047680a1f3 mullvad-vpn-daemon: Add systemd subpkg 2026-03-30 10:20:45 +02:00
Joakim Hulthe
31c74fd178 mullvad-vpn-slint: Enable tray-icon feature 2026-03-30 10:20:45 +02:00
Joakim Hulthe
cf6a072724 Add APKBUILD for mullvad-vpn-daemon 2026-03-30 10:20:45 +02:00
Joakim Hulthe
89c6da8e8b Add docker-build.sh 2026-03-30 10:20:45 +02:00
Joakim Hulthe
f2928898bf APKBUILD: small fixes 2026-03-30 10:20:45 +02:00
Joakim Hulthe
2f47541f62 mullvad-vpn-slint: Remove unnecessary dependencies 2026-03-30 10:20:45 +02:00
Joakim Hulthe
a57cea5bcb Add mullvad-vpn-slint APKBUILD 2026-03-30 10:20:45 +02:00
Joakim Hulthe
d4e1042d3c Add scripts to build alpine packages with podman 2026-03-30 10:20:43 +02:00
15 changed files with 222 additions and 96 deletions

4
.gitmodules vendored Normal file
View File

@@ -0,0 +1,4 @@
[submodule "mullvad-vpn-daemon/mullvadvpn-app"]
path = mullvad-vpn-daemon/mullvadvpn-app
url = git@github.com:mullvad/mullvadvpn-app-priv.git
branch = poc-slint

View File

@@ -6,17 +6,16 @@ RUN apk update && apk add \
build-base \ build-base \
abuild \ abuild \
git \ git \
rustup \ rust \
musl-dev \ cargo-auditable \
pkgconfig \ pkgconfig \
protobuf-dev \ protobuf-dev \
protobuf-dev \ protobuf-dev \
libmnl-dev \ libmnl libmnl-dev \
libnftnl-dev \ libnftnl libnftnl-dev \
dbus-dev \ dbus dbus-dev \
fontconfig-dev fontconfig-dev \
wayland-dev
RUN rustup-init -y --default-toolchain stable
# Set pkg-config to use static libraries # Set pkg-config to use static libraries
ENV PKG_CONFIG_ALLOW_STATIC=1 ENV PKG_CONFIG_ALLOW_STATIC=1

View File

@@ -4,7 +4,7 @@
1. Install `abuild` 1. Install `abuild`
2. Create keys: `abuild-keygen` 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. The keys will end up in ~/.abuild/, and will be mounted into the build container.
3. Remember to keep keys around. 3. Remember to keep keys around.
## Building ## Building

View File

@@ -4,7 +4,10 @@ set -ex
cd "$(dirname "$0")" cd "$(dirname "$0")"
package="$1" package="$1"
shift
builder_image="mullvad-slint-musl-builder" builder_image="mullvad-slint-musl-builder"
cargo_home="${CARGO_HOME:-$HOME/.cargo}"
. "$HOME/.abuild/abuild.conf" . "$HOME/.abuild/abuild.conf"
docker build . -f Dockerfile -t "$builder_image" docker build . -f Dockerfile -t "$builder_image"
@@ -14,10 +17,12 @@ docker run --rm \
-v "$PACKAGER_PRIVKEY":/key.rsa:ro \ -v "$PACKAGER_PRIVKEY":/key.rsa:ro \
-v "$PACKAGER_PRIVKEY.pub":/key.rsa.pub:ro \ -v "$PACKAGER_PRIVKEY.pub":/key.rsa.pub:ro \
-v "$PACKAGER_PRIVKEY.pub":/etc/apk/keys/key.rsa.pub:ro \ -v "$PACKAGER_PRIVKEY.pub":/etc/apk/keys/key.rsa.pub:ro \
-v ./target:/cargo-target \
-v ./packages:/root/packages \ -v ./packages:/root/packages \
-v "$cargo_home":/cargo-home \
-e "CARGO_HOME=/cargo-home" \
-v ./target:/cargo-target \
-e "CARGO_TARGET_DIR=/cargo-target" \ -e "CARGO_TARGET_DIR=/cargo-target" \
-it \ -it \
"$builder_image" \ "$builder_image" \
abuild -F abuild -F "$@"

View File

@@ -1,75 +1,93 @@
# Contributor: maintainer="Joakim Hulthe <joakim@hulthe.net>"
# Maintainer: Joakim Hulthe <joakim@hulthe.net>
pkgname=mullvad-vpn-daemon pkgname=mullvad-vpn-daemon
pkgver=2026.1_git pkgver=2026.2_beta1
pkgrel=0 pkgrel=0
pkgdesc="Mullvad VPN GUI" pkgdesc="Mullvad VPN client (daemon and CLI)"
url="https://mullvad.net/" url="https://mullvad.net/"
arch="$(uname -m)" # Mullvad depends on old versions of the `nix` library
license="GPL-3-or-later" # which are broken on on loongarch64 and s390x
depends=" arch="all !loongarch64 !s390x"
" license="GPL-3.0-or-later"
# TODO: dbus-dev? also Dockerfile
# TODO: libmnl-dev? also Dockerfile
# TODO: libnftnl-dev? also Dockerfile
# TODO: git? also Dockerfile
makedepends=" makedepends="
build-base cargo-auditable
rustup git
musl-dev protobuf-dev
pkgconfig dbus-dev
git libmnl-dev
protobuf-dev libnftnl-dev
libmnl-dev
libnftnl-dev
dbus-dev
" "
checkdepends="" install="
install="" $pkgname.pre-upgrade
subpackages="" $pkgname.pre-deinstall
source="" $pkgname-systemd.post-install
builddir="$srcdir/" $pkgname-systemd.post-upgrade
options="net !check suid" $pkgname-systemd.pre-deinstall
"
subpackages="
$pkgname-systemd
$pkgname-suid
"
source="
https://github.com/mullvad/mullvadvpn-app/archive/refs/tags/${pkgver//_/-}.tar.gz
"
builddir="$srcdir/mullvadvpn-app-${pkgver//_/-}/"
options="net suid"
_cargo_target_dir="${CARGO_TARGET_DIR:-$startdir/mullvadvpn-app/target}" _cargo_target_dir="${CARGO_TARGET_DIR:-$builddir/target}"
_cargo_release_dir="$_cargo_target_dir/$CHOST/release"
prepare() {
default_prepare
cargo fetch --target "$CHOST" --locked
}
build() { build() {
# rustup-init -y --default-toolchain stable # Specify `--target` so that build artifacts will be in target/<target>/release
source "$HOME/.cargo/env" # This avoids clashes with host system when building in a container.
cd "$startdir/mullvadvpn-app" # Compile all binaries
cargo auditable build --release --frozen \
--target "$CHOST" \
-p mullvad-cli \
-p mullvad-daemon \
-p mullvad-exclude \
-p mullvad-problem-report \
-p mullvad-setup
}
local target="$(rustup +stable show active-toolchain | sed 's/^[^-]*-//' | grep -o "^[^ ]*")" check() {
cargo test --target "$CHOST" --frozen
# * Force the `stable` toolchain since it's installed in the container.
# We don't wan't to needlessly download rust while building.
# * Specify `--target` so that the final binary ends up in target/<target>/release.
cargo +stable build --release --locked \
--target "$target" \
-p mullvad-daemon \
-p mullvad-cli \
-p mullvad-exclude \
-p mullvad-problem-report
} }
package() { package() {
local target="$(rustup +stable show active-toolchain | sed 's/^[^-]*-//' | grep -o "^[^ ]*")" install -m755 -Dt "$pkgdir/usr/bin/" \
"$_cargo_release_dir/mullvad" \
"$_cargo_release_dir/mullvad-daemon" \
"$_cargo_release_dir/mullvad-problem-report" \
"$_cargo_release_dir/mullvad-setup"
install -m755 -D "$_cargo_target_dir/$target/release/mullvad-daemon" \ # TODO: Bundle a relay list.
"$pkgdir"/usr/bin/mullvad-daemon # We can't generate one at build time since that would break build reproducibility.
# Once mullvad starts checking a relay list into their release branches, we can bundle that.
#install -m644 -D "$builddir/<todo>/relays.json" \
# "$pkgdir/usr/share/mullvad-vpn/relays.json"
# TODO: Copy relay list into /var/cache/ in post-upgrade/post-install
install -m755 -D "$_cargo_target_dir/$target/release/mullvad" \ # files in /usr/lib/systemd/ are automatically put in systemd subpackage
"$pkgdir"/usr/bin/mullvad install -m755 -Dt "$pkgdir/usr/lib/systemd/system/" \
"$builddir/dist-assets/linux/mullvad-daemon.service" \
# TODO: setuid "$builddir/dist-assets/linux/mullvad-early-boot-blocking.service"
install -m755 -D "$_cargo_target_dir/$target/release/mullvad-exclude" \
"$pkgdir"/usr/bin/mullvad-exclude
install -m755 -D "$_cargo_target_dir/$target/release/mullvad-problem-report" \
"$pkgdir"/usr/bin/mullvad-problem-report
chmod u+s "$pkgdir"/usr/bin/mullvad-problem-report
# TODO: systemd services
# TODO: pre/post(de)install-scripts
} }
suid() {
pkgdesc="mullvad-exclude cli for split tunneling"
depends="$pkgname=$pkgver-r$pkgrel"
install -m4755 -Dt "$subpkgdir/usr/bin/" \
"$_cargo_release_dir/mullvad-exclude"
}
sha512sums="
9af0c263f0e5985d7842099f50a5070da0b23691f08ffe57c3b6d239d2c1c9acea89c07890f31d89bd75448a2dd1fd3c878b85be458baba0bcd90760e714b032 2026.2-beta1.tar.gz
"

View File

@@ -0,0 +1,9 @@
#!/bin/sh
set -eu
# Enable and start systemd services
if which systemctl >/dev/null 2>&1 && systemctl is-system-running | grep -vq offline >/dev/null 2>&1; then
systemctl enable "/usr/lib/systemd/system/mullvad-daemon.service"
systemctl start mullvad-daemon.service || echo "Failed to start mullvad-daemon.service"
systemctl enable "/usr/lib/systemd/system/mullvad-early-boot-blocking.service"
fi

View File

@@ -0,0 +1,9 @@
#!/bin/sh
set -eu
# Enable and start systemd services
if which systemctl >/dev/null 2>&1 && systemctl is-system-running | grep -vq offline >/dev/null 2>&1; then
systemctl enable "/usr/lib/systemd/system/mullvad-daemon.service"
systemctl start mullvad-daemon.service || echo "Failed to start mullvad-daemon.service"
systemctl enable "/usr/lib/systemd/system/mullvad-early-boot-blocking.service"
fi

View File

@@ -0,0 +1,8 @@
#!/bin/sh
set -eu
# Stop and disable all mullvad services
systemctl stop mullvad-daemon.service || true
systemctl disable mullvad-daemon.service || true
systemctl stop mullvad-early-boot-blocking.service || true
systemctl disable mullvad-early-boot-blocking.service || true

View File

@@ -0,0 +1,8 @@
#!/bin/sh
set -eu
# TODO: see `package()` in APKBUILD
# Copy vendored relay list into place
# mkdir -p /var/cache/mullvad-vpn \
# && cp /usr/share/mullvad-vpn/relays.json /var/cache/mullvad-vpn/relays.json \
# || echo "failed to install /var/cache/mullvad-vpn/relays.json"

View File

@@ -0,0 +1,8 @@
#!/bin/sh
set -eu
# TODO: see `package()` in APKBUILD
# Overwrite the cached relay list with the vendored one.
# mkdir -p /var/cache/mullvad-vpn \
# && cp /usr/share/mullvad-vpn/relays.json /var/cache/mullvad-vpn/relays.json \
# || echo "failed to install /var/cache/mullvad-vpn/relays.json"

View File

@@ -0,0 +1,6 @@
#!/bin/sh
set -eu
# Log out and remove any firewall rules
mullvad-setup reset-firewall || echo "Failed to reset firewall"
mullvad-setup remove-device || echo "Failed to remove device from account"

View File

@@ -0,0 +1,18 @@
#!/bin/sh
set -eu
# Stop the daemon gracefully, and set up firewall rules to prevent network
# leaks during upgrade.
if which systemctl >/dev/null 2>&1 && systemctl is-system-running | grep -vq offline >/dev/null 2>&1; then
if systemctl status mullvad-daemon >/dev/null 2>&1; then
mullvad-setup prepare-restart || true
systemctl stop mullvad-daemon.service
systemctl disable mullvad-daemon.service
systemctl disable mullvad-early-boot-blocking.service || true
cp /var/log/mullvad-vpn/daemon.log /var/log/mullvad-vpn/old-install-daemon.log \
|| echo "Failed to copy old daemon log"
fi
fi
# Clear the cached API IP address.
rm -f /var/cache/mullvad-vpn/api-ip-address.txt

View File

@@ -2,22 +2,23 @@
# Maintainer: Joakim Hulthe <joakim@hulthe.net> # Maintainer: Joakim Hulthe <joakim@hulthe.net>
pkgname=mullvad-vpn-slint pkgname=mullvad-vpn-slint
pkgver=2026.1_git pkgver=2026.1_git
pkgrel=0 pkgrel=4
pkgdesc="Mullvad VPN GUI" pkgdesc="Mullvad VPN GUI"
url="https://mullvad.net/" url="https://mullvad.net/"
arch="$(uname -m)" arch="all"
license="GPL-3-or-later" license="GPL-3-or-later"
# TODO: maybe depend on mullvad-vpn-daemon? # TODO: maybe depend on mullvad-vpn-daemon?
depends=" depends="
" "
makedepends=" makedepends="
build-base build-base
rustup cargo-auditable
musl-dev rust
pkgconfig pkgconfig
protobuf-dev protobuf-dev
fontconfig-dev fontconfig-dev
dbus-dev dbus-dev
wayland-dev
" "
checkdepends="" checkdepends=""
install="" install=""
@@ -28,30 +29,57 @@ options="net !check"
_cargo_target_dir="${CARGO_TARGET_DIR:-$startdir/mullvadvpn-app/target}" _cargo_target_dir="${CARGO_TARGET_DIR:-$startdir/mullvadvpn-app/target}"
build() { prepare() {
# rustup-init -y --default-toolchain stable default_prepare
source "$HOME/.cargo/env"
cd "$startdir/mullvadvpn-app" cd "$startdir/mullvadvpn-app"
cargo fetch --target "$CHOST" --locked
}
# rustup default stable build() {
local target="$(rustup +stable show active-toolchain | sed 's/^[^-]*-//' | grep -o "^[^ ]*")" cd "$startdir/mullvadvpn-app"
# * Force the `stable` toolchain since it's installed in the container. # Specify `--target` so that the final binary ends up in target/<target>/release.
# We don't wan't to needlessly download rust while building. cargo build --release --locked \
# * Specify `--target` so that the final binary ends up in target/<target>/release. --target "$CHOST" \
cargo +stable build --release --locked \
--target "$target" \
-p mullvad-slint -p mullvad-slint
} }
package() { package() {
local target="$(rustup +stable show active-toolchain | sed 's/^[^-]*-//' | grep -o "^[^ ]*")" # Executable
install -m755 -D "$_cargo_target_dir/$CHOST/release/mullvad-slint" \
# TODO: .desktop
# TODO: icon
install -m755 -D "$_cargo_target_dir/$target/release/mullvad-slint" \
"$pkgdir"/usr/bin/mullvad-slint "$pkgdir"/usr/bin/mullvad-slint
# .desktop file
install -m644 -D "$startdir/mullvadvpn-app/dist-assets/linux/slint/mullvad-vpn-slint.desktop" \
"$pkgdir"/usr/share/applications/mullvad-vpn-slint.desktop
# Icons
install -m644 -D "$startdir/mullvadvpn-app/dist-assets/linux/slint/16x16/apps/mullvad.png" \
"$pkgdir"/usr/share/icons/hicolor/16x16/apps/mullvad.png
install -m644 -D "$startdir/mullvadvpn-app/dist-assets/linux/slint/20x20/apps/mullvad.png" \
"$pkgdir"/usr/share/icons/hicolor/20x20/apps/mullvad.png
install -m644 -D "$startdir/mullvadvpn-app/dist-assets/linux/slint/24x24/apps/mullvad.png" \
"$pkgdir"/usr/share/icons/hicolor/24x24/apps/mullvad.png
install -m644 -D "$startdir/mullvadvpn-app/dist-assets/linux/slint/30x30/apps/mullvad.png" \
"$pkgdir"/usr/share/icons/hicolor/30x30/apps/mullvad.png
install -m644 -D "$startdir/mullvadvpn-app/dist-assets/linux/slint/32x32/apps/mullvad.png" \
"$pkgdir"/usr/share/icons/hicolor/32x32/apps/mullvad.png
install -m644 -D "$startdir/mullvadvpn-app/dist-assets/linux/slint/36x36/apps/mullvad.png" \
"$pkgdir"/usr/share/icons/hicolor/36x36/apps/mullvad.png
install -m644 -D "$startdir/mullvadvpn-app/dist-assets/linux/slint/40x40/apps/mullvad.png" \
"$pkgdir"/usr/share/icons/hicolor/40x40/apps/mullvad.png
install -m644 -D "$startdir/mullvadvpn-app/dist-assets/linux/slint/48x48/apps/mullvad.png" \
"$pkgdir"/usr/share/icons/hicolor/48x48/apps/mullvad.png
install -m644 -D "$startdir/mullvadvpn-app/dist-assets/linux/slint/64x64/apps/mullvad.png" \
"$pkgdir"/usr/share/icons/hicolor/64x64/apps/mullvad.png
install -m644 -D "$startdir/mullvadvpn-app/dist-assets/linux/slint/72x72/apps/mullvad.png" \
"$pkgdir"/usr/share/icons/hicolor/72x72/apps/mullvad.png
install -m644 -D "$startdir/mullvadvpn-app/dist-assets/linux/slint/96x96/apps/mullvad.png" \
"$pkgdir"/usr/share/icons/hicolor/96x96/apps/mullvad.png
install -m644 -D "$startdir/mullvadvpn-app/dist-assets/linux/slint/256x256/apps/mullvad.png" \
"$pkgdir"/usr/share/icons/hicolor/256x256/apps/mullvad.png
install -m644 -D "$startdir/mullvadvpn-app/dist-assets/linux/slint/512x512/apps/mullvad.png" \
"$pkgdir"/usr/share/icons/hicolor/512x512/apps/mullvad.png
} }

Submodule mullvad-vpn-slint/mullvadvpn-app added at 236bbc4c0e

View File

@@ -4,7 +4,10 @@ set -ex
cd "$(dirname "$0")" cd "$(dirname "$0")"
package="$1" package="$1"
shift
builder_image="mullvad-slint-musl-builder" builder_image="mullvad-slint-musl-builder"
cargo_home="${CARGO_HOME:-$HOME/.cargo}"
. "$HOME/.abuild/abuild.conf" . "$HOME/.abuild/abuild.conf"
podman build . -f Dockerfile -t "$builder_image" podman build . -f Dockerfile -t "$builder_image"
@@ -14,10 +17,12 @@ podman run --rm \
-v "$PACKAGER_PRIVKEY":/key.rsa:ro \ -v "$PACKAGER_PRIVKEY":/key.rsa:ro \
-v "$PACKAGER_PRIVKEY.pub":/key.rsa.pub:ro \ -v "$PACKAGER_PRIVKEY.pub":/key.rsa.pub:ro \
-v "$PACKAGER_PRIVKEY.pub":/etc/apk/keys/key.rsa.pub:ro \ -v "$PACKAGER_PRIVKEY.pub":/etc/apk/keys/key.rsa.pub:ro \
-v ./target:/cargo-target \
-v ./packages:/root/packages \ -v ./packages:/root/packages \
-v "$cargo_home":/cargo-home \
-e "CARGO_HOME=/cargo-home" \
-v ./target:/cargo-target \
-e "CARGO_TARGET_DIR=/cargo-target" \ -e "CARGO_TARGET_DIR=/cargo-target" \
-it \ -it \
"$builder_image" \ "$builder_image" \
abuild -F abuild -F "$@"