Changeset View
Changeset View
Standalone View
Standalone View
Mk/Uses/perl5.mk
# $FreeBSD$ | # $FreeBSD$ | ||||
# ex:ts=4 | |||||
# | # | ||||
# Provide support to use perl5 | # Provide support to use perl5 | ||||
# | # | ||||
# PERL5 - Set to full path of perl5, either in the system or | # PERL5 - Set to full path of perl5, either in the system or | ||||
# installed from a port. | # installed from a port. | ||||
# PERL - Set to full path of perl5, either in the system or | # PERL - Set to full path of perl5, either in the system or | ||||
# installed from a port, but without the version number. | # installed from a port, but without the version number. | ||||
# Use this if you need to replace "#!" lines in scripts. | # Use this if you need to replace "#!" lines in scripts. | ||||
# PERL_VERSION - Full version of perl5 (see below for current value). | # PERL_VERSION - Full version of perl5 (see below for current value). | ||||
# | # | ||||
# PERL_VER - Short version of perl5 (major.minor without patchlevel) | # PERL_VER - Short version of perl5 (major.minor without patchlevel) | ||||
# | # | ||||
# PERL_LEVEL - Perl version as an integer of the form MNNNPP, where | # PERL_LEVEL - Perl version as an integer of the form MNNNPP, where | ||||
# M is major version, N is minor version, and P is | # M is major version, N is minor version, and P is | ||||
# the patch level. E.g., PERL_VERSION=5.14.4 would give | # the patch level. E.g., PERL_VERSION=5.14.4 would give | ||||
# a PERL_LEVEL of 501404. This can be used in comparisons | # a PERL_LEVEL of 501404. This can be used in comparisons | ||||
# to determine if the version of perl is high enough, | # to determine if the version of perl is high enough, | ||||
# whether a particular dependency is needed, etc. | # whether a particular dependency is needed, etc. | ||||
# PERL_ARCH - Directory name of architecture dependent libraries | # PERL_ARCH - Directory name of architecture dependent libraries | ||||
# (value: mach). | # (value: mach). | ||||
# PERL_PORT - Name of the perl port that is installed | # PERL_PORT - Name of the perl port that is installed | ||||
# (value: perl5.14) | # (value: perl5.14) | ||||
# SITE_PERL - Directory name where site specific perl packages go. | # SITE_PERL - Directory name where site specific perl packages go. | ||||
# This value is added to PLIST_SUB. | # This value is added to PLIST_SUB. | ||||
# ARCH_PERL - Directory name where arch site specific perl packages go. | |||||
# This value is added to PLIST_SUB. | |||||
# USE_PERL5 - If set, this port uses perl5 in one or more of the extract, | # USE_PERL5 - If set, this port uses perl5 in one or more of the extract, | ||||
# patch, build, install or run phases. The fixpacklist is | # patch, build, install or run phases. The fixpacklist is | ||||
# needed in some cases, when a .packlist is created, it may | # needed in some cases, when a .packlist is created, it may | ||||
# reference ${STAGEDIR} | # reference ${STAGEDIR} | ||||
# It can also have configure, modbuild and modbuildtiny when | # It can also have configure, modbuild and modbuildtiny when | ||||
# the port needs to run Makefile.PL, Build.PL and a | # the port needs to run Makefile.PL, Build.PL and a | ||||
# Module::Build::Tiny flavor of Build.PL. | # Module::Build::Tiny flavor of Build.PL. | ||||
# | # | ||||
▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | |||||
.elif ${PERL_LEVEL} >= 501800 | .elif ${PERL_LEVEL} >= 501800 | ||||
PERL_PORT?= perl5.18 | PERL_PORT?= perl5.18 | ||||
.elif ${PERL_LEVEL} >= 501600 | .elif ${PERL_LEVEL} >= 501600 | ||||
PERL_PORT?= perl5.16 | PERL_PORT?= perl5.16 | ||||
.else # ${PERL_LEVEL} < 501600 | .else # ${PERL_LEVEL} < 501600 | ||||
PERL_PORT?= perl5.14 | PERL_PORT?= perl5.14 | ||||
.endif | .endif | ||||
SITE_PERL_REL?= lib/perl5/site_perl/${PERL_VER} | SITE_PERL_REL?= lib/perl5/site_perl | ||||
SITE_PERL?= ${LOCALBASE}/${SITE_PERL_REL} | SITE_PERL?= ${LOCALBASE}/${SITE_PERL_REL} | ||||
SITE_ARCH_REL?= ${SITE_PERL_REL}/${PERL_ARCH}/${PERL_VER} | |||||
antoine: why ${PERL_ARCH}/${PERL_VER} and not ${PERL_VER}/${PERL_ARCH} ? | |||||
Not Done Inline ActionsWell, that way, all of perl .so end up in ${PERL_ARCH} with on subdirectory for each perl version. mat: Well, that way, all of perl .so end up in ${PERL_ARCH} with on subdirectory for each perl… | |||||
SITE_ARCH?= ${LOCALBASE}/${SITE_ARCH_REL} | |||||
SITE_MAN3_REL?= ${SITE_PERL_REL}/man/man3 | |||||
SITE_MAN3?= ${PREFIX}/${SITE_MAN3_REL} | |||||
PERL5= ${LOCALBASE}/bin/perl${PERL_VERSION} | PERL5= ${LOCALBASE}/bin/perl${PERL_VERSION} | ||||
PERL= ${LOCALBASE}/bin/perl | PERL= ${LOCALBASE}/bin/perl | ||||
CONFIGURE_ENV+= ac_cv_path_PERL=${PERL} ac_cv_path_PERL_PATH=${PERL} | CONFIGURE_ENV+= ac_cv_path_PERL=${PERL} ac_cv_path_PERL_PATH=${PERL} | ||||
# Define the want perl first if defined | # Define the want perl first if defined | ||||
.if ${USE_PERL5:M5*} | .if ${USE_PERL5:M5*} | ||||
want_perl_sign= ${USE_PERL5:M5*:C|^[0-9.]+||} | want_perl_sign= ${USE_PERL5:M5*:C|^[0-9.]+||} | ||||
▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | |||||
.endif | .endif | ||||
.if defined(_POSTMKINCLUDED) && !defined(_INCLUDE_USES_PERL5_POST_MK) | .if defined(_POSTMKINCLUDED) && !defined(_INCLUDE_USES_PERL5_POST_MK) | ||||
_INCLUDE_USES_PERL5_POST_MK= yes | _INCLUDE_USES_PERL5_POST_MK= yes | ||||
PLIST_SUB+= PERL_VERSION=${PERL_VERSION} \ | PLIST_SUB+= PERL_VERSION=${PERL_VERSION} \ | ||||
PERL_VER=${PERL_VER} \ | PERL_VER=${PERL_VER} \ | ||||
PERL_ARCH=${PERL_ARCH} \ | PERL_ARCH=${PERL_ARCH} \ | ||||
PERL5_MAN3=lib/perl5/${PERL_VER}/man/man3 \ | PERL5_MAN3=${SITE_MAN3_REL} \ | ||||
SITE_PERL=${SITE_PERL_REL} | SITE_PERL=${SITE_PERL_REL} \ | ||||
SITE_ARCH=${SITE_ARCH_REL} | |||||
# handle perl5 specific manpages | # handle perl5 specific manpages | ||||
.for sect in 3 | .for sect in 3 | ||||
.if defined(P5MAN${sect}) | .if defined(P5MAN${sect}) | ||||
_MANPAGES+= ${P5MAN${sect}:S%^%${PREFIX}/lib/perl5/${PERL_VER}/man/man${sect}/%} | _MANPAGES+= ${P5MAN${sect}:S%^%${PREFIX}/lib/perl5/${PERL_VER}/man/man${sect}/%} | ||||
.endif | .endif | ||||
.endfor | .endfor | ||||
MANDIRS+= ${PREFIX}/lib/perl5/${PERL_VER} | MANDIRS+= ${PREFIX}/lib/perl5/${PERL_VER} | ||||
.if ${_USE_PERL5:Mmodbuild} || ${_USE_PERL5:Mmodbuildtiny} | .if ${_USE_PERL5:Mmodbuild} || ${_USE_PERL5:Mmodbuildtiny} | ||||
_USE_PERL5+= configure | _USE_PERL5+= configure | ||||
ALL_TARGET?= # empty | ALL_TARGET?= # empty | ||||
CONFIGURE_ARGS+=--install_path lib="${PREFIX}/${SITE_PERL_REL}" \ | CONFIGURE_ARGS+=--install_path lib="${PREFIX}/${SITE_PERL_REL}" \ | ||||
--install_path arch="${PREFIX}/${SITE_PERL_REL}/${PERL_ARCH}" \ | --install_path arch="${PREFIX}/${SITE_ARCH_REL}" \ | ||||
--install_path script="${PREFIX}/bin" \ | --install_path script="${PREFIX}/bin" \ | ||||
--install_path bin="${PREFIX}/bin" \ | --install_path bin="${PREFIX}/bin" \ | ||||
--install_path libdoc="${MAN3PREFIX}/man/man3" \ | --install_path libdoc="${MAN3PREFIX}/man/man3" \ | ||||
--install_path bindoc="${MAN1PREFIX}/man/man1" | --install_path bindoc="${MAN1PREFIX}/man/man1" | ||||
CONFIGURE_SCRIPT?= Build.PL | CONFIGURE_SCRIPT?= Build.PL | ||||
PL_BUILD?= Build | PL_BUILD?= Build | ||||
CONFIGURE_ARGS+=--destdir ${STAGEDIR} | CONFIGURE_ARGS+=--destdir ${STAGEDIR} | ||||
DESTDIRNAME= --destdir | DESTDIRNAME= --destdir | ||||
Show All 39 Lines | |||||
.if ${_USE_PERL5:Mrun} | .if ${_USE_PERL5:Mrun} | ||||
RUN_DEPENDS+= ${PERL5}:${PORTSDIR}/lang/${PERL_PORT} | RUN_DEPENDS+= ${PERL5}:${PORTSDIR}/lang/${PERL_PORT} | ||||
.endif | .endif | ||||
.if ${_USE_PERL5:Mconfigure} | .if ${_USE_PERL5:Mconfigure} | ||||
CONFIGURE_ARGS+= CC="${CC}" CCFLAGS="${CFLAGS}" PREFIX="${PREFIX}" \ | CONFIGURE_ARGS+= CC="${CC}" CCFLAGS="${CFLAGS}" PREFIX="${PREFIX}" \ | ||||
INSTALLPRIVLIB="${PREFIX}/lib" INSTALLARCHLIB="${PREFIX}/lib" | INSTALLPRIVLIB="${PREFIX}/lib" INSTALLARCHLIB="${PREFIX}/lib" | ||||
CONFIGURE_SCRIPT?= Makefile.PL | CONFIGURE_SCRIPT?= Makefile.PL | ||||
MAN3PREFIX?= ${PREFIX}/lib/perl5/${PERL_VER} | MAN3PREFIX?= ${PREFIX}/${SITE_PERL_REL} | ||||
.undef HAS_CONFIGURE | .undef HAS_CONFIGURE | ||||
.if !target(do-configure) | .if !target(do-configure) | ||||
do-configure: | do-configure: | ||||
@if [ -f ${SCRIPTDIR}/configure ]; then \ | @if [ -f ${SCRIPTDIR}/configure ]; then \ | ||||
cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} ${SH} \ | cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} ${SH} \ | ||||
${SCRIPTDIR}/configure; \ | ${SCRIPTDIR}/configure; \ | ||||
fi | fi | ||||
Show All 18 Lines | |||||
do-install: | do-install: | ||||
@(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${PERL5} ${PL_BUILD} ${INSTALL_TARGET} ${MAKE_ARGS}) | @(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${PERL5} ${PL_BUILD} ${INSTALL_TARGET} ${MAKE_ARGS}) | ||||
.endif # !target(do-install) | .endif # !target(do-install) | ||||
.endif # ! USES=gmake | .endif # ! USES=gmake | ||||
.endif # modbuild | .endif # modbuild | ||||
.if ${USE_PERL5:Mconfigure} || ${USE_PERL5:Mmodbuildtiny} || ${USE_PERL5:Mfixpacklist} | .if ${USE_PERL5:Mconfigure} || ${USE_PERL5:Mmodbuildtiny} || ${USE_PERL5:Mfixpacklist} | ||||
fix-packlist:: | fix-packlist:: | ||||
@if [ -d ${STAGEDIR}${PREFIX}/${SITE_PERL_REL}/${PERL_ARCH}/auto ] ; then ${FIND} ${STAGEDIR}${PREFIX}/${SITE_PERL_REL}/${PERL_ARCH}/auto -name .packlist -exec ${SED} -i '' 's|^${STAGEDIR}||' '{}' \; ; fi | @if [ -d ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto ] ; then ${FIND} ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto -name .packlist -exec ${SED} -i '' 's|^${STAGEDIR}||' '{}' \; ; fi | ||||
.endif | .endif | ||||
# Starting with perl 5.20, the empty bootstrap files are not installed any more | # Starting with perl 5.20, the empty bootstrap files are not installed any more | ||||
# by ExtUtils::MakeMaker. As we don't need them anyway, remove them. | # by ExtUtils::MakeMaker. As we don't need them anyway, remove them. | ||||
# Module::Build continues to install them, so remove the files unconditionally. | # Module::Build continues to install them, so remove the files unconditionally. | ||||
fix-perl-bs: | fix-perl-bs: | ||||
-@${FIND} ${STAGEDIR} -name '*.bs' -size 0 -delete | -@${FIND} ${STAGEDIR} -name '*.bs' -size 0 -delete | ||||
.if !target(regression-test) | .if !target(regression-test) | ||||
TEST_ARGS+= ${MAKE_ARGS} | TEST_ARGS+= ${MAKE_ARGS} | ||||
TEST_ENV+= ${MAKE_ENV} | TEST_ENV+= ${MAKE_ENV} | ||||
TEST_TARGET?= test | TEST_TARGET?= test | ||||
TEST_WRKSRC?= ${BUILD_WRKSRC} | TEST_WRKSRC?= ${BUILD_WRKSRC} | ||||
Not Done Inline Actionss/no/to/ brueffer: s/no/to/ | |||||
.if !target(test) | .if !target(test) | ||||
test: regression-test | test: regression-test | ||||
.endif # test | .endif # test | ||||
regression-test: build | regression-test: build | ||||
.if ${USE_PERL5:Mmodbuild*} | .if ${USE_PERL5:Mmodbuild*} | ||||
-cd ${TEST_WRKSRC}/ && ${SETENV} ${TEST_ENV} ${PERL5} ${PL_BUILD} ${TEST_TARGET} ${TEST_ARGS} | -cd ${TEST_WRKSRC}/ && ${SETENV} ${TEST_ENV} ${PERL5} ${PL_BUILD} ${TEST_TARGET} ${TEST_ARGS} | ||||
.elif ${USE_PERL5:Mconfigure} | .elif ${USE_PERL5:Mconfigure} | ||||
-cd ${TEST_WRKSRC}/ && ${SETENV} ${TEST_ENV} ${MAKE_CMD} ${TEST_ARGS} ${TEST_TARGET} | -cd ${TEST_WRKSRC}/ && ${SETENV} ${TEST_ENV} ${MAKE_CMD} ${TEST_ARGS} ${TEST_TARGET} | ||||
.endif # USE_PERL5:Mmodbuild* | .endif # USE_PERL5:Mmodbuild* | ||||
.endif # regression-test | .endif # regression-test | ||||
.endif # defined(_POSTMKINCLUDED) | .endif # defined(_POSTMKINCLUDED) |
why ${PERL_ARCH}/${PERL_VER} and not ${PERL_VER}/${PERL_ARCH} ?