From 3303feed91cd0b85c0c9b7452c43bbcfe006d00b Mon Sep 17 00:00:00 2001 From: Tobias Christiansen Date: Fri, 11 Mar 2022 19:01:35 +0100 Subject: Ports: Add GNU APL Since the glyphs are being worked on, a APL interpreter seems like a good way to use them. --- Ports/gnuapl/package.sh | 9 +++++++++ Ports/gnuapl/patches/ReadMe.md | 19 +++++++++++++++++++ Ports/gnuapl/patches/fix-common-includes.patch | 12 ++++++++++++ Ports/gnuapl/patches/stub-performance-macro.patch | 11 +++++++++++ Ports/gnuapl/patches/stub-sbrk.patch | 13 +++++++++++++ Ports/gnuapl/patches/sub-config.patch | 11 +++++++++++ 6 files changed, 75 insertions(+) create mode 100755 Ports/gnuapl/package.sh create mode 100644 Ports/gnuapl/patches/ReadMe.md create mode 100644 Ports/gnuapl/patches/fix-common-includes.patch create mode 100644 Ports/gnuapl/patches/stub-performance-macro.patch create mode 100644 Ports/gnuapl/patches/stub-sbrk.patch create mode 100644 Ports/gnuapl/patches/sub-config.patch (limited to 'Ports/gnuapl') 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 + #include + #include +-#include ++#include ++#include + + #ifdef ENABLE_NLS + #include 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*) -- cgit v1.2.3