[plt-scheme] PlaneT, plts and distributing software.

From: Eli Barzilay (eli at barzilay.org)
Date: Wed Oct 26 00:45:05 EDT 2005

On Oct 26, Pupeno wrote:
> On Tuesday 25 October 2005 22:04, Eli Barzilay wrote:
> > On Oct 25, Pupeno wrote:
> > > > Seriously, it is a bit farcical to not use the tools provided
> > > > (and hence my farcical response).  Planet and .plts works
> > > > across more platforms that PLT targets than Debian or Portage
> > > > does (and in particular on Windows).  You can't seriously
> > > > expect PLT to distribute their packages using, say, the Debian
> > > > system.
> > >
> > > Oh! I don't, I don't expect any software to be distributed in a
> > > platform specific way but I also don't expect software to be
> > > distributed in a way that can't be packaged for a platform.
> >
> > This is not too easy any way you look at it.  If you want to
> > distribute collections, you have to distinguish installing them in
> > the plt tree which makes them available for any user on the
> > system, or installing them in a specific user directory.
> In operating systems like Debian, Gentoo, FreeBSD, you pratically
> never install something for one user, you always install libraries
> in a generic location (/lib, /usr/lib, /usr/local/lib, etc) as well
> as binaries for everyone to use and that is what I would like to
> achieve by making a deb out of a plt.

I know, which is why I said that you should not try to do that with
planet packages.  They are distributed through planet and trying to
twist them to be installed in a different way would be a lots of
work.  Using .plt's would be better, but even then I don't see much
point in wrapping a plt package in some OS dependent package.  .plt
files are platform independent, and there are ways to make them
installed either in the plt directory (equivalent to installing a
package on the system) or in the user's directory.

> > For installation in the main plt tree, what you need (if you want
> > to use some other package system) is to package up the contents of
> > that collection.
> Yes, as long as no other task is needed to be done (MrPersist needs
> some C code to get compiled for example,

A package is installed with setup-plt, which will run hooks that you
specify in the collection's info.ss file.  Look for
"install-collection" in collects/setup/doc.txt.  In these hooks you
can do anything like compiling C files or whatever.

> and I've seen a plt wanting to *modify* another file, am I mistaken
> about that ?)

Usually, the operations are to either create new files, or replace
files.  Replacing files is intended for cases where you want to create
a .plt that will install a new version if it already exists on the
installing machine.

> > In the 
> > script section that is in charge of installing the package, you need
> > to invoke "setup-plt -l <new-collection>".
> So, I could something like:
>  setup-plt -l /tmp/temporarycollection

No, -l is used with a name of a collection that mzscheme knows about
-- in <plt>/collects, the user directory, in your PLTCOLLECTS etc.

> and then repackage those files to be put on the real collection ?

Distributing an already-setup collection (eg, including .zo files) is
tricky -- it's better to package up only source files.  When setup-plt
installs the package it will compile it (and run the hooks).

> Won't any path be hardcoded when I do that ?


> Do I have to set up /tmp/temporarycollection in any particular way ?

You put your code in a collection where it is available for use with
your installation, then package up just the sources.  There is some
code in the schematics repository that makes things a little more

> > To find the current 
> > PLTHOME, you can run this:
> >
> >   mzscheme -meev '(require (lib "plthome.ss" "setup"))' \
> >                  '(printf "~a~%" plthome)'
> Would this find the user's plthome or the general one ? I'd need the
> general one.

The installation home.

> > But note that installing a new version of plt will usually want to
> > create its directory from scratch.
> What do you mean ? Can you elaborate on what are the consequencies
> of those actions.

The installers will want to be installed in a clean place and will not
feel comfortable being installed on top of an existing directory.

          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!

Posted on the users mailing list.