From 4ffe35c312b2dc8d34db57ba9ed5ce2ed1b02d94 Mon Sep 17 00:00:00 2001 From: Lee Starnes Date: Sat, 18 Apr 2020 09:43:10 +0000 Subject: 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 (limited to 'experimental/sbcl') diff --git a/experimental/sbcl/APKBUILD b/experimental/sbcl/APKBUILD new file mode 100644 index 000000000..ac8408bcb --- /dev/null +++ b/experimental/sbcl/APKBUILD @@ -0,0 +1,39 @@ +# Contributor: Lee Starnes +# Maintainer: Lee Starnes +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 000000000..1aa5cb557 --- /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 < $TEST_FILESTEM.test.lisp < ++#include ++ ++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 ++ ++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 ++} -- cgit v1.2.3-70-g09d2