Date: Fri, 20 Dec 2024 02:47:44 GMT From: Joseph Mingrone <jrm@FreeBSD.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Subject: git: 4c954c1522cb - main - Infrastructure for Common Lisp Ports: Overhaul Message-ID: <202412200247.4BK2liAn066796@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by jrm: URL: https://cgit.FreeBSD.org/ports/commit/?id=4c954c1522cbf4d05013caaf40c36458d82f1480 commit 4c954c1522cbf4d05013caaf40c36458d82f1480 Author: Joseph Mingrone <jrm@FreeBSD.org> AuthorDate: 2024-12-07 04:35:45 +0000 Commit: Joseph Mingrone <jrm@FreeBSD.org> CommitDate: 2024-12-20 02:31:48 +0000 Infrastructure for Common Lisp Ports: Overhaul - Decouple ASDF initialization from devel/cl-asdf by creating a dedicated port: devel/freebsd-cl-asdf-init. - Convert devel/cl-asdf/bsd.cl-asdf.mk to USES=cl. - Add devel/cl-asdf-sbcl - Update ASDF configuration: - Prefer newer ASDF versions, but only if the fasl is available. - Replace license text with an SPDX license identifier. - Simplify and clarify documentation. - Remove the assumption that ${PREFIX} is /usr/local. - Use uiop:getenv instead of a custom getenv function. - Remove asdf:output-files customization to resolve output translation issues. - Improve output translations: - Prevent writing fasls to ${PREFIX}/lib/common-lisp/ when the corresponding fasl port is not installed. - Fall back to ASDF's default caching mechanism of writing fasl to a cache under ${HOME} when users install a Common Lisp port without its fasl port. - Improve interoperability with Common Lisp code from sources outside of ports, such as Quicklisp. - Add support for Clozure Common Lisp (CCL) Approved by: olgeni (implicit) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47983 --- Mk/Uses/cl.mk | 142 ++++++++++++ converters/cl-babel-sbcl/Makefile | 8 +- converters/cl-babel/Makefile | 5 +- devel/Makefile | 2 + devel/cl-alexandria-sbcl/Makefile | 10 +- devel/cl-alexandria/Makefile | 4 +- devel/cl-asdf-sbcl/Makefile | 19 ++ devel/cl-asdf-sbcl/pkg-descr | 7 + devel/cl-asdf/Makefile | 11 +- devel/cl-asdf/bsd.cl-asdf.mk | 122 ---------- devel/cl-asdf/files/asdf-init.lisp | 254 --------------------- devel/cl-asdf/files/patch-Makefile | 11 - devel/cl-asdf/files/pkg-message.in | 16 -- devel/cl-asdf/pkg-plist | 1 - devel/cl-cffi/Makefile | 8 +- devel/cl-freebsd-asdf-init/Makefile | 25 ++ .../files/cl-freebsd-asdf-init.lisp.in | 184 +++++++++++++++ devel/cl-freebsd-asdf-init/pkg-descr | 15 ++ devel/cl-infix-sbcl/Makefile | 6 +- devel/cl-infix/Makefile | 7 +- devel/cl-port-sbcl/Makefile | 6 +- devel/cl-port/Makefile | 7 +- devel/cl-split-sequence-sbcl/Makefile | 6 +- devel/cl-split-sequence/Makefile | 7 +- devel/cl-trivial-features-sbcl/Makefile | 6 +- devel/cl-trivial-features/Makefile | 7 +- devel/cl-trivial-gray-streams-sbcl/Makefile | 6 +- devel/cl-trivial-gray-streams/Makefile | 7 +- lang/ccl/Makefile | 4 +- lang/ccl/pkg-message | 6 +- lang/clisp/Makefile | 2 +- lang/sbcl/Makefile | 6 +- lang/sbcl/files/pkg-message.in | 10 - lang/sbcl/files/sbclrc.in | 2 +- security/cl-md5-sbcl/Makefile | 6 +- security/cl-md5/Makefile | 7 +- textproc/cl-meta-sbcl/Makefile | 6 +- textproc/cl-meta/Makefile | 5 +- textproc/cl-ppcre-sbcl/Makefile | 6 +- textproc/cl-ppcre/Makefile | 4 +- www/cl-lml-sbcl/Makefile | 6 +- www/cl-lml/Makefile | 7 +- x11-wm/stumpwm/Makefile | 1 - x11/cl-clx-sbcl/Makefile | 6 +- x11/cl-clx/Makefile | 5 +- 45 files changed, 466 insertions(+), 532 deletions(-) diff --git a/Mk/Uses/cl.mk b/Mk/Uses/cl.mk new file mode 100644 index 000000000000..6144c08386b7 --- /dev/null +++ b/Mk/Uses/cl.mk @@ -0,0 +1,142 @@ +# Provide support for Common Lisp ports. +# +# Feature: cl +# Usage: USES=cl +# Valid ARGS: none +# +# Variables, which may be set by ports: +# ASDF_MODULES - List of ASDF modules to build when FASL_TARGET is set (defaults to PORTNAME) +# FASL_TARGET - Build fasl variant of port (one of ccl, clisp, or sbcl) +# USE_ASDF - Depend on devel/cl-asdf +# USE_ASDF_FASL - Depend on devel/cl-asdf-<FASL_TARGET> +# USE_CCL - Depend on lang/ccl; implied when FASL_TARGET=ccl +# USE_CLISP - Depend on lang/clisp; implied when FASL_TARGET=clisp +# USE_SBCL - Depend on lang/sbcl; implied when FASL_TARGET=SBCL +# +# Variables to be read by ports: +# ASDF_PATHNAME - Path to CL source +# ASDF_REGISTRY - Path to CL registry containing asd files +# CCL - Path to the Clozure Common Lisp compiler +# CLISP - Path to the GNU Common Lisp compiler +# CL_LIBDIR_REL - CL library directory relative to LOCALBASE or PREFIX +# DOCSDIR - DOCSDIR accounting for cl- PKGNAMEPREFIX +# EXAMPLESDIR - EXAMPLESDIR accounting for cl- PKGNAMEPREFIX +# FASL_DIR_REL - Relative path to compiled fasl files; depends on FASL_TARGET +# FASL_PATHNAME - Path to CL fasl +# LISP_EXTRA_ARG - Extra arguments used when building fasl +# SBCL - Path to the Steel Bank Common Lisp compiler + +.if !defined(_INCLUDE_USES_CL_MK) +_INCLUDE_USES_CL_MK= yes + +CL_ASDF_Include_MAINTAINER= olgeni@FreeBSD.org + +CCL?= ${LOCALBASE}/bin/ccl +CLISP?= ${LOCALBASE}/bin/clisp +SBCL?= ${LOCALBASE}/bin/sbcl + +CL_LIBDIR_REL= lib/common-lisp + +ASDF_PATHNAME= ${PREFIX}/${CL_LIBDIR_REL}/${PORTNAME} +ASDF_REGISTRY= ${PREFIX}/${CL_LIBDIR_REL}/system-registry + +# Include PKGNAMEPREFIX in DOCSDIR and EXAMPLESDIR +DOCSDIR= ${PREFIX}/share/doc/${PKGBASE} +EXAMPLESDIR= ${PREFIX}/share/examples/${PKGBASE} + +. if ${PORTNAME} != "ccl" +NO_ARCH= yes +. endif + +. if defined(FASL_TARGET) +FASL_DIR_REL= ${FASL_TARGET}fasl +FASL_PATHNAME= ${PREFIX}/${CL_LIBDIR_REL}/${PORTNAME}/${FASL_DIR_REL} +PKGNAMESUFFIX= -${FASL_TARGET} +. if ${FASL_TARGET} == "ccl" +USE_CCL= yes +. elif ${FASL_TARGET} == "clisp" +USE_CLISP= yes +. elif ${FASL_TARGET} == "sbcl" +USE_SBCL= yes +. endif +. endif # defined(FASL_TARGET) + +. if defined(USE_CCL) +BUILD_DEPENDS+= ccl:lang/ccl +RUN_DEPENDS+= ccl:lang/ccl +. elif defined(USE_CLISP) +BUILD_DEPENDS+= clisp:lang/clisp +RUN_DEPENDS+= clisp:lang/clisp +. elif defined(USE_SBCL) +BUILD_DEPENDS+= sbcl:lang/sbcl +RUN_DEPENDS+= sbcl:lang/sbcl +. endif + +. if defined(USE_ASDF) +# Depend on the ASDF port, even if the Common Lisp compiler already has a bundled +# ASDF framework. +BUILD_DEPENDS+= ${LOCALBASE}/${CL_LIBDIR_REL}/asdf/asdf.asd:devel/cl-asdf +RUN_DEPENDS+= ${LOCALBASE}/${CL_LIBDIR_REL}/asdf/asdf.asd:devel/cl-asdf +. endif # defined(USE_ASDF) + +. if defined(USE_ASDF_FASL) +. if defined(USE_CCL) +BUILD_DEPENDS+= ${LOCALBASE}/${CL_LIBDIR_REL}/asdf/${FASL_DIR_REL}/build/asdf.fx64fsl:devel/cl-asdf-ccl +RUN_DEPENDS+= ${LOCALBASE}/${CL_LIBDIR_REL}/asdf/${FASL_DIR_REL}/build/asdf.fx64fsl:devel/cl-asdf-ccl +. elif defined(USE_CLISP) +BUILD_DEPENDS+= ${LOCALBASE}/${CL_LIBDIR_REL}/asdf/${FASL_DIR_REL}/build/asdf.fas:devel/cl-asdf-clisp +RUN_DEPENDS+= ${LOCALBASE}/${CL_LIBDIR_REL}/asdf/${FASL_DIR_REL}/build/asdf.fas:devel/cl-asdf-clisp +. elif defined(USE_SBCL) +BUILD_DEPENDS+= ${LOCALBASE}/${CL_LIBDIR_REL}/asdf/${FASL_DIR_REL}/build/asdf.fasl:devel/cl-asdf-sbcl +RUN_DEPENDS+= ${LOCALBASE}/${CL_LIBDIR_REL}/asdf/${FASL_DIR_REL}/build/asdf.fasl:devel/cl-asdf-sbcl +. endif +. endif # defined(USE_ASDF_FASL) + +. if defined(FASL_TARGET) + +ASDF_MODULES?= ${PORTNAME} + +. if !target(do-build) +# See devel/cl-freebsd-asdf-init/files/cl-freebsd-asdf-init.lisp for the meaning +# of FBSD_ASDF_COMPILE_PORT. +do-build: +. for MODULE in ${ASDF_MODULES} +. if defined(USE_CCL) + @FBSD_ASDF_COMPILE_PORT=t PORTNAME=${PORTNAME} WRKSRC=${WRKSRC}/ \ + ${CCL} ${LISP_EXTRA_ARG} -b -n \ + -l ${LOCALBASE}/etc/cl-freebsd-asdf-init \ + -e "(asdf:oos 'asdf:compile-op :${MODULE})" +. endif # USE_CCL + +. if defined(USE_CLISP) + @FBSD_ASDF_COMPILE_PORT=t PORTNAME=${PORTNAME} WRKSRC=${WRKSRC}/ \ + ${CLISP} ${LISP_EXTRA_ARG} -ansi -norc \ + -i ${LOCALBASE}/etc/cl-freebsd-asdf-init \ + -x "(asdf:oos 'asdf:compile-op :${MODULE})" +. endif # USE_CLISP + +. if defined(USE_SBCL) + @FBSD_ASDF_COMPILE_PORT=t PORTNAME=${PORTNAME} WRKSRC=${WRKSRC}/ \ + ${SBCL} ${LISP_EXTRA_ARG} --noinform --userinit /dev/null --disable-debugger \ + --eval '#.(load "${LOCALBASE}/etc/cl-freebsd-asdf-init")' \ + --eval "(asdf:oos 'asdf:compile-op :${MODULE})" \ + --eval "(quit)" +. endif # USE_SBCL +. endfor +. endif # !target(do-build) + +. if !target(do-install) +do-install: + @${MKDIR} ${STAGEDIR}${FASL_PATHNAME} + @cd ${WRKSRC} && ${COPYTREE_SHARE} . ${STAGEDIR}${FASL_PATHNAME} + +. endif # !target(do-install) +post-install: + @cd ${WRKSRC} && ${FIND} * -type f \ + | ${SORT} \ + | ${AWK} '{ print "${CL_LIBDIR_REL}/${PORTNAME}/${FASL_DIR_REL}/" $$1 }' \ + >> ${TMPPLIST} + +. endif # FASL_TARGET + +.endif # _INCLUDE_USES_ASDF_MK diff --git a/converters/cl-babel-sbcl/Makefile b/converters/cl-babel-sbcl/Makefile index fabe9aaa04de..1857ce17c354 100644 --- a/converters/cl-babel-sbcl/Makefile +++ b/converters/cl-babel-sbcl/Makefile @@ -1,6 +1,6 @@ PORTNAME= babel PORTVERSION= 2010.01.16 -PORTREVISION= 90 +PORTREVISION= 91 CATEGORIES= converters lisp PKGNAMEPREFIX= cl- DISTFILES= # none @@ -18,10 +18,8 @@ RUN_DEPENDS= ${LOCALBASE}/${CL_LIBDIR_REL}/babel/babel.asd:converters/cl-babel \ ${LOCALBASE}/${CL_LIBDIR_REL}/trivial-features/sbclfasl/src/tf-sbcl.fasl:devel/cl-trivial-features-sbcl \ ${LOCALBASE}/${CL_LIBDIR_REL}/trivial-gray-streams/sbclfasl/package.fasl:devel/cl-trivial-gray-streams-sbcl -USE_ASDF_FASL= yes -FASL_TARGET= sbcl -FASL_BUILD= yes +USES= cl ASDF_MODULES= babel babel-streams +FASL_TARGET= sbcl -.include "${.CURDIR}/../../devel/cl-asdf/bsd.cl-asdf.mk" .include <bsd.port.mk> diff --git a/converters/cl-babel/Makefile b/converters/cl-babel/Makefile index 1cb3da7af8f4..0d486d68e668 100644 --- a/converters/cl-babel/Makefile +++ b/converters/cl-babel/Makefile @@ -1,6 +1,6 @@ PORTNAME= babel PORTVERSION= 2010.01.16 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= converters lisp PKGNAMEPREFIX= cl- MASTER_SITES= LOCAL/olgeni @@ -18,7 +18,7 @@ RUN_DEPENDS= ${LOCALBASE}/${CL_LIBDIR_REL}/alexandria/alexandria.asd:devel/cl-al NO_BUILD= yes -USE_ASDF= yes +USES= cl OPTIONS_DEFINE= DOCS EXAMPLES @@ -36,5 +36,4 @@ do-install: @${MKDIR} ${STAGEDIR}${EXAMPLESDIR} @${INSTALL_DATA} ${WRKSRC}/tests/* ${STAGEDIR}${EXAMPLESDIR} -.include "${.CURDIR}/../../devel/cl-asdf/bsd.cl-asdf.mk" .include <bsd.port.mk> diff --git a/devel/Makefile b/devel/Makefile index 7c69ed2e6f0f..aa1f57730ff2 100644 --- a/devel/Makefile +++ b/devel/Makefile @@ -414,7 +414,9 @@ SUBDIR += cl-alexandria SUBDIR += cl-alexandria-sbcl SUBDIR += cl-asdf + SUBDIR += cl-asdf-sbcl SUBDIR += cl-cffi + SUBDIR += cl-freebsd-asdf-init SUBDIR += cl-infix SUBDIR += cl-infix-sbcl SUBDIR += cl-port diff --git a/devel/cl-alexandria-sbcl/Makefile b/devel/cl-alexandria-sbcl/Makefile index ce7cd0976d92..7197fa07679f 100644 --- a/devel/cl-alexandria-sbcl/Makefile +++ b/devel/cl-alexandria-sbcl/Makefile @@ -1,23 +1,21 @@ PORTNAME= alexandria PORTVERSION= 1.4 -PORTREVISION= 1 +PORTREVISION= 2 PORTEPOCH= 1 CATEGORIES= devel lisp PKGNAMEPREFIX= cl- DISTFILES= # none -LICENSE= PD - MAINTAINER= olgeni@FreeBSD.org COMMENT= Collection of portable public domain utilities for Common Lisp WWW= https://common-lisp.net/project/alexandria/ +LICENSE= PD + BUILD_DEPENDS= ${LOCALBASE}/${CL_LIBDIR_REL}/alexandria/alexandria.asd:devel/cl-alexandria RUN_DEPENDS= ${LOCALBASE}/${CL_LIBDIR_REL}/alexandria/alexandria.asd:devel/cl-alexandria -USE_ASDF_FASL= yes +USES= cl FASL_TARGET= sbcl -FASL_BUILD= yes -.include "${.CURDIR}/../../devel/cl-asdf/bsd.cl-asdf.mk" .include <bsd.port.mk> diff --git a/devel/cl-alexandria/Makefile b/devel/cl-alexandria/Makefile index eadd890ba221..d83d7e05511d 100644 --- a/devel/cl-alexandria/Makefile +++ b/devel/cl-alexandria/Makefile @@ -1,6 +1,7 @@ PORTNAME= alexandria DISTVERSIONPREFIX= v DISTVERSION= 1.4 +PORTREVISION= 1 PORTEPOCH= 1 CATEGORIES= devel lisp PKGNAMEPREFIX= cl- @@ -12,7 +13,7 @@ WWW= https://common-lisp.net/project/alexandria/ LICENSE= PD LICENSE_FILE= ${WRKSRC}/LICENCE -USE_ASDF= yes +USES= cl USE_GITLAB= yes GL_SITE= https://gitlab.common-lisp.net @@ -46,5 +47,4 @@ do-install-DOCS-on: ${INSTALL_DATA} ${WRKSRC}/doc/${PORTNAME}.html ${WRKSRC}/doc/${PORTNAME}.pdf \ ${STAGEDIR}${DOCSDIR} -.include "${.CURDIR}/../../devel/cl-asdf/bsd.cl-asdf.mk" .include <bsd.port.mk> diff --git a/devel/cl-asdf-sbcl/Makefile b/devel/cl-asdf-sbcl/Makefile new file mode 100644 index 000000000000..b099b81c3b72 --- /dev/null +++ b/devel/cl-asdf-sbcl/Makefile @@ -0,0 +1,19 @@ +PORTNAME= asdf +PORTVERSION= 3.3.7 +CATEGORIES= devel lisp +PKGNAMEPREFIX= cl- +DISTFILES= # none + +MAINTAINER= jrm@FreeBSD.org +COMMENT= System definition facility for Common Lisp +WWW= https://common-lisp.net/project/asdf/ + +LICENSE= MIT + +BUILD_DEPENDS= ${LOCALBASE}/${CL_LIBDIR_REL}/asdf/asdf.asd:devel/cl-asdf +RUN_DEPENDS= ${LOCALBASE}/${CL_LIBDIR_REL}/asdf/asdf.asd:devel/cl-asdf + +USES= cl +FASL_TARGET= sbcl + +.include <bsd.port.mk> diff --git a/devel/cl-asdf-sbcl/pkg-descr b/devel/cl-asdf-sbcl/pkg-descr new file mode 100644 index 000000000000..037297a06e01 --- /dev/null +++ b/devel/cl-asdf-sbcl/pkg-descr @@ -0,0 +1,7 @@ +asdf is Another System Definition Facility for Common Lisp. It intends +to solve the same class of problems as mk-defsystem - compiling and +installing Lisp libraries -, but internally it takes advantage of +modern CL features like pathname support etc., and uses CLOS for +extensibility. + +This package is compiled with SBCL. diff --git a/devel/cl-asdf/Makefile b/devel/cl-asdf/Makefile index 51f5d7d8baad..5819b843ba3d 100644 --- a/devel/cl-asdf/Makefile +++ b/devel/cl-asdf/Makefile @@ -11,10 +11,7 @@ WWW= https://common-lisp.net/project/asdf/ LICENSE= MIT -USES= gmake - -ALL_TARGET= build/asdf.lisp -SUB_FILES= pkg-message +USES= cl gmake OPTIONS_DEFINE= DOCS @@ -37,16 +34,10 @@ do-install: ${RLN} ${STAGEDIR}${ASDF_PATHNAME}/build/asdf.lisp ${STAGEDIR}${ASDF_PATHNAME} ${RLN} ${STAGEDIR}${ASDF_PATHNAME}/asdf.asd ${STAGEDIR}${ASDF_REGISTRY} ${RLN} ${STAGEDIR}${ASDF_PATHNAME}/uiop/uiop.asd ${STAGEDIR}${ASDF_REGISTRY} - ${SED} -e 's|%%ASDF_PATHNAME%%|${ASDF_PATHNAME}/asdf|' \ - -e 's|%%ASDF_REGISTRY%%|${ASDF_REGISTRY}|' \ - -e 's|%%PREFIX%%|${PREFIX}|' \ - ${FILESDIR}/asdf-init.lisp > \ - ${STAGEDIR}${PREFIX}/etc/asdf-init.lisp.default do-install-DOCS-on: @${MKDIR} ${STAGEDIR}${DOCSDIR} (cd ${WRKSRC}/doc && ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR}) (cd ${STAGEDIR}${DOCSDIR} && ${RM} .htaccess Changelog Makefile) -.include <bsd.cl-asdf.mk> .include <bsd.port.mk> diff --git a/devel/cl-asdf/bsd.cl-asdf.mk b/devel/cl-asdf/bsd.cl-asdf.mk deleted file mode 100644 index 4073f8a98516..000000000000 --- a/devel/cl-asdf/bsd.cl-asdf.mk +++ /dev/null @@ -1,122 +0,0 @@ -# bsd.cl-asdf.mk - Common Lisp related macros -# -# SBCL - Path to the Steel Bank Common Lisp compiler -# CLISP - Path to the GNU Common Lisp compiler -# LISP_EXTRA_ARG - Extra arguments for compiler used by FASL_BUILD ports -# CL_LIBDIR_REL - Common Lisp library directory, relative to LOCALBASE or PREFIX -# ASDF_PATHNAME - Where to install compiled FASL files (depends on FASL_DIR_REL) -# ASDF_REGISTRY - Path to ASDF registry -# DOCSDIR - DOCSDIR using PKGBASE (to account for optional cl- PKGNAMEPREFIX) -# EXAMPLESDIR - Same as above, for EXAMPLESDIR -# FASL_DIR_REL - Relative path to compiled FASL files; depends on FASL_TARGET -# FASL_TARGET - Platform for building FASL files (currently "sbcl" or "clisp") -# USE_SBCL - If set, depend on lang/sbcl -# USE_CLISP - If set, depend on lang/clisp -# USE_ASDF - If set, depend on devel/cl-asdf -# USE_ASDF_FASL - If set, set dependency on compiled ASDF files (only if -# required by the chosen FASL_TARGET) -# FASL_BUILD - If set, compile FASL files using the ASDF framework -# ASDF_MODULES - If FASL_BUILD is set: list of ASDF modules to compile - -CL_ASDF_Include_MAINTAINER= olgeni@FreeBSD.org - -SBCL?= ${LOCALBASE}/bin/sbcl -CLISP?= ${LOCALBASE}/bin/clisp - -CL_LIBDIR_REL= lib/common-lisp - -ASDF_PATHNAME= ${PREFIX}/${CL_LIBDIR_REL}/${PORTNAME} -FASL_PATHNAME= ${PREFIX}/${CL_LIBDIR_REL}/${PORTNAME}/${FASL_DIR_REL} -ASDF_REGISTRY= ${PREFIX}/${CL_LIBDIR_REL}/system-registry - -# Include PKGNAMEPREFIX in DOCSDIR and EXAMPLESDIR -DOCSDIR= ${PREFIX}/share/doc/${PKGBASE} -EXAMPLESDIR= ${PREFIX}/share/examples/${PKGBASE} - -.if ${PORTNAME} != "ccl" -NO_ARCH= yes -.endif - -.if defined(FASL_TARGET) -FASL_DIR_REL= ${FASL_TARGET}fasl -PKGNAMESUFFIX= -${FASL_TARGET} -.if ${FASL_TARGET} == "sbcl" -USE_SBCL= yes -.elif ${FASL_TARGET} == "clisp" -USE_CLISP= yes -.endif -.endif # defined(FASL_TARGET) - -.if defined(USE_SBCL) -BUILD_DEPENDS+= sbcl:lang/sbcl -RUN_DEPENDS+= sbcl:lang/sbcl -.elif defined(USE_CLISP) -BUILD_DEPENDS+= clisp:lang/clisp -RUN_DEPENDS+= clisp:lang/clisp -.endif # defined(USE_CLISP) - -.if defined(USE_ASDF) -# Even if the Common Lisp compiler already has a bundled ASDF framework, -# we still need the asdf-init file. - -BUILD_DEPENDS+= ${LOCALBASE}/${CL_LIBDIR_REL}/asdf/asdf.asd:devel/cl-asdf -RUN_DEPENDS+= ${LOCALBASE}/${CL_LIBDIR_REL}/asdf/asdf.asd:devel/cl-asdf - -.endif # defined(USE_ASDF) - -.if defined(USE_ASDF_FASL) -.if defined(USE_SBCL) -# SBCL already has a bundled ASDF framework -.elif defined(USE_CLISP) -BUILD_DEPENDS+= ${LOCALBASE}/${CL_LIBDIR_REL}/asdf/${FASL_DIR_REL}/asdf.fasl:devel/cl-asdf-clisp -RUN_DEPENDS+= ${LOCALBASE}/${CL_LIBDIR_REL}/asdf/${FASL_DIR_REL}/asdf.fasl:devel/cl-asdf-clisp -.endif # defined(USE_CLISP) -.endif # defined(USE_ASDF_FASL) - -.if defined(FASL_BUILD) - -ASDF_MODULES?= ${PORTNAME} - -.if !target(do-build) - -# See devel/cl-asdf/files/asdf-init.lisp for the meaning of FBSD_ASDF_COMPILE_PORT. - -do-build: - -.for MODULE in ${ASDF_MODULES} - -.if defined(USE_SBCL) - @FBSD_ASDF_COMPILE_PORT=t PORTNAME=${PORTNAME} WRKSRC=${WRKSRC}/ \ - ${SBCL} ${LISP_EXTRA_ARG} --noinform --userinit /dev/null --disable-debugger \ - --eval '#.(load "${LOCALBASE}/etc/asdf-init")' \ - --eval "(asdf:oos 'asdf:compile-op :${MODULE})" \ - --eval "(quit)" -.endif # USE_SBCL - -.if defined(USE_CLISP) - @FBSD_ASDF_COMPILE_PORT=t PORTNAME=${PORTNAME} WRKSRC=${WRKSRC}/ \ - ${CLISP} ${LISP_EXTRA_ARG} -ansi -norc \ - -i ${LOCALBASE}/etc/asdf-init \ - -x "(asdf:oos 'asdf:compile-op :${MODULE})" - @${FIND} ${WRKSRC} -name "*.lib" | ${XARGS} ${RM} -.endif # USE_CLISP - -.endfor - -.endif # !target(do-build) - -.if !target(do-install) - -do-install: - @${MKDIR} ${STAGEDIR}${FASL_PATHNAME} - @cd ${WRKSRC} && ${COPYTREE_SHARE} . ${STAGEDIR}${FASL_PATHNAME} - -.endif # !target(do-install) - -post-install: - @cd ${WRKSRC} && ${FIND} * -type f \ - | ${SORT} \ - | ${AWK} '{ print "${CL_LIBDIR_REL}/${PORTNAME}/${FASL_DIR_REL}/" $$1 }' \ - >> ${TMPPLIST} - -.endif # FASL_BUILD diff --git a/devel/cl-asdf/files/asdf-init.lisp b/devel/cl-asdf/files/asdf-init.lisp deleted file mode 100644 index a8a6e0e87446..000000000000 --- a/devel/cl-asdf/files/asdf-init.lisp +++ /dev/null @@ -1,254 +0,0 @@ -;;;; asdf-config.lisp - Setup ASDF to deal with FBSD ports conventions - -;; Copyright (c) 2003 Henrik Motakef <henrik.motakef@web.de> - -;; Redistribution and use in source and binary forms, with or without -;; modification, are permitted provided that the following conditions are -;; met: - -;; 1. Redistributions of source code must retain the above copyright -;; notice, this list of conditions and the following disclaimer. -;; -;; 2. Redistributions in binary form must reproduce the above copyright -;; notice, this list of conditions and the following disclaimer in the -;; documentation and/or other materials provided with the distribution - -;; THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED -;; WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -;; MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -;; IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -;; INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -;; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -;; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -;; HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -;; STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING -;; IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -;; POSSIBILITY OF SUCH DAMAGE. - -;;;; How to use - -;; A number of FreeBSD ports related to Common Lisp use the asdf -;; system definition library, available as devel/cl-asdf-* (which you -;; obviously already have installed, since this file is included with -;; that port). That implies that you will have to load and configure -;; asdf to use these ports with your Lisp system. -;; -;; This file takes all necessary actions. The easiest way is to load -;; it in your Lisp every time it starts, by putting -;; -;; (load "/usr/local/etc/asdf-init.lisp") -;; -;; in your init file. -;; -;; Each Lisp implementation has its own files where this can be done: -;; -;; CLISP: -;; /usr/local/lib/clisp/config.lisp -;; ~/.clisprc -;; -;; CMUCL: -;; /usr/local/lib/cmucl/lib/cmucl/lib/site-init.lisp -;; ~/.cmucl-init.lisp -;; -;; SBCL: -;; /usr/local/etc/sbclrc -;; ~/.sbclrc -;; -;; CLOZURE CL / OPENMCL: -;; ~/.ccl-init.lisp -;; -;; After that, you can load your installed ports like this (using -;; textproc/cl-ppcre as an example): -;; -;; (asdf:operate 'asdf:load-op 'cl-ppcre) -;; - -;; Have fun! - - -;;;; What's going on here - -;; We mess around with asdf:output-files in interesting ways to -;; enforce a filesystem layout that works without multiple Lisp -;; implementations overwriting their fasls. Basically, each lib has -;; its own directory in /usr/local/lib/common-lisp, initially -;; containing its sources. Each fasl port will create an -;; implementation-specific subdirectory where all its fasls go, for -;; example ./cmuclfasl, ./clispfasl etc. - -;; Additionally, all fasl files have the pathname-type "fasl", not -;; "x86f" or "fas". The reason is that I want to be prepared for the -;; case that CMUCL some lucky day might be supported on non-x86 -;; archs. Since it encodes the arch in the fasl file-type (x86f, -;; sparcf etc), hardcoding this in pkg-plists would then -;; break. Enforcing this policy for all implementations (for example, -;; CLISP uses .fas by default) simply is more convenient than handling -;; CMUCL specially. - -;; The drawback is that users cannot easily load compiled code unless -;; they set up asdf properly, which boils down to loading this file -;; instead of asdf.lisp directly. - -;; Yet another thing that has to be handled is compiling ports: During -;; 'make build', no files outside of ${WRKSRC} may be created. On the -;; other hand, it is a good idea to use the source files from their -;; final location, because CMUCL and SBCL record the source path and -;; can use, for example, to show the misbehaving form in the debugger. -;; And the fasl ports depend on the source port to be installed -;; anyway, because of the .asd file. -;; Hence, in the case of port compilation, we redirect the output to -;; ${WRKSRC}. This situation is detected by checking if an environment -;; variable FBSD_ASDF_COMPILE_PORT is set (and if we have a WRKSRC -;; envvar as well), so each port Makefile has to create this variable -;; in the environment in which it calls Lisp in do-build, see existing -;; ports for examples. - -;; Note that it is only necessary to modify -;; (output-files ((op compile-op)) ...), because asdf:load-op will use -;; this method too to decide which files are to be loaded, there is no -;; separate method for load-op. - -;;;; Adding support for other Lisp implementations - -;; In order to make all this work for not-handled-yet Lisps, it is -;; only necessary to change LISP-SPECIFIC-FASL-SUDBIR and GETENV. Of -;; course, you'll also have to create new binary ports, if that's what -;; you want. - - - -;;;; Package declaration - -(defpackage :freebsd-asdf - (:use :common-lisp) - (:export #:*asdf-pathname* - #:unsupported-lisp-implementation)) - -(in-package :freebsd-asdf) - -;;;; Paths - -(defvar *asdf-pathname* - ;; Clozure CL's internal asdf - #+openmcl "/usr/local/lib/ccl/tools/asdf" - ;; SBCL's internal asdf - #+sbcl "/usr/local/lib/sbcl/asdf/asdf" - ;; CMU and clisp - #-(or openmcl sbcl) "/usr/local/lib/common-lisp/asdf/asdf" - "Path of the ASDF library") - -(defvar *system-registry* - "/usr/local/lib/common-lisp/system-registry/" - "FreeBSD's contribution to the central registry for ASDF system -definitions. This will be added to asdf:*central-registry*, you -should modify that in order to add other directories.") - -;;;; Implementation-specific functions - -(define-condition unsupported-lisp-implementation () - () - (:report (lambda (condition stream) - (declare (ignore condition) - (type stream stream)) - (format stream "Your Lisp system, ~A ~A, is currently not ~ - supported by the FreeBSD ports system." - (lisp-implementation-type) - (lisp-implementation-version))))) - -(defun lisp-specific-fasl-subdir () - "Return the subdirectory in which fasl files for this Lisp -implementations should be stored, as a string without any slashes. - -If no subdirectory for the current implementation is known, signal an -error of type UNSUPPORTED-LISP-IMPLEMENTATION. - -This function has to be extended for each new Lisp implementation that -should be able to use the ASDF-based Lisp ports. If you do this, you -should probably extend GETENV as well." - #+clisp "clispfasl" - #+cmu "cmuclfasl" - #+sbcl "sbclfasl" - #+openmcl "cclfasl" - #-(or clisp cmu sbcl openmcl) (error 'unsupported-lisp-implementation)) - -(defun getenv (varname) - "Return the value of environment variable VARNAME, as a string. -If VARNAME is not found in the current environment, return nil. -May signal an error of type UNSUPPORTED-LISP-IMPLEMENTATION, see -below. - -This is used to communicate make variables like WRKSRC from the ports -system to Lisp. Note that this doesn't happen automatically for -variables defined in a Makefile, you'll have to pass these to the -environment in which Lisp runs explicitly. - -Since accessing environment variables is not portable, this function -has to be extended for each Lisp implementation that is to work with -FreeBSDs Lisp ports. If you do this, you should probably extend -LISP-SPECIFIC-FASL-SUBDIR as well." - #+sbcl (sb-ext:posix-getenv varname) - #+cmu (cdr (assoc varname ext:*environment-list* - :test #'equalp - :key #'string)) - #+clisp (sys::getenv varname) - #+openmcl (ccl::getenv varname) - #-(or sbcl cmu clisp openmcl) (error 'unsupported-lisp-implementation)) - -;;;; Load and configure ASDF - -(defvar *asdf-binary-pathname* - (make-pathname - :directory `(:absolute ,@(cdr (pathname-directory *asdf-pathname*)) - ,(lisp-specific-fasl-subdir)) - :type "fasl" - :defaults *asdf-pathname*)) - -(or (ignore-errors (load *asdf-binary-pathname* :verbose t :print nil)) - (load *asdf-pathname* :verbose t :print nil)) - -#+openmcl (push "ccl:tools;asdf-install;" asdf:*central-registry*) - -(pushnew *system-registry* asdf:*central-registry*) - -(defmethod asdf:output-files :around ((op asdf:compile-op) - (file asdf:cl-source-file)) - (let ((default-output-file (car (call-next-method)))) - (list - (make-pathname - :directory (pathname-directory (namestring default-output-file)) - :type "fasl" - :defaults default-output-file)))) - -;; Map each library in common-lisp/ to its fasl subdirectory - -(defvar *freebsd-output-translations* ()) - -(pushnew :inherit-configuration *freebsd-output-translations*) - -(dolist (path (directory "/usr/local/lib/common-lisp/*/")) - (let ((source (make-pathname - :directory (append (pathname-directory path) - (list :wild-inferiors)))) - (target (make-pathname - :directory (append (pathname-directory path) - (list (lisp-specific-fasl-subdir) :wild-inferiors))))) - (pushnew (list source target) *freebsd-output-translations*))) - -(if (and (getenv "FBSD_ASDF_COMPILE_PORT") - (getenv "PORTNAME") - (getenv "WRKSRC")) - (let ((wrksrc (getenv "WRKSRC")) - (portname (getenv "PORTNAME"))) - ;; If we are building a FreeBSD port, all the compiled fasl files - ;; should be redirected to WRKSRC. - (let ((source (make-pathname - :directory (append (pathname-directory #P"/usr/local/lib/common-lisp/") - (list portname :wild-inferiors)))) - (target (make-pathname - :directory (append (pathname-directory wrksrc) - (list :wild-inferiors))))) - (pushnew (list source target) *freebsd-output-translations*)))) - -(asdf:initialize-output-translations (cons :output-translations *freebsd-output-translations*)) - -;;;; asdf-init.lisp ends here diff --git a/devel/cl-asdf/files/patch-Makefile b/devel/cl-asdf/files/patch-Makefile deleted file mode 100644 index 02d99d940f21..000000000000 --- a/devel/cl-asdf/files/patch-Makefile +++ /dev/null @@ -1,11 +0,0 @@ ---- Makefile.orig 2018-03-07 21:53:28 UTC -+++ Makefile -@@ -101,7 +101,7 @@ noext: - load: build/asdf.lisp - ./test/run-tests.sh -t $l $(all_lisp) - --install: archive -+install: - - bump: bump-version - git commit -a -m "Bump version to $$(eval a=$$(cat version.lisp-expr) ; echo $$a)" diff --git a/devel/cl-asdf/files/pkg-message.in b/devel/cl-asdf/files/pkg-message.in deleted file mode 100644 index 722037f98717..000000000000 --- a/devel/cl-asdf/files/pkg-message.in +++ /dev/null @@ -1,16 +0,0 @@ -[ -{ type: install - message: <<EOM -To use asdf and depending ports, you will have to configure your -Lisp systems so they know where to find asdf itself and the system -definition files. - -A default configuration is installed in - - %%PREFIX%%/etc/asdf-init.lisp - -Review this file for further information, or simply load it from your -Lisp initialization file. -EOM -} -] diff --git a/devel/cl-asdf/pkg-plist b/devel/cl-asdf/pkg-plist index 4b2d7ec17d15..cfe35aaea7ac 100644 --- a/devel/cl-asdf/pkg-plist +++ b/devel/cl-asdf/pkg-plist @@ -1,4 +1,3 @@ -@sample etc/asdf-init.lisp.default etc/asdf-init.lisp lib/common-lisp/asdf/action.lisp lib/common-lisp/asdf/asdf.lisp lib/common-lisp/asdf/build/asdf.lisp diff --git a/devel/cl-cffi/Makefile b/devel/cl-cffi/Makefile index 4624bb8896c6..db1e4f12ec85 100644 --- a/devel/cl-cffi/Makefile +++ b/devel/cl-cffi/Makefile @@ -29,6 +29,7 @@ RUN_DEPENDS:= ${BUILD_DEPENDS} NO_BUILD= yes +USES= cl USE_ASDF= yes OPTIONS_DEFINE= DOCS EXAMPLES @@ -46,8 +47,10 @@ do-install: ${INSTALL_DATA} ${WRKSRC}/cffi.asd ${STAGEDIR}${ASDF_PATHNAME} ${INSTALL_DATA} ${WRKSRC}/cffi-uffi-compat.asd ${STAGEDIR}${ASDF_PATHNAME} ${INSTALL_DATA} ${WRKSRC}/cffi-grovel.asd ${STAGEDIR}${ASDF_PATHNAME} - ${LN} -sf ${ASDF_PATHNAME}/cffi.asd ${ASDF_PATHNAME}/cffi-uffi-compat.asd \ - ${ASDF_PATHNAME}/cffi-grovel.asd ${STAGEDIR}${ASDF_REGISTRY} + ${RLN} ${STAGEDIR}${ASDF_PATHNAME}/cffi.asd \ + ${STAGEDIR}${ASDF_PATHNAME}/cffi-uffi-compat.asd \ + ${STAGEDIR}${ASDF_PATHNAME}/cffi-grovel.asd \ + ${STAGEDIR}${ASDF_REGISTRY} @${MKDIR} ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${WRKSRC}/README.md ${STAGEDIR}${DOCSDIR} .for FILE in shareable-vectors.txt allegro-internals.txt mem-vector.txt @@ -64,5 +67,4 @@ do-install: ${INSTALL_DATA} ${WRKSRC}/examples/* ${STAGEDIR}${EXAMPLESDIR} ${INSTALL_DATA} ${WRKSRC}/tests/* ${STAGEDIR}${EXAMPLESDIR}/tests -.include "${.CURDIR}/../../devel/cl-asdf/bsd.cl-asdf.mk" .include <bsd.port.mk> diff --git a/devel/cl-freebsd-asdf-init/Makefile b/devel/cl-freebsd-asdf-init/Makefile new file mode 100644 index 000000000000..157df9f225b3 --- /dev/null +++ b/devel/cl-freebsd-asdf-init/Makefile @@ -0,0 +1,25 @@ +PORTNAME= cl-freebsd-asdf-init +PORTVERSION= 20241212 +CATEGORIES= devel +MASTER_SITES= # none +DISTFILES= # none + +MAINTAINER= jrm@FreeBSD.org +COMMENT= ASDF configuration for FreeBSD Common Lisp ports + +LICENSE= BSD2CLAUSE + +NO_ARCH= yes +NO_BUILD= yes +NO_WRKSUBDIR= yes + +PLIST_FILES= etc/asdf-init.lisp \ + etc/cl-freebsd-asdf-init.lisp +SUB_FILES= cl-freebsd-asdf-init.lisp + +do-install: + ${INSTALL_SCRIPT} ${WRKDIR}/${PORTNAME}.lisp ${STAGEDIR}${PREFIX}/etc/ + ${RLN} ${STAGEDIR}${PREFIX}/etc/${PORTNAME}.lisp \ + ${STAGEDIR}${PREFIX}/etc/asdf-init.lisp + +.include <bsd.port.mk> diff --git a/devel/cl-freebsd-asdf-init/files/cl-freebsd-asdf-init.lisp.in b/devel/cl-freebsd-asdf-init/files/cl-freebsd-asdf-init.lisp.in new file mode 100644 index 000000000000..faf0003d49ac --- /dev/null +++ b/devel/cl-freebsd-asdf-init/files/cl-freebsd-asdf-init.lisp.in @@ -0,0 +1,184 @@ +;; cl-freebsd-asdf-init.lisp - Configure ASDF to work with FreeBSD ports +;; +;; SPDX-License-Identifier: BSD-2-Clause +;; +;; Copyright (c) 2003 Henrik Motakef <henrik.motakef@web.de> +;; Copyright (c) 2024 Joseph Mingrone <jrm@FreeBSD.org> +;; +;; This file configures ASDF to work with Common Lisp (CL) installed via +;; FreeBSD ports. To load it when your Lisp implementation starts, add +;; +;; (load "%%PREFIX%%/etc/cl-freebsd-asdf-init.lisp") +;; +;; to your init file. +;; +;; These are the initialization files for the supported CL implementations: +;; +;; CLISP: +;; ~/.clisprc +;; +;; CLOZURE CL / OPENMCL: +;; ~/.ccl-init.lisp +;; +;; SBCL: +;; %%PREFIX%%/etc/sbclrc +;; ~/.sbclrc +;; +;; After that, use ASDF to load systems installed from ports like this: +;; +;; (asdf:load-system :alexandria) +;; +;; ** Detailed Explanation ** +;; +;; This ASDF initialization enables working with CL installed via FreeBSD +;; ports by serving three key functions: +;; +;; 1. It configures a central registry to tell ASDF where to find systems +;; installed via FreeBSD CL ports. +;; +;; 2. It sets up output translations so no code from CL ports needs to be +;; compiled at load time. +;; +;; CL ports have binary variants for each supported CL implementation. For +;; example, devel/cl-alexandria includes the Alexandria sources, and +;; devel/cl-alexandria-sbcl installs the compiled code (fasl) for SBCL. +;; The output translations defined here tell ASDF where to look for the +;; binary code. +;; +;; If you prefer to build systems at load time, simply install the CL port +;; without the associated fasl port, and ASDF will build and write fasl to +;; a cache under ${HOME}. +;; +;; 3. It configures specific ASDF output translations for building CL ports. +;; *** 797 LINES SKIPPED ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202412200247.4BK2liAn066796>