1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:17:35 +00:00

Ports: Added The One True AWK

This commit is contained in:
Mattias Nilsson 2022-04-04 22:05:38 +02:00 committed by Brian Gianforcaro
parent 8a46794ff8
commit 45d73f8ef9
5 changed files with 53 additions and 0 deletions

17
Ports/awk/package.sh Executable file
View file

@ -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/
}

View file

@ -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

View file

@ -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.

View file

@ -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>