diff options
author | olgeni <olgeni@FreeBSD.org> | 2010-01-15 20:14:39 +0800 |
---|---|---|
committer | olgeni <olgeni@FreeBSD.org> | 2010-01-15 20:14:39 +0800 |
commit | db6c634e448bc8765cbc58ca91b1a4e4aa41610a (patch) | |
tree | 9c5ff04da0b9c023f86f7db9b932c7c9a9da8101 /devel/cl-asdf | |
parent | e434a643efdf84c3dfcdc64e58706cc363f818d1 (diff) | |
download | freebsd-ports-gnome-db6c634e448bc8765cbc58ca91b1a4e4aa41610a.tar.gz freebsd-ports-gnome-db6c634e448bc8765cbc58ca91b1a4e4aa41610a.tar.zst freebsd-ports-gnome-db6c634e448bc8765cbc58ca91b1a4e4aa41610a.zip |
Remove redundant code and variables from the cl-* ports.
Introduce bsd.cl-asdf.mk to automate the compilation and installation
of Common Lisp libraries using the ASDF framework.
Currently it supports building FASL files on SBCL and CLISP, to
support the ports that already exist in the ports tree.
This should help bringing in more cl-* ports from the ASDF repository
without excessive code duplication.
Diffstat (limited to 'devel/cl-asdf')
-rw-r--r-- | devel/cl-asdf/Makefile | 35 | ||||
-rw-r--r-- | devel/cl-asdf/bsd.cl-asdf.mk | 110 | ||||
-rw-r--r-- | devel/cl-asdf/pkg-plist | 6 |
3 files changed, 128 insertions, 23 deletions
diff --git a/devel/cl-asdf/Makefile b/devel/cl-asdf/Makefile index c592fa325994..26f27631bd3a 100644 --- a/devel/cl-asdf/Makefile +++ b/devel/cl-asdf/Makefile @@ -9,36 +9,30 @@ PORTNAME= asdf PORTVERSION= 1.374 +PORTREVISION= 1 PORTEPOCH= 1 CATEGORIES= devel lisp +PKGNAMEPREFIX= cl- MASTER_SITES= ${MASTER_SITE_LOCAL} MASTER_SITE_SUBDIR= olgeni -PKGNAMEPREFIX= cl- MAINTAINER= olgeni@FreeBSD.org COMMENT= A system definition facility for Common Lisp -SUB_FILES+= pkg-message WRKSRC= ${WRKDIR}/${PORTNAME} -NO_BUILD= yes # Sources only -DOCSDIR= ${PREFIX}/share/doc/${UNIQUENAME} -EXAMPLESDIR= ${PREFIX}/share/examples/${UNIQUENAME} +NO_BUILD= yes -CL_LIBDIR= ${PREFIX}/lib/common-lisp -ASDF_SYSTEM_REGISTRY= ${CL_LIBDIR}/system-registry +SUB_FILES+= pkg-message do-install: - @${MKDIR} ${CL_LIBDIR}/asdf - @${MKDIR} ${ASDF_SYSTEM_REGISTRY} - - @${INSTALL_DATA} ${WRKSRC}/*.lisp ${CL_LIBDIR}/asdf/ - @${INSTALL_DATA} ${WRKSRC}/*.asd ${CL_LIBDIR}/asdf/ - - @${LN} -sf ${CL_LIBDIR}/asdf/*.asd ${ASDF_SYSTEM_REGISTRY} - - @${SED} -i '' -e 's|%%PREFIX%%|${PREFIX}|' ${CL_LIBDIR}/asdf/asdf.lisp - @${SED} -e 's|%%ASDF_PATHNAME%%|${CL_LIBDIR}/asdf/asdf|' \ - -e 's|%%ASDF_SYSTEM_REGISTRY%%|${ASDF_SYSTEM_REGISTRY}|' \ + @${MKDIR} ${ASDF_PATHNAME} + @${MKDIR} ${ASDF_REGISTRY} + @${INSTALL_DATA} ${WRKSRC}/*.lisp ${ASDF_PATHNAME} + @${INSTALL_DATA} ${WRKSRC}/*.asd ${ASDF_PATHNAME} + @${LN} -sf ${ASDF_PATHNAME}/*.asd ${ASDF_REGISTRY} + @${SED} -i '' -e 's|%%PREFIX%%|${PREFIX}|' ${ASDF_PATHNAME}/asdf.lisp + @${SED} -e 's|%%ASDF_PATHNAME%%|${ASDF_PATHNAME}/asdf|' \ + -e 's|%%ASDF_REGISTRY%%|${ASDF_REGISTRY}|' \ -e 's|%%PREFIX%%|${PREFIX}|' \ ${FILESDIR}/asdf-init.lisp > \ ${PREFIX}/etc/asdf-init.lisp.default @@ -47,11 +41,12 @@ do-install: ${PREFIX}/etc/asdf-init.lisp .if !defined(NOPORTDOCS) @${MKDIR} ${DOCSDIR} - @${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR}/ - @${INSTALL_DATA} ${FILESDIR}/README.FreeBSD ${DOCSDIR}/ + @${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR} + @${INSTALL_DATA} ${FILESDIR}/README.FreeBSD ${DOCSDIR} .endif post-install: @${CAT} ${PKGMESSAGE} +.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 new file mode 100644 index 000000000000..bd647e3ccaf6 --- /dev/null +++ b/devel/cl-asdf/bsd.cl-asdf.mk @@ -0,0 +1,110 @@ +# $FreeBSD$ +# +# 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 +# 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 UNIQUENAME (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 chosed 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/${UNIQUENAME} +EXAMPLESDIR= ${PREFIX}/share/examples/${UNIQUENAME} + +.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:${PORTSDIR}/lang/sbcl +RUN_DEPENDS+= sbcl:${PORTSDIR}/lang/sbcl +.elif defined(USE_CLISP) +BUILD_DEPENDS+= clisp:${PORTSDIR}/lang/clisp +RUN_DEPENDS+= clisp:${PORTSDIR}/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.lisp:${PORTSDIR}/devel/cl-asdf +RUN_DEPENDS= ${LOCALBASE}/${CL_LIBDIR_REL}/asdf/asdf.lisp:${PORTSDIR}/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:${PORTSDIR}/devel/cl-asdf-clisp +RUN_DEPENDS+= ${LOCALBASE}/${CL_LIBDIR_REL}/asdf/${FASL_DIR_REL}/asdf.fasl:${PORTSDIR}/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 WRKSRC=${WRKSRC}/ \ + ${SBCL} --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 WRKSRC=${WRKSRC}/ \ + ${CLISP} -q -ansi -norc \ + -i ${LOCALBASE}/etc/asdf-init \ + -x "(asdf:oos 'asdf:compile-op :${MODULE})" +.endif # USE_CLISP + +.endfor + +.endif # !target(do-build) + +.if !target(do-install) + +do-install: + @${MKDIR} ${FASL_PATHNAME} + @${INSTALL_DATA} ${WRKSRC}/*.fasl ${FASL_PATHNAME} + +.endif # !target(do-install) + +.endif # FASL_BUILD diff --git a/devel/cl-asdf/pkg-plist b/devel/cl-asdf/pkg-plist index 25bf8ebe19f6..62832838b437 100644 --- a/devel/cl-asdf/pkg-plist +++ b/devel/cl-asdf/pkg-plist @@ -14,6 +14,6 @@ etc/asdf-init.lisp.default %%PORTDOCS%%%%DOCSDIR%%/README %%PORTDOCS%%%%DOCSDIR%%/README.FreeBSD %%PORTDOCS%%@dirrm %%DOCSDIR%% -@dirrm %%LIB32DIR%%/common-lisp/system-registry -@dirrm %%LIB32DIR%%/common-lisp/asdf -@dirrm %%LIB32DIR%%/common-lisp +@dirrmtry %%LIB32DIR%%/common-lisp/system-registry +@dirrmtry %%LIB32DIR%%/common-lisp/asdf +@dirrmtry %%LIB32DIR%%/common-lisp |