From owner-freebsd-ports Wed Nov 20 06:24:26 1996 Return-Path: owner-ports Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id GAA06840 for ports-outgoing; Wed, 20 Nov 1996 06:24:26 -0800 (PST) Received: from po2.glue.umd.edu (po2.glue.umd.edu [129.2.128.45]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id GAA06834 for ; Wed, 20 Nov 1996 06:24:24 -0800 (PST) Received: from packet.eng.umd.edu (packet.eng.umd.edu [129.2.98.184]) by po2.glue.umd.edu (8.8.2/8.7.3) with ESMTP id JAA03308; Wed, 20 Nov 1996 09:24:15 -0500 (EST) Received: from localhost (chuckr@localhost) by packet.eng.umd.edu (8.8.3/8.7.3) with SMTP id JAA24291; Wed, 20 Nov 1996 09:24:15 -0500 (EST) X-Authentication-Warning: packet.eng.umd.edu: chuckr owned process doing -bs Date: Wed, 20 Nov 1996 09:24:14 -0500 (EST) From: Chuck Robey X-Sender: chuckr@packet.eng.umd.edu To: Martin Cracauer cc: freebsd-ports@freebsd.org Subject: Re: Questions about proper port making In-Reply-To: <199611200950.KAA02236@knight.cons.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-ports@freebsd.org X-Loop: FreeBSD.org Precedence: bulk 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 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! ----------------------------+-----------------------------------------------