2013-07-31 08:29:25 +02:00
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
# Provide support to use perl5
|
|
|
|
#
|
2014-12-16 13:06:40 +01:00
|
|
|
# PERL5 - Set to full path of perl5, either in the system or
|
|
|
|
# installed from a port.
|
|
|
|
# PERL - Set to full path of perl5, either in the system or
|
|
|
|
# installed from a port, but without the version number.
|
|
|
|
# Use this if you need to replace "#!" lines in scripts.
|
2013-07-31 08:29:25 +02:00
|
|
|
# PERL_VERSION - Full version of perl5 (see below for current value).
|
2014-11-26 14:08:24 +01:00
|
|
|
#
|
2013-07-31 08:29:25 +02:00
|
|
|
# PERL_VER - Short version of perl5 (major.minor without patchlevel)
|
|
|
|
#
|
|
|
|
# PERL_LEVEL - Perl version as an integer of the form MNNNPP, where
|
2014-12-16 13:06:40 +01:00
|
|
|
# M is major version, N is minor version, and P is
|
|
|
|
# the patch level. E.g., PERL_VERSION=5.14.4 would give
|
|
|
|
# a PERL_LEVEL of 501404. This can be used in comparisons
|
|
|
|
# to determine if the version of perl is high enough,
|
|
|
|
# whether a particular dependency is needed, etc.
|
|
|
|
# PERL_ARCH - Directory name of architecture dependent libraries
|
|
|
|
# (value: mach).
|
|
|
|
# PERL_PORT - Name of the perl port that is installed
|
2014-12-31 17:04:29 +01:00
|
|
|
# (for example: perl5.18)
|
2014-12-16 13:06:40 +01:00
|
|
|
# SITE_PERL - Directory name where site specific perl packages go.
|
|
|
|
# This value is added to PLIST_SUB.
|
|
|
|
# SITE_ARCH - 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,
|
|
|
|
# patch, build, install or run phases.
|
|
|
|
# It can also have configure, modbuild and modbuildtiny when
|
|
|
|
# the port needs to run Makefile.PL, Build.PL and a
|
|
|
|
# Module::Build::Tiny flavor of Build.PL.
|
2014-03-15 11:31:54 +01:00
|
|
|
#
|
|
|
|
# MAINTAINER: perl@FreeBSD.org
|
2013-07-31 08:29:25 +02:00
|
|
|
|
|
|
|
.if !defined(_INCLUDE_USES_PERL5_MK)
|
|
|
|
_INCLUDE_USES_PERL5_MK= yes
|
|
|
|
|
2014-09-28 18:36:31 +02:00
|
|
|
.if !empty(perl5_ARGS)
|
2013-07-31 08:29:25 +02:00
|
|
|
IGNORE= Incorrect 'USES+=perl5:${perl5_ARGS}' perl5 takes no arguments
|
|
|
|
.endif
|
|
|
|
|
|
|
|
USE_PERL5?= run build
|
|
|
|
|
2015-09-14 14:19:48 +02:00
|
|
|
# remove when 5.20 goes away.
|
2013-07-31 08:29:25 +02:00
|
|
|
.sinclude "${LOCALBASE}/etc/perl5_version"
|
2015-09-14 14:19:48 +02:00
|
|
|
.if defined(PERL_VERSION)
|
|
|
|
PERL5_DEPEND= ${PERL5}
|
|
|
|
THIS_IS_OLD_PERL= yes
|
2013-07-31 08:29:25 +02:00
|
|
|
.else
|
2015-09-14 14:19:48 +02:00
|
|
|
# end of remove
|
2016-04-14 15:34:25 +02:00
|
|
|
# When adding a version, please keep the comment in
|
|
|
|
# Mk/bsd.default-versions.mk in sync.
|
2013-09-19 10:16:43 +02:00
|
|
|
.include "${PORTSDIR}/Mk/bsd.default-versions.mk"
|
2015-12-31 22:06:14 +01:00
|
|
|
.if ${PERL5_DEFAULT} == 5.18
|
2015-08-31 15:17:48 +02:00
|
|
|
.include "${PORTSDIR}/lang/perl5.18/version.mk"
|
2014-05-27 14:19:24 +02:00
|
|
|
.elif ${PERL5_DEFAULT} == 5.20
|
2015-08-31 15:17:48 +02:00
|
|
|
.include "${PORTSDIR}/lang/perl5.20/version.mk"
|
2015-05-26 16:44:06 +02:00
|
|
|
.elif ${PERL5_DEFAULT} == 5.22
|
2015-08-31 15:17:48 +02:00
|
|
|
.include "${PORTSDIR}/lang/perl5.22/version.mk"
|
2016-05-09 14:50:38 +02:00
|
|
|
.elif ${PERL5_DEFAULT} == 5.24
|
|
|
|
.include "${PORTSDIR}/lang/perl5.24/version.mk"
|
2015-06-01 20:55:45 +02:00
|
|
|
.elif ${PERL5_DEFAULT} == devel
|
2015-08-31 15:17:48 +02:00
|
|
|
.include "${PORTSDIR}/lang/perl5-devel/version.mk"
|
2015-05-26 14:10:11 +02:00
|
|
|
# Force PERL_PORT here in case two identical PERL_VERSION.
|
|
|
|
PERL_PORT?= perl5-devel
|
2013-09-19 10:16:43 +02:00
|
|
|
.else
|
|
|
|
IGNORE= Invalid perl5 version ${PERL5_DEFAULT}
|
|
|
|
.endif
|
2013-07-31 08:29:25 +02:00
|
|
|
.endif
|
|
|
|
|
|
|
|
PERL_VER?= ${PERL_VERSION:C/\.[0-9]+$//}
|
|
|
|
|
|
|
|
.if !defined(PERL_LEVEL) && defined(PERL_VERSION)
|
2014-12-16 13:06:40 +01:00
|
|
|
perl_major= ${PERL_VERSION:C|^([1-9]+).*|\1|}
|
2013-07-31 08:29:25 +02:00
|
|
|
_perl_minor= 00${PERL_VERSION:C|^([1-9]+)\.([0-9]+).*|\2|}
|
2014-12-16 13:06:40 +01:00
|
|
|
perl_minor= ${_perl_minor:C|^.*(...)|\1|}
|
2013-07-31 08:29:25 +02:00
|
|
|
.if ${perl_minor} >= 100
|
2014-12-16 13:06:40 +01:00
|
|
|
perl_minor= ${PERL_VERSION:C|^([1-9]+)\.([0-9][0-9][0-9]).*|\2|}
|
|
|
|
perl_patch= ${PERL_VERSION:C|^.*(..)|\1|}
|
2013-07-31 08:29:25 +02:00
|
|
|
.else # ${perl_minor} < 100
|
|
|
|
_perl_patch= 0${PERL_VERSION:C|^([1-9]+)\.([0-9]+)\.*|0|}
|
2014-12-16 13:06:40 +01:00
|
|
|
perl_patch= ${_perl_patch:C|^.*(..)|\1|}
|
2013-07-31 08:29:25 +02:00
|
|
|
.endif # ${perl_minor} < 100
|
|
|
|
PERL_LEVEL= ${perl_major}${perl_minor}${perl_patch}
|
|
|
|
.else
|
|
|
|
PERL_LEVEL=0
|
|
|
|
.endif # !defined(PERL_LEVEL) && defined(PERL_VERSION)
|
|
|
|
|
2014-12-16 13:06:40 +01:00
|
|
|
PERL_ARCH?= mach
|
2013-07-31 08:29:25 +02:00
|
|
|
|
|
|
|
# there must always be a default to prevent dependency failures such
|
2015-06-01 20:55:45 +02:00
|
|
|
# as "ports/lang: not found". Also, perl5-devel is taken care in the
|
|
|
|
# perl5_default file, or up there in the default versions selection.
|
2016-04-14 15:34:25 +02:00
|
|
|
# When adding a version, please keep the comment in
|
|
|
|
# Mk/bsd.default-versions.mk in sync.
|
2016-05-09 14:50:38 +02:00
|
|
|
.if ${PERL_LEVEL} >= 502400
|
|
|
|
PERL_PORT?= perl5.24
|
|
|
|
.elif ${PERL_LEVEL} >= 502200
|
2015-05-26 16:44:06 +02:00
|
|
|
PERL_PORT?= perl5.22
|
2015-04-16 13:44:21 +02:00
|
|
|
.elif ${PERL_LEVEL} >= 502000
|
2014-05-27 14:19:24 +02:00
|
|
|
PERL_PORT?= perl5.20
|
2015-12-31 22:06:14 +01:00
|
|
|
.else # ${PERL_LEVEL} < 502000
|
2013-08-13 15:04:55 +02:00
|
|
|
PERL_PORT?= perl5.18
|
2013-07-31 08:29:25 +02:00
|
|
|
.endif
|
|
|
|
|
2014-11-26 14:08:24 +01:00
|
|
|
SITE_PERL_REL?= lib/perl5/site_perl
|
2013-07-31 08:29:25 +02:00
|
|
|
SITE_PERL?= ${LOCALBASE}/${SITE_PERL_REL}
|
2014-11-26 14:08:24 +01:00
|
|
|
SITE_ARCH_REL?= ${SITE_PERL_REL}/${PERL_ARCH}/${PERL_VER}
|
2014-11-18 14:45:56 +01:00
|
|
|
SITE_ARCH?= ${LOCALBASE}/${SITE_ARCH_REL}
|
2014-11-26 14:08:24 +01:00
|
|
|
SITE_MAN3_REL?= ${SITE_PERL_REL}/man/man3
|
|
|
|
SITE_MAN3?= ${PREFIX}/${SITE_MAN3_REL}
|
2015-09-14 14:19:48 +02:00
|
|
|
.if defined(THIS_IS_OLD_PERL)
|
|
|
|
SITE_MAN1_REL?= share/man/man1
|
|
|
|
.else
|
|
|
|
SITE_MAN1_REL?= ${SITE_PERL_REL}/man/man1
|
|
|
|
.endif
|
|
|
|
SITE_MAN1?= ${PREFIX}/${SITE_MAN1_REL}
|
2013-07-31 08:29:25 +02:00
|
|
|
|
2016-05-04 21:50:21 +02:00
|
|
|
PERL5?= ${LOCALBASE}/bin/perl${PERL_VERSION}
|
|
|
|
PERL?= ${LOCALBASE}/bin/perl
|
2014-04-04 13:29:07 +02:00
|
|
|
CONFIGURE_ENV+= ac_cv_path_PERL=${PERL} ac_cv_path_PERL_PATH=${PERL}
|
2013-07-31 08:29:25 +02:00
|
|
|
|
2014-12-17 14:21:56 +01:00
|
|
|
QA_ENV+= SITE_ARCH_REL=${SITE_ARCH_REL} LIBPERL=libperl.so.${PERL_VER}
|
|
|
|
|
2013-07-31 08:29:25 +02:00
|
|
|
# Define the want perl first if defined
|
|
|
|
.if ${USE_PERL5:M5*}
|
|
|
|
want_perl_sign= ${USE_PERL5:M5*:C|^[0-9.]+||}
|
|
|
|
want_perl_ver= ${USE_PERL5:M5*:S|${want_perl_sign}$||}
|
|
|
|
want_perl_major= ${want_perl_ver:C|\..*||}
|
|
|
|
_want_perl_minor= ${want_perl_ver:S|^${want_perl_major}||:S|^.||:C|\..*||}
|
|
|
|
_want_perl_patch= ${want_perl_ver:S|^${want_perl_major}||:S|^.${_want_perl_minor}||:S|^.||:C|\..*||}
|
|
|
|
want_perl_minor= ${_want_perl_minor:S|^|000|:C|.*(...)|\1|}
|
|
|
|
want_perl_patch= ${_want_perl_patch:S|^|00|:C|.*(..)|\1|}
|
|
|
|
USE_PERL5_LEVEL= ${want_perl_major}${want_perl_minor}${want_perl_patch}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
# All but version
|
|
|
|
_USE_PERL5= ${USE_PERL5:N5*}
|
|
|
|
|
|
|
|
# Mask unspecified components. E.g. this way "5" will match any "5.x.x".
|
|
|
|
.if empty(_want_perl_minor)
|
|
|
|
masked_PERL_LEVEL= ${PERL_LEVEL:C|(.....)$|00000|}
|
|
|
|
.elif empty(_want_perl_patch)
|
|
|
|
masked_PERL_LEVEL= ${PERL_LEVEL:C|(..)$|00|}
|
|
|
|
.else
|
|
|
|
masked_PERL_LEVEL= ${PERL_LEVEL}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if defined(want_perl_sign)
|
|
|
|
.if ${want_perl_sign} == "+"
|
|
|
|
.if ${USE_PERL5_LEVEL} > ${masked_PERL_LEVEL}
|
|
|
|
USE_PERL5_REASON?= requires Perl ${want_perl_ver} or later, install lang/perl${want_perl_major}.${want_perl_minor:C|^0||} and try again
|
|
|
|
IGNORE= ${USE_PERL5_REASON}
|
|
|
|
.endif # ${USE_PERL5_LEVEL} > ${masked_PERL_LEVEL}
|
|
|
|
.elif ${want_perl_sign} == ""
|
|
|
|
.if ${USE_PERL5_LEVEL} != ${masked_PERL_LEVEL}
|
|
|
|
USE_PERL5_REASON?= requires Perl ${want_perl_ver} exactly
|
|
|
|
IGNORE= ${USE_PERL5_REASON}
|
|
|
|
.endif # ${USE_PERL5_LEVEL} != ${masked_PERL_LEVEL}
|
|
|
|
.elif ${want_perl_sign} == "-"
|
|
|
|
.if ${USE_PERL5_LEVEL} <= ${masked_PERL_LEVEL}
|
|
|
|
USE_PERL5_REASON?= requires a Perl version earlier than ${want_perl_ver}
|
|
|
|
IGNORE= ${USE_PERL5_REASON}
|
|
|
|
.endif # ${USE_PERL5_LEVEL} <= ${masked_PERL_LEVEL}
|
|
|
|
.else # wrong suffix
|
|
|
|
IGNORE= improper use of USE_PERL5
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
|
|
|
_USES_POST+= perl5
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if defined(_POSTMKINCLUDED) && !defined(_INCLUDE_USES_PERL5_POST_MK)
|
|
|
|
_INCLUDE_USES_PERL5_POST_MK= yes
|
|
|
|
|
|
|
|
PLIST_SUB+= PERL_VERSION=${PERL_VERSION} \
|
2014-12-16 13:06:40 +01:00
|
|
|
PERL_VER=${PERL_VER} \
|
2015-09-14 14:19:48 +02:00
|
|
|
PERL5_MAN1=${SITE_MAN1_REL} \
|
2014-12-16 13:06:40 +01:00
|
|
|
PERL5_MAN3=${SITE_MAN3_REL} \
|
|
|
|
SITE_PERL=${SITE_PERL_REL} \
|
|
|
|
SITE_ARCH=${SITE_ARCH_REL}
|
2013-09-23 07:34:18 +02:00
|
|
|
|
2013-07-31 08:29:25 +02:00
|
|
|
# handle perl5 specific manpages
|
2013-09-26 17:52:38 +02:00
|
|
|
.for sect in 3
|
2013-07-31 08:29:25 +02:00
|
|
|
.if defined(P5MAN${sect})
|
|
|
|
_MANPAGES+= ${P5MAN${sect}:S%^%${PREFIX}/lib/perl5/${PERL_VER}/man/man${sect}/%}
|
|
|
|
.endif
|
|
|
|
.endfor
|
2014-12-23 02:32:18 +01:00
|
|
|
MANDIRS+= ${PREFIX}/${SITE_PERL_REL}/man
|
2013-07-31 08:29:25 +02:00
|
|
|
|
2013-09-04 15:11:02 +02:00
|
|
|
.if ${_USE_PERL5:Mmodbuild} || ${_USE_PERL5:Mmodbuildtiny}
|
2013-10-20 10:29:15 +02:00
|
|
|
_USE_PERL5+= configure
|
|
|
|
ALL_TARGET?= # empty
|
2014-12-23 02:42:10 +01:00
|
|
|
CONFIGURE_ARGS+=--install_path lib="${PREFIX}/${SITE_PERL_REL}" \
|
|
|
|
--install_path arch="${PREFIX}/${SITE_ARCH_REL}" \
|
2014-12-16 13:06:40 +01:00
|
|
|
--install_path script="${PREFIX}/bin" \
|
|
|
|
--install_path bin="${PREFIX}/bin" \
|
|
|
|
--install_path libdoc="${MAN3PREFIX}/man/man3" \
|
|
|
|
--install_path bindoc="${MAN1PREFIX}/man/man1"
|
2013-07-31 08:29:25 +02:00
|
|
|
CONFIGURE_SCRIPT?= Build.PL
|
2013-10-20 10:29:15 +02:00
|
|
|
PL_BUILD?= Build
|
|
|
|
CONFIGURE_ARGS+=--destdir ${STAGEDIR}
|
|
|
|
DESTDIRNAME= --destdir
|
2013-09-04 18:54:39 +02:00
|
|
|
.if ${_USE_PERL5:Mmodbuild}
|
2013-07-31 08:29:25 +02:00
|
|
|
.if ${PORTNAME} != Module-Build
|
2016-03-27 03:23:25 +02:00
|
|
|
BUILD_DEPENDS+= p5-Module-Build>=0.4206:devel/p5-Module-Build
|
2013-07-31 08:29:25 +02:00
|
|
|
.endif
|
2014-11-27 10:57:39 +01:00
|
|
|
CONFIGURE_ARGS+=--create_packlist 1
|
2013-09-04 18:54:39 +02:00
|
|
|
.endif
|
2013-09-04 15:11:02 +02:00
|
|
|
.if ${_USE_PERL5:Mmodbuildtiny}
|
2013-09-04 18:54:39 +02:00
|
|
|
.if ${PORTNAME} != Module-Build-Tiny
|
2016-03-27 03:23:25 +02:00
|
|
|
BUILD_DEPENDS+= p5-Module-Build-Tiny>=0.039:devel/p5-Module-Build-Tiny
|
2013-09-04 15:11:02 +02:00
|
|
|
.endif
|
2014-11-27 10:57:39 +01:00
|
|
|
CONFIGURE_ARGS+=--create_packlist 1
|
2013-09-04 18:54:39 +02:00
|
|
|
.endif
|
2013-07-31 08:29:25 +02:00
|
|
|
.elif ${_USE_PERL5:Mconfigure}
|
2014-11-27 10:57:39 +01:00
|
|
|
CONFIGURE_ARGS+=INSTALLDIRS="site"
|
2013-07-31 08:29:25 +02:00
|
|
|
.endif # modbuild
|
|
|
|
|
|
|
|
.if ${_USE_PERL5:Mconfigure}
|
|
|
|
_USE_PERL5+= build run
|
|
|
|
# Disable AutoInstall from attempting to install from CPAN directly in
|
|
|
|
# the case of missing dependencies. This causes the build to loop on
|
|
|
|
# the build cluster asking for interactive input.
|
|
|
|
CONFIGURE_ENV+= PERL_EXTUTILS_AUTOINSTALL="--skipdeps"
|
|
|
|
.if defined(BATCH) && !defined(IS_INTERACTIVE)
|
|
|
|
CONFIGURE_ENV+= PERL_MM_USE_DEFAULT="YES"
|
|
|
|
.endif # defined(BATCH) && !defined(IS_INTERACTIVE)
|
|
|
|
.endif # configure
|
|
|
|
|
|
|
|
.if ${_USE_PERL5:Mextract}
|
2016-03-27 03:23:25 +02:00
|
|
|
EXTRACT_DEPENDS+= ${PERL5_DEPEND}:lang/${PERL_PORT}
|
2013-07-31 08:29:25 +02:00
|
|
|
.endif
|
|
|
|
|
|
|
|
.if ${_USE_PERL5:Mpatch}
|
2016-03-27 03:23:25 +02:00
|
|
|
PATCH_DEPENDS+= ${PERL5_DEPEND}:lang/${PERL_PORT}
|
2013-07-31 08:29:25 +02:00
|
|
|
.endif
|
|
|
|
|
|
|
|
.if ${_USE_PERL5:Mbuild}
|
2016-03-27 03:23:25 +02:00
|
|
|
BUILD_DEPENDS+= ${PERL5_DEPEND}:lang/${PERL_PORT}
|
2013-07-31 08:29:25 +02:00
|
|
|
.endif
|
|
|
|
|
|
|
|
.if ${_USE_PERL5:Mrun}
|
2016-03-27 03:23:25 +02:00
|
|
|
RUN_DEPENDS+= ${PERL5_DEPEND}:lang/${PERL_PORT}
|
2013-07-31 08:29:25 +02:00
|
|
|
.endif
|
|
|
|
|
|
|
|
.if ${_USE_PERL5:Mconfigure}
|
|
|
|
CONFIGURE_ARGS+= CC="${CC}" CCFLAGS="${CFLAGS}" PREFIX="${PREFIX}" \
|
|
|
|
INSTALLPRIVLIB="${PREFIX}/lib" INSTALLARCHLIB="${PREFIX}/lib"
|
|
|
|
CONFIGURE_SCRIPT?= Makefile.PL
|
2014-12-23 02:42:10 +01:00
|
|
|
MAN3PREFIX?= ${PREFIX}/${SITE_PERL_REL}
|
2015-09-14 14:19:48 +02:00
|
|
|
.if !defined(THIS_IS_OLD_PERL)
|
|
|
|
MAN1PREFIX?= ${PREFIX}/${SITE_PERL_REL}
|
|
|
|
.endif
|
2013-07-31 08:29:25 +02:00
|
|
|
.undef HAS_CONFIGURE
|
|
|
|
|
|
|
|
.if !target(do-configure)
|
|
|
|
do-configure:
|
|
|
|
@if [ -f ${SCRIPTDIR}/configure ]; then \
|
2014-12-17 14:21:56 +01:00
|
|
|
cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} ${SH} \
|
|
|
|
${SCRIPTDIR}/configure; \
|
2013-07-31 08:29:25 +02:00
|
|
|
fi
|
|
|
|
@cd ${CONFIGURE_WRKSRC} && \
|
2014-12-17 14:21:56 +01:00
|
|
|
${SETENV} ${CONFIGURE_ENV} \
|
2016-04-13 12:36:15 +02:00
|
|
|
${PERL5} ${CONFIGURE_CMD} ${CONFIGURE_ARGS}
|
2013-09-04 18:54:39 +02:00
|
|
|
.if !${_USE_PERL5:Mmodbuild*}
|
2013-07-31 08:29:25 +02:00
|
|
|
@cd ${CONFIGURE_WRKSRC} && \
|
2014-12-17 14:21:56 +01:00
|
|
|
${PERL5} -pi -e 's/ doc_(perl|site|\$$\(INSTALLDIRS\))_install$$//' Makefile
|
2013-07-31 08:29:25 +02:00
|
|
|
.endif # ! modbuild
|
|
|
|
.endif # !target(do-configure)
|
|
|
|
.endif # configure
|
|
|
|
|
2013-09-04 18:54:39 +02:00
|
|
|
.if ${_USE_PERL5:Mmodbuild*}
|
2013-07-31 08:29:25 +02:00
|
|
|
.if !target(do-build)
|
|
|
|
do-build:
|
2013-10-19 21:11:19 +02:00
|
|
|
@(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${PERL5} ${PL_BUILD} ${ALL_TARGET} ${MAKE_ARGS})
|
2013-07-31 08:29:25 +02:00
|
|
|
.endif # !target(do-build)
|
|
|
|
|
|
|
|
.if !${USES:Mgmake}
|
|
|
|
.if !target(do-install)
|
|
|
|
do-install:
|
2013-10-19 21:11:19 +02:00
|
|
|
@(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${PERL5} ${PL_BUILD} ${INSTALL_TARGET} ${MAKE_ARGS})
|
2013-07-31 08:29:25 +02:00
|
|
|
.endif # !target(do-install)
|
|
|
|
.endif # ! USES=gmake
|
|
|
|
.endif # modbuild
|
2013-10-19 21:11:19 +02:00
|
|
|
|
2014-11-27 10:57:39 +01:00
|
|
|
PACKLIST_DIR?= ${PREFIX}/${SITE_ARCH_REL}/auto
|
|
|
|
|
2014-11-26 14:08:24 +01:00
|
|
|
# In all those, don't use - before the command so that the user does
|
|
|
|
# not wonder what has been ignored by this message "*** Error code 1 (ignored)"
|
Rewrite the target ordering code.
The targets now have priority assigned to them, and, when the dependency
ordering magic is done at the end of bsd.port.mk, they are sorted
according to their priority.
This allows USES to add targets easily and have them run whenever they
want without touching bsd.port.mk.
To add a target that runs just before post-configure run, do:
_USES_configure+= 695:my-post-configure
my-post-configure:
do something
To fine tune when the target is ran, look at the values in the *_SEQ
variables at the end of bsd.port.mk, and the other USES.
Allow ports Makefiles to override the priority of targets with the
TARGET_ORDER_OVERRIDE variable. For example, to get post-install
running earlier, (its default is 700) do:
TARGET_ORDER_OVERRIDE= 650:post-install
While there, add options target helpers for the do-* targets when they
exist.
Reviewed by: antoine, bapt
Exp-run by: antoine
Sponsored by: Absolight
Differential Revision: https://reviews.freebsd.org/D3099
2015-08-17 15:31:25 +02:00
|
|
|
_USES_install+= 560:fix-perl-things
|
2014-11-26 14:08:24 +01:00
|
|
|
fix-perl-things:
|
2014-11-27 10:57:39 +01:00
|
|
|
# Remove STAGEDIR from .packlist and add the file to the plist.
|
2014-11-27 11:04:47 +01:00
|
|
|
@(if [ -d ${STAGEDIR}${PACKLIST_DIR} ] ; then \
|
2014-12-16 13:06:40 +01:00
|
|
|
${FIND} ${STAGEDIR}${PACKLIST_DIR} -name .packlist | while read f ; do \
|
|
|
|
${SED} -i '' 's|^${STAGEDIR}||' "$$f"; \
|
|
|
|
${ECHO} $$f | ${SED} -e 's|^${STAGEDIR}||' >> ${TMPPLIST}; \
|
|
|
|
done \
|
2014-11-26 14:08:24 +01:00
|
|
|
fi) || :
|
2014-03-12 19:49:03 +01:00
|
|
|
|
2014-08-18 14:29:06 +02:00
|
|
|
# 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.
|
2014-08-18 14:45:10 +02:00
|
|
|
# Module::Build continues to install them, so remove the files unconditionally.
|
2014-11-26 14:08:24 +01:00
|
|
|
@${FIND} ${STAGEDIR} -name '*.bs' -size 0 -delete || :
|
|
|
|
|
|
|
|
# Some ports use their own way of building perl modules and generate
|
|
|
|
# perllocal.pod, remove it here so that those ports don't include it
|
|
|
|
# by mistake in their plists. It is sometime compressed, so use a
|
|
|
|
# shell glob for the removal. Also, remove the directories that
|
|
|
|
# contain it to not leave orphans directories around.
|
|
|
|
@${RM} -f ${STAGEDIR}${PREFIX}/lib/perl5/${PERL_VER}/${PERL_ARCH}/perllocal.pod* || :
|
|
|
|
@${RMDIR} -p ${STAGEDIR}${PREFIX}/lib/perl5/${PERL_VER}/${PERL_ARCH} 2>/dev/null || :
|
2016-05-30 17:33:44 +02:00
|
|
|
# Starting at ExtUtils::MakeMaker 7.06 and Perl 5.25.1, the base README.pod is
|
|
|
|
# no longer manified into a README.3, as the README.pod is installed and can be
|
|
|
|
# read with perldoc, remove the README.3 files that may be generated.
|
|
|
|
@[ -d "${STAGEDIR}${SITE_MAN3}" ] && \
|
|
|
|
${FIND} ${STAGEDIR}${SITE_MAN3} -name '*::README.3' -delete || :
|
2014-06-02 10:48:13 +02:00
|
|
|
|
2015-10-07 20:45:28 +02:00
|
|
|
.if !target(do-test) && (!empty(USE_PERL5:Mmodbuild*) || !empty(USE_PERL5:Mconfigure))
|
2014-03-12 19:49:03 +01:00
|
|
|
TEST_TARGET?= test
|
|
|
|
TEST_WRKSRC?= ${BUILD_WRKSRC}
|
Implemented complete support for test target.
You can now `make test' on any port to run test sequence, no-op by default.
If a port defines TEST_TARGET, it'll run sub-make with specified target,
usually `check' or `test', useful if upstream supports that. The port may
instead define custom do-test target, as well as usual satellite targets:
{pre,do,post}-test, {pre,do,post}-test-OPT, {pre,do,post}-test-OPT-off
`make test' builds and stages port first, so test may use both WRKDIR and
STAGEDIR, and both BUILD and RUN depends are available for test target.
Additionally, TEST_DEPENDS is now properly supported and may be used to
define additional depends specifically for testing.
Framework may define default tests for specific cases. For instance,
perl5.mk and cran.mk already provide default test target on their own.
This commit also converts my ports which have tests to this new framework.
Approved by: portmgr (bapt)
Differential Revision: D3680
2015-09-28 19:20:42 +02:00
|
|
|
do-test:
|
2014-03-12 19:49:03 +01:00
|
|
|
.if ${USE_PERL5:Mmodbuild*}
|
Implemented complete support for test target.
You can now `make test' on any port to run test sequence, no-op by default.
If a port defines TEST_TARGET, it'll run sub-make with specified target,
usually `check' or `test', useful if upstream supports that. The port may
instead define custom do-test target, as well as usual satellite targets:
{pre,do,post}-test, {pre,do,post}-test-OPT, {pre,do,post}-test-OPT-off
`make test' builds and stages port first, so test may use both WRKDIR and
STAGEDIR, and both BUILD and RUN depends are available for test target.
Additionally, TEST_DEPENDS is now properly supported and may be used to
define additional depends specifically for testing.
Framework may define default tests for specific cases. For instance,
perl5.mk and cran.mk already provide default test target on their own.
This commit also converts my ports which have tests to this new framework.
Approved by: portmgr (bapt)
Differential Revision: D3680
2015-09-28 19:20:42 +02:00
|
|
|
cd ${TEST_WRKSRC}/ && ${SETENV} ${TEST_ENV} ${PERL5} ${PL_BUILD} ${TEST_TARGET} ${TEST_ARGS}
|
2014-03-12 19:49:03 +01:00
|
|
|
.elif ${USE_PERL5:Mconfigure}
|
Implemented complete support for test target.
You can now `make test' on any port to run test sequence, no-op by default.
If a port defines TEST_TARGET, it'll run sub-make with specified target,
usually `check' or `test', useful if upstream supports that. The port may
instead define custom do-test target, as well as usual satellite targets:
{pre,do,post}-test, {pre,do,post}-test-OPT, {pre,do,post}-test-OPT-off
`make test' builds and stages port first, so test may use both WRKDIR and
STAGEDIR, and both BUILD and RUN depends are available for test target.
Additionally, TEST_DEPENDS is now properly supported and may be used to
define additional depends specifically for testing.
Framework may define default tests for specific cases. For instance,
perl5.mk and cran.mk already provide default test target on their own.
This commit also converts my ports which have tests to this new framework.
Approved by: portmgr (bapt)
Differential Revision: D3680
2015-09-28 19:20:42 +02:00
|
|
|
cd ${TEST_WRKSRC}/ && ${SETENV} ${TEST_ENV} ${MAKE_CMD} ${TEST_ARGS} ${TEST_TARGET}
|
2014-03-12 19:49:03 +01:00
|
|
|
.endif # USE_PERL5:Mmodbuild*
|
2015-10-03 19:06:52 +02:00
|
|
|
.endif # do-test
|
2013-07-31 08:29:25 +02:00
|
|
|
.endif # defined(_POSTMKINCLUDED)
|