6 Commits

Author SHA1 Message Date
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
10 changed files with 70 additions and 85 deletions

View File

@@ -14,7 +14,8 @@ RUN apk update && apk add \
libmnl libmnl-dev \
libnftnl libnftnl-dev \
dbus dbus-dev \
fontconfig-dev
fontconfig-dev \
wayland-dev
# Set pkg-config to use static libraries
ENV PKG_CONFIG_ALLOW_STATIC=1

View File

@@ -2,10 +2,10 @@
# Maintainer: Joakim Hulthe <joakim@hulthe.net>
pkgname=mullvad-vpn-daemon
pkgver=2026.1_git
pkgrel=1
pkgrel=4
pkgdesc="Mullvad VPN system service"
url="https://mullvad.net/"
arch="$(uname -m)"
arch="all"
license="GPL-3-or-later"
depends="
dbus
@@ -24,9 +24,7 @@ makedepends="
libnftnl-dev
"
checkdepends=""
# TODO: pre/post(de)install-scripts
#install="$pkgname.pre-install $pkgname.post-install $pkgname.pre-deinstall $pkgname.post-deinstall"
install=""
install="$pkgname.post-install $pkgname.pre-upgrade $pkgname.post-upgrade $pkgname.pre-deinstall $pkgname.post-deinstall"
subpackages="$pkgname-systemd"
source=""
builddir="$srcdir/"
@@ -44,38 +42,44 @@ prepare() {
build() {
cd "$startdir/mullvadvpn-app"
# * 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.
# Specify `--target` so that the build artifacts ends up in target/<target>/release to
# avoid clashes with host system when running in a container with a mounted target folder.
cargo auditable build --release --locked \
--target "$CHOST" \
-p mullvad-daemon \
-p mullvad-cli \
-p mullvad-daemon \
-p mullvad-exclude \
-p mullvad-problem-report
-p mullvad-problem-report \
-p mullvad-setup
}
check() {
cd "$startdir/mullvadvpn-app"
cargo test --frozen
cargo test --target "$CHOST" --frozen
}
package() {
install -m755 -D "$_cargo_target_dir/$CHOST/release/mullvad-daemon" \
"$pkgdir"/usr/bin/mullvad-daemon
install -m755 -D "$_cargo_target_dir/$CHOST/release/mullvad" \
"$pkgdir"/usr/bin/mullvad
install -m755 -D "$_cargo_target_dir/$CHOST/release/mullvad-exclude" \
install -m755 -D "$_cargo_target_dir/$CHOST/release/mullvad-daemon" \
"$pkgdir"/usr/bin/mullvad-daemon
# mullvad-exclude requires setuid
install -m4755 -D "$_cargo_target_dir/$CHOST/release/mullvad-exclude" \
"$pkgdir"/usr/bin/mullvad-exclude
chmod u+s "$pkgdir"/usr/bin/mullvad-exclude
install -m755 -D "$_cargo_target_dir/$CHOST/release/mullvad-problem-report" \
"$pkgdir"/usr/bin/mullvad-problem-report
install -m755 -D "$_cargo_target_dir/$CHOST/release/mullvad-setup" \
"$pkgdir"/usr/bin/mullvad-setup
}
systemd() {
install -m755 -D "$startdir/mullvadvpn-app/dist-assets/linux/mullvad-daemon.service" \
"$subpkgdir"/usr/lib/systemd/system/mullvad-daemon.service
install -m755 -D "$startdir/mullvadvpn-app/dist-assets/linux/mullvad-early-boot-blocking.service" \
"$subpkgdir"/usr/lib/systemd/system/mullvad-early-boot-blocking.service
}

View File

@@ -1,39 +1,9 @@
#!/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
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"
rm -r --interactive=never /etc/mullvad-vpn || \
echo "Failed to remove mullvad-vpn config"

View File

@@ -1,8 +1,10 @@
#!/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"
if which systemctl &> /dev/null && systemctl is-system-running | grep -vq offline &> /dev/null; then
if systemctl status mullvad-daemon &> /dev/null; 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
fi

View File

@@ -0,0 +1,10 @@
#!/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
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
fi

View File

@@ -19,5 +19,5 @@ 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"
mullvad-setup reset-firewall || echo "Failed to reset firewall"
mullvad-setup remove-device || echo "Failed to remove device from account"

View File

@@ -3,7 +3,7 @@ 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
mullvad-setup prepare-restart || true
systemctl stop mullvad-daemon.service
systemctl disable mullvad-daemon.service
systemctl disable mullvad-early-boot-blocking.service || true

View File

@@ -2,22 +2,23 @@
# Maintainer: Joakim Hulthe <joakim@hulthe.net>
pkgname=mullvad-vpn-slint
pkgver=2026.1_git
pkgrel=1
pkgrel=4
pkgdesc="Mullvad VPN GUI"
url="https://mullvad.net/"
arch="$(uname -m)"
arch="all"
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
build-base
cargo-auditable
rust
pkgconfig
protobuf-dev
fontconfig-dev
dbus-dev
wayland-dev
"
checkdepends=""
install=""
@@ -28,28 +29,25 @@ options="net !check"
_cargo_target_dir="${CARGO_TARGET_DIR:-$startdir/mullvadvpn-app/target}"
build() {
# rustup-init -y --default-toolchain stable
source "$HOME/.cargo/env"
prepare() {
default_prepare
cd "$startdir/mullvadvpn-app"
cargo fetch --target "$CHOST" --locked
}
# rustup default stable
local target="$(rustup +stable show active-toolchain | sed 's/^[^-]*-//' | grep -o "^[^ ]*")"
build() {
cd "$startdir/mullvadvpn-app"
# * 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" \
# Specify `--target` so that the final binary ends up in target/<target>/release.
cargo build --release --locked \
--target "$CHOST" \
-p mullvad-slint
}
package() {
local target="$(rustup +stable show active-toolchain | sed 's/^[^-]*-//' | grep -o "^[^ ]*")"
# Executable
install -m755 -D "$_cargo_target_dir/$target/release/mullvad-slint" \
install -m755 -D "$_cargo_target_dir/$CHOST/release/mullvad-slint" \
"$pkgdir"/usr/bin/mullvad-slint
# .desktop file