[PATCH] use ASDF functions instead of `logical-pathname-translations'

Luca Capello <[email protected]> Sun, 30 Dec 2007 20:01:45 +0100
Newsgroups gmane.lisp.clg.devel
Message-ID <[email protected]>
--===============1857904646==
Content-Type: multipart/signed; boundary="=-=-=";
	micalg=pgp-sha1; protocol="application/pgp-signature"

--=-=-=
Content-Transfer-Encoding: quoted-printable

Hello,

I'm new to the list, please be nice with me ;-)

To remove the need to specify a `logical-pathname-translations', I
develop the attached patch which uses ASDF functions instead, since clg
already depends on ASDF.

While I was at it, I modified that clg/gdk/export.lisp to use
`export-from-files' similar to clg/gtk/export.lisp.

Comments are welcome!

Thanks, bye,
Gismo / Luca

=2D-8<---------------cut here---------------start------------->8---
diff -Naur clg.ORG/atk/export.lisp clg/atk/export.lisp
=2D-- clg.ORG/atk/export.lisp	2007-12-30 19:30:34.000000000 +0100
+++ clg/atk/export.lisp	2007-12-30 19:53:40.000000000 +0100
@@ -1,4 +1,4 @@
 (in-package "ATK")
=20
 ;;; Autogenerating exported symbols
=2D(export-from-file #p"clg:atk;atk.lisp")
+(export-from-file "atk.lisp" :atk)
diff -Naur clg.ORG/cairo/export.lisp clg/cairo/export.lisp
=2D-- clg.ORG/cairo/export.lisp	2007-12-30 19:30:34.000000000 +0100
+++ clg/cairo/export.lisp	2007-12-30 19:53:40.000000000 +0100
@@ -20,5 +20,4 @@
=20
=20
 ;;; Autogenerating exported symbols
=2D(export-from-file #p"clg:cairo;cairo.lisp")
=2D=20=20
\ No newline at end of file
+(export-from-file "cairo.lisp" :cairo)
diff -Naur clg.ORG/gdk/export.lisp clg/gdk/export.lisp
=2D-- clg.ORG/gdk/export.lisp	2007-12-30 19:30:34.000000000 +0100
+++ clg/gdk/export.lisp	2007-12-30 19:53:40.000000000 +0100
@@ -1,7 +1,12 @@
 (in-package "GDK")
=20
+(eval-when (:compile-toplevel :load-toplevel :execute)
+  (defvar *gdk-files*
+    (list
+     "gdkevents.lisp"
+     "gdktypes.lisp"
+     "gdk.lisp"
+     "pixbuf.lisp")))
+
 ;;; Autogenerating exported symbols
=2D(export-from-file #p"clg:gdk;gdkevents.lisp")
=2D(export-from-file #p"clg:gdk;gdktypes.lisp")
=2D(export-from-file #p"clg:gdk;gdk.lisp")
=2D(export-from-file #p"clg:gdk;pixbuf.lisp")
+(export-from-files #.*gdk-files* :gdk)
diff -Naur clg.ORG/gtk/export.lisp clg/gtk/export.lisp
=2D-- clg.ORG/gtk/export.lisp	2007-12-30 19:30:34.000000000 +0100
+++ clg/gtk/export.lisp	2007-12-30 19:53:40.000000000 +0100
@@ -3,16 +3,16 @@
 (eval-when (:compile-toplevel :load-toplevel :execute)
   (defvar *gtk-files*=20
     (list=20
=2D     #p"clg:gtk;gtktypes.lisp"
=2D     #p"clg:gtk;gtkwidget.lisp"
=2D     #p"clg:gtk;gtkcontainer.lisp"
=2D     #p"clg:gtk;gtk.lisp"
=2D     #p"clg:gtk;gtktree.lisp"
=2D     #p"clg:gtk;gtktext.lisp"
=2D     #p"clg:gtk;gtkaction.lisp"
=2D     #p"clg:gtk;gtkselection.lisp"
=2D     #p"clg:gtk;gtkutils.lisp"
=2D     #p"clg:gtk;gtkstyle.lisp"))
+     "gtktypes.lisp"
+     "gtkwidget.lisp"
+     "gtkcontainer.lisp"
+     "gtk.lisp"
+     "gtktree.lisp"
+     "gtktext.lisp"
+     "gtkaction.lisp"
+     "gtkselection.lisp"
+     "gtkutils.lisp"
+     "gtkstyle.lisp"))
=20
   (defexport define-style-color-accessor (name type)
     (declare (ignore type))
@@ -23,7 +23,7 @@
     name))
=20
 ;;; Autogenerating exported symbols
=2D(export-from-files #.*gtk-files*)
+(export-from-files #.*gtk-files* :gtk)
=20
=20
 ;;; Now re-export some of the symbols from the CLG package
@@ -35,4 +35,4 @@
    (declare (ignore superclasses options))
    (export-defclass-form class slotdefs nil))
=20
=2D (export-from-files #.*gtk-files* "CLG"))
+ (export-from-files #.*gtk-files* :gtk "CLG"))
diff -Naur clg.ORG/pango/export.lisp clg/pango/export.lisp
=2D-- clg.ORG/pango/export.lisp	2007-12-30 19:30:34.000000000 +0100
+++ clg/pango/export.lisp	2007-12-30 19:53:39.000000000 +0100
@@ -1,4 +1,4 @@
 (in-package "PANGO")
=20
 ;;; Autogenerating exported symbols
=2D(export-from-file #p"clg:pango;pango.lisp")
+(export-from-file "pango.lisp" :pango)
diff -Naur clg.ORG/README clg/README
=2D-- clg.ORG/README	2007-12-30 19:30:34.000000000 +0100
+++ clg/README	2007-12-30 19:53:40.000000000 +0100
@@ -38,14 +38,6 @@
=20
 2. Set up paths to match your system:
=20
=2D   - Add a logical-pathname-translation to the clg root directory in
=2D     ~/.cmucl-init.lisp, ~/.sbclrc or some other startup file, like
=2D     this:
=2D
=2D       (setf
=2D         (logical-pathname-translations "clg")
=2D         '(("**;*.*.*" "/home/espen/src/clg/**/")))
=2D
    - Set the correct pkg-config search path if your Gtk+ installation
      is in an unusual place, by adding it to the PKG_CONFIG_PATH
      environment variable before starting lisp.
@@ -53,7 +45,7 @@
    - Make sure ASDF finds the system definition files:
=20=20=20=20=20=20=20=20
        (push
=2D        (translate-logical-pathname "clg:systems;")
+        (translate-logical-pathname "/your/ASDF/systems/path")
          asdf:*central-registry*)
=20
=20
diff -Naur clg.ORG/rsvg/export.lisp clg/rsvg/export.lisp
=2D-- clg.ORG/rsvg/export.lisp	2007-12-30 19:30:34.000000000 +0100
+++ clg/rsvg/export.lisp	2007-12-30 19:53:40.000000000 +0100
@@ -1,4 +1,4 @@
 (in-package "RSVG")
=20
 ;;; Autogenerating exported symbols
=2D(export-from-file #p"clg:rsvg;rsvg.lisp")
+(export-from-file "rsvg.lisp" :rsvg)
diff -Naur clg.ORG/tools/autoexport.lisp clg/tools/autoexport.lisp
=2D-- clg.ORG/tools/autoexport.lisp	2007-12-30 19:30:34.000000000 +0100
+++ clg/tools/autoexport.lisp	2007-12-30 19:53:40.000000000 +0100
@@ -57,14 +57,19 @@
 			(read-file in))))))))
 	(read-file in)))))
=20=20=20
=2D(defmacro export-from-file (file &optional package)
=2D  (if package
=2D      `(export ',(list-autoexported-symbols-in-file file) ,package)
=2D    `(export ',(list-autoexported-symbols-in-file file))))
=20
=2D(defmacro export-from-files (files &optional package)
+(defmacro export-from-file (file system &optional package)
+  (let ((asdf-file-path (merge-pathnames
+			 file (asdf:component-pathname
+			       (asdf:find-system system)))))
+    (if package
+	`(export ',(list-autoexported-symbols-in-file asdf-file-path) ,package)
+      `(export ',(list-autoexported-symbols-in-file asdf-file-path)))))
+
+(defmacro export-from-files (files system &optional package)
   `(progn=20
=2D     ,@(loop for file in files collect `(export-from-file ,file ,package=
))))
+     ,@(loop for file in files collect
+	    `(export-from-file ,file ,system ,package))))
=20
 (defun copy-hash-table (hash-table)
   (let ((new-hash-table (make-hash-table=20
=2D-8<---------------cut here---------------end--------------->8---

--=-=-=
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHd+sbjThn2J3bmSsRAk+CAJwIPXA0d0+e7KrwXSwNIi/9hsCXhwCeKc1P
YnHf8gnyuvFOcvjc/DDb3zA=
=zzN1
-----END PGP SIGNATURE-----
--=-=-=--


--===============1857904646==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
--===============1857904646==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Clg-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/clg-devel

--===============1857904646==--