; OpenPGP package signing, key management and offline verification. defpkgbuild(gnupg, #:pkgname, "gnupg", #:pkgver, "2.4.9", #:pkgrel, 1, #:pkgdesc, "GnuPG tools and agent for signing and verifying packages", #:arch, [#:x86-64, #:aarch64], #:license, "GPL-3.0-or-later", #:url, "https://gnupg.org/", #:depends, ["musl", "bzip2", "libassuan", "libgcrypt", "libgpg-error", "libksba", "npth", "pinentry", "readline", "sqlite", "zlib"], #:source, ["https://gnupg.org/ftp/gcrypt/gnupg/gnupg-2.4.9.tar.bz2", "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/gnupg/0010-avoid-beta-warning.patch", "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/gnupg/0020-avoid-regenerating-defsincdate-use-shipped-file.patch", "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/gnupg/0110-avoid-simple-memory-dumps-via-ptrace.patch", "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/gnupg/0210-dirmngr-hkp-avoid-potential-race-condition-when-some-host-die.patch", "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/gnupg/0230-dirmngr-avoid-automatically-checking-upstream-swdb.patch", "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/gnupg/0330-gpg-default-to-sha512-for-all-signature-types-on-rsa-keys.patch", "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/gnupg/0340-gpg-prefer-sha512-and-sha384-in-personal-digest.patch", "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/gnupg/0420-gpg-drop-import-clean-from-default-keyserver-import-options.patch", "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/gnupg/fix-i18n.patch", "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/gnupg/HACK-revert-rfc4880bis-default.patch", "check.py"], #:sha256sums, ["dd17ab2e9a04fd79d39d853f599cbc852062ddb9ab52a4ddeb4176fd8b302964", "243c3a79295519b3931f9d846cf2af5caa064a78de812ee336dc786c1567b4d0", "9bd33f7d1b875bf710a9ad58db17d8217e747733a3118ff9403e1856a2c6754a", "9bb5282a5292f8fe4ff77253ba28bb5a2453d85ba4bdebcc646bf82bb9175c60", "9b30351f7eff35c27376f7b7c73ee23a1b737b5bb293fdf97e41924ae6851e88", "a059840eed2d1e0ed977fbc7420108d91031e3c256f95eede1d8fa61e6193ee4", "1b3b0f879f1cae1d734607a0f29e0ceecb186384e39a37232e60b0adcaa56bc3", "87b77fe213a66b78866f4865882d62649c8b861df7adf383cffb6a781675ed52", "6ade15b536c50a88efc2d9dc958433b0ccfaf2908025b7672753e6bfce51c3c6", "ce409e47ce4a0d8468ba7e791fd5a7311fd600a167e3a2a60f4330d5460b65be", "f75fdd02ba73ff93e6ce5d36a6ccff3ad06f1b2e08f8918d42c912e073893a3e", "d8a6178cd60146bdbcd509e570a85bd958b969ead3e896e90e3f085f5da1c6bd"], #:prepare, fn() { for-each(fn(file) { run("patch", "--batch", "-d", "gnupg-2.4.9", "-p1", "-i", string-append("../", file)) }, list("0010-avoid-beta-warning.patch", "0020-avoid-regenerating-defsincdate-use-shipped-file.patch", "0110-avoid-simple-memory-dumps-via-ptrace.patch", "0210-dirmngr-hkp-avoid-potential-race-condition-when-some-host-die.patch", "0230-dirmngr-avoid-automatically-checking-upstream-swdb.patch", "0330-gpg-default-to-sha512-for-all-signature-types-on-rsa-keys.patch", "0340-gpg-prefer-sha512-and-sha384-in-personal-digest.patch", "0420-gpg-drop-import-clean-from-default-keyserver-import-options.patch", "fix-i18n.patch", "HACK-revert-rfc4880bis-default.patch")) run("rm", "-f", "gnupg-2.4.9/tests/gpgme/setup.scm") run("env", "-C", "gnupg-2.4.9", "AUTOCONF=autoconf", "AUTOHEADER=autoheader", "autoreconf", "-fi") }, #:build, fn() { root := get-environment-variable("VPAC_MAKEPKG_ROOT") ; libksba supplies ksba.pc. The installed gpgrt-config shell script reads ; that record for configure, including when the target cannot run here. run("env", string-append("GPGRT_CONFIG=", root, "/usr/bin/gpgrt-config"), "vinix-configure", "gnupg-2.4.9/configure", string-append("--with-libgpg-error-prefix=", root, "/usr"), string-append("--with-libgcrypt-prefix=", root, "/usr"), string-append("--with-libassuan-prefix=", root, "/usr"), string-append("--with-libksba-prefix=", root, "/usr"), string-append("--with-npth-prefix=", root, "/usr"), "--localstatedir=/var", "--disable-nls", "--enable-tofu", "--disable-scdaemon", "--disable-ccid-driver", "--disable-dirmngr", "--disable-wks-tools", "--disable-ldap", "--disable-doc", "--disable-ntbtls") run("make") }, #:check, fn() { run("vinix-run", "g10/gpg", "--version") run("vinix-run", "agent/gpg-agent", "--version") run("python3", "check.py") }, #:package, fn() { run("make", "install", string-append("DESTDIR=", pkgdir())) run("rm", "-f", string-append(pkgdir(), "/usr/share/info/dir")) run("install", "-Dm644", "gnupg-2.4.9/COPYING", string-append(pkgdir(), "/usr/share/licenses/gnupg/COPYING")) })