From 45f11706913d540214112dfb91811e25c5af3182 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 14 Apr 2021 04:32:34 +0200 Subject: [PATCH] Ports: Add libgpg-error port --- Ports/AvailablePorts.md | 1 + Ports/libgpg-error/package.sh | 14 +++++++++++++ Ports/libgpg-error/patches/configure.patch | 12 +++++++++++ Ports/libgpg-error/patches/includes.patch | 11 ++++++++++ Ports/libgpg-error/patches/syntax-error.patch | 11 ++++++++++ Ports/libgpg-error/patches/syscfg.patch | 21 +++++++++++++++++++ 6 files changed, 70 insertions(+) create mode 100755 Ports/libgpg-error/package.sh create mode 100644 Ports/libgpg-error/patches/configure.patch create mode 100644 Ports/libgpg-error/patches/includes.patch create mode 100644 Ports/libgpg-error/patches/syntax-error.patch create mode 100644 Ports/libgpg-error/patches/syscfg.patch diff --git a/Ports/AvailablePorts.md b/Ports/AvailablePorts.md index 25a08879fe..5f5a0c2456 100644 --- a/Ports/AvailablePorts.md +++ b/Ports/AvailablePorts.md @@ -45,6 +45,7 @@ Please make sure to keep this list up to date when adding and updating ports. :^ | [`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/ | +| [`libgpg-error`](libgpg-error/)| libgpg-error | 1.42 | https://gnupg.org/software/libgpg-error/index.html | | [`libiconv`](libiconv/) | GNU libiconv | 1.16 | https://www.gnu.org/software/libiconv/ | | [`libksba`](libksba/) | libksba | 1.5.1 | https://gnupg.org/software/libksba/index.html | | [`libjpeg`](libjpeg/) | libjpeg | 9d | https://ijg.org/ | diff --git a/Ports/libgpg-error/package.sh b/Ports/libgpg-error/package.sh new file mode 100755 index 0000000000..908b40ced1 --- /dev/null +++ b/Ports/libgpg-error/package.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env -S bash ../.port_include.sh +port=libgpg-error +version=1.42 +useconfigure=true +configopts="--disable-tests --disable-threads" +files="https://gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-${version}.tar.bz2 libgpg-error-${version}.tar.bz2" + +pre_configure() { + export gcry_cv_gcc_has_f_visibility=no +} + +configure() { + run ./configure --host="${SERENITY_ARCH}-pc-serenity" --build="$($workdir/build-aux/config.guess)" $configopts +} diff --git a/Ports/libgpg-error/patches/configure.patch b/Ports/libgpg-error/patches/configure.patch new file mode 100644 index 0000000000..8d9bb07b8c --- /dev/null +++ b/Ports/libgpg-error/patches/configure.patch @@ -0,0 +1,12 @@ +diff -Naur libgpg-error-1.42/build-aux/config.sub libgpg-error-1.42.serenity/build-aux/config.sub +--- libgpg-error-1.42/build-aux/config.sub 2018-10-24 10:00:20.000000000 +0200 ++++ libgpg-error-1.42.serenity/build-aux/config.sub 2021-04-14 01:15:34.040231143 +0200 +@@ -1333,7 +1333,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* | esix* | aix* | cnk* | sunos | sunos[34]*\ + | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ + | sym* | kopensolaris* | plan9* \ diff --git a/Ports/libgpg-error/patches/includes.patch b/Ports/libgpg-error/patches/includes.patch new file mode 100644 index 0000000000..f3959a4c1c --- /dev/null +++ b/Ports/libgpg-error/patches/includes.patch @@ -0,0 +1,11 @@ +diff -Naur libgpg-error-1.42/src/mkerrcodes.c libgpg-error-1.42.serenity/src/mkerrcodes.c +--- libgpg-error-1.42/src/mkerrcodes.c 2016-11-16 13:22:03.000000000 +0100 ++++ libgpg-error-1.42.serenity/src/mkerrcodes.c 2021-04-14 01:38:44.112242487 +0200 +@@ -22,6 +22,7 @@ + system, while this file will be run on the build system. */ + + #include ++#include + + #include "mkerrcodes.h" + diff --git a/Ports/libgpg-error/patches/syntax-error.patch b/Ports/libgpg-error/patches/syntax-error.patch new file mode 100644 index 0000000000..26bd22a5ff --- /dev/null +++ b/Ports/libgpg-error/patches/syntax-error.patch @@ -0,0 +1,11 @@ +diff -Naur libgpg-error-1.42/src/gen-lock-obj.sh libgpg-error-1.42.serenity/src/gen-lock-obj.sh +--- libgpg-error-1.42/src/gen-lock-obj.sh 2021-03-04 11:05:29.000000000 +0100 ++++ libgpg-error-1.42.serenity/src/gen-lock-obj.sh 2021-04-14 02:17:50.977517154 +0200 +@@ -124,7 +124,6 @@ + fi + + cat <<'EOF' +-}}} + ## + ## Local Variables: + ## mode: c diff --git a/Ports/libgpg-error/patches/syscfg.patch b/Ports/libgpg-error/patches/syscfg.patch new file mode 100644 index 0000000000..3ad208d305 --- /dev/null +++ b/Ports/libgpg-error/patches/syscfg.patch @@ -0,0 +1,21 @@ +diff -Naur libgpg-error-1.42/src/syscfg/lock-obj-pub.i686-pc-serenity.h libgpg-error-1.42.serenity/src/syscfg/lock-obj-pub.i686-pc-serenity.h +--- libgpg-error-1.42/src/syscfg/lock-obj-pub.i686-pc-serenity.h 1970-01-01 01:00:00.000000000 +0100 ++++ libgpg-error-1.42.serenity/src/syscfg/lock-obj-pub.i686-pc-serenity.h 2021-04-14 01:24:29.444700685 +0200 +@@ -0,0 +1,17 @@ ++## lock-obj-pub.i686-pc-serenity.h - NO LOCK SUPPORT ++## File created by gen-posix-lock-obj - DO NOT EDIT ++## To be included by mkheader into gpg-error.h ++ ++/* Dummy object - no locking available. */ ++typedef struct ++{ ++ long _vers; ++} gpgrt_lock_t; ++ ++#define GPGRT_LOCK_INITIALIZER {-1} ++## ++## Local Variables: ++## mode: c ++## buffer-read-only: t ++## End: ++##