Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Nov 1996 09:24:14 -0500 (EST)
From:      Chuck Robey <chuckr@glue.umd.edu>
To:        Martin Cracauer <cracauer@cons.org>
Cc:        freebsd-ports@freebsd.org
Subject:   Re: Questions about proper port making
Message-ID:  <Pine.OSF.3.95.961120090838.24730A-100000@packet.eng.umd.edu>
In-Reply-To: <199611200950.KAA02236@knight.cons.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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.

> 
> 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.

> 
> How do I handle this: 
> - As a port that always installs to the default basedir?

The user is responsible for setting PREFIX if the default value is not
acceptable.

> - 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.
 
> - Or install the executable in a hidden place and generate a shell
>   script that calls the real things in a wrapper?

STILL respect PREFIX.  You can do both.

> - if the latter, should I always use a wrapper or only when basedir is
>   non-default?
> 
> Questions over questions...
> 
> 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
> 

----------------------------+-----------------------------------------------
Chuck Robey                 | Interests include any kind of voice or data 
chuckr@eng.umd.edu          | communications topic, C programming, and Unix.
9120 Edmonston Ct #302      |
Greenbelt, MD 20770         | I run Journey2 and picnic, both FreeBSD
(301) 220-2114              | version 3.0 current -- and great FUN!
----------------------------+-----------------------------------------------




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.OSF.3.95.961120090838.24730A-100000>