Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Jan 2005 17:06:53 +1100
From:      Sam Lawrance <boris@brooknet.com.au>
To:        dave <dmehler26@woh.rr.com>
Cc:        freebsd-ports@freebsd.org
Subject:   Re: lib_depends port patch and pkg-plist
Message-ID:  <41E60FFD.8020208@brooknet.com.au>
In-Reply-To: <010b01c4f92f$64c863d0$0400a8c0@satellite>
References:  <010b01c4f92f$64c863d0$0400a8c0@satellite>

next in thread | previous in thread | raw e-mail | index | archive | help
dave wrote:

>Hello,
>    I'm trying to alter a port, i want to change it so that instead of
>pulling in all the lib depends, they are not all necessary for the port they
>just give extra functionality, i use "if defined" blocks. My goal is if
>someone wants a feature "make WITH_FEATURE=yes" will do it, but if not they
>won't get all the extra dependencies needed. I've got the if defines going,
>and that seems to be working, but my problem is with the pkg-plist file, how
>do i handle this in view of the dependencies?
>Thanks.
>Dave.
>  
>

dave wrote:

>Hello,
>    I'm trying to alter a port, i want to change it so that instead of
>pulling in all the lib depends, they are not all necessary for the port they
>just give extra functionality, i use "if defined" blocks. My goal is if
>someone wants a feature "make WITH_FEATURE=yes" will do it, but if not they
>won't get all the extra dependencies needed. I've got the if defines going,
>and that seems to be working, but my problem is with the pkg-plist file, how
>do i handle this in view of the dependencies?
>  
>

The way this was explained to me was to put all the files in the 
pkg-plist, then use PLIST_SUB to comment them out if they aren't used.

Example: if WITH_FOOBAR is not defined, %%FOOBAR%% in the pkg-plist is 
replaced with "@comment ", making that line a no-op.

In the port Makefile:

.if defined(${WITH_FOOBAR})
PLIST_SUB+=   FOOBAR=""
.else
PLIST_SUB+=   FOOBAR="@comment "
.endif

In pkg-plist:

%%FOOBAR%%some/file/for/foobar/option


-- 
Sam Lawrance    ph +61 0425 228 579    freenode: deft



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?41E60FFD.8020208>