Subject: Re: Need help with perl5/module.mk and OTHERLDFLAGS (was Re: devel/p5-subversion is broken)
To: None <tech-pkg@NetBSD.org>
From: Eric Gillespie <epg@pretzelnet.org>
List: tech-pkg
Date: 01/13/2004 20:54:13
Eric Gillespie <epg@pretzelnet.org> writes:

> I can think of plenty of hacks, but no clean way to solve this.
> I'm hoping someone who knows more about perl and/or pkgsrc can
> help.

It turns out p5-subversion doesn't need much out of module.mk:
only the PLIST-generation.  The following patch is the best i've
come up with, and if no one has a better way to solve, i'll go
ahead and commit it.

Juan and Mark, you two are the only others who have seen the
problem, so if you could take a look at this, i'd appreciate it.
It works for me now, on both NetBSD 1.6 and Debian 3.0.


Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/devel/p5-subversion/Makefile,v
retrieving revision 1.5
diff -a -u -r1.5 Makefile
--- Makefile	13 Jan 2004 21:17:04 -0000	1.5
+++ Makefile	14 Jan 2004 00:38:01 -0000
@@ -17,7 +17,8 @@
 PERL5_CONFIGURE_DIRS=	${PERL_DIR}
 PERL5_PACKLIST=		${PERL5_SITEARCH}/auto/SVN/_Core/.packlist
 
-post-build: perl5-configure
+post-build:
+	${_PKG_SILENT}${_PKG_DEBUG}cd ${PERL_DIR} && perl Makefile.PL
 	${_PKG_SILENT}${_PKG_DEBUG}${_ULIMIT_CMD}cd ${PERL_DIR} && \
 		${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS}
 
@@ -25,8 +26,30 @@
 	${_PKG_SILENT}${_PKG_DEBUG}${_ULIMIT_CMD}cd ${PERL_DIR} && \
 		${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS} install
 
+################################################################################
+# Begin theft from perl5/module.mk
+DEPENDS+=	perl>=${PERL5_REQD}:${BUILDLINK_PKGSRCDIR.perl}
+PERL5_PLIST_COMMENT= \
+	( ${ECHO} "@comment The following lines are automatically generated"; \
+	  ${ECHO} "@comment from the installed .packlist files." )
+PERL5_PLIST_FILES= \
+	( ${CAT} ${PERL5_PACKLIST}; for f in ${PERL5_PACKLIST}; do [ ! -f $$f ] || ${ECHO} $$f; done ) \
+	| ${SED} -e "s,[ 	].*,," -e "s,/\./,/,g" -e "s,${PREFIX}/,," \
+	| ${SORT} -u
+PERL5_PLIST_DIRS= \
+	( ${CAT} ${PERL5_PACKLIST}; for f in ${PERL5_PACKLIST}; do [ ! -f $$f ] || ${ECHO} $$f; done ) \
+	| ${SED} -e "s,[ 	].*,," -e "s,/\./,/,g" -e "s,${PREFIX}/,," \
+		-e "s,^,@unexec \${RMDIR} -p %D/," \
+		-e "s,/[^/]*$$, 2>/dev/null || \${TRUE}," \
+	| ${SORT} -ur
+PERL5_GENERATE_PLIST=	${PERL5_PLIST_COMMENT}; \
+			${PERL5_PLIST_FILES}; \
+			${PERL5_PLIST_DIRS}
+GENERATE_PLIST+=	${PERL5_GENERATE_PLIST};
+# End theft
+################################################################################
+
 .include "../../devel/subversion/buildlink2.mk"
 .include "../../devel/swig-build/buildlink2.mk"
 .include "../../devel/swig-perl/buildlink2.mk"
-.include "../../lang/perl5/module.mk"
 .include "../../mk/bsd.pkg.mk"