瀏覽代碼

Ports: Add libassuan port

Gunnar Beutner 4 年之前
父節點
當前提交
c3aac8cbe7

+ 1 - 0
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/                                 |
 | [`klong`](klong/)              | Klong                                         | 20190926          | http://t3x.org/klong/                                 |
 | [`less`](less/)                | less                                          | 530               | http://www.greenwoodsoftware.com/less/                |
 | [`less`](less/)                | less                                          | 530               | http://www.greenwoodsoftware.com/less/                |
 | [`libarchive`](libarchive/)    | libarchive                                    | 3.4.0             | https://libarchive.org/                               |
 | [`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/                           |
 | [`libexpat`](libexpat/)        | Expat                                         | 2.2.9             | https://libexpat.github.io/                           |
 | [`libffi`](libffi/)            | libffi                                        | 3.3               | https://www.sourceware.org/libffi/                    |
 | [`libffi`](libffi/)            | libffi                                        | 3.3               | https://www.sourceware.org/libffi/                    |
 | [`libiconv`](libiconv/)        | GNU libiconv                                  | 1.16              | https://www.gnu.org/software/libiconv/                |
 | [`libiconv`](libiconv/)        | GNU libiconv                                  | 1.16              | https://www.gnu.org/software/libiconv/                |

+ 15 - 0
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
+}

+ 12 - 0
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* \

+ 11 - 0
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 <sys/types.h>
++# include <sys/time.h>
+ # include <sys/socket.h>
+ # include <netinet/in.h>
+ # include <arpa/inet.h>

+ 16 - 0
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
+ }
+ 
+