Files
chromebrew/packages/perl.rb
Cassandra Watergate 1d60778b1c perl => 5.34.1 (#6860)
* perl => 5.34.1

* fix perl library versioning

* update YAML::Tiny

* update XML::Simple

* update XML::SAX::Parserfactory

* update XML::Parser

* update Unicode::Linebreak

* update Unicode::Eastasianwidth

* update Time::Hires

* update Text::Wrapi18n

* update Text::Unidecode

* update Text:Charwidth

* add Test::Output

* update Term::Readkey

* update Term::ANSIColor

* update GNU stow

* update SGLMS

* remove duplicate Term::Readkey

* update Pod::Parser

* update Parse::YAPP

* update Net::SSLeay

* update Mozilla::CA

* update Module::Build

* update Locale::Messages

* update Locale::Messages

* remove duplicate Unicode::LineBreak

* update IO::Socket::SSL

* update File::Tail

* update Date::Manip

* update Date::Format

* update Date::Calc

* update Carp::Clan

* add App::Cpanminus

* perl: Download Cpan Minus in prebuild phase

* App::Cpanminus conflicts with #{CREW_PREFIX}/bin/cpanm from perl.rb

* fix Mozilla::CA checksum

* add x86_64 and i686 binaries

* recompile perl binaries #1 >:(

* recompile perl binaries #2 >:(

* File::Tail correct spelling

* add dep to XML::SAX::ParserFactory

* add more binaries

* xml source stuff

* perl xml binaries

* misc fixes

* rest of binaries (x86_64 and i686)

* quote ldflags

* Add perl binaries

* add conflicts_ok to allow builds

* Add binaries for all successful armv7l builds

* rubocop perl

* add more armv7l binaries

Co-authored-by: Satadru Pramanik <satadru@gmail.com>
2022-03-16 23:43:02 -05:00

90 lines
4.2 KiB
Ruby

require 'package'
class Perl < Package
description 'Perl 5 is a highly capable, feature-rich programming language with over 29 years of development.'
homepage 'https://www.perl.org/'
@_ver = '5.34.1'
version @_ver
license 'GPL-1+ or Artistic'
compatibility 'all'
source_url "https://www.cpan.org/src/5.0/perl-#{@_ver}.tar.xz"
source_sha256 '6d52cf833ff1af27bb5e986870a2c30cec73c044b41e3458cd991f94374039f7'
binary_url({
aarch64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/perl/5.34.1_armv7l/perl-5.34.1-chromeos-armv7l.tar.zst',
armv7l: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/perl/5.34.1_armv7l/perl-5.34.1-chromeos-armv7l.tar.zst',
i686: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/perl/5.34.1_i686/perl-5.34.1-chromeos-i686.tar.zst',
x86_64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/perl/5.34.1_x86_64/perl-5.34.1-chromeos-x86_64.tar.zst'
})
binary_sha256({
aarch64: 'dfffdd358c4863f28a7865e7087f6a716478509b7ebeafab0b1200bc5e65fe3d',
armv7l: 'dfffdd358c4863f28a7865e7087f6a716478509b7ebeafab0b1200bc5e65fe3d',
i686: '49c0701b82abe192ec20a22f435df153689c7269f36da9ab38299496a6360233',
x86_64: '09abf3ae359466bb0451e9ed890b4d95bc7721de05fa65f8acba5ee131797b46'
})
depends_on 'patch' => :build
def self.build
FileUtils.ln_sf "#{CREW_LIB_PREFIX}/libnsl.so.1", "#{CREW_LIB_PREFIX}/libnsl.so"
# Use system zlib and bzip2
# Create shared library
# Install manual files into #{CREW_PREFIX}/share/man/man* even if groff is not installed.
system "env AR=gcc-ar RANLIB=gcc-ranlib NM=gcc-nm \
BUILD_ZLIB=False BUILD_BZIP2=0 \
./Configure \
-de \
-Dprefix=#{CREW_PREFIX} \
-Dvendorprefix=#{CREW_PREFIX} \
-Dprivlib=#{CREW_PREFIX}/share/perl5/core_perl \
-Darchlib=#{CREW_LIB_PREFIX}/perl5/#{@_ver}/core_perl \
-Dsitelib=#{CREW_PREFIX}/share/perl5/site_perl \
-Dsitearch=#{CREW_LIB_PREFIX}/perl5/#{@_ver}/site_perl \
-Dvendorlib=#{CREW_PREFIX}/share/perl5/vendor_perl \
-Dvendorarch=#{CREW_LIB_PREFIX}/perl5/#{@_ver}/vendor_perl \
-Dcc=#{CREW_TGT}-gcc \
-Doptimize='#{CREW_COMMON_FLAGS}' \
-Dlldlflags='-shared #{CREW_LDFLAGS}' -Dldflags='#{CREW_LDFLAGS}' \
-Dusethreads \
-Dinstallusrbinperl=n \
-Duseshrplib -Dman1dir=#{CREW_MAN_PREFIX}/man1 -Dman3dir=#{CREW_MAN_PREFIX}/man3"
system 'make'
end
def self.install
system 'make', "DESTDIR=#{CREW_DEST_DIR}", 'install'
# Make libperl symlinks into standard locations
libperl_so = "#{CREW_PREFIX}/lib/perl5/#{@perl_fullversion}/#{ARCH}-linux-thread-multi/CORE/libperl.so"
FileUtils.ln_sf libperl_so, "#{CREW_DEST_LIB_PREFIX}/libperl.so.#{@_ver}" # e.g., libperl.so.5.34.1
FileUtils.ln_sf libperl_so, "#{CREW_DEST_LIB_PREFIX}/libperl.so.#{@_ver.sub(/\.\d$/, '')}" # e.g., libperl.so.5.34
FileUtils.ln_sf libperl_so, "#{CREW_DEST_LIB_PREFIX}/libperl.so#{@_ver.sub(/\.\d\.\d$/, '')}" # e.g., libperl.so.5
FileUtils.ln_sf libperl_so, "#{CREW_DEST_LIB_PREFIX}/libperl.so" # e.g., libperl.so
# Consider adding this symlink to the glibc package
FileUtils.ln_sf "#{CREW_LIB_PREFIX}/libnsl.so.1", "#{CREW_DEST_LIB_PREFIX}/libnsl.so"
# Avoid File conflict with tcl, ocaml
FileUtils.mv "#{CREW_DEST_MAN_PREFIX}/man3/Thread.3", "#{CREW_DEST_MAN_PREFIX}/man3/Thread.3perl"
end
def self.check
# having strange error as explained at https://patchwork.openembedded.org/patch/95795/
# so, apply patch from https://github.com/habitat-sh/core-plans/blob/master/perl/skip-wide-character-test.patch
# to ignore this single test
system 'patch -Np1 << EOF
diff -ur perl-5.22.1.orig/t/lib/warnings/regexec perl-5.22.1/t/lib/warnings/regexec
--- perl-5.22.1.orig/t/lib/warnings/regexec 2015-10-30 21:14:29.000000000 +0000
+++ perl-5.22.1/t/lib/warnings/regexec 2016-01-19 05:05:50.218474114 +0000
@@ -188,6 +188,7 @@
########
# NAME \b{} in UTF-8 locale
require \'../loc_tools.pl\';
+print("SKIPPED\n# This test causes a failure in the test suite\n"),exit;
unless (locales_enabled()) {
print("SKIPPED\n# locales not available\n"),exit;
}
EOF'
# test
# system 'make test || true'
end
end