aboutsummaryrefslogtreecommitdiff
path: root/devel/cl-asdf
diff options
context:
space:
mode:
authorJimmy Olgeni <olgeni@FreeBSD.org>2010-01-20 12:40:13 +0000
committerJimmy Olgeni <olgeni@FreeBSD.org>2010-01-20 12:40:13 +0000
commit9d2ef0bb9e6d20a29f9f5c876df5940030f8fc9b (patch)
tree4783b07e65d08851153d1c5e959bd6ae077b1ff2 /devel/cl-asdf
parentb667cdbd375c6509a88a99061cd9cc5296057119 (diff)
downloadports-9d2ef0bb9e6d20a29f9f5c876df5940030f8fc9b.tar.gz
ports-9d2ef0bb9e6d20a29f9f5c876df5940030f8fc9b.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).
Notes
Notes: svn path=/head/; revision=248207
Diffstat (limited to 'devel/cl-asdf')
-rw-r--r--devel/cl-asdf/Makefile2
-rw-r--r--devel/cl-asdf/bsd.cl-asdf.mk28
-rw-r--r--devel/cl-asdf/files/asdf-init.lisp66
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