diff --git a/srcpkgs/ccl/patches/musl-fixes.patch b/srcpkgs/ccl/patches/musl-fixes.patch new file mode 100644 index 0000000000..8a6c3d7251 --- /dev/null +++ b/srcpkgs/ccl/patches/musl-fixes.patch @@ -0,0 +1,60 @@ +--- lisp-kernel/lisp-debug.c 2015-11-07 07:10:11.000000000 +1100 ++++ lisp-kernel/lisp-debug.c 2016-12-18 10:35:29.070710875 +1100 +@@ -36,6 +36,11 @@ + #include + #endif + ++#ifndef __GLIBC__ ++struct _libc_xmmreg { ++ unsigned int element[4]; ++}; ++#endif + + FILE *dbgout = NULL, *dbgin=NULL; + +--- lisp-kernel/pmcl-kernel.c 2015-11-07 07:10:11.000000000 +1100 ++++ lisp-kernel/pmcl-kernel.c 2016-12-18 10:34:36.854708181 +1100 +@@ -36,7 +36,7 @@ + #endif + + #ifdef LINUX +-#ifndef ANDROID ++#ifdef __GLIBC__ + #include + #endif + #include +@@ -1702,7 +1702,11 @@ + ensure_gs_available(char *progname) + { + LispObj fs_addr = 0L, gs_addr = 0L, cur_thread = (LispObj)pthread_self(); ++ #ifdef __GLIBC__ + char *gnu_get_libc_version(void); ++ #else ++ #define gnu_get_libc_version() "" ++ #endif + + arch_prctl(ARCH_GET_GS, &gs_addr); + arch_prctl(ARCH_GET_FS, &fs_addr); +--- lisp-kernel/thread_manager.c 2015-11-07 07:10:11.000000000 +1100 ++++ lisp-kernel/thread_manager.c 2016-12-18 10:32:35.095701899 +1100 +@@ -185,7 +185,7 @@ + void + set_thread_affinity(TCR *target, unsigned cpuno) + { +-#ifdef LINUX ++#ifdef __GLIBC__ + #ifndef ANDROID /* too useful to be in Android ... */ + pthread_t thread = (pthread_t)(target->osid); + cpu_set_t mask; +--- lisp-kernel/x86-exceptions.c 2015-11-07 07:10:11.000000000 +1100 ++++ lisp-kernel/x86-exceptions.c 2016-12-18 10:30:47.952696372 +1100 +@@ -29,7 +29,9 @@ + #ifdef LINUX + #include + #include ++#ifdef __GLIBC__ + #include ++#endif + #include + #endif + #ifdef DARWIN diff --git a/srcpkgs/ccl/template b/srcpkgs/ccl/template new file mode 100644 index 0000000000..8119707ea2 --- /dev/null +++ b/srcpkgs/ccl/template @@ -0,0 +1,63 @@ +pkgname=ccl +version=1.11 +revision=1 +wrksrc="ccl" +only_for_archs="i686 i686-musl x86_64 x86_64-musl" +build_style=gnu-makefile +hostmakedepends="m4" +short_desc="Clozure Common Lisp interpreter and compiler" +maintainer="Ankur Kothari " +license="Apache-2.0" +homepage="http://ccl.clozure.com/" +distfiles="ftp://ftp.clozure.com/pub/release/${version}/${pkgname}-${version}-linuxx86.tar.gz" +checksum="08e885e8c2bb6e4abd42b8e8e2b60f257c6929eb34b8ec87ca1ecf848fac6d70" +nopie=1 +nostrip=1 +disable_parallel_build=1 + +case $XBPS_MACHINE in + x86_64*) _arch=64 ;; + *) _arch='' ;; +esac + +do_build() { + # recompile kernel, mandatory for musl + cd "lisp-kernel/linuxx86${_arch:-32}" + make + cd ../.. + + ./lx86cl$_arch -n -Q -b -e '(ccl:rebuild-ccl :full t)' -e '(ccl:quit)' +} + +do_install() { + + find . -type d -name .svn -exec rm -rf '{}' + + find . -name '*.o' -delete + find . -name '*.*fsl' -delete + + vmkdir usr/lib/$pkgname + + vcopy lx86cl$_arch usr/lib/$pkgname + vcopy lx86cl$_arch.image usr/lib/$pkgname + + cat > exe.sh <