diff options
author | olgeni <olgeni@FreeBSD.org> | 2010-01-20 20:40:13 +0800 |
---|---|---|
committer | olgeni <olgeni@FreeBSD.org> | 2010-01-20 20:40:13 +0800 |
commit | 67470e3e62a80c8c5bfdb82dd0dc1f83227a4466 (patch) | |
tree | 7390db757292594b0ac05dc13ba7933b2952dbee /devel/cl-asdf | |
parent | 1248f9e714648228a7a75582c43573a23552a73a (diff) | |
download | freebsd-ports-gnome-67470e3e62a80c8c5bfdb82dd0dc1f83227a4466.tar.gz freebsd-ports-gnome-67470e3e62a80c8c5bfdb82dd0dc1f83227a4466.tar.zst freebsd-ports-gnome-67470e3e62a80c8c5bfdb82dd0dc1f83227a4466.zip |
When building ASDF modules with the previous cl-asdf port version,
sometimes the build would fail because of "missing" packages that
weren't actually missing (this only happened in ports that aren't
committed yet).
Rewrite the FASL placement code using the asdf-binary-locations
extension, which is already included in the cl-asdf port but needs
to be installed from ports when building for SBCL (which has its
own ASDF code). The binary-locations code generates paths unsuitable
for PLISTs, therefore it has been overridden with
lisp-specific-fasl-subdir.
Because of the new code, PLIST generation for cl-*-sbcl and cl-*-clisp
ports is now entirely automated.
All dependent cl-* ports are upgraded (obsolete code removed,
PORTREVISION bumped).
Diffstat (limited to 'devel/cl-asdf')
-rw-r--r-- | devel/cl-asdf/Makefile | 2 | ||||
-rw-r--r-- | devel/cl-asdf/bsd.cl-asdf.mk | 28 | ||||
-rw-r--r-- | devel/cl-asdf/files/asdf-init.lisp | 66 |
3 files changed, 54 insertions, 42 deletions
diff --git a/devel/cl-asdf/Makefile b/devel/cl-asdf/Makefile index 26f27631bd3a..49e7184836c7 100644 --- a/devel/cl-asdf/Makefile +++ b/devel/cl-asdf/Makefile @@ -9,7 +9,7 @@ PORTNAME= asdf PORTVERSION= 1.374 -PORTREVISION= 1 +PORTREVISION= 2 PORTEPOCH= 1 CATEGORIES= devel lisp PKGNAMEPREFIX= cl- diff --git a/devel/cl-asdf/bsd.cl-asdf.mk b/devel/cl-asdf/bsd.cl-asdf.mk index 82270e653494..e288b06484c4 100644 --- a/devel/cl-asdf/bsd.cl-asdf.mk +++ b/devel/cl-asdf/bsd.cl-asdf.mk @@ -15,7 +15,7 @@ # 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) +# 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 @@ -55,8 +55,12 @@ RUN_DEPENDS+= clisp:${PORTSDIR}/lang/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 + +BUILD_DEPENDS+= ${LOCALBASE}/${CL_LIBDIR_REL}/asdf/asdf.asd:${PORTSDIR}/devel/cl-asdf \ + ${LOCALBASE}/${CL_LIBDIR_REL}/asdf-binary-locations/asdf-binary-locations.asd:${PORTSDIR}/devel/cl-asdf-binary-locations +RUN_DEPENDS+= ${LOCALBASE}/${CL_LIBDIR_REL}/asdf/asdf.asd:${PORTSDIR}/devel/cl-asdf \ + ${LOCALBASE}/${CL_LIBDIR_REL}/asdf-binary-locations/asdf-binary-locations.asd:${PORTSDIR}/devel/cl-asdf-binary-locations + .endif # defined(USE_ASDF) .if defined(USE_ASDF_FASL) @@ -81,7 +85,7 @@ do-build: .for MODULE in ${ASDF_MODULES} .if defined(USE_SBCL) - @FBSD_ASDF_COMPILE_PORT=t WRKSRC=${WRKSRC}/ \ + @FBSD_ASDF_COMPILE_PORT=t PORTNAME=${PORTNAME} WRKSRC=${WRKSRC}/ \ ${SBCL} --noinform --userinit /dev/null --disable-debugger \ --eval '#.(load "${LOCALBASE}/etc/asdf-init")' \ --eval "(asdf:oos 'asdf:compile-op :${MODULE})" \ @@ -89,10 +93,11 @@ do-build: .endif # USE_SBCL .if defined(USE_CLISP) - @FBSD_ASDF_COMPILE_PORT=t WRKSRC=${WRKSRC}/ \ + @FBSD_ASDF_COMPILE_PORT=t PORTNAME=${PORTNAME} WRKSRC=${WRKSRC}/ \ ${CLISP} -q -ansi -norc \ -i ${LOCALBASE}/etc/asdf-init \ -x "(asdf:oos 'asdf:compile-op :${MODULE})" + @${FIND} ${WRKSRC} -name "*.lib" | ${XARGS} ${RM} .endif # USE_CLISP .endfor @@ -103,8 +108,19 @@ do-build: do-install: @${MKDIR} ${FASL_PATHNAME} - @${INSTALL_DATA} ${WRKSRC}/*.fasl ${FASL_PATHNAME} + @cd ${WRKSRC} && ${COPYTREE_SHARE} . ${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} + @cd ${WRKSRC} && ${FIND} * -type d \ + | ${SORT} -r \ + | ${AWK} '{ print "@dirrm ${CL_LIBDIR_REL}/${PORTNAME}/${FASL_DIR_REL}/" $$1 }' \ + >> ${TMPPLIST} + @${ECHO_CMD} "@dirrm ${CL_LIBDIR_REL}/${PORTNAME}/${FASL_DIR_REL}" >> ${TMPPLIST} + .endif # FASL_BUILD diff --git a/devel/cl-asdf/files/asdf-init.lisp b/devel/cl-asdf/files/asdf-init.lisp index 93408f0bb249..9913c1fc1800 100644 --- a/devel/cl-asdf/files/asdf-init.lisp +++ b/devel/cl-asdf/files/asdf-init.lisp @@ -155,7 +155,6 @@ should modify that in order to add other directories.") (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. @@ -209,41 +208,38 @@ LISP-SPECIFIC-FASL-SUBDIR as well." (pushnew *system-registry* asdf:*central-registry*) -;;;; Messing with asdf:output-files +;; The bundled ASDF in SBCL needs asdf-binary-locations +#+sbcl (asdf:operate 'asdf:load-op :asdf-binary-locations) + +(defun asdf:implementation-specific-directory-name () + "Return a name that can be used as a directory name that is unique to +a Lisp implementation, Lisp implementation version, operating system, +and hardware architecture. This implementation is designed for the +FreeBSD ports system and returns a simplified directory name (sbclfasl, +clispfasl, ...) by calling lisp-specific-fasl-subdir." + (lisp-specific-fasl-subdir)) + +(setf asdf:*source-to-target-mappings* + '(#+openmcl ("%%PREFIX%%/lib/ccl/" nil) + #+sbcl ("%%PREFIX%%/lib/sbcl/" nil))) + +(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)))) (if (and (getenv "FBSD_ASDF_COMPILE_PORT") - (getenv "WRKSRC")) - - ;; We are compiling a port - fasls should go to ${WRKSRC} - (defmethod asdf:output-files :around ((op asdf:compile-op) - (file asdf:cl-source-file)) - (let ((wrksrc (getenv "WRKSRC")) - (relative-name (asdf:component-relative-pathname file)) - (default-output-name (car (call-next-method)))) - (list - (make-pathname - :host (pathname-host wrksrc) - :device (pathname-device wrksrc) - :directory `(:absolute ,@(cdr (pathname-directory wrksrc)) - ,@(cdr (pathname-directory relative-name))) - :name (pathname-name default-output-name) - :type "fasl")))) - - ;; Normal operation: load from lisp-specific-fasl-subdir - (defmethod asdf:output-files :around ((op asdf:compile-op) - (file asdf:cl-source-file)) - (let ((default-output-file (car (call-next-method)))) - (let ((output-file-string (namestring default-output-file))) - (list - (if - (or - (search "%%PREFIX%%/lib/ccl" output-file-string) - (search "%%PREFIX%%/lib/sbcl" output-file-string)) - (make-pathname :defaults default-output-file) - (make-pathname - :directory `(:absolute ,@(cdr (pathname-directory default-output-file)) - ,(lisp-specific-fasl-subdir)) - :type "fasl" - :defaults default-output-file))))))) + (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 ((package (format nil "%%PREFIX%%/lib/common-lisp/~A/" portname))) + (pushnew (list package wrksrc) asdf:*source-to-target-mappings*)))) ;;;; asdf-init.lisp ends here |