From 6e16bccce7c9dce8b12965f60086529d0b400a95 Mon Sep 17 00:00:00 2001 From: carlocab <30379873+carlocab@users.noreply.github.com> Date: Tue, 17 Nov 2020 21:24:03 +0000 Subject: [PATCH 1/3] groff: fix build See https://github.com/Homebrew/homebrew-core/issues/65000#issuecomment-728899218 Builds on https://github.com/Homebrew/homebrew-core/pull/64842 - [x] Have you followed the [guidelines for contributing](https://github.com/Homebrew/homebrew-core/blob/HEAD/CONTRIBUTING.md)? - [x] Have you checked that there aren't other open [pull requests](https://github.com/Homebrew/homebrew-core/pulls) for the same formula update/change? - [x] Have you built your formula locally with `brew install --build-from-source `, where `` is the name of the formula you're submitting? - [x] Is your test running fine `brew test `, where `` is the name of the formula you're submitting? - [x] Does your build pass `brew audit --strict ` (after doing `brew install `)? Newly added dependencies are for creating PDF and HTML files, and for recognising file encoding. --- Formula/groff.rb | 157 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 155 insertions(+), 2 deletions(-) diff --git a/Formula/groff.rb b/Formula/groff.rb index 1515123d4f72d..803e8e688a96f 100644 --- a/Formula/groff.rb +++ b/Formula/groff.rb @@ -4,7 +4,7 @@ class Groff < Formula url "https://ftp.gnu.org/gnu/groff/groff-1.22.4.tar.gz" mirror "https://ftpmirror.gnu.org/groff/groff-1.22.4.tar.gz" sha256 "e78e7b4cb7dec310849004fa88847c44701e8d133b5d4c13057d876c1bad0293" - license "GPL-3.0" + license "GPL-3.0-or-later" livecheck do url :stable @@ -17,8 +17,21 @@ class Groff < Formula sha256 "2966f4b562c30eb6679d6940b43f4b99b2b625433e6a218489f160eb76c7c360" => :sierra end + depends_on "pkg-config" => :build + depends_on "ghostscript" + depends_on "netpbm" + depends_on "psutils" + depends_on "uchardet" + + uses_from_macos "libiconv" + uses_from_macos "perl" + + # See https://savannah.gnu.org/bugs/index.php?59276 + # Fixed in 1.23.0 + patch :DATA + def install - system "./configure", "--prefix=#{prefix}", "--without-x" + system "./configure", "--prefix=#{prefix}", "--without-x", "--with-uchardet" system "make" # Separate steps required system "make", "install" end @@ -28,3 +41,143 @@ def install pipe_output("#{bin}/groff -a", "homebrew\n") end end +__END__ +--- a/src/libs/libgroff/assert.cpp ++++ b/src/libs/libgroff/assert.cpp +@@ -16,6 +16,10 @@ for more details. + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif ++ + #include + #include + #include "assert.h" +--- a/src/libs/libgroff/errarg.cpp ++++ b/src/libs/libgroff/errarg.cpp +@@ -17,6 +17,10 @@ for more details. + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif ++ + #include + #include "assert.h" + #include "errarg.h" +--- a/src/libs/libgroff/error.cpp ++++ b/src/libs/libgroff/error.cpp +@@ -17,6 +17,10 @@ for more details. + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif ++ + #include + #include + #include +--- a/src/preproc/eqn/eqn.ypp ++++ b/src/preproc/eqn/eqn.ypp +@@ -16,6 +16,10 @@ for more details. + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + %{ ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif ++ + #include + #include + #include +--- a/src/libs/libgroff/curtime.cpp ++++ b/src/libs/libgroff/curtime.cpp +@@ -15,6 +15,10 @@ + The GNU General Public License version 2 (GPL2) is available in the + internet at . */ + ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif ++ + #include + #include + #include +--- a/src/libs/libgroff/device.cpp ++++ b/src/libs/libgroff/device.cpp +@@ -17,6 +17,7 @@ for more details. + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + ++#include "config.h" + #include + #include "device.h" + #include "defs.h" +--- a/src/libs/libgroff/fatal.cpp ++++ b/src/libs/libgroff/fatal.cpp +@@ -16,6 +16,7 @@ for more details. + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + ++#include "config.h" + #include + + #define FATAL_ERROR_EXIT_CODE 3 +--- a/src/libs/libgroff/string.cpp ++++ b/src/libs/libgroff/string.cpp +@@ -17,6 +17,10 @@ for more details. + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif ++ + #include + + #include "lib.h" +--- a/src/libs/libgroff/strsave.cpp ++++ b/src/libs/libgroff/strsave.cpp +@@ -17,6 +17,7 @@ for more details. + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + ++#include "config.h" + #include + #include + +--- a/src/preproc/eqn/text.cpp ++++ b/src/preproc/eqn/text.cpp +@@ -17,6 +17,7 @@ for more details. + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + ++#include "config.h" + #include + #include + #include "eqn.h" +--- a/src/preproc/eqn/other.cpp ++++ b/src/preproc/eqn/other.cpp +@@ -17,6 +17,7 @@ for more details. + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + ++#include "config.h" + #include + + #include "eqn.h" +--- a/src/preproc/pic/object.cpp ++++ b/src/preproc/pic/object.cpp +@@ -17,6 +17,8 @@ for more details. + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + ++#include "config.h" ++ + #include + + #include "pic.h" From 0594e15702749fbd54d99b2695a97c72110ba265 Mon Sep 17 00:00:00 2001 From: Jonathan Chang Date: Wed, 18 Nov 2020 12:31:34 +1100 Subject: [PATCH 2/3] Update groff.rb --- Formula/groff.rb | 145 ++--------------------------------------------- 1 file changed, 4 insertions(+), 141 deletions(-) diff --git a/Formula/groff.rb b/Formula/groff.rb index 803e8e688a96f..493a70d38a8df 100644 --- a/Formula/groff.rb +++ b/Formula/groff.rb @@ -28,7 +28,10 @@ class Groff < Formula # See https://savannah.gnu.org/bugs/index.php?59276 # Fixed in 1.23.0 - patch :DATA + patch do + url "https://raw.githubusercontent.com/Homebrew/formula-patches/8059b3027a4aa68d8f42e1281cc3a81449ca0010/groff/1.22.4.patch" + sha256 "aaea94b65169357a9a2c6e8f71dea35c87eed3e8f49aaa27003cd0893b54f7c4" + end def install system "./configure", "--prefix=#{prefix}", "--without-x", "--with-uchardet" @@ -41,143 +44,3 @@ def install pipe_output("#{bin}/groff -a", "homebrew\n") end end -__END__ ---- a/src/libs/libgroff/assert.cpp -+++ b/src/libs/libgroff/assert.cpp -@@ -16,6 +16,10 @@ for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -+#ifdef HAVE_CONFIG_H -+#include "config.h" -+#endif -+ - #include - #include - #include "assert.h" ---- a/src/libs/libgroff/errarg.cpp -+++ b/src/libs/libgroff/errarg.cpp -@@ -17,6 +17,10 @@ for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -+#ifdef HAVE_CONFIG_H -+#include "config.h" -+#endif -+ - #include - #include "assert.h" - #include "errarg.h" ---- a/src/libs/libgroff/error.cpp -+++ b/src/libs/libgroff/error.cpp -@@ -17,6 +17,10 @@ for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -+#ifdef HAVE_CONFIG_H -+#include "config.h" -+#endif -+ - #include - #include - #include ---- a/src/preproc/eqn/eqn.ypp -+++ b/src/preproc/eqn/eqn.ypp -@@ -16,6 +16,10 @@ for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - %{ -+#ifdef HAVE_CONFIG_H -+#include "config.h" -+#endif -+ - #include - #include - #include ---- a/src/libs/libgroff/curtime.cpp -+++ b/src/libs/libgroff/curtime.cpp -@@ -15,6 +15,10 @@ - The GNU General Public License version 2 (GPL2) is available in the - internet at . */ - -+#ifdef HAVE_CONFIG_H -+#include "config.h" -+#endif -+ - #include - #include - #include ---- a/src/libs/libgroff/device.cpp -+++ b/src/libs/libgroff/device.cpp -@@ -17,6 +17,7 @@ for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -+#include "config.h" - #include - #include "device.h" - #include "defs.h" ---- a/src/libs/libgroff/fatal.cpp -+++ b/src/libs/libgroff/fatal.cpp -@@ -16,6 +16,7 @@ for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -+#include "config.h" - #include - - #define FATAL_ERROR_EXIT_CODE 3 ---- a/src/libs/libgroff/string.cpp -+++ b/src/libs/libgroff/string.cpp -@@ -17,6 +17,10 @@ for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -+#ifdef HAVE_CONFIG_H -+#include "config.h" -+#endif -+ - #include - - #include "lib.h" ---- a/src/libs/libgroff/strsave.cpp -+++ b/src/libs/libgroff/strsave.cpp -@@ -17,6 +17,7 @@ for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -+#include "config.h" - #include - #include - ---- a/src/preproc/eqn/text.cpp -+++ b/src/preproc/eqn/text.cpp -@@ -17,6 +17,7 @@ for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -+#include "config.h" - #include - #include - #include "eqn.h" ---- a/src/preproc/eqn/other.cpp -+++ b/src/preproc/eqn/other.cpp -@@ -17,6 +17,7 @@ for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -+#include "config.h" - #include - - #include "eqn.h" ---- a/src/preproc/pic/object.cpp -+++ b/src/preproc/pic/object.cpp -@@ -17,6 +17,8 @@ for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -+#include "config.h" -+ - #include - - #include "pic.h" From f20b510e937b40882a96b5194104be44b07312a1 Mon Sep 17 00:00:00 2001 From: Jonathan Chang Date: Wed, 18 Nov 2020 12:33:51 +1100 Subject: [PATCH 3/3] Update groff.rb --- Formula/groff.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/Formula/groff.rb b/Formula/groff.rb index 493a70d38a8df..641c6585382d3 100644 --- a/Formula/groff.rb +++ b/Formula/groff.rb @@ -5,6 +5,7 @@ class Groff < Formula mirror "https://ftpmirror.gnu.org/groff/groff-1.22.4.tar.gz" sha256 "e78e7b4cb7dec310849004fa88847c44701e8d133b5d4c13057d876c1bad0293" license "GPL-3.0-or-later" + revision 1 livecheck do url :stable