From 3858abdc5d6d3370d3db17641a9cd7fee3382c1d Mon Sep 17 00:00:00 2001 From: Havard Eidnes Date: Sun, 7 Jun 2020 13:16:15 +0200 Subject: [PATCH] Add a draft package for clisp "current as of 7 jun 2020". This is based on lang/clisp, with patches removed for now, and only added those required to build on NetBSD/i386 9.0. The old verison, 2.49, is from 2010, while this one is being worked on. The repository is moved to gitlab.com, but there's no releases to point to (argh!), so we have to resort to referring to the version via a tag. Verified to build on NetBSD/i386 9.0; had to reduce the end of mmapp'able memory due to ASLR. Sadly, no change log in sight. --- clisp/DESCR | 14 ++++ clisp/Makefile | 86 ++++++++++++++++++++ clisp/PLIST | 73 +++++++++++++++++ clisp/distinfo | 8 ++ clisp/options.mk | 122 +++++++++++++++++++++++++++++ clisp/patches/patch-src_gmalloc.c | 19 +++++ clisp/patches/patch-src_lispbibl.d | 13 +++ 7 files changed, 335 insertions(+) create mode 100644 clisp/DESCR create mode 100644 clisp/Makefile create mode 100644 clisp/PLIST create mode 100644 clisp/distinfo create mode 100644 clisp/options.mk create mode 100644 clisp/patches/patch-src_gmalloc.c create mode 100644 clisp/patches/patch-src_lispbibl.d diff --git a/clisp/DESCR b/clisp/DESCR new file mode 100644 index 0000000000..f6e4d547a7 --- /dev/null +++ b/clisp/DESCR @@ -0,0 +1,14 @@ +Common Lisp is a high-level, general-purpose programming language. GNU +CLISP is a Common Lisp implementation by Bruno Haible of Karlsruhe +University and Michael Stoll of Munich University, both in Germany. + +It mostly supports the Lisp described in the ANSI Common Lisp standard. +It runs on microcomputers (Windows NT/2000/XP, Windows 95/98/ME) as well +as on Unix workstations (Linux, SVR4, Sun4, DEC Alpha OSF, HP-UX, BeOS, +NeXTstep, SGI, AIX and others) and needs only 2 MB of RAM. + +The user interface comes in German, English, French, Spanish, Dutch and +Russian. GNU CLISP includes an interpreter, a compiler, a debugger, +CLOS, a foreign language interface, sockets, i18n, fast bignums and +more. An X11 interface is available through CLX, Garnet, CLUE/CLIO. GNU +CLISP runs Maxima, ACL2 and many other Common Lisp packages. diff --git a/clisp/Makefile b/clisp/Makefile new file mode 100644 index 0000000000..9b4d8fd348 --- /dev/null +++ b/clisp/Makefile @@ -0,0 +1,86 @@ +# $NetBSD: Makefile,v 1.115 2019/11/02 10:20:42 rillig Exp $ + +DISTNAME= clisp-cur-20200607 +CATEGORIES= lang +TAG= c26de78733578fc38952d2485313065eba4f5caa +MASTER_SITES= https://gitlab.com/gnu-clisp/clisp/-/archive/${TAG}/ +#https://gitlab.com/gnu-clisp/clisp/-/archive/master/clisp-master.tar.bz2 +EXTRACT_SUFX= .tar.bz2 + +MAINTAINER= pkgsrc-users@NetBSD.org +HOMEPAGE= https://gitlab.com/gnu-clisp/clisp/ +COMMENT= CLISP, a Common Lisp implementation +LICENSE= gnu-gpl-v2 + +WRKSRC= ${WRKDIR}/clisp-${TAG} + +# XXX: is this still current? +#BROKEN_ON_PLATFORM+= *-*-arm +#BROKEN_ON_PLATFORM+= *-*-aarch64 +# makes the bulk build hang under MirBSD +#BROKEN_ON_PLATFORM+= MirBSD-*-* + +MAKE_JOBS_SAFE= no + +# Installs a copy of its own depcomp, avoid libtool dependency here. +OVERRIDE_DIRDEPTH.depcomp= 0 + +GNU_CONFIGURE= yes # not really, but very close +GNU_CONFIGURE_STRICT= no # doesn't know --enable-option-checking +CONFIGURE_DIRS= . +USE_LIBTOOL= yes +USE_PKGLOCALEDIR= yes +BUILD_DIRS= src +USE_TOOLS+= groff +UNLIMIT_RESOURCES= datasize stacksize + +USE_GNU_CONFIGURE_HOST= NO # work around broken reasoning: "configure --host=..." => cross-building +CONFIGURE_ARGS+= --disable-maintainer-mode +CONFIGURE_ARGS+= --fsstnd=netbsd +CONFIGURE_ARGS+= --without-included-regex +CONFIGURE_ARGS+= --with-gettext +MAKE_FLAGS+= docdir=${PREFIX}/share/doc/${PKGBASE} +MAKE_FLAGS+= mandir=${PREFIX}/${PKGMANDIR} +MAKE_FLAGS+= elispdir="${PREFIX}/share/${PKGBASE}/emacs" +MAKE_FLAGS+= vimdir="${PREFIX}/share/${PKGBASE}/vim" + +CONFIGURE_ENV+= CPP=${CPP} + +TEST_TARGET= check mod-check + +.include "../../mk/bsd.prefs.mk" + +.if ${MACHINE_ARCH} == alpha || ${MACHINE_ARCH} == amd64 || ${MACHINE_ARCH} == x86_64 || ${OPSYS} == DragonFly +CONFIGURE_ARGS+= --disable-mmap +.endif + +# Try to make the built-in src/malloc/gmalloc.c work with modern GCC +.if ${OPSYS} == "NetBSD" +CFLAGS+= -fno-builtin-calloc +CFLAGS+= -fno-builtin-malloc +CFLAGS+= -fno-builtin-memalign +CFLAGS+= -fno-builtin-realloc +CFLAGS+= -fno-builtin-valloc +CFLAGS+= -fno-builtin-free +.endif + +.if ${MACHINE_ARCH} == i386 +CFLAGS+= -falign-functions=4 # force the assumption +.endif + +.if ${OPSYS} == "SunOS" +USE_TOOLS+= bash +CONFIG_SHELL= ${TOOLS_PATH.bash} +.endif + +#post-extract: +# (cd ${WRKSRC} && ${CP} -p src/gllib/mbrtowc.c modules/syscalls/gllib) + +.include "options.mk" + +.include "../../converters/libiconv/buildlink3.mk" +.include "../../devel/gettext-lib/buildlink3.mk" +.include "../../devel/glib2/buildlink3.mk" +BUILDLINK_API_DEPENDS.libsigsegv+= libsigsegv>=2.4 +.include "../../devel/libsigsegv/buildlink3.mk" +.include "../../mk/bsd.pkg.mk" diff --git a/clisp/PLIST b/clisp/PLIST new file mode 100644 index 0000000000..0e8512eaa3 --- /dev/null +++ b/clisp/PLIST @@ -0,0 +1,73 @@ +@comment $NetBSD$ +bin/clisp +bin/clisp-link +lib/clisp-2.49.93+/base/calls.o +lib/clisp-2.49.93+/base/gettext.o +lib/clisp-2.49.93+/base/libgnu.a +lib/clisp-2.49.93+/base/libnoreadline.a +lib/clisp-2.49.93+/base/lisp.a +lib/clisp-2.49.93+/base/lisp.run +lib/clisp-2.49.93+/base/lispinit.mem +lib/clisp-2.49.93+/base/makevars +lib/clisp-2.49.93+/base/modules.h +lib/clisp-2.49.93+/base/modules.o +lib/clisp-2.49.93+/base/readline.o +lib/clisp-2.49.93+/base/regexi.o +lib/clisp-2.49.93+/build-aux/config.guess +lib/clisp-2.49.93+/build-aux/config.rpath +lib/clisp-2.49.93+/build-aux/config.sub +lib/clisp-2.49.93+/build-aux/depcomp +lib/clisp-2.49.93+/build-aux/install-sh +lib/clisp-2.49.93+/data/Symbol-Table.text +lib/clisp-2.49.93+/data/UnicodeDataFull.txt +lib/clisp-2.49.93+/linkkit/clisp.h +lib/clisp-2.49.93+/linkkit/modprep.lisp +lib/clisp-2.49.93+/linkkit/modules.c +man/man1/clisp-link.1 +man/man1/clisp.1 +share/aclocal/clisp.m4 +share/clisp-cur/emacs/clhs.el +share/clisp-cur/emacs/clisp-coding.el +share/clisp-cur/emacs/clisp-ffi.el +share/clisp-cur/emacs/clisp-indent.el +share/clisp-cur/emacs/clisp-indent.lisp +share/clisp-cur/vim/lisp.vim +share/doc/clisp-cur/ANNOUNCE +share/doc/clisp-cur/CLOS-guide.txt +share/doc/clisp-cur/COPYRIGHT +share/doc/clisp-cur/GNU-GPL +share/doc/clisp-cur/LISP-tutorial.txt +share/doc/clisp-cur/MAGIC.add +share/doc/clisp-cur/NEWS +share/doc/clisp-cur/README +share/doc/clisp-cur/README.de +share/doc/clisp-cur/README.es +share/doc/clisp-cur/SUMMARY +share/doc/clisp-cur/clisp-link.1 +share/doc/clisp-cur/clisp-link.html +share/doc/clisp-cur/clisp-link.pdf +share/doc/clisp-cur/clisp-link.ps +share/doc/clisp-cur/clisp.1 +share/doc/clisp-cur/clisp.html +share/doc/clisp-cur/clisp.pdf +share/doc/clisp-cur/clisp.png +share/doc/clisp-cur/clisp.ps +share/doc/clisp-cur/impnotes.css +share/doc/clisp-cur/impnotes.html +share/locale/da/LC_MESSAGES/clisp.mo +share/locale/da/LC_MESSAGES/clisplow.mo +share/locale/de/LC_MESSAGES/clisp.mo +share/locale/de/LC_MESSAGES/clisplow.mo +share/locale/en/LC_MESSAGES/clisp.mo +share/locale/en/LC_MESSAGES/clisplow.mo +share/locale/es/LC_MESSAGES/clisp.mo +share/locale/es/LC_MESSAGES/clisplow.mo +share/locale/fr/LC_MESSAGES/clisp.mo +share/locale/fr/LC_MESSAGES/clisplow.mo +share/locale/nl/LC_MESSAGES/clisp.mo +share/locale/nl/LC_MESSAGES/clisplow.mo +share/locale/ru/LC_MESSAGES/clisp.mo +share/locale/ru/LC_MESSAGES/clisplow.mo +share/locale/sv/LC_MESSAGES/clisp.mo +share/locale/sv/LC_MESSAGES/clisplow.mo +@pkgdir lib/clisp-2.49.93+/dynmod diff --git a/clisp/distinfo b/clisp/distinfo new file mode 100644 index 0000000000..92f07f2b40 --- /dev/null +++ b/clisp/distinfo @@ -0,0 +1,8 @@ +$NetBSD$ + +SHA1 (clisp-cur-20200607.tar.bz2) = b2786570d6eb19bd2770f175a3ffde1e1358fbbf +RMD160 (clisp-cur-20200607.tar.bz2) = 85470d4fac74686d6be4e0afe6a12696f0142735 +SHA512 (clisp-cur-20200607.tar.bz2) = 3ae3887ef8a26abb52770ba2719bad412877bc8c683b3dd76ebb2aa5d97c034aac01a0bad5f64fde0b7224d20de966694a7b76184b89fa53d8afcb34772ca7a3 +Size (clisp-cur-20200607.tar.bz2) = 8803692 bytes +SHA1 (patch-src_gmalloc.c) = 9f66b6d8e8145bb65e5b70778d8a38de55aad891 +SHA1 (patch-src_lispbibl.d) = 4964b81a1a8925bc0db3a66e29a45d218dac4da6 diff --git a/clisp/options.mk b/clisp/options.mk new file mode 100644 index 0000000000..e5a59e4785 --- /dev/null +++ b/clisp/options.mk @@ -0,0 +1,122 @@ +# $NetBSD: options.mk,v 1.13 2017/09/10 20:03:49 wiz Exp $ + +PKG_OPTIONS_VAR= PKG_OPTIONS.clisp + +PKG_SUPPORTED_OPTIONS+= doc +# this option is essential for some others to work: +PKG_SUPPORTED_OPTIONS+= ffcall +PKG_SUPPORTED_OPTIONS+= gmalloc +PKG_SUPPORTED_OPTIONS+= readline +PKG_SUGGESTED_OPTIONS+= ffcall readline doc + +# CLISP doesn't work with jemalloc: +.if ${OPSYS} == "NetBSD" +PKG_SUGGESTED_OPTIONS+= gmalloc +.elif ${OPSYS} == "FreeBSD" && !empty(OS_VERSION:N[0-6].*) +PKG_SUGGESTED_OPTIONS+= gmalloc +.endif + +.include "../../mk/bsd.prefs.mk" +.include "../../mk/bsd.options.mk" + +PLIST_VARS+= ${PKG_SUPPORTED_OPTIONS} + +.for option in ${PKG_SUPPORTED_OPTIONS} +. if !empty(PKG_OPTIONS:M${option}) +PLIST.${option}= yes +. endif +.endfor + +.if !empty(PKG_OPTIONS:Mgmalloc) +CONFIGURE_ARGS+= --with-gmalloc +.endif + +.if !empty(PKG_OPTIONS:Mffcall) +CONFIGURE_ARGS+= --with-dynamic-ffi +. include "../../devel/libffcall/buildlink3.mk" +.endif + +.if !empty(PKG_OPTIONS:Mreadline) +CONFIGURE_ARGS+= --with-readline +BUILDLINK_API_DEPENDS.readline+= readline>=7.0 +.include "../../devel/readline/buildlink3.mk" +.endif + +.if !empty(PKG_OPTIONS:Mdoc) +USE_TOOLS+= dvipdf groff +.else +# suppress generation of printable documentation +CONFIGURE_ENV+= PS2PDF= ac_cv_prog_PS2PDF= +.endif + + +# Options for those who wishes to build "static" CLISP: + +#.if !empty(PKG_OPTIONS:Mwildcard) +#CONFIGURE_ARGS+= --with-module=wildcard +#.endif + +#.if !empty(PKG_OPTIONS:Mpari) +#CONFIGURE_ARGS+= --with-module=pari +#. include "../../math/pari/buildlink3.mk" +#.endif + +#.if !empty(PKG_OPTIONS:Mmit-clx) +#CONFIGURE_ARGS+= --with-module=clx/mit-clx +#. include "../../x11/libX11/buildlink3.mk" +#. include "../../x11/libXau/buildlink3.mk" +#.endif + +#.if !empty(PKG_OPTIONS:Mnew-clx) +#CONFIGURE_ARGS+= --with-module=clx/new-clx +#. include "../../x11/libX11/buildlink3.mk" +#. include "../../x11/libXau/buildlink3.mk" +#.endif + +#.if !empty(PKG_OPTIONS:Mbdb) +# it requires version 4, not anything older +#CONFIGURE_ARGS+= --with-module=berkeley-db +#BUILDLINK_TRANSFORM+= l:db:db46 +#. include "../../databases/db46/buildlink3.mk" +#.endif + +# .if !empty(PKG_OPTIONS:Mpgsql) +# CONFIGURE_ARGS+= --with-module=postgresql +# . include "../../mk/pgsql.buildlink3.mk" +# .endif + +# .if !empty(PKG_OPTIONS:Mgdbm) +# CONFIGURE_ARGS+= --with-module=gdbm +# . include "../../databases/gdbm/buildlink3.mk" +# .endif + +# .if !empty(PKG_OPTIONS:Mpcre) +# CONFIGURE_ARGS+= --with-module=pcre +# . include "../../devel/pcre/buildlink3.mk" +# .endif + +# .if !empty(PKG_OPTIONS:Mrawsock) +# CONFIGURE_ARGS+= --with-module=rawsock +# .endif + +# .if !empty(PKG_OPTIONS:Mfastcgi) +# CONFIGURE_ARGS+= --with-module=fastcgi +# . include "../../www/fcgi/buildlink3.mk" +# .endif + +# .if !empty(PKG_OPTIONS:Mgtk2) +# CONFIGURE_ARGS+= --with-module=gtk2 +# . include "../../devel/libglade/buildlink3.mk" +# . include "../../x11/gtk2/buildlink3.mk" +# .endif + +# .if !empty(PKG_OPTIONS:Mzlib) +# CONFIGURE_ARGS+= --with-module=zlib +# BUILDLINK_API_DEPENDS.zlib+= zlib>=1.2 +# .include "../../devel/zlib/buildlink3.mk" +# .endif + +## libffcall is required for some other options to work: +# .if !empty(PKG_OPTIONS:Mpgsql) && empty(PKG_OPTIONS:Mffcall) +# PKG_OPTIONS+= ffcall +# .endif diff --git a/clisp/patches/patch-src_gmalloc.c b/clisp/patches/patch-src_gmalloc.c new file mode 100644 index 0000000000..c12157db97 --- /dev/null +++ b/clisp/patches/patch-src_gmalloc.c @@ -0,0 +1,19 @@ +$NetBSD$ + +--- src/gmalloc.c.orig 2019-11-03 21:40:38.000000000 +0000 ++++ src/gmalloc.c +@@ -1911,7 +1911,14 @@ Fifth Floor, Boston, MA 02110-1301, USA. + extern size_t __getpagesize PP ((void)); + #endif + #else ++#ifdef __NetBSD__ ++/* XXX can't include as one should, ++ * since that will pull in gllib/unistd.h instead! ++ */ ++extern int getpagesize(); ++#else + #include "getpagesize.h" ++#endif + #define __getpagesize() getpagesize() + #endif + diff --git a/clisp/patches/patch-src_lispbibl.d b/clisp/patches/patch-src_lispbibl.d new file mode 100644 index 0000000000..b72738435c --- /dev/null +++ b/clisp/patches/patch-src_lispbibl.d @@ -0,0 +1,13 @@ +$NetBSD$ + +--- src/lispbibl.d.orig 2019-11-03 21:40:38.000000000 +0000 ++++ src/lispbibl.d +@@ -2427,7 +2427,7 @@ typedef enum { + There is room from 0x09000000UL to 0xBB000000UL, but let's keep some + distance. */ + #define MAPPABLE_ADDRESS_RANGE_START 0x10000000UL +- #define MAPPABLE_ADDRESS_RANGE_END 0xAFFFFFFFUL ++ #define MAPPABLE_ADDRESS_RANGE_END 0x9FFFFFFFUL + #endif + #if defined(UNIX_NETBSD) && defined(SPARC) + /* On NetBSD/sparc: