From owner-freebsd-ports Wed Nov 20 06:42:47 1996 Return-Path: owner-ports Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id GAA08101 for ports-outgoing; Wed, 20 Nov 1996 06:42:47 -0800 (PST) Received: from knight.cons.org (knight.cons.org [194.233.237.86]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id GAA08092 for ; Wed, 20 Nov 1996 06:42:41 -0800 (PST) Received: (from cracauer@localhost) by knight.cons.org (8.7.5/8.7.3) id PAA02492; Wed, 20 Nov 1996 15:44:22 +0100 (MET) Date: Wed, 20 Nov 1996 15:44:22 +0100 (MET) Message-Id: <199611201444.PAA02492@knight.cons.org> From: Martin Cracauer To: freebsd-ports@freebsd.org Subject: Re: Questions about proper port making In-Reply-To: References: <199611200950.KAA02236@knight.cons.org> Sender: owner-ports@freebsd.org X-Loop: FreeBSD.org Precedence: bulk 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 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