summaryrefslogtreecommitdiff
path: root/Ports/gnuapl
diff options
context:
space:
mode:
authorTobias Christiansen <tobyase@serenityos.org>2022-03-11 19:01:35 +0100
committerLinus Groh <mail@linusgroh.de>2022-03-11 20:14:10 +0100
commit3303feed91cd0b85c0c9b7452c43bbcfe006d00b (patch)
tree3775aa2ab5af18ac3698a4af84b0987a1c4a6016 /Ports/gnuapl
parent38bb9afea863efda1e25e16e9a3352a7d4195e63 (diff)
downloadserenity-3303feed91cd0b85c0c9b7452c43bbcfe006d00b.zip
Ports: Add GNU APL
Since the glyphs are being worked on, a APL interpreter seems like a good way to use them.
Diffstat (limited to 'Ports/gnuapl')
-rwxr-xr-xPorts/gnuapl/package.sh9
-rw-r--r--Ports/gnuapl/patches/ReadMe.md19
-rw-r--r--Ports/gnuapl/patches/fix-common-includes.patch12
-rw-r--r--Ports/gnuapl/patches/stub-performance-macro.patch11
-rw-r--r--Ports/gnuapl/patches/stub-sbrk.patch13
-rw-r--r--Ports/gnuapl/patches/sub-config.patch11
6 files changed, 75 insertions, 0 deletions
diff --git a/Ports/gnuapl/package.sh b/Ports/gnuapl/package.sh
new file mode 100755
index 0000000000..9979cd89f5
--- /dev/null
+++ b/Ports/gnuapl/package.sh
@@ -0,0 +1,9 @@
+#!/usr/bin/env -S bash ../.port_include.sh
+
+port="gnuapl"
+version="1.8"
+useconfigure="true"
+workdir="apl-${version}"
+configopts=("CXX_WERROR=no")
+files="https://ftpmirror.gnu.org/gnu/apl/apl-${version}.tar.gz apl-${version}.tar.gz https://ftpmirror.gnu.org/gnu/apl/apl-${version}.tar.gz.sig"
+auth_type="md5"
diff --git a/Ports/gnuapl/patches/ReadMe.md b/Ports/gnuapl/patches/ReadMe.md
new file mode 100644
index 0000000000..9f5fd61e0a
--- /dev/null
+++ b/Ports/gnuapl/patches/ReadMe.md
@@ -0,0 +1,19 @@
+# Patches for GNU APL on SerenityOS
+
+## `fix-common-includes.patch`
+
+`fcntl.h` was included as `sys/fcntl.h`, which is not where this lives in Serenity.
+
+Also `sys/select.h` is included here.
+
+## `stub-performance-macro.patch`
+
+The Macro for performance reporting was throwing compile errors, so we just stub it out.
+
+## `stub-sbrk.patch`
+
+Again, for performance reporting the function `sbrk` is needed which we don't have. We just stub it out.
+
+## `sub-config.patch`
+
+The default change to `config.sub`: Add `serenity` as a valid target.
diff --git a/Ports/gnuapl/patches/fix-common-includes.patch b/Ports/gnuapl/patches/fix-common-includes.patch
new file mode 100644
index 0000000000..491c6f8559
--- /dev/null
+++ b/Ports/gnuapl/patches/fix-common-includes.patch
@@ -0,0 +1,12 @@
+--- apl-1.8/src/Common.hh
++++ apl-1.8/src/Common.hh
+@@ -26,7 +26,8 @@
+ #include <netinet/in.h>
+ #include <sys/un.h>
+ #include <sys/stat.h>
+-#include <sys/fcntl.h>
++#include <fcntl.h>
++#include <sys/select.h>
+
+ #ifdef ENABLE_NLS
+ #include <libintl.h>
diff --git a/Ports/gnuapl/patches/stub-performance-macro.patch b/Ports/gnuapl/patches/stub-performance-macro.patch
new file mode 100644
index 0000000000..d35dd7da38
--- /dev/null
+++ b/Ports/gnuapl/patches/stub-performance-macro.patch
@@ -0,0 +1,11 @@
+--- apl-1.8/src/Performance.cc
++++ apl-1.8/src/Performance.cc
+@@ -224,7 +224,7 @@ const uint64_t subsq_avg_AB = Statistics_record::average(sum_subsq_cycles_AB,
+ //
+ #define perfo_1(id, ab, _name, _thr)
+ #define perfo_2(id, ab, _name, _thr)
+-#define perfo_3(id, ab, _name, _thr) fs_ ## id ## ab.print(out);
++#define perfo_3(id, ab, _name, _thr)
+ #define perfo_4(id, ab, name, thr) perfo_3(id, ab, name, thr)
+
+ #include "Performance.def"
diff --git a/Ports/gnuapl/patches/stub-sbrk.patch b/Ports/gnuapl/patches/stub-sbrk.patch
new file mode 100644
index 0000000000..ab62be89d5
--- /dev/null
+++ b/Ports/gnuapl/patches/stub-sbrk.patch
@@ -0,0 +1,13 @@
+--- apl-1.8/src/sbrk.cc
++++ apl-1.8/src/sbrk.cc
+@@ -34,9 +34,6 @@ extern uint64_t top_of_memory();
+ uint64_t
+ top_of_memory()
+ {
+- if (sizeof(const void *) == 4)
+- return 0xFFFFFFFFULL & uint64_t(sbrk(0));
+- else
+- return uint64_t(sbrk(0));
++ return 0xFFFFFFFFULL;
+ }
+
diff --git a/Ports/gnuapl/patches/sub-config.patch b/Ports/gnuapl/patches/sub-config.patch
new file mode 100644
index 0000000000..a4c79c9058
--- /dev/null
+++ b/Ports/gnuapl/patches/sub-config.patch
@@ -0,0 +1,11 @@
+--- apl-1.8/config.sub
++++ apl-1.8/config.sub
+@@ -1290,7 +1290,7 @@ case $os in
+ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+- | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
++ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -serenity* )
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
+ -qnx*)