diff options
Diffstat (limited to 'var/spack/repos/builtin/packages/perl/package.py')
-rw-r--r-- | var/spack/repos/builtin/packages/perl/package.py | 88 |
1 files changed, 46 insertions, 42 deletions
diff --git a/var/spack/repos/builtin/packages/perl/package.py b/var/spack/repos/builtin/packages/perl/package.py index fbf788d106..fd0c4aef17 100644 --- a/var/spack/repos/builtin/packages/perl/package.py +++ b/var/spack/repos/builtin/packages/perl/package.py @@ -1,27 +1,8 @@ -############################################################################## -# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. -# Produced at the Lawrence Livermore National Laboratory. +# Copyright 2013-2018 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. # -# This file is part of Spack. -# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. -# LLNL-CODE-647188 -# -# For details, see https://github.com/spack/spack -# Please also see the NOTICE and LICENSE files for our notice and the LGPL. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License (as -# published by the Free Software Foundation) version 2.1, February 1999. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and -# conditions of the GNU Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -############################################################################## +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + # # Author: Milton Woods <milton.woods@bom.gov.au> # Date: March 22, 2017 @@ -30,12 +11,13 @@ # Author: Justin Too <justin@doubleotoo.com> # Date: September 6, 2015 # -from spack import * import os from contextlib import contextmanager -import spack + from llnl.util.lang import match_predicate +from spack import * + class Perl(Package): # Perl doesn't use Autotools, it should subclass Package """Perl 5 is a highly capable, feature-rich programming language with over @@ -45,19 +27,23 @@ class Perl(Package): # Perl doesn't use Autotools, it should subclass Package # URL must remain http:// so Spack can bootstrap curl url = "http://www.cpan.org/src/5.0/perl-5.24.1.tar.gz" - # Development releases + # see http://www.cpan.org/src/README.html for + # explanation of version numbering scheme + + # Development releases (odd numbers) version('5.25.11', '37a398682c36cd85992b34b5c1c25dc1') - # Maintenance releases (recommended) - version('5.24.1', '765ef511b5b87a164e2531403ee16b3c', preferred=True) - version('5.22.3', 'aa4f236dc2fc6f88b871436b8d0fda95') + # Maintenance releases (even numbers, recommended) + version('5.28.0', sha256='7e929f64d4cb0e9d1159d4a59fc89394e27fa1f7004d0836ca0d514685406ea8') + version('5.26.2', 'dc0fea097f3992a8cd53f8ac0810d523', preferred=True) + version('5.24.1', '765ef511b5b87a164e2531403ee16b3c') - # Misc releases that people need + # End of life releases + version('5.22.4', '31a71821682e02378fcdadeed85688b8') + version('5.22.3', 'aa4f236dc2fc6f88b871436b8d0fda95') version('5.22.2', '5767e2a10dd62a46d7b57f74a90d952b') version('5.22.1', '19295bbb775a3c36123161b9bf4892f1') version('5.22.0', 'e32cb6a8dda0084f2a43dac76318d68d') - - # End of life releases version('5.20.3', 'd647d0ea5a7a8194c34759ab9f2610cd') version('5.18.4', '1f9334ff730adc05acd3dd7130d295db') version('5.16.3', 'eb5c40f2575df6c155bc99e3fe0a9d82') @@ -71,6 +57,10 @@ class Perl(Package): # Perl doesn't use Autotools, it should subclass Package # https://rt.perl.org/Public/Bug/Display.html?id=126468 patch('protect-quotes-in-ccflags.patch', when='@5.22.0') + # Fix build on Fedora 28 + # https://bugzilla.redhat.com/show_bug.cgi?id=1536752 + patch('https://src.fedoraproject.org/rpms/perl/raw/004cea3a67df42e92ffdf4e9ac36d47a3c6a05a4/f/perl-5.26.1-guard_old_libcrypt_fix.patch', level=1, sha256='0eac10ed90aeb0459ad8851f88081d439a4e41978e586ec743069e8b059370ac', when='@:5.26.2') + # Installing cpanm alongside the core makes it safe and simple for # people/projects to install their own sets of perl modules. Not # having it in core increases the "energy of activation" for doing @@ -81,6 +71,9 @@ class Perl(Package): # Perl doesn't use Autotools, it should subclass Package variant('shared', default=True, description='Build a shared libperl.so library') + variant('threads', default=True, + description='Build perl with threads support') + resource( name="cpanm", url="http://search.cpan.org/CPAN/authors/id/M/MI/MIYAGAWA/App-cpanminus-1.7042.tar.gz", @@ -91,6 +84,18 @@ class Perl(Package): # Perl doesn't use Autotools, it should subclass Package phases = ['configure', 'build', 'install'] + # On a lustre filesystem, patch may fail when files + # aren't writeable so make pp.c user writeable + # before patching. This should probably walk the + # source and make everything writeable in the future. + def do_stage(self, mirror_only=False): + # Do Spack's regular stage + super(Perl, self).do_stage(mirror_only) + # Add write permissions on file to be patched + filename = join_path(self.stage.source_path, 'pp.c') + perm = os.stat(filename).st_mode + os.chmod(filename, perm | 0o200) + def configure_args(self): spec = self.spec prefix = self.prefix @@ -128,6 +133,9 @@ class Perl(Package): # Perl doesn't use Autotools, it should subclass Package if '+shared' in spec: config_args.append('-Duseshrplib') + if '+threads' in spec: + config_args.append('-Dusethreads') + return config_args def configure(self, spec, prefix): @@ -252,27 +260,23 @@ class Perl(Package): # Perl doesn't use Autotools, it should subclass Package return match_predicate(ignore_arg, patterns) - def activate(self, ext_pkg, **args): + def activate(self, ext_pkg, view, **args): ignore = self.perl_ignore(ext_pkg, args) args.update(ignore=ignore) - super(Perl, self).activate(ext_pkg, **args) - - extensions_layout = args.get("extensions_layout", - spack.store.extensions) + super(Perl, self).activate(ext_pkg, view, **args) + extensions_layout = view.extensions_layout exts = extensions_layout.extension_map(self.spec) exts[ext_pkg.name] = ext_pkg.spec - def deactivate(self, ext_pkg, **args): + def deactivate(self, ext_pkg, view, **args): ignore = self.perl_ignore(ext_pkg, args) args.update(ignore=ignore) - super(Perl, self).deactivate(ext_pkg, **args) - - extensions_layout = args.get("extensions_layout", - spack.store.extensions) + super(Perl, self).deactivate(ext_pkg, view, **args) + extensions_layout = view.extensions_layout exts = extensions_layout.extension_map(self.spec) # Make deactivate idempotent if ext_pkg.name in exts: |