Merge branch 'features/python-modules' into develop

This commit is contained in:
Todd Gamblin
2015-02-17 00:44:02 -08:00
69 changed files with 2308 additions and 117 deletions

View File

@@ -0,0 +1,33 @@
from spack import *
class R(Package):
"""R is 'GNU S', a freely available language and environment for
statistical computing and graphics which provides a wide va
riety of statistical and graphical techniques: linear and
nonlinear modelling, statistical tests, time series analysis,
classification, clustering, etc. Please consult the R project
homepage for further information."""
homepage = "http://www.example.com"
url = "http://cran.cnr.berkeley.edu/src/base/R-3/R-3.1.2.tar.gz"
version('3.1.2', '3af29ec06704cbd08d4ba8d69250ae74')
depends_on("readline")
depends_on("ncurses")
depends_on("icu")
depends_on("glib")
depends_on("zlib")
depends_on("libtiff")
depends_on("jpeg")
depends_on("cairo")
depends_on("pango")
depends_on("freetype")
depends_on("tcl")
depends_on("tk")
def install(self, spec, prefix):
configure("--prefix=%s" % prefix,
"--enable-R-shlib",
"--enable-BLAS-shlib")
make()
make("install")

View File

@@ -0,0 +1,31 @@
from spack import *
class Geos(Package):
"""GEOS (Geometry Engine - Open Source) is a C++ port of the Java
Topology Suite (JTS). As such, it aims to contain the complete
functionality of JTS in C++. This includes all the OpenGIS
Simple Features for SQL spatial predicate functions and spatial
operators, as well as specific JTS enhanced topology functions."""
homepage = "http://trac.osgeo.org/geos/"
url = "http://download.osgeo.org/geos/geos-3.4.2.tar.bz2"
version('3.4.2', 'fc5df2d926eb7e67f988a43a92683bae')
version('3.4.1', '4c930dec44c45c49cd71f3e0931ded7e')
version('3.4.0', 'e41318fc76b5dc764a69d43ac6b18488')
version('3.3.9', '4794c20f07721d5011c93efc6ccb8e4e')
version('3.3.8', '75be476d0831a2d14958fed76ca266de')
version('3.3.7', '95ab996d22672b067d92c7dee2170460')
version('3.3.6', '6fadfb941541875f4976f75fb0bbc800')
version('3.3.5', '2ba61afb7fe2c5ddf642d82d7b16e75b')
version('3.3.4', '1bb9f14d57ef06ffa41cb1d67acb55a1')
version('3.3.3', '8454e653d7ecca475153cc88fd1daa26')
extends('python')
depends_on('swig')
def install(self, spec, prefix):
configure("--prefix=%s" % prefix,
"--enable-python")
make()
make("install")

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,19 @@
from spack import *
class Libgcrypt(Package):
"""Libgcrypt is a general purpose cryptographic library based on
the code from GnuPG. It provides functions for all cryptographic
building blocks: symmetric ciphers, hash algorithms, MACs, public
key algorithms, large integer functions, random numbers and a lot
of supporting functions. """
homepage = "http://www.gnu.org/software/libgcrypt/"
url = "ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.6.2.tar.bz2"
version('1.6.2', 'b54395a93cb1e57619943c082da09d5f')
depends_on("libgpg-error")
def install(self, spec, prefix):
configure("--prefix=%s" % prefix)
make()
make("install")

View File

@@ -0,0 +1,17 @@
from spack import *
class LibgpgError(Package):
"""Libgpg-error is a small library that defines common error
values for all GnuPG components. Among these are GPG, GPGSM,
GPGME, GPG-Agent, libgcrypt, Libksba, DirMngr, Pinentry,
SmartCard Daemon and possibly more in the future. """
homepage = "https://www.gnupg.org/related_software/libgpg-error"
url = "ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.18.tar.bz2"
version('1.18', '12312802d2065774b787cbfc22cc04e9')
def install(self, spec, prefix):
configure("--prefix=%s" % prefix)
make()
make("install")

View File

@@ -9,6 +9,9 @@ class Libxml2(Package):
version('2.9.2', '9e6a9aca9d155737868b3dc5fd82f788')
depends_on('zlib')
depends_on('xz')
def install(self, spec, prefix):
configure("--prefix=%s" % prefix,
"--without-python")

View File

@@ -0,0 +1,24 @@
from spack import *
class Libxslt(Package):
"""Libxslt is the XSLT C library developed for the GNOME
project. XSLT itself is a an XML language to define
transformation for XML. Libxslt is based on libxml2 the XML C
library developed for the GNOME project. It also implements
most of the EXSLT set of processor-portable extensions
functions and some of Saxon's evaluate and expressions
extensions."""
homepage = "http://www.xmlsoft.org/XSLT/index.html"
url = "http://xmlsoft.org/sources/libxslt-1.1.28.tar.gz"
version('1.1.28', '9667bf6f9310b957254fdcf6596600b7')
depends_on("libxml2")
depends_on("xz")
depends_on("zlib")
depends_on("libgcrypt")
def install(self, spec, prefix):
configure("--prefix=%s" % prefix)
make()
make("install")

View File

@@ -0,0 +1,20 @@
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')
extends('python')
depends_on('py-setuptools')
depends_on('py-numpy')
depends_on('py-matplotlib')
depends_on('py-pil')
depends_on("geos")
def install(self, spec, prefix):
env['GEOS_DIR'] = spec['geos'].prefix
python('setup.py', 'install', '--prefix=%s' % prefix)

View File

@@ -0,0 +1,15 @@
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')
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 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,14 @@
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')
depends_on('py-numpy')
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,15 @@
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')
depends_on('py-setuptools')
def install(self, spec, prefix):
python('setup.py', 'install', '--prefix=%s' % prefix)

View File

@@ -0,0 +1,15 @@
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')
depends_on('libxml2')
depends_on('libxslt')
def install(self, spec, prefix):
python('setup.py', 'install', '--prefix=%s' % prefix)

View File

@@ -0,0 +1,46 @@
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', ignore=r'bin/nosetests.*$')
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')
depends_on('qt')
depends_on('bzip2')
depends_on('tcl')
depends_on('tk')
depends_on('qhull')
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,14 @@
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('py-setuptools')
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,16 @@
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', ignore=r'bin/nosetests.*$')
depends_on('py-setuptools')
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')
depends_on('py-nose')
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 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,24 @@
from spack import *
class PyPyqt(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('py-sip')
# TODO: allow qt5 when conditional deps are supported.
# TODO: Fix version matching so that @4 works like @:4
depends_on('qt@:4')
def install(self, spec, prefix):
python('configure.py',
'--confirm-license',
'--destdir=%s' % site_packages_dir)
make()
make('install')

View File

@@ -0,0 +1,47 @@
from spack import *
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')
# TODO: make build dependency
# depends_on("cmake")
extends('python')
depends_on('py-setuptools')
depends_on('qt@:4')
def patch(self):
"""Undo PySide RPATH handling and add Spack RPATH."""
# Figure out the special RPATH
pypkg = self.spec['python'].package
rpath = self.rpath
rpath.append(os.path.join(self.prefix, pypkg.site_packages_dir, 'PySide'))
# Add Spack's standard CMake args to the sub-builds.
# They're called BY setup.py so we have to patch it.
filter_file(
r'OPTION_CMAKE,',
r'OPTION_CMAKE, ' + (
'"-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=FALSE", '
'"-DCMAKE_INSTALL_RPATH=%s",' % ':'.join(rpath)),
'setup.py')
# PySide tries to patch ELF files to remove RPATHs
# Disable this and go with the one we set.
filter_file(
r'^\s*rpath_cmd\(pyside_path, srcpath\)',
r'#rpath_cmd(pyside_path, srcpath)',
'pyside_postinstall.py')
def install(self, spec, prefix):
python('setup.py', 'install',
'--prefix=%s' % prefix,
'--jobs=%s' % make_jobs)

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,16 @@
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')
depends_on('R')
def install(self, spec, prefix):
python('setup.py', 'install', '--prefix=%s' % prefix)

View File

@@ -0,0 +1,17 @@
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,45 @@
from spack import *
import os
class PyShiboken(Package):
"""Shiboken generates bindings for C++ libraries using CPython source code."""
homepage = "https://shiboken.readthedocs.org/"
url = "https://pypi.python.org/packages/source/S/Shiboken/Shiboken-1.2.2.tar.gz"
version('1.2.2', '345cfebda221f525842e079a6141e555')
# TODO: make build dependency
# depends_on("cmake")
extends('python')
depends_on("py-setuptools")
depends_on("libxml2")
depends_on("qt@:4.8")
def patch(self):
"""Undo Shiboken RPATH handling and add Spack RPATH."""
# Add Spack's standard CMake args to the sub-builds.
# They're called BY setup.py so we have to patch it.
pypkg = self.spec['python'].package
rpath = self.rpath
rpath.append(os.path.join(self.prefix, pypkg.site_packages_dir, 'Shiboken'))
filter_file(
r'OPTION_CMAKE,',
r'OPTION_CMAKE, ' + (
'"-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=FALSE", '
'"-DCMAKE_INSTALL_RPATH=%s",' % ':'.join(rpath)),
'setup.py')
# Shiboken tries to patch ELF files to remove RPATHs
# Disable this and go with the one we set.
filter_file(
r'^\s*rpath_cmd\(shiboken_path, srcpath\)',
r'#rpath_cmd(shiboken_path, srcpath)',
'shiboken_postinstall.py')
def install(self, spec, prefix):
python('setup.py', 'install',
'--prefix=%s' % prefix,
'--jobs=%s' % make_jobs)

View File

@@ -0,0 +1,20 @@
from spack import *
import os
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',
'--destdir=%s' % site_packages_dir,
'--bindir=%s' % spec.prefix.bin,
'--incdir=%s' % python_include_dir,
'--sipdir=%s' % os.path.join(spec.prefix.share, 'sip'))
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,19 @@
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')
depends_on('py-setuptools')
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,19 @@
import os
import re
from contextlib import closing
from llnl.util.lang import match_predicate
from spack import *
import spack
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 +32,126 @@ 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 python_include_dir(self):
return os.path.join('include', 'python%d.%d' % self.version[:2])
@property
def site_packages_dir(self):
return os.path.join(self.python_lib_dir, 'site-packages')
def setup_dependent_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.python_include_dir = os.path.join(ext_spec.prefix, self.python_include_dir)
module.site_packages_dir = os.path.join(ext_spec.prefix, self.site_packages_dir)
# Make the site packages directory if it does not exist already.
mkdirp(module.site_packages_dir)
# Set PYTHONPATH to include site-packages dir for the
# extension and any other python extensions it depends on.
python_paths = []
for d in ext_spec.traverse():
if d.package.extends(self.spec):
python_paths.append(os.path.join(d.prefix, self.site_packages_dir))
os.environ['PYTHONPATH'] = ':'.join(python_paths)
# ========================================================================
# Handle specifics of activating and deactivating python modules.
# ========================================================================
def python_ignore(self, ext_pkg, args):
"""Add some ignore files to activate/deactivate args."""
ignore_arg = args.get('ignore', lambda f: False)
# 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 match_predicate(ignore_arg, patterns)
def write_easy_install_pth(self, exts):
paths = []
for ext in sorted(exts.values()):
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)
exts = spack.install_layout.extension_map(self.spec)
exts[ext_pkg.name] = ext_pkg.spec
self.write_easy_install_pth(exts)
def deactivate(self, ext_pkg, **args):
args.update(ignore=self.python_ignore(ext_pkg, args))
super(Python, self).deactivate(ext_pkg, **args)
exts = spack.install_layout.extension_map(self.spec)
if ext_pkg.name in exts: # Make deactivate idempotent.
del exts[ext_pkg.name]
self.write_easy_install_pth(exts)

View File

@@ -0,0 +1,27 @@
from spack import *
class Qhull(Package):
"""Qhull computes the convex hull, Delaunay triangulation, Voronoi
diagram, halfspace intersection about a point, furt hest-site
Delaunay triangulation, and furthest-site Voronoi diagram. The
source code runs in 2-d, 3-d, 4-d, and higher dimensions. Qhull
implements the Quickhull algorithm for computing the convex
hull. It handles roundoff errors from floating point
arithmetic. It computes volumes, surface areas, and
approximations to the convex hull.
Qhull does not support triangulation of non-convex surfaces,
mesh generation of non-convex objects, medium-sized inputs in
9-D and higher, alpha shapes, weighted Voronoi diagrams,
Voronoi volumes, or constrained Delaunay triangulations."""
homepage = "http://www.qhull.org"
version('1.0', 'd0f978c0d8dfb2e919caefa56ea2953c',
url="http://www.qhull.org/download/qhull-2012.1-src.tgz")
def install(self, spec, prefix):
with working_dir('spack-build', create=True):
cmake('..', *std_cmake_args)
make()
make("install")

View File

@@ -1,3 +1,4 @@
import os
from spack import *
class Qt(Package):
@@ -20,6 +21,11 @@ class Qt(Package):
depends_on("libmng")
depends_on("jpeg")
def setup_dependent_environment(self, module, spec, dep_spec):
"""Dependencies of Qt find it using the QTDIR environment variable."""
os.environ['QTDIR'] = self.prefix
def patch(self):
# Fix qmake compilers in the default mkspec
qmake_conf = 'mkspecs/common/g++-base.conf'
@@ -37,8 +43,9 @@ def install(self, spec, prefix):
'-fast',
'-optimized-qmake',
'-no-pch',
'-no-phonon',
'-no-phonon-backend',
# phonon required for py-pyqt
# '-no-phonon',
# '-no-phonon-backend',
'-no-openvg')
make()
make("install")

View File

@@ -0,0 +1,22 @@
from spack import *
class Tcl(Package):
"""Tcl (Tool Command Language) is a very powerful but easy to
learn dynamic programming language, suitable for a very wide
range of uses, including web and desktop applications,
networking, administration, testing and many more. Open source
and business-friendly, Tcl is a mature yet evolving language
that is truly cross platform, easily deployed and highly
extensible."""
homepage = "http://www.tcl.tk"
version('8.6.3', 'db382feca91754b7f93da16dc4cdad1f',
url="http://prdownloads.sourceforge.net/tcl/tcl8.6.3-src.tar.gz")
depends_on('zlib')
def install(self, spec, prefix):
with working_dir('unix'):
configure("--prefix=%s" % prefix)
make()
make("install")

View File

@@ -0,0 +1,22 @@
from spack import *
class Tk(Package):
"""Tk is a graphical user interface toolkit that takes developing
desktop applications to a higher level than conventional
approaches. Tk is the standard GUI not only for Tcl, but for
many other dynamic languages, and can produce rich, native
applications that run unchanged across Windows, Mac OS X, Linux
and more."""
homepage = "http://www.tcl.tk"
url = "http://prdownloads.sourceforge.net/tcl/tk8.6.3-src.tar.gz"
version('src', '85ca4dbf4dcc19777fd456f6ee5d0221')
depends_on("tcl")
def install(self, spec, prefix):
with working_dir('unix'):
configure("--prefix=%s" % prefix,
"--with-tcl=%s" % spec['tcl'].prefix.lib)
make()
make("install")