aboutsummaryrefslogtreecommitdiff
path: root/devel/cl-asdf
diff options
context:
space:
mode:
authorWill Andrews <will@FreeBSD.org>2003-06-03 02:54:31 +0000
committerWill Andrews <will@FreeBSD.org>2003-06-03 02:54:31 +0000
commitc8b230d195a992158323e1a2f85a6ed24c29ac13 (patch)
tree14e2a514460719c10c08220b969ab3c72e495953 /devel/cl-asdf
parente5f188ab5d23c6f45382ece9c9117aa9a8f592e6 (diff)
downloadports-c8b230d195a992158323e1a2f85a6ed24c29ac13.tar.gz
ports-c8b230d195a992158323e1a2f85a6ed24c29ac13.zip
Add cl-asdf 2003.05.16, a system definition facility for Common Lisp.
PR: 52358 Submitted by: Henrik Motakef <henrik.motakef@web.de>
Notes
Notes: svn path=/head/; revision=82103
Diffstat (limited to 'devel/cl-asdf')
-rw-r--r--devel/cl-asdf/Makefile45
-rw-r--r--devel/cl-asdf/distinfo1
-rw-r--r--devel/cl-asdf/files/README.FreeBSD11
-rw-r--r--devel/cl-asdf/files/asdf-init.lisp236
-rw-r--r--devel/cl-asdf/files/patch-asdf.lisp12
-rw-r--r--devel/cl-asdf/pkg-descr9
-rw-r--r--devel/cl-asdf/pkg-message12
-rw-r--r--devel/cl-asdf/pkg-plist30
8 files changed, 356 insertions, 0 deletions
diff --git a/devel/cl-asdf/Makefile b/devel/cl-asdf/Makefile
new file mode 100644
index 000000000000..bb2eb7abe97d
--- /dev/null
+++ b/devel/cl-asdf/Makefile
@@ -0,0 +1,45 @@
+# New ports collection Makefile for: cl-asdf
+# Date created: 10 May 2003
+# Whom: Henrik Motakef <henrik.motakef@web.de>
+#
+# $FreeBSD$
+
+PORTNAME= asdf
+PORTVERSION= 2003.05.16
+CATEGORIES= devel
+MASTER_SITES= http://www.henrik-motakef.de/freebsd-distfiles/asdf/
+PKGNAMEPREFIX= cl-
+
+MAINTAINER= henrik.motakef@web.de
+COMMENT= A system definition facility for Common Lisp
+
+WRKSRC= ${WRKDIR}/${PORTNAME}
+NO_BUILD= yes # Sources only, see cl-asdf-[cmucl|sbcl|clisp]
+CL_LIBDIR= ${PREFIX}/lib/common-lisp
+ASDF_SYSTEM_REGISTRY= ${CL_LIBDIR}/system-registry
+
+do-install:
+ ${MKDIR} ${CL_LIBDIR}/asdf
+ ${MKDIR} ${ASDF_SYSTEM_REGISTRY}
+ ${INSTALL_DATA} ${WRKSRC}/asdf.lisp ${CL_LIBDIR}/asdf/
+ ${INSTALL_DATA} ${WRKSRC}/wild-modules.lisp ${CL_LIBDIR}/asdf/
+ ${SED} -e 's|%%ASDF_PATHNAME%%|${CL_LIBDIR}/asdf/asdf|' \
+ -e 's|%%ASDF_SYSTEM_REGISTRY%%|${ASDF_SYSTEM_REGISTRY}|' \
+ ${FILESDIR}/asdf-init.lisp > \
+ ${PREFIX}/etc/asdf-init.lisp.default
+ [ -f ${PREFIX}/etc/asdf-init.lisp ] || \
+ ${CP} ${PREFIX}/etc/asdf-init.lisp.default \
+ ${PREFIX}/etc/asdf-init.lisp
+.if !defined(NOPORTDOCS)
+ ${MKDIR} ${PREFIX}/share/doc/cl-asdf/
+ ${MKDIR} ${PREFIX}/share/examples/cl-asdf/
+ ${INSTALL_DATA} ${WRKSRC}/README ${PREFIX}/share/doc/cl-asdf/
+ ${INSTALL_DATA} ${WRKSRC}/LICENSE ${PREFIX}/share/doc/cl-asdf/
+ ${INSTALL_DATA} ${FILESDIR}/README.FreeBSD ${PREFIX}/share/doc/cl-asdf/
+ ${INSTALL_DATA} ${WRKSRC}/test/* ${PREFIX}/share/examples/cl-asdf/
+.endif
+
+post-install:
+ @${CAT} ${MASTERDIR}/pkg-message
+
+.include <bsd.port.mk>
diff --git a/devel/cl-asdf/distinfo b/devel/cl-asdf/distinfo
new file mode 100644
index 000000000000..827fe287f80e
--- /dev/null
+++ b/devel/cl-asdf/distinfo
@@ -0,0 +1 @@
+MD5 (asdf-2003.05.16.tar.gz) = fa9b84d932ba1632df37b86e38a72e2d
diff --git a/devel/cl-asdf/files/README.FreeBSD b/devel/cl-asdf/files/README.FreeBSD
new file mode 100644
index 000000000000..597845c8a18e
--- /dev/null
+++ b/devel/cl-asdf/files/README.FreeBSD
@@ -0,0 +1,11 @@
+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.
+
diff --git a/devel/cl-asdf/files/asdf-init.lisp b/devel/cl-asdf/files/asdf-init.lisp
new file mode 100644
index 000000000000..50345182f698
--- /dev/null
+++ b/devel/cl-asdf/files/asdf-init.lisp
@@ -0,0 +1,236 @@
+;;;; 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, scince 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 neccessary actions. The easiest way is to load
+;; it in your Lisp everytime it starts, by putting
+;;
+;; (load "/usr/local/etc/freebsd-lisp-init")
+;;
+;; in your init file.
+;;
+;; Each Lisp implementation has it's 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
+;;
+;; 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
+;; it's own directory in /usr/local/lib/common-lisp, initially
+;; containing its sources. Each fasl port will create an
+;; implementation-specific subdirectory where all it's 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. Scince 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 then 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 envorinment in which it calls Lisp in do-build, see existing
+;; ports for examples.
+
+;; Note that it is only neccessary 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 neccessary 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)
+
+;;;; Pathes
+
+(defvar *asdf-pathname*
+ "/usr/local/lib/common-lisp/asdf/asdf"
+ "Path of the ASDF library")
+
+(defvar *system-registry*
+ "/usr/local/lib/common-lisp/system-registry"
+ "FreeBSDs contribution to the entral 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 sting 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"
+ #-(or clisp cmu sbcl) (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.
+
+Scince 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)
+ #-(or sbcl cmu clisp) (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))
+
+(pushnew *system-registry* asdf:*central-registry*)
+
+;;;; Messing with asdf:output-files
+
+(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))))
+ (list
+ (make-pathname
+ :directory `(:absolute ,@(cdr (pathname-directory default-output-file))
+ ,(lisp-specific-fasl-subdir))
+ :type "fasl"
+ :defaults default-output-file))))
+)
+
+
+;;; freebsd-lisp-init.lisp ends here
diff --git a/devel/cl-asdf/files/patch-asdf.lisp b/devel/cl-asdf/files/patch-asdf.lisp
new file mode 100644
index 000000000000..87ef4c51cbbb
--- /dev/null
+++ b/devel/cl-asdf/files/patch-asdf.lisp
@@ -0,0 +1,12 @@
+--- asdf.lisp.orig Thu Mar 20 13:58:09 2003
++++ asdf.lisp Thu Mar 20 13:58:49 2003
+@@ -322,8 +322,7 @@
+
+ (defvar *central-registry*
+ '(*default-pathname-defaults*
+- #+nil "/home/dan/src/sourceforge/cclan/asdf/systems/"
+- #+nil "telent:asdf;systems;"))
++ "/usr/local/lib/common-lisp/system-registry/"))
+
+ (defun sysdef-central-registry-search (system)
+ (let ((name (coerce-name system)))
diff --git a/devel/cl-asdf/pkg-descr b/devel/cl-asdf/pkg-descr
new file mode 100644
index 000000000000..c001675fbe2f
--- /dev/null
+++ b/devel/cl-asdf/pkg-descr
@@ -0,0 +1,9 @@
+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.
+
+WWW: http://www.cliki.net/asdf
+
+- Henrik Motakef
diff --git a/devel/cl-asdf/pkg-message b/devel/cl-asdf/pkg-message
new file mode 100644
index 000000000000..5d306053baf5
--- /dev/null
+++ b/devel/cl-asdf/pkg-message
@@ -0,0 +1,12 @@
+==========================================================================
+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.
+==========================================================================
diff --git a/devel/cl-asdf/pkg-plist b/devel/cl-asdf/pkg-plist
new file mode 100644
index 000000000000..7e02263e140c
--- /dev/null
+++ b/devel/cl-asdf/pkg-plist
@@ -0,0 +1,30 @@
+lib/common-lisp/asdf/asdf.lisp
+lib/common-lisp/asdf/wild-modules.lisp
+etc/asdf-init.lisp.default
+@dirrm lib/common-lisp/asdf
+@dirrm lib/common-lisp/system-registry
+%%PORTDOCS%%share/doc/cl-asdf/README
+%%PORTDOCS%%share/doc/cl-asdf/README.FreeBSD
+%%PORTDOCS%%share/doc/cl-asdf/LICENSE
+%%PORTDOCS%%share/examples/cl-asdf/file1.lisp
+%%PORTDOCS%%share/examples/cl-asdf/file2.lisp
+%%PORTDOCS%%share/examples/cl-asdf/file3.lisp
+%%PORTDOCS%%share/examples/cl-asdf/file4.lisp
+%%PORTDOCS%%share/examples/cl-asdf/run-tests.sh
+%%PORTDOCS%%share/examples/cl-asdf/test1.asd
+%%PORTDOCS%%share/examples/cl-asdf/test1.script
+%%PORTDOCS%%share/examples/cl-asdf/test2.asd
+%%PORTDOCS%%share/examples/cl-asdf/test2.script
+%%PORTDOCS%%share/examples/cl-asdf/test2a.asd
+%%PORTDOCS%%share/examples/cl-asdf/test2b1.asd
+%%PORTDOCS%%share/examples/cl-asdf/test2b2.asd
+%%PORTDOCS%%share/examples/cl-asdf/test2b3.asd
+%%PORTDOCS%%share/examples/cl-asdf/test3.asd
+%%PORTDOCS%%share/examples/cl-asdf/test3.script
+%%PORTDOCS%%share/examples/cl-asdf/test4.script
+%%PORTDOCS%%share/examples/cl-asdf/wild-module.asd
+%%PORTDOCS%%share/examples/cl-asdf/wild-module.script
+%%PORTDOCS%%@dirrm share/examples/cl-asdf
+%%PORTDOCS%%@dirrm share/doc/cl-asdf
+@exec [ -f %D/etc/asdf-init.lisp ] || cp %D/etc/asdf-init.lisp.default %D/etc/asdf-init.lisp
+@exec mkdir -p %D/lib/common-lisp/system-registry