[portage-overlay-devel] asdf versus ebuilds

Hans Halvorson hhalvors at Princeton.EDU
Tue Jan 30 16:34:40 UTC 2007


I immediately set to work on this after I received Xavier's message,
and I would be very glad to collaborate.

The goal -- if we follow the model of g-cpan -- is to use asdf-install
and the system definition to autogenerate an ebuild.  Here are some
basic operations:

1. Use asdf-install to get the system tarball.

(defvar *tmpdir* "var/tmp/g-asdf")

(ensure-directories-exist *tmpdir*)

(defun my-temp-file-name (package-name)
  (merge-pathnames (make-pathname :directory *tmpdir*) (make-pathname
  :name package-name :type "tgz")))

;; the following uses "metatilities" as an example

(asdf-install::download-files-for-package "metatilities"
					  (my-temp-file-name "metatilties")) 

2. Unpack the tarball.  (There is a nice function to do so in asdf-install.)

3. Load the asd files. (? Do not use asdf:load-op, because this
requires all dependencies to be installed.)

4. Look in the asd files to gather a list of system dependencies and
the system version number.  

;; the following is not quite right, because it does not list
;;   dependencies if they are already loaded.  We want to know what the
;;   dependencies are, even if they are already installed.

(defun dependencies (package-name)
  (cdr 
   (mapcar 'string (car (asdf::component-depends-on (make-instance 'asdf:compile-op) (asdf:find-component nil package-name))))
   )
  )

(defun version-number (package-name)
  (asdf::component-version (asdf:find-system package-name)))



Now the information from (4) can be used to auto-generate an ebuild
file.  In most cases (??), everything else in the ebuild will follow
the same pattern (e.g. for src_install, just do common-lisp-install
for all of the unpacked files, and then common-lisp-system-symlink the
asd files).

There are a couple of other features of g-cpan that would be nice to
implement.  For example, g-cpan looks in the portage tree to see if
the module already has an ebuild; it also reads "/etc/make.conf" and
"/etc/make.global" to get information about ACCEPT_KEYWORDS, portage
overlays and such.  To implement these things in Lisp would, I think,
be fairly easy for an experienced hand.

Best wishes,
Hans

At Tue, 30 Jan 2007 17:26:08 +0200,
Ivan Toshkov wrote:
> 
> On 1/28/07, Xavier Maillard <zedek at gnu.org> wrote:
> > Hans Halvorson <hhalvors at Princeton.EDU> wrote:
> >
> > > Isn't this the equivalent to using 'cpan install' directly to install
> > > Perl modules?  If so, wouldn't this be undesirable, because portage
> > > doesn't know about what is installed by asdf-install (and so we can
> > > have package conflicts, plus we can't use portage tools to see which
> > > packages are installed)?
> >
> > Agreed. I did have problems with this in the past.
> >
> > Xavier
> 
> So, is anybody working on this?
> _______________________________________________
> portage-overlay-devel mailing list
> portage-overlay-devel at common-lisp.net
> http://common-lisp.net/cgi-bin/mailman/listinfo/portage-overlay-devel



More information about the Portage-overlay-devel mailing list