Changeset View
Changeset View
Standalone View
Standalone View
lang/sbcl/Makefile
# $FreeBSD$ | # $FreeBSD$ | ||||
PORTNAME= sbcl | PORTNAME= sbcl | ||||
PORTVERSION= 1.3.1 | PORTVERSION= 1.3.13 | ||||
DISTVERSIONSUFFIX= -source | |||||
PORTEPOCH= 1 | PORTEPOCH= 1 | ||||
CATEGORIES= lang lisp | CATEGORIES= lang lisp | ||||
MASTER_SITES= SF/sbcl/sbcl/${PORTVERSION} LOCAL/marino:binaries | MASTER_SITES= SF/sbcl/sbcl/${PORTVERSION} | ||||
DISTFILES= sbcl-${PORTVERSION}-source${EXTRACT_SUFX} \ | |||||
sbcl-${PORTVERSION}-documentation-html${EXTRACT_SUFX} | |||||
MAINTAINER= ports@FreeBSD.org | MAINTAINER= pavelivolkov@gmail.com | ||||
COMMENT= Common Lisp development system derived from the CMU CL system | COMMENT= Common Lisp development system derived from the CMU CL system | ||||
LICENSE= sbcl | LICENSE= sbcl | ||||
LICENSE_NAME= public domain | FreeBSD | LICENSE_NAME= public domain | FreeBSD | ||||
LICENSE_FILE= ${WRKSRC}/COPYING | LICENSE_FILE= ${WRKSRC}/COPYING | ||||
LICENSE_PERMS= dist-mirror pkg-mirror auto-accept dist-sell pkg-sell | LICENSE_PERMS= dist-mirror pkg-mirror auto-accept dist-sell pkg-sell | ||||
LIB_DEPENDS= libgmp.so:math/gmp | LIB_DEPENDS= libgmp.so:math/gmp \ | ||||
libmpfr.so:math/mpfr | |||||
USES= gmake tar:bzip2 | USES= gmake makeinfo tar:bzip2 | ||||
ONLY_FOR_ARCHS= i386 amd64 | ONLY_FOR_ARCHS= i386 amd64 | ||||
SBCL_HOME= ${PREFIX}/lib/sbcl | |||||
MANUALS= asdf.html sbcl.html | |||||
MODULESDOCS= asdf/README.md \ | |||||
asdf/README.SBCL \ | |||||
sb-aclrepl/README \ | |||||
sb-bsd-sockets/FAQ \ | |||||
sb-bsd-sockets/NEWS \ | |||||
sb-gmp/README.md \ | |||||
sb-md5/README \ | |||||
sb-mpfr/README.md \ | |||||
sb-posix/README \ | |||||
sb-rotate-byte/README \ | |||||
sb-simple-streams/README | |||||
TEXTDOCS= BUGS CREDITS COPYING NEWS PRINCIPLES TLA TODO | |||||
CFLAGS+= -fno-omit-frame-pointer | |||||
CPPFLAGS+= -I. -DSBCL_PREFIX=\\\"\$$(SBCL_PREFIX)\\\" | |||||
CONMODULES= asdf sb-aclrepl sb-bsd-sockets sb-cltl2 sb-concurrency \ | |||||
sb-cover sb-executable sb-gmp sb-grovel sb-introspect \ | |||||
sb-md5 sb-mpfr sb-posix sb-queue sb-rotate-byte sb-rt \ | |||||
sb-simple-streams sb-sprof | |||||
MAKE_SH_ARGS?= --prefix=${PREFIX} \ | WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION} | ||||
--dynamic-space-size=${DYNAMIC_SPACE_SIZE} \ | |||||
--with-sb-core-compression \ | |||||
--with-sb-qshow | |||||
NM?= /usr/bin/nm | |||||
NMFLAGS?= -gp | |||||
BOOT_ARCH_OS_LIST= 1.0.31-amd64-freebsd8 1.0.31-i386-freebsd8 \ | MAKE_SH_ARGS?= --prefix="${PREFIX}" \ | ||||
1.2.9-x86_64-dragonfly4 | --xc-host="${XC_HOST}" | ||||
OPTIONS_DEFINE= SBCL #THREADS (don't build, see PR 184425) | # You can use the DYNAMIC_SPACE_SIZE knob to change the size of SBCL dynamically-allocated memory. | ||||
SBCL_DESC= Bootstrap with installed SBCL binary, if available | # Default for arch: i386 = 512Mb, amd64 = 1Gb. | ||||
THREADS_DESC= Experimental threading support | .if defined(DYNAMIC_SPACE_SIZE) | ||||
MAKE_SH_ARGS+= --dynamic-space-size=${DYNAMIC_SPACE_SIZE} | |||||
.endif | |||||
adamw: No. Take that whole thing out. `OPTIONS_DEFAULT` should not be changing based on things that… | |||||
.include <bsd.port.options.mk> | # All options explained into file: ${WRKSRC}/base-target-features.lisp-expr | ||||
OPTIONS_DEFINE= UNICODE THREADS ZLIB DOCS XREF RENAME QSHOW SAFEPOINT | |||||
OPTIONS_DEFAULT=CCL UNICODE | |||||
Done Inline ActionsThis block doesn't make any sense either. It changes depending upon what's installed before make config is run. In poudriere, NONE of them will be installed. Pick one, and make it the default. This block is so clever that it won't work. adamw: This block doesn't make any sense either. It changes depending upon what's installed before… | |||||
NEWBOOTNAME= sbcl-${PORTVERSION}-${ARCH}-${OPSYS:tl}${OSREL:R} | XREF_DESC= XREF data for SBCL internals | ||||
PATTERN= *-${ARCH}-${OPSYS:tl}* | RENAME_DESC= Rename suffix .core to _core | ||||
# FreeBSD hack is to support legacy make, add unrelated core fix while here | QSHOW_DESC= C runtime with low-level debugging output | ||||
. if ${OPSYS} == FreeBSD | SAFEPOINT_DESC= Using safepoints instead of signals | ||||
CORE= sbcl.core | |||||
BOOT_DISTNAME= sbcl-1.0.31-${ARCH}-freebsd8 | |||||
. else # newer core format | |||||
CORE= sbcl_core | |||||
BOOT_DISTNAME= sbcl-${BOOT_ARCH_OS_LIST:M${PATTERN}} | |||||
. endif | |||||
.if make(makesum) || defined(FETCH_ALL) | OPTIONS_SINGLE= BOOTSTRAP | ||||
. for BOOT_ARCH_OS in ${BOOT_ARCH_OS_LIST} | OPTIONS_SINGLE_BOOTSTRAP= SBCL CCL CMUCL ABCL | ||||
DISTFILES:= ${DISTFILES} sbcl-${BOOT_ARCH_OS}-binary.tar.bz2:binaries | BOOTSTRAP_DESC= Supported languages of the build host | ||||
Done Inline ActionsWhat is the circumstance under which PREFIX would be defined, but not LOCALBASE? I don't like this block... previously-installed stuff should be in LOCALBASE, not PREFIX. adamw: What is the circumstance under which `PREFIX` would be defined, but not `LOCALBASE`? I don't… | |||||
. endfor | SBCL_DESC= Steel Bank Common Lisp | ||||
.else | CCL_DESC= Clozure Common Lisp | ||||
DISTFILES:= ${DISTFILES} ${BOOT_DISTNAME}-binary.tar.bz2:binaries | CMUCL_DESC= Carnegie Mellon University Common Lisp | ||||
.endif | ABCL_DESC= Armed Bear Common Lisp | ||||
.if ${ARCH} == "i386" | # On this moment CMUCL - don't builds sbcl correctly, ABCL - I don't tested. Welcome volunteers. | ||||
DYNAMIC_SPACE_SIZE?= 512 | OPTIONS_EXCLUDE=CMUCL ABCL | ||||
PLIST_SUB+= I386_ONLY="" AMD64_ONLY="@comment " | |||||
SBCLCONFIG= Config.x86-${OPSYS:tl} | |||||
.else | |||||
DYNAMIC_SPACE_SIZE?= 1024 | |||||
PLIST_SUB+= I386_ONLY="@comment " AMD64_ONLY="" | |||||
SBCLCONFIG= Config.x86-64-${OPSYS:tl} | |||||
.endif | |||||
# If the SBCL option is enabled, try to use existing "sbcl" first: | SBCL_VARS= XC_HOST="sbcl --noinform --disable-debugger --no-sysinit --no-userinit" | ||||
.if empty(PORT_OPTIONS:MSBCL) || !exists(${LOCALBASE}/bin/sbcl) | |||||
XC_HOST?= ${WRKDIR}/${BOOT_DISTNAME}/src/runtime/sbcl \ | |||||
--core ${WRKDIR}/${BOOT_DISTNAME}/output/${CORE} \ | |||||
--dynamic-space-size ${DYNAMIC_SPACE_SIZE} \ | |||||
--disable-debugger \ | |||||
--userinit /dev/null \ | |||||
--sysinit /dev/null | |||||
MAKE_SH_ARGS+= --xc-host='${XC_HOST}' | |||||
.endif # SBCL | |||||
.if ${PORT_OPTIONS:MTHREADS} | CCL_VARS= XC_HOST="ccl --no-init --batch --quiet" | ||||
MAKE_SH_ARGS+= --with-sb-thread | CCL_BUILD_DEPENDS= ccl:lang/ccl | ||||
. if defined(WITH_FUTEX) | |||||
MAKE_SH_ARGS+= --with-sb-futex | |||||
. else | |||||
MAKE_SH_ARGS+= --without-sb-futex | |||||
. endif | |||||
. if defined(WITH_SAFEPOINT) || defined(WITH_STRICT_SAFEPOINT) | |||||
MAKE_SH_ARGS+= --with-sb-safepoint --with-sb-thruption --with-sb-wtimer | |||||
. if defined(WITH_STRICT_SAFEPOINT) | |||||
MAKE_SH_ARGS+= --with-sb-safepoint-strictly | |||||
. else | |||||
MAKE_SH_ARGS+= --without-sb-safepoint-strictly | |||||
. endif | |||||
. else | |||||
MAKE_SH_ARGS+= --without-sb-safepoint \ | |||||
--without-sb-safepoint-strictly \ | |||||
--without-sb-thruption \ | |||||
--without-sb-wtimer | |||||
. endif | |||||
.else | |||||
MAKE_SH_ARGS+= --without-sb-thread | |||||
.endif | |||||
pre-everything:: | CMUCL_VARS= XC_HOST="lisp -nositeinit -noinit -batch -quiet" | ||||
@${ECHO_MSG} | CMUCL_BUILD_DEPENDS= lisp:lang/cmucl | ||||
@${ECHO_MSG} "---------------------------------------------------------" | |||||
@${ECHO_MSG} "You might need to adjust memory limits in order to" | |||||
@${ECHO_MSG} "build SBCL." | |||||
@${ECHO_MSG} | |||||
@${ECHO_MSG} "You can use the DYNAMIC_SPACE_SIZE knob to change the size" | |||||
@${ECHO_MSG} "of SBCL dynamically-allocated memory." | |||||
@${ECHO_MSG} "---------------------------------------------------------" | |||||
@${ECHO_MSG} | |||||
post-patch: | ABCL_VARS= XC_HOST="abcl" | ||||
@${ECHO_CMD} "CC=${CC}" >> ${WRKSRC}/src/runtime/${SBCLCONFIG} | ABCL_BUILD_DEPENDS= abcl:lang/abcl | ||||
@${ECHO_CMD} "CFLAGS=${CFLAGS}" >> \ | |||||
${WRKSRC}/src/runtime/${SBCLCONFIG} | |||||
@${ECHO_CMD} "CPPFLAGS=${CPPFLAGS}" >> \ | |||||
${WRKSRC}/src/runtime/${SBCLCONFIG} | |||||
@${ECHO_CMD} "GREP=${GREP}" >> ${WRKSRC}/src/runtime/${SBCLCONFIG} | |||||
@${ECHO_CMD} "LD=${LD}" >> ${WRKSRC}/src/runtime/${SBCLCONFIG} | |||||
@${ECHO_CMD} "LINKFLAGS=${LDFLAGS} -dynamic -rdynamic" >> \ | |||||
${WRKSRC}/src/runtime/${SBCLCONFIG} | |||||
@${ECHO_CMD} "NM=${NM} ${NMFLAGS}" >> \ | |||||
${WRKSRC}/src/runtime/${SBCLCONFIG} | |||||
@${REINPLACE_CMD} -E -e 's,-lthr,-lpthread,g' \ | |||||
${WRKSRC}/src/runtime/${SBCLCONFIG} | |||||
@${GREP} -Fe '.core' -l -r ${WRKSRC} | ${XARGS} ${REINPLACE_CMD} \ | |||||
-e 's|\.core|_core|g' | |||||
@${REINPLACE_CMD} -e 's|/usr/local|${PREFIX}|g' \ | |||||
${WRKSRC}/doc/sbcl.1 | |||||
@${REINPLACE_CMD} -E -e 's!-sbcl-shared!& ${CFLAGS}!' \ | |||||
-e 's!\$$(TEST_FILESTEM|x|1)_core!$${\1}_core!g' \ | |||||
${WRKSRC}/tests/core.test.sh \ | |||||
${WRKSRC}/tests/foreign.test.sh | |||||
@${REINPLACE_CMD} -E -e 's!"-O3"!!' \ | |||||
-e 's!("-sbcl-(pic|shared)"[[:blank:]]*)+!& ${CFLAGS:C/.*/"&"/}!' \ | |||||
${WRKSRC}/tests/foreign-stack-alignment.impure.lisp \ | |||||
${WRKSRC}/tests/kill-non-lisp-thread.impure.lisp \ | |||||
${WRKSRC}/tests/swap-lispobjs.impure.lisp \ | |||||
${WRKSRC}/tests/threads.impure.lisp | |||||
@${REINPLACE_CMD} -e 's|( cd ./doc ; sh ./clean.sh )|#&|' \ | |||||
${WRKSRC}/clean.sh | |||||
@case "`${CC} --version`" in \ | |||||
*clang*) \ | |||||
${REINPLACE_CMD} -e '/#define END()/s/\.end//' \ | |||||
${WRKSRC}/src/runtime/x86-assem.S \ | |||||
${WRKSRC}/src/runtime/x86-64-assem.S ;; \ | |||||
esac | |||||
${REINPLACE_CMD} -e 's!/bin/bash!${LOCALBASE}&!' \ | |||||
${WRKSRC}/release.sh \ | |||||
${WRKSRC}/src/code/run-program.lisp \ | |||||
${WRKSRC}/tests/run-compiler.sh | |||||
@${FIND} ${WRKSRC} \( -name '*.orig' -o -name '*.bak' \) -delete | |||||
THREADS_VARS= MAKE_SH_ARGS+="--with-sb-thread --with-restore-fs-segment-register-from-tls" | |||||
THREADS_VARS_OFF= MAKE_SH_ARGS+="--without-sb-thread --without-restore-fs-segment-register-from-tls" | |||||
ZLIB_VARS= MAKE_SH_ARGS+="--with-sb-core-compression" | |||||
ZLIB_VARS_OFF= MAKE_SH_ARGS+="--without-sb-core-compression" | |||||
XREF_VARS= MAKE_SH_ARGS+="--with-sb-xref-for-internals" | |||||
XREF_VARS_OFF= MAKE_SH_ARGS+="--without-sb-xref-for-internals" | |||||
UNICODE_VARS= MAKE_SH_ARGS+="--with-sb-unicode" | |||||
UNICODE_VARS_OFF= MAKE_SH_ARGS+="--without-sb-unicode" | |||||
QSHOW_VARS= MAKE_SH_ARGS+="--with-sb-qshow" | |||||
QSHOW_VARS_OFF= MAKE_SH_ARGS+="--without-sb-qshow" | |||||
SAFEPOINT_VARS= MAKE_SH_ARGS+="--with-sb-safepoint --with-sb-thruption --with-sb-wtimer" | |||||
SAFEPOINT_VARS_OFF= MAKE_SH_ARGS+="--without-sb-safepoint --without-sb-thruption --without-sb-wtimer" | |||||
SAFEPOINT_IMPLIES= THREADS | |||||
RENAME_VARS= RENAME_DLM="_" | |||||
RENAME_VARS_OFF=RENAME_DLM="." | |||||
PLIST_SUB= RENAME_DLM=${RENAME_DLM} | |||||
Not Done Inline ActionsThis should be up at line 68. But really, it should be this: RENAME_PLIST_SUB= RENAME_DLM="_" RENAME_PLIST_SUB_OFF= RENAME_DLM="." adamw: This should be up at line 68. But really, it should be this:
```
RENAME_PLIST_SUB=… | |||||
DOCS_VARS= INFO="asdf sbcl" | |||||
PORTDOCS= * | |||||
post-patch-RENAME-on: | |||||
${GREP} -Frl '.core' ${WRKSRC} | ${XARGS} ${REINPLACE_CMD} -e 's|\.core|_core|g' | |||||
do-build: | do-build: | ||||
(cd ${WRKSRC} && ${SETENV} CC="${CC}" ${SH} make.sh ${MAKE_SH_ARGS}) | (cd ${WRKSRC} && ${SH} make.sh ${MAKE_SH_ARGS}) | ||||
${RM} -r ${WRKSRC}/contrib/sb-cover/test-output | |||||
${REINPLACE_CMD} -E -e \ | |||||
's|\$$Date\$$|'"`${SETENV} LANG=C /bin/date '+%B %d, %Y'`|g" \ | |||||
${WRKSRC}/doc/sbcl.1 | |||||
do-install: | do-install: | ||||
${MKDIR} ${STAGEDIR}${SBCL_HOME}/contrib \ | (cd ${WRKSRC} && ${SETENV} \ | ||||
Done Inline ActionsNot right, because it discards the environment. Alternatives: DOCS_ALL_TARGET= all info html post-build-DOCS-on: ${DO_MAKE_BUILD} -C ${WRKSRC}/doc/manual info html adamw: Not right, because it discards the environment.
Alternatives:
```
DOCS_ALL_TARGET= all… | |||||
${STAGEDIR}${SBCL_HOME}/site-systems | INSTALL_ROOT="${STAGEDIR}${PREFIX}" \ | ||||
${INSTALL_PROGRAM} ${WRKSRC}/src/runtime/sbcl ${STAGEDIR}${PREFIX}/bin | MAN_DIR="${STAGEDIR}${MANPREFIX}/man" \ | ||||
${INSTALL_DATA} ${WRKSRC}/output/sbcl_core ${STAGEDIR}${SBCL_HOME} | INFO_DIR="${STAGEDIR}${PREFIX}/${INFO_PATH}" \ | ||||
${INSTALL_DATA} ${WRKSRC}/obj/sbcl-home/contrib/*.fasl \ | DOC_DIR="${STAGEDIR}${DOCSDIR}" \ | ||||
${STAGEDIR}${SBCL_HOME}/contrib/ | ${SH} install.sh) | ||||
${INSTALL_DATA} ${WRKSRC}/obj/sbcl-home/contrib/*.asd \ | |||||
${STAGEDIR}${SBCL_HOME}/contrib/ | |||||
.for MOD in ${CONMODULES} | |||||
${MKDIR} ${STAGEDIR}${SBCL_HOME}/${MOD} | |||||
- ${INSTALL_DATA} ${WRKSRC}/contrib/${MOD}/*.lisp \ | |||||
${STAGEDIR}${SBCL_HOME}/${MOD} | |||||
- ${INSTALL_DATA} ${WRKSRC}/contrib/${MOD}/*.fasl \ | |||||
${STAGEDIR}${SBCL_HOME}/${MOD} | |||||
- ${INSTALL_DATA} ${WRKSRC}/contrib/${MOD}/${MOD}.asd \ | |||||
${STAGEDIR}${SBCL_HOME}/${MOD} | |||||
.endfor | |||||
.if ${PORT_OPTIONS:MDOCS} | |||||
${MKDIR} ${STAGEDIR}${DOCSDIR}/ | |||||
${INSTALL_DATA} ${MANUALS:S,^, ${WRKSRC}/doc/manual/,g} \ | |||||
${STAGEDIR}${DOCSDIR}/ | |||||
${INSTALL_DATA} ${TEXTDOCS:S,^,${WRKSRC}/,g} ${STAGEDIR}${DOCSDIR}/ | |||||
${MKDIR} ${MODULESDOCS:C,/[^/]+$,,g:u:S,^,${STAGEDIR}${DOCSDIR}/,g} | |||||
. for MODDOC in ${MODULESDOCS} | |||||
${INSTALL_DATA} ${WRKSRC}/contrib/${MODDOC} \ | |||||
${STAGEDIR}${DOCSDIR}/${MODDOC} | |||||
. endfor | |||||
.endif | |||||
${INSTALL_MAN} ${WRKSRC}/doc/sbcl.1 ${STAGEDIR}${MAN1PREFIX}/man/man1 | |||||
check regression-test test: build | post-build-DOCS-on: | ||||
(cd ${WRKSRC}/tests && ${SETENV} CC="${CC}" ${SH} run-tests.sh) | ${DO_MAKE_BUILD} -C ${WRKSRC}/doc/manual info html | ||||
Done Inline ActionsEither DOCS_ALL_TARGET, or this, not both. adamw: Either `DOCS_ALL_TARGET`, or this, not both. | |||||
bootstrap: | post-install: | ||||
${CP} -r ${WRKSRC} ${WRKDIR}/${NEWBOOTNAME} | ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/sbcl | ||||
(cd ${WRKDIR}/ && \ | |||||
Done Inline ActionsWhat's with all the quoted paths? adamw: What's with all the quoted paths? | |||||
${WRKDIR}/${NEWBOOTNAME}/binary-distribution.sh ${NEWBOOTNAME}) | post-install-DOCS-on: | ||||
(cd ${WRKDIR}/ && ${BZIP2_CMD} ${NEWBOOTNAME}-binary.tar) | ${RM} ${STAGEDIR}${PREFIX}/${INFO_PATH}/dir # don't requered with INFO= | ||||
${RM} -r ${STAGEDIR}${DOCSDIR}/html # empty directory created by install.sh | |||||
check regression-test test: build | |||||
(cd ${WRKSRC}/tests && ${SH} run-tests.sh) | |||||
Done Inline ActionsNo. OPTIONS handles this already. adamw: No. OPTIONS handles this already. | |||||
Not Done Inline ActionsHow many different ways is this planning on being called? adamw: How many different ways is this planning on being called? | |||||
.include <bsd.port.mk> | .include <bsd.port.mk> |
No. Take that whole thing out. OPTIONS_DEFAULT should not be changing based on things that won't exist at options-time in poudriere.