perl: rebuild for -dbg pkg; cross build support.

This commit is contained in:
Juan RP 2013-02-24 13:11:35 +01:00
parent 40ab3af9e9
commit 77b6c279b9
8 changed files with 6468 additions and 31 deletions

View File

@ -0,0 +1,117 @@
#!/bin/sh
: script used to extract .SH files with variable substitutions
mkdir -p UU
cd UU
cat >extract <<'EOS'
PERL_CONFIG_SH=true
echo "Doing variable substitutions on .SH files..."
if test -f MANIFEST; then
set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
else
echo "(Looking for .SH files under the source directory.)"
set x `(cd "$src"; find . -name "*.SH" -print)`
fi
shift
case $# in
0) set x `(cd "$src"; echo *.SH)`; shift;;
esac
if test ! -f "$src/$1"; then
shift
fi
mkdir_p='
name=$1;
create="";
while test $name; do
if test ! -d "$name"; then
create="$name $create";
name=`echo $name | sed -e "s|^[^/]*$||"`;
name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
else
name="";
fi;
done;
for file in $create; do
mkdir $file;
done
'
for file in $*; do
case "$src" in
".")
case "$file" in
*/*)
dir=`expr X$file : 'X\(.*\)/'`
file=`expr X$file : 'X.*/\(.*\)'`
(cd "$dir" && . ./$file)
;;
*)
. ./$file
;;
esac
;;
*)
case "$file" in
*/*)
dir=`expr X$file : 'X\(.*\)/'`
file=`expr X$file : 'X.*/\(.*\)'`
(set x $dir; shift; eval $mkdir_p)
sh <"$src/$dir/$file"
;;
*)
sh <"$src/$file"
;;
esac
;;
esac
done
if test -f "$src/config_h.SH"; then
if test ! -f config.h; then
: oops, they left it out of MANIFEST, probably, so do it anyway.
. "$src/config_h.SH"
fi
fi
EOS
cd ..
# For now
make=make
echo "Run a copy of the end of Configure"
: if this fails, just run all the .SH files by hand
. ./config.sh
echo " "
pwd=`pwd`
. ./UU/extract
cd "$pwd"
echo "Run $make depend unconditionally"
$make depend && echo "Now you must run '$make'."
if $test -f Policy.sh; then
$cat <<EOM
If you compile $package on a different machine or from a different object
directory, copy the Policy.sh file from this object directory to the
new one before you run Configure -- this will help you with most of
the policy defaults.
EOM
fi
if $test -f config.msg; then
echo "Hmm. I also noted the following information while running:"
echo " "
$cat config.msg >&4
$rm -f config.msg
fi
$rm -f kit*isdone ark*isdone
$rm -rf UU
: End of Configure

View File

@ -0,0 +1,18 @@
{
0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4,
1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,299 @@
{
/* sv '\0' Special scalar variable */
want_vtbl_sv | PERL_MAGIC_READONLY_ACCEPTABLE,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
/* arylen '#' Array length ($#ary) */
want_vtbl_arylen | PERL_MAGIC_VALUE_MAGIC,
0,
/* rhash '%' extra data for restricted hashes */
magic_vtable_max | PERL_MAGIC_VALUE_MAGIC,
0,
0,
0,
0,
0,
0,
0,
0,
/* pos '.' pos() lvalue */
want_vtbl_pos | PERL_MAGIC_VALUE_MAGIC,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
/* symtab ':' extra data for symbol tables */
magic_vtable_max | PERL_MAGIC_VALUE_MAGIC,
0,
/* backref '<' for weak ref data */
want_vtbl_backref | PERL_MAGIC_READONLY_ACCEPTABLE | PERL_MAGIC_VALUE_MAGIC,
0,
0,
0,
/* arylen_p '@' to move arylen out of XPVAV */
magic_vtable_max | PERL_MAGIC_VALUE_MAGIC,
/* overload 'A' %OVERLOAD hash */
want_vtbl_amagic,
/* bm 'B' Boyer-Moore (fast string search) */
want_vtbl_regexp | PERL_MAGIC_READONLY_ACCEPTABLE | PERL_MAGIC_VALUE_MAGIC,
0,
/* regdata 'D' Regex match position data (@+ and @- vars) */
want_vtbl_regdata,
/* env 'E' %ENV hash */
want_vtbl_env,
0,
/* study 'G' study()ed string */
want_vtbl_regexp | PERL_MAGIC_READONLY_ACCEPTABLE | PERL_MAGIC_VALUE_MAGIC,
/* hints 'H' %^H hash */
want_vtbl_hints,
/* isa 'I' @ISA array */
want_vtbl_isa,
0,
0,
/* dbfile 'L' Debugger %_<filename */
magic_vtable_max,
0,
0,
0,
/* tied 'P' Tied array or hash */
want_vtbl_pack | PERL_MAGIC_VALUE_MAGIC,
0,
0,
/* sig 'S' %SIG hash */
magic_vtable_max,
0,
/* uvar 'U' Available for use by extensions */
want_vtbl_uvar,
/* vstring 'V' SV was vstring literal */
want_vtbl_vstring | PERL_MAGIC_VALUE_MAGIC,
0,
0,
0,
0,
0,
0,
/* checkcall ']' inlining/mutation of call to this CV */
magic_vtable_max | PERL_MAGIC_VALUE_MAGIC,
0,
0,
0,
/* overload_elem 'a' %OVERLOAD hash element */
want_vtbl_amagicelem,
0,
/* overload_table 'c' Holds overload table (AMT) on stash */
want_vtbl_ovrld,
/* regdatum 'd' Regex match position data element */
want_vtbl_regdatum,
/* envelem 'e' %ENV hash element */
want_vtbl_envelem,
/* fm 'f' Formline ('compiled' format) */
want_vtbl_regdata | PERL_MAGIC_READONLY_ACCEPTABLE | PERL_MAGIC_VALUE_MAGIC,
/* regex_global 'g' m//g target */
want_vtbl_mglob | PERL_MAGIC_READONLY_ACCEPTABLE | PERL_MAGIC_VALUE_MAGIC,
/* hintselem 'h' %^H hash element */
want_vtbl_hintselem,
/* isaelem 'i' @ISA array element */
want_vtbl_isaelem,
0,
/* nkeys 'k' scalar(keys()) lvalue */
want_vtbl_nkeys | PERL_MAGIC_VALUE_MAGIC,
/* dbline 'l' Debugger %_<filename element */
want_vtbl_dbline,
0,
0,
/* collxfrm 'o' Locale transformation */
want_vtbl_collxfrm | PERL_MAGIC_VALUE_MAGIC,
/* tiedelem 'p' Tied array or hash element */
want_vtbl_packelem,
/* tiedscalar 'q' Tied scalar or handle */
want_vtbl_packelem,
/* qr 'r' precompiled qr// regex */
want_vtbl_regexp | PERL_MAGIC_VALUE_MAGIC,
/* sigelem 's' %SIG hash element */
want_vtbl_sigelem,
/* taint 't' Taintedness */
want_vtbl_taint | PERL_MAGIC_VALUE_MAGIC,
0,
/* vec 'v' vec() lvalue */
want_vtbl_vec | PERL_MAGIC_VALUE_MAGIC,
/* utf8 'w' Cached UTF-8 information */
want_vtbl_utf8 | PERL_MAGIC_VALUE_MAGIC,
/* substr 'x' substr() lvalue */
want_vtbl_substr | PERL_MAGIC_VALUE_MAGIC,
/* defelem 'y' Shadow "foreach" iterator variable / smart parameter vivification */
want_vtbl_defelem | PERL_MAGIC_VALUE_MAGIC,
0,
0,
0,
0,
/* ext '~' Available for use by extensions */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 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
}

View File

@ -0,0 +1,83 @@
--- Makefile.SH.orig 2013-02-23 12:44:25.420587388 +0100
+++ Makefile.SH 2013-02-23 12:51:32.923426243 +0100
@@ -302,10 +302,12 @@ LIB_EXT = $_a
OBJ_EXT = $_o
PATH_SEP = $p_
+ifeq (,\$(CROSS_PERL))
# Macros to invoke a copy of miniperl during the build. Targets which
# are built using these macros should depend on \$(MINIPERL_EXE)
MINIPERL_EXE = miniperl\$(EXE_EXT)
MINIPERL = \$(LDLIBPTH) \$(RUN) ./miniperl\$(EXE_EXT) -Ilib
+HOST_MINIPERL = $(MINIPERL_EXE)
# Macros to invoke a copy of our fully operational perl during the build.
PERL_EXE = perl\$(EXE_EXT)
@@ -314,6 +316,23 @@ RUN_PERL = \$(LDLIBPTH) \$(RUN) ./perl\$
# Macros to run our tests
RUN_TESTS = \$(LDLIBPTH) ./runtests
+else # CROSS_PERL
+
+# Macros to invoke a copy of miniperl during the build. Targets which
+# are built using these macros should depend on \$(MINIPERL_EXE)
+MINIPERL_EXE = miniperl\$(EXE_EXT)
+MINIPERL = \$(CROSS_PERL)
+HOST_MINIPERL = \$(CROSS_PERL)
+
+# Macros to invoke a copy of our fully operational perl during the build.
+PERL_EXE = perl\$(EXE_EXT)
+RUN_PERL = \$(CROSS_PERL)
+
+# Macros to run our tests
+RUN_TESTS = echo "Not running tests"
+
+endif # CROSS_PERL
+
dynamic_ext = $dynamic_list
dynamic_ext_re = $dynamic_ext_re
static_ext = $static_list
@@ -559,6 +578,9 @@ all: $(FIRSTMAKEFILE) $(MINIPERL_EXE) $(
@echo " ";
@echo " Everything is up to date. Type '$(MAKE) test' to run test suite."
+# Cross building requires a separate target to allow manipulation of the build tree
+extensions: $(dynamic_ext) $(nonxs_ext)
+
.PHONY: all translators utilities
# Both git_version.h and lib/Config_git.pl are built
@@ -649,6 +671,9 @@ $spitshell >>$Makefile <<'!NO!SUBS!'
globals$(OBJ_EXT): $(generated_headers)
+ifeq (,$(CROSS_PERL))
+# If we're cross-building, we should have uudmap.h and bitcount.h
+# provided already
uudmap.h mg_data.h: bitcount.h
bitcount.h: generate_uudmap$(HOST_EXE_EXT)
@@ -658,6 +683,7 @@ generate_uudmap$(OBJ_EXT): mg_raw.h
generate_uudmap$(HOST_EXE_EXT): generate_uudmap$(OBJ_EXT)
$(CC) -o generate_uudmap$(EXE_EXT) $(LDFLAGS) generate_uudmap$(OBJ_EXT) $(libs)
+endif
miniperlmain$(OBJ_EXT): miniperlmain.c patchlevel.h
$(CCCMD) $(PLDLFLAGS) $*.c
@@ -869,9 +895,15 @@ $(MINIPERL_EXE): $& $(mini_obj)
$spitshell >>$Makefile <<'!NO!SUBS!'
$(MINIPERL_EXE): $& $(mini_obj)
-@rm -f miniperl.xok
+ifeq (,$(CROSS_PERL))
$(LDLIBPTH) $(CC) $(CLDFLAGS) -o $(MINIPERL_EXE) \
$(mini_obj) $(libs)
$(LDLIBPTH) $(RUN) ./miniperl$(HOST_EXE_EXT) -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
+else
+ -rm $(MINIPERL_EXE)
+ ln -s $(HOST_MINIPERL) $(MINIPERL_EXE)
+endif
+
!NO!SUBS!
;;
esac

View File

@ -1,24 +1,14 @@
# Template build file for 'perl'.
pkgname=perl
version=5.16.2
revision=1
makedepends="gdbm-devel db-devel less groff"
revision=2
makedepends="which gdbm-devel db-devel less groff"
short_desc="Practical Extraction and Report Language"
maintainer="Juan RP <xtraeme@gmail.com>"
homepage="http://www.perl.org"
license="GPL-2"
distfiles="http://www.cpan.org/src/5.0/perl-${version}.tar.bz2"
checksum=5ba91d9aa40220c615b644bb48fa5df7fbca4afb1c9e911bdc0ce2a93f072d7d
long_desc="
Perl is a general-purpose programming language originally developed
for text manipulation and now used for a wide range of tasks including
system administration, web development, network programming, GUI
development, and more. The language is intended to be practical (easy
to use, efficient, complete) rather than beautiful (tiny, elegant,
minimal). Its major features are that it's easy to use, supports both
procedural and object-oriented (OO) programming, has powerful built-in
support for text processing, and has one of the world's most impressive
collections of third-party modules."
# Before updating this package to a new major version, run ${FILESDIR}/provides.pl
# against ${wrksrc} to find the list of built in packages.
@ -161,29 +151,78 @@ for _f in ${_provides}; do
replaces="${replaces} ${_p}>=0"
done
do_build() {
./Configure \
-des -Dusethreads -Duseshrplib \
-Dinstallprefix=/usr \
-Dprefix=/usr -Dvendorprefix=/usr \
-Dprivlib=/usr/share/perl5/core_perl \
-Darchlib=/usr/lib/perl5/core_perl \
-Dsitelib=/usr/share/perl5/site_perl \
-Dsitearch=/usr/lib/perl5/site_perl \
-Dvendorlib=/usr/share/perl5/vendor_perl \
-Dvendorarch=/usr/lib/perl5/vendor_perl \
-Dscriptdir=/usr/lib/perl5/core_perl/bin \
-Dsitescript=/usr/lib/perl5/site_perl/bin \
-Dvendorscript=/usr/lib/perl5/vendor_perl/bin \
-Dinc_version_list=none -Dman1ext=1p -Dman3ext=3p \
-Dcccdlflags="-fPIC" -Doptimize="${XBPS_CFLAGS}"
if [ -n "$XBPS_CROSS_TRIPLET" ]; then
makedepends="perl>=${version} which less groff"
crossmakedepends="zlib-devel bzip2-devel db-devel gdbm-devel"
fi
make ${makejobs}
do_configure() {
local _args="-Dusethreads -Duseshrplib
-Dprefix=/usr -Dvendorprefix=/usr
-Dprivlib=/usr/share/perl5/core_perl
-Darchlib=/usr/lib/perl5/core_perl
-Dsitelib=/usr/share/perl5/site_perl
-Dsitearch=/usr/lib/perl5/site_perl
-Dvendorlib=/usr/share/perl5/vendor_perl
-Dvendorarch=/usr/lib/perl5/vendor_perl
-Dscriptdir=/usr/lib/perl5/core_perl/bin
-Dvendorscript=/usr/lib/perl5/vendor_perl/bin
-Dinc_version_list=none -Dman1ext=1p -Dman3ext=3p"
if [ -n "$XBPS_CROSS_TRIPLET" ]; then
# Copy target files
cp -f ${FILESDIR}/${XBPS_CROSS_TRIPLET}/* .
cp -f ${FILESDIR}/Configure.cross .
sh ./Configure.cross
perl -Ilib make_patchnum.pl
else
./Configure -des ${_args} \
-Dcccdlflags="-fPIC" \
-Doptimize="${XBPS_CFLAGS}"
fi
}
do_build() {
if [ -n "$XBPS_CROSS_TRIPLET" ]; then
export HOST_PERL=/usr/bin/perl
export PERL_TO_USE=$HOST_PERL
export HOST_PERL_LIBS=/usr/lib/perl5/core_perl
export LIB=/usr/$XBPS_CROSS_TRIPLET/lib
export INCLUDE=/usr/$XBPS_CROSS_TRIPLET/include
make SHRPLDFLAGS='-shared -Wl,-soname,libperl.so' \
CROSS_PERL=$HOST_PERL libperl.so ${makejobs}
cp -fr $HOST_PERL_LIBS/auto/* lib/auto/
mkdir -p lib/$XBPS_CROSS_TRIPLET
make extensions CROSS_PERL=$HOST_PERL \
INST_ARCHLIB=$wrksrc/lib/$XBPS_CROSS_TRIPLET \
${makejobs}
else
make ${makejobs}
fi
}
do_install() {
# We use the same defaults than Arch Linux.
make DESTDIR=${DESTDIR} install
if [ -n "$XBPS_CROSS_TRIPLET" ]; then
export HOST_PERL=/usr/bin/perl
export PERL_TO_USE=$HOST_PERL
export HOST_PERL_LIBS=/usr/lib/perl5/core_perl
export LIB=/usr/$XBPS_CROSS_TRIPLET/lib
export INCLUDE=/usr/$XBPS_CROSS_TRIPLET/include
cp -fr $HOST_PERL_LIBS/auto/* lib/auto/
make CROSS_PERL=$HOST_PERL DESTDIR=$DESTDIR install
find lib/auto -name .exists -o -name '*.bs' | xargs rm -f
vmkdir usr/lib/perl5/core_perl/auto
cp -fr lib/$XBPS_CROSS_TRIPLET/auto/* \
${DESTDIR}/usr/lib/perl5/core_perl/auto/
find ${DESTDIR} -name .exists |xargs rm -f
rm -rf ${DESTDIR}/usr/share/perl5/core_perl/$XBPS_CROSS_TRIPLET
else
# We use the same defaults than Arch Linux.
make DESTDIR=${DESTDIR} install
fi
# Make a link from perl${version} to perl.
cd ${DESTDIR}/usr/bin && ln -sf perl${version} perl