2014-01-07 16:29:49 +00: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 19:19:00 +00:00
|
|
|
local perlprefix=${XBPS_STATEDIR}/perlprefix-${XBPS_TARGET_MACHINE}
|
|
|
|
mkdir -p $perlprefix
|
2017-09-25 14:57:31 +00:00
|
|
|
cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Config"*.p? $perlprefix
|
2016-08-29 14:23:26 +00:00
|
|
|
cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Errno.pm" $perlprefix
|
2016-08-14 19:19:00 +00:00
|
|
|
export PERL5LIB=$perlprefix
|
|
|
|
|
2015-02-24 09:05:08 +00: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 16:29:49 +00: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 09:31:06 +00: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 17:52:56 +00:00
|
|
|
LDFLAGS="$LDFLAGS -L${XBPS_CROSS_BASE}/usr/lib -lperl" \
|
2014-01-28 09:31:06 +00:00
|
|
|
LDDLFLAGS="-shared $CFLAGS -L${XBPS_CROSS_BASE}/usr/lib" \
|
2014-01-07 16:29:49 +00:00
|
|
|
perl Makefile.PL ${configure_args} INSTALLDIRS=vendor
|
|
|
|
fi
|
|
|
|
|
2015-02-24 09:05:08 +00:00
|
|
|
for i in ${perl_configure_dirs}; do
|
2014-01-07 16:29:49 +00:00
|
|
|
perlmkf="$wrksrc/$i/Makefile.PL"
|
|
|
|
if [ -f $perlmkf ]; then
|
|
|
|
cd $wrksrc/$i
|
2014-01-28 09:31:06 +00: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 17:52:56 +00:00
|
|
|
LDFLAGS="$LDFLAGS -L${XBPS_CROSS_BASE}/usr/lib -lperl" \
|
|
|
|
LDDLFLAGS="-shared $CFLAGS -L${XBPS_CROSS_BASE}/usr/lib -lperl" \
|
2014-01-07 16:29:49 +00:00
|
|
|
perl Makefile.PL ${make_build_args} INSTALLDIRS=vendor
|
|
|
|
else
|
|
|
|
msg_error "*** ERROR: couldn't find $perlmkf, aborting **\n"
|
|
|
|
fi
|
|
|
|
done
|
2015-02-24 09:05:08 +00:00
|
|
|
|
2014-01-07 16:29:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
do_build() {
|
|
|
|
: ${make_cmd:=make}
|
|
|
|
|
2014-01-28 09:31:06 +00:00
|
|
|
${make_cmd} CC="$CC" LD="$CC" CFLAGS="$CFLAGS" OPTIMIZE="$CFLAGS" \
|
2015-06-22 17:52:56 +00:00
|
|
|
LDFLAGS="$LDFLAGS -L${XBPS_CROSS_BASE}/usr/lib -lperl" \
|
|
|
|
LDDLFLAGS="-shared $CFLAGS -L${XBPS_CROSS_BASE}/usr/lib -lperl" \
|
2014-01-28 09:31:06 +00:00
|
|
|
${makejobs} ${make_build_args} ${make_build_target}
|
2014-01-07 16:29:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
do_install() {
|
|
|
|
: ${make_cmd:=make}
|
|
|
|
: ${make_install_target:=install}
|
|
|
|
|
2015-02-19 15:38:30 +00:00
|
|
|
${make_cmd} DESTDIR=${DESTDIR} ${make_install_args} ${make_install_target}
|
2014-01-07 16:29:49 +00:00
|
|
|
}
|