From 9444e92316ab6c73c54caea50984f6dfab0e9254 Mon Sep 17 00:00:00 2001 From: juandmcr Date: Thu, 19 Nov 2026 22:36:02 +0100 Subject: [PATCH] new package: mullvadvpn --- srcpkgs/mullvadvpn/files/mullvad/run | 17 +++++++++ srcpkgs/mullvadvpn/patches/noroot.patch | 12 +++++++ srcpkgs/mullvadvpn/template | 46 +++++++++++++++++++++++++ 3 files changed, 75 insertions(+) create mode 100644 srcpkgs/mullvadvpn/files/mullvad/run create mode 100644 srcpkgs/mullvadvpn/patches/noroot.patch create mode 100644 srcpkgs/mullvadvpn/template diff --git a/srcpkgs/mullvadvpn/files/mullvad/run b/srcpkgs/mullvadvpn/files/mullvad/run new file mode 100644 index 0000000..d776fb6 --- /dev/null +++ b/srcpkgs/mullvadvpn/files/mullvad/run @@ -0,0 +1,17 @@ +#!/bin/sh + +export MULLVAD_RESOURCE_DIR=/usr/share/mullvad + +if [ -r ./conf ]; then + . ./conf +else + _caps=+all +fi + +exec 2>&1 +exec setpriv --reuid root --regid root --clear-groups \ + --securebits +no_setuid_fixup,+no_setuid_fixup_locked,+keep_caps_locked \ + --ambient-caps ${_caps} \ + --inh-caps ${_caps} \ + --bounding-set -all,${_caps} \ + --no-new-privs -- mullvad-daemon --disable-stdout-timestamps diff --git a/srcpkgs/mullvadvpn/patches/noroot.patch b/srcpkgs/mullvadvpn/patches/noroot.patch new file mode 100644 index 0000000..6748363 --- /dev/null +++ b/srcpkgs/mullvadvpn/patches/noroot.patch @@ -0,0 +1,12 @@ +@@ -1,11 +0,0 @@ +--- a/mullvad-daemon/src/main.rs ++++ b/mullvad-daemon/src/main.rs +@@ -258,7 +258,7 @@ + + #[cfg(unix)] + fn running_as_admin() -> bool { +- nix::unistd::Uid::current().is_root() ++ true + } + + #[cfg(windows)] diff --git a/srcpkgs/mullvadvpn/template b/srcpkgs/mullvadvpn/template new file mode 100644 index 0000000..c67bc24 --- /dev/null +++ b/srcpkgs/mullvadvpn/template @@ -0,0 +1,46 @@ +# Template file for 'mullvadvpn' +pkgname=mullvadvpn +version=2026.6 +revision=1 +build_style=cargo +build_helper=qemu +make_build_args=" + -p mullvad-daemon --bin mullvad-daemon + -p mullvad-cli --bin mullvad + -p mullvad-setup --bin mullvad-setup + -p mullvad-problem-report --bin mullvad-problem-report + -p mullvad-exclude --bin mullvad-exclude + -p mullvad-api --bin relay_list" +hostmakedepends="pkgconf protobuf protobuf-devel git" +# drop git after mullvadvpn-app/pull/10845 is released +makedepends="dbus-devel libnftnl-devel libmnl-devel" +# drop dbus after mullvadvpn-app/pull/11537 +short_desc="Mullvad VPN client app (cli only)" +maintainer="dkwo " +license="GPL-3.0-or-later" +homepage="https://mullvad.net/" +changelog="https://raw.githubusercontent.com/mullvad/mullvadvpn-app/refs/heads/main/CHANGELOG.md" +distfiles="https://github.com/mullvad/mullvadvpn-app/archive/refs/tags/${version}.tar.gz" +checksum=9ddbc4596c0a5b2729449c3da3b01ecb6c19ae9ec1c6b841ef26d84e38b851e0 + +do_install() { + for _bin in mullvad-daemon mullvad mullvad-problem-report mullvad-setup mullvad-exclude; do + vbin target/${RUST_TARGET}/release/${_bin} + done +} + +post_install() { + vtargetrun target/${RUST_TARGET}/release/relay_list > dist-assets/relays.json + vinstall dist-assets/relays.json 644 usr/share/mullvad + + compdir=$(mktemp -d) + for _shell in bash zsh fish; do + vtargetrun ${DESTDIR}/usr/bin/mullvad shell-completions ${_shell} ${compdir} + done + + vcompletion ${compdir}/mullvad.bash bash mullvad + vcompletion ${compdir}/_mullvad zsh mullvad + vcompletion ${compdir}/mullvad.fish fish mullvad + + vsv mullvad +}