summaryrefslogtreecommitdiff
path: root/PKGBUILD
blob: 89b48b44b3a91462f2ddc5708d12170b87bf3fe7 (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
# Maintainer: jc_gargma <jc_gargma@iserlohn-fortress.net>
# Maintainer (Arch): Balló György <ballogyor+arch at gmail dot com>
# Maintainer (Arch): Bruno Pagani <archange@archlinux.org>

# # I maintain this because:
# Arch version uses yubikey libs
# Arch version enables networking support
# Arch version does not use ~/.config
# Arch version lacks additional optimization and hardening flags

_NETBUILD=OFF

pkgname=keepassxc
pkgver=2.7.6
pkgrel=3
pkgdesc="Cross-platform community-driven port of Keepass password manager"
arch=(x86_64)
url="https://keepassxc.org/"
license=(GPL)
options=('!lto')
depends=(argon2 botan curl hicolor-icon-theme libxtst
         minizip pcsclite qrencode qt5-svg qt5-x11extras libusb)
makedepends=(asciidoctor cmake qt5-tools)
optdepends=('xclip: keepassxc-cli clipboard support under X server'
            'wl-clipboard: keepassxc-cli clipboard support under Wayland')
checkdepends=(xclip xorg-server-xvfb)
provides=(org.freedesktop.secrets)
source=(https://github.com/keepassxreboot/keepassxc/releases/download/$pkgver/keepassxc-$pkgver-src.tar.xz{,.sig}
        cc0530ba.patch)
sha256sums=('a58074509fa8e90f152c6247f73e75e126303081f55eedb4ea0cbb6fa980d670'
            'SKIP'
            '7884a0425a5bf7e67d389d6b2545b06ee28b6d77e9164df13a8e78b5719d11ce')
b2sums=('2ecdd387a7bc70aeeaef6eeabdfeed6aaf1d779056580375c011aa71d62459d38258617a4cb46fc3b215a2b6e1e3326cc8c62b228bee0be674923399421b0cbe'
        'SKIP'
        'de04cc88f3829dd9183126c6ec014dab808ea6be8ddb96eb29ef1192510bb1ff421d4ddcab5e69faf8b8be0dc75864fdb276973484a5be83b3e94730204f87a9')
# List of signing keys can be found at https://keepassxc.org/verifying-signatures/
validpgpkeys=(BF5A669F2272CF4324C1FDA8CFB4C2166397D0D2
              71D4673D73C7F83C17DAE6A2D8538E98A26FD9C4
              AF0AEA44ABAC8F1047733EA7AFF235EEFB5A2517
              C1E4CBA3AD78D3AFD894F9E0B7A66F03B59076A8)

prepare() {

  # Fix build with botan 3.3
  patch -d $pkgname-$pkgver -p1 < cc0530ba.patch

  sed -i 's|Exec=keepassxc %f|Exec=keepassxc --localconfig ~/.config/keepassxc/keepassxc.ini %f|' $srcdir/$pkgname-$pkgver/share/linux/org.keepassxc.KeePassXC.desktop.in
}

build() {

  # PIE causes the tests to fail
  export CFLAGS="$CFLAGS -O3 -fstack-protector-all"
  export CXXFLAGS="$CXXFLAGS -O3 -fstack-protector-all"

  cmake -S keepassxc-$pkgver -B build \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=lib \
    -DWITH_XC_AUTOTYPE=ON \
    -DWITH_XC_NETWORKING=OFF \
    -DWITH_XC_BROWSER=${_NETBUILD} \
    -DWITH_XC_YUBIKEY=OFF \
    -DWITH_XC_SSHAGENT=OFF \
    -DWITH_XC_KEESHARE=OFF \
    -DWITH_XC_UPDATECHECK=OFF \
    -DWITH_XC_FDOSECRETS=OFF
  cmake --build build
}

check() {
  xvfb-run --auto-servernum cmake --build build --target test
}

package() {
  cmake --build build --target install -- DESTDIR="$pkgdir"
}