From c2d9d0277f39a91fdfcc1276497f737976281162 Mon Sep 17 00:00:00 2001 From: Liav A Date: Sat, 12 Aug 2023 19:12:57 +0300 Subject: [PATCH] Ports: Add groff This port is exceptionally useful in the ports ecosystem, as it will allow us to read ROFF manual pages within the system. --- Ports/AvailablePorts.md | 1 + Ports/groff/package.sh | 15 ++++++++++++ .../0001-Include-config.h-in-math.h.patch | 23 +++++++++++++++++++ ...002-Don-t-redeclare-signbit-function.patch | 23 +++++++++++++++++++ Ports/groff/patches/ReadMe.md | 14 +++++++++++ 5 files changed, 76 insertions(+) create mode 100755 Ports/groff/package.sh create mode 100644 Ports/groff/patches/0001-Include-config.h-in-math.h.patch create mode 100644 Ports/groff/patches/0002-Don-t-redeclare-signbit-function.patch create mode 100644 Ports/groff/patches/ReadMe.md diff --git a/Ports/AvailablePorts.md b/Ports/AvailablePorts.md index 186034d122..beb6b611a6 100644 --- a/Ports/AvailablePorts.md +++ b/Ports/AvailablePorts.md @@ -104,6 +104,7 @@ This list is also available at [ports.serenityos.net](https://ports.serenityos.n | [`grep`](grep/) | GNU Grep | 3.10 | https://www.gnu.org/software/grep/ | | [`grepcidr`](grepcidr/) | grepcidr | 2.0 | http://www.pc-tools.net/unix/grepcidr/ | | [`griffon`](griffon/) | The Griffon Legend | 1.0 | https://www.scummvm.org/games/#games-griffon | +| [`groff`](groff/) | GNU roff | 1.22.4 | https://www.gnu.org/software/groff/ | | [`gsl`](gsl/) | GNU Scientific Library | 2.7.1 | https://www.gnu.org/software/gsl/ | | [`guile`](guile/) | The GNU guile programming language | 3.0.8 | https://www.gnu.org/software/guile/ | | [`gzip`](gzip/) | GNU gzip | 1.12 | https://www.gnu.org/software/gzip/ | diff --git a/Ports/groff/package.sh b/Ports/groff/package.sh new file mode 100755 index 0000000000..5bb6fc23c9 --- /dev/null +++ b/Ports/groff/package.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env -S bash ../.port_include.sh +port='groff' +version='1.22.4' +useconfigure='true' +use_fresh_config_sub='true' +config_sub_paths=('build-aux/config.sub') +files=( + "https://ftpmirror.gnu.org/gnu/groff/groff-${version}.tar.gz e78e7b4cb7dec310849004fa88847c44701e8d133b5d4c13057d876c1bad0293" +) +depends=( + 'libiconv' +) +configopts=( + '--with-doc=no' +) diff --git a/Ports/groff/patches/0001-Include-config.h-in-math.h.patch b/Ports/groff/patches/0001-Include-config.h-in-math.h.patch new file mode 100644 index 0000000000..674ad0fef8 --- /dev/null +++ b/Ports/groff/patches/0001-Include-config.h-in-math.h.patch @@ -0,0 +1,23 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Liav A +Date: Sat, 12 Aug 2023 19:14:23 +0300 +Subject: [PATCH] Include config.h in math.h + +Otherwise the build will fail due to #define(s) not being included. +--- + lib/math.in.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/lib/math.in.h b/lib/math.in.h +index c30fc202c0d31b7df331a9910dae0842511589ba..2b595710530c99ec4f4a6681e4e2b623716028d1 100644 +--- a/lib/math.in.h ++++ b/lib/math.in.h +@@ -33,6 +33,8 @@ + # include + #endif + ++#include ++ + #ifndef _GL_INLINE_HEADER_BEGIN + #error "Please include config.h first." + #endif diff --git a/Ports/groff/patches/0002-Don-t-redeclare-signbit-function.patch b/Ports/groff/patches/0002-Don-t-redeclare-signbit-function.patch new file mode 100644 index 0000000000..8c8ae9aa42 --- /dev/null +++ b/Ports/groff/patches/0002-Don-t-redeclare-signbit-function.patch @@ -0,0 +1,23 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Liav A +Date: Sat, 12 Aug 2023 19:15:27 +0300 +Subject: [PATCH] Don't redeclare signbit function + +We have it already implemented so simply use what we have. +--- + lib/math.in.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/math.in.h b/lib/math.in.h +index 2b595710530c99ec4f4a6681e4e2b623716028d1..419ab4a609ce0ecd753bb9673819144d81836d8b 100644 +--- a/lib/math.in.h ++++ b/lib/math.in.h +@@ -2344,7 +2344,7 @@ _GL_WARN_REAL_FLOATING_DECL (isnan); + #endif + + +-#if @GNULIB_SIGNBIT@ ++#if 0 + # if (@REPLACE_SIGNBIT_USING_GCC@ \ + && (!defined __cplusplus || __cplusplus < 201103)) + # undef signbit diff --git a/Ports/groff/patches/ReadMe.md b/Ports/groff/patches/ReadMe.md new file mode 100644 index 0000000000..8cebfaf9bc --- /dev/null +++ b/Ports/groff/patches/ReadMe.md @@ -0,0 +1,14 @@ +# Patches for groff on SerenityOS + +## `0001-Include-config.h-in-math.h.patch` + +Include config.h in math.h + +Otherwise the build will fail due to #define(s) not being included. + +## `0002-Don-t-redeclare-signbit-function.patch` + +Don't redeclare signbit function + +We have it already implemented so simply use what we have. +