have perl module work like it should: define extra TARGET_* variables,

and have do-install/do-build use them.

Replace pre-configure with folded in shell fragment.
Don't hardcode perl location, we don't hardcode those things but rely
on PATH instead.

check that Makefile.PL actually produced a Makefile, since the way it
errors out does not exit 1, thus leading to configure having failed and
ports thinking it succeeded...

okay sthen@
This commit is contained in:
espie 2012-08-15 09:38:11 +00:00
parent 64777f79b0
commit a2a18547bc

View File

@ -1,6 +1,6 @@
#-*- mode: Fundamental; tab-width: 4; -*-
# ex:ts=4 sw=4 filetype=make:
# $OpenBSD: perl.port.mk,v 1.19 2010/11/26 20:24:36 espie Exp $
# $OpenBSD: perl.port.mk,v 1.20 2012/08/15 09:38:11 espie Exp $
# Based on bsd.port.mk, originally by Jordan K. Hubbard.
# This file is in the public domain.
@ -10,9 +10,9 @@ SHARED_ONLY ?= No
.if ${CONFIGURE_STYLE:L:Mmodbuild}
MODPERL_configure = \
arch=`/usr/bin/perl -e 'use Config; print $$Config{archname}, "\n";'`; \
arch=`perl -e 'use Config; print $$Config{archname}, "\n";'`; \
cd ${WRKSRC}; ${_SYSTRACE_CMD} ${SETENV} ${CONFIGURE_ENV} \
/usr/bin/perl Build.PL \
perl Build.PL \
install_path=lib="${PREFIX}/libdata/perl5/site_perl" \
install_path=arch="${PREFIX}/libdata/perl5/site_perl/$$arch" \
install_path=libdoc="${PREFIX}/man/man3p" \
@ -20,11 +20,11 @@ MODPERL_configure = \
install_path=bin="${PREFIX}/bin" \
install_path=script="${PREFIX}/bin" ${CONFIGURE_ARGS}
.else
MODPERL_configure = \
arch=`/usr/bin/perl -e 'use Config; print $$Config{archname}, "\n";'`; \
MODPERL_configure = ${_MODPERL_preconfig}; \
arch=`perl -e 'use Config; print $$Config{archname}, "\n";'`; \
cd ${WRKSRC}; ${_SYSTRACE_CMD} ${SETENV} ${CONFIGURE_ENV} \
PERL_MM_USE_DEFAULT=Yes \
/usr/bin/perl Makefile.PL \
perl Makefile.PL \
PREFIX='${PREFIX}' \
INSTALLSITELIB='${PREFIX}/libdata/perl5/site_perl' \
INSTALLSITEARCH="\$${INSTALLSITELIB}/$$arch" \
@ -33,38 +33,47 @@ MODPERL_configure = \
INSTALLMAN1DIR='${PREFIX}/man/man1' \
INSTALLMAN3DIR='${PREFIX}/man/man3p' \
INSTALLBIN='$${PREFIX}/bin' \
INSTALLSCRIPT='$${INSTALLBIN}' ${CONFIGURE_ARGS}
INSTALLSCRIPT='$${INSTALLBIN}' ${CONFIGURE_ARGS}; \
if ! test -f ${WRKBUILD}/Makefile; then \
echo >&2 "Fatal: Makefile.PL did not produce a Makefile"; \
exit 1; \
fi
. if ${CONFIGURE_STYLE:L:Mmodinst}
BUILD_DEPENDS += devel/p5-Module-Install
CONFIGURE_ARGS += --skipdeps
_MODPERL_preconfig = rm -rf ${WRKSRC}/inc/Module/*Install*
. else
_MODPERL_preconfig = :
. endif
.endif
MODPERL_pre-fake = \
${SUDO} mkdir -p ${WRKINST}`/usr/bin/perl -e 'use Config; print $$Config{installarchlib}, "\n";'`
${SUDO} mkdir -p ${WRKINST}`perl -e 'use Config; print $$Config{installarchlib}, "\n";'`
.if ${CONFIGURE_STYLE:L:Mmodbuild}
MODPERL_BUILD_TARGET = \
cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} perl \
${MODPERL_BUILD} build
MODPERL_REGRESS_TARGET = \
cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} perl \
${MODPERL_BUILD} ${REGRESS_TARGET}
MODPERL_INSTALL_TARGET = \
cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} perl \
${MODPERL_BUILD} destdir=${WRKINST} ${FAKE_TARGET}
. if !target(do-build)
do-build:
@cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} /usr/bin/perl \
${MODPERL_BUILD} build
@${MODPERL_BUILD_TARGET}
. endif
. if !target(do-regress)
do-regress:
@cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} /usr/bin/perl \
${MODPERL_BUILD} ${REGRESS_TARGET}
@${MODPERL_REGRESS_TARGET}
. endif
. if !target(do-install)
do-install:
@cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} /usr/bin/perl \
${MODPERL_BUILD} destdir=${WRKINST} ${FAKE_TARGET}
. endif
.elif ${CONFIGURE_STYLE:L:Mmodinst}
. if !target(pre-configure)
pre-configure:
@rm -rf ${WRKSRC}/inc/Module/*Install*
@${MODPERL_INSTALL_TARGET}
. endif
.endif