Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Aug 2010 06:58:27 +0400
From:      Anonymous <swell.k@gmail.com>
To:        CyberLeo Kitsana <cyberleo@cyberleo.net>
Cc:        FreeBSD Ports <freebsd-ports@freebsd.org>
Subject:   Re: Overriding port knobs in child ports
Message-ID:  <86occv2w18.fsf@gmail.com>
In-Reply-To: <4C706D78.70200@cyberleo.net> (CyberLeo Kitsana's message of "Sat, 21 Aug 2010 19:21:12 -0500")
References:  <4C706D78.70200@cyberleo.net>

next in thread | previous in thread | raw e-mail | index | archive | help
CyberLeo Kitsana <cyberleo@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.
%%



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86occv2w18.fsf>