11 Commits

Author SHA1 Message Date
Joakim Hulthe
57048c5a9e Copy debian install scripts 2026-03-30 10:16:11 +02:00
Joakim Hulthe
a3c9390bfd Add submodules 2026-03-30 10:15:35 +02:00
Joakim Hulthe
26f70c0005 fixup! add scripts to build alpine packages with podman 2026-03-30 10:12:39 +02:00
Joakim Hulthe
d695ad5ed3 mullvad-vpn-daemon: Add systemd subpkg 2026-03-28 22:25:04 +01:00
d2a1e43957 mullvad-vpn-slint: Enable tray-icon feature 2026-03-28 22:07:33 +01:00
f34b7bed2f Add APKBUILD for mullvad-vpn-daemon 2026-03-28 22:07:17 +01:00
6446528e83 Add docker-build.sh 2026-03-28 21:47:53 +01:00
0bdc5be782 APKBUILD: small fixes 2026-03-28 21:47:45 +01:00
f4d15b8604 mullvad-vpn-slint: Remove unnecessary dependencies 2026-03-28 21:47:03 +01:00
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
18 changed files with 328 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

8
.gitmodules vendored Normal file
View File

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

29
Dockerfile Normal file
View File

@@ -0,0 +1,29 @@
FROM alpine:edge
# Install build dependencies
# TODO: trim dependencies?
RUN apk update && apk add \
build-base \
abuild \
git \
rustup \
musl-dev \
pkgconfig \
protobuf-dev \
protobuf-dev \
libmnl-dev \
libnftnl-dev \
dbus-dev \
fontconfig-dev
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"

23
docker-build.sh Executable 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"
docker build . -f Dockerfile -t "$builder_image"
docker 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

View File

@@ -0,0 +1,73 @@
# Contributor:
# Maintainer: Joakim Hulthe <joakim@hulthe.net>
pkgname=mullvad-vpn-daemon
pkgver=2026.1_git
pkgrel=0
pkgdesc="Mullvad VPN system service"
url="https://mullvad.net/"
arch="$(uname -m)"
license="GPL-3-or-later"
depends="
"
makedepends="
build-base
rustup
musl-dev
pkgconfig
git
protobuf-dev
libmnl-dev
libnftnl-dev
dbus-dev
"
checkdepends=""
# TODO: pre/post(de)install-scripts
#install="$pkgname.pre-install $pkgname.post-install $pkgname.pre-deinstall $pkgname.post-deinstall"
install=""
subpackages="$pkgname-systemd"
source=""
builddir="$srcdir/"
options="net !check suid"
_cargo_target_dir="${CARGO_TARGET_DIR:-$startdir/mullvadvpn-app/target}"
build() {
# rustup-init -y --default-toolchain stable
source "$HOME/.cargo/env"
cd "$startdir/mullvadvpn-app"
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.
# * 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() {
local target="$(rustup +stable show active-toolchain | sed 's/^[^-]*-//' | grep -o "^[^ ]*")"
install -m755 -D "$_cargo_target_dir/$target/release/mullvad-daemon" \
"$pkgdir"/usr/bin/mullvad-daemon
install -m755 -D "$_cargo_target_dir/$target/release/mullvad" \
"$pkgdir"/usr/bin/mullvad
install -m755 -D "$_cargo_target_dir/$target/release/mullvad-exclude" \
"$pkgdir"/usr/bin/mullvad-exclude
chmod u+s "$pkgdir"/usr/bin/mullvad-exclude
install -m755 -D "$_cargo_target_dir/$target/release/mullvad-problem-report" \
"$pkgdir"/usr/bin/mullvad-problem-report
}
systemd() {
install -m755 -D "$startdir/mullvadvpn-app/dist-assets/linux/mullvad-daemon.service" \
"$subpkgdir"/usr/lib/systemd/system/mullvad-daemon.service
}

View File

@@ -0,0 +1,39 @@
#!/usr/bin/env bash
set -eu
function remove_logs_and_cache {
rm -r --interactive=never /var/log/mullvad-vpn/ || \
echo "Failed to remove mullvad-vpn logs"
rm -r --interactive=never /var/cache/mullvad-vpn/ || \
echo "Failed to remove mullvad-vpn cache"
}
function remove_config {
rm -r --interactive=never /etc/mullvad-vpn || \
echo "Failed to remove mullvad-vpn config"
}
function remove_symlinks {
rm /usr/bin/mullvad-problem-report || \
echo "Failed to remove mullvad-problem-report"
}
# checking what kind of an action is taking place
case $@ in
# apt purge passes "purge"
"purge")
remove_logs_and_cache
remove_config
remove_symlinks
;;
# apt remove passes "remove"
"remove")
remove_symlinks
;;
# dnf remove passes a 0
"0")
remove_logs_and_cache
remove_config
remove_symlinks
;;
esac

View File

@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -eu
ln -sf /opt/Mullvad\ VPN/resources/mullvad-problem-report /usr/bin/mullvad-problem-report
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"

View File

@@ -0,0 +1,23 @@
#!/usr/bin/env bash
set -eu
echo "Running prerm."
is_number_re='^[0-9]+$'
# Check if we're running during an upgrade step on Fedora
# https://fedoraproject.org/wiki/Packaging:Scriptlets#Syntax
if [[ "$1" =~ $is_number_re ]] && [ "$1" -gt 0 ]; then
exit 0;
fi
if [[ "$1" == "upgrade" ]]; then
exit 0;
fi
# the user might've disabled or stopped the service themselves already
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
/opt/Mullvad\ VPN/resources/mullvad-setup reset-firewall || echo "Failed to reset firewall"
/opt/Mullvad\ VPN/resources/mullvad-setup remove-device || echo "Failed to remove device from account"

View File

@@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -eu
if which systemctl &> /dev/null && systemctl is-system-running | grep -vq offline &> /dev/null; then
if systemctl status mullvad-daemon &> /dev/null; then
/opt/Mullvad\ VPN/resources/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
rm -f /var/cache/mullvad-vpn/relays.json
rm -f /var/cache/mullvad-vpn/api-ip-address.txt

View File

@@ -0,0 +1,57 @@
# Contributor:
# Maintainer: Joakim Hulthe <joakim@hulthe.net>
pkgname=mullvad-vpn-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="
"
makedepends="
build-base
rustup
musl-dev
pkgconfig
protobuf-dev
fontconfig-dev
dbus-dev
"
checkdepends=""
install=""
subpackages=""
source=""
builddir="$srcdir/"
options="net !check"
_cargo_target_dir="${CARGO_TARGET_DIR:-$startdir/mullvadvpn-app/target}"
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.
# * Specify `--target` so that the final binary ends up in target/<target>/release.
cargo +stable build --release --locked \
--target "$target" \
-p mullvad-slint
}
package() {
local target="$(rustup +stable show active-toolchain | sed 's/^[^-]*-//' | grep -o "^[^ ]*")"
# TODO: .desktop
# TODO: icon
install -m755 -D "$_cargo_target_dir/$target/release/mullvad-slint" \
"$pkgdir"/usr/bin/mullvad-slint
}

0
packages/.gitkeep Normal file
View File

23
podman-build.sh Executable 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