1 # Maintainer: Tobias Powalowski <tpowa@archlinux.org>
2 # Contributor: Roman Kyrylych <roman@archlinux.org>
3 # Contributor: Sarah Hay <sarah@archlinux.org>
6 pkgname=(gpgme qgpgme-qt5 qgpgme-qt6 python-gpgme)
9 pkgdesc='A C wrapper library for GnuPG'
11 url='https://www.gnupg.org/related_software/gpgme/'
25 validpgpkeys=('6DAA6E64A76D2840571B4902528897B826403ADA' # Werner Koch (dist signing 2020)
26 'AC8E115BF73E2D8D47FA9908E98E9B2D19C6C8BD') # Niibe Yutaka (GnuPG Release Key)
27 source=("https://www.gnupg.org/ftp/gcrypt/${pkgbase}/${pkgbase}-${pkgver}.tar.bz2"{,.sig})
28 sha256sums=('25a5785a5da356689001440926b94e967d02e13c49eb7743e35ef0cf22e42750'
32 # Building qt5 and qt6 bindings in the same source tree is not supported
33 cp -r ${pkgbase}-${pkgver}{,-qt6}
37 cd ${pkgbase}-${pkgver}
41 --disable-fd-passing \
47 # use a PEP517 workflow to get a reproducible Python package
48 # NOTE: top_builddir is required so that the build takes place against local gpgme, not system gpgme
50 top_builddir="$srcdir/$pkgbase-$pkgver" python -m build --wheel --no-isolation
53 cd ../${pkgbase}-${pkgver}-qt6
56 --disable-fd-passing \
58 --disable-gpgsm-test \
59 --enable-languages=cpp,qt6
64 cd ${pkgbase}-${pkgver}
66 # this test fails with gnupg (FS#66572)
67 sed -i 's#"t-keylist-secret",##' tests/json/t-json.c
73 depends=('libgpg-error' 'gnupg>=2')
74 options+=('!emptydirs')
75 provides=('libgpgme.so'
78 cd ${pkgbase}-${pkgver}
80 make DESTDIR="${pkgdir}" install
83 rm -r "${pkgdir}"/usr/lib/{cmake/QGpgme/,libqgpgme.*}
84 rm -r "${pkgdir}"/usr/lib/python*
87 package_qgpgme-qt5() {
88 pkgdesc="Qt5 bindings for GPGme"
89 depends=('gpgme' 'qt5-base')
93 cd ${pkgbase}-${pkgver}/lang/qt
95 make DESTDIR="${pkgdir}" install
96 rm -r "${pkgdir}"/usr/include
99 package_qgpgme-qt6() {
100 pkgdesc="Qt6 bindings for GPGme"
101 depends=('gpgme' 'qt6-base')
103 cd ${pkgbase}-${pkgver}-qt6/lang/qt
105 make DESTDIR="${pkgdir}" install
106 rm -r "${pkgdir}"/usr/include
109 package_python-gpgme() {
110 pkgdesc="Python bindings for GPGme"
111 depends=('gpgme' 'python')
113 cd ${pkgbase}-${pkgver}/lang/python
114 python -m installer --destdir="$pkgdir" dist/*.whl