From owner-freebsd-perl@FreeBSD.ORG Tue Feb 26 14:04:58 2008 Return-Path: Delivered-To: perl@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D2DD106566B; Tue, 26 Feb 2008 14:04:58 +0000 (UTC) (envelope-from tobez@tobez.org) Received: from heechee.tobez.org (heechee.tobez.org [194.255.56.42]) by mx1.freebsd.org (Postfix) with ESMTP id C10AA13C4D5; Tue, 26 Feb 2008 14:04:57 +0000 (UTC) (envelope-from tobez@tobez.org) Received: by heechee.tobez.org (Postfix, from userid 1001) id 17CBA6D402; Tue, 26 Feb 2008 15:04:56 +0100 (CET) Date: Tue, 26 Feb 2008 15:04:56 +0100 From: Anton Berezin To: ports@freebsd.org, perl@freebsd.org Message-ID: <20080226140456.GB30778@heechee.tobez.org> Mail-Followup-To: Anton Berezin , ports@freebsd.org, perl@freebsd.org, lth@freebsd.org, Dag-Erling Smorgrav , Yen-Ming Lee References: <86zltpzrxt.fsf@ds4.des.no> <759236930802242324o614598d1i1a8ca3cc8c12478c@mail.gmail.com> <86prulibf4.fsf@ds4.des.no> <759236930802250245j646f5be5k8382bedbfb2a7c1e@mail.gmail.com> <868x19i6ky.fsf@ds4.des.no> <759236930802251702h694c4f5bn2c7c87c7c47c7cc@mail.gmail.com> <20080226122512.GA30778@heechee.tobez.org> <86ve4bsx8l.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <86ve4bsx8l.fsf@ds4.des.no> X-Powered-By: FreeBSD http://www.freebsd.org/ User-Agent: Mutt/1.5.17 (2007-11-01) Cc: Dag-Erling Smorgrav , Yen-Ming Lee , lth@freebsd.org Subject: Re: Port dependencies on p5-Test-* X-BeenThere: freebsd-perl@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: maintainer of a number of perl-related ports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2008 14:04:58 -0000 On Tue, Feb 26, 2008 at 01:44:42PM +0100, Dag-Erling Smorgrav wrote: > Anton Berezin writes: > > A side-line comment here. One has to remember that modules which are in > > perl core consitute moving targets: > > > > 1. Such a module (not only Test::More) might be in the core 5.8 but not 5.6 > > (or, in the near future, in core 5.10, but not in 5.8 and 5.6). > > Easily solved by adding handling for Perl module dependencies to > bsd.perl.mk. Heh. Mathematicians use phrases like "it is obvious that", "it is easy to see that", "it is clear that", and "is trivial" to indicate that some steps have been omitted. The use of such language may be classified under three headings -- honest, dishonest, and pedagogical. Which of those three usages did you have in mind? ;-) Anyway. Having discussed this at a whiteboard with lth@ (ah, the advantages of face-to-face communication!), we came up with the following idea for bsd.perl.mk's implementation. Introduce a couple of new, Perl-specific *DEPENDS knobs, at the infrastructure level (bsd.perl.mk), and gradually migrate existing p5 ports towards using it. The knobs are as follows: PERL_DEPENDS. This will be the one which will be used most of the time, since (p5-Test-* ports notwithstanding) it is actually difficult to come up with cases when we want BUILD_DEPENDS without accompanying RUN_DEPENDS. The syntax would be like this: PERL_DEPENDS= \ p5-CGI.pm>3:www/p5-CGI.pm \ devel/p5-Time-HiRes>=1.86 \ textproc/p5-Regexp-Common You can see three syntax variations here. The first one is pretty much identical to what we have in BUILD_DEPENDS now, except it looses the ${PORTSDIR} crap. The second one, which will be good for the vast majority of cases, looses the package name, which is derived from the port name (by the way, the p5-CGI.pm case can also be written like this; we cannot, from the top of our collective head, come up with a p5 port for which the package name base differs from the port directory name). The last one drops the version requirement and is a simple contraction for textproc/p5-Regexp-Common>0. This will get translated (by bsd.perl.mk) into a corresponding BUILD_DEPENDS and RUN_DEPENDS syntax. Additionally, bsd.perl.mk maintains a little database for dual-life modules, recording which version is present in which core. So, when parsing the above PERL_DEPENDS line, bsd.perl.mk will be able to notice that Time::HiRes is at version 1.86 in perl 5.8.8 and thus the stand-alone p5-Time-HiRes is not needed, provided perl 5.8.8 is installed. When PERL_DEPENDS is not enough, we add PERL_BUILD_DEPENDS and PERL_RUN_DEPENDS to the mix with the identical syntax. Furthermore, to solve the p5-Test* problem without being harsh to maintainers (installing test modules by hand does not work very well in automated jailed test environments), we also introduce PERL_TEST_DEPENDS, the content of which is added to BUILD_DEPENDS if a certain make variable is set (say, P5PORTER). What do people think of this? If we see positive reaction, we'll just temporarily switch from coding in Perl to coding in make. :-) Cheers, \Anton & Lars -- We're going for 'working' here. 'clean' is for people with skills... -- Flemming Jacobsen