Browse Source

Ports: Add GNU APL

Since the glyphs are being worked on, a APL interpreter seems like a
good way to use them.
Tobias Christiansen 3 years ago
parent
commit
3303feed91

+ 1 - 0
Ports/AvailablePorts.md

@@ -62,6 +62,7 @@ Please make sure to keep this list up to date when adding and updating ports. :^
 | [`gltron`](gltron/)                    | GLTron                                                          | 0.70                     | http://gltron.org                                                              |
 | [`glu`](glu/)                          | Mesa GLU                                                        | 9.0.2                    | https://gitlab.freedesktop.org/mesa/glu                                        |
 | [`gmp`](gmp/)                          | GNU Multiple Precision Arithmetic Library (GMP)                 | 6.2.1                    | https://gmplib.org/                                                            |
+| [`gnuapl`](gnuapl/)                    | GNU APL                                                         | 1.8                      | https://www.gnu.org/software/apl/                                              |
 | [`gnucobol`](gnucobol/)                | GnuCOBOL                                                        | 3.1.2                    | https://gnucobol.sourceforge.io/                                               |
 | [`gnupg`](gnupg/)                      | GnuPG                                                           | 2.3.0                    | https://gnupg.org/software/index.html                                          |
 | [`gnuplot`](gnuplot/)                  | Gnuplot                                                         | 5.2.8                    | http://www.gnuplot.info/                                                       |

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

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

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

+ 11 - 0
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"

+ 13 - 0
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;
+ }
+ 

+ 11 - 0
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*)