Merge pull request #84 from Naoir/perl
perl: Import from oldpackages, update to latest upstream, fix building, add myself as maintainer
This commit is contained in:
commit
cc4c8fb327
18 changed files with 11064 additions and 0 deletions
194
lang/perl/Makefile
Normal file
194
lang/perl/Makefile
Normal file
|
@ -0,0 +1,194 @@
|
|||
#
|
||||
# Copyright (C) 2006-2014 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=perl
|
||||
PKG_VERSION:=5.20.0
|
||||
PKG_RELEASE:=1
|
||||
PKG_MD5SUM:=406ec049ebe3afcc80d9c76ec78ca4f8
|
||||
|
||||
PKG_SOURCE_URL:=ftp://ftp.cpan.org/pub/CPAN/src/5.0 \
|
||||
http://www.cpan.org/src/5.0/perl-5.20.0.tar.gz \
|
||||
ftp://ftp.mpi-sb.mpg.de/pub/perl/CPAN/src/5.0 \
|
||||
http://ftp.mpi-sb.mpg.de/pub/perl/CPAN/src/5.0 \
|
||||
ftp://ftp.gmd.de/mirrors/CPAN/src/5.0 \
|
||||
http://ftp5.gwdg.de/pub/languages/perl/CPAN/src/ \
|
||||
ftp://ftp.funet.fi/pub/languages/perl/CPAN/src/5.0 \
|
||||
http://ftp.funet.fi/pub/languages/perl/CPAN/src/5.0
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
|
||||
PKG_LICENSE:=GPLv1 ARTISTIC
|
||||
PKG_LICENSE_FILES:=Copying Artistic README
|
||||
PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/perl/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
ifneq ($(CONFIG_USE_EGLIBC),)
|
||||
EXTRA_LIBS:=bsd
|
||||
EXTRA_LIBDIRS:=$(STAGING_DIR)/lib
|
||||
endif
|
||||
|
||||
define Package/perl/Default
|
||||
SUBMENU:=Perl
|
||||
SECTION:=lang
|
||||
CATEGORY:=Languages
|
||||
TITLE:=The Perl intepreter
|
||||
URL:=http://www.perl.com/
|
||||
DEPENDS:=+USE_EGLIBC:libbsd
|
||||
endef
|
||||
|
||||
define Package/microperl
|
||||
$(call Package/perl/Default)
|
||||
TITLE+=(minimal version)
|
||||
endef
|
||||
|
||||
define Package/microperl/description
|
||||
A perl package without operating-specific functions such as readdir.
|
||||
endef
|
||||
|
||||
define Build/Template
|
||||
|
||||
$(STAMP_CONFIGURED)-$(1): $(STAMP_PREPARED)
|
||||
-$(MAKE) -C $(PKG_BUILD_DIR) clean
|
||||
$(call Build/$(1)/Configure)
|
||||
touch $$@
|
||||
|
||||
$(STAMP_BUILT)-$(1): $(STAMP_CONFIGURED)-$(1)
|
||||
$(call Build/$(1)/Compile)
|
||||
touch $$@
|
||||
|
||||
$(STAMP_BUILT): $(STAMP_BUILT)-$(1)
|
||||
|
||||
endef
|
||||
|
||||
define Build/microperl/Configure
|
||||
endef
|
||||
|
||||
define Build/microperl/Compile
|
||||
+$(MAKE) $(MAKE_J) -C $(PKG_BUILD_DIR) -f Makefile.micro \
|
||||
CC="gcc" ugenerate_uudmap
|
||||
+$(MAKE) $(MAKE_J) -C $(PKG_BUILD_DIR) -f Makefile.micro \
|
||||
CC="$(TARGET_CC)" OPTIMIZE="$(TARGET_CFLAGS)"
|
||||
$(INSTALL_DIR) $(PKG_INSTALL_DIR)/usr/bin/
|
||||
$(CP) $(PKG_BUILD_DIR)/microperl $(PKG_INSTALL_DIR)/usr/bin/
|
||||
endef
|
||||
|
||||
define Package/microperl/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/microperl $(1)/usr/bin/
|
||||
endef
|
||||
|
||||
include perlmod.mk
|
||||
|
||||
define Package/perl
|
||||
$(call Package/perl/Default)
|
||||
endef
|
||||
|
||||
define Package/perl/description
|
||||
Perl is a stable, cross platform programming language.
|
||||
It is used for mission critical projects in the public and private sectors
|
||||
and is widely used to program web applications of all needs.
|
||||
endef
|
||||
|
||||
define Build/perl/Configure
|
||||
@echo
|
||||
@echo "===> Stage 1: Configure host perl"
|
||||
@echo
|
||||
mkdir -p $(PKG_BUILD_DIR)/host-perl
|
||||
(cd $(PKG_BUILD_DIR)/host-perl && sh ../Configure -der -Dmksymlinks -Uusedl -Dotherlibdirs=$(PERL_LIB))
|
||||
|
||||
@echo
|
||||
@echo "===> Stage 2: Build host perl binary with static extensions"
|
||||
@echo
|
||||
+$(MAKE) $(MAKE_J) -C $(PKG_BUILD_DIR)/host-perl miniperl
|
||||
|
||||
@echo
|
||||
@echo "===> Stage 3: Configure target perl"
|
||||
@echo
|
||||
-$(MAKE) -C $(PKG_BUILD_DIR) clean
|
||||
sed \
|
||||
-e 's!%%CC%%!$(TARGET_CC)!g' \
|
||||
-e 's!%%CFLAGS%%!$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)!g' \
|
||||
-e 's!%%CPP%%!$(TARGET_CROSS)gcc -E!g' \
|
||||
-e 's!%%AR%%!$(TARGET_CROSS)ar!g' \
|
||||
-e 's!%%LD%%!$(TARGET_CROSS)gcc!g' \
|
||||
-e 's!%%LDFLAGS%%!-rdynamic $(TARGET_LDFLAGS)!g' \
|
||||
-e 's!%%LIBDIRS%%!$(STAGING_DIR)/lib $(STAGING_DIR)/usr/lib!g' \
|
||||
-e 's!%%INCDIRS%%!$(STAGING_DIR)/include $(STAGING_DIR)/usr/include!g' \
|
||||
-e 's!%%EXTRA_PERLLIBS%%!$(EXTRA_LIBS:%=-l%)!g' \
|
||||
-e 's!%%EXTRA_PERLLIBDIRS%%!$(EXTRA_LIBDIRS:%=-L%)!g' \
|
||||
-e 's!%%IPV6%%!$(if $($(CONFIG_IPV6)),define,undef)!g' \
|
||||
-e 's!%%HOSTMINIPERL%%!$(PKG_BUILD_DIR)/host-perl/miniperl!g' \
|
||||
-e 's!%%HOSTGENERATE%%!$(PKG_BUILD_DIR)/host-perl/generate_uudmap!g' \
|
||||
files/config.sh-$(patsubst i386,i486,$(ARCH)).in \
|
||||
> $(PKG_BUILD_DIR)/config.sh
|
||||
(cd $(PKG_BUILD_DIR) && ./Configure -S)
|
||||
endef
|
||||
|
||||
define Build/perl/Compile
|
||||
@echo
|
||||
@echo "===> Stage 4: Build target perl binary"
|
||||
@echo
|
||||
install -m 0644 $(PKG_BUILD_DIR)/config.h $(PKG_BUILD_DIR)/xconfig.h
|
||||
+$(MAKE) $(MAKE_J) -C $(PKG_BUILD_DIR) perl
|
||||
mkdir -p $(PKG_BUILD_DIR)/target-bin
|
||||
install -m 0755 $(PKG_BUILD_DIR)/perl $(PKG_BUILD_DIR)/target-bin/
|
||||
|
||||
@echo
|
||||
@echo "===> Stage 5: Build target extensions and utils"
|
||||
@echo
|
||||
+$(MAKE) $(MAKE_J) -C $(PKG_BUILD_DIR)
|
||||
|
||||
@echo
|
||||
@echo "===> Stage 6: Install Perl into staging dir"
|
||||
@echo
|
||||
(cd $(PKG_BUILD_DIR) && ./miniperl installperl --destdir=$(STAGING_DIR))
|
||||
|
||||
@echo
|
||||
@echo "===> Stage 7: Install Perl into a temporary root"
|
||||
@echo
|
||||
mkdir -p $(PKG_INSTALL_DIR)
|
||||
(cd $(PKG_BUILD_DIR) && ./miniperl installperl --destdir=$(PKG_INSTALL_DIR))
|
||||
endef
|
||||
|
||||
define Package/perl/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/perl$(PKG_VERSION) $(1)/usr/bin
|
||||
ln -nsf perl$(PKG_VERSION) $(1)/usr/bin/perl
|
||||
endef
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_microperl),)
|
||||
define Build/microperl
|
||||
$(call Build/Template,microperl)
|
||||
endef
|
||||
endif
|
||||
$(eval $(Build/microperl))
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_perl),)
|
||||
define Build/perl
|
||||
$(call Build/Template,perl)
|
||||
endef
|
||||
endif
|
||||
$(eval $(Build/perl))
|
||||
|
||||
define Build/Configure
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
$(eval $(call RequireCommand,rsync, \
|
||||
$(PKG_NAME) requires rsync installed on the host-system. \
|
||||
))
|
||||
|
||||
$(eval $(call BuildPackage,microperl))
|
||||
$(eval $(call BuildPackage,perl))
|
||||
|
||||
-include perlbase.mk
|
1083
lang/perl/files/Module/ScanDeps.pm
Normal file
1083
lang/perl/files/Module/ScanDeps.pm
Normal file
File diff suppressed because it is too large
Load diff
1162
lang/perl/files/config.sh-arm.in
Normal file
1162
lang/perl/files/config.sh-arm.in
Normal file
File diff suppressed because it is too large
Load diff
1162
lang/perl/files/config.sh-armeb.in
Normal file
1162
lang/perl/files/config.sh-armeb.in
Normal file
File diff suppressed because it is too large
Load diff
1164
lang/perl/files/config.sh-avr32.in
Normal file
1164
lang/perl/files/config.sh-avr32.in
Normal file
File diff suppressed because it is too large
Load diff
1147
lang/perl/files/config.sh-i486.in
Normal file
1147
lang/perl/files/config.sh-i486.in
Normal file
File diff suppressed because it is too large
Load diff
1162
lang/perl/files/config.sh-mips.in
Normal file
1162
lang/perl/files/config.sh-mips.in
Normal file
File diff suppressed because it is too large
Load diff
1147
lang/perl/files/config.sh-mipsel.in
Normal file
1147
lang/perl/files/config.sh-mipsel.in
Normal file
File diff suppressed because it is too large
Load diff
1162
lang/perl/files/config.sh-powerpc.in
Normal file
1162
lang/perl/files/config.sh-powerpc.in
Normal file
File diff suppressed because it is too large
Load diff
81
lang/perl/files/perlmod-deps.sh
Normal file
81
lang/perl/files/perlmod-deps.sh
Normal file
|
@ -0,0 +1,81 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Generate perl module package dependencies
|
||||
#
|
||||
# Copyright (C) 2007 Peter Colberg <peter@petercolberg.org>
|
||||
# Licensed under the terms of the GNU General Public License.
|
||||
#
|
||||
|
||||
if [ $# -lt 3 ]; then
|
||||
echo >&2 "Usage: $(basename $0) STAGING-DIR PERL-BUILD-DIR [FILES...] [DIRECTORIES...]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
STAGING_DIR="$1"
|
||||
PERL_BIN="$STAGING_DIR/usr/bin/perl"
|
||||
PERL_LIB="$STAGING_DIR/usr/lib/perl5/5.10"
|
||||
INC_DIR="$(dirname $0)"
|
||||
shift
|
||||
|
||||
"$PERL_BIN" -I"$INC_DIR" -I"$PERL_LIB" - "$@" <<'PERL_SCRIPT'
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Module::ScanDeps;
|
||||
use File::Find;
|
||||
use Cwd;
|
||||
|
||||
our $sitelib = "/usr/lib/perl5/5.10";
|
||||
|
||||
sub scandeps {
|
||||
my $builddir = Cwd::abs_path(shift);
|
||||
my @scanpaths = @_;
|
||||
my ($curdir, @pkgdirs, $dir, @deps, %depends, $file);
|
||||
our ($pkg, %bundles, $path, @files);
|
||||
|
||||
@pkgdirs = glob($builddir . "/*/ipkg");
|
||||
$curdir = getcwd();
|
||||
@INC = ();
|
||||
for $dir (@pkgdirs) {
|
||||
chdir($dir) or die "$dir: $!";
|
||||
for $pkg (glob("*")) {
|
||||
chdir($dir . "/" . $pkg . $sitelib) or next;
|
||||
push @INC, getcwd();
|
||||
sub wanted {
|
||||
return unless (-f $_);
|
||||
s/^\.\///;
|
||||
$bundles{$_} = $pkg;
|
||||
}
|
||||
find({ wanted => \&wanted, no_chdir => 1 }, ".");
|
||||
}
|
||||
}
|
||||
chdir($curdir) or die "$curdir: $!\n";
|
||||
|
||||
for $path (@scanpaths) {
|
||||
sub scan_wanted {
|
||||
return unless (-f $_ and /\.(pl|pm)$/);
|
||||
push @files, $_;
|
||||
}
|
||||
if (-f $path) {
|
||||
push @files, $path;
|
||||
}
|
||||
elsif (-d $path) {
|
||||
find({ wanted => \&scan_wanted, no_chdir => 1 }, $path);
|
||||
}
|
||||
}
|
||||
|
||||
@deps = keys %{scan_deps(files => \@files, recurse => 0)};
|
||||
for $file (grep { not exists $bundles{$_} } @deps) {
|
||||
warn "could not resolve dependency: $file\n";
|
||||
}
|
||||
%depends = map { $bundles{$_}, 1 } grep { exists $bundles{$_} } @deps;
|
||||
|
||||
if (%depends) {
|
||||
print join(' ', 'perl', sort keys %depends), "\n";
|
||||
}
|
||||
}
|
||||
|
||||
if (@ARGV > 1) {
|
||||
scandeps(@ARGV);
|
||||
}
|
||||
PERL_SCRIPT
|
176
lang/perl/files/scan-perlbase.sh
Normal file
176
lang/perl/files/scan-perlbase.sh
Normal file
|
@ -0,0 +1,176 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Generate perl base modules package definitions
|
||||
#
|
||||
# Copyright (C) 2007 Peter Colberg <peter@petercolberg.org>
|
||||
# Licensed under the terms of the GNU General Public License.
|
||||
#
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo >&2 "Usage: $(basename $0) STAGING-DIR [OUTFILE]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
STAGING_DIR="$1"
|
||||
PERL_BIN="$STAGING_DIR/usr/bin/perl"
|
||||
PERL_LIB="$STAGING_DIR/usr/lib/perl5/5.10"
|
||||
INC_DIR="$(dirname $0)"
|
||||
shift
|
||||
|
||||
"$PERL_BIN" -I"$INC_DIR" -I"$PERL_LIB" - "$PERL_LIB" "$@" <<'PERL_SCRIPT'
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Module::ScanDeps;
|
||||
use File::Find;
|
||||
use File::Basename;
|
||||
|
||||
our $skipfiles = 'CORE vmsish.pm auto/sdbm';
|
||||
|
||||
our %defmodules = (
|
||||
'essential' => 'lib.pm vars.pm strict.pm warnings.pm warnings Carp Carp.pm Exporter Exporter.pm locale.pm subs.pm overload.pm constant.pm',
|
||||
'getoptpl' => 'getopt.pl getopts.pl',
|
||||
'utf8' => 'utf8_heavy.pl',
|
||||
'Getopt' => 'newgetopt.pl',
|
||||
'open' => 'open2.pl open3.pl',
|
||||
'Config' => 'Config_heavy.pl',
|
||||
'bytes' => 'bytes_heavy.pl',
|
||||
);
|
||||
|
||||
our %defdepends = (
|
||||
'DB_File' => 'libdb1-compat',
|
||||
'GDBM_File' => 'libgdbm',
|
||||
);
|
||||
|
||||
our $prefix = 'perlbase-';
|
||||
|
||||
sub template ($) {
|
||||
$_ = $_[0];
|
||||
return <<TEMPLATE;
|
||||
define Package/$$_{package}
|
||||
SECTION:=lang
|
||||
CATEGORY:=Languages
|
||||
URL:=http://www.cpan.org/
|
||||
TITLE:=$$_{module} perl module
|
||||
DEPENDS:=$$_{depends}
|
||||
endef
|
||||
|
||||
define Package/$$_{package}/install
|
||||
\$(call perlmod/Install,\$(1),$$_{files},$$_{exclude})
|
||||
endef
|
||||
|
||||
\$(eval \$(call BuildPackage,$$_{package}))
|
||||
|
||||
|
||||
TEMPLATE
|
||||
}
|
||||
|
||||
|
||||
sub scandeps ($) {
|
||||
my $sitedir = shift;
|
||||
my @result;
|
||||
|
||||
my ($mod, $file, @deps, $dep, %depends, $parent, $pkg);
|
||||
our (%files, %modules);
|
||||
my (%packages, %excludes);
|
||||
|
||||
for $mod (keys %defmodules) {
|
||||
($pkg = $prefix . $mod) =~ tr/A-Z_/a-z-/;
|
||||
$modules{$pkg} = $mod;
|
||||
for $file (split / /, $defmodules{$mod}) {
|
||||
$files{$file} = $pkg;
|
||||
}
|
||||
}
|
||||
for $file ('pod', 'Pod', split(/ /, $skipfiles)) {
|
||||
$files{$file} = undef;
|
||||
}
|
||||
|
||||
sub wanted {
|
||||
s/^\.\///;
|
||||
return if (/^(\.|auto)$/ or exists $files{$_});
|
||||
if (/\.pod$/) {
|
||||
$files{$_} = undef;
|
||||
}
|
||||
elsif (exists $files{dirname($_)}) {
|
||||
$files{$_} = $files{dirname($_)};
|
||||
}
|
||||
elsif (m!^(?:auto/)?([^./]+)(?:\.(?:pl|pm)|/|$)!) {
|
||||
(my $pkg = $prefix . $1) =~ tr/A-Z_/a-z-/;
|
||||
$modules{$pkg} = $1;
|
||||
$files{$_} = $pkg;
|
||||
}
|
||||
else {
|
||||
$files{$_} = undef;
|
||||
}
|
||||
}
|
||||
chdir($sitedir);
|
||||
find({ wanted => \&wanted, no_chdir => 1}, '.');
|
||||
|
||||
for $pkg (keys %modules) {
|
||||
$packages{$pkg} = [];
|
||||
$excludes{$pkg} = [];
|
||||
$depends{$pkg} = {};
|
||||
}
|
||||
|
||||
for $file (keys %files) {
|
||||
$mod = $files{$file};
|
||||
$parent = $files{dirname($file)};
|
||||
|
||||
if (defined ($mod)) {
|
||||
if (defined ($parent) and not ($parent eq $mod)) {
|
||||
push @{$packages{$mod}}, $file;
|
||||
push @{$excludes{$parent}}, $file;
|
||||
}
|
||||
elsif (not defined ($parent)) {
|
||||
push @{$packages{$mod}}, $file;
|
||||
}
|
||||
}
|
||||
elsif (defined ($parent)) {
|
||||
push @{$excludes{$parent}}, $file;
|
||||
}
|
||||
}
|
||||
|
||||
for $mod (keys %defdepends) {
|
||||
($pkg = $prefix . $mod) =~ tr/A-Z_/a-z-/;
|
||||
for $dep (split / /, $defdepends{$mod}) {
|
||||
${$depends{$pkg}}{$dep} = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@INC = ('.');
|
||||
for $file (grep { -f $_ and defined $files{$_} } keys %files) {
|
||||
@deps = keys %{scan_deps(files => [ $file ], recurse => 0)};
|
||||
$pkg = $files{$file};
|
||||
|
||||
for $dep (grep { not defined $files{$_} } @deps) {
|
||||
warn "$file: could not resolve dependency: $dep\n";
|
||||
}
|
||||
for $dep (grep { defined $files{$_} } @deps) {
|
||||
next if ($files{$dep} eq $pkg);
|
||||
${$depends{$pkg}}{$files{$dep}} = 1;
|
||||
}
|
||||
}
|
||||
|
||||
for $pkg (sort keys %packages) {
|
||||
push @result, template({
|
||||
package => $pkg,
|
||||
module => $modules{$pkg},
|
||||
depends => join(' ', 'perl', sort keys %{$depends{$pkg}}),
|
||||
files => join(' ', sort @{$packages{$pkg}}),
|
||||
exclude => join(' ', sort @{$excludes{$pkg}}),
|
||||
});
|
||||
}
|
||||
|
||||
return join('', @result);
|
||||
}
|
||||
|
||||
|
||||
if (@ARGV > 1) {
|
||||
open FILE, ">$ARGV[1]" or die "$ARGV[1]: $!\n";
|
||||
print FILE scandeps($ARGV[0]);
|
||||
close FILE;
|
||||
}
|
||||
else {
|
||||
print scandeps($ARGV[0] or '.');
|
||||
}
|
||||
PERL_SCRIPT
|
11
lang/perl/files/strippm.sh
Normal file
11
lang/perl/files/strippm.sh
Normal file
|
@ -0,0 +1,11 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Attempt to strip comments and pod docs from perl modules
|
||||
#
|
||||
|
||||
[ "$#" -gt 0 ] || set .
|
||||
echo "---> Stripping modules in: $@" >&2
|
||||
find "$@" -name \*.pm -or -name \*.pl -or -name \*.pod | while read fn; do
|
||||
echo " $fn" >&2
|
||||
sed -i -e '/^=\(head\|pod\|item\|over\|back\)/,/^=cut/d; /^=\(head\|pod\|item\|over\|back\)/,$d; /^#$/d; /^#[^!"'"'"']/d' "$fn"
|
||||
done
|
|
@ -0,0 +1,22 @@
|
|||
--- a/config_h.SH
|
||||
+++ b/config_h.SH
|
||||
@@ -52,6 +52,19 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#und
|
||||
#ifndef _config_h_
|
||||
#define _config_h_
|
||||
|
||||
+#if defined(USE_CROSS_COMPILE) && !defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)
|
||||
+# include <endian.h>
|
||||
+# if defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && defined(__BIG_ENDIAN)
|
||||
+# if (__BYTE_ORDER == __LITTLE_ENDIAN)
|
||||
+# define __LITTLE_ENDIAN__
|
||||
+# elif (__BYTE_ORDER == __BIG_ENDIAN)
|
||||
+# define __BIG_ENDIAN__
|
||||
+# else
|
||||
+# error Unknown endianness
|
||||
+# endif
|
||||
+# endif
|
||||
+#endif
|
||||
+
|
||||
/* LOC_SED:
|
||||
* This symbol holds the complete pathname to the sed program.
|
||||
*/
|
|
@ -0,0 +1,27 @@
|
|||
--- a/hints/linux.sh
|
||||
+++ b/hints/linux.sh
|
||||
@@ -204,6 +204,24 @@ case "$libc" in
|
||||
;;
|
||||
esac
|
||||
|
||||
+# Ubuntu 11.04 (and later, presumably) doesn't keep most libraries
|
||||
+# (such as -lm) in /lib or /usr/lib. So we have to ask gcc to tell us
|
||||
+# where to look. We don't want gcc's own libraries, however, so we
|
||||
+# filter those out.
|
||||
+# This could be conditional on Unbuntu, but other distributions may
|
||||
+# follow suit, and this scheme seems to work even on rather old gcc's.
|
||||
+# This unconditionally uses gcc because even if the user is using another
|
||||
+# compiler, we still need to find the math library and friends, and I don't
|
||||
+# know how other compilers will cope with that situation.
|
||||
+# Still, as an escape hatch, allow Configure command line overrides to
|
||||
+# plibpth to bypass this check.
|
||||
+case "$plibpth" in
|
||||
+'') plibpth=`gcc -print-search-dirs | grep libraries |
|
||||
+ cut -f2- -d= | tr ':' $trnl | grep -v 'gcc'`
|
||||
+ plibpth="$plibpth" # Collapse all entries on one line
|
||||
+ ;;
|
||||
+esac
|
||||
+
|
||||
# Are we using ELF? Thanks to Kenneth Albanowski <kjahds@kjahds.com>
|
||||
# for this test.
|
||||
cat >try.c <<'EOM'
|
27
lang/perl/patches/300-always_use_miniperl.patch
Normal file
27
lang/perl/patches/300-always_use_miniperl.patch
Normal file
|
@ -0,0 +1,27 @@
|
|||
--- a/Makefile.SH
|
||||
+++ b/Makefile.SH
|
||||
@@ -315,22 +315,11 @@ MINIPERL = \$(LDLIBPTH) ./miniperl\$(EXE
|
||||
|
||||
!GROK!THIS!
|
||||
|
||||
-case "$usecrosscompile$perl" in
|
||||
-define?*)
|
||||
- $spitshell >>$Makefile <<!GROK!THIS!
|
||||
-# Macros to invoke a copy of our fully operational perl during the build.
|
||||
-PERL_EXE = perl\$(EXE_EXT)
|
||||
-RUN_PERL = \$(LDLIBPTH) \$(RUN) $perl\$(EXE_EXT)
|
||||
-!GROK!THIS!
|
||||
- ;;
|
||||
-*)
|
||||
- $spitshell >>$Makefile <<!GROK!THIS!
|
||||
+$spitshell >>$Makefile <<!GROK!THIS!
|
||||
# Macros to invoke a copy of our fully operational perl during the build.
|
||||
PERL_EXE = perl\$(EXE_EXT)
|
||||
-RUN_PERL = \$(LDLIBPTH) \$(RUN) ./perl\$(EXE_EXT) -Ilib
|
||||
+RUN_PERL = \$(LDLIBPTH) \$(RUN) ./miniperl\$(EXE_EXT) -Ilib
|
||||
!GROK!THIS!
|
||||
- ;;
|
||||
-esac
|
||||
|
||||
$spitshell >>$Makefile <<!GROK!THIS!
|
||||
# Macros to run our tests
|
22
lang/perl/patches/400-add_microperl_caretx_dependency.patch
Normal file
22
lang/perl/patches/400-add_microperl_caretx_dependency.patch
Normal file
|
@ -0,0 +1,22 @@
|
|||
--- a/Makefile.micro
|
||||
+++ b/Makefile.micro
|
||||
@@ -22,7 +22,8 @@ O = uav$(_O) udeb$(_O) udoio$(_O) udoop$
|
||||
uregcomp$(_O) uregexec$(_O) urun$(_O) \
|
||||
uscope$(_O) usv$(_O) utaint$(_O) utoke$(_O) \
|
||||
unumeric$(_O) ulocale$(_O) umathoms$(_O) \
|
||||
- uuniversal$(_O) uutf8$(_O) uutil$(_O) uperlapi$(_O) ukeywords$(_O)
|
||||
+ uuniversal$(_O) uutf8$(_O) uutil$(_O) uperlapi$(_O) ukeywords$(_O) \
|
||||
+ ucaretx$(_O)
|
||||
|
||||
microperl: $(O)
|
||||
$(LD) -o $@ $(O) $(LDFLAGS) $(LIBS)
|
||||
@@ -178,6 +179,9 @@ uutil$(_O): $(HE) util.c
|
||||
uperlapi$(_O): $(HE) perlapi.c perlapi.h
|
||||
$(CC) $(CCFLAGS) -o $@ $(CFLAGS) perlapi.c
|
||||
|
||||
+ucaretx$(_O): $(HE) caretx.c
|
||||
+ $(CC) $(CCFLAGS) -o $@ $(CFLAGS) caretx.c
|
||||
+
|
||||
uuudmap.h umg_data.h: ubitcount.h
|
||||
|
||||
ubitcount.h: ugenerate_uudmap$(_X)
|
1262
lang/perl/perlbase.mk
Normal file
1262
lang/perl/perlbase.mk
Normal file
File diff suppressed because it is too large
Load diff
53
lang/perl/perlmod.mk
Normal file
53
lang/perl/perlmod.mk
Normal file
|
@ -0,0 +1,53 @@
|
|||
# This makefile simplifies perl module builds.
|
||||
#
|
||||
|
||||
# Build environment
|
||||
PERL_CMD := $(STAGING_DIR)/usr/bin/perl
|
||||
PERL_LIB := $(STAGING_DIR)/usr/lib/perl5/5.20
|
||||
|
||||
# Module install prefix
|
||||
PERL_SITELIB := /usr/lib/perl5/5.20
|
||||
|
||||
define perlmod/Configure
|
||||
(cd $(PKG_BUILD_DIR); \
|
||||
PERL5LIB=$(PERL_LIB) \
|
||||
PERL_MM_USE_DEFAULT=1 \
|
||||
$(2) \
|
||||
$(PERL_CMD) Makefile.PL \
|
||||
$(1) \
|
||||
PERL_LIB=$(PERL_LIB) \
|
||||
PERL_ARCHLIB=$(PERL_LIB) \
|
||||
INSTALLSITELIB=$(PERL_SITELIB) \
|
||||
INSTALLSITEARCH=$(PERL_SITELIB) \
|
||||
DESTDIR=$(PKG_INSTALL_DIR) \
|
||||
);
|
||||
endef
|
||||
|
||||
define perlmod/Compile
|
||||
PERL5LIB=$(PERL_LIB) \
|
||||
$(2) \
|
||||
$(MAKE) -C $(PKG_BUILD_DIR) \
|
||||
$(1) \
|
||||
install
|
||||
endef
|
||||
|
||||
define perlmod/Install
|
||||
$(INSTALL_DIR) $(strip $(1))$(PERL_SITELIB)
|
||||
(cd $(PKG_INSTALL_DIR)$(PERL_SITELIB) && \
|
||||
rsync --relative -rlHp --itemize-changes \
|
||||
--exclude=\*.pod \
|
||||
--exclude=.packlist \
|
||||
$(addprefix --exclude=/,$(strip $(3))) \
|
||||
--prune-empty-dirs \
|
||||
$(strip $(2)) $(strip $(1))$(PERL_SITELIB))
|
||||
|
||||
chmod -R u+w $(strip $(1))$(PERL_SITELIB)
|
||||
|
||||
@echo "---> Stripping modules in: $(strip $(1))$(PERL_SITELIB)"
|
||||
find $(strip $(1))$(PERL_SITELIB) -name \*.pm -or -name \*.pl | \
|
||||
xargs -r sed -i \
|
||||
-e '/^=\(head\|pod\|item\|over\|back\)/,/^=cut/d' \
|
||||
-e '/^=\(head\|pod\|item\|over\|back\)/,$$$$d' \
|
||||
-e '/^#$$$$/d' \
|
||||
-e '/^#[^!"'"'"']/d'
|
||||
endef
|
Loading…
Reference in a new issue