diff --git a/.gitignore b/.gitignore index 60c4b6009e3a442d2722e57bba8eb185adda0b95..2427993b8f2b569b2059f6645a3dba7f134fbd17 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,9 @@ debian/files # IDE .idea .vs + +# Arch Linux package +ArchLinux/src +ArchLinux/pkg +ArchLinux/bitmask-vpn +ArchLinux/*.tar.zst diff --git a/ArchLinux/PKGBUILD b/ArchLinux/PKGBUILD new file mode 100644 index 0000000000000000000000000000000000000000..bd8680a1111b5aa9404171eb1dd9b2e8edc420fb --- /dev/null +++ b/ArchLinux/PKGBUILD @@ -0,0 +1,61 @@ +# Maintainer: Pea <peanut2 [aaaaat] systemli [dooot] org> + +pkgname=bitmask-vpn-git +pkgrel=1 +pkgdesc="Bitmask is an open source application to provide easy and secure encrypted communication with a VPN" +pkgver=0.24.6.rc.1.r10.g4ee5fba +arch=("x86_64") +license=("GPL-3.0-only") +url="https://0xacab.org/leap/bitmask-vpn" +conflicts=('riseup-vpn' 'riseup-vpn-git') + +source=("git+$url.git") +sha256sums=('SKIP') + +# qt6-tools has /usr/lib/qt6/bin/lrelease +makedepends=('git' 'make' 'go' 'qt6-tools') +depends=('qt6-base' 'qt6-declarative' 'qt6-svg' 'openvpn' 'python' 'lxsession' 'iptables') + +pkgver() { + cd bitmask-vpn + git describe --long --abbrev=7 | sed 's/\([^-]*-g\)/r\1/;s/-/./g' +} + +prepare() { + cd bitmask-vpn + export GOCACHE="$srcdir/GOCACHE" + PROVIDER=bitmask make vendor +} + + +build() { + cd bitmask-vpn + export GOCACHE="$srcdir/GOCACHE" + 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" + + export PROVIDER=bitmask + export QMAKE=qmake6 + export LRELEASE=/usr/lib/qt6/bin/lrelease + make build -j $(nproc) +} + +check() { + cd bitmask-vpn + export GOCACHE="$srcdir/GOCACHE" + CI="dont run integration tests as they are broken" make test +} + +package() { + cd bitmask-vpn + + install -Dm755 build/qt/release/bitmask-vpn "$pkgdir/usr/bin/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 -Dm644 build/bitmask/debian/bitmask-vpn.desktop "$pkgdir/usr/share/applications/bitmask-vpn.desktop" + install -Dm644 build/bitmask/debian/icons/scalable/bitmask-vpn.png "$pkgdir/usr/share/icons/hicolor/128x128/apps/bitmask-vpn.png" +} diff --git a/Makefile b/Makefile index fb897bfbf38ccbd44118dd58b9336a66786b7057..e9d2e4d3059e23e2f00698599c8edb67c0ed3a66 100644 --- a/Makefile +++ b/Makefile @@ -297,6 +297,7 @@ clean: @rm -rf lib/* @rm -rf build/ @-unlink branding/assets/default + @cd ArchLinux && rm -rf bitmask-vpn pkg src *.tar.zst ######################################################################## @@ -435,6 +436,11 @@ package_snap: package_deb: @${MAKE} -C build/${PROVIDER} pkg_deb +package_arch: + grep -q "Arch Linux" /etc/issue || (echo "Arch Linux system is required to build the Arch Linux package" && exit 1) + # at least the makepkg binary is mandatory, makepkg is part pacman package + (cd ArchLinux && makepkg --syncdeps --noconfirm) + sign_artifact: @find ${FILE} -type f -not -name "*.asc" -print0 | xargs -0 -n1 -I{} sha256sum -b "{}" | sed 's/*deploy\///' > ${FILE}.sha256 @gpg --clear-sign --armor ${FILE}.sha256