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
12 changed files with 117 additions and 144 deletions

View File

@@ -6,16 +6,17 @@ RUN apk update && apk add \
build-base \
abuild \
git \
rust \
cargo-auditable \
rustup \
musl-dev \
pkgconfig \
protobuf-dev \
protobuf-dev \
libmnl libmnl-dev \
libnftnl libnftnl-dev \
dbus dbus-dev \
fontconfig-dev \
wayland-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

View File

@@ -5,7 +5,6 @@ cd "$(dirname "$0")"
package="$1"
builder_image="mullvad-slint-musl-builder"
cargo_home="${CARGO_HOME:-$HOME/.cargo}"
. "$HOME/.abuild/abuild.conf"
docker build . -f Dockerfile -t "$builder_image"
@@ -15,10 +14,8 @@ docker run --rm \
-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 ./packages:/root/packages \
-v "$cargo_home":/cargo-home \
-e "CARGO_HOME=/cargo-home" \
-v ./target:/cargo-target \
-v ./packages:/root/packages \
-e "CARGO_TARGET_DIR=/cargo-target" \
-it \
"$builder_image" \

View File

@@ -2,84 +2,72 @@
# Maintainer: Joakim Hulthe <joakim@hulthe.net>
pkgname=mullvad-vpn-daemon
pkgver=2026.1_git
pkgrel=4
pkgrel=0
pkgdesc="Mullvad VPN system service"
url="https://mullvad.net/"
arch="all"
arch="$(uname -m)"
license="GPL-3-or-later"
depends="
dbus
libmnl
libnftnl
"
makedepends="
build-base
cargo-auditable
rust
rustup
musl-dev
pkgconfig
git
protobuf-dev
dbus-dev
libmnl-dev
libnftnl-dev
dbus-dev
"
checkdepends=""
install="$pkgname.post-install $pkgname.pre-upgrade $pkgname.post-upgrade $pkgname.pre-deinstall $pkgname.post-deinstall"
# 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 suid"
options="net !check suid"
_cargo_target_dir="${CARGO_TARGET_DIR:-$startdir/mullvadvpn-app/target}"
prepare() {
default_prepare
cd "$startdir/mullvadvpn-app"
cargo fetch --target "$CHOST" --locked
}
build() {
# rustup-init -y --default-toolchain stable
source "$HOME/.cargo/env"
cd "$startdir/mullvadvpn-app"
# 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-cli \
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 \
-p mullvad-setup
}
check() {
cd "$startdir/mullvadvpn-app"
cargo test --target "$CHOST" --frozen
-p mullvad-problem-report
}
package() {
install -m755 -D "$_cargo_target_dir/$CHOST/release/mullvad" \
"$pkgdir"/usr/bin/mullvad
local target="$(rustup +stable show active-toolchain | sed 's/^[^-]*-//' | grep -o "^[^ ]*")"
install -m755 -D "$_cargo_target_dir/$CHOST/release/mullvad-daemon" \
install -m755 -D "$_cargo_target_dir/$target/release/mullvad-daemon" \
"$pkgdir"/usr/bin/mullvad-daemon
# mullvad-exclude requires setuid
install -m4755 -D "$_cargo_target_dir/$CHOST/release/mullvad-exclude" \
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/$CHOST/release/mullvad-problem-report" \
install -m755 -D "$_cargo_target_dir/$target/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,9 +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

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

View File

@@ -1,10 +0,0 @@
#!/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
mullvad-setup reset-firewall || echo "Failed to reset firewall"
mullvad-setup remove-device || echo "Failed to remove device from account"
/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

@@ -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
mullvad-setup prepare-restart || true
/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

View File

@@ -2,23 +2,22 @@
# Maintainer: Joakim Hulthe <joakim@hulthe.net>
pkgname=mullvad-vpn-slint
pkgver=2026.1_git
pkgrel=4
pkgrel=0
pkgdesc="Mullvad VPN GUI"
url="https://mullvad.net/"
arch="all"
arch="$(uname -m)"
license="GPL-3-or-later"
# TODO: maybe depend on mullvad-vpn-daemon?
depends="
"
makedepends="
build-base
cargo-auditable
rust
rustup
musl-dev
pkgconfig
protobuf-dev
fontconfig-dev
dbus-dev
wayland-dev
"
checkdepends=""
install=""
@@ -29,57 +28,30 @@ options="net !check"
_cargo_target_dir="${CARGO_TARGET_DIR:-$startdir/mullvadvpn-app/target}"
prepare() {
default_prepare
cd "$startdir/mullvadvpn-app"
cargo fetch --target "$CHOST" --locked
}
build() {
# rustup-init -y --default-toolchain stable
source "$HOME/.cargo/env"
cd "$startdir/mullvadvpn-app"
# Specify `--target` so that the final binary ends up in target/<target>/release.
cargo build --release --locked \
--target "$CHOST" \
# 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() {
# Executable
install -m755 -D "$_cargo_target_dir/$CHOST/release/mullvad-slint" \
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
# .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
}

View File

@@ -5,7 +5,6 @@ cd "$(dirname "$0")"
package="$1"
builder_image="mullvad-slint-musl-builder"
cargo_home="${CARGO_HOME:-$HOME/.cargo}"
. "$HOME/.abuild/abuild.conf"
podman build . -f Dockerfile -t "$builder_image"
@@ -15,10 +14,8 @@ podman run --rm \
-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 ./packages:/root/packages \
-v "$cargo_home":/cargo-home \
-e "CARGO_HOME=/cargo-home" \
-v ./target:/cargo-target \
-v ./packages:/root/packages \
-e "CARGO_TARGET_DIR=/cargo-target" \
-it \
"$builder_image" \