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/' version '5.26.1' source_url 'http://www.cpan.org/src/5.0/perl-5.26.1.tar.gz' source_sha256 'e763aa485e8dc1a70483dbe6d615986bbf32b977f38016480d68c99237e701dd' binary_url ({ aarch64: 'https://dl.bintray.com/chromebrew/chromebrew/perl-5.26.1-chromeos-armv7l.tar.xz', armv7l: 'https://dl.bintray.com/chromebrew/chromebrew/perl-5.26.1-chromeos-armv7l.tar.xz', i686: 'https://dl.bintray.com/chromebrew/chromebrew/perl-5.26.1-chromeos-i686.tar.xz', x86_64: 'https://dl.bintray.com/chromebrew/chromebrew/perl-5.26.1-chromeos-x86_64.tar.xz', }) binary_sha256 ({ aarch64: 'd905b33e42f8825063eebe17a34bc8011ed9e7a88374373187d55f879453ccc4', armv7l: 'd905b33e42f8825063eebe17a34bc8011ed9e7a88374373187d55f879453ccc4', i686: 'a1394c4caafbca33de118521f850fa4162834f70c4bacbca9b576048a420ffb2', x86_64: 'd6f71ac89fae67ce77d097075b52683cc5bb6367f87ad2dc86c383b4024b4186', }) depends_on 'patch' => :build def self.build # Use system zlib and bzip2 # Create shared library # Install manual files into /usr/local/share/man/man* even if groff is not installed. system "BUILD_ZLIB=False BUILD_BZIP2=0 ./Configure -de -Duseshrplib -Dman1dir=#{CREW_PREFIX}/share/man/man1 -Dman3dir=#{CREW_PREFIX}/share/man/man3" system "make" system "curl -o cpanm https://cpanmin.us" system "chmod +x cpanm" end def self.install system "make", "DESTDIR=#{CREW_DEST_DIR}", "install" system "mkdir -p #{CREW_DEST_PREFIX}/bin/" system "cp cpanm #{CREW_DEST_PREFIX}/bin/" 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 -p1 << 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" end end