From c3aac8cbe74b405302b08733cd8ac1c506cf636c Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 14 Apr 2021 04:32:19 +0200 Subject: [PATCH] Ports: Add libassuan port --- Ports/AvailablePorts.md | 1 + Ports/libassuan/package.sh | 15 +++++++++++++++ Ports/libassuan/patches/configure.patch | 12 ++++++++++++ Ports/libassuan/patches/includes.patch | 11 +++++++++++ Ports/libassuan/patches/socketpair.patch | 16 ++++++++++++++++ 5 files changed, 55 insertions(+) create mode 100755 Ports/libassuan/package.sh create mode 100644 Ports/libassuan/patches/configure.patch create mode 100644 Ports/libassuan/patches/includes.patch create mode 100644 Ports/libassuan/patches/socketpair.patch diff --git a/Ports/AvailablePorts.md b/Ports/AvailablePorts.md index 030f4ae157..25a08879fe 100644 --- a/Ports/AvailablePorts.md +++ b/Ports/AvailablePorts.md @@ -42,6 +42,7 @@ Please make sure to keep this list up to date when adding and updating ports. :^ | [`klong`](klong/) | Klong | 20190926 | http://t3x.org/klong/ | | [`less`](less/) | less | 530 | http://www.greenwoodsoftware.com/less/ | | [`libarchive`](libarchive/) | libarchive | 3.4.0 | https://libarchive.org/ | +| [`libassuan`](libassuan/) | libassuan | 2.5.5 | https://gnupg.org/software/libassuan/index.html | | [`libexpat`](libexpat/) | Expat | 2.2.9 | https://libexpat.github.io/ | | [`libffi`](libffi/) | libffi | 3.3 | https://www.sourceware.org/libffi/ | | [`libiconv`](libiconv/) | GNU libiconv | 1.16 | https://www.gnu.org/software/libiconv/ | diff --git a/Ports/libassuan/package.sh b/Ports/libassuan/package.sh new file mode 100755 index 0000000000..edbb5b5798 --- /dev/null +++ b/Ports/libassuan/package.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env -S bash ../.port_include.sh +port=libassuan +version=2.5.5 +useconfigure=true +#configopts="--with-libgpg-error-prefix=${SERENITY_BUILD_DIR}/Root/usr/local" +files="https://gnupg.org/ftp/gcrypt/libassuan/libassuan-${version}.tar.bz2 libassuan-${version}.tar.bz2" + +pre_configure() { + export gcry_cv_gcc_has_f_visibility=no + export ac_cv_lib_pthread_pthread_create=no +} + +configure() { + run ./configure --host="${SERENITY_ARCH}-pc-serenity" --build="$($workdir/build-aux/config.guess)" $configopts +} diff --git a/Ports/libassuan/patches/configure.patch b/Ports/libassuan/patches/configure.patch new file mode 100644 index 0000000000..cca8809e60 --- /dev/null +++ b/Ports/libassuan/patches/configure.patch @@ -0,0 +1,12 @@ +diff -Naur libassuan-2.5.5/build-aux/config.sub libassuan-2.5.5.serenity/build-aux/config.sub +--- libassuan-2.5.5/build-aux/config.sub 2016-07-13 19:01:14.000000000 +0200 ++++ libassuan-2.5.5.serenity/build-aux/config.sub 2021-04-14 02:35:26.315797397 +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* \ diff --git a/Ports/libassuan/patches/includes.patch b/Ports/libassuan/patches/includes.patch new file mode 100644 index 0000000000..3cf627fb92 --- /dev/null +++ b/Ports/libassuan/patches/includes.patch @@ -0,0 +1,11 @@ +diff -Naur libassuan-2.5.5/src/assuan-socket.c libassuan-2.5.5.serenity/src/assuan-socket.c +--- libassuan-2.5.5/src/assuan-socket.c 2021-04-14 02:38:16.911542870 +0200 ++++ libassuan-2.5.5.serenity/src/assuan-socket.c 2021-04-14 02:37:37.497571703 +0200 +@@ -34,6 +34,7 @@ + #endif + #else + # include ++# include + # include + # include + # include diff --git a/Ports/libassuan/patches/socketpair.patch b/Ports/libassuan/patches/socketpair.patch new file mode 100644 index 0000000000..61d318bac4 --- /dev/null +++ b/Ports/libassuan/patches/socketpair.patch @@ -0,0 +1,16 @@ +diff -Naur libassuan-2.5.5/src/system-posix.c libassuan-2.5.5.serenity/src/system-posix.c +--- libassuan-2.5.5/src/system-posix.c 2021-04-14 02:40:14.020341296 +0200 ++++ libassuan-2.5.5.serenity/src/system-posix.c 2021-04-14 02:39:56.823341349 +0200 +@@ -412,7 +412,12 @@ + __assuan_socketpair (assuan_context_t ctx, int namespace, int style, + int protocol, assuan_fd_t filedes[2]) + { ++#ifndef __serenity__ + return socketpair (namespace, style, protocol, filedes); ++#else ++ errno = ENOTSUP; ++ return -1; ++#endif + } + +