From ab9ce10828ac25cb38af926c539d5154c2708598 Mon Sep 17 00:00:00 2001 From: Will Sinatra Date: Wed, 24 Jul 2019 15:15:09 -0500 Subject: testing/sbcl: upgrade to 1.5.4, adopt Removing from musl-fixes.patch allows SBCL to compile correctly. Added myself as the maintainer. --- testing/sbcl/APKBUILD | 68 ++++++++++++ testing/sbcl/fix-generate-version.patch | 13 +++ testing/sbcl/musl-fix-threads.patch | 180 +++++++++++++++++++++++++++++++ testing/sbcl/musl-fixes.patch | 12 +++ testing/sbcl/pax-genesis-stage-two.patch | 11 ++ testing/sbcl/sbcl_prefix.patch | 11 ++ 6 files changed, 295 insertions(+) create mode 100644 testing/sbcl/APKBUILD create mode 100644 testing/sbcl/fix-generate-version.patch create mode 100644 testing/sbcl/musl-fix-threads.patch create mode 100644 testing/sbcl/musl-fixes.patch create mode 100644 testing/sbcl/pax-genesis-stage-two.patch create mode 100644 testing/sbcl/sbcl_prefix.patch (limited to 'testing/sbcl') diff --git a/testing/sbcl/APKBUILD b/testing/sbcl/APKBUILD new file mode 100644 index 0000000000..9d591f264c --- /dev/null +++ b/testing/sbcl/APKBUILD @@ -0,0 +1,68 @@ +# Contributor: Sören Tempel +# Maintainer: Will Sinatra +pkgname=sbcl +pkgver=1.5.4 +pkgrel=0 +pkgdesc="Steel Bank Common Lisp" +url="http://www.sbcl.org/" +arch="x86_64" +license="custom" +checkdepends="ed" +makedepends="clisp linux-headers paxmark zlib-dev" +subpackages="$pkgname-doc" +source="$pkgname-$pkgver.tar.bz2::https://prdownloads.sourceforge.net/$pkgname/$pkgname-$pkgver-source.tar.bz2 + pax-genesis-stage-two.patch + musl-fixes.patch + musl-fix-threads.patch + sbcl_prefix.patch + fix-generate-version.patch + " +builddir="$srcdir/$pkgname-$pkgver" + +prepare() { + default_prepare + + # FIXME: This test fails (returns incorrect result), don't know why. + rm tests/traceroot.test.sh +} + +build() { + cd "$builddir" + + GNUMAKE=make ./make.sh clisp \ + --prefix=/usr \ + --with-sb-thread \ + --with-sb-test \ + --with-sb-unicode \ + --with-sb-core-compression +} + +check() { + cd "$builddir"/tests + + sh run-tests.sh +} + +package() { + cd "$builddir" + + INSTALL_ROOT="$pkgdir/usr" \ + LIB_DIR="/usr/lib" \ + DOC_DIR="$pkgdir/usr/share/doc/$pkgname" \ + sh install.sh + + paxmark -rm "$pkgdir"/usr/bin/sbcl + + install -Dm644 COPYING \ + "$pkgdir"/usr/share/licenses/$pkgname/LICENSE.txt + + rmdir "$pkgdir"/usr/share/doc/sbcl/html \ + "$pkgdir"/usr/share/info 2>/dev/null || true +} + +sha512sums="052856e7e7f8810903960acf750ba2f073c3b9f4c2141c45714b67a1c499dff9b67a949534a6f0f57299f64103fd7766cd50db24a689cf8e174fbe87fedba78d sbcl-1.5.4.tar.bz2 +cda5c7268b314145a1bdb8293c7970e077aebf3cce5dace12542bf18beb7b124bf97f4754906f2f681428869ca3060300b88cab80055a3d5881dfcdcfbe51d6d pax-genesis-stage-two.patch +507ecaf8fc296586c637d6ad8c91770efe18158a3aa551d0d2993ce9592454f33442d425d076bcb7121525d7942a03d9a0038252251f1540c575e95fb334ef7e musl-fixes.patch +86b8a51d518d71a3c4d3069f80bc00cccd4b97edc6c96ff12875a0727cc2b96208f35c3a11044d98881b5e6c2e607fc65506020b7ff990b257edae55eb6a1c59 musl-fix-threads.patch +bfb6bef3b6512e487e45bc8c9cf36aa519e470690b6c7036bba7d28269bd899c60a4dfa09b5aba44830b8c002e7191276f2cf6f8f134b163d05af7b46f9849ff sbcl_prefix.patch +acd6a154e539dde5c8c6726cc553cc79b1ba98670f61596a3f7754126de35fae1656c98963169ec5dff1551d33632e00e1a40fa65aec73a729317d814825c6a1 fix-generate-version.patch" diff --git a/testing/sbcl/fix-generate-version.patch b/testing/sbcl/fix-generate-version.patch new file mode 100644 index 0000000000..521520e86a --- /dev/null +++ b/testing/sbcl/fix-generate-version.patch @@ -0,0 +1,13 @@ +Don't read sbcl version from the aports git repository. + +--- a/generate-version.sh ++++ b/generate-version.sh +@@ -2,7 +2,7 @@ + + git_available_p() { + # Check that (1) we have git (2) this is a git tree. +- if ( command -v git >/dev/null && git describe >/dev/null 2>/dev/null ) ++ if ( test -d .git && command -v git >/dev/null && git describe >/dev/null 2>/dev/null ) + then + echo "ok" + else diff --git a/testing/sbcl/musl-fix-threads.patch b/testing/sbcl/musl-fix-threads.patch new file mode 100644 index 0000000000..f9705bdcfb --- /dev/null +++ b/testing/sbcl/musl-fix-threads.patch @@ -0,0 +1,180 @@ +Patch-Source: https://bugs.launchpad.net/sbcl/+bug/1768368 + +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,20 @@ 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 +@@ -33,4 +33,13 @@ featurep os-provides-getprotoby-r + + featurep os-provides-poll + ++featurep os-provides-netdb-internal ++ + featurep arm-softfp ++ ++# 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 ++} diff --git a/testing/sbcl/musl-fixes.patch b/testing/sbcl/musl-fixes.patch new file mode 100644 index 0000000000..73a938f290 --- /dev/null +++ b/testing/sbcl/musl-fixes.patch @@ -0,0 +1,12 @@ +diff -upr sbcl-1.3.1.orig/src/runtime/linux-os.h sbcl-1.3.1/src/runtime/linux-os.h +--- sbcl-1.3.1.orig/src/runtime/linux-os.h 2016-04-05 19:48:17.823336398 +0200 ++++ sbcl-1.3.1/src/runtime/linux-os.h 2016-04-05 19:48:47.117967857 +0200 +@@ -24,7 +24,7 @@ + #include + + // Needs to be defined before including target-arch.h +-typedef caddr_t os_vm_address_t; ++typedef void *os_vm_address_t; + typedef size_t os_vm_size_t; + typedef off_t os_vm_offset_t; + typedef int os_vm_prot_t; diff --git a/testing/sbcl/pax-genesis-stage-two.patch b/testing/sbcl/pax-genesis-stage-two.patch new file mode 100644 index 0000000000..b06dd22bb2 --- /dev/null +++ b/testing/sbcl/pax-genesis-stage-two.patch @@ -0,0 +1,11 @@ +diff -upr sbcl-1.3.11.orig/make-target-2.sh sbcl-1.3.11/make-target-2.sh +--- sbcl-1.3.11.orig/make-target-2.sh 2016-11-02 10:44:23.226711691 +0100 ++++ sbcl-1.3.11/make-target-2.sh 2016-11-02 10:45:19.043220337 +0100 +@@ -39,6 +39,7 @@ fi + # system with the :SB-SHOW feature enabled, it does it rather silently, + # without trying to tell you about what it's doing. So unless it hangs + # for much longer than that, don't worry, it's likely to be normal. ++paxmark.sh -mr ./src/runtime/sbcl + if [ "$1" != --load ]; then + echo //doing warm init - compilation phase + echo '(load "loader.lisp") (load-sbcl-file "make-host-1.lisp")' | \ diff --git a/testing/sbcl/sbcl_prefix.patch b/testing/sbcl/sbcl_prefix.patch new file mode 100644 index 0000000000..2019d0e7ec --- /dev/null +++ b/testing/sbcl/sbcl_prefix.patch @@ -0,0 +1,11 @@ +--- a/make-config.sh ++++ b/make-config.sh +@@ -30,7 +30,7 @@ + then + SBCL_PREFIX="$PROGRAMFILES/sbcl" + else +- SBCL_PREFIX="/usr/local" ++ SBCL_PREFIX="/usr" + fi + SBCL_XC_HOST="sbcl --no-userinit --no-sysinit" + export SBCL_XC_HOST -- cgit v1.2.3