# Maintainer: Tobias Powalowski # Contributor: Roman Kyrylych # Contributor: Sarah Hay # ALARM: Kevin Mihelich # - add -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 to v7 CPPFLAGS pkgbase=gpgme pkgname=(gpgme qgpgme-qt6 python-gpgme) pkgver=1.24.0 pkgrel=1 pkgdesc='A C wrapper library for GnuPG' arch=('x86_64') url='https://www.gnupg.org/related_software/gpgme/' license=( GPL-2.0-or-later LGPL-2.0-or-later LGPL-2.1-or-later ) makedepends=( 'gnupg' 'libassuan' 'libgpg-error' 'python' 'python-build' 'python-installer' 'python-setuptools' 'python-wheel' 'qt6-base' 'swig' ) validpgpkeys=('6DAA6E64A76D2840571B4902528897B826403ADA' # Werner Koch (dist signing 2020) 'AC8E115BF73E2D8D47FA9908E98E9B2D19C6C8BD') # Niibe Yutaka (GnuPG Release Key) source=("https://www.gnupg.org/ftp/gcrypt/${pkgbase}/${pkgbase}-${pkgver}.tar.bz2"{,.sig}) sha256sums=('61e3a6ad89323fecfaff176bc1728fb8c3312f2faa83424d9d5077ba20f5f7da' 'SKIP') prepare() { cd ${pkgbase}-${pkgver}/ sed -i 's/-unknown//' autogen.sh autoreconf -fi } build() { cd ${pkgbase}-${pkgver} [[ $CARCH == "armv7h" ]] && CPPFLAGS+=' -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' ./configure \ --prefix=/usr \ --disable-fd-passing \ --disable-static \ --disable-gpgsm-test # prevent excessive overlinking due to libtool sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool make ( # use a PEP517 workflow to get a reproducible Python package # NOTE: top_builddir is required so that the build takes place against local gpgme, not system gpgme cd lang/python/ top_builddir="$srcdir/$pkgbase-$pkgver" python -m build --wheel --no-isolation ) } check() { cd ${pkgbase}-${pkgver} # this test fails with gnupg (FS#66572) sed -i 's#"t-keylist-secret",##' tests/json/t-json.c make check } package_gpgme() { depends=( 'gcc-libs' 'glib2' 'glibc' 'libassuan' 'libgpg-error' 'gnupg>=2' ) options+=('!emptydirs') provides=('libgpgme.so' 'libgpgmepp.so') license+=(MIT) cd ${pkgbase}-${pkgver} make DESTDIR="${pkgdir}" install # split qgpgme rm -r "${pkgdir}"/usr/lib/{cmake/QGpgmeQt6/,libqgpgmeqt6.*} rm -r "${pkgdir}"/usr/lib/python* rm -r "${pkgdir}"/usr/include/qgpgme-qt6/ install -vDm 644 LICENSES "$pkgdir/usr/share/licenses/$pkgname/MIT.txt" } package_qgpgme-qt6() { pkgdesc="Qt6 bindings for GPGme" depends=( 'gcc-libs' 'glibc' 'gpgme' 'libgpg-error' 'qt6-base' ) cd ${pkgbase}-${pkgver}/lang/qt make DESTDIR="${pkgdir}" install } package_python-gpgme() { pkgdesc="Python bindings for GPGme" depends=( 'glibc' 'gpgme' 'python' ) cd ${pkgbase}-${pkgver}/lang/python python -m installer --destdir="$pkgdir" dist/*.whl }