Add perl package
Add perl package, based on [work by justintoo](https://github.com/LLNL/spack/pull/105). He had too many things pulled into that pull request, this just adds a perl package. Support the current releases on the past three minor branches. Run perl's tests before installing. Install cpanm into the core (makes building on top of this perl *much* simpler). Controlled by a variant.
This commit is contained in:
		
							
								
								
									
										1075
									
								
								var/spack/repos/builtin/packages/perl/cpanm-installer.pl
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1075
									
								
								var/spack/repos/builtin/packages/perl/cpanm-installer.pl
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										42
									
								
								var/spack/repos/builtin/packages/perl/package.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										42
									
								
								var/spack/repos/builtin/packages/perl/package.py
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,42 @@
 | 
			
		||||
#
 | 
			
		||||
# Author: George Hartzell <hartzell@alerce.com>
 | 
			
		||||
# Date: July 21, 2016
 | 
			
		||||
# Author: Justin Too <justin@doubleotoo.com>
 | 
			
		||||
# Date: September 6, 2015
 | 
			
		||||
#
 | 
			
		||||
from spack import *
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class Perl(Package):
 | 
			
		||||
    """Perl 5 is a highly capable, feature-rich programming language with over
 | 
			
		||||
       27 years of development."""
 | 
			
		||||
    homepage = "http://www.perl.org"
 | 
			
		||||
    url      = "http://www.cpan.org/src/5.0/perl-5.22.2.tar.gz"
 | 
			
		||||
 | 
			
		||||
    version('5.24.0', 'c5bf7f3285439a2d3b6a488e14503701')
 | 
			
		||||
    version('5.22.2', '5767e2a10dd62a46d7b57f74a90d952b')
 | 
			
		||||
    version('5.20.3', 'd647d0ea5a7a8194c34759ab9f2610cd')
 | 
			
		||||
    # 5.18.4 fails with gcc-5
 | 
			
		||||
    # https://rt.perl.org/Public/Bug/Display.html?id=123784
 | 
			
		||||
    # version('5.18.4' , '1f9334ff730adc05acd3dd7130d295db')
 | 
			
		||||
 | 
			
		||||
    # 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
 | 
			
		||||
    # things cleanly.
 | 
			
		||||
    variant('cpanm', default=True,
 | 
			
		||||
            description='Having cpanm in core simplifies adding modules.')
 | 
			
		||||
 | 
			
		||||
    def install(self, spec, prefix):
 | 
			
		||||
        configure = Executable('./Configure')
 | 
			
		||||
        configure("-des", "-Dprefix=" + prefix)
 | 
			
		||||
        make()
 | 
			
		||||
        make("test")
 | 
			
		||||
        make("install")
 | 
			
		||||
 | 
			
		||||
        if '+cpanm' in spec:
 | 
			
		||||
            perl_exe = join_path(prefix, 'bin', 'perl')
 | 
			
		||||
            perl = Executable(perl_exe)
 | 
			
		||||
            cpanm_installer = join_path(self.package_dir, 'cpanm-installer.pl')
 | 
			
		||||
            cpanm_package_spec = 'App::cpanminus' + '@' + '1.7042'
 | 
			
		||||
            perl(cpanm_installer, cpanm_package_spec)
 | 
			
		||||
		Reference in New Issue
	
	Block a user