Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 09 Jun 2012 11:06:17 -0700
From:      Doug Barton <dougb@FreeBSD.org>
To:        Matthew Seaman <m.seaman@infracaninophile.co.uk>
Cc:        Chris Rees <crees@freebsd.org>, freebsd-current <freebsd-current@freebsd.org>
Subject:   Re: PORTS_MODULES fix
Message-ID:  <4FD39099.3000208@FreeBSD.org>
In-Reply-To: <4FD38A71.8070601@infracaninophile.co.uk>
References:  <4FD384B5.3050709@FreeBSD.org> <CADLo839AsqtRiDZt3HJatBy=0Peu6W2Bu7XrsfiMes3RewTtPg@mail.gmail.com> <4FD38A71.8070601@infracaninophile.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------060901030601010102070101
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

On 06/09/2012 10:40, Matthew Seaman wrote:
> On 09/06/2012 18:26, Chris Rees wrote:
>> On 9 June 2012 18:15, Doug Barton <dougb@freebsd.org> wrote:
>>> I have recently tried the PORTS_MODULES knob, and found a
>>> problem. The ports tree searches for some dependencies by
>>> finding a binary in PATH, and that fails since by default
>>> /usr/local/ isn't there. The attached patch fixes that
>>> problem.
>>> 
>>> It would be more robust to use PREFIX there instead of
>>> /usr/local explicitly, but I'm not sure how to unravel the mk
>>> maze to get that value. If anyone has a suggestion for that,
>>> I'd be happy to include it.
>> 
>> As you mention, PREFIX is only defined in ports/Mk, and it'd 
>> definitely be undesirable to be including any of those files :)
>> 
>> The most robust (but unpleasant) solution would be one of the
>> following:
>> 
>> PREFIX?=/usr/local PORTSMODULESENV=SYSDIR=${SYSDIR}
>> PATH=${PATH}:${PREFIX}/bin:${PREFIX}/sbin
>> 
>> or the equivalent (and perhaps cleaner, not leaving PREFIX
>> defined)
>> 
>> .if !defined(PREFIX) PORTSMODULESENV=SYSDIR=${SYSDIR}
>> PATH=${PATH}:/usr/local/bin:/usr/local/sbin .else 
>> PORTSMODULESENV=SYSDIR=${SYSDIR}
>> PATH=${PATH}:${PREFIX}/bin:${PREFIX}/sbin .endif
>> 
>> Both of these will respect make.conf's setting of PREFIX.
>> 
> 
> Shouldn't you be looking for LOCALBASE rather than PREFIX in this
> context?

Both good points. New and improved attached.

Doug

- -- 

    This .signature sanitized for your protection
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (FreeBSD)

iEYEAREDAAYFAk/TkJkACgkQyIakK9Wy8Pv36QCeMyL31kOIIwYX/6rCoKFqhufW
unsAnjoUG31Cr5TB0GZ1YPv4+zGuz+XY
=mM5z
-----END PGP SIGNATURE-----

--------------060901030601010102070101
Content-Type: text/plain; charset=UTF-8;
 name="kern.post.mk.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="kern.post.mk.diff"

Index: kern.post.mk
===================================================================
--- kern.post.mk	(revision 236818)
+++ kern.post.mk	(working copy)
@@ -38,7 +38,9 @@
 
 # Handle out of tree ports 
 .if !defined(NO_MODULES) && defined(PORTS_MODULES)
-PORTSMODULESENV=SYSDIR=${SYSDIR}
+# The ports tree looks for dependencies in PATH, so we need to accommodate
+LOCALBASE?=	/usr/local
+PORTSMODULESENV=SYSDIR=${SYSDIR} PATH=${PATH}:${LOCALBASE}/bin:${LOCALBASE}/sbin
 .for __target in all install reinstall clean
 ${__target}: ports-${__target}
 ports-${__target}:

--------------060901030601010102070101--



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