Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Nov 1996 15:44:22 +0100 (MET)
From:      Martin Cracauer <cracauer@cons.org>
To:        freebsd-ports@freebsd.org
Subject:   Re: Questions about proper port making
Message-ID:  <199611201444.PAA02492@knight.cons.org>
In-Reply-To: <Pine.OSF.3.95.961120090838.24730A-100000@packet.eng.umd.edu>
References:  <199611200950.KAA02236@knight.cons.org> <Pine.OSF.3.95.961120090838.24730A-100000@packet.eng.umd.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
Chuck Robey writes:
> On Wed, 20 Nov 1996, Martin Cracauer wrote:
> 
> > 
> > Suppose I have a library for Common Lisp. Installation require that
> > one of many Common Lisp implemenations is installed.
> > 
> > What is the right thing to do this? The cleanest solution would be to
> > have one port for each target implementation, but could be many when
> > it comes to scheme (10 libararies for 20 implementations would make
> > 200 ports :-)
> > 
> > Should I search the path for installed implemenations and choose the
> > best? Or ask the user (but I'd rather would keep thinsg
> > non-interactive)?
> > 
> > I think the right way would be to search for implemenations and if
> > there is more than one, then ask the user. But how do I implement this
> > in a FreeBSD port? As far as I know, a port's installation can be
> > either interactive or not, not "depends".
> 
> First, verify that at least ONE common lisp port does in fact work as a
> dependency.  After that, you can use the method that the encryption based
> ports used, by requiring that the user set some variable (choose one
> that's likely to be unique, like CHOSEN_LISP) to one of a chosen set of
> acceptable alternatives.  If it is not so set, you can print an
> informative error message.  If it is set, you can assume the port is
> installed.  If needed, you can assume the port has been installed using
> the same PREFIX variable that is active in your library port, so you can
> have access to the port's installed location.

I fear the added complexity that an environment variable has to be set
may cause users to give up. Am I allowed to look whether there's
exactly one usable Lisp installed and obey the environment variable
only when there's more than one?

> > Second question, I have an implementation to port that has a hardcoded
> > basedir in it (recompiling is far too heavy for normal users). It
> > can be changed by an environment variable at run time, but there's no
> > way to do this with a config file or such.
> 
> Any file in the port may be changed by patching, and there is a
> comprehensive structure in ports allowing you to do this in an automated
> manner.

No, in this case I have to get a binary package and I would have to
write a little program to patch the binary at hardcoded positions. As
I think over it, why not...

[...]
> > - Obey basedir and just emit a warning to the user when he installs
> >   anywhere else?
> 
> Patch the file in the port, so that it respects PREFIX.

I don't install from sources.

OK, so I see two options:

1) make a hack to patch the prefix dir string in the binary
2a) use a wrapper shell script if prefix is nondefault
2b) use a wrapper shell script anytime.

Will choose 2a) unless people protest.

Martin
-- 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Martin Cracauer <cracauer@cons.org> http://www.cons.org/cracauer
  cracauer@wavehh.hanse.de (batched, preferred for large mails)
  Tel.: (daytime) +4940 41478712 (sometimes hacker's daytime :-)
  Tel.: (private) +4940 5221829 Fax.: (private) +4940 5228536
  Paper: (private) Waldstrasse 200, 22846 Norderstedt, Germany



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199611201444.PAA02492>