From 509b60329949662ff33bf4b7d2aa0756cb31bd09 Mon Sep 17 00:00:00 2001
From: Lee Starnes <lee@canned-death.us>
Date: Sat, 18 Apr 2020 05:41:03 +0000
Subject: [PATCH 1/8] user/libsigsegv: import from Alpine

---
 user/libsigsegv/APKBUILD | 41 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)
 create mode 100644 user/libsigsegv/APKBUILD

diff --git a/user/libsigsegv/APKBUILD b/user/libsigsegv/APKBUILD
new file mode 100644
index 0000000000..05d266d3ae
--- /dev/null
+++ b/user/libsigsegv/APKBUILD
@@ -0,0 +1,41 @@
+# Contributor: Carlo Landmeter <clandmeter@gmail.com>
+# Contributor: Lee Starnes <lee@canned-death.us>
+# Maintainer: Lee Starnes <lee@canned-death.us>
+pkgname=libsigsegv
+pkgver=2.12
+pkgrel=0
+pkgdesc="A library for handling page faults in user mode"
+url="https://www.gnu.org/software/libsigsegv"
+arch="all"
+license="GPL-2.0-or-later"
+depends=""
+makedepends=""
+subpackages="$pkgname-dev"
+source="https://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.gz"
+builddir="$srcdir/$pkgname-$pkgver"
+
+build() {
+	./configure \
+		--prefix=/usr \
+		--build=$CBUILD \
+		--host=$CHOST \
+		--localstatedir=/var \
+		--sysconfdir=/etc \
+		--enable-shared
+	make
+}
+
+check() {
+	make check
+}
+
+package() {
+	make DESTDIR="$pkgdir" install
+	rm -r "$pkgdir"/usr/include
+}
+
+dev() {
+	install -D -m 0444 "$builddir"/src/sigsegv.h "$subpkgdir"/usr/include/sigsegv.h
+}
+
+sha512sums="27986e8aaf4357ed131032aa7c281a5a28c5759530c62bb76f034aea33959547dcaae805e06347a1f532f0488b72fbbbdac4400f74e8d3f2128511526e8a5913  libsigsegv-2.12.tar.gz"
-- 
GitLab


From eb9884ddc8c49fe36411ebdb178eec1033accd3f Mon Sep 17 00:00:00 2001
From: Lee Starnes <lee@canned-death.us>
Date: Sat, 18 Apr 2020 05:41:19 +0000
Subject: [PATCH 2/8] user/ffcall: import from Alpine

---
 user/ffcall/APKBUILD | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 user/ffcall/APKBUILD

diff --git a/user/ffcall/APKBUILD b/user/ffcall/APKBUILD
new file mode 100644
index 0000000000..6cc0f86850
--- /dev/null
+++ b/user/ffcall/APKBUILD
@@ -0,0 +1,39 @@
+# Contributor: Carlo Landmeter <clandmeter@gmail.com>
+# Contributor: Will Sinatra <wpsinatra@gmail.com>
+# Contributor: Lee Starnes <lee@canned-death.us>
+# Maintainer: Lee Starnes <lee@canned-death.us>
+pkgname=ffcall
+pkgver=2.2
+pkgrel=0
+pkgdesc="C library for implementing foreign function calls in embedded interpreterts"
+url="https://www.gnu.org/software/libffcall"
+arch="all"
+license="GPL-2.0-or-later"
+makedepends="$depends_dev"
+subpackages="$pkgname-dev $pkgname-doc"
+source="https://ftp.gnu.org/gnu/libffcall/libffcall-$pkgver.tar.gz"
+builddir="$srcdir/"/libffcall-$pkgver
+
+build() {
+	./configure \
+		--build=$CBUILD \
+		--host=$CHOST \
+		--prefix=/usr \
+		--sysconfdir=/etc \
+		--mandir=/usr/share/man \
+		--infodir=/usr/share/info \
+		--localstatedir=/var
+	# Fails to build if building in parallel
+	make -j1
+}
+
+check() {
+	make check
+}
+
+package() {
+	make DESTDIR="$pkgdir" htmldir=/usr/share/doc/ffcall install
+
+}
+
+sha512sums="b9d3ca4c67ab92915a8183d850153e585dcb58ceb2199a104426a7aae363d37017b1226440acd18a2db0cc207e044f71e932857189964261e8eaa6de5cef1731  libffcall-2.2.tar.gz"
-- 
GitLab


From e2de959186282f7808a01d4249933f9a89db0096 Mon Sep 17 00:00:00 2001
From: Lee Starnes <lee@canned-death.us>
Date: Sat, 18 Apr 2020 05:41:59 +0000
Subject: [PATCH 3/8] user/clisp: import/adapt from Alpine

---
 user/clisp/APKBUILD        | 47 ++++++++++++++++++++++++++++++++++++++
 user/clisp/no-page.h.patch | 12 ++++++++++
 2 files changed, 59 insertions(+)
 create mode 100644 user/clisp/APKBUILD
 create mode 100644 user/clisp/no-page.h.patch

diff --git a/user/clisp/APKBUILD b/user/clisp/APKBUILD
new file mode 100644
index 0000000000..bdca17a85b
--- /dev/null
+++ b/user/clisp/APKBUILD
@@ -0,0 +1,47 @@
+# Contributor: Soren Tempel <soeren+alpine@soeren-tempel.net>
+# Contrubutor: Carlo Landmeter <clandmeter@gmail.com>
+# Contributor: Lee Starnes <lee@canned-death.us>
+# Maintainer: Lee Starnes <lee@canned-death.us>
+pkgname=clisp
+pkgver=2.49
+pkgrel=0
+pkgdesc="ANSI Common Lisp interpreter, compiler, and debugger"
+url="https://clisp.sourceforge.io"
+arch="all"
+license="GPL-2.0-only"
+depends="libsigsegv"
+depends_dev="libsigsegv-dev ffcall ncurses-dev"
+makedepends="$depends_dev"
+subpackages="$pkgname-dev $pkgname-doc"
+source="https://downloads.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.bz2
+	no-page.h.patch"
+builddir="$srcdir/$pkgname-$pkgver"
+
+prepare() {
+	default_prepare
+	update_config_sub
+}
+
+build() {
+	ulimit -s 16384
+
+	./configure \
+		--prefix=/usr \
+		--with-ffcall \
+		--mandir=/usr/share/man \
+		--infodir=/usr/share/info\
+		"$builddir"
+	# Parallel builds fail
+	make -j1
+}
+
+check() {
+	make check
+}
+
+package() {
+	make -j1 DESTDIR="$pkgdir" install
+}
+
+sha512sums="eef66fc85199a2c283b616db61bf67ff103eeb0f19fa907da48994dc790b6f5f8d0c74fb3bd723c6b827c0ff3cfd89fa6ba67934fc669ed5d5249044b5140d81  clisp-2.49.tar.bz2
+86273c5d5d05a8d41ab6311192e0c757d3f7fe4d78546590830aa00f8c2f170fcb08f66ea739ae8834cec00cdf0f6a20824eb6a3d0f6df97be405c26b1cc5d39  no-page.h.patch"
diff --git a/user/clisp/no-page.h.patch b/user/clisp/no-page.h.patch
new file mode 100644
index 0000000000..aafb98a31e
--- /dev/null
+++ b/user/clisp/no-page.h.patch
@@ -0,0 +1,12 @@
+--- a/src/unix.d
++++ b/src/unix.d
+@@ -135,9 +135,6 @@
+   #ifdef UNIX_AUX
+     #include <sys/mmu.h> /* for SHMLBA */
+   #endif
+-  #if defined(UNIX_LINUX) && !defined(UNIX_GNU)
+-    #include <asm/page.h> /* for SHMLBA on Linux 2.0 */
+-  #endif
+ /* <sys/shm.h> declares shmget(), shmat(), shmdt(), shmctl() */
+ #endif
+ /* used by SPVW, STREAM */
-- 
GitLab


From 4ffe35c312b2dc8d34db57ba9ed5ce2ed1b02d94 Mon Sep 17 00:00:00 2001
From: Lee Starnes <lee@canned-death.us>
Date: Sat, 18 Apr 2020 09:43:10 +0000
Subject: [PATCH 4/8] experimental/sbcl: create

---
 experimental/sbcl/APKBUILD        |  39 +++++++
 experimental/sbcl/musl-libc.patch | 180 ++++++++++++++++++++++++++++++
 2 files changed, 219 insertions(+)
 create mode 100644 experimental/sbcl/APKBUILD
 create mode 100644 experimental/sbcl/musl-libc.patch

diff --git a/experimental/sbcl/APKBUILD b/experimental/sbcl/APKBUILD
new file mode 100644
index 0000000000..ac8408bcbd
--- /dev/null
+++ b/experimental/sbcl/APKBUILD
@@ -0,0 +1,39 @@
+# Contributor: Lee Starnes <lee@canned-death.us>
+# Maintainer: Lee Starnes <lee@canned-death.us>
+pkgname=sbcl
+pkgver=2.0.3
+pkgrel=0
+pkgdesc="Steel Bank Common Lisp"
+url="http://www.sbcl.org"
+arch="pmmx x86_64 ppc ppc64 aarch64"
+license="BSD-2-Clause AND BSD-2-Clause-FreeBSD AND BSD-3-Clause AND MIT"
+depends=""
+makedepends="clisp clisp-dev"
+checkdepends="ed"
+subpackages="$pkgname-doc"
+# Patch provided by Eric Timmons: https://bugs.launchpad.net/sbcl/+bug/1768368
+source="https://sourceforge.net/projects/$pkgname/files/$pkgname/$pkgver/$pkgname-$pkgver-source.tar.bz2
+	musl-libc.patch"
+builddir="$srcdir/$pkgname-$pkgver"
+
+prepare() {
+	default_prepare
+	
+	# run-program test is hard-coded to use /bin/ed but it should be /usr/bin/ed
+	sed -i 's,/bin/ed,/usr/bin/ed,g' tests/run-program.impure.lisp
+}
+
+build() {
+	sh make.sh --prefix=/usr --with-dlclose-is-noop --xc-host=clisp
+}
+
+check() {
+	cd tests && sh run-tests.sh
+}
+
+package() {
+	INSTALL_ROOT="$pkgdir"/usr sh install.sh 
+}
+
+sha512sums="c29c115fff0e118e5c05959dd8d73ae876458daeb5ddde67ce485b10e6d1583b1f8a9597b54b45606696ab1b1eea5392dcb09357c83fce31323f2a5a154f2dd1  sbcl-2.0.3-source.tar.bz2
+e6757e4cc623682c501ab5e255a881833ff393efac829ffe9f67fff0a005724c3c03a23352b4c88d58b3d15dbb0cf33c8cc58d72d3795abb2f12a4bca4302165  musl-libc.patch"
diff --git a/experimental/sbcl/musl-libc.patch b/experimental/sbcl/musl-libc.patch
new file mode 100644
index 0000000000..1aa5cb5573
--- /dev/null
+++ b/experimental/sbcl/musl-libc.patch
@@ -0,0 +1,180 @@
+diff --git a/contrib/sb-bsd-sockets/constants.lisp b/contrib/sb-bsd-sockets/constants.lisp
+index 88f5bb7c4..23fd87277 100644
+--- a/contrib/sb-bsd-sockets/constants.lisp
++++ b/contrib/sb-bsd-sockets/constants.lisp
+@@ -93,8 +93,8 @@
+  (:integer EAFNOSUPPORT "EAFNOSUPPORT")
+  (:integer EINPROGRESS "EINPROGRESS")
+ 
+- (:integer NETDB-INTERNAL #+hpux "h_NETDB_INTERNAL" #-hpux "NETDB_INTERNAL" "See errno.")
+- (:integer NETDB-SUCCESS #+hpux "h_NETDB_SUCCESS" #-hpux "NETDB_SUCCESS" "No problem.")
++ (:integer-no-check NETDB-INTERNAL #-os-provides-netdb-internal "-1" #+(and os-provides-netdb-internal hpux) "h_NETDB_INTERNAL" #+(and os-provides-netdb-internal (not hpux)) "NETDB_INTERNAL" "See errno.")
++ (:integer-no-check NETDB-SUCCESS #-os-provides-netdb-internal "0" #+(and os-provides-netdb-internal hpux) "h_NETDB_SUCCESS" #+(and os-provides-netdb-internal (not hpux)) "NETDB_SUCCESS" "No problem.")
+  (:integer HOST-NOT-FOUND "HOST_NOT_FOUND" "Authoritative Answer Host not found.")
+  (:integer TRY-AGAIN "TRY_AGAIN" "Non-Authoritative Host not found, or SERVERFAIL.")
+  (:integer NO-RECOVERY "NO_RECOVERY" "Non recoverable errors, FORMERR, REFUSED, NOTIMP.")
+diff --git a/src/runtime/linux-os.c b/src/runtime/linux-os.c
+index fa4f5e490..60b5fea4e 100644
+--- a/src/runtime/linux-os.c
++++ b/src/runtime/linux-os.c
+@@ -187,8 +187,15 @@ isnptl (void)
+       if (strstr (buf, "NPTL")) {
+           return 1;
+       }
++      else {
++          return 0;
++      }
++  }
++  else {
++      /* If the configuration variable is empty, just assume we have a
++       * good enough thread implementation. */
++      return 1;
+   }
+-  return 0;
+ }
+ #endif
+ 
+diff --git a/tests/foreign.test.sh b/tests/foreign.test.sh
+index 7fb757813..9ba8ed3cf 100755
+--- a/tests/foreign.test.sh
++++ b/tests/foreign.test.sh
+@@ -248,16 +248,23 @@ cat > $TEST_FILESTEM.test.lisp <<EOF
+   (assert (= 13 foo))
+   (assert (= 42 (bar)))
+   (note "/original definitions ok")
+-  (rename-file "$TEST_FILESTEM-b.so" "$TEST_FILESTEM-b.bak")
+-  (rename-file "$TEST_FILESTEM-b2.so" "$TEST_FILESTEM-b.so")
+-  (load-shared-object (truename "$TEST_FILESTEM-b.so"))
+-  (note "/reloading ok")
+-  (assert (= 42 foo))
+-  (assert (= 13 (bar)))
+-  (note "/redefined versions ok")
+-  (rename-file "$TEST_FILESTEM-b.so" "$TEST_FILESTEM-b2.so")
+-  (rename-file "$TEST_FILESTEM-b.bak" "$TEST_FILESTEM-b.so")
+-  (note "/renamed back to originals")
++  ;; test late resolution
++  (eval-when (:compile-toplevel :load-toplevel :execute)
++   (setq *features* (union *features* sb-impl:+internal-features+)))
++  #+dlclose-is-noop
++  (note "/skipping reloading tests")
++  #-dlclose-is-noop
++  (progn
++    (rename-file "$TEST_FILESTEM-b.so" "$TEST_FILESTEM-b.bak")
++    (rename-file "$TEST_FILESTEM-b2.so" "$TEST_FILESTEM-b.so")
++    (load-shared-object (truename "$TEST_FILESTEM-b.so"))
++    (note "/reloading ok")
++    (assert (= 42 foo))
++    (assert (= 13 (bar)))
++    (note "/redefined versions ok")
++    (rename-file "$TEST_FILESTEM-b.so" "$TEST_FILESTEM-b2.so")
++    (rename-file "$TEST_FILESTEM-b.bak" "$TEST_FILESTEM-b.so")
++    (note "/renamed back to originals"))
+ 
+   ;; test late resolution
+   #+linkage-table
+@@ -274,13 +278,17 @@ cat > $TEST_FILESTEM.test.lisp <<EOF
+     (load-shared-object (truename "$TEST_FILESTEM-c.so"))
+     (assert (= 43 late-foo))
+     (assert (= 14 (late-bar)))
+-    (unload-shared-object (truename "$TEST_FILESTEM-c.so"))
+-    (multiple-value-bind (val err) (ignore-errors late-foo)
+-      (assert (not val))
+-      (assert (typep err 'undefined-alien-error)))
+-    (multiple-value-bind (val err) (ignore-errors (late-bar))
+-      (assert (not val))
+-      (assert (typep err 'undefined-alien-error)))
++    #+dlclose-is-noop
++    (note "/skipping unloading tests")
++    #-dlclose-is-noop
++    (progn
++      (unload-shared-object (truename "$TEST_FILESTEM-c.so"))
++      (multiple-value-bind (val err) (ignore-errors late-foo)
++        (assert (not val))
++        (assert (typep err 'undefined-alien-error)))
++      (multiple-value-bind (val err) (ignore-errors (late-bar))
++        (assert (not val))
++        (assert (typep err 'undefined-alien-error))))
+     (note "/linkage table ok"))
+ 
+   (sb-ext:exit :code $EXIT_LISP_WIN) ; success convention for Lisp program
+diff --git a/tools-for-build/Makefile b/tools-for-build/Makefile
+index 3f6e4ecf9..39bab2b92 100644
+--- a/tools-for-build/Makefile
++++ b/tools-for-build/Makefile
+@@ -16,6 +16,9 @@ LDLIBS:=$(OS_LIBS)
+ 
+ all: grovel-headers determine-endianness where-is-mcontext
+ 
++dlclose-is-noop-test-helper.so: dlclose-is-noop-test-helper.c
++	@$(CC) $(LDFLAGS) -shared $< -o $@ $(LOADLIBES) $(LDLIBS)
++
+ clean:
+ 	rm -f *.o grovel-headers determine-endianness where-is-mcontext
+ 	rm -f *.exe
+diff --git a/tools-for-build/dlclose-is-noop-test-helper.c b/tools-for-build/dlclose-is-noop-test-helper.c
+new file mode 100644
+index 000000000..4be7a8e5b
+--- /dev/null
++++ b/tools-for-build/dlclose-is-noop-test-helper.c
+@@ -0,0 +1 @@
++int sbcl_dl_close_test = 42;
+diff --git a/tools-for-build/dlclose-is-noop-test.c b/tools-for-build/dlclose-is-noop-test.c
+new file mode 100644
+index 000000000..f4eab26a5
+--- /dev/null
++++ b/tools-for-build/dlclose-is-noop-test.c
+@@ -0,0 +1,19 @@
++/* test to build and run so that we know if we have a noop dlclose
++ */
++
++#include <dlfcn.h>
++#include <stddef.h>
++
++int main ()
++{
++   void * handle = dlopen("./dlclose-is-noop-test-helper.so", RTLD_NOW | RTLD_GLOBAL);
++   dlclose(handle);
++
++   handle = dlopen("./dlclose-is-noop-test-helper.so", RTLD_NOW | RTLD_NOLOAD);
++
++   if (handle != NULL) {
++       return 104;
++   } else {
++       return 0;
++   }
++}
+diff --git a/tools-for-build/grovel-features.sh b/tools-for-build/grovel-features.sh
+index ffc4307eb..bf1448a6a 100644
+--- a/tools-for-build/grovel-features.sh
++++ b/tools-for-build/grovel-features.sh
+@@ -36,3 +36,12 @@
+ if [ "$sbcl_arch" = arm ] ; then
+    featurep arm-softfp
+ fi
++
++featurep os-provides-netdb-internal
++
++# We need a helper shared library to test dlclose-is-noop
++$GNUMAKE dlclose-is-noop-test-helper.so > /dev/null 2>&1
++
++featurep dlclose-is-noop
++
++rm -f dlclose-is-noop-test-helper.so
+diff --git a/tools-for-build/os-provides-netdb-internal-test.c b/tools-for-build/os-provides-netdb-internal-test.c
+new file mode 100644
+index 000000000..cab08cc41
+--- /dev/null
++++ b/tools-for-build/os-provides-netdb-internal-test.c
+@@ -0,0 +1,12 @@
++#include <netdb.h>
++
++int main ()
++{
++#if defined NETDB_INTERNAL && defined NETDB_SUCCESS
++    return 104;
++#elif defined h_NETDB_INTERNAL && defined h_NETDB_SUCCESS
++    return 104;
++#else
++    return 0;
++#endif
++}
-- 
GitLab


From 49240324ae699776f33d861d3ae7359350abd710 Mon Sep 17 00:00:00 2001
From: Lee Starnes <lee@canned-death.us>
Date: Sat, 18 Apr 2020 10:20:47 +0000
Subject: [PATCH 5/8] rename user/ffcall to libffcall; clean up others

---
 user/clisp/APKBUILD                 | 3 +--
 user/{ffcall => libffcall}/APKBUILD | 5 ++---
 user/libsigsegv/APKBUILD            | 8 +-------
 3 files changed, 4 insertions(+), 12 deletions(-)
 rename user/{ffcall => libffcall}/APKBUILD (92%)

diff --git a/user/clisp/APKBUILD b/user/clisp/APKBUILD
index bdca17a85b..f1d3473057 100644
--- a/user/clisp/APKBUILD
+++ b/user/clisp/APKBUILD
@@ -10,12 +10,11 @@ url="https://clisp.sourceforge.io"
 arch="all"
 license="GPL-2.0-only"
 depends="libsigsegv"
-depends_dev="libsigsegv-dev ffcall ncurses-dev"
+depends_dev="libsigsegv-dev libffcall ncurses-dev"
 makedepends="$depends_dev"
 subpackages="$pkgname-dev $pkgname-doc"
 source="https://downloads.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.bz2
 	no-page.h.patch"
-builddir="$srcdir/$pkgname-$pkgver"
 
 prepare() {
 	default_prepare
diff --git a/user/ffcall/APKBUILD b/user/libffcall/APKBUILD
similarity index 92%
rename from user/ffcall/APKBUILD
rename to user/libffcall/APKBUILD
index 6cc0f86850..67635fcf3e 100644
--- a/user/ffcall/APKBUILD
+++ b/user/libffcall/APKBUILD
@@ -2,17 +2,16 @@
 # Contributor: Will Sinatra <wpsinatra@gmail.com>
 # Contributor: Lee Starnes <lee@canned-death.us>
 # Maintainer: Lee Starnes <lee@canned-death.us>
-pkgname=ffcall
+pkgname=libffcall
 pkgver=2.2
 pkgrel=0
 pkgdesc="C library for implementing foreign function calls in embedded interpreterts"
 url="https://www.gnu.org/software/libffcall"
 arch="all"
-license="GPL-2.0-or-later"
+license="GPL-2.0+"
 makedepends="$depends_dev"
 subpackages="$pkgname-dev $pkgname-doc"
 source="https://ftp.gnu.org/gnu/libffcall/libffcall-$pkgver.tar.gz"
-builddir="$srcdir/"/libffcall-$pkgver
 
 build() {
 	./configure \
diff --git a/user/libsigsegv/APKBUILD b/user/libsigsegv/APKBUILD
index 05d266d3ae..bb21149a3d 100644
--- a/user/libsigsegv/APKBUILD
+++ b/user/libsigsegv/APKBUILD
@@ -7,12 +7,11 @@ pkgrel=0
 pkgdesc="A library for handling page faults in user mode"
 url="https://www.gnu.org/software/libsigsegv"
 arch="all"
-license="GPL-2.0-or-later"
+license="GPL-2.0+"
 depends=""
 makedepends=""
 subpackages="$pkgname-dev"
 source="https://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.gz"
-builddir="$srcdir/$pkgname-$pkgver"
 
 build() {
 	./configure \
@@ -31,11 +30,6 @@ check() {
 
 package() {
 	make DESTDIR="$pkgdir" install
-	rm -r "$pkgdir"/usr/include
-}
-
-dev() {
-	install -D -m 0444 "$builddir"/src/sigsegv.h "$subpkgdir"/usr/include/sigsegv.h
 }
 
 sha512sums="27986e8aaf4357ed131032aa7c281a5a28c5759530c62bb76f034aea33959547dcaae805e06347a1f532f0488b72fbbbdac4400f74e8d3f2128511526e8a5913  libsigsegv-2.12.tar.gz"
-- 
GitLab


From 0c2bd44a73d8a7c75162c819e105ba4d4ce9532e Mon Sep 17 00:00:00 2001
From: Lee Starnes <lee@canned-death.us>
Date: Sun, 19 Apr 2020 03:50:02 +0000
Subject: [PATCH 6/8] sbcl+libffcall: fix more issues

---
 experimental/sbcl/APKBUILD | 1 -
 user/libffcall/APKBUILD    | 4 ++--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/experimental/sbcl/APKBUILD b/experimental/sbcl/APKBUILD
index ac8408bcbd..9aa3c4cfc3 100644
--- a/experimental/sbcl/APKBUILD
+++ b/experimental/sbcl/APKBUILD
@@ -14,7 +14,6 @@ subpackages="$pkgname-doc"
 # Patch provided by Eric Timmons: https://bugs.launchpad.net/sbcl/+bug/1768368
 source="https://sourceforge.net/projects/$pkgname/files/$pkgname/$pkgver/$pkgname-$pkgver-source.tar.bz2
 	musl-libc.patch"
-builddir="$srcdir/$pkgname-$pkgver"
 
 prepare() {
 	default_prepare
diff --git a/user/libffcall/APKBUILD b/user/libffcall/APKBUILD
index 67635fcf3e..51e5fed8fc 100644
--- a/user/libffcall/APKBUILD
+++ b/user/libffcall/APKBUILD
@@ -5,11 +5,11 @@
 pkgname=libffcall
 pkgver=2.2
 pkgrel=0
-pkgdesc="C library for implementing foreign function calls in embedded interpreterts"
+pkgdesc="C library for implementing foreign function calls in embedded interpreters"
 url="https://www.gnu.org/software/libffcall"
 arch="all"
 license="GPL-2.0+"
-makedepends="$depends_dev"
+depends=""
 subpackages="$pkgname-dev $pkgname-doc"
 source="https://ftp.gnu.org/gnu/libffcall/libffcall-$pkgver.tar.gz"
 
-- 
GitLab


From 3bee57e565c131fc1702f0955efeca58906df6ee Mon Sep 17 00:00:00 2001
From: Lee Starnes <lee@canned-death.us>
Date: Sun, 19 Apr 2020 04:14:04 +0000
Subject: [PATCH 7/8] sbcl+clisp: more stylistic fixes

---
 experimental/sbcl/APKBUILD | 4 ++--
 user/clisp/APKBUILD        | 3 ---
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/experimental/sbcl/APKBUILD b/experimental/sbcl/APKBUILD
index 9aa3c4cfc3..86f9ab1f50 100644
--- a/experimental/sbcl/APKBUILD
+++ b/experimental/sbcl/APKBUILD
@@ -5,7 +5,7 @@ pkgver=2.0.3
 pkgrel=0
 pkgdesc="Steel Bank Common Lisp"
 url="http://www.sbcl.org"
-arch="pmmx x86_64 ppc ppc64 aarch64"
+arch="all !armv7"
 license="BSD-2-Clause AND BSD-2-Clause-FreeBSD AND BSD-3-Clause AND MIT"
 depends=""
 makedepends="clisp clisp-dev"
@@ -23,7 +23,7 @@ prepare() {
 }
 
 build() {
-	sh make.sh --prefix=/usr --with-dlclose-is-noop --xc-host=clisp
+	./make.sh --prefix=/usr --with-dlclose-is-noop --xc-host=clisp
 }
 
 check() {
diff --git a/user/clisp/APKBUILD b/user/clisp/APKBUILD
index f1d3473057..a95d343e03 100644
--- a/user/clisp/APKBUILD
+++ b/user/clisp/APKBUILD
@@ -9,7 +9,6 @@ pkgdesc="ANSI Common Lisp interpreter, compiler, and debugger"
 url="https://clisp.sourceforge.io"
 arch="all"
 license="GPL-2.0-only"
-depends="libsigsegv"
 depends_dev="libsigsegv-dev libffcall ncurses-dev"
 makedepends="$depends_dev"
 subpackages="$pkgname-dev $pkgname-doc"
@@ -22,8 +21,6 @@ prepare() {
 }
 
 build() {
-	ulimit -s 16384
-
 	./configure \
 		--prefix=/usr \
 		--with-ffcall \
-- 
GitLab


From f2aa66f3081104339eaa412f78ee35732c05ea2f Mon Sep 17 00:00:00 2001
From: Lee Starnes <lee@canned-death.us>
Date: Tue, 5 May 2020 06:58:31 +0000
Subject: [PATCH 8/8] Fix awilfox's review issues

---
 user/clisp/APKBUILD     | 3 ++-
 user/libffcall/APKBUILD | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/user/clisp/APKBUILD b/user/clisp/APKBUILD
index a95d343e03..d9f80ebef7 100644
--- a/user/clisp/APKBUILD
+++ b/user/clisp/APKBUILD
@@ -9,6 +9,7 @@ pkgdesc="ANSI Common Lisp interpreter, compiler, and debugger"
 url="https://clisp.sourceforge.io"
 arch="all"
 license="GPL-2.0-only"
+depends=""
 depends_dev="libsigsegv-dev libffcall ncurses-dev"
 makedepends="$depends_dev"
 subpackages="$pkgname-dev $pkgname-doc"
@@ -25,7 +26,7 @@ build() {
 		--prefix=/usr \
 		--with-ffcall \
 		--mandir=/usr/share/man \
-		--infodir=/usr/share/info\
+		--infodir=/usr/share/info \
 		"$builddir"
 	# Parallel builds fail
 	make -j1
diff --git a/user/libffcall/APKBUILD b/user/libffcall/APKBUILD
index 51e5fed8fc..a3bdfde1a3 100644
--- a/user/libffcall/APKBUILD
+++ b/user/libffcall/APKBUILD
@@ -10,6 +10,7 @@ url="https://www.gnu.org/software/libffcall"
 arch="all"
 license="GPL-2.0+"
 depends=""
+makedepends=""
 subpackages="$pkgname-dev $pkgname-doc"
 source="https://ftp.gnu.org/gnu/libffcall/libffcall-$pkgver.tar.gz"
 
-- 
GitLab