diff --git a/Ports/AvailablePorts.md b/Ports/AvailablePorts.md index 8962471b001..e84b1d2a972 100644 --- a/Ports/AvailablePorts.md +++ b/Ports/AvailablePorts.md @@ -7,6 +7,7 @@ Please make sure to keep this list up to date when adding and updating ports. :^ | [`Another-World`](Another-World/) | Another World Bytecode Interpreter | | https://github.com/fabiensanglard/Another-World-Bytecode-Interpreter | | [`angband`](angband/) | Angband | 4.2.4 | https://rephial.org | | [`bash`](bash/) | GNU Bash | 5.1.16 | https://www.gnu.org/software/bash/ | +| [`awk`](awk/) | The One True Awk | 20220122 | https://github.com/onetrueawk/awk | | [`bass`](bass/) | Beneath a Steel Sky | cd-1.2 | https://www.scummvm.org/games | | [`bc`](bc/) | bc | 5.1.1 | https://github.com/gavinhoward/bc | | [`bdwgc`](bdwgc/) | Boehm-Demers-Weiser Garbage Collector (libgc) | 8.0.6 | https://github.com/ivmai/bdwgc | diff --git a/Ports/awk/package.sh b/Ports/awk/package.sh new file mode 100755 index 00000000000..388b82f925c --- /dev/null +++ b/Ports/awk/package.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env -S bash ../.port_include.sh +port=awk +version=20220122 +useconfigure="false" +files="https://github.com/onetrueawk/awk/archive/refs/tags/${version}.tar.gz awk-${version}.tar.xz 720a06ff8dcc12686a5176e8a4c74b1295753df816e38468a6cf077562d54042" +auth_type=sha256 +patchlevel=1 + +build() { + run make "${makeopts[@]}" + run mv a.out awk +} + +install() { + run mkdir -p ${SERENITY_INSTALL_ROOT}/usr/local/bin/ + run cp awk ${SERENITY_INSTALL_ROOT}/usr/local/bin/ +} diff --git a/Ports/awk/patches/ReadMe.md b/Ports/awk/patches/ReadMe.md new file mode 100644 index 00000000000..d86d2af038e --- /dev/null +++ b/Ports/awk/patches/ReadMe.md @@ -0,0 +1,9 @@ +# Patches for the one true AWK + +## `build.patch` + +Patched the assigning of CC to allow override from environment + +## `version.patch` + +Patch the version descriptor in `main.c` to reflect the tag built diff --git a/Ports/awk/patches/build.patch b/Ports/awk/patches/build.patch new file mode 100644 index 00000000000..8d9ee4a74ad --- /dev/null +++ b/Ports/awk/patches/build.patch @@ -0,0 +1,15 @@ +diff --git a/makefile b/makefile +index 9ceaaad..6b9dff5 100644 +--- a/makefile ++++ b/makefile +@@ -31,8 +31,8 @@ CFLAGS = -O2 + #CC = gcc -Wall -g -Wwrite-strings + #CC = gcc -O4 -Wall -pedantic -fno-strict-aliasing + #CC = gcc -fprofile-arcs -ftest-coverage # then gcov f1.c; cat f1.c.gcov +-HOSTCC = gcc -g -Wall -pedantic -Wcast-qual +-CC = $(HOSTCC) # change this is cross-compiling. ++HOSTCC ?= gcc -g -Wall -pedantic -Wcast-qual ++CC ?= $(HOSTCC) # change this is cross-compiling. + + # By fiat, to make our lives easier, yacc is now defined to be bison. + # If you want something else, you're on your own. diff --git a/Ports/awk/patches/version.patch b/Ports/awk/patches/version.patch new file mode 100644 index 00000000000..482e027d8bb --- /dev/null +++ b/Ports/awk/patches/version.patch @@ -0,0 +1,11 @@ +--- a/main.c ++++ b/main.c +@@ -22,7 +22,7 @@ + THIS SOFTWARE. + ****************************************************************/ + +-const char *version = "version 20211208"; ++const char *version = "version 20220122"; + + #define DEBUG + #include