From 0a600a3c36ffc7b2edb6de91ba24d48a839913b7 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 14 Apr 2021 04:33:14 +0200 Subject: [PATCH] Ports: Add gnupg port --- Ports/AvailablePorts.md | 1 + Ports/gnupg/package.sh | 22 ++++++++++++++++++++++ Ports/gnupg/patches/configure.patch | 12 ++++++++++++ 3 files changed, 35 insertions(+) create mode 100755 Ports/gnupg/package.sh create mode 100644 Ports/gnupg/patches/configure.patch diff --git a/Ports/AvailablePorts.md b/Ports/AvailablePorts.md index c5adf2dcb1cb4b..178fd5873a0141 100644 --- a/Ports/AvailablePorts.md +++ b/Ports/AvailablePorts.md @@ -33,6 +33,7 @@ Please make sure to keep this list up to date when adding and updating ports. :^ | [`git`](git/) | Git | 2.26.0 | https://git-scm.com/ | | [`gmp`](gmp/) | GNU Multiple Precision Arithmetic Library | 6.2.1 | https://gmplib.org/ | | [`gnucobol`](gnucobol/) | GnuCOBOL | 3.1.2 | https://gnucobol.sourceforge.io/ | +| [`gnupg`](gnupg/) | GnuPG | 2.3.0 | https://gnupg.org/software/index.html | | [`gnuplot`](gnuplot/) | Gnuplot | 5.2.8 | http://www.gnuplot.info/ | | [`grep`](grep/) | GNU Grep | 2.5.4 | https://www.gnu.org/software/grep/ | | [`hatari`](hatari/) | Atari ST/STE/TT/Falcon emulator | 2.4.0-devel | https://hatari.tuxfamily.org/ | diff --git a/Ports/gnupg/package.sh b/Ports/gnupg/package.sh new file mode 100755 index 00000000000000..2975f8d1d21341 --- /dev/null +++ b/Ports/gnupg/package.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env -S bash ../.port_include.sh +port=gnupg +version=2.3.0 +useconfigure=true +configopts="--with-libgpg-error-prefix=${SERENITY_BUILD_DIR}/Root/usr/local \ + --with-libgcrypt-prefix=${SERENITY_BUILD_DIR}/Root/usr/local \ + --with-libassuan-prefix=${SERENITY_BUILD_DIR}/Root/usr/local \ + --with-ntbtls-prefix=${SERENITY_BUILD_DIR}/Root/usr/local \ + --with-npth-prefix=${SERENITY_BUILD_DIR}/Root/usr/local \ + --disable-dirmngr" +files="https://gnupg.org/ftp/gcrypt/gnupg/gnupg-${version}.tar.bz2 gnupg-${version}.tar.bz2" +depends="libiconv libgpg-error libgcrypt libassuan npth ntbtls" + +pre_configure() { + export GPGRT_CONFIG="${SERENITY_BUILD_DIR}/Root/usr/local/bin/gpgrt-config" + export CFLAGS="-L${SERENITY_BUILD_DIR}/Root/usr/local/include" + export LDFLAGS="-L${SERENITY_BUILD_DIR}/Root/usr/local/lib -lm -liconv" +} + +configure() { + run ./configure --host="${SERENITY_ARCH}-pc-serenity" --build="$($workdir/build-aux/config.guess)" $configopts +} diff --git a/Ports/gnupg/patches/configure.patch b/Ports/gnupg/patches/configure.patch new file mode 100644 index 00000000000000..35539f705472d8 --- /dev/null +++ b/Ports/gnupg/patches/configure.patch @@ -0,0 +1,12 @@ +diff -Naur gnupg-2.3.0/build-aux/config.sub gnupg-2.3.0.serenity/build-aux/config.sub +--- gnupg-2.3.0/build-aux/config.sub 2017-03-17 09:34:37.000000000 +0100 ++++ gnupg-2.3.0.serenity/build-aux/config.sub 2021-04-14 01:12:00.264606451 +0200 +@@ -1381,7 +1381,7 @@ + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. +- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ ++ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* | -serenity* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* | -plan9* \