summaryrefslogtreecommitdiffstats
path: root/packages/net-vpn/mullvad-vpn/mullvad-vpn-2026.5.exheres-0
blob: 4a3da5b471140c81128be54468257871422c3034 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Copyright 2026 Gurov <thuggerthugger1@duck.com>
# Distributed under the terms of the GNU General Public License v2

SUMMARY="Mullvad VPN desktop client and daemon"
HOMEPAGE="https://mullvad.net/"

DOWNLOADS="https://cdn.mullvad.net/app/desktop/releases/${PV}/MullvadVPN-${PV}_amd64.deb -> ${PNV}.deb"

LICENCES="GPL-3"
SLOT="0"
PLATFORMS="~amd64"

DEPENDENCIES="
    build:
        app-arch/xz

    run:
        dev-libs/at-spi2-core
        sys-sound/alsa-lib
        x11-dri/mesa
        x11-dri/libdrm
        sys-apps/dbus
"

WORK="${WORKBASE}"

pkg_setup() {
    exdirectory --allow /opt
}

src_unpack() {
    local checksum
    checksum=$(sha256sum "${FETCHEDDIR}/${PNV}.deb") || die "Cannot checksum Mullvad archive"
    [[ ${checksum%% *} == aa6bd00452588597f50e8ca2f02bb91e9c295c4f01b0ae907354552e7428e7ab ]] ||
        die "Mullvad archive changed; check version before updating checksum"

    default
    unpack ./data.tar.xz
}

src_install() {
    edo mkdir -p "${IMAGE}/opt" "${IMAGE}/usr"
    edo cp -rT "${WORK}/opt" "${IMAGE}/opt"
    edo cp -rT "${WORK}/usr" "${IMAGE}/usr"

    edo mkdir -p "${IMAGE}/usr/${CHOST}"
    edo mv "${IMAGE}/usr/bin" "${IMAGE}/usr/${CHOST}/"

    if [[ -d "${IMAGE}/usr/lib" ]]; then
        edo mv "${IMAGE}/usr/lib" "${IMAGE}/usr/${CHOST}/"
    fi

    local helper="${IMAGE}/usr/${CHOST}/bin/mullvad-exclude"
    [[ -f ${helper} && ! -L ${helper} ]] || die "Mullvad exclusion helper is missing or not a regular file"
    edo chown root:root "${helper}"
    edo chmod 4755 "${helper}"

    edo mkdir -p "${IMAGE}/usr/share/zsh/site-functions"
    edo mv "${IMAGE}/usr/local/share/zsh/site-functions/_mullvad" "${IMAGE}/usr/share/zsh/site-functions/"
    edo rmdir "${IMAGE}/usr/local/share/zsh/site-functions" "${IMAGE}/usr/local/share/zsh" \
        "${IMAGE}/usr/local/share" "${IMAGE}/usr/local"
}