Hi all,

Is there a proper way to install data files from egg .setup-files?
I couldn't find anything at http://wiki.call-cc.org/manual/Extensions
so I rolled my own for the "slatex" egg:

(define style-path
  (list (installation-prefix) "share" "chicken" "slatex"))

;; <snipped: code to build style-path into to the program>

(copy-file "slatex.sty" (make-pathname style-path "slatex.sty"))
(copy-file "slatex-chicken.sty" (make-pathname style-path "slatex-chicken.sty"))
(copy-file "cltl.sty" (make-pathname style-path "cltl.sty"))

The disadvantages are obvious: these files don't get uninstalled by
chicken-uninstall and Chicken's data files aren't necessarily installed
under $PREFIX/share/chicken  (the user can override $DATADIR on the Make
invocation when building Chicken).

So, I think it would be a good idea to add something like this to

(define style-path (data-path-for-extension 'slatex))

(install-data 'slatex
              '("slatex.sty" "slatex-chicken.sty" "cltl.sty")
              `((version ,slatex-version))) ;; If this makes sense?

The data-path-for-extension would return a unique directory for
this extension in which it is free to dump its files.  I think this would
make it easier to keep track of where everything is, especially if some
extensions install a lot of files.

Alternatively, we could have a "data-path" procedure which works just
like the "program-path" procedure, ie it could accept no args and return
the $DATADIR path.  Then it would be up to eggs whether they want to
create a subdirectory for their files or not.

"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
                                                        -- Donald Knuth

Chicken-users mailing list

Reply via email to