summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2583cea97485fbf028a924b24eb4392fc2bff04c (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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
pkgname=riseup-vpn-git
pkgrel=1
pkgver=0.24.3.r1.g8dd1abf
pkgdesc="RiseupVPN is a branded build of Bitmask VPN. Bitmask VPN is a minimal rewrite of the Bitmask VPN Client, written in golang, that for now lacks client authentication, and is preconfigured to use a single provider."
url="https://0xacab.org/leap/bitmask-vpn"
arch=('x86_64')
license=('GPL3')
conflicts=('riseup-vpn')
source=(
    "git+https://0xacab.org/leap/bitmask-vpn.git"
    "riseup-vpn_launcher.desktop"
    "riseup-vpn.png"
)

sha256sums=('SKIP'
            'e21a0d99dcea6b849f80960fccc488e6294e3e794b0033fdc163291ecc8595ff'
            '18cdea88cb7feb3de898918a78f612318b066d18c174d2a9addaa448f58de15c')

pkgver() {
   cd "bitmask-vpn"
   git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

makedepends=(
    'git'
    'cmake'
    'make'
    'which'
    'gcc'
    'go'
)

depends=(
    'qt6-base'
    'qt6-tools'
    'qt6-quickcontrols2'
    'qt6-svg'
    'openvpn'
    'python'
    'lxsession'
)

prepare() {
        cd "bitmask-vpn"
        sed -i 's@/usr/sbin/bitmask-root@/usr/bin/bitmask-root@g' pkg/pickle/helpers.go
        sed -i 's@/usr/sbin/bitmask-root@/usr/bin/bitmask-root@g' pkg/vpn/launcher_linux.go
        sed -i 's@/usr/sbin/bitmask-root@/usr/bin/bitmask-root@g' pkg/pickle/helpers/bitmask-root
        sed -i 's@/usr/sbin/bitmask-root@/usr/bin/bitmask-root@g' helpers/se.leap.bitmask.policy
        PROVIDER=riseup make vendor
}

build() {
    cd "bitmask-vpn"
    export CGO_CPPFLAGS="${CPPFLAGS}"
    export CGO_CFLAGS="${CFLAGS}"
    export CGO_CXXFLAGS="${CXXFLAGS}"
    export CGO_LDFLAGS="${LDFLAGS}"
    export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"

    PROVIDER=riseup QMAKE=qmake6 LRELEASE=/usr/lib/qt6/bin/lrelease make build -j $(nproc)
}

check() {
    cd "bitmask-vpn"
    make test
}

package() {
    install -Dm644 riseup-vpn_launcher.desktop "${pkgdir}/usr/share/applications/riseup-vpn_launcher.desktop"
    install -Dm644 riseup-vpn.png "${pkgdir}/usr/share/icons/hicolor/128x128/apps/riseup-vpn.png"

    cd "bitmask-vpn"
    install -Dm755 helpers/bitmask-root "${pkgdir}/usr/bin/bitmask-root"
    install -Dm644 helpers/se.leap.bitmask.policy "${pkgdir}/usr/share/polkit-1/actions/se.leap.bitmask.policy"
    install -Dm755 build/qt/release/riseup-vpn "${pkgdir}/usr/bin/riseup-vpn"
}