Quellcode durchsuchen

Ports: Added The One True AWK

Mattias Nilsson vor 3 Jahren
Ursprung
Commit
45d73f8ef9

+ 1 - 0
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                                                 |

+ 17 - 0
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/
+}

+ 9 - 0
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

+ 15 - 0
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.

+ 11 - 0
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 <stdio.h>