Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Mar 1999 16:22:21 +0000
From:      Tom Hukins <tom@eborcom.com>
To:        freebsd-ports@FreeBSD.org
Subject:   Re: Problems with p5-* ports
Message-ID:  <19990322162220.A6658@eborcom.com>
In-Reply-To: <19990314175904.A11110@eborcom.com>; from Tom Hukins on Sun, Mar 14, 1999 at 05:59:04PM %2B0000
References:  <19990314175904.A11110@eborcom.com>

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

--yrj/dFKFPuw6o+aM
Content-Type: text/plain; charset=us-ascii

On Sun, Mar 14, 1999 at 05:59:04PM +0000, I wrote:
> 
> Here is my proposal: We add a PERL5_DEPENDS variable. Sure, this
> makes bsd.port.mk even bigger, but I count 95 p5-* ports in
> /usr/ports/INDEX and 137 ports involve p5-* ports in some way,
> possibly as dependencies. PERL5_DEPENDS would run "perl -M$module"
> for each item in PERL5_DEPENDS, where $module is the module's name,
> eg. Net::FTP, LWP::UserAgent, or whatever.
> 
> Also, a PERL5_MODULE variable should be added. If this is defined,
> then "do-configure:" would call "perl Makefile.PL", as most p5-*
> modules do. This variable would also set "USE_PERL5= YES".

I've attached a patch to bsd.port.mk to this message which
incorporates both my suggestions. I'm not sure whether the patch
goes about this the right way, but it's a good start.

Another thought: Would it be a good idea for PERL5_DEPENDS to
include a minimum acceptable version for each module, as is done
with LIB_DEPENDS? For example, a dependent port might work fine with
Module.pm only if $Module::VERSION > 1.40.

Tom

--yrj/dFKFPuw6o+aM
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="portmk.patch"

--- /usr/ports/Mk/bsd.port.mk.orig	Tue Mar  9 18:22:10 1999
+++ /usr/ports/Mk/bsd.port.mk	Mon Mar 22 16:13:06 1999
@@ -608,6 +608,11 @@
 .endif
 .endif
 
+.if defined(PERL5_MODULE)
+MAN3PREFIX?=	${PREFIX}/lib/perl5/${PERL_VERSION}
+USE_PERL5=	yes
+.endif
+
 .if defined(USE_XLIB)
 LIB_DEPENDS+=	X11.6:${PORTSDIR}/x11/XFree86
 .endif
@@ -1478,6 +1483,12 @@
 .if defined(USE_IMAKE)
 	@(cd ${WRKSRC} && ${XMKMF})
 .endif
+.if defined(PERL5_MODULE)
+	@(cd ${WRKSRC} && \
+	${SETENV} ${MAKE_ENV} ${PERL} Makefile.PL PREFIX=${PREFIX} \
+		INSTALLMAN1DIR=${PREFIX}/man/man1 \
+		INSTALLSCRIPT=${PREFIX}/bin)
+.endif
 .endif
 
 # Build
@@ -1946,7 +1957,7 @@
 ################################################################
 
 .if !target(depends)
-depends: lib-depends misc-depends
+depends: lib-depends misc-depends perl5-depends
 	@cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} fetch-depends
 	@cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} build-depends
 	@cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} run-depends
@@ -2066,6 +2077,36 @@
 		fi \
 	done
 	@${ECHO_MSG} "===>   Returning to build of ${PKGNAME}"
+.endif
+.else
+	@${DO_NADA}
+.endif
+
+perl5-depends:
+.if defined(PERL5_DEPENDS)
+.if !defined(NO_DEPENDS)
+	@for i in ${PERL5_DEPENDS}; do \
+		lib=`${ECHO} $$i | ${SED} -e 's/:.*//' | ${SED} -e 's!/!::!g'`; \
+		dir=`${ECHO} $$i | ${SED} -e 's/[^:]*://'`; \
+		if ${PERL5} -M$$lib -e 'exit 0' > /dev/null 2>&1; then \
+			${ECHO_MSG} "===>   ${PKGNAME} depends on Perl module: $$lib - found"; \
+		else \
+			${ECHO_MSG} "===>   ${PKGNAME} depends on Perl module: $$lib - not found"; \
+			${ECHO_MSG} "===>    Verifying $$target for $$lib in $$dir"; \
+			if [ ! -d "$$dir" ]; then \
+				${ECHO_MSG} "     >> No directory for $$lib.  Skipping.."; \
+			else \
+				(cd $$dir; ${MAKE} ${.MAKEFLAGS} $$target) ; \
+				${ECHO_MSG} "===>   Returning to build of ${PKGNAME}"; \
+				if $${PERL5} -M$$lib -e 'exit 0' > /dev/null 2>&1; then \
+					${TRUE}; \
+				else \
+					${ECHO_MSG} "Error: Perl module \"$$lib\" does not exist"; \
+					${FALSE}; \
+				fi; \
+			fi; \
+		fi; \
+	done
 .endif
 .else
 	@${DO_NADA}

--yrj/dFKFPuw6o+aM--


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




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