2014-01-07 17:29:49 +01:00
|
|
|
#
|
|
|
|
# This helper does the required steps to be able to build and install
|
|
|
|
# perl modules that use MakeMaker into the correct location.
|
|
|
|
#
|
|
|
|
# Required vars to be set by a template:
|
|
|
|
#
|
|
|
|
# build_style=perl-module
|
|
|
|
#
|
|
|
|
# Optionally if the module needs more directories to be configured other
|
|
|
|
# than $XBPS_BUILDDIR/$wrksrc, one can use (relative to $wrksrc):
|
|
|
|
#
|
|
|
|
# perl_configure_dirs="blob/bob foo/blah"
|
|
|
|
#
|
|
|
|
do_configure() {
|
|
|
|
local perlmkf
|
|
|
|
|
2016-08-14 21:19:00 +02:00
|
|
|
local perlprefix=${XBPS_STATEDIR}/perlprefix-${XBPS_TARGET_MACHINE}
|
|
|
|
mkdir -p $perlprefix
|
2017-09-25 16:57:31 +02:00
|
|
|
cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Config"*.p? $perlprefix
|
2016-08-29 16:23:26 +02:00
|
|
|
cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Errno.pm" $perlprefix
|
2016-08-14 21:19:00 +02:00
|
|
|
export PERL5LIB=$perlprefix
|
|
|
|
|
2015-02-24 10:05:08 +01:00
|
|
|
if [ -f ${wrksrc}/Makefile.PL ]; then
|
|
|
|
sed -i "s,/usr/include,${XBPS_CROSS_BASE}/usr/include,g" ${wrksrc}/Makefile.PL
|
|
|
|
fi
|
|
|
|
|
2014-01-07 17:29:49 +01:00
|
|
|
if [ -z "$perl_configure_dirs" ]; then
|
|
|
|
perlmkf="$wrksrc/Makefile.PL"
|
|
|
|
if [ ! -f $perlmkf ]; then
|
|
|
|
msg_error "*** ERROR couldn't find $perlmkf, aborting ***\n"
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd $wrksrc
|
2014-01-28 10:31:06 +01:00
|
|
|
PERL_MM_USE_DEFAULT=1 GCC="$CC" CC="$CC" LD="$CC" \
|
|
|
|
OPTIMIZE="$CFLAGS" \
|
|
|
|
CFLAGS="$CFLAGS -I${XBPS_CROSS_BASE}/usr/include" \
|
2015-06-22 19:52:56 +02:00
|
|
|
LDFLAGS="$LDFLAGS -L${XBPS_CROSS_BASE}/usr/lib -lperl" \
|
2014-01-28 10:31:06 +01:00
|
|
|
LDDLFLAGS="-shared $CFLAGS -L${XBPS_CROSS_BASE}/usr/lib" \
|
2014-01-07 17:29:49 +01:00
|
|
|
perl Makefile.PL ${configure_args} INSTALLDIRS=vendor
|
|
|
|
fi
|
|
|
|
|
2015-02-24 10:05:08 +01:00
|
|
|
for i in ${perl_configure_dirs}; do
|
2014-01-07 17:29:49 +01:00
|
|
|
perlmkf="$wrksrc/$i/Makefile.PL"
|
|
|
|
if [ -f $perlmkf ]; then
|
|
|
|
cd $wrksrc/$i
|
2014-01-28 10:31:06 +01:00
|
|
|
PERL_MM_USE_DEFAULT=1 GCC="$CC" CC="$CC" LD="$CC" \
|
|
|
|
OPTIMIZE="$CFLAGS" \
|
|
|
|
CFLAGS="$CFLAGS -I${XBPS_CROSS_BASE}/usr/include" \
|
2015-06-22 19:52:56 +02:00
|
|
|
LDFLAGS="$LDFLAGS -L${XBPS_CROSS_BASE}/usr/lib -lperl" \
|
|
|
|
LDDLFLAGS="-shared $CFLAGS -L${XBPS_CROSS_BASE}/usr/lib -lperl" \
|
2014-01-07 17:29:49 +01:00
|
|
|
perl Makefile.PL ${make_build_args} INSTALLDIRS=vendor
|
|
|
|
else
|
|
|
|
msg_error "*** ERROR: couldn't find $perlmkf, aborting **\n"
|
|
|
|
fi
|
|
|
|
done
|
2015-02-24 10:05:08 +01:00
|
|
|
|
2014-01-07 17:29:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
do_build() {
|
|
|
|
: ${make_cmd:=make}
|
|
|
|
|
2014-01-28 10:31:06 +01:00
|
|
|
${make_cmd} CC="$CC" LD="$CC" CFLAGS="$CFLAGS" OPTIMIZE="$CFLAGS" \
|
2015-06-22 19:52:56 +02:00
|
|
|
LDFLAGS="$LDFLAGS -L${XBPS_CROSS_BASE}/usr/lib -lperl" \
|
|
|
|
LDDLFLAGS="-shared $CFLAGS -L${XBPS_CROSS_BASE}/usr/lib -lperl" \
|
2014-01-28 10:31:06 +01:00
|
|
|
${makejobs} ${make_build_args} ${make_build_target}
|
2014-01-07 17:29:49 +01:00
|
|
|
}
|
|
|
|
|
2017-11-20 04:27:25 +01:00
|
|
|
do_check() {
|
|
|
|
: ${make_cmd:=make}
|
|
|
|
: ${make_check_target:=test}
|
|
|
|
|
|
|
|
${make_cmd} ${make_check_args} ${make_check_target}
|
|
|
|
}
|
|
|
|
|
2014-01-07 17:29:49 +01:00
|
|
|
do_install() {
|
|
|
|
: ${make_cmd:=make}
|
|
|
|
: ${make_install_target:=install}
|
|
|
|
|
2015-02-19 16:38:30 +01:00
|
|
|
${make_cmd} DESTDIR=${DESTDIR} ${make_install_args} ${make_install_target}
|
2014-01-07 17:29:49 +01:00
|
|
|
}
|