aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Mingrone <jrm@FreeBSD.org>2024-12-28 15:14:03 +0000
committerJoseph Mingrone <jrm@FreeBSD.org>2024-12-28 16:30:56 +0000
commitf6a75a8f9bf20dbf1e9a4d5bc171d58f595c1ec1 (patch)
tree392dafd5227c0ff3d9aefd4124acb43a253433aa
parentb5599c6c8df0fb10e8e03cf6cb4087e66845873a (diff)
devel/cl-freebsd-asdf-init: Fix output translations for CL builds
ASDF uses output translations to locate compiled Common Lisp files (fasl). Before this fix, these translations were not correctly configured during port builds, causing failures for ports with Common Lisp dependencies, such as converters/cl-babel-*. Because ASDF could not locate the pre-built fasl, it attempted to write new fasl under $HOME/.cache/ during the build. Sponsored by: The FreeBSD Foundation
-rw-r--r--devel/cl-freebsd-asdf-init/Makefile2
-rw-r--r--devel/cl-freebsd-asdf-init/files/cl-freebsd-asdf-init.lisp.in67
2 files changed, 33 insertions, 36 deletions
diff --git a/devel/cl-freebsd-asdf-init/Makefile b/devel/cl-freebsd-asdf-init/Makefile
index 157df9f225b3..bc6d38cd7fab 100644
--- a/devel/cl-freebsd-asdf-init/Makefile
+++ b/devel/cl-freebsd-asdf-init/Makefile
@@ -1,5 +1,5 @@
PORTNAME= cl-freebsd-asdf-init
-PORTVERSION= 20241212
+PORTVERSION= 20241228
CATEGORIES= devel
MASTER_SITES= # none
DISTFILES= # none
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
index faf0003d49ac..73310483809e 100644
--- 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
@@ -136,10 +136,34 @@ modify that in order to add other directories.")
;; Set up output translations
-;; If we are building a port, redirect fasl files to WRKSRC.
-(if (and (uiop:getenv "FBSD_ASDF_COMPILE_PORT")
- (uiop:getenv "PORTNAME")
- (uiop:getenv "WRKSRC"))
+(let* ((freebsd-translations '(:ignore-inherited-configuration)))
+ ;; Create translations to point source to fasl.
+ (dolist (path (directory "%%PREFIX%%/lib/common-lisp/*/"))
+ (let* ((base-dir (pathname-directory path))
+ (source (make-pathname
+ :directory (append base-dir (list :wild-inferiors))
+ :name :wild
+ :type :wild))
+ (ctarget (make-pathname
+ :directory (append
+ base-dir
+ (list (lisp-specific-fasl-subdir)))))
+ (target (make-pathname
+ :directory (append base-dir
+ (list (lisp-specific-fasl-subdir)
+ :wild-inferiors))
+ :name :wild
+ :type :wild)))
+ ;; Only create translation when source is not system registry and
+ ;; ctarget exists.
+ (when (and
+ (not (string= *system-registry* (namestring path)))
+ (uiop:directory-exists-p ctarget))
+ (pushnew (list source target) freebsd-translations))))
+ ;; When building a port, redirect fasl files to WRKSRC.
+ (when (and (uiop:getenv "FBSD_ASDF_COMPILE_PORT")
+ (uiop:getenv "PORTNAME")
+ (uiop:getenv "WRKSRC"))
(let* ((wrksrc (uiop:getenv "WRKSRC"))
(portname (uiop:getenv "PORTNAME"))
(source (make-pathname
@@ -149,36 +173,9 @@ modify that in order to add other directories.")
(list portname :wild-inferiors))))
(target (make-pathname
:directory (append (pathname-directory wrksrc)
- (list :wild-inferiors))))
- (ports-translations '(:ignore-inherited-configuration)))
- (pushnew (list source target) ports-translations)
- (asdf:initialize-output-translations
- (cons :output-translations ports-translations)))
- ;; On target systems, set up translations to point to installed fasl.
- (let ((freebsd-translations '(:ignore-inherited-configuration)))
- (dolist (path (directory "%%PREFIX%%/lib/common-lisp/*/"))
- (let* ((base-dir (pathname-directory path))
- (source (make-pathname
- :directory (append base-dir (list :wild-inferiors))
- :name :wild
- :type :wild))
- (ctarget (make-pathname
- :directory (append
- base-dir
- (list (lisp-specific-fasl-subdir)))))
- (target (make-pathname
- :directory (append base-dir
- (list (lisp-specific-fasl-subdir)
- :wild-inferiors))
- :name :wild
- :type :wild)))
- ;; Only create translation when source is not system registry and
- ;; ctarget exists.
- (when (and
- (not (string= *system-registry* (namestring path)))
- (uiop:directory-exists-p ctarget))
- (pushnew (list source target) freebsd-translations))))
- (asdf:initialize-output-translations
- (cons :output-translations freebsd-translations))))
+ (list :wild-inferiors)))))
+ (pushnew (list source target) freebsd-translations)))
+ (asdf:initialize-output-translations
+ (cons :output-translations freebsd-translations)))
;;;; asdf-init.lisp ends here