Files
Misty De Meo 89852c9206 add G3 bottles for several packages
These bottles were built by Sevan; I've just handled the uploads.
2025-12-22 00:24:22 +00:00

59 lines
2.0 KiB
Ruby

class Gawk < Formula
desc "GNU awk utility"
homepage "https://www.gnu.org/software/gawk/"
url "http://ftpmirror.gnu.org/gawk/gawk-5.3.2.tar.xz"
mirror "https://ftp.gnu.org/gnu/gawk/gawk-5.3.2.tar.xz"
sha256 "f8c3486509de705192138b00ef2c00bbbdd0e84c30d5c07d23fc73a9dc4cc9cc"
bottle do
sha256 "65211cf52a893bdde1c31c6ff3dd3be0740e5dfd3d2c8a8898a3e6a451eb9596" => :tiger_g3
end
# spawn.h containing posix_spawnattr_* functions showed up in Leopard
# MAP_ANONYMOUS is not defined on Snow Leopard
patch :p0, :DATA
depends_on "mpfr"
depends_on "readline"
def install
system "./configure", "--disable-debug",
"--disable-dependency-tracking",
"--prefix=#{prefix}",
"--with-readline",
"--with-mpfr"
system "make"
system "make", "install"
end
test do
output = pipe_output("#{bin}/gawk '{ gsub(/Macro/, \"Home\"); print }' -", "Macrobrew")
assert_equal "Homebrew", output.strip
end
end
__END__
--- posix/gawkmisc.c.orig 2025-10-10 20:04:02.000000000 +0100
+++ posix/gawkmisc.c 2025-10-10 20:05:43.000000000 +0100
@@ -341,7 +341,7 @@
(void) unsetenv("GAWK_PMA_REINCARNATION");
}
#endif
-#ifdef HAVE__NSGETEXECUTABLEPATH
+#if defined(HAVE__NSGETEXECUTABLEPATH) && defined(HAVE_SPAWN_H)
// This code is for macos
if (persist_file != NULL) {
const char *cp = getenv("GAWK_PMA_REINCARNATION");
--- support/pma.c.orig 2025-11-16 00:19:56.000000000 +0000
+++ support/pma.c 2025-11-16 00:21:10.000000000 +0000
@@ -345,6 +345,10 @@
#define MAP_NORESERVE 0
#endif /* MAP_NORESERVE */
+#ifndef MAP_ANONYMOUS
+#define MAP_ANONYMOUS MAP_ANON
+#endif /* MAP_ANONYMOUS */
+
#define MMAP(N) mmap(NULL, (N), PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE, -1, 0)
#define MUNMAP(A, N) do { if (0 != munmap((A), (N))) { ERR("munmap()" ERN); SERN; } } while (0)
static void * addrgap(off_t n) { // find big gap in address space to map n bytes