Overriding port knobs in child ports
Anonymous
swell.k at gmail.com
Sun Aug 22 03:03:29 UTC 2010
CyberLeo Kitsana <cyberleo at cyberleo.net> writes:
[...]
> ----8<----
> MASTERDIR= ${.CURDIR}/../../www/squid
>
> .include "${MASTERDIR}/Makefile"
>
> PORTNAME= squid-perlless
> .undef USE_PERL5
> USE_PERL5_BUILD=yes
> ----8<----
>
> Installing this port creates a package named 'squid-perlless', but it
> still has perl5 registered as an rdep, regardless of where I put the
> .include.
My guess, you're erasing USE_PERL5 too late, master port already
inlcuded bsd.perl.mk via bsd.port.mk and set build/run deps.
While you can trick Mk/ files into thinking they're already loaded, e.g.
Perl_Pre_Include=
Perl_Post_Include=
BUILD_DEPENDS+=perl:${PORTSDIR}/lang/perl5.12
PKGNAMESUFFIX=-perlless
.include "${MASTERDIR}/Makefile"
there is another way - bsd.local.mk. You can put a few lines there and
it'll only be a matter of a few ifdefs in make.conf, e.g.
.if ${.CURDIR:M*/squid}
USE_LOCAL_MK=
STRIP_PERL5_RUN=
.endif
%%
Index: Mk/bsd.local.mk
===================================================================
RCS file: /a/.cvsup/ports/Mk/bsd.local.mk,v
retrieving revision 1.2
diff -u -p -r1.2 bsd.local.mk
--- Mk/bsd.local.mk 10 Dec 2006 18:15:33 -0000 1.2
+++ Mk/bsd.local.mk 22 Aug 2010 02:57:53 -0000
@@ -12,6 +12,23 @@
Local_Pre_Include= bsd.local.mk
+.if defined(STRIP_PERL5)
+ PKGNAMESUFFIX += -no-perl
+. undef USE_PERL5
+. undef USE_PERL5_BUILD
+. undef USE_PERL5_RUN
+.elif defined(STRIP_PERL5_BUILD)
+ PKGNAMESUFFIX += -no-perl-bdep
+ USE_PERL5_RUN := ${USE_PERL5}
+. undef USE_PERL5
+. undef USE_PERL5_BUILD
+.elif defined(STRIP_PERL5_RUN)
+ PKGNAMESUFFIX += -no-perl-rdep
+ USE_PERL5_BUILD := ${USE_PERL5}
+. undef USE_PERL5
+. undef USE_PERL5_RUN
+.endif
+
#
# Here is where any code that needs to run at bsd.port.pre.mk inclusion
# time should live.
%%
More information about the freebsd-ports
mailing list