merge with python-modules

This commit is contained in:
Alfredo Gimenez
2015-02-06 16:27:33 -08:00
62 changed files with 1839 additions and 142 deletions

View File

@@ -0,0 +1,26 @@
from spack import *
class Cloog(Package):
"""CLooG is a free software and library to generate code for
scanning Z-polyhedra. That is, it finds a code (e.g. in C,
FORTRAN...) that reaches each integral point of one or more
parameterized polyhedra."""
homepage = "http://www.cloog.org"
url = "http://www.bastoul.net/cloog/pages/download/count.php3?url=./cloog-0.18.1.tar.gz"
list_url = "http://www.bastoul.net/cloog/pages/download"
version('0.18.1', 'e34fca0540d840e5d0f6427e98c92252')
version('0.18.0', 'be78a47bd82523250eb3e91646db5b3d')
version('0.17.0', '0aa3302c81f65ca62c114e5264f8a802')
depends_on("gmp")
depends_on("isl")
def install(self, spec, prefix):
configure("--prefix=%s" % prefix,
"--with-osl=no",
"--with-isl=%s" % spec['isl'].prefix,
"--with-gmp=%s" % spec['gmp'].prefix)
make()
make("install")

View File

@@ -32,29 +32,46 @@ class Gcc(Package):
Objective-C, Fortran, and Java."""
homepage = "https://gcc.gnu.org"
url = "http://open-source-box.org/gcc/gcc-4.9.2/gcc-4.9.2.tar.bz2"
list_url = 'http://open-source-box.org/gcc/'
list_depth = 2
version('4.9.2', '4df8ee253b7f3863ad0b86359cd39c43',
url="http://open-source-box.org/gcc/gcc-4.9.2/gcc-4.9.2.tar.bz2")
version('4.9.1', 'fddf71348546af523353bd43d34919c1',
url="http://open-source-box.org/gcc/gcc-4.9.1/gcc-4.9.1.tar.bz2")
version('4.9.2', '4df8ee253b7f3863ad0b86359cd39c43')
version('4.9.1', 'fddf71348546af523353bd43d34919c1')
version('4.8.4', '5a84a30839b2aca22a2d723de2a626ec')
version('4.7.4', '4c696da46297de6ae77a82797d2abe28')
version('4.6.4', 'b407a3d1480c11667f293bfb1f17d1a4')
version('4.5.4', '27e459c2566b8209ab064570e1b378f7')
depends_on("mpc")
depends_on("mpfr")
depends_on("gmp")
depends_on("mpc") # when @4.5:
depends_on("libelf")
# Save these until we can do optional deps.
#depends_on("isl")
#depends_on("ppl")
#depends_on("cloog")
def install(self, spec, prefix):
# libjava/configure needs a minor fix to install into spack paths.
filter_file(r"'@.*@'", "'@[[:alnum:]]*@'", 'libjava/configure', string=True)
enabled_languages = set(('c', 'c++', 'fortran', 'java', 'objc'))
if spec.satisfies("@4.7.1:"):
enabled_languages.add('go')
# Rest of install is straightforward.
configure("--prefix=%s" % prefix,
"--libdir=%s/lib64" % prefix,
"--disable-multilib",
"--enable-languages=c,c++,fortran,java,objc,go",
"--enable-languages=" + ','.join(enabled_languages),
"--with-mpc=%s" % spec['mpc'].prefix,
"--with-mpfr=%s" % spec['mpfr'].prefix,
"--with-gmp=%s" % spec['gmp'].prefix,
"--with-libelf=%s" % spec['libelf'].prefix,
"--with-stage1-ldflags=%s" % self.rpath_args,
"--with-boot-ldflags=%s" % self.rpath_args,
"--enable-lto",
"--with-quad")
make()

View File

@@ -18,12 +18,14 @@ class Hdf5(Package):
# TODO: currently hard-coded to use OpenMPI
def install(self, spec, prefix):
configure(
"--prefix=%s" % prefix,
"--with-zlib=%s" % spec['zlib'].prefix,
"--enable-parallel",
"CC=%s" % spec['openmpi'].prefix.bin + "/mpicc",
"CXX=%s" % spec['openmpi'].prefix.bin + "/mpic++")
"--enable-shared",
"CC=%s" % spec['mpich'].prefix.bin + "/mpicc",
"CXX=%s" % spec['mpich'].prefix.bin + "/mpic++")
make()
make("install")

View File

@@ -0,0 +1,17 @@
from spack import *
class Isl(Package):
"""isl is a thread-safe C library for manipulating sets and
relations of integer points bounded by affine constraints."""
homepage = "http://isl.gforge.inria.fr"
url = "http://isl.gforge.inria.fr/isl-0.14.tar.bz2"
version('0.14', 'acd347243fca5609e3df37dba47fd0bb')
depends_on("gmp")
def install(self, spec, prefix):
configure("--prefix=%s" % prefix,
"--with-gmp-prefix=%s" % spec['gmp'].prefix)
make()
make("install")

View File

@@ -0,0 +1,28 @@
from spack import *
class Ppl(Package):
"""The Parma Polyhedra Library (PPL) provides numerical
abstractions especially targeted at applications in the field of
analysis and verification of complex systems. These abstractions
include convex polyhedra, some special classes of polyhedra shapes
that offer interesting complexity/precision tradeoffs, and grids
which represent regularly spaced points that satisfy a set of
linear congruence relations. The library also supports finite
powersets and products of polyhedra and grids, a mixed integer
linear programming problem solver using an exact-arithmetic
version of the simplex algorithm, a parametric integer programming
solver, and primitives for termination analysis via the automatic
synthesis of linear ranking functions."""
homepage = "http://bugseng.com/products/ppl/"
url = "http://bugseng.com/products/ppl/download/ftp/releases/1.1/ppl-1.1.tar.gz"
version('1.1', '4f2422c0ef3f409707af32108deb30a7')
depends_on("gmp")
def install(self, spec, prefix):
configure("--prefix=%s" % prefix,
"--with-gmp=%s" % spec['gmp'].prefix)
make()
make("install")

View File

@@ -0,0 +1,25 @@
from spack import *
import os
class PyBasemap(Package):
"""The matplotlib basemap toolkit is a library for plotting 2D data on maps in Python."""
homepage = "http://matplotlib.org/basemap/"
url = "https://downloads.sourceforge.net/project/matplotlib/matplotlib-toolkits/basemap-1.0.7/basemap-1.0.7.tar.gz"
version('1.0.7', '48c0557ced9e2c6e440b28b3caff2de8')
geos_version = {'1.0.7' : '3.3.3'}
extends('python')
depends_on('py-setuptools')
depends_on('py-numpy')
depends_on('py-matplotlib')
depends_on('py-pil')
def install(self, spec, prefix):
with working_dir('geos-%s' % self.geos_version[str(self.version)]):
configure("--prefix=" + prefix)
make()
make("install")
os.environ['GEOS_DIR'] = prefix
python('setup.py', 'install', '--prefix=%s' % prefix)

View File

@@ -0,0 +1,14 @@
from spack import *
class PyBiopython(Package):
"""It is a distributed collaborative effort to develop Python libraries and applications which address the needs of current and future work in bioinformatics."""
homepage = "http://biopython.org/wiki/Main_Page"
url = "http://biopython.org/DIST/biopython-1.65.tar.gz"
version('1.65', '143e7861ade85c0a8b5e2bbdd1da1f67')
extends('python')
depends_on('py-mx')
def install(self, spec, prefix):
python('setup.py', 'install', '--prefix=%s' % prefix)

View File

@@ -0,0 +1,13 @@
from spack import *
class PyCython(Package):
"""The Cython compiler for writing C extensions for the Python language."""
homepage = "https://pypi.python.org/pypi/cython"
url = "https://pypi.python.org/packages/source/C/Cython/Cython-0.21.2.tar.gz"
version('0.21.2', 'd21adb870c75680dc857cd05d41046a4')
extends('python')
def install(self, spec, prefix):
python('setup.py', 'install', '--prefix=%s' % prefix)

View File

@@ -0,0 +1,14 @@
from spack import *
class PyDateutil(Package):
"""Extensions to the standard Python datetime module."""
homepage = "https://pypi.python.org/pypi/dateutil"
url = "https://pypi.python.org/packages/source/p/python-dateutil/python-dateutil-2.4.0.tar.gz"
version('2.4.0', '75714163bb96bedd07685cdb2071b8bc')
extends('python')
depends_on('py-setuptools')
def install(self, spec, prefix):
python('setup.py', 'install', '--prefix=%s' % prefix)

View File

@@ -0,0 +1,13 @@
from spack import *
class PyEpydoc(Package):
"""Epydoc is a tool for generating API documentation documentation for Python modules, based on their docstrings."""
homepage = "https://pypi.python.org/pypi/epydoc"
url = "https://pypi.python.org/packages/source/e/epydoc/epydoc-3.0.1.tar.gz"
version('3.0.1', '36407974bd5da2af00bf90ca27feeb44')
extends('python')
def install(self, spec, prefix):
python('setup.py', 'install', '--prefix=%s' % prefix)

View File

@@ -0,0 +1,13 @@
from spack import *
class PyGnuplot(Package):
"""Gnuplot.py is a Python package that allows you to create graphs from within Python using the gnuplot plotting program."""
homepage = "http://gnuplot-py.sourceforge.net/"
url = "http://downloads.sourceforge.net/project/gnuplot-py/Gnuplot-py/1.8/gnuplot-py-1.8.tar.gz"
version('1.8', 'abd6f571e7aec68ae7db90a5217cd5b1')
extends('python')
def install(self, spec, prefix):
python('setup.py', 'install', '--prefix=%s' % prefix)

View File

@@ -0,0 +1,18 @@
from spack import *
import re
class PyH5py(Package):
"""The h5py package provides both a high- and low-level interface to the HDF5 library from Python."""
homepage = "https://pypi.python.org/pypi/h5py"
url = "https://pypi.python.org/packages/source/h/h5py/h5py-2.4.0.tar.gz"
version('2.4.0', '80c9a94ae31f84885cc2ebe1323d6758')
extends('python', ignore=lambda f: re.match(r'cy*', f))
depends_on('hdf5')
depends_on('py-numpy')
depends_on('py-cython')
def install(self, spec, prefix):
python('setup.py', 'configure', '--hdf5=%s' % spec['hdf5'].prefix)
python('setup.py', 'install', '--prefix=%s' % prefix)

View File

@@ -0,0 +1,14 @@
from spack import *
class PyIpython(Package):
"""IPython provides a rich toolkit to help you make the most out of using Python interactively."""
homepage = "https://pypi.python.org/pypi/ipython"
url = "https://pypi.python.org/packages/source/i/ipython/ipython-2.3.1.tar.gz"
version('2.3.1', '2b7085525dac11190bfb45bb8ec8dcbf')
extends('python')
depends_on('py-pygments')
def install(self, spec, prefix):
python('setup.py', 'install', '--prefix=%s' % prefix)

View File

@@ -0,0 +1,13 @@
from spack import *
class PyLibxml2(Package):
"""A Python wrapper around libxml2."""
homepage = "https://xmlsoft.org/python.html"
url = "ftp://xmlsoft.org/libxml2/python/libxml2-python-2.6.21.tar.gz"
version('2.6.21', '229dd2b3d110a77defeeaa73af83f7f3')
extends('python')
def install(self, spec, prefix):
python('setup.py', 'install', '--prefix=%s' % prefix)

View File

@@ -0,0 +1,38 @@
from spack import *
import os
class PyMatplotlib(Package):
"""Python plotting package."""
homepage = "https://pypi.python.org/pypi/matplotlib"
url = "https://pypi.python.org/packages/source/m/matplotlib/matplotlib-1.4.2.tar.gz"
version('1.4.2', '7d22efb6cce475025733c50487bd8898')
extends('python')
depends_on('py-pyside')
depends_on('py-ipython')
depends_on('py-pyparsing')
depends_on('py-six')
depends_on('py-dateutil')
depends_on('py-pytz')
depends_on('py-nose')
depends_on('py-numpy')
def install(self, spec, prefix):
python('setup.py', 'install', '--prefix=%s' % prefix)
if str(self.version) == '1.4.2':
# hack to fix configuration file
config_file = None
for p,d,f in os.walk(prefix.lib):
for file in f:
if file.find('matplotlibrc') != -1:
config_file = join_path(p, 'matplotlibrc')
print config_file
if config_file == None:
raise InstallError('could not find config file')
filter_file(r'backend : pyside',
'backend : Qt4Agg',
config_file)
filter_file(r'#backend.qt4 : PyQt4',
'backend.qt4 : PySide',
config_file)

View File

@@ -0,0 +1,13 @@
from spack import *
class PyMpi4py(Package):
"""This package provides Python bindings for the Message Passing Interface (MPI) standard. It is implemented on top of the MPI-1/MPI-2 specification and exposes an API which grounds on the standard MPI-2 C++ bindings."""
homepage = "https://pypi.python.org/pypi/mpi4py"
url = "https://pypi.python.org/packages/source/m/mpi4py/mpi4py-1.3.1.tar.gz"
version('1.3.1', 'dbe9d22bdc8ed965c23a7ceb6f32fc3c')
extends('python')
depends_on('mpi')
def install(self, spec, prefix):
python('setup.py', 'install', '--prefix=%s' % prefix)

View File

@@ -0,0 +1,13 @@
from spack import *
class PyMx(Package):
"""The eGenix.com mx Base Distribution for Python is a collection of professional quality software tools which enhance Python's usability in many important areas such as fast text searching, date/time processing and high speed data types."""
homepage = "http://www.egenix.com/products/python/mxBase/"
url = "https://downloads.egenix.com/python/egenix-mx-base-3.2.8.tar.gz"
version('3.2.8', '9d9d3a25f9dc051a15e97f452413423b')
extends('python')
def install(self, spec, prefix):
python('setup.py', 'install', '--prefix=%s' % prefix)

View File

@@ -0,0 +1,15 @@
from spack import *
class PyNose(Package):
"""nose extends the test loading and running features of unittest,
making it easier to write, find and run tests."""
homepage = "https://pypi.python.org/pypi/nose"
url = "https://pypi.python.org/packages/source/n/nose/nose-1.3.4.tar.gz"
version('1.3.4', '6ed7169887580ddc9a8e16048d38274d')
extends('python')
def install(self, spec, prefix):
python('setup.py', 'install', '--prefix=%s' % prefix)

View File

@@ -0,0 +1,14 @@
from spack import *
class PyNumpy(Package):
"""array processing for numbers, strings, records, and objects."""
homepage = "https://pypi.python.org/pypi/numpy"
url = "https://pypi.python.org/packages/source/n/numpy/numpy-1.9.1.tar.gz"
version('1.9.1', '78842b73560ec378142665e712ae4ad9')
extends('python')
depends_on('py-nose')
def install(self, spec, prefix):
python('setup.py', 'install', '--prefix=%s' % prefix)

View File

@@ -0,0 +1,13 @@
from spack import *
class PyPexpect(Package):
"""Pexpect allows easy control of interactive console applications."""
homepage = "https://pypi.python.org/pypi/pexpect"
url = "https://pypi.python.org/packages/source/p/pexpect/pexpect-3.3.tar.gz"
version('3.3', '0de72541d3f1374b795472fed841dce8')
extends('python')
def install(self, spec, prefix):
python('setup.py', 'install', '--prefix=%s' % prefix)

View File

@@ -0,0 +1,14 @@
from spack import *
class PyPil(Package):
"""The Python Imaging Library (PIL) adds image processing capabilities to your Python interpreter. This library supports many file formats, and provides powerful image processing and graphics capabilities."""
homepage = "http://www.pythonware.com/products/pil/"
url = "http://effbot.org/media/downloads/Imaging-1.1.7.tar.gz"
version('1.1.7', 'fc14a54e1ce02a0225be8854bfba478e')
extends('python')
def install(self, spec, prefix):
python('setup.py', 'install', '--prefix=%s' % prefix)

View File

@@ -0,0 +1,13 @@
from spack import *
class PyPmw(Package):
"""Pmw is a toolkit for building high-level compound widgets, or megawidgets, constructed using other widgets as component parts."""
homepage = "https://pypi.python.org/pypi/Pmw"
url = "https://pypi.python.org/packages/source/P/Pmw/Pmw-2.0.0.tar.gz"
version('2.0.0', 'c7c3f26c4f5abaa99807edefee578fc0')
extends('python')
def install(self, spec, prefix):
python('setup.py', 'install', '--prefix=%s' % prefix)

View File

@@ -0,0 +1,13 @@
from spack import *
class PyPychecker(Package):
""""""
homepage = "http://pychecker.sourceforge.net/"
url = "http://sourceforge.net/projects/pychecker/files/pychecker/0.8.19/pychecker-0.8.19.tar.gz"
version('0.8.19', 'c37182863dfb09209d6ba4f38fce9d2b')
extends('python')
def install(self, spec, prefix):
python('setup.py', 'install', '--prefix=%s' % prefix)

View File

@@ -0,0 +1,14 @@
from spack import *
class PyPygments(Package):
"""Pygments is a syntax highlighting package written in Python."""
homepage = "https://pypi.python.org/pypi/pygments"
url = "https://pypi.python.org/packages/source/P/Pygments/Pygments-2.0.1.tar.gz"
version('2.0.1', 'e0daf4c14a4fe5b630da765904de4d6c')
extends('python')
depends_on('py-setuptools')
def install(self, spec, prefix):
python('setup.py', 'install', '--prefix=%s' % prefix)

View File

@@ -0,0 +1,16 @@
from spack import *
import re
class PyPylint(Package):
"""array processing for numbers, strings, records, and objects."""
homepage = "https://pypi.python.org/pypi/pylint"
url = "https://pypi.python.org/packages/source/p/pylint/pylint-1.4.1.tar.gz"
version('1.4.1', 'df7c679bdcce5019389038847e4de622')
# extends('python')
extends('python', ignore=lambda f:re.match(r"site.py*", f))
depends_on('py-nose')
def install(self, spec, prefix):
python('setup.py', 'install', '--prefix=%s' % prefix)

View File

@@ -0,0 +1,13 @@
from spack import *
class PyPyparsing(Package):
"""A Python Parsing Module."""
homepage = "https://pypi.python.org/pypi/pyparsing"
url = "https://pypi.python.org/packages/source/p/pyparsing/pyparsing-2.0.3.tar.gz"
version('2.0.3', '0fe479be09fc2cf005f753d3acc35939')
extends('python')
def install(self, spec, prefix):
python('setup.py', 'install', '--prefix=%s' % prefix)

View File

@@ -0,0 +1,18 @@
from spack import *
class PyPyqt4(Package):
"""PyQt is a set of Python v2 and v3 bindings for Digia's Qt application framework and runs on all platforms supported by Qt including Windows, MacOS/X and Linux."""
homepage = "http://www.riverbankcomputing.com/software/pyqt/intro"
url = "http://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-4.11.3/PyQt-x11-gpl-4.11.3.tar.gz"
version('4.11.3', '997c3e443165a89a559e0d96b061bf70')
extends('python')
depends_on('qt')
depends_on('py-sip')
def install(self, spec, prefix):
version_array = str(spec['python'].version).split('.')
python('configure.py', '--confirm-license', '--destdir=%s/python%s.%s/site-packages' %(self.prefix.lib, version_array[0], version_array[1]))
make()
make('install')

View File

@@ -0,0 +1,18 @@
from spack import *
import spack.package
import os
class PyPyside(Package):
"""array processing for numbers, strings, records, and objects."""
homepage = "https://pypi.python.org/pypi/pyside"
url = "https://pypi.python.org/packages/source/P/PySide/PySide-1.2.2.tar.gz"
version('1.2.2', 'c45bc400c8a86d6b35f34c29e379e44d')
extends('python')
def install(self, spec, prefix):
qmake_path = '/usr/lib64/qt4/bin/qmake'
if not os.path.exists(qmake_path):
raise spack.package.InstallError("Failed to find qmake in %s" % qmake_path)
python('setup.py', 'install', '--prefix=%s' % prefix, '--qmake=%s' % qmake_path)

View File

@@ -0,0 +1,13 @@
from spack import *
class PyPytz(Package):
"""World timezone definitions, modern and historical."""
homepage = "https://pypi.python.org/pypi/pytz"
url = "https://pypi.python.org/packages/source/p/pytz/pytz-2014.10.tar.gz"
version('2014.10', 'eb1cb941a20c5b751352c52486aa1dd7')
extends('python')
def install(self, spec, prefix):
python('setup.py', 'install', '--prefix=%s' % prefix)

View File

@@ -0,0 +1,14 @@
from spack import *
class PyRpy2(Package):
"""rpy2 is a redesign and rewrite of rpy. It is providing a low-level interface to R from Python, a proposed high-level interface, including wrappers to graphical libraries, as well as R-like structures and functions."""
homepage = "https://pypi.python.org/pypi/rpy2"
url = "https://pypi.python.org/packages/source/r/rpy2/rpy2-2.5.4.tar.gz"
version('2.5.4', '115a20ac30883f096da2bdfcab55196d')
extends('python')
depends_on('py-setuptools')
def install(self, spec, prefix):
python('setup.py', 'install', '--prefix=%s' % prefix)

View File

@@ -0,0 +1,13 @@
from spack import *
class PyScientificpython(Package):
"""ScientificPython is a collection of Python modules for scientific computing. It contains support for geometry, mathematical functions, statistics, physical units, IO, visualization, and parallelization."""
homepage = "https://sourcesup.renater.fr/projects/scientific-py/"
url = "https://sourcesup.renater.fr/frs/download.php/4411/ScientificPython-2.8.1.tar.gz"
version('2.8.1', '73ee0df19c7b58cdf2954261f0763c77')
extends('python')
def install(self, spec, prefix):
python('setup.py', 'install', '--prefix=%s' % prefix)

View File

@@ -0,0 +1,13 @@
from spack import *
class PyScikitLearn(Package):
""""""
homepage = "https://pypi.python.org/pypi/scikit-learn"
url = "https://pypi.python.org/packages/source/s/scikit-learn/scikit-learn-0.15.2.tar.gz"
version('0.15.2', 'd9822ad0238e17b382a3c756ea94fe0d')
extends('python')
def install(self, spec, prefix):
python('setup.py', 'install', '--prefix=%s' % prefix)

View File

@@ -0,0 +1,15 @@
from spack import *
class PyScipy(Package):
"""Scientific Library for Python."""
homepage = "https://pypi.python.org/pypi/scipy"
url = "https://pypi.python.org/packages/source/s/scipy/scipy-0.15.0.tar.gz"
version('0.15.0', '639112f077f0aeb6d80718dc5019dc7a')
extends('python')
depends_on('py-nose')
depends_on('py-numpy')
def install(self, spec, prefix):
python('setup.py', 'install', '--prefix=%s' % prefix)

View File

@@ -0,0 +1,13 @@
from spack import *
class PySetuptools(Package):
"""Easily download, build, install, upgrade, and uninstall Python packages."""
homepage = "https://pypi.python.org/pypi/setuptools"
url = "https://pypi.python.org/packages/source/s/setuptools/setuptools-11.3.tar.gz"
version('11.3.1', '01f69212e019a2420c1693fb43593930')
extends('python')
def install(self, spec, prefix):
python('setup.py', 'install', '--prefix=%s' % prefix)

View File

@@ -0,0 +1,15 @@
from spack import *
class PySip(Package):
"""SIP is a tool that makes it very easy to create Python bindings for C and C++ libraries."""
homepage = "http://www.riverbankcomputing.com/software/sip/intro"
url = "http://sourceforge.net/projects/pyqt/files/sip/sip-4.16.5/sip-4.16.5.tar.gz"
version('4.16.5', '6d01ea966a53e4c7ae5c5e48c40e49e5')
extends('python')
def install(self, spec, prefix):
python('configure.py')
make()
make('install')

View File

@@ -0,0 +1,13 @@
from spack import *
class PySix(Package):
"""Python 2 and 3 compatibility utilities."""
homepage = "https://pypi.python.org/pypi/six"
url = "https://pypi.python.org/packages/source/s/six/six-1.9.0.tar.gz"
version('1.9.0', '476881ef4012262dfc8adc645ee786c4')
extends('python')
def install(self, spec, prefix):
python('setup.py', 'install', '--prefix=%s' % prefix)

View File

@@ -0,0 +1,13 @@
from spack import *
class PySympy(Package):
"""SymPy is a Python library for symbolic mathematics."""
homepage = "https://pypi.python.org/pypi/sympy"
url = "https://pypi.python.org/packages/source/s/sympy/sympy-0.7.6.tar.gz"
version('0.7.6', '3d04753974306d8a13830008e17babca')
extends('python')
def install(self, spec, prefix):
python('setup.py', 'install', '--prefix=%s' % prefix)

View File

@@ -0,0 +1,18 @@
from spack import *
import shutil
class PyVirtualenv(Package):
"""virtualenv is a tool to create isolated Python environments."""
homepage = "http://virtualenv.readthedocs.org/projects/virtualenv/"
url = "https://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.11.6.tar.gz"
version('1.11.6', 'f61cdd983d2c4e6aeabb70b1060d6f49')
extends('python')
def clean(self):
if os.path.exists('build'):
shutil.rmtree('build')
def install(self, spec, prefix):
python('setup.py', 'install', '--prefix=%s' % prefix)

View File

@@ -1,10 +1,17 @@
from spack import *
import spack
import os
import re
from contextlib import closing
class Python(Package):
"""The Python programming language."""
homepage = "http://www.python.org"
url = "http://www.python.org/ftp/python/2.7.8/Python-2.7.8.tar.xz"
extendable = True
version('2.7.8', 'd235bdfa75b8396942e360a70487ee00')
depends_on("openssl")
@@ -23,3 +30,118 @@ def install(self, spec, prefix):
"--enable-shared")
make()
make("install")
# ========================================================================
# Set up environment to make install easy for python extensions.
# ========================================================================
@property
def python_lib_dir(self):
return os.path.join('lib', 'python%d.%d' % self.version[:2])
@property
def site_packages_dir(self):
return os.path.join(self.python_lib_dir, 'site-packages')
def setup_extension_environment(self, module, spec, ext_spec):
"""Called before python modules' install() methods.
In most cases, extensions will only need to have one line::
python('setup.py', 'install', '--prefix=%s' % prefix)
"""
# Python extension builds can have a global python executable function
module.python = Executable(join_path(spec.prefix.bin, 'python'))
# Add variables for lib/pythonX.Y and lib/pythonX.Y/site-packages dirs.
module.python_lib_dir = os.path.join(ext_spec.prefix, self.python_lib_dir)
module.site_packages_dir = os.path.join(ext_spec.prefix, self.site_packages_dir)
# Add site packages directory to the PYTHONPATH
os.environ['PYTHONPATH'] = module.site_packages_dir
# Make the site packages directory if it does not exist already.
mkdirp(module.site_packages_dir)
# ========================================================================
# Handle specifics of activating and deactivating python modules.
# ========================================================================
def python_ignore(self, ext_pkg, args):
"""Add some ignore files to activate/deactivate args."""
orig_ignore = args.get('ignore', lambda f: False)
def ignore(filename):
# Always ignore easy-install.pth, as it needs to be merged.
patterns = [r'easy-install\.pth$']
# Ignore pieces of setuptools installed by other packages.
if ext_pkg.name != 'py-setuptools':
patterns.append(r'/site\.pyc?$')
patterns.append(r'setuptools\.pth')
patterns.append(r'bin/easy_install[^/]*$')
patterns.append(r'setuptools.*egg$')
return (any(re.search(p, filename) for p in patterns) or
orig_ignore(filename))
return ignore
def write_easy_install_pth(self, extensions):
paths = []
for ext in extensions:
ext_site_packages = os.path.join(ext.prefix, self.site_packages_dir)
easy_pth = "%s/easy-install.pth" % ext_site_packages
if not os.path.isfile(easy_pth):
continue
with closing(open(easy_pth)) as f:
for line in f:
line = line.rstrip()
# Skip lines matching these criteria
if not line: continue
if re.search(r'^(import|#)', line): continue
if (ext.name != 'py-setuptools' and
re.search(r'setuptools.*egg$', line)): continue
paths.append(line)
site_packages = os.path.join(self.prefix, self.site_packages_dir)
main_pth = "%s/easy-install.pth" % site_packages
if not paths:
if os.path.isfile(main_pth):
os.remove(main_pth)
else:
with closing(open(main_pth, 'w')) as f:
f.write("import sys; sys.__plen = len(sys.path)\n")
for path in paths:
f.write("%s\n" % path)
f.write("import sys; new=sys.path[sys.__plen:]; del sys.path[sys.__plen:]; "
"p=getattr(sys,'__egginsert',0); sys.path[p:p]=new; sys.__egginsert = p+len(new)\n")
def activate(self, ext_pkg, **args):
args.update(ignore=self.python_ignore(ext_pkg, args))
super(Python, self).activate(ext_pkg, **args)
extensions = set(spack.install_layout.get_extensions(self.spec))
extensions.add(ext_pkg.spec)
self.write_easy_install_pth(extensions)
def deactivate(self, ext_pkg, **args):
args.update(ignore=self.python_ignore(ext_pkg, args))
super(Python, self).deactivate(ext_pkg, **args)
extensions = set(spack.install_layout.get_extensions(self.spec))
extensions.remove(ext_pkg.spec)
self.write_easy_install_pth(extensions)

View File

@@ -45,46 +45,19 @@ def patch(self):
filter_file(r'^QMAKE_CXX *=.*$', 'QMAKE_CXX = c++', qmake_conf)
@property
def common_config_args(self):
return [
'-prefix', self.prefix,
'-v',
'-opensource',
"-release",
'-shared',
'-confirm-license',
'-openssl-linked',
'-dbus-linked',
'-optimized-qmake',
'-no-openvg',
'-no-pch',
# For now, disable all the database drivers
"-no-sql-db2", "-no-sql-ibase", "-no-sql-mysql", "-no-sql-oci", "-no-sql-odbc",
"-no-sql-psql", "-no-sql-sqlite", "-no-sql-sqlite2", "-no-sql-tds",
# NIS is deprecated in more recent glibc
"-no-nis"]
@when('@4')
def configure(self):
configure('-no-phonon',
'-no-phonon-backend',
'-fast',
*self.common_config_args)
@when('@5')
def configure(self):
configure('-no-eglfs',
'-no-directfb',
'-qt-xcb',
# If someone wants to get a webkit build working, be my guest!
'-skip', 'qtwebkit',
*self.common_config_args)
def install(self, spec, prefix):
self.configure()
configure('-v',
'-confirm-license',
'-opensource',
'-prefix', prefix,
'-openssl-linked',
'-dbus-linked',
'-fast',
'-optimized-qmake',
'-no-pch',
# phonon required for py-pyqt4
# '-no-phonon',
# '-no-phonon-backend',
'-no-openvg')
make()
make("install")