package : added EditableMakefile

Modifications :
- added EditableMakefile to PackageBase subclasses
- astyle modified as an example
- preliminary hook to stop at a certain phase of install
This commit is contained in:
alalazo
2016-07-11 10:08:19 +02:00
parent 8f75d34331
commit a43c63f149
7 changed files with 78 additions and 48 deletions

View File

@@ -25,28 +25,24 @@
from spack import *
class Astyle(Package):
class Astyle(EditableMakefile):
"""
A Free, Fast, and Small Automatic Formatter for C, C++, C++/CLI,
Objective-C, C#, and Java Source Code.
"""
homepage = "http://astyle.sourceforge.net/"
url = "http://downloads.sourceforge.net/project/astyle/astyle/astyle%202.04/astyle_2.04_linux.tar.gz"
url = "http://downloads.sourceforge.net/project/astyle/astyle/astyle%202.04/astyle_2.04_linux.tar.gz"
version('2.04', '30b1193a758b0909d06e7ee8dd9627f6')
def install(self, spec, prefix):
parallel = False
with working_dir('src'):
# we need to edit the makefile in place to set compiler:
make_file = join_path(self.stage.source_path,
'build', 'gcc', 'Makefile')
filter_file(r'^CXX\s*=.*', 'CXX=%s' % spack_cxx, make_file)
def wdir(self):
return join_path(self.stage.source_path, 'build', self.compiler.name)
make('-f',
make_file,
parallel=False)
def edit(self, spec, prefix):
makefile = join_path(self.wdir(), 'Makefile')
filter_file(r'^CXX\s*=.*', 'CXX=%s' % spack_cxx, makefile)
mkdirp(self.prefix.bin)
install(join_path(self.stage.source_path, 'src', 'bin', 'astyle'),
self.prefix.bin)
def install_args(self):
return ['prefix={0}'.format(prefix)]

View File

@@ -24,16 +24,10 @@
##############################################################################
from spack import *
class Blitz(Package):
class Blitz(AutotoolsPackage):
"""N-dimensional arrays for C++"""
homepage = "http://github.com/blitzpp/blitz"
url = "https://github.com/blitzpp/blitz/tarball/1.0.0"
url = "https://github.com/blitzpp/blitz/tarball/1.0.0"
version('1.0.0', '9f040b9827fe22228a892603671a77af')
# No dependencies
def install(self, spec, prefix):
configure('--prefix=%s' % prefix)
make()
make("install")

View File

@@ -24,20 +24,16 @@
##############################################################################
from spack import *
class Gmp(Package):
class Gmp(AutotoolsPackage):
"""GMP is a free library for arbitrary precision arithmetic,
operating on signed integers, rational numbers, and
floating-point numbers."""
homepage = "https://gmplib.org"
url = "https://gmplib.org/download/gmp/gmp-6.0.0a.tar.bz2"
url = "https://gmplib.org/download/gmp/gmp-6.0.0a.tar.bz2"
version('6.1.0' , '86ee6e54ebfc4a90b643a65e402c4048')
version('6.0.0a', 'b7ff2d88cae7f8085bd5006096eed470')
version('6.0.0' , '6ef5869ae735db9995619135bd856b84')
depends_on("m4")
def install(self, spec, prefix):
configure("--prefix=%s" % prefix)
make()
make("install")

View File

@@ -66,8 +66,8 @@ def autoreconf(self, spec, prefix):
autogen = Executable('./autogen.sh')
autogen()
def config_args(self):
return ['--prefix=%s' % prefix,
'--enable-mpi' if '+mpi' in spec else '--disable-mpi',
def configure_args(self):
return ['--prefix=%s' % self.prefix,
'--enable-mpi' if '+mpi' in self.spec else '--disable-mpi',
'--with-metis={0}'.format(self.spec['metis'].prefix),
'--enable-optimization']