diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 00000000000..62fc306ec3b --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,12 @@ +coverage: + precision: 2 + round: nearest + range: 60...100 + +ignore: + - lib/spack/spack/test/.* + - lib/spack/env/.* + - lib/spack/docs/.* + - lib/spack/external/.* + +comment: off diff --git a/.travis.yml b/.travis.yml index 04db99a47b9..2e7b1c64fcb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,40 +1,37 @@ #============================================================================= # Project settings #============================================================================= -language: python - # Only build master and develop on push; do not build every branch. branches: only: - master - develop + - /^releases\/.*$/ #============================================================================= # Build matrix #============================================================================= -python: - - 2.6 - - 2.7 - -env: - - TEST_SUITE=unit - - TEST_SUITE=flake8 - - TEST_SUITE=doc - matrix: - # Flake8 and Sphinx no longer support Python 2.6, and one run is enough. - exclude: - - python: 2.6 - env: TEST_SUITE=flake8 - - python: 2.6 - env: TEST_SUITE=doc - # Explicitly include an OS X build with homebrew's python. - # Works around Python issues on Travis for OSX, described here: - # http://blog.fizyk.net.pl/blog/running-python-tests-on-traviss-osx-workers.html include: - - os: osx - language: generic - env: TEST_SUITE=unit + - python: '2.6' + os: linux + language: python + env: TEST_SUITE=unit + - python: '2.7' + os: linux + language: python + env: TEST_SUITE=unit + - python: '2.7' + os: linux + language: python + env: TEST_SUITE=flake8 + - python: '2.7' + os: linux + language: python + env: TEST_SUITE=doc + - os: osx + language: generic + env: [ TEST_SUITE=unit, PYTHON_VERSION=2.7 ] #============================================================================= # Environment @@ -60,7 +57,7 @@ before_install: # Install various dependencies install: - - pip install --upgrade coveralls + - pip install --upgrade codecov - pip install --upgrade flake8 - pip install --upgrade sphinx - pip install --upgrade mercurial @@ -79,7 +76,7 @@ before_script: script: share/spack/qa/run-$TEST_SUITE-tests after_success: - - if [[ $TEST_SUITE == unit && $TRAVIS_PYTHON_VERSION == 2.7 && $TRAVIS_OS_NAME == "linux" ]]; then coveralls; fi + - if [[ $TEST_SUITE == unit && $TRAVIS_PYTHON_VERSION == 2.7 && $TRAVIS_OS_NAME == "linux" ]]; then codecov --env PY_VERSION; fi #============================================================================= # Notifications diff --git a/README.md b/README.md index 9d005605ebc..375aad4dd7a 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ============ [![Build Status](https://travis-ci.org/LLNL/spack.svg?branch=develop)](https://travis-ci.org/LLNL/spack) -[![Coverage Status](https://coveralls.io/repos/github/LLNL/spack/badge.svg?branch=develop)](https://coveralls.io/github/LLNL/spack?branch=develop) +[![codecov](https://codecov.io/gh/LLNL/spack/branch/develop/graph/badge.svg)](https://codecov.io/gh/LLNL/spack) Spack is a package management tool designed to support multiple versions and configurations of software on a wide variety of platforms diff --git a/bin/spack b/bin/spack index 66bebe57e72..9f17443d009 100755 --- a/bin/spack +++ b/bin/spack @@ -102,19 +102,19 @@ spec expressions: [^DEPENDENCY [CONSTRAINTS] ...]""")) parser.add_argument('-d', '--debug', action='store_true', - help="Write out debug logs during compile") + help="write out debug logs during compile") parser.add_argument('-D', '--pdb', action='store_true', - help="Run spack under the pdb debugger") + help="run spack under the pdb debugger") parser.add_argument('-k', '--insecure', action='store_true', - help="Do not check ssl certificates when downloading.") + help="do not check ssl certificates when downloading") parser.add_argument('-m', '--mock', action='store_true', - help="Use mock packages instead of real ones.") + help="use mock packages instead of real ones") parser.add_argument('-p', '--profile', action='store_true', - help="Profile execution using cProfile.") + help="profile execution using cProfile") parser.add_argument('-v', '--verbose', action='store_true', - help="Print additional output during builds") + help="print additional output during builds") parser.add_argument('-s', '--stacktrace', action='store_true', - help="Add stacktrace information to all printed statements") + help="add stacktrace information to all printed statements") parser.add_argument('-V', '--version', action='version', version="%s" % spack.spack_version) diff --git a/lib/spack/docs/contribution_guide.rst b/lib/spack/docs/contribution_guide.rst index 4abf97ef924..e9cfe1fa540 100644 --- a/lib/spack/docs/contribution_guide.rst +++ b/lib/spack/docs/contribution_guide.rst @@ -75,7 +75,10 @@ This allows you to develop iteratively: make a change, test that change, make another change, test that change, etc. To get a list of all available unit tests, run: -.. command-output:: spack test --collect-only +.. command-output:: spack test --list + +A more detailed list of available unit tests can be found by running +``spack test --long-list``. Unit tests are crucial to making sure bugs aren't introduced into Spack. If you are modifying core Spack libraries or adding new functionality, please consider diff --git a/lib/spack/docs/developer_guide.rst b/lib/spack/docs/developer_guide.rst index 5ddbaf24782..dbb9a670b46 100644 --- a/lib/spack/docs/developer_guide.rst +++ b/lib/spack/docs/developer_guide.rst @@ -300,6 +300,42 @@ Stage objects Writing commands ---------------- +Adding a new command to Spack is easy. Simply add a ``.py`` file to +``lib/spack/spack/cmd/``, where ```` is the name of the subcommand. +At the bare minimum, two functions are required in this file: + +^^^^^^^^^^^^^^^^^^ +``setup_parser()`` +^^^^^^^^^^^^^^^^^^ + +Unless your command doesn't accept any arguments, a ``setup_parser()`` +function is required to define what arguments and flags your command takes. +See the `Argparse documentation `_ +for more details on how to add arguments. + +Some commands have a set of subcommands, like ``spack compiler find`` or +``spack module refresh``. You can add subparsers to your parser to handle +this. Check out ``spack edit --command compiler`` for an example of this. + +A lot of commands take the same arguments and flags. These arguments should +be defined in ``lib/spack/spack/cmd/common/arguments.py`` so that they don't +need to be redefined in multiple commands. + +^^^^^^^^^^^^ +``()`` +^^^^^^^^^^^^ + +In order to run your command, Spack searches for a function with the same +name as your command in ``.py``. This is the main method for your +command, and can call other helper methods to handle common tasks. + +Remember, before adding a new command, think to yourself whether or not this +new command is actually necessary. Sometimes, the functionality you desire +can be added to an existing command. Also remember to add unit tests for +your command. If it isn't used very frequently, changes to the rest of +Spack can cause your command to break without sufficient unit tests to +prevent this from happening. + ---------- Unit tests ---------- @@ -312,14 +348,80 @@ Unit testing Developer commands ------------------ +.. _cmd-spack-doc: + ^^^^^^^^^^^^^ ``spack doc`` ^^^^^^^^^^^^^ +.. _cmd-spack-test: + ^^^^^^^^^^^^^^ ``spack test`` ^^^^^^^^^^^^^^ +.. _cmd-spack-url: + +^^^^^^^^^^^^^ +``spack url`` +^^^^^^^^^^^^^ + +A package containing a single URL can be used to download several different +versions of the package. If you've ever wondered how this works, all of the +magic is in :mod:`spack.url`. This module contains methods for extracting +the name and version of a package from its URL. The name is used by +``spack create`` to guess the name of the package. By determining the version +from the URL, Spack can replace it with other versions to determine where to +download them from. + +The regular expressions in ``parse_name_offset`` and ``parse_version_offset`` +are used to extract the name and version, but they aren't perfect. In order +to debug Spack's URL parsing support, the ``spack url`` command can be used. + +""""""""""""""""""" +``spack url parse`` +""""""""""""""""""" + +If you need to debug a single URL, you can use the following command: + +.. command-output:: spack url parse http://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.0.tar.gz + +You'll notice that the name and version of this URL are correctly detected, +and you can even see which regular expressions it was matched to. However, +you'll notice that when it substitutes the version number in, it doesn't +replace the ``2.2`` with ``9.9`` where we would expect ``9.9.9b`` to live. +This particular package may require a ``list_url`` or ``url_for_version`` +function. + +This command also accepts a ``--spider`` flag. If provided, Spack searches +for other versions of the package and prints the matching URLs. + +"""""""""""""""""" +``spack url list`` +"""""""""""""""""" + +This command lists every URL in every package in Spack. If given the +``--color`` and ``--extrapolation`` flags, it also colors the part of +the string that it detected to be the name and version. The +``--incorrect-name`` and ``--incorrect-version`` flags can be used to +print URLs that were not being parsed correctly. + +"""""""""""""""""" +``spack url test`` +"""""""""""""""""" + +This command attempts to parse every URL for every package in Spack +and prints a summary of how many of them are being correctly parsed. +It also prints a histogram showing which regular expressions are being +matched and how frequently: + +.. command-output:: spack url test + +This command is essential for anyone adding or changing the regular +expressions that parse names and versions. By running this command +before and after the change, you can make sure that your regular +expression fixes more packages than it breaks. + --------- Profiling --------- diff --git a/lib/spack/docs/packaging_guide.rst b/lib/spack/docs/packaging_guide.rst index 708dd71c761..211e72158c4 100644 --- a/lib/spack/docs/packaging_guide.rst +++ b/lib/spack/docs/packaging_guide.rst @@ -17,7 +17,7 @@ There are two key parts of Spack: software according to a spec. Specs allow a user to describe a *particular* build in a way that a -package author can understand. Packages allow a the packager to +package author can understand. Packages allow the packager to encapsulate the build logic for different versions, compilers, options, platforms, and dependency combinations in one place. Essentially, a package translates a spec into build logic. @@ -40,87 +40,68 @@ Creating & editing packages ^^^^^^^^^^^^^^^^ The ``spack create`` command creates a directory with the package name and -generates a ``package.py`` file with a boilerplate package template from a URL. -The URL should point to a tarball or other software archive. In most cases, -``spack create`` plus a few modifications is all you need to get a package -working. +generates a ``package.py`` file with a boilerplate package template. If given +a URL pointing to a tarball or other software archive, ``spack create`` is +smart enough to determine basic information about the package, including its name +and build system. In most cases, ``spack create`` plus a few modifications is +all you need to get a package working. Here's an example: .. code-block:: console - $ spack create http://www.cmake.org/files/v2.8/cmake-2.8.12.1.tar.gz + $ spack create https://gmplib.org/download/gmp/gmp-6.1.2.tar.bz2 Spack examines the tarball URL and tries to figure out the name of the package -to be created. Once the name is determined a directory in the appropriate -repository is created with that name. Spack prefers, but does not require, that -names be lower case so the directory name will be lower case when ``spack -create`` generates it. In cases where it is desired to have mixed case or upper -case simply rename the directory. Spack also tries to determine what version -strings look like for this package. Using this information, it will try to find -*additional* versions by spidering the package's webpage. If it finds multiple -versions, Spack prompts you to tell it how many versions you want to download -and checksum: +to be created. If the name contains uppercase letters, these are automatically +converted to lowercase. If the name contains underscores or periods, these are +automatically converted to dashes. + +Spack also searches for *additional* versions located in the same directory of +the website. Spack prompts you to tell you how many versions it found and asks +you how many you would like to download and checksum: .. code-block:: console - $ spack create http://www.cmake.org/files/v2.8/cmake-2.8.12.1.tar.gz - ==> This looks like a URL for cmake version 2.8.12.1. - ==> Creating template for package cmake - ==> Found 18 versions of cmake. - 2.8.12.1 http://www.cmake.org/files/v2.8/cmake-2.8.12.1.tar.gz - 2.8.12 http://www.cmake.org/files/v2.8/cmake-2.8.12.tar.gz - 2.8.11.2 http://www.cmake.org/files/v2.8/cmake-2.8.11.2.tar.gz - ... - 2.8.0 http://www.cmake.org/files/v2.8/cmake-2.8.0.tar.gz + $ spack create https://gmplib.org/download/gmp/gmp-6.1.2.tar.bz2 + ==> This looks like a URL for gmp + ==> Found 16 versions of gmp: - Include how many checksums in the package file? (default is 5, q to abort) + 6.1.2 https://gmplib.org/download/gmp/gmp-6.1.2.tar.bz2 + 6.1.1 https://gmplib.org/download/gmp/gmp-6.1.1.tar.bz2 + 6.1.0 https://gmplib.org/download/gmp/gmp-6.1.0.tar.bz2 + ... + 5.0.0 https://gmplib.org/download/gmp/gmp-5.0.0.tar.bz2 + + How many would you like to checksum? (default is 1, q to abort) Spack will automatically download the number of tarballs you specify (starting with the most recent) and checksum each of them. You do not *have* to download all of the versions up front. You can always choose to download just one tarball initially, and run -:ref:`cmd-spack-checksum` later if you need more. - -.. note:: - - If ``spack create`` fails to detect the package name correctly, - you can try supplying it yourself, e.g.: - - .. code-block:: console - - $ spack create --name cmake http://www.cmake.org/files/v2.8/cmake-2.8.12.1.tar.gz - - If it fails entirely, you can get minimal boilerplate by using - :ref:`spack edit --force `, or you can manually create a - directory and ``package.py`` file for the package in - ``var/spack/repos/builtin/packages``, or within your own :ref:`package - repository `. - -.. note:: - - Spack can fetch packages from source code repositories, but, - ``spack create`` will *not* currently create a boilerplate package - from a repository URL. You will need to use :ref:`spack edit --force ` - and manually edit the ``version()`` directives to fetch from a - repo. See :ref:`vcs-fetch` for details. +:ref:`cmd-spack-checksum` later if you need more versions. Let's say you download 3 tarballs: -.. code-block:: none +.. code-block:: console - Include how many checksums in the package file? (default is 5, q to abort) 3 - ==> Downloading... - ==> Fetching http://www.cmake.org/files/v2.8/cmake-2.8.12.1.tar.gz - ###################################################################### 98.6% - ==> Fetching http://www.cmake.org/files/v2.8/cmake-2.8.12.tar.gz - ##################################################################### 96.7% - ==> Fetching http://www.cmake.org/files/v2.8/cmake-2.8.11.2.tar.gz - #################################################################### 95.2% + How many would you like to checksum? (default is 1, q to abort) 3 + ==> Downloading... + ==> Fetching https://gmplib.org/download/gmp/gmp-6.1.2.tar.bz2 + ######################################################################## 100.0% + ==> Fetching https://gmplib.org/download/gmp/gmp-6.1.1.tar.bz2 + ######################################################################## 100.0% + ==> Fetching https://gmplib.org/download/gmp/gmp-6.1.0.tar.bz2 + ######################################################################## 100.0% + ==> Checksummed 3 versions of gmp: + ==> This package looks like it uses the autotools build system + ==> Created template for gmp package + ==> Created package file: /Users/Adam/spack/var/spack/repos/builtin/packages/gmp/package.py -Now Spack generates boilerplate code and opens a new ``package.py`` -file in your favorite ``$EDITOR``: +Spack automatically creates a directory in the appropriate repository, +generates a boilerplate template for your package, and opens up the new +``package.py`` in your favorite ``$EDITOR``: .. code-block:: python :linenos: @@ -130,11 +111,11 @@ file in your favorite ``$EDITOR``: # next to all the things you'll want to change. Once you've handled # them, you can save this file and test your package like this: # - # spack install cmake + # spack install gmp # # You can edit this file again by typing: # - # spack edit cmake + # spack edit gmp # # See the Spack documentation for more information on packaging. # If you submit this package back to Spack as a pull request, @@ -143,33 +124,46 @@ file in your favorite ``$EDITOR``: from spack import * - class Cmake(Package): + class Gmp(AutotoolsPackage): """FIXME: Put a proper description of your package here.""" # FIXME: Add a proper url for your package's homepage here. homepage = "http://www.example.com" - url = "http://www.cmake.org/files/v2.8/cmake-2.8.12.1.tar.gz" + url = "https://gmplib.org/download/gmp/gmp-6.1.2.tar.bz2" - version('2.8.12.1', '9d38cd4e2c94c3cea97d0e2924814acc') - version('2.8.12', '105bc6d21cc2e9b6aff901e43c53afea') - version('2.8.11.2', '6f5d7b8e7534a5d9e1a7664ba63cf882') + version('6.1.2', '8ddbb26dc3bd4e2302984debba1406a5') + version('6.1.1', '4c175f86e11eb32d8bf9872ca3a8e11d') + version('6.1.0', '86ee6e54ebfc4a90b643a65e402c4048') - # FIXME: Add dependencies if this package requires them. - # depends_on("foo") + # FIXME: Add dependencies if required. + # depends_on('foo') - def install(self, spec, prefix): - # FIXME: Modify the configure line to suit your build system here. - configure("--prefix=" + prefix) - - # FIXME: Add logic to build and install here - make() - make("install") + def configure_args(self): + # FIXME: Add arguments other than --prefix + # FIXME: If not needed delete the function + args = [] + return args The tedious stuff (creating the class, checksumming archives) has been -done for you. +done for you. You'll notice that ``spack create`` correctly detected that +``gmp`` uses the Autotools build system. It created a new ``Gmp`` package +that subclasses the ``AutotoolsPackage`` base class. This base class +provides basic installation methods common to all Autotools packages: + +.. code-block:: bash + + ./configure --prefix=/path/to/installation/directory + + make + make check + make install + +For most Autotools packages, this is sufficient. If you need to add +additional arguments to the ``./configure`` call, add them via the +``configure_args`` function. In the generated package, the download ``url`` attribute is already -set. All the things you still need to change are marked with +set. All the things you still need to change are marked with ``FIXME`` labels. You can delete the commented instructions between the license and the first import statement after reading them. The rest of the tasks you need to do are as follows: @@ -177,28 +171,66 @@ The rest of the tasks you need to do are as follows: #. Add a description. Immediately inside the package class is a *docstring* in - triple-quotes (``"""``). It's used to generate the description + triple-quotes (``"""``). It is used to generate the description shown when users run ``spack info``. #. Change the ``homepage`` to a useful URL. The ``homepage`` is displayed when users run ``spack info`` so - that they can learn about packages. + that they can learn more about your package. #. Add ``depends_on()`` calls for the package's dependencies. ``depends_on`` tells Spack that other packages need to be built - and installed before this one. See :ref:`dependencies`. + and installed before this one. See :ref:`dependencies`. -#. Get the ``install()`` method working. +#. Get the installation working. - The ``install()`` method implements the logic to build a - package. The code should look familiar; it is designed to look - like a shell script. Specifics will differ depending on the package, - and :ref:`implementing the install method ` is + Your new package may require specific flags during ``configure``. + These can be added via ``configure_args``. Specifics will differ + depending on the package and its build system. + :ref:`Implementing the install method ` is covered in detail later. -Before going into details, we'll cover a few more basics. +Passing a URL to ``spack create`` is a convenient and easy way to get +a basic package template, but what if your software is licensed and +cannot be downloaded from a URL? You can still create a boilerplate +``package.py`` by telling ``spack create`` what name you want to use: + +.. code-block:: console + + $ spack create --name intel + +This will create a simple ``intel`` package with an ``install()`` +method that you can craft to install your package. + +What if ``spack create `` guessed the wrong name or build system? +For example, if your package uses the Autotools build system but does +not come with a ``configure`` script, Spack won't realize it uses +Autotools. You can overwrite the old package with ``--force`` and specify +a name with ``--name`` or a build system template to use with ``--template``: + +.. code-block:: console + + $ spack create --name gmp https://gmplib.org/download/gmp/gmp-6.1.2.tar.bz2 + $ spack create --force --template autotools https://gmplib.org/download/gmp/gmp-6.1.2.tar.bz2 + +.. note:: + + If you are creating a package that uses the Autotools build system + but does not come with a ``configure`` script, you'll need to add an + ``autoreconf`` method to your package that explains how to generate + the ``configure`` script. You may also need the following dependencies: + + .. code-block:: python + + depends_on('autoconf', type='build') + depends_on('automake', type='build') + depends_on('libtool', type='build') + depends_on('m4', type='build') + +A complete list of available build system templates can be found by running +``spack create --help``. .. _cmd-spack-edit: @@ -206,76 +238,29 @@ Before going into details, we'll cover a few more basics. ``spack edit`` ^^^^^^^^^^^^^^ -One of the easiest ways to learn to write packages is to look at +One of the easiest ways to learn how to write packages is to look at existing ones. You can edit a package file by name with the ``spack edit`` command: .. code-block:: console - $ spack edit cmake + $ spack edit gmp So, if you used ``spack create`` to create a package, then saved and closed the resulting file, you can get back to it with ``spack edit``. -The ``cmake`` package actually lives in -``$SPACK_ROOT/var/spack/repos/builtin/packages/cmake/package.py``, -but this provides a much simpler shortcut and saves you the trouble -of typing the full path. - -If you try to edit a package that doesn't exist, Spack will recommend -using ``spack create`` or ``spack edit --force``: - -.. code-block:: console - - $ spack edit foo - ==> Error: No package 'foo'. Use spack create, or supply -f/--force to edit a new file. - -.. _spack-edit-f: - -^^^^^^^^^^^^^^^^^^^^^^ -``spack edit --force`` -^^^^^^^^^^^^^^^^^^^^^^ - -``spack edit --force`` can be used to create a new, minimal boilerplate -package: - -.. code-block:: console - - $ spack edit --force foo - -Unlike ``spack create``, which infers names and versions, and which -actually downloads the tarball and checksums it for you, ``spack edit ---force`` has no such fanciness. It will substitute dummy values for you -to fill in yourself: - -.. code-block:: python - :linenos: - - from spack import * - - class Foo(Package): - """Description""" - - homepage = "http://www.example.com" - url = "http://www.example.com/foo-1.0.tar.gz" - - version('1.0', '0123456789abcdef0123456789abcdef') - - def install(self, spec, prefix): - configure("--prefix=%s" % prefix) - make() - make("install") - -This is useful when ``spack create`` cannot figure out the name and -version of your package from the archive URL. +The ``gmp`` package actually lives in +``$SPACK_ROOT/var/spack/repos/builtin/packages/gmp/package.py``, +but ``spack edit`` provides a much simpler shortcut and saves you the +trouble of typing the full path. ---------------------------- Naming & directory structure ---------------------------- This section describes how packages need to be named, and where they -live in Spack's directory structure. In general, :ref:`cmd-spack-create` and -:ref:`cmd-spack-edit` handle creating package files for you, so you can skip -most of the details here. +live in Spack's directory structure. In general, :ref:`cmd-spack-create` +handles creating package files for you, so you can skip most of the +details here. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ``var/spack/repos/builtin/packages`` @@ -308,10 +293,9 @@ directories or files (like patches) that it needs to build. Package Names ^^^^^^^^^^^^^ -Packages are named after the directory containing ``package.py``. It is -preferred, but not required, that the directory, and thus the package name, are -lower case. So, ``libelf``'s ``package.py`` lives in a directory called -``libelf``. The ``package.py`` file defines a class called ``Libelf``, which +Packages are named after the directory containing ``package.py``. So, +``libelf``'s ``package.py`` lives in a directory called ``libelf``. +The ``package.py`` file defines a class called ``Libelf``, which extends Spack's ``Package`` class. For example, here is ``$SPACK_ROOT/var/spack/repos/builtin/packages/libelf/package.py``: @@ -336,21 +320,22 @@ these: .. code-block:: console - $ spack install libelf + $ spack info libelf + $ spack versions libelf $ spack install libelf@0.8.13 Spack sees the package name in the spec and looks for -``libelf/package.py`` in ``var/spack/repos/builtin/packages``. Likewise, if you say -``spack install py-numpy``, then Spack looks for +``libelf/package.py`` in ``var/spack/repos/builtin/packages``. +Likewise, if you run ``spack install py-numpy``, Spack looks for ``py-numpy/package.py``. Spack uses the directory name as the package name in order to give -packagers more freedom in naming their packages. Package names can -contain letters, numbers, dashes, and underscores. Using a Python -identifier (e.g., a class name or a module name) would make it -difficult to support these options. So, you can name a package -``3proxy`` or ``_foo`` and Spack won't care. It just needs to see -that name in the package spec. +packagers more freedom in naming their packages. Package names can +contain letters, numbers, and dashes. Using a Python identifier +(e.g., a class name or a module name) would make it difficult to +support these options. So, you can name a package ``3proxy`` or +``foo-bar`` and Spack won't care. It just needs to see that name +in the packages directory. ^^^^^^^^^^^^^^^^^^^ Package class names @@ -359,16 +344,14 @@ Package class names Spack loads ``package.py`` files dynamically, and it needs to find a special class name in the file for the load to succeed. The **class name** (``Libelf`` in our example) is formed by converting words -separated by `-` or ``_`` in the file name to camel case. If the name +separated by ``-`` in the file name to CamelCase. If the name starts with a number, we prefix the class name with ``_``. Here are some examples: ================= ================= Module Name Class Name ================= ================= - ``foo_bar`` ``FooBar`` - ``docbook-xml`` ``DocbookXml`` - ``FooBar`` ``Foobar`` + ``foo-bar`` ``FooBar`` ``3proxy`` ``_3proxy`` ================= ================= @@ -422,70 +405,22 @@ For tarball downloads, Spack can currently support checksums using the MD5, SHA-1, SHA-224, SHA-256, SHA-384, and SHA-512 algorithms. It determines the algorithm to use based on the hash length. ------------------------ -Package Version Numbers ------------------------ +--------------------- +Versions and fetching +--------------------- -Most Spack versions are numeric, a tuple of integers; for example, -``apex@0.1``, ``ferret@6.96`` or ``py-netcdf@1.2.3.1``. Spack knows -how to compare and sort numeric versions. +The most straightforward way to add new versions to your package is to +add a line like this in the package class: -Some Spack versions involve slight extensions of numeric syntax; for -example, ``py-sphinx-rtd-theme@0.1.10a0``. In this case, numbers are -always considered to be "newer" than letters. This is for consistency -with `RPM `_. +.. code-block:: python + :linenos: -Spack versions may also be arbitrary non-numeric strings; any string -here will suffice; for example, ``@develop``, ``@master``, ``@local``. -The following rules determine the sort order of numeric -vs. non-numeric versions: + class Foo(Package): + url = 'http://example.com/foo-1.0.tar.gz' + version('8.2.1', '4136d7b4c04df68b686570afa26988ac') + ... -#. The non-numeric versions ``@develop`` is considered greatest (newest). - -#. Numeric versions are all less than ``@develop`` version, and are - sorted numerically. - -#. All other non-numeric versions are less than numeric versions, and - are sorted alphabetically. - -The logic behind this sort order is two-fold: - -#. Non-numeric versions are usually used for special cases while - developing or debugging a piece of software. Keeping most of them - less than numeric versions ensures that Spack choose numeric - versions by default whenever possible. - -#. The most-recent development version of a package will usually be - newer than any released numeric versions. This allows the - ``develop`` version to satisfy dependencies like ``depends_on(abc, - when="@x.y.z:")`` - -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Concretization Version Selection -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -When concretizing, many versions might match a user-supplied spec. -For example, the spec ``python`` matches all available versions of the -package ``python``. Similarly, ``python@3:`` matches all versions of -Python3. Given a set of versions that match a spec, Spack -concretization uses the following priorities to decide which one to -use: - -#. If the user provided a list of versions in ``packages.yaml``, the - first matching version in that list will be used. - -#. If one or more versions is specified as ``preferred=True``, in - either ``packages.yaml`` or ``package.py``, the largest matching - version will be used. ("Latest" is defined by the sort order - above). - -#. If no preferences in particular are specified in the package or in - ``packages.yaml``, then the largest matching non-develop version - will be used. By avoiding ``@develop``, this prevents users from - accidentally installing a ``@develop`` version. - -#. If all else fails and ``@develop`` is the only matching version, it - will be used. +Versions should be listed with the newest version first. ^^^^^^^^^^^^^ Date Versions @@ -501,24 +436,6 @@ Alternately, you might use a hybrid release-version / date scheme. For example, ``@1.3.2016.08.31`` would mean the version from the ``1.3`` branch, as of August 31, 2016. - -------------------- -Adding new versions -------------------- - -The most straightforward way to add new versions to your package is to -add a line like this in the package class: - -.. code-block:: python - :linenos: - - class Foo(Package): - url = 'http://example.com/foo-1.0.tar.gz' - version('8.2.1', '4136d7b4c04df68b686570afa26988ac') - ... - -Versions should be listed with the newest version first. - ^^^^^^^^^^^^ Version URLs ^^^^^^^^^^^^ @@ -583,13 +500,44 @@ way to guess the URL systematically. When you supply a custom URL for a version, Spack uses that URL *verbatim* and does not perform extrapolation. +^^^^^^^^^^^^^^^^^^^^^ +PyPI and version URLs +^^^^^^^^^^^^^^^^^^^^^ + +In addition to their developer websites, many python packages are hosted at the +`Python Package Index (PyPi) `_. Although links to +these individual files are typically `generated using a hash +`_ it is often possible to find a +reliable link of the format + +.. code-block:: sh + + https://pypi.python.org/packages/source///-. + +Packages hosted on GitHub and the like are often developer versions that do not +contain all of the files (e.g. configuration scripts) necessary to support +compilation. For this reason it is ideal to link to a repository such as PyPi +if possible. + +More recently, sources are being indexed at `pypi.io `_ as +well. Links obtained from this site follow a similar pattern, namely + +.. code-block:: sh + + https://pypi.io/packages/source///-. + +These links currently redirect back to `pypi.python.org +`_, but this `may change in the future +`_. + + ^^^^^^^^^^^^^^^^^^^^^^^^ Skipping the expand step ^^^^^^^^^^^^^^^^^^^^^^^^ -Spack normally expands archives automatically after downloading -them. If you want to skip this step (e.g., for self-extracting -executables and other custom archive types), you can add +Spack normally expands archives (e.g. `*.tar.gz` and `*.zip`) automatically +after downloading them. If you want to skip this step (e.g., for +self-extracting executables and other custom archive types), you can add ``expand=False`` to a ``version`` directive. .. code-block:: python @@ -613,6 +561,79 @@ it executable, then runs it with some arguments. installer = Executable(self.stage.archive_file) installer('--prefix=%s' % prefix, 'arg1', 'arg2', 'etc.') +^^^^^^^^^^^^^^^^ +Download caching +^^^^^^^^^^^^^^^^ + +Spack maintains a cache (described :ref:`here `) which saves files +retrieved during package installations to avoid re-downloading in the case that +a package is installed with a different specification (but the same version) or +reinstalled on account of a change in the hashing scheme. + +^^^^^^^^^^^^^^^^^^ +Version comparison +^^^^^^^^^^^^^^^^^^ + +Most Spack versions are numeric, a tuple of integers; for example, +``apex@0.1``, ``ferret@6.96`` or ``py-netcdf@1.2.3.1``. Spack knows +how to compare and sort numeric versions. + +Some Spack versions involve slight extensions of numeric syntax; for +example, ``py-sphinx-rtd-theme@0.1.10a0``. In this case, numbers are +always considered to be "newer" than letters. This is for consistency +with `RPM `_. + +Spack versions may also be arbitrary non-numeric strings; any string +here will suffice; for example, ``@develop``, ``@master``, ``@local``. +The following rules determine the sort order of numeric +vs. non-numeric versions: + +#. The non-numeric versions ``@develop`` is considered greatest (newest). + +#. Numeric versions are all less than ``@develop`` version, and are + sorted numerically. + +#. All other non-numeric versions are less than numeric versions, and + are sorted alphabetically. + +The logic behind this sort order is two-fold: + +#. Non-numeric versions are usually used for special cases while + developing or debugging a piece of software. Keeping most of them + less than numeric versions ensures that Spack choose numeric + versions by default whenever possible. + +#. The most-recent development version of a package will usually be + newer than any released numeric versions. This allows the + ``develop`` version to satisfy dependencies like ``depends_on(abc, + when="@x.y.z:")`` + +^^^^^^^^^^^^^^^^^ +Version selection +^^^^^^^^^^^^^^^^^ + +When concretizing, many versions might match a user-supplied spec. +For example, the spec ``python`` matches all available versions of the +package ``python``. Similarly, ``python@3:`` matches all versions of +Python3. Given a set of versions that match a spec, Spack +concretization uses the following priorities to decide which one to +use: + +#. If the user provided a list of versions in ``packages.yaml``, the + first matching version in that list will be used. + +#. If one or more versions is specified as ``preferred=True``, in + either ``packages.yaml`` or ``package.py``, the largest matching + version will be used. ("Latest" is defined by the sort order + above). + +#. If no preferences in particular are specified in the package or in + ``packages.yaml``, then the largest matching non-develop version + will be used. By avoiding ``@develop``, this prevents users from + accidentally installing a ``@develop`` version. + +#. If all else fails and ``@develop`` is the only matching version, it + will be used. ^^^^^^^^^^^^^ ``spack md5`` @@ -691,8 +712,8 @@ is at ``http://example.com/downloads/foo-1.0.tar.gz``, Spack will look in ``http://example.com/downloads/`` for links to additional versions. If you need to search another path for download links, you can supply some extra attributes that control how your package finds new -versions. See the documentation on `attribute_list_url`_ and -`attribute_list_depth`_. +versions. See the documentation on :ref:`attribute_list_url` and +:ref:`attribute_list_depth`. .. note:: @@ -707,12 +728,108 @@ versions. See the documentation on `attribute_list_url`_ and syntax errors, or the ``import`` will fail. Use this once you've got your package in working order. +-------------------- +Finding new versions +-------------------- + +You've already seen the ``homepage`` and ``url`` package attributes: + +.. code-block:: python + :linenos: + + from spack import * + + + class Mpich(Package): + """MPICH is a high performance and widely portable implementation of + the Message Passing Interface (MPI) standard.""" + homepage = "http://www.mpich.org" + url = "http://www.mpich.org/static/downloads/3.0.4/mpich-3.0.4.tar.gz" + +These are class-level attributes used by Spack to show users +information about the package, and to determine where to download its +source code. + +Spack uses the tarball URL to extrapolate where to find other tarballs +of the same package (e.g. in :ref:`cmd-spack-checksum`, but +this does not always work. This section covers ways you can tell +Spack to find tarballs elsewhere. + +.. _attribute_list_url: + +^^^^^^^^^^^^ +``list_url`` +^^^^^^^^^^^^ + +When spack tries to find available versions of packages (e.g. with +:ref:`cmd-spack-checksum`), it spiders the parent directory +of the tarball in the ``url`` attribute. For example, for libelf, the +url is: + +.. code-block:: python + + url = "http://www.mr511.de/software/libelf-0.8.13.tar.gz" + +Here, Spack spiders ``http://www.mr511.de/software/`` to find similar +tarball links and ultimately to make a list of available versions of +``libelf``. + +For many packages, the tarball's parent directory may be unlistable, +or it may not contain any links to source code archives. In fact, +many times additional package downloads aren't even available in the +same directory as the download URL. + +For these, you can specify a separate ``list_url`` indicating the page +to search for tarballs. For example, ``libdwarf`` has the homepage as +the ``list_url``, because that is where links to old versions are: + +.. code-block:: python + :linenos: + + class Libdwarf(Package): + homepage = "http://www.prevanders.net/dwarf.html" + url = "http://www.prevanders.net/libdwarf-20130729.tar.gz" + list_url = homepage + +.. _attribute_list_depth: + +^^^^^^^^^^^^^^ +``list_depth`` +^^^^^^^^^^^^^^ + +``libdwarf`` and many other packages have a listing of available +versions on a single webpage, but not all do. For example, ``mpich`` +has a tarball URL that looks like this: + +.. code-block:: python + + url = "http://www.mpich.org/static/downloads/3.0.4/mpich-3.0.4.tar.gz" + +But its downloads are in many different subdirectories of +``http://www.mpich.org/static/downloads/``. So, we need to add a +``list_url`` *and* a ``list_depth`` attribute: + +.. code-block:: python + :linenos: + + class Mpich(Package): + homepage = "http://www.mpich.org" + url = "http://www.mpich.org/static/downloads/3.0.4/mpich-3.0.4.tar.gz" + list_url = "http://www.mpich.org/static/downloads/" + list_depth = 2 + +By default, Spack only looks at the top-level page available at +``list_url``. ``list_depth`` tells it to follow up to 2 levels of +links from the top-level page. Note that here, this implies two +levels of subdirectories, as the ``mpich`` website is structured much +like a filesystem. But ``list_depth`` really refers to link depth +when spidering the page. .. _vcs-fetch: ------------------------------- -Fetching from VCS repositories ------------------------------- +------------------------------- +Fetching from code repositories +------------------------------- For some packages, source code is provided in a Version Control System (VCS) repository rather than in a tarball. Spack can fetch packages @@ -810,9 +927,9 @@ Submodules .. _github-fetch: -"""""" +^^^^^^ GitHub -"""""" +^^^^^^ If a project is hosted on GitHub, *any* valid Git branch, tag or hash may be downloaded as a tarball. This is accomplished simply by @@ -892,38 +1009,8 @@ Fetching a revision Subversion branches are handled as part of the directory structure, so you can check out a branch or tag by changing the ``url``. ------------------------------------------ -Standard repositories for python packages ------------------------------------------ - -In addition to their developer websites, many python packages are hosted at the -`Python Package Index (PyPi) `_. Although links to -these individual files are typically `generated using a hash -`_ it is often possible to find a -reliable link of the format - -.. code-block:: sh - - https://pypi.python.org/packages/source///-. - -Packages hosted on GitHub and the like are often developer versions that do not -contain all of the files (e.g. configuration scripts) necessary to support -compilation. For this reason it is ideal to link to a repository such as PyPi -if possible. - -More recently, sources are being indexed at `pypi.io `_ as -well. Links obtained from this site follow a similar pattern, namely - -.. code-block:: sh - - https://pypi.io/packages/source///-. - -These links currently redirect back to `pypi.python.org -`_, but this `may change in the future -`_. - ------------------------------------------------- -Expanding additional resources in the source tree +Resources (expanding extra tarballs) ------------------------------------------------- Some packages (most notably compilers) provide optional features if additional @@ -943,15 +1030,6 @@ Based on the keywords present among the arguments the appropriate ``FetchStrateg will be used for the resource. The keyword ``destination`` is relative to the source root of the package and should point to where the resource is to be expanded. ------------------------------------------------------- -Automatic caching of files fetched during installation ------------------------------------------------------- - -Spack maintains a cache (described :ref:`here `) which saves files -retrieved during package installations to avoid re-downloading in the case that -a package is installed with a different specification (but the same version) or -reinstalled on account of a change in the hashing scheme. - .. _license: ----------------- @@ -1116,20 +1194,28 @@ structure like this: package.py ad_lustre_rwcontig_open_source.patch -If you supply a URL instead of a filename, the patch will be fetched -from the URL and then applied to your source code. +If you supply a URL instead of a filename, you need to supply a checksum, +like this: -.. warning:: +.. code-block:: python - It is generally better to use a filename rather than a URL for your - patch. Patches fetched from URLs are not currently checksummed, - and adding checksums for them is tedious for the package builder. - File patches go into the spack repository, which gives you git's - integrity guarantees. URL patches may be removed in a future spack - version. + patch('http://www.nwchem-sw.org/images/Tddft_mxvec20.patch.gz', + md5='f91c6a04df56e228fe946291d2f38c9a') + +This directive provides an ``md5`` checksum. You can use other hashing +algorihtms like ``sha256`` as well. The patch will be fetched from the +URL, checked, and applied to your source code. You can use the ``spack +md5`` command to generate a checksum for a patch file. ``patch`` can take two options keyword arguments. They are: +"""""""""""""""""""""""""""""""""""""" +``md5``, ``sha256``, ``sha512``, etc. +"""""""""""""""""""""""""""""""""""""" + +Use one of these when you supply a patch to be downloaded from a remote +site. The downloaded file will be validated using the given checksum. + """""""" ``when`` """""""" @@ -1251,103 +1337,6 @@ RPATHs in Spack are handled in one of three ways: links. You can see this how this is used in the :ref:`PySide example ` above. --------------------- -Finding new versions --------------------- - -You've already seen the ``homepage`` and ``url`` package attributes: - -.. code-block:: python - :linenos: - - from spack import * - - - class Mpich(Package): - """MPICH is a high performance and widely portable implementation of - the Message Passing Interface (MPI) standard.""" - homepage = "http://www.mpich.org" - url = "http://www.mpich.org/static/downloads/3.0.4/mpich-3.0.4.tar.gz" - -These are class-level attributes used by Spack to show users -information about the package, and to determine where to download its -source code. - -Spack uses the tarball URL to extrapolate where to find other tarballs -of the same package (e.g. in :ref:`cmd-spack-checksum`, but -this does not always work. This section covers ways you can tell -Spack to find tarballs elsewhere. - -.. _attribute_list_url: - -^^^^^^^^^^^^ -``list_url`` -^^^^^^^^^^^^ - -When spack tries to find available versions of packages (e.g. with -:ref:`cmd-spack-checksum`), it spiders the parent directory -of the tarball in the ``url`` attribute. For example, for libelf, the -url is: - -.. code-block:: python - - url = "http://www.mr511.de/software/libelf-0.8.13.tar.gz" - -Here, Spack spiders ``http://www.mr511.de/software/`` to find similar -tarball links and ultimately to make a list of available versions of -``libelf``. - -For many packages, the tarball's parent directory may be unlistable, -or it may not contain any links to source code archives. In fact, -many times additional package downloads aren't even available in the -same directory as the download URL. - -For these, you can specify a separate ``list_url`` indicating the page -to search for tarballs. For example, ``libdwarf`` has the homepage as -the ``list_url``, because that is where links to old versions are: - -.. code-block:: python - :linenos: - - class Libdwarf(Package): - homepage = "http://www.prevanders.net/dwarf.html" - url = "http://www.prevanders.net/libdwarf-20130729.tar.gz" - list_url = homepage - -.. _attribute_list_depth: - -^^^^^^^^^^^^^^ -``list_depth`` -^^^^^^^^^^^^^^ - -``libdwarf`` and many other packages have a listing of available -versions on a single webpage, but not all do. For example, ``mpich`` -has a tarball URL that looks like this: - -.. code-block:: python - - url = "http://www.mpich.org/static/downloads/3.0.4/mpich-3.0.4.tar.gz" - -But its downloads are in many different subdirectories of -``http://www.mpich.org/static/downloads/``. So, we need to add a -``list_url`` *and* a ``list_depth`` attribute: - -.. code-block:: python - :linenos: - - class Mpich(Package): - homepage = "http://www.mpich.org" - url = "http://www.mpich.org/static/downloads/3.0.4/mpich-3.0.4.tar.gz" - list_url = "http://www.mpich.org/static/downloads/" - list_depth = 2 - -By default, Spack only looks at the top-level page available at -``list_url``. ``list_depth`` tells it to follow up to 2 levels of -links from the top-level page. Note that here, this implies two -levels of subdirectories, as the ``mpich`` website is structured much -like a filesystem. But ``list_depth`` really refers to link depth -when spidering the page. - .. _attribute_parallel: --------------- @@ -1507,7 +1496,7 @@ Additional hybrid dependency types are (note the lack of quotes): * ****: ``type`` assumed to be ``("build", "link")``. This is the common case for compiled language usage. - + """"""""""""""""""" Dependency Formulas """"""""""""""""""" @@ -1977,7 +1966,7 @@ See the :ref:`concretization-preferences` section for more details. .. _install-method: ------------------ -Inconsistent Specs +Conflicting Specs ------------------ Suppose a user needs to install package C, which depends on packages A @@ -2016,36 +2005,122 @@ the Python extensions provided by them: once for ``+python`` and once for ``~python``. Other than using a little extra disk space, that solution has no serious problems. ------------------------------------ -Implementing the ``install`` method ------------------------------------ +.. _installation_procedure: -The last element of a package is its ``install()`` method. This is +--------------------------------------- +Implementing the installation procedure +--------------------------------------- + +The last element of a package is its **installation procedure**. This is where the real work of installation happens, and it's the main part of the package you'll need to customize for each piece of software. -.. literalinclude:: ../../../var/spack/repos/builtin/packages/mpfr/package.py - :pyobject: Mpfr.install - :linenos: +Defining an installation procedure means overriding a set of methods or attributes +that will be called at some point during the installation of the package. +The package base class, usually specialized for a given build system, determines the +actual set of entities available for overriding. +The classes that are currently provided by Spack are: -``install`` takes a ``spec``: a description of how the package should -be built, and a ``prefix``: the path to the directory where the -software should be installed. + +------------------------------------+----------------------------------+ + | | **Base class purpose** | + +====================================+==================================+ + | :py:class:`.Package` | General base class not | + | | specialized for any build system | + +------------------------------------+----------------------------------+ + | :py:class:`.MakefilePackage` | Specialized class for packages | + | | built invoking | + | | hand-written Makefiles | + +------------------------------------+----------------------------------+ + | :py:class:`.AutotoolsPackage` | Specialized class for packages | + | | built using GNU Autotools | + +------------------------------------+----------------------------------+ + | :py:class:`.CMakePackage` | Specialized class for packages | + | | built using CMake | + +------------------------------------+----------------------------------+ + | :py:class:`.RPackage` | Specialized class for | + | | :py:class:`.R` extensions | + +------------------------------------+----------------------------------+ + | :py:class:`.PythonPackage` | Specialized class for | + | | :py:class:`.Python` extensions | + +------------------------------------+----------------------------------+ -Spack provides wrapper functions for ``configure`` and ``make`` so -that you can call them in a similar way to how you'd call a shell -command. In reality, these are Python functions. Spack provides -these functions to make writing packages more natural. See the section -on :ref:`shell wrappers `. -Now that the metadata is out of the way, we can move on to the -``install()`` method. When a user runs ``spack install``, Spack -fetches an archive for the correct version of the software, expands -the archive, and sets the current working directory to the root -directory of the expanded archive. It then instantiates a package -object and calls the ``install()`` method. -The ``install()`` signature looks like this: +.. note:: + Choice of the appropriate base class for a package + In most cases packagers don't have to worry about the selection of the right base class + for a package, as ``spack create`` will make the appropriate choice on their behalf. In those + rare cases where manual intervention is needed we need to stress that a + package base class depends on the *build system* being used, not the language of the package. + For example, a Python extension installed with CMake would ``extends('python')`` and + subclass from :py:class:`.CMakePackage`. + +^^^^^^^^^^^^^^^^^^^^^ +Installation pipeline +^^^^^^^^^^^^^^^^^^^^^ + +When a user runs ``spack install``, Spack: + +1. Fetches an archive for the correct version of the software. +2. Expands the archive. +3. Sets the current working directory to the root directory of the expanded archive. + +Then, depending on the base class of the package under consideration, it will execute +a certain number of **phases** that reflect the way a package of that type is usually built. +The name and order in which the phases will be executed can be obtained either reading the API +docs at :py:mod:`~.spack.build_systems`, or using the ``spack info`` command: + +.. code-block:: console + :emphasize-lines: 13,14 + + $ spack info m4 + AutotoolsPackage: m4 + Homepage: https://www.gnu.org/software/m4/m4.html + + Safe versions: + 1.4.17 ftp://ftp.gnu.org/gnu/m4/m4-1.4.17.tar.gz + + Variants: + Name Default Description + + sigsegv on Build the libsigsegv dependency + + Installation Phases: + autoreconf configure build install + + Build Dependencies: + libsigsegv + + ... + + +Typically, phases have default implementations that fit most of the common cases: + +.. literalinclude:: ../../../lib/spack/spack/build_systems/autotools.py + :pyobject: AutotoolsPackage.configure + :linenos: + +It is thus just sufficient for a packager to override a few +build system specific helper methods or attributes to provide, for instance, +configure arguments: + +.. literalinclude:: ../../../var/spack/repos/builtin/packages/m4/package.py + :pyobject: M4.configure_args + :linenos: + +.. note:: + Each specific build system has a list of attributes that can be overridden to + fine-tune the installation of a package without overriding an entire phase. To + have more information on them the place to go is the API docs of the :py:mod:`~.spack.build_systems` + module. + +^^^^^^^^^^^^^^^^^^^^^^^^^^ +Overriding an entire phase +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +In extreme cases it may be necessary to override an entire phase. Regardless +of the build system, the signature is the same. For example, the signature +for the install phase is: .. code-block:: python @@ -2053,8 +2128,6 @@ The ``install()`` signature looks like this: def install(self, spec, prefix): ... -The parameters are as follows: - ``self`` For those not used to Python instance methods, this is the package itself. In this case it's an instance of ``Foo``, which @@ -2071,24 +2144,20 @@ The parameters are as follows: targets into. It acts like a string, but it's actually its own special type, :py:class:`Prefix `. -``spec`` and ``prefix`` are passed to ``install`` for convenience. -``spec`` is also available as an attribute on the package -(``self.spec``), and ``prefix`` is actually an attribute of ``spec`` -(``spec.prefix``). +The arguments ``spec`` and ``prefix`` are passed only for convenience, as they always +correspond to ``self.spec`` and ``self.spec.prefix`` respectively. -As mentioned in :ref:`install-environment`, you will usually not need -to refer to dependencies explicitly in your package file, as the -compiler wrappers take care of most of the heavy lifting here. There -will be times, though, when you need to refer to the install locations -of dependencies, or when you need to do something different depending -on the version, compiler, dependencies, etc. that your package is -built with. These parameters give you access to this type of -information. +As mentioned in :ref:`install-environment`, you will usually not need to refer +to dependencies explicitly in your package file, as the compiler wrappers take care of most of +the heavy lifting here. There will be times, though, when you need to refer to +the install locations of dependencies, or when you need to do something different +depending on the version, compiler, dependencies, etc. that your package is +built with. These parameters give you access to this type of information. .. _install-environment: ----------------------- -The install environment +The build environment ----------------------- In general, you should not have to do much differently in your install @@ -2106,6 +2175,17 @@ custom Makefiles, you may need to add logic to modify the makefiles. The remainder of the section covers the way Spack's build environment works. +^^^^^^^^^^^^^^^^^^^^^ +Forking ``install()`` +^^^^^^^^^^^^^^^^^^^^^ + +To give packagers free reign over their install environment, Spack forks +a new process each time it invokes a package's ``install()`` method. +This allows packages to have a sandboxed build environment, without +impacting the environments ofother jobs that the main Spack process runs. +Packages are free to change the environment or to modify Spack internals, +because each ``install()`` call has its own dedicated process. + ^^^^^^^^^^^^^^^^^^^^^ Environment variables ^^^^^^^^^^^^^^^^^^^^^ @@ -2127,6 +2207,10 @@ The Compiler environment variables that Spack sets are: ``FC`` Fortran 90 and above compiler ============ =============================== +Spack sets these variables so that they point to *compiler +wrappers*. These are covered in :ref:`their own section +` below. + All of these are standard variables respected by most build systems. If your project uses ``Autotools`` or ``CMake``, then it should pick them up automatically when you run ``configure`` or ``cmake`` in the @@ -2174,145 +2258,9 @@ if you want to run commands in that environment to test them out, you can use the :ref:`cmd-spack-env` command, documented below. -.. _compiler-wrappers: - ^^^^^^^^^^^^^^^^^^^^^ -Compiler interceptors -^^^^^^^^^^^^^^^^^^^^^ - -As mentioned, ``CC``, ``CXX``, ``F77``, and ``FC`` are set to point to -Spack's compiler wrappers. These are simply called ``cc``, ``c++``, -``f77``, and ``f90``, and they live in ``$SPACK_ROOT/lib/spack/env``. - -``$SPACK_ROOT/lib/spack/env`` is added first in the ``PATH`` -environment variable when ``install()`` runs so that system compilers -are not picked up instead. - -All of these compiler wrappers point to a single compiler wrapper -script that figures out which *real* compiler it should be building -with. This comes either from spec `concretization -`_ or from a user explicitly asking for a -particular compiler using, e.g., ``%intel`` on the command line. - -In addition to invoking the right compiler, the compiler wrappers add -flags to the compile line so that dependencies can be easily found. -These flags are added for each dependency, if they exist: - -Compile-time library search paths -* ``-L$dep_prefix/lib`` -* ``-L$dep_prefix/lib64`` - -Runtime library search paths (RPATHs) -* ``$rpath_flag$dep_prefix/lib`` -* ``$rpath_flag$dep_prefix/lib64`` - -Include search paths -* ``-I$dep_prefix/include`` - -An example of this would be the ``libdwarf`` build, which has one -dependency: ``libelf``. Every call to ``cc`` in the ``libdwarf`` -build will have ``-I$LIBELF_PREFIX/include``, -``-L$LIBELF_PREFIX/lib``, and ``$rpath_flag$LIBELF_PREFIX/lib`` -inserted on the command line. This is done transparently to the -project's build system, which will just think it's using a system -where ``libelf`` is readily available. Because of this, you **do -not** have to insert extra ``-I``, ``-L``, etc. on the command line. - -Another useful consequence of this is that you often do *not* have to -add extra parameters on the ``configure`` line to get autotools to -find dependencies. The ``libdwarf`` install method just calls -configure like this: - -.. code-block:: python - - configure("--prefix=" + prefix) - -Because of the ``-L`` and ``-I`` arguments, configure will -successfully find ``libdwarf.h`` and ``libdwarf.so``, without the -packager having to provide ``--with-libdwarf=/path/to/libdwarf`` on -the command line. - -.. note:: - - For most compilers, ``$rpath_flag`` is ``-Wl,-rpath,``. However, NAG - passes its flags to GCC instead of passing them directly to the linker. - Therefore, its ``$rpath_flag`` is doubly wrapped: ``-Wl,-Wl,,-rpath,``. - ``$rpath_flag`` can be overriden on a compiler specific basis in - ``lib/spack/spack/compilers/$compiler.py``. - -The compiler wrappers also pass the compiler flags specified by the user from -the command line (``cflags``, ``cxxflags``, ``fflags``, ``cppflags``, ``ldflags``, -and/or ``ldlibs``). They do not override the canonical autotools flags with the -same names (but in ALL-CAPS) that may be passed into the build by particularly -challenging package scripts. - -^^^^^^^^^^^^^^ -Compiler flags -^^^^^^^^^^^^^^ - -In rare circumstances such as compiling and running small unit tests, a package -developer may need to know what are the appropriate compiler flags to enable -features like ``OpenMP``, ``c++11``, ``c++14`` and alike. To that end the -compiler classes in ``spack`` implement the following **properties**: -``openmp_flag``, ``cxx11_flag``, ``cxx14_flag``, which can be accessed in a -package by ``self.compiler.cxx11_flag`` and alike. Note that the implementation -is such that if a given compiler version does not support this feature, an -error will be produced. Therefore package developers can also use these properties -to assert that a compiler supports the requested feature. This is handy when a -package supports additional variants like - -.. code-block:: python - - variant('openmp', default=True, description="Enable OpenMP support.") - -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Message Parsing Interface (MPI) -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -It is common for high performance computing software/packages to use ``MPI``. -As a result of conretization, a given package can be built using different -implementations of MPI such as ``Openmpi``, ``MPICH`` or ``IntelMPI``. -In some scenarios, to configure a package, one has to provide it with appropriate MPI -compiler wrappers such as ``mpicc``, ``mpic++``. -However different implementations of ``MPI`` may have different names for those -wrappers. In order to make package's ``install()`` method indifferent to the -choice ``MPI`` implementation, each package which implements ``MPI`` sets up -``self.spec.mpicc``, ``self.spec.mpicxx``, ``self.spec.mpifc`` and ``self.spec.mpif77`` -to point to ``C``, ``C++``, ``Fortran 90`` and ``Fortran 77`` ``MPI`` wrappers. -Package developers are advised to use these variables, for example ``self.spec['mpi'].mpicc`` -instead of hard-coding ``join_path(self.spec['mpi'].prefix.bin, 'mpicc')`` for -the reasons outlined above. - -^^^^^^^^^^^^^^^^^^^^^^^^^ -Blas and Lapack libraries -^^^^^^^^^^^^^^^^^^^^^^^^^ - -Different packages provide implementation of ``Blas`` and ``Lapack`` routines. -The names of the resulting static and/or shared libraries differ from package -to package. In order to make the ``install()`` method independent of the -choice of ``Blas`` implementation, each package which provides it -sets up ``self.spec.blas_libs`` to point to the correct ``Blas`` libraries. -The same applies to packages which provide ``Lapack``. Package developers are advised to -use these variables, for example ``spec['blas'].blas_libs.joined()`` instead of -hard-coding ``join_path(spec['blas'].prefix.lib, 'libopenblas.so')``. - -^^^^^^^^^^^^^^^^^^^^^ -Forking ``install()`` -^^^^^^^^^^^^^^^^^^^^^ - -To give packagers free reign over their install environment, Spack -forks a new process each time it invokes a package's ``install()`` -method. This allows packages to have their own completely sandboxed -build environment, without impacting other jobs that the main Spack -process runs. Packages are free to change the environment or to -modify Spack internals, because each ``install()`` call has its own -dedicated process. - -.. _prefix-objects: - ------------------ Failing the build ------------------ +^^^^^^^^^^^^^^^^^^^^^ Sometimes you don't want a package to successfully install unless some condition is true. You can explicitly cause the build to fail from @@ -2323,9 +2271,89 @@ condition is true. You can explicitly cause the build to fail from if spec.architecture.startswith('darwin'): raise InstallError('This package does not build on Mac OS X!') --------------- +.. _shell-wrappers: + +^^^^^^^^^^^^^^^^^^^^^^^ +Shell command functions +^^^^^^^^^^^^^^^^^^^^^^^ + +Recall the install method from ``libelf``: + +.. literalinclude:: ../../../var/spack/repos/builtin/packages/libelf/package.py + :pyobject: Libelf.install + :linenos: + +Normally in Python, you'd have to write something like this in order +to execute shell commands: + +.. code-block:: python + + import subprocess + subprocess.check_call('configure', '--prefix={0}'.format(prefix)) + +We've tried to make this a bit easier by providing callable wrapper +objects for some shell commands. By default, ``configure``, +``cmake``, and ``make`` wrappers are are provided, so you can call +them more naturally in your package files. + +If you need other commands, you can use ``which`` to get them: + +.. code-block:: python + + sed = which('sed') + sed('s/foo/bar/', filename) + +The ``which`` function will search the ``PATH`` for the application. + +Callable wrappers also allow spack to provide some special features. +For example, in Spack, ``make`` is parallel by default, and Spack +figures out the number of cores on your machine and passes an +appropriate value for ``-j`` when it calls ``make`` (see the +``parallel`` `package attribute `). In +a package file, you can supply a keyword argument, ``parallel=False``, +to the ``make`` wrapper to disable parallel make. In the ``libelf`` +package, this allows us to avoid race conditions in the library's +build system. + +^^^^^^^^^^^^^^ +Compiler flags +^^^^^^^^^^^^^^ + +In rare circumstances such as compiling and running small unit tests, a +package developer may need to know what are the appropriate compiler +flags to enable features like ``OpenMP``, ``c++11``, ``c++14`` and +alike. To that end the compiler classes in ``spack`` implement the +following **properties**: ``openmp_flag``, ``cxx11_flag``, +``cxx14_flag``, which can be accessed in a package by +``self.compiler.cxx11_flag`` and alike. Note that the implementation is +such that if a given compiler version does not support this feature, an +error will be produced. Therefore package developers can also use these +properties to assert that a compiler supports the requested feature. This +is handy when a package supports additional variants like + +.. code-block:: python + + variant('openmp', default=True, description="Enable OpenMP support.") + +^^^^^^^^^^^^^^^^^^^^^^^^^ +Blas and Lapack libraries +^^^^^^^^^^^^^^^^^^^^^^^^^ + +Different packages provide implementation of ``Blas`` and ``Lapack`` +routines. The names of the resulting static and/or shared libraries +differ from package to package. In order to make the ``install()`` method +independent of the choice of ``Blas`` implementation, each package which +provides it sets up ``self.spec.blas_libs`` to point to the correct +``Blas`` libraries. The same applies to packages which provide +``Lapack``. Package developers are advised to use these variables, for +example ``spec['blas'].blas_libs.joined()`` instead of hard-coding +``join_path(spec['blas'].prefix.lib, 'libopenblas.so')``. + +.. _prefix-objects: + +^^^^^^^^^^^^^^^^^^^^^ Prefix objects --------------- +^^^^^^^^^^^^^^^^^^^^^ Spack passes the ``prefix`` parameter to the install method so that you can pass it to ``configure``, ``cmake``, or some other installer, @@ -2594,56 +2622,254 @@ method (the one without the ``@when`` decorator) will be called. versions. There's not much we can do to get around this because of the way decorators work. +.. _compiler-wrappers: -.. _shell-wrappers: +--------------------- +Compiler wrappers +--------------------- ------------------------ -Shell command functions ------------------------ +As mentioned, ``CC``, ``CXX``, ``F77``, and ``FC`` are set to point to +Spack's compiler wrappers. These are simply called ``cc``, ``c++``, +``f77``, and ``f90``, and they live in ``$SPACK_ROOT/lib/spack/env``. -Recall the install method from ``libelf``: +``$SPACK_ROOT/lib/spack/env`` is added first in the ``PATH`` +environment variable when ``install()`` runs so that system compilers +are not picked up instead. -.. literalinclude:: ../../../var/spack/repos/builtin/packages/libelf/package.py - :pyobject: Libelf.install - :linenos: +All of these compiler wrappers point to a single compiler wrapper +script that figures out which *real* compiler it should be building +with. This comes either from spec `concretization +`_ or from a user explicitly asking for a +particular compiler using, e.g., ``%intel`` on the command line. -Normally in Python, you'd have to write something like this in order -to execute shell commands: +In addition to invoking the right compiler, the compiler wrappers add +flags to the compile line so that dependencies can be easily found. +These flags are added for each dependency, if they exist: + +Compile-time library search paths +* ``-L$dep_prefix/lib`` +* ``-L$dep_prefix/lib64`` + +Runtime library search paths (RPATHs) +* ``$rpath_flag$dep_prefix/lib`` +* ``$rpath_flag$dep_prefix/lib64`` + +Include search paths +* ``-I$dep_prefix/include`` + +An example of this would be the ``libdwarf`` build, which has one +dependency: ``libelf``. Every call to ``cc`` in the ``libdwarf`` +build will have ``-I$LIBELF_PREFIX/include``, +``-L$LIBELF_PREFIX/lib``, and ``$rpath_flag$LIBELF_PREFIX/lib`` +inserted on the command line. This is done transparently to the +project's build system, which will just think it's using a system +where ``libelf`` is readily available. Because of this, you **do +not** have to insert extra ``-I``, ``-L``, etc. on the command line. + +Another useful consequence of this is that you often do *not* have to +add extra parameters on the ``configure`` line to get autotools to +find dependencies. The ``libdwarf`` install method just calls +configure like this: .. code-block:: python - import subprocess - subprocess.check_call('configure', '--prefix={0}'.format(prefix)) + configure("--prefix=" + prefix) -We've tried to make this a bit easier by providing callable wrapper -objects for some shell commands. By default, ``configure``, -``cmake``, and ``make`` wrappers are are provided, so you can call -them more naturally in your package files. +Because of the ``-L`` and ``-I`` arguments, configure will +successfully find ``libdwarf.h`` and ``libdwarf.so``, without the +packager having to provide ``--with-libdwarf=/path/to/libdwarf`` on +the command line. -If you need other commands, you can use ``which`` to get them: +.. note:: + + For most compilers, ``$rpath_flag`` is ``-Wl,-rpath,``. However, NAG + passes its flags to GCC instead of passing them directly to the linker. + Therefore, its ``$rpath_flag`` is doubly wrapped: ``-Wl,-Wl,,-rpath,``. + ``$rpath_flag`` can be overriden on a compiler specific basis in + ``lib/spack/spack/compilers/$compiler.py``. + +The compiler wrappers also pass the compiler flags specified by the user from +the command line (``cflags``, ``cxxflags``, ``fflags``, ``cppflags``, ``ldflags``, +and/or ``ldlibs``). They do not override the canonical autotools flags with the +same names (but in ALL-CAPS) that may be passed into the build by particularly +challenging package scripts. + +--------------------- +MPI support in Spack +--------------------- + +It is common for high performance computing software/packages to use the +Message Passing Interface ( ``MPI``). As a result of conretization, a +given package can be built using different implementations of MPI such as +``Openmpi``, ``MPICH`` or ``IntelMPI``. That is, when your package +declares that it ``depends_on('mpi')``, it can be built with any of these +``mpi`` implementations. In some scenarios, to configure a package, one +has to provide it with appropriate MPI compiler wrappers such as +``mpicc``, ``mpic++``. However different implementations of ``MPI`` may +have different names for those wrappers. + +Spack provides an idiomatic way to use MPI compilers in your package. To +use MPI wrappers to compile your whole build, do this in your +``install()`` method: .. code-block:: python - sed = which('sed') - sed('s/foo/bar/', filename) + env['CC'] = spec['mpi'].mpicc + env['CXX'] = spec['mpi'].mpicxx + env['F77'] = spec['mpi'].mpif77 + env['FC'] = spec['mpi'].mpifc -The ``which`` function will search the ``PATH`` for the application. +That's all. A longer explanation of why this works is below. -Callable wrappers also allow spack to provide some special features. -For example, in Spack, ``make`` is parallel by default, and Spack -figures out the number of cores on your machine and passes an -appropriate value for ``-j`` when it calls ``make`` (see the -``parallel`` `package attribute `). In -a package file, you can supply a keyword argument, ``parallel=False``, -to the ``make`` wrapper to disable parallel make. In the ``libelf`` -package, this allows us to avoid race conditions in the library's -build system. +We don't try to force any particular build method on packagers. The +decision to use MPI wrappers depends on the way the package is written, +on common practice, and on "what works". Loosely, There are three types +of MPI builds: + + 1. Some build systems work well without the wrappers and can treat MPI + as an external library, where the person doing the build has to + supply includes/libs/etc. This is fairly uncommon. + + 2. Others really want the wrappers and assume you're using an MPI + "compiler" – i.e., they have no mechanism to add MPI + includes/libraries/etc. + + 3. CMake's ``FindMPI`` needs the compiler wrappers, but it uses them to + extract ``–I`` / ``-L`` / ``-D`` arguments, then treats MPI like a + regular library. + +Note that some CMake builds fall into case 2 because they either don't +know about or don't like CMake's ``FindMPI`` support – they just assume +an MPI compiler. Also, some autotools builds fall into case 3 (e.g. `here +is an autotools version of CMake's FindMPI +`_). + +Given all of this, we leave the use of the wrappers up to the packager. +Spack will support all three ways of building MPI packages. + +^^^^^^^^^^^^^^^^^^^^^ +Packaging Conventions +^^^^^^^^^^^^^^^^^^^^^ + +As mentioned above, in the ``install()`` method, ``CC``, ``CXX``, +``F77``, and ``FC`` point to Spack's wrappers around the chosen compiler. +Spack's wrappers are not the MPI compiler wrappers, though they do +automatically add ``–I``, ``–L``, and ``–Wl,-rpath`` args for +dependencies in a similar way. The MPI wrappers are a bit different in +that they also add ``-l`` arguments for the MPI libraries, and some add +special ``-D`` arguments to trigger build options in MPI programs. + +For case 1 above, you generally don't need to do more than patch your +Makefile or add configure args as you normally would. + +For case 3, you don't need to do much of anything, as Spack puts the MPI +compiler wrappers in the PATH, and the build will find them and +interrogate them. + +For case 2, things are a bit more complicated, as you'll need to tell the +build to use the MPI compiler wrappers instead of Spack's compiler +wrappers. All it takes some lines like this: + +.. code-block:: python + + env['CC'] = spec['mpi'].mpicc + env['CXX'] = spec['mpi'].mpicxx + env['F77'] = spec['mpi'].mpif77 + env['FC'] = spec['mpi'].mpifc + +Or, if you pass CC, CXX, etc. directly to your build with, e.g., +`--with-cc=`, you'll want to substitute `spec['mpi'].mpicc` in +there instead, e.g.: + +.. code-block:: python + + configure('—prefix=%s' % prefix, + '—with-cc=%s' % spec['mpi'].mpicc) + +Now, you may think that doing this will lose the includes, library paths, +and RPATHs that Spack's compiler wrapper get you, but we've actually set +things up so that the MPI compiler wrappers use Spack's compiler wrappers +when run from within Spack. So using the MPI wrappers should really be as +simple as the code above. + +^^^^^^^^^^^^^^^^^^^^^ +``spec['mpi']`` +^^^^^^^^^^^^^^^^^^^^^ + +Ok, so how does all this work? + +If your package has a virtual dependency like ``mpi``, then referring to +``spec['mpi']`` within ``install()`` will get you the concrete ``mpi`` +implementation in your dependency DAG. That is a spec object just like +the one passed to install, only the MPI implementations all set some +additional properties on it to help you out. E.g., in mvapich2, you'll +find this: + +.. code-block:: python + + def setup_dependent_package(self, module, dep_spec): + self.spec.mpicc = join_path(self.prefix.bin, 'mpicc') + # … etc … + +That code allows the mvapich2 package to associate an ``mpicc`` property +with the ``mvapich2`` node in the DAG, so that dependents can access it. +``openmpi`` and ``mpich`` do similar things. So, no matter what MPI +you're using, spec['mpi'].mpicc gets you the location of the MPI +compilers. This allows us to have a fairly simple polymorphic interface +for information about virtual dependencies like MPI. + +^^^^^^^^^^^^^^^^^^^^^ +Wrapping wrappers +^^^^^^^^^^^^^^^^^^^^^ + +Spack likes to use its own compiler wrappers to make it easy to add +``RPATHs`` to builds, and to try hard to ensure that your builds use the +right dependencies. This doesn't play nicely by default with MPI, so we +have to do a couple tricks. + + 1. If we build MPI with Spack's wrappers, mpicc and friends will be + installed with hard-coded paths to Spack's wrappers, and using them + from outside of Spack will fail because they only work within Spack. + To fix this, we patch mpicc and friends to use the regular + compilers. Look at the filter_compilers method in mpich, openmpi, + or mvapich2 for details. + + 2. We still want to use the Spack compiler wrappers when Spack is + calling mpicc. Luckily, wrappers in all mainstream MPI + implementations provide environment variables that allow us to + dynamically set the compiler to be used by mpicc, mpicxx, etc. + Denis pasted some code from this below – Spack's build environment + sets ``MPICC``, ``MPICXX``, etc. for mpich derivatives and + ``OMPI_CC``, ``OMPI_CXX``, etc. for OpenMPI. This makes the MPI + compiler wrappers use the Spack compiler wrappers so that your + dependencies still get proper RPATHs even if you use the MPI + wrappers. + +^^^^^^^^^^^^^^^^^^^^^ +MPI on Cray machines +^^^^^^^^^^^^^^^^^^^^^ + +The Cray programming environment notably uses ITS OWN compiler wrappers, +which function like MPI wrappers. On Cray systems, the ``CC``, ``cc``, +and ``ftn`` wrappers ARE the MPI compiler wrappers, and it's assumed that +you'll use them for all of your builds. So on Cray we don't bother with +``mpicc``, ``mpicxx``, etc, Spack MPI implementations set +``spec['mpi'].mpicc`` to point to Spack's wrappers, which wrap the Cray +wrappers, which wrap the regular compilers and include MPI flags. That +may seem complicated, but for packagers, that means the same code for +using MPI wrappers will work, even on even on a Cray: + +.. code-block:: python + + env['CC'] = spec['mpi'].mpicc + +This is because on Cray, ``spec['mpi'].mpicc`` is just ``spack_cc``. .. _sanity-checks: -------------------------------- -Sanity checking an installation -------------------------------- +------------------------ +Checking an installation +------------------------ By default, Spack assumes that a build has failed if nothing is written to the install prefix, and that it has succeeded if anything @@ -2662,16 +2888,18 @@ Consider a simple autotools build like this: If you are using using standard autotools or CMake, ``configure`` and ``make`` will not write anything to the install prefix. Only ``make install`` writes the files, and only once the build is already -complete. Not all builds are like this. Many builds of scientific -software modify the install prefix *before* ``make install``. Builds -like this can falsely report that they were successfully installed if -an error occurs before the install is complete but after files have -been written to the ``prefix``. +complete. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ``sanity_check_is_file`` and ``sanity_check_is_dir`` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Unfortunately, many builds of scientific +software modify the install prefix *before* ``make install``. Builds +like this can falsely report that they were successfully installed if +an error occurs before the install is complete but after files have +been written to the ``prefix``. + You can optionally specify *sanity checks* to deal with this problem. Add properties like this to your package: @@ -2695,6 +2923,48 @@ the build will fail and the install prefix will be removed. If they succeed, Spack considers the build successful and keeps the prefix in place. +^^^^^^^^^^^^^^^^ +Build-time tests +^^^^^^^^^^^^^^^^ + +Sometimes packages finish to build "correctly" and issues with their run-time +behavior are discovered only at a later stage, maybe after a full software stack +relying on them has already been built. To avoid situations of that kind it's possible +to write build-time tests that will be executed only if the option ``--run-tests`` +of ``spack install`` has been activated. + +The proper way to write these tests is relying on two decorators that come with +any base class listed in :ref:`installation_procedure`. + +.. code-block:: python + + @run_after('build') + @on_package_attributes(run_tests=True) + def check_build(self): + # Custom implementation goes here + pass + +The first decorator ``run_after('build')`` schedules this +function to be invoked after the ``build`` phase has been executed, while the +second one makes the invocation conditional on the fact that ``self.run_tests == True``. +It is also possible to schedule a function to be invoked *before* a given phase +using the ``run_before`` decorator. + +.. note:: + + Default implementations for build-time tests + + Packages that are built using specific build systems may already have a + default implementation for build-time tests. For instance :py:class:`~.AutotoolsPackage` + based packages will try to invoke ``make test`` and ``make check`` if + Spack is asked to run tests. + More information on each class is available in the the :py:mod:`~.spack.build_systems` + documentation. + +.. warning:: + + The API for adding tests is not yet considered stable and may change drastically in future releases. + .. _file-manipulation: --------------------------- @@ -2719,7 +2989,7 @@ running: from spack import * This is already part of the boilerplate for packages created with -``spack create`` or ``spack edit``. +``spack create``. ^^^^^^^^^^^^^^^^^^^ Filtering functions @@ -2856,9 +3126,9 @@ File functions .. _package-lifecycle: ------------------------ -Coding Style Guidelines ------------------------ +----------------------------- +Style guidelines for packages +----------------------------- The following guidelines are provided, in the interests of making Spack packages work in a consistent manner: diff --git a/lib/spack/docs/tutorial_sc16_modules.rst b/lib/spack/docs/tutorial_sc16_modules.rst index 407f679ae68..0a79d943f96 100644 --- a/lib/spack/docs/tutorial_sc16_modules.rst +++ b/lib/spack/docs/tutorial_sc16_modules.rst @@ -45,7 +45,7 @@ Add a new compiler ^^^^^^^^^^^^^^^^^^ Spack automatically scans the environment to search for available -compilers on first use. On a Ubuntu 14.04 a fresh clone will show +compilers on first use. On Ubuntu 14.04, a fresh clone will show something like this: .. code-block:: console @@ -58,9 +58,10 @@ something like this: -- gcc ---------------------------------------------------------- gcc@4.8 -For the purpose of building a limited set of packages with some features -that will help showcasing the capabilities of -module customization the first thing we need is to build a new compiler: +In order to showcase the capabilities of module customization, we will want to +build a limited set of packages with multiple compilers. If you do not already +have multiple compilers listed by ``spack compilers``, you should build one +with Spack: .. code-block:: console @@ -85,7 +86,7 @@ Then we can use shell support for modules to add it to the list of known compile -- gcc ---------------------------------------------------------- gcc@6.2.0 gcc@4.8 -Note that the final 7 digits hash at the end of the generated module may vary depending +Note that the 7-digit hash at the end of the generated module may vary depending on architecture or package version. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -96,16 +97,11 @@ Next you should install a few modules that will be used in the tutorial: .. code-block:: console - $ spack install netlib-scalapack ^openmpi ^openblas - # ... - -The packages you need to install are: - -- ``netlib-scalapack ^openmpi ^openblas`` -- ``netlib-scalapack ^mpich ^openblas`` -- ``netlib-scalapack ^openmpi ^netlib-lapack`` -- ``netlib-scalapack ^mpich ^netlib-lapack`` -- ``py-scipy ^openblas`` + $ spack install netlib-scalapack ^openmpi ^openblas + $ spack install netlib-scalapack ^mpich ^openblas + $ spack install netlib-scalapack ^openmpi ^netlib-lapack + $ spack install netlib-scalapack ^mpich ^netlib-lapack + $ spack install py-scipy ^openblas In the end your environment should look something like: @@ -500,7 +496,7 @@ Regenerating the module files should result in something like: Fortran, and Java. ]]) -As you see the ``gcc`` module has the environment variable ``GCC_ROOT`` set. +As you can see, the ``gcc`` module has the environment variable ``GCC_ROOT`` set. Sometimes it's also useful to apply environment modifications selectively and target only certain packages. You can, for instance set the common variables ``CC``, ``CXX``, @@ -727,7 +723,7 @@ Core/Compiler/MPI The most common hierarchy is the so called ``Core/Compiler/MPI``. To have an idea how a hierarchy is organized you may refer to the -`Lmod guide `_. +`Lmod guide `_. Since ``lmod`` is not enabled by default, you need to add it to the list of enabled module file generators. The other things you need to do are: @@ -782,9 +778,10 @@ After modifications the configuration file will be: purpose of overriding the default list of enabled generators so that only ``lmod`` will be active (see :ref:`the reference manual ` for a more detailed explanation of - config scopes). + config scopes). If a single colon is used, it will append instead + of override. -The directive ``core_compilers`` accepts a list of compilers : everything built +The directive ``core_compilers`` accepts a list of compilers; everything built using these compilers will create a module in the ``Core`` part of the hierarchy. It is common practice to put the OS provided compilers in the list and only build common utilities and other compilers in ``Core``. diff --git a/lib/spack/env/cc b/lib/spack/env/cc index c4e51834a5f..c0e97f3416f 100755 --- a/lib/spack/env/cc +++ b/lib/spack/env/cc @@ -98,25 +98,25 @@ case "$command" in cpp) mode=cpp ;; - cc|c89|c99|gcc|clang|icc|pgcc|xlc) + cc|c89|c99|gcc|clang|icc|pgcc|xlc|xlc_r) command="$SPACK_CC" language="C" comp="CC" lang_flags=C ;; - c++|CC|g++|clang++|icpc|pgc++|xlc++) + c++|CC|g++|clang++|icpc|pgc++|xlc++|xlc++_r) command="$SPACK_CXX" language="C++" comp="CXX" lang_flags=CXX ;; - ftn|f90|fc|f95|gfortran|ifort|pgfortran|xlf90|nagfor) + ftn|f90|fc|f95|gfortran|ifort|pgfortran|xlf90|xlf90_r|nagfor) command="$SPACK_FC" language="Fortran 90" comp="FC" lang_flags=F ;; - f77|gfortran|ifort|pgfortran|xlf|nagfor|ftn) + f77|gfortran|ifort|pgfortran|xlf|xlf_r|nagfor|ftn) command="$SPACK_F77" language="Fortran 77" comp="F77" diff --git a/lib/spack/env/xl_r/xlc++_r b/lib/spack/env/xl_r/xlc++_r new file mode 120000 index 00000000000..82c2b8e90a3 --- /dev/null +++ b/lib/spack/env/xl_r/xlc++_r @@ -0,0 +1 @@ +../cc \ No newline at end of file diff --git a/lib/spack/env/xl_r/xlc_r b/lib/spack/env/xl_r/xlc_r new file mode 120000 index 00000000000..82c2b8e90a3 --- /dev/null +++ b/lib/spack/env/xl_r/xlc_r @@ -0,0 +1 @@ +../cc \ No newline at end of file diff --git a/lib/spack/env/xl_r/xlf90_r b/lib/spack/env/xl_r/xlf90_r new file mode 120000 index 00000000000..82c2b8e90a3 --- /dev/null +++ b/lib/spack/env/xl_r/xlf90_r @@ -0,0 +1 @@ +../cc \ No newline at end of file diff --git a/lib/spack/env/xl_r/xlf_r b/lib/spack/env/xl_r/xlf_r new file mode 120000 index 00000000000..82c2b8e90a3 --- /dev/null +++ b/lib/spack/env/xl_r/xlf_r @@ -0,0 +1 @@ +../cc \ No newline at end of file diff --git a/lib/spack/llnl/util/filesystem.py b/lib/spack/llnl/util/filesystem.py index 31e09f2fe61..79f15f9a214 100644 --- a/lib/spack/llnl/util/filesystem.py +++ b/lib/spack/llnl/util/filesystem.py @@ -455,7 +455,12 @@ def fix_darwin_install_name(path): # fix all dependencies: for dep in deps: for loc in libs: - if dep == os.path.basename(loc): + # We really want to check for either + # dep == os.path.basename(loc) or + # dep == join_path(builddir, os.path.basename(loc)), + # but we don't know builddir (nor how symbolic links look + # in builddir). We thus only compare the basenames. + if os.path.basename(dep) == os.path.basename(loc): subprocess.Popen( ["install_name_tool", "-change", dep, loc, lib], stdout=subprocess.PIPE).communicate()[0] diff --git a/lib/spack/spack/__init__.py b/lib/spack/spack/__init__.py index 901b8f115c5..6a28fbb2b03 100644 --- a/lib/spack/spack/__init__.py +++ b/lib/spack/spack/__init__.py @@ -46,6 +46,7 @@ module_path = join_path(lib_path, "spack") platform_path = join_path(module_path, 'platforms') compilers_path = join_path(module_path, "compilers") +build_systems_path = join_path(module_path, 'build_systems') operating_system_path = join_path(module_path, 'operating_systems') test_path = join_path(module_path, "test") hooks_path = join_path(module_path, "hooks") @@ -88,7 +89,7 @@ # Initialize various data structures & objects at the core of Spack. #----------------------------------------------------------------------------- # Version information -spack_version = Version("0.9.1") +spack_version = Version("0.10.0") # Set up the default packages database. @@ -155,13 +156,24 @@ #----------------------------------------------------------------------------- __all__ = [] -from spack.package import Package +from spack.package import Package, run_before, run_after, on_package_attributes from spack.build_systems.makefile import MakefilePackage from spack.build_systems.autotools import AutotoolsPackage from spack.build_systems.cmake import CMakePackage +from spack.build_systems.python import PythonPackage from spack.build_systems.r import RPackage -__all__ += ['Package', 'CMakePackage', 'AutotoolsPackage', 'MakefilePackage', - 'RPackage'] + +__all__ += [ + 'run_before', + 'run_after', + 'on_package_attributes', + 'Package', + 'CMakePackage', + 'AutotoolsPackage', + 'MakefilePackage', + 'PythonPackage', + 'RPackage' +] from spack.version import Version, ver __all__ += ['Version', 'ver'] diff --git a/lib/spack/spack/build_systems/autotools.py b/lib/spack/spack/build_systems/autotools.py index 78a4df5e117..f0f57b12322 100644 --- a/lib/spack/spack/build_systems/autotools.py +++ b/lib/spack/spack/build_systems/autotools.py @@ -31,36 +31,68 @@ from subprocess import check_call import llnl.util.tty as tty -from llnl.util.filesystem import working_dir -from spack.package import PackageBase +from llnl.util.filesystem import working_dir, join_path, force_remove +from spack.package import PackageBase, run_after, run_before +from spack.util.executable import Executable class AutotoolsPackage(PackageBase): - """Specialized class for packages that are built using GNU Autotools + """Specialized class for packages built using GNU Autotools. This class provides four phases that can be overridden: - * autoreconf - * configure - * build - * install + 1. :py:meth:`~.AutotoolsPackage.autoreconf` + 2. :py:meth:`~.AutotoolsPackage.configure` + 3. :py:meth:`~.AutotoolsPackage.build` + 4. :py:meth:`~.AutotoolsPackage.install` They all have sensible defaults and for many packages the only thing - necessary will be to override ``configure_args`` + necessary will be to override the helper method :py:meth:`.configure_args`. + For a finer tuning you may also override: + + +-----------------------------------------------+--------------------+ + | **Method** | **Purpose** | + +===============================================+====================+ + | :py:attr:`~.AutotoolsPackage.build_targets` | Specify ``make`` | + | | targets for the | + | | build phase | + +-----------------------------------------------+--------------------+ + | :py:attr:`~.AutotoolsPackage.install_targets` | Specify ``make`` | + | | targets for the | + | | install phase | + +-----------------------------------------------+--------------------+ + | :py:meth:`~.AutotoolsPackage.check` | Run build time | + | | tests if required | + +-----------------------------------------------+--------------------+ - Additionally, you may specify make targets for build and install - phases by overriding ``build_targets`` and ``install_targets`` """ + #: Phases of a GNU Autotools package phases = ['autoreconf', 'configure', 'build', 'install'] - # To be used in UI queries that require to know which - # build-system class we are using + #: This attribute is used in UI queries that need to know the build + #: system base class build_system_class = 'AutotoolsPackage' + #: Whether or not to update ``config.guess`` on old architectures patch_config_guess = True + #: Targets for ``make`` during the :py:meth:`~.AutotoolsPackage.build` + #: phase build_targets = [] + #: Targets for ``make`` during the :py:meth:`~.AutotoolsPackage.install` + #: phase install_targets = ['install'] - def do_patch_config_guess(self): + #: Callback names for build-time test + build_time_test_callbacks = ['check'] + + #: Callback names for install-time test + install_time_test_callbacks = ['installcheck'] + + #: Set to true to force the autoreconf step even if configure is present + force_autoreconf = False + #: Options to be passed to autoreconf when using the default implementation + autoreconf_extra_args = [] + + def _do_patch_config_guess(self): """Some packages ship with an older config.guess and need to have this updated when installed on a newer architecture.""" @@ -86,7 +118,7 @@ def do_patch_config_guess(self): check_call([my_config_guess], stdout=PIPE, stderr=PIPE) # The package's config.guess already runs OK, so just use it return True - except: + except Exception: pass else: return True @@ -104,7 +136,7 @@ def do_patch_config_guess(self): check_call([config_guess], stdout=PIPE, stderr=PIPE) shutil.copyfile(config_guess, my_config_guess) return True - except: + except Exception: pass # Look for the system's config.guess @@ -121,83 +153,152 @@ def do_patch_config_guess(self): check_call([config_guess], stdout=PIPE, stderr=PIPE) shutil.copyfile(config_guess, my_config_guess) return True - except: + except Exception: pass return False - def build_directory(self): - """Override to provide another place to build the package""" + @property + def configure_directory(self): + """Returns the directory where 'configure' resides. + + :return: directory where to find configure + """ return self.stage.source_path + @property + def configure_abs_path(self): + # Absolute path to configure + configure_abs_path = join_path( + os.path.abspath(self.configure_directory), 'configure' + ) + return configure_abs_path + + @property + def build_directory(self): + """Override to provide another place to build the package""" + return self.configure_directory + def patch(self): - """Perform any required patches.""" + """Patches config.guess if + :py:attr:``~.AutotoolsPackage.patch_config_guess`` is True + + :raise RuntimeError: if something goes wrong when patching + ``config.guess`` + """ if self.patch_config_guess and self.spec.satisfies( - 'arch=linux-rhel7-ppc64le'): - if not self.do_patch_config_guess(): + 'arch=linux-rhel7-ppc64le' + ): + if not self._do_patch_config_guess(): raise RuntimeError('Failed to find suitable config.guess') + @run_before('autoreconf') + def delete_configure_to_force_update(self): + if self.force_autoreconf: + force_remove(self.configure_abs_path) + def autoreconf(self, spec, prefix): """Not needed usually, configure should be already there""" - pass + # If configure exists nothing needs to be done + if os.path.exists(self.configure_abs_path): + return + # Else try to regenerate it + autotools = ['m4', 'autoconf', 'automake', 'libtool'] + missing = [x for x in autotools if x not in spec] + if missing: + msg = 'Cannot generate configure: missing dependencies {0}' + raise RuntimeError(msg.format(missing)) + tty.msg('Configure script not found: trying to generate it') + tty.warn('*********************************************************') + tty.warn('* If the default procedure fails, consider implementing *') + tty.warn('* a custom AUTORECONF phase in the package *') + tty.warn('*********************************************************') + with working_dir(self.configure_directory): + m = inspect.getmodule(self) + # This part should be redundant in principle, but + # won't hurt + m.libtoolize() + m.aclocal() + # This line is what is needed most of the time + # --install, --verbose, --force + autoreconf_args = ['-ivf'] + if 'pkg-config' in spec: + autoreconf_args += [ + '-I', + join_path(spec['pkg-config'].prefix, 'share', 'aclocal'), + ] + autoreconf_args += self.autoreconf_extra_args + m.autoreconf(*autoreconf_args) - @PackageBase.sanity_check('autoreconf') - def is_configure_or_die(self): + @run_after('autoreconf') + def set_configure_or_die(self): """Checks the presence of a ``configure`` file after the - autoreconf phase""" - with working_dir(self.build_directory()): - if not os.path.exists('configure'): - raise RuntimeError( - 'configure script not found in {0}'.format(os.getcwd())) + autoreconf phase. If it is found sets a module attribute + appropriately, otherwise raises an error. + + :raises RuntimeError: if a configure script is not found in + :py:meth:`~.configure_directory` + """ + # Check if a configure script is there. If not raise a RuntimeError. + if not os.path.exists(self.configure_abs_path): + msg = 'configure script not found in {0}' + raise RuntimeError(msg.format(self.configure_directory)) + + # Monkey-patch the configure script in the corresponding module + inspect.getmodule(self).configure = Executable( + self.configure_abs_path + ) def configure_args(self): - """Method to be overridden. Should return an iterable containing - all the arguments that must be passed to configure, except ``--prefix`` + """Produces a list containing all the arguments that must be passed to + configure, except ``--prefix`` which will be pre-pended to the list. + + :return: list of arguments for configure """ return [] def configure(self, spec, prefix): - """Runs configure with the arguments specified in ``configure_args`` - and an appropriately set prefix + """Runs configure with the arguments specified in :py:meth:`.configure_args` + and an appropriately set prefix. """ options = ['--prefix={0}'.format(prefix)] + self.configure_args() - with working_dir(self.build_directory()): + with working_dir(self.build_directory, create=True): inspect.getmodule(self).configure(*options) def build(self, spec, prefix): - """Make the build targets""" - with working_dir(self.build_directory()): + """Makes the build targets specified by + :py:attr:``~.AutotoolsPackage.build_targets`` + """ + with working_dir(self.build_directory): inspect.getmodule(self).make(*self.build_targets) def install(self, spec, prefix): - """Make the install targets""" - with working_dir(self.build_directory()): + """Makes the install targets specified by + :py:attr:``~.AutotoolsPackage.install_targets`` + """ + with working_dir(self.build_directory): inspect.getmodule(self).make(*self.install_targets) - @PackageBase.sanity_check('build') - @PackageBase.on_package_attributes(run_tests=True) - def _run_default_function(self): - """This function is run after build if ``self.run_tests == True`` - - It will search for a method named ``check`` and run it. A sensible - default is provided in the base class. - """ - try: - fn = getattr(self, 'check') - tty.msg('Trying default sanity checks [check]') - fn() - except AttributeError: - tty.msg('Skipping default sanity checks [method `check` not implemented]') # NOQA: ignore=E501 + run_after('build')(PackageBase._run_default_build_time_test_callbacks) def check(self): - """Default test: search the Makefile for targets ``test`` and ``check`` - and run them if found. + """Searches the Makefile for targets ``test`` and ``check`` + and runs them if found. """ - with working_dir(self.build_directory()): + with working_dir(self.build_directory): self._if_make_target_execute('test') self._if_make_target_execute('check') + run_after('install')(PackageBase._run_default_install_time_test_callbacks) + + def installcheck(self): + """Searches the Makefile for an ``installcheck`` target + and runs it if found. + """ + with working_dir(self.build_directory): + self._if_make_target_execute('installcheck') + # Check that self.prefix is there after installation - PackageBase.sanity_check('install')(PackageBase.sanity_check_prefix) + run_after('install')(PackageBase.sanity_check_prefix) diff --git a/lib/spack/spack/build_systems/cmake.py b/lib/spack/spack/build_systems/cmake.py index 61d45784e8f..43d177d3cb6 100644 --- a/lib/spack/spack/build_systems/cmake.py +++ b/lib/spack/spack/build_systems/cmake.py @@ -26,52 +26,76 @@ import inspect import platform -import llnl.util.tty as tty import spack.build_environment from llnl.util.filesystem import working_dir, join_path from spack.directives import depends_on -from spack.package import PackageBase +from spack.package import PackageBase, run_after class CMakePackage(PackageBase): - """Specialized class for packages that are built using CMake + """Specialized class for packages built using CMake This class provides three phases that can be overridden: - * cmake - * build - * install + 1. :py:meth:`~.CMakePackage.cmake` + 2. :py:meth:`~.CMakePackage.build` + 3. :py:meth:`~.CMakePackage.install` They all have sensible defaults and for many packages the only thing - necessary will be to override ``cmake_args`` + necessary will be to override :py:meth:`~.CMakePackage.cmake_args`. + For a finer tuning you may also override: + + +-----------------------------------------------+--------------------+ + | **Method** | **Purpose** | + +===============================================+====================+ + | :py:meth:`~.CMakePackage.build_type` | Specify the value | + | | for the | + | | CMAKE_BUILD_TYPE | + | | variable | + +-----------------------------------------------+--------------------+ + | :py:meth:`~.CMakePackage.root_cmakelists_dir` | Location of the | + | | root CMakeLists.txt| + +-----------------------------------------------+--------------------+ + | :py:meth:`~.CMakePackage.build_directory` | Directory where to | + | | build the package | + +-----------------------------------------------+--------------------+ + - Additionally, you may specify make targets for build and install - phases by overriding ``build_targets`` and ``install_targets`` """ + #: Phases of a CMake package phases = ['cmake', 'build', 'install'] - # To be used in UI queries that require to know which - # build-system class we are using + #: This attribute is used in UI queries that need to know the build + #: system base class build_system_class = 'CMakePackage' build_targets = [] install_targets = ['install'] + build_time_test_callbacks = ['check'] + depends_on('cmake', type='build') def build_type(self): - """Override to provide the correct build_type in case a complex - logic is needed + """Returns the correct value for the ``CMAKE_BUILD_TYPE`` variable + + :return: value for ``CMAKE_BUILD_TYPE`` """ return 'RelWithDebInfo' + @property def root_cmakelists_dir(self): - """Directory where to find the root CMakeLists.txt""" + """Returns the location of the root CMakeLists.txt + + :return: directory containing the root CMakeLists.txt + """ return self.stage.source_path @property def std_cmake_args(self): """Standard cmake arguments provided as a property for convenience of package writers + + :return: standard cmake arguments """ # standard CMake arguments return CMakePackage._std_args(self) @@ -96,57 +120,52 @@ def _std_args(pkg): args.append('-DCMAKE_INSTALL_RPATH:STRING={0}'.format(rpaths)) return args + @property def build_directory(self): - """Override to provide another place to build the package""" + """Returns the directory to use when building the package + + :return: directory where to build the package + """ return join_path(self.stage.source_path, 'spack-build') def cmake_args(self): - """Method to be overridden. Should return an iterable containing - all the arguments that must be passed to configure, except: + """Produces a list containing all the arguments that must be passed to + cmake, except: - * CMAKE_INSTALL_PREFIX - * CMAKE_BUILD_TYPE + * CMAKE_INSTALL_PREFIX + * CMAKE_BUILD_TYPE + + which will be set automatically. + + :return: list of arguments for cmake """ return [] def cmake(self, spec, prefix): - """Run cmake in the build directory""" - options = [self.root_cmakelists_dir()] + self.std_cmake_args + \ + """Runs ``cmake`` in the build directory""" + options = [self.root_cmakelists_dir] + self.std_cmake_args + \ self.cmake_args() - with working_dir(self.build_directory(), create=True): + with working_dir(self.build_directory, create=True): inspect.getmodule(self).cmake(*options) def build(self, spec, prefix): """Make the build targets""" - with working_dir(self.build_directory()): + with working_dir(self.build_directory): inspect.getmodule(self).make(*self.build_targets) def install(self, spec, prefix): """Make the install targets""" - with working_dir(self.build_directory()): + with working_dir(self.build_directory): inspect.getmodule(self).make(*self.install_targets) - @PackageBase.sanity_check('build') - @PackageBase.on_package_attributes(run_tests=True) - def _run_default_function(self): - """This function is run after build if ``self.run_tests == True`` - - It will search for a method named ``check`` and run it. A sensible - default is provided in the base class. - """ - try: - fn = getattr(self, 'check') - tty.msg('Trying default build sanity checks [check]') - fn() - except AttributeError: - tty.msg('Skipping default build sanity checks [method `check` not implemented]') # NOQA: ignore=E501 + run_after('build')(PackageBase._run_default_build_time_test_callbacks) def check(self): - """Default test: search the Makefile for the target ``test`` - and run them if found. + """Searches the CMake-generated Makefile for the target ``test`` + and runs it if found. """ - with working_dir(self.build_directory()): + with working_dir(self.build_directory): self._if_make_target_execute('test') # Check that self.prefix is there after installation - PackageBase.sanity_check('install')(PackageBase.sanity_check_prefix) + run_after('install')(PackageBase.sanity_check_prefix) diff --git a/lib/spack/spack/build_systems/makefile.py b/lib/spack/spack/build_systems/makefile.py index a56f316109a..72743844782 100644 --- a/lib/spack/spack/build_systems/makefile.py +++ b/lib/spack/spack/build_systems/makefile.py @@ -27,7 +27,7 @@ import llnl.util.tty as tty from llnl.util.filesystem import working_dir -from spack.package import PackageBase +from spack.package import PackageBase, run_after class MakefilePackage(PackageBase): @@ -35,38 +35,70 @@ class MakefilePackage(PackageBase): This class provides three phases that can be overridden: - * edit - * build - * install + 1. :py:meth:`~.MakefilePackage.edit` + 2. :py:meth:`~.MakefilePackage.build` + 3. :py:meth:`~.MakefilePackage.install` - It is necessary to override the 'edit' phase, while 'build' and 'install' - have sensible defaults. + It is usually necessary to override the :py:meth:`~.MakefilePackage.edit` + phase, while :py:meth:`~.MakefilePackage.build` and + :py:meth:`~.MakefilePackage.install` have sensible defaults. + For a finer tuning you may override: + + +-----------------------------------------------+--------------------+ + | **Method** | **Purpose** | + +===============================================+====================+ + | :py:attr:`~.MakefilePackage.build_targets` | Specify ``make`` | + | | targets for the | + | | build phase | + +-----------------------------------------------+--------------------+ + | :py:attr:`~.MakefilePackage.install_targets` | Specify ``make`` | + | | targets for the | + | | install phase | + +-----------------------------------------------+--------------------+ + | :py:meth:`~.MakefilePackage.build_directory` | Directory where the| + | | Makefile is located| + +-----------------------------------------------+--------------------+ """ + #: Phases of a package that is built with an hand-written Makefile phases = ['edit', 'build', 'install'] - # To be used in UI queries that require to know which - # build-system class we are using + #: This attribute is used in UI queries that need to know the build + #: system base class build_system_class = 'MakefilePackage' + #: Targets for ``make`` during the :py:meth:`~.MakefilePackage.build` + #: phase build_targets = [] + #: Targets for ``make`` during the :py:meth:`~.MakefilePackage.install` + #: phase install_targets = ['install'] + @property def build_directory(self): - """Directory where the main Makefile is located""" + """Returns the directory containing the main Makefile + + :return: build directory + """ return self.stage.source_path def edit(self, spec, prefix): - """This phase cannot be defaulted for obvious reasons...""" + """Edits the Makefile before calling make. This phase cannot + be defaulted. + """ tty.msg('Using default implementation: skipping edit phase.') def build(self, spec, prefix): - """Make the build targets""" - with working_dir(self.build_directory()): + """Calls make, passing :py:attr:`~.MakefilePackage.build_targets` + as targets. + """ + with working_dir(self.build_directory): inspect.getmodule(self).make(*self.build_targets) def install(self, spec, prefix): - """Make the install targets""" - with working_dir(self.build_directory()): + """Calls make, passing :py:attr:`~.MakefilePackage.install_targets` + as targets. + """ + with working_dir(self.build_directory): inspect.getmodule(self).make(*self.install_targets) # Check that self.prefix is there after installation - PackageBase.sanity_check('install')(PackageBase.sanity_check_prefix) + run_after('install')(PackageBase.sanity_check_prefix) diff --git a/lib/spack/spack/build_systems/python.py b/lib/spack/spack/build_systems/python.py new file mode 100644 index 00000000000..d2ee72925da --- /dev/null +++ b/lib/spack/spack/build_systems/python.py @@ -0,0 +1,310 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# 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/llnl/spack +# Please also see the LICENSE file 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 +############################################################################## + +import inspect + +from spack.directives import extends +from spack.package import PackageBase, run_after + +from llnl.util.filesystem import working_dir + + +class PythonPackage(PackageBase): + """Specialized class for packages that are built using Python + setup.py files + + This class provides the following phases that can be overridden: + + * build + * build_py + * build_ext + * build_clib + * build_scripts + * clean + * install + * install_lib + * install_headers + * install_scripts + * install_data + * sdist + * register + * bdist + * bdist_dumb + * bdist_rpm + * bdist_wininst + * upload + * check + + These are all standard setup.py commands and can be found by running: + + .. code-block:: console + + $ python setup.py --help-commands + + By default, only the 'build' and 'install' phases are run, but if you + need to run more phases, simply modify your ``phases`` list like so: + + .. code-block:: python + + phases = ['build_ext', 'install', 'bdist'] + + Each phase provides a function that runs: + + .. code-block:: console + + $ python --no-user-cfg setup.py + + Each phase also has a function that can pass arguments to + this call. All of these functions are empty except for the ``install_args`` + function, which passes ``--prefix=/path/to/installation/directory``. + + If you need to run a phase which is not a standard setup.py command, + you'll need to define a function for it like so: + + .. code-block:: python + + def configure(self, spec, prefix): + self.setup_py('configure') + """ + # Default phases + phases = ['build', 'install'] + + # To be used in UI queries that require to know which + # build-system class we are using + build_system_class = 'PythonPackage' + + extends('python') + + def setup_file(self): + """Returns the name of the setup file to use.""" + return 'setup.py' + + @property + def build_directory(self): + """The directory containing the ``setup.py`` file.""" + return self.stage.source_path + + def python(self, *args): + inspect.getmodule(self).python(*args) + + def setup_py(self, *args): + setup = self.setup_file() + + with working_dir(self.build_directory): + self.python(setup, '--no-user-cfg', *args) + + # The following phases and their descriptions come from: + # $ python setup.py --help-commands + # Only standard commands are included here, but some packages + # define extra commands as well + + def build(self, spec, prefix): + """Build everything needed to install.""" + args = self.build_args(spec, prefix) + + self.setup_py('build', *args) + + def build_args(self, spec, prefix): + """Arguments to pass to build.""" + return [] + + def build_py(self, spec, prefix): + '''"Build" pure Python modules (copy to build directory).''' + args = self.build_py_args(spec, prefix) + + self.setup_py('build_py', *args) + + def build_py_args(self, spec, prefix): + """Arguments to pass to build_py.""" + return [] + + def build_ext(self, spec, prefix): + """Build C/C++ extensions (compile/link to build directory).""" + args = self.build_ext_args(spec, prefix) + + self.setup_py('build_ext', *args) + + def build_ext_args(self, spec, prefix): + """Arguments to pass to build_ext.""" + return [] + + def build_clib(self, spec, prefix): + """Build C/C++ libraries used by Python extensions.""" + args = self.build_clib_args(spec, prefix) + + self.setup_py('build_clib', *args) + + def build_clib_args(self, spec, prefix): + """Arguments to pass to build_clib.""" + return [] + + def build_scripts(self, spec, prefix): + '''"Build" scripts (copy and fixup #! line).''' + args = self.build_scripts_args(spec, prefix) + + self.setup_py('build_scripts', *args) + + def clean(self, spec, prefix): + """Clean up temporary files from 'build' command.""" + args = self.clean_args(spec, prefix) + + self.setup_py('clean', *args) + + def clean_args(self, spec, prefix): + """Arguments to pass to clean.""" + return [] + + def install(self, spec, prefix): + """Install everything from build directory.""" + args = self.install_args(spec, prefix) + + self.setup_py('install', *args) + + def install_args(self, spec, prefix): + """Arguments to pass to install.""" + return ['--prefix={0}'.format(prefix)] + + def install_lib(self, spec, prefix): + """Install all Python modules (extensions and pure Python).""" + args = self.install_lib_args(spec, prefix) + + self.setup_py('install_lib', *args) + + def install_lib_args(self, spec, prefix): + """Arguments to pass to install_lib.""" + return [] + + def install_headers(self, spec, prefix): + """Install C/C++ header files.""" + args = self.install_headers_args(spec, prefix) + + self.setup_py('install_headers', *args) + + def install_headers_args(self, spec, prefix): + """Arguments to pass to install_headers.""" + return [] + + def install_scripts(self, spec, prefix): + """Install scripts (Python or otherwise).""" + args = self.install_scripts_args(spec, prefix) + + self.setup_py('install_scripts', *args) + + def install_scripts_args(self, spec, prefix): + """Arguments to pass to install_scripts.""" + return [] + + def install_data(self, spec, prefix): + """Install data files.""" + args = self.install_data_args(spec, prefix) + + self.setup_py('install_data', *args) + + def install_data_args(self, spec, prefix): + """Arguments to pass to install_data.""" + return [] + + def sdist(self, spec, prefix): + """Create a source distribution (tarball, zip file, etc.).""" + args = self.sdist_args(spec, prefix) + + self.setup_py('sdist', *args) + + def sdist_args(self, spec, prefix): + """Arguments to pass to sdist.""" + return [] + + def register(self, spec, prefix): + """Register the distribution with the Python package index.""" + args = self.register_args(spec, prefix) + + self.setup_py('register', *args) + + def register_args(self, spec, prefix): + """Arguments to pass to register.""" + return [] + + def bdist(self, spec, prefix): + """Create a built (binary) distribution.""" + args = self.bdist_args(spec, prefix) + + self.setup_py('bdist', *args) + + def bdist_args(self, spec, prefix): + """Arguments to pass to bdist.""" + return [] + + def bdist_dumb(self, spec, prefix): + '''Create a "dumb" built distribution.''' + args = self.bdist_dumb_args(spec, prefix) + + self.setup_py('bdist_dumb', *args) + + def bdist_dumb_args(self, spec, prefix): + """Arguments to pass to bdist_dumb.""" + return [] + + def bdist_rpm(self, spec, prefix): + """Create an RPM distribution.""" + args = self.bdist_rpm(spec, prefix) + + self.setup_py('bdist_rpm', *args) + + def bdist_rpm_args(self, spec, prefix): + """Arguments to pass to bdist_rpm.""" + return [] + + def bdist_wininst(self, spec, prefix): + """Create an executable installer for MS Windows.""" + args = self.bdist_wininst_args(spec, prefix) + + self.setup_py('bdist_wininst', *args) + + def bdist_wininst_args(self, spec, prefix): + """Arguments to pass to bdist_wininst.""" + return [] + + def upload(self, spec, prefix): + """Upload binary package to PyPI.""" + args = self.upload_args(spec, prefix) + + self.setup_py('upload', *args) + + def upload_args(self, spec, prefix): + """Arguments to pass to upload.""" + return [] + + def check(self, spec, prefix): + """Perform some checks on the package.""" + args = self.check_args(spec, prefix) + + self.setup_py('check', *args) + + def check_args(self, spec, prefix): + """Arguments to pass to check.""" + return [] + + # Check that self.prefix is there after installation + run_after('install')(PackageBase.sanity_check_prefix) diff --git a/lib/spack/spack/build_systems/r.py b/lib/spack/spack/build_systems/r.py index f642f2dfd82..cde3dc9fdd6 100644 --- a/lib/spack/spack/build_systems/r.py +++ b/lib/spack/spack/build_systems/r.py @@ -26,7 +26,7 @@ import inspect from spack.directives import extends -from spack.package import PackageBase +from spack.package import PackageBase, run_after class RPackage(PackageBase): @@ -34,25 +34,25 @@ class RPackage(PackageBase): This class provides a single phase that can be overridden: - * install + 1. :py:meth:`~.RPackage.install` - It has sensible defaults and for many packages the only thing + It has sensible defaults, and for many packages the only thing necessary will be to add dependencies """ phases = ['install'] - # To be used in UI queries that require to know which - # build-system class we are using + #: This attribute is used in UI queries that need to know the build + #: system base class build_system_class = 'RPackage' extends('r') def install(self, spec, prefix): - """Install the R package""" + """Installs an R package.""" inspect.getmodule(self).R( 'CMD', 'INSTALL', '--library={0}'.format(self.module.r_lib_dir), self.stage.source_path) # Check that self.prefix is there after installation - PackageBase.sanity_check('install')(PackageBase.sanity_check_prefix) + run_after('install')(PackageBase.sanity_check_prefix) diff --git a/lib/spack/spack/cmd/__init__.py b/lib/spack/spack/cmd/__init__.py index 6fa08830144..764b6fffcff 100644 --- a/lib/spack/spack/cmd/__init__.py +++ b/lib/spack/spack/cmd/__init__.py @@ -39,10 +39,10 @@ # # Settings for commands that modify configuration # -# Commands that modify confguration By default modify the *highest* +# Commands that modify configuration by default modify the *highest* # priority scope. default_modify_scope = spack.config.highest_precedence_scope().name -# Commands that list confguration list *all* scopes by default. +# Commands that list configuration list *all* scopes by default. default_list_scope = None # cmd has a submodule called "list" so preserve the python list module @@ -61,7 +61,6 @@ if file.endswith(".py") and not re.search(ignore_files, file): cmd = re.sub(r'.py$', '', file) commands.append(cmd) -commands.append('test') commands.sort() diff --git a/lib/spack/spack/cmd/activate.py b/lib/spack/spack/cmd/activate.py index 797cdcb1367..f21799753b5 100644 --- a/lib/spack/spack/cmd/activate.py +++ b/lib/spack/spack/cmd/activate.py @@ -27,16 +27,16 @@ import spack import spack.cmd -description = "Activate a package extension." +description = "activate a package extension" def setup_parser(subparser): subparser.add_argument( '-f', '--force', action='store_true', - help="Activate without first activating dependencies.") + help="activate without first activating dependencies") subparser.add_argument( 'spec', nargs=argparse.REMAINDER, - help="spec of package extension to activate.") + help="spec of package extension to activate") def activate(parser, args): diff --git a/lib/spack/spack/cmd/arch.py b/lib/spack/spack/cmd/arch.py index 4e29230c288..5b9daf9dea0 100644 --- a/lib/spack/spack/cmd/arch.py +++ b/lib/spack/spack/cmd/arch.py @@ -24,14 +24,14 @@ ############################################################################## import spack.architecture as architecture -description = "Print architecture information about this machine." +description = "print architecture information about this machine" def setup_parser(subparser): parts = subparser.add_mutually_exclusive_group() parts.add_argument( '-p', '--platform', action='store_true', default=False, - help="Print only the platform.") + help="print only the platform") def arch(parser, args): diff --git a/lib/spack/spack/cmd/bootstrap.py b/lib/spack/spack/cmd/bootstrap.py index a79ef4aa680..a804086a389 100644 --- a/lib/spack/spack/cmd/bootstrap.py +++ b/lib/spack/spack/cmd/bootstrap.py @@ -32,7 +32,7 @@ _SPACK_UPSTREAM = 'https://github.com/llnl/spack' -description = "Create a new installation of spack in another prefix" +description = "create a new installation of spack in another prefix" def setup_parser(subparser): diff --git a/lib/spack/spack/cmd/build.py b/lib/spack/spack/cmd/build.py index 703705a32ca..6a90af907d8 100644 --- a/lib/spack/spack/cmd/build.py +++ b/lib/spack/spack/cmd/build.py @@ -26,11 +26,12 @@ from spack import * -description = 'Stops at build stage when installing a package, if possible' +description = 'stops at build stage when installing a package, if possible' build_system_to_phase = { CMakePackage: 'build', - AutotoolsPackage: 'build' + AutotoolsPackage: 'build', + PythonPackage: 'build' } diff --git a/lib/spack/spack/cmd/cd.py b/lib/spack/spack/cmd/cd.py index cf7232258c0..784ad4ac83c 100644 --- a/lib/spack/spack/cmd/cd.py +++ b/lib/spack/spack/cmd/cd.py @@ -25,7 +25,7 @@ import spack.cmd.location import spack.modules -description = "cd to spack directories in the shell." +description = "cd to spack directories in the shell" def setup_parser(subparser): diff --git a/lib/spack/spack/cmd/checksum.py b/lib/spack/spack/cmd/checksum.py index b45cfcbd399..4ea31efe08b 100644 --- a/lib/spack/spack/cmd/checksum.py +++ b/lib/spack/spack/cmd/checksum.py @@ -22,6 +22,8 @@ # License along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## +from __future__ import print_function + import argparse import hashlib @@ -30,93 +32,133 @@ import spack.cmd import spack.util.crypto from spack.stage import Stage, FailedDownloadError +from spack.util.naming import * from spack.version import * -description = "Checksum available versions of a package." +description = "checksum available versions of a package" def setup_parser(subparser): subparser.add_argument( - 'package', metavar='PACKAGE', help='Package to list versions for') + 'package', + help='package to checksum versions for') subparser.add_argument( - '--keep-stage', action='store_true', dest='keep_stage', - help="Don't clean up staging area when command completes.") + '--keep-stage', action='store_true', + help="don't clean up staging area when command completes") subparser.add_argument( 'versions', nargs=argparse.REMAINDER, - help='Versions to generate checksums for') + help='versions to generate checksums for') -def get_checksums(versions, urls, **kwargs): - # Allow commands like create() to do some analysis on the first - # archive after it is downloaded. +def get_checksums(url_dict, name, **kwargs): + """Fetches and checksums archives from URLs. + + This function is called by both ``spack checksum`` and ``spack create``. + The ``first_stage_function`` kwarg allows ``spack create`` to determine + things like the build system of the archive. + + :param dict url_dict: A dictionary of the form: version -> URL + :param str name: The name of the package + :param callable first_stage_function: Function to run on first staging area + :param bool keep_stage: Don't clean up staging area when command completes + + :returns: A multi-line string containing versions and corresponding hashes + :rtype: str + """ first_stage_function = kwargs.get('first_stage_function', None) keep_stage = kwargs.get('keep_stage', False) + sorted_versions = sorted(url_dict.keys(), reverse=True) + + # Find length of longest string in the list for padding + max_len = max(len(str(v)) for v in sorted_versions) + num_ver = len(sorted_versions) + + tty.msg("Found {0} version{1} of {2}:".format( + num_ver, '' if num_ver == 1 else 's', name), + "", + *spack.cmd.elide_list( + ["{0:{1}} {2}".format(v, max_len, url_dict[v]) + for v in sorted_versions])) + print() + + archives_to_fetch = tty.get_number( + "How many would you like to checksum?", default=1, abort='q') + + if not archives_to_fetch: + tty.die("Aborted.") + + versions = sorted_versions[:archives_to_fetch] + urls = [url_dict[v] for v in versions] + tty.msg("Downloading...") - hashes = [] + version_hashes = [] i = 0 for url, version in zip(urls, versions): try: with Stage(url, keep=keep_stage) as stage: + # Fetch the archive stage.fetch() if i == 0 and first_stage_function: + # Only run first_stage_function the first time, + # no need to run it every time first_stage_function(stage, url) - hashes.append((version, spack.util.crypto.checksum( + # Checksum the archive and add it to the list + version_hashes.append((version, spack.util.crypto.checksum( hashlib.md5, stage.archive_file))) i += 1 - except FailedDownloadError as e: - tty.msg("Failed to fetch %s" % url) + except FailedDownloadError: + tty.msg("Failed to fetch {0}".format(url)) except Exception as e: - tty.msg('Something failed on %s, skipping.\n (%s)' % (url, e)) + tty.msg("Something failed on {0}, skipping.".format(url), + " ({0})".format(e)) - return hashes + if not version_hashes: + tty.die("Could not fetch any versions for {0}".format(name)) + + # Find length of longest string in the list for padding + max_len = max(len(str(v)) for v, h in version_hashes) + + # Generate the version directives to put in a package.py + version_lines = "\n".join([ + " version('{0}', {1}'{2}')".format( + v, ' ' * (max_len - len(str(v))), h) for v, h in version_hashes + ]) + + num_hash = len(version_hashes) + tty.msg("Checksummed {0} version{1} of {2}".format( + num_hash, '' if num_hash == 1 else 's', name)) + + return version_lines def checksum(parser, args): - # get the package we're going to generate checksums for + # Make sure the user provided a package and not a URL + if not valid_fully_qualified_module_name(args.package): + tty.die("`spack checksum` accepts package names, not URLs. " + "Use `spack md5 ` instead.") + + # Get the package we're going to generate checksums for pkg = spack.repo.get(args.package) - # If the user asked for specific versions, use those. if args.versions: - versions = {} + # If the user asked for specific versions, use those + url_dict = {} for version in args.versions: version = ver(version) if not isinstance(version, Version): - tty.die("Cannot generate checksums for version lists or " + - "version ranges. Use unambiguous versions.") - versions[version] = pkg.url_for_version(version) + tty.die("Cannot generate checksums for version lists or " + "version ranges. Use unambiguous versions.") + url_dict[version] = pkg.url_for_version(version) else: - versions = pkg.fetch_remote_versions() - if not versions: - tty.die("Could not fetch any versions for %s" % pkg.name) + # Otherwise, see what versions we can find online + url_dict = pkg.fetch_remote_versions() + if not url_dict: + tty.die("Could not find any versions for {0}".format(pkg.name)) - sorted_versions = sorted(versions, reverse=True) + version_lines = get_checksums( + url_dict, pkg.name, keep_stage=args.keep_stage) - # Find length of longest string in the list for padding - maxlen = max(len(str(v)) for v in versions) - - tty.msg("Found %s versions of %s" % (len(versions), pkg.name), - *spack.cmd.elide_list( - ["{0:{1}} {2}".format(v, maxlen, versions[v]) - for v in sorted_versions])) - print - archives_to_fetch = tty.get_number( - "How many would you like to checksum?", default=5, abort='q') - - if not archives_to_fetch: - tty.msg("Aborted.") - return - - version_hashes = get_checksums( - sorted_versions[:archives_to_fetch], - [versions[v] for v in sorted_versions[:archives_to_fetch]], - keep_stage=args.keep_stage) - - if not version_hashes: - tty.die("Could not fetch any versions for %s" % pkg.name) - - version_lines = [ - " version('%s', '%s')" % (v, h) for v, h in version_hashes - ] - tty.msg("Checksummed new versions of %s:" % pkg.name, *version_lines) + print() + print(version_lines) diff --git a/lib/spack/spack/cmd/clean.py b/lib/spack/spack/cmd/clean.py index dc62fbcaf66..6c70b5bd38f 100644 --- a/lib/spack/spack/cmd/clean.py +++ b/lib/spack/spack/cmd/clean.py @@ -29,7 +29,7 @@ import spack import spack.cmd -description = "Remove build stage and source tarball for packages." +description = "remove build stage and source tarball for packages" def setup_parser(subparser): diff --git a/lib/spack/spack/cmd/common/arguments.py b/lib/spack/spack/cmd/common/arguments.py index f091b9cf759..b527c7f1387 100644 --- a/lib/spack/spack/cmd/common/arguments.py +++ b/lib/spack/spack/cmd/common/arguments.py @@ -76,32 +76,32 @@ def _specs(self, **kwargs): _arguments['constraint'] = Args( 'constraint', nargs=argparse.REMAINDER, action=ConstraintAction, - help='Constraint to select a subset of installed packages') + help='constraint to select a subset of installed packages') _arguments['module_type'] = Args( - '-m', '--module-type', help='Type of module files', + '-m', '--module-type', help='type of module files', default='tcl', choices=spack.modules.module_types) _arguments['yes_to_all'] = Args( '-y', '--yes-to-all', action='store_true', dest='yes_to_all', - help='Assume "yes" is the answer to every confirmation request.') + help='assume "yes" is the answer to every confirmation request') _arguments['recurse_dependencies'] = Args( '-r', '--dependencies', action='store_true', dest='recurse_dependencies', - help='Recursively traverse spec dependencies') + help='recursively traverse spec dependencies') _arguments['clean'] = Args( '--clean', action='store_false', dest='dirty', - help='Clean environment before installing package.') + help='clean environment before installing package') _arguments['dirty'] = Args( '--dirty', action='store_true', dest='dirty', - help='Do NOT clean environment before installing.') + help='do NOT clean environment before installing') _arguments['long'] = Args( '-l', '--long', action='store_true', - help='Show dependency hashes as well as versions.') + help='show dependency hashes as well as versions') _arguments['very_long'] = Args( '-L', '--very-long', action='store_true', - help='Show full dependency hashes as well as versions.') + help='show full dependency hashes as well as versions') diff --git a/lib/spack/spack/cmd/compiler.py b/lib/spack/spack/cmd/compiler.py index 609210f77e3..c6097941850 100644 --- a/lib/spack/spack/cmd/compiler.py +++ b/lib/spack/spack/cmd/compiler.py @@ -35,7 +35,7 @@ from spack.spec import CompilerSpec, ArchSpec from spack.util.environment import get_path -description = "Manage compilers" +description = "manage compilers" def setup_parser(subparser): @@ -47,35 +47,35 @@ def setup_parser(subparser): # Find find_parser = sp.add_parser( 'find', aliases=['add'], - help='Search the system for compilers to add to Spack configuration.') + help='search the system for compilers to add to Spack configuration') find_parser.add_argument('add_paths', nargs=argparse.REMAINDER) find_parser.add_argument( '--scope', choices=scopes, default=spack.cmd.default_modify_scope, - help="Configuration scope to modify.") + help="configuration scope to modify") # Remove remove_parser = sp.add_parser( - 'remove', aliases=['rm'], help='Remove compiler by spec.') + 'remove', aliases=['rm'], help='remove compiler by spec') remove_parser.add_argument( '-a', '--all', action='store_true', - help='Remove ALL compilers that match spec.') + help='remove ALL compilers that match spec') remove_parser.add_argument('compiler_spec') remove_parser.add_argument( '--scope', choices=scopes, default=spack.cmd.default_modify_scope, - help="Configuration scope to modify.") + help="configuration scope to modify") # List list_parser = sp.add_parser('list', help='list available compilers') list_parser.add_argument( '--scope', choices=scopes, default=spack.cmd.default_list_scope, - help="Configuration scope to read from.") + help="configuration scope to read from") # Info - info_parser = sp.add_parser('info', help='Show compiler paths.') + info_parser = sp.add_parser('info', help='show compiler paths') info_parser.add_argument('compiler_spec') info_parser.add_argument( '--scope', choices=scopes, default=spack.cmd.default_list_scope, - help="Configuration scope to read from.") + help="configuration scope to read from") def compiler_find(args): diff --git a/lib/spack/spack/cmd/compilers.py b/lib/spack/spack/cmd/compilers.py index b87f977e5a3..934fc6cf061 100644 --- a/lib/spack/spack/cmd/compilers.py +++ b/lib/spack/spack/cmd/compilers.py @@ -25,12 +25,12 @@ import spack from spack.cmd.compiler import compiler_list -description = "List available compilers. Same as 'spack compiler list'." +description = "list available compilers, same as 'spack compiler list'" def setup_parser(subparser): subparser.add_argument('--scope', choices=spack.config.config_scopes, - help="Configuration scope to read/modify.") + help="configuration scope to read/modify") def compilers(parser, args): diff --git a/lib/spack/spack/cmd/config.py b/lib/spack/spack/cmd/config.py index 3288c4cb8bc..1a9e44a8b96 100644 --- a/lib/spack/spack/cmd/config.py +++ b/lib/spack/spack/cmd/config.py @@ -24,27 +24,27 @@ ############################################################################## import spack.config -description = "Get and set configuration options." +description = "get and set configuration options" def setup_parser(subparser): # User can only choose one subparser.add_argument('--scope', choices=spack.config.config_scopes, - help="Configuration scope to read/modify.") + help="configuration scope to read/modify") sp = subparser.add_subparsers(metavar='SUBCOMMAND', dest='config_command') - get_parser = sp.add_parser('get', help='Print configuration values.') + get_parser = sp.add_parser('get', help='print configuration values') get_parser.add_argument('section', - help="Configuration section to print. " - "Options: %(choices)s.", + help="configuration section to print. " + "options: %(choices)s", metavar='SECTION', choices=spack.config.section_schemas) - edit_parser = sp.add_parser('edit', help='Edit configuration file.') + edit_parser = sp.add_parser('edit', help='edit configuration file') edit_parser.add_argument('section', - help="Configuration section to edit. " - "Options: %(choices)s.", + help="configuration section to edit. " + "options: %(choices)s", metavar='SECTION', choices=spack.config.section_schemas) diff --git a/lib/spack/spack/cmd/configure.py b/lib/spack/spack/cmd/configure.py index 3eebe2584bb..7b1ef04522a 100644 --- a/lib/spack/spack/cmd/configure.py +++ b/lib/spack/spack/cmd/configure.py @@ -31,7 +31,7 @@ from spack import * -description = 'Stops at configuration stage when installing a package, if possible' # NOQA: ignore=E501 +description = 'stops at configuration stage when installing a package, if possible' # NOQA: ignore=E501 build_system_to_phase = { @@ -49,7 +49,7 @@ def setup_parser(subparser): subparser.add_argument( '-v', '--verbose', action='store_true', - help="Print additional output during builds" + help="print additional output during builds" ) diff --git a/lib/spack/spack/cmd/create.py b/lib/spack/spack/cmd/create.py index cac67f22af2..2901dcfa63d 100644 --- a/lib/spack/spack/cmd/create.py +++ b/lib/spack/spack/cmd/create.py @@ -26,7 +26,6 @@ import os import re -import string import llnl.util.tty as tty import spack @@ -35,15 +34,14 @@ import spack.url import spack.util.web from llnl.util.filesystem import mkdirp -from ordereddict_backport import OrderedDict -from spack.repository import Repo, RepoError +from spack.repository import Repo from spack.spec import Spec from spack.util.executable import which from spack.util.naming import * -description = "Create a new package file from an archive URL" +description = "create a new package file" -package_template = string.Template("""\ +package_template = '''\ ############################################################################## # Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. @@ -73,11 +71,11 @@ # next to all the things you'll want to change. Once you've handled # them, you can save this file and test your package like this: # -# spack install ${name} +# spack install {name} # # You can edit this file again by typing: # -# spack edit ${name} +# spack edit {name} # # See the Spack documentation for more information on packaging. # If you submit this package back to Spack as a pull request, @@ -86,23 +84,24 @@ from spack import * -class ${class_name}(${base_class_name}): - ""\"FIXME: Put a proper description of your package here.""\" +class {class_name}({base_class_name}): + """FIXME: Put a proper description of your package here.""" # FIXME: Add a proper url for your package's homepage here. homepage = "http://www.example.com" - url = "${url}" + url = "{url}" -${versions} +{versions} -${dependencies} +{dependencies} -${body} -""") +{body} +''' -class DefaultGuess(object): +class PackageTemplate(object): """Provides the default values to be used for the package file template""" + base_class_name = 'Package' dependencies = """\ @@ -115,57 +114,89 @@ def install(self, spec, prefix): make() make('install')""" - def __init__(self, name, url, version_hash_tuples): - self.name = name + def __init__(self, name, url, versions): + self.name = name self.class_name = mod_to_class(name) - self.url = url - self.version_hash_tuples = version_hash_tuples + self.url = url + self.versions = versions - @property - def versions(self): - """Adds a version() call to the package for each version found.""" - max_len = max(len(str(v)) for v, h in self.version_hash_tuples) - format = " version(%%-%ds, '%%s')" % (max_len + 2) - return '\n'.join( - format % ("'%s'" % v, h) for v, h in self.version_hash_tuples - ) + def write(self, pkg_path): + """Writes the new package file.""" + + # Write out a template for the file + with open(pkg_path, "w") as pkg_file: + pkg_file.write(package_template.format( + name=self.name, + class_name=self.class_name, + base_class_name=self.base_class_name, + url=self.url, + versions=self.versions, + dependencies=self.dependencies, + body=self.body)) -class AutotoolsGuess(DefaultGuess): - """Provides appropriate overrides for autotools-based packages""" +class AutotoolsPackageTemplate(PackageTemplate): + """Provides appropriate overrides for Autotools-based packages + that *do* come with a ``configure`` script""" + base_class_name = 'AutotoolsPackage' dependencies = """\ # FIXME: Add dependencies if required. - # depends_on('m4', type='build') - # depends_on('autoconf', type='build') - # depends_on('automake', type='build') - # depends_on('libtool', type='build') # depends_on('foo')""" body = """\ def configure_args(self): # FIXME: Add arguments other than --prefix - # FIXME: If not needed delete the function + # FIXME: If not needed delete this function args = [] return args""" -class CMakeGuess(DefaultGuess): - """Provides appropriate overrides for cmake-based packages""" +class AutoreconfPackageTemplate(PackageTemplate): + """Provides appropriate overrides for Autotools-based packages + that *do not* come with a ``configure`` script""" + + base_class_name = 'AutotoolsPackage' + + dependencies = """\ + depends_on('autoconf', type='build') + depends_on('automake', type='build') + depends_on('libtool', type='build') + depends_on('m4', type='build') + + # FIXME: Add additional dependencies if required. + # depends_on('foo')""" + + body = """\ + def autoreconf(self, spec, prefix): + # FIXME: Modify the autoreconf method as necessary + autoreconf('--install', '--verbose', '--force') + + def configure_args(self): + # FIXME: Add arguments other than --prefix + # FIXME: If not needed delete this function + args = [] + return args""" + + +class CMakePackageTemplate(PackageTemplate): + """Provides appropriate overrides for CMake-based packages""" + base_class_name = 'CMakePackage' body = """\ def cmake_args(self): # FIXME: Add arguments other than # FIXME: CMAKE_INSTALL_PREFIX and CMAKE_BUILD_TYPE - # FIXME: If not needed delete the function + # FIXME: If not needed delete this function args = [] return args""" -class SconsGuess(DefaultGuess): - """Provides appropriate overrides for scons-based packages""" +class SconsPackageTemplate(PackageTemplate): + """Provides appropriate overrides for SCons-based packages""" + dependencies = """\ # FIXME: Add additional dependencies if required. depends_on('scons', type='build')""" @@ -177,8 +208,9 @@ def install(self, spec, prefix): scons('install')""" -class BazelGuess(DefaultGuess): - """Provides appropriate overrides for bazel-based packages""" +class BazelPackageTemplate(PackageTemplate): + """Provides appropriate overrides for Bazel-based packages""" + dependencies = """\ # FIXME: Add additional dependencies if required. depends_on('bazel', type='build')""" @@ -189,27 +221,36 @@ def install(self, spec, prefix): bazel()""" -class PythonGuess(DefaultGuess): +class PythonPackageTemplate(PackageTemplate): """Provides appropriate overrides for python extensions""" - dependencies = """\ - extends('python') + base_class_name = 'PythonPackage' - # FIXME: Add additional dependencies if required. + dependencies = """\ + # FIXME: Add dependencies if required. # depends_on('py-setuptools', type='build') # depends_on('py-foo', type=('build', 'run'))""" body = """\ - def install(self, spec, prefix): - # FIXME: Add logic to build and install here. - setup_py('install', '--prefix={0}'.format(prefix))""" + def build_args(self): + # FIXME: Add arguments other than --prefix + # FIXME: If not needed delete the function + args = [] + return args""" def __init__(self, name, *args): - name = 'py-{0}'.format(name) - super(PythonGuess, self).__init__(name, *args) + # If the user provided `--name py-numpy`, don't rename it py-py-numpy + if not name.startswith('py-'): + # Make it more obvious that we are renaming the package + tty.msg("Changing package name from {0} to py-{0}".format(name)) + name = 'py-{0}'.format(name) + + super(PythonPackageTemplate, self).__init__(name, *args) -class RGuess(DefaultGuess): +class RPackageTemplate(PackageTemplate): """Provides appropriate overrides for R extensions""" + base_class_name = 'RPackage' + dependencies = """\ # FIXME: Add dependencies if required. # depends_on('r-foo', type=('build', 'run'))""" @@ -218,12 +259,18 @@ class RGuess(DefaultGuess): # FIXME: Override install() if necessary.""" def __init__(self, name, *args): - name = 'r-{0}'.format(name) - super(RGuess, self).__init__(name, *args) + # If the user provided `--name r-rcpp`, don't rename it r-r-rcpp + if not name.startswith('r-'): + # Make it more obvious that we are renaming the package + tty.msg("Changing package name from {0} to r-{0}".format(name)) + name = 'r-{0}'.format(name) + + super(RPackageTemplate, self).__init__(name, *args) -class OctaveGuess(DefaultGuess): +class OctavePackageTemplate(PackageTemplate): """Provides appropriate overrides for octave packages""" + dependencies = """\ extends('octave') @@ -240,43 +287,59 @@ def install(self, spec, prefix): prefix, self.stage.archive_file))""" def __init__(self, name, *args): - name = 'octave-{0}'.format(name) - super(OctaveGuess, self).__init__(name, *args) + # If the user provided `--name octave-splines`, don't rename it + # octave-octave-splines + if not name.startswith('octave-'): + # Make it more obvious that we are renaming the package + tty.msg("Changing package name from {0} to octave-{0}".format(name)) # noqa + name = 'octave-{0}'.format(name) + + super(OctavePackageTemplate, self).__init__(name, *args) + + +templates = { + 'autotools': AutotoolsPackageTemplate, + 'autoreconf': AutoreconfPackageTemplate, + 'cmake': CMakePackageTemplate, + 'scons': SconsPackageTemplate, + 'bazel': BazelPackageTemplate, + 'python': PythonPackageTemplate, + 'r': RPackageTemplate, + 'octave': OctavePackageTemplate, + 'generic': PackageTemplate +} def setup_parser(subparser): - subparser.add_argument('url', nargs='?', help="url of package archive") + subparser.add_argument( + 'url', nargs='?', + help="url of package archive") subparser.add_argument( '--keep-stage', action='store_true', - help="Don't clean up staging area when command completes.") + help="don't clean up staging area when command completes") subparser.add_argument( - '-n', '--name', dest='alternate_name', default=None, metavar='NAME', - help="Override the autodetected name for the created package.") + '-n', '--name', + help="name of the package to create") subparser.add_argument( - '-r', '--repo', default=None, - help="Path to a repository where the package should be created.") + '-t', '--template', metavar='TEMPLATE', choices=templates.keys(), + help="build system template to use. options: %(choices)s") + subparser.add_argument( + '-r', '--repo', + help="path to a repository where the package should be created") subparser.add_argument( '-N', '--namespace', - help="Specify a namespace for the package. Must be the namespace of " - "a repository registered with Spack.") + help="specify a namespace for the package. must be the namespace of " + "a repository registered with Spack") subparser.add_argument( - '-f', '--force', action='store_true', dest='force', - help="Overwrite any existing package file with the same name.") - - setup_parser.subparser = subparser + '-f', '--force', action='store_true', + help="overwrite any existing package file with the same name") -class BuildSystemGuesser(object): - - _choices = { - 'autotools': AutotoolsGuess, - 'cmake': CMakeGuess, - 'scons': SconsGuess, - 'bazel': BazelGuess, - 'python': PythonGuess, - 'r': RGuess, - 'octave': OctaveGuess - } +class BuildSystemGuesser: + """An instance of BuildSystemGuesser provides a callable object to be used + during ``spack create``. By passing this object to ``spack checksum``, we + can take a peek at the fetched tarball and discern the build system it uses + """ def __call__(self, stage, url): """Try to guess the type of build system used by a project based on @@ -293,12 +356,14 @@ def __call__(self, stage, url): # uses. If the regular expression matches a file contained in the # archive, the corresponding build system is assumed. clues = [ - (r'/configure$', 'autotools'), - (r'/CMakeLists.txt$', 'cmake'), - (r'/SConstruct$', 'scons'), - (r'/setup.py$', 'python'), - (r'/NAMESPACE$', 'r'), - (r'/WORKSPACE$', 'bazel') + (r'/configure$', 'autotools'), + (r'/configure.(in|ac)$', 'autoreconf'), + (r'/Makefile.am$', 'autoreconf'), + (r'/CMakeLists.txt$', 'cmake'), + (r'/SConstruct$', 'scons'), + (r'/setup.py$', 'python'), + (r'/NAMESPACE$', 'r'), + (r'/WORKSPACE$', 'bazel') ] # Peek inside the compressed file. @@ -319,65 +384,174 @@ def __call__(self, stage, url): # Determine the build system based on the files contained # in the archive. - build_system = 'unknown' + build_system = 'generic' for pattern, bs in clues: if any(re.search(pattern, l) for l in lines): build_system = bs + break self.build_system = build_system - def make_guess(self, name, url, ver_hash_tuples): - cls = self._choices.get(self.build_system, DefaultGuess) - return cls(name, url, ver_hash_tuples) +def get_name(args): + """Get the name of the package based on the supplied arguments. -def guess_name_and_version(url, args): - # Try to deduce name and version of the new package from the URL - version = spack.url.parse_version(url) - if not version: - tty.die("Couldn't guess a version string from %s" % url) + If a name was provided, always use that. Otherwise, if a URL was + provided, extract the name from that. Otherwise, use a default. - # Try to guess a name. If it doesn't work, allow the user to override. - if args.alternate_name: - name = args.alternate_name - else: + :param argparse.Namespace args: The arguments given to ``spack create`` + + :returns: The name of the package + :rtype: str + """ + + # Default package name + name = 'example' + + if args.name: + # Use a user-supplied name if one is present + name = args.name + tty.msg("Using specified package name: '{0}'".format(name)) + elif args.url: + # Try to guess the package name based on the URL try: - name = spack.url.parse_name(url, version) + name = spack.url.parse_name(args.url) + tty.msg("This looks like a URL for {0}".format(name)) except spack.url.UndetectableNameError: - # Use a user-supplied name if one is present - tty.die("Couldn't guess a name for this package. Try running:", "", - "spack create --name ") + tty.die("Couldn't guess a name for this package.", + " Please report this bug. In the meantime, try running:", + " `spack create --name `") if not valid_fully_qualified_module_name(name): - tty.die("Package name can only contain A-Z, a-z, 0-9, '_' and '-'") + tty.die("Package name can only contain a-z, 0-9, and '-'") - return name, version + return name -def find_repository(spec, args): - # figure out namespace for spec +def get_url(args): + """Get the URL to use. + + Use a default URL if none is provided. + + :param argparse.Namespace args: The arguments given to ``spack create`` + + :returns: The URL of the package + :rtype: str + """ + + # Default URL + url = 'http://www.example.com/example-1.2.3.tar.gz' + + if args.url: + # Use a user-supplied URL if one is present + url = args.url + + return url + + +def get_versions(args, name): + """Returns a list of versions and hashes for a package. + + Also returns a BuildSystemGuesser object. + + Returns default values if no URL is provided. + + :param argparse.Namespace args: The arguments given to ``spack create`` + :param str name: The name of the package + + :returns: Versions and hashes, and a BuildSystemGuesser object + :rtype: str and BuildSystemGuesser + """ + + # Default version, hash, and guesser + versions = """\ + # FIXME: Add proper versions and checksums here. + # version('1.2.3', '0123456789abcdef0123456789abcdef')""" + + guesser = BuildSystemGuesser() + + if args.url: + # Find available versions + url_dict = spack.util.web.find_versions_of_archive(args.url) + + if not url_dict: + # If no versions were found, revert to what the user provided + version = spack.url.parse_version(args.url) + url_dict = {version: args.url} + + versions = spack.cmd.checksum.get_checksums( + url_dict, name, first_stage_function=guesser, + keep_stage=args.keep_stage) + + return versions, guesser + + +def get_build_system(args, guesser): + """Determine the build system template. + + If a template is specified, always use that. Otherwise, if a URL + is provided, download the tarball and peek inside to guess what + build system it uses. Otherwise, use a generic template by default. + + :param argparse.Namespace args: The arguments given to ``spack create`` + :param BuildSystemGuesser guesser: The first_stage_function given to \ + ``spack checksum`` which records the build system it detects + + :returns: The name of the build system template to use + :rtype: str + """ + + # Default template + template = 'generic' + + if args.template: + # Use a user-supplied template if one is present + template = args.template + tty.msg("Using specified package template: '{0}'".format(template)) + elif args.url: + # Use whatever build system the guesser detected + template = guesser.build_system + if template == 'generic': + tty.warn("Unable to detect a build system. " + "Using a generic package template.") + else: + msg = "This package looks like it uses the {0} build system" + tty.msg(msg.format(template)) + + return template + + +def get_repository(args, name): + """Returns a Repo object that will allow us to determine the path where + the new package file should be created. + + :param argparse.Namespace args: The arguments given to ``spack create`` + :param str name: The name of the package to create + + :returns: A Repo object capable of determining the path to the package file + :rtype: Repo + """ + spec = Spec(name) + # Figure out namespace for spec if spec.namespace and args.namespace and spec.namespace != args.namespace: - tty.die("Namespaces '%s' and '%s' do not match." % (spec.namespace, - args.namespace)) + tty.die("Namespaces '{0}' and '{1}' do not match.".format( + spec.namespace, args.namespace)) if not spec.namespace and args.namespace: spec.namespace = args.namespace - # Figure out where the new package should live. + # Figure out where the new package should live repo_path = args.repo if repo_path is not None: - try: - repo = Repo(repo_path) - if spec.namespace and spec.namespace != repo.namespace: - tty.die("Can't create package with namespace %s in repo with " - "namespace %s" % (spec.namespace, repo.namespace)) - except RepoError as e: - tty.die(str(e)) + repo = Repo(repo_path) + if spec.namespace and spec.namespace != repo.namespace: + tty.die("Can't create package with namespace {0} in repo with " + "namespace {0}".format(spec.namespace, repo.namespace)) else: if spec.namespace: repo = spack.repo.get_repo(spec.namespace, None) if not repo: - tty.die("Unknown namespace: %s" % spec.namespace) + tty.die("Unknown namespace: '{0}'".format(spec.namespace)) else: repo = spack.repo.first_repo() @@ -388,84 +562,30 @@ def find_repository(spec, args): return repo -def fetch_tarballs(url, name, version): - """Try to find versions of the supplied archive by scraping the web. - Prompts the user to select how many to download if many are found.""" - versions = spack.util.web.find_versions_of_archive(url) - rkeys = sorted(versions.keys(), reverse=True) - versions = OrderedDict(zip(rkeys, (versions[v] for v in rkeys))) - - archives_to_fetch = 1 - if not versions: - # If the fetch failed for some reason, revert to what the user provided - versions = {version: url} - elif len(versions) > 1: - tty.msg("Found %s versions of %s:" % (len(versions), name), - *spack.cmd.elide_list( - ["%-10s%s" % (v, u) for v, u in versions.iteritems()])) - print('') - archives_to_fetch = tty.get_number( - "Include how many checksums in the package file?", - default=5, abort='q') - - if not archives_to_fetch: - tty.die("Aborted.") - - sorted_versions = sorted(versions.keys(), reverse=True) - sorted_urls = [versions[v] for v in sorted_versions] - return sorted_versions[:archives_to_fetch], sorted_urls[:archives_to_fetch] - - def create(parser, args): - url = args.url - if not url: - setup_parser.subparser.print_help() - return + # Gather information about the package to be created + name = get_name(args) + url = get_url(args) + versions, guesser = get_versions(args, name) + build_system = get_build_system(args, guesser) - # Figure out a name and repo for the package. - name, version = guess_name_and_version(url, args) - spec = Spec(name) - repo = find_repository(spec, args) + # Create the package template object + PackageClass = templates[build_system] + package = PackageClass(name, url, versions) + tty.msg("Created template for {0} package".format(package.name)) - tty.msg("This looks like a URL for %s version %s" % (name, version)) - tty.msg("Creating template for package %s" % name) - - # Fetch tarballs (prompting user if necessary) - versions, urls = fetch_tarballs(url, name, version) - - # Try to guess what build system is used. - guesser = BuildSystemGuesser() - ver_hash_tuples = spack.cmd.checksum.get_checksums( - versions, urls, - first_stage_function=guesser, - keep_stage=args.keep_stage) - - if not ver_hash_tuples: - tty.die("Could not fetch any tarballs for %s" % name) - - guess = guesser.make_guess(name, url, ver_hash_tuples) - - # Create a directory for the new package. - pkg_path = repo.filename_for_package_name(guess.name) + # Create a directory for the new package + repo = get_repository(args, name) + pkg_path = repo.filename_for_package_name(package.name) if os.path.exists(pkg_path) and not args.force: - tty.die("%s already exists." % pkg_path) + tty.die('{0} already exists.'.format(pkg_path), + ' Try running `spack create --force` to overwrite it.') else: mkdirp(os.path.dirname(pkg_path)) - # Write out a template for the file - with open(pkg_path, "w") as pkg_file: - pkg_file.write( - package_template.substitute( - name=guess.name, - class_name=guess.class_name, - base_class_name=guess.base_class_name, - url=guess.url, - versions=guess.versions, - dependencies=guess.dependencies, - body=guess.body - ) - ) + # Write the new package file + package.write(pkg_path) + tty.msg("Created package file: {0}".format(pkg_path)) - # If everything checks out, go ahead and edit. + # Open up the new package file in your $EDITOR spack.editor(pkg_path) - tty.msg("Created package %s" % pkg_path) diff --git a/lib/spack/spack/cmd/deactivate.py b/lib/spack/spack/cmd/deactivate.py index fedd078972d..7ea20392362 100644 --- a/lib/spack/spack/cmd/deactivate.py +++ b/lib/spack/spack/cmd/deactivate.py @@ -30,20 +30,20 @@ import spack.store from spack.graph import topological_sort -description = "Deactivate a package extension." +description = "deactivate a package extension" def setup_parser(subparser): subparser.add_argument( '-f', '--force', action='store_true', - help="Run deactivation even if spec is NOT currently activated.") + help="run deactivation even if spec is NOT currently activated") subparser.add_argument( '-a', '--all', action='store_true', - help="Deactivate all extensions of an extendable package, or " - "deactivate an extension AND its dependencies.") + help="deactivate all extensions of an extendable package, or " + "deactivate an extension AND its dependencies") subparser.add_argument( 'spec', nargs=argparse.REMAINDER, - help="spec of package extension to deactivate.") + help="spec of package extension to deactivate") def deactivate(parser, args): diff --git a/lib/spack/spack/cmd/debug.py b/lib/spack/spack/cmd/debug.py index c7e90cb2108..06dea9ea708 100644 --- a/lib/spack/spack/cmd/debug.py +++ b/lib/spack/spack/cmd/debug.py @@ -33,13 +33,13 @@ import spack from spack.util.executable import which -description = "Debugging commands for troubleshooting Spack." +description = "debugging commands for troubleshooting Spack" def setup_parser(subparser): sp = subparser.add_subparsers(metavar='SUBCOMMAND', dest='debug_command') sp.add_parser('create-db-tarball', - help="Create a tarball of Spack's installation metadata.") + help="create a tarball of Spack's installation metadata") def _debug_tarball_suffix(): diff --git a/lib/spack/spack/cmd/dependents.py b/lib/spack/spack/cmd/dependents.py index dc2ee658ac2..8c533561e3e 100644 --- a/lib/spack/spack/cmd/dependents.py +++ b/lib/spack/spack/cmd/dependents.py @@ -30,13 +30,13 @@ import spack.store import spack.cmd -description = "Show installed packages that depend on another." +description = "show installed packages that depend on another" def setup_parser(subparser): subparser.add_argument( 'spec', nargs=argparse.REMAINDER, - help="specs to list dependencies of.") + help="specs to list dependencies of") def dependents(parser, args): diff --git a/lib/spack/spack/cmd/diy.py b/lib/spack/spack/cmd/diy.py index 22966a26eb9..c67e189f733 100644 --- a/lib/spack/spack/cmd/diy.py +++ b/lib/spack/spack/cmd/diy.py @@ -31,28 +31,27 @@ import spack import spack.cmd import spack.cmd.common.arguments as arguments -from spack.cmd.edit import edit_package from spack.stage import DIYStage -description = "Do-It-Yourself: build from an existing source directory." +description = "do-it-yourself: build from an existing source directory" def setup_parser(subparser): subparser.add_argument( '-i', '--ignore-dependencies', action='store_true', dest='ignore_deps', - help="Do not try to install dependencies of requested packages.") + help="don't try to install dependencies of requested packages") subparser.add_argument( '--keep-prefix', action='store_true', - help="Don't remove the install prefix if installation fails.") + help="do not remove the install prefix if installation fails") subparser.add_argument( '--skip-patch', action='store_true', - help="Skip patching for the DIY build.") + help="skip patching for the DIY build") subparser.add_argument( '-q', '--quiet', action='store_true', dest='quiet', - help="Do not display verbose build output while installing.") + help="do not display verbose build output while installing") subparser.add_argument( 'spec', nargs=argparse.REMAINDER, - help="specs to use for install. Must contain package AND version.") + help="specs to use for install. must contain package AND version") cd_group = subparser.add_mutually_exclusive_group() arguments.add_common_arguments(cd_group, ['clean', 'dirty']) @@ -68,15 +67,8 @@ def diy(self, args): spec = specs[0] if not spack.repo.exists(spec.name): - tty.warn("No such package: %s" % spec.name) - create = tty.get_yes_or_no("Create this package?", default=False) - if not create: - tty.msg("Exiting without creating.") - sys.exit(1) - else: - tty.msg("Running 'spack edit -f %s'" % spec.name) - edit_package(spec.name, spack.repo.first_repo(), None, True) - return + tty.die("No package for '{0}' was found.".format(spec.name), + " Use `spack create` to create a new package") if not spec.versions.concrete: tty.die( diff --git a/lib/spack/spack/cmd/doc.py b/lib/spack/spack/cmd/doc.py index 291b17216fe..12ae6b49738 100644 --- a/lib/spack/spack/cmd/doc.py +++ b/lib/spack/spack/cmd/doc.py @@ -23,11 +23,11 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## -description = "Run pydoc from within spack." +description = "run pydoc from within spack" def setup_parser(subparser): - subparser.add_argument('entity', help="Run pydoc help on entity") + subparser.add_argument('entity', help="run pydoc help on entity") def doc(parser, args): diff --git a/lib/spack/spack/cmd/edit.py b/lib/spack/spack/cmd/edit.py index 286136dd672..f4397361921 100644 --- a/lib/spack/spack/cmd/edit.py +++ b/lib/spack/spack/cmd/edit.py @@ -23,39 +23,26 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## import os -import string import llnl.util.tty as tty -from llnl.util.filesystem import mkdirp, join_path +from llnl.util.filesystem import join_path import spack import spack.cmd from spack.spec import Spec from spack.repository import Repo -from spack.util.naming import mod_to_class -description = "Open package files in $EDITOR" - -# When -f is supplied, we'll create a very minimal skeleton. -package_template = string.Template("""\ -from spack import * - -class ${class_name}(Package): - ""\"Description""\" - - homepage = "http://www.example.com" - url = "http://www.example.com/${name}-1.0.tar.gz" - - version('1.0', '0123456789abcdef0123456789abcdef') - - def install(self, spec, prefix): - configure("--prefix=%s" % prefix) - make() - make("install") -""") +description = "open package files in $EDITOR" -def edit_package(name, repo_path, namespace, force=False): +def edit_package(name, repo_path, namespace): + """Opens the requested package file in your favorite $EDITOR. + + :param str name: The name of the package + :param str repo_path: The path to the repository containing this package + :param str namespace: A valid namespace registered with Spack + """ + # Find the location of the package if repo_path: repo = Repo(repo_path) elif namespace: @@ -67,68 +54,67 @@ def edit_package(name, repo_path, namespace, force=False): spec = Spec(name) if os.path.exists(path): if not os.path.isfile(path): - tty.die("Something's wrong. '%s' is not a file!" % path) + tty.die("Something is wrong. '{0}' is not a file!".format(path)) if not os.access(path, os.R_OK | os.W_OK): tty.die("Insufficient permissions on '%s'!" % path) - elif not force: - tty.die("No package '%s'. Use spack create, or supply -f/--force " - "to edit a new file." % spec.name) else: - mkdirp(os.path.dirname(path)) - with open(path, "w") as pkg_file: - pkg_file.write( - package_template.substitute( - name=spec.name, class_name=mod_to_class(spec.name))) + tty.die("No package for '{0}' was found.".format(spec.name), + " Use `spack create` to create a new package") spack.editor(path) def setup_parser(subparser): - subparser.add_argument( - '-f', '--force', dest='force', action='store_true', - help="Open a new file in $EDITOR even if package doesn't exist.") - excl_args = subparser.add_mutually_exclusive_group() - # Various filetypes you can edit directly from the cmd line. + # Various types of Spack files that can be edited + # Edits package files by default + excl_args.add_argument( + '-b', '--build-system', dest='path', action='store_const', + const=spack.build_systems_path, + help="Edit the build system with the supplied name.") excl_args.add_argument( '-c', '--command', dest='path', action='store_const', const=spack.cmd.command_path, - help="Edit the command with the supplied name.") + help="edit the command with the supplied name") excl_args.add_argument( '-t', '--test', dest='path', action='store_const', - const=spack.test_path, help="Edit the test with the supplied name.") + const=spack.test_path, + help="edit the test with the supplied name") excl_args.add_argument( '-m', '--module', dest='path', action='store_const', const=spack.module_path, - help="Edit the main spack module with the supplied name.") + help="edit the main spack module with the supplied name") # Options for editing packages excl_args.add_argument( '-r', '--repo', default=None, - help="Path to repo to edit package in.") + help="path to repo to edit package in") excl_args.add_argument( '-N', '--namespace', default=None, - help="Namespace of package to edit.") + help="namespace of package to edit") subparser.add_argument( - 'name', nargs='?', default=None, help="name of package to edit") + 'name', nargs='?', default=None, + help="name of package to edit") def edit(parser, args): name = args.name + # By default, edit package files path = spack.packages_path + + # If `--command`, `--test`, or `--module` is chosen, edit those instead if args.path: path = args.path if name: path = join_path(path, name + ".py") - if not args.force and not os.path.exists(path): - tty.die("No command named '%s'." % name) + if not os.path.exists(path): + tty.die("No command for '{0}' was found.".format(name)) spack.editor(path) - elif name: - edit_package(name, args.repo, args.namespace, args.force) + edit_package(name, args.repo, args.namespace) else: - # By default open the directory where packages or commands live. + # By default open the directory where packages live spack.editor(path) diff --git a/lib/spack/spack/cmd/env.py b/lib/spack/spack/cmd/env.py index f3bad039d4c..49fc48700c8 100644 --- a/lib/spack/spack/cmd/env.py +++ b/lib/spack/spack/cmd/env.py @@ -28,13 +28,13 @@ import spack.cmd import spack.build_environment as build_env -description = "Run a command with the install environment for a spec." +description = "run a command with the install environment for a spec" def setup_parser(subparser): subparser.add_argument( 'spec', nargs=argparse.REMAINDER, - help="specs of package environment to emulate.") + help="specs of package environment to emulate") def env(parser, args): diff --git a/lib/spack/spack/cmd/extensions.py b/lib/spack/spack/cmd/extensions.py index bd149044ca3..94a3e8288f5 100644 --- a/lib/spack/spack/cmd/extensions.py +++ b/lib/spack/spack/cmd/extensions.py @@ -32,24 +32,24 @@ import spack.cmd.find import spack.store -description = "List extensions for package." +description = "list extensions for package" def setup_parser(subparser): format_group = subparser.add_mutually_exclusive_group() format_group.add_argument( '-l', '--long', action='store_true', dest='long', - help='Show dependency hashes as well as versions.') + help='show dependency hashes as well as versions') format_group.add_argument( '-p', '--paths', action='store_const', dest='mode', const='paths', - help='Show paths to extension install directories') + help='show paths to extension install directories') format_group.add_argument( '-d', '--deps', action='store_const', dest='mode', const='deps', - help='Show full dependency DAG of extensions') + help='show full dependency DAG of extensions') subparser.add_argument( 'spec', nargs=argparse.REMAINDER, - help='Spec of package to list extensions for') + help='spec of package to list extensions for') def extensions(parser, args): diff --git a/lib/spack/spack/cmd/fetch.py b/lib/spack/spack/cmd/fetch.py index c1ac2ed48d1..35cc23a9631 100644 --- a/lib/spack/spack/cmd/fetch.py +++ b/lib/spack/spack/cmd/fetch.py @@ -27,19 +27,19 @@ import spack import spack.cmd -description = "Fetch archives for packages" +description = "fetch archives for packages" def setup_parser(subparser): subparser.add_argument( '-n', '--no-checksum', action='store_true', dest='no_checksum', - help="Do not check packages against checksum") + help="do not check packages against checksum") subparser.add_argument( '-m', '--missing', action='store_true', - help="Also fetch all missing dependencies") + help="also fetch all missing dependencies") subparser.add_argument( '-D', '--dependencies', action='store_true', - help="Also fetch all dependencies") + help="also fetch all dependencies") subparser.add_argument( 'packages', nargs=argparse.REMAINDER, help="specs of packages to fetch") diff --git a/lib/spack/spack/cmd/find.py b/lib/spack/spack/cmd/find.py index ecd6ae28221..3a6d8270fb8 100644 --- a/lib/spack/spack/cmd/find.py +++ b/lib/spack/spack/cmd/find.py @@ -29,7 +29,7 @@ from spack.cmd import display_specs -description = "Find installed spack packages" +description = "find installed spack packages" def setup_parser(subparser): @@ -39,56 +39,56 @@ def setup_parser(subparser): dest='mode', const='short', default='short', - help='Show only specs (default)') + help='show only specs (default)') format_group.add_argument('-p', '--paths', action='store_const', dest='mode', const='paths', - help='Show paths to package install directories') + help='show paths to package install directories') format_group.add_argument( '-d', '--deps', action='store_const', dest='mode', const='deps', - help='Show full dependency DAG of installed packages') + help='show full dependency DAG of installed packages') arguments.add_common_arguments(subparser, ['long', 'very_long']) subparser.add_argument('-f', '--show-flags', action='store_true', dest='show_flags', - help='Show spec compiler flags.') + help='show spec compiler flags') implicit_explicit = subparser.add_mutually_exclusive_group() implicit_explicit.add_argument( '-e', '--explicit', action='store_true', - help='Show only specs that were installed explicitly') + help='show only specs that were installed explicitly') implicit_explicit.add_argument( '-E', '--implicit', action='store_true', - help='Show only specs that were installed as dependencies') + help='show only specs that were installed as dependencies') subparser.add_argument( '-u', '--unknown', action='store_true', dest='unknown', - help='Show only specs Spack does not have a package for.') + help='show only specs Spack does not have a package for') subparser.add_argument( '-m', '--missing', action='store_true', dest='missing', - help='Show missing dependencies as well as installed specs.') + help='show missing dependencies as well as installed specs') subparser.add_argument( '-v', '--variants', action='store_true', dest='variants', - help='Show variants in output (can be long)') + help='show variants in output (can be long)') subparser.add_argument('-M', '--only-missing', action='store_true', dest='only_missing', - help='Show only missing dependencies.') + help='show only missing dependencies') subparser.add_argument('-N', '--namespace', action='store_true', - help='Show fully qualified package names.') + help='show fully qualified package names') arguments.add_common_arguments(subparser, ['constraint']) diff --git a/lib/spack/spack/cmd/flake8.py b/lib/spack/spack/cmd/flake8.py index b8e28b08602..5ee68a80df6 100644 --- a/lib/spack/spack/cmd/flake8.py +++ b/lib/spack/spack/cmd/flake8.py @@ -34,7 +34,7 @@ import spack from spack.util.executable import * -description = "Runs source code style checks on Spack. Requires flake8." +description = "runs source code style checks on Spack. requires flake8" flake8 = None include_untracked = True @@ -138,17 +138,17 @@ def filter_file(source, dest, output=False): def setup_parser(subparser): subparser.add_argument( '-k', '--keep-temp', action='store_true', - help="Do not delete temporary directory where flake8 runs. " - "Use for debugging, to see filtered files.") + help="do not delete temporary directory where flake8 runs. " + "use for debugging, to see filtered files") subparser.add_argument( '-o', '--output', action='store_true', - help="Send filtered files to stdout as well as temp files.") + help="send filtered files to stdout as well as temp files") subparser.add_argument( '-r', '--root-relative', action='store_true', default=False, help="print root-relative paths (default is cwd-relative)") subparser.add_argument( '-U', '--no-untracked', dest='untracked', action='store_false', - default=True, help="Exclude untracked files from checks.") + default=True, help="exclude untracked files from checks") subparser.add_argument( 'files', nargs=argparse.REMAINDER, help="specific files to check") diff --git a/lib/spack/spack/cmd/graph.py b/lib/spack/spack/cmd/graph.py index 6a268e6961a..414b6d78ec4 100644 --- a/lib/spack/spack/cmd/graph.py +++ b/lib/spack/spack/cmd/graph.py @@ -32,7 +32,7 @@ from spack.spec import * from spack.graph import * -description = "Generate graphs of package dependency relationships." +description = "generate graphs of package dependency relationships" def setup_parser(subparser): @@ -41,31 +41,31 @@ def setup_parser(subparser): method = subparser.add_mutually_exclusive_group() method.add_argument( '-a', '--ascii', action='store_true', - help="Draw graph as ascii to stdout (default).") + help="draw graph as ascii to stdout (default)") method.add_argument( '-d', '--dot', action='store_true', - help="Generate graph in dot format and print to stdout.") + help="generate graph in dot format and print to stdout") subparser.add_argument( '-n', '--normalize', action='store_true', - help="Skip concretization; only print normalized spec.") + help="skip concretization; only print normalized spec") subparser.add_argument( '-s', '--static', action='store_true', - help="Use static information from packages, not dynamic spec info.") + help="use static information from packages, not dynamic spec info") subparser.add_argument( '-i', '--installed', action='store_true', - help="Graph all installed specs in dot format (implies --dot).") + help="graph all installed specs in dot format (implies --dot)") subparser.add_argument( '-t', '--deptype', action='store', - help="Comma-separated list of deptypes to traverse. default=%s." + help="comma-separated list of deptypes to traverse. default=%s" % ','.join(alldeps)) subparser.add_argument( 'specs', nargs=argparse.REMAINDER, - help="specs of packages to graph.") + help="specs of packages to graph") def graph(parser, args): diff --git a/lib/spack/spack/cmd/help.py b/lib/spack/spack/cmd/help.py index 5bc8fc3e743..e867ca12958 100644 --- a/lib/spack/spack/cmd/help.py +++ b/lib/spack/spack/cmd/help.py @@ -22,7 +22,7 @@ # License along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## -description = "Get help on spack and its commands" +description = "get help on spack and its commands" def setup_parser(subparser): diff --git a/lib/spack/spack/cmd/info.py b/lib/spack/spack/cmd/info.py index 8e7df87a023..1dd0ee4e789 100644 --- a/lib/spack/spack/cmd/info.py +++ b/lib/spack/spack/cmd/info.py @@ -27,7 +27,7 @@ import spack import spack.fetch_strategy as fs -description = "Get detailed information on a particular package" +description = "get detailed information on a particular package" def padder(str_list, extra=0): @@ -43,7 +43,7 @@ def pad(string): def setup_parser(subparser): subparser.add_argument( - 'name', metavar="PACKAGE", help="Name of package to get info for.") + 'name', metavar="PACKAGE", help="name of package to get info for") def print_text_info(pkg): diff --git a/lib/spack/spack/cmd/install.py b/lib/spack/spack/cmd/install.py index 3731fe3c81a..fb01fc2d5e1 100644 --- a/lib/spack/spack/cmd/install.py +++ b/lib/spack/spack/cmd/install.py @@ -40,7 +40,7 @@ from spack.fetch_strategy import FetchError from spack.package import PackageBase -description = "Build and install packages" +description = "build and install packages" def setup_parser(subparser): @@ -49,29 +49,29 @@ def setup_parser(subparser): default='package,dependencies', dest='things_to_install', choices=['package', 'dependencies'], - help="""Select the mode of installation. -The default is to install the package along with all its dependencies. -Alternatively one can decide to install only the package or only -the dependencies.""" + help="""select the mode of installation. +the default is to install the package along with all its dependencies. +alternatively one can decide to install only the package or only +the dependencies""" ) subparser.add_argument( '-j', '--jobs', action='store', type=int, - help="Explicitly set number of make jobs. Default is #cpus.") + help="explicitly set number of make jobs. default is #cpus") subparser.add_argument( '--keep-prefix', action='store_true', dest='keep_prefix', - help="Don't remove the install prefix if installation fails.") + help="don't remove the install prefix if installation fails") subparser.add_argument( '--keep-stage', action='store_true', dest='keep_stage', - help="Don't remove the build stage if installation succeeds.") + help="don't remove the build stage if installation succeeds") subparser.add_argument( '-n', '--no-checksum', action='store_true', dest='no_checksum', - help="Do not check packages against checksum") + help="do not check packages against checksum") subparser.add_argument( '-v', '--verbose', action='store_true', dest='verbose', - help="Display verbose build output while installing.") + help="display verbose build output while installing") subparser.add_argument( '--fake', action='store_true', dest='fake', - help="Fake install. Just remove prefix and create a fake file.") + help="fake install. just remove prefix and create a fake file") cd_group = subparser.add_mutually_exclusive_group() arguments.add_common_arguments(cd_group, ['clean', 'dirty']) @@ -83,18 +83,18 @@ def setup_parser(subparser): ) subparser.add_argument( '--run-tests', action='store_true', dest='run_tests', - help="Run package level tests during installation." + help="run package level tests during installation" ) subparser.add_argument( '--log-format', default=None, choices=['junit'], - help="Format to be used for log files." + help="format to be used for log files" ) subparser.add_argument( '--log-file', default=None, - help="Filename for the log file. If not passed a default will be used." + help="filename for the log file. if not passed a default will be used" ) diff --git a/lib/spack/spack/cmd/list.py b/lib/spack/spack/cmd/list.py index e1389df69f1..b5b699dccdb 100644 --- a/lib/spack/spack/cmd/list.py +++ b/lib/spack/spack/cmd/list.py @@ -33,7 +33,7 @@ import spack from llnl.util.tty.colify import colify -description = "Print available spack packages to stdout in different formats" +description = "print available spack packages to stdout in different formats" formatters = {} @@ -47,13 +47,13 @@ def formatter(func): def setup_parser(subparser): subparser.add_argument( 'filter', nargs=argparse.REMAINDER, - help='Optional case-insensitive glob patterns to filter results.') + help='optional case-insensitive glob patterns to filter results') subparser.add_argument( '-d', '--search-description', action='store_true', default=False, - help='Filtering will also search the description for a match.') + help='filtering will also search the description for a match') subparser.add_argument( '--format', default='name_only', choices=formatters, - help='Format to be used to print the output [default: name_only]') + help='format to be used to print the output [default: name_only]') def filter_by_name(pkgs, args): diff --git a/lib/spack/spack/cmd/load.py b/lib/spack/spack/cmd/load.py index 85190a5d0b5..cdc3a741ae0 100644 --- a/lib/spack/spack/cmd/load.py +++ b/lib/spack/spack/cmd/load.py @@ -25,7 +25,7 @@ import argparse import spack.modules -description = "Add package to environment using modules." +description = "add package to environment using modules" def setup_parser(subparser): @@ -33,8 +33,8 @@ def setup_parser(subparser): message with -h. """ subparser.add_argument( 'spec', nargs=argparse.REMAINDER, - help="Spec of package to load with modules. " - "(If -, read specs from STDIN)") + help="spec of package to load with modules " + "(if -, read specs from STDIN)") def load(parser, args): diff --git a/lib/spack/spack/cmd/location.py b/lib/spack/spack/cmd/location.py index 54f71857072..c82b7072f98 100644 --- a/lib/spack/spack/cmd/location.py +++ b/lib/spack/spack/cmd/location.py @@ -29,7 +29,7 @@ import spack import spack.cmd -description = "Print out locations of various directories used by Spack" +description = "print out locations of various directories used by Spack" def setup_parser(subparser): @@ -38,34 +38,34 @@ def setup_parser(subparser): directories.add_argument( '-m', '--module-dir', action='store_true', - help="Spack python module directory.") + help="spack python module directory") directories.add_argument( '-r', '--spack-root', action='store_true', - help="Spack installation root.") + help="spack installation root") directories.add_argument( '-i', '--install-dir', action='store_true', - help="Install prefix for spec (spec need not be installed).") + help="install prefix for spec (spec need not be installed)") directories.add_argument( '-p', '--package-dir', action='store_true', - help="Directory enclosing a spec's package.py file.") + help="directory enclosing a spec's package.py file") directories.add_argument( '-P', '--packages', action='store_true', - help="Top-level packages directory for Spack.") + help="top-level packages directory for Spack") directories.add_argument( '-s', '--stage-dir', action='store_true', - help="Stage directory for a spec.") + help="stage directory for a spec") directories.add_argument( '-S', '--stages', action='store_true', - help="Top level Stage directory.") + help="top level stage directory") directories.add_argument( '-b', '--build-dir', action='store_true', - help="Checked out or expanded source directory for a spec " - "(requires it to be staged first).") + help="checked out or expanded source directory for a spec " + "(requires it to be staged first)") subparser.add_argument( 'spec', nargs=argparse.REMAINDER, - help="spec of package to fetch directory for.") + help="spec of package to fetch directory for") def location(parser, args): diff --git a/lib/spack/spack/cmd/md5.py b/lib/spack/spack/cmd/md5.py index 2ae279a41e7..7940d1327bb 100644 --- a/lib/spack/spack/cmd/md5.py +++ b/lib/spack/spack/cmd/md5.py @@ -31,13 +31,13 @@ import spack.util.crypto from spack.stage import Stage, FailedDownloadError -description = "Calculate md5 checksums for files/urls." +description = "calculate md5 checksums for files/urls" def setup_parser(subparser): setup_parser.parser = subparser subparser.add_argument('files', nargs=argparse.REMAINDER, - help="Files/urls to checksum.") + help="files/urls to checksum") def compute_md5_checksum(url): diff --git a/lib/spack/spack/cmd/mirror.py b/lib/spack/spack/cmd/mirror.py index 585faaf5249..2db75a0b1f1 100644 --- a/lib/spack/spack/cmd/mirror.py +++ b/lib/spack/spack/cmd/mirror.py @@ -37,13 +37,13 @@ from spack.error import SpackError from spack.util.spack_yaml import syaml_dict -description = "Manage mirrors." +description = "manage mirrors" def setup_parser(subparser): subparser.add_argument( '-n', '--no-checksum', action='store_true', dest='no_checksum', - help="Do not check fetched packages against checksum") + help="do not check fetched packages against checksum") sp = subparser.add_subparsers( metavar='SUBCOMMAND', dest='mirror_command') @@ -51,30 +51,30 @@ def setup_parser(subparser): # Create create_parser = sp.add_parser('create', help=mirror_create.__doc__) create_parser.add_argument('-d', '--directory', default=None, - help="Directory in which to create mirror.") + help="directory in which to create mirror") create_parser.add_argument( 'specs', nargs=argparse.REMAINDER, - help="Specs of packages to put in mirror") + help="specs of packages to put in mirror") create_parser.add_argument( - '-f', '--file', help="File with specs of packages to put in mirror.") + '-f', '--file', help="file with specs of packages to put in mirror") create_parser.add_argument( '-D', '--dependencies', action='store_true', - help="Also fetch all dependencies") + help="also fetch all dependencies") create_parser.add_argument( '-o', '--one-version-per-spec', action='store_const', const=1, default=0, - help="Only fetch one 'preferred' version per spec, not all known.") + help="only fetch one 'preferred' version per spec, not all known") scopes = spack.config.config_scopes # Add add_parser = sp.add_parser('add', help=mirror_add.__doc__) - add_parser.add_argument('name', help="Mnemonic name for mirror.") + add_parser.add_argument('name', help="mnemonic name for mirror") add_parser.add_argument( - 'url', help="URL of mirror directory from 'spack mirror create'.") + 'url', help="url of mirror directory from 'spack mirror create'") add_parser.add_argument( '--scope', choices=scopes, default=spack.cmd.default_modify_scope, - help="Configuration scope to modify.") + help="configuration scope to modify") # Remove remove_parser = sp.add_parser('remove', aliases=['rm'], @@ -82,13 +82,13 @@ def setup_parser(subparser): remove_parser.add_argument('name') remove_parser.add_argument( '--scope', choices=scopes, default=spack.cmd.default_modify_scope, - help="Configuration scope to modify.") + help="configuration scope to modify") # List list_parser = sp.add_parser('list', help=mirror_list.__doc__) list_parser.add_argument( '--scope', choices=scopes, default=spack.cmd.default_list_scope, - help="Configuration scope to read from.") + help="configuration scope to read from") def mirror_add(args): diff --git a/lib/spack/spack/cmd/module.py b/lib/spack/spack/cmd/module.py index b4ee5613397..a924c5f912c 100644 --- a/lib/spack/spack/cmd/module.py +++ b/lib/spack/spack/cmd/module.py @@ -35,7 +35,7 @@ import spack.cmd.common.arguments as arguments from spack.modules import module_types -description = "Manipulate module files" +description = "manipulate module files" # Dictionary that will be populated with the list of sub-commands # Each sub-command must be callable and accept 3 arguments : @@ -57,10 +57,10 @@ def setup_parser(subparser): sp = subparser.add_subparsers(metavar='SUBCOMMAND', dest='subparser_name') # spack module refresh - refresh_parser = sp.add_parser('refresh', help='Regenerate module files') + refresh_parser = sp.add_parser('refresh', help='regenerate module files') refresh_parser.add_argument( '--delete-tree', - help='Delete the module file tree before refresh', + help='delete the module file tree before refresh', action='store_true' ) arguments.add_common_arguments( @@ -68,11 +68,11 @@ def setup_parser(subparser): ) # spack module find - find_parser = sp.add_parser('find', help='Find module files for packages') + find_parser = sp.add_parser('find', help='find module files for packages') arguments.add_common_arguments(find_parser, ['constraint', 'module_type']) # spack module rm - rm_parser = sp.add_parser('rm', help='Remove module files') + rm_parser = sp.add_parser('rm', help='remove module files') arguments.add_common_arguments( rm_parser, ['constraint', 'module_type', 'yes_to_all'] ) @@ -80,19 +80,19 @@ def setup_parser(subparser): # spack module loads loads_parser = sp.add_parser( 'loads', - help='Prompt the list of modules associated with a constraint' + help='prompt the list of modules associated with a constraint' ) loads_parser.add_argument( '--input-only', action='store_false', dest='shell', - help='Generate input for module command (instead of a shell script)' + help='generate input for module command (instead of a shell script)' ) loads_parser.add_argument( '-p', '--prefix', dest='prefix', default='', - help='Prepend to module names when issuing module load commands' + help='prepend to module names when issuing module load commands' ) loads_parser.add_argument( '-x', '--exclude', dest='exclude', action='append', default=[], - help="Exclude package from output; may be specified multiple times" + help="exclude package from output; may be specified multiple times" ) arguments.add_common_arguments( loads_parser, ['constraint', 'module_type', 'recurse_dependencies'] diff --git a/lib/spack/spack/cmd/patch.py b/lib/spack/spack/cmd/patch.py index 9c72da40b5d..2e332554ad8 100644 --- a/lib/spack/spack/cmd/patch.py +++ b/lib/spack/spack/cmd/patch.py @@ -29,13 +29,13 @@ import spack -description = "Patch expanded archive sources in preparation for install" +description = "patch expanded archive sources in preparation for install" def setup_parser(subparser): subparser.add_argument( '-n', '--no-checksum', action='store_true', dest='no_checksum', - help="Do not check downloaded packages against checksum") + help="do not check downloaded packages against checksum") subparser.add_argument( 'packages', nargs=argparse.REMAINDER, help="specs of packages to stage") diff --git a/lib/spack/spack/cmd/pkg.py b/lib/spack/spack/cmd/pkg.py index 7791b93cf58..45104a9ff2a 100644 --- a/lib/spack/spack/cmd/pkg.py +++ b/lib/spack/spack/cmd/pkg.py @@ -31,7 +31,7 @@ import spack from spack.util.executable import * -description = "Query packages associated with particular git revisions." +description = "query packages associated with particular git revisions" def setup_parser(subparser): @@ -40,35 +40,35 @@ def setup_parser(subparser): add_parser = sp.add_parser('add', help=pkg_add.__doc__) add_parser.add_argument('packages', nargs=argparse.REMAINDER, - help="Names of packages to add to git repo.") + help="names of packages to add to git repo") list_parser = sp.add_parser('list', help=pkg_list.__doc__) list_parser.add_argument('rev', default='HEAD', nargs='?', - help="Revision to list packages for.") + help="revision to list packages for") diff_parser = sp.add_parser('diff', help=pkg_diff.__doc__) diff_parser.add_argument( 'rev1', nargs='?', default='HEAD^', - help="Revision to compare against.") + help="revision to compare against") diff_parser.add_argument( 'rev2', nargs='?', default='HEAD', - help="Revision to compare to rev1 (default is HEAD).") + help="revision to compare to rev1 (default is HEAD)") add_parser = sp.add_parser('added', help=pkg_added.__doc__) add_parser.add_argument( 'rev1', nargs='?', default='HEAD^', - help="Revision to compare against.") + help="revision to compare against") add_parser.add_argument( 'rev2', nargs='?', default='HEAD', - help="Revision to compare to rev1 (default is HEAD).") + help="revision to compare to rev1 (default is HEAD)") rm_parser = sp.add_parser('removed', help=pkg_removed.__doc__) rm_parser.add_argument( 'rev1', nargs='?', default='HEAD^', - help="Revision to compare against.") + help="revision to compare against") rm_parser.add_argument( 'rev2', nargs='?', default='HEAD', - help="Revision to compare to rev1 (default is HEAD).") + help="revision to compare to rev1 (default is HEAD)") def get_git(): diff --git a/lib/spack/spack/cmd/providers.py b/lib/spack/spack/cmd/providers.py index 0f4a97cc4a7..470e3e5ed2f 100644 --- a/lib/spack/spack/cmd/providers.py +++ b/lib/spack/spack/cmd/providers.py @@ -29,13 +29,13 @@ import spack import spack.cmd -description = "List packages that provide a particular virtual package" +description = "list packages that provide a particular virtual package" def setup_parser(subparser): subparser.add_argument( 'vpkg_spec', metavar='VPACKAGE_SPEC', nargs=argparse.REMAINDER, - help='Find packages that provide this virtual package') + help='find packages that provide this virtual package') def providers(parser, args): diff --git a/lib/spack/spack/cmd/purge.py b/lib/spack/spack/cmd/purge.py index 66cfc2af29d..56165d5d97a 100644 --- a/lib/spack/spack/cmd/purge.py +++ b/lib/spack/spack/cmd/purge.py @@ -25,22 +25,22 @@ import spack import spack.stage as stage -description = "Remove temporary build files and/or downloaded archives" +description = "remove temporary build files and/or downloaded archives" def setup_parser(subparser): subparser.add_argument( '-s', '--stage', action='store_true', default=True, - help="Remove all temporary build stages (default).") + help="remove all temporary build stages (default)") subparser.add_argument( '-d', '--downloads', action='store_true', - help="Remove cached downloads.") + help="remove cached downloads") subparser.add_argument( '-m', '--misc-cache', action='store_true', - help="Remove long-lived caches, like the virtual package index.") + help="remove long-lived caches, like the virtual package index") subparser.add_argument( '-a', '--all', action='store_true', - help="Remove all of the above.") + help="remove all of the above") def purge(parser, args): diff --git a/lib/spack/spack/cmd/python.py b/lib/spack/spack/cmd/python.py index 12727cb5998..05af7bc7764 100644 --- a/lib/spack/spack/cmd/python.py +++ b/lib/spack/spack/cmd/python.py @@ -31,15 +31,15 @@ import spack +description = "launch an interpreter as spack would launch a command" + + def setup_parser(subparser): subparser.add_argument( - '-c', dest='python_command', help='Command to execute.') + '-c', dest='python_command', help='command to execute') subparser.add_argument( 'python_args', nargs=argparse.REMAINDER, - help="File to run plus arguments.") - - -description = "Launch an interpreter as spack would launch a command" + help="file to run plus arguments") def python(parser, args): diff --git a/lib/spack/spack/cmd/reindex.py b/lib/spack/spack/cmd/reindex.py index 7dddda2ffb8..0bbd85069fc 100644 --- a/lib/spack/spack/cmd/reindex.py +++ b/lib/spack/spack/cmd/reindex.py @@ -24,7 +24,7 @@ ############################################################################## import spack import spack.store -description = "Rebuild Spack's package database." +description = "rebuild Spack's package database" def reindex(parser, args): diff --git a/lib/spack/spack/cmd/repo.py b/lib/spack/spack/cmd/repo.py index 79df63ce8d6..1881654cac4 100644 --- a/lib/spack/spack/cmd/repo.py +++ b/lib/spack/spack/cmd/repo.py @@ -30,7 +30,7 @@ import spack.config from spack.repository import * -description = "Manage package source repositories." +description = "manage package source repositories" def setup_parser(subparser): @@ -40,34 +40,34 @@ def setup_parser(subparser): # Create create_parser = sp.add_parser('create', help=repo_create.__doc__) create_parser.add_argument( - 'directory', help="Directory to create the repo in.") + 'directory', help="directory to create the repo in") create_parser.add_argument( - 'namespace', help="Namespace to identify packages in the repository. " - "Defaults to the directory name.", nargs='?') + 'namespace', help="namespace to identify packages in the repository. " + "defaults to the directory name", nargs='?') # List list_parser = sp.add_parser('list', help=repo_list.__doc__) list_parser.add_argument( '--scope', choices=scopes, default=spack.cmd.default_list_scope, - help="Configuration scope to read from.") + help="configuration scope to read from") # Add add_parser = sp.add_parser('add', help=repo_add.__doc__) add_parser.add_argument( - 'path', help="Path to a Spack package repository directory.") + 'path', help="path to a Spack package repository directory") add_parser.add_argument( '--scope', choices=scopes, default=spack.cmd.default_modify_scope, - help="Configuration scope to modify.") + help="configuration scope to modify") # Remove remove_parser = sp.add_parser( 'remove', help=repo_remove.__doc__, aliases=['rm']) remove_parser.add_argument( 'path_or_namespace', - help="Path or namespace of a Spack package repository.") + help="path or namespace of a Spack package repository") remove_parser.add_argument( '--scope', choices=scopes, default=spack.cmd.default_modify_scope, - help="Configuration scope to modify.") + help="configuration scope to modify") def repo_create(args): diff --git a/lib/spack/spack/cmd/restage.py b/lib/spack/spack/cmd/restage.py index 969afe09bda..36fee9237b5 100644 --- a/lib/spack/spack/cmd/restage.py +++ b/lib/spack/spack/cmd/restage.py @@ -29,7 +29,7 @@ import spack import spack.cmd -description = "Revert checked out package source code." +description = "revert checked out package source code" def setup_parser(subparser): diff --git a/lib/spack/spack/cmd/setup.py b/lib/spack/spack/cmd/setup.py index 746674ad322..82d00f4e11f 100644 --- a/lib/spack/spack/cmd/setup.py +++ b/lib/spack/spack/cmd/setup.py @@ -36,22 +36,21 @@ import spack.cmd.common.arguments as arguments from llnl.util.filesystem import set_executable from spack import which -from spack.cmd.edit import edit_package from spack.stage import DIYStage -description = "Create a configuration script and module, but don't build." +description = "create a configuration script and module, but don't build" def setup_parser(subparser): subparser.add_argument( '-i', '--ignore-dependencies', action='store_true', dest='ignore_deps', - help="Do not try to install dependencies of requested packages.") + help="do not try to install dependencies of requested packages") subparser.add_argument( '-v', '--verbose', action='store_true', dest='verbose', - help="Display verbose build output while installing.") + help="display verbose build output while installing") subparser.add_argument( 'spec', nargs=argparse.REMAINDER, - help="specs to use for install. Must contain package AND version.") + help="specs to use for install. must contain package AND version") cd_group = subparser.add_mutually_exclusive_group() arguments.add_common_arguments(cd_group, ['clean', 'dirty']) @@ -134,16 +133,8 @@ def setup(self, args): with spack.store.db.write_transaction(): spec = specs[0] if not spack.repo.exists(spec.name): - tty.warn("No such package: %s" % spec.name) - create = tty.get_yes_or_no("Create this package?", default=False) - if not create: - tty.msg("Exiting without creating.") - sys.exit(1) - else: - tty.msg("Running 'spack edit -f %s'" % spec.name) - edit_package(spec.name, spack.repo.first_repo(), None, True) - return - + tty.die("No package for '{0}' was found.".format(spec.name), + " Use `spack create` to create a new package") if not spec.versions.concrete: tty.die( "spack setup spec must have a single, concrete version. " diff --git a/lib/spack/spack/cmd/spec.py b/lib/spack/spack/cmd/spec.py index 4ecd4d6e549..9eea404bc7a 100644 --- a/lib/spack/spack/cmd/spec.py +++ b/lib/spack/spack/cmd/spec.py @@ -28,29 +28,29 @@ import spack.cmd import spack.cmd.common.arguments as arguments -description = "print out abstract and concrete versions of a spec." +description = "print out abstract and concrete versions of a spec" def setup_parser(subparser): arguments.add_common_arguments(subparser, ['long', 'very_long']) subparser.add_argument( '-y', '--yaml', action='store_true', default=False, - help='Print concrete spec as YAML.') + help='print concrete spec as YAML') subparser.add_argument( '-c', '--cover', action='store', default='nodes', choices=['nodes', 'edges', 'paths'], - help='How extensively to traverse the DAG. (default: nodes).') + help='how extensively to traverse the DAG (default: nodes)') subparser.add_argument( '-N', '--namespaces', action='store_true', default=False, - help='Show fully qualified package names.') + help='show fully qualified package names') subparser.add_argument( '-I', '--install-status', action='store_true', default=False, - help='Show install status of packages. Packages can be: ' + help='show install status of packages. packages can be: ' 'installed [+], missing and needed by an installed package [-], ' - 'or not installed (no annotation).') + 'or not installed (no annotation)') subparser.add_argument( '-t', '--types', action='store_true', default=False, - help='Show dependency types.') + help='show dependency types') subparser.add_argument( 'specs', nargs=argparse.REMAINDER, help="specs of packages") diff --git a/lib/spack/spack/cmd/stage.py b/lib/spack/spack/cmd/stage.py index bfc2e5f4561..e0023b7254d 100644 --- a/lib/spack/spack/cmd/stage.py +++ b/lib/spack/spack/cmd/stage.py @@ -28,16 +28,16 @@ import spack import spack.cmd -description = "Expand downloaded archive in preparation for install" +description = "expand downloaded archive in preparation for install" def setup_parser(subparser): subparser.add_argument( '-n', '--no-checksum', action='store_true', dest='no_checksum', - help="Do not check downloaded packages against checksum") + help="do not check downloaded packages against checksum") subparser.add_argument( '-p', '--path', dest='path', - help="Path to stage package, does not add to spack tree") + help="path to stage package, does not add to spack tree") subparser.add_argument( 'specs', nargs=argparse.REMAINDER, help="specs of packages to stage") diff --git a/lib/spack/spack/cmd/test.py b/lib/spack/spack/cmd/test.py index 9d92037bb64..c569a1bc880 100644 --- a/lib/spack/spack/cmd/test.py +++ b/lib/spack/spack/cmd/test.py @@ -34,24 +34,24 @@ import spack -description = "A thin wrapper around the pytest command." +description = "a thin wrapper around the pytest command" def setup_parser(subparser): subparser.add_argument( '-H', '--pytest-help', action='store_true', default=False, - help="print full pytest help message, showing advanced options.") + help="print full pytest help message, showing advanced options") list_group = subparser.add_mutually_exclusive_group() list_group.add_argument( '-l', '--list', action='store_true', default=False, - help="list basic test names.") + help="list basic test names") list_group.add_argument( '-L', '--long-list', action='store_true', default=False, - help="list the entire hierarchy of tests.") + help="list the entire hierarchy of tests") subparser.add_argument( 'tests', nargs=argparse.REMAINDER, - help="list of tests to run (will be passed to pytest -k).") + help="list of tests to run (will be passed to pytest -k)") def do_list(args, unknown_args): diff --git a/lib/spack/spack/cmd/uninstall.py b/lib/spack/spack/cmd/uninstall.py index 0fc22ce538a..f8b5408ba14 100644 --- a/lib/spack/spack/cmd/uninstall.py +++ b/lib/spack/spack/cmd/uninstall.py @@ -32,7 +32,7 @@ import spack.store import spack.repository -description = "Remove an installed package" +description = "remove an installed package" error_message = """You can either: a) Use a more specific spec, or @@ -50,24 +50,24 @@ def setup_parser(subparser): subparser.add_argument( '-f', '--force', action='store_true', dest='force', - help="Remove regardless of whether other packages depend on this one.") + help="remove regardless of whether other packages depend on this one") subparser.add_argument( '-a', '--all', action='store_true', dest='all', - help="USE CAREFULLY. Remove ALL installed packages that match each " + help="USE CAREFULLY. remove ALL installed packages that match each " "supplied spec. i.e., if you say uninstall `libelf`," - " ALL versions of `libelf` are uninstalled. If no spec is " - "supplied all installed software will be uninstalled. This " - "is both useful and dangerous, like rm -r.") + " ALL versions of `libelf` are uninstalled. if no spec is " + "supplied all installed software will be uninstalled. this " + "is both useful and dangerous, like rm -r") subparser.add_argument( '-d', '--dependents', action='store_true', dest='dependents', - help='Also uninstall any packages that depend on the ones given ' - 'via command line.') + help='also uninstall any packages that depend on the ones given ' + 'via command line') subparser.add_argument( '-y', '--yes-to-all', action='store_true', dest='yes_to_all', - help='Assume "yes" is the answer to every confirmation requested') + help='assume "yes" is the answer to every confirmation requested') subparser.add_argument( 'packages', diff --git a/lib/spack/spack/cmd/unload.py b/lib/spack/spack/cmd/unload.py index b52bedb7b48..5da6f5daa58 100644 --- a/lib/spack/spack/cmd/unload.py +++ b/lib/spack/spack/cmd/unload.py @@ -25,7 +25,7 @@ import argparse import spack.modules -description = "Remove package from environment using module." +description = "remove package from environment using module" def setup_parser(subparser): @@ -33,7 +33,7 @@ def setup_parser(subparser): message with -h. """ subparser.add_argument( 'spec', nargs=argparse.REMAINDER, - help='Spec of package to unload with modules.') + help='spec of package to unload with modules') def unload(parser, args): diff --git a/lib/spack/spack/cmd/unuse.py b/lib/spack/spack/cmd/unuse.py index 6403cf61628..e4797494578 100644 --- a/lib/spack/spack/cmd/unuse.py +++ b/lib/spack/spack/cmd/unuse.py @@ -25,7 +25,7 @@ import argparse import spack.modules -description = "Remove package from environment using dotkit." +description = "remove package from environment using dotkit" def setup_parser(subparser): @@ -33,7 +33,7 @@ def setup_parser(subparser): message with -h. """ subparser.add_argument( 'spec', nargs=argparse.REMAINDER, - help='Spec of package to unuse with dotkit.') + help='spec of package to unuse with dotkit') def unuse(parser, args): diff --git a/lib/spack/spack/cmd/url.py b/lib/spack/spack/cmd/url.py new file mode 100644 index 00000000000..6823f0febd1 --- /dev/null +++ b/lib/spack/spack/cmd/url.py @@ -0,0 +1,319 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# 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/llnl/spack +# Please also see the LICENSE file 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 +############################################################################## +from __future__ import division, print_function + +from collections import defaultdict + +import spack + +from llnl.util import tty +from spack.url import * +from spack.util.web import find_versions_of_archive + +description = "debugging tool for url parsing" + + +def setup_parser(subparser): + sp = subparser.add_subparsers(metavar='SUBCOMMAND', dest='subcommand') + + # Parse + parse_parser = sp.add_parser('parse', help='attempt to parse a url') + + parse_parser.add_argument( + 'url', + help='url to parse') + parse_parser.add_argument( + '-s', '--spider', action='store_true', + help='spider the source page for versions') + + # List + list_parser = sp.add_parser('list', help='list urls in all packages') + + list_parser.add_argument( + '-c', '--color', action='store_true', + help='color the parsed version and name in the urls shown ' + '(versions will be cyan, name red)') + list_parser.add_argument( + '-e', '--extrapolation', action='store_true', + help='color the versions used for extrapolation as well ' + '(additional versions will be green, names magenta)') + + excl_args = list_parser.add_mutually_exclusive_group() + + excl_args.add_argument( + '-n', '--incorrect-name', action='store_true', + help='only list urls for which the name was incorrectly parsed') + excl_args.add_argument( + '-v', '--incorrect-version', action='store_true', + help='only list urls for which the version was incorrectly parsed') + + # Test + sp.add_parser( + 'test', help='print a summary of how well we are parsing package urls') + + +def url(parser, args): + action = { + 'parse': url_parse, + 'list': url_list, + 'test': url_test + } + + action[args.subcommand](args) + + +def url_parse(args): + url = args.url + + tty.msg('Parsing URL: {0}'.format(url)) + print() + + ver, vs, vl, vi, vregex = parse_version_offset(url) + tty.msg('Matched version regex {0:>2}: r{1!r}'.format(vi, vregex)) + + name, ns, nl, ni, nregex = parse_name_offset(url, ver) + tty.msg('Matched name regex {0:>2}: r{1!r}'.format(ni, nregex)) + + print() + tty.msg('Detected:') + try: + print_name_and_version(url) + except UrlParseError as e: + tty.error(str(e)) + + print(' name: {0}'.format(name)) + print(' version: {0}'.format(ver)) + print() + + tty.msg('Substituting version 9.9.9b:') + newurl = substitute_version(url, '9.9.9b') + print_name_and_version(newurl) + + if args.spider: + print() + tty.msg('Spidering for versions:') + versions = find_versions_of_archive(url) + + max_len = max(len(str(v)) for v in versions) + + for v in sorted(versions): + print('{0:{1}} {2}'.format(v, max_len, versions[v])) + + +def url_list(args): + urls = set() + + # Gather set of URLs from all packages + for pkg in spack.repo.all_packages(): + url = getattr(pkg.__class__, 'url', None) + urls = url_list_parsing(args, urls, url, pkg) + + for params in pkg.versions.values(): + url = params.get('url', None) + urls = url_list_parsing(args, urls, url, pkg) + + # Print URLs + for url in sorted(urls): + if args.color or args.extrapolation: + print(color_url(url, subs=args.extrapolation, errors=True)) + else: + print(url) + + # Return the number of URLs that were printed, only for testing purposes + return len(urls) + + +def url_test(args): + # Collect statistics on how many URLs were correctly parsed + total_urls = 0 + correct_names = 0 + correct_versions = 0 + + # Collect statistics on which regexes were matched and how often + name_regex_dict = dict() + name_count_dict = defaultdict(int) + version_regex_dict = dict() + version_count_dict = defaultdict(int) + + tty.msg('Generating a summary of URL parsing in Spack...') + + # Loop through all packages + for pkg in spack.repo.all_packages(): + urls = set() + + url = getattr(pkg.__class__, 'url', None) + if url: + urls.add(url) + + for params in pkg.versions.values(): + url = params.get('url', None) + if url: + urls.add(url) + + # Calculate statistics + for url in urls: + total_urls += 1 + + # Parse versions + version = None + try: + version, vs, vl, vi, vregex = parse_version_offset(url) + version_regex_dict[vi] = vregex + version_count_dict[vi] += 1 + if version_parsed_correctly(pkg, version): + correct_versions += 1 + except UndetectableVersionError: + pass + + # Parse names + try: + name, ns, nl, ni, nregex = parse_name_offset(url, version) + name_regex_dict[ni] = nregex + name_count_dict[ni] += 1 + if name_parsed_correctly(pkg, name): + correct_names += 1 + except UndetectableNameError: + pass + + print() + print(' Total URLs found: {0}'.format(total_urls)) + print(' Names correctly parsed: {0:>4}/{1:>4} ({2:>6.2%})'.format( + correct_names, total_urls, correct_names / total_urls)) + print(' Versions correctly parsed: {0:>4}/{1:>4} ({2:>6.2%})'.format( + correct_versions, total_urls, correct_versions / total_urls)) + print() + + tty.msg('Statistics on name regular expresions:') + + print() + print(' Index Count Regular Expresion') + for ni in name_regex_dict: + print(' {0:>3}: {1:>6} r{2!r}'.format( + ni, name_count_dict[ni], name_regex_dict[ni])) + print() + + tty.msg('Statistics on version regular expresions:') + + print() + print(' Index Count Regular Expresion') + for vi in version_regex_dict: + print(' {0:>3}: {1:>6} r{2!r}'.format( + vi, version_count_dict[vi], version_regex_dict[vi])) + print() + + # Return statistics, only for testing purposes + return (total_urls, correct_names, correct_versions, + name_count_dict, version_count_dict) + + +def print_name_and_version(url): + """Prints a URL. Underlines the detected name with dashes and + the detected version with tildes. + + :param str url: The url to parse + """ + name, ns, nl, ntup, ver, vs, vl, vtup = substitution_offsets(url) + underlines = [' '] * max(ns + nl, vs + vl) + for i in range(ns, ns + nl): + underlines[i] = '-' + for i in range(vs, vs + vl): + underlines[i] = '~' + + print(' {0}'.format(url)) + print(' {0}'.format(''.join(underlines))) + + +def url_list_parsing(args, urls, url, pkg): + """Helper function for :func:`url_list`. + + :param argparse.Namespace args: The arguments given to ``spack url list`` + :param set urls: List of URLs that have already been added + :param url: A URL to potentially add to ``urls`` depending on ``args`` + :type url: str or None + :param spack.package.PackageBase pkg: The Spack package + :returns: The updated ``urls`` list + :rtype: set + """ + if url: + if args.incorrect_name: + # Only add URLs whose name was incorrectly parsed + try: + name = parse_name(url) + if not name_parsed_correctly(pkg, name): + urls.add(url) + except UndetectableNameError: + urls.add(url) + elif args.incorrect_version: + # Only add URLs whose version was incorrectly parsed + try: + version = parse_version(url) + if not version_parsed_correctly(pkg, version): + urls.add(url) + except UndetectableVersionError: + urls.add(url) + else: + urls.add(url) + + return urls + + +def name_parsed_correctly(pkg, name): + """Determine if the name of a package was correctly parsed. + + :param spack.package.PackageBase pkg: The Spack package + :param str name: The name that was extracted from the URL + :returns: True if the name was correctly parsed, else False + :rtype: bool + """ + pkg_name = pkg.name + + # After determining a name, `spack create` determines a build system. + # Some build systems prepend a special string to the front of the name. + # Since this can't be guessed from the URL, it would be unfair to say + # that these names are incorrectly parsed, so we remove them. + if pkg_name.startswith('r-'): + pkg_name = pkg_name[2:] + elif pkg_name.startswith('py-'): + pkg_name = pkg_name[3:] + elif pkg_name.startswith('octave-'): + pkg_name = pkg_name[7:] + + return name == pkg_name + + +def version_parsed_correctly(pkg, version): + """Determine if the version of a package was correctly parsed. + + :param spack.package.PackageBase pkg: The Spack package + :param str version: The version that was extracted from the URL + :returns: True if the name was correctly parsed, else False + :rtype: bool + """ + # If the version parsed from the URL is listed in a version() + # directive, we assume it was correctly parsed + for pkg_version in pkg.versions: + if str(pkg_version) == str(version): + return True + return False diff --git a/lib/spack/spack/cmd/url_parse.py b/lib/spack/spack/cmd/url_parse.py deleted file mode 100644 index 2af9671459d..00000000000 --- a/lib/spack/spack/cmd/url_parse.py +++ /dev/null @@ -1,79 +0,0 @@ -############################################################################## -# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. -# Produced at the Lawrence Livermore National Laboratory. -# -# 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/llnl/spack -# Please also see the LICENSE file 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 -############################################################################## -import llnl.util.tty as tty - -import spack -import spack.url -from spack.util.web import find_versions_of_archive - -description = "Show parsing of a URL, optionally spider web for versions." - - -def setup_parser(subparser): - subparser.add_argument('url', help="url of a package archive") - subparser.add_argument( - '-s', '--spider', action='store_true', - help="Spider the source page for versions.") - - -def print_name_and_version(url): - name, ns, nl, ntup, ver, vs, vl, vtup = spack.url.substitution_offsets(url) - underlines = [" "] * max(ns + nl, vs + vl) - for i in range(ns, ns + nl): - underlines[i] = '-' - for i in range(vs, vs + vl): - underlines[i] = '~' - - print " %s" % url - print " %s" % ''.join(underlines) - - -def url_parse(parser, args): - url = args.url - - ver, vs, vl = spack.url.parse_version_offset(url, debug=True) - name, ns, nl = spack.url.parse_name_offset(url, ver, debug=True) - print - - tty.msg("Detected:") - try: - print_name_and_version(url) - except spack.url.UrlParseError as e: - tty.error(str(e)) - - print ' name: %s' % name - print ' version: %s' % ver - - print - tty.msg("Substituting version 9.9.9b:") - newurl = spack.url.substitute_version(url, '9.9.9b') - print_name_and_version(newurl) - - if args.spider: - print - tty.msg("Spidering for versions:") - versions = find_versions_of_archive(url) - for v in sorted(versions): - print "%-20s%s" % (v, versions[v]) diff --git a/lib/spack/spack/cmd/use.py b/lib/spack/spack/cmd/use.py index e3612ace483..c9714d9de07 100644 --- a/lib/spack/spack/cmd/use.py +++ b/lib/spack/spack/cmd/use.py @@ -25,7 +25,7 @@ import argparse import spack.modules -description = "Add package to environment using dotkit." +description = "add package to environment using dotkit" def setup_parser(subparser): @@ -33,7 +33,7 @@ def setup_parser(subparser): message with -h. """ subparser.add_argument( 'spec', nargs=argparse.REMAINDER, - help='Spec of package to use with dotkit.') + help='spec of package to use with dotkit') def use(parser, args): diff --git a/lib/spack/spack/cmd/versions.py b/lib/spack/spack/cmd/versions.py index 1e95225ab8c..dacca2489b5 100644 --- a/lib/spack/spack/cmd/versions.py +++ b/lib/spack/spack/cmd/versions.py @@ -26,12 +26,12 @@ import llnl.util.tty as tty import spack -description = "List available versions of a package" +description = "list available versions of a package" def setup_parser(subparser): subparser.add_argument('package', metavar='PACKAGE', - help='Package to list versions for') + help='package to list versions for') def versions(parser, args): diff --git a/lib/spack/spack/cmd/view.py b/lib/spack/spack/cmd/view.py index 869a58f15cb..72e139d123c 100644 --- a/lib/spack/spack/cmd/view.py +++ b/lib/spack/spack/cmd/view.py @@ -69,7 +69,7 @@ import spack.cmd import llnl.util.tty as tty -description = "Produce a single-rooted directory view of a spec." +description = "produce a single-rooted directory view of a spec" def setup_parser(sp): @@ -77,40 +77,40 @@ def setup_parser(sp): sp.add_argument( '-v', '--verbose', action='store_true', default=False, - help="Display verbose output.") + help="display verbose output") sp.add_argument( '-e', '--exclude', action='append', default=[], - help="Exclude packages with names matching the given regex pattern.") + help="exclude packages with names matching the given regex pattern") sp.add_argument( '-d', '--dependencies', choices=['true', 'false', 'yes', 'no'], default='true', - help="Follow dependencies.") + help="follow dependencies") ssp = sp.add_subparsers(metavar='ACTION', dest='action') specs_opts = dict(metavar='spec', nargs='+', - help="Seed specs of the packages to view.") + help="seed specs of the packages to view") # The action parameterizes the command but in keeping with Spack # patterns we make it a subcommand. file_system_view_actions = [ ssp.add_parser( 'symlink', aliases=['add', 'soft'], - help='Add package files to a filesystem view via symbolic links.'), + help='add package files to a filesystem view via symbolic links'), ssp.add_parser( 'hardlink', aliases=['hard'], - help='Add packages files to a filesystem via via hard links.'), + help='add packages files to a filesystem via via hard links'), ssp.add_parser( 'remove', aliases=['rm'], - help='Remove packages from a filesystem view.'), + help='remove packages from a filesystem view'), ssp.add_parser( 'statlink', aliases=['status', 'check'], - help='Check status of packages in a filesystem view.') + help='check status of packages in a filesystem view') ] # All these options and arguments are common to every action. for act in file_system_view_actions: act.add_argument('path', nargs=1, - help="Path to file system view directory.") + help="path to file system view directory") act.add_argument('specs', **specs_opts) return diff --git a/lib/spack/spack/compilers/__init__.py b/lib/spack/spack/compilers/__init__.py index 6e65f502697..731acaf9c29 100644 --- a/lib/spack/spack/compilers/__init__.py +++ b/lib/spack/spack/compilers/__init__.py @@ -40,6 +40,7 @@ _imported_compilers_module = 'spack.compilers' _path_instance_vars = ['cc', 'cxx', 'f77', 'fc'] +_flags_instance_vars = ['cflags', 'cppflags', 'cxxflags', 'fflags'] _other_instance_vars = ['modules', 'operating_system', 'environment', 'extra_rpaths'] _cache_config_file = [] @@ -60,6 +61,9 @@ def _to_dict(compiler): d['paths'] = dict((attr, getattr(compiler, attr, None)) for attr in _path_instance_vars) d['flags'] = dict((fname, fvals) for fname, fvals in compiler.flags) + d['flags'].update(dict((attr, getattr(compiler, attr, None)) + for attr in _flags_instance_vars + if hasattr(compiler, attr))) d['operating_system'] = str(compiler.operating_system) d['target'] = str(compiler.target) d['modules'] = compiler.modules if compiler.modules else [] diff --git a/lib/spack/spack/compilers/xl.py b/lib/spack/spack/compilers/xl.py index f4b7c4237db..686807ae335 100644 --- a/lib/spack/spack/compilers/xl.py +++ b/lib/spack/spack/compilers/xl.py @@ -29,17 +29,16 @@ class Xl(Compiler): # Subclasses use possible names of C compiler - cc_names = ['xlc', 'xlc_r'] + cc_names = ['xlc'] # Subclasses use possible names of C++ compiler - cxx_names = ['xlC', 'xlC_r', 'xlc++', 'xlc++_r'] + cxx_names = ['xlC', 'xlc++'] # Subclasses use possible names of Fortran 77 compiler - f77_names = ['xlf', 'xlf_r'] + f77_names = ['xlf'] # Subclasses use possible names of Fortran 90 compiler - fc_names = ['xlf90', 'xlf90_r', 'xlf95', 'xlf95_r', - 'xlf2003', 'xlf2003_r', 'xlf2008', 'xlf2008_r'] + fc_names = ['xlf90', 'xlf95', 'xlf2003', 'xlf2008'] # Named wrapper links within spack.build_env_path link_paths = {'cc': 'xl/xlc', @@ -62,6 +61,14 @@ def cxx11_flag(self): def pic_flag(self): return "-qpic" + @property + def fflags(self): + # The -qzerosize flag is effective only for the Fortran 77 + # compilers and allows the use of zero size objects. + # For Fortran 90 and beyond, it is set by default and has not impact. + # Its use has no negative side effects. + return "-qzerosize" + @classmethod def default_version(cls, comp): """The '-qversion' is the standard option fo XL compilers. diff --git a/lib/spack/spack/compilers/xl_r.py b/lib/spack/spack/compilers/xl_r.py new file mode 100644 index 00000000000..d08e700f420 --- /dev/null +++ b/lib/spack/spack/compilers/xl_r.py @@ -0,0 +1,122 @@ +############################################################################## +# Copyright (c) 2016, International Business Machines Corporation +# +# This file is part of Spack. +# Created by Serban Maerean, serban@us.ibm.com based on a similar file, +# spack/lib/spack/spack/compilers/xl.py, produced by Todd Gamblin, +# tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://github.com/llnl/spack +# Please also see the LICENSE file 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 +############################################################################## +from spack.compiler import * +import llnl.util.tty as tty +from spack.version import ver + + +class XlR(Compiler): + # Subclasses use possible names of C compiler + cc_names = ['xlc_r'] + + # Subclasses use possible names of C++ compiler + cxx_names = ['xlC_r', 'xlc++_r'] + + # Subclasses use possible names of Fortran 77 compiler + f77_names = ['xlf_r'] + + # Subclasses use possible names of Fortran 90 compiler + fc_names = ['xlf90_r', 'xlf95_r', 'xlf2003_r', 'xlf2008_r'] + + # Named wrapper links within spack.build_env_path + link_paths = {'cc': 'xl_r/xlc_r', + 'cxx': 'xl_r/xlc++_r', + 'f77': 'xl_r/xlf_r', + 'fc': 'xl_r/xlf90_r'} + + @property + def openmp_flag(self): + return "-qsmp=omp" + + @property + def cxx11_flag(self): + if self.version < ver('13.1'): + tty.die("Only xlC 13.1 and above have some c++11 support.") + else: + return "-qlanglvl=extended0x" + + @property + def pic_flag(self): + return("-qpic") + + @property + def fflags(self): + # The -qzerosize flag is effective only for the Fortran 77 + # compilers and allows the use of zero size objects. + # For Fortran 90 and beyond, it is set by default and has not impact. + # Its use has no negative side effects. + return "-qzerosize" + + @classmethod + def default_version(self, comp): + """The '-qversion' is the standard option fo XL compilers. + Output looks like this:: + + IBM XL C/C++ for Linux, V11.1 (5724-X14) + Version: 11.01.0000.0000 + + or:: + + IBM XL Fortran for Linux, V13.1 (5724-X16) + Version: 13.01.0000.0000 + + or:: + + IBM XL C/C++ for AIX, V11.1 (5724-X13) + Version: 11.01.0000.0009 + + or:: + + IBM XL C/C++ Advanced Edition for Blue Gene/P, V9.0 + Version: 09.00.0000.0017 + """ + + return get_compiler_version( + comp, '-qversion', r'([0-9]?[0-9]\.[0-9])') + + @classmethod + def fc_version(cls, fc): + """The fortran and C/C++ versions of the XL compiler are always + two units apart. By this we mean that the fortran release that + goes with XL C/C++ 11.1 is 13.1. Having such a difference in + version number is confusing spack quite a lot. Most notably + if you keep the versions as is the default xl compiler will + only have fortran and no C/C++. So we associate the Fortran + compiler with the version associated to the C/C++ compiler. + One last stumble. Version numbers over 10 have at least a .1 + those under 10 a .0. There is no xlf 9.x or under currently + available. BG/P and BG/L can such a compiler mix and possibly + older version of AIX and linux on power. + """ + fver = get_compiler_version(fc, '-qversion', r'([0-9]?[0-9]\.[0-9])') + cver = float(fver) - 2 + if cver < 10: + cver = cver - 0.1 + return str(cver) + + @classmethod + def f77_version(cls, f77): + return cls.fc_version(f77) diff --git a/lib/spack/spack/directives.py b/lib/spack/spack/directives.py index 72656684e04..58eabb9e3bb 100644 --- a/lib/spack/spack/directives.py +++ b/lib/spack/spack/directives.py @@ -289,9 +289,10 @@ def extends(spec, **kwargs): """ def _execute(pkg): - if pkg.extendees: - msg = 'Packages can extend at most one other package.' - raise DirectiveError(msg) + # if pkg.extendees: + # directive = 'extends' + # msg = 'Packages can extend at most one other package.' + # raise DirectiveError(directive, msg) when = kwargs.pop('when', pkg.name) _depends_on(pkg, spec, when=when) @@ -344,8 +345,9 @@ def variant(name, default=False, description=""): def _execute(pkg): if not re.match(spack.spec.identifier_re, name): - msg = 'Invalid variant name in {0}: \'{1}\'' - raise DirectiveError(msg.format(pkg.name, name)) + directive = 'variant' + msg = "Invalid variant name in {0}: '{1}'" + raise DirectiveError(directive, msg.format(pkg.name, name)) pkg.variants[name] = Variant(default, description) return _execute diff --git a/lib/spack/spack/graph.py b/lib/spack/spack/graph.py index 1f0390dae90..7cc2046b9dc 100644 --- a/lib/spack/spack/graph.py +++ b/lib/spack/spack/graph.py @@ -138,7 +138,7 @@ class AsciiGraph(object): def __init__(self): # These can be set after initialization or after a call to # graph() to change behavior. - self.node_character = '*' + self.node_character = 'o' self.debug = False self.indent = 0 self.deptype = alldeps @@ -364,7 +364,7 @@ def _expand_right_line(self, index): self._set_state(EXPAND_RIGHT, index) self._out.write("\n") - def write(self, spec, **kwargs): + def write(self, spec, color=None, out=None): """Write out an ascii graph of the provided spec. Arguments: @@ -378,14 +378,13 @@ def write(self, spec, **kwargs): based on output file. """ - out = kwargs.get('out', None) - if not out: + if out is None: out = sys.stdout - color = kwargs.get('color', None) - if not color: + if color is None: color = out.isatty() - self._out = ColorStream(sys.stdout, color=color) + + self._out = ColorStream(out, color=color) # We'll traverse the spec in topo order as we graph it. topo_order = topological_sort(spec, reverse=True, deptype=self.deptype) diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index f9bc1fafbc0..e5ea8c56add 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -78,13 +78,14 @@ class InstallPhase(object): search for execution. The method is retrieved at __get__ time, so that it can be overridden by subclasses of whatever class declared the phases. - It also provides hooks to execute prerequisite and sanity checks. + It also provides hooks to execute arbitrary callbacks before and after + the phase. """ def __init__(self, name): self.name = name - self.preconditions = [] - self.sanity_checks = [] + self.run_before = [] + self.run_after = [] def __get__(self, instance, owner): # The caller is a class that is trying to customize @@ -101,14 +102,13 @@ def phase_wrapper(spec, prefix): self._on_phase_start(instance) # Execute phase pre-conditions, # and give them the chance to fail - for check in self.preconditions: - # Do something sensible at some point - check(instance) + for callback in self.run_before: + callback(instance) phase(spec, prefix) # Execute phase sanity_checks, # and give them the chance to fail - for check in self.sanity_checks: - check(instance) + for callback in self.run_after: + callback(instance) # Check instance attributes at the end of a phase self._on_phase_exit(instance) return phase_wrapper @@ -129,8 +129,8 @@ def copy(self): # This bug-fix was not back-ported in Python 2.6 # http://bugs.python.org/issue1515 other = InstallPhase(self.name) - other.preconditions.extend(self.preconditions) - other.sanity_checks.extend(self.sanity_checks) + other.run_before.extend(self.run_before) + other.run_after.extend(self.run_after) return other @@ -142,22 +142,23 @@ class PackageMeta(spack.directives.DirectiveMetaMixin): """ phase_fmt = '_InstallPhase_{0}' - _InstallPhase_sanity_checks = {} - _InstallPhase_preconditions = {} + _InstallPhase_run_before = {} + _InstallPhase_run_after = {} + + def __new__(mcs, name, bases, attr_dict): - def __new__(meta, name, bases, attr_dict): - # Check if phases is in attr dict, then set - # install phases wrappers if 'phases' in attr_dict: + # Turn the strings in 'phases' into InstallPhase instances + # and add them as private attributes _InstallPhase_phases = [PackageMeta.phase_fmt.format(x) for x in attr_dict['phases']] # NOQA: ignore=E501 for phase_name, callback_name in zip(_InstallPhase_phases, attr_dict['phases']): # NOQA: ignore=E501 attr_dict[phase_name] = InstallPhase(callback_name) attr_dict['_InstallPhase_phases'] = _InstallPhase_phases - def _append_checks(check_name): + def _flush_callbacks(check_name): # Name of the attribute I am going to check it exists attr_name = PackageMeta.phase_fmt.format(check_name) - checks = getattr(meta, attr_name) + checks = getattr(mcs, attr_name) if checks: for phase_name, funcs in checks.items(): try: @@ -180,57 +181,61 @@ def _append_checks(check_name): PackageMeta.phase_fmt.format(phase_name)] getattr(phase, check_name).extend(funcs) # Clear the attribute for the next class - setattr(meta, attr_name, {}) - - @classmethod - def _register_checks(cls, check_type, *args): - def _register_sanity_checks(func): - attr_name = PackageMeta.phase_fmt.format(check_type) - check_list = getattr(meta, attr_name) - for item in args: - checks = check_list.setdefault(item, []) - checks.append(func) - setattr(meta, attr_name, check_list) - return func - return _register_sanity_checks - - @staticmethod - def on_package_attributes(**attrs): - def _execute_under_condition(func): - @functools.wraps(func) - def _wrapper(instance): - # If all the attributes have the value we require, then - # execute - if all([getattr(instance, key, None) == value for key, value in attrs.items()]): # NOQA: ignore=E501 - func(instance) - return _wrapper - return _execute_under_condition - - @classmethod - def precondition(cls, *args): - return cls._register_checks('preconditions', *args) - - @classmethod - def sanity_check(cls, *args): - return cls._register_checks('sanity_checks', *args) - - if all([not hasattr(x, '_register_checks') for x in bases]): - attr_dict['_register_checks'] = _register_checks - - if all([not hasattr(x, 'sanity_check') for x in bases]): - attr_dict['sanity_check'] = sanity_check - - if all([not hasattr(x, 'precondition') for x in bases]): - attr_dict['precondition'] = precondition - - if all([not hasattr(x, 'on_package_attributes') for x in bases]): - attr_dict['on_package_attributes'] = on_package_attributes + setattr(mcs, attr_name, {}) # Preconditions - _append_checks('preconditions') + _flush_callbacks('run_before') # Sanity checks - _append_checks('sanity_checks') - return super(PackageMeta, meta).__new__(meta, name, bases, attr_dict) + _flush_callbacks('run_after') + return super(PackageMeta, mcs).__new__(mcs, name, bases, attr_dict) + + @staticmethod + def register_callback(check_type, *phases): + def _decorator(func): + attr_name = PackageMeta.phase_fmt.format(check_type) + check_list = getattr(PackageMeta, attr_name) + for item in phases: + checks = check_list.setdefault(item, []) + checks.append(func) + setattr(PackageMeta, attr_name, check_list) + return func + return _decorator + + +def run_before(*phases): + """Registers a method of a package to be run before a given phase""" + return PackageMeta.register_callback('run_before', *phases) + + +def run_after(*phases): + """Registers a method of a package to be run after a given phase""" + return PackageMeta.register_callback('run_after', *phases) + + +def on_package_attributes(**attr_dict): + """Executes the decorated method only if at the moment of calling + the instance has attributes that are equal to certain values. + + :param dict attr_dict: dictionary mapping attribute names to their + required values + """ + def _execute_under_condition(func): + + @functools.wraps(func) + def _wrapper(instance, *args, **kwargs): + # If all the attributes have the value we require, then execute + has_all_attributes = all( + [hasattr(instance, key) for key in attr_dict] + ) + if has_all_attributes: + has_the_right_values = all( + [getattr(instance, key) == value for key, value in attr_dict.items()] # NOQA: ignore=E501 + ) + if has_the_right_values: + func(instance, *args, **kwargs) + return _wrapper + + return _execute_under_condition class PackageBase(object): @@ -1555,10 +1560,9 @@ def do_activate(self, force=False): # Activate any package dependencies that are also extensions. if not force: - for spec in self.spec.traverse(root=False, deptype='run'): - if spec.package.extends(self.extendee_spec): - if not spec.package.activated: - spec.package.do_activate(force=force) + for spec in self.dependency_activations(): + if not spec.package.activated: + spec.package.do_activate(force=force) self.extendee_spec.package.activate(self, **self.extendee_args) @@ -1566,6 +1570,10 @@ def do_activate(self, force=False): tty.msg("Activated extension %s for %s" % (self.spec.short_spec, self.extendee_spec.format("$_$@$+$%@"))) + def dependency_activations(self): + return (spec for spec in self.spec.traverse(root=False, deptype='run') + if spec.package.extends(self.extendee_spec)) + def activate(self, extension, **kwargs): """Symlinks all files from the extension into extendee's install dir. @@ -1704,15 +1712,61 @@ def rpath_args(self): """ return " ".join("-Wl,-rpath,%s" % p for p in self.rpath) + build_time_test_callbacks = None + + @on_package_attributes(run_tests=True) + def _run_default_build_time_test_callbacks(self): + """Tries to call all the methods that are listed in the attribute + ``build_time_test_callbacks`` if ``self.run_tests is True``. + + If ``build_time_test_callbacks is None`` returns immediately. + """ + if self.build_time_test_callbacks is None: + return + + for name in self.build_time_test_callbacks: + try: + fn = getattr(self, name) + tty.msg('RUN-TESTS: build-time tests [{0}]'.format(name)) + fn() + except AttributeError: + msg = 'RUN-TESTS: method not implemented [{0}]' + tty.warn(msg.format(name)) + + install_time_test_callbacks = None + + @on_package_attributes(run_tests=True) + def _run_default_install_time_test_callbacks(self): + """Tries to call all the methods that are listed in the attribute + ``install_time_test_callbacks`` if ``self.run_tests is True``. + + If ``install_time_test_callbacks is None`` returns immediately. + """ + if self.install_time_test_callbacks is None: + return + + for name in self.install_time_test_callbacks: + try: + fn = getattr(self, name) + tty.msg('RUN-TESTS: install-time tests [{0}]'.format(name)) + fn() + except AttributeError: + msg = 'RUN-TESTS: method not implemented [{0}]' + tty.warn(msg.format(name)) + class Package(PackageBase): + """General purpose class with a single ``install`` + phase that needs to be coded by packagers. + """ + #: The one and only phase phases = ['install'] - # To be used in UI queries that require to know which - # build-system class we are using + #: This attribute is used in UI queries that require to know which + #: build-system class we are using build_system_class = 'Package' # This will be used as a registration decorator in user # packages, if need be - PackageBase.sanity_check('install')(PackageBase.sanity_check_prefix) + run_after('install')(PackageBase.sanity_check_prefix) def install_dependency_symlinks(pkg, spec, prefix): diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py index e34f2b799d3..07e3221ed7a 100644 --- a/lib/spack/spack/spec.py +++ b/lib/spack/spack/spec.py @@ -152,7 +152,9 @@ 'UnsatisfiableArchitectureSpecError', 'UnsatisfiableProviderSpecError', 'UnsatisfiableDependencySpecError', - 'AmbiguousHashError'] + 'AmbiguousHashError', + 'InvalidHashError', + 'RedundantSpecError'] # Valid pattern for an identifier in Spack identifier_re = r'\w[\w-]*' @@ -1388,8 +1390,9 @@ def _replace_with(self, concrete): dependent = dep_spec.parent deptypes = dep_spec.deptypes - # remove self from all dependents. - del dependent._dependencies[self.name] + # remove self from all dependents, unless it is already removed + if self.name in dependent._dependencies: + del dependent._dependencies[self.name] # add the replacement, unless it is already a dep of dependent. if concrete.name not in dependent._dependencies: @@ -1992,7 +1995,7 @@ def _autospec(self, spec_like): except SpecError: return parse_anonymous_spec(spec_like, self.name) - def satisfies(self, other, deps=True, strict=False): + def satisfies(self, other, deps=True, strict=False, strict_deps=False): """Determine if this spec satisfies all constraints of another. There are two senses for satisfies: @@ -2008,8 +2011,8 @@ def satisfies(self, other, deps=True, strict=False): other = self._autospec(other) # The only way to satisfy a concrete spec is to match its hash exactly. - if other._concrete: - return self._concrete and self.dag_hash() == other.dag_hash() + if other.concrete: + return self.concrete and self.dag_hash() == other.dag_hash() # A concrete provider can satisfy a virtual dependency. if not self.virtual and other.virtual: @@ -2066,7 +2069,8 @@ def satisfies(self, other, deps=True, strict=False): # If we need to descend into dependencies, do it, otherwise we're done. if deps: deps_strict = strict - if not (self.name and other.name): + if self.concrete and not other.name: + # We're dealing with existing specs deps_strict = True return self.satisfies_dependencies(other, strict=deps_strict) else: @@ -2082,9 +2086,10 @@ def satisfies_dependencies(self, other, strict=False): if other._dependencies and not self._dependencies: return False - alldeps = set(d.name for d in self.traverse(root=False)) - if not all(dep.name in alldeps - for dep in other.traverse(root=False)): + selfdeps = self.traverse(root=False) + otherdeps = other.traverse(root=False) + if not all(any(d.satisfies(dep) for d in selfdeps) + for dep in otherdeps): return False elif not self._dependencies or not other._dependencies: @@ -2696,30 +2701,28 @@ def do_parse(self): specs = [] try: - while self.next or self.previous: + while self.next: # TODO: clean this parsing up a bit - if self.previous: - # We picked up the name of this spec while finishing the - # previous spec - specs.append(self.spec(self.previous.value)) - self.previous = None - elif self.accept(ID): + if self.accept(ID): self.previous = self.token if self.accept(EQ): - # We're either parsing an anonymous spec beginning - # with a key-value pair or adding a key-value pair - # to the last spec + # We're parsing an anonymous spec beginning with a + # key-value pair. if not specs: specs.append(self.spec(None)) self.expect(VAL) + # Raise an error if the previous spec is already + # concrete (assigned by hash) + if specs[-1]._hash: + raise RedundantSpecError(specs[-1], + 'key-value pair') specs[-1]._add_flag( self.previous.value, self.token.value) self.previous = None else: # We're parsing a new spec by name - value = self.previous.value self.previous = None - specs.append(self.spec(value)) + specs.append(self.spec(self.token.value)) elif self.accept(HASH): # We're finding a spec by hash specs.append(self.spec_by_hash()) @@ -2727,27 +2730,38 @@ def do_parse(self): elif self.accept(DEP): if not specs: # We're parsing an anonymous spec beginning with a - # dependency - self.previous = self.token + # dependency. Push the token to recover after creating + # anonymous spec + self.push_tokens([self.token]) specs.append(self.spec(None)) - self.previous = None - if self.accept(HASH): - # We're finding a dependency by hash for an anonymous - # spec - dep = self.spec_by_hash() else: - # We're adding a dependency to the last spec - self.expect(ID) - dep = self.spec(self.token.value) + if self.accept(HASH): + # We're finding a dependency by hash for an + # anonymous spec + dep = self.spec_by_hash() + else: + # We're adding a dependency to the last spec + self.expect(ID) + dep = self.spec(self.token.value) - # command line deps get empty deptypes now. - # Real deptypes are assigned later per packages. - specs[-1]._add_dependency(dep, ()) + # Raise an error if the previous spec is already + # concrete (assigned by hash) + if specs[-1]._hash: + raise RedundantSpecError(specs[-1], 'dependency') + # command line deps get empty deptypes now. + # Real deptypes are assigned later per packages. + specs[-1]._add_dependency(dep, ()) else: # If the next token can be part of a valid anonymous spec, # create the anonymous spec if self.next.type in (AT, ON, OFF, PCT): + # Raise an error if the previous spec is already + # concrete (assigned by hash) + if specs and specs[-1]._hash: + raise RedundantSpecError(specs[-1], + 'compiler, version, ' + 'or variant') specs.append(self.spec(None)) else: self.unexpected_token() @@ -2782,13 +2796,13 @@ def spec_by_hash(self): if len(matches) != 1: raise AmbiguousHashError( - "Multiple packages specify hash %s." % self.token.value, - *matches) + "Multiple packages specify hash beginning '%s'." + % self.token.value, *matches) return matches[0] def spec(self, name): - """Parse a spec out of the input. If a spec is supplied, then initialize + """Parse a spec out of the input. If a spec is supplied, initialize and return it instead of creating a new one.""" if name: spec_namespace, dot, spec_name = name.rpartition('.') @@ -2822,16 +2836,6 @@ def spec(self, name): # unspecified or not. added_version = False - if self.previous and self.previous.value == DEP: - if self.accept(HASH): - spec.add_dependency(self.spec_by_hash()) - else: - self.expect(ID) - if self.accept(EQ): - raise SpecParseError(spack.parse.ParseError( - "", "", "Expected dependency received anonymous spec")) - spec.add_dependency(self.spec(self.token.value)) - while self.next: if self.accept(AT): vlist = self.version_list() @@ -2857,13 +2861,25 @@ def spec(self, name): self.previous = None else: # We've found the start of a new spec. Go back to do_parse + # and read this token again. + self.push_tokens([self.token]) + self.previous = None break + elif self.accept(HASH): + # Get spec by hash and confirm it matches what we already have + hash_spec = self.spec_by_hash() + if hash_spec.satisfies(spec): + spec = hash_spec + break + else: + raise InvalidHashError(spec, hash_spec.dag_hash()) + else: break # If there was no version in the spec, consier it an open range - if not added_version: + if not added_version and not spec._hash: spec.versions = VersionList(':') return spec @@ -3135,6 +3151,21 @@ def __init__(self, provided, required): class AmbiguousHashError(SpecError): def __init__(self, msg, *specs): - super(AmbiguousHashError, self).__init__(msg) - for spec in specs: - print(' ', spec.format('$.$@$%@+$+$=$#')) + specs_str = '\n ' + '\n '.join(spec.format('$.$@$%@+$+$=$#') + for spec in specs) + super(AmbiguousHashError, self).__init__(msg + specs_str) + + +class InvalidHashError(SpecError): + def __init__(self, spec, hash): + super(InvalidHashError, self).__init__( + "The spec specified by %s does not match provided spec %s" + % (hash, spec)) + + +class RedundantSpecError(SpecError): + def __init__(self, spec, addition): + super(RedundantSpecError, self).__init__( + "Attempting to add %s to spec %s which is already concrete." + " This is likely the result of adding to a spec specified by hash." + % (addition, spec)) diff --git a/lib/spack/spack/test/build_system_guess.py b/lib/spack/spack/test/build_system_guess.py index 86c1c9da135..82bf1964b20 100644 --- a/lib/spack/spack/test/build_system_guess.py +++ b/lib/spack/spack/test/build_system_guess.py @@ -32,12 +32,13 @@ @pytest.fixture( scope='function', params=[ - ('configure', 'autotools'), + ('configure', 'autotools'), ('CMakeLists.txt', 'cmake'), - ('SConstruct', 'scons'), - ('setup.py', 'python'), - ('NAMESPACE', 'r'), - ('foobar', 'unknown') + ('SConstruct', 'scons'), + ('setup.py', 'python'), + ('NAMESPACE', 'r'), + ('WORKSPACE', 'bazel'), + ('foobar', 'generic') ] ) def url_and_build_system(request, tmpdir): diff --git a/lib/spack/spack/test/cmd/url.py b/lib/spack/spack/test/cmd/url.py new file mode 100644 index 00000000000..4c60d814cea --- /dev/null +++ b/lib/spack/spack/test/cmd/url.py @@ -0,0 +1,116 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# 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/llnl/spack +# Please also see the LICENSE file 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 +############################################################################## +import argparse +import pytest + +from spack.cmd.url import * + + +@pytest.fixture(scope='module') +def parser(): + """Returns the parser for the ``url`` command""" + parser = argparse.ArgumentParser() + setup_parser(parser) + return parser + + +class MyPackage: + def __init__(self, name, versions): + self.name = name + self.versions = versions + + +def test_name_parsed_correctly(): + # Expected True + assert name_parsed_correctly(MyPackage('netcdf', []), 'netcdf') + assert name_parsed_correctly(MyPackage('r-devtools', []), 'devtools') + assert name_parsed_correctly(MyPackage('py-numpy', []), 'numpy') + assert name_parsed_correctly(MyPackage('octave-splines', []), 'splines') + + # Expected False + assert not name_parsed_correctly(MyPackage('', []), 'hdf5') + assert not name_parsed_correctly(MyPackage('hdf5', []), '') + assert not name_parsed_correctly(MyPackage('imagemagick', []), 'ImageMagick') # noqa + assert not name_parsed_correctly(MyPackage('yaml-cpp', []), 'yamlcpp') + assert not name_parsed_correctly(MyPackage('yamlcpp', []), 'yaml-cpp') + assert not name_parsed_correctly(MyPackage('r-py-parser', []), 'parser') + assert not name_parsed_correctly(MyPackage('oce', []), 'oce-0.18.0') # noqa + + +def test_version_parsed_correctly(): + # Expected True + assert version_parsed_correctly(MyPackage('', ['1.2.3']), '1.2.3') + assert version_parsed_correctly(MyPackage('', ['5.4a', '5.4b']), '5.4a') + assert version_parsed_correctly(MyPackage('', ['5.4a', '5.4b']), '5.4b') + + # Expected False + assert not version_parsed_correctly(MyPackage('', []), '1.2.3') + assert not version_parsed_correctly(MyPackage('', ['1.2.3']), '') + assert not version_parsed_correctly(MyPackage('', ['1.2.3']), '1.2.4') + assert not version_parsed_correctly(MyPackage('', ['3.4a']), '3.4') + assert not version_parsed_correctly(MyPackage('', ['3.4']), '3.4b') + assert not version_parsed_correctly(MyPackage('', ['0.18.0']), 'oce-0.18.0') # noqa + + +def test_url_parse(parser): + args = parser.parse_args(['parse', 'http://zlib.net/fossils/zlib-1.2.10.tar.gz']) + url(parser, args) + + +@pytest.mark.xfail +def test_url_parse_xfail(parser): + # No version in URL + args = parser.parse_args(['parse', 'http://www.netlib.org/voronoi/triangle.zip']) + url(parser, args) + + +def test_url_list(parser): + args = parser.parse_args(['list']) + total_urls = url_list(args) + + # The following two options should not change the number of URLs printed. + args = parser.parse_args(['list', '--color', '--extrapolation']) + colored_urls = url_list(args) + assert colored_urls == total_urls + + # The following two options should print fewer URLs than the default. + # If they print the same number of URLs, something is horribly broken. + # If they say we missed 0 URLs, something is probably broken too. + args = parser.parse_args(['list', '--incorrect-name']) + incorrect_name_urls = url_list(args) + assert 0 < incorrect_name_urls < total_urls + + args = parser.parse_args(['list', '--incorrect-version']) + incorrect_version_urls = url_list(args) + assert 0 < incorrect_version_urls < total_urls + + +def test_url_test(parser): + args = parser.parse_args(['test']) + (total_urls, correct_names, correct_versions, + name_count_dict, version_count_dict) = url_test(args) + + assert 0 < correct_names <= sum(name_count_dict.values()) <= total_urls # noqa + assert 0 < correct_versions <= sum(version_count_dict.values()) <= total_urls # noqa diff --git a/lib/spack/spack/test/graph.py b/lib/spack/spack/test/graph.py new file mode 100644 index 00000000000..09dbcd05486 --- /dev/null +++ b/lib/spack/spack/test/graph.py @@ -0,0 +1,138 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# 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/llnl/spack +# Please also see the LICENSE file 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 +############################################################################## +from StringIO import StringIO + +from spack.spec import Spec +from spack.graph import AsciiGraph, topological_sort, graph_dot + + +def test_topo_sort(builtin_mock): + """Test topo sort gives correct order.""" + s = Spec('mpileaks').normalized() + + topo = topological_sort(s) + + assert topo.index('mpileaks') < topo.index('callpath') + assert topo.index('mpileaks') < topo.index('mpi') + assert topo.index('mpileaks') < topo.index('dyninst') + assert topo.index('mpileaks') < topo.index('libdwarf') + assert topo.index('mpileaks') < topo.index('libelf') + + assert topo.index('callpath') < topo.index('mpi') + assert topo.index('callpath') < topo.index('dyninst') + assert topo.index('callpath') < topo.index('libdwarf') + assert topo.index('callpath') < topo.index('libelf') + + assert topo.index('dyninst') < topo.index('libdwarf') + assert topo.index('dyninst') < topo.index('libelf') + + assert topo.index('libdwarf') < topo.index('libelf') + + +def test_static_graph_mpileaks(builtin_mock): + """Test a static spack graph for a simple package.""" + s = Spec('mpileaks').normalized() + + stream = StringIO() + graph_dot([s], static=True, out=stream) + + dot = stream.getvalue() + + assert ' "mpileaks" [label="mpileaks"]\n' in dot + assert ' "dyninst" [label="dyninst"]\n' in dot + assert ' "callpath" [label="callpath"]\n' in dot + assert ' "libelf" [label="libelf"]\n' in dot + assert ' "libdwarf" [label="libdwarf"]\n' in dot + + assert ' "dyninst" -> "libdwarf"\n' in dot + assert ' "callpath" -> "dyninst"\n' in dot + assert ' "mpileaks" -> "mpi"\n' in dot + assert ' "libdwarf" -> "libelf"\n' in dot + assert ' "callpath" -> "mpi"\n' in dot + assert ' "mpileaks" -> "callpath"\n' in dot + assert ' "dyninst" -> "libelf"\n' in dot + + +def test_dynamic_dot_graph_mpileaks(builtin_mock): + """Test dynamically graphing the mpileaks package.""" + s = Spec('mpileaks').normalized() + + stream = StringIO() + graph_dot([s], static=False, out=stream) + + dot = stream.getvalue() + + mpileaks_hash, mpileaks_lbl = s.dag_hash(), s.format('$_$#') + mpi_hash, mpi_lbl = s['mpi'].dag_hash(), s['mpi'].format('$_$#') + callpath_hash, callpath_lbl = ( + s['callpath'].dag_hash(), s['callpath'].format('$_$#')) + dyninst_hash, dyninst_lbl = ( + s['dyninst'].dag_hash(), s['dyninst'].format('$_$#')) + libdwarf_hash, libdwarf_lbl = ( + s['libdwarf'].dag_hash(), s['libdwarf'].format('$_$#')) + libelf_hash, libelf_lbl = ( + s['libelf'].dag_hash(), s['libelf'].format('$_$#')) + + assert ' "%s" [label="%s"]\n' % (mpileaks_hash, mpileaks_lbl) in dot + assert ' "%s" [label="%s"]\n' % (callpath_hash, callpath_lbl) in dot + assert ' "%s" [label="%s"]\n' % (mpi_hash, mpi_lbl) in dot + assert ' "%s" [label="%s"]\n' % (dyninst_hash, dyninst_lbl) in dot + assert ' "%s" [label="%s"]\n' % (libdwarf_hash, libdwarf_lbl) in dot + assert ' "%s" [label="%s"]\n' % (libelf_hash, libelf_lbl) in dot + + assert ' "%s" -> "%s"\n' % (dyninst_hash, libdwarf_hash) in dot + assert ' "%s" -> "%s"\n' % (callpath_hash, dyninst_hash) in dot + assert ' "%s" -> "%s"\n' % (mpileaks_hash, mpi_hash) in dot + assert ' "%s" -> "%s"\n' % (libdwarf_hash, libelf_hash) in dot + assert ' "%s" -> "%s"\n' % (callpath_hash, mpi_hash) in dot + assert ' "%s" -> "%s"\n' % (mpileaks_hash, callpath_hash) in dot + assert ' "%s" -> "%s"\n' % (dyninst_hash, libelf_hash) in dot + + +def test_ascii_graph_mpileaks(builtin_mock): + """Test dynamically graphing the mpileaks package.""" + s = Spec('mpileaks').normalized() + + stream = StringIO() + graph = AsciiGraph() + graph.write(s, out=stream, color=False) + string = stream.getvalue() + + # Some lines in spack graph still have trailing space + # TODO: fix this. + string = '\n'.join([line.rstrip() for line in string.split('\n')]) + + assert string == r'''o mpileaks +|\ +| o callpath +|/| +o | mpi + / +o dyninst +|\ +| o libdwarf +|/ +o libelf +''' diff --git a/lib/spack/spack/test/packages.py b/lib/spack/spack/test/packages.py index 6ae8a33a247..bc1f438e448 100644 --- a/lib/spack/spack/test/packages.py +++ b/lib/spack/spack/test/packages.py @@ -108,6 +108,13 @@ def test_inheritance_of_diretives(): assert 'mpi' in s +def test_dependency_extensions(): + s = Spec('extension2') + s.concretize() + deps = set(x.name for x in s.package.dependency_activations()) + assert deps == set(['extension1']) + + def test_import_class_from_package(builtin_mock): from spack.pkg.builtin.mock.mpich import Mpich # noqa diff --git a/lib/spack/spack/test/spec_semantics.py b/lib/spack/spack/test/spec_semantics.py index 84c8650f15f..2f3b2b1b8de 100644 --- a/lib/spack/spack/test/spec_semantics.py +++ b/lib/spack/spack/test/spec_semantics.py @@ -287,6 +287,14 @@ def test_unsatisfiable_compiler_flag(self): # 'mpich' is concrete: check_unsatisfiable('mpich', 'mpich cppflags="-O3"', True) + def test_copy_satisfies_transitive(self): + spec = Spec('dttop') + spec.concretize() + copy = spec.copy() + for s in spec.traverse(): + assert s.satisfies(copy[s.name]) + assert copy[s.name].satisfies(s) + def test_unsatisfiable_compiler_flag_mismatch(self): # No matchi in specs check_unsatisfiable( diff --git a/lib/spack/spack/test/spec_syntax.py b/lib/spack/spack/test/spec_syntax.py index 043d9b176fb..fcb6cfa907b 100644 --- a/lib/spack/spack/test/spec_syntax.py +++ b/lib/spack/spack/test/spec_syntax.py @@ -132,6 +132,13 @@ def test_package_names(self): self.check_parse("mvapich_foo") self.check_parse("_mvapich_foo") + def test_anonymous_specs(self): + self.check_parse("%intel") + self.check_parse("@2.7") + self.check_parse("^zlib") + self.check_parse("+foo") + self.check_parse("arch=test-None-None", "platform=test") + def test_simple_dependence(self): self.check_parse("openmpi^hwloc") self.check_parse("openmpi^hwloc^libunwind") @@ -218,6 +225,115 @@ def test_parse_errors(self): errors = ['x@@1.2', 'x ^y@@1.2', 'x@1.2::', 'x::'] self._check_raises(SpecParseError, errors) + def test_spec_by_hash(self, database): + specs = database.mock.db.query() + hashes = [s._hash for s in specs] # Preserves order of elements + + # Make sure the database is still the shape we expect + assert len(specs) > 3 + + self.check_parse(str(specs[0]), '/' + hashes[0]) + self.check_parse(str(specs[1]), '/ ' + hashes[1][:5]) + self.check_parse(str(specs[2]), specs[2].name + '/' + hashes[2]) + self.check_parse(str(specs[3]), + specs[3].name + '@' + str(specs[3].version) + + ' /' + hashes[3][:6]) + + def test_dep_spec_by_hash(self, database): + specs = database.mock.db.query() + hashes = [s._hash for s in specs] # Preserves order of elements + + # Make sure the database is still the shape we expect + assert len(specs) > 10 + assert specs[4].name in specs[10] + assert specs[-1].name in specs[10] + + spec1 = sp.Spec(specs[10].name + '^/' + hashes[4]) + assert specs[4].name in spec1 and spec1[specs[4].name] == specs[4] + spec2 = sp.Spec(specs[10].name + '%' + str(specs[10].compiler) + + ' ^ / ' + hashes[-1]) + assert (specs[-1].name in spec2 and + spec2[specs[-1].name] == specs[-1] and + spec2.compiler == specs[10].compiler) + spec3 = sp.Spec(specs[10].name + '^/' + hashes[4][:4] + + '^ / ' + hashes[-1][:5]) + assert (specs[-1].name in spec3 and + spec3[specs[-1].name] == specs[-1] and + specs[4].name in spec3 and spec3[specs[4].name] == specs[4]) + + def test_multiple_specs_with_hash(self, database): + specs = database.mock.db.query() + hashes = [s._hash for s in specs] # Preserves order of elements + + assert len(specs) > 3 + + output = sp.parse(specs[0].name + '/' + hashes[0] + '/' + hashes[1]) + assert len(output) == 2 + output = sp.parse('/' + hashes[0] + '/' + hashes[1]) + assert len(output) == 2 + output = sp.parse('/' + hashes[0] + '/' + hashes[1] + + ' ' + specs[2].name) + assert len(output) == 3 + output = sp.parse('/' + hashes[0] + + ' ' + specs[1].name + ' ' + specs[2].name) + assert len(output) == 3 + output = sp.parse('/' + hashes[0] + ' ' + + specs[1].name + ' / ' + hashes[1]) + assert len(output) == 2 + + def test_ambiguous_hash(self, database): + specs = database.mock.db.query() + hashes = [s._hash for s in specs] # Preserves order of elements + + # Make sure the database is as expected + assert hashes[1][:1] == hashes[2][:1] == 'b' + + ambiguous_hashes = ['/b', + specs[1].name + '/b', + specs[0].name + '^/b', + specs[0].name + '^' + specs[1].name + '/b'] + self._check_raises(AmbiguousHashError, ambiguous_hashes) + + def test_invalid_hash(self, database): + specs = database.mock.db.query() + hashes = [s._hash for s in specs] # Preserves order of elements + + # Make sure the database is as expected + assert (hashes[0] != hashes[3] and + hashes[1] != hashes[4] and len(specs) > 4) + + inputs = [specs[0].name + '/' + hashes[3], + specs[1].name + '^' + specs[4].name + '/' + hashes[0], + specs[1].name + '^' + specs[4].name + '/' + hashes[1]] + self._check_raises(InvalidHashError, inputs) + + def test_nonexistent_hash(self, database): + # This test uses database to make sure we don't accidentally access + # real installs, however unlikely + specs = database.mock.db.query() + hashes = [s._hash for s in specs] # Preserves order of elements + + # Make sure the database is as expected + assert 'abc123' not in [h[:6] for h in hashes] + + nonexistant_hashes = ['/abc123', + specs[0].name + '/abc123'] + self._check_raises(SystemExit, nonexistant_hashes) + + def test_redundant_spec(self, database): + specs = database.mock.db.query() + hashes = [s._hash for s in specs] # Preserves order of elements + + # Make sure the database is as expected + assert len(specs) > 3 + + redundant_specs = ['/' + hashes[0] + '%' + str(specs[0].compiler), + specs[1].name + '/' + hashes[1] + + '@' + str(specs[1].version), + specs[2].name + '/' + hashes[2] + '^ libelf', + '/' + hashes[3] + ' cflags="-O3 -fPIC"'] + self._check_raises(RedundantSpecError, redundant_specs) + def test_duplicate_variant(self): duplicates = [ 'x@1.2+debug+debug', diff --git a/lib/spack/spack/test/url_parse.py b/lib/spack/spack/test/url_parse.py index c4718d56b84..8913de94d02 100644 --- a/lib/spack/spack/test/url_parse.py +++ b/lib/spack/spack/test/url_parse.py @@ -364,3 +364,8 @@ def test_luaposix_version(self): self.check( 'luaposix', '33.4.0', 'https://github.com/luaposix/luaposix/archive/release-v33.4.0.tar.gz') + + def test_sionlib_version(self): + self.check( + 'sionlib', '1.7.1', + 'http://apps.fz-juelich.de/jsc/sionlib/download.php?version=1.7.1') diff --git a/lib/spack/spack/url.py b/lib/spack/spack/url.py index a1eec6067ea..65f8e12e58f 100644 --- a/lib/spack/spack/url.py +++ b/lib/spack/spack/url.py @@ -28,17 +28,17 @@ download location of the package, and figure out version and name information from there. -Example: when spack is given the following URL: +**Example:** when spack is given the following URL: - ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.1-p243.tar.gz + https://www.hdfgroup.org/ftp/HDF/releases/HDF4.2.12/src/hdf-4.2.12.tar.gz -It can figure out that the package name is ruby, and that it is at version -1.9.1-p243. This is useful for making the creation of packages simple: a user +It can figure out that the package name is ``hdf``, and that it is at version +``4.2.12``. This is useful for making the creation of packages simple: a user just supplies a URL and skeleton code is generated automatically. -Spack can also figure out that it can most likely download 1.8.1 at this URL: +Spack can also figure out that it can most likely download 4.2.6 at this URL: - ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.8.1.tar.gz + https://www.hdfgroup.org/ftp/HDF/releases/HDF4.2.6/src/hdf-4.2.6.tar.gz This is useful if a user asks for a package at a particular version number; spack doesn't need anyone to tell it where to get the tarball even though @@ -104,24 +104,23 @@ def strip_query_and_fragment(path): def split_url_extension(path): """Some URLs have a query string, e.g.: - 1. https://github.com/losalamos/CLAMR/blob/packages/PowerParser_v2.0.7.tgz?raw=true - 2. http://www.apache.org/dyn/closer.cgi?path=/cassandra/1.2.0/apache-cassandra-1.2.0-rc2-bin.tar.gz - 3. https://gitlab.kitware.com/vtk/vtk/repository/archive.tar.bz2?ref=v7.0.0 + 1. https://github.com/losalamos/CLAMR/blob/packages/PowerParser_v2.0.7.tgz?raw=true + 2. http://www.apache.org/dyn/closer.cgi?path=/cassandra/1.2.0/apache-cassandra-1.2.0-rc2-bin.tar.gz + 3. https://gitlab.kitware.com/vtk/vtk/repository/archive.tar.bz2?ref=v7.0.0 - In (1), the query string needs to be stripped to get at the - extension, but in (2) & (3), the filename is IN a single final query - argument. + In (1), the query string needs to be stripped to get at the + extension, but in (2) & (3), the filename is IN a single final query + argument. - This strips the URL into three pieces: prefix, ext, and suffix. - The suffix contains anything that was stripped off the URL to - get at the file extension. In (1), it will be '?raw=true', but - in (2), it will be empty. In (3) the suffix is a parameter that follows - after the file extension, e.g.: + This strips the URL into three pieces: ``prefix``, ``ext``, and ``suffix``. + The suffix contains anything that was stripped off the URL to + get at the file extension. In (1), it will be ``'?raw=true'``, but + in (2), it will be empty. In (3) the suffix is a parameter that follows + after the file extension, e.g.: - 1. ('https://github.com/losalamos/CLAMR/blob/packages/PowerParser_v2.0.7', '.tgz', '?raw=true') - 2. ('http://www.apache.org/dyn/closer.cgi?path=/cassandra/1.2.0/apache-cassandra-1.2.0-rc2-bin', - '.tar.gz', None) - 3. ('https://gitlab.kitware.com/vtk/vtk/repository/archive', '.tar.bz2', '?ref=v7.0.0') + 1. ``('https://github.com/losalamos/CLAMR/blob/packages/PowerParser_v2.0.7', '.tgz', '?raw=true')`` + 2. ``('http://www.apache.org/dyn/closer.cgi?path=/cassandra/1.2.0/apache-cassandra-1.2.0-rc2-bin', '.tar.gz', None)`` + 3. ``('https://gitlab.kitware.com/vtk/vtk/repository/archive', '.tar.bz2', '?ref=v7.0.0')`` """ prefix, ext, suffix = path, '', '' @@ -149,7 +148,7 @@ def determine_url_file_extension(path): """This returns the type of archive a URL refers to. This is sometimes confusing because of URLs like: - (1) https://github.com/petdance/ack/tarball/1.93_02 + (1) https://github.com/petdance/ack/tarball/1.93_02 Where the URL doesn't actually contain the filename. We need to know what type it is so that we can appropriately name files @@ -166,19 +165,44 @@ def determine_url_file_extension(path): return ext -def parse_version_offset(path, debug=False): - """Try to extract a version string from a filename or URL. This is taken - largely from Homebrew's Version class.""" +def parse_version_offset(path): + """Try to extract a version string from a filename or URL. + + :param str path: The filename or URL for the package + + :return: A tuple containing: + version of the package, + first index of version, + length of version string, + the index of the matching regex + the matching regex + + :rtype: tuple + + :raises UndetectableVersionError: If the URL does not match any regexes + """ original_path = path + # path: The prefix of the URL, everything before the ext and suffix + # ext: The file extension + # suffix: Any kind of query string that begins with a '?' path, ext, suffix = split_url_extension(path) - # Allow matches against the basename, to avoid including parent - # dirs in version name Remember the offset of the stem in the path + # stem: Everything from path after the final '/' stem = os.path.basename(path) offset = len(path) - len(stem) - version_types = [ + # List of the following format: + # + # [ + # (regex, string), + # ... + # ] + # + # The first regex that matches string will be used to determine + # the version of the package. Thefore, hyperspecific regexes should + # come first while generic, catch-all regexes should come last. + version_regexes = [ # GitHub tarballs, e.g. v1.2.3 (r'github.com/.+/(?:zip|tar)ball/v?((\d+\.)+\d+)$', path), @@ -213,7 +237,9 @@ def parse_version_offset(path, debug=False): # Search dotted versions: # e.g., https://gitlab.kitware.com/vtk/vtk/repository/archive.tar.bz2?ref=v7.0.0 # e.g., https://example.com/org/repo/repository/archive.tar.bz2?ref=SomePrefix-2.1.1 + # e.g., http://apps.fz-juelich.de/jsc/sionlib/download.php?version=1.7.1 (r'\?ref=(?:.*-|v)*((\d+\.)+\d+).*$', suffix), + (r'\?version=((\d+\.)+\d+)', suffix), # e.g. boost_1_39_0 (r'((\d+_)+\d+)$', stem), @@ -256,16 +282,13 @@ def parse_version_offset(path, debug=False): (r'\/(\d\.\d+)\/', path), # e.g. http://www.ijg.org/files/jpegsrc.v8d.tar.gz - (r'\.v(\d+[a-z]?)', stem)] + (r'\.v(\d+[a-z]?)', stem) + ] - for i, vtype in enumerate(version_types): - regex, match_string = vtype + for i, version_regex in enumerate(version_regexes): + regex, match_string = version_regex match = re.search(regex, match_string) if match and match.group(1) is not None: - if debug: - tty.msg("Parsing URL: %s" % path, - " Matched regex %d: r'%s'" % (i, regex)) - version = match.group(1) start = match.start(1) @@ -273,30 +296,74 @@ def parse_version_offset(path, debug=False): if match_string is stem: start += offset - return version, start, len(version) + return version, start, len(version), i, regex raise UndetectableVersionError(original_path) -def parse_version(path, debug=False): - """Given a URL or archive name, extract a version from it and return - a version object. +def parse_version(path): + """Try to extract a version string from a filename or URL. + + :param str path: The filename or URL for the package + + :return: The version of the package + :rtype: spack.version.Version + + :raises UndetectableVersionError: If the URL does not match any regexes """ - ver, start, l = parse_version_offset(path, debug=debug) - return Version(ver) + version, start, length, i, regex = parse_version_offset(path) + return Version(version) -def parse_name_offset(path, v=None, debug=False): +def parse_name_offset(path, v=None): + """Try to determine the name of a package from its filename or URL. + + :param str path: The filename or URL for the package + :param str v: The version of the package + + :return: A tuple containing: + name of the package, + first index of name, + length of name, + the index of the matching regex + the matching regex + + :rtype: tuple + + :raises UndetectableNameError: If the URL does not match any regexes + """ + original_path = path + + # We really need to know the version of the package + # This helps us prevent collisions between the name and version if v is None: - v = parse_version(path, debug=debug) + try: + v = parse_version(path) + except UndetectableVersionError: + # Not all URLs contain a version. We still want to be able + # to determine a name if possible. + v = '' + # path: The prefix of the URL, everything before the ext and suffix + # ext: The file extension + # suffix: Any kind of query string that begins with a '?' path, ext, suffix = split_url_extension(path) - # Allow matching with either path or stem, as with the version. + # stem: Everything from path after the final '/' stem = os.path.basename(path) offset = len(path) - len(stem) - name_types = [ + # List of the following format: + # + # [ + # (regex, string), + # ... + # ] + # + # The first regex that matches string will be used to determine + # the name of the package. Thefore, hyperspecific regexes should + # come first while generic, catch-all regexes should come last. + name_regexes = [ (r'/sourceforge/([^/]+)/', path), (r'github.com/[^/]+/[^/]+/releases/download/%s/(.*)-%s$' % (v, v), path), @@ -304,6 +371,7 @@ def parse_name_offset(path, v=None, debug=False): (r'/([^/]+)[_.-](bin|dist|stable|src|sources)[_.-]%s' % v, path), (r'github.com/[^/]+/([^/]+)/archive', path), (r'[^/]+/([^/]+)/repository/archive', path), # gitlab + (r'([^/]+)/download.php', path), (r'([^/]+)[_.-]v?%s' % v, stem), # prefer the stem (r'([^/]+)%s' % v, stem), @@ -313,10 +381,11 @@ def parse_name_offset(path, v=None, debug=False): (r'/([^/]+)%s' % v, path), (r'^([^/]+)[_.-]v?%s' % v, path), - (r'^([^/]+)%s' % v, path)] + (r'^([^/]+)%s' % v, path) + ] - for i, name_type in enumerate(name_types): - regex, match_string = name_type + for i, name_regex in enumerate(name_regexes): + regex, match_string = name_regex match = re.search(regex, match_string) if match: name = match.group(1) @@ -330,17 +399,38 @@ def parse_name_offset(path, v=None, debug=False): name = name.lower() name = re.sub('[_.]', '-', name) - return name, start, len(name) + return name, start, len(name), i, regex - raise UndetectableNameError(path) + raise UndetectableNameError(original_path) def parse_name(path, ver=None): - name, start, l = parse_name_offset(path, ver) + """Try to determine the name of a package from its filename or URL. + + :param str path: The filename or URL for the package + :param str ver: The version of the package + + :return: The name of the package + :rtype: str + + :raises UndetectableNameError: If the URL does not match any regexes + """ + name, start, length, i, regex = parse_name_offset(path, ver) return name def parse_name_and_version(path): + """Try to determine the name of a package and extract its version + from its filename or URL. + + :param str path: The filename or URL for the package + + :return: A tuple containing: + The name of the package + The version of the package + + :rtype: tuple + """ ver = parse_version(path) name = parse_name(path, ver) return (name, ver) @@ -368,12 +458,12 @@ def cumsum(elts, init=0, fn=lambda x: x): def substitution_offsets(path): """This returns offsets for substituting versions and names in the - provided path. It is a helper for substitute_version(). + provided path. It is a helper for :func:`substitute_version`. """ # Get name and version offsets try: - ver, vs, vl = parse_version_offset(path) - name, ns, nl = parse_name_offset(path, ver) + ver, vs, vl, vi, vregex = parse_version_offset(path) + name, ns, nl, ni, nregex = parse_name_offset(path, ver) except UndetectableNameError: return (None, -1, -1, (), ver, vs, vl, (vs,)) except UndetectableVersionError: @@ -441,21 +531,22 @@ def wildcard_version(path): def substitute_version(path, new_version): """Given a URL or archive name, find the version in the path and - substitute the new version for it. Replace all occurrences of - the version *if* they don't overlap with the package name. + substitute the new version for it. Replace all occurrences of + the version *if* they don't overlap with the package name. - Simple example:: - substitute_version('http://www.mr511.de/software/libelf-0.8.13.tar.gz', '2.9.3') - ->'http://www.mr511.de/software/libelf-2.9.3.tar.gz' + Simple example: - Complex examples:: - substitute_version('http://mvapich.cse.ohio-state.edu/download/mvapich/mv2/mvapich2-2.0.tar.gz', 2.1) - -> 'http://mvapich.cse.ohio-state.edu/download/mvapich/mv2/mvapich2-2.1.tar.gz' + .. code-block:: python - # In this string, the "2" in mvapich2 is NOT replaced. - substitute_version('http://mvapich.cse.ohio-state.edu/download/mvapich/mv2/mvapich2-2.tar.gz', 2.1) - -> 'http://mvapich.cse.ohio-state.edu/download/mvapich/mv2/mvapich2-2.1.tar.gz' + substitute_version('http://www.mr511.de/software/libelf-0.8.13.tar.gz', '2.9.3') + >>> 'http://www.mr511.de/software/libelf-2.9.3.tar.gz' + Complex example: + + .. code-block:: python + + substitute_version('https://www.hdfgroup.org/ftp/HDF/releases/HDF4.2.12/src/hdf-4.2.12.tar.gz', '2.3') + >>> 'https://www.hdfgroup.org/ftp/HDF/releases/HDF2.3/src/hdf-2.3.tar.gz' """ (name, ns, nl, noffs, ver, vs, vl, voffs) = substitution_offsets(path) @@ -474,17 +565,16 @@ def substitute_version(path, new_version): def color_url(path, **kwargs): """Color the parts of the url according to Spack's parsing. - Colors are: - Cyan: The version found by parse_version_offset(). - Red: The name found by parse_name_offset(). + Colors are: + | Cyan: The version found by :func:`parse_version_offset`. + | Red: The name found by :func:`parse_name_offset`. - Green: Instances of version string from substitute_version(). - Magenta: Instances of the name (protected from substitution). - - Optional args: - errors=True Append parse errors at end of string. - subs=True Color substitutions as well as parsed name/version. + | Green: Instances of version string from :func:`substitute_version`. + | Magenta: Instances of the name (protected from substitution). + :param str path: The filename or URL for the package + :keyword bool errors: Append parse errors at end of string. + :keyword bool subs: Color substitutions as well as parsed name/version. """ errors = kwargs.get('errors', False) subs = kwargs.get('subs', False) diff --git a/share/spack/setup-env.sh b/share/spack/setup-env.sh index 943db726120..24ab3dae6f4 100755 --- a/share/spack/setup-env.sh +++ b/share/spack/setup-env.sh @@ -167,6 +167,11 @@ function _spack_pathadd { fi } +# Export spack function so it is available in subshells (only works with bash) +if [ -n "${BASH_VERSION:-}" ]; then + export -f spack +fi + # # Figure out where this file is. Below code needs to be portable to # bash and zsh. diff --git a/var/spack/repos/builtin.mock/packages/cmake-client/package.py b/var/spack/repos/builtin.mock/packages/cmake-client/package.py index 51704e3f4b6..e82d2cd781c 100644 --- a/var/spack/repos/builtin.mock/packages/cmake-client/package.py +++ b/var/spack/repos/builtin.mock/packages/cmake-client/package.py @@ -22,9 +22,10 @@ # License along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## -from spack import * import os +from spack import * + def check(condition, msg): """Raise an install error if condition is False.""" @@ -39,6 +40,28 @@ class CmakeClient(CMakePackage): version('1.0', '4cb3ff35b2472aae70f542116d616e63') + callback_counter = 0 + + flipped = False + run_this = True + check_this_is_None = None + did_something = False + + @run_after('cmake') + @run_before('cmake', 'build', 'install') + def increment(self): + self.callback_counter += 1 + + @run_after('cmake') + @on_package_attributes(run_this=True, check_this_is_None=None) + def flip(self): + self.flipped = True + + @run_after('cmake') + @on_package_attributes(does_not_exist=None) + def do_not_execute(self): + self.did_something = True + def setup_environment(self, spack_env, run_env): spack_cc # Ensure spack module-scope variable is avaiabl check(from_cmake == "from_cmake", @@ -67,11 +90,15 @@ def setup_dependent_package(self, module, dspec): "setup_dependent_package.") def cmake(self, spec, prefix): - pass + assert self.callback_counter == 1 - build = cmake + def build(self, spec, prefix): + assert self.did_something is False + assert self.flipped is True + assert self.callback_counter == 3 def install(self, spec, prefix): + assert self.callback_counter == 4 # check that cmake is in the global scope. global cmake check(cmake is not None, "No cmake was in environment!") diff --git a/var/spack/repos/builtin.mock/packages/extendee/package.py b/var/spack/repos/builtin.mock/packages/extendee/package.py new file mode 100644 index 00000000000..f86bcf7de5a --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/extendee/package.py @@ -0,0 +1,39 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# 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/llnl/spack +# Please also see the LICENSE file 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 +############################################################################## +from spack import * + + +class Extendee(Package): + """A package with extensions""" + + homepage = "http://www.example.com" + url = "http://www.example.com/extendee-1.0.tar.gz" + + extendable = True + + version('1.0', 'hash-extendee-1.0') + + def install(self, spec, prefix): + pass diff --git a/var/spack/repos/builtin.mock/packages/extension1/package.py b/var/spack/repos/builtin.mock/packages/extension1/package.py new file mode 100644 index 00000000000..d3babc6ce40 --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/extension1/package.py @@ -0,0 +1,39 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# 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/llnl/spack +# Please also see the LICENSE file 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 +############################################################################## +from spack import * + + +class Extension1(Package): + """A package which extends another package""" + + homepage = "http://www.example.com" + url = "http://www.example.com/extension1-1.0.tar.gz" + + extends('extendee') + + version('1.0', 'hash-extension1-1.0') + + def install(self, spec, prefix): + pass diff --git a/var/spack/repos/builtin.mock/packages/extension2/package.py b/var/spack/repos/builtin.mock/packages/extension2/package.py new file mode 100644 index 00000000000..fcb23ab8ede --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/extension2/package.py @@ -0,0 +1,41 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# 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/llnl/spack +# Please also see the LICENSE file 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 +############################################################################## +from spack import * + + +class Extension2(Package): + """A package which extends another package. It also depends on another + package which extends the same package.""" + + homepage = "http://www.example.com" + url = "http://www.example.com/extension2-1.0.tar.gz" + + extends('extendee') + depends_on('extension1', type=('build', 'run')) + + version('1.0', 'hash-extension2-1.0') + + def install(self, spec, prefix): + pass diff --git a/var/spack/repos/builtin/packages/adol-c/package.py b/var/spack/repos/builtin/packages/adol-c/package.py index 5c8d8947574..4260b6b21b2 100644 --- a/var/spack/repos/builtin/packages/adol-c/package.py +++ b/var/spack/repos/builtin/packages/adol-c/package.py @@ -36,6 +36,8 @@ class AdolC(Package): version('2.6.2', '0f9547584c99c0673e4f81cf64e8d865') version('2.6.1', '1032b28427d6e399af4610e78c0f087b') + variant('advanced_branching', default=False, + description='Enable advanced branching to reduce retaping') variant('doc', default=True, description='Install documentation') variant('openmp', default=False, description='Enable OpenMP support') variant('sparse', default=False, description='Enable sparse drivers') @@ -45,10 +47,13 @@ class AdolC(Package): patch('openmp_exam_261.patch', when='@2.6.1') def install(self, spec, prefix): - make_args = ['--prefix=%s' % prefix] + make_args = ['--prefix=%s' % prefix, + '--enable-atrig-erf'] - # --with-cflags=FLAGS use CFLAGS=FLAGS (default: -O3 -Wall -ansi) - # --with-cxxflags=FLAGS use CXXFLAGS=FLAGS (default: -O3 -Wall) + if '+advanced_branching' in spec: + make_args.extend([ + '--enable-advanced-branching' + ]) if '+openmp' in spec: if spec.satisfies('%gcc'): diff --git a/var/spack/repos/builtin/packages/applewmproto/package.py b/var/spack/repos/builtin/packages/applewmproto/package.py index 8d7e360bfb0..41d7c4c10a9 100644 --- a/var/spack/repos/builtin/packages/applewmproto/package.py +++ b/var/spack/repos/builtin/packages/applewmproto/package.py @@ -25,7 +25,7 @@ from spack import * -class Applewmproto(Package): +class Applewmproto(AutotoolsPackage): """Apple Rootless Window Management Extension. This extension defines a protcol that allows X window managers @@ -39,8 +39,3 @@ class Applewmproto(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make('install') diff --git a/var/spack/repos/builtin/packages/appres/package.py b/var/spack/repos/builtin/packages/appres/package.py index 47a9c5bb545..ff13937a0e6 100644 --- a/var/spack/repos/builtin/packages/appres/package.py +++ b/var/spack/repos/builtin/packages/appres/package.py @@ -25,7 +25,7 @@ from spack import * -class Appres(Package): +class Appres(AutotoolsPackage): """The appres program prints the resources seen by an application (or subhierarchy of an application) with the specified class and instance names. It can be used to determine which resources a particular @@ -42,9 +42,3 @@ class Appres(Package): depends_on('xproto@7.0.17:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/asciidoc/package.py b/var/spack/repos/builtin/packages/asciidoc/package.py index 552030d965f..428bb7d645c 100644 --- a/var/spack/repos/builtin/packages/asciidoc/package.py +++ b/var/spack/repos/builtin/packages/asciidoc/package.py @@ -25,7 +25,7 @@ from spack import * -class Asciidoc(Package): +class Asciidoc(AutotoolsPackage): """A presentable text document format for writing articles, UNIX man pages and other small to medium sized documents.""" @@ -38,9 +38,3 @@ class Asciidoc(Package): depends_on('libxslt') depends_on('docbook-xml') depends_on('docbook-xsl') - - def install(self, spec, prefix): - configure('--prefix=%s' % prefix) - - make() - make("install") diff --git a/var/spack/repos/builtin/packages/astyle/package.py b/var/spack/repos/builtin/packages/astyle/package.py index 16c59469fab..851952be660 100644 --- a/var/spack/repos/builtin/packages/astyle/package.py +++ b/var/spack/repos/builtin/packages/astyle/package.py @@ -39,6 +39,7 @@ class Astyle(MakefilePackage): parallel = False + @property def build_directory(self): return join_path(self.stage.source_path, 'build', self.compiler.name) diff --git a/var/spack/repos/builtin/packages/atk/package.py b/var/spack/repos/builtin/packages/atk/package.py index 0a7d48774d8..1375f2d0f92 100644 --- a/var/spack/repos/builtin/packages/atk/package.py +++ b/var/spack/repos/builtin/packages/atk/package.py @@ -25,7 +25,7 @@ from spack import * -class Atk(Package): +class Atk(AutotoolsPackage): """ATK provides the set of accessibility interfaces that are implemented by other toolkits and applications. Using the ATK interfaces, accessibility tools have full access to view and @@ -43,8 +43,3 @@ def url_for_version(self, version): """Handle atk's version-based custom URLs.""" url = 'http://ftp.gnome.org/pub/gnome/sources/atk' return url + '/%s/atk-%s.tar.xz' % (version.up_to(2), version) - - def install(self, spec, prefix): - configure("--prefix=%s" % prefix) - make() - make("install") diff --git a/var/spack/repos/builtin/packages/autoconf/package.py b/var/spack/repos/builtin/packages/autoconf/package.py index d812350ae8f..3dcf8f36b5f 100644 --- a/var/spack/repos/builtin/packages/autoconf/package.py +++ b/var/spack/repos/builtin/packages/autoconf/package.py @@ -38,6 +38,8 @@ class Autoconf(AutotoolsPackage): depends_on('m4@1.4.6:', type='build') + build_directory = 'spack-build' + def _make_executable(self, name): return Executable(join_path(self.prefix.bin, name)) diff --git a/var/spack/repos/builtin/packages/automake/package.py b/var/spack/repos/builtin/packages/automake/package.py index 6c0a47ff95a..8643f5d8364 100644 --- a/var/spack/repos/builtin/packages/automake/package.py +++ b/var/spack/repos/builtin/packages/automake/package.py @@ -37,6 +37,8 @@ class Automake(AutotoolsPackage): depends_on('autoconf', type='build') + build_directory = 'spack-build' + def _make_executable(self, name): return Executable(join_path(self.prefix.bin, name)) diff --git a/var/spack/repos/builtin/packages/bash-completion/package.py b/var/spack/repos/builtin/packages/bash-completion/package.py index 666a1bef13e..0bd4d7c294a 100644 --- a/var/spack/repos/builtin/packages/bash-completion/package.py +++ b/var/spack/repos/builtin/packages/bash-completion/package.py @@ -25,10 +25,10 @@ from spack import * -class BashCompletion(Package): +class BashCompletion(AutotoolsPackage): """Programmable completion functions for bash.""" homepage = "https://github.com/scop/bash-completion" - url = "https://github.com/scop/bash-completion/archive/2.3.tar.gz" + url = "https://github.com/scop/bash-completion/archive/2.3.tar.gz" version('2.3', '67e50f5f3c804350b43f2b664c33dde811d24292') version('develop', git='https://github.com/scop/bash-completion.git') @@ -41,16 +41,9 @@ class BashCompletion(Package): # Other dependencies depends_on('bash@4.1:', type='run') - def install(self, spec, prefix): - make_args = ['--prefix=%s' % prefix] - - autoreconf('-i') - configure(*make_args) - make() - # make("check") # optional, requires dejagnu and tcllib - make("install", - parallel=False) - + @run_after('install') + def show_message_to_user(self): + prefix = self.prefix # Guidelines for individual user as provided by the author at # https://github.com/scop/bash-completion print('=====================================================') @@ -59,6 +52,6 @@ def install(self, spec, prefix): print('') print('# Use bash-completion, if available') print('[[ $PS1 && -f %s/share/bash-completion/bash_completion ]] && \ ' % prefix) # NOQA: ignore=E501 - print(' . %s/share/bash-completion/bash_completion' % prefix) + print(' . %s/share/bash-completion/bash_completion' % prefix) print('') print('=====================================================') diff --git a/var/spack/repos/builtin/packages/bash/package.py b/var/spack/repos/builtin/packages/bash/package.py index e0cd114635e..33168c2c34c 100644 --- a/var/spack/repos/builtin/packages/bash/package.py +++ b/var/spack/repos/builtin/packages/bash/package.py @@ -29,7 +29,7 @@ class Bash(Package): """The GNU Project's Bourne Again SHell.""" homepage = "https://www.gnu.org/software/bash/" - url = "ftp://ftp.gnu.org/gnu/bash/bash-4.3.tar.gz" + url = "https://ftp.gnu.org/gnu/bash/bash-4.3.tar.gz" version('4.3', '81348932d5da294953e15d4814c74dd1') diff --git a/var/spack/repos/builtin/packages/bdftopcf/package.py b/var/spack/repos/builtin/packages/bdftopcf/package.py index 095f0c1bd4c..b6ddd044181 100644 --- a/var/spack/repos/builtin/packages/bdftopcf/package.py +++ b/var/spack/repos/builtin/packages/bdftopcf/package.py @@ -25,7 +25,7 @@ from spack import * -class Bdftopcf(Package): +class Bdftopcf(AutotoolsPackage): """bdftopcf is a font compiler for the X server and font server. Fonts in Portable Compiled Format can be read by any architecture, although the file is structured to allow one particular architecture to read @@ -42,9 +42,3 @@ class Bdftopcf(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/beforelight/package.py b/var/spack/repos/builtin/packages/beforelight/package.py index 37a91f56148..3c0cbcf3cb9 100644 --- a/var/spack/repos/builtin/packages/beforelight/package.py +++ b/var/spack/repos/builtin/packages/beforelight/package.py @@ -25,7 +25,7 @@ from spack import * -class Beforelight(Package): +class Beforelight(AutotoolsPackage): """The beforelight program is a sample implementation of a screen saver for X servers supporting the MIT-SCREEN-SAVER extension. It is only recommended for use as a code sample, as it does not include features @@ -42,9 +42,3 @@ class Beforelight(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/bertini/package.py b/var/spack/repos/builtin/packages/bertini/package.py index 7dd17a062e5..c6d169fbcc7 100644 --- a/var/spack/repos/builtin/packages/bertini/package.py +++ b/var/spack/repos/builtin/packages/bertini/package.py @@ -25,7 +25,7 @@ from spack import * -class Bertini(Package): +class Bertini(AutotoolsPackage): """Bertini is a general-purpose solver, written in C, that was created for research about polynomial continuation. It solves for the numerical solution of systems of polynomial equations using homotopy continuation.""" @@ -42,9 +42,3 @@ class Bertini(Package): depends_on('gmp') depends_on('mpfr') depends_on('mpi', when='+mpi') - - def install(self, spec, prefix): - configure('--prefix=%s' % prefix) - - make() - make("install") diff --git a/var/spack/repos/builtin/packages/bigreqsproto/package.py b/var/spack/repos/builtin/packages/bigreqsproto/package.py index 61fd9c51216..f2542d921e2 100644 --- a/var/spack/repos/builtin/packages/bigreqsproto/package.py +++ b/var/spack/repos/builtin/packages/bigreqsproto/package.py @@ -25,7 +25,7 @@ from spack import * -class Bigreqsproto(Package): +class Bigreqsproto(AutotoolsPackage): """Big Requests Extension. This extension defines a protocol to enable the use of requests @@ -38,8 +38,3 @@ class Bigreqsproto(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make('install') diff --git a/var/spack/repos/builtin/packages/bison/package.py b/var/spack/repos/builtin/packages/bison/package.py index 70795f05ccf..a9691fab8b1 100644 --- a/var/spack/repos/builtin/packages/bison/package.py +++ b/var/spack/repos/builtin/packages/bison/package.py @@ -25,7 +25,7 @@ from spack import * -class Bison(Package): +class Bison(AutotoolsPackage): """Bison is a general-purpose parser generator that converts an annotated context-free grammar into a deterministic LR or generalized LR (GLR) parser employing LALR(1) parser tables.""" @@ -37,8 +37,4 @@ class Bison(Package): depends_on("m4", type='build') - def install(self, spec, prefix): - configure("--prefix=%s" % prefix) - - make() - make("install") + build_directory = 'spack-build' diff --git a/var/spack/repos/builtin/packages/bitmap/package.py b/var/spack/repos/builtin/packages/bitmap/package.py index 55fdacefd5a..80bc496013f 100644 --- a/var/spack/repos/builtin/packages/bitmap/package.py +++ b/var/spack/repos/builtin/packages/bitmap/package.py @@ -25,7 +25,7 @@ from spack import * -class Bitmap(Package): +class Bitmap(AutotoolsPackage): """bitmap, bmtoa, atobm - X bitmap (XBM) editor and converter utilities.""" homepage = "http://cgit.freedesktop.org/xorg/app/bitmap" @@ -43,9 +43,3 @@ class Bitmap(Package): depends_on('xproto@7.0.25:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/bzip2/package.py b/var/spack/repos/builtin/packages/bzip2/package.py index 9e5894a6a84..d12b88e734d 100644 --- a/var/spack/repos/builtin/packages/bzip2/package.py +++ b/var/spack/repos/builtin/packages/bzip2/package.py @@ -36,6 +36,7 @@ class Bzip2(Package): url = "http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz" version('1.0.6', '00b516f4704d4a7cb50a1d97e6e8e15b') + variant('shared', default=True, description='Enables the build of shared libraries.') def patch(self): # bzip2 comes with two separate Makefiles for static and dynamic builds @@ -71,27 +72,30 @@ def patch(self): def install(self, spec, prefix): # Build the dynamic library first - make('-f', 'Makefile-libbz2_so') + if '+shared' in spec: + make('-f', 'Makefile-libbz2_so') + # Build the static library and everything else make() make('install', 'PREFIX={0}'.format(prefix)) - install('bzip2-shared', join_path(prefix.bin, 'bzip2')) + if '+shared' in spec: + install('bzip2-shared', join_path(prefix.bin, 'bzip2')) - v1, v2, v3 = (self.spec.version.up_to(i) for i in (1, 2, 3)) - if 'darwin' in self.spec.architecture: - lib = 'libbz2.dylib' - lib1, lib2, lib3 = ('libbz2.{0}.dylib'.format(v) - for v in (v1, v2, v3)) - else: - lib = 'libbz2.so' - lib1, lib2, lib3 = ('libbz2.so.{0}'.format(v) - for v in (v1, v2, v3)) + v1, v2, v3 = (self.spec.version.up_to(i) for i in (1, 2, 3)) + if 'darwin' in self.spec.architecture: + lib = 'libbz2.dylib' + lib1, lib2, lib3 = ('libbz2.{0}.dylib'.format(v) + for v in (v1, v2, v3)) + else: + lib = 'libbz2.so' + lib1, lib2, lib3 = ('libbz2.so.{0}'.format(v) + for v in (v1, v2, v3)) - install(lib3, join_path(prefix.lib, lib3)) - with working_dir(prefix.lib): - for l in (lib, lib1, lib2): - symlink(lib3, l) + install(lib3, join_path(prefix.lib, lib3)) + with working_dir(prefix.lib): + for l in (lib, lib1, lib2): + symlink(lib3, l) with working_dir(prefix.bin): force_remove('bunzip2', 'bzcat') diff --git a/var/spack/repos/builtin/packages/c-blosc/package.py b/var/spack/repos/builtin/packages/c-blosc/package.py index 4ebf3811a58..8bb0e295afb 100644 --- a/var/spack/repos/builtin/packages/c-blosc/package.py +++ b/var/spack/repos/builtin/packages/c-blosc/package.py @@ -31,20 +31,24 @@ class CBlosc(Package): """Blosc, an extremely fast, multi-threaded, meta-compressor library""" homepage = "http://www.blosc.org" - url = "https://github.com/Blosc/c-blosc/archive/v1.9.2.tar.gz" + url = "https://github.com/Blosc/c-blosc/archive/v1.11.1.tar.gz" - version('1.9.2', 'dd2d83069d74b36b8093f1c6b49defc5') - version('1.9.1', '7d708d3daadfacf984a87b71b1734ce2') - version('1.9.0', 'e4c1dc8e2c468e5cfa2bf05eeee5357a') - version('1.8.1', 'd73d5be01359cf271e9386c90dcf5b05') - version('1.8.0', '5b92ecb287695ba20cc33d30bf221c4f') + version('1.11.1', 'e236550640afa50155f3881f2d300206') + version('1.9.2', 'dd2d83069d74b36b8093f1c6b49defc5') + version('1.9.1', '7d708d3daadfacf984a87b71b1734ce2') + version('1.9.0', 'e4c1dc8e2c468e5cfa2bf05eeee5357a') + version('1.8.1', 'd73d5be01359cf271e9386c90dcf5b05') + version('1.8.0', '5b92ecb287695ba20cc33d30bf221c4f') + + variant('avx2', default=True, description='Enable AVX2 support') depends_on("cmake", type='build') depends_on("snappy") depends_on("zlib") def install(self, spec, prefix): - cmake('.', *std_cmake_args) + avx2 = '-DDEACTIVATE_AVX2=%s' % ('ON' if '~avx2' in spec else 'OFF') + cmake('.', avx2, *std_cmake_args) make() make("install") diff --git a/var/spack/repos/builtin/packages/cdd/package.py b/var/spack/repos/builtin/packages/cdd/package.py index 4a0a0aefef7..96414bc54b6 100644 --- a/var/spack/repos/builtin/packages/cdd/package.py +++ b/var/spack/repos/builtin/packages/cdd/package.py @@ -33,7 +33,7 @@ class Cdd(Package): a general convex polyhedron given by a system of linear inequalities""" homepage = "https://www.inf.ethz.ch/personal/fukudak/cdd_home/cdd.html" - url = "ftp://ftp.ifor.math.ethz.ch/pub/fukuda/cdd/cdd-061a.tar.gz" + url = "http://www.cs.mcgill.ca/~fukuda/download/cdd/cdd-061a.tar.gz" version('0.61a', '22c24a7a9349dd7ec0e24531925a02d9') @@ -42,7 +42,7 @@ class Cdd(Package): patch("Makefile.spack.patch") def url_for_version(self, version): - url = "ftp://ftp.ifor.math.ethz.ch/pub/fukuda/cdd/cdd-{0}.tar.gz" + url = "http://www.cs.mcgill.ca/~fukuda/download/cdd/cdd-{0}.tar.gz" return url.format(version.joined) def install(self, spec, prefix): diff --git a/var/spack/repos/builtin/packages/cddlib/package.py b/var/spack/repos/builtin/packages/cddlib/package.py index ced5f46d1f4..50dc5ad4724 100644 --- a/var/spack/repos/builtin/packages/cddlib/package.py +++ b/var/spack/repos/builtin/packages/cddlib/package.py @@ -26,7 +26,7 @@ from spack import * -class Cddlib(Package): +class Cddlib(AutotoolsPackage): """The C-library cddlib is a C implementation of the Double Description Method of Motzkin et al. for generating all vertices (i.e. extreme points) and extreme rays of a general convex polyhedron in R^d given by a system @@ -51,8 +51,3 @@ def url_for_version(self, version): depends_on("gmp") depends_on("libtool", type="build") - - def install(self, spec, prefix): - configure("--prefix=%s" % prefix) - make() - make("install") diff --git a/var/spack/repos/builtin/packages/cfitsio/package.py b/var/spack/repos/builtin/packages/cfitsio/package.py index 79af31ae216..811b3ca9bc7 100644 --- a/var/spack/repos/builtin/packages/cfitsio/package.py +++ b/var/spack/repos/builtin/packages/cfitsio/package.py @@ -25,20 +25,38 @@ from spack import * -class Cfitsio(Package): +class Cfitsio(AutotoolsPackage): """CFITSIO is a library of C and Fortran subroutines for reading and writing data files in FITS (Flexible Image Transport System) data format. """ homepage = 'http://heasarc.gsfc.nasa.gov/fitsio/' + version('3.410', '8a4a66fcdd816aae41768baa0b025552') version('3.370', 'abebd2d02ba5b0503c633581e3bfa116') + variant('bzip2', default=True, description='Enable bzip2 support') + variant('shared', default=True, description='Build shared libraries') + + depends_on('bzip2', when='+bzip2') + def url_for_version(self, version): - url = 'ftp://heasarc.gsfc.nasa.gov/software/fitsio/c/cfitsio{0}.tar.gz' + url = 'http://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio{0}.tar.gz' return url.format(version.joined) - def install(self, spec, prefix): - configure('--prefix=' + prefix) - make() - make('install') + def configure_args(self): + spec = self.spec + extra_args = [] + if '+bzip2' in spec: + extra_args.append('--with-bzip2=%s' % spec['bzip2'].prefix), + return extra_args + + @property + def build_targets(self): + targets = ['all'] + + # Build shared if variant is set. + if '+shared' in self.spec: + targets += ['shared'] + + return targets diff --git a/var/spack/repos/builtin/packages/cityhash/package.py b/var/spack/repos/builtin/packages/cityhash/package.py index 85d948cc57a..b98f39a3360 100644 --- a/var/spack/repos/builtin/packages/cityhash/package.py +++ b/var/spack/repos/builtin/packages/cityhash/package.py @@ -23,10 +23,9 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## from spack import * -from spack.util.environment import * -class Cityhash(Package): +class Cityhash(AutotoolsPackage): """CityHash, a family of hash functions for strings.""" homepage = "https://github.com/google/cityhash" @@ -37,8 +36,5 @@ class Cityhash(Package): version('master', branch='master', git='https://github.com/google/cityhash.git') - def install(self, spec, prefix): - configure('--enable-sse4.2', '--prefix=%s' % prefix) - - make() - make("install") + def configure_args(self): + return ['--enable-sse4.2'] diff --git a/var/spack/repos/builtin/packages/cmake/package.py b/var/spack/repos/builtin/packages/cmake/package.py index 60c95b91842..276db137ad9 100644 --- a/var/spack/repos/builtin/packages/cmake/package.py +++ b/var/spack/repos/builtin/packages/cmake/package.py @@ -33,6 +33,7 @@ class Cmake(Package): list_url = 'https://cmake.org/files/' list_depth = 2 + version('3.7.2', '79bd7e65cd81ea3aa2619484ad6ff25a') version('3.7.1', 'd031d5a06e9f1c5367cdfc56fbd2a1c8') version('3.6.1', 'd6dd661380adacdb12f41b926ec99545') version('3.6.0', 'aa40fbecf49d99c083415c2411d12db9') diff --git a/var/spack/repos/builtin/packages/cmor/package.py b/var/spack/repos/builtin/packages/cmor/package.py index b5debf95377..bb4f3b4df22 100644 --- a/var/spack/repos/builtin/packages/cmor/package.py +++ b/var/spack/repos/builtin/packages/cmor/package.py @@ -49,7 +49,7 @@ class Cmor(AutotoolsPackage): depends_on('python@:2.7', when='+python') depends_on('py-numpy', type=('build', 'run'), when='+python') - @AutotoolsPackage.precondition('configure') + @run_before('configure') def validate(self): if '+fortran' in self.spec and not self.compiler.fc: msg = 'cannot build a fortran variant without a fortran compiler' diff --git a/var/spack/repos/builtin/packages/compiz/package.py b/var/spack/repos/builtin/packages/compiz/package.py index ec21f5b4f2f..92820db10df 100644 --- a/var/spack/repos/builtin/packages/compiz/package.py +++ b/var/spack/repos/builtin/packages/compiz/package.py @@ -25,7 +25,7 @@ from spack import * -class Compiz(Package): +class Compiz(AutotoolsPackage): """compiz - OpenGL window and compositing manager. Compiz is an OpenGL compositing manager that use @@ -55,9 +55,3 @@ class Compiz(Package): depends_on('libpng') depends_on('glib') depends_on('gconf') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/compositeproto/package.py b/var/spack/repos/builtin/packages/compositeproto/package.py index 1b3fbda0af4..3d445bd7e8c 100644 --- a/var/spack/repos/builtin/packages/compositeproto/package.py +++ b/var/spack/repos/builtin/packages/compositeproto/package.py @@ -25,7 +25,7 @@ from spack import * -class Compositeproto(Package): +class Compositeproto(AutotoolsPackage): """Composite Extension. This package contains header files and documentation for the composite @@ -38,8 +38,3 @@ class Compositeproto(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make('install') diff --git a/var/spack/repos/builtin/packages/constype/package.py b/var/spack/repos/builtin/packages/constype/package.py index dcf88fdd55c..3a62e897272 100644 --- a/var/spack/repos/builtin/packages/constype/package.py +++ b/var/spack/repos/builtin/packages/constype/package.py @@ -25,7 +25,7 @@ from spack import * -class Constype(Package): +class Constype(AutotoolsPackage): """constype prints on the standard output the Sun code for the type of display that the specified device is. @@ -39,9 +39,3 @@ class Constype(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/coreutils/package.py b/var/spack/repos/builtin/packages/coreutils/package.py index 94cfa113410..a3c77dda9ce 100644 --- a/var/spack/repos/builtin/packages/coreutils/package.py +++ b/var/spack/repos/builtin/packages/coreutils/package.py @@ -25,7 +25,7 @@ from spack import * -class Coreutils(Package): +class Coreutils(AutotoolsPackage): """The GNU Core Utilities are the basic file, shell and text manipulation utilities of the GNU operating system. These are the core utilities which are expected to exist on every @@ -35,8 +35,3 @@ class Coreutils(Package): url = "http://ftp.gnu.org/gnu/coreutils/coreutils-8.23.tar.xz" version('8.23', 'abed135279f87ad6762ce57ff6d89c41') - - def install(self, spec, prefix): - configure("--prefix=%s" % prefix) - make() - make("install") diff --git a/var/spack/repos/builtin/packages/curl/package.py b/var/spack/repos/builtin/packages/curl/package.py index a22ac527141..46d3ccc23bf 100644 --- a/var/spack/repos/builtin/packages/curl/package.py +++ b/var/spack/repos/builtin/packages/curl/package.py @@ -32,6 +32,7 @@ class Curl(Package): homepage = "http://curl.haxx.se" url = "http://curl.haxx.se/download/curl-7.46.0.tar.bz2" + version('7.52.1', 'dd014df06ff1d12e173de86873f9f77a') version('7.50.3', 'bd177fd6deecce00cfa7b5916d831c5e') version('7.50.2', '6e161179f7af4b9f8b6ea21420132719') version('7.50.1', '015f6a0217ca6f2c5442ca406476920b') diff --git a/var/spack/repos/builtin/packages/czmq/package.py b/var/spack/repos/builtin/packages/czmq/package.py index ef6374619bc..fd50197326d 100644 --- a/var/spack/repos/builtin/packages/czmq/package.py +++ b/var/spack/repos/builtin/packages/czmq/package.py @@ -23,10 +23,9 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## from spack import * -import os -class Czmq(Package): +class Czmq(AutotoolsPackage): """ A C interface to the ZMQ library """ homepage = "http://czmq.zeromq.org" url = "https://github.com/zeromq/czmq/archive/v3.0.2.tar.gz" @@ -39,23 +38,3 @@ class Czmq(Package): depends_on('autoconf', type='build') depends_on('pkg-config', type='build') depends_on('zeromq') - - def install(self, spec, prefix): - # Work around autogen.sh oddities - # bash = which("bash") - # bash("./autogen.sh") - mkdirp("config") - autoreconf = which("autoreconf") - autoreconf("--install", "--verbose", "--force", - "-I", "config", - "-I", os.path.join(spec['pkg-config'].prefix, - "share", "aclocal"), - "-I", os.path.join(spec['automake'].prefix, - "share", "aclocal"), - "-I", os.path.join(spec['libtool'].prefix, - "share", "aclocal"), - ) - configure("--prefix=%s" % prefix) - - make() - make("install") diff --git a/var/spack/repos/builtin/packages/damageproto/package.py b/var/spack/repos/builtin/packages/damageproto/package.py index 84e0fac3110..22eeeeddcb8 100644 --- a/var/spack/repos/builtin/packages/damageproto/package.py +++ b/var/spack/repos/builtin/packages/damageproto/package.py @@ -25,7 +25,7 @@ from spack import * -class Damageproto(Package): +class Damageproto(AutotoolsPackage): """X Damage Extension. This package contains header files and documentation for the X Damage @@ -38,8 +38,3 @@ class Damageproto(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make('install') diff --git a/var/spack/repos/builtin/packages/darshan-runtime/package.py b/var/spack/repos/builtin/packages/darshan-runtime/package.py index a0313743819..93b2744e194 100644 --- a/var/spack/repos/builtin/packages/darshan-runtime/package.py +++ b/var/spack/repos/builtin/packages/darshan-runtime/package.py @@ -34,7 +34,7 @@ class DarshanRuntime(Package): systems where you intend to instrument MPI applications.""" homepage = "http://www.mcs.anl.gov/research/projects/darshan/" - url = "ftp://ftp.mcs.anl.gov/pub/darshan/releases/darshan-3.1.0.tar.gz" + url = "http://ftp.mcs.anl.gov/pub/darshan/releases/darshan-3.1.0.tar.gz" version('3.1.0', '439d717323e6265b2612ed127886ae52') version('3.0.0', '732577fe94238936268d74d7d74ebd08') diff --git a/var/spack/repos/builtin/packages/darshan-util/package.py b/var/spack/repos/builtin/packages/darshan-util/package.py index 47b0497ca8f..2a970fa95f7 100644 --- a/var/spack/repos/builtin/packages/darshan-util/package.py +++ b/var/spack/repos/builtin/packages/darshan-util/package.py @@ -32,7 +32,7 @@ class DarshanUtil(Package): log files produced by Darshan (runtime).""" homepage = "http://www.mcs.anl.gov/research/projects/darshan/" - url = "ftp://ftp.mcs.anl.gov/pub/darshan/releases/darshan-3.1.0.tar.gz" + url = "http://ftp.mcs.anl.gov/pub/darshan/releases/darshan-3.1.0.tar.gz" version('3.1.0', '439d717323e6265b2612ed127886ae52') version('3.0.0', '732577fe94238936268d74d7d74ebd08') diff --git a/var/spack/repos/builtin/packages/datamash/package.py b/var/spack/repos/builtin/packages/datamash/package.py index 85adeca996e..4cf7d24ef18 100644 --- a/var/spack/repos/builtin/packages/datamash/package.py +++ b/var/spack/repos/builtin/packages/datamash/package.py @@ -25,7 +25,7 @@ from spack import * -class Datamash(Package): +class Datamash(AutotoolsPackage): """GNU datamash is a command-line program which performs basic numeric, textual and statistical operations on input textual data files. """ @@ -37,8 +37,3 @@ class Datamash(Package): version('1.0.7', '9f317bab07454032ba9c068e7f17b04b') version('1.0.6', 'ff26fdef0f343cb695cf1853e14a1a5b') version('1.0.5', '9a29549dc7feca49fdc5fab696614e11') - - def install(self, spec, prefix): - configure('--prefix=%s' % prefix) - make() - make("install") diff --git a/var/spack/repos/builtin/packages/dealii/package.py b/var/spack/repos/builtin/packages/dealii/package.py index 66267b2d9a7..ca26edfb400 100644 --- a/var/spack/repos/builtin/packages/dealii/package.py +++ b/var/spack/repos/builtin/packages/dealii/package.py @@ -115,11 +115,19 @@ class Dealii(CMakePackage): depends_on("slepc@:3.6.3", when='@:8.4.1+slepc+petsc+mpi~int64') depends_on("trilinos", when='+trilinos+mpi') + # check that the combination of variants makes sense + def variants_check(self): + for p in ['+arpack', '+hdf5', '+netcdf', '+p4est', '+petsc', + '+slepc', '+trilinos']: + if p in self.spec and '+mpi' not in self.spec: + raise RuntimeError('The ' + p + ' variant requires +mpi') + def build_type(self): # CMAKE_BUILD_TYPE should be DebugRelease | Debug | Release return 'DebugRelease' def cmake_args(self): + self.variants_check() spec = self.spec options = [] @@ -192,7 +200,7 @@ def cmake_args(self): ]) # arpack - if '+arpack' in spec: + if '+arpack' in spec and '+mpi' in spec: options.extend([ '-DARPACK_DIR=%s' % spec['arpack-ng'].prefix, '-DDEAL_II_WITH_ARPACK=ON', @@ -204,7 +212,7 @@ def cmake_args(self): ]) # since Netcdf is spread among two, need to do it by hand: - if '+netcdf' in spec: + if '+netcdf' in spec and '+mpi' in spec: # take care of lib64 vs lib installed lib locations: if os.path.isdir(spec['netcdf-cxx'].prefix.lib): netcdfcxx_lib_dir = spec['netcdf-cxx'].prefix.lib diff --git a/var/spack/repos/builtin/packages/dmxproto/package.py b/var/spack/repos/builtin/packages/dmxproto/package.py index 34213bba5f5..7aa02511911 100644 --- a/var/spack/repos/builtin/packages/dmxproto/package.py +++ b/var/spack/repos/builtin/packages/dmxproto/package.py @@ -25,7 +25,7 @@ from spack import * -class Dmxproto(Package): +class Dmxproto(AutotoolsPackage): """Distributed Multihead X (DMX) Extension. This extension defines a protocol for clients to access a front-end proxy @@ -39,8 +39,3 @@ class Dmxproto(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make('install') diff --git a/var/spack/repos/builtin/packages/dri2proto/package.py b/var/spack/repos/builtin/packages/dri2proto/package.py index d05e7ea2316..4c906013b4a 100644 --- a/var/spack/repos/builtin/packages/dri2proto/package.py +++ b/var/spack/repos/builtin/packages/dri2proto/package.py @@ -25,7 +25,7 @@ from spack import * -class Dri2proto(Package): +class Dri2proto(AutotoolsPackage): """Direct Rendering Infrastructure 2 Extension. This extension defines a protocol to securely allow user applications to @@ -39,8 +39,3 @@ class Dri2proto(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make('install') diff --git a/var/spack/repos/builtin/packages/dri3proto/package.py b/var/spack/repos/builtin/packages/dri3proto/package.py index cd2594d5da6..be8b521aae8 100644 --- a/var/spack/repos/builtin/packages/dri3proto/package.py +++ b/var/spack/repos/builtin/packages/dri3proto/package.py @@ -25,7 +25,7 @@ from spack import * -class Dri3proto(Package): +class Dri3proto(AutotoolsPackage): """Direct Rendering Infrastructure 3 Extension. This extension defines a protocol to securely allow user applications to @@ -39,8 +39,3 @@ class Dri3proto(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make('install') diff --git a/var/spack/repos/builtin/packages/editres/package.py b/var/spack/repos/builtin/packages/editres/package.py index 52ad33b1334..d1823ec6fdf 100644 --- a/var/spack/repos/builtin/packages/editres/package.py +++ b/var/spack/repos/builtin/packages/editres/package.py @@ -25,7 +25,7 @@ from spack import * -class Editres(Package): +class Editres(AutotoolsPackage): """Dynamic resource editor for X Toolkit applications.""" homepage = "http://cgit.freedesktop.org/xorg/app/editres" @@ -40,9 +40,3 @@ class Editres(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/elfutils/package.py b/var/spack/repos/builtin/packages/elfutils/package.py index ef8c2433c95..4a91c7db304 100644 --- a/var/spack/repos/builtin/packages/elfutils/package.py +++ b/var/spack/repos/builtin/packages/elfutils/package.py @@ -25,7 +25,7 @@ from spack import * -class Elfutils(Package): +class Elfutils(AutotoolsPackage): """elfutils is a collection of various binary tools such as eu-objdump, eu-readelf, and other utilities that allow you to inspect and manipulate ELF files. Refer to Table 5.Tools Included @@ -35,16 +35,15 @@ class Elfutils(Package): homepage = "https://fedorahosted.org/elfutils/" + depends_on('libtool', type='build') + depends_on('automake', type='build') + depends_on('autoconf', type='build') + version('0.163', git='git://git.fedorahosted.org/git/elfutils.git', tag='elfutils-0.163') provides('elf') - def install(self, spec, prefix): - autoreconf = which('autoreconf') - autoreconf('-if') - - configure('--prefix=%s' % prefix, '--enable-maintainer-mode') - make() - make("install") + def configure_args(self): + return ['--enable-maintainer-mode'] diff --git a/var/spack/repos/builtin/packages/emacs/package.py b/var/spack/repos/builtin/packages/emacs/package.py index 1f9caee24c2..990ffd03cd7 100644 --- a/var/spack/repos/builtin/packages/emacs/package.py +++ b/var/spack/repos/builtin/packages/emacs/package.py @@ -25,7 +25,7 @@ from spack import * -class Emacs(Package): +class Emacs(AutotoolsPackage): """The Emacs programmable text editor.""" homepage = "https://www.gnu.org/software/emacs" @@ -47,7 +47,8 @@ class Emacs(Package): depends_on('libxaw', when='+X toolkit=athena') depends_on('gtkplus+X', when='+X toolkit=gtk') - def install(self, spec, prefix): + def configure_args(self): + spec = self.spec args = [] toolkit = spec.variants['toolkit'].value if '+X' in spec: @@ -61,7 +62,4 @@ def install(self, spec, prefix): else: args = ['--without-x'] - configure('--prefix={0}'.format(prefix), *args) - - make() - make("install") + return args diff --git a/var/spack/repos/builtin/packages/evieext/package.py b/var/spack/repos/builtin/packages/evieext/package.py index afc0245f506..8814ae31c00 100644 --- a/var/spack/repos/builtin/packages/evieext/package.py +++ b/var/spack/repos/builtin/packages/evieext/package.py @@ -25,7 +25,7 @@ from spack import * -class Evieext(Package): +class Evieext(AutotoolsPackage): """Extended Visual Information Extension (XEVIE). This extension defines a protocol for a client to determine information @@ -38,8 +38,3 @@ class Evieext(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make('install') diff --git a/var/spack/repos/builtin/packages/exuberant-ctags/package.py b/var/spack/repos/builtin/packages/exuberant-ctags/package.py index 10be30ab8bf..5d1c1eafc6a 100644 --- a/var/spack/repos/builtin/packages/exuberant-ctags/package.py +++ b/var/spack/repos/builtin/packages/exuberant-ctags/package.py @@ -25,15 +25,9 @@ from spack import * -class ExuberantCtags(Package): +class ExuberantCtags(AutotoolsPackage): """The canonical ctags generator""" homepage = "ctags.sourceforge.net" url = "http://downloads.sourceforge.net/project/ctags/ctags/5.8/ctags-5.8.tar.gz" version('5.8', 'c00f82ecdcc357434731913e5b48630d') - - def install(self, spec, prefix): - configure('--prefix=%s' % prefix) - - make() - make("install") diff --git a/var/spack/repos/builtin/packages/fastx-toolkit/package.py b/var/spack/repos/builtin/packages/fastx-toolkit/package.py index 04b4d24b39c..fed54b9b366 100644 --- a/var/spack/repos/builtin/packages/fastx-toolkit/package.py +++ b/var/spack/repos/builtin/packages/fastx-toolkit/package.py @@ -25,7 +25,7 @@ from spack import * -class FastxToolkit(Package): +class FastxToolkit(AutotoolsPackage): """The FASTX-Toolkit is a collection of command line tools for Short-Reads FASTA/FASTQ files preprocessing.""" @@ -35,9 +35,3 @@ class FastxToolkit(Package): version('0.0.14', 'bf1993c898626bb147de3d6695c20b40') depends_on('libgtextutils') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/fftw/package.py b/var/spack/repos/builtin/packages/fftw/package.py index 838f6ff7444..9b40d10fe0e 100644 --- a/var/spack/repos/builtin/packages/fftw/package.py +++ b/var/spack/repos/builtin/packages/fftw/package.py @@ -89,14 +89,20 @@ def install(self, spec, prefix): autoreconf = which('autoreconf') autoreconf('-ifv') - configure(*options) + float_options = [] + double_options = [] + if 'x86_64' in spec.architecture: + float_options.append('--enable-sse2') + double_options.append('--enable-sse2') + + configure(*(options + double_options)) make() if self.run_tests: make("check") make("install") if '+float' in spec: - configure('--enable-float', *options) + configure('--enable-float', *(options + float_options)) make() if self.run_tests: make("check") diff --git a/var/spack/repos/builtin/packages/fish/package.py b/var/spack/repos/builtin/packages/fish/package.py index fb784b7571a..f0dfac70c83 100644 --- a/var/spack/repos/builtin/packages/fish/package.py +++ b/var/spack/repos/builtin/packages/fish/package.py @@ -25,7 +25,7 @@ from spack import * -class Fish(Package): +class Fish(AutotoolsPackage): """fish is a smart and user-friendly command line shell for OS X, Linux, and the rest of the family. """ @@ -35,9 +35,3 @@ class Fish(Package): list_url = "http://fishshell.com/" version('2.2.0', 'a76339fd14ce2ec229283c53e805faac48c3e99d9e3ede9d82c0554acfc7b77a') - - def install(self, spec, prefix): - configure('--prefix=%s' % prefix) - - make() - make("install") diff --git a/var/spack/repos/builtin/packages/fixesproto/package.py b/var/spack/repos/builtin/packages/fixesproto/package.py index 64852b40e29..934848727fb 100644 --- a/var/spack/repos/builtin/packages/fixesproto/package.py +++ b/var/spack/repos/builtin/packages/fixesproto/package.py @@ -25,7 +25,7 @@ from spack import * -class Fixesproto(Package): +class Fixesproto(AutotoolsPackage): """X Fixes Extension. The extension makes changes to many areas of the protocol to resolve @@ -39,8 +39,3 @@ class Fixesproto(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make('install') diff --git a/var/spack/repos/builtin/packages/flex/package.py b/var/spack/repos/builtin/packages/flex/package.py index 23b3c8b21a8..0314950140f 100644 --- a/var/spack/repos/builtin/packages/flex/package.py +++ b/var/spack/repos/builtin/packages/flex/package.py @@ -31,6 +31,7 @@ class Flex(AutotoolsPackage): homepage = "https://github.com/westes/flex" url = "https://github.com/westes/flex/releases/download/v2.6.1/flex-2.6.1.tar.gz" + version('2.6.3', 'a5f65570cd9107ec8a8ec88f17b31bb1') # Problematic version: # See issue #2554; https://github.com/westes/flex/issues/113 # version('2.6.2', 'cc6d76c333db7653d5caf423a3335239') @@ -60,11 +61,3 @@ def url_for_version(self, version): url += "/archive/flex-{0}.tar.gz".format(version.dashed) return url - - def autoreconf(self, spec, prefix): - pass - - @when('@:2.6.0') - def autoreconf(self, spec, prefix): - libtoolize('--install', '--force') - autoreconf('--install', '--force') diff --git a/var/spack/repos/builtin/packages/font-util/package.py b/var/spack/repos/builtin/packages/font-util/package.py index 0b310117c67..03a466d00aa 100644 --- a/var/spack/repos/builtin/packages/font-util/package.py +++ b/var/spack/repos/builtin/packages/font-util/package.py @@ -25,7 +25,7 @@ from spack import * -class FontUtil(Package): +class FontUtil(AutotoolsPackage): """X.Org font package creation/installation utilities.""" homepage = "http://cgit.freedesktop.org/xorg/font/util" @@ -35,9 +35,3 @@ class FontUtil(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/fontcacheproto/package.py b/var/spack/repos/builtin/packages/fontcacheproto/package.py index 77feb875738..f793aba9cf1 100644 --- a/var/spack/repos/builtin/packages/fontcacheproto/package.py +++ b/var/spack/repos/builtin/packages/fontcacheproto/package.py @@ -25,15 +25,10 @@ from spack import * -class Fontcacheproto(Package): +class Fontcacheproto(AutotoolsPackage): """X.org FontcacheProto protocol headers.""" homepage = "http://cgit.freedesktop.org/xorg/proto/fontcacheproto" url = "https://www.x.org/archive/individual/proto/fontcacheproto-0.1.3.tar.gz" version('0.1.3', '5a91ab914ffbfbc856e6fcde52e6f3e3') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make('install') diff --git a/var/spack/repos/builtin/packages/fontsproto/package.py b/var/spack/repos/builtin/packages/fontsproto/package.py index c3771e18fae..03e825c2f75 100644 --- a/var/spack/repos/builtin/packages/fontsproto/package.py +++ b/var/spack/repos/builtin/packages/fontsproto/package.py @@ -25,7 +25,7 @@ from spack import * -class Fontsproto(Package): +class Fontsproto(AutotoolsPackage): """X Fonts Extension.""" homepage = "http://cgit.freedesktop.org/xorg/proto/fontsproto" @@ -35,8 +35,3 @@ class Fontsproto(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make('install') diff --git a/var/spack/repos/builtin/packages/fonttosfnt/package.py b/var/spack/repos/builtin/packages/fonttosfnt/package.py index 016cab1ac86..e8cc3a6f6f4 100644 --- a/var/spack/repos/builtin/packages/fonttosfnt/package.py +++ b/var/spack/repos/builtin/packages/fonttosfnt/package.py @@ -25,7 +25,7 @@ from spack import * -class Fonttosfnt(Package): +class Fonttosfnt(AutotoolsPackage): """Wrap a bitmap font in a sfnt (TrueType) wrapper.""" homepage = "http://cgit.freedesktop.org/xorg/app/fonttosfnt" @@ -39,9 +39,3 @@ class Fonttosfnt(Package): depends_on('xproto', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/fslsfonts/package.py b/var/spack/repos/builtin/packages/fslsfonts/package.py index 6e46bd6b5aa..2becf5a346e 100644 --- a/var/spack/repos/builtin/packages/fslsfonts/package.py +++ b/var/spack/repos/builtin/packages/fslsfonts/package.py @@ -25,7 +25,7 @@ from spack import * -class Fslsfonts(Package): +class Fslsfonts(AutotoolsPackage): """fslsfonts produces a list of fonts served by an X font server.""" homepage = "http://cgit.freedesktop.org/xorg/app/fslsfonts" @@ -38,9 +38,3 @@ class Fslsfonts(Package): depends_on('xproto@7.0.25:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/fstobdf/package.py b/var/spack/repos/builtin/packages/fstobdf/package.py index 6358e33d2a7..7b2d433ef2a 100644 --- a/var/spack/repos/builtin/packages/fstobdf/package.py +++ b/var/spack/repos/builtin/packages/fstobdf/package.py @@ -25,7 +25,7 @@ from spack import * -class Fstobdf(Package): +class Fstobdf(AutotoolsPackage): """The fstobdf program reads a font from a font server and prints a BDF file on the standard output that may be used to recreate the font. This is useful in testing servers, debugging font metrics, and @@ -42,9 +42,3 @@ class Fstobdf(Package): depends_on('xproto@7.0.25:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/gbenchmark/package.py b/var/spack/repos/builtin/packages/gbenchmark/package.py index 1c54f602437..a25ddd7a4da 100644 --- a/var/spack/repos/builtin/packages/gbenchmark/package.py +++ b/var/spack/repos/builtin/packages/gbenchmark/package.py @@ -48,12 +48,3 @@ def patch(self): r'##### add_cxx_compiler_flag(-Werror', 'CMakeLists.txt' ) - - def cmake_args(self, spec, prefix): - if self.compiler.name == 'intel': - return [ - "-DCMAKE_CXX_FLAGS=-no-ansi-alias -fno-strict-aliasing", - "-DCMAKE_C_FLAGS=-no-ansi-alias -fno-strict-aliasing", - "-DBENCHMARK_ENABLE_TESTING=OFF" - ] - return [] diff --git a/var/spack/repos/builtin/packages/gcc/package.py b/var/spack/repos/builtin/packages/gcc/package.py index 31da068d72d..a9fed4d8dd2 100644 --- a/var/spack/repos/builtin/packages/gcc/package.py +++ b/var/spack/repos/builtin/packages/gcc/package.py @@ -30,7 +30,7 @@ from os.path import isfile -class Gcc(Package): +class Gcc(AutotoolsPackage): """The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, and Java.""" homepage = "https://gcc.gnu.org" @@ -85,7 +85,9 @@ class Gcc(Package): patch('piclibs.patch', when='+piclibs') patch('gcc-backport.patch', when='@4.7:4.9.2,5:5.3') - def install(self, spec, prefix): + def configure_args(self): + spec = self.spec + prefix = self.spec.prefix # libjava/configure needs a minor fix to install into spack paths. filter_file(r"'@.*@'", "'@[[:alnum:]]*@'", 'libjava/configure', string=True) @@ -138,18 +140,15 @@ def install(self, spec, prefix): darwin_options = ["--with-build-config=bootstrap-debug"] options.extend(darwin_options) - build_dir = join_path(self.stage.path, 'spack-build') - configure = Executable(join_path(self.stage.source_path, 'configure')) - with working_dir(build_dir, create=True): - # Rest of install is straightforward. - configure(*options) - if sys.platform == 'darwin': - make("bootstrap") - else: - make() - make("install") + return options - self.write_rpath_specs() + build_directory = 'spack-build' + + @property + def build_targets(self): + if sys.platform == 'darwin': + return ['bootstrap'] + return [] @property def spec_dir(self): @@ -157,6 +156,7 @@ def spec_dir(self): spec_dir = glob("%s/lib64/gcc/*/*" % self.prefix) return spec_dir[0] if spec_dir else None + @run_after('install') def write_rpath_specs(self): """Generate a spec file so the linker adds a rpath to the libs the compiler used to build the executable.""" diff --git a/var/spack/repos/builtin/packages/gccmakedep/package.py b/var/spack/repos/builtin/packages/gccmakedep/package.py index ed2530d89e1..1e082bb0505 100644 --- a/var/spack/repos/builtin/packages/gccmakedep/package.py +++ b/var/spack/repos/builtin/packages/gccmakedep/package.py @@ -25,7 +25,7 @@ from spack import * -class Gccmakedep(Package): +class Gccmakedep(AutotoolsPackage): """X.org gccmakedep utilities.""" homepage = "https://cgit.freedesktop.org/xorg/util/gccmakedep/" @@ -34,9 +34,3 @@ class Gccmakedep(Package): version('1.0.3', '127ddb6131eb4a56fdf6644a63ade788') depends_on('pkg-config@0.9.0:', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/gconf/package.py b/var/spack/repos/builtin/packages/gconf/package.py index 3b3abc71ed8..65023017840 100644 --- a/var/spack/repos/builtin/packages/gconf/package.py +++ b/var/spack/repos/builtin/packages/gconf/package.py @@ -25,11 +25,11 @@ from spack import * -class Gconf(Package): +class Gconf(AutotoolsPackage): """GConf is a system for storing application preferences.""" homepage = "https://projects.gnome.org/gconf/" - url = "ftp://ftp.gnome.org/pub/gnome/sources/GConf/3.2/GConf-3.2.6.tar.xz" + url = "http://ftp.gnome.org/pub/gnome/sources/GConf/3.2/GConf-3.2.6.tar.xz" version('3.2.6', '2b16996d0e4b112856ee5c59130e822c') @@ -43,9 +43,3 @@ class Gconf(Package): # gobject-2.0 >= 2.7.0 # dbus-1 >= 1.0.0 # dbus-glib-1 >= 0.74 - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/gdk-pixbuf/package.py b/var/spack/repos/builtin/packages/gdk-pixbuf/package.py index 4d39086b062..11597447211 100644 --- a/var/spack/repos/builtin/packages/gdk-pixbuf/package.py +++ b/var/spack/repos/builtin/packages/gdk-pixbuf/package.py @@ -25,7 +25,7 @@ from spack import * -class GdkPixbuf(Package): +class GdkPixbuf(AutotoolsPackage): """The Gdk Pixbuf is a toolkit for image loading and pixel buffer manipulation. It is used by GTK+ 2 and GTK+ 3 to load and manipulate images. In the past it was distributed as part of @@ -42,8 +42,3 @@ class GdkPixbuf(Package): depends_on("jpeg") depends_on("libpng") depends_on("libtiff") - - def install(self, spec, prefix): - configure("--prefix=%s" % prefix) - make() - make("install") diff --git a/var/spack/repos/builtin/packages/ghostscript-fonts/package.py b/var/spack/repos/builtin/packages/ghostscript-fonts/package.py index 1bf3f857b03..86c937d5554 100644 --- a/var/spack/repos/builtin/packages/ghostscript-fonts/package.py +++ b/var/spack/repos/builtin/packages/ghostscript-fonts/package.py @@ -30,7 +30,7 @@ class GhostscriptFonts(Package): """Ghostscript Fonts""" homepage = "http://ghostscript.com/" - url = "ftp://ftp.imagemagick.org/pub/ImageMagick/delegates/ghostscript-fonts-std-8.11.tar.gz" + url = "https://www.imagemagick.org/download/delegates/ghostscript-fonts-std-8.11.tar.gz" version('8.11', '6865682b095f8c4500c54b285ff05ef6') diff --git a/var/spack/repos/builtin/packages/giflib/package.py b/var/spack/repos/builtin/packages/giflib/package.py index 7082384b9b8..feca5b046bb 100644 --- a/var/spack/repos/builtin/packages/giflib/package.py +++ b/var/spack/repos/builtin/packages/giflib/package.py @@ -25,7 +25,7 @@ from spack import * -class Giflib(Package): +class Giflib(AutotoolsPackage): """The GIFLIB project maintains the giflib service library, which has been pulling images out of GIFs since 1989.""" @@ -33,9 +33,3 @@ class Giflib(Package): url = "https://downloads.sourceforge.net/project/giflib/giflib-5.1.4.tar.bz2" version('5.1.4', '2c171ced93c0e83bb09e6ccad8e3ba2b') - - def install(self, spec, prefix): - configure('--prefix=%s' % prefix) - - make() - make("install") diff --git a/var/spack/repos/builtin/packages/glib/package.py b/var/spack/repos/builtin/packages/glib/package.py index 4d8085baf2a..e2eb984876c 100644 --- a/var/spack/repos/builtin/packages/glib/package.py +++ b/var/spack/repos/builtin/packages/glib/package.py @@ -23,10 +23,9 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## from spack import * -import os -class Glib(Package): +class Glib(AutotoolsPackage): """The GLib package contains a low-level libraries useful for providing data structure handling for C, portability wrappers and interfaces for such runtime functionality as an event loop, @@ -54,22 +53,9 @@ class Glib(Package): # around a legitimate usage. patch('no-Werror=format-security.patch') + force_autoreconf = True + def url_for_version(self, version): """Handle glib's version-based custom URLs.""" url = 'http://ftp.gnome.org/pub/gnome/sources/glib' return url + '/%s/glib-%s.tar.xz' % (version.up_to(2), version) - - def install(self, spec, prefix): - autoreconf = which("autoreconf") - autoreconf("--install", "--verbose", "--force", - "-I", "config", - "-I", os.path.join(spec['pkg-config'].prefix, - "share", "aclocal"), - "-I", os.path.join(spec['automake'].prefix, - "share", "aclocal"), - "-I", os.path.join(spec['libtool'].prefix, - "share", "aclocal"), - ) - configure("--prefix=%s" % prefix) - make() - make("install", parallel=False) diff --git a/var/spack/repos/builtin/packages/globus-toolkit/package.py b/var/spack/repos/builtin/packages/globus-toolkit/package.py index 5cec13a5af0..5cdc0689a77 100644 --- a/var/spack/repos/builtin/packages/globus-toolkit/package.py +++ b/var/spack/repos/builtin/packages/globus-toolkit/package.py @@ -25,7 +25,7 @@ from spack import * -class GlobusToolkit(Package): +class GlobusToolkit(AutotoolsPackage): """The Globus Toolkit is an open source software toolkit used for building grids""" @@ -33,8 +33,3 @@ class GlobusToolkit(Package): url = "http://toolkit.globus.org/ftppub/gt6/installers/src/globus_toolkit-6.0.1470089956.tar.gz" version('6.0.1470089956', 'b77fe3cc5a5844df995688b0e630d077') - - def install(self, spec, prefix): - configure("--prefix=%s" % prefix) - make() - make('install') diff --git a/var/spack/repos/builtin/packages/glog/package.py b/var/spack/repos/builtin/packages/glog/package.py index 14f042732b8..11d679c7ffe 100644 --- a/var/spack/repos/builtin/packages/glog/package.py +++ b/var/spack/repos/builtin/packages/glog/package.py @@ -25,15 +25,10 @@ from spack import * -class Glog(Package): +class Glog(AutotoolsPackage): """C++ implementation of the Google logging module.""" homepage = "https://github.com/google/glog" url = "https://github.com/google/glog/archive/v0.3.3.tar.gz" version('0.3.3', 'c1f86af27bd9c73186730aa957607ed0') - - def install(self, spec, prefix): - configure("--prefix=" + prefix) - make() - make("install") diff --git a/var/spack/repos/builtin/packages/glproto/package.py b/var/spack/repos/builtin/packages/glproto/package.py index 462e5290676..8a5eaef660d 100644 --- a/var/spack/repos/builtin/packages/glproto/package.py +++ b/var/spack/repos/builtin/packages/glproto/package.py @@ -25,7 +25,7 @@ from spack import * -class Glproto(Package): +class Glproto(AutotoolsPackage): """OpenGL Extension to the X Window System. This extension defines a protocol for the client to send 3D rendering @@ -38,8 +38,3 @@ class Glproto(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make('install') diff --git a/var/spack/repos/builtin/packages/gmake/package.py b/var/spack/repos/builtin/packages/gmake/package.py index ca296350a41..ed89a46758a 100644 --- a/var/spack/repos/builtin/packages/gmake/package.py +++ b/var/spack/repos/builtin/packages/gmake/package.py @@ -29,7 +29,7 @@ class Gmake(Package): """GNU Make.""" homepage = "http://gnu.org/gnu/make" - url = "ftp://ftp.gnu.org/gnu/make/make-4.0.tar.gz" + url = "https://ftp.gnu.org/gnu/make/make-4.0.tar.gz" version('4.0', 'b5e558f981326d9ca1bfdb841640721a') diff --git a/var/spack/repos/builtin/packages/gmsh/package.py b/var/spack/repos/builtin/packages/gmsh/package.py index fffd448443d..5c42fcf39fc 100644 --- a/var/spack/repos/builtin/packages/gmsh/package.py +++ b/var/spack/repos/builtin/packages/gmsh/package.py @@ -38,6 +38,7 @@ class Gmsh(CMakePackage): homepage = 'http://gmsh.info' url = 'http://gmsh.info/src/gmsh-2.11.0-source.tgz' + version('2.16.0', 'e829eaf32ea02350a385202cc749341f2a3217c464719384b18f653edd028eea') version('2.15.0', '992a4b580454105f719f5bc05441d3d392ab0b4b80d4ea07b61ca3bdc974070a') version('2.12.0', '7fbd2ec8071e79725266e72744d21e902d4fe6fa9e7c52340ad5f4be5c159d09') version('2.11.0', 'f15b6e7ac9ca649c9a74440e1259d0db') diff --git a/var/spack/repos/builtin/packages/gnutls/package.py b/var/spack/repos/builtin/packages/gnutls/package.py index 5f7b0daf9bb..638ef7e30cf 100644 --- a/var/spack/repos/builtin/packages/gnutls/package.py +++ b/var/spack/repos/builtin/packages/gnutls/package.py @@ -25,7 +25,7 @@ from spack import * -class Gnutls(Package): +class Gnutls(AutotoolsPackage): """GnuTLS is a secure communications library implementing the SSL, TLS and DTLS protocols and technologies around them. It provides a simple C language application programming interface @@ -35,13 +35,8 @@ class Gnutls(Package): with focus on security and interoperability.""" homepage = "http://www.gnutls.org" - url = "ftp://ftp.gnutls.org/gcrypt/gnutls/v3.3/gnutls-3.3.9.tar.xz" + url = "http://www.ring.gr.jp/pub/net/gnupg/gnutls/v3.3/gnutls-3.3.9.tar.xz" version('3.3.9', 'ff61b77e39d09f1140ab5a9cf52c58b6') depends_on("nettle") - - def install(self, spec, prefix): - configure("--prefix=%s" % prefix) - make() - make("install") diff --git a/var/spack/repos/builtin/packages/gource/package.py b/var/spack/repos/builtin/packages/gource/package.py index dda00420a38..21994ad42ca 100644 --- a/var/spack/repos/builtin/packages/gource/package.py +++ b/var/spack/repos/builtin/packages/gource/package.py @@ -25,11 +25,11 @@ from spack import * -class Gource(Package): +class Gource(AutotoolsPackage): """Software version control visualization.""" homepage = "http://gource.io" - url = "https://github.com/acaudwell/Gource/releases/download/gource-0.44/gource-0.44.tar.gz" + url = "https://github.com/acaudwell/Gource/releases/download/gource-0.44/gource-0.44.tar.gz" version('0.44', '79cda1bfaad16027d59cce55455bfab88b57c69d') @@ -49,15 +49,17 @@ class Gource(Package): depends_on('sdl2') depends_on('sdl2-image') - def install(self, spec, prefix): - make_args = ['--prefix=%s' % prefix, - '--disable-dependency-tracking', - '--without-x', - '--with-boost=%s' % spec['boost'].prefix] + parallel = False + force_autoreconf = True - autoreconf('-i') - configure(*make_args) - make() + def url_for_version(self, version): + tmp = 'https://github.com/acaudwell/Gource/releases/download/gource-{0}/gource-{0}.tar.gz' # NOQA: ignore=E501 + return tmp.format(version.dotted) - make("install", - parallel=False) + def configure_args(self): + spec = self.spec + return [ + '--disable-dependency-tracking', + '--without-x', + '--with-boost=%s' % spec['boost'].prefix + ] diff --git a/var/spack/repos/builtin/packages/gperf/package.py b/var/spack/repos/builtin/packages/gperf/package.py index 0ae07b33fcb..e7dffa017a6 100644 --- a/var/spack/repos/builtin/packages/gperf/package.py +++ b/var/spack/repos/builtin/packages/gperf/package.py @@ -25,7 +25,7 @@ from spack import * -class Gperf(Package): +class Gperf(AutotoolsPackage): """GNU gperf is a perfect hash function generator. For a given list of strings, it produces a hash function and hash table, in form of C or C++ code, for looking up a value depending on the @@ -38,9 +38,4 @@ class Gperf(Package): version('3.0.4', 'c1f1db32fb6598d6a93e6e88796a8632') - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - # make('check') # fails tests - make('install') + # NOTE: `make check` is known to fail tests diff --git a/var/spack/repos/builtin/packages/gperftools/package.py b/var/spack/repos/builtin/packages/gperftools/package.py index c6ca6c8057d..300e0ae7659 100644 --- a/var/spack/repos/builtin/packages/gperftools/package.py +++ b/var/spack/repos/builtin/packages/gperftools/package.py @@ -25,7 +25,7 @@ from spack import * -class Gperftools(Package): +class Gperftools(AutotoolsPackage): """Google's fast malloc/free implementation, especially for multi-threaded applications. Contains tcmalloc, heap-checker, heap-profiler, and cpu-profiler. @@ -40,8 +40,3 @@ class Gperftools(Package): url="https://googledrive.com/host/0B6NtGsLhIcf7MWxMMF9JdTN3UVk/gperftools-2.3.tar.gz") depends_on("libunwind") - - def install(self, spec, prefix): - configure("--prefix=" + prefix) - make() - make("install") diff --git a/var/spack/repos/builtin/packages/grandr/package.py b/var/spack/repos/builtin/packages/grandr/package.py index 8097d4fa01c..dd56426ef84 100644 --- a/var/spack/repos/builtin/packages/grandr/package.py +++ b/var/spack/repos/builtin/packages/grandr/package.py @@ -25,7 +25,7 @@ from spack import * -class Grandr(Package): +class Grandr(AutotoolsPackage): """RandR user interface using GTK+ libraries.""" homepage = "https://cgit.freedesktop.org/xorg/app/grandr" @@ -36,10 +36,3 @@ class Grandr(Package): depends_on('gtkplus@2.0.0:') depends_on('gconf') depends_on('xrandr@1.2:') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('check') - make('install') diff --git a/var/spack/repos/builtin/packages/gromacs/package.py b/var/spack/repos/builtin/packages/gromacs/package.py index d079188db61..fd5814ca08b 100644 --- a/var/spack/repos/builtin/packages/gromacs/package.py +++ b/var/spack/repos/builtin/packages/gromacs/package.py @@ -39,7 +39,7 @@ class Gromacs(CMakePackage): """ homepage = 'http://www.gromacs.org' - url = 'ftp://ftp.gromacs.org/pub/gromacs/gromacs-5.1.2.tar.gz' + url = 'http://ftp.gromacs.org/gromacs/gromacs-5.1.2.tar.gz' version('5.1.2', '614d0be372f1a6f1f36382b7a6fcab98') diff --git a/var/spack/repos/builtin/packages/gtkplus/package.py b/var/spack/repos/builtin/packages/gtkplus/package.py index b53b688372e..b17b1877ec4 100644 --- a/var/spack/repos/builtin/packages/gtkplus/package.py +++ b/var/spack/repos/builtin/packages/gtkplus/package.py @@ -25,7 +25,7 @@ from spack import * -class Gtkplus(Package): +class Gtkplus(AutotoolsPackage): """The GTK+ 2 package contains libraries used for creating graphical user interfaces for applications.""" homepage = "http://www.gtk.org" @@ -47,8 +47,3 @@ def patch(self): # remove disable deprecated flag. filter_file(r'CFLAGS="-DGDK_PIXBUF_DISABLE_DEPRECATED $CFLAGS"', '', 'configure', string=True) - - def install(self, spec, prefix): - configure("--prefix=%s" % prefix) - make() - make("install") diff --git a/var/spack/repos/builtin/packages/gts/package.py b/var/spack/repos/builtin/packages/gts/package.py index 2b3d4dd4f81..ea9443fb9d5 100644 --- a/var/spack/repos/builtin/packages/gts/package.py +++ b/var/spack/repos/builtin/packages/gts/package.py @@ -25,7 +25,7 @@ from spack import * -class Gts(Package): +class Gts(AutotoolsPackage): """GTS stands for the GNU Triangulated Surface Library. It is an Open Source Free Software Library intended to provide a set of @@ -46,8 +46,3 @@ class Gts(Package): version('121130', '023ebb6b13b8707534182a3ef0d12908') depends_on('glib') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - make() - make('install') diff --git a/var/spack/repos/builtin/packages/guile/package.py b/var/spack/repos/builtin/packages/guile/package.py index 22aff1bddf3..15e24e56345 100644 --- a/var/spack/repos/builtin/packages/guile/package.py +++ b/var/spack/repos/builtin/packages/guile/package.py @@ -30,7 +30,7 @@ class Guile(Package): the official extension language for the GNU operating system.""" homepage = "https://www.gnu.org/software/guile/" - url = "ftp://ftp.gnu.org/gnu/guile/guile-2.0.11.tar.gz" + url = "https://ftp.gnu.org/gnu/guile/guile-2.0.11.tar.gz" version('2.0.11', 'e532c68c6f17822561e3001136635ddd') diff --git a/var/spack/repos/builtin/packages/h5hut/package.py b/var/spack/repos/builtin/packages/h5hut/package.py index 22146372dcf..b12549df0da 100644 --- a/var/spack/repos/builtin/packages/h5hut/package.py +++ b/var/spack/repos/builtin/packages/h5hut/package.py @@ -47,7 +47,7 @@ class H5hut(AutotoolsPackage): # install: .libs/libH5hut.a: No such file or directory parallel = False - @AutotoolsPackage.precondition('configure') + @run_before('configure') def validate(self): """Checks if Fortran compiler is available.""" diff --git a/var/spack/repos/builtin/packages/harfbuzz/package.py b/var/spack/repos/builtin/packages/harfbuzz/package.py index 7c98c2a96a0..f8d5355f87e 100644 --- a/var/spack/repos/builtin/packages/harfbuzz/package.py +++ b/var/spack/repos/builtin/packages/harfbuzz/package.py @@ -25,7 +25,7 @@ from spack import * -class Harfbuzz(Package): +class Harfbuzz(AutotoolsPackage): """The Harfbuzz package contains an OpenType text shaping engine.""" homepage = "http://www.freedesktop.org/wiki/Software/HarfBuzz/" url = "http://www.freedesktop.org/software/harfbuzz/release/harfbuzz-0.9.37.tar.bz2" @@ -41,8 +41,3 @@ class Harfbuzz(Package): def patch(self): change_sed_delimiter('@', ';', 'src/Makefile.in') - - def install(self, spec, prefix): - configure("--prefix=%s" % prefix) - make() - make("install") diff --git a/var/spack/repos/builtin/packages/hdf5/package.py b/var/spack/repos/builtin/packages/hdf5/package.py index 222af536017..5e82818697d 100644 --- a/var/spack/repos/builtin/packages/hdf5/package.py +++ b/var/spack/repos/builtin/packages/hdf5/package.py @@ -70,7 +70,7 @@ class Hdf5(AutotoolsPackage): depends_on('szip', when='+szip') depends_on('zlib@1.1.2:') - @AutotoolsPackage.precondition('configure') + @run_before('configure') def validate(self): """ Checks if incompatible variants have been activated at the same time @@ -170,7 +170,7 @@ def configure(self, spec, prefix): arg for arg in m.group(1).split(' ') if arg != '-l'), 'libtool') - @AutotoolsPackage.sanity_check('install') + @run_after('install') def check_install(self): # Build and run a small program to test the installed HDF5 library spec = self.spec diff --git a/var/spack/repos/builtin/packages/heppdt/package.py b/var/spack/repos/builtin/packages/heppdt/package.py index 54c846ae335..65946fb1028 100644 --- a/var/spack/repos/builtin/packages/heppdt/package.py +++ b/var/spack/repos/builtin/packages/heppdt/package.py @@ -26,7 +26,7 @@ from spack import * -class Heppdt(Package): +class Heppdt(AutotoolsPackage): """The HepPID library contains translation methods for particle ID's to and from various Monte Carlo generators and the PDG standard numbering scheme. We realize that the generators adhere closely @@ -40,9 +40,3 @@ class Heppdt(Package): version('3.03.01', 'd411f3bfdf9c4350d802241ba2629cc2') version('3.03.00', 'cd84d0a0454be982dcd8c285e060a7b3') version('2.06.01', '5688b4bdbd84b48ed5dd2545a3dc33c0') - - def install(self, spec, prefix): - configure('--prefix=%s' % prefix) - - make() - make("install") diff --git a/var/spack/repos/builtin/packages/hsakmt/package.py b/var/spack/repos/builtin/packages/hsakmt/package.py index 0daad4afedf..534d5e4c84c 100644 --- a/var/spack/repos/builtin/packages/hsakmt/package.py +++ b/var/spack/repos/builtin/packages/hsakmt/package.py @@ -25,7 +25,7 @@ from spack import * -class Hsakmt(Package): +class Hsakmt(AutotoolsPackage): """hsakmt is a thunk library that provides a userspace interface to amdkfd (AMD's HSA Linux kernel driver). It is the HSA equivalent of libdrm.""" @@ -33,9 +33,3 @@ class Hsakmt(Package): url = "https://www.x.org/archive/individual/lib/hsakmt-1.0.0.tar.gz" version('1.0.0', '9beb20104e505300daf541266c4c3c3d') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/htop/package.py b/var/spack/repos/builtin/packages/htop/package.py index 3df0a353567..7a7cc418ce2 100644 --- a/var/spack/repos/builtin/packages/htop/package.py +++ b/var/spack/repos/builtin/packages/htop/package.py @@ -25,7 +25,7 @@ from spack import * -class Htop(Package): +class Htop(AutotoolsPackage): """htop is an interactive text-mode process viewer for Unix systems.""" homepage = "https://github.com/hishamhm/htop" @@ -34,8 +34,3 @@ class Htop(Package): version('2.0.2', '7d354d904bad591a931ad57e99fea84a') depends_on('ncurses') - - def install(self, spec, prefix): - configure('--prefix=%s' % prefix) - make() - make('install') diff --git a/var/spack/repos/builtin/packages/htslib/package.py b/var/spack/repos/builtin/packages/htslib/package.py index 1a8b8fd2f5e..77829e71b93 100644 --- a/var/spack/repos/builtin/packages/htslib/package.py +++ b/var/spack/repos/builtin/packages/htslib/package.py @@ -25,7 +25,7 @@ from spack import * -class Htslib(Package): +class Htslib(AutotoolsPackage): """C library for high-throughput sequencing data formats.""" homepage = "https://github.com/samtools/htslib" @@ -34,8 +34,3 @@ class Htslib(Package): version('1.3.1', '16d78f90b72f29971b042e8da8be6843') depends_on('zlib') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - make() - make('install') diff --git a/var/spack/repos/builtin/packages/hwloc/package.py b/var/spack/repos/builtin/packages/hwloc/package.py index 111c424b223..68c92b3aff5 100644 --- a/var/spack/repos/builtin/packages/hwloc/package.py +++ b/var/spack/repos/builtin/packages/hwloc/package.py @@ -25,7 +25,7 @@ from spack import * -class Hwloc(Package): +class Hwloc(AutotoolsPackage): """The Portable Hardware Locality (hwloc) software package provides a portable abstraction (across OS, versions, architectures, ...) of the hierarchical topology of modern @@ -42,6 +42,7 @@ class Hwloc(Package): list_url = "http://www.open-mpi.org/software/hwloc/" list_depth = 3 + version('1.11.5', '8f5fe6a9be2eb478409ad5e640b2d3ba') version('1.11.4', 'b6f23eb59074fd09fdd84905d50b103d') version('1.11.3', 'c1d36a9de6028eac1d18ea4782ef958f') version('1.11.2', 'e4ca55c2a5c5656da4a4e37c8fc51b23') @@ -52,9 +53,3 @@ class Hwloc(Package): def url_for_version(self, version): return "http://www.open-mpi.org/software/hwloc/v%s/downloads/hwloc-%s.tar.gz" % (version.up_to(2), version) - - def install(self, spec, prefix): - configure("--prefix=%s" % prefix) - - make() - make("install") diff --git a/var/spack/repos/builtin/packages/hydra/package.py b/var/spack/repos/builtin/packages/hydra/package.py index eee346ba498..4461adae2ef 100644 --- a/var/spack/repos/builtin/packages/hydra/package.py +++ b/var/spack/repos/builtin/packages/hydra/package.py @@ -25,7 +25,7 @@ from spack import * -class Hydra(Package): +class Hydra(AutotoolsPackage): """Hydra is a process management system for starting parallel jobs. Hydra is designed to natively work with existing launcher daemons (such as ssh, rsh, fork), as well as natively integrate with resource @@ -37,9 +37,3 @@ class Hydra(Package): list_depth = 2 version('3.2', '4d670916695bf7e3a869cc336a881b39') - - def install(self, spec, prefix): - configure('--prefix=%s' % prefix) - - make() - make("install") diff --git a/var/spack/repos/builtin/packages/iceauth/package.py b/var/spack/repos/builtin/packages/iceauth/package.py index 59c6e0e7b71..6af0d0b4bb3 100644 --- a/var/spack/repos/builtin/packages/iceauth/package.py +++ b/var/spack/repos/builtin/packages/iceauth/package.py @@ -25,7 +25,7 @@ from spack import * -class Iceauth(Package): +class Iceauth(AutotoolsPackage): """The iceauth program is used to edit and display the authorization information used in connecting with ICE. It operates very much like the xauth program for X11 connection authentication records.""" @@ -40,9 +40,3 @@ class Iceauth(Package): depends_on('xproto@7.0.22:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/ico/package.py b/var/spack/repos/builtin/packages/ico/package.py index 5e523575cab..2163e8566e9 100644 --- a/var/spack/repos/builtin/packages/ico/package.py +++ b/var/spack/repos/builtin/packages/ico/package.py @@ -25,7 +25,7 @@ from spack import * -class Ico(Package): +class Ico(AutotoolsPackage): """ico is a simple animation program that may be used for testing various X11 operations and extensions. It displays a wire-frame rotating polyhedron, with hidden lines removed, or a solid-fill polyhedron with @@ -41,9 +41,3 @@ class Ico(Package): depends_on('xproto@7.0.22:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/ilmbase/package.py b/var/spack/repos/builtin/packages/ilmbase/package.py index 873c830623f..7f478f23415 100644 --- a/var/spack/repos/builtin/packages/ilmbase/package.py +++ b/var/spack/repos/builtin/packages/ilmbase/package.py @@ -25,7 +25,7 @@ from spack import * -class Ilmbase(Package): +class Ilmbase(AutotoolsPackage): """OpenEXR ILM Base libraries (high dynamic-range image file format)""" homepage = "http://www.openexr.com/" @@ -36,7 +36,3 @@ class Ilmbase(Package): version('2.0.1', '74c0d0d2873960bd0dc1993f8e03f0ae') version('1.0.2', '26c133ee8ca48e1196fbfb3ffe292ab4') version('0.9.0', '4df45f8116cb7a013b286caf6da30a2e') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - make('install') diff --git a/var/spack/repos/builtin/packages/imake/package.py b/var/spack/repos/builtin/packages/imake/package.py index 32542b03916..b15a019156a 100644 --- a/var/spack/repos/builtin/packages/imake/package.py +++ b/var/spack/repos/builtin/packages/imake/package.py @@ -25,7 +25,7 @@ from spack import * -class Imake(Package): +class Imake(AutotoolsPackage): """The imake build system.""" homepage = "http://www.snake.net/software/imake-stuff/" @@ -35,9 +35,3 @@ class Imake(Package): depends_on('xproto', type='build') depends_on('pkg-config@0.9.0:', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/inputproto/package.py b/var/spack/repos/builtin/packages/inputproto/package.py index 915986ef681..220c314ac60 100644 --- a/var/spack/repos/builtin/packages/inputproto/package.py +++ b/var/spack/repos/builtin/packages/inputproto/package.py @@ -25,7 +25,7 @@ from spack import * -class Inputproto(Package): +class Inputproto(AutotoolsPackage): """X Input Extension. This extension defines a protocol to provide additional input devices @@ -38,8 +38,3 @@ class Inputproto(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make('install') diff --git a/var/spack/repos/builtin/packages/intel-gpu-tools/package.py b/var/spack/repos/builtin/packages/intel-gpu-tools/package.py index 132e29839b2..f72ebf76e71 100644 --- a/var/spack/repos/builtin/packages/intel-gpu-tools/package.py +++ b/var/spack/repos/builtin/packages/intel-gpu-tools/package.py @@ -25,7 +25,7 @@ from spack import * -class IntelGpuTools(Package): +class IntelGpuTools(AutotoolsPackage): """Intel GPU Tools is a collection of tools for development and testing of the Intel DRM driver. There are many macro-level test suites that get used against the driver, including xtest, rendercheck, piglit, and oglconform, @@ -58,10 +58,3 @@ class IntelGpuTools(Package): # python-docutils # x11proto-dri2-dev # xutils-dev - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('check') - make('install') diff --git a/var/spack/repos/builtin/packages/intel-parallel-studio/package.py b/var/spack/repos/builtin/packages/intel-parallel-studio/package.py index 8564eeb9411..941ef9befbe 100644 --- a/var/spack/repos/builtin/packages/intel-parallel-studio/package.py +++ b/var/spack/repos/builtin/packages/intel-parallel-studio/package.py @@ -127,20 +127,7 @@ def url_for_version(self, version): return url + ".tgz" - def check_variants(self, spec): - error_message = '\t{variant} can not be turned off if "+all" is set' - - if self.spec.satisfies('+all'): - errors = [error_message.format(variant=x) - for x in ('mpi', 'mkl', 'daal', 'ipp', 'tools') - if ('~' + x) in self.spec] - if errors: - errors = ['incompatible variants given'] + errors - raise InstallError('\n'.join(errors)) - def install(self, spec, prefix): - self.check_variants(spec) - base_components = "ALL" # when in doubt, install everything mpi_components = "" mkl_components = "" diff --git a/var/spack/repos/builtin/packages/itstool/package.py b/var/spack/repos/builtin/packages/itstool/package.py index b8b2b4459f2..c78e7404991 100644 --- a/var/spack/repos/builtin/packages/itstool/package.py +++ b/var/spack/repos/builtin/packages/itstool/package.py @@ -25,7 +25,7 @@ from spack import * -class Itstool(Package): +class Itstool(AutotoolsPackage): """ITS Tool allows you to translate your XML documents with PO files, using rules from the W3C Internationalization Tag Set (ITS) to determine what to translate and how to separate it into PO file messages.""" @@ -37,8 +37,3 @@ class Itstool(Package): version('2.0.1', '40935cfb08228488bd45575e5f001a34') version('2.0.0', 'd8c702c3e8961db83d04182c2aa4730b') version('1.2.0', 'c0925f6869e33af8e7fe56848c129152') - - def install(self, spec, prefix): - configure("--prefix=%s" % prefix) - make() - make('install') diff --git a/var/spack/repos/builtin/packages/jemalloc/package.py b/var/spack/repos/builtin/packages/jemalloc/package.py index 839251f47b4..ddd08f862f2 100644 --- a/var/spack/repos/builtin/packages/jemalloc/package.py +++ b/var/spack/repos/builtin/packages/jemalloc/package.py @@ -31,6 +31,7 @@ class Jemalloc(Package): homepage = "http://www.canonware.com/jemalloc/" url = "https://github.com/jemalloc/jemalloc/releases/download/4.0.4/jemalloc-4.0.4.tar.bz2" + version('4.4.0', '81b59778e19696d99e2f7922820671b0') version('4.3.1', 'f204c0ea1aef92fbb339dc640de338a6') version('4.2.1', '094b0a7b8c77c464d0dc8f0643fd3901') version('4.2.0', 'e6b5d5a1ea93a04207528d274efdd144') diff --git a/var/spack/repos/builtin/packages/jpeg/package.py b/var/spack/repos/builtin/packages/jpeg/package.py index 594240d9507..5c45a2889c2 100644 --- a/var/spack/repos/builtin/packages/jpeg/package.py +++ b/var/spack/repos/builtin/packages/jpeg/package.py @@ -25,7 +25,7 @@ from spack import * -class Jpeg(Package): +class Jpeg(AutotoolsPackage): """libjpeg is a widely used free library with functions for handling the JPEG image data format. It implements a JPEG codec (encoding and decoding) alongside various utilities for handling JPEG data.""" @@ -35,10 +35,3 @@ class Jpeg(Package): version('9b', '6a9996ce116ec5c52b4870dbcd6d3ddb') version('9a', '3353992aecaee1805ef4109aadd433e7') - - def install(self, spec, prefix): - configure("--prefix=%s" % prefix) - - make() - make("test") - make("install") diff --git a/var/spack/repos/builtin/packages/judy/package.py b/var/spack/repos/builtin/packages/judy/package.py index 8b8b261e535..ddcec05c226 100644 --- a/var/spack/repos/builtin/packages/judy/package.py +++ b/var/spack/repos/builtin/packages/judy/package.py @@ -25,16 +25,11 @@ from spack import * -class Judy(Package): +class Judy(AutotoolsPackage): """Judy: General-purpose dynamic array, associative array and hash-trie.""" homepage = "http://judy.sourceforge.net/" url = "http://downloads.sourceforge.net/project/judy/judy/Judy-1.0.5/Judy-1.0.5.tar.gz" version('1.0.5', '115a0d26302676e962ae2f70ec484a54') + parallel = False - - def install(self, spec, prefix): - configure('--prefix=%s' % prefix) - - make() - make("install") diff --git a/var/spack/repos/builtin/packages/kbproto/package.py b/var/spack/repos/builtin/packages/kbproto/package.py index 356d1c6b4fd..aaf4c9e1d1a 100644 --- a/var/spack/repos/builtin/packages/kbproto/package.py +++ b/var/spack/repos/builtin/packages/kbproto/package.py @@ -25,7 +25,7 @@ from spack import * -class Kbproto(Package): +class Kbproto(AutotoolsPackage): """X Keyboard Extension. This extension defines a protcol to provide a number of new capabilities @@ -38,8 +38,3 @@ class Kbproto(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make('install') diff --git a/var/spack/repos/builtin/packages/lbxproxy/package.py b/var/spack/repos/builtin/packages/lbxproxy/package.py index 3de3ade0c9d..3895134a7ca 100644 --- a/var/spack/repos/builtin/packages/lbxproxy/package.py +++ b/var/spack/repos/builtin/packages/lbxproxy/package.py @@ -25,7 +25,7 @@ from spack import * -class Lbxproxy(Package): +class Lbxproxy(AutotoolsPackage): """lbxproxy accepts client connections, multiplexes them over a single connection to the X server, and performs various optimizations on the X protocol to make it faster over low bandwidth and/or high latency @@ -50,9 +50,3 @@ class Lbxproxy(Package): depends_on('bigreqsproto', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/lcms/package.py b/var/spack/repos/builtin/packages/lcms/package.py index 4d3fc59568a..ad85ebe0558 100644 --- a/var/spack/repos/builtin/packages/lcms/package.py +++ b/var/spack/repos/builtin/packages/lcms/package.py @@ -25,7 +25,7 @@ from spack import * -class Lcms(Package): +class Lcms(AutotoolsPackage): """Little cms is a color management library. Implements fast transforms between ICC profiles. It is focused on speed, and is portable across several platforms (MIT license).""" @@ -37,8 +37,3 @@ class Lcms(Package): depends_on("jpeg") depends_on("libtiff") depends_on("zlib") - - def install(self, spec, prefix): - configure("--prefix=%s" % prefix) - make() - make("install") diff --git a/var/spack/repos/builtin/packages/libapplewm/package.py b/var/spack/repos/builtin/packages/libapplewm/package.py index 85408053ad2..35091985e37 100644 --- a/var/spack/repos/builtin/packages/libapplewm/package.py +++ b/var/spack/repos/builtin/packages/libapplewm/package.py @@ -25,7 +25,7 @@ from spack import * -class Libapplewm(Package): +class Libapplewm(AutotoolsPackage): """AppleWM is a simple library designed to interface with the Apple-WM extension. This extension allows X window managers to better interact with the Mac OS X Aqua user interface when running X11 in a rootless mode.""" @@ -43,12 +43,6 @@ class Libapplewm(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - # Crashes with this error message on Linux: - # HIServices/Processes.h: No such file or directory - # May only build properly on macOS? - - make() - make('install') + # Crashes with this error message on Linux: + # HIServices/Processes.h: No such file or directory + # May only build properly on macOS? diff --git a/var/spack/repos/builtin/packages/libarchive/package.py b/var/spack/repos/builtin/packages/libarchive/package.py index e439bf894ff..0edb3521d12 100644 --- a/var/spack/repos/builtin/packages/libarchive/package.py +++ b/var/spack/repos/builtin/packages/libarchive/package.py @@ -25,7 +25,7 @@ from spack import * -class Libarchive(Package): +class Libarchive(AutotoolsPackage): """libarchive: C library and command-line tools for reading and writing tar, cpio, zip, ISO, and other archive formats.""" @@ -48,10 +48,5 @@ class Libarchive(Package): depends_on('libxml2') depends_on('expat') - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - if self.run_tests: - make('check') # cannot build test suite with Intel compilers - make('install') + # NOTE: `make check` is known to fail with the Intel compilers + # The build test suite cannot be built with Intel diff --git a/var/spack/repos/builtin/packages/libcanberra/package.py b/var/spack/repos/builtin/packages/libcanberra/package.py new file mode 100644 index 00000000000..dfeb5c9c3e9 --- /dev/null +++ b/var/spack/repos/builtin/packages/libcanberra/package.py @@ -0,0 +1,68 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# 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/llnl/spack +# Please also see the LICENSE file 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 +############################################################################## +from spack import * + + +class Libcanberra(AutotoolsPackage): + """libcanberra is an implementation of the XDG Sound Theme and + Name Specifications, for generating event sounds on free desktops, + such as GNOME.""" + + homepage = "http://0pointer.de/lennart/projects/libcanberra/" + url = "http://0pointer.de/lennart/projects/libcanberra/libcanberra-0.30.tar.xz" + + version('0.30', '34cb7e4430afaf6f447c4ebdb9b42072') + + # TODO: Add variants and dependencies for the following audio support: + # ALSA, OSS, PulseAudio, udev, GStreamer, null, GTK3+ , tdb + + variant('gtk', default=False, description='Enable optional GTK+ support') + + depends_on('libxrender', when='+gtk') + depends_on('libxext', when='+gtk') + depends_on('libx11', when='+gtk') + depends_on('libxinerama', when='+gtk') + depends_on('libxrandr', when='+gtk') + depends_on('libxcursor', when='+gtk') + depends_on('libxcomposite', when='+gtk') + depends_on('libxdamage', when='+gtk') + depends_on('libxfixes', when='+gtk') + depends_on('libxcb', when='+gtk') + depends_on('libxau', when='+gtk') + depends_on('gtkplus', when='+gtk') + + depends_on('libvorbis') + + depends_on('pkg-config@0.9.0:', type='build') + + def configure_args(self): + args = ['--enable-static'] + + if '+gtk' in self.spec: + args.append('--enable-gtk') + else: + args.append('--disable-gtk') + + return args diff --git a/var/spack/repos/builtin/packages/libcerf/package.py b/var/spack/repos/builtin/packages/libcerf/package.py index 1964f03b958..82637431d64 100644 --- a/var/spack/repos/builtin/packages/libcerf/package.py +++ b/var/spack/repos/builtin/packages/libcerf/package.py @@ -26,7 +26,7 @@ from spack import * -class Libcerf(Package): +class Libcerf(AutotoolsPackage): """A self-contained C library providing complex error functions, based on Faddeeva's plasma dispersion function w(z). Also provides Dawson's integral and Voigt's convolution of a Gaussian and a Lorentzian @@ -37,13 +37,12 @@ class Libcerf(Package): version('1.3', 'b3504c467204df71e62aeccf73a25612') - def install(self, spec, prefix): + def configure_args(self): + spec = self.spec options = [] # Clang reports unused functions as errors, see # http://clang.debian.net/status.php?version=3.8.1&key=UNUSED_FUNCTION if spec.satisfies('%clang'): options.append('CFLAGS=-Wno-unused-function') - configure('--prefix=%s' % prefix, *options) - make() - make("install") + return options diff --git a/var/spack/repos/builtin/packages/libcircle/package.py b/var/spack/repos/builtin/packages/libcircle/package.py index 971c29f5f1c..e1063292190 100644 --- a/var/spack/repos/builtin/packages/libcircle/package.py +++ b/var/spack/repos/builtin/packages/libcircle/package.py @@ -25,7 +25,7 @@ from spack import * -class Libcircle(Package): +class Libcircle(AutotoolsPackage): """libcircle provides an efficient distributed queue on a cluster, using self-stabilizing work stealing.""" @@ -35,8 +35,3 @@ class Libcircle(Package): url='https://github.com/hpc/libcircle/releases/download/0.2.1-rc.1/libcircle-0.2.1-rc.1.tar.gz') depends_on('mpi') - - def install(self, spec, prefix): - configure("--prefix=" + prefix) - make() - make("install") diff --git a/var/spack/repos/builtin/packages/libdmx/package.py b/var/spack/repos/builtin/packages/libdmx/package.py index fa469fd4232..2aeb5b9fbb3 100644 --- a/var/spack/repos/builtin/packages/libdmx/package.py +++ b/var/spack/repos/builtin/packages/libdmx/package.py @@ -25,7 +25,7 @@ from spack import * -class Libdmx(Package): +class Libdmx(AutotoolsPackage): """libdmx - X Window System DMX (Distributed Multihead X) extension library.""" @@ -41,9 +41,3 @@ class Libdmx(Package): depends_on('dmxproto@2.2.99.1:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libedit/package.py b/var/spack/repos/builtin/packages/libedit/package.py index 235e7648bca..5dcee61caba 100644 --- a/var/spack/repos/builtin/packages/libedit/package.py +++ b/var/spack/repos/builtin/packages/libedit/package.py @@ -25,7 +25,7 @@ from spack import * -class Libedit(Package): +class Libedit(AutotoolsPackage): """An autotools compatible port of the NetBSD editline library""" homepage = "http://thrysoee.dk/editline/" url = "http://thrysoee.dk/editline/libedit-20150325-3.1.tar.gz" @@ -34,9 +34,3 @@ class Libedit(Package): url="http://thrysoee.dk/editline/libedit-20150325-3.1.tar.gz") depends_on('ncurses') - - def install(self, spec, prefix): - configure('--prefix=%s' % prefix) - - make() - make("install") diff --git a/var/spack/repos/builtin/packages/libepoxy/package.py b/var/spack/repos/builtin/packages/libepoxy/package.py index 364ea1e30c5..32c95fdda42 100644 --- a/var/spack/repos/builtin/packages/libepoxy/package.py +++ b/var/spack/repos/builtin/packages/libepoxy/package.py @@ -25,15 +25,10 @@ from spack import * -class Libepoxy(Package): +class Libepoxy(AutotoolsPackage): """Epoxy is a library for handling OpenGL function pointer management for you.""" homepage = "https://github.com/anholt/libepoxy" url = "https://github.com/anholt/libepoxy/releases/download/v1.3.1/libepoxy-1.3.1.tar.bz2" version('1.3.1', '96f6620a9b005a503e7b44b0b528287d') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libevent/package.py b/var/spack/repos/builtin/packages/libevent/package.py index 65b3a716c0a..f06c46a7159 100644 --- a/var/spack/repos/builtin/packages/libevent/package.py +++ b/var/spack/repos/builtin/packages/libevent/package.py @@ -25,7 +25,7 @@ from spack import * -class Libevent(Package): +class Libevent(AutotoolsPackage): """The libevent API provides a mechanism to execute a callback function when a specific event occurs on a file descriptor or after a timeout has been reached. Furthermore, libevent also support @@ -48,17 +48,17 @@ class Libevent(Package): version('2.0.13', 'af786b4b3f790c9d3279792edf7867fc') version('2.0.12', '42986228baf95e325778ed328a93e070') + # Does not build with OpenSSL 1.1.0 variant('openssl', default=True, description="Build with encryption enabled at the libevent level.") - depends_on('openssl', when='+openssl') + depends_on('openssl @:1.0', when='+openssl') - def install(self, spec, prefix): + def configure_args(self): + spec = self.spec configure_args = [] if '+openssl' in spec: configure_args.append('--enable-openssl') else: - configure_args.append('--enable-openssl') + configure_args.append('--disable-openssl') - configure("--prefix=%s" % prefix, *configure_args) - make() - make("install") + return configure_args diff --git a/var/spack/repos/builtin/packages/libffi/package.py b/var/spack/repos/builtin/packages/libffi/package.py index ddb7709ddfc..79ba50d77a2 100644 --- a/var/spack/repos/builtin/packages/libffi/package.py +++ b/var/spack/repos/builtin/packages/libffi/package.py @@ -33,7 +33,7 @@ class Libffi(AutotoolsPackage): homepage = "https://sourceware.org/libffi/" version('3.2.1', '83b89587607e3eb65c70d361f13bab43', - url="ftp://sourceware.org/pub/libffi/libffi-3.2.1.tar.gz") + url="https://www.mirrorservice.org/sites/sourceware.org/pub/libffi/libffi-3.2.1.tar.gz") # version('3.1', 'f5898b29bbfd70502831a212d9249d10',url = # "ftp://sourceware.org/pub/libffi/libffi-3.1.tar.gz") # Has a bug # $(lib64) instead of ${lib64} in libffi.pc diff --git a/var/spack/repos/builtin/packages/libfontenc/package.py b/var/spack/repos/builtin/packages/libfontenc/package.py index 1c7fa196d9d..945f74ccad3 100644 --- a/var/spack/repos/builtin/packages/libfontenc/package.py +++ b/var/spack/repos/builtin/packages/libfontenc/package.py @@ -25,7 +25,7 @@ from spack import * -class Libfontenc(Package): +class Libfontenc(AutotoolsPackage): """libfontenc - font encoding library.""" homepage = "http://cgit.freedesktop.org/xorg/lib/libfontenc" @@ -38,9 +38,3 @@ class Libfontenc(Package): depends_on('xproto', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libfs/package.py b/var/spack/repos/builtin/packages/libfs/package.py index 96bf62afd7f..96cb396b0ae 100644 --- a/var/spack/repos/builtin/packages/libfs/package.py +++ b/var/spack/repos/builtin/packages/libfs/package.py @@ -25,7 +25,7 @@ from spack import * -class Libfs(Package): +class Libfs(AutotoolsPackage): """libFS - X Font Service client library. This library is used by clients of X Font Servers (xfs), such as @@ -41,9 +41,3 @@ class Libfs(Package): depends_on('xtrans', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libgcrypt/package.py b/var/spack/repos/builtin/packages/libgcrypt/package.py index b556def4d3b..1eae9c6530a 100644 --- a/var/spack/repos/builtin/packages/libgcrypt/package.py +++ b/var/spack/repos/builtin/packages/libgcrypt/package.py @@ -25,20 +25,15 @@ from spack import * -class Libgcrypt(Package): +class Libgcrypt(AutotoolsPackage): """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" + url = "http://gd.tuwien.ac.at/pub/gnupg/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") diff --git a/var/spack/repos/builtin/packages/libgd/package.py b/var/spack/repos/builtin/packages/libgd/package.py index 6329adf8f3e..58867c85f8d 100644 --- a/var/spack/repos/builtin/packages/libgd/package.py +++ b/var/spack/repos/builtin/packages/libgd/package.py @@ -26,7 +26,7 @@ from spack import * -class Libgd(Package): +class Libgd(AutotoolsPackage): """GD is an open source code library for the dynamic creation of images by programmers. GD is written in C, and "wrappers" are available for Perl, PHP and other languages. GD creates PNG, JPEG, GIF, @@ -38,8 +38,9 @@ class Libgd(Package): """ homepage = "https://github.com/libgd/libgd" - url = "https://github.com/libgd/libgd/archive/gd-2.1.1.tar.gz" + url = 'https://github.com/libgd/libgd/releases/download/gd-2.2.4/libgd-2.2.4.tar.gz' + version('2.2.4', '0a3c307b5075edbe1883543dd1153c02') version('2.2.3', 'a67bd15fa33d4aac0a1c7904aed19f49') version('2.1.1', 'e91a1a99903e460e7ba00a794e72cc1e') @@ -54,19 +55,3 @@ class Libgd(Package): depends_on('libpng') depends_on('libtiff') depends_on('fontconfig') - - def install(self, spec, prefix): - autoreconf("--install", "--force", - "-I", "m4", - "-I", join_path(spec['gettext'].prefix, - "share", "aclocal"), - "-I", join_path(spec['pkg-config'].prefix, - "share", "aclocal"), - "-I", join_path(spec['automake'].prefix, - "share", "aclocal"), - "-I", join_path(spec['libtool'].prefix, - "share", "aclocal") - ) - configure('--prefix={0}'.format(prefix)) - make() - make("install") diff --git a/var/spack/repos/builtin/packages/libgpg-error/package.py b/var/spack/repos/builtin/packages/libgpg-error/package.py index a0e2acd5160..67cd1759c0c 100644 --- a/var/spack/repos/builtin/packages/libgpg-error/package.py +++ b/var/spack/repos/builtin/packages/libgpg-error/package.py @@ -25,19 +25,14 @@ from spack import * -class LibgpgError(Package): +class LibgpgError(AutotoolsPackage): """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" + url = "http://gd.tuwien.ac.at/pub/gnupg/libgpg-error/libgpg-error-1.18.tar.bz2" version('1.21', 'ab0b5aba6d0a185b41d07bda804fd8b2') version('1.18', '12312802d2065774b787cbfc22cc04e9') - - def install(self, spec, prefix): - configure("--prefix=%s" % prefix) - make() - make("install") diff --git a/var/spack/repos/builtin/packages/libgtextutils/package.py b/var/spack/repos/builtin/packages/libgtextutils/package.py index 201e0318694..05b6b7dabe7 100644 --- a/var/spack/repos/builtin/packages/libgtextutils/package.py +++ b/var/spack/repos/builtin/packages/libgtextutils/package.py @@ -25,16 +25,10 @@ from spack import * -class Libgtextutils(Package): +class Libgtextutils(AutotoolsPackage): """Gordon's Text utils Library.""" homepage = "https://github.com/agordon/libgtextutils" url = "https://github.com/agordon/libgtextutils/releases/download/0.7/libgtextutils-0.7.tar.gz" version('0.7', '593c7c62e3c76ec49f5736eed4f96806') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libhio/package.py b/var/spack/repos/builtin/packages/libhio/package.py index 17bd86d310f..181aca979f7 100644 --- a/var/spack/repos/builtin/packages/libhio/package.py +++ b/var/spack/repos/builtin/packages/libhio/package.py @@ -25,7 +25,7 @@ from spack import * -class Libhio(Package): +class Libhio(AutotoolsPackage): """ A library for writing to hierarchical data store systems. """ @@ -38,8 +38,3 @@ class Libhio(Package): depends_on("libjson-c") depends_on("bzip2") depends_on("pkg-config", type="build") - - def install(self, spec, prefix): - configure('--prefix=%s' % prefix) - make() - make("install") diff --git a/var/spack/repos/builtin/packages/libice/package.py b/var/spack/repos/builtin/packages/libice/package.py index 1f6fd2f9015..36436df501c 100644 --- a/var/spack/repos/builtin/packages/libice/package.py +++ b/var/spack/repos/builtin/packages/libice/package.py @@ -25,7 +25,7 @@ from spack import * -class Libice(Package): +class Libice(AutotoolsPackage): """libICE - Inter-Client Exchange Library.""" homepage = "http://cgit.freedesktop.org/xorg/lib/libICE" @@ -37,9 +37,3 @@ class Libice(Package): depends_on('xtrans', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libjpeg-turbo/package.py b/var/spack/repos/builtin/packages/libjpeg-turbo/package.py index 3fe159d7b99..8b9413bc86b 100644 --- a/var/spack/repos/builtin/packages/libjpeg-turbo/package.py +++ b/var/spack/repos/builtin/packages/libjpeg-turbo/package.py @@ -25,7 +25,7 @@ from spack import * -class LibjpegTurbo(Package): +class LibjpegTurbo(AutotoolsPackage): """libjpeg-turbo is a fork of the original IJG libjpeg which uses SIMD to accelerate baseline JPEG compression and decompression. libjpeg is a library that implements JPEG image encoding, decoding and @@ -43,8 +43,3 @@ class LibjpegTurbo(Package): # TODO: Implement the selection between two supported assemblers. # depends_on("yasm", type='build') depends_on("nasm", type='build') - - def install(self, spec, prefix): - configure("--prefix=" + prefix) - make() - make("install") diff --git a/var/spack/repos/builtin/packages/liblbxutil/package.py b/var/spack/repos/builtin/packages/liblbxutil/package.py index 1de59defd6c..fe1be09cf97 100644 --- a/var/spack/repos/builtin/packages/liblbxutil/package.py +++ b/var/spack/repos/builtin/packages/liblbxutil/package.py @@ -25,7 +25,7 @@ from spack import * -class Liblbxutil(Package): +class Liblbxutil(AutotoolsPackage): """liblbxutil - Low Bandwith X extension (LBX) utility routines.""" homepage = "http://cgit.freedesktop.org/xorg/lib/liblbxutil" @@ -43,9 +43,3 @@ class Liblbxutil(Package): # undefined symbol: Xalloc # See https://bugs.freedesktop.org/show_bug.cgi?id=8421 # Adding a dependency on libxdmcp and adding LIBS=-lXdmcp did not fix it - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libmng/package.py b/var/spack/repos/builtin/packages/libmng/package.py index a77aada79cc..c8ea90401b2 100644 --- a/var/spack/repos/builtin/packages/libmng/package.py +++ b/var/spack/repos/builtin/packages/libmng/package.py @@ -25,7 +25,7 @@ from spack import * -class Libmng(Package): +class Libmng(AutotoolsPackage): """libmng -THE reference library for reading, displaying, writing and examining Multiple-Image Network Graphics. MNG is the animation extension to the popular PNG image-format.""" @@ -43,7 +43,6 @@ def patch(self): filter_file(r'^(\#include \)', '#include\n\\1', 'libmng_types.h') - def install(self, spec, prefix): - configure("--prefix=%s" % prefix) - make() - make("install") + @run_before('configure') + def clean_configure_directory(self): + make('distclean') diff --git a/var/spack/repos/builtin/packages/libmonitor/package.py b/var/spack/repos/builtin/packages/libmonitor/package.py index f680baa2655..26a87c78fa4 100644 --- a/var/spack/repos/builtin/packages/libmonitor/package.py +++ b/var/spack/repos/builtin/packages/libmonitor/package.py @@ -25,7 +25,7 @@ from spack import * -class Libmonitor(Package): +class Libmonitor(AutotoolsPackage): """Libmonitor is a library for process and thread control.""" homepage = "https://github.com/HPCToolkit/libmonitor" version('20130218', git='https://github.com/HPCToolkit/libmonitor.git', @@ -36,8 +36,3 @@ class Libmonitor(Package): patch('libmonitorkrell-0000.patch', when='@20130218+krellpatch') patch('libmonitorkrell-0001.patch', when='@20130218+krellpatch') patch('libmonitorkrell-0002.patch', when='@20130218+krellpatch') - - def install(self, spec, prefix): - configure("--prefix=" + prefix) - make() - make("install") diff --git a/var/spack/repos/builtin/packages/libnbc/package.py b/var/spack/repos/builtin/packages/libnbc/package.py index 414498a37ae..e135fa6835e 100644 --- a/var/spack/repos/builtin/packages/libnbc/package.py +++ b/var/spack/repos/builtin/packages/libnbc/package.py @@ -25,7 +25,7 @@ from spack import * -class Libnbc(Package): +class Libnbc(AutotoolsPackage): """LibNBC is a prototypic implementation of a nonblocking interface for MPI collective operations. Based on ANSI C and MPI-1, it supports all MPI-1 collective operations in a @@ -37,8 +37,3 @@ class Libnbc(Package): version('1.1.1', 'ece5c94992591a9fa934a90e5dbe50ce') depends_on("mpi") - - def install(self, spec, prefix): - configure("--prefix=%s" % prefix) - make() - make("install") diff --git a/var/spack/repos/builtin/packages/libogg/package.py b/var/spack/repos/builtin/packages/libogg/package.py new file mode 100644 index 00000000000..bb80764b7cd --- /dev/null +++ b/var/spack/repos/builtin/packages/libogg/package.py @@ -0,0 +1,35 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# 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/llnl/spack +# Please also see the LICENSE file 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 +############################################################################## +from spack import * + + +class Libogg(AutotoolsPackage): + """Ogg is a multimedia container format, and the native file and stream + format for the Xiph.org multimedia codecs.""" + + homepage = "https://www.xiph.org/ogg/" + url = "http://downloads.xiph.org/releases/ogg/libogg-1.3.2.tar.gz" + + version('1.3.2', 'b72e1a1dbadff3248e4ed62a4177e937') diff --git a/var/spack/repos/builtin/packages/liboldx/package.py b/var/spack/repos/builtin/packages/liboldx/package.py index 9e85f1ed65f..1bec00bfe37 100644 --- a/var/spack/repos/builtin/packages/liboldx/package.py +++ b/var/spack/repos/builtin/packages/liboldx/package.py @@ -25,7 +25,7 @@ from spack import * -class Liboldx(Package): +class Liboldx(AutotoolsPackage): """X version 10 backwards compatibility.""" homepage = "https://cgit.freedesktop.org/xorg/lib/liboldX/" @@ -37,9 +37,3 @@ class Liboldx(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libpthread-stubs/package.py b/var/spack/repos/builtin/packages/libpthread-stubs/package.py index fdaf327c2a7..911bf6814c7 100644 --- a/var/spack/repos/builtin/packages/libpthread-stubs/package.py +++ b/var/spack/repos/builtin/packages/libpthread-stubs/package.py @@ -25,7 +25,7 @@ from spack import * -class LibpthreadStubs(Package): +class LibpthreadStubs(AutotoolsPackage): """The libpthread-stubs package provides weak aliases for pthread functions not provided in libc or otherwise available by default.""" @@ -33,8 +33,3 @@ class LibpthreadStubs(Package): url = "https://xcb.freedesktop.org/dist/libpthread-stubs-0.3.tar.gz" version('0.3', 'a09d928c4af54fe5436002345ef71138') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make('install') diff --git a/var/spack/repos/builtin/packages/libquo/package.py b/var/spack/repos/builtin/packages/libquo/package.py index 8856913bb26..76a508f9c61 100644 --- a/var/spack/repos/builtin/packages/libquo/package.py +++ b/var/spack/repos/builtin/packages/libquo/package.py @@ -23,19 +23,16 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## from spack import * -import os -class Libquo(Package): - """A high-level, easy to use programming interface tailored specifically - for MPI/MPI+X codes that may benefit from evolving process binding - policies during their execution. QUO allows for arbitrary process binding - policies to be enacted and reverted during the execution of an MPI/MPI+X - application as different computational phases are entered and exited, - respectively.""" +class Libquo(AutotoolsPackage): - homepage = "https://github.com/losalamos/libquo" - url = "https://github.com/losalamos/libquo/archive/v1.2.9.tar.gz" + """QUO (as in "status quo") is a runtime library that aids in accommodating + thread-level heterogeneity in dynamic, phased MPI+X applications comprising + single- and multi-threaded libraries.""" + + homepage = "https://github.com/lanl/libquo" + url = "https://github.com/lanl/libquo/archive/v1.2.9.tar.gz" version('1.2.9', 'ca82ab33f13e2b89983f81e7c02e98c2') @@ -44,25 +41,8 @@ class Libquo(Package): depends_on('automake', type='build') depends_on('libtool', type='build') - def install(self, spec, prefix): - autoreconf_options = [ - '--install', - '--verbose', - '--force', - '-I', 'config', - '-I', os.path.join(spec['automake'].prefix, - 'share', 'aclocal'), - '-I', os.path.join(spec['libtool'].prefix, - 'share', 'aclocal') + def configure_args(self): + return [ + 'CC={0}'.format(self.spec['mpi'].mpicc), + 'FC={0}'.format(self.spec['mpi'].mpifc) ] - autoreconf(*autoreconf_options) - - configure_options = [ - '--prefix={0}'.format(prefix), - 'CC=%s' % join_path(spec['mpi'].prefix.bin, "mpicc"), - 'FC=%s' % join_path(spec['mpi'].prefix.bin, "mpif90") - ] - configure(*configure_options) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libsigsegv/package.py b/var/spack/repos/builtin/packages/libsigsegv/package.py index a5a3e8eb5ff..f354b260a92 100644 --- a/var/spack/repos/builtin/packages/libsigsegv/package.py +++ b/var/spack/repos/builtin/packages/libsigsegv/package.py @@ -29,7 +29,7 @@ class Libsigsegv(AutotoolsPackage): """GNU libsigsegv is a library for handling page faults in user mode.""" homepage = "https://www.gnu.org/software/libsigsegv/" - url = "ftp://ftp.gnu.org/gnu/libsigsegv/libsigsegv-2.10.tar.gz" + url = "https://ftp.gnu.org/gnu/libsigsegv/libsigsegv-2.10.tar.gz" patch('patch.new_config_guess', when='@2.10') diff --git a/var/spack/repos/builtin/packages/libsm/package.py b/var/spack/repos/builtin/packages/libsm/package.py index 4affd50127b..9479da07d7a 100644 --- a/var/spack/repos/builtin/packages/libsm/package.py +++ b/var/spack/repos/builtin/packages/libsm/package.py @@ -25,7 +25,7 @@ from spack import * -class Libsm(Package): +class Libsm(AutotoolsPackage): """libSM - X Session Management Library.""" homepage = "http://cgit.freedesktop.org/xorg/lib/libSM" @@ -39,9 +39,3 @@ class Libsm(Package): depends_on('xtrans', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libsodium/package.py b/var/spack/repos/builtin/packages/libsodium/package.py index 805881ce070..a7e3ab10aed 100644 --- a/var/spack/repos/builtin/packages/libsodium/package.py +++ b/var/spack/repos/builtin/packages/libsodium/package.py @@ -25,7 +25,7 @@ from spack import * -class Libsodium(Package): +class Libsodium(AutotoolsPackage): """Sodium is a modern, easy-to-use software library for encryption, decryption, signatures, password hashing and more.""" homepage = "https://download.libsodium.org/doc/" @@ -44,9 +44,3 @@ def url_for_version(self, version): if version < Version('1.0.4'): url += 'old/' return url + 'libsodium-{0}.tar.gz'.format(version) - - def install(self, spec, prefix): - configure("--prefix=%s" % prefix) - - make() - make("install") diff --git a/var/spack/repos/builtin/packages/libtiff/package.py b/var/spack/repos/builtin/packages/libtiff/package.py index 70c371b3b81..3e5b57a9656 100644 --- a/var/spack/repos/builtin/packages/libtiff/package.py +++ b/var/spack/repos/builtin/packages/libtiff/package.py @@ -28,7 +28,7 @@ class Libtiff(AutotoolsPackage): """libtiff graphics format library""" homepage = "http://www.simplesystems.org/libtiff/" - url = "ftp://download.osgeo.org/libtiff/tiff-4.0.3.tar.gz" + url = "http://download.osgeo.org/libtiff/tiff-4.0.3.tar.gz" version('4.0.6', 'd1d2e940dea0b5ad435f21f03d96dd72') version('4.0.3', '051c1068e6a0627f461948c365290410') diff --git a/var/spack/repos/builtin/packages/libtool/package.py b/var/spack/repos/builtin/packages/libtool/package.py index cd125036814..ae706089c97 100644 --- a/var/spack/repos/builtin/packages/libtool/package.py +++ b/var/spack/repos/builtin/packages/libtool/package.py @@ -36,6 +36,8 @@ class Libtool(AutotoolsPackage): depends_on('m4@1.4.6:', type='build') + build_directory = 'spack-build' + def _make_executable(self, name): return Executable(join_path(self.prefix.bin, name)) diff --git a/var/spack/repos/builtin/packages/libunistring/package.py b/var/spack/repos/builtin/packages/libunistring/package.py index 5b8837e72b2..08657f89d19 100644 --- a/var/spack/repos/builtin/packages/libunistring/package.py +++ b/var/spack/repos/builtin/packages/libunistring/package.py @@ -25,7 +25,7 @@ from spack import * -class Libunistring(Package): +class Libunistring(AutotoolsPackage): """This library provides functions for manipulating Unicode strings and for manipulating C strings according to the Unicode standard.""" @@ -34,9 +34,4 @@ class Libunistring(Package): version('0.9.6', 'cb09c398020c27edac10ca590e9e9ef3') - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - # make('check') # test-verify fails for me, contacted developers - make('install') + # NOTE: `make check` fails test-verify diff --git a/var/spack/repos/builtin/packages/libunwind/package.py b/var/spack/repos/builtin/packages/libunwind/package.py index 63ab4aec59b..1e727f84f37 100644 --- a/var/spack/repos/builtin/packages/libunwind/package.py +++ b/var/spack/repos/builtin/packages/libunwind/package.py @@ -25,15 +25,10 @@ from spack import * -class Libunwind(Package): +class Libunwind(AutotoolsPackage): """A portable and efficient C programming interface (API) to determine the call-chain of a program.""" homepage = "http://www.nongnu.org/libunwind/" url = "http://download.savannah.gnu.org/releases/libunwind/libunwind-1.1.tar.gz" version('1.1', 'fb4ea2f6fbbe45bf032cd36e586883ce') - - def install(self, spec, prefix): - configure("--prefix=" + prefix) - make() - make("install") diff --git a/var/spack/repos/builtin/packages/libuuid/package.py b/var/spack/repos/builtin/packages/libuuid/package.py index b8f6b1cc3af..31f109cba3b 100644 --- a/var/spack/repos/builtin/packages/libuuid/package.py +++ b/var/spack/repos/builtin/packages/libuuid/package.py @@ -25,16 +25,10 @@ from spack import * -class Libuuid(Package): +class Libuuid(AutotoolsPackage): """Portable uuid C library""" homepage = "http://sourceforge.net/projects/libuuid/" url = "http://downloads.sourceforge.net/project/libuuid/libuuid-1.0.3.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Flibuuid%2F&ts=1433881396&use_mirror=iweb" version('1.0.3', 'd44d866d06286c08ba0846aba1086d68') - - def install(self, spec, prefix): - configure("--prefix=%s" % prefix) - - make() - make("install") diff --git a/var/spack/repos/builtin/packages/libuv/package.py b/var/spack/repos/builtin/packages/libuv/package.py index dae10809f22..2f303280daf 100644 --- a/var/spack/repos/builtin/packages/libuv/package.py +++ b/var/spack/repos/builtin/packages/libuv/package.py @@ -25,7 +25,7 @@ from spack import * -class Libuv(Package): +class Libuv(AutotoolsPackage): """Multi-platform library with a focus on asynchronous IO""" homepage = "http://libuv.org" url = "https://github.com/libuv/libuv/archive/v1.9.0.tar.gz" @@ -36,11 +36,8 @@ class Libuv(Package): depends_on('autoconf', type='build') depends_on('libtool', type='build') - def install(self, spec, prefix): + def autoreconf(self, spec, prefix): + # This is needed because autogen.sh generates on-the-fly + # an m4 macro needed during configuration bash = which("bash") bash('autogen.sh') - configure('--prefix=%s' % prefix) - - make() - make("check") - make("install") diff --git a/lib/spack/spack/cmd/urls.py b/var/spack/repos/builtin/packages/libvorbis/package.py similarity index 54% rename from lib/spack/spack/cmd/urls.py rename to var/spack/repos/builtin/packages/libvorbis/package.py index f151581d7db..e716abe46dc 100644 --- a/lib/spack/spack/cmd/urls.py +++ b/var/spack/repos/builtin/packages/libvorbis/package.py @@ -22,38 +22,23 @@ # License along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## -import spack -import spack.url - -description = "Inspect urls used by packages in spack." +from spack import * -def setup_parser(subparser): - subparser.add_argument( - '-c', '--color', action='store_true', - help="Color the parsed version and name in the urls shown. " - "Version will be cyan, name red.") - subparser.add_argument( - '-e', '--extrapolation', action='store_true', - help="Color the versions used for extrapolation as well." - "Additional versions are green, names magenta.") +class Libvorbis(AutotoolsPackage): + """Ogg Vorbis is a fully open, non-proprietary, patent-and-royalty-free, + general-purpose compressed audio format for mid to high quality (8kHz- + 48.0kHz, 16+ bit, polyphonic) audio and music at fixed and variable + bitrates from 16 to 128 kbps/channel.""" + homepage = "https://xiph.org/vorbis/" + url = "http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.5.tar.gz" -def urls(parser, args): - urls = set() - for pkg in spack.repo.all_packages(): - url = getattr(pkg.__class__, 'url', None) - if url: - urls.add(url) + version('1.3.5', '7220e089f3be3412a2317d6fde9e3944') - for params in pkg.versions.values(): - url = params.get('url', None) - if url: - urls.add(url) + depends_on('libogg') - for url in sorted(urls): - if args.color or args.extrapolation: - print spack.url.color_url( - url, subs=args.extrapolation, errors=True) - else: - print url + depends_on('pkg-config@0.9.0:', type='build') + + # `make check` crashes when run in parallel + parallel = False diff --git a/var/spack/repos/builtin/packages/libwindowswm/package.py b/var/spack/repos/builtin/packages/libwindowswm/package.py index 3836e0d4194..5b331f428cb 100644 --- a/var/spack/repos/builtin/packages/libwindowswm/package.py +++ b/var/spack/repos/builtin/packages/libwindowswm/package.py @@ -25,7 +25,7 @@ from spack import * -class Libwindowswm(Package): +class Libwindowswm(AutotoolsPackage): """WindowsWM - Cygwin/X rootless window management extension. WindowsWM is a simple library designed to interface with the @@ -45,9 +45,3 @@ class Libwindowswm(Package): depends_on('windowswmproto', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libx11/package.py b/var/spack/repos/builtin/packages/libx11/package.py index c5df2e0f83e..d9c28836b8e 100644 --- a/var/spack/repos/builtin/packages/libx11/package.py +++ b/var/spack/repos/builtin/packages/libx11/package.py @@ -25,7 +25,7 @@ from spack import * -class Libx11(Package): +class Libx11(AutotoolsPackage): """libX11 - Core X11 protocol client library.""" homepage = "https://www.x.org/" @@ -42,10 +42,3 @@ class Libx11(Package): depends_on('inputproto', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('check') - make('install') diff --git a/var/spack/repos/builtin/packages/libxau/package.py b/var/spack/repos/builtin/packages/libxau/package.py index eb1f1326c64..bf4e9f5e4eb 100644 --- a/var/spack/repos/builtin/packages/libxau/package.py +++ b/var/spack/repos/builtin/packages/libxau/package.py @@ -25,7 +25,7 @@ from spack import * -class Libxau(Package): +class Libxau(AutotoolsPackage): """The libXau package contains a library implementing the X11 Authorization Protocol. This is useful for restricting client access to the display.""" @@ -38,10 +38,3 @@ class Libxau(Package): depends_on('xproto', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('check') - make('install') diff --git a/var/spack/repos/builtin/packages/libxaw/package.py b/var/spack/repos/builtin/packages/libxaw/package.py index 9f92ff57d2d..f3779be7ed3 100644 --- a/var/spack/repos/builtin/packages/libxaw/package.py +++ b/var/spack/repos/builtin/packages/libxaw/package.py @@ -25,7 +25,7 @@ from spack import * -class Libxaw(Package): +class Libxaw(AutotoolsPackage): """Xaw is the X Athena Widget Set. Xaw is a widget set based on the X Toolkit Intrinsics (Xt) Library.""" @@ -44,9 +44,3 @@ class Libxaw(Package): depends_on('xextproto', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libxaw3d/package.py b/var/spack/repos/builtin/packages/libxaw3d/package.py index 498f57cbca3..0e350aa2ce3 100644 --- a/var/spack/repos/builtin/packages/libxaw3d/package.py +++ b/var/spack/repos/builtin/packages/libxaw3d/package.py @@ -25,7 +25,7 @@ from spack import * -class Libxaw3d(Package): +class Libxaw3d(AutotoolsPackage): """Xaw3d is the X 3D Athena Widget Set. Xaw3d is a widget set based on the X Toolkit Intrinsics (Xt) Library.""" @@ -42,9 +42,3 @@ class Libxaw3d(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libxcb/package.py b/var/spack/repos/builtin/packages/libxcb/package.py index 9fa1c6f97ce..0e4d00da979 100644 --- a/var/spack/repos/builtin/packages/libxcb/package.py +++ b/var/spack/repos/builtin/packages/libxcb/package.py @@ -25,7 +25,7 @@ from spack import * -class Libxcb(Package): +class Libxcb(AutotoolsPackage): """The X protocol C-language Binding (XCB) is a replacement for Xlib featuring a small footprint, latency hiding, direct access to the protocol, improved threading support, and @@ -52,10 +52,3 @@ def patch(self): 'typedef struct xcb_auth_info_t {', 'typedef struct {', 'src/xcb.h') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('check') - make('install') diff --git a/var/spack/repos/builtin/packages/libxcomposite/package.py b/var/spack/repos/builtin/packages/libxcomposite/package.py index 48cba002500..30d3a4c0cae 100644 --- a/var/spack/repos/builtin/packages/libxcomposite/package.py +++ b/var/spack/repos/builtin/packages/libxcomposite/package.py @@ -25,7 +25,7 @@ from spack import * -class Libxcomposite(Package): +class Libxcomposite(AutotoolsPackage): """libXcomposite - client library for the Composite extension to the X11 protocol.""" @@ -40,9 +40,3 @@ class Libxcomposite(Package): depends_on('compositeproto@0.4:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libxcursor/package.py b/var/spack/repos/builtin/packages/libxcursor/package.py index 215452ef525..ee5065bfa4f 100644 --- a/var/spack/repos/builtin/packages/libxcursor/package.py +++ b/var/spack/repos/builtin/packages/libxcursor/package.py @@ -25,7 +25,7 @@ from spack import * -class Libxcursor(Package): +class Libxcursor(AutotoolsPackage): """libXcursor - X Window System Cursor management library.""" homepage = "http://cgit.freedesktop.org/xorg/lib/libXcursor" @@ -40,9 +40,3 @@ class Libxcursor(Package): depends_on('fixesproto', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libxdamage/package.py b/var/spack/repos/builtin/packages/libxdamage/package.py index 448ac21945c..4eca877421f 100644 --- a/var/spack/repos/builtin/packages/libxdamage/package.py +++ b/var/spack/repos/builtin/packages/libxdamage/package.py @@ -25,7 +25,7 @@ from spack import * -class Libxdamage(Package): +class Libxdamage(AutotoolsPackage): """This package contains the library for the X Damage extension.""" homepage = "http://cgit.freedesktop.org/xorg/lib/libXdamage" @@ -41,9 +41,3 @@ class Libxdamage(Package): depends_on('xextproto', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libxdmcp/package.py b/var/spack/repos/builtin/packages/libxdmcp/package.py index c05d4b87719..7c4fd068f0d 100644 --- a/var/spack/repos/builtin/packages/libxdmcp/package.py +++ b/var/spack/repos/builtin/packages/libxdmcp/package.py @@ -25,7 +25,7 @@ from spack import * -class Libxdmcp(Package): +class Libxdmcp(AutotoolsPackage): """libXdmcp - X Display Manager Control Protocol library.""" homepage = "http://cgit.freedesktop.org/xorg/lib/libXdmcp" @@ -36,10 +36,3 @@ class Libxdmcp(Package): depends_on('xproto', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('check') - make('install') diff --git a/var/spack/repos/builtin/packages/libxevie/package.py b/var/spack/repos/builtin/packages/libxevie/package.py index b9f0e416313..7435027b48b 100644 --- a/var/spack/repos/builtin/packages/libxevie/package.py +++ b/var/spack/repos/builtin/packages/libxevie/package.py @@ -25,7 +25,7 @@ from spack import * -class Libxevie(Package): +class Libxevie(AutotoolsPackage): """Xevie - X Event Interception Extension (XEvIE).""" homepage = "http://cgit.freedesktop.org/xorg/lib/libXevie" @@ -41,9 +41,3 @@ class Libxevie(Package): depends_on('evieext', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libxext/package.py b/var/spack/repos/builtin/packages/libxext/package.py index 192ab3957a1..528f00cc357 100644 --- a/var/spack/repos/builtin/packages/libxext/package.py +++ b/var/spack/repos/builtin/packages/libxext/package.py @@ -25,7 +25,7 @@ from spack import * -class Libxext(Package): +class Libxext(AutotoolsPackage): """libXext - library for common extensions to the X11 protocol.""" homepage = "http://cgit.freedesktop.org/xorg/lib/libXext" @@ -39,9 +39,3 @@ class Libxext(Package): depends_on('xextproto@7.1.99:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libxfixes/package.py b/var/spack/repos/builtin/packages/libxfixes/package.py index 6b8b599a856..6add3bb56d9 100644 --- a/var/spack/repos/builtin/packages/libxfixes/package.py +++ b/var/spack/repos/builtin/packages/libxfixes/package.py @@ -25,7 +25,7 @@ from spack import * -class Libxfixes(Package): +class Libxfixes(AutotoolsPackage): """This package contains header files and documentation for the XFIXES extension. Library and server implementations are separate.""" @@ -41,9 +41,3 @@ class Libxfixes(Package): depends_on('xextproto', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libxfont/package.py b/var/spack/repos/builtin/packages/libxfont/package.py index 1ebf321c9f7..7538c34f078 100644 --- a/var/spack/repos/builtin/packages/libxfont/package.py +++ b/var/spack/repos/builtin/packages/libxfont/package.py @@ -25,7 +25,7 @@ from spack import * -class Libxfont(Package): +class Libxfont(AutotoolsPackage): """libXfont provides the core of the legacy X11 font system, handling the index files (fonts.dir, fonts.alias, fonts.scale), the various font file formats, and rasterizing them. It is used by the X servers, the @@ -46,9 +46,3 @@ class Libxfont(Package): depends_on('fontsproto@2.1.3:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libxfont2/package.py b/var/spack/repos/builtin/packages/libxfont2/package.py index 8611e65ebb9..bc1dc06dd03 100644 --- a/var/spack/repos/builtin/packages/libxfont2/package.py +++ b/var/spack/repos/builtin/packages/libxfont2/package.py @@ -25,7 +25,7 @@ from spack import * -class Libxfont2(Package): +class Libxfont2(AutotoolsPackage): """libXfont provides the core of the legacy X11 font system, handling the index files (fonts.dir, fonts.alias, fonts.scale), the various font file formats, and rasterizing them. It is used by the X servers, the @@ -46,9 +46,3 @@ class Libxfont2(Package): depends_on('fontsproto@2.1.3:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libxfontcache/package.py b/var/spack/repos/builtin/packages/libxfontcache/package.py index 5421f093cad..c4a4d5675a8 100644 --- a/var/spack/repos/builtin/packages/libxfontcache/package.py +++ b/var/spack/repos/builtin/packages/libxfontcache/package.py @@ -25,7 +25,7 @@ from spack import * -class Libxfontcache(Package): +class Libxfontcache(AutotoolsPackage): """Xfontcache - X-TrueType font cache extension client library.""" homepage = "http://cgit.freedesktop.org/xorg/lib/libXfontcache" @@ -40,9 +40,3 @@ class Libxfontcache(Package): depends_on('fontcacheproto', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libxft/package.py b/var/spack/repos/builtin/packages/libxft/package.py index b1b8f853d0d..8385b4168a6 100644 --- a/var/spack/repos/builtin/packages/libxft/package.py +++ b/var/spack/repos/builtin/packages/libxft/package.py @@ -25,7 +25,7 @@ from spack import * -class Libxft(Package): +class Libxft(AutotoolsPackage): """X FreeType library. Xft version 2.1 was the first stand alone release of Xft, a library that @@ -44,9 +44,3 @@ class Libxft(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libxi/package.py b/var/spack/repos/builtin/packages/libxi/package.py index 4e9a2735790..5334ef9044c 100644 --- a/var/spack/repos/builtin/packages/libxi/package.py +++ b/var/spack/repos/builtin/packages/libxi/package.py @@ -25,7 +25,7 @@ from spack import * -class Libxi(Package): +class Libxi(AutotoolsPackage): """libXi - library for the X Input Extension.""" homepage = "http://cgit.freedesktop.org/xorg/lib/libXi" @@ -40,9 +40,3 @@ class Libxi(Package): depends_on('xproto@7.0.13:', type='build') depends_on('xextproto@7.0.3:', type='build') depends_on('inputproto@2.2.99.1:', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libxinerama/package.py b/var/spack/repos/builtin/packages/libxinerama/package.py index a001c41ca78..9e3633629a5 100644 --- a/var/spack/repos/builtin/packages/libxinerama/package.py +++ b/var/spack/repos/builtin/packages/libxinerama/package.py @@ -25,7 +25,7 @@ from spack import * -class Libxinerama(Package): +class Libxinerama(AutotoolsPackage): """libXinerama - API for Xinerama extension to X11 Protocol.""" homepage = "http://cgit.freedesktop.org/xorg/lib/libXinerama" @@ -40,9 +40,3 @@ class Libxinerama(Package): depends_on('xineramaproto@1.1.99.1:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libxkbfile/package.py b/var/spack/repos/builtin/packages/libxkbfile/package.py index af8029a024a..daafa8dd654 100644 --- a/var/spack/repos/builtin/packages/libxkbfile/package.py +++ b/var/spack/repos/builtin/packages/libxkbfile/package.py @@ -25,7 +25,7 @@ from spack import * -class Libxkbfile(Package): +class Libxkbfile(AutotoolsPackage): """XKB file handling routines.""" homepage = "https://cgit.freedesktop.org/xorg/lib/libxkbfile" @@ -38,9 +38,3 @@ class Libxkbfile(Package): depends_on('kbproto', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libxkbui/package.py b/var/spack/repos/builtin/packages/libxkbui/package.py index d0c132d9700..b6a40b656d2 100644 --- a/var/spack/repos/builtin/packages/libxkbui/package.py +++ b/var/spack/repos/builtin/packages/libxkbui/package.py @@ -25,7 +25,7 @@ from spack import * -class Libxkbui(Package): +class Libxkbui(AutotoolsPackage): """X.org libxkbui library.""" homepage = "https://cgit.freedesktop.org/xorg/lib/libxkbui/" @@ -39,9 +39,3 @@ class Libxkbui(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libxml2/package.py b/var/spack/repos/builtin/packages/libxml2/package.py index bbb934ab9fa..470998d8826 100644 --- a/var/spack/repos/builtin/packages/libxml2/package.py +++ b/var/spack/repos/builtin/packages/libxml2/package.py @@ -25,7 +25,7 @@ from spack import * -class Libxml2(Package): +class Libxml2(AutotoolsPackage): """Libxml2 is the XML C parser and toolkit developed for the Gnome project (but usable outside of the Gnome platform), it is free software available under the MIT License.""" @@ -45,7 +45,8 @@ class Libxml2(Package): depends_on('pkg-config@0.9.0:', type='build') - def install(self, spec, prefix): + def configure_args(self): + spec = self.spec if '+python' in spec: python_args = [ '--with-python={0}'.format(spec['python'].prefix), @@ -54,9 +55,4 @@ def install(self, spec, prefix): else: python_args = ['--without-python'] - configure('--prefix={0}'.format(prefix), *python_args) - - make() - if self.run_tests: - make('check') - make('install') + return python_args diff --git a/var/spack/repos/builtin/packages/libxmu/package.py b/var/spack/repos/builtin/packages/libxmu/package.py index dbba5f168d2..937cf750133 100644 --- a/var/spack/repos/builtin/packages/libxmu/package.py +++ b/var/spack/repos/builtin/packages/libxmu/package.py @@ -25,7 +25,7 @@ from spack import * -class Libxmu(Package): +class Libxmu(AutotoolsPackage): """This library contains miscellaneous utilities and is not part of the Xlib standard. It contains routines which only use public interfaces so that it may be layered on top of any proprietary implementation of Xlib @@ -43,9 +43,3 @@ class Libxmu(Package): depends_on('xextproto', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libxp/package.py b/var/spack/repos/builtin/packages/libxp/package.py index 10aaccc54f2..95d4bfa2f80 100644 --- a/var/spack/repos/builtin/packages/libxp/package.py +++ b/var/spack/repos/builtin/packages/libxp/package.py @@ -25,7 +25,7 @@ from spack import * -class Libxp(Package): +class Libxp(AutotoolsPackage): """libXp - X Print Client Library.""" homepage = "http://cgit.freedesktop.org/xorg/lib/libXp" @@ -41,9 +41,3 @@ class Libxp(Package): depends_on('printproto', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libxpm/package.py b/var/spack/repos/builtin/packages/libxpm/package.py index b726e74b0be..cfb269db7f9 100644 --- a/var/spack/repos/builtin/packages/libxpm/package.py +++ b/var/spack/repos/builtin/packages/libxpm/package.py @@ -25,7 +25,7 @@ from spack import * -class Libxpm(Package): +class Libxpm(AutotoolsPackage): """libXpm - X Pixmap (XPM) image file format library.""" homepage = "http://cgit.freedesktop.org/xorg/lib/libXpm" @@ -42,9 +42,3 @@ class Libxpm(Package): depends_on('xproto', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libxpresent/package.py b/var/spack/repos/builtin/packages/libxpresent/package.py index e65d4353a00..5237b164a0f 100644 --- a/var/spack/repos/builtin/packages/libxpresent/package.py +++ b/var/spack/repos/builtin/packages/libxpresent/package.py @@ -25,7 +25,7 @@ from spack import * -class Libxpresent(Package): +class Libxpresent(AutotoolsPackage): """This package contains header files and documentation for the Present extension. Library and server implementations are separate.""" @@ -41,9 +41,3 @@ class Libxpresent(Package): depends_on('xextproto', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libxprintapputil/package.py b/var/spack/repos/builtin/packages/libxprintapputil/package.py index fc66b76ac08..ef1963c3006 100644 --- a/var/spack/repos/builtin/packages/libxprintapputil/package.py +++ b/var/spack/repos/builtin/packages/libxprintapputil/package.py @@ -25,7 +25,7 @@ from spack import * -class Libxprintapputil(Package): +class Libxprintapputil(AutotoolsPackage): """Xprint application utility routines.""" homepage = "https://cgit.freedesktop.org/xorg/lib/libXprintAppUtil/" @@ -41,9 +41,3 @@ class Libxprintapputil(Package): depends_on('printproto', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libxprintutil/package.py b/var/spack/repos/builtin/packages/libxprintutil/package.py index 8eb768958f6..b55123a3979 100644 --- a/var/spack/repos/builtin/packages/libxprintutil/package.py +++ b/var/spack/repos/builtin/packages/libxprintutil/package.py @@ -25,7 +25,7 @@ from spack import * -class Libxprintutil(Package): +class Libxprintutil(AutotoolsPackage): """Xprint application utility routines.""" homepage = "https://cgit.freedesktop.org/xorg/lib/libXprintUtil/" @@ -41,9 +41,3 @@ class Libxprintutil(Package): depends_on('printproto', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libxrandr/package.py b/var/spack/repos/builtin/packages/libxrandr/package.py index 56c36c0c7bc..773be3ab8bf 100644 --- a/var/spack/repos/builtin/packages/libxrandr/package.py +++ b/var/spack/repos/builtin/packages/libxrandr/package.py @@ -25,7 +25,7 @@ from spack import * -class Libxrandr(Package): +class Libxrandr(AutotoolsPackage): """libXrandr - X Resize, Rotate and Reflection extension library.""" homepage = "http://cgit.freedesktop.org/xorg/lib/libXrandr" @@ -42,9 +42,3 @@ class Libxrandr(Package): depends_on('renderproto', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libxrender/package.py b/var/spack/repos/builtin/packages/libxrender/package.py index c5a6dac1be2..9c7e657f1dc 100644 --- a/var/spack/repos/builtin/packages/libxrender/package.py +++ b/var/spack/repos/builtin/packages/libxrender/package.py @@ -25,7 +25,7 @@ from spack import * -class Libxrender(Package): +class Libxrender(AutotoolsPackage): """libXrender - library for the Render Extension to the X11 protocol.""" homepage = "http://cgit.freedesktop.org/xorg/lib/libXrender" @@ -38,9 +38,3 @@ class Libxrender(Package): depends_on('renderproto@0.9:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libxres/package.py b/var/spack/repos/builtin/packages/libxres/package.py index 6d0684c4b81..c8a77403466 100644 --- a/var/spack/repos/builtin/packages/libxres/package.py +++ b/var/spack/repos/builtin/packages/libxres/package.py @@ -25,7 +25,7 @@ from spack import * -class Libxres(Package): +class Libxres(AutotoolsPackage): """libXRes - X-Resource extension client library.""" homepage = "http://cgit.freedesktop.org/xorg/lib/libXRes" @@ -40,9 +40,3 @@ class Libxres(Package): depends_on('resourceproto@1.0:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libxscrnsaver/package.py b/var/spack/repos/builtin/packages/libxscrnsaver/package.py index c9ca6ac1c86..14f3aa0f04c 100644 --- a/var/spack/repos/builtin/packages/libxscrnsaver/package.py +++ b/var/spack/repos/builtin/packages/libxscrnsaver/package.py @@ -25,7 +25,7 @@ from spack import * -class Libxscrnsaver(Package): +class Libxscrnsaver(AutotoolsPackage): """XScreenSaver - X11 Screen Saver extension client library""" homepage = "http://cgit.freedesktop.org/xorg/lib/libXScrnSaver" @@ -40,9 +40,3 @@ class Libxscrnsaver(Package): depends_on('scrnsaverproto@1.2:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libxshmfence/package.py b/var/spack/repos/builtin/packages/libxshmfence/package.py index d4f4c852030..63604865bde 100644 --- a/var/spack/repos/builtin/packages/libxshmfence/package.py +++ b/var/spack/repos/builtin/packages/libxshmfence/package.py @@ -25,7 +25,7 @@ from spack import * -class Libxshmfence(Package): +class Libxshmfence(AutotoolsPackage): """libxshmfence - Shared memory 'SyncFence' synchronization primitive. This library offers a CPU-based synchronization primitive compatible @@ -40,10 +40,3 @@ class Libxshmfence(Package): depends_on('xproto', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('check') - make('install') diff --git a/var/spack/repos/builtin/packages/libxt/package.py b/var/spack/repos/builtin/packages/libxt/package.py index c657c866b40..1bab6854d95 100644 --- a/var/spack/repos/builtin/packages/libxt/package.py +++ b/var/spack/repos/builtin/packages/libxt/package.py @@ -25,7 +25,7 @@ from spack import * -class Libxt(Package): +class Libxt(AutotoolsPackage): """libXt - X Toolkit Intrinsics library.""" homepage = "http://cgit.freedesktop.org/xorg/lib/libXt" @@ -41,9 +41,3 @@ class Libxt(Package): depends_on('kbproto', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libxtrap/package.py b/var/spack/repos/builtin/packages/libxtrap/package.py index 4589f98a870..2b22fb1679c 100644 --- a/var/spack/repos/builtin/packages/libxtrap/package.py +++ b/var/spack/repos/builtin/packages/libxtrap/package.py @@ -25,7 +25,7 @@ from spack import * -class Libxtrap(Package): +class Libxtrap(AutotoolsPackage): """libXTrap is the Xlib-based client API for the DEC-XTRAP extension. XTrap was a proposed standard extension for X11R5 which facilitated the @@ -50,9 +50,3 @@ class Libxtrap(Package): depends_on('xextproto', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libxtst/package.py b/var/spack/repos/builtin/packages/libxtst/package.py index 0d16643f94f..aaff481afc4 100644 --- a/var/spack/repos/builtin/packages/libxtst/package.py +++ b/var/spack/repos/builtin/packages/libxtst/package.py @@ -25,7 +25,7 @@ from spack import * -class Libxtst(Package): +class Libxtst(AutotoolsPackage): """libXtst provides the Xlib-based client API for the XTEST & RECORD extensions. @@ -51,9 +51,3 @@ class Libxtst(Package): depends_on('inputproto', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libxv/package.py b/var/spack/repos/builtin/packages/libxv/package.py index 03f10a1842c..2662da86474 100644 --- a/var/spack/repos/builtin/packages/libxv/package.py +++ b/var/spack/repos/builtin/packages/libxv/package.py @@ -25,7 +25,7 @@ from spack import * -class Libxv(Package): +class Libxv(AutotoolsPackage): """libXv - library for the X Video (Xv) extension to the X Window System.""" @@ -41,9 +41,3 @@ class Libxv(Package): depends_on('videoproto', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libxvmc/package.py b/var/spack/repos/builtin/packages/libxvmc/package.py index 9d5695c2c10..8492f660a40 100644 --- a/var/spack/repos/builtin/packages/libxvmc/package.py +++ b/var/spack/repos/builtin/packages/libxvmc/package.py @@ -25,7 +25,7 @@ from spack import * -class Libxvmc(Package): +class Libxvmc(AutotoolsPackage): """X.org libXvMC library.""" homepage = "https://cgit.freedesktop.org/xorg/lib/libXvMC" @@ -41,9 +41,3 @@ class Libxvmc(Package): depends_on('videoproto', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libxxf86dga/package.py b/var/spack/repos/builtin/packages/libxxf86dga/package.py index 292c5d213bd..501a40705fd 100644 --- a/var/spack/repos/builtin/packages/libxxf86dga/package.py +++ b/var/spack/repos/builtin/packages/libxxf86dga/package.py @@ -25,7 +25,7 @@ from spack import * -class Libxxf86dga(Package): +class Libxxf86dga(AutotoolsPackage): """libXxf86dga - Client library for the XFree86-DGA extension.""" homepage = "http://cgit.freedesktop.org/xorg/lib/libXxf86dga" @@ -41,9 +41,3 @@ class Libxxf86dga(Package): depends_on('xf86dgaproto@2.0.99.2:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libxxf86misc/package.py b/var/spack/repos/builtin/packages/libxxf86misc/package.py index 0247f8b57cf..8e6f743183d 100644 --- a/var/spack/repos/builtin/packages/libxxf86misc/package.py +++ b/var/spack/repos/builtin/packages/libxxf86misc/package.py @@ -25,7 +25,7 @@ from spack import * -class Libxxf86misc(Package): +class Libxxf86misc(AutotoolsPackage): """libXxf86misc - Extension library for the XFree86-Misc X extension.""" homepage = "http://cgit.freedesktop.org/xorg/lib/libXxf86misc" @@ -41,9 +41,3 @@ class Libxxf86misc(Package): depends_on('xf86miscproto', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/libxxf86vm/package.py b/var/spack/repos/builtin/packages/libxxf86vm/package.py index feec5ff3d21..6f91c62a2d2 100644 --- a/var/spack/repos/builtin/packages/libxxf86vm/package.py +++ b/var/spack/repos/builtin/packages/libxxf86vm/package.py @@ -25,7 +25,7 @@ from spack import * -class Libxxf86vm(Package): +class Libxxf86vm(AutotoolsPackage): """libXxf86vm - Extension library for the XFree86-VidMode X extension.""" homepage = "http://cgit.freedesktop.org/xorg/lib/libXxf86vm" @@ -41,9 +41,3 @@ class Libxxf86vm(Package): depends_on('xf86vidmodeproto@2.2.99.1:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/listres/package.py b/var/spack/repos/builtin/packages/listres/package.py index c6b3d149f68..3727ddc0b49 100644 --- a/var/spack/repos/builtin/packages/listres/package.py +++ b/var/spack/repos/builtin/packages/listres/package.py @@ -25,7 +25,7 @@ from spack import * -class Listres(Package): +class Listres(AutotoolsPackage): """The listres program generates a list of X resources for a widget in an X client written using a toolkit based on libXt.""" @@ -41,9 +41,3 @@ class Listres(Package): depends_on('xproto', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/lmod/package.py b/var/spack/repos/builtin/packages/lmod/package.py index 9ac270bab5c..01df3c7f24b 100644 --- a/var/spack/repos/builtin/packages/lmod/package.py +++ b/var/spack/repos/builtin/packages/lmod/package.py @@ -26,7 +26,7 @@ from glob import glob -class Lmod(Package): +class Lmod(AutotoolsPackage): """Lmod is a Lua based module system that easily handles the MODULEPATH Hierarchical problem. Environment Modules provide a convenient way to dynamically change the users' environment through modulefiles. This @@ -66,7 +66,3 @@ def patch(self): if self.spec.version <= Version('6.4.3'): for tclscript in glob('src/*.tcl'): filter_file(r'^#!.*tclsh', '#!@path_to_tclsh@', tclscript) - - def install(self, spec, prefix): - configure('--prefix=%s' % prefix) - make('install') diff --git a/var/spack/repos/builtin/packages/lndir/package.py b/var/spack/repos/builtin/packages/lndir/package.py index a7ce892502d..ce3a199fe2a 100644 --- a/var/spack/repos/builtin/packages/lndir/package.py +++ b/var/spack/repos/builtin/packages/lndir/package.py @@ -25,7 +25,7 @@ from spack import * -class Lndir(Package): +class Lndir(AutotoolsPackage): """lndir - create a shadow directory of symbolic links to another directory tree.""" @@ -36,9 +36,3 @@ class Lndir(Package): depends_on('xproto@7.0.17:', type='build') depends_on('pkg-config@0.9.0:', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/lwgrp/package.py b/var/spack/repos/builtin/packages/lwgrp/package.py index 9322d69b9b0..169f7540be8 100644 --- a/var/spack/repos/builtin/packages/lwgrp/package.py +++ b/var/spack/repos/builtin/packages/lwgrp/package.py @@ -25,7 +25,7 @@ from spack import * -class Lwgrp(Package): +class Lwgrp(AutotoolsPackage): """Thie light-weight group library provides process group representations using O(log N) space and time.""" @@ -35,8 +35,3 @@ class Lwgrp(Package): version('1.0.2', 'ab7ba3bdd8534a651da5076f47f27d8a') depends_on('mpi') - - def install(self, spec, prefix): - configure("--prefix=" + prefix) - make() - make("install") diff --git a/var/spack/repos/builtin/packages/lwm2/package.py b/var/spack/repos/builtin/packages/lwm2/package.py index 063204b84a4..03cb6342716 100644 --- a/var/spack/repos/builtin/packages/lwm2/package.py +++ b/var/spack/repos/builtin/packages/lwm2/package.py @@ -25,7 +25,7 @@ from spack import * -class Lwm2(Package): +class Lwm2(AutotoolsPackage): """LWM2: Light Weight Measurement Module. This is a PMPI module that can collect a number of time-sliced MPI and POSIX I/O measurements from a program. @@ -36,8 +36,3 @@ class Lwm2(Package): depends_on("papi") depends_on("mpi") - - def install(self, spec, prefix): - configure("--prefix=%s" % prefix) - make() - make("install") diff --git a/var/spack/repos/builtin/packages/lz4/package.py b/var/spack/repos/builtin/packages/lz4/package.py index de7e566e709..85299419196 100644 --- a/var/spack/repos/builtin/packages/lz4/package.py +++ b/var/spack/repos/builtin/packages/lz4/package.py @@ -31,13 +31,22 @@ class Lz4(Package): an extremely fast decoder, with speed in multiple GB/s per core, typically reaching RAM speed limits on multi-core systems.""" - homepage = "http://cyan4973.github.io/lz4/" - url = "https://github.com/Cyan4973/lz4/archive/r131.tar.gz" + homepage = "http://lz4.github.io/lz4/" + url = "https://github.com/lz4/lz4/archive/v1.7.5.tar.gz" - version('131', '42b09fab42331da9d3fb33bd5c560de9') + version('1.7.5', 'c9610c5ce97eb431dddddf0073d919b9') + version('1.3.1', '42b09fab42331da9d3fb33bd5c560de9') # depends_on('valgrind', type='test') + def url_for_version(self, version): + url = "https://github.com/lz4/lz4/archive" + + if version > Version('1.3.1'): + return "{0}/v{1}.tar.gz".format(url, version) + else: + return "{0}/r{1}.tar.gz".format(url, version.joined) + def install(self, spec, prefix): make() if self.run_tests: diff --git a/var/spack/repos/builtin/packages/m4/package.py b/var/spack/repos/builtin/packages/m4/package.py index ebfbc28612e..128e1c2a41f 100644 --- a/var/spack/repos/builtin/packages/m4/package.py +++ b/var/spack/repos/builtin/packages/m4/package.py @@ -29,8 +29,9 @@ class M4(AutotoolsPackage): """GNU M4 is an implementation of the traditional Unix macro processor.""" homepage = "https://www.gnu.org/software/m4/m4.html" - url = "ftp://ftp.gnu.org/gnu/m4/m4-1.4.17.tar.gz" + url = "https://ftp.gnu.org/gnu/m4/m4-1.4.17.tar.gz" + version('1.4.18', 'a077779db287adf4e12a035029002d28') version('1.4.17', 'a5e9954b1dae036762f7b13673a2cf76') patch('pgi.patch', when='@1.4.17') @@ -40,6 +41,8 @@ class M4(AutotoolsPackage): depends_on('libsigsegv', when='+sigsegv') + build_directory = 'spack-build' + def configure_args(self): spec = self.spec args = ['--enable-c++'] diff --git a/var/spack/repos/builtin/packages/makedepend/package.py b/var/spack/repos/builtin/packages/makedepend/package.py index 5675793abc0..68be988d82f 100644 --- a/var/spack/repos/builtin/packages/makedepend/package.py +++ b/var/spack/repos/builtin/packages/makedepend/package.py @@ -25,7 +25,7 @@ from spack import * -class Makedepend(Package): +class Makedepend(AutotoolsPackage): """makedepend - create dependencies in makefiles.""" homepage = "http://cgit.freedesktop.org/xorg/util/makedepend" @@ -35,10 +35,3 @@ class Makedepend(Package): depends_on('xproto@7.0.17:', type='build') depends_on('pkg-config@0.9.0:', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('check') - make('install') diff --git a/var/spack/repos/builtin/packages/matio/package.py b/var/spack/repos/builtin/packages/matio/package.py index a33b23a4e95..3c48b8f3fc0 100644 --- a/var/spack/repos/builtin/packages/matio/package.py +++ b/var/spack/repos/builtin/packages/matio/package.py @@ -37,6 +37,8 @@ class Matio(AutotoolsPackage): description='support for compressed mat files') variant("hdf5", default=True, description='support for version 7.3 mat files via hdf5') + variant("shared", default=True, description='Enables the build of shared libraries.') + depends_on("zlib", when="+zlib") depends_on("hdf5", when="+hdf5") @@ -47,4 +49,6 @@ def configure_args(self): args.append("--with-zlib=%s" % self.spec['zlib'].prefix) if '+hdf5' in self.spec: args.append("--with-hdf5=%s" % self.spec['hdf5'].prefix) + if '+shared' not in self.spec: + args.append("--disable-shared") return args diff --git a/var/spack/repos/builtin/packages/mesa/package.py b/var/spack/repos/builtin/packages/mesa/package.py index f19bb466fd9..7d6c5596961 100644 --- a/var/spack/repos/builtin/packages/mesa/package.py +++ b/var/spack/repos/builtin/packages/mesa/package.py @@ -25,12 +25,12 @@ from spack import * -class Mesa(Package): +class Mesa(AutotoolsPackage): """Mesa is an open-source implementation of the OpenGL specification - a system for rendering interactive 3D graphics.""" homepage = "http://www.mesa3d.org" - url = "ftp://ftp.freedesktop.org/pub/mesa/12.0.3/mesa-12.0.3.tar.gz" + url = "http://ftp.iij.ad.jp/pub/X11/x.org/pub/mesa/12.0.3/mesa-12.0.3.tar.gz" version('12.0.3', '60c5f9897ddc38b46f8144c7366e84ad') @@ -59,9 +59,3 @@ class Mesa(Package): # TODO: Add package for systemd, provides libudev # Using the system package manager to install systemd didn't work for me - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/metis/package.py b/var/spack/repos/builtin/packages/metis/package.py index b66677288c1..f15d544b7be 100644 --- a/var/spack/repos/builtin/packages/metis/package.py +++ b/var/spack/repos/builtin/packages/metis/package.py @@ -186,6 +186,15 @@ def install(self, spec, prefix): if '+shared' in spec: options.append('-DSHARED:BOOL=ON') + else: + # Remove all RPATH options + # (RPATHxxx options somehow trigger cmake to link dynamically) + rpath_options = [] + for o in options: + if o.find('RPATH') >= 0: + rpath_options.append(o) + for o in rpath_options: + options.remove(o) if '+debug' in spec: options.extend(['-DDEBUG:BOOL=ON', '-DCMAKE_BUILD_TYPE:STRING=Debug']) diff --git a/var/spack/repos/builtin/packages/mkfontdir/package.py b/var/spack/repos/builtin/packages/mkfontdir/package.py index 15c85b24e46..1a43a028a86 100644 --- a/var/spack/repos/builtin/packages/mkfontdir/package.py +++ b/var/spack/repos/builtin/packages/mkfontdir/package.py @@ -25,7 +25,7 @@ from spack import * -class Mkfontdir(Package): +class Mkfontdir(AutotoolsPackage): """mkfontdir creates the fonts.dir files needed by the legacy X server core font system. The current implementation is a simple wrapper script around the mkfontscale program, which must be built and installed first.""" @@ -39,9 +39,3 @@ class Mkfontdir(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/mkfontscale/package.py b/var/spack/repos/builtin/packages/mkfontscale/package.py index 4c907831b68..397ba03a629 100644 --- a/var/spack/repos/builtin/packages/mkfontscale/package.py +++ b/var/spack/repos/builtin/packages/mkfontscale/package.py @@ -25,7 +25,7 @@ from spack import * -class Mkfontscale(Package): +class Mkfontscale(AutotoolsPackage): """mkfontscale creates the fonts.scale and fonts.dir index files used by the legacy X11 font system.""" @@ -40,9 +40,3 @@ class Mkfontscale(Package): depends_on('xproto@7.0.25:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/mpc/package.py b/var/spack/repos/builtin/packages/mpc/package.py index 2fe39009811..39c4f3d8c08 100644 --- a/var/spack/repos/builtin/packages/mpc/package.py +++ b/var/spack/repos/builtin/packages/mpc/package.py @@ -25,12 +25,12 @@ from spack import * -class Mpc(Package): +class Mpc(AutotoolsPackage): """Gnu Mpc is a C library for the arithmetic of complex numbers with arbitrarily high precision and correct rounding of the result.""" homepage = "http://www.multiprecision.org" - url = "ftp://ftp.gnu.org/gnu/mpc/mpc-1.0.2.tar.gz" + url = "https://ftp.gnu.org/gnu/mpc/mpc-1.0.2.tar.gz" version('1.0.3', 'd6a1d5f8ddea3abd2cc3e98f58352d26') version('1.0.2', '68fadff3358fb3e7976c7a398a0af4c3') @@ -40,11 +40,6 @@ class Mpc(Package): def url_for_version(self, version): if version < Version("1.0.1"): - return "http://www.multiprecision.org/mpc/download/mpc-%s.tar.gz" % version # NOQA + return "http://www.multiprecision.org/mpc/download/mpc-%s.tar.gz" % version else: - return "ftp://ftp.gnu.org/gnu/mpc/mpc-%s.tar.gz" % version - - def install(self, spec, prefix): - configure("--prefix=%s" % prefix) - make() - make("install") + return "https://ftp.gnu.org/gnu/mpc/mpc-%s.tar.gz" % version diff --git a/var/spack/repos/builtin/packages/mpe2/package.py b/var/spack/repos/builtin/packages/mpe2/package.py index a129d599497..78201281bb0 100644 --- a/var/spack/repos/builtin/packages/mpe2/package.py +++ b/var/spack/repos/builtin/packages/mpe2/package.py @@ -29,7 +29,7 @@ class Mpe2(Package): """Message Passing Extensions (MPE): Parallel, shared X window graphics""" homepage = "http://www.mcs.anl.gov/research/projects/perfvis/software/MPE/" - url = "ftp://ftp.mcs.anl.gov/pub/mpi/mpe/mpe2-1.3.0.tar.gz" + url = "http://ftp.mcs.anl.gov/pub/mpi/mpe/mpe2-1.3.0.tar.gz" version('1.3.0', '67bf0c7b2e573df3ba0d2059a96c2f7b') diff --git a/var/spack/repos/builtin/packages/mpfr/package.py b/var/spack/repos/builtin/packages/mpfr/package.py index 4612d038499..5dc33b2fb98 100644 --- a/var/spack/repos/builtin/packages/mpfr/package.py +++ b/var/spack/repos/builtin/packages/mpfr/package.py @@ -25,7 +25,7 @@ from spack import * -class Mpfr(Package): +class Mpfr(AutotoolsPackage): """The MPFR library is a C library for multiple-precision floating-point computations with correct rounding.""" homepage = "http://www.mpfr.org" @@ -36,8 +36,3 @@ class Mpfr(Package): version('3.1.2', 'ee2c3ac63bf0c2359bf08fc3ee094c19') depends_on('gmp') # mpir is a drop-in replacement for this - - def install(self, spec, prefix): - configure("--prefix=%s" % prefix) - make() - make("install") diff --git a/var/spack/repos/builtin/packages/mpich/package.py b/var/spack/repos/builtin/packages/mpich/package.py index 958fbe762c3..4c34f3e3a0a 100644 --- a/var/spack/repos/builtin/packages/mpich/package.py +++ b/var/spack/repos/builtin/packages/mpich/package.py @@ -23,7 +23,6 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## from spack import * -import os class Mpich(AutotoolsPackage): @@ -52,10 +51,17 @@ class Mpich(AutotoolsPackage): provides('mpi@:1.3', when='@1:') def setup_dependent_environment(self, spack_env, run_env, dependent_spec): - spack_env.set('MPICC', join_path(self.prefix.bin, 'mpicc')) - spack_env.set('MPICXX', join_path(self.prefix.bin, 'mpic++')) - spack_env.set('MPIF77', join_path(self.prefix.bin, 'mpif77')) - spack_env.set('MPIF90', join_path(self.prefix.bin, 'mpif90')) + # On Cray, the regular compiler wrappers *are* the MPI wrappers. + if 'platform=cray' in self.spec: + spack_env.set('MPICC', spack_cc) + spack_env.set('MPICXX', spack_cxx) + spack_env.set('MPIF77', spack_fc) + spack_env.set('MPIF90', spack_fc) + else: + spack_env.set('MPICC', join_path(self.prefix.bin, 'mpicc')) + spack_env.set('MPICXX', join_path(self.prefix.bin, 'mpic++')) + spack_env.set('MPIF77', join_path(self.prefix.bin, 'mpif77')) + spack_env.set('MPIF90', join_path(self.prefix.bin, 'mpif90')) spack_env.set('MPICH_CC', spack_cc) spack_env.set('MPICH_CXX', spack_cxx) @@ -64,8 +70,7 @@ def setup_dependent_environment(self, spack_env, run_env, dependent_spec): spack_env.set('MPICH_FC', spack_fc) def setup_dependent_package(self, module, dep_spec): - # Is this a Cray machine? (TODO: We need a better test than this.) - if os.environ.get('CRAYPE_VERSION'): + if 'platform=cray' in self.spec: self.spec.mpicc = spack_cc self.spec.mpicxx = spack_cxx self.spec.mpifc = spack_fc @@ -81,7 +86,7 @@ def setup_dependent_package(self, module, dep_spec): join_path(self.prefix.lib, 'libmpi.{0}'.format(dso_suffix)) ] - @AutotoolsPackage.precondition('autoreconf') + @run_before('autoreconf') def die_without_fortran(self): # Until we can pass variants such as +fortran through virtual # dependencies depends_on('mpi'), require Fortran compiler to @@ -101,7 +106,7 @@ def configure_args(self): '--{0}-ibverbs'.format('with' if '+verbs' in spec else 'without') ] - @AutotoolsPackage.sanity_check('install') + @run_after('install') def filter_compilers(self): """Run after install to make the MPI compilers use the compilers that Spack built the package with. diff --git a/var/spack/repos/builtin/packages/mpip/package.py b/var/spack/repos/builtin/packages/mpip/package.py index 78e1dca68ae..235c66c882e 100644 --- a/var/spack/repos/builtin/packages/mpip/package.py +++ b/var/spack/repos/builtin/packages/mpip/package.py @@ -26,7 +26,7 @@ import os -class Mpip(Package): +class Mpip(AutotoolsPackage): """mpiP: Lightweight, Scalable MPI Profiling""" homepage = "http://mpip.sourceforge.net/" url = "http://downloads.sourceforge.net/project/mpip/mpiP/mpiP-3.4.1/mpiP-3.4.1.tar.gz" @@ -38,7 +38,5 @@ class Mpip(Package): depends_on('libunwind', when=os.uname()[4] == "x86_64", type="build") depends_on("mpi", type="build") - def install(self, spec, prefix): - configure("--prefix=" + prefix, "--without-f77") - make() - make("install") + def configure_args(self): + return ['--without-f77'] diff --git a/var/spack/repos/builtin/packages/mrnet/package.py b/var/spack/repos/builtin/packages/mrnet/package.py index 9da9e29a2e9..81938827f1f 100644 --- a/var/spack/repos/builtin/packages/mrnet/package.py +++ b/var/spack/repos/builtin/packages/mrnet/package.py @@ -25,10 +25,10 @@ from spack import * -class Mrnet(Package): +class Mrnet(AutotoolsPackage): """The MRNet Multi-Cast Reduction Network.""" homepage = "http://paradyn.org/mrnet" - url = "ftp://ftp.cs.wisc.edu/paradyn/mrnet/mrnet_5.0.1.tar.gz" + url = "http://ftp.cs.wisc.edu/pub/paradyn/mrnet/mrnet_5.0.1.tar.gz" list_url = "http://ftp.cs.wisc.edu/paradyn/mrnet" version('5.0.1-2', git='https://github.com/dyninst/mrnet.git', @@ -43,14 +43,13 @@ class Mrnet(Package): depends_on("boost") - def install(self, spec, prefix): + def configure_args(self): + spec = self.spec + config_args = ['--enable-shared'] + # Build the MRNet LW thread safe libraries when the # lwthreads variant is present if '+lwthreads' in spec: - configure("--prefix=%s" % prefix, "--enable-shared", - "--enable-ltwt-threadsafe") - else: - configure("--prefix=%s" % prefix, "--enable-shared") + config_args.append('--enable-ltwt-threadsafe') - make() - make("install") + return config_args diff --git a/var/spack/repos/builtin/packages/mumps/package.py b/var/spack/repos/builtin/packages/mumps/package.py index 82d0c606b68..1d87d6f35a3 100644 --- a/var/spack/repos/builtin/packages/mumps/package.py +++ b/var/spack/repos/builtin/packages/mumps/package.py @@ -81,7 +81,7 @@ def write_makefile_inc(self): lapack_blas = (self.spec['lapack'].lapack_libs + self.spec['blas'].blas_libs) - makefile_conf = ["LIBBLAS = %s" % lapack_blas.joined()] + makefile_conf = ["LIBBLAS = %s" % lapack_blas.ld_flags] orderings = ['-Dpord'] diff --git a/var/spack/repos/builtin/packages/mxml/package.py b/var/spack/repos/builtin/packages/mxml/package.py index 29e3b27d6ea..bae1984bde8 100644 --- a/var/spack/repos/builtin/packages/mxml/package.py +++ b/var/spack/repos/builtin/packages/mxml/package.py @@ -25,7 +25,7 @@ from spack import * -class Mxml(Package): +class Mxml(AutotoolsPackage): """Mini-XML is a small XML library that you can use to read and write XML and XML-like data files in your application without requiring large non-standard libraries. @@ -44,7 +44,5 @@ class Mxml(Package): # (Can use whatever compiler you want to use) # Case statement to change CC and CXX flags - def install(self, spec, prefix): - configure('--prefix=%s' % prefix, "--disable-shared", 'CFLAGS=-static') - make() - make("install") + def configure_args(self): + return ['--disable-shared', 'CFLAGS=-static'] diff --git a/var/spack/repos/builtin/packages/nano/package.py b/var/spack/repos/builtin/packages/nano/package.py index 3e87ec8ffe8..d303b5e4243 100644 --- a/var/spack/repos/builtin/packages/nano/package.py +++ b/var/spack/repos/builtin/packages/nano/package.py @@ -25,7 +25,7 @@ from spack import * -class Nano(Package): +class Nano(AutotoolsPackage): """Tiny little text editor""" homepage = "http://www.nano-editor.org" @@ -33,8 +33,3 @@ class Nano(Package): version('2.6.3', '1213c7f17916e65afefc95054c1f90f9') version('2.6.2', '58568a4b8a33841d774c25f285fc11c1') - - def install(self, spec, prefix): - configure("--prefix=%s" % prefix) - make() - make('install') diff --git a/var/spack/repos/builtin/packages/nasm/package.py b/var/spack/repos/builtin/packages/nasm/package.py index 9faccccaaea..979d002b4cf 100644 --- a/var/spack/repos/builtin/packages/nasm/package.py +++ b/var/spack/repos/builtin/packages/nasm/package.py @@ -25,15 +25,10 @@ from spack import * -class Nasm(Package): +class Nasm(AutotoolsPackage): """NASM (Netwide Assembler) is an 80x86 assembler designed for portability and modularity. It includes a disassembler as well.""" homepage = "http://www.nasm.us" url = "http://www.nasm.us/pub/nasm/releasebuilds/2.11.06/nasm-2.11.06.tar.xz" version('2.11.06', '2b958e9f5d200641e6fc9564977aecc5') - - def install(self, spec, prefix): - configure("--prefix=%s" % prefix) - make() - make("install") diff --git a/var/spack/repos/builtin/packages/ncview/package.py b/var/spack/repos/builtin/packages/ncview/package.py index 5c3cf300d2d..6f83aa9139e 100644 --- a/var/spack/repos/builtin/packages/ncview/package.py +++ b/var/spack/repos/builtin/packages/ncview/package.py @@ -25,10 +25,10 @@ from spack import * -class Ncview(Package): +class Ncview(AutotoolsPackage): """Simple viewer for NetCDF files.""" homepage = "http://meteora.ucsd.edu/~pierce/ncview_home_page.html" - url = "ftp://cirrus.ucsd.edu/pub/ncview/ncview-2.1.7.tar.gz" + url = "https://fossies.org/linux/misc/ncview-2.1.7.tar.gz" version('2.1.7', 'debd6ca61410aac3514e53122ab2ba07') @@ -36,9 +36,3 @@ class Ncview(Package): depends_on('udunits2') depends_on('libpng') depends_on('libxaw') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/netcdf-cxx4/package.py b/var/spack/repos/builtin/packages/netcdf-cxx4/package.py index 2da30c7b0c0..36ab8766b92 100644 --- a/var/spack/repos/builtin/packages/netcdf-cxx4/package.py +++ b/var/spack/repos/builtin/packages/netcdf-cxx4/package.py @@ -34,8 +34,9 @@ class NetcdfCxx4(AutotoolsPackage): version('4.2.1', 'd019853802092cf686254aaba165fc81') depends_on('netcdf') - depends_on('autoconf', type='build') - def autoreconf(self, spec, prefix): - # Rebuild to prevent problems of inconsistency in git repo - which('autoreconf')('-ivf') + depends_on('automake', type='build') + depends_on('autoconf', type='build') + depends_on('libtool', type='build') + + force_autoreconf = True diff --git a/var/spack/repos/builtin/packages/netcdf/package.py b/var/spack/repos/builtin/packages/netcdf/package.py index 79a1be2090d..34d3bd41c6f 100644 --- a/var/spack/repos/builtin/packages/netcdf/package.py +++ b/var/spack/repos/builtin/packages/netcdf/package.py @@ -31,8 +31,9 @@ class Netcdf(AutotoolsPackage): and sharing of array-oriented scientific data.""" homepage = "http://www.unidata.ucar.edu/software/netcdf" - url = "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4.3.3.tar.gz" + url = "http://www.gfd-dennou.org/arch/netcdf/unidata-mirror/netcdf-4.3.3.tar.gz" + version('4.4.1.1', '503a2d6b6035d116ed53b1d80c811bda') version('4.4.1', '7843e35b661c99e1d49e60791d5072d8') version('4.4.0', 'cffda0cbd97fdb3a06e9274f7aef438e') version('4.3.3.1', '5c9dad3705a3408d27f696e5b31fb88c') diff --git a/var/spack/repos/builtin/packages/netgauge/package.py b/var/spack/repos/builtin/packages/netgauge/package.py index b57cdbe5f37..e7e669410ba 100644 --- a/var/spack/repos/builtin/packages/netgauge/package.py +++ b/var/spack/repos/builtin/packages/netgauge/package.py @@ -25,7 +25,7 @@ from spack import * -class Netgauge(Package): +class Netgauge(AutotoolsPackage): """Netgauge is a high-precision network parameter measurement tool. It supports benchmarking of many different network protocols and communication patterns. The main focus lies on accuracy, @@ -37,8 +37,3 @@ class Netgauge(Package): version('2.4.6', 'e0e040ec6452e93ca21ccc54deac1d7f') depends_on("mpi") - - def install(self, spec, prefix): - configure("--prefix=%s" % prefix) - make() - make("install") diff --git a/var/spack/repos/builtin/packages/nettle/package.py b/var/spack/repos/builtin/packages/nettle/package.py index 7e2b758bc01..6112dc6507e 100644 --- a/var/spack/repos/builtin/packages/nettle/package.py +++ b/var/spack/repos/builtin/packages/nettle/package.py @@ -25,7 +25,7 @@ from spack import * -class Nettle(Package): +class Nettle(AutotoolsPackage): """The Nettle package contains the low-level cryptographic library that is designed to fit easily in many contexts.""" @@ -37,11 +37,3 @@ class Nettle(Package): depends_on('gmp') depends_on('m4', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - if self.run_tests: - make('check') - make('install') diff --git a/var/spack/repos/builtin/packages/npm/package.py b/var/spack/repos/builtin/packages/npm/package.py index 7910a8af9ba..500674d1d8f 100644 --- a/var/spack/repos/builtin/packages/npm/package.py +++ b/var/spack/repos/builtin/packages/npm/package.py @@ -26,7 +26,7 @@ from spack import * -class Npm(Package): +class Npm(AutotoolsPackage): """npm: A package manager for javascript.""" homepage = "https://github.com/npm/npm" @@ -37,18 +37,10 @@ class Npm(Package): version('3.10.5', '46002413f4a71de9b0da5b506bf1d992') depends_on('node-js') - + def setup_dependent_environment(self, spack_env, run_env, dependent_spec): npm_config_cache_dir = "%s/npm-cache" % dependent_spec.prefix if not os.path.isdir(npm_config_cache_dir): mkdir(npm_config_cache_dir) run_env.set('npm_config_cache', npm_config_cache_dir) spack_env.set('npm_config_cache', npm_config_cache_dir) - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - if self.run_tests: - make('test') - - make('install') diff --git a/var/spack/repos/builtin/packages/ocaml/package.py b/var/spack/repos/builtin/packages/ocaml/package.py index 9488d3b7a62..855e2d7b3bc 100644 --- a/var/spack/repos/builtin/packages/ocaml/package.py +++ b/var/spack/repos/builtin/packages/ocaml/package.py @@ -25,7 +25,7 @@ from spack import * -class Ocaml(Package): +class Ocaml(AutotoolsPackage): """OCaml is an industrial strength programming language supporting functional, imperative and object-oriented styles""" @@ -36,8 +36,4 @@ class Ocaml(Package): depends_on('ncurses') - def install(self, spec, prefix): - configure('-prefix', '{0}'.format(prefix)) - - make('world.opt') - make('install') + build_targets = ['world.opt'] diff --git a/var/spack/repos/builtin/packages/oce/package.py b/var/spack/repos/builtin/packages/oce/package.py index 2d518d83c34..c3488c137af 100644 --- a/var/spack/repos/builtin/packages/oce/package.py +++ b/var/spack/repos/builtin/packages/oce/package.py @@ -32,8 +32,8 @@ class Oce(Package): Open CASCADE library. """ homepage = "https://github.com/tpaviot/oce" - url = "https://github.com/tpaviot/oce/archive/OCE-0.17.tar.gz" + version('0.18', '226e45e77c16a4a6e127c71fefcd171410703960ae75c7ecc7eb68895446a993') version('0.17.2', 'bf2226be4cd192606af677cf178088e5') version('0.17.1', '36c67b87093c675698b483454258af91') version('0.17', 'f1a89395c4b0d199bea3db62b85f818d') @@ -46,6 +46,10 @@ class Oce(Package): depends_on('cmake@2.8:', type='build') depends_on('tbb', when='+tbb') + def url_for_version(self, version): + return 'https://github.com/tpaviot/oce/archive/OCE-%s.tar.gz' % ( + version.dotted) + # There is a bug in OCE which appears with Clang (version?) or GCC 6.0 # and has to do with compiler optimization, see # https://github.com/tpaviot/oce/issues/576 @@ -56,8 +60,9 @@ class Oce(Package): # fix build with Xcode 8 "previous definition of CLOCK_REALTIME" # reported 27 Sep 2016 https://github.com/tpaviot/oce/issues/643 - if (platform.system() == "Darwin") and (platform.mac_ver()[0] == '10.12'): - patch('sierra.patch') + if (platform.system() == "Darwin") and ( + '.'.join(platform.mac_ver()[0].split('.')[:2]) == '10.12'): + patch('sierra.patch', when='@0.17.2:0.18') def install(self, spec, prefix): options = [] @@ -85,8 +90,13 @@ def install(self, spec, prefix): '-DOCE_OSX_USE_COCOA:BOOL=ON', ]) - options.append('-DCMAKE_INSTALL_NAME_DIR:PATH=%s/lib' % prefix) + if '.'.join(platform.mac_ver()[0].split('.')[:2]) == '10.12': + # use @rpath on Sierra due to limit of dynamic loader + options.append('-DCMAKE_MACOSX_RPATH=ON') + else: + options.append('-DCMAKE_INSTALL_NAME_DIR:PATH=%s/lib' % prefix) cmake('.', *options) make("install/strip") - make("test") + if self.run_tests: + make("test") diff --git a/var/spack/repos/builtin/packages/oce/sierra.patch b/var/spack/repos/builtin/packages/oce/sierra.patch index 8db3af5e37c..1c0c86569bf 100644 --- a/var/spack/repos/builtin/packages/oce/sierra.patch +++ b/var/spack/repos/builtin/packages/oce/sierra.patch @@ -1,45 +1,12 @@ -diff --git a/adm/cmake/TKernel/CMakeLists.txt b/adm/cmake/TKernel/CMakeLists.txt -index 54e241e..72873c6 100644 ---- a/adm/cmake/TKernel/CMakeLists.txt -+++ b/adm/cmake/TKernel/CMakeLists.txt -@@ -29,7 +29,7 @@ if(WIN32) - set(TOOLKIT_LIBS ${TOOLKIT_LIBS} ${CSF_SOCKETLibs_LIB} ${CSF_advapi32_LIB} ${CSF_gdi32_LIB} ${CSF_user32_LIB} ${CSF_kernel32_LIB} ${CSF_psapi_LIB}) - else(WIN32) - #  An implementation for Mac OS X has been added in src/OSD/gettime_osx.h -- if(NOT APPLE) -+ if(APPLE) - include( CheckFunctionExists ) - check_function_exists( clock_gettime CLOCK_GETTIME_IN_LIBC ) - if(NOT CLOCK_GETTIME_IN_LIBC) -@@ -40,7 +40,7 @@ else(WIN32) - endif(NOT CLOCK_GETTIME_IN_LIBRT) - set(TOOLKIT_LIBS ${TOOLKIT_LIBS} rt) - endif(NOT CLOCK_GETTIME_IN_LIBC) -- endif(NOT APPLE) -+ endif(APPLE) - endif(WIN32) - - # Adde-DHAVE_TBB in TKernel in order to benefit from Standard_MMgrTBBalloc -@@ -70,4 +70,3 @@ if (OCE_BUILD_TKERNEL_WITH_INSTALL_RPATH) - set_target_properties_install_rpath(${TOOLKIT} "${OCE_INSTALL_LIB_DIR_RPATH};${OCE_INSTALL_PACKAGE_LIB_DIR_RPATH}") - set_target_properties(${TOOLKIT} PROPERTIES BUILD_WITH_INSTALL_RPATH ON) - endif () -- diff --git a/src/OSD/OSD_Chronometer.cxx b/src/OSD/OSD_Chronometer.cxx -index 444f844..25970d0 100644 ---- a/src/OSD/OSD_Chronometer.cxx +index f7374fb..63ac140 100644 +--- a/src/OSD/OSD_Chronometer.cxx.old +++ b/src/OSD/OSD_Chronometer.cxx @@ -51,7 +51,7 @@ #include #endif -#if defined(__APPLE__) && defined(__MACH__) -+#if defined(__OOOOPPLE__) && defined(__MACH__) ++#if defined(__APPLE__) && !defined(__MAC_10_12) #include "gettime_osx.h" #endif - -@@ -283,4 +283,3 @@ void OSD_Chronometer::Show (Standard_Real& user, - system = Cumul_sys; - if (!StopSav) Start(); - } -- diff --git a/var/spack/repos/builtin/packages/oclock/package.py b/var/spack/repos/builtin/packages/oclock/package.py index 84da93c36ec..ec656b23f12 100644 --- a/var/spack/repos/builtin/packages/oclock/package.py +++ b/var/spack/repos/builtin/packages/oclock/package.py @@ -25,7 +25,7 @@ from spack import * -class Oclock(Package): +class Oclock(AutotoolsPackage): """oclock is a simple analog clock using the SHAPE extension to make a round (possibly transparent) window.""" @@ -42,9 +42,3 @@ class Oclock(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/octave/package.py b/var/spack/repos/builtin/packages/octave/package.py index df144c8bbbd..ed8d28ebdad 100644 --- a/var/spack/repos/builtin/packages/octave/package.py +++ b/var/spack/repos/builtin/packages/octave/package.py @@ -26,7 +26,7 @@ import sys -class Octave(Package): +class Octave(AutotoolsPackage): """GNU Octave is a high-level language, primarily intended for numerical computations. It provides a convenient command line interface for solving linear and nonlinear problems numerically, and for performing other @@ -34,10 +34,11 @@ class Octave(Package): Matlab. It may also be used as a batch-oriented language.""" homepage = "https://www.gnu.org/software/octave/" - url = "ftp://ftp.gnu.org/gnu/octave/octave-4.0.0.tar.gz" + url = "https://ftp.gnu.org/gnu/octave/octave-4.0.0.tar.gz" extendable = True + version('4.2.0', '443ba73782f3531c94bcf016f2f0362a58e186ddb8269af7dcce973562795567') version('4.0.2', 'c2a5cacc6e4c52f924739cdf22c2c687') version('4.0.0', 'a69f8320a4f20a8480c1b278b1adb799') @@ -97,15 +98,18 @@ class Octave(Package): depends_on('suite-sparse', when='+suitesparse') depends_on('zlib', when='+zlib') - def install(self, spec, prefix): - config_args = [ - "--prefix=%s" % prefix - ] + def configure_args(self): + # See + # https://github.com/macports/macports-ports/blob/master/math/octave/ + # https://github.com/Homebrew/homebrew-science/blob/master/octave.rb + + spec = self.spec + config_args = [] # Required dependencies config_args.extend([ - "--with-blas=%s" % spec['blas'].prefix.lib, - "--with-lapack=%s" % spec['lapack'].prefix.lib + "--with-blas=%s" % spec['blas'].blas_libs.ld_flags, + "--with-lapack=%s" % spec['lapack'].lapack_libs.ld_flags ]) # Strongly recommended dependencies @@ -210,10 +214,7 @@ def install(self, spec, prefix): else: config_args.append("--without-z") - configure(*config_args) - - make() - make("install") + return config_args # ======================================================================== # Set up environment to make install easy for Octave extensions. diff --git a/var/spack/repos/builtin/packages/openblas/package.py b/var/spack/repos/builtin/packages/openblas/package.py index d5a70f077b5..327031b87e9 100644 --- a/var/spack/repos/builtin/packages/openblas/package.py +++ b/var/spack/repos/builtin/packages/openblas/package.py @@ -68,7 +68,7 @@ def blas_libs(self): def lapack_libs(self): return self.blas_libs - @MakefilePackage.precondition('edit') + @run_before('edit') def check_compilers(self): # As of 06/2016 there is no mechanism to specify that packages which # depends on Blas/Lapack need C or/and Fortran symbols. For now @@ -126,7 +126,7 @@ def build_targets(self): return self.make_defs + targets - @MakefilePackage.sanity_check('build') + @run_after('build') def check_build(self): make('tests', *self.make_defs) @@ -138,7 +138,7 @@ def install_targets(self): ] return make_args + self.make_defs - @MakefilePackage.sanity_check('install') + @run_after('install') def check_install(self): spec = self.spec # Openblas may pass its own test but still fail to compile Lapack diff --git a/var/spack/repos/builtin/packages/openmpi/fix_multidef_pmi_class.patch b/var/spack/repos/builtin/packages/openmpi/fix_multidef_pmi_class.patch new file mode 100644 index 00000000000..28ebd9aeca9 --- /dev/null +++ b/var/spack/repos/builtin/packages/openmpi/fix_multidef_pmi_class.patch @@ -0,0 +1,54 @@ +diff -Naur openmpi-2.0.1.orig/opal/mca/pmix/cray/pmix_cray.c openmpi-2.0.1/opal/mca/pmix/cray/pmix_cray.c +--- openmpi-2.0.1.orig/opal/mca/pmix/cray/pmix_cray.c 2016-08-23 04:56:37.000000000 +0800 ++++ openmpi-2.0.1/opal/mca/pmix/cray/pmix_cray.c 2017-01-31 01:05:34.302807465 +0800 +@@ -6,7 +6,7 @@ + * Copyright (c) 2011-2015 Los Alamos National Security, LLC. All + * rights reserved. + * Copyright (c) 2013-2015 Intel, Inc. All rights reserved. +- * Copyright (c) 2014-2015 Research Organization for Information Science ++ * Copyright (c) 2014-2016 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * $COPYRIGHT$ + * +@@ -127,7 +127,7 @@ + opal_pmix_op_cbfunc_t opcbfunc; + void *cbdata; + } pmi_opcaddy_t; +-OBJ_CLASS_INSTANCE(pmi_opcaddy_t, ++static OBJ_CLASS_INSTANCE(pmi_opcaddy_t, + opal_object_t, + NULL, NULL); + +diff -Naur openmpi-2.0.1.orig/opal/mca/pmix/s1/pmix_s1.c openmpi-2.0.1/opal/mca/pmix/s1/pmix_s1.c +--- openmpi-2.0.1.orig/opal/mca/pmix/s1/pmix_s1.c 2016-08-23 04:56:37.000000000 +0800 ++++ openmpi-2.0.1/opal/mca/pmix/s1/pmix_s1.c 2017-01-31 01:06:08.014808847 +0800 +@@ -1,7 +1,7 @@ + /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ + /* + * Copyright (c) 2014-2015 Intel, Inc. All rights reserved. +- * Copyright (c) 2014-2015 Research Organization for Information Science ++ * Copyright (c) 2014-2016 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * $COPYRIGHT$ + * +@@ -88,7 +88,7 @@ + opal_pmix_op_cbfunc_t opcbfunc; + void *cbdata; + } pmi_opcaddy_t; +-OBJ_CLASS_INSTANCE(pmi_opcaddy_t, ++static OBJ_CLASS_INSTANCE(pmi_opcaddy_t, + opal_object_t, + NULL, NULL); + +diff -Naur openmpi-2.0.1.orig/opal/mca/pmix/s2/pmix_s2.c openmpi-2.0.1/opal/mca/pmix/s2/pmix_s2.c +--- openmpi-2.0.1.orig/opal/mca/pmix/s2/pmix_s2.c 2016-08-23 04:56:37.000000000 +0800 ++++ openmpi-2.0.1/opal/mca/pmix/s2/pmix_s2.c 2017-01-31 01:06:27.718809655 +0800 +@@ -95,7 +95,7 @@ + opal_pmix_op_cbfunc_t opcbfunc; + void *cbdata; + } pmi_opcaddy_t; +-OBJ_CLASS_INSTANCE(pmi_opcaddy_t, ++static OBJ_CLASS_INSTANCE(pmi_opcaddy_t, + opal_object_t, + NULL, NULL); + diff --git a/var/spack/repos/builtin/packages/openmpi/package.py b/var/spack/repos/builtin/packages/openmpi/package.py index 754cc8d93e0..3740923cf09 100644 --- a/var/spack/repos/builtin/packages/openmpi/package.py +++ b/var/spack/repos/builtin/packages/openmpi/package.py @@ -39,6 +39,9 @@ def _verbs_dir(): # Remove executable name and "bin" directory path = os.path.dirname(path) path = os.path.dirname(path) + # There's usually no "/include" on Unix; use "/usr/include" instead + if path == "/": + path = "/usr" return path except: return None @@ -72,6 +75,7 @@ class Openmpi(AutotoolsPackage): patch('ad_lustre_rwcontig_open_source.patch', when="@1.6.5") patch('llnl-platforms.patch', when="@1.6.5") patch('configure.patch', when="@1.10.0:1.10.1") + patch('fix_multidef_pmi_class.patch', when="@2.0.0:2.0.1") # Fabrics variant('psm', default=False, description='Build support for the PSM library') @@ -142,7 +146,7 @@ def verbs(self): elif self.spec.satisfies('@1.7:'): return 'verbs' - @AutotoolsPackage.precondition('autoreconf') + @run_before('autoreconf') def die_without_fortran(self): # Until we can pass variants such as +fortran through virtual # dependencies depends_on('mpi'), require Fortran compiler to @@ -236,7 +240,7 @@ def configure_args(self): return config_args - @AutotoolsPackage.sanity_check('install') + @run_after('install') def filter_compilers(self): """Run after install to make the MPI compilers use the compilers that Spack built the package with. diff --git a/var/spack/repos/builtin/packages/openssl/package.py b/var/spack/repos/builtin/packages/openssl/package.py index 12b5ed9c522..f74a4203561 100644 --- a/var/spack/repos/builtin/packages/openssl/package.py +++ b/var/spack/repos/builtin/packages/openssl/package.py @@ -28,14 +28,22 @@ class Openssl(Package): - """The OpenSSL Project is a collaborative effort to develop a - robust, commercial-grade, full-featured, and Open Source - toolkit implementing the Secure Sockets Layer (SSL v2/v3) and - Transport Layer Security (TLS v1) protocols as well as a - full-strength general purpose cryptography library.""" + """OpenSSL is an open source project that provides a robust, + commercial-grade, and full-featured toolkit for the Transport + Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. + It is also a general-purpose cryptography library.""" homepage = "http://www.openssl.org" - url = "ftp://openssl.org/source/openssl-1.0.1h.tar.gz" + url = "http://www.openssl.org/source/openssl-1.0.1h.tar.gz" + list_url = "https://www.openssl.org/source/old/" + list_depth = 2 + # Note: Version 1.0.2 is the "long-term support" version that will + # remain supported until 2019. We could thus make this version the + # preferred version, if we find that many packages cannot handle + # version 1.1. + version('1.1.0d', '711ce3cd5f53a99c0e12a7d5804f0f63') + version('1.1.0c', '601e8191f72b18192a937ecf1a800f3f') + version('1.0.2k', 'f965fc0bf01bf882b31314b61391ae65') version('1.0.2j', '96322138f0b69e61b7212bc53d5e912b') version('1.0.2i', '678374e63f8df456a697d3e5e5a931fb') version('1.0.2h', '9392e65072ce4b614c1392eefc1f23d0') @@ -48,7 +56,11 @@ class Openssl(Package): version('1.0.1r', '1abd905e079542ccae948af37e393d28') version('1.0.1h', '8d6d684a9430d5cc98a62a5d8fbda8cf') - depends_on("zlib") + depends_on('zlib') + + # 'make test' requires Test::More version 0.96 + depends_on('perl@5.14.0:', type='build') + parallel = False def handle_fetch_error(self, error): @@ -67,7 +79,9 @@ def install(self, spec, prefix): # where it happens automatically?) env['KERNEL_BITS'] = '64' - options = ['zlib', 'no-krb5', 'shared'] + options = ['zlib', 'shared'] + if spec.satisfies('@1.0'): + options.append('no-krb5') config = Executable('./config') config('--prefix=%s' % prefix, @@ -80,4 +94,6 @@ def install(self, spec, prefix): filter_file(r'-arch x86_64', '', 'Makefile') make() + if self.run_tests: + make('test') # 'VERBOSE=1' make('install') diff --git a/var/spack/repos/builtin/packages/p4est/package.py b/var/spack/repos/builtin/packages/p4est/package.py index da58f5a7e7d..ef3f2f54d19 100644 --- a/var/spack/repos/builtin/packages/p4est/package.py +++ b/var/spack/repos/builtin/packages/p4est/package.py @@ -25,12 +25,13 @@ from spack import * -class P4est(Package): +class P4est(AutotoolsPackage): """Dynamic management of a collection (a forest) of adaptive octrees in parallel""" homepage = "http://www.p4est.org" url = "http://p4est.github.io/release/p4est-1.1.tar.gz" + version('2.0', 'c522c5b69896aab39aa5a81399372a19a6b03fc6200d2d5d677d9a22fe31029a') version('1.1', '37ba7f4410958cfb38a2140339dbf64f') # build dependencies @@ -42,8 +43,8 @@ class P4est(Package): depends_on('mpi') depends_on('zlib') - def install(self, spec, prefix): - options = [ + def configure_args(self): + return [ '--enable-mpi', '--enable-shared', '--disable-vtk-binary', @@ -55,10 +56,3 @@ def install(self, spec, prefix): 'FC=%s' % self.spec['mpi'].mpifc, 'F77=%s' % self.spec['mpi'].mpif77 ] - - configure('--prefix=%s' % prefix, *options) - - make() - if self.run_tests: - make("check") - make("install") diff --git a/var/spack/repos/builtin/packages/pango/package.py b/var/spack/repos/builtin/packages/pango/package.py index c45054be581..0f082527b96 100644 --- a/var/spack/repos/builtin/packages/pango/package.py +++ b/var/spack/repos/builtin/packages/pango/package.py @@ -25,7 +25,7 @@ from spack import * -class Pango(Package): +class Pango(AutotoolsPackage): """Pango is a library for laying out and rendering of text, with an emphasis on internationalization. It can be used anywhere that text layout is needed, though most of the work on Pango so @@ -49,6 +49,4 @@ class Pango(Package): depends_on("glib") def install(self, spec, prefix): - configure("--prefix=%s" % prefix) - make() make("install", parallel=False) diff --git a/var/spack/repos/builtin/packages/papi/package.py b/var/spack/repos/builtin/packages/papi/package.py index 90a7490e753..115f1604b77 100644 --- a/var/spack/repos/builtin/packages/papi/package.py +++ b/var/spack/repos/builtin/packages/papi/package.py @@ -41,6 +41,7 @@ class Papi(Package): homepage = "http://icl.cs.utk.edu/papi/index.html" url = "http://icl.cs.utk.edu/projects/papi/downloads/papi-5.4.1.tar.gz" + version('5.5.1', '86a8a6f3d0f34cd83251da3514aae15d') version('5.5.0', '5e1244a04ca031d4cc29b46ce3dd05b5') version('5.4.3', '3211b5a5bb389fe692370f5cf4cc2412') version('5.4.1', '9134a99219c79767a11463a76b0b01a2') diff --git a/var/spack/repos/builtin/packages/parallel-netcdf/package.py b/var/spack/repos/builtin/packages/parallel-netcdf/package.py index 65512017ef6..0563bd06867 100644 --- a/var/spack/repos/builtin/packages/parallel-netcdf/package.py +++ b/var/spack/repos/builtin/packages/parallel-netcdf/package.py @@ -32,7 +32,9 @@ class ParallelNetcdf(AutotoolsPackage): homepage = "https://trac.mcs.anl.gov/projects/parallel-netcdf" url = "http://cucis.ece.northwestern.edu/projects/PnetCDF/Release/parallel-netcdf-1.6.1.tar.gz" + list_url = "http://cucis.ece.northwestern.edu/projects/PnetCDF/download.html" + version('1.8.0', '825825481aa629eb82f21ca37afff1609b8eeb07') version('1.7.0', '267eab7b6f9dc78c4d0e6def2def3aea4bc7c9f0') version('1.6.1', '62a094eb952f9d1e15f07d56e535052604f1ac34') diff --git a/var/spack/repos/builtin/packages/parallel/package.py b/var/spack/repos/builtin/packages/parallel/package.py index 81c01956512..4297e8acb01 100644 --- a/var/spack/repos/builtin/packages/parallel/package.py +++ b/var/spack/repos/builtin/packages/parallel/package.py @@ -25,7 +25,7 @@ from spack import * -class Parallel(Package): +class Parallel(AutotoolsPackage): """GNU parallel is a shell tool for executing jobs in parallel using one or more computers. A job can be a single command or a small script that has to be run for each of the lines in the input. @@ -36,9 +36,3 @@ class Parallel(Package): version('20160422', '24621f684130472694333709bd4454cb') version('20160322', '4e81e0d36902ab4c4e969ee6f35e6e57') - - def install(self, spec, prefix): - configure('--prefix=%s' % prefix) - - make() - make("install") diff --git a/var/spack/repos/builtin/packages/parmetis/package.py b/var/spack/repos/builtin/packages/parmetis/package.py index 74e00cc9e01..0e6cd5390a0 100644 --- a/var/spack/repos/builtin/packages/parmetis/package.py +++ b/var/spack/repos/builtin/packages/parmetis/package.py @@ -71,6 +71,16 @@ def install(self, spec, prefix): if '+shared' in spec: options.append('-DSHARED:BOOL=ON') + else: + # Remove all RPATH options + # (RPATHxxx options somehow trigger cmake to link dynamically) + rpath_options = [] + for o in options: + if o.find('RPATH') >= 0: + rpath_options.append(o) + for o in rpath_options: + options.remove(o) + if '+debug' in spec: options.extend(['-DDEBUG:BOOL=ON', '-DCMAKE_BUILD_TYPE:STRING=Debug']) diff --git a/var/spack/repos/builtin/packages/patchelf/package.py b/var/spack/repos/builtin/packages/patchelf/package.py index c391f491ebb..1d429361b69 100644 --- a/var/spack/repos/builtin/packages/patchelf/package.py +++ b/var/spack/repos/builtin/packages/patchelf/package.py @@ -25,7 +25,7 @@ from spack import * -class Patchelf(Package): +class Patchelf(AutotoolsPackage): """PatchELF is a small utility to modify the dynamic linker and RPATH of ELF executables.""" @@ -37,8 +37,3 @@ class Patchelf(Package): version('0.9', '3c265508526760f233620f35d79c79fc') version('0.8', '407b229e6a681ffb0e2cdd5915cb2d01') - - def install(self, spec, prefix): - configure('--prefix=%s' % prefix) - make() - make("install") diff --git a/var/spack/repos/builtin/packages/pcre/package.py b/var/spack/repos/builtin/packages/pcre/package.py index a2236e682b0..f1a106f8d79 100644 --- a/var/spack/repos/builtin/packages/pcre/package.py +++ b/var/spack/repos/builtin/packages/pcre/package.py @@ -30,7 +30,7 @@ class Pcre(Package): libraries. These are useful for implementing regular expression pattern matching using the same syntax and semantics as Perl 5.""" homepage = "http://www.pcre.org""" - url = "ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.36.tar.bz2" + url = "https://ftp.pcre.org/pub/pcre/pcre-8.36.tar.bz2" version('8.39', 'e3fca7650a0556a2647821679d81f585') version('8.38', '00aabbfe56d5a48b270f999b508c5ad2') diff --git a/var/spack/repos/builtin/packages/pcre2/package.py b/var/spack/repos/builtin/packages/pcre2/package.py index a2739e05844..5fb582cab0c 100644 --- a/var/spack/repos/builtin/packages/pcre2/package.py +++ b/var/spack/repos/builtin/packages/pcre2/package.py @@ -25,16 +25,11 @@ from spack import * -class Pcre2(Package): +class Pcre2(AutotoolsPackage): """The PCRE2 package contains Perl Compatible Regular Expression libraries. These are useful for implementing regular expression pattern matching using the same syntax and semantics as Perl 5.""" homepage = "http://www.pcre.org""" - url = "ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre2-10.20.tar.bz2" + url = "https://ftp.pcre.org/pub/pcre/pcre2-10.20.tar.bz2" version('10.20', 'dcd027c57ecfdc8a6c3af9d0acf5e3f7') - - def install(self, spec, prefix): - configure("--prefix=%s" % prefix) - make() - make("install") diff --git a/var/spack/repos/builtin/packages/pdt/package.py b/var/spack/repos/builtin/packages/pdt/package.py index bed01aeefb8..081c32c861d 100644 --- a/var/spack/repos/builtin/packages/pdt/package.py +++ b/var/spack/repos/builtin/packages/pdt/package.py @@ -25,7 +25,7 @@ from spack import * -class Pdt(Package): +class Pdt(AutotoolsPackage): """Program Database Toolkit (PDT) is a framework for analyzing source code written in several programming languages and for making rich program knowledge accessible to developers of static and dynamic @@ -43,8 +43,3 @@ class Pdt(Package): version('3.20', 'c3edabe202926abe04552e33cd39672d') version('3.19', '5c5e1e6607086aa13bf4b1b9befc5864') version('3.18.1', 'e401534f5c476c3e77f05b7f73b6c4f2') - - def install(self, spec, prefix): - configure('-prefix=%s' % prefix) - make() - make('install') diff --git a/var/spack/repos/builtin/packages/pflotran/package.py b/var/spack/repos/builtin/packages/pflotran/package.py index 347f792453e..fc706930410 100644 --- a/var/spack/repos/builtin/packages/pflotran/package.py +++ b/var/spack/repos/builtin/packages/pflotran/package.py @@ -38,7 +38,7 @@ class Pflotran(AutotoolsPackage): commmit='4734cf5e606b') depends_on('mpi') - depends_on('hdf5@1.8.12+mpi+fortran') + depends_on('hdf5@1.8.12:+mpi+fortran') depends_on('petsc@develop+hdf5+metis',when='@develop') depends_on('petsc@for-pflotran-0.1.0+hdf5+metis',when='@0.1.0') diff --git a/var/spack/repos/builtin/packages/plumed/package.py b/var/spack/repos/builtin/packages/plumed/package.py index 60dfdf74055..69949b0017d 100644 --- a/var/spack/repos/builtin/packages/plumed/package.py +++ b/var/spack/repos/builtin/packages/plumed/package.py @@ -27,7 +27,7 @@ from spack import * -class Plumed(Package): +class Plumed(AutotoolsPackage): """PLUMED is an open source library for free energy calculations in molecular systems which works together with some of the most popular molecular dynamics engines. @@ -67,6 +67,8 @@ class Plumed(Package): depends_on('gsl', when='+gsl') depends_on('autoconf', type='build') + depends_on('automake', type='build') + depends_on('libtool', type='build') # Dictionary mapping PLUMED versions to the patches it provides # interactively @@ -84,6 +86,8 @@ class Plumed(Package): } } + force_autoreconf = True + def apply_patch(self, other): plumed = subprocess.Popen( [join_path(self.spec.prefix.bin, 'plumed'), 'patch', '-p'], @@ -99,12 +103,15 @@ def setup_dependent_package(self, module, ext_spec): # Make plumed visible from dependent packages module.plumed = Executable(join_path(self.spec.prefix.bin, 'plumed')) - def install(self, spec, prefix): + @run_before('autoreconf') + def filter_gslcblas(self): # This part is needed to avoid linking with gsl cblas # interface which will mask the cblas interface # provided by optimized libraries due to linking order filter_file('-lgslcblas', '', 'configure.ac') - autoreconf('-ivf') + + def configure_args(self): + spec = self.spec # From plumed docs : # Also consider that this is different with respect to what some other @@ -114,8 +121,7 @@ def install(self, spec, prefix): # with MPI you should use: # # > ./configure CXX="$MPICXX" - configure_opts = ['--prefix=' + prefix] - + configure_opts = [] # If using MPI then ensure the correct compiler wrapper is used. if '+mpi' in spec: configure_opts.extend([ @@ -153,6 +159,4 @@ def install(self, spec, prefix): configure_opts.extend([ '--enable-modules={0}'.format("".join(module_opts))]) - configure(*configure_opts) - make() - make('install') + return configure_opts diff --git a/var/spack/repos/builtin/packages/presentproto/package.py b/var/spack/repos/builtin/packages/presentproto/package.py index ca145abb6b1..32560ade65c 100644 --- a/var/spack/repos/builtin/packages/presentproto/package.py +++ b/var/spack/repos/builtin/packages/presentproto/package.py @@ -25,7 +25,7 @@ from spack import * -class Presentproto(Package): +class Presentproto(AutotoolsPackage): """Present protocol specification and Xlib/Xserver headers.""" homepage = "https://cgit.freedesktop.org/xorg/proto/presentproto/" @@ -35,8 +35,3 @@ class Presentproto(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make('install') diff --git a/var/spack/repos/builtin/packages/printproto/package.py b/var/spack/repos/builtin/packages/printproto/package.py index 151924dd490..0f905c3172f 100644 --- a/var/spack/repos/builtin/packages/printproto/package.py +++ b/var/spack/repos/builtin/packages/printproto/package.py @@ -25,7 +25,7 @@ from spack import * -class Printproto(Package): +class Printproto(AutotoolsPackage): """Xprint extension to the X11 protocol - a portable, network-transparent printing system.""" @@ -36,8 +36,3 @@ class Printproto(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make('install') diff --git a/var/spack/repos/builtin/packages/proj/package.py b/var/spack/repos/builtin/packages/proj/package.py index 06ab6108b63..3008baa690e 100644 --- a/var/spack/repos/builtin/packages/proj/package.py +++ b/var/spack/repos/builtin/packages/proj/package.py @@ -25,7 +25,7 @@ from spack import * -class Proj(Package): +class Proj(AutotoolsPackage): """Cartographic Projections""" homepage = "https://github.com/OSGeo/proj.4/wiki" url = "http://download.osgeo.org/proj/proj-4.9.2.tar.gz" @@ -35,11 +35,3 @@ class Proj(Package): version('4.8.0', 'd815838c92a29179298c126effbb1537') version('4.7.0', '927d34623b52e0209ba2bfcca18fe8cd') version('4.6.1', '7dbaab8431ad50c25669fd3fb28dc493') - - # No dependencies - - def install(self, spec, prefix): - configure('--prefix=%s' % prefix) - - make() - make("install") diff --git a/var/spack/repos/builtin/packages/protobuf/package.py b/var/spack/repos/builtin/packages/protobuf/package.py index bf0073b16a8..6faa0376ada 100644 --- a/var/spack/repos/builtin/packages/protobuf/package.py +++ b/var/spack/repos/builtin/packages/protobuf/package.py @@ -25,16 +25,10 @@ from spack import * -class Protobuf(Package): +class Protobuf(AutotoolsPackage): """Google's data interchange format.""" homepage = "https://developers.google.com/protocol-buffers" url = "https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.bz2" version('2.5.0', 'a72001a9067a4c2c4e0e836d0f92ece4') - - def install(self, spec, prefix): - configure("--prefix=" + prefix) - make() - make("check") - make("install") diff --git a/var/spack/repos/builtin/packages/proxymngr/package.py b/var/spack/repos/builtin/packages/proxymngr/package.py index 896f4a516b7..896f2d00b74 100644 --- a/var/spack/repos/builtin/packages/proxymngr/package.py +++ b/var/spack/repos/builtin/packages/proxymngr/package.py @@ -25,7 +25,7 @@ from spack import * -class Proxymngr(Package): +class Proxymngr(AutotoolsPackage): """The proxy manager (proxymngr) is responsible for resolving requests from xfindproxy (and other similar clients), starting new proxies when appropriate, and keeping track of all of the available proxy services. @@ -44,9 +44,3 @@ class Proxymngr(Package): depends_on('xproxymanagementprotocol', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/py-3to2/package.py b/var/spack/repos/builtin/packages/py-3to2/package.py index d0b6857aafb..80b95fcbfd3 100644 --- a/var/spack/repos/builtin/packages/py-3to2/package.py +++ b/var/spack/repos/builtin/packages/py-3to2/package.py @@ -25,7 +25,7 @@ from spack import * -class Py3to2(Package): +class Py3to2(PythonPackage): """lib3to2 is a set of fixers that are intended to backport code written for Python version 3.x into Python version 2.x.""" @@ -33,8 +33,3 @@ class Py3to2(Package): url = "https://pypi.python.org/packages/source/3/3to2/3to2-1.1.1.zip" version('1.1.1', 'cbeed28e350dbdaef86111ace3052824') - - extends('python') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-alabaster/package.py b/var/spack/repos/builtin/packages/py-alabaster/package.py index 24cb5dce226..f2402c9bc63 100644 --- a/var/spack/repos/builtin/packages/py-alabaster/package.py +++ b/var/spack/repos/builtin/packages/py-alabaster/package.py @@ -25,7 +25,7 @@ from spack import * -class PyAlabaster(Package): +class PyAlabaster(PythonPackage): """Alabaster is a visually (c)lean, responsive, configurable theme for the Sphinx documentation system.""" @@ -35,9 +35,4 @@ class PyAlabaster(Package): version('0.7.9', 'b29646a8bbe7aa52830375b7d17b5d7a', url="https://pypi.python.org/packages/71/c3/70da7d8ac18a4f4c502887bd2549e05745fa403e2cd9d06a8a9910a762bc/alabaster-0.7.9.tar.gz") - extends('python') - depends_on('py-setuptools', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-argcomplete/package.py b/var/spack/repos/builtin/packages/py-argcomplete/package.py index fe948f80612..585540f23bf 100644 --- a/var/spack/repos/builtin/packages/py-argcomplete/package.py +++ b/var/spack/repos/builtin/packages/py-argcomplete/package.py @@ -25,7 +25,7 @@ from spack import * -class PyArgcomplete(Package): +class PyArgcomplete(PythonPackage): """Bash tab completion for argparse.""" homepage = "https://pypi.python.org/pypi/argcomplete" @@ -34,7 +34,3 @@ class PyArgcomplete(Package): version('1.1.1', '89a3839096c9f991ad33828e72d21abf') depends_on('py-setuptools', type='build') - extends('python') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-astroid/package.py b/var/spack/repos/builtin/packages/py-astroid/package.py index a42d936f054..f275813d86c 100644 --- a/var/spack/repos/builtin/packages/py-astroid/package.py +++ b/var/spack/repos/builtin/packages/py-astroid/package.py @@ -22,11 +22,10 @@ # License along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## -from spack import depends_on, extends, version -from spack import Package +from spack import * -class PyAstroid(Package): +class PyAstroid(PythonPackage): homepage = "https://www.astroid.org/" url = "https://github.com/PyCQA/astroid/archive/astroid-1.4.5.tar.gz" @@ -36,10 +35,6 @@ class PyAstroid(Package): version('1.4.2', '677f7965840f375af51b0e86403bee6a') version('1.4.1', 'ed70bfed5e4b25be4292e7fe72da2c02') - extends('python') depends_on('py-logilab-common', type=('build', 'run')) depends_on('py-setuptools', type='build') depends_on('py-six', type=('build', 'run')) - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-astropy/package.py b/var/spack/repos/builtin/packages/py-astropy/package.py index 193add18ef4..8688e0ee7ea 100644 --- a/var/spack/repos/builtin/packages/py-astropy/package.py +++ b/var/spack/repos/builtin/packages/py-astropy/package.py @@ -25,7 +25,7 @@ from spack import * -class PyAstropy(Package): +class PyAstropy(PythonPackage): """The Astropy Project is a community effort to develop a single core package for Astronomy in Python and foster interoperability between Python astronomy packages.""" @@ -37,7 +37,6 @@ class PyAstropy(Package): version('1.1.post1', 'b52919f657a37d45cc45f5cb0f58c44d') # Required dependencies - extends('python') depends_on('py-numpy', type=('build', 'run')) # Optional dependencies @@ -55,6 +54,5 @@ class PyAstropy(Package): depends_on('cfitsio') depends_on('expat') - def install(self, spec, prefix): - setup_py('build', '--use-system-cfitsio', '--use-system-expat') - setup_py('install', '--prefix={0}'.format(prefix)) + def build_args(self, spec, prefix): + return ['--use-system-cfitsio', '--use-system-expat'] diff --git a/var/spack/repos/builtin/packages/py-autopep8/package.py b/var/spack/repos/builtin/packages/py-autopep8/package.py index 629a3b515ee..c892e2979ca 100644 --- a/var/spack/repos/builtin/packages/py-autopep8/package.py +++ b/var/spack/repos/builtin/packages/py-autopep8/package.py @@ -25,7 +25,7 @@ from spack import * -class PyAutopep8(Package): +class PyAutopep8(PythonPackage): """autopep8 automatically formats Python code to conform to the PEP 8 style guide.""" @@ -48,6 +48,3 @@ def url_for_version(self, version): return url.format('v', version) else: return url.format('ver', version) - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-babel/package.py b/var/spack/repos/builtin/packages/py-babel/package.py index 12d7ff84b6c..844ceab34ea 100644 --- a/var/spack/repos/builtin/packages/py-babel/package.py +++ b/var/spack/repos/builtin/packages/py-babel/package.py @@ -25,7 +25,7 @@ from spack import * -class PyBabel(Package): +class PyBabel(PythonPackage): """Babel is an integrated collection of utilities that assist in internationalizing and localizing Python applications, with an emphasis on web-based applications.""" @@ -36,10 +36,5 @@ class PyBabel(Package): version('2.3.4', 'afa20bc55b0e991833030129ad498f35', url="https://pypi.python.org/packages/6e/96/ba2a2462ed25ca0e651fb7b66e7080f5315f91425a07ea5b34d7c870c114/Babel-2.3.4.tar.gz") - extends('python') - depends_on('py-setuptools', type='build') depends_on('py-pytz', type=('build', 'run')) - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-backports-abc/package.py b/var/spack/repos/builtin/packages/py-backports-abc/package.py index d39cec83c89..7d062bff6ae 100644 --- a/var/spack/repos/builtin/packages/py-backports-abc/package.py +++ b/var/spack/repos/builtin/packages/py-backports-abc/package.py @@ -25,17 +25,12 @@ from spack import * -class PyBackportsAbc(Package): +class PyBackportsAbc(PythonPackage): """Backports_ABC: A backport of recent additions to the 'collections.abc' module.""" homepage = "https://github.com/cython/backports_abc" - # base https://pypi.python.org/pypi/backports_abc/ url = "https://github.com/cython/backports_abc/archive/0.4.tar.gz" version('0.4', 'e4246ae689221c9cbe84369fdb59e8c74d02b298') - extends('python') depends_on('py-setuptools', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-backports-shutil-get-terminal-size/package.py b/var/spack/repos/builtin/packages/py-backports-shutil-get-terminal-size/package.py index 5158fa3ad4a..5950faa765a 100644 --- a/var/spack/repos/builtin/packages/py-backports-shutil-get-terminal-size/package.py +++ b/var/spack/repos/builtin/packages/py-backports-shutil-get-terminal-size/package.py @@ -25,8 +25,8 @@ from spack import * -class PyBackportsShutilGetTerminalSize(Package): - """A backport of the get_terminal_size function +class PyBackportsShutilGetTerminalSize(PythonPackage): + """A backport of the get_terminal_size function from Python 3.3's shutil.""" homepage = "https://pypi.python.org/pypi/backports.shutil_get_terminal_size" @@ -34,10 +34,5 @@ class PyBackportsShutilGetTerminalSize(Package): version('1.0.0', '03267762480bd86b50580dc19dff3c66') - extends('python') - depends_on('py-setuptools', type='build') depends_on('python@:3.2.999') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-backports-ssl-match-hostname/package.py b/var/spack/repos/builtin/packages/py-backports-ssl-match-hostname/package.py index 13b3a1abd48..bf4679556b2 100644 --- a/var/spack/repos/builtin/packages/py-backports-ssl-match-hostname/package.py +++ b/var/spack/repos/builtin/packages/py-backports-ssl-match-hostname/package.py @@ -25,7 +25,7 @@ from spack import * -class PyBackportsSslMatchHostname(Package): +class PyBackportsSslMatchHostname(PythonPackage): """The ssl.match_hostname() function from Python 3.5""" homepage = "https://pypi.python.org/pypi/backports.ssl_match_hostname" @@ -33,9 +33,4 @@ class PyBackportsSslMatchHostname(Package): version('3.5.0.1', 'c03fc5e2c7b3da46b81acf5cbacfe1e6') - extends('python') - depends_on('py-setuptools', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-basemap/package.py b/var/spack/repos/builtin/packages/py-basemap/package.py index d69051037b5..d2934eb3c77 100644 --- a/var/spack/repos/builtin/packages/py-basemap/package.py +++ b/var/spack/repos/builtin/packages/py-basemap/package.py @@ -26,7 +26,7 @@ import os -class PyBasemap(Package): +class PyBasemap(PythonPackage): """The matplotlib basemap toolkit is a library for plotting 2D data on maps in Python.""" @@ -35,17 +35,18 @@ class PyBasemap(Package): version('1.0.7', '48c0557ced9e2c6e440b28b3caff2de8') - extends('python') depends_on('py-setuptools', type='build') depends_on('py-numpy', type=('build', 'run')) depends_on('py-matplotlib', type=('build', 'run')) depends_on('pil', type=('build', 'run')) - depends_on("geos") + depends_on('geos') - def install(self, spec, prefix): - env['GEOS_DIR'] = spec['geos'].prefix - setup_py('install', '--prefix=%s' % prefix) + def setup_environment(self, spack_env, run_env): + spack_env.set('GEOS_DIR', self.spec['geos'].prefix) + @run_after('install') + def post_install_patch(self): + spec = self.spec # We are not sure if this fix is needed before Python 3.5.2. # If it is needed, this test should be changed. # See: https://github.com/LLNL/spack/pull/1964 diff --git a/var/spack/repos/builtin/packages/py-beautifulsoup4/package.py b/var/spack/repos/builtin/packages/py-beautifulsoup4/package.py index 5f8b6369856..3a90d02127d 100644 --- a/var/spack/repos/builtin/packages/py-beautifulsoup4/package.py +++ b/var/spack/repos/builtin/packages/py-beautifulsoup4/package.py @@ -25,7 +25,7 @@ from spack import * -class PyBeautifulsoup4(Package): +class PyBeautifulsoup4(PythonPackage): """Beautiful Soup is a Python library for pulling data out of HTML and XML files. It works with your favorite parser to provide idiomatic ways of navigating, searching, and modifying the parse tree.""" @@ -38,9 +38,4 @@ class PyBeautifulsoup4(Package): 'download/4.5/beautifulsoup4-4.5.1.tar.gz') version('4.4.1', '8fbd9a7cac0704645fa20d1419036815') - extends('python') - depends_on('py-setuptools', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-biopython/package.py b/var/spack/repos/builtin/packages/py-biopython/package.py index 83ede166d6c..3411e244f9c 100644 --- a/var/spack/repos/builtin/packages/py-biopython/package.py +++ b/var/spack/repos/builtin/packages/py-biopython/package.py @@ -25,7 +25,7 @@ from spack import * -class PyBiopython(Package): +class PyBiopython(PythonPackage): """A distributed collaborative effort to develop Python libraries and applications which address the needs of current and future work in bioinformatics. @@ -36,9 +36,5 @@ class PyBiopython(Package): version('1.65', '143e7861ade85c0a8b5e2bbdd1da1f67') - extends('python') depends_on('py-mx', type=('build', 'run')) depends_on('py-numpy', type=('build', 'run')) - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-bleach/package.py b/var/spack/repos/builtin/packages/py-bleach/package.py new file mode 100644 index 00000000000..4a6d7ed9d2f --- /dev/null +++ b/var/spack/repos/builtin/packages/py-bleach/package.py @@ -0,0 +1,39 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# 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/llnl/spack +# Please also see the LICENSE file 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 +############################################################################## +from spack import * + + +class PyBleach(PythonPackage): + """An easy whitelist-based HTML-sanitizing tool.""" + + homepage = "http://github.com/mozilla/bleach" + url = "https://pypi.python.org/packages/99/00/25a8fce4de102bf6e3cc76bc4ea60685b2fee33bde1b34830c70cacc26a7/bleach-1.5.0.tar.gz" + + version('1.5.0', 'b663300efdf421b3b727b19d7be9c7e7') + + depends_on('python@2.6:2.7,3.2:3.5') + depends_on('py-setuptools', type='build') + depends_on('py-six', type=('build', 'run')) + depends_on('py-html5lib@0.999,0.999999:0.9999999', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-blessings/package.py b/var/spack/repos/builtin/packages/py-blessings/package.py index 700c0ff4b30..b38f34b4123 100644 --- a/var/spack/repos/builtin/packages/py-blessings/package.py +++ b/var/spack/repos/builtin/packages/py-blessings/package.py @@ -25,7 +25,7 @@ from spack import * -class PyBlessings(Package): +class PyBlessings(PythonPackage): """A nicer, kinder way to write to the terminal """ homepage = "https://github.com/erikrose/blessings" url = "https://pypi.python.org/packages/source/b/blessings/blessings-1.6.tar.gz" @@ -33,8 +33,3 @@ class PyBlessings(Package): version('1.6', '4f552a8ebcd4982693c92571beb99394') depends_on('py-setuptools', type='build') - - extends("python") - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-bottleneck/package.py b/var/spack/repos/builtin/packages/py-bottleneck/package.py index d2d258105d0..a1215ce39e0 100644 --- a/var/spack/repos/builtin/packages/py-bottleneck/package.py +++ b/var/spack/repos/builtin/packages/py-bottleneck/package.py @@ -25,15 +25,11 @@ from spack import * -class PyBottleneck(Package): +class PyBottleneck(PythonPackage): """A collection of fast NumPy array functions written in Cython.""" homepage = "https://pypi.python.org/pypi/Bottleneck/1.0.0" url = "https://pypi.python.org/packages/source/B/Bottleneck/Bottleneck-1.0.0.tar.gz" version('1.0.0', '380fa6f275bd24f27e7cf0e0d752f5d2') - extends('python') depends_on('py-numpy', type=('build', 'run')) - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-cclib/package.py b/var/spack/repos/builtin/packages/py-cclib/package.py index f06a8cbc371..b59376d7b8b 100644 --- a/var/spack/repos/builtin/packages/py-cclib/package.py +++ b/var/spack/repos/builtin/packages/py-cclib/package.py @@ -25,18 +25,13 @@ from spack import * -class PyCclib(Package): +class PyCclib(PythonPackage): """Open source library for parsing and interpreting the results of computational chemistry packages""" homepage = "https://cclib.github.io/" - url = "https://github.com/cclib/cclib/releases/download/v1.5/cclib-1.5.tar.gz" - version('1.5', 'c06940101c4796bce82036b13fecb73c') - - extends('python') + version('1.5.post1', '1a50be48e4597b1a6dabe943da82a43c', + url="https://github.com/cclib/cclib/releases/download/v1.5/cclib-1.5.post1.tar.gz") depends_on('py-numpy@1.5:', type=('build', 'run')) - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-cdo/package.py b/var/spack/repos/builtin/packages/py-cdo/package.py index c74a3f7c335..5eb8f414a86 100644 --- a/var/spack/repos/builtin/packages/py-cdo/package.py +++ b/var/spack/repos/builtin/packages/py-cdo/package.py @@ -25,7 +25,7 @@ from spack import * -class PyCdo(Package): +class PyCdo(PythonPackage): """The cdo package provides an interface to the Climate Data Operators from Python.""" @@ -35,13 +35,8 @@ class PyCdo(Package): version('1.3.2', '4b3686ec1b9b891f166c1c466c6db745', url="https://pypi.python.org/packages/d6/13/908e7c1451e1f5fb68405f341cdcb3196a16952ebfe1f172cb788f864aa9/cdo-1.3.2.tar.gz") - extends('python') - depends_on('cdo') depends_on('py-setuptools', type='build') depends_on('py-scipy', type=('build', 'run')) - depends_on('py-netcdf', type=('build', 'run')) - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) + depends_on('py-netcdf', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-certifi/package.py b/var/spack/repos/builtin/packages/py-certifi/package.py index 996a90df8ed..959c0221edf 100644 --- a/var/spack/repos/builtin/packages/py-certifi/package.py +++ b/var/spack/repos/builtin/packages/py-certifi/package.py @@ -25,18 +25,13 @@ from spack import * -class PyCertifi(Package): +class PyCertifi(PythonPackage): """Certifi: A carefully curated collection of Root Certificates for validating the trustworthiness of SSL certificates while verifying the identity of TLS hosts.""" homepage = "https://github.com/certifi/python-certifi" - # base https://pypi.python.org/pypi/certifi/ url = "https://github.com/certifi/python-certifi/archive/2016.02.28.tar.gz" version('2016.02.28', '5ccfc23bd5e931863f0b01ef3e9d2dbd3bef0e1b') - extends('python') depends_on('py-setuptools', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-cffi/package.py b/var/spack/repos/builtin/packages/py-cffi/package.py index f2f76466876..c0fbae639be 100644 --- a/var/spack/repos/builtin/packages/py-cffi/package.py +++ b/var/spack/repos/builtin/packages/py-cffi/package.py @@ -22,12 +22,10 @@ # License along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## -import os - from spack import * -class PyCffi(Package): +class PyCffi(PythonPackage): """Foreign Function Interface for Python calling C code""" homepage = "http://cffi.readthedocs.org/en/latest/" # base https://pypi.python.org/pypi/cffi @@ -35,18 +33,15 @@ class PyCffi(Package): version('1.1.2', 'ca6e6c45b45caa87aee9adc7c796eaea') - extends('python') depends_on('py-setuptools', type='build') depends_on('py-pycparser', type=('build', 'run')) depends_on('libffi') - def install(self, spec, prefix): + def setup_environment(self, spack_env, run_env): # This sets the compiler (and flags) that distutils will use # to create the final shared library. It will use the # compiler specified by the environment variable 'CC' for all # other compilation. We are setting the 'LDSHARED" to the # spack compiler wrapper plus a few extra flags necessary for # building the shared library. - os.environ['LDSHARED'] = "{0} -shared -pthread".format(spack_cc) - - setup_py('install', '--prefix=%s' % prefix) + spack_env.set('LDSHARED', "{0} -shared -pthread".format(spack_cc)) diff --git a/var/spack/repos/builtin/packages/py-configparser/package.py b/var/spack/repos/builtin/packages/py-configparser/package.py index 6885d6bd935..c9ba7ac15cc 100644 --- a/var/spack/repos/builtin/packages/py-configparser/package.py +++ b/var/spack/repos/builtin/packages/py-configparser/package.py @@ -25,7 +25,7 @@ from spack import * -class PyConfigparser(Package): +class PyConfigparser(PythonPackage): """This library brings the updated configparser from Python 3.5 to Python 2.6-3.5.""" @@ -35,12 +35,10 @@ class PyConfigparser(Package): version('3.5.0', 'cfdd915a5b7a6c09917a64a573140538', url="https://pypi.python.org/packages/7c/69/c2ce7e91c89dc073eb1aa74c0621c3eefbffe8216b3f9af9d3885265c01c/configparser-3.5.0.tar.gz") - extends('python') depends_on('python@2.6:2.7,3.4:') - depends_on('py-ordereddict', when='^python@2.6:2.6.999', type=('build', 'run')) + # This dependency breaks concretization + # See https://github.com/LLNL/spack/issues/2793 + # depends_on('py-ordereddict', when='^python@2.6:2.6.999', type=('build', 'run')) # noqa depends_on('py-setuptools', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-coverage/package.py b/var/spack/repos/builtin/packages/py-coverage/package.py index 8cd8440b7e1..dc8fc08e24b 100644 --- a/var/spack/repos/builtin/packages/py-coverage/package.py +++ b/var/spack/repos/builtin/packages/py-coverage/package.py @@ -25,7 +25,7 @@ from spack import * -class PyCoverage(Package): +class PyCoverage(PythonPackage): """ Testing coverage checker for python """ homepage = "http://nedbatchelder.com/code/coverage/" @@ -34,8 +34,3 @@ class PyCoverage(Package): version('4.0a6', '1bb4058062646148965bef0796b61efc') depends_on('py-setuptools', type='build') - - extends('python') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-csvkit/package.py b/var/spack/repos/builtin/packages/py-csvkit/package.py index ceb220eef74..5bcda9f4491 100644 --- a/var/spack/repos/builtin/packages/py-csvkit/package.py +++ b/var/spack/repos/builtin/packages/py-csvkit/package.py @@ -25,7 +25,7 @@ from spack import * -class PyCsvkit(Package): +class PyCsvkit(PythonPackage): """A library of utilities for working with CSV, the king of tabular file formats""" @@ -34,14 +34,9 @@ class PyCsvkit(Package): version('0.9.1', '48d78920019d18846933ee969502fff6') - extends('python') - depends_on('py-dateutil', type=('build', 'run')) depends_on('py-dbf', type=('build', 'run')) depends_on('py-xlrd', type=('build', 'run')) depends_on('py-sqlalchemy', type=('build', 'run')) depends_on('py-six', type=('build', 'run')) depends_on('py-openpyxl', type=('build', 'run')) - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-cycler/package.py b/var/spack/repos/builtin/packages/py-cycler/package.py index dff307cddda..f2b2a150185 100644 --- a/var/spack/repos/builtin/packages/py-cycler/package.py +++ b/var/spack/repos/builtin/packages/py-cycler/package.py @@ -25,7 +25,7 @@ from spack import * -class PyCycler(Package): +class PyCycler(PythonPackage): """Composable style cycles.""" homepage = "http://matplotlib.org/cycler/" @@ -33,10 +33,5 @@ class PyCycler(Package): version('0.10.0', '83dd0df7810e838b59e4dd9fa6e2d198') - extends('python') - depends_on('py-setuptools', type='build') depends_on('py-six', type=('build', 'run')) - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-cython/package.py b/var/spack/repos/builtin/packages/py-cython/package.py index 55a4ef9ced3..c84728cf3ea 100644 --- a/var/spack/repos/builtin/packages/py-cython/package.py +++ b/var/spack/repos/builtin/packages/py-cython/package.py @@ -25,21 +25,16 @@ from spack import * -class PyCython(Package): +class PyCython(PythonPackage): """The Cython compiler for writing C extensions for the Python language.""" homepage = "https://pypi.python.org/pypi/cython" url = "https://pypi.io/packages/source/c/cython/Cython-0.25.2.tar.gz" version('0.25.2', '642c81285e1bb833b14ab3f439964086') - + version('0.23.5', '66b62989a67c55af016c916da36e7514') version('0.23.4', '157df1f69bcec6b56fd97e0f2e057f6e') # These versions contain illegal Python3 code... version('0.22', '1ae25add4ef7b63ee9b4af697300d6b6') version('0.21.2', 'd21adb870c75680dc857cd05d41046a4') - - extends('python') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-dask/package.py b/var/spack/repos/builtin/packages/py-dask/package.py index c72046b6278..4113c2ac0bb 100644 --- a/var/spack/repos/builtin/packages/py-dask/package.py +++ b/var/spack/repos/builtin/packages/py-dask/package.py @@ -25,16 +25,11 @@ from spack import * -class PyDask(Package): +class PyDask(PythonPackage): """Minimal task scheduling abstraction""" homepage = "https://github.com/dask/dask/" url = "https://pypi.python.org/packages/source/d/dask/dask-0.8.1.tar.gz" version('0.8.1', '5dd8e3a3823b3bc62c9a6d192e2cb5b4') - extends('python') - depends_on('py-setuptools', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-dateutil/package.py b/var/spack/repos/builtin/packages/py-dateutil/package.py index c9e77b3b086..3ab5ad029c4 100644 --- a/var/spack/repos/builtin/packages/py-dateutil/package.py +++ b/var/spack/repos/builtin/packages/py-dateutil/package.py @@ -25,7 +25,7 @@ from spack import * -class PyDateutil(Package): +class PyDateutil(PythonPackage): """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" @@ -34,9 +34,5 @@ class PyDateutil(Package): version('2.4.2', '4ef68e1c485b09e9f034e10473e5add2') version('2.5.2', 'eafe168e8f404bf384514f5116eedbb6') - extends('python') depends_on('py-setuptools', type='build') depends_on('py-six', type=('build', 'run')) - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-dbf/package.py b/var/spack/repos/builtin/packages/py-dbf/package.py index eff893cc828..56403405e8e 100644 --- a/var/spack/repos/builtin/packages/py-dbf/package.py +++ b/var/spack/repos/builtin/packages/py-dbf/package.py @@ -25,7 +25,7 @@ from spack import * -class PyDbf(Package): +class PyDbf(PythonPackage): """Pure python package for reading/writing dBase, FoxPro, and Visual FoxPro .dbf files (including memos)""" @@ -33,8 +33,3 @@ class PyDbf(Package): url = "https://pypi.python.org/packages/source/d/dbf/dbf-0.96.005.tar.gz" version('0.96.005', 'bce1a1ed8b454a30606e7e18dd2f8277') - - extends('python') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-decorator/package.py b/var/spack/repos/builtin/packages/py-decorator/package.py index 30f764edc38..e5734866ec4 100644 --- a/var/spack/repos/builtin/packages/py-decorator/package.py +++ b/var/spack/repos/builtin/packages/py-decorator/package.py @@ -25,7 +25,7 @@ from spack import * -class PyDecorator(Package): +class PyDecorator(PythonPackage): """The aim of the decorator module it to simplify the usage of decorators for the average programmer, and to popularize decorators by showing various non-trivial examples.""" @@ -34,9 +34,4 @@ class PyDecorator(Package): version('4.0.9', 'f12c5651ccd707e12a0abaa4f76cd69a') - extends('python') - depends_on('py-setuptools', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-docutils/package.py b/var/spack/repos/builtin/packages/py-docutils/package.py index 114131df902..00741284df0 100644 --- a/var/spack/repos/builtin/packages/py-docutils/package.py +++ b/var/spack/repos/builtin/packages/py-docutils/package.py @@ -25,7 +25,7 @@ from spack import * -class PyDocutils(Package): +class PyDocutils(PythonPackage): """Docutils is an open-source text processing system for processing plaintext documentation into useful formats, such as HTML, LaTeX, man-pages, open-document or XML. It includes reStructuredText, the @@ -35,9 +35,6 @@ class PyDocutils(Package): homepage = "http://docutils.sourceforge.net/" url = "https://pypi.python.org/packages/source/d/docutils/docutils-0.12.tar.gz" - version('0.12', '4622263b62c5c771c03502afa3157768') - - extends('python') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) + version('0.13.1', 'ea4a893c633c788be9b8078b6b305d53', + url="https://pypi.python.org/packages/05/25/7b5484aca5d46915493f1fd4ecb63c38c333bd32aa9ad6e19da8d08895ae/docutils-0.13.1.tar.gz") + version('0.12', '4622263b62c5c771c03502afa3157768') diff --git a/var/spack/repos/builtin/packages/py-emcee/package.py b/var/spack/repos/builtin/packages/py-emcee/package.py index d3627b32c55..6419a9c40e6 100644 --- a/var/spack/repos/builtin/packages/py-emcee/package.py +++ b/var/spack/repos/builtin/packages/py-emcee/package.py @@ -25,7 +25,7 @@ from spack import * -class PyEmcee(Package): +class PyEmcee(PythonPackage): """emcee is an MIT licensed pure-Python implementation of Goodman & Weare's Affine Invariant Markov chain Monte Carlo (MCMC) Ensemble sampler.""" @@ -34,8 +34,4 @@ class PyEmcee(Package): version('2.1.0', 'c6b6fad05c824d40671d4a4fc58dfff7') - extends('python') depends_on('py-numpy', type=('build', 'run')) - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-enum34/package.py b/var/spack/repos/builtin/packages/py-enum34/package.py index 584572b47df..cc111ce0924 100644 --- a/var/spack/repos/builtin/packages/py-enum34/package.py +++ b/var/spack/repos/builtin/packages/py-enum34/package.py @@ -25,7 +25,7 @@ from spack import * -class PyEnum34(Package): +class PyEnum34(PythonPackage): """Python 3.4 Enum backported to 3.3, 3.2, 3.1, 2.7, 2.6, 2.5, and 2.4.""" homepage = "https://pypi.python.org/pypi/enum34" @@ -34,12 +34,10 @@ class PyEnum34(Package): version('1.1.6', '5f13a0841a61f7fc295c514490d120d0', url="https://pypi.python.org/packages/bf/3e/31d502c25302814a7c2f1d3959d2a3b3f78e509002ba91aea64993936876/enum34-1.1.6.tar.gz") - extends('python') depends_on('python@2.4:2.8,3.3:') - depends_on('py-ordereddict', when='^python@:2.6.999', type=('build', 'run')) + # This dependency breaks concretization + # See https://github.com/LLNL/spack/issues/2793 + # depends_on('py-ordereddict', when='^python@:2.6.999', type=('build', 'run')) # noqa depends_on('py-setuptools', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-epydoc/package.py b/var/spack/repos/builtin/packages/py-epydoc/package.py index ed490cb3965..e13d431f914 100644 --- a/var/spack/repos/builtin/packages/py-epydoc/package.py +++ b/var/spack/repos/builtin/packages/py-epydoc/package.py @@ -25,15 +25,10 @@ from spack import * -class PyEpydoc(Package): +class PyEpydoc(PythonPackage): """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): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-flake8/package.py b/var/spack/repos/builtin/packages/py-flake8/package.py index 4515f68e0ab..17d7cea3430 100644 --- a/var/spack/repos/builtin/packages/py-flake8/package.py +++ b/var/spack/repos/builtin/packages/py-flake8/package.py @@ -25,7 +25,7 @@ from spack import * -class PyFlake8(Package): +class PyFlake8(PythonPackage): """Flake8 is a wrapper around PyFlakes, pep8 and Ned Batchelder's McCabe script.""" @@ -43,7 +43,7 @@ class PyFlake8(Package): depends_on('py-setuptools', type=('build', 'run')) # pyflakes >= 0.8.1, != 1.2.0, != 1.2.1, != 1.2.2, < 1.3.0 - depends_on('py-pyflakes@0.8.1:1.1.0,1.2.3:1.2.3', when='@3.0.4', type=('build', 'run')) # noqa + depends_on('py-pyflakes@0.8.1:1.1.0,1.2.3:1.2.3', when='@3.0.4', type=('build', 'run')) # pyflakes >= 0.8.1, < 1.1 depends_on('py-pyflakes@0.8.1:1.0.0', when='@2.5.4', type=('build', 'run')) @@ -57,11 +57,12 @@ class PyFlake8(Package): # mccabe >= 0.2.1, < 0.5 depends_on('py-mccabe@0.2.1:0.4.0', when='@2.5.4', type=('build', 'run')) - depends_on('py-configparser', when='^python@:3.3.999', type=('build', 'run')) - depends_on('py-enum34', when='^python@:3.1.999', type=('build', 'run')) + # These dependencies breaks concretization + # See https://github.com/LLNL/spack/issues/2793 + # depends_on('py-configparser', when='^python@:3.3.999', type=('build', 'run')) # noqa + # depends_on('py-enum34', when='^python@:3.1.999', type=('build', 'run')) + depends_on('py-configparser', type=('build', 'run')) + depends_on('py-enum34', type=('build', 'run')) # TODO: Add test dependencies # depends_on('py-nose', type='test') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-funcsigs/package.py b/var/spack/repos/builtin/packages/py-funcsigs/package.py index b82a37cae98..ea8b71f25f0 100644 --- a/var/spack/repos/builtin/packages/py-funcsigs/package.py +++ b/var/spack/repos/builtin/packages/py-funcsigs/package.py @@ -25,16 +25,11 @@ from spack import * -class PyFuncsigs(Package): +class PyFuncsigs(PythonPackage): """Python function signatures from PEP362 for Python 2.6, 2.7 and 3.2.""" homepage = "https://pypi.python.org/pypi/funcsigs" url = "https://pypi.python.org/packages/source/f/funcsigs/funcsigs-0.4.tar.gz" version('0.4', 'fb1d031f284233e09701f6db1281c2a5') - extends('python') - depends_on('py-setuptools', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-functools32/package.py b/var/spack/repos/builtin/packages/py-functools32/package.py index dc4e49d278f..f2fb0df555f 100644 --- a/var/spack/repos/builtin/packages/py-functools32/package.py +++ b/var/spack/repos/builtin/packages/py-functools32/package.py @@ -25,17 +25,11 @@ from spack import * -class PyFunctools32(Package): +class PyFunctools32(PythonPackage): """Backport of the functools module from Python 3.2.3 for use on 2.7 and PyPy.""" homepage = "https://github.com/MiCHiLU/python-functools32" - # base https://pypi.python.org/pypi/functools32 url = "https://pypi.python.org/packages/source/f/functools32/functools32-3.2.3-2.tar.gz" version('3.2.3-2', '09f24ffd9af9f6cd0f63cb9f4e23d4b2') - - extends('python') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-futures/package.py b/var/spack/repos/builtin/packages/py-futures/package.py index 20bf4c7dae7..c6c1d8134fa 100644 --- a/var/spack/repos/builtin/packages/py-futures/package.py +++ b/var/spack/repos/builtin/packages/py-futures/package.py @@ -25,7 +25,7 @@ from spack import * -class PyFutures(Package): +class PyFutures(PythonPackage): """Backport of the concurrent.futures package from Python 3.2""" homepage = "https://pypi.python.org/pypi/futures" @@ -33,9 +33,4 @@ class PyFutures(Package): version('3.0.5', 'ced2c365e518242512d7a398b515ff95') - extends('python') - depends_on('py-setuptools', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-genders/package.py b/var/spack/repos/builtin/packages/py-genders/package.py index f919a7e6c28..2123f4eb3fc 100644 --- a/var/spack/repos/builtin/packages/py-genders/package.py +++ b/var/spack/repos/builtin/packages/py-genders/package.py @@ -36,6 +36,9 @@ class PyGenders(Package): url='https://github.com/chaos/genders/releases/download/genders-1-22-1/genders-1.22.tar.gz') extends('python') + # FIXME: Missing a dependency on genders + # #include + def install(self, spec, prefix): configure("--prefix=%s" % prefix) make(parallel=False) diff --git a/var/spack/repos/builtin/packages/py-genshi/package.py b/var/spack/repos/builtin/packages/py-genshi/package.py index e7eb7bebddd..462dbfe802c 100644 --- a/var/spack/repos/builtin/packages/py-genshi/package.py +++ b/var/spack/repos/builtin/packages/py-genshi/package.py @@ -22,11 +22,10 @@ # License along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## -from spack import version, extends, depends_on -from spack import Package +from spack import * -class PyGenshi(Package): +class PyGenshi(PythonPackage): """Python toolkit for generation of output for the web""" homepage = "https://genshi.edgewall.org/" url = "http://ftp.edgewall.com/pub/genshi/Genshi-0.7.tar.gz" @@ -35,8 +34,4 @@ class PyGenshi(Package): version('0.6.1', '372c368c8931110b0a521fa6091742d7') version('0.6', '604e8b23b4697655d36a69c2d8ef7187') - extends("python") depends_on("py-setuptools", type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-gnuplot/package.py b/var/spack/repos/builtin/packages/py-gnuplot/package.py index f7b88d00fe6..a23aa2585f1 100644 --- a/var/spack/repos/builtin/packages/py-gnuplot/package.py +++ b/var/spack/repos/builtin/packages/py-gnuplot/package.py @@ -25,7 +25,7 @@ from spack import * -class PyGnuplot(Package): +class PyGnuplot(PythonPackage): """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/" @@ -33,8 +33,4 @@ class PyGnuplot(Package): version('1.8', 'abd6f571e7aec68ae7db90a5217cd5b1') - extends('python') depends_on('py-numpy', type=('build', 'run')) - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-h5py/package.py b/var/spack/repos/builtin/packages/py-h5py/package.py index dffd2463d3f..666905e5c0c 100644 --- a/var/spack/repos/builtin/packages/py-h5py/package.py +++ b/var/spack/repos/builtin/packages/py-h5py/package.py @@ -25,7 +25,7 @@ from spack import * -class PyH5py(Package): +class PyH5py(PythonPackage): """The h5py package provides both a high- and low-level interface to the HDF5 library from Python.""" @@ -38,8 +38,6 @@ class PyH5py(Package): variant('mpi', default=True, description='Build with MPI support') - extends('python') - # Build dependencies depends_on('py-cython@0.19:', type='build') depends_on('pkg-config', type='build') @@ -55,11 +53,11 @@ class PyH5py(Package): # Runtime dependencies depends_on('py-six', type=('build', 'run')) - def install(self, spec, prefix): - setup_py('configure', '--hdf5={0}'.format(spec['hdf5'].prefix)) + phases = ['configure', 'install'] + + def configure(self, spec, prefix): + self.setup_py('configure', '--hdf5={0}'.format(spec['hdf5'].prefix)) if '+mpi' in spec: env['CC'] = spec['mpi'].mpicc - setup_py('configure', '--mpi') - - setup_py('install', '--prefix={0}'.format(prefix)) + self.setup_py('configure', '--mpi') diff --git a/var/spack/repos/builtin/packages/py-html5lib/package.py b/var/spack/repos/builtin/packages/py-html5lib/package.py new file mode 100644 index 00000000000..1757b442979 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-html5lib/package.py @@ -0,0 +1,37 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# 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/llnl/spack +# Please also see the LICENSE file 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 +############################################################################## +from spack import * + + +class PyHtml5lib(PythonPackage): + """HTML parser based on the WHATWG HTML specification.""" + + homepage = "https://github.com/html5lib/html5lib-python" + url = "https://pypi.python.org/packages/ae/ae/bcb60402c60932b32dfaf19bb53870b29eda2cd17551ba5639219fb5ebf9/html5lib-0.9999999.tar.gz" + + version('0.9999999', 'ef43cb05e9e799f25d65d1135838a96f') + + depends_on('python@2.6:2.7,3.2:3.4') + depends_on('py-six', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-imagesize/package.py b/var/spack/repos/builtin/packages/py-imagesize/package.py index 941e64610ef..a2d08f65027 100644 --- a/var/spack/repos/builtin/packages/py-imagesize/package.py +++ b/var/spack/repos/builtin/packages/py-imagesize/package.py @@ -25,7 +25,7 @@ from spack import * -class PyImagesize(Package): +class PyImagesize(PythonPackage): """Parses image file headers and returns image size. Supports PNG, JPEG, JPEG2000, and GIF image file formats.""" @@ -35,9 +35,4 @@ class PyImagesize(Package): version('0.7.1', '976148283286a6ba5f69b0f81aef8052', url="https://pypi.python.org/packages/53/72/6c6f1e787d9cab2cc733cf042f125abec07209a58308831c9f292504e826/imagesize-0.7.1.tar.gz") - extends('python') - depends_on('py-setuptools', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-iminuit/package.py b/var/spack/repos/builtin/packages/py-iminuit/package.py index 3162b413160..0b93a0f2b89 100644 --- a/var/spack/repos/builtin/packages/py-iminuit/package.py +++ b/var/spack/repos/builtin/packages/py-iminuit/package.py @@ -25,7 +25,7 @@ from spack import * -class PyIminuit(Package): +class PyIminuit(PythonPackage): """Interactive IPython-Friendly Minimizer based on SEAL Minuit2.""" homepage = "https://pypi.python.org/pypi/iminuit" @@ -34,13 +34,9 @@ class PyIminuit(Package): version('1.2', '4701ec472cae42015e26251703e6e984') # Required dependencies - extends('python') depends_on('py-setuptools', type='build') # Optional dependencies depends_on('py-numpy', type=('build', 'run')) depends_on('py-matplotlib', type=('build', 'run')) depends_on('py-cython', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-ipdb/package.py b/var/spack/repos/builtin/packages/py-ipdb/package.py index ab7982a76a3..a79ade5d004 100644 --- a/var/spack/repos/builtin/packages/py-ipdb/package.py +++ b/var/spack/repos/builtin/packages/py-ipdb/package.py @@ -25,7 +25,7 @@ from spack import * -class PyIpdb(Package): +class PyIpdb(PythonPackage): """ipdb is the iPython debugger and has many additional features, including a better interactive debugging experience via colorized output.""" @@ -39,7 +39,6 @@ class PyIpdb(Package): # this the original packager does not know what they are. See the 3rd party # section on ipdb's GitHub: # https://github.com/gotcha/ipdb#third-party-support - extends('python') depends_on('python@2.6:2.7,3.2:') # Dependencies gathered from: @@ -52,7 +51,3 @@ class PyIpdb(Package): depends_on('py-six', type=('build', 'link')) depends_on('py-pexpect', type=('build', 'link')) depends_on('py-prompt-toolkit', type=('build', 'link')) - - def install(self, spec, prefix): - # Installation is uncomplicated, this should suffice. - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-ipykernel/package.py b/var/spack/repos/builtin/packages/py-ipykernel/package.py index d68cfa2ae4a..0303a8e43c1 100644 --- a/var/spack/repos/builtin/packages/py-ipykernel/package.py +++ b/var/spack/repos/builtin/packages/py-ipykernel/package.py @@ -25,7 +25,7 @@ from spack import * -class PyIpykernel(Package): +class PyIpykernel(PythonPackage): """IPython Kernel for Jupyter""" homepage = "https://pypi.python.org/pypi/ipykernel" @@ -42,15 +42,10 @@ class PyIpykernel(Package): version('4.1.1', '51376850c46fb006e1f8d1cd353507c5') version('4.1.0', '638a43e4f8a15872f749090c3f0827b6') - extends('python') - depends_on('python@2.7:2.7.999,3.3:') depends_on('py-setuptools', type='build') - depends_on('py-traitlets@4.1.0:') - depends_on('py-tornado@4.0:') - depends_on('py-ipython@4.0:') - depends_on('py-jupyter-client') - depends_on('py-pexpect') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) + depends_on('py-traitlets@4.1.0:', type=('build', 'run')) + depends_on('py-tornado@4.0:', type=('build', 'run')) + depends_on('py-ipython@4.0:', type=('build', 'run')) + depends_on('py-jupyter-client', type=('build', 'run')) + depends_on('py-pexpect', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-ipython-genutils/package.py b/var/spack/repos/builtin/packages/py-ipython-genutils/package.py index 75b20e08e9d..66e8a02130d 100644 --- a/var/spack/repos/builtin/packages/py-ipython-genutils/package.py +++ b/var/spack/repos/builtin/packages/py-ipython-genutils/package.py @@ -25,7 +25,7 @@ from spack import * -class PyIpythonGenutils(Package): +class PyIpythonGenutils(PythonPackage): """Vestigial utilities from IPython""" homepage = "https://pypi.python.org/pypi/ipython_genutils" @@ -33,10 +33,5 @@ class PyIpythonGenutils(Package): version('0.1.0', '9a8afbe0978adbcbfcb3b35b2d015a56') - extends('python') - depends_on('py-setuptools', type='build') depends_on('python@2.7:2.7.999,3.3:') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-ipython/package.py b/var/spack/repos/builtin/packages/py-ipython/package.py index b8ad5bf03a5..277e090faa5 100644 --- a/var/spack/repos/builtin/packages/py-ipython/package.py +++ b/var/spack/repos/builtin/packages/py-ipython/package.py @@ -25,7 +25,7 @@ from spack import * -class PyIpython(Package): +class PyIpython(PythonPackage): """IPython provides a rich toolkit to help you make the most out of using Python interactively.""" homepage = "https://pypi.python.org/pypi/ipython" @@ -35,13 +35,15 @@ class PyIpython(Package): version('3.1.0', 'a749d90c16068687b0ec45a27e72ef8f') version('2.3.1', '2b7085525dac11190bfb45bb8ec8dcbf') - extends('python') depends_on('py-pygments', type=('build', 'run')) depends_on('py-setuptools', type=('build', 'run')) - depends_on('py-backports-shutil-get-terminal-size', when="^python@:3.2.999") - depends_on('py-pathlib2', when="^python@:3.3.999") - depends_on('py-pickleshare') - depends_on('py-simplegeneric') - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) + # These dependencies breaks concretization + # See https://github.com/LLNL/spack/issues/2793 + # depends_on('py-backports-shutil-get-terminal-size', when="^python@:3.2.999") # noqa + # depends_on('py-pathlib2', when="^python@:3.3.999") + depends_on('py-backports-shutil-get-terminal-size', type=('build', 'run')) + depends_on('py-pathlib2', type=('build', 'run')) + + depends_on('py-pickleshare', type=('build', 'run')) + depends_on('py-simplegeneric', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-ipywidgets/package.py b/var/spack/repos/builtin/packages/py-ipywidgets/package.py index c9b2e9c168d..eafee8e0848 100644 --- a/var/spack/repos/builtin/packages/py-ipywidgets/package.py +++ b/var/spack/repos/builtin/packages/py-ipywidgets/package.py @@ -25,7 +25,7 @@ from spack import * -class PyIpywidgets(Package): +class PyIpywidgets(PythonPackage): """IPython widgets for the Jupyter Notebook""" homepage = "https://github.com/ipython/ipywidgets" @@ -33,13 +33,8 @@ class PyIpywidgets(Package): version('5.2.2', '112f3daa4aa0f42f8dda831cea3649c8') - extends('python') - depends_on('py-setuptools', type='build') depends_on('python@2.7:2.7.999,3.3:') - depends_on('py-ipython@4.0.0:') - depends_on('py-ipykernel@4.2.2:') - depends_on('py-traitlets@4.2.1:') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) + depends_on('py-ipython@4.0.0:', type=('build', 'run')) + depends_on('py-ipykernel@4.2.2:', type=('build', 'run')) + depends_on('py-traitlets@4.2.1:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-jdcal/package.py b/var/spack/repos/builtin/packages/py-jdcal/package.py index 60ee91c9b64..964db1448f4 100644 --- a/var/spack/repos/builtin/packages/py-jdcal/package.py +++ b/var/spack/repos/builtin/packages/py-jdcal/package.py @@ -25,15 +25,10 @@ from spack import * -class PyJdcal(Package): +class PyJdcal(PythonPackage): """Julian dates from proleptic Gregorian and Julian calendars""" homepage = 'http://github.com/phn/jdcal' url = "https://pypi.python.org/packages/source/j/jdcal/jdcal-1.2.tar.gz" version('1.2', 'ab8d5ba300fd1eb01514f363d19b1eb9') - - extends('python') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-jinja2/package.py b/var/spack/repos/builtin/packages/py-jinja2/package.py index d9191952eea..eafe8c252b5 100644 --- a/var/spack/repos/builtin/packages/py-jinja2/package.py +++ b/var/spack/repos/builtin/packages/py-jinja2/package.py @@ -25,7 +25,7 @@ from spack import * -class PyJinja2(Package): +class PyJinja2(PythonPackage): """Jinja2 is a template engine written in pure Python. It provides a Django inspired non-XML syntax but supports inline expressions and an optional sandboxed environment.""" @@ -39,11 +39,6 @@ class PyJinja2(Package): version('2.7.1', '282aed153e69f970d6e76f78ed9d027a') version('2.7', 'c2fb12cbbb523c57d3d15bfe4dc0e8fe') - extends('python') - depends_on('py-setuptools', type='build') depends_on('py-markupsafe', type=('build', 'run')) depends_on('py-babel@0.8:', type=('build', 'run')) # optional, required for i18n - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-jsonschema/package.py b/var/spack/repos/builtin/packages/py-jsonschema/package.py index d41ee439dbb..b1a0ac6606c 100644 --- a/var/spack/repos/builtin/packages/py-jsonschema/package.py +++ b/var/spack/repos/builtin/packages/py-jsonschema/package.py @@ -25,19 +25,18 @@ from spack import * -class PyJsonschema(Package): +class PyJsonschema(PythonPackage): """Jsonschema: An(other) implementation of JSON Schema for Python.""" homepage = "http://github.com/Julian/jsonschema" - # base https://pypi.python.org/pypi/jsonschema url = "https://pypi.python.org/packages/source/j/jsonschema/jsonschema-2.5.1.tar.gz" version('2.5.1', '374e848fdb69a3ce8b7e778b47c30640') - extends('python') depends_on('py-setuptools', type='build') - depends_on('py-vcversioner') - depends_on('py-functools32', when="^python@2.7") + depends_on('py-vcversioner', type=('build', 'run')) - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) + # This dependency breaks concretization + # See https://github.com/LLNL/spack/issues/2793 + # depends_on('py-functools32', when="^python@2.7", type=('build', 'run')) + depends_on('py-functools32', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-jupyter-client/package.py b/var/spack/repos/builtin/packages/py-jupyter-client/package.py index c8268c8aa2d..b0c7b06362c 100644 --- a/var/spack/repos/builtin/packages/py-jupyter-client/package.py +++ b/var/spack/repos/builtin/packages/py-jupyter-client/package.py @@ -25,7 +25,7 @@ from spack import * -class PyJupyterClient(Package): +class PyJupyterClient(PythonPackage): """Jupyter protocol client APIs""" homepage = "https://github.com/jupyter/jupyter_client" @@ -40,13 +40,8 @@ class PyJupyterClient(Package): version('4.1.0', 'cf42048b889c8434fbb5813a9eec1d34') version('4.0.0', '00fa63c67cb3adf359d09dc4d803aff5') - extends('python') - depends_on('py-setuptools', type='build') depends_on('python@2.7:2.7.999,3.3:') - depends_on('py-traitlets') - depends_on('py-jupyter-core') - depends_on('py-zmq@13:') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) + depends_on('py-traitlets', type=('build', 'run')) + depends_on('py-jupyter-core', type=('build', 'run')) + depends_on('py-zmq@13:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-jupyter-console/package.py b/var/spack/repos/builtin/packages/py-jupyter-console/package.py index 1cc432e2e09..a5f3e53298b 100644 --- a/var/spack/repos/builtin/packages/py-jupyter-console/package.py +++ b/var/spack/repos/builtin/packages/py-jupyter-console/package.py @@ -25,7 +25,7 @@ from spack import * -class PyJupyterConsole(Package): +class PyJupyterConsole(PythonPackage): """Jupyter Terminal Console""" homepage = "https://github.com/jupyter/jupyter_console" @@ -37,15 +37,10 @@ class PyJupyterConsole(Package): version('4.0.3', '0e928ea261e7f8154698cf69ed4f2459') version('4.0.2', 'f2e174938c91136549b908bd39fa5d59') - extends('python') - depends_on('py-setuptools', type='build') depends_on('python@2.7:2.7.999,3.3:') - depends_on('py-jupyter-client') - depends_on('py-ipython') - depends_on('py-ipykernel') - depends_on('py-pygments') - depends_on('py-prompt-toolkit@1.0.0:1.999.999') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) + depends_on('py-jupyter-client', type=('build', 'run')) + depends_on('py-ipython', type=('build', 'run')) + depends_on('py-ipykernel', type=('build', 'run')) + depends_on('py-pygments', type=('build', 'run')) + depends_on('py-prompt-toolkit@1.0.0:1.999.999', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-jupyter-core/package.py b/var/spack/repos/builtin/packages/py-jupyter-core/package.py index ae4f1924370..f650a91bb97 100644 --- a/var/spack/repos/builtin/packages/py-jupyter-core/package.py +++ b/var/spack/repos/builtin/packages/py-jupyter-core/package.py @@ -25,7 +25,7 @@ from spack import * -class PyJupyterCore(Package): +class PyJupyterCore(PythonPackage): """Core Jupyter functionality""" homepage = "http://jupyter-core.readthedocs.io/" @@ -40,13 +40,8 @@ class PyJupyterCore(Package): version('4.0.3', 'f2608f6e92f992ec8e37646b52c922a6') version('4.0.2', 'ae0d0197c4febf43c050a97ac6277263') version('4.0.1', 'f849136b2badaaba2a8a3b397bf04639') - version('4.0' , 'b6b37cb4f40bd0fcd20433cb2cc7a4c1') - - extends('python') + version('4.0', 'b6b37cb4f40bd0fcd20433cb2cc7a4c1') depends_on('py-setuptools', type='build') depends_on('python@2.7:2.7.999,3.3:') - depends_on('py-traitlets') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) + depends_on('py-traitlets', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-jupyter-notebook/package.py b/var/spack/repos/builtin/packages/py-jupyter-notebook/package.py index c9eb51d2d4e..4c0d12b2458 100644 --- a/var/spack/repos/builtin/packages/py-jupyter-notebook/package.py +++ b/var/spack/repos/builtin/packages/py-jupyter-notebook/package.py @@ -25,7 +25,7 @@ from spack import * -class PyJupyterNotebook(Package): +class PyJupyterNotebook(PythonPackage): """Jupyter Interactive Notebook""" homepage = "https://github.com/jupyter/notebook" @@ -44,23 +44,18 @@ class PyJupyterNotebook(Package): variant('terminal', default=False, description="Enable terminal functionality") - extends('python') - depends_on('py-setuptools', type='build') depends_on('python@2.7:2.7.999,3.3:') depends_on('npm', type='build') - depends_on('py-jinja2') - depends_on('py-tornado@4:') - depends_on('py-ipython-genutils') - depends_on('py-traitlets') - depends_on('py-jupyter-core') - depends_on('py-jupyter-client') - depends_on('py-jupyter-console') - depends_on('py-nbformat') - depends_on('py-nbconvert') - depends_on('py-ipykernel') - depends_on('py-terminado@0.3.3:', when="+terminal") - depends_on('py-ipywidgets', when="+terminal") - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) + depends_on('py-jinja2', type=('build', 'run')) + depends_on('py-tornado@4:', type=('build', 'run')) + depends_on('py-ipython-genutils', type=('build', 'run')) + depends_on('py-traitlets', type=('build', 'run')) + depends_on('py-jupyter-core', type=('build', 'run')) + depends_on('py-jupyter-client', type=('build', 'run')) + depends_on('py-jupyter-console', type=('build', 'run')) + depends_on('py-nbformat', type=('build', 'run')) + depends_on('py-nbconvert', type=('build', 'run')) + depends_on('py-ipykernel', type=('build', 'run')) + depends_on('py-terminado@0.3.3:', when="+terminal", type=('build', 'run')) + depends_on('py-ipywidgets', when="+terminal", type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-lockfile/package.py b/var/spack/repos/builtin/packages/py-lockfile/package.py index 856276ec89e..1e57e6a1d7d 100644 --- a/var/spack/repos/builtin/packages/py-lockfile/package.py +++ b/var/spack/repos/builtin/packages/py-lockfile/package.py @@ -25,7 +25,7 @@ from spack import * -class PyLockfile(Package): +class PyLockfile(PythonPackage): """The lockfile package exports a LockFile class which provides a simple API for locking files. Unlike the Windows msvcrt.locking function, the fcntl.lockf and flock functions, and the @@ -41,8 +41,4 @@ class PyLockfile(Package): version('0.10.2', '1aa6175a6d57f082cd12e7ac6102ab15') - extends("python") depends_on("py-setuptools", type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-logilab-common/package.py b/var/spack/repos/builtin/packages/py-logilab-common/package.py index e8c52493b5c..4c20885760f 100644 --- a/var/spack/repos/builtin/packages/py-logilab-common/package.py +++ b/var/spack/repos/builtin/packages/py-logilab-common/package.py @@ -22,11 +22,10 @@ # License along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## -from spack import depends_on, extends, version -from spack import Package +from spack import * -class PyLogilabCommon(Package): +class PyLogilabCommon(PythonPackage): """Common modules used by Logilab projects""" homepage = "https://www.logilab.org/project/logilab-common" url = "https://pypi.python.org/packages/a7/31/1650d23e44794d46935d82b86e73454cc83b814cbe1365260ccce8a2f4c6/logilab-common-1.2.0.tar.gz" @@ -36,6 +35,3 @@ class PyLogilabCommon(Package): extends('python', ignore=r'bin/pytest') depends_on("py-setuptools", type='build') depends_on("py-six", type=('build', 'run')) - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-macs2/package.py b/var/spack/repos/builtin/packages/py-macs2/package.py index 09cb76c3d3d..42318faa2a0 100644 --- a/var/spack/repos/builtin/packages/py-macs2/package.py +++ b/var/spack/repos/builtin/packages/py-macs2/package.py @@ -26,7 +26,7 @@ from spack import * -class PyMacs2(Package): +class PyMacs2(PythonPackage): """MACS2 Model-based Analysis of ChIP-Seq""" homepage = "https://github.com/taoliu/MACS" @@ -34,13 +34,9 @@ class PyMacs2(Package): version('2.1.1.20160309', '2008ba838f83f34f8e0fddefe2a3a0159f4a740707c68058f815b31ddad53d26') - extends('python') depends_on('python@2.7:2.8') # Most Python packages only require py-setuptools as a build dependency. # However, py-macs2 requires py-setuptools during runtime as well. depends_on('py-setuptools', type=('build', 'run')) depends_on('py-numpy@1.6:', type=('build', 'run')) - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-mako/package.py b/var/spack/repos/builtin/packages/py-mako/package.py index 799bc7b5d95..0707d0b12fa 100644 --- a/var/spack/repos/builtin/packages/py-mako/package.py +++ b/var/spack/repos/builtin/packages/py-mako/package.py @@ -25,7 +25,7 @@ from spack import * -class PyMako(Package): +class PyMako(PythonPackage): """A super-fast templating language that borrows the best ideas from the existing templating languages.""" @@ -35,12 +35,7 @@ class PyMako(Package): version('1.0.4', 'c5fc31a323dd4990683d2f2da02d4e20') version('1.0.1', '9f0aafd177b039ef67b90ea350497a54') - extends('python') - depends_on('py-setuptools', type='build') # depends_on('py-mock', type='test') # TODO: Add test deptype # depends_on('py-pytest', type='test') # TODO: Add test deptype depends_on('py-markupsafe@0.9.2:', type=('build', 'run')) - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-markdown/package.py b/var/spack/repos/builtin/packages/py-markdown/package.py index cded451f3bb..23c81670213 100644 --- a/var/spack/repos/builtin/packages/py-markdown/package.py +++ b/var/spack/repos/builtin/packages/py-markdown/package.py @@ -26,7 +26,7 @@ from spack import * -class PyMarkdown(Package): +class PyMarkdown(PythonPackage): """This is a Python implementation of John Gruber's Markdown. It is almost completely compliant with the reference implementation, though there are a few very minor differences. See John's Syntax @@ -48,14 +48,9 @@ class PyMarkdown(Package): version('2.5.1', 'be6f6ba65a8fb843d2aaf1fcdd68c755') version('2.5', '8393ceab9c6e33357fb8a7be063a4849') - extends('python') - depends_on('py-setuptools', type='build') depends_on('python@2.7:2.8,3.2:3.4') def url_for_version(self, version): base_url = "https://github.com/waylan/Python-Markdown/archive" return "{0}/{1}-final.tar.gz".format(base_url, version) - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-markupsafe/package.py b/var/spack/repos/builtin/packages/py-markupsafe/package.py index 5ba5bfb9979..a31e3972de8 100644 --- a/var/spack/repos/builtin/packages/py-markupsafe/package.py +++ b/var/spack/repos/builtin/packages/py-markupsafe/package.py @@ -25,7 +25,7 @@ from spack import * -class PyMarkupsafe(Package): +class PyMarkupsafe(PythonPackage): """MarkupSafe is a library for Python that implements a unicode string that is aware of HTML escaping rules and can be used to implement automatic string escaping. It is used by Jinja 2, the @@ -40,9 +40,4 @@ class PyMarkupsafe(Package): version('0.20', '7da066d9cb191a70aa85d0a3d43565d1') version('0.19', 'ccb3f746c807c5500850987006854a6d') - extends('python') - depends_on('py-setuptools', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-matplotlib/package.py b/var/spack/repos/builtin/packages/py-matplotlib/package.py index cac4da9e792..fc40dce9c11 100644 --- a/var/spack/repos/builtin/packages/py-matplotlib/package.py +++ b/var/spack/repos/builtin/packages/py-matplotlib/package.py @@ -26,7 +26,7 @@ import os -class PyMatplotlib(Package): +class PyMatplotlib(PythonPackage): """matplotlib is a python 2D plotting library which produces publication quality figures in a variety of hardcopy formats and interactive environments across platforms.""" @@ -80,7 +80,7 @@ class PyMatplotlib(Package): # --------- Optional dependencies depends_on('pkg-config', type='build') # why not... - depends_on('py-pillow', when='+image', type=('build', 'run')) + depends_on('pil', when='+image', type=('build', 'run')) depends_on('py-ipython', when='+ipython') depends_on('ghostscript', when='+latex', type='run') depends_on('texlive', when='+latex', type='run') @@ -95,9 +95,10 @@ class PyMatplotlib(Package): # depends_on('ttconv') depends_on('py-six@1.9.0:', type=('build', 'run')) - def install(self, spec, prefix): - setup_py('build') - setup_py('install', '--prefix={0}'.format(prefix)) + @run_after('install') + def set_backend(self): + spec = self.spec + prefix = self.prefix if '+qt' in spec or '+tk' in spec: # Set backend in matplotlib configuration file diff --git a/var/spack/repos/builtin/packages/py-mccabe/package.py b/var/spack/repos/builtin/packages/py-mccabe/package.py index ec913acb16e..c413193cdc6 100644 --- a/var/spack/repos/builtin/packages/py-mccabe/package.py +++ b/var/spack/repos/builtin/packages/py-mccabe/package.py @@ -25,7 +25,7 @@ from spack import * -class PyMccabe(Package): +class PyMccabe(PythonPackage): """Ned's script to check McCabe complexity.""" homepage = "https://github.com/PyCQA/mccabe" @@ -41,13 +41,9 @@ class PyMccabe(Package): version('0.2', '36d4808c37e187dbb1fe2373a0ac6645') version('0.1', '3c9e8e72612a9c01d865630cc569150a') - extends('python') depends_on('python@2.7:2.8,3.3:') depends_on('py-setuptools', type='build') # TODO: Add test dependencies # depends_on('py-pytest', type='test') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-meep/package.py b/var/spack/repos/builtin/packages/py-meep/package.py index a0d57e7373c..64ca4e25d93 100644 --- a/var/spack/repos/builtin/packages/py-meep/package.py +++ b/var/spack/repos/builtin/packages/py-meep/package.py @@ -25,7 +25,7 @@ from spack import * -class PyMeep(Package): +class PyMeep(PythonPackage): """Python-meep is a wrapper around libmeep. It allows the scripting of Meep-simulations with Python""" @@ -36,7 +36,6 @@ class PyMeep(Package): variant('mpi', default=True, description='Enable MPI support') - extends('python') depends_on('py-numpy', type=('build', 'run')) depends_on('py-scipy', type=('build', 'run')) depends_on('py-matplotlib', type=('build', 'run')) @@ -50,9 +49,12 @@ class PyMeep(Package): # or else it can't handle newer C++ compilers and flags. depends_on('swig@1.3.39:3.0.2') - def install(self, spec, prefix): - setup = 'setup-mpi.py' if '+mpi' in spec else 'setup.py' + phases = ['clean', 'build_ext', 'install', 'bdist'] + def setup_file(self): + return 'setup-mpi.py' if '+mpi' in self.spec else 'setup.py' + + def common_args(self, spec, prefix): include_dirs = [ spec['meep'].prefix.include, spec['py-numpy'].include @@ -69,7 +71,19 @@ def install(self, spec, prefix): include_flags = '-I{0}'.format(','.join(include_dirs)) library_flags = '-L{0}'.format(','.join(library_dirs)) - python(setup, 'clean', '--all') - python(setup, 'build_ext', include_flags, library_flags) - python(setup, 'install', '--prefix={0}'.format(prefix)) - python(setup, 'bdist', include_flags, library_flags) + # FIXME: For some reason, this stopped working. + # The -I and -L are no longer being properly forwarded to setup.py: + # meep_common.i:87: Error: Unable to find 'meep/mympi.hpp' + # meep_common.i:88: Error: Unable to find 'meep/vec.hpp' + # meep_common.i:89: Error: Unable to find 'meep.hpp' + + return [include_flags, library_flags] + + def clean_args(self, spec, prefix): + return ['--all'] + + def build_ext_args(self, spec, prefix): + return self.common_args(spec, prefix) + + def bdist_args(self, spec, prefix): + return self.common_args(spec, prefix) diff --git a/var/spack/repos/builtin/packages/py-mistune/package.py b/var/spack/repos/builtin/packages/py-mistune/package.py index 2daee1ed9a8..cc859d4b787 100644 --- a/var/spack/repos/builtin/packages/py-mistune/package.py +++ b/var/spack/repos/builtin/packages/py-mistune/package.py @@ -22,11 +22,10 @@ # License along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## -from spack import depends_on, extends, version -from spack import Package +from spack import * -class PyMistune(Package): +class PyMistune(PythonPackage): """ Python markdown parser """ @@ -39,8 +38,4 @@ class PyMistune(Package): version('0.5.1', '1c6cfce28a4aa90cf125217cd6c6fe6c') version('0.5', '997736554f1f95eea78c66ae339b5722') - extends('python') depends_on('py-setuptools', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-mock/package.py b/var/spack/repos/builtin/packages/py-mock/package.py index b33dfe73799..21edbd1dc0b 100644 --- a/var/spack/repos/builtin/packages/py-mock/package.py +++ b/var/spack/repos/builtin/packages/py-mock/package.py @@ -25,7 +25,7 @@ from spack import * -class PyMock(Package): +class PyMock(PythonPackage): """mock is a library for testing in Python. It allows you to replace parts of your system under test with mock objects and make assertions about how they have been used.""" @@ -35,9 +35,5 @@ class PyMock(Package): version('1.3.0', '73ee8a4afb3ff4da1b4afa287f39fdeb') - extends('python') depends_on('py-pbr', type=('build', 'run')) depends_on('py-setuptools@17.1:', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-monotonic/package.py b/var/spack/repos/builtin/packages/py-monotonic/package.py index 6584aa248c4..b02f954ccc9 100644 --- a/var/spack/repos/builtin/packages/py-monotonic/package.py +++ b/var/spack/repos/builtin/packages/py-monotonic/package.py @@ -25,7 +25,7 @@ from spack import * -class PyMonotonic(Package): +class PyMonotonic(PythonPackage): """An implementation of time.monotonic() for Python 2 & < 3.3""" homepage = "https://pypi.python.org/pypi/monotonic" @@ -33,9 +33,4 @@ class PyMonotonic(Package): version('1.2', 'd14c93aabc3d6af25ef086b032b123cf') - extends('python') - depends_on('py-setuptools', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-mpi4py/package.py b/var/spack/repos/builtin/packages/py-mpi4py/package.py index 11b15843971..7f8dc6b9860 100644 --- a/var/spack/repos/builtin/packages/py-mpi4py/package.py +++ b/var/spack/repos/builtin/packages/py-mpi4py/package.py @@ -25,7 +25,7 @@ from spack import * -class PyMpi4py(Package): +class PyMpi4py(PythonPackage): """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 @@ -38,9 +38,5 @@ class PyMpi4py(Package): version('2.0.0', '4f7d8126d7367c239fd67615680990e3') version('1.3.1', 'dbe9d22bdc8ed965c23a7ceb6f32fc3c') - extends('python') depends_on('py-setuptools', type='build') depends_on('mpi') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-mpmath/package.py b/var/spack/repos/builtin/packages/py-mpmath/package.py index 846852aeb56..d379e0bd036 100644 --- a/var/spack/repos/builtin/packages/py-mpmath/package.py +++ b/var/spack/repos/builtin/packages/py-mpmath/package.py @@ -25,14 +25,9 @@ from spack import * -class PyMpmath(Package): +class PyMpmath(PythonPackage): """A Python library for arbitrary-precision floating-point arithmetic.""" homepage = "http://mpmath.org" url = "https://pypi.python.org/packages/source/m/mpmath/mpmath-all-0.19.tar.gz" version('0.19', 'd1b7e19dd6830d0d7b5e1bc93d46c02c') - - extends('python') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-mx/package.py b/var/spack/repos/builtin/packages/py-mx/package.py index e72b281665c..9af74555b14 100644 --- a/var/spack/repos/builtin/packages/py-mx/package.py +++ b/var/spack/repos/builtin/packages/py-mx/package.py @@ -25,7 +25,7 @@ from spack import * -class PyMx(Package): +class PyMx(PythonPackage): """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, @@ -36,8 +36,3 @@ class PyMx(Package): 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): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-mysqldb1/package.py b/var/spack/repos/builtin/packages/py-mysqldb1/package.py index 14534a57cad..8fd794aadb3 100644 --- a/var/spack/repos/builtin/packages/py-mysqldb1/package.py +++ b/var/spack/repos/builtin/packages/py-mysqldb1/package.py @@ -25,15 +25,14 @@ from spack import * -class PyMysqldb1(Package): +class PyMysqldb1(PythonPackage): """Legacy mysql bindings for python""" homepage = "https://github.com/farcepest/MySQLdb1" url = "https://github.com/farcepest/MySQLdb1/archive/MySQLdb-1.2.5.tar.gz" - version('1.2.5', '332c8f4955b6bc0c79ea15170bf7321b') + version('1.2.5', '332c8f4955b6bc0c79ea15170bf7321b', + url="https://github.com/farcepest/MySQLdb1/archive/MySQLdb-1.2.5.tar.gz") + + # FIXME: Missing dependency on mysql - extends('python') depends_on('py-setuptools', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-nbconvert/package.py b/var/spack/repos/builtin/packages/py-nbconvert/package.py index 41a1c896869..0e221d355c3 100644 --- a/var/spack/repos/builtin/packages/py-nbconvert/package.py +++ b/var/spack/repos/builtin/packages/py-nbconvert/package.py @@ -25,30 +25,31 @@ from spack import * -class PyNbconvert(Package): +class PyNbconvert(PythonPackage): """Jupyter Notebook Conversion""" homepage = "https://github.com/jupyter/nbconvert" url = "https://github.com/jupyter/nbconvert/archive/4.2.0.tar.gz" - version('4.2.0' , '8bd88771cc00f575d5edcd0b5197f964') - version('4.1.0' , '06655576713ba1ff7cece2b92760c187') - version('4.0.0' , '9661620b1e10a7b46f314588d2d0932f') - - extends('python') + version('4.2.0', '8bd88771cc00f575d5edcd0b5197f964') + version('4.1.0', '06655576713ba1ff7cece2b92760c187') + version('4.0.0', '9661620b1e10a7b46f314588d2d0932f') depends_on('py-setuptools', type='build') depends_on('py-pycurl', type='build') depends_on('python@2.7:2.7.999,3.3:') - depends_on('py-mistune') - depends_on('py-jinja2') - depends_on('py-pygments') - depends_on('py-traitlets') - depends_on('py-jupyter-core') - depends_on('py-nbformat') - depends_on('py-entrypoints') - depends_on('py-tornado') - depends_on('py-jupyter-client') + depends_on('py-mistune', type=('build', 'run')) + depends_on('py-jinja2', type=('build', 'run')) + depends_on('py-pygments', type=('build', 'run')) + depends_on('py-traitlets', type=('build', 'run')) + depends_on('py-jupyter-core', type=('build', 'run')) + depends_on('py-nbformat', type=('build', 'run')) + depends_on('py-entrypoints', type=('build', 'run')) + depends_on('py-tornado', type=('build', 'run')) + depends_on('py-jupyter-client', type=('build', 'run')) - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) + # FIXME: + # Failed, try again after installing PycURL with `pip install pycurl` to avoid outdated SSL. # noqa + # Failed to download css from https://cdn.jupyter.org/notebook/4.1.0/style/style.min.css: [Errno socket error] [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661) # noqa + # Downloading CSS: https://cdn.jupyter.org/notebook/4.1.0/style/style.min.css # noqa + # error: Need Notebook CSS to proceed: nbconvert/resources/style.min.css diff --git a/var/spack/repos/builtin/packages/py-nbformat/package.py b/var/spack/repos/builtin/packages/py-nbformat/package.py index f45236fc34a..4ecf7f8fcf0 100644 --- a/var/spack/repos/builtin/packages/py-nbformat/package.py +++ b/var/spack/repos/builtin/packages/py-nbformat/package.py @@ -25,7 +25,7 @@ from spack import * -class PyNbformat(Package): +class PyNbformat(PythonPackage): """The Jupyter Notebook format""" homepage = "https://github.com/jupyter/nbformat" @@ -35,13 +35,8 @@ class PyNbformat(Package): version('4.0.1', 'ab7172e517c9d561c0c01eef5631b4c8') version('4.0.0', '7cf61359fa4e9cf3ef5e969e2fcb909e') - extends('python') - depends_on('py-setuptools', type='build') - depends_on('py-ipython-genutils') - depends_on('py-traitlets') - depends_on('py-jsonschema') - depends_on('py-jupyter-core') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) + depends_on('py-ipython-genutils', type=('build', 'run')) + depends_on('py-traitlets', type=('build', 'run')) + depends_on('py-jsonschema', type=('build', 'run')) + depends_on('py-jupyter-core', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-nestle/package.py b/var/spack/repos/builtin/packages/py-nestle/package.py index a2ce2f514f3..22dc9debe1e 100644 --- a/var/spack/repos/builtin/packages/py-nestle/package.py +++ b/var/spack/repos/builtin/packages/py-nestle/package.py @@ -25,7 +25,7 @@ from spack import * -class PyNestle(Package): +class PyNestle(PythonPackage): """Nested sampling algorithms for evaluating Bayesian evidence.""" homepage = "http://kbarbary.github.io/nestle/" @@ -34,11 +34,7 @@ class PyNestle(Package): version('0.1.1', '4875c0f9a0a8e263c1d7f5fa6ce604c5') # Required dependencies - extends('python') depends_on('py-numpy', type=('build', 'run')) # Optional dependencies depends_on('py-scipy', type=('build', 'run')) - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-netcdf/package.py b/var/spack/repos/builtin/packages/py-netcdf/package.py index 967b8e06134..2d35320ca06 100644 --- a/var/spack/repos/builtin/packages/py-netcdf/package.py +++ b/var/spack/repos/builtin/packages/py-netcdf/package.py @@ -25,18 +25,14 @@ from spack import * -class PyNetcdf(Package): +class PyNetcdf(PythonPackage): """Python interface to the netCDF Library.""" homepage = "http://unidata.github.io/netcdf4-python" url = "https://github.com/Unidata/netcdf4-python/tarball/v1.2.3.1rel" version('1.2.3.1', '4fc4320d4f2a77b894ebf8da1c9895af') - extends('python') depends_on('py-numpy', type=('build', 'run')) depends_on('py-cython', type=('build', 'run')) depends_on('py-setuptools', type=('build', 'run')) depends_on('netcdf') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-networkx/package.py b/var/spack/repos/builtin/packages/py-networkx/package.py index 3086709a793..6eca70c15ca 100644 --- a/var/spack/repos/builtin/packages/py-networkx/package.py +++ b/var/spack/repos/builtin/packages/py-networkx/package.py @@ -25,7 +25,7 @@ from spack import * -class PyNetworkx(Package): +class PyNetworkx(PythonPackage): """NetworkX is a Python package for the creation, manipulation, and study of the structure, dynamics, and functions of complex networks.""" homepage = "http://networkx.github.io/" @@ -33,10 +33,5 @@ class PyNetworkx(Package): version('1.11', '6ef584a879e9163013e9a762e1cf7cd1') - extends('python') - depends_on('py-decorator', type=('build', 'run')) depends_on('py-setuptools', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-nose/package.py b/var/spack/repos/builtin/packages/py-nose/package.py index f1872c85b47..050a018ffa0 100644 --- a/var/spack/repos/builtin/packages/py-nose/package.py +++ b/var/spack/repos/builtin/packages/py-nose/package.py @@ -25,7 +25,7 @@ from spack import * -class PyNose(Package): +class PyNose(PythonPackage): """nose extends the test loading and running features of unittest, making it easier to write, find and run tests.""" @@ -36,8 +36,4 @@ class PyNose(Package): version('1.3.6', '0ca546d81ca8309080fc80cb389e7a16') version('1.3.7', '4d3ad0ff07b61373d2cefc89c5d0b20b') - extends('python') depends_on('py-setuptools', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-numexpr/package.py b/var/spack/repos/builtin/packages/py-numexpr/package.py index b8e1ca5e0c9..ee89820f5b4 100644 --- a/var/spack/repos/builtin/packages/py-numexpr/package.py +++ b/var/spack/repos/builtin/packages/py-numexpr/package.py @@ -25,16 +25,16 @@ from spack import * -class PyNumexpr(Package): +class PyNumexpr(PythonPackage): """Fast numerical expression evaluator for NumPy""" homepage = "https://pypi.python.org/pypi/numexpr" url = "https://pypi.python.org/packages/source/n/numexpr/numexpr-2.4.6.tar.gz" + version('2.6.1', '6365245705b446426df9543ad218dd8e', + url="https://pypi.python.org/packages/c6/f0/11628fa4d332d8fe9ab0ba8e9bfe0e065fb6b5324859171ee72d84e079c0/numexpr-2.6.1.tar.gz") + version('2.5', '84f66cced45ba3e30dcf77a937763aaa') version('2.4.6', '17ac6fafc9ea1ce3eb970b9abccb4fbd') - version('2.5', '84f66cced45ba3e30dcf77a937763aaa') - extends('python') - depends_on('py-numpy', type=('build', 'run')) - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) + depends_on('python@2.6:') + depends_on('py-numpy@1.6:', type=('build', 'run')) + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-numpy/package.py b/var/spack/repos/builtin/packages/py-numpy/package.py index 22b4d98b9df..a48f5a19552 100644 --- a/var/spack/repos/builtin/packages/py-numpy/package.py +++ b/var/spack/repos/builtin/packages/py-numpy/package.py @@ -26,7 +26,7 @@ import platform -class PyNumpy(Package): +class PyNumpy(PythonPackage): """NumPy is the fundamental package for scientific computing with Python. It contains among other things: a powerful N-dimensional array object, sophisticated (broadcasting) functions, tools for integrating C/C++ and @@ -46,7 +46,6 @@ class PyNumpy(Package): variant('blas', default=True) variant('lapack', default=True) - extends('python') depends_on('python@2.6:2.8,3.2:') depends_on('py-nose', type='build') depends_on('py-setuptools', type='build') @@ -65,7 +64,8 @@ def setup_dependent_package(self, module, dep_spec): self.spec.version, python_version, arch), 'numpy/core/include') - def install(self, spec, prefix): + def patch(self): + spec = self.spec # for build notes see http://www.scipy.org/scipylib/building/linux.html lapackblas = LibraryList('') if '+lapack' in spec: @@ -75,12 +75,56 @@ def install(self, spec, prefix): lapackblas += spec['blas'].blas_libs if '+blas' in spec or '+lapack' in spec: + # note that one should not use [blas_opt] and [lapack_opt], see + # https://github.com/numpy/numpy/commit/ffd4332262ee0295cb942c94ed124f043d801eb6 with open('site.cfg', 'w') as f: - f.write('[DEFAULT]\n') - f.write('libraries=%s\n' % ','.join(lapackblas.names)) - f.write('library_dirs=%s\n' % ':'.join(lapackblas.directories)) + # Unfortunately, numpy prefers to provide each BLAS/LAPACK + # differently. + names = ','.join(lapackblas.names) + dirs = ':'.join(lapackblas.directories) + # First, workout the defaults. + # The section title for the defaults changed in @1.10, see + # https://github.com/numpy/numpy/blob/master/site.cfg.example + if spec.satisfies('@:1.9.2'): + f.write('[DEFAULT]\n') + else: + f.write('[ALL]\n') + if not ('^openblas' in spec or + '^mkl' in spec or + '^atlas' in spec): + f.write('libraries=%s\n' % names) + f.write('library_dirs=%s\n' % dirs) + if not ((platform.system() == "Darwin") and (platform.mac_ver()[0] == '10.12')): f.write('rpath=%s\n' % ':'.join(lapackblas.directories)) - setup_py('install', '--prefix={0}'.format(prefix)) + # Now special treatment for some (!) BLAS/LAPACK. Note that + # in this case library_dirs can not be specified within [ALL]. + if '^openblas' in spec: + f.write('[openblas]\n') + f.write('libraries=%s\n' % names) + f.write('library_dirs=%s\n' % dirs) + elif '^mkl' in spec: + # numpy does not expect system libraries needed for MKL + # here. + # names = [x for x in names if x.startswith('mkl')] + # FIXME: as of @1.11.2, numpy does not work with separately + # specified threading and interface layers. A workaround is + # a terribly bad idea to use mkl_rt. In this case Spack + # won't no longer be able to guarantee that one and the + # same variant of Blas/Lapack (32/64bit, threaded/serial) + # is used within the DAG. This may lead to a lot of + # hard-to-debug segmentation faults on user's side. Users + # may also break working installation by (unconciously) + # setting environment variable to switch between different + # interface and threading layers dynamically. From this + # perspective it is no different from throwing away RPATH's + # and using LD_LIBRARY_PATH throughout Spack. + f.write('[mkl]\n') + f.write('mkl_libs=%s\n' % 'mkl_rt') + f.write('library_dirs=%s\n' % dirs) + elif '^atlas' in spec: + f.write('[atlas]\n') + f.write('atlas_libs=%s\n' % names) + f.write('library_dirs=%s\n' % dirs) diff --git a/var/spack/repos/builtin/packages/py-openpyxl/package.py b/var/spack/repos/builtin/packages/py-openpyxl/package.py index b9d86367421..d396916035b 100644 --- a/var/spack/repos/builtin/packages/py-openpyxl/package.py +++ b/var/spack/repos/builtin/packages/py-openpyxl/package.py @@ -25,7 +25,7 @@ from spack import * -class PyOpenpyxl(Package): +class PyOpenpyxl(PythonPackage): """A Python library to read/write Excel 2007 xlsx/xlsm files""" homepage = 'http://openpyxl.readthedocs.org/' @@ -33,10 +33,5 @@ class PyOpenpyxl(Package): version('2.4.0-a1', 'e5ca6d23ceccb15115d45cdf26e736fc') - extends('python') - depends_on('py-jdcal', type=('build', 'run')) depends_on('py-setuptools', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-ordereddict/package.py b/var/spack/repos/builtin/packages/py-ordereddict/package.py index 6e038b789cd..b560990f00c 100644 --- a/var/spack/repos/builtin/packages/py-ordereddict/package.py +++ b/var/spack/repos/builtin/packages/py-ordereddict/package.py @@ -25,7 +25,7 @@ from spack import * -class PyOrdereddict(Package): +class PyOrdereddict(PythonPackage): """A drop-in substitute for Py2.7's new collections. OrderedDict that works in Python 2.4-2.6.""" @@ -33,9 +33,3 @@ class PyOrdereddict(Package): url = "https://pypi.python.org/packages/source/o/ordereddict/ordereddict-1.1.tar.gz" version('1.1', 'a0ed854ee442051b249bfad0f638bbec') - - extends('python') - depends_on('python@2.4:2.6.999') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-pandas/package.py b/var/spack/repos/builtin/packages/py-pandas/package.py index eb2d948f221..c0da33054fb 100644 --- a/var/spack/repos/builtin/packages/py-pandas/package.py +++ b/var/spack/repos/builtin/packages/py-pandas/package.py @@ -25,7 +25,7 @@ from spack import * -class PyPandas(Package): +class PyPandas(PythonPackage): """pandas is a Python package providing fast, flexible, and expressive data structures designed to make working with relational or labeled data both easy and intuitive. It aims to be the @@ -42,13 +42,9 @@ class PyPandas(Package): version('0.16.1', 'fac4f25748f9610a3e00e765474bdea8') version('0.18.0', 'f143762cd7a59815e348adf4308d2cf6') - extends('python') depends_on('py-dateutil', type=('build', 'run')) depends_on('py-numpy', type=('build', 'run')) depends_on('py-setuptools', type='build') depends_on('py-pytz', type=('build', 'run')) depends_on('py-numexpr', type=('build', 'run')) depends_on('py-bottleneck', type=('build', 'run')) - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-pathlib2/package.py b/var/spack/repos/builtin/packages/py-pathlib2/package.py index 8db18261b80..8951feff4c1 100644 --- a/var/spack/repos/builtin/packages/py-pathlib2/package.py +++ b/var/spack/repos/builtin/packages/py-pathlib2/package.py @@ -25,7 +25,7 @@ from spack import * -class PyPathlib2(Package): +class PyPathlib2(PythonPackage): """Backport of pathlib from python 3.4""" homepage = "https://pypi.python.org/pypi/pathlib2" @@ -33,10 +33,5 @@ class PyPathlib2(Package): version('2.1.0', '38e4f58b4d69dfcb9edb49a54a8b28d2') - extends('python') - depends_on('py-setuptools', type='build') depends_on('python@:3.3.999') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-pathspec/package.py b/var/spack/repos/builtin/packages/py-pathspec/package.py index 399f3c91ef8..e5030abc703 100644 --- a/var/spack/repos/builtin/packages/py-pathspec/package.py +++ b/var/spack/repos/builtin/packages/py-pathspec/package.py @@ -25,7 +25,7 @@ from spack import * -class PyPathspec(Package): +class PyPathspec(PythonPackage): """pathspec extends the test loading and running features of unittest, making it easier to write, find and run tests.""" @@ -34,8 +34,4 @@ class PyPathspec(Package): version('0.3.4', '2a4af9bf2dee98845d583ec61a00d05d', url='https://pypi.python.org/packages/14/9d/c9d790d373d6f6938d793e9c549b87ad8670b6fa7fc6176485e6ef11c1a4/pathspec-0.3.4.tar.gz') - extends('python') depends_on('py-setuptools', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-pbr/package.py b/var/spack/repos/builtin/packages/py-pbr/package.py index 0251e436b11..2a320eb76d6 100644 --- a/var/spack/repos/builtin/packages/py-pbr/package.py +++ b/var/spack/repos/builtin/packages/py-pbr/package.py @@ -25,7 +25,7 @@ from spack import * -class PyPbr(Package): +class PyPbr(PythonPackage): """PBR is a library that injects some useful and sensible default behaviors into your setuptools run.""" homepage = "https://pypi.python.org/pypi/pbr" @@ -33,9 +33,4 @@ class PyPbr(Package): version('1.8.1', 'c8f9285e1a4ca6f9654c529b158baa3a') - extends('python') - depends_on('py-setuptools', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-periodictable/package.py b/var/spack/repos/builtin/packages/py-periodictable/package.py index d4f732a5871..9ff15430183 100644 --- a/var/spack/repos/builtin/packages/py-periodictable/package.py +++ b/var/spack/repos/builtin/packages/py-periodictable/package.py @@ -25,7 +25,7 @@ from spack import * -class PyPeriodictable(Package): +class PyPeriodictable(PythonPackage): """nose extends the test loading and running features of unittest, making it easier to write, find and run tests.""" @@ -36,7 +36,3 @@ class PyPeriodictable(Package): depends_on('py-numpy', type=('build', 'run')) depends_on('py-pyparsing', type=('build', 'run')) - extends('python') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-pexpect/package.py b/var/spack/repos/builtin/packages/py-pexpect/package.py index 99b69fc30bb..5c194c44b63 100644 --- a/var/spack/repos/builtin/packages/py-pexpect/package.py +++ b/var/spack/repos/builtin/packages/py-pexpect/package.py @@ -25,16 +25,12 @@ from spack import * -class PyPexpect(Package): +class PyPexpect(PythonPackage): """Pexpect allows easy control of interactive console applications.""" homepage = "https://pypi.python.org/pypi/pexpect" url = "https://pypi.io/packages/source/p/pexpect/pexpect-4.2.1.tar.gz" version('4.2.1', '3694410001a99dff83f0b500a1ca1c95') + version('3.3', '0de72541d3f1374b795472fed841dce8') - extends('python') - - depends_on('py-ptyprocess') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) + depends_on('py-ptyprocess', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-phonopy/package.py b/var/spack/repos/builtin/packages/py-phonopy/package.py index 748f0dd36b1..b7f1003e282 100644 --- a/var/spack/repos/builtin/packages/py-phonopy/package.py +++ b/var/spack/repos/builtin/packages/py-phonopy/package.py @@ -25,7 +25,7 @@ from spack import * -class PyPhonopy(Package): +class PyPhonopy(PythonPackage): """Phonopy is an open source package for phonon calculations at harmonic and quasi-harmonic levels.""" homepage = "http://atztogo.github.io/phonopy/index.html" @@ -33,11 +33,7 @@ class PyPhonopy(Package): version('1.10.0', '973ed1bcea46e21b9bf747aab9061ff6') - extends('python') depends_on('py-numpy', type=('build', 'run')) depends_on('py-scipy', type=('build', 'run')) depends_on('py-matplotlib', type=('build', 'run')) depends_on('py-pyyaml', type=('build', 'run')) - - def install(self, spec, prefix): - setup_py('install', '--home=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-pickleshare/package.py b/var/spack/repos/builtin/packages/py-pickleshare/package.py index 09a810869db..9bf9ff63fbc 100644 --- a/var/spack/repos/builtin/packages/py-pickleshare/package.py +++ b/var/spack/repos/builtin/packages/py-pickleshare/package.py @@ -25,7 +25,7 @@ from spack import * -class PyPickleshare(Package): +class PyPickleshare(PythonPackage): """Tiny 'shelve'-like database with concurrency support""" homepage = "https://pypi.python.org/pypi/pickleshare" @@ -33,9 +33,4 @@ class PyPickleshare(Package): version('0.7.4', '6a9e5dd8dfc023031f6b7b3f824cab12') - extends('python') - depends_on('py-setuptools', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-pil/package.py b/var/spack/repos/builtin/packages/py-pil/package.py index f5d684962d4..fb14fb9b272 100644 --- a/var/spack/repos/builtin/packages/py-pil/package.py +++ b/var/spack/repos/builtin/packages/py-pil/package.py @@ -25,7 +25,7 @@ from spack import * -class PyPil(Package): +class PyPil(PythonPackage): """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.""" @@ -39,8 +39,4 @@ class PyPil(Package): # py-pil currently only works with Python2. # If you are using Python 3, try using py-pillow instead. - extends('python') depends_on('python@1.5.2:2.8') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-pillow/package.py b/var/spack/repos/builtin/packages/py-pillow/package.py index 3125a822b47..5729c5c3dd0 100644 --- a/var/spack/repos/builtin/packages/py-pillow/package.py +++ b/var/spack/repos/builtin/packages/py-pillow/package.py @@ -23,9 +23,10 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## from spack import * +import sys -class PyPillow(Package): +class PyPillow(PythonPackage): """Pillow is a fork of the Python Imaging Library (PIL). It adds image processing capabilities to your Python interpreter. This library supports many file formats, and provides powerful image processing and graphics @@ -64,8 +65,7 @@ class PyPillow(Package): # description='Provide improved color quantization') # Required dependencies - extends('python') - depends_on('binutils', type='build') + depends_on('binutils', type='build', when=sys.platform != 'darwin') depends_on('py-setuptools', type='build') # Recommended dependencies @@ -83,6 +83,8 @@ class PyPillow(Package): # depends_on('webpmux', when='+webpmux') # depends_on('imagequant', when='+imagequant') + phases = ['build_ext', 'install'] + def patch(self): """Patch setup.py to provide lib and include directories for dependencies.""" @@ -121,13 +123,10 @@ def patch(self): spec['openjpeg'].prefix.lib, spec['openjpeg'].prefix.include)) - def install(self, spec, prefix): + def build_ext_args(self, spec, prefix): def variant_to_flag(variant): able = 'enable' if '+{0}'.format(variant) in spec else 'disable' return '--{0}-{1}'.format(able, variant) variants = ['jpeg', 'zlib', 'tiff', 'freetype', 'lcms', 'jpeg2000'] - build_args = list(map(variant_to_flag, variants)) - - setup_py('build_ext', *build_args) - setup_py('install', '--prefix={0}'.format(prefix)) + return list(map(variant_to_flag, variants)) diff --git a/var/spack/repos/builtin/packages/py-pip/package.py b/var/spack/repos/builtin/packages/py-pip/package.py index dca73f763f3..73e1661245e 100644 --- a/var/spack/repos/builtin/packages/py-pip/package.py +++ b/var/spack/repos/builtin/packages/py-pip/package.py @@ -25,7 +25,7 @@ from spack import * -class PyPip(Package): +class PyPip(PythonPackage): """The PyPA recommended tool for installing Python packages.""" homepage = "https://pypi.python.org/pypi/pip" @@ -33,9 +33,4 @@ class PyPip(Package): version('9.0.1', '35f01da33009719497f01a4ba69d63c9') - extends('python') - depends_on('py-setuptools', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-ply/package.py b/var/spack/repos/builtin/packages/py-ply/package.py index d249de64fad..f5a1e537e25 100644 --- a/var/spack/repos/builtin/packages/py-ply/package.py +++ b/var/spack/repos/builtin/packages/py-ply/package.py @@ -25,14 +25,9 @@ from spack import * -class PyPly(Package): +class PyPly(PythonPackage): """PLY is nothing more than a straightforward lex/yacc implementation.""" homepage = "http://www.dabeaz.com/ply" url = "http://www.dabeaz.com/ply/ply-3.8.tar.gz" version('3.8', '94726411496c52c87c2b9429b12d5c50') - - extends('python') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-pmw/package.py b/var/spack/repos/builtin/packages/py-pmw/package.py index 5173864f62a..3293d94cd61 100644 --- a/var/spack/repos/builtin/packages/py-pmw/package.py +++ b/var/spack/repos/builtin/packages/py-pmw/package.py @@ -25,15 +25,10 @@ from spack import * -class PyPmw(Package): +class PyPmw(PythonPackage): """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): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-prettytable/package.py b/var/spack/repos/builtin/packages/py-prettytable/package.py index 55a323a0d68..2203f68af08 100644 --- a/var/spack/repos/builtin/packages/py-prettytable/package.py +++ b/var/spack/repos/builtin/packages/py-prettytable/package.py @@ -25,7 +25,7 @@ from spack import * -class PyPrettytable(Package): +class PyPrettytable(PythonPackage): """PrettyTable is a simple Python library designed to make it quick and easy to represent tabular data in visually appealing ASCII tables. @@ -36,8 +36,4 @@ class PyPrettytable(Package): version('0.7.2', 'a6b80afeef286ce66733d54a0296b13b') - extends("python") depends_on("py-setuptools", type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-proj/package.py b/var/spack/repos/builtin/packages/py-proj/package.py index a839a1d0b62..949aab88c36 100644 --- a/var/spack/repos/builtin/packages/py-proj/package.py +++ b/var/spack/repos/builtin/packages/py-proj/package.py @@ -25,7 +25,7 @@ from spack import * -class PyProj(Package): +class PyProj(PythonPackage): """Python interface to the PROJ.4 Library.""" homepage = "http://jswhit.github.io/pyproj/" url = "https://github.com/jswhit/pyproj/tarball/v1.9.5.1rel" @@ -37,8 +37,6 @@ class PyProj(Package): version('1.9.5.1', 'a4b80d7170fc82aee363d7f980279835') - extends('python') - depends_on('py-cython', type='build') depends_on('py-setuptools', type='build') @@ -46,6 +44,3 @@ class PyProj(Package): # The py-proj git repo actually includes the correct version of PROJ.4, # which is built internally as part of the py-proj build. # Adding depends_on('proj') will cause mysterious build errors. - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-prompt-toolkit/package.py b/var/spack/repos/builtin/packages/py-prompt-toolkit/package.py index 5c81cf17010..da48cb932f7 100644 --- a/var/spack/repos/builtin/packages/py-prompt-toolkit/package.py +++ b/var/spack/repos/builtin/packages/py-prompt-toolkit/package.py @@ -25,7 +25,7 @@ from spack import * -class PyPromptToolkit(Package): +class PyPromptToolkit(PythonPackage): """Library for building powerful interactive command lines in Python""" homepage = "https://pypi.python.org/pypi/prompt_toolkit" @@ -33,11 +33,6 @@ class PyPromptToolkit(Package): version('1.0.9', 'a39f91a54308fb7446b1a421c11f227c') - extends('python') - depends_on('py-setuptools', type='build') - depends_on('py-six@1.9.0:') - depends_on('py-wcwidth') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) + depends_on('py-six@1.9.0:', type=('build', 'run')) + depends_on('py-wcwidth', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-protobuf/package.py b/var/spack/repos/builtin/packages/py-protobuf/package.py index d1186775bbf..4cdb3801a52 100644 --- a/var/spack/repos/builtin/packages/py-protobuf/package.py +++ b/var/spack/repos/builtin/packages/py-protobuf/package.py @@ -25,7 +25,7 @@ from spack import * -class PyProtobuf(Package): +class PyProtobuf(PythonPackage): """Protocol buffers are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data - think XML, but smaller, faster, and simpler. You define how you want your data to be @@ -42,9 +42,4 @@ class PyProtobuf(Package): version('2.4.1', '72f5141d20ab1bcae6b1e00acfb1068a') version('2.3.0', 'bb020c962f252fe81bfda8fb433bafdd') - extends('python') - depends_on('py-setuptools', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-psutil/package.py b/var/spack/repos/builtin/packages/py-psutil/package.py index 7aa776d2a12..539f0bdbd7f 100644 --- a/var/spack/repos/builtin/packages/py-psutil/package.py +++ b/var/spack/repos/builtin/packages/py-psutil/package.py @@ -25,7 +25,7 @@ from spack import * -class PyPsutil(Package): +class PyPsutil(PythonPackage): """psutil is a cross-platform library for retrieving information on running processes and system utilization (CPU, memory, disks, network) in Python.""" @@ -35,9 +35,5 @@ class PyPsutil(Package): version('5.0.1', '153dc8be94badc4072016ceeac7808dc') - extends('python') depends_on('python@2.6:') depends_on('py-setuptools', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-ptyprocess/package.py b/var/spack/repos/builtin/packages/py-ptyprocess/package.py index fc65e617baf..24197932273 100644 --- a/var/spack/repos/builtin/packages/py-ptyprocess/package.py +++ b/var/spack/repos/builtin/packages/py-ptyprocess/package.py @@ -25,7 +25,7 @@ from spack import * -class PyPtyprocess(Package): +class PyPtyprocess(PythonPackage): """Run a subprocess in a pseudo terminal""" homepage = "https://pypi.python.org/pypi/ptyprocess" @@ -33,9 +33,4 @@ class PyPtyprocess(Package): version('0.5.1', '94e537122914cc9ec9c1eadcd36e73a1') - extends('python') - depends_on('py-setuptools', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-pudb/package.py b/var/spack/repos/builtin/packages/py-pudb/package.py index d9c2d3e0a46..66896bd83fa 100644 --- a/var/spack/repos/builtin/packages/py-pudb/package.py +++ b/var/spack/repos/builtin/packages/py-pudb/package.py @@ -26,7 +26,7 @@ from spack import * -class PyPudb(Package): +class PyPudb(PythonPackage): """Full-screen console debugger for Python""" homepage = "http://mathema.tician.de/software/pudb" @@ -34,11 +34,6 @@ class PyPudb(Package): version('2016.2', '4573b70163329c1cb59836a357bfdf7c') - extends('python') - depends_on('py-setuptools', type='build') depends_on('py-urwid@1.1.1:', type=('build', 'run')) depends_on('py-pygments@1.0:', type=('build', 'run')) - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-py/package.py b/var/spack/repos/builtin/packages/py-py/package.py index f624aaf3894..5a963105bd2 100644 --- a/var/spack/repos/builtin/packages/py-py/package.py +++ b/var/spack/repos/builtin/packages/py-py/package.py @@ -25,7 +25,7 @@ from spack import * -class PyPy(Package): +class PyPy(PythonPackage): """library with cross-python path, ini-parsing, io, code, log facilities""" homepage = "http://pylib.readthedocs.io/en/latest/" @@ -33,9 +33,4 @@ class PyPy(Package): version('1.4.31', '5d2c63c56dc3f2115ec35c066ecd582b') - extends('python') - depends_on('py-setuptools', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-py2cairo/package.py b/var/spack/repos/builtin/packages/py-py2cairo/package.py index efc36457454..bb404c61f01 100644 --- a/var/spack/repos/builtin/packages/py-py2cairo/package.py +++ b/var/spack/repos/builtin/packages/py-py2cairo/package.py @@ -26,19 +26,19 @@ class PyPy2cairo(Package): - """bindings for the Cairo for Python 2, - to be used in Python.""" + """Pycairo is a set of Python bindings for the cairo graphics library.""" - homepage = "https://pypi.python.org/pypi/pycairo" + homepage = "https://www.cairographics.org/pycairo/" url = "https://cairographics.org/releases/py2cairo-1.10.0.tar.bz2" version('1.10.0', '20337132c4ab06c1146ad384d55372c5') extends('python') - depends_on("cairo") - depends_on("pixman") + + depends_on('cairo+X') + depends_on('pixman') def install(self, spec, prefix): - python('waf', 'configure', '--prefix=%s' % prefix) + python('waf', 'configure', '--prefix={0}'.format(prefix)) python('waf', 'build') python('waf', 'install') diff --git a/var/spack/repos/builtin/packages/py-py2neo/package.py b/var/spack/repos/builtin/packages/py-py2neo/package.py index aed0859021b..1db080ac97e 100644 --- a/var/spack/repos/builtin/packages/py-py2neo/package.py +++ b/var/spack/repos/builtin/packages/py-py2neo/package.py @@ -22,11 +22,10 @@ # License along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## -from spack import depends_on, extends, version -from spack import Package +from spack import * -class PyPy2neo(Package): +class PyPy2neo(PythonPackage): """Py2neo is a client library and toolkit for working with Neo4j from within Python applications and from the command line.""" @@ -40,7 +39,3 @@ class PyPy2neo(Package): version('2.0.4', 'b3f7efd3344dc3f66db4eda11e5899f7') depends_on("py-setuptools", type='build') - extends("python") - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-pychecker/package.py b/var/spack/repos/builtin/packages/py-pychecker/package.py index b1f8aad33f1..de09b380c91 100644 --- a/var/spack/repos/builtin/packages/py-pychecker/package.py +++ b/var/spack/repos/builtin/packages/py-pychecker/package.py @@ -25,14 +25,9 @@ from spack import * -class PyPychecker(Package): - """""" +class PyPychecker(PythonPackage): + """Python source code checking tool.""" 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): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-pycodestyle/package.py b/var/spack/repos/builtin/packages/py-pycodestyle/package.py index 9feb5eb8f6e..3e668a2704a 100644 --- a/var/spack/repos/builtin/packages/py-pycodestyle/package.py +++ b/var/spack/repos/builtin/packages/py-pycodestyle/package.py @@ -25,7 +25,7 @@ from spack import * -class PyPycodestyle(Package): +class PyPycodestyle(PythonPackage): """pycodestyle is a tool to check your Python code against some of the style conventions in PEP 8. Note: formerly called pep8.""" @@ -42,11 +42,6 @@ class PyPycodestyle(Package): version('1.5.5', 'cfa12df9b86b3a1dfb13aced1927e12f') version('1.5.4', '3977a760829652543544074c684610ee') - extends('python') - # Most Python packages only require py-setuptools as a build dependency. # However, py-pycodestyle requires py-setuptools during runtime as well. depends_on('py-setuptools', type=('build', 'run')) - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-pycparser/package.py b/var/spack/repos/builtin/packages/py-pycparser/package.py index e7b91f44954..8de5c39d32e 100644 --- a/var/spack/repos/builtin/packages/py-pycparser/package.py +++ b/var/spack/repos/builtin/packages/py-pycparser/package.py @@ -25,15 +25,11 @@ from spack import * -class PyPycparser(Package): +class PyPycparser(PythonPackage): """A complete parser of the C language, written in pure python.""" homepage = "https://github.com/eliben/pycparser" url = "https://pypi.python.org/packages/source/p/pycparser/pycparser-2.13.tar.gz" version('2.13', 'e4fe1a2d341b22e25da0d22f034ef32f') - extends('python') depends_on('py-setuptools', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-pycurl/package.py b/var/spack/repos/builtin/packages/py-pycurl/package.py index ab62440f8ea..81a2a35064f 100644 --- a/var/spack/repos/builtin/packages/py-pycurl/package.py +++ b/var/spack/repos/builtin/packages/py-pycurl/package.py @@ -25,7 +25,7 @@ from spack import * -class PyPycurl(Package): +class PyPycurl(PythonPackage): """PycURL is a Python interface to libcurl. PycURL can be used to fetch objects identified by a URL from a Python program.""" @@ -34,10 +34,6 @@ class PyPycurl(Package): version('7.43.0', 'c94bdba01da6004fa38325e9bd6b9760') - extends('python') depends_on('python@2.6:') depends_on('py-setuptools', type='build') depends_on('curl@7.19.0:') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-pydatalog/package.py b/var/spack/repos/builtin/packages/py-pydatalog/package.py index b2203ae04cf..600a34cdfc3 100644 --- a/var/spack/repos/builtin/packages/py-pydatalog/package.py +++ b/var/spack/repos/builtin/packages/py-pydatalog/package.py @@ -25,14 +25,9 @@ from spack import * -class PyPydatalog(Package): +class PyPydatalog(PythonPackage): """pyDatalog adds logic programming to Python.""" homepage = 'https://pypi.python.org/pypi/pyDatalog/' url = 'https://pypi.python.org/packages/09/0b/2670eb9c0027aacfb5b5024ca75e5fee2f1261180ab8797108ffc941158a/pyDatalog-0.17.1.zip' version('0.17.1', '6b2682301200068d208d6f2d01723939') - - extends('python') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-pyelftools/package.py b/var/spack/repos/builtin/packages/py-pyelftools/package.py index 96a5645541e..d586f14f0d0 100644 --- a/var/spack/repos/builtin/packages/py-pyelftools/package.py +++ b/var/spack/repos/builtin/packages/py-pyelftools/package.py @@ -25,15 +25,10 @@ from spack import * -class PyPyelftools(Package): +class PyPyelftools(PythonPackage): """A pure-Python library for parsing and analyzing ELF files and DWARF debugging information""" homepage = "https://pypi.python.org/pypi/pyelftools" url = "https://pypi.python.org/packages/source/p/pyelftools/pyelftools-0.23.tar.gz" version('0.23', 'aa7cefa8bd2f63d7b017440c9084f310') - - extends('python') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-pyflakes/package.py b/var/spack/repos/builtin/packages/py-pyflakes/package.py index fc904d53345..53674bb6e45 100644 --- a/var/spack/repos/builtin/packages/py-pyflakes/package.py +++ b/var/spack/repos/builtin/packages/py-pyflakes/package.py @@ -25,8 +25,8 @@ from spack import * -class PyPyflakes(Package): - """A simple program which checks Python source files for errors..""" +class PyPyflakes(PythonPackage): + """A simple program which checks Python source files for errors.""" homepage = "https://github.com/PyCQA/pyflakes" url = "https://github.com/PyCQA/pyflakes/archive/1.3.0.tar.gz" @@ -42,11 +42,6 @@ class PyPyflakes(Package): version('0.9.1', '8108d2248e93ca6a315fa2dd31ee9bb1') version('0.9.0', '43c2bcee88606bde55dbf25a253ef886') - extends('python') - # Most Python packages only require py-setuptools as a build dependency. # However, py-pyflakes requires py-setuptools during runtime as well. depends_on('py-setuptools', type=('build', 'run')) - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-pygments/package.py b/var/spack/repos/builtin/packages/py-pygments/package.py index c61b080e142..42e3366cdff 100644 --- a/var/spack/repos/builtin/packages/py-pygments/package.py +++ b/var/spack/repos/builtin/packages/py-pygments/package.py @@ -25,7 +25,7 @@ from spack import * -class PyPygments(Package): +class PyPygments(PythonPackage): """Pygments is a syntax highlighting package written in Python.""" homepage = "https://pypi.python.org/pypi/pygments" @@ -35,9 +35,4 @@ class PyPygments(Package): version('2.0.1', 'e0daf4c14a4fe5b630da765904de4d6c') version('2.0.2', '238587a1370d62405edabd0794b3ec4a') - extends('python') - depends_on('py-setuptools', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-pygobject/package.py b/var/spack/repos/builtin/packages/py-pygobject/package.py index 675eb8f004d..1dae1a128bd 100644 --- a/var/spack/repos/builtin/packages/py-pygobject/package.py +++ b/var/spack/repos/builtin/packages/py-pygobject/package.py @@ -30,6 +30,8 @@ class PyPygobject(AutotoolsPackage): to be used in Python.""" homepage = "https://pypi.python.org/pypi/pygobject" + + # FIXME: This URL is no longer available for download from PyPi url = "https://pypi.python.org/packages/6d/15/97c8b5ccca2be14cf59a2f79e15e3a82a1c3408a6b76b4107689a8b94846/pygobject-2.28.3.tar.bz2" version('2.28.3', 'aa64900b274c4661a5c32e52922977f9') diff --git a/var/spack/repos/builtin/packages/py-pylint/package.py b/var/spack/repos/builtin/packages/py-pylint/package.py index c0c31a76862..84830c9bcf2 100644 --- a/var/spack/repos/builtin/packages/py-pylint/package.py +++ b/var/spack/repos/builtin/packages/py-pylint/package.py @@ -25,7 +25,7 @@ from spack import * -class PyPylint(Package): +class PyPylint(PythonPackage): """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" @@ -39,6 +39,3 @@ class PyPylint(Package): depends_on('py-logilab-common', type=('build', 'run')) depends_on('py-nose', type='build') depends_on('py-setuptools', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-pypar/package.py b/var/spack/repos/builtin/packages/py-pypar/package.py index ffbc2323530..6ba999c063f 100644 --- a/var/spack/repos/builtin/packages/py-pypar/package.py +++ b/var/spack/repos/builtin/packages/py-pypar/package.py @@ -25,7 +25,7 @@ from spack import * -class PyPypar(Package): +class PyPypar(PythonPackage): """Pypar is an efficient but easy-to-use module that allows programs written in Python to run in parallel on multiple processors and communicate using MPI.""" @@ -34,13 +34,10 @@ class PyPypar(Package): version('2.1.5_108', '7a1f28327d2a3b679f9455c843d850b8') - extends('python') depends_on('mpi') - depends_on('py-numpy') + depends_on('py-numpy', type=('build', 'run')) - def install(self, spec, prefix): - with working_dir('source'): - setup_py('install', '--prefix=%s' % prefix) + build_directory = 'source' def url_for_version(self, version): return "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/pypar/pypar-%s.tgz" % version diff --git a/var/spack/repos/builtin/packages/py-pyparsing/package.py b/var/spack/repos/builtin/packages/py-pyparsing/package.py index c3b4432d337..cb158a76d69 100644 --- a/var/spack/repos/builtin/packages/py-pyparsing/package.py +++ b/var/spack/repos/builtin/packages/py-pyparsing/package.py @@ -25,14 +25,9 @@ from spack import * -class PyPyparsing(Package): +class PyPyparsing(PythonPackage): """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): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-pyside/package.py b/var/spack/repos/builtin/packages/py-pyside/package.py index ab8c70140c2..961aef78646 100644 --- a/var/spack/repos/builtin/packages/py-pyside/package.py +++ b/var/spack/repos/builtin/packages/py-pyside/package.py @@ -26,7 +26,7 @@ import os -class PyPyside(Package): +class PyPyside(PythonPackage): """Python bindings for Qt.""" homepage = "https://pypi.python.org/pypi/pyside" url = "https://pypi.python.org/packages/source/P/PySide/PySide-1.2.2.tar.gz" @@ -36,7 +36,6 @@ class PyPyside(Package): depends_on('cmake', type='build') - extends('python') depends_on('py-setuptools', type='build') depends_on('py-sphinx', type=('build', 'run')) depends_on('qt@4.5:4.9') @@ -80,5 +79,5 @@ def patch(self): "'Programming Language :: Python :: 3.5'", "setup.py") - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix, '--jobs=%s' % make_jobs) + def build_args(self, spec, prefix): + return ['--jobs={0}'.format(make_jobs)] diff --git a/var/spack/repos/builtin/packages/py-pytables/package.py b/var/spack/repos/builtin/packages/py-pytables/package.py index 110d13f355d..3d9bfb2c2fc 100644 --- a/var/spack/repos/builtin/packages/py-pytables/package.py +++ b/var/spack/repos/builtin/packages/py-pytables/package.py @@ -25,7 +25,7 @@ from spack import * -class PyPytables(Package): +class PyPytables(PythonPackage): """PyTables is a package for managing hierarchical datasets and designed to efficiently and easily cope with extremely large amounts of data.""" homepage = "http://www.pytables.org/" @@ -35,13 +35,12 @@ class PyPytables(Package): url='https://github.com/PyTables/PyTables/archive/v3.3.0.tar.gz') version('3.2.2', '7cbb0972e4d6580f629996a5bed92441') - extends('python') - depends_on('hdf5') - depends_on('py-numpy', type=('build', 'run')) - depends_on('py-numexpr', type=('build', 'run')) + depends_on('hdf5@1.8.0:1.8.999') + depends_on('py-numpy@1.8.0:', type=('build', 'run')) + depends_on('py-numexpr@2.5.2:', type=('build', 'run')) depends_on('py-cython', type=('build', 'run')) + depends_on('py-six', type=('build', 'run')) depends_on('py-setuptools', type='build') - def install(self, spec, prefix): - env["HDF5_DIR"] = spec['hdf5'].prefix - setup_py('install', '--prefix=%s' % prefix) + def setup_environment(self, spack_env, run_env): + spack_env.set('HDF5_DIR', self.spec['hdf5'].prefix) diff --git a/var/spack/repos/builtin/packages/py-pytest/package.py b/var/spack/repos/builtin/packages/py-pytest/package.py index 1ad356ff4b4..4af49306c2c 100644 --- a/var/spack/repos/builtin/packages/py-pytest/package.py +++ b/var/spack/repos/builtin/packages/py-pytest/package.py @@ -25,7 +25,7 @@ from spack import * -class PyPytest(Package): +class PyPytest(PythonPackage): """pytest: simple powerful testing with Python.""" homepage = "http://doc.pytest.org/en/latest/" @@ -34,10 +34,5 @@ class PyPytest(Package): version('3.0.2', '61dc36e65a6f6c11c53b1388e043a9f5', url="https://pypi.python.org/packages/2b/05/e20806c99afaff43331f5fd8770bb346145303882f98ef3275fa1dd66f6d/pytest-3.0.2.tar.gz") - extends('python') - depends_on('py-setuptools', type='build') depends_on('py-py@1.4.29:', type=('build', 'run')) - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-python-daemon/package.py b/var/spack/repos/builtin/packages/py-python-daemon/package.py index f8532c91752..9ed085f0310 100644 --- a/var/spack/repos/builtin/packages/py-python-daemon/package.py +++ b/var/spack/repos/builtin/packages/py-python-daemon/package.py @@ -25,7 +25,7 @@ from spack import * -class PyPythonDaemon(Package): +class PyPythonDaemon(PythonPackage): """Library to implement a well-behaved Unix daemon process. This library implements the well-behaved daemon specification of @@ -42,9 +42,5 @@ class PyPythonDaemon(Package): version('2.0.5', '73e7f49f525c51fa4a995aea4d80de41') - extends("python") depends_on("py-setuptools", type='build') depends_on("py-lockfile", type=('build', 'run')) - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-pytz/package.py b/var/spack/repos/builtin/packages/py-pytz/package.py index 486b86a4679..7a905f9f989 100644 --- a/var/spack/repos/builtin/packages/py-pytz/package.py +++ b/var/spack/repos/builtin/packages/py-pytz/package.py @@ -25,7 +25,7 @@ from spack import * -class PyPytz(Package): +class PyPytz(PythonPackage): """World timezone definitions, modern and historical.""" homepage = "https://pypi.python.org/pypi/pytz" @@ -37,9 +37,4 @@ class PyPytz(Package): version('2015.4', '417a47b1c432d90333e42084a605d3d8') version('2016.3', 'abae92c3301b27bd8a9f56b14f52cb29') - extends('python') - depends_on('py-setuptools', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-pyyaml/package.py b/var/spack/repos/builtin/packages/py-pyyaml/package.py index d760fcaae93..94d8fdd0e6e 100644 --- a/var/spack/repos/builtin/packages/py-pyyaml/package.py +++ b/var/spack/repos/builtin/packages/py-pyyaml/package.py @@ -25,14 +25,9 @@ from spack import * -class PyPyyaml(Package): +class PyPyyaml(PythonPackage): """PyYAML is a YAML parser and emitter for Python.""" homepage = "http://pyyaml.org/wiki/PyYAML" url = "http://pyyaml.org/download/pyyaml/PyYAML-3.11.tar.gz" version('3.11', 'f50e08ef0fe55178479d3a618efe21db') - - extends('python') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-readme-renderer/package.py b/var/spack/repos/builtin/packages/py-readme-renderer/package.py new file mode 100644 index 00000000000..2abe4bac74e --- /dev/null +++ b/var/spack/repos/builtin/packages/py-readme-renderer/package.py @@ -0,0 +1,42 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# 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/llnl/spack +# Please also see the LICENSE file 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 +############################################################################## +from spack import * + + +class PyReadmeRenderer(PythonPackage): + """readme_renderer is a library for rendering "readme" descriptions + for Warehouse.""" + + homepage = "https://github.com/pypa/readme_renderer" + url = "https://pypi.python.org/packages/f2/6e/ef1bc3a24eb14e14574aba9dc1bd50bc9a5e7cc880e8ff9cadd385b4fb37/readme_renderer-16.0.tar.gz" + + version('16.0', '70321cea986956bcf2deef9981569f39') + + depends_on('python@2.6:2.7,3.2:3.3') + depends_on('py-setuptools', type='build') + depends_on('py-bleach', type=('build', 'run')) + depends_on('py-docutils@0.13.1:', type=('build', 'run')) + depends_on('py-pygments', type=('build', 'run')) + depends_on('py-six', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-restview/package.py b/var/spack/repos/builtin/packages/py-restview/package.py index 1aaf5d8f8a5..871016fdb19 100644 --- a/var/spack/repos/builtin/packages/py-restview/package.py +++ b/var/spack/repos/builtin/packages/py-restview/package.py @@ -25,7 +25,7 @@ from spack import * -class PyRestview(Package): +class PyRestview(PythonPackage): """A viewer for ReStructuredText documents that renders them on the fly.""" homepage = "https://mg.pov.lt/restview/" @@ -33,9 +33,7 @@ class PyRestview(Package): version('2.6.1', 'ac8b70e15b8f1732d1733d674813666b') - extends('python') - depends_on('py-docutils', type=('build', 'run')) + depends_on('python@2.7.0:2.7.999,3.3:3.5') + depends_on('py-docutils@0.13.1:', type=('build', 'run')) + depends_on('py-readme-renderer', type=('build', 'run')) depends_on('py-pygments', type=('build', 'run')) - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-rpy2/package.py b/var/spack/repos/builtin/packages/py-rpy2/package.py index 6308afd3dde..284a41894a2 100644 --- a/var/spack/repos/builtin/packages/py-rpy2/package.py +++ b/var/spack/repos/builtin/packages/py-rpy2/package.py @@ -25,7 +25,7 @@ from spack import * -class PyRpy2(Package): +class PyRpy2(PythonPackage): """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 @@ -38,11 +38,11 @@ class PyRpy2(Package): version('2.5.4', '115a20ac30883f096da2bdfcab55196d') version('2.5.6', 'a36e758b633ce6aec6a5f450bfee980f') - extends('python') + # FIXME: Missing dependencies: + # ld: cannot find -licuuc + # ld: cannot find -licui18 + depends_on('py-six', type=('build', 'run')) depends_on('py-setuptools', type='build') - depends_on('R') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) + depends_on('r') diff --git a/var/spack/repos/builtin/packages/py-rtree/package.py b/var/spack/repos/builtin/packages/py-rtree/package.py index dfb69f6983a..55f98ad19e6 100644 --- a/var/spack/repos/builtin/packages/py-rtree/package.py +++ b/var/spack/repos/builtin/packages/py-rtree/package.py @@ -23,10 +23,9 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## from spack import * -import os -class PyRtree(Package): +class PyRtree(PythonPackage): """Python interface to the RTREE.4 Library.""" homepage = "http://toblerity.org/rtree/" url = "https://github.com/Toblerity/rtree/tarball/0.8.2" @@ -46,16 +45,12 @@ class PyRtree(Package): # Does not work with Spack # version('0.8.2', '593c7ac6babc397b8ba58f1636c1e0a0') - extends('python') - depends_on('py-setuptools', type='build') depends_on('libspatialindex') - def install(self, spec, prefix): - lib = os.path.join(spec['libspatialindex'].prefix, 'lib') - os.environ['SPATIALINDEX_LIBRARY'] = \ - os.path.join(lib, 'libspatialindex.%s' % dso_suffix) - os.environ['SPATIALINDEX_C_LIBRARY'] = \ - os.path.join(lib, 'libspatialindex_c.%s' % dso_suffix) - - setup_py('install', '--prefix=%s' % prefix) + def setup_environment(self, spack_env, run_env): + lib = self.spec['libspatialindex'].prefix.lib + spack_env.set('SPATIALINDEX_LIBRARY', + join_path(lib, 'libspatialindex.%s' % dso_suffix)) + spack_env.set('SPATIALINDEX_C_LIBRARY', + join_path(lib, 'libspatialindex_c.%s' % dso_suffix)) diff --git a/var/spack/repos/builtin/packages/py-scientificpython/package.py b/var/spack/repos/builtin/packages/py-scientificpython/package.py index 48b56ef2faf..f0fe2e4e6c1 100644 --- a/var/spack/repos/builtin/packages/py-scientificpython/package.py +++ b/var/spack/repos/builtin/packages/py-scientificpython/package.py @@ -25,7 +25,7 @@ from spack import * -class PyScientificpython(Package): +class PyScientificpython(PythonPackage): """ScientificPython is a collection of Python modules for scientific computing. It contains support for geometry, mathematical functions, statistics, physical units, IO, @@ -36,8 +36,3 @@ class PyScientificpython(Package): version('2.8.1', '73ee0df19c7b58cdf2954261f0763c77') depends_on('py-numpy') - - extends('python') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-scikit-image/package.py b/var/spack/repos/builtin/packages/py-scikit-image/package.py index 9ea21bdbdf6..d05341f9ebe 100644 --- a/var/spack/repos/builtin/packages/py-scikit-image/package.py +++ b/var/spack/repos/builtin/packages/py-scikit-image/package.py @@ -25,7 +25,7 @@ from spack import * -class PyScikitImage(Package): +class PyScikitImage(PythonPackage): """Image processing algorithms for SciPy, including IO, morphology, filtering, warping, color manipulation, object detection, etc.""" @@ -43,6 +43,3 @@ class PyScikitImage(Package): depends_on('py-scipy', type=('build', 'run')) depends_on('py-matplotlib', type=('build', 'run')) depends_on('py-setuptools', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-scikit-learn/package.py b/var/spack/repos/builtin/packages/py-scikit-learn/package.py index 4a713e6565e..7c7102ce418 100644 --- a/var/spack/repos/builtin/packages/py-scikit-learn/package.py +++ b/var/spack/repos/builtin/packages/py-scikit-learn/package.py @@ -25,8 +25,8 @@ from spack import * -class PyScikitLearn(Package): - """""" +class PyScikitLearn(PythonPackage): + """A set of python modules for machine learning and data mining.""" 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" @@ -34,11 +34,6 @@ class PyScikitLearn(Package): version('0.16.1', '363ddda501e3b6b61726aa40b8dbdb7e') version('0.17.1', 'a2f8b877e6d99b1ed737144f5a478dfc') - extends('python') - depends_on('py-setuptools', type='build') depends_on('py-numpy', type=('build', 'run')) depends_on('py-scipy', type=('build', 'run')) - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-scipy/package.py b/var/spack/repos/builtin/packages/py-scipy/package.py index 509a1f8b943..85b6f631e13 100644 --- a/var/spack/repos/builtin/packages/py-scipy/package.py +++ b/var/spack/repos/builtin/packages/py-scipy/package.py @@ -25,7 +25,7 @@ from spack import * -class PyScipy(Package): +class PyScipy(PythonPackage): """SciPy (pronounced "Sigh Pie") is a Scientific Library for Python. It provides many user-friendly and efficient numerical routines such as routines for numerical integration and optimization.""" @@ -39,16 +39,13 @@ class PyScipy(Package): version('0.15.1', 'be56cd8e60591d6332aac792a5880110') version('0.15.0', '639112f077f0aeb6d80718dc5019dc7a') - extends('python') depends_on('python@2.6:2.8,3.2:') depends_on('py-nose', type='build') # Known not to work with 2.23, 2.25 depends_on('binutils@2.26:', type='build') depends_on('py-numpy@1.7.1:+blas+lapack', type=('build', 'run')) + + # NOTE: scipy picks up Blas/Lapack from numpy, see + # http://www.scipy.org/scipylib/building/linux.html#step-4-build-numpy-1-5-0 depends_on('blas') depends_on('lapack') - - def install(self, spec, prefix): - # NOTE: scipy picks up Blas/Lapack from numpy, see - # http://www.scipy.org/scipylib/building/linux.html#step-4-build-numpy-1-5-0 - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-setuptools/package.py b/var/spack/repos/builtin/packages/py-setuptools/package.py index d696fdf776b..d3558009589 100644 --- a/var/spack/repos/builtin/packages/py-setuptools/package.py +++ b/var/spack/repos/builtin/packages/py-setuptools/package.py @@ -25,7 +25,7 @@ from spack import * -class PySetuptools(Package): +class PySetuptools(PythonPackage): """A Python utility that aids in the process of downloading, building, upgrading, installing, and uninstalling Python packages.""" @@ -41,8 +41,3 @@ class PySetuptools(Package): version('18.1', 'f72e87f34fbf07f299f6cb46256a0b06') version('16.0', '0ace0b96233516fc5f7c857d086aa3ad') version('11.3.1', '01f69212e019a2420c1693fb43593930') - - extends('python') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-shiboken/package.py b/var/spack/repos/builtin/packages/py-shiboken/package.py index c6c23acd33e..3ad51d5fc56 100644 --- a/var/spack/repos/builtin/packages/py-shiboken/package.py +++ b/var/spack/repos/builtin/packages/py-shiboken/package.py @@ -26,7 +26,7 @@ import os -class PyShiboken(Package): +class PyShiboken(PythonPackage): """Shiboken generates bindings for C++ libraries using CPython.""" homepage = "https://shiboken.readthedocs.org/" url = "https://pypi.python.org/packages/source/S/Shiboken/Shiboken-1.2.2.tar.gz" @@ -35,8 +35,8 @@ class PyShiboken(Package): depends_on('cmake', type='build') - extends('python') depends_on("py-setuptools", type='build') + depends_on("py-sphinx", type=('build', 'run')) depends_on("libxml2") depends_on("qt@:4.8") @@ -63,5 +63,5 @@ def patch(self): r'#rpath_cmd(shiboken_path, srcpath)', 'shiboken_postinstall.py') - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix, '--jobs=%s' % make_jobs) + def build_args(self, spec, prefix): + return ['--jobs={0}'.format(make_jobs)] diff --git a/var/spack/repos/builtin/packages/py-simplegeneric/package.py b/var/spack/repos/builtin/packages/py-simplegeneric/package.py index b2ee72822b9..3881f8bc885 100644 --- a/var/spack/repos/builtin/packages/py-simplegeneric/package.py +++ b/var/spack/repos/builtin/packages/py-simplegeneric/package.py @@ -25,8 +25,8 @@ from spack import * -class PySimplegeneric(Package): - """Simple generic functions (similar to Python's own len(), +class PySimplegeneric(PythonPackage): + """Simple generic functions (similar to Python's own len(), pickle.dump(), etc.)""" homepage = "https://pypi.python.org/pypi/simplegeneric" @@ -35,9 +35,4 @@ class PySimplegeneric(Package): version('0.8.1', 'f9c1fab00fd981be588fc32759f474e3') version('0.8', 'eaa358a5f9517a8b475d03fbee3ec90f') - extends('python') - depends_on('py-setuptools', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-singledispatch/package.py b/var/spack/repos/builtin/packages/py-singledispatch/package.py index 05d8c16b44b..9125ecb5f88 100644 --- a/var/spack/repos/builtin/packages/py-singledispatch/package.py +++ b/var/spack/repos/builtin/packages/py-singledispatch/package.py @@ -25,7 +25,7 @@ from spack import * -class PySingledispatch(Package): +class PySingledispatch(PythonPackage): """This library brings functools.singledispatch to Python 2.6-3.3.""" homepage = "https://pypi.python.org/pypi/singledispatch" @@ -33,11 +33,9 @@ class PySingledispatch(Package): version('3.4.0.3', 'af2fc6a3d6cc5a02d0bf54d909785fcb') - extends('python') - depends_on('py-setuptools', type='build') depends_on('py-six') - depends_on('py-ordereddict', when="^python@:2.6.999") - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) + # This dependency breaks concretization + # See https://github.com/LLNL/spack/issues/2793 + # depends_on('py-ordereddict', when="^python@:2.6.999", type=('build', 'run')) # noqa diff --git a/var/spack/repos/builtin/packages/py-six/package.py b/var/spack/repos/builtin/packages/py-six/package.py index 6298f39f32f..7d653fd102c 100644 --- a/var/spack/repos/builtin/packages/py-six/package.py +++ b/var/spack/repos/builtin/packages/py-six/package.py @@ -25,7 +25,7 @@ from spack import * -class PySix(Package): +class PySix(PythonPackage): """Python 2 and 3 compatibility utilities.""" homepage = "https://pypi.python.org/pypi/six" @@ -37,6 +37,3 @@ class PySix(Package): extends('python', ignore=r'bin/pytest') depends_on('py-setuptools', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-sncosmo/package.py b/var/spack/repos/builtin/packages/py-sncosmo/package.py index 6a1fb7c557e..f9d2546da3f 100644 --- a/var/spack/repos/builtin/packages/py-sncosmo/package.py +++ b/var/spack/repos/builtin/packages/py-sncosmo/package.py @@ -25,7 +25,7 @@ from spack import * -class PySncosmo(Package): +class PySncosmo(PythonPackage): """SNCosmo is a Python library for high-level supernova cosmology analysis.""" @@ -46,6 +46,3 @@ class PySncosmo(Package): depends_on('py-iminuit', type=('build', 'run')) depends_on('py-emcee', type=('build', 'run')) depends_on('py-nestle', type=('build', 'run')) - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-snowballstemmer/package.py b/var/spack/repos/builtin/packages/py-snowballstemmer/package.py index 44c05489321..cfeeeb26ce8 100644 --- a/var/spack/repos/builtin/packages/py-snowballstemmer/package.py +++ b/var/spack/repos/builtin/packages/py-snowballstemmer/package.py @@ -25,7 +25,7 @@ from spack import * -class PySnowballstemmer(Package): +class PySnowballstemmer(PythonPackage): """This package provides 16 stemmer algorithms (15 + Poerter English stemmer) generated from Snowball algorithms.""" @@ -33,8 +33,3 @@ class PySnowballstemmer(Package): url = "https://pypi.python.org/packages/source/s/snowballstemmer/snowballstemmer-1.2.1.tar.gz" version('1.2.1', '643b019667a708a922172e33a99bf2fa') - - extends('python') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-sphinx-bootstrap-theme/package.py b/var/spack/repos/builtin/packages/py-sphinx-bootstrap-theme/package.py index 38f127dfc44..bcc68cbc646 100644 --- a/var/spack/repos/builtin/packages/py-sphinx-bootstrap-theme/package.py +++ b/var/spack/repos/builtin/packages/py-sphinx-bootstrap-theme/package.py @@ -25,7 +25,7 @@ from spack import * -class PySphinxBootstrapTheme(Package): +class PySphinxBootstrapTheme(PythonPackage): """Sphinx Bootstrap Theme.""" homepage = "https://pypi.python.org/pypi/sphinx-bootstrap-theme/" @@ -33,9 +33,4 @@ class PySphinxBootstrapTheme(Package): version('0.4.13', '32e513a9c8ffbb8c1e4b036e8f74fb51') - extends('python') - depends_on('py-setuptools', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-sphinx-rtd-theme/package.py b/var/spack/repos/builtin/packages/py-sphinx-rtd-theme/package.py index 9c57628e2c2..4b9141d80ce 100644 --- a/var/spack/repos/builtin/packages/py-sphinx-rtd-theme/package.py +++ b/var/spack/repos/builtin/packages/py-sphinx-rtd-theme/package.py @@ -25,7 +25,7 @@ from spack import * -class PySphinxRtdTheme(Package): +class PySphinxRtdTheme(PythonPackage): """ReadTheDocs.org theme for Sphinx.""" homepage = "https://pypi.python.org/pypi/sphinx_rtd_theme" @@ -34,9 +34,4 @@ class PySphinxRtdTheme(Package): version('0.1.10a0', '83bd95cae55aa8b773a8cc3a41094282', url="https://pypi.python.org/packages/da/6b/1b75f13d8aa3333f19c6cdf1f0bc9f52ea739cae464fbee050307c121857/sphinx_rtd_theme-0.1.10a0.tar.gz") - extends('python') - depends_on('py-setuptools', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-sphinx/package.py b/var/spack/repos/builtin/packages/py-sphinx/package.py index 48b19d4d7b7..b71f2ed8c56 100644 --- a/var/spack/repos/builtin/packages/py-sphinx/package.py +++ b/var/spack/repos/builtin/packages/py-sphinx/package.py @@ -25,7 +25,7 @@ from spack import * -class PySphinx(Package): +class PySphinx(PythonPackage): """Sphinx Documentation Generator.""" homepage = "http://sphinx-doc.org" url = "https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.3.1.tar.gz" @@ -49,6 +49,3 @@ class PySphinx(Package): depends_on('py-alabaster@0.7:', type=('build', 'run')) depends_on('py-imagesize', when='@1.4:', type=('build', 'run')) depends_on('py-sphinx-rtd-theme@0.1:', type=('build', 'run')) # optional as of 1.4 - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-sqlalchemy/package.py b/var/spack/repos/builtin/packages/py-sqlalchemy/package.py index 73e144b00e3..f8221058a08 100644 --- a/var/spack/repos/builtin/packages/py-sqlalchemy/package.py +++ b/var/spack/repos/builtin/packages/py-sqlalchemy/package.py @@ -25,15 +25,10 @@ from spack import * -class PySqlalchemy(Package): +class PySqlalchemy(PythonPackage): """The Python SQL Toolkit and Object Relational Mapper""" homepage = 'http://www.sqlalchemy.org/' url = "https://pypi.python.org/packages/source/S/SQLAlchemy/SQLAlchemy-1.0.12.tar.gz" version('1.0.12', '6d19ef29883bbebdcac6613cf391cac4') - - extends('python') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-storm/package.py b/var/spack/repos/builtin/packages/py-storm/package.py index 74fb2add0d6..a6c29004145 100644 --- a/var/spack/repos/builtin/packages/py-storm/package.py +++ b/var/spack/repos/builtin/packages/py-storm/package.py @@ -22,19 +22,14 @@ # License along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## -from spack import depends_on, extends, version -from spack import Package +from spack import * -class PyStorm(Package): +class PyStorm(PythonPackage): """Storm is an object-relational mapper (ORM) for Python""" homepage = "https://storm.canonical.com/" url = "https://launchpad.net/storm/trunk/0.20/+download/storm-0.20.tar.gz" version('0.20', '8628503141f0f06c0749d607ac09b9c7') - extends('python') depends_on('py-setuptools', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-symengine/package.py b/var/spack/repos/builtin/packages/py-symengine/package.py index 7f7cd84a778..0817d394f22 100644 --- a/var/spack/repos/builtin/packages/py-symengine/package.py +++ b/var/spack/repos/builtin/packages/py-symengine/package.py @@ -25,7 +25,7 @@ from spack import * -class PySymengine(Package): +class PySymengine(PythonPackage): """Python wrappers for SymEngine, a symbolic manipulation library.""" homepage = "https://github.com/symengine/symengine.py" @@ -35,13 +35,11 @@ class PySymengine(Package): version('develop', git='https://github.com/symengine/symengine.py.git') # Build dependencies - extends('python') depends_on('python@2.7:2.8,3.3:') depends_on('py-setuptools', type='build') depends_on('py-cython@0.19.1:') depends_on('cmake@2.8.7:', type='build') depends_on('symengine@0.2.0:') - def install(self, spec, prefix): - python('setup.py', 'install', '--prefix=%s --symengine-dir=%s' % - (prefix, spec['symengine'].prefix)) + def build_args(self, spec, prefix): + return ['--symengine-dir={0}'.format(spec['symengine'].prefix)] diff --git a/var/spack/repos/builtin/packages/py-sympy/package.py b/var/spack/repos/builtin/packages/py-sympy/package.py index 7d1b016263c..58c4167e23e 100644 --- a/var/spack/repos/builtin/packages/py-sympy/package.py +++ b/var/spack/repos/builtin/packages/py-sympy/package.py @@ -25,7 +25,7 @@ from spack import * -class PySympy(Package): +class PySympy(PythonPackage): """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" @@ -33,8 +33,4 @@ class PySympy(Package): version('0.7.6', '3d04753974306d8a13830008e17babca') version('1.0', '43e797de799f00f9e8fd2307dba9fab1') - extends('python') depends_on('py-mpmath', when='@1.0:') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-tappy/package.py b/var/spack/repos/builtin/packages/py-tappy/package.py index c195d08fd97..22bc15392fc 100644 --- a/var/spack/repos/builtin/packages/py-tappy/package.py +++ b/var/spack/repos/builtin/packages/py-tappy/package.py @@ -25,7 +25,7 @@ from spack import * -class PyTappy(Package): +class PyTappy(PythonPackage): """Python TAP interface module for unit tests""" homepage = "https://github.com/mblayman/tappy" # base https://pypi.python.org/pypi/cffi @@ -33,8 +33,9 @@ class PyTappy(Package): version('1.6', 'c8bdb93ad66e05f939905172a301bedf') - extends('python') - depends_on('py-setuptools', type='build') + extends('python', ignore='bin/nosetests|bin/pygmentize') - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) + depends_on('python@2.6:2.7,3.2:3.4') + depends_on('py-nose', type=('build', 'run')) + depends_on('py-pygments', type=('build', 'run')) + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-terminado/package.py b/var/spack/repos/builtin/packages/py-terminado/package.py index e9db560cd56..4cebe14fcab 100644 --- a/var/spack/repos/builtin/packages/py-terminado/package.py +++ b/var/spack/repos/builtin/packages/py-terminado/package.py @@ -25,7 +25,7 @@ from spack import * -class PyTerminado(Package): +class PyTerminado(PythonPackage): """Terminals served to term.js using Tornado websockets""" homepage = "https://pypi.python.org/pypi/terminado" @@ -33,11 +33,6 @@ class PyTerminado(Package): version('0.6', '5b6c65da27fe1ed07a9f80f0588cdaba') - extends('python') - depends_on('py-setuptools', type='build') - depends_on('py-tornado@4:') - depends_on('py-ptyprocess') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) + depends_on('py-tornado@4:', type=('build', 'run')) + depends_on('py-ptyprocess', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-tornado/package.py b/var/spack/repos/builtin/packages/py-tornado/package.py index 0de77a2d574..eb9c6609473 100644 --- a/var/spack/repos/builtin/packages/py-tornado/package.py +++ b/var/spack/repos/builtin/packages/py-tornado/package.py @@ -25,25 +25,24 @@ from spack import * -class PyTornado(Package): +class PyTornado(PythonPackage): """Tornado is a Python web framework and asynchronous networking library.""" homepage = "https://github.com/tornadoweb/tornado" - # base https://pypi.python.org/pypi/tornado/ url = "https://github.com/tornadoweb/tornado/archive/v4.4.0.tar.gz" version('4.4.0', 'c28675e944f364ee96dda3a8d2527a87ed28cfa3') - - extends('python') - + depends_on('py-setuptools', type='build') - + # requirements from setup.py - depends_on('py-backports-ssl-match-hostname', when='^python@:2.7.8') - depends_on('py-singledispatch', when='^python@:3.3') - depends_on('py-certifi', when='^python@:3.3') - depends_on('py-backports-abc@0.4:', when='^python@:3.4') - - def install(self, spec, prefix): - setup_py('build') - setup_py('install', '--prefix={0}'.format(prefix)) + # These dependencies breaks concretization + # See https://github.com/LLNL/spack/issues/2793 + # depends_on('py-backports-ssl-match-hostname', when='^python@:2.7.8', type=('build', 'run')) # noqa + # depends_on('py-singledispatch', when='^python@:3.3', type=('build', 'run')) # noqa + # depends_on('py-certifi', when='^python@:3.3', type=('build', 'run')) + # depends_on('py-backports-abc@0.4:', when='^python@:3.4', type=('build', 'run')) # noqa + depends_on('py-backports-ssl-match-hostname', type=('build', 'run')) + depends_on('py-singledispatch', type=('build', 'run')) + depends_on('py-certifi', type=('build', 'run')) + depends_on('py-backports-abc@0.4:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-traitlets/package.py b/var/spack/repos/builtin/packages/py-traitlets/package.py index 2a087dffb98..debd1dca43a 100644 --- a/var/spack/repos/builtin/packages/py-traitlets/package.py +++ b/var/spack/repos/builtin/packages/py-traitlets/package.py @@ -25,7 +25,7 @@ from spack import * -class PyTraitlets(Package): +class PyTraitlets(PythonPackage): """Traitlets Python config system""" homepage = "https://pypi.python.org/pypi/traitlets" @@ -40,12 +40,11 @@ class PyTraitlets(Package): version('4.0.0', 'b5b95ea5941fd9619b4704dfd8201568') version('4.0', '14544e25ccf8e920ed1cbf833852481f') - extends('python') - depends_on('py-setuptools', type='build') depends_on('py-decorator', type=('build', 'run')) - depends_on('py-ipython-genutils') - depends_on('py-enum34', when='^python@:3.3') + depends_on('py-ipython-genutils', type=('build', 'run')) - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) + # This dependency breaks concretization + # See https://github.com/LLNL/spack/issues/2793 + # depends_on('py-enum34', when='^python@:3.3', type=('build', 'run')) + depends_on('py-enum34', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-tuiview/package.py b/var/spack/repos/builtin/packages/py-tuiview/package.py index 5ce2043fb39..93726cf0047 100644 --- a/var/spack/repos/builtin/packages/py-tuiview/package.py +++ b/var/spack/repos/builtin/packages/py-tuiview/package.py @@ -25,7 +25,7 @@ from spack import * -class PyTuiview(Package): +class PyTuiview(PythonPackage): """TuiView is a lightweight raster GIS with powerful raster attribute table manipulation abilities. """ @@ -35,10 +35,6 @@ class PyTuiview(Package): version('1.1.7', '4b3b38a820cc239c8ab4a181ac5d4c30') - extends("python") depends_on("py-pyqt", type=('build', 'run')) depends_on("py-numpy", type=('build', 'run')) depends_on("gdal") - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-twisted/package.py b/var/spack/repos/builtin/packages/py-twisted/package.py index 80023c2123c..e558adbc7f7 100644 --- a/var/spack/repos/builtin/packages/py-twisted/package.py +++ b/var/spack/repos/builtin/packages/py-twisted/package.py @@ -25,7 +25,7 @@ from spack import * -class PyTwisted(Package): +class PyTwisted(PythonPackage): """An asynchronous networking framework written in Python""" homepage = "https://twistedmatrix.com/" url = "https://pypi.python.org/packages/source/T/Twisted/Twisted-15.3.0.tar.bz2" @@ -34,8 +34,3 @@ class PyTwisted(Package): version('15.3.0', 'b58e83da2f00b3352afad74d0c5c4599') depends_on('py-setuptools', type='build') - - extends('python') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-unittest2/package.py b/var/spack/repos/builtin/packages/py-unittest2/package.py index ddd50a37d41..d6a68c35359 100644 --- a/var/spack/repos/builtin/packages/py-unittest2/package.py +++ b/var/spack/repos/builtin/packages/py-unittest2/package.py @@ -25,7 +25,7 @@ from spack import * -class PyUnittest2(Package): +class PyUnittest2(PythonPackage): """unittest2 is a backport of the new features added to the unittest testing framework in Python 2.7 and onwards.""" @@ -34,8 +34,4 @@ class PyUnittest2(Package): version('1.1.0', 'f72dae5d44f091df36b6b513305ea000') - extends('python') depends_on('py-setuptools', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-unittest2py3k/package.py b/var/spack/repos/builtin/packages/py-unittest2py3k/package.py index 4aee545d748..03134acfcd3 100644 --- a/var/spack/repos/builtin/packages/py-unittest2py3k/package.py +++ b/var/spack/repos/builtin/packages/py-unittest2py3k/package.py @@ -25,7 +25,7 @@ from spack import * -class PyUnittest2py3k(Package): +class PyUnittest2py3k(PythonPackage): """unittest2 is a backport of the new features added to the unittest testing framework in Python 2.7 and 3.2. This is a Python 3 compatible version of unittest2.""" @@ -35,8 +35,5 @@ class PyUnittest2py3k(Package): version('0.5.1', '8824ff92044310d9365f90d892bf0f09') - extends('python') + depends_on('python@3:') depends_on('py-setuptools', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-urwid/package.py b/var/spack/repos/builtin/packages/py-urwid/package.py index 61dec3f1cd2..8e33d2bef2e 100644 --- a/var/spack/repos/builtin/packages/py-urwid/package.py +++ b/var/spack/repos/builtin/packages/py-urwid/package.py @@ -25,7 +25,7 @@ from spack import * -class PyUrwid(Package): +class PyUrwid(PythonPackage): """A full-featured console UI library""" homepage = "http://urwid.org/" url = "https://pypi.python.org/packages/source/u/urwid/urwid-1.3.0.tar.gz" @@ -33,8 +33,3 @@ class PyUrwid(Package): version('1.3.0', 'a989acd54f4ff1a554add464803a9175') depends_on('py-setuptools', type='build') - - extends("python") - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-vcversioner/package.py b/var/spack/repos/builtin/packages/py-vcversioner/package.py index 246a3b7b439..81e4f7bdda6 100644 --- a/var/spack/repos/builtin/packages/py-vcversioner/package.py +++ b/var/spack/repos/builtin/packages/py-vcversioner/package.py @@ -25,17 +25,12 @@ from spack import * -class PyVcversioner(Package): +class PyVcversioner(PythonPackage): """Vcversioner: Take version numbers from version control.""" homepage = "https://github.com/habnabit/vcversioner" - # base https://pypi.python.org/pypi/vcversioner/ url = "https://pypi.python.org/packages/source/v/vcversioner/vcversioner-2.16.0.0.tar.gz" version('2.16.0.0', 'aab6ef5e0cf8614a1b1140ed5b7f107d') - extends('python') depends_on('py-setuptools', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-virtualenv/package.py b/var/spack/repos/builtin/packages/py-virtualenv/package.py index f3730671441..5e6431b6372 100644 --- a/var/spack/repos/builtin/packages/py-virtualenv/package.py +++ b/var/spack/repos/builtin/packages/py-virtualenv/package.py @@ -25,7 +25,7 @@ from spack import * -class PyVirtualenv(Package): +class PyVirtualenv(PythonPackage): """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" @@ -34,8 +34,4 @@ class PyVirtualenv(Package): version('13.0.1', '1ffc011bde6667f0e37ecd976f4934db') version('15.0.1', '28d76a0d9cbd5dc42046dd14e76a6ecc') - extends('python') depends_on('py-setuptools', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-wcsaxes/package.py b/var/spack/repos/builtin/packages/py-wcsaxes/package.py index f7b5c13a133..be1d151ee9c 100644 --- a/var/spack/repos/builtin/packages/py-wcsaxes/package.py +++ b/var/spack/repos/builtin/packages/py-wcsaxes/package.py @@ -25,7 +25,7 @@ from spack import * -class PyWcsaxes(Package): +class PyWcsaxes(PythonPackage): """WCSAxes is a framework for making plots of Astronomical data in Matplotlib.""" @@ -34,10 +34,7 @@ class PyWcsaxes(Package): version('0.8', 'de1c60fdae4c330bf5ddb9f1ab5ab920') - extends('python', ignore=r'bin/pbr') + extends('python', ignore=r'bin/') depends_on('py-numpy', type=('build', 'run')) depends_on('py-matplotlib', type=('build', 'run')) depends_on('py-astropy', type=('build', 'run')) - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-wcwidth/package.py b/var/spack/repos/builtin/packages/py-wcwidth/package.py index 2740d749b59..c4846e2ee75 100644 --- a/var/spack/repos/builtin/packages/py-wcwidth/package.py +++ b/var/spack/repos/builtin/packages/py-wcwidth/package.py @@ -25,7 +25,7 @@ from spack import * -class PyWcwidth(Package): +class PyWcwidth(PythonPackage): """Measures number of Terminal column cells of wide-character codes""" homepage = "https://pypi.python.org/pypi/wcwidth" @@ -33,9 +33,4 @@ class PyWcwidth(Package): version('0.1.7', 'b3b6a0a08f0c8a34d1de8cf44150a4ad') - extends('python') - depends_on('py-setuptools', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-wheel/package.py b/var/spack/repos/builtin/packages/py-wheel/package.py index ce495bf6d0e..7e678df2e86 100644 --- a/var/spack/repos/builtin/packages/py-wheel/package.py +++ b/var/spack/repos/builtin/packages/py-wheel/package.py @@ -25,7 +25,7 @@ from spack import * -class PyWheel(Package): +class PyWheel(PythonPackage): """A built-package format for Python.""" homepage = "https://pypi.python.org/pypi/wheel" @@ -33,8 +33,4 @@ class PyWheel(Package): version('0.26.0', '4cfc6e7e3dc7377d0164914623922a10') - extends('python') depends_on('py-setuptools', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-widgetsnbextension/package.py b/var/spack/repos/builtin/packages/py-widgetsnbextension/package.py index c0833806f87..916263bda6d 100644 --- a/var/spack/repos/builtin/packages/py-widgetsnbextension/package.py +++ b/var/spack/repos/builtin/packages/py-widgetsnbextension/package.py @@ -25,7 +25,7 @@ from spack import * -class PyWidgetsnbextension(Package): +class PyWidgetsnbextension(PythonPackage): """IPython HTML widgets for Jupyter""" homepage = "https://pypi.python.org/pypi/widgetsnbextension" @@ -33,11 +33,6 @@ class PyWidgetsnbextension(Package): version('1.2.6', '0aa4e152c9ba2d704389dc2453f448c7') - extends('python') - depends_on('py-setuptools', type='build') depends_on('python@2.7:2.7.999,3.3:') - depends_on('py-jupyter-notebook@4.2.0:') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) + depends_on('py-jupyter-notebook@4.2.0:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-xlrd/package.py b/var/spack/repos/builtin/packages/py-xlrd/package.py index 9638b8a36b7..bbd2f57b070 100644 --- a/var/spack/repos/builtin/packages/py-xlrd/package.py +++ b/var/spack/repos/builtin/packages/py-xlrd/package.py @@ -25,7 +25,7 @@ from spack import * -class PyXlrd(Package): +class PyXlrd(PythonPackage): """Library for developers to extract data from Microsoft Excel (tm) spreadsheet files""" @@ -33,8 +33,3 @@ class PyXlrd(Package): url = "https://pypi.python.org/packages/source/x/xlrd/xlrd-0.9.4.tar.gz" version('0.9.4', '911839f534d29fe04525ef8cd88fe865') - - extends('python') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-xpyb/package.py b/var/spack/repos/builtin/packages/py-xpyb/package.py index 49c6343c452..136da54dcf3 100644 --- a/var/spack/repos/builtin/packages/py-xpyb/package.py +++ b/var/spack/repos/builtin/packages/py-xpyb/package.py @@ -25,7 +25,7 @@ from spack import * -class PyXpyb(Package): +class PyXpyb(AutotoolsPackage): """xpyb provides a Python binding to the X Window System protocol via libxcb.""" @@ -39,9 +39,3 @@ class PyXpyb(Package): depends_on('libxcb@1.5:') depends_on('xcb-proto@1.7.1:', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/py-yapf/package.py b/var/spack/repos/builtin/packages/py-yapf/package.py index eab4d54abc7..5f5d32e3d00 100644 --- a/var/spack/repos/builtin/packages/py-yapf/package.py +++ b/var/spack/repos/builtin/packages/py-yapf/package.py @@ -25,7 +25,7 @@ from spack import * -class PyYapf(Package): +class PyYapf(PythonPackage): """ Yet Another Python Formatter """ homepage = "https://github.com/google/yapf" # base https://pypi.python.org/pypi/cffi @@ -33,8 +33,4 @@ class PyYapf(Package): version('0.2.1', '348ccf86cf2057872e4451b204fb914c') - extends('python') depends_on('py-setuptools', type='build') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-yt/package.py b/var/spack/repos/builtin/packages/py-yt/package.py index cf359121916..4a61bfcec99 100644 --- a/var/spack/repos/builtin/packages/py-yt/package.py +++ b/var/spack/repos/builtin/packages/py-yt/package.py @@ -26,7 +26,7 @@ from spack import * -class PyYt(Package): +class PyYt(PythonPackage): """Volumetric Data Analysis yt is a python package for analyzing and visualizing @@ -54,8 +54,6 @@ class PyYt(Package): variant("h5py", default=True, description="enable h5py support") variant("scipy", default=True, description="enable scipy support") - extends("python") - depends_on("py-astropy", type=('build', 'run'), when="+astropy") depends_on("py-cython", type=('build', 'run')) depends_on("py-h5py", type=('build', 'run'), when="+h5py") @@ -67,12 +65,9 @@ class PyYt(Package): depends_on("py-sympy", type=('build', 'run')) depends_on("python @2.7:2.999,3.4:") - def install(self, spec, prefix): - setup_py("install", "--prefix=%s" % prefix) - self.check_install(spec, prefix) - - def check_install(self, spec, prefix): + @run_after('install') + def check_install(self): # The Python interpreter path can be too long for this # yt = Executable(join_path(prefix.bin, "yt")) # yt("--help") - python(join_path(prefix.bin, "yt"), "--help") + python(join_path(self.prefix.bin, "yt"), "--help") diff --git a/var/spack/repos/builtin/packages/py-zmq/package.py b/var/spack/repos/builtin/packages/py-zmq/package.py index ff2373c2f4c..cbc0e02e6e1 100644 --- a/var/spack/repos/builtin/packages/py-zmq/package.py +++ b/var/spack/repos/builtin/packages/py-zmq/package.py @@ -25,21 +25,16 @@ from spack import * -class PyZmq(Package): +class PyZmq(PythonPackage): """PyZMQ: Python bindings for zeromq.""" homepage = "https://github.com/zeromq/pyzmq" - # base https://pypi.python.org/pypi/pyzmq/ url = "https://github.com/zeromq/pyzmq/archive/v14.7.0.tar.gz" version('16.0.2', '4cf14a2995742253b2b009541f4436f4') version('14.7.0', 'bf304fb73d72aee314ff82d3554328c179938ecf') - extends('python') depends_on('py-setuptools', type='build') - depends_on('py-cython@0.16:') - depends_on('py-py') - depends_on('py-cffi') + depends_on('py-cython@0.16:', type=('build', 'run')) + depends_on('py-py', type=('build', 'run')) + depends_on('py-cffi', type=('build', 'run')) depends_on('zeromq') - - def install(self, spec, prefix): - setup_py('install', '--prefix={0}'.format(prefix)) diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py index 7a5904ddd92..9a04aaf9812 100644 --- a/var/spack/repos/builtin/packages/python/package.py +++ b/var/spack/repos/builtin/packages/python/package.py @@ -99,6 +99,11 @@ def patch(self): r'\1setup.py\2 --no-user-cfg \3\6' ) + @when('@:2.6,3.0:3.3') + def patch(self): + # See https://github.com/LLNL/spack/issues/1490 + pass + def install(self, spec, prefix): # TODO: The '--no-user-cfg' option for Python installation is only in # Python v2.7 and v3.4+ (see https://bugs.python.org/issue1180) and @@ -143,6 +148,16 @@ def install(self, spec, prefix): make() make('install') + self.sysconfigfilename = '_sysconfigdata.py' + if spec.satisfies('@3.6:'): + # Python 3.6.0 renamed the sys config file + python3 = os.path.join(prefix.bin, + 'python{0}'.format(self.version.up_to(1))) + python = Executable(python3) + sc = 'import sysconfig; print(sysconfig._get_sysconfigdata_name())' + cf = python('-c', sc, output=str).strip('\n') + self.sysconfigfilename = '{0}.py'.format(cf) + self._save_distutil_vars(prefix) self.filter_compilers(prefix) @@ -202,12 +217,11 @@ def _save_distutil_vars(self, prefix): input_filename = None for filename in [join_path(lib_dir, 'python{0}'.format(self.version.up_to(2)), - '_sysconfigdata.py') + self.sysconfigfilename) for lib_dir in [prefix.lib, prefix.lib64]]: if os.path.isfile(filename): input_filename = filename break - if not input_filename: return @@ -296,7 +310,7 @@ def filter_compilers(self, prefix): config_dirname = 'config-{0}m'.format( self.version.up_to(2)) if self.spec.satisfies('@3:') else 'config' - rel_filenames = ['_sysconfigdata.py', + rel_filenames = [self.sysconfigfilename, join_path(config_dirname, 'Makefile')] abs_filenames = [join_path(dirname, filename) for dirname in diff --git a/var/spack/repos/builtin/packages/qt/package.py b/var/spack/repos/builtin/packages/qt/package.py index 95698018fa4..447af5f1af8 100644 --- a/var/spack/repos/builtin/packages/qt/package.py +++ b/var/spack/repos/builtin/packages/qt/package.py @@ -227,7 +227,7 @@ def common_config_args(self): @when('@3') def configure(self): # A user reported that this was necessary to link Qt3 on ubuntu - os.environ['LD_LIBRARY_PATH'] = os.getcwd() + '/lib' + os.environ['LD_LIBRARY_PATH'] += os.pathsep + os.getcwd() + '/lib' configure('-prefix', self.prefix, '-v', '-thread', diff --git a/var/spack/repos/builtin/packages/r-adabag/package.py b/var/spack/repos/builtin/packages/r-adabag/package.py new file mode 100644 index 00000000000..aa160478568 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-adabag/package.py @@ -0,0 +1,39 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# 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/llnl/spack +# Please also see the LICENSE file 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 +############################################################################## +from spack import * + + +class RAdabag(RPackage): + """Applies Multiclass AdaBoost.M1, SAMME and Bagging.""" + + homepage = "https://cran.r-project.org/package=adabag" + url = "https://cran.r-project.org/src/contrib/adabag_4.1.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/adabag" + + version('4.1', '2e019f053d49f62ebb3b1697bbb50afa') + + depends_on('r-rpart', type=('build', 'run')) + depends_on('r-mlbench', type=('build', 'run')) + depends_on('r-caret', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/r-assertthat/package.py b/var/spack/repos/builtin/packages/r-assertthat/package.py index 97c29b4a999..b8ab7d7a0cd 100644 --- a/var/spack/repos/builtin/packages/r-assertthat/package.py +++ b/var/spack/repos/builtin/packages/r-assertthat/package.py @@ -31,7 +31,8 @@ class RAssertthat(RPackage): producing friendly error messages so that your users know what they've done wrong.""" - homepage = "https://cran.r-project.org/web/packages/assertthat/index.html" + homepage = "https://cran.r-project.org/package=assertthat" url = "https://cran.r-project.org/src/contrib/assertthat_0.1.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/assertthat" version('0.1', '59f9d7f7c00077ea54d763b78eeb5798') diff --git a/var/spack/repos/builtin/packages/r-biocinstaller/package.py b/var/spack/repos/builtin/packages/r-biocinstaller/package.py new file mode 100644 index 00000000000..c145de688cc --- /dev/null +++ b/var/spack/repos/builtin/packages/r-biocinstaller/package.py @@ -0,0 +1,37 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# 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/llnl/spack +# Please also see the LICENSE file 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 +############################################################################## +from spack import * + + +class RBiocinstaller(RPackage): + """This package is used to install and update Bioconductor, CRAN, + and (some) github packages.""" + + homepage = "http://bioconductor.org/packages/devel/bioc/html/BiocInstaller.html" + url = "http://bioconductor.org/packages/devel/bioc/src/contrib/BiocInstaller_1.25.3.tar.gz" + + version('1.25.3', '6214770455a5122dca5544861f52c91d') + + depends_on('r@3.4.0:') diff --git a/var/spack/repos/builtin/packages/r-car/package.py b/var/spack/repos/builtin/packages/r-car/package.py index 80a0206a8ac..56c87c27a6d 100644 --- a/var/spack/repos/builtin/packages/r-car/package.py +++ b/var/spack/repos/builtin/packages/r-car/package.py @@ -30,13 +30,14 @@ class RCar(RPackage): Companion to Applied Regression, Second Edition, Sage, 2011.""" homepage = "https://r-forge.r-project.org/projects/car/" - url = "https://cran.r-project.org/src/contrib/car_2.1-2.tar.gz" + url = "https://cran.r-project.org/src/contrib/car_2.1-4.tar.gz" list_url = "https://cran.r-project.org/src/contrib/Archive/car" + version('2.1-4', 'a66c307e8ccf0c336ed197c0f1799565') version('2.1-2', '0f78ad74ef7130126d319acec23951a0') - depends_on('r-mass', type=('build','run')) - depends_on('r-mgcv', type=('build','run')) - depends_on('r-nnet', type=('build','run')) - depends_on('r-pbkrtest', type=('build','run')) - depends_on('r-quantreg', type=('build','run')) + depends_on('r-mass', type=('build', 'run')) + depends_on('r-mgcv', type=('build', 'run')) + depends_on('r-nnet', type=('build', 'run')) + depends_on('r-pbkrtest', type=('build', 'run')) + depends_on('r-quantreg', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/r-caret/package.py b/var/spack/repos/builtin/packages/r-caret/package.py index d795cfa2047..277fdc71430 100644 --- a/var/spack/repos/builtin/packages/r-caret/package.py +++ b/var/spack/repos/builtin/packages/r-caret/package.py @@ -30,15 +30,19 @@ class RCaret(RPackage): models.""" homepage = "https://github.com/topepo/caret/" - url = "https://cran.r-project.org/src/contrib/caret_6.0-70.tar.gz" + url = "https://cran.r-project.org/src/contrib/caret_6.0-73.tar.gz" list_url = "https://cran.r-project.org/src/contrib/Archive/caret" + version('6.0-73', 'ca869e3357b5358f028fb926eb62eb70') version('6.0-70', '202d7abb6a679af716ea69fb2573f108') - depends_on('r-lattice', type=('build','run')) - depends_on('r-ggplot2', type=('build','run')) - depends_on('r-car', type=('build','run')) - depends_on('r-foreach', type=('build','run')) - depends_on('r-plyr', type=('build','run')) - depends_on('r-nlme', type=('build','run')) - depends_on('r-reshape2', type=('build','run')) + depends_on('r@2.10:') + + depends_on('r-lattice@0.20:', type=('build', 'run')) + depends_on('r-ggplot2', type=('build', 'run')) + depends_on('r-car', type=('build', 'run')) + depends_on('r-foreach', type=('build', 'run')) + depends_on('r-plyr', type=('build', 'run')) + depends_on('r-modelmetrics@1.1.0:', type=('build', 'run')) + depends_on('r-nlme', type=('build', 'run')) + depends_on('r-reshape2', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/r-checkpoint/package.py b/var/spack/repos/builtin/packages/r-checkpoint/package.py new file mode 100644 index 00000000000..5fd862fa46f --- /dev/null +++ b/var/spack/repos/builtin/packages/r-checkpoint/package.py @@ -0,0 +1,41 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# 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/llnl/spack +# Please also see the LICENSE file 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 +############################################################################## +from spack import * + + +class RCheckpoint(RPackage): + """The goal of checkpoint is to solve the problem of package + reproducibility in R. Specifically, checkpoint allows you to + install packages as they existed on CRAN on a specific snapshot + date as if you had a CRAN time machine.""" + + homepage = "https://cran.r-project.org/package=checkpoint" + url = "https://cran.r-project.org/src/contrib/checkpoint_0.3.18.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/checkpoint" + + version('0.3.18', '021d7faeb72c36167951e103b2b065ea') + version('0.3.15', 'a4aa8320338f1434a330d984e97981ea') + + depends_on('r@3.0.0:') diff --git a/var/spack/repos/builtin/packages/r-cluster/package.py b/var/spack/repos/builtin/packages/r-cluster/package.py index 29e16c22715..caa96a380a1 100644 --- a/var/spack/repos/builtin/packages/r-cluster/package.py +++ b/var/spack/repos/builtin/packages/r-cluster/package.py @@ -31,7 +31,8 @@ class RCluster(RPackage): (1990) "Finding Groups in Data".""" homepage = "https://cran.r-project.org/web/packages/cluster/index.html" - url = "https://cran.r-project.org/src/contrib/cluster_2.0.4.tar.gz" + url = "https://cran.r-project.org/src/contrib/cluster_2.0.5.tar.gz" list_url = "https://cran.r-project.org/src/contrib/Archive/cluster" + version('2.0.5', '7330f209ebce960bdee1a6d6679cb85a') version('2.0.4', 'bb4deceaafb1c42bb1278d5d0dc11e59') diff --git a/var/spack/repos/builtin/packages/r-codetools/package.py b/var/spack/repos/builtin/packages/r-codetools/package.py index 39186bf54a1..60b8fc2cc8a 100644 --- a/var/spack/repos/builtin/packages/r-codetools/package.py +++ b/var/spack/repos/builtin/packages/r-codetools/package.py @@ -29,7 +29,8 @@ class RCodetools(RPackage): """Code analysis tools for R.""" homepage = "https://cran.r-project.org/web/packages/codetools/index.html" - url = "https://cran.r-project.org/src/contrib/codetools_0.2-14.tar.gz" + url = "https://cran.r-project.org/src/contrib/codetools_0.2-15.tar.gz" list_url = "https://cran.r-project.org/src/contrib/Archive/codetools" + version('0.2-15', '37419cbc3de81984cf6d9b207d4f62d4') version('0.2-14', '7ec41d4f8bd6ba85facc8c5e6adc1f4d') diff --git a/var/spack/repos/builtin/packages/r-coin/package.py b/var/spack/repos/builtin/packages/r-coin/package.py new file mode 100644 index 00000000000..51b61a6164e --- /dev/null +++ b/var/spack/repos/builtin/packages/r-coin/package.py @@ -0,0 +1,44 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# 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/llnl/spack +# Please also see the LICENSE file 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 +############################################################################## +from spack import * + + +class RCoin(RPackage): + """Conditional inference procedures for the general independence problem + including two-sample, K-sample (non-parametric ANOVA), correlation, + censored, ordered and multivariate problems.""" + + homepage = "https://cran.r-project.org/package=coin" + url = "https://cran.r-project.org/src/contrib/coin_1.1-3.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/coin" + + version('1.1-3', '97d3d21f1e4a5762e36dd718dd2d0661') + + depends_on('r@2.14.0:') + + depends_on('r-survival', type=('build', 'run')) + depends_on('r-modeltools@0.2-9:', type=('build', 'run')) + depends_on('r-mvtnorm@1.0-5:', type=('build', 'run')) + depends_on('r-multcomp', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/r-colorspace/package.py b/var/spack/repos/builtin/packages/r-colorspace/package.py index b7561ea3603..af2895acbf4 100644 --- a/var/spack/repos/builtin/packages/r-colorspace/package.py +++ b/var/spack/repos/builtin/packages/r-colorspace/package.py @@ -32,7 +32,8 @@ class RColorspace(RPackage): are provided.""" homepage = "https://cran.r-project.org/web/packages/colorspace/index.html" - url = "https://cran.r-project.org/src/contrib/colorspace_1.2-6.tar.gz" + url = "https://cran.r-project.org/src/contrib/colorspace_1.3-2.tar.gz" list_url = "https://cran.r-project.org/src/contrib/Archive/colorspace" + version('1.3-2', '63000bab81d995ff167df76fb97b2984') version('1.2-6', 'a30191e9caf66f77ff4e99c062e9dce1') diff --git a/var/spack/repos/builtin/packages/r-corrplot/package.py b/var/spack/repos/builtin/packages/r-corrplot/package.py new file mode 100644 index 00000000000..ccae3bf9138 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-corrplot/package.py @@ -0,0 +1,36 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# 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/llnl/spack +# Please also see the LICENSE file 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 +############################################################################## +from spack import * + + +class RCorrplot(RPackage): + """A graphical display of a correlation matrix or general matrix. + It also contains some algorithms to do matrix reordering.""" + + homepage = "https://cran.r-project.org/package=corrplot" + url = "https://cran.r-project.org/src/contrib/corrplot_0.77.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/corrplot" + + version('0.77', '2a5d54fd5c65618b9afba1a32f6b4542') diff --git a/var/spack/repos/builtin/packages/r-cubist/package.py b/var/spack/repos/builtin/packages/r-cubist/package.py new file mode 100644 index 00000000000..acc02613833 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-cubist/package.py @@ -0,0 +1,38 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# 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/llnl/spack +# Please also see the LICENSE file 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 +############################################################################## +from spack import * + + +class RCubist(RPackage): + """Regression modeling using rules with added instance-based corrections""" + + homepage = "https://cran.r-project.org/package=Cubist" + url = "https://cran.r-project.org/src/contrib/Cubist_0.0.19.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/Cubist" + + version('0.0.19', 'bf9364f655536ec03717fd2ad6223a47') + + depends_on('r-lattice', type=('build', 'run')) + depends_on('r-reshape2', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/r-curl/package.py b/var/spack/repos/builtin/packages/r-curl/package.py index 7b62d1be603..ae9ccf3f5e8 100644 --- a/var/spack/repos/builtin/packages/r-curl/package.py +++ b/var/spack/repos/builtin/packages/r-curl/package.py @@ -37,10 +37,12 @@ class RCurl(RPackage): package with http specific tools and logic.""" homepage = "https://github.com/jeroenooms/curl" - url = "https://cran.r-project.org/src/contrib/curl_0.9.7.tar.gz" + url = "https://cran.r-project.org/src/contrib/curl_2.3.tar.gz" list_url = "https://cran.r-project.org/src/contrib/Archive/curl" - version('1.0', '93d34926d6071e1fba7e728b482f0dd9') + version('2.3', '7250ee8caed98ba76906ab4d32da60f8') + version('1.0', '93d34926d6071e1fba7e728b482f0dd9') version('0.9.7', 'a101f7de948cb828fef571c730f39217') + depends_on('r@3.0.0:') depends_on('curl') diff --git a/var/spack/repos/builtin/packages/r-datatable/package.py b/var/spack/repos/builtin/packages/r-data-table/package.py similarity index 90% rename from var/spack/repos/builtin/packages/r-datatable/package.py rename to var/spack/repos/builtin/packages/r-data-table/package.py index 23802524e82..4381d1e0f88 100644 --- a/var/spack/repos/builtin/packages/r-datatable/package.py +++ b/var/spack/repos/builtin/packages/r-data-table/package.py @@ -25,16 +25,17 @@ from spack import * -class RDatatable(RPackage): +class RDataTable(RPackage): """Fast aggregation of large data (e.g. 100GB in RAM), fast ordered joins, fast add/modify/delete of columns by group using no copies at all, list columns and a fast file reader (fread). Offers a natural and flexible syntax, for faster development.""" homepage = "https://github.com/Rdatatable/data.table/wiki" - url = "https://cran.r-project.org/src/contrib/data.table_1.9.6.tar.gz" + url = "https://cran.r-project.org/src/contrib/data.table_1.10.0.tar.gz" list_url = "https://cran.r-project.org/src/contrib/Archive/data.table" - version('1.9.6', 'b1c0c7cce490bdf42ab288541cc55372') + version('1.10.0', 'f0e08dd5ba1b3f46c59dd1574fe497c1') + version('1.9.6', 'b1c0c7cce490bdf42ab288541cc55372') - depends_on('r-chron', type=('build', 'run')) + depends_on('r@3.0.0:') diff --git a/var/spack/repos/builtin/packages/r-devtools/package.py b/var/spack/repos/builtin/packages/r-devtools/package.py index 9895a3b3900..c994f557c81 100644 --- a/var/spack/repos/builtin/packages/r-devtools/package.py +++ b/var/spack/repos/builtin/packages/r-devtools/package.py @@ -29,16 +29,19 @@ class RDevtools(RPackage): """Collection of package development tools.""" homepage = "https://github.com/hadley/devtools" - url = "https://cran.r-project.org/src/contrib/devtools_1.11.1.tar.gz" + url = "https://cran.r-project.org/src/contrib/devtools_1.12.0.tar.gz" list_url = "https://cran.r-project.org/src/contrib/Archive/devtools" + version('1.12.0', '73b46c446273566e5b21c9f5f72aeca3') version('1.11.1', '242672ee27d24dddcbdaac88c586b6c2') - depends_on('r-httr', type=('build', 'run')) - depends_on('r-memoise', type=('build', 'run')) + depends_on('r@3.0.2:') + + depends_on('r-httr@0.4:', type=('build', 'run')) + depends_on('r-memoise@1.0.0:', type=('build', 'run')) depends_on('r-whisker', type=('build', 'run')) depends_on('r-digest', type=('build', 'run')) - depends_on('r-rstudioapi', type=('build', 'run')) + depends_on('r-rstudioapi@0.2.0:', type=('build', 'run')) depends_on('r-jsonlite', type=('build', 'run')) - depends_on('r-git2r', type=('build', 'run')) + depends_on('r-git2r@0.11.0:', type=('build', 'run')) depends_on('r-withr', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/r-digest/package.py b/var/spack/repos/builtin/packages/r-digest/package.py index 7e077442f96..08f5af0aca3 100644 --- a/var/spack/repos/builtin/packages/r-digest/package.py +++ b/var/spack/repos/builtin/packages/r-digest/package.py @@ -44,7 +44,11 @@ class RDigest(RPackage): used.""" homepage = "http://dirk.eddelbuettel.com/code/digest.html" - url = "https://cran.r-project.org/src/contrib/digest_0.6.9.tar.gz" + url = "https://cran.r-project.org/src/contrib/digest_0.6.12.tar.gz" list_url = "https://cran.r-project.org/src/contrib/Archive/digest" - version('0.6.9', '48048ce6c466bdb124716e45ba4a0e83') + version('0.6.12', '738efd4d9a37c5a4001ae66e954ce07e') + version('0.6.11', '52a864f55846b48b3cab0b5d0304a82a') + version('0.6.9', '48048ce6c466bdb124716e45ba4a0e83') + + depends_on('r@2.4.1:') diff --git a/var/spack/repos/builtin/packages/r-domc/package.py b/var/spack/repos/builtin/packages/r-domc/package.py new file mode 100644 index 00000000000..1a44aa537d7 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-domc/package.py @@ -0,0 +1,41 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# 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/llnl/spack +# Please also see the LICENSE file 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 +############################################################################## +from spack import * + + +class RDomc(RPackage): + """Provides a parallel backend for the %dopar% function using + the multicore functionality of the parallel package.""" + + homepage = "https://cran.r-project.org/package=doMC" + url = "https://cran.r-project.org/src/contrib/doMC_1.3.4.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/doMC" + + version('1.3.4', 'f965b09add9056e84f99a831dc3af7d1') + + depends_on('r@2.14.0:') + + depends_on('r-foreach@1.2.0:', type=('build', 'run')) + depends_on('r-iterators@1.0.0:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/r-ellipse/package.py b/var/spack/repos/builtin/packages/r-ellipse/package.py new file mode 100644 index 00000000000..1f6144285e9 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-ellipse/package.py @@ -0,0 +1,38 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# 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/llnl/spack +# Please also see the LICENSE file 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 +############################################################################## +from spack import * + + +class REllipse(RPackage): + """This package contains various routines for drawing ellipses and + ellipse-like confidence regions.""" + + homepage = "https://cran.r-project.org/package=ellipse" + url = "https://cran.r-project.org/src/contrib/ellipse_0.3-8.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/ellipse" + + version('0.3-8', '385f5ec5e49bcda4317ca9dffd33f771') + + depends_on('r@2.0.0:') diff --git a/var/spack/repos/builtin/packages/r-evaluate/package.py b/var/spack/repos/builtin/packages/r-evaluate/package.py index cf6c72dc62e..004048e9857 100644 --- a/var/spack/repos/builtin/packages/r-evaluate/package.py +++ b/var/spack/repos/builtin/packages/r-evaluate/package.py @@ -35,6 +35,9 @@ class REvaluate(RPackage): url = "https://cran.rstudio.com/src/contrib/evaluate_0.9.tar.gz" list_url = "https://cran.rstudio.com/src/contrib/Archive/evaluate" - version('0.9', '877d89ce8a9ef7f403b1089ca1021775') + version('0.10', 'c49326babf984a8b36e7e276da370ad2') + version('0.9', '877d89ce8a9ef7f403b1089ca1021775') - depends_on('r-stringr', type=('build', 'run')) + depends_on('r@3.0.2:') + + depends_on('r-stringr@0.6.2:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/r-ggplot2/package.py b/var/spack/repos/builtin/packages/r-ggplot2/package.py index 3b4c437f0c2..e5c80e4b799 100644 --- a/var/spack/repos/builtin/packages/r-ggplot2/package.py +++ b/var/spack/repos/builtin/packages/r-ggplot2/package.py @@ -35,14 +35,19 @@ class RGgplot2(RPackage): documentation and examples.""" homepage = "http://ggplot2.org/" - url = "https://cran.r-project.org/src/contrib/ggplot2_2.1.0.tar.gz" + url = "https://cran.r-project.org/src/contrib/ggplot2_2.2.1.tar.gz" list_url = "https://cran.r-project.org/src/contrib/Archive/ggplot2" + version('2.2.1', '14c5a3507bc123c6e7e9ad3bef7cee5c') version('2.1.0', '771928cfb97c649c720423deb3ec7fd3') + depends_on('r@3.1:') + depends_on('r-digest', type=('build', 'run')) - depends_on('r-gtable', type=('build', 'run')) + depends_on('r-gtable@0.1.1:', type=('build', 'run')) depends_on('r-mass', type=('build', 'run')) - depends_on('r-plyr', type=('build', 'run')) + depends_on('r-plyr@1.7.1:', type=('build', 'run')) depends_on('r-reshape2', type=('build', 'run')) - depends_on('r-scales', type=('build', 'run')) + depends_on('r-scales@0.4.1', type=('build', 'run')) + depends_on('r-tibble', type=('build', 'run')) + depends_on('r-lazyeval', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/r-git2r/package.py b/var/spack/repos/builtin/packages/r-git2r/package.py index 7c4ff3144ba..a0df2d9b230 100644 --- a/var/spack/repos/builtin/packages/r-git2r/package.py +++ b/var/spack/repos/builtin/packages/r-git2r/package.py @@ -31,10 +31,13 @@ class RGit2r(RPackage): data and running some basic 'Git' commands.""" homepage = "https://github.com/ropensci/git2r" - url = "https://cran.r-project.org/src/contrib/git2r_0.15.0.tar.gz" + url = "https://cran.r-project.org/src/contrib/git2r_0.18.0.tar.gz" list_url = "https://cran.r-project.org/src/contrib/Archive/git2r" + version('0.18.0', 'fb5741eb490c3d6e23a751a72336f24d') version('0.15.0', '57658b3298f9b9aadc0dd77b4ef6a1e1') + depends_on('r@3.0.2:') + depends_on('zlib') depends_on('openssl') diff --git a/var/spack/repos/builtin/packages/r-httpuv/package.py b/var/spack/repos/builtin/packages/r-httpuv/package.py index e4b60893b61..a81e3c3fb18 100644 --- a/var/spack/repos/builtin/packages/r-httpuv/package.py +++ b/var/spack/repos/builtin/packages/r-httpuv/package.py @@ -40,4 +40,6 @@ class RHttpuv(RPackage): version('1.3.3', 'c78ae068cf59e949b9791be987bb4489') - depends_on('r-rcpp', type=('build', 'run')) + depends_on('r@2.15.1:') + + depends_on('r-rcpp@0.11.0:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/r-httr/package.py b/var/spack/repos/builtin/packages/r-httr/package.py index 55a5b0efab2..b27bee4fbbe 100644 --- a/var/spack/repos/builtin/packages/r-httr/package.py +++ b/var/spack/repos/builtin/packages/r-httr/package.py @@ -31,13 +31,16 @@ class RHttr(RPackage): request components (authenticate(), add_headers() and so on).""" homepage = "https://github.com/hadley/httr" - url = "https://cran.r-project.org/src/contrib/httr_1.1.0.tar.gz" + url = "https://cran.r-project.org/src/contrib/httr_1.2.1.tar.gz" list_url = "https://cran.r-project.org/src/contrib/Archive/httr" + version('1.2.1', 'c469948dedac9ab3926f23cf484b33d9') version('1.1.0', '5ffbbc5c2529e49f00aaa521a2b35600') + depends_on('r@3.0.0:') + depends_on('r-jsonlite', type=('build', 'run')) depends_on('r-mime', type=('build', 'run')) - depends_on('r-curl', type=('build', 'run')) + depends_on('r-curl@0.9.1:', type=('build', 'run')) depends_on('r-openssl', type=('build', 'run')) depends_on('r-r6', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/r-ipred/package.py b/var/spack/repos/builtin/packages/r-ipred/package.py new file mode 100644 index 00000000000..37accb6ee28 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-ipred/package.py @@ -0,0 +1,46 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# 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/llnl/spack +# Please also see the LICENSE file 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 +############################################################################## +from spack import * + + +class RIpred(RPackage): + """Improved predictive models by indirect classification and bagging for + classification, regression and survival problems as well as resampling + based estimators of prediction error.""" + + homepage = "https://cran.r-project.org/package=ipred" + url = "https://cran.r-project.org/src/contrib/ipred_0.9-5.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/ipred" + + version('0.9-5', 'ce8768547a7aa9554ad3650b18ea3cbd') + + depends_on('r@2.10:') + + depends_on('r-rpart@3.1-8:', type=('build', 'run')) + depends_on('r-mass', type=('build', 'run')) + depends_on('r-survival', type=('build', 'run')) + depends_on('r-nnet', type=('build', 'run')) + depends_on('r-class', type=('build', 'run')) + depends_on('r-prodlim', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/r-irlba/package.py b/var/spack/repos/builtin/packages/r-irlba/package.py index e0d1b325659..ad383492ff2 100644 --- a/var/spack/repos/builtin/packages/r-irlba/package.py +++ b/var/spack/repos/builtin/packages/r-irlba/package.py @@ -31,9 +31,10 @@ class RIrlba(RPackage): matrices.""" homepage = "https://cran.r-project.org/web/packages/irlba/index.html" - url = "https://cran.r-project.org/src/contrib/irlba_2.0.0.tar.gz" + url = "https://cran.r-project.org/src/contrib/irlba_2.1.2.tar.gz" list_url = "https://cran.r-project.org/src/contrib/Archive/irlba" + version('2.1.2', '290940abf6662ed10c0c5a8db1bc6e88') version('2.0.0', '557674cf8b68fea5b9f231058c324d26') depends_on('r-matrix', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/r-jsonlite/package.py b/var/spack/repos/builtin/packages/r-jsonlite/package.py index 7368187af5d..4a690d475a6 100644 --- a/var/spack/repos/builtin/packages/r-jsonlite/package.py +++ b/var/spack/repos/builtin/packages/r-jsonlite/package.py @@ -38,8 +38,9 @@ class RJsonlite(RPackage): use with dynamic data in systems and applications.""" homepage = "https://github.com/jeroenooms/jsonlite" - url = "https://cran.r-project.org/src/contrib/jsonlite_1.0.tar.gz" + url = "https://cran.r-project.org/src/contrib/jsonlite_1.2.tar.gz" list_url = "https://cran.r-project.org/src/contrib/Archive/jsonlite" + version('1.2', '80cd2678ae77254be470f5931db71c51') version('1.0', 'c8524e086de22ab39b8ac8000220cc87') version('0.9.21', '4fc382747f88a79ff0718a0d06bed45d') diff --git a/var/spack/repos/builtin/packages/r-kernlab/package.py b/var/spack/repos/builtin/packages/r-kernlab/package.py new file mode 100644 index 00000000000..67159297ab0 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-kernlab/package.py @@ -0,0 +1,40 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# 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/llnl/spack +# Please also see the LICENSE file 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 +############################################################################## +from spack import * + + +class RKernlab(RPackage): + """Kernel-based machine learning methods for classification, regression, + clustering, novelty detection, quantile regression and dimensionality + reduction. Among other methods 'kernlab' includes Support Vector Machines, + Spectral Clustering, Kernel PCA, Gaussian Processes and a QP solver.""" + + homepage = "https://cran.r-project.org/package=kernlab" + url = "https://cran.r-project.org/src/contrib/kernlab_0.9-25.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/kernlab" + + version('0.9-25', '1182a2a336a79fd2cf70b4bc5a35353f') + + depends_on('r@2.10:') diff --git a/var/spack/repos/builtin/packages/r-kernsmooth/package.py b/var/spack/repos/builtin/packages/r-kernsmooth/package.py new file mode 100644 index 00000000000..14e58072dc5 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-kernsmooth/package.py @@ -0,0 +1,37 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# 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/llnl/spack +# Please also see the LICENSE file 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 +############################################################################## +from spack import * + + +class RKernsmooth(RPackage): + """Functions for kernel smoothing (and density estimation).""" + + homepage = "https://cran.r-project.org/package=KernSmooth" + url = "https://cran.r-project.org/src/contrib/KernSmooth_2.23-15.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/KernSmooth" + + version('2.23-15', '746cdf26dec72004cf19978e87dcc982') + + depends_on('r@2.5.0:') diff --git a/var/spack/repos/builtin/packages/r-kknn/package.py b/var/spack/repos/builtin/packages/r-kknn/package.py new file mode 100644 index 00000000000..bd5d688b140 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-kknn/package.py @@ -0,0 +1,41 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# 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/llnl/spack +# Please also see the LICENSE file 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 +############################################################################## +from spack import * + + +class RKknn(RPackage): + """Weighted k-Nearest Neighbors for Classification, Regression and + Clustering.""" + + homepage = "https://cran.r-project.org/package=kknn" + url = "https://cran.r-project.org/src/contrib/kknn_1.3.1.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/kknn" + + version('1.3.1', '372cd84f618cd5005f8c4c5721755117') + + depends_on('r@2.10:') + + depends_on('r-igraph@1.0:', type=('build', 'run')) + depends_on('r-matrix', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/r-lava/package.py b/var/spack/repos/builtin/packages/r-lava/package.py new file mode 100644 index 00000000000..c38f9003ea8 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-lava/package.py @@ -0,0 +1,40 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# 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/llnl/spack +# Please also see the LICENSE file 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 +############################################################################## +from spack import * + + +class RLava(RPackage): + """Estimation and simulation of latent variable models.""" + + homepage = "https://cran.r-project.org/package=lava" + url = "https://cran.r-project.org/src/contrib/lava_1.4.6.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/lava" + + version('1.4.7', '28039248a7039ba9281d172e4dbf9543') + + depends_on('r@3.0:') + + depends_on('r-numderiv', type=('build', 'run')) + depends_on('r-survival', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/r-matrix/package.py b/var/spack/repos/builtin/packages/r-matrix/package.py index 07c2eaf9da1..ba1323a7372 100644 --- a/var/spack/repos/builtin/packages/r-matrix/package.py +++ b/var/spack/repos/builtin/packages/r-matrix/package.py @@ -30,9 +30,10 @@ class RMatrix(RPackage): using 'LAPACK' and 'SuiteSparse'.""" homepage = "http://matrix.r-forge.r-project.org/" - url = "https://cran.r-project.org/src/contrib/Matrix_1.2-6.tar.gz" + url = "https://cran.r-project.org/src/contrib/Matrix_1.2-8.tar.gz" list_url = "https://cran.r-project.org/src/contrib/Archive/Matrix" + version('1.2-8', '4a6406666bf97d3ec6b698eea5d9c0f5') version('1.2-6', 'f545307fb1284861e9266c4e9712c55e') depends_on('r-lattice', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/r-mda/package.py b/var/spack/repos/builtin/packages/r-mda/package.py new file mode 100644 index 00000000000..4a3325abec1 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-mda/package.py @@ -0,0 +1,40 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# 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/llnl/spack +# Please also see the LICENSE file 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 +############################################################################## +from spack import * + + +class RMda(RPackage): + """Mixture and flexible discriminant analysis, multivariate adaptive + regression splines (MARS), BRUTO.""" + + homepage = "https://cran.r-project.org/package=mda" + url = "https://cran.r-project.org/src/contrib/mda_0.4-9.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/mda" + + version('0.4-9', '2ce1446c4a013e0ebcc1099a00269ad9') + + depends_on('r@1.9.0:') + + depends_on('r-class', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/r-mgcv/package.py b/var/spack/repos/builtin/packages/r-mgcv/package.py index c8cb067275e..611abfd47c1 100644 --- a/var/spack/repos/builtin/packages/r-mgcv/package.py +++ b/var/spack/repos/builtin/packages/r-mgcv/package.py @@ -32,9 +32,10 @@ class RMgcv(RPackage): beyond the exponential family.""" homepage = "https://cran.r-project.org/package=mgcv" - url = "https://cran.r-project.org/src/contrib/mgcv_1.8-13.tar.gz" + url = "https://cran.r-project.org/src/contrib/mgcv_1.8-16.tar.gz" list_url = "https://cran.r-project.org/src/contrib/Archive/mgcv" + version('1.8-16', '4c1d85e0f80b017bccb4b63395842911') version('1.8-13', '30607be3aaf44b13bd8c81fc32e8c984') depends_on('r-nlme', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/r-mlbench/package.py b/var/spack/repos/builtin/packages/r-mlbench/package.py new file mode 100644 index 00000000000..ec7957d5f71 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-mlbench/package.py @@ -0,0 +1,40 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# 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/llnl/spack +# Please also see the LICENSE file 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 +############################################################################## +from spack import * + + +class RMlbench(RPackage): + """A collection of artificial and real-world machine learning benchmark + problems, including, e.g., several data sets from the UCI repository.""" + + homepage = "https://cran.r-project.org/web/packages/mlbench/index.html" + url = "https://cran.r-project.org/src/contrib/mlbench_2.1-1.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/mlbench" + + version('2.1-1', '9f06848b8e137b8a37417c92d8e57f3b') + + depends_on('r@2.10:') + + depends_on('r-lattice', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/r-modelmetrics/package.py b/var/spack/repos/builtin/packages/r-modelmetrics/package.py new file mode 100644 index 00000000000..99644ef1900 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-modelmetrics/package.py @@ -0,0 +1,40 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# 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/llnl/spack +# Please also see the LICENSE file 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 +############################################################################## +from spack import * + + +class RModelmetrics(RPackage): + """Collection of metrics for evaluating models written in C++ using + 'Rcpp'.""" + + homepage = "https://cran.r-project.org/package=ModelMetrics" + url = "https://cran.r-project.org/src/contrib/ModelMetrics_1.1.0.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/ModelMetrics" + + version('1.1.0', 'd43175001f0531b8810d2802d76b7b44') + + depends_on('r@3.2.2:') + + depends_on('r-rcpp', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/r-modeltools/package.py b/var/spack/repos/builtin/packages/r-modeltools/package.py new file mode 100644 index 00000000000..97c3cf0682b --- /dev/null +++ b/var/spack/repos/builtin/packages/r-modeltools/package.py @@ -0,0 +1,35 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# 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/llnl/spack +# Please also see the LICENSE file 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 +############################################################################## +from spack import * + + +class RModeltools(RPackage): + """A collection of tools to deal with statistical models.""" + + homepage = "https://cran.r-project.org/package=modeltools" + url = "https://cran.r-project.org/src/contrib/modeltools_0.2-21.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/modeltools" + + version('0.2-21', '3bf56b2e7bf78981444385d87eeccdd7') diff --git a/var/spack/repos/builtin/packages/r-multcomp/package.py b/var/spack/repos/builtin/packages/r-multcomp/package.py index 70704a9c618..0dbfb14ea00 100644 --- a/var/spack/repos/builtin/packages/r-multcomp/package.py +++ b/var/spack/repos/builtin/packages/r-multcomp/package.py @@ -38,8 +38,8 @@ class RMultcomp(RPackage): version('1.4-6', 'f1353ede2ed78b23859a7f1f1f9ebe88') - depends_on('r-mvtnorm', type=('build', 'run')) - depends_on('r-survival', type=('build', 'run')) - depends_on('r-thdata', type=('build', 'run')) - depends_on('r-sandwich', type=('build', 'run')) + depends_on('r-mvtnorm@1.0-3:', type=('build', 'run')) + depends_on('r-survival@2.39-4:', type=('build', 'run')) + depends_on('r-th-data@1.0-2:', type=('build', 'run')) + depends_on('r-sandwich@2.3-0:', type=('build', 'run')) depends_on('r-codetools', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/r-nlme/package.py b/var/spack/repos/builtin/packages/r-nlme/package.py index 869e03ab51d..32fa484f60a 100644 --- a/var/spack/repos/builtin/packages/r-nlme/package.py +++ b/var/spack/repos/builtin/packages/r-nlme/package.py @@ -29,9 +29,10 @@ class RNlme(RPackage): """Fit and compare Gaussian linear and nonlinear mixed-effects models.""" homepage = "https://cran.r-project.org/package=nlme" - url = "https://cran.r-project.org/src/contrib/nlme_3.1-128.tar.gz" + url = "https://cran.r-project.org/src/contrib/nlme_3.1-130.tar.gz" list_url = "https://cran.r-project.org/src/contrib/Archive/nlme" + version('3.1-130', '1935d6e308a8018ed8e45d25c8731288') version('3.1-128', '3d75ae7380bf123761b95a073eb55008') depends_on('r-lattice', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/r-numderiv/package.py b/var/spack/repos/builtin/packages/r-numderiv/package.py new file mode 100644 index 00000000000..135c4f41418 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-numderiv/package.py @@ -0,0 +1,38 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# 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/llnl/spack +# Please also see the LICENSE file 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 +############################################################################## +from spack import * + + +class RNumderiv(RPackage): + """Methods for calculating (usually) accurate numerical first and + second order derivatives.""" + + homepage = "https://cran.r-project.org/package=numDeriv" + url = "https://cran.r-project.org/src/contrib/numDeriv_2016.8-1.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/numDeriv" + + version('2016.8-1', '30e486298d5126d86560095be8e8aac1') + + depends_on('r@2.11.1:') diff --git a/var/spack/repos/builtin/packages/r-openssl/package.py b/var/spack/repos/builtin/packages/r-openssl/package.py index bf9f38be723..8b20482c322 100644 --- a/var/spack/repos/builtin/packages/r-openssl/package.py +++ b/var/spack/repos/builtin/packages/r-openssl/package.py @@ -38,9 +38,10 @@ class ROpenssl(RPackage): calculations on large multibyte integers.""" homepage = "https://github.com/jeroenooms/openssl#readme" - url = "https://cran.r-project.org/src/contrib/openssl_0.9.4.tar.gz" + url = "https://cran.r-project.org/src/contrib/openssl_0.9.6.tar.gz" list_url = "https://cran.r-project.org/src/contrib/Archive/openssl" + version('0.9.6', '7ef137929d9dd07db690d35db242ba4b') version('0.9.4', '82a890e71ed0e74499878bedacfb8ccb') - depends_on('openssl') + depends_on('openssl@1.0.1:') diff --git a/var/spack/repos/builtin/packages/r-pacman/package.py b/var/spack/repos/builtin/packages/r-pacman/package.py new file mode 100644 index 00000000000..a51633fbb4d --- /dev/null +++ b/var/spack/repos/builtin/packages/r-pacman/package.py @@ -0,0 +1,42 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# 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/llnl/spack +# Please also see the LICENSE file 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 +############################################################################## +from spack import * + + +class RPacman(RPackage): + """Tools to more conveniently perform tasks associated with add-on + packages. pacman conveniently wraps library and package related functions + and names them in an intuitive and consistent fashion. It seeks to combine + functionality from lower level functions which can speed up workflow.""" + + homepage = "https://cran.r-project.org/package=pacman" + url = "https://cran.r-project.org/src/contrib/pacman_0.4.1.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/pacman" + + version('0.4.1', 'bf18fe6d1407d31e00b337d9b07fb648') + + depends_on('r@3.0.2:') + + depends_on('r-devtools', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/r-party/package.py b/var/spack/repos/builtin/packages/r-party/package.py new file mode 100644 index 00000000000..23f66ca4a4d --- /dev/null +++ b/var/spack/repos/builtin/packages/r-party/package.py @@ -0,0 +1,45 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# 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/llnl/spack +# Please also see the LICENSE file 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 +############################################################################## +from spack import * + + +class RParty(RPackage): + """A computational toolbox for recursive partitioning.""" + + homepage = "https://cran.r-project.org/web/packages/party/index.html" + url = "https://cran.r-project.org/src/contrib/party_1.1-2.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/party" + + version('1.1-2', '40a00336cf8418042d2ab616675c8ddf') + + depends_on('r@2.14.0:') + + depends_on('r-mvtnorm@1.0-2:', type=('build', 'run')) + depends_on('r-modeltools@0.1-21:', type=('build', 'run')) + depends_on('r-strucchange', type=('build', 'run')) + depends_on('r-survival@2.37-7:', type=('build', 'run')) + depends_on('r-coin@1.1-0:', type=('build', 'run')) + depends_on('r-zoo', type=('build', 'run')) + depends_on('r-sandwich@1.1-1:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/r-pbkrtest/package.py b/var/spack/repos/builtin/packages/r-pbkrtest/package.py index 2d51d2b9586..2a2edc50ce5 100644 --- a/var/spack/repos/builtin/packages/r-pbkrtest/package.py +++ b/var/spack/repos/builtin/packages/r-pbkrtest/package.py @@ -37,7 +37,10 @@ class RPbkrtest(RPackage): list_url = "https://cran.r-project.org/src/contrib/Archive/pbkrtest" version('0.4-6', '0a7d9ff83b8d131af9b2335f35781ef9') + version('0.4-4', '5e54b1b1b35413dd1d24ef15735ec645') - depends_on('r-lme4', type=('build', 'run')) - depends_on('r-matrix', type=('build', 'run')) + depends_on('r@3.2.3:') + + depends_on('r-lme4@1.1.10:', type=('build', 'run')) + depends_on('r-matrix@1.2.3:', type=('build', 'run')) depends_on('r-mass', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/r-plotrix/package.py b/var/spack/repos/builtin/packages/r-plotrix/package.py index 8a17c72f912..0cd3423f733 100644 --- a/var/spack/repos/builtin/packages/r-plotrix/package.py +++ b/var/spack/repos/builtin/packages/r-plotrix/package.py @@ -29,7 +29,8 @@ class RPlotrix(RPackage): """Lots of plots, various labeling, axis and color scaling functions.""" homepage = "https://cran.r-project.org/package=plotrix" - url = "https://cran.r-project.org/src/contrib/plotrix_3.6-3.tar.gz" + url = "https://cran.r-project.org/src/contrib/plotrix_3.6-4.tar.gz" list_url = "https://cran.r-project.org/src/contrib/Archive/plotrix" + version('3.6-4', 'efe9b9b093d8903228a9b56c46d943fa') version('3.6-3', '23e3e022a13a596e9b77b40afcb4a2ef') diff --git a/var/spack/repos/builtin/packages/r-pls/package.py b/var/spack/repos/builtin/packages/r-pls/package.py new file mode 100644 index 00000000000..ddb18ff42ec --- /dev/null +++ b/var/spack/repos/builtin/packages/r-pls/package.py @@ -0,0 +1,39 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# 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/llnl/spack +# Please also see the LICENSE file 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 +############################################################################## +from spack import * + + +class RPls(RPackage): + """Multivariate regression methods Partial Least Squares Regression (PLSR), + Principal Component Regression (PCR) and Canonical Powered Partial Least + Squares (CPPLS).""" + + homepage = "https://cran.r-project.org/package=pls" + url = "https://cran.r-project.org/src/contrib/pls_2.6-0.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/pls" + + version('2.6-0', '04e02e8e46d983c5ed53c1f952b329df') + + depends_on('r@2.10:') diff --git a/var/spack/repos/builtin/packages/r-prodlim/package.py b/var/spack/repos/builtin/packages/r-prodlim/package.py new file mode 100644 index 00000000000..5219578d943 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-prodlim/package.py @@ -0,0 +1,44 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# 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/llnl/spack +# Please also see the LICENSE file 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 +############################################################################## +from spack import * + + +class RProdlim(RPackage): + """Product-Limit Estimation for Censored Event History Analysis. Fast and + user friendly implementation of nonparametric estimators for censored event + history (survival) analysis. Kaplan-Meier and Aalen-Johansen method.""" + + homepage = "https://cran.r-project.org/package=prodlim" + url = "https://cran.r-project.org/src/contrib/prodlim_1.5.9.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/prodlim" + + version('1.5.9', 'e0843053c9270e41b657a733d6675dc9') + + depends_on('r@2.9.0:') + + depends_on('r-rcpp@0.11.5:', type=('build', 'run')) + depends_on('r-survival', type=('build', 'run')) + depends_on('r-kernsmooth', type=('build', 'run')) + depends_on('r-lava', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/r-quantreg/package.py b/var/spack/repos/builtin/packages/r-quantreg/package.py index 2d5091ccafe..c9bdaefa44e 100644 --- a/var/spack/repos/builtin/packages/r-quantreg/package.py +++ b/var/spack/repos/builtin/packages/r-quantreg/package.py @@ -34,9 +34,10 @@ class RQuantreg(RPackage): included.""" homepage = "https://cran.r-project.org/package=quantreg" - url = "https://cran.r-project.org/src/contrib/quantreg_5.26.tar.gz" + url = "https://cran.r-project.org/src/contrib/quantreg_5.29.tar.gz" list_url = "https://cran.r-project.org/src/contrib/Archive/quantreg" + version('5.29', '643ca728200d13f8c2e62365204e9907') version('5.26', '1d89ed932fb4d67ae2d5da0eb8c2989f') depends_on('r-sparsem', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/r-r6/package.py b/var/spack/repos/builtin/packages/r-r6/package.py index e64a8a65324..700771f40fd 100644 --- a/var/spack/repos/builtin/packages/r-r6/package.py +++ b/var/spack/repos/builtin/packages/r-r6/package.py @@ -34,7 +34,10 @@ class RR6(RPackage): classes are defined in different packages.""" homepage = "https://github.com/wch/R6/" - url = "https://cran.r-project.org/src/contrib/R6_2.1.2.tar.gz" + url = "https://cran.r-project.org/src/contrib/R6_2.2.0.tar.gz" list_url = "https://cran.r-project.org/src/contrib/Archive/R6" + version('2.2.0', '659d83b2d3f7a308a48332b4cfbdab49') version('2.1.2', 'b6afb9430e48707be87638675390e457') + + depends_on('r@3.0:') diff --git a/var/spack/repos/builtin/packages/r-rcpp/package.py b/var/spack/repos/builtin/packages/r-rcpp/package.py index b447dea8bdd..5b89324970e 100644 --- a/var/spack/repos/builtin/packages/r-rcpp/package.py +++ b/var/spack/repos/builtin/packages/r-rcpp/package.py @@ -37,8 +37,9 @@ class RRcpp(RPackage): last two.""" homepage = "http://dirk.eddelbuettel.com/code/rcpp.html" - url = "https://cran.r-project.org/src/contrib/Rcpp_0.12.6.tar.gz" + url = "https://cran.r-project.org/src/contrib/Rcpp_0.12.9.tar.gz" list_url = "https://cran.r-project.org/src/contrib/Archive/Rcpp" + version('0.12.9', '691c49b12794507288b728ede03668a5') version('0.12.6', 'db4280fb0a79cd19be73a662c33b0a8b') version('0.12.5', 'f03ec05b4e391cc46e7ce330e82ff5e2') diff --git a/var/spack/repos/builtin/packages/r-rcppeigen/package.py b/var/spack/repos/builtin/packages/r-rcppeigen/package.py index 23ec0bc27bc..b33e938d5bf 100644 --- a/var/spack/repos/builtin/packages/r-rcppeigen/package.py +++ b/var/spack/repos/builtin/packages/r-rcppeigen/package.py @@ -41,9 +41,10 @@ class RRcppeigen(RPackage): GNU GPL version 2 or later, as is the rest of 'Rcpp'.""" homepage = "http://eigen.tuxfamily.org/" - url = "https://cran.r-project.org/src/contrib/RcppEigen_0.3.2.8.1.tar.gz" + url = "https://cran.r-project.org/src/contrib/RcppEigen_0.3.2.9.0.tar.gz" list_url = "https://cran.r-project.org/src/contrib/Archive/RcppEigen" + version('0.3.2.9.0', '14a7786882a5d9862d53c4b2217df318') version('0.3.2.8.1', '4146e06e4fdf7f4d08db7839069d479f') depends_on('r-matrix', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/r-reshape2/package.py b/var/spack/repos/builtin/packages/r-reshape2/package.py index d27231e139f..ca65e006dc2 100644 --- a/var/spack/repos/builtin/packages/r-reshape2/package.py +++ b/var/spack/repos/builtin/packages/r-reshape2/package.py @@ -30,9 +30,10 @@ class RReshape2(RPackage): and dcast (or acast).""" homepage = "https://github.com/hadley/reshape" - url = "https://cran.r-project.org/src/contrib/reshape2_1.4.1.tar.gz" + url = "https://cran.r-project.org/src/contrib/reshape2_1.4.2.tar.gz" list_url = "https://cran.r-project.org/src/contrib/Archive/reshape2" + version('1.4.2', 'c851a0312191b8c5bab956445df7cf5f') version('1.4.1', '41e9dffdf5c6fa830321ac9c8ebffe00') depends_on('r-plyr', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/r-rminer/package.py b/var/spack/repos/builtin/packages/r-rminer/package.py new file mode 100644 index 00000000000..b22612a2389 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-rminer/package.py @@ -0,0 +1,54 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# 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/llnl/spack +# Please also see the LICENSE file 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 +############################################################################## +from spack import * + + +class RRminer(RPackage): + """Facilitates the use of data mining algorithms in classification and + regression (including time series forecasting) tasks by presenting a short + and coherent set of functions.""" + + homepage = "http://www3.dsi.uminho.pt/pcortez/rminer.html" + url = "https://cran.r-project.org/src/contrib/rminer_1.4.2.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/rminer" + + version('1.4.2', '7d5d90f4ae030cf647d67aa962412c05') + + depends_on('r-plotrix', type=('build', 'run')) + depends_on('r-lattice', type=('build', 'run')) + depends_on('r-nnet', type=('build', 'run')) + depends_on('r-kknn', type=('build', 'run')) + depends_on('r-pls', type=('build', 'run')) + depends_on('r-mass', type=('build', 'run')) + depends_on('r-mda', type=('build', 'run')) + depends_on('r-rpart', type=('build', 'run')) + depends_on('r-randomforest', type=('build', 'run')) + depends_on('r-adabag', type=('build', 'run')) + depends_on('r-party', type=('build', 'run')) + depends_on('r-cubist', type=('build', 'run')) + depends_on('r-kernlab', type=('build', 'run')) + depends_on('r-e1071', type=('build', 'run')) + depends_on('r-glmnet', type=('build', 'run')) + depends_on('r-xgboost', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/r-rpart-plot/package.py b/var/spack/repos/builtin/packages/r-rpart-plot/package.py new file mode 100644 index 00000000000..d7d40f21545 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-rpart-plot/package.py @@ -0,0 +1,38 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# 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/llnl/spack +# Please also see the LICENSE file 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 +############################################################################## +from spack import * + + +class RRpartPlot(RPackage): + """Plot 'rpart' models. Extends plot.rpart() and text.rpart() in the + 'rpart' package.""" + + homepage = "https://cran.r-project.org/package=rpart.plot" + url = "https://cran.r-project.org/src/contrib/rpart.plot_2.1.0.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/rpart.plot" + + version('2.1.0', 'fb0f8edfe22c464683ee82aa429136f9') + + depends_on('r-rpart@4.1-0:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/r-rpart/package.py b/var/spack/repos/builtin/packages/r-rpart/package.py new file mode 100644 index 00000000000..a81c9d7d919 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-rpart/package.py @@ -0,0 +1,38 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# 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/llnl/spack +# Please also see the LICENSE file 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 +############################################################################## +from spack import * + + +class RRpart(RPackage): + """Recursive partitioning for classification, regression and + survival trees.""" + + homepage = "https://cran.r-project.org/package=rpart" + url = "https://cran.r-project.org/src/contrib/rpart_4.1-10.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/rpart" + + version('4.1-10', '15873cded4feb3ef44d63580ba3ca46e') + + depends_on('r@2.15.0:') diff --git a/var/spack/repos/builtin/packages/r-sandwich/package.py b/var/spack/repos/builtin/packages/r-sandwich/package.py index 62bd2880e59..bae8e82d68b 100644 --- a/var/spack/repos/builtin/packages/r-sandwich/package.py +++ b/var/spack/repos/builtin/packages/r-sandwich/package.py @@ -35,4 +35,6 @@ class RSandwich(RPackage): version('2.3-4', 'a621dbd8a57b6e1e036496642aadc2e5') + depends_on('r@2.0.0:') + depends_on('r-zoo', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/r-scales/package.py b/var/spack/repos/builtin/packages/r-scales/package.py index e3832f78e08..e88ef144cfa 100644 --- a/var/spack/repos/builtin/packages/r-scales/package.py +++ b/var/spack/repos/builtin/packages/r-scales/package.py @@ -30,9 +30,10 @@ class RScales(RPackage): automatically determining breaks and labels for axes and legends.""" homepage = "https://github.com/hadley/scales" - url = "https://cran.r-project.org/src/contrib/scales_0.4.0.tar.gz" + url = "https://cran.r-project.org/src/contrib/scales_0.4.1.tar.gz" list_url = "https://cran.r-project.org/src/contrib/Archive/scales" + version('0.4.1', '3fb2218866a7fe4c1f6e66790876f85a') version('0.4.0', '7b5602d9c55595901192248bca25c099') depends_on('r-rcolorbrewer', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/r-sparsem/package.py b/var/spack/repos/builtin/packages/r-sparsem/package.py index 370497e395d..bcd11a5c1f3 100644 --- a/var/spack/repos/builtin/packages/r-sparsem/package.py +++ b/var/spack/repos/builtin/packages/r-sparsem/package.py @@ -31,7 +31,8 @@ class RSparsem(RPackage): subsetting and Kronecker products.""" homepage = "http://www.econ.uiuc.edu/~roger/research/sparse/sparse.html" - url = "https://cran.r-project.org/src/contrib/SparseM_1.7.tar.gz" + url = "https://cran.r-project.org/src/contrib/SparseM_1.74.tar.gz" list_url = "https://cran.r-project.org/src/contrib/Archive/SparseM" - version('1.7', '7b5b0ab166a0929ef6dcfe1d97643601') + version('1.74', 'a16c9b7db172dfd2b7b6508c48e81a5d') + version('1.7', '7b5b0ab166a0929ef6dcfe1d97643601') diff --git a/var/spack/repos/builtin/packages/r-stringi/package.py b/var/spack/repos/builtin/packages/r-stringi/package.py index d89238f3d73..b116c328f58 100644 --- a/var/spack/repos/builtin/packages/r-stringi/package.py +++ b/var/spack/repos/builtin/packages/r-stringi/package.py @@ -37,9 +37,10 @@ class RStringi(RPackage): etc.""" homepage = "http://www.gagolewski.com/software/stringi/" - url = "https://cran.r-project.org/src/contrib/stringi_1.1.1.tar.gz" + url = "https://cran.r-project.org/src/contrib/stringi_1.1.2.tar.gz" list_url = "https://cran.r-project.org/src/contrib/Archive/stringi" + version('1.1.2', '0ec2faa62643e1900734c0eaf5096648') version('1.1.1', '32b919ee3fa8474530c4942962a6d8d9') depends_on('icu4c') diff --git a/var/spack/repos/builtin/packages/r-stringr/package.py b/var/spack/repos/builtin/packages/r-stringr/package.py index de8d83b5007..4accd04e51e 100644 --- a/var/spack/repos/builtin/packages/r-stringr/package.py +++ b/var/spack/repos/builtin/packages/r-stringr/package.py @@ -33,9 +33,10 @@ class RStringr(RPackage): into the input of another.""" homepage = "https://cran.r-project.org/web/packages/stringr/index.html" - url = "https://cran.r-project.org/src/contrib/stringr_1.0.0.tar.gz" + url = "https://cran.r-project.org/src/contrib/stringr_1.1.0.tar.gz" list_url = "https://cran.r-project.org/src/contrib/Archive/stringr" + version('1.1.0', '47973a33944c6d5db9524b1e835b8a5d') version('1.0.0', '5ca977c90351f78b1b888b379114a7b4') depends_on('r-stringi', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/r-strucchange/package.py b/var/spack/repos/builtin/packages/r-strucchange/package.py new file mode 100644 index 00000000000..6d00d314020 --- /dev/null +++ b/var/spack/repos/builtin/packages/r-strucchange/package.py @@ -0,0 +1,41 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# 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/llnl/spack +# Please also see the LICENSE file 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 +############################################################################## +from spack import * + + +class RStrucchange(RPackage): + """Testing, monitoring and dating structural changes in (linear) + regression models.""" + + homepage = "https://cran.r-project.org/package=strucchange" + url = "https://cran.r-project.org/src/contrib/strucchange_1.5-1.tar.gz" + list_url = "https://cran.r-project.org/src/contrib/Archive/strucchange" + + version('1.5-1', 'fc751fc011df9c8df82d577298cb8395') + + depends_on('r@2.10.0:') + + depends_on('r-zoo', type=('build', 'run')) + depends_on('r-sandwich', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/r-survival/package.py b/var/spack/repos/builtin/packages/r-survival/package.py index 1df00f0c935..067cdcfd6bf 100644 --- a/var/spack/repos/builtin/packages/r-survival/package.py +++ b/var/spack/repos/builtin/packages/r-survival/package.py @@ -31,9 +31,10 @@ class RSurvival(RPackage): models, and parametric accelerated failure time models.""" homepage = "https://cran.r-project.org/package=survival" - url = "https://cran.r-project.org/src/contrib/survival_2.39-5.tar.gz" + url = "https://cran.r-project.org/src/contrib/survival_2.40-1.tar.gz" list_url = "https://cran.r-project.org/src/contrib/Archive/survival" + version('2.40-1', 'a2474b656cd723791268e3114481b8a7') version('2.39-5', 'a3cc6b5762e8c5c0bb9e64a276710be2') depends_on('r-matrix', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/r-thdata/package.py b/var/spack/repos/builtin/packages/r-th-data/package.py similarity index 94% rename from var/spack/repos/builtin/packages/r-thdata/package.py rename to var/spack/repos/builtin/packages/r-th-data/package.py index cf2b01e6e8b..b9c5fab0d07 100644 --- a/var/spack/repos/builtin/packages/r-thdata/package.py +++ b/var/spack/repos/builtin/packages/r-th-data/package.py @@ -25,13 +25,14 @@ from spack import * -class RThdata(RPackage): +class RThData(RPackage): """Contains data sets used in other packages Torsten Hothorn maintains.""" homepage = "https://cran.r-project.org/package=TH.data" - url = "https://cran.r-project.org/src/contrib/TH.data_1.0-7.tar.gz" + url = "https://cran.r-project.org/src/contrib/TH.data_1.0-8.tar.gz" list_url = "https://cran.r-project.org/src/contrib/Archive/TH.data" + version('1.0-8', '2cc20acc8b470dff1202749b4bea55c4') version('1.0-7', '3e8b6b1a4699544f175215aed7039a94') depends_on('r-survival', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/r-tibble/package.py b/var/spack/repos/builtin/packages/r-tibble/package.py index 39dfc3893ba..a06b33e7f21 100644 --- a/var/spack/repos/builtin/packages/r-tibble/package.py +++ b/var/spack/repos/builtin/packages/r-tibble/package.py @@ -30,11 +30,14 @@ class RTibble(RPackage): capabilities than traditional data frames.""" homepage = "https://github.com/hadley/tibble" - url = "https://cran.r-project.org/src/contrib/tibble_1.1.tar.gz" + url = "https://cran.r-project.org/src/contrib/tibble_1.2.tar.gz" list_url = "https://cran.r-project.org/src/contrib/Archive/tibble" + version('1.2', 'bdbc3d67aa16860741add6d6ec20ea13') version('1.1', '2fe9f806109d0b7fadafb1ffafea4cb8') + depends_on('r@3.1.2:') + depends_on('r-assertthat', type=('build', 'run')) - depends_on('r-lazyeval', type=('build', 'run')) + depends_on('r-lazyeval@0.1.10:', type=('build', 'run')) depends_on('r-rcpp', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/r-withr/package.py b/var/spack/repos/builtin/packages/r-withr/package.py index 785050ed873..082b94e2a62 100644 --- a/var/spack/repos/builtin/packages/r-withr/package.py +++ b/var/spack/repos/builtin/packages/r-withr/package.py @@ -32,7 +32,10 @@ class RWithr(RPackage): dependencies to provide access to these functions.""" homepage = "http://github.com/jimhester/withr" - url = "https://cran.r-project.org/src/contrib/withr_1.0.1.tar.gz" + url = "https://cran.r-project.org/src/contrib/withr_1.0.2.tar.gz" list_url = "https://cran.r-project.org/src/contrib/Archive/withr" + version('1.0.2', 'ca52b729af9bbaa14fc8b7bafe38663c') version('1.0.1', 'ac38af2c6f74027c9592dd8f0acb7598') + + depends_on('r@3.0.2:') diff --git a/var/spack/repos/builtin/packages/r-xgboost/package.py b/var/spack/repos/builtin/packages/r-xgboost/package.py index 766191dcc16..4246d73e498 100644 --- a/var/spack/repos/builtin/packages/r-xgboost/package.py +++ b/var/spack/repos/builtin/packages/r-xgboost/package.py @@ -37,12 +37,19 @@ class RXgboost(RPackage): users are also allowed to define their own objectives easily.""" homepage = "https://github.com/dmlc/xgboost" - url = "https://cran.r-project.org/src/contrib/xgboost_0.4-4.tar.gz" + url = "https://cran.r-project.org/src/contrib/xgboost_0.6-4.tar.gz" list_url = "https://cran.r-project.org/src/contrib/Archive/xgboost" + version('0.6-4', '86e517e3ce39f8a01de796920f6b425e') version('0.4-4', 'c24d3076058101a71de4b8af8806697c') - depends_on('r-matrix', type=('build', 'run')) - depends_on('r-datatable', type=('build', 'run')) - depends_on('r-magrittr', type=('build', 'run')) + depends_on('r@3.3.0:') + + depends_on('r-matrix@1.1-0:', type=('build', 'run')) + depends_on('r-data-table@1.9.6:', type=('build', 'run')) + depends_on('r-magrittr@1.5:', type=('build', 'run')) + depends_on('r-stringi@0.5.2:', type=('build', 'run')) + + # This is not listed as required, but installation fails without it + # ERROR: dependency 'stringr' is not available for package 'xgboost' depends_on('r-stringr', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/r-zoo/package.py b/var/spack/repos/builtin/packages/r-zoo/package.py index 230c78a61ac..7418d36a64d 100644 --- a/var/spack/repos/builtin/packages/r-zoo/package.py +++ b/var/spack/repos/builtin/packages/r-zoo/package.py @@ -33,9 +33,10 @@ class RZoo(RPackage): methods to extend standard generics.""" homepage = "http://zoo.r-forge.r-project.org/" - url = "https://cran.r-project.org/src/contrib/zoo_1.7-13.tar.gz" + url = "https://cran.r-project.org/src/contrib/zoo_1.7-14.tar.gz" list_url = "https://cran.r-project.org/src/contrib/Archive/zoo" + version('1.7-14', '8c577a7c1e535c899ab14177b1039c32') version('1.7-13', '99521dfa4c668e692720cefcc5a1bf30') depends_on('r-lattice', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/r/package.py b/var/spack/repos/builtin/packages/r/package.py index 3fed62d1fa7..842affc4cce 100644 --- a/var/spack/repos/builtin/packages/r/package.py +++ b/var/spack/repos/builtin/packages/r/package.py @@ -28,7 +28,7 @@ import shutil -class R(Package): +class R(AutotoolsPackage): """R is 'GNU S', a freely available language and environment for statistical computing and graphics which provides a wide variety of statistical and graphical techniques: linear and nonlinear modelling, @@ -36,10 +36,11 @@ class R(Package): Please consult the R project homepage for further information.""" homepage = "https://www.r-project.org" - url = "http://cran.cnr.berkeley.edu/src/base/R-3/R-3.1.2.tar.gz" + url = "https://cloud.r-project.org/src/base/R-3/R-3.3.2.tar.gz" extendable = True + version('3.3.2', '2437014ef40641cdc9673e89c040b7a8') version('3.3.1', 'f50a659738b73036e2f5635adbd229c5') version('3.3.0', '5a7506c8813432d1621c9725e86baf7a') version('3.2.3', '1ba3dac113efab69e706902810cc2970') @@ -63,7 +64,7 @@ class R(Package): depends_on('ncurses') depends_on('icu4c') depends_on('glib') - depends_on('zlib@:1.2.8') + depends_on('zlib@1.2.5:') depends_on('bzip2') depends_on('libtiff') depends_on('jpeg') @@ -82,33 +83,46 @@ class R(Package): depends_on('pcre') depends_on('jdk') + patch('zlib.patch', when='@:3.3.2') + @property def etcdir(self): return join_path(prefix, 'rlib', 'R', 'etc') - def install(self, spec, prefix): - rlibdir = join_path(prefix, 'rlib') - configure_args = ['--prefix=%s' % prefix, - '--libdir=%s' % rlibdir, - '--enable-R-shlib', - '--enable-BLAS-shlib', - '--enable-R-framework=no'] + def configure_args(self): + spec = self.spec + prefix = self.prefix + + config_args = [ + '--libdir={0}'.format(join_path(prefix, 'rlib')), + '--enable-R-shlib', + '--enable-BLAS-shlib', + '--enable-R-framework=no' + ] + if '+external-lapack' in spec: - configure_args.extend(['--with-blas', '--with-lapack']) + config_args.extend([ + '--with-blas', + '--with-lapack' + ]) - configure(*configure_args) - make() - make('install') + if '+X' in spec: + config_args.append('--with-x') + else: + config_args.append('--without-x') + return config_args + + @run_after('install') + def copy_makeconf(self): # Make a copy of Makeconf because it will be needed to properly build R # dependencies in Spack. src_makeconf = join_path(self.etcdir, 'Makeconf') dst_makeconf = join_path(self.etcdir, 'Makeconf.spack') shutil.copy(src_makeconf, dst_makeconf) - self.filter_compilers(spec, prefix) - - def filter_compilers(self, spec, prefix): + @run_after('install') + def filter_compilers(self): """Run after install to tell the configuration files and Makefiles to use the compilers that Spack built the package with. diff --git a/var/spack/repos/builtin/packages/r/zlib.patch b/var/spack/repos/builtin/packages/r/zlib.patch new file mode 100644 index 00000000000..673d5352fac --- /dev/null +++ b/var/spack/repos/builtin/packages/r/zlib.patch @@ -0,0 +1,29 @@ +*** a/configure 2017-01-21 21:48:35.077000000 +0000 +--- b/configure 2017-01-21 21:50:50.700000000 +0000 +*************** +*** 35496,35505 **** + #include + #include + int main() { +! #ifdef ZLIB_VERSION +! /* Work around Debian bug: it uses 1.2.3.4 even though there was no such +! version on the master site zlib.net */ +! exit(strncmp(ZLIB_VERSION, "1.2.5", 5) < 0); + #else + exit(1); + #endif +--- 35496,35509 ---- + #include + #include + int main() { +! /* Checking ZLIB_VERNUM trick learned here: +! * https://github.com/TransitApp/protobuf/blob/master/configure.ac#L95 +! */ +! #ifdef ZLIB_VERNUM +! if (ZLIB_VERNUM < 0x1250) { +! exit(1); +! } +! exit(0); + #else + exit(1); + #endif diff --git a/var/spack/repos/builtin/packages/randrproto/package.py b/var/spack/repos/builtin/packages/randrproto/package.py index ecff886a3ba..ff336204486 100644 --- a/var/spack/repos/builtin/packages/randrproto/package.py +++ b/var/spack/repos/builtin/packages/randrproto/package.py @@ -25,7 +25,7 @@ from spack import * -class Randrproto(Package): +class Randrproto(AutotoolsPackage): """X Resize and Rotate Extension (RandR). This extension defines a protocol for clients to dynamically change X @@ -39,8 +39,3 @@ class Randrproto(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make('install') diff --git a/var/spack/repos/builtin/packages/readline/package.py b/var/spack/repos/builtin/packages/readline/package.py index abb6ba04ce4..631a49183f3 100644 --- a/var/spack/repos/builtin/packages/readline/package.py +++ b/var/spack/repos/builtin/packages/readline/package.py @@ -25,7 +25,7 @@ from spack import * -class Readline(Package): +class Readline(AutotoolsPackage): """The GNU Readline library provides a set of functions for use by applications that allow users to edit command lines as they are typed in. Both Emacs and vi editing modes are @@ -34,13 +34,11 @@ class Readline(Package): recall and perhaps reedit those lines, and perform csh-like history expansion on previous commands.""" homepage = "http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html" - url = "ftp://ftp.cwru.edu/pub/bash/readline-6.3.tar.gz" + url = "https://ftp.gnu.org/gnu/readline/readline-6.3.tar.gz" version('6.3', '33c8fb279e981274f485fd91da77e94a') depends_on("ncurses") - def install(self, spec, prefix): - configure("--prefix=%s" % prefix) + def build(self, spec, prefix): make("SHLIB_LIBS=-lncurses") - make("install") diff --git a/var/spack/repos/builtin/packages/recordproto/package.py b/var/spack/repos/builtin/packages/recordproto/package.py index 02018a76ff5..b38eeae0790 100644 --- a/var/spack/repos/builtin/packages/recordproto/package.py +++ b/var/spack/repos/builtin/packages/recordproto/package.py @@ -25,7 +25,7 @@ from spack import * -class Recordproto(Package): +class Recordproto(AutotoolsPackage): """X Record Extension. This extension defines a protocol for the recording and playback of user @@ -38,8 +38,3 @@ class Recordproto(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make('install') diff --git a/var/spack/repos/builtin/packages/rendercheck/package.py b/var/spack/repos/builtin/packages/rendercheck/package.py index 07cc809e9ad..f53925fe287 100644 --- a/var/spack/repos/builtin/packages/rendercheck/package.py +++ b/var/spack/repos/builtin/packages/rendercheck/package.py @@ -25,7 +25,7 @@ from spack import * -class Rendercheck(Package): +class Rendercheck(AutotoolsPackage): """rendercheck is a program to test a Render extension implementation against separate calculations of expected output.""" @@ -40,9 +40,3 @@ class Rendercheck(Package): depends_on('xproto@7.0.17:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/renderproto/package.py b/var/spack/repos/builtin/packages/renderproto/package.py index 10be4c941c4..81348d7347e 100644 --- a/var/spack/repos/builtin/packages/renderproto/package.py +++ b/var/spack/repos/builtin/packages/renderproto/package.py @@ -25,7 +25,7 @@ from spack import * -class Renderproto(Package): +class Renderproto(AutotoolsPackage): """X Rendering Extension. This extension defines the protcol for a digital image composition as @@ -38,8 +38,3 @@ class Renderproto(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make('install') diff --git a/var/spack/repos/builtin/packages/resourceproto/package.py b/var/spack/repos/builtin/packages/resourceproto/package.py index 4e0a495d83f..11e143b5fc3 100644 --- a/var/spack/repos/builtin/packages/resourceproto/package.py +++ b/var/spack/repos/builtin/packages/resourceproto/package.py @@ -25,7 +25,7 @@ from spack import * -class Resourceproto(Package): +class Resourceproto(AutotoolsPackage): """X Resource Extension. This extension defines a protocol that allows a client to query the @@ -38,8 +38,3 @@ class Resourceproto(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make('install') diff --git a/var/spack/repos/builtin/packages/rgb/package.py b/var/spack/repos/builtin/packages/rgb/package.py index ddc54193055..985b90449d5 100644 --- a/var/spack/repos/builtin/packages/rgb/package.py +++ b/var/spack/repos/builtin/packages/rgb/package.py @@ -25,7 +25,7 @@ from spack import * -class Rgb(Package): +class Rgb(AutotoolsPackage): """X color name database. This package includes both the list mapping X color names to RGB values @@ -42,10 +42,3 @@ class Rgb(Package): depends_on('xorg-server') depends_on('xproto', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('check') - make('install') diff --git a/var/spack/repos/builtin/packages/rstart/package.py b/var/spack/repos/builtin/packages/rstart/package.py index 7b80e88ae7e..198c9c8be52 100644 --- a/var/spack/repos/builtin/packages/rstart/package.py +++ b/var/spack/repos/builtin/packages/rstart/package.py @@ -25,7 +25,7 @@ from spack import * -class Rstart(Package): +class Rstart(AutotoolsPackage): """This package includes both the client and server sides implementing the protocol described in the "A Flexible Remote Execution Protocol Based on rsh" paper found in the specs/ subdirectory. @@ -41,9 +41,3 @@ class Rstart(Package): depends_on('xproto', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/rsync/package.py b/var/spack/repos/builtin/packages/rsync/package.py index 4e741b255f2..2c21262b39e 100644 --- a/var/spack/repos/builtin/packages/rsync/package.py +++ b/var/spack/repos/builtin/packages/rsync/package.py @@ -25,16 +25,10 @@ from spack import * -class Rsync(Package): +class Rsync(AutotoolsPackage): """An open source utility that provides fast incremental file transfer.""" homepage = "https://rsync.samba.org" url = "https://download.samba.org/pub/rsync/rsync-3.1.1.tar.gz" version('3.1.2', '0f758d7e000c0f7f7d3792610fad70cb') version('3.1.1', '43bd6676f0b404326eee2d63be3cdcfe') - - def install(self, spec, prefix): - configure('--prefix=%s' % prefix) - - make() - make("install") diff --git a/var/spack/repos/builtin/packages/scons/package.py b/var/spack/repos/builtin/packages/scons/package.py index d20e5293845..54f894da6fe 100644 --- a/var/spack/repos/builtin/packages/scons/package.py +++ b/var/spack/repos/builtin/packages/scons/package.py @@ -25,14 +25,9 @@ from spack import * -class Scons(Package): +class Scons(PythonPackage): """SCons is a software construction tool""" homepage = "http://scons.org" url = "http://downloads.sourceforge.net/project/scons/scons/2.5.0/scons-2.5.0.tar.gz" version('2.5.0', '9e00fa0df8f5ca5c5f5975b40e0ed354') - - extends('python') - - def install(self, spec, prefix): - setup_py('install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/screen/package.py b/var/spack/repos/builtin/packages/screen/package.py index 7edfb44a4d9..542612f2075 100644 --- a/var/spack/repos/builtin/packages/screen/package.py +++ b/var/spack/repos/builtin/packages/screen/package.py @@ -25,7 +25,7 @@ from spack import * -class Screen(Package): +class Screen(AutotoolsPackage): """Screen is a full-screen window manager that multiplexes a physical terminal between several processes, typically interactive shells. """ @@ -51,8 +51,3 @@ class Screen(Package): version('3.7.1', '27cdd29318446561ef7c966041cbd2c9') depends_on('ncurses') - - def install(self, spec, prefix): - configure('--prefix=%s' % prefix) - make() - make("install") diff --git a/var/spack/repos/builtin/packages/scripts/package.py b/var/spack/repos/builtin/packages/scripts/package.py index 7086cfd6fe1..4bdf63e70ad 100644 --- a/var/spack/repos/builtin/packages/scripts/package.py +++ b/var/spack/repos/builtin/packages/scripts/package.py @@ -25,7 +25,7 @@ from spack import * -class Scripts(Package): +class Scripts(AutotoolsPackage): """Various X related scripts.""" homepage = "http://cgit.freedesktop.org/xorg/app/scripts" @@ -37,9 +37,3 @@ class Scripts(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/scrnsaverproto/package.py b/var/spack/repos/builtin/packages/scrnsaverproto/package.py index 3675fd0effa..c849d127135 100644 --- a/var/spack/repos/builtin/packages/scrnsaverproto/package.py +++ b/var/spack/repos/builtin/packages/scrnsaverproto/package.py @@ -25,7 +25,7 @@ from spack import * -class Scrnsaverproto(Package): +class Scrnsaverproto(AutotoolsPackage): """MIT Screen Saver Extension. This extension defines a protocol to control screensaver features @@ -38,8 +38,3 @@ class Scrnsaverproto(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make('install') diff --git a/var/spack/repos/builtin/packages/sdl2-image/package.py b/var/spack/repos/builtin/packages/sdl2-image/package.py index 5df207ac55b..6e953a14514 100644 --- a/var/spack/repos/builtin/packages/sdl2-image/package.py +++ b/var/spack/repos/builtin/packages/sdl2-image/package.py @@ -25,7 +25,7 @@ from spack import * -class Sdl2Image(Package): +class Sdl2Image(AutotoolsPackage): """SDL is designed to provide the bare bones of creating a graphical program. """ @@ -35,9 +35,3 @@ class Sdl2Image(Package): version('2.0.1', 'd94b94555ba022fa249a53a021dc3606') depends_on('sdl2') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/sed/package.py b/var/spack/repos/builtin/packages/sed/package.py index f2a240e1b3d..57e00f4e77b 100644 --- a/var/spack/repos/builtin/packages/sed/package.py +++ b/var/spack/repos/builtin/packages/sed/package.py @@ -25,15 +25,9 @@ from spack import * -class Sed(Package): +class Sed(AutotoolsPackage): """GNU implementation of the famous stream editor.""" homepage = "http://www.gnu.org/software/sed/" url = "http://ftpmirror.gnu.org/sed/sed-4.2.2.tar.bz2" version('4.2.2', '7ffe1c7cdc3233e1e0c4b502df253974') - - def install(self, spec, prefix): - configure('--prefix=%s' % prefix) - - make() - make("install") diff --git a/var/spack/repos/builtin/packages/sessreg/package.py b/var/spack/repos/builtin/packages/sessreg/package.py index 2ab505cc7ae..d50e65f4b03 100644 --- a/var/spack/repos/builtin/packages/sessreg/package.py +++ b/var/spack/repos/builtin/packages/sessreg/package.py @@ -25,7 +25,7 @@ from spack import * -class Sessreg(Package): +class Sessreg(AutotoolsPackage): """Sessreg is a simple program for managing utmp/wtmp entries for X sessions. It was originally written for use with xdm, but may also be used with other display managers such as gdm or kdm.""" @@ -43,9 +43,3 @@ def patch(self): kwargs = {'string': True} filter_file('$(CPP) $(DEFS)', '$(CPP) -P $(DEFS)', 'man/Makefile.in', **kwargs) - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/setxkbmap/package.py b/var/spack/repos/builtin/packages/setxkbmap/package.py index db365530c94..2c0f4380e30 100644 --- a/var/spack/repos/builtin/packages/setxkbmap/package.py +++ b/var/spack/repos/builtin/packages/setxkbmap/package.py @@ -25,7 +25,7 @@ from spack import * -class Setxkbmap(Package): +class Setxkbmap(AutotoolsPackage): """setxkbmap is an X11 client to change the keymaps in the X server for a specified keyboard to use the layout determined by the options listed on the command line.""" @@ -40,9 +40,3 @@ class Setxkbmap(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/showfont/package.py b/var/spack/repos/builtin/packages/showfont/package.py index 232988193bf..2dd83603118 100644 --- a/var/spack/repos/builtin/packages/showfont/package.py +++ b/var/spack/repos/builtin/packages/showfont/package.py @@ -25,7 +25,7 @@ from spack import * -class Showfont(Package): +class Showfont(AutotoolsPackage): """showfont displays data about a font from an X font server. The information shown includes font information, font properties, character metrics, and character bitmaps.""" @@ -39,9 +39,3 @@ class Showfont(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/smproxy/package.py b/var/spack/repos/builtin/packages/smproxy/package.py index 5bdde800d48..f7c7ebfe990 100644 --- a/var/spack/repos/builtin/packages/smproxy/package.py +++ b/var/spack/repos/builtin/packages/smproxy/package.py @@ -25,7 +25,7 @@ from spack import * -class Smproxy(Package): +class Smproxy(AutotoolsPackage): """smproxy allows X applications that do not support X11R6 session management to participate in an X11R6 session.""" @@ -41,9 +41,3 @@ class Smproxy(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/snappy/package.py b/var/spack/repos/builtin/packages/snappy/package.py index 1e94980c925..c7b8118a248 100644 --- a/var/spack/repos/builtin/packages/snappy/package.py +++ b/var/spack/repos/builtin/packages/snappy/package.py @@ -25,15 +25,10 @@ from spack import * -class Snappy(Package): +class Snappy(AutotoolsPackage): """A fast compressor/decompressor: https://code.google.com/p/snappy""" homepage = "https://code.google.com/p/snappy" url = "https://github.com/google/snappy/releases/download/1.1.3/snappy-1.1.3.tar.gz" version('1.1.3', '7358c82f133dc77798e4c2062a749b73') - - def install(self, spec, prefix): - configure("--prefix=" + prefix) - make() - make("install") diff --git a/var/spack/repos/builtin/packages/sowing/package.py b/var/spack/repos/builtin/packages/sowing/package.py index f7f6297488a..5dc23579b80 100644 --- a/var/spack/repos/builtin/packages/sowing/package.py +++ b/var/spack/repos/builtin/packages/sowing/package.py @@ -26,7 +26,7 @@ from spack import * -class Sowing(Package): +class Sowing(AutotoolsPackage): """Sowing generates Fortran interfaces and documentation for PETSc and MPICH. """ @@ -36,7 +36,5 @@ class Sowing(Package): version('1.1.23-p1', '65aaf3ae2a4c0f30d532fec291702e16') - def install(self, spec, prefix): - configure('--prefix=%s' % prefix) + def build(self, spec, prefix): make('ALL', parallel=False) - make("install") diff --git a/var/spack/repos/builtin/packages/sparsehash/package.py b/var/spack/repos/builtin/packages/sparsehash/package.py index e5abd42ae6e..6216987bce1 100644 --- a/var/spack/repos/builtin/packages/sparsehash/package.py +++ b/var/spack/repos/builtin/packages/sparsehash/package.py @@ -25,15 +25,9 @@ from spack import * -class Sparsehash(Package): +class Sparsehash(AutotoolsPackage): """Sparse and dense hash-tables for C++ by Google""" homepage = "https://github.com/sparsehash/sparsehash" url = "https://github.com/sparsehash/sparsehash/archive/sparsehash-2.0.3.tar.gz" version('2.0.3', 'd8d5e2538c1c25577b3f066d7a55e99e') - - def install(self, spec, prefix): - configure('--prefix=%s' % prefix) - - make() - make("install") diff --git a/var/spack/repos/builtin/packages/spindle/package.py b/var/spack/repos/builtin/packages/spindle/package.py index 213d41e9705..c23fb56f034 100644 --- a/var/spack/repos/builtin/packages/spindle/package.py +++ b/var/spack/repos/builtin/packages/spindle/package.py @@ -25,7 +25,7 @@ from spack import * -class Spindle(Package): +class Spindle(AutotoolsPackage): """Spindle improves the library-loading performance of dynamically linked HPC applications. Without Spindle large MPI jobs can overload on a shared file system when loading dynamically @@ -38,8 +38,3 @@ class Spindle(Package): version('0.8.1', 'f11793a6b9d8df2cd231fccb2857d912') depends_on("launchmon") - - def install(self, spec, prefix): - configure("--prefix=" + prefix) - make() - make("install") diff --git a/var/spack/repos/builtin/packages/spot/package.py b/var/spack/repos/builtin/packages/spot/package.py index 096aa24c027..abb1776aaf4 100644 --- a/var/spack/repos/builtin/packages/spot/package.py +++ b/var/spack/repos/builtin/packages/spot/package.py @@ -25,7 +25,7 @@ from spack import * -class Spot(Package): +class Spot(AutotoolsPackage): """Spot is a C++11 library for omega-automata manipulation and model checking.""" homepage = "https://spot.lrde.epita.fr/index.html" @@ -35,9 +35,3 @@ class Spot(Package): # depends_on("gcc@4.8:", type='build') depends_on("python@3.2:") - - def install(self, spec, prefix): - configure('--prefix=%s' % prefix) - - make() - make("install") diff --git a/var/spack/repos/builtin/packages/swiftsim/package.py b/var/spack/repos/builtin/packages/swiftsim/package.py index 1c424b5ca0e..2ebdc1fdcbe 100644 --- a/var/spack/repos/builtin/packages/swiftsim/package.py +++ b/var/spack/repos/builtin/packages/swiftsim/package.py @@ -58,13 +58,6 @@ def setup_environment(self, spack_env, run_env): tty.warn('This is needed to clone SWIFT repository') spack_env.set('GIT_SSL_NO_VERIFY', 1) - def autoreconf(self, spec, prefix): - libtoolize() - aclocal() - autoconf() - autogen = Executable('./autogen.sh') - autogen() - def configure_args(self): return ['--prefix=%s' % self.prefix, '--enable-mpi' if '+mpi' in self.spec else '--disable-mpi', diff --git a/var/spack/repos/builtin/packages/swig/package.py b/var/spack/repos/builtin/packages/swig/package.py index b43246dcee2..3bc1f9ac2ad 100644 --- a/var/spack/repos/builtin/packages/swig/package.py +++ b/var/spack/repos/builtin/packages/swig/package.py @@ -25,7 +25,7 @@ from spack import * -class Swig(Package): +class Swig(AutotoolsPackage): """SWIG is an interface compiler that connects programs written in C and C++ with scripting languages such as Perl, Python, Ruby, and Tcl. It works by taking the declarations found in C/C++ @@ -38,6 +38,7 @@ class Swig(Package): homepage = "http://www.swig.org" url = "http://prdownloads.sourceforge.net/swig/swig-3.0.8.tar.gz" + version('3.0.11', '13732eb0f1ab2123d180db8425c1edea') version('3.0.10', 'bb4ab8047159469add7d00910e203124') version('3.0.8', 'c96a1d5ecb13d38604d7e92148c73c97') version('3.0.2', '62f9b0d010cef36a13a010dc530d0d41') @@ -46,8 +47,3 @@ class Swig(Package): version('1.3.40', '2df766c9e03e02811b1ab4bba1c7b9cc') depends_on('pcre') - - def install(self, spec, prefix): - configure('--prefix=%s' % prefix) - make() - make('install') diff --git a/var/spack/repos/builtin/packages/symengine/package.py b/var/spack/repos/builtin/packages/symengine/package.py index f3fc13474cb..e3c00f849ae 100644 --- a/var/spack/repos/builtin/packages/symengine/package.py +++ b/var/spack/repos/builtin/packages/symengine/package.py @@ -23,9 +23,10 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## from spack import * +import sys -class Symengine(Package): +class Symengine(CMakePackage): """SymEngine is a fast symbolic manipulation library, written in C++.""" homepage = "https://github.com/symengine/symengine" @@ -35,7 +36,9 @@ class Symengine(Package): version('0.1.0', '41ad7daed61fc5a77c285eb6c7303425') version('develop', git='https://github.com/symengine/symengine.git') - variant('flint', default=True, + variant('boostmp', default=False, + description='Compile with Boost multi-precision integer library') + variant('flint', default=False, description='Compile with Flint integer library') variant('mpc', default=True, description='Compile with MPC library') @@ -54,20 +57,22 @@ class Symengine(Package): depends_on('cmake', type='build') # Other dependencies - depends_on('gmp') # mpir is a drop-in replacement for this - depends_on('mpc', when='+mpc') # Could also be built against mpir - depends_on('mpfr', when='+mpfr') # Could also be built against mpir - depends_on('flint', when='+flint') # Could also be built against mpir - depends_on('piranha', when='+piranha~flint') # Could also be built against mpir # NOQA + # NOTE: mpir is a drop-in replacement for gmp + # NOTE: [mpc,mpfr,flint,piranha] could also be built against mpir + depends_on('boost', when='+boostmp') + depends_on('gmp', when='~boostmp') + depends_on('mpc', when='+mpc~boostmp') + depends_on('mpfr', when='+mpfr~boostmp') + depends_on('flint', when='+flint~boostmp') + depends_on('piranha', when='+piranha~flint~boostmp') - def install(self, spec, prefix): + def build_type(self): + # CMAKE_BUILD_TYPE should be Debug | Release + return 'Release' + + def cmake_args(self): + spec = self.spec options = [] - options.extend(std_cmake_args) - - # CMAKE_BUILD_TYPE should be Debug | Release - for word in options[:]: - if word.startswith('-DCMAKE_BUILD_TYPE'): - options.remove(word) # See https://github.com/symengine/symengine/blob/master/README.md # for build options @@ -76,38 +81,47 @@ def install(self, spec, prefix): '-DWITH_SYMENGINE_RCP:BOOL=ON', '-DWITH_SYMENGINE_THREAD_SAFE:BOOL=%s' % ( 'ON' if ('+thread_safe' or '+openmp') in spec else 'OFF'), - '-DBUILD_TESTS:BOOL=ON', + '-DBUILD_TESTS:BOOL=%s' % ( + 'ON' if self.run_tests else 'OFF'), '-DBUILD_BENCHMARKS:BOOL=ON', - '-DWITH_MPC:BOOL=%s' % ( - 'ON' if '+mpc' in spec else 'OFF'), - '-DWITH_MPFR:BOOL=%s' % ( - 'ON' if '+mpfr' in spec else 'OFF'), - '-DINTEGER_CLASS:STRING=gmp', '-DWITH_OPENMP:BOOL=%s' % ( 'ON' if '+openmp' in spec else 'OFF'), '-DBUILD_SHARED_LIBS:BOOL=%s' % ( 'ON' if '+shared' in spec else 'OFF'), ]) - if '+flint' in spec: + if sys.platform == 'darwin': options.extend([ - '-DWITH_FLINT:BOOL=ON', - '-DINTEGER_CLASS:STRING=flint' + '-DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=on' ]) - elif '+piranha' in spec: + + if '+boostmp' in spec: options.extend([ - '-DWITH_PIRANHA:BOOL=ON', - '-DINTEGER_CLASS:STRING=piranha' + '-DINTEGER_CLASS:STRING=boostmp', + '-DBoost_INCLUDE_DIR=%s' % spec['boost'].prefix.include, + '-DWITH_MPC:BOOL=OFF', + '-DWITH_MPFR:BOOL=OFF', ]) else: options.extend([ - '-DINTEGER_CLASS:STRING=gmp' + '-DWITH_MPC:BOOL=%s' % ( + 'ON' if '+mpc' in spec else 'OFF'), + '-DWITH_MPFR:BOOL=%s' % ( + 'ON' if '+mpfr' in spec else 'OFF'), ]) + if '+flint' in spec: + options.extend([ + '-DWITH_FLINT:BOOL=ON', + '-DINTEGER_CLASS:STRING=flint' + ]) + elif '+piranha' in spec: + options.extend([ + '-DWITH_PIRANHA:BOOL=ON', + '-DINTEGER_CLASS:STRING=piranha' + ]) + else: + options.extend([ + '-DINTEGER_CLASS:STRING=gmp' + ]) - with working_dir('spack-build', create=True): - cmake('..', *options) - - make() - make('install') - if self.run_tests: - ctest() + return options diff --git a/var/spack/repos/builtin/packages/tcl/package.py b/var/spack/repos/builtin/packages/tcl/package.py index d9b535305db..a9bc3cceaab 100644 --- a/var/spack/repos/builtin/packages/tcl/package.py +++ b/var/spack/repos/builtin/packages/tcl/package.py @@ -42,6 +42,8 @@ class Tcl(AutotoolsPackage): depends_on('zlib') + configure_directory = 'unix' + def url_for_version(self, version): base_url = 'http://prdownloads.sourceforge.net/tcl' return '{0}/tcl{1}-src.tar.gz'.format(base_url, version) @@ -52,10 +54,7 @@ def setup_environment(self, spack_env, env): env.set('TCL_LIBRARY', join_path(self.prefix.lib, 'tcl{0}'.format( self.spec.version.up_to(2)))) - def build_directory(self): - return 'unix' - - @AutotoolsPackage.sanity_check('install') + @run_after('install') def symlink_tclsh(self): with working_dir(self.prefix.bin): symlink('tclsh{0}'.format(self.version.up_to(2)), 'tclsh') diff --git a/var/spack/repos/builtin/packages/the-silver-searcher/package.py b/var/spack/repos/builtin/packages/the-silver-searcher/package.py index c98e964efa6..9721554663f 100644 --- a/var/spack/repos/builtin/packages/the-silver-searcher/package.py +++ b/var/spack/repos/builtin/packages/the-silver-searcher/package.py @@ -25,7 +25,7 @@ from spack import * -class TheSilverSearcher(Package): +class TheSilverSearcher(AutotoolsPackage): """Fast recursive grep alternative""" homepage = "http://geoff.greer.fm/ag/" url = "http://geoff.greer.fm/ag/releases/the_silver_searcher-0.32.0.tar.gz" @@ -36,9 +36,3 @@ class TheSilverSearcher(Package): depends_on('pcre') depends_on('xz') depends_on('pkg-config', type='build') - - def install(self, spec, prefix): - configure("--prefix=%s" % prefix) - - make() - make("install") diff --git a/var/spack/repos/builtin/packages/tk/package.py b/var/spack/repos/builtin/packages/tk/package.py index 071db04e635..66573eaa451 100644 --- a/var/spack/repos/builtin/packages/tk/package.py +++ b/var/spack/repos/builtin/packages/tk/package.py @@ -42,6 +42,8 @@ class Tk(AutotoolsPackage): depends_on("tcl") depends_on("libx11", when='+X') + configure_directory = 'unix' + def url_for_version(self, version): base_url = "http://prdownloads.sourceforge.net/tcl" return "{0}/tk{1}-src.tar.gz".format(base_url, version) @@ -52,9 +54,6 @@ def setup_environment(self, spack_env, run_env): run_env.set('TK_LIBRARY', join_path(self.prefix.lib, 'tk{0}'.format( self.spec.version.up_to(2)))) - def build_directory(self): - return 'unix' - def configure_args(self): spec = self.spec return ['--with-tcl={0}'.format(spec['tcl'].prefix.lib)] diff --git a/var/spack/repos/builtin/packages/transset/package.py b/var/spack/repos/builtin/packages/transset/package.py index 0f607387417..27f3a2f8823 100644 --- a/var/spack/repos/builtin/packages/transset/package.py +++ b/var/spack/repos/builtin/packages/transset/package.py @@ -25,7 +25,7 @@ from spack import * -class Transset(Package): +class Transset(AutotoolsPackage): """transset is an utility for setting opacity property.""" homepage = "http://cgit.freedesktop.org/xorg/app/transset" @@ -38,9 +38,3 @@ class Transset(Package): depends_on('xproto@7.0.17:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/trapproto/package.py b/var/spack/repos/builtin/packages/trapproto/package.py index eebab744100..879ac569dfb 100644 --- a/var/spack/repos/builtin/packages/trapproto/package.py +++ b/var/spack/repos/builtin/packages/trapproto/package.py @@ -25,15 +25,10 @@ from spack import * -class Trapproto(Package): +class Trapproto(AutotoolsPackage): """X.org TrapProto protocol headers.""" homepage = "https://cgit.freedesktop.org/xorg/proto/trapproto" url = "https://www.x.org/archive/individual/proto/trapproto-3.4.3.tar.gz" version('3.4.3', '1344759ae8d7d923e64f5eec078a679b') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make('install') diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index 4b3412ce7af..9add3b238cc 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -25,6 +25,7 @@ from spack import * import os import sys +import platform # Trilinos is complicated to build, as an inspiration a couple of links to # other repositories which build it: @@ -157,6 +158,10 @@ def cmake_args(self): 'DEBUG' if '+debug' in spec else 'RELEASE'), '-DBUILD_SHARED_LIBS:BOOL=%s' % ( 'ON' if '+shared' in spec else 'OFF'), + '-DTPL_FIND_SHARED_LIBS:BOOL=%s' % ( + 'ON' if '+shared' in spec else 'OFF'), + '-DTrilinos_LINK_SEARCH_START_STATIC:BOOL=%s' % ( + 'OFF' if '+shared' in spec else 'ON'), '-DTPL_ENABLE_MPI:BOOL=ON', '-DMPI_BASE_DIR:PATH=%s' % spec['mpi'].prefix, '-DTPL_ENABLE_BLAS=ON', @@ -167,10 +172,15 @@ def cmake_args(self): '-DLAPACK_LIBRARY_DIRS=%s' % ';'.join(lapack.directories), '-DTrilinos_ENABLE_EXPLICIT_INSTANTIATION:BOOL=ON', '-DTrilinos_ENABLE_CXX11:BOOL=ON', - '-DTPL_ENABLE_Netcdf:BOOL=ON', - '-DCMAKE_INSTALL_NAME_DIR:PATH=%s/lib' % self.prefix + '-DTPL_ENABLE_Netcdf:BOOL=ON' ]) + if '.'.join(platform.mac_ver()[0].split('.')[:2]) == '10.12': + # use @rpath on Sierra due to limit of dynamic loader + options.append('-DCMAKE_MACOSX_RPATH=ON') + else: + options.append('-DCMAKE_INSTALL_NAME_DIR:PATH=%s/lib' % prefix) + # Force Trilinos to use the MPI wrappers instead of raw compilers # this is needed on Apple systems that require full resolution of # all symbols when linking shared libraries @@ -369,7 +379,7 @@ def cmake_args(self): ]) return options - @CMakePackage.sanity_check('install') + @run_after('install') def filter_python(self): # When trilinos is built with Python, libpytrilinos is included # through cmake configure files. Namely, Trilinos_LIBRARIES in diff --git a/var/spack/repos/builtin/packages/twm/package.py b/var/spack/repos/builtin/packages/twm/package.py index 3e37f4903d3..a1a221b969e 100644 --- a/var/spack/repos/builtin/packages/twm/package.py +++ b/var/spack/repos/builtin/packages/twm/package.py @@ -25,7 +25,7 @@ from spack import * -class Twm(Package): +class Twm(AutotoolsPackage): """twm is a window manager for the X Window System. It provides titlebars, shaped windows, several forms of icon management, user-defined macro functions, click-to-type and pointer-driven @@ -48,9 +48,3 @@ class Twm(Package): depends_on('flex', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/uberftp/package.py b/var/spack/repos/builtin/packages/uberftp/package.py index b0c6c8a42f0..f9d0174b78a 100644 --- a/var/spack/repos/builtin/packages/uberftp/package.py +++ b/var/spack/repos/builtin/packages/uberftp/package.py @@ -25,7 +25,7 @@ from spack import * -class Uberftp(Package): +class Uberftp(AutotoolsPackage): """UberFTP is an interactive (text-based) client for GridFTP""" homepage = "http://toolkit.globus.org/grid_software/data/uberftp.php" @@ -36,9 +36,3 @@ class Uberftp(Package): version('2_6', '784210976f259f9d19c0798c19778d34') depends_on('globus-toolkit') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/udunits2/package.py b/var/spack/repos/builtin/packages/udunits2/package.py index 57d18e1ea44..faf40551947 100644 --- a/var/spack/repos/builtin/packages/udunits2/package.py +++ b/var/spack/repos/builtin/packages/udunits2/package.py @@ -29,11 +29,34 @@ class Udunits2(AutotoolsPackage): """Automated units conversion""" homepage = "http://www.unidata.ucar.edu/software/udunits" - url = "ftp://ftp.unidata.ucar.edu/pub/udunits/udunits-2.2.20.tar.gz" + url = "https://github.com/Unidata/UDUNITS-2/archive/v2.2.23.tar.gz" - version('2.2.20', '1586b70a49dfe05da5fcc29ef239dce0') + version('2.2.25', '373106a0fcd20c40fc53a975c9fa4fca') + version('2.2.24', '316911493e3b5c28ff7019223b4e27ea') + version('2.2.23', '0c0d9b1ebd7ad066233bedf40e66f1ba') + version('2.2.21', '167738b3ec886da1b92239de9cbbbc39') depends_on('expat') depends_on('bison', type='build') depends_on('flex', type='build') + depends_on('libtool', type='build') + depends_on('automake', type='build') + depends_on('autoconf', type='build') + depends_on('pkg-config', type='build') + + def autoreconf(self, spec, prefix): + # Work around autogen.sh oddities + # bash = which("bash") + # bash("./autogen.sh") + mkdirp("config") + autoreconf = which("autoreconf") + autoreconf("--install", "--verbose", "--force", + "-I", "config", + "-I", join_path(spec['pkg-config'].prefix, + "share", "aclocal"), + "-I", join_path(spec['automake'].prefix, + "share", "aclocal"), + "-I", join_path(spec['libtool'].prefix, + "share", "aclocal"), + ) diff --git a/var/spack/repos/builtin/packages/uncrustify/package.py b/var/spack/repos/builtin/packages/uncrustify/package.py index c3182d0dc89..7e4b3bd24d0 100644 --- a/var/spack/repos/builtin/packages/uncrustify/package.py +++ b/var/spack/repos/builtin/packages/uncrustify/package.py @@ -25,15 +25,10 @@ from spack import * -class Uncrustify(Package): +class Uncrustify(AutotoolsPackage): """Source Code Beautifier for C, C++, C#, ObjectiveC, Java, and others.""" homepage = "http://uncrustify.sourceforge.net/" url = "http://downloads.sourceforge.net/project/uncrustify/uncrustify/uncrustify-0.61/uncrustify-0.61.tar.gz" version('0.61', 'b6140106e74c64e831d0b1c4b6cf7727') - - def install(self, spec, prefix): - configure("--prefix=%s" % prefix) - make() - make("install") diff --git a/var/spack/repos/builtin/packages/unixodbc/package.py b/var/spack/repos/builtin/packages/unixodbc/package.py index 15de127b7ea..8ce11d27ddf 100644 --- a/var/spack/repos/builtin/packages/unixodbc/package.py +++ b/var/spack/repos/builtin/packages/unixodbc/package.py @@ -25,18 +25,12 @@ from spack import * -class Unixodbc(Package): +class Unixodbc(AutotoolsPackage): """ODBC is an open specification for providing application developers with a predictable API with which to access Data Sources. Data Sources include SQL Servers and any Data Source with an ODBC Driver.""" homepage = "http://www.unixodbc.org/" - url = "ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-2.3.4.tar.gz" + url = "http://www.unixodbc.org/unixODBC-2.3.4.tar.gz" version('2.3.4', 'bd25d261ca1808c947cb687e2034be81') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/util-macros/package.py b/var/spack/repos/builtin/packages/util-macros/package.py index 486d4463b0d..1d7515b4cf5 100644 --- a/var/spack/repos/builtin/packages/util-macros/package.py +++ b/var/spack/repos/builtin/packages/util-macros/package.py @@ -25,17 +25,13 @@ from spack import * -class UtilMacros(Package): +class UtilMacros(AutotoolsPackage): """This is a set of autoconf macros used by the configure.ac scripts in other Xorg modular packages, and is needed to generate new versions of their configure scripts with autoconf.""" homepage = "http://cgit.freedesktop.org/xorg/util/macros/" - url = "https://www.x.org/archive/individual/util/util-macros-1.19.0.tar.bz2" + url = "https://www.x.org/archive/individual/util/util-macros-1.19.1.tar.bz2" + version('1.19.1', '6e76e546a4e580f15cebaf8019ef1625') version('1.19.0', '1cf984125e75f8204938d998a8b6c1e1') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make('install') diff --git a/var/spack/repos/builtin/packages/valgrind/package.py b/var/spack/repos/builtin/packages/valgrind/package.py index e7ae227c27c..0794e77ba09 100644 --- a/var/spack/repos/builtin/packages/valgrind/package.py +++ b/var/spack/repos/builtin/packages/valgrind/package.py @@ -40,6 +40,7 @@ class Valgrind(Package): homepage = "http://valgrind.org/" url = "http://valgrind.org/downloads/valgrind-3.11.0.tar.bz2" + version('3.12.0', '6eb03c0c10ea917013a7622e483d61bb') version('3.11.0', '4ea62074da73ae82e0162d6550d3f129') version('3.10.1', '60ddae962bc79e7c95cfc4667245707f') version('3.10.0', '7c311a72a20388aceced1aa5573ce970') diff --git a/var/spack/repos/builtin/packages/videoproto/package.py b/var/spack/repos/builtin/packages/videoproto/package.py index 93b0e61ca43..d1495fe33da 100644 --- a/var/spack/repos/builtin/packages/videoproto/package.py +++ b/var/spack/repos/builtin/packages/videoproto/package.py @@ -25,7 +25,7 @@ from spack import * -class Videoproto(Package): +class Videoproto(AutotoolsPackage): """X Video Extension. This extension provides a protocol for a video output mechanism, @@ -38,8 +38,3 @@ class Videoproto(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make('install') diff --git a/var/spack/repos/builtin/packages/viewres/package.py b/var/spack/repos/builtin/packages/viewres/package.py index 3a325550756..9e6daafc8b3 100644 --- a/var/spack/repos/builtin/packages/viewres/package.py +++ b/var/spack/repos/builtin/packages/viewres/package.py @@ -25,7 +25,7 @@ from spack import * -class Viewres(Package): +class Viewres(AutotoolsPackage): """viewres displays a tree showing the widget class hierarchy of the Athena Widget Set (libXaw).""" @@ -40,9 +40,3 @@ class Viewres(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/vizglow/package.py b/var/spack/repos/builtin/packages/vizglow/package.py index 9e4506b05a6..42e3e23aced 100644 --- a/var/spack/repos/builtin/packages/vizglow/package.py +++ b/var/spack/repos/builtin/packages/vizglow/package.py @@ -39,20 +39,73 @@ class Vizglow(Package): homepage = "http://esgeetech.com/products/vizglow-plasma-modeling/" - version('2.2a-15', 'be2b5044f30f2b2c3bbe87a0037bf228', expand=False, + version('2.2alpha20', '2bef890c66f3a44aaf96f7c96788c89e', expand=False, + url="file://{0}/VizGlow_v2.2alpha20-Linux-x86_64-R09December2016-Install".format(os.getcwd())) + version('2.2alpha17', '1de268564363e0ee86f9ffff1c3b82e1', expand=False, + url="file://{0}/VizGlow_v2.2alpha17-R21November2016-Linux-x86_64-Install".format(os.getcwd())) + version('2.2alpha15', 'be2b5044f30f2b2c3bbe87a0037bf228', expand=False, url="file://{0}/VizGlow_v2.2alpha15-Linux-x86_64-R31October2016-Install".format(os.getcwd())) + # depends_on('mesa') # TODO: mesa build doesn't work for me + depends_on('zlib') + depends_on('freetype') + depends_on('fontconfig') + depends_on('libxrender') + depends_on('xterm') + # Can't get mozjs to build, packagekit -> polkit -> mozjs + # depends_on('packagekit+gtk') + depends_on('libcanberra+gtk') + # Licensing license_required = True license_comment = '#' license_files = ['esgeelm.lic'] license_vars = ['ESGEE_LICENSE_FILE'] + def configure(self, prefix): + # Dictionary of responses + responses = { + 'CreateDesktopShortcut': 'No', + 'CreateQuickLaunchShortcut': 'No', + 'InstallDir': prefix + } + + # Write response file + with open('spack-responses.txt', 'w') as response_file: + for key in responses: + response_file.write('{0}: {1}\n'.format(key, responses[key])) + def install(self, spec, prefix): + self.configure(prefix) + installer = glob.glob('VizGlow*Install')[0] chmod = which('chmod') chmod('+x', installer) installer = Executable(installer) - installer('--mode', 'silent', '--prefix', prefix) + installer('--mode', 'silent', '--response-file', 'spack-responses.txt') + + self.filter_ld_library_path(spec, prefix) + + def filter_ld_library_path(self, spec, prefix): + """Run after install to inject dependencies into LD_LIBRARY_PATH. + + If we don't do this, the run files will clear the LD_LIBRARY_PATH. + Since the installer is a binary file, we have no means of specifying + an RPATH to use.""" + + files = glob.glob(prefix + '/binaries/*.run') + + ld_library_path = ':'.join([ + spec['zlib'].prefix.lib, + spec['freetype'].prefix.lib, + spec['fontconfig'].prefix.lib, + spec['libxrender'].prefix.lib, + spec['libcanberra'].prefix.lib + ]) + + for runfile in files: + filter_file('(export LD_LIBRARY_PATH=)$', + r'\1{0}'.format(ld_library_path), + runfile) diff --git a/var/spack/repos/builtin/packages/windowswmproto/package.py b/var/spack/repos/builtin/packages/windowswmproto/package.py index f163d1afb0b..9341cbd22c7 100644 --- a/var/spack/repos/builtin/packages/windowswmproto/package.py +++ b/var/spack/repos/builtin/packages/windowswmproto/package.py @@ -25,7 +25,7 @@ from spack import * -class Windowswmproto(Package): +class Windowswmproto(AutotoolsPackage): """This module provides the definition of the WindowsWM extension to the X11 protocol, used for coordination between an X11 server and the Microsoft Windows native window manager. @@ -37,8 +37,3 @@ class Windowswmproto(Package): url = "https://www.x.org/archive/individual/proto/windowswmproto-1.0.4.tar.gz" version('1.0.4', '558db92a8e4e1b07e9c62eca3f04dd8d') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make('install') diff --git a/var/spack/repos/builtin/packages/x11perf/package.py b/var/spack/repos/builtin/packages/x11perf/package.py index 91db1e8a59b..89936e77f54 100644 --- a/var/spack/repos/builtin/packages/x11perf/package.py +++ b/var/spack/repos/builtin/packages/x11perf/package.py @@ -25,7 +25,7 @@ from spack import * -class X11perf(Package): +class X11perf(AutotoolsPackage): """Simple X server performance benchmarker.""" homepage = "http://cgit.freedesktop.org/xorg/app/x11perf" @@ -41,9 +41,3 @@ class X11perf(Package): depends_on('xproto@7.0.17:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xauth/package.py b/var/spack/repos/builtin/packages/xauth/package.py index 6d6a03c8996..fa172b5dc02 100644 --- a/var/spack/repos/builtin/packages/xauth/package.py +++ b/var/spack/repos/builtin/packages/xauth/package.py @@ -25,7 +25,7 @@ from spack import * -class Xauth(Package): +class Xauth(AutotoolsPackage): """The xauth program is used to edit and display the authorization information used in connecting to the X server.""" @@ -43,9 +43,4 @@ class Xauth(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - # make('check') # TODO: add package for cmdtest build dependency - make('install') + # TODO: add package for cmdtest test dependency diff --git a/var/spack/repos/builtin/packages/xbacklight/package.py b/var/spack/repos/builtin/packages/xbacklight/package.py index f1a9ecc1242..da9ab8f3bd1 100644 --- a/var/spack/repos/builtin/packages/xbacklight/package.py +++ b/var/spack/repos/builtin/packages/xbacklight/package.py @@ -25,7 +25,7 @@ from spack import * -class Xbacklight(Package): +class Xbacklight(AutotoolsPackage): """Xbacklight is used to adjust the backlight brightness where supported. It uses the RandR extension to find all outputs on the X server supporting backlight brightness control and changes them all in the @@ -41,9 +41,3 @@ class Xbacklight(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xbiff/package.py b/var/spack/repos/builtin/packages/xbiff/package.py index f5c53c5997d..29bd9086d8b 100644 --- a/var/spack/repos/builtin/packages/xbiff/package.py +++ b/var/spack/repos/builtin/packages/xbiff/package.py @@ -25,7 +25,7 @@ from spack import * -class Xbiff(Package): +class Xbiff(AutotoolsPackage): """xbiff provides graphical notification of new e-mail. It only handles mail stored in a filesystem accessible file, not via IMAP, POP or other remote access protocols.""" @@ -43,9 +43,3 @@ class Xbiff(Package): depends_on('xbitmaps', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xbitmaps/package.py b/var/spack/repos/builtin/packages/xbitmaps/package.py index 1c6fb79d3ad..6fcaf1240d4 100644 --- a/var/spack/repos/builtin/packages/xbitmaps/package.py +++ b/var/spack/repos/builtin/packages/xbitmaps/package.py @@ -25,7 +25,7 @@ from spack import * -class Xbitmaps(Package): +class Xbitmaps(AutotoolsPackage): """The xbitmaps package contains bitmap images used by multiple applications built in Xorg.""" @@ -36,8 +36,3 @@ class Xbitmaps(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make('install') diff --git a/var/spack/repos/builtin/packages/xcalc/package.py b/var/spack/repos/builtin/packages/xcalc/package.py index a470d1c9d06..7b4717db65a 100644 --- a/var/spack/repos/builtin/packages/xcalc/package.py +++ b/var/spack/repos/builtin/packages/xcalc/package.py @@ -25,7 +25,7 @@ from spack import * -class Xcalc(Package): +class Xcalc(AutotoolsPackage): """xcalc is a scientific calculator X11 client that can emulate a TI-30 or an HP-10C.""" @@ -41,9 +41,3 @@ class Xcalc(Package): depends_on('xproto@7.0.17:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xcb-demo/package.py b/var/spack/repos/builtin/packages/xcb-demo/package.py index 62433e3b32e..6c3ccfa8aaa 100644 --- a/var/spack/repos/builtin/packages/xcb-demo/package.py +++ b/var/spack/repos/builtin/packages/xcb-demo/package.py @@ -25,7 +25,7 @@ from spack import * -class XcbDemo(Package): +class XcbDemo(AutotoolsPackage): """xcb-demo: A collection of demo programs that use the XCB library.""" homepage = "https://xcb.freedesktop.org/" @@ -40,12 +40,5 @@ class XcbDemo(Package): depends_on('pkg-config@0.9.0:', type='build') - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - # FIXME: crashes with the following error message - # X11/XCB/xcb.h: No such file or directory - - make() - make('check') - make('install') + # FIXME: crashes with the following error message + # X11/XCB/xcb.h: No such file or directory diff --git a/var/spack/repos/builtin/packages/xcb-proto/package.py b/var/spack/repos/builtin/packages/xcb-proto/package.py index d2ac54d34f4..be8a09ef62f 100644 --- a/var/spack/repos/builtin/packages/xcb-proto/package.py +++ b/var/spack/repos/builtin/packages/xcb-proto/package.py @@ -25,7 +25,7 @@ from spack import * -class XcbProto(Package): +class XcbProto(AutotoolsPackage): """xcb-proto provides the XML-XCB protocol descriptions that libxcb uses to generate the majority of its code and API.""" @@ -37,8 +37,4 @@ class XcbProto(Package): extends('python') - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - # make('check') # fails xmllint validation - make('install') + # NOTE: `make check` fails xmllint validation diff --git a/var/spack/repos/builtin/packages/xcb-util-cursor/package.py b/var/spack/repos/builtin/packages/xcb-util-cursor/package.py index b25fb181a61..83ae52ae934 100644 --- a/var/spack/repos/builtin/packages/xcb-util-cursor/package.py +++ b/var/spack/repos/builtin/packages/xcb-util-cursor/package.py @@ -25,7 +25,7 @@ from spack import * -class XcbUtilCursor(Package): +class XcbUtilCursor(AutotoolsPackage): """The XCB util modules provides a number of libraries which sit on top of libxcb, the core X protocol library, and some of the extension libraries. These experimental libraries provide convenience functions @@ -43,9 +43,3 @@ class XcbUtilCursor(Package): depends_on('xcb-util-image') depends_on('pkg-config@0.9.0:', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xcb-util-errors/package.py b/var/spack/repos/builtin/packages/xcb-util-errors/package.py index c287a0ec6e7..f7c950841d5 100644 --- a/var/spack/repos/builtin/packages/xcb-util-errors/package.py +++ b/var/spack/repos/builtin/packages/xcb-util-errors/package.py @@ -25,7 +25,7 @@ from spack import * -class XcbUtilErrors(Package): +class XcbUtilErrors(AutotoolsPackage): """The XCB util modules provides a number of libraries which sit on top of libxcb, the core X protocol library, and some of the extension libraries. These experimental libraries provide convenience functions @@ -42,10 +42,3 @@ class XcbUtilErrors(Package): depends_on('xcb-proto', type='build') depends_on('pkg-config@0.9.0:', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('check') - make('install') diff --git a/var/spack/repos/builtin/packages/xcb-util-image/package.py b/var/spack/repos/builtin/packages/xcb-util-image/package.py index 4413c7e11dc..58a5f82d181 100644 --- a/var/spack/repos/builtin/packages/xcb-util-image/package.py +++ b/var/spack/repos/builtin/packages/xcb-util-image/package.py @@ -25,7 +25,7 @@ from spack import * -class XcbUtilImage(Package): +class XcbUtilImage(AutotoolsPackage): """The XCB util modules provides a number of libraries which sit on top of libxcb, the core X protocol library, and some of the extension libraries. These experimental libraries provide convenience functions @@ -43,10 +43,3 @@ class XcbUtilImage(Package): depends_on('xproto@7.0.8:', type='build') depends_on('pkg-config@0.9.0:', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('check') - make('install') diff --git a/var/spack/repos/builtin/packages/xcb-util-keysyms/package.py b/var/spack/repos/builtin/packages/xcb-util-keysyms/package.py index 0de6391b183..026ac2a129d 100644 --- a/var/spack/repos/builtin/packages/xcb-util-keysyms/package.py +++ b/var/spack/repos/builtin/packages/xcb-util-keysyms/package.py @@ -25,7 +25,7 @@ from spack import * -class XcbUtilKeysyms(Package): +class XcbUtilKeysyms(AutotoolsPackage): """The XCB util modules provides a number of libraries which sit on top of libxcb, the core X protocol library, and some of the extension libraries. These experimental libraries provide convenience functions @@ -42,9 +42,3 @@ class XcbUtilKeysyms(Package): depends_on('xproto@7.0.8:', type='build') depends_on('pkg-config@0.9.0:', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xcb-util-renderutil/package.py b/var/spack/repos/builtin/packages/xcb-util-renderutil/package.py index d41c88206c9..aa4db331128 100644 --- a/var/spack/repos/builtin/packages/xcb-util-renderutil/package.py +++ b/var/spack/repos/builtin/packages/xcb-util-renderutil/package.py @@ -25,7 +25,7 @@ from spack import * -class XcbUtilRenderutil(Package): +class XcbUtilRenderutil(AutotoolsPackage): """The XCB util modules provides a number of libraries which sit on top of libxcb, the core X protocol library, and some of the extension libraries. These experimental libraries provide convenience functions @@ -41,9 +41,3 @@ class XcbUtilRenderutil(Package): depends_on('libxcb@1.4:') depends_on('pkg-config@0.9.0:', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xcb-util-wm/package.py b/var/spack/repos/builtin/packages/xcb-util-wm/package.py index ef3db06aec1..c5dfe65423b 100644 --- a/var/spack/repos/builtin/packages/xcb-util-wm/package.py +++ b/var/spack/repos/builtin/packages/xcb-util-wm/package.py @@ -25,7 +25,7 @@ from spack import * -class XcbUtilWm(Package): +class XcbUtilWm(AutotoolsPackage): """The XCB util modules provides a number of libraries which sit on top of libxcb, the core X protocol library, and some of the extension libraries. These experimental libraries provide convenience functions @@ -41,9 +41,3 @@ class XcbUtilWm(Package): depends_on('libxcb@1.4:') depends_on('pkg-config@0.9.0:', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xcb-util/package.py b/var/spack/repos/builtin/packages/xcb-util/package.py index 820592a3197..6dcfbb64473 100644 --- a/var/spack/repos/builtin/packages/xcb-util/package.py +++ b/var/spack/repos/builtin/packages/xcb-util/package.py @@ -25,7 +25,7 @@ from spack import * -class XcbUtil(Package): +class XcbUtil(AutotoolsPackage): """The XCB util modules provides a number of libraries which sit on top of libxcb, the core X protocol library, and some of the extension libraries. These experimental libraries provide convenience functions @@ -41,9 +41,3 @@ class XcbUtil(Package): depends_on('libxcb@1.4:') depends_on('pkg-config@0.9.0:', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xclipboard/package.py b/var/spack/repos/builtin/packages/xclipboard/package.py index d9af19da719..309a09bd762 100644 --- a/var/spack/repos/builtin/packages/xclipboard/package.py +++ b/var/spack/repos/builtin/packages/xclipboard/package.py @@ -25,7 +25,7 @@ from spack import * -class Xclipboard(Package): +class Xclipboard(AutotoolsPackage): """xclipboard is used to collect and display text selections that are sent to the CLIPBOARD by other clients. It is typically used to save CLIPBOARD selections for later use. It stores each CLIPBOARD @@ -45,9 +45,3 @@ class Xclipboard(Package): depends_on('xproto@7.0.17:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xclock/package.py b/var/spack/repos/builtin/packages/xclock/package.py index 5bd38826db2..0ec33e78de7 100644 --- a/var/spack/repos/builtin/packages/xclock/package.py +++ b/var/spack/repos/builtin/packages/xclock/package.py @@ -25,7 +25,7 @@ from spack import * -class Xclock(Package): +class Xclock(AutotoolsPackage): """xclock is the classic X Window System clock utility. It displays the time in analog or digital form, continuously updated at a frequency which may be specified by the user.""" @@ -46,9 +46,3 @@ class Xclock(Package): depends_on('xproto@7.0.17:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xcmiscproto/package.py b/var/spack/repos/builtin/packages/xcmiscproto/package.py index 2b15d1b3e77..c31b19f04be 100644 --- a/var/spack/repos/builtin/packages/xcmiscproto/package.py +++ b/var/spack/repos/builtin/packages/xcmiscproto/package.py @@ -25,7 +25,7 @@ from spack import * -class Xcmiscproto(Package): +class Xcmiscproto(AutotoolsPackage): """XC-MISC Extension. This extension defines a protocol that provides Xlib two ways to query @@ -38,8 +38,3 @@ class Xcmiscproto(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make('install') diff --git a/var/spack/repos/builtin/packages/xcmsdb/package.py b/var/spack/repos/builtin/packages/xcmsdb/package.py index 4d12e3a843a..74e1f6267f0 100644 --- a/var/spack/repos/builtin/packages/xcmsdb/package.py +++ b/var/spack/repos/builtin/packages/xcmsdb/package.py @@ -25,7 +25,7 @@ from spack import * -class Xcmsdb(Package): +class Xcmsdb(AutotoolsPackage): """xcmsdb is used to load, query, or remove Device Color Characterization data stored in properties on the root window of the screen as specified in section 7, Device Color Characterization, of the @@ -40,9 +40,3 @@ class Xcmsdb(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xcompmgr/package.py b/var/spack/repos/builtin/packages/xcompmgr/package.py index fc5bbb4b9c6..1c0771e38dd 100644 --- a/var/spack/repos/builtin/packages/xcompmgr/package.py +++ b/var/spack/repos/builtin/packages/xcompmgr/package.py @@ -25,7 +25,7 @@ from spack import * -class Xcompmgr(Package): +class Xcompmgr(AutotoolsPackage): """xcompmgr is a sample compositing manager for X servers supporting the XFIXES, DAMAGE, RENDER, and COMPOSITE extensions. It enables basic eye-candy effects.""" @@ -43,9 +43,3 @@ class Xcompmgr(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xconsole/package.py b/var/spack/repos/builtin/packages/xconsole/package.py index f86fe753b6a..eabd5a48eda 100644 --- a/var/spack/repos/builtin/packages/xconsole/package.py +++ b/var/spack/repos/builtin/packages/xconsole/package.py @@ -25,7 +25,7 @@ from spack import * -class Xconsole(Package): +class Xconsole(AutotoolsPackage): """xconsole displays in a X11 window the messages which are usually sent to /dev/console.""" @@ -42,9 +42,3 @@ class Xconsole(Package): depends_on('xproto@7.0.17:') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xcursorgen/package.py b/var/spack/repos/builtin/packages/xcursorgen/package.py index 4e43844646c..8098723fc8e 100644 --- a/var/spack/repos/builtin/packages/xcursorgen/package.py +++ b/var/spack/repos/builtin/packages/xcursorgen/package.py @@ -25,7 +25,7 @@ from spack import * -class Xcursorgen(Package): +class Xcursorgen(AutotoolsPackage): """xcursorgen prepares X11 cursor sets for use with libXcursor.""" homepage = "http://cgit.freedesktop.org/xorg/app/xcursorgen" @@ -39,9 +39,3 @@ class Xcursorgen(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xdbedizzy/package.py b/var/spack/repos/builtin/packages/xdbedizzy/package.py index 7a8f97401f5..61ad98dc617 100644 --- a/var/spack/repos/builtin/packages/xdbedizzy/package.py +++ b/var/spack/repos/builtin/packages/xdbedizzy/package.py @@ -25,7 +25,7 @@ from spack import * -class Xdbedizzy(Package): +class Xdbedizzy(AutotoolsPackage): """xdbedizzy is a demo of the X11 Double Buffer Extension (DBE) creating a double buffered spinning scene.""" @@ -39,9 +39,3 @@ class Xdbedizzy(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xditview/package.py b/var/spack/repos/builtin/packages/xditview/package.py index 3fececd12e3..4f5384b81c9 100644 --- a/var/spack/repos/builtin/packages/xditview/package.py +++ b/var/spack/repos/builtin/packages/xditview/package.py @@ -25,7 +25,7 @@ from spack import * -class Xditview(Package): +class Xditview(AutotoolsPackage): """xditview displays ditroff output on an X display.""" homepage = "http://cgit.freedesktop.org/xorg/app/xditview" @@ -40,9 +40,3 @@ class Xditview(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xdm/package.py b/var/spack/repos/builtin/packages/xdm/package.py index d42ced9a579..384077e5568 100644 --- a/var/spack/repos/builtin/packages/xdm/package.py +++ b/var/spack/repos/builtin/packages/xdm/package.py @@ -25,7 +25,7 @@ from spack import * -class Xdm(Package): +class Xdm(AutotoolsPackage): """X Display Manager / XDMCP server.""" homepage = "http://cgit.freedesktop.org/xorg/app/xdm" @@ -46,9 +46,3 @@ class Xdm(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xdpyinfo/package.py b/var/spack/repos/builtin/packages/xdpyinfo/package.py index c69af3b357b..f3838999eb6 100644 --- a/var/spack/repos/builtin/packages/xdpyinfo/package.py +++ b/var/spack/repos/builtin/packages/xdpyinfo/package.py @@ -25,7 +25,7 @@ from spack import * -class Xdpyinfo(Package): +class Xdpyinfo(AutotoolsPackage): """xdpyinfo is a utility for displaying information about an X server. It is used to examine the capabilities of a server, the predefined @@ -46,9 +46,3 @@ class Xdpyinfo(Package): depends_on('xproto@7.0.22:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xdriinfo/package.py b/var/spack/repos/builtin/packages/xdriinfo/package.py index 7548175f6f9..9545f7707d9 100644 --- a/var/spack/repos/builtin/packages/xdriinfo/package.py +++ b/var/spack/repos/builtin/packages/xdriinfo/package.py @@ -25,7 +25,7 @@ from spack import * -class Xdriinfo(Package): +class Xdriinfo(AutotoolsPackage): """xdriinfo - query configuration information of X11 DRI drivers.""" homepage = "http://cgit.freedesktop.org/xorg/app/xdriinfo" @@ -44,9 +44,3 @@ class Xdriinfo(Package): depends_on('glproto', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xedit/package.py b/var/spack/repos/builtin/packages/xedit/package.py index da5f28809f5..73aca40a3b4 100644 --- a/var/spack/repos/builtin/packages/xedit/package.py +++ b/var/spack/repos/builtin/packages/xedit/package.py @@ -25,7 +25,7 @@ from spack import * -class Xedit(Package): +class Xedit(AutotoolsPackage): """Xedit is a simple text editor for X.""" homepage = "https://cgit.freedesktop.org/xorg/app/xedit" @@ -40,9 +40,3 @@ class Xedit(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xerces-c/package.py b/var/spack/repos/builtin/packages/xerces-c/package.py index 9f3ad8a4dce..bd28a9eec6c 100644 --- a/var/spack/repos/builtin/packages/xerces-c/package.py +++ b/var/spack/repos/builtin/packages/xerces-c/package.py @@ -25,21 +25,17 @@ from spack import * -class XercesC(Package): +class XercesC(AutotoolsPackage): """Xerces-C++ is a validating XML parser written in a portable subset of C++. Xerces-C++ makes it easy to give your application the ability to read and write XML data. A shared library is provided for parsing, generating, manipulating, and validating XML documents using the DOM, SAX, and SAX2 - APIs. - """ + APIs.""" homepage = "https://xerces.apache.org/xerces-c" url = "https://www.apache.org/dist/xerces/c/3/sources/xerces-c-3.1.4.tar.bz2" + version('3.1.4', 'd04ae9d8b2dee2157c6db95fa908abfd') - def install(self, spec, prefix): - configure("--prefix=%s" % prefix, - "--disable-network") - make("clean") - make() - make("install") + def configure_args(self): + return ['--disable-network'] diff --git a/var/spack/repos/builtin/packages/xev/package.py b/var/spack/repos/builtin/packages/xev/package.py index 5727d4e4287..79ff7b08a72 100644 --- a/var/spack/repos/builtin/packages/xev/package.py +++ b/var/spack/repos/builtin/packages/xev/package.py @@ -25,7 +25,7 @@ from spack import * -class Xev(Package): +class Xev(AutotoolsPackage): """xev creates a window and then asks the X server to send it X11 events whenever anything happens to the window (such as it being moved, resized, typed in, clicked in, etc.). You can also attach it to an @@ -45,9 +45,3 @@ class Xev(Package): depends_on('xproto@7.0.17:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xextproto/package.py b/var/spack/repos/builtin/packages/xextproto/package.py index 9c1c123527d..012a023e720 100644 --- a/var/spack/repos/builtin/packages/xextproto/package.py +++ b/var/spack/repos/builtin/packages/xextproto/package.py @@ -25,7 +25,7 @@ from spack import * -class Xextproto(Package): +class Xextproto(AutotoolsPackage): """X Protocol Extensions.""" homepage = "http://cgit.freedesktop.org/xorg/proto/xextproto" @@ -37,8 +37,3 @@ class Xextproto(Package): depends_on('util-macros', type='build') parallel = False - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make('install') diff --git a/var/spack/repos/builtin/packages/xeyes/package.py b/var/spack/repos/builtin/packages/xeyes/package.py index cfea92fda37..599b08544b1 100644 --- a/var/spack/repos/builtin/packages/xeyes/package.py +++ b/var/spack/repos/builtin/packages/xeyes/package.py @@ -25,7 +25,7 @@ from spack import * -class Xeyes(Package): +class Xeyes(AutotoolsPackage): """xeyes - a follow the mouse X demo, using the X SHAPE extension""" homepage = "http://cgit.freedesktop.org/xorg/app/xeyes" @@ -41,9 +41,3 @@ class Xeyes(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xf86bigfontproto/package.py b/var/spack/repos/builtin/packages/xf86bigfontproto/package.py index 6c1dc8f37d9..5a2e10a7ba6 100644 --- a/var/spack/repos/builtin/packages/xf86bigfontproto/package.py +++ b/var/spack/repos/builtin/packages/xf86bigfontproto/package.py @@ -25,15 +25,10 @@ from spack import * -class Xf86bigfontproto(Package): +class Xf86bigfontproto(AutotoolsPackage): """X.org XF86BigFontProto protocol headers.""" homepage = "https://cgit.freedesktop.org/xorg/proto/xf86bigfontproto" url = "https://www.x.org/archive/individual/proto/xf86bigfontproto-1.2.0.tar.gz" version('1.2.0', '91b0733ff4cbe55808d96073258aa3d1') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make('install') diff --git a/var/spack/repos/builtin/packages/xf86dga/package.py b/var/spack/repos/builtin/packages/xf86dga/package.py index 8add6fbca7e..1bd2feaaa38 100644 --- a/var/spack/repos/builtin/packages/xf86dga/package.py +++ b/var/spack/repos/builtin/packages/xf86dga/package.py @@ -25,7 +25,7 @@ from spack import * -class Xf86dga(Package): +class Xf86dga(AutotoolsPackage): """dga is a simple test client for the XFree86-DGA extension.""" homepage = "http://cgit.freedesktop.org/xorg/app/xf86dga" @@ -38,9 +38,3 @@ class Xf86dga(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xf86dgaproto/package.py b/var/spack/repos/builtin/packages/xf86dgaproto/package.py index 05b64c9534c..3c92582a3a3 100644 --- a/var/spack/repos/builtin/packages/xf86dgaproto/package.py +++ b/var/spack/repos/builtin/packages/xf86dgaproto/package.py @@ -25,15 +25,10 @@ from spack import * -class Xf86dgaproto(Package): +class Xf86dgaproto(AutotoolsPackage): """X.org XF86DGAProto protocol headers.""" homepage = "https://cgit.freedesktop.org/xorg/proto/xf86dgaproto" url = "https://www.x.org/archive/individual/proto/xf86dgaproto-2.1.tar.gz" version('2.1', '1fe79dc07857ad3e1fb8b8f2bdd70d1b') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make('install') diff --git a/var/spack/repos/builtin/packages/xf86driproto/package.py b/var/spack/repos/builtin/packages/xf86driproto/package.py index 655d1bc60ba..8378eb9e5e9 100644 --- a/var/spack/repos/builtin/packages/xf86driproto/package.py +++ b/var/spack/repos/builtin/packages/xf86driproto/package.py @@ -25,7 +25,7 @@ from spack import * -class Xf86driproto(Package): +class Xf86driproto(AutotoolsPackage): """XFree86 Direct Rendering Infrastructure Extension. This extension defines a protocol to allow user applications to access @@ -39,8 +39,3 @@ class Xf86driproto(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make('install') diff --git a/var/spack/repos/builtin/packages/xf86miscproto/package.py b/var/spack/repos/builtin/packages/xf86miscproto/package.py index 4b7e2790771..4368eed3265 100644 --- a/var/spack/repos/builtin/packages/xf86miscproto/package.py +++ b/var/spack/repos/builtin/packages/xf86miscproto/package.py @@ -25,7 +25,7 @@ from spack import * -class Xf86miscproto(Package): +class Xf86miscproto(AutotoolsPackage): """This package includes the protocol definitions of the "XFree86-Misc" extension to the X11 protocol. The "XFree86-Misc" extension is supported by the XFree86 X server and versions of the Xorg X server @@ -35,8 +35,3 @@ class Xf86miscproto(Package): url = "https://www.x.org/archive/individual/proto/xf86miscproto-0.9.3.tar.gz" version('0.9.3', 'c6432f04f84929c94fa05b3a466c489d') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make('install') diff --git a/var/spack/repos/builtin/packages/xf86rushproto/package.py b/var/spack/repos/builtin/packages/xf86rushproto/package.py index bdd192970b6..05b9afa40a1 100644 --- a/var/spack/repos/builtin/packages/xf86rushproto/package.py +++ b/var/spack/repos/builtin/packages/xf86rushproto/package.py @@ -25,15 +25,10 @@ from spack import * -class Xf86rushproto(Package): +class Xf86rushproto(AutotoolsPackage): """X.org XF86RushProto protocol headers.""" homepage = "https://cgit.freedesktop.org/xorg/proto/xf86rushproto" url = "https://www.x.org/archive/individual/proto/xf86rushproto-1.1.2.tar.gz" version('1.1.2', '6a6389473332ace01146cccfef228576') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make('install') diff --git a/var/spack/repos/builtin/packages/xf86vidmodeproto/package.py b/var/spack/repos/builtin/packages/xf86vidmodeproto/package.py index ece389f9e60..aaf1db44729 100644 --- a/var/spack/repos/builtin/packages/xf86vidmodeproto/package.py +++ b/var/spack/repos/builtin/packages/xf86vidmodeproto/package.py @@ -25,7 +25,7 @@ from spack import * -class Xf86vidmodeproto(Package): +class Xf86vidmodeproto(AutotoolsPackage): """XFree86 Video Mode Extension. This extension defines a protocol for dynamically configuring modelines @@ -38,8 +38,3 @@ class Xf86vidmodeproto(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make('install') diff --git a/var/spack/repos/builtin/packages/xfd/package.py b/var/spack/repos/builtin/packages/xfd/package.py index 669cd83bf59..b7d1282b278 100644 --- a/var/spack/repos/builtin/packages/xfd/package.py +++ b/var/spack/repos/builtin/packages/xfd/package.py @@ -25,7 +25,7 @@ from spack import * -class Xfd(Package): +class Xfd(AutotoolsPackage): """xfd - display all the characters in a font using either the X11 core protocol or libXft2.""" @@ -44,9 +44,3 @@ class Xfd(Package): depends_on('xproto@7.0.17:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xfindproxy/package.py b/var/spack/repos/builtin/packages/xfindproxy/package.py index e4b83433c4e..af767be8a1a 100644 --- a/var/spack/repos/builtin/packages/xfindproxy/package.py +++ b/var/spack/repos/builtin/packages/xfindproxy/package.py @@ -25,7 +25,7 @@ from spack import * -class Xfindproxy(Package): +class Xfindproxy(AutotoolsPackage): """xfindproxy is used to locate available X11 proxy services. It utilizes the Proxy Management Protocol to communicate with a proxy @@ -45,9 +45,3 @@ class Xfindproxy(Package): depends_on('xproxymanagementprotocol', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xfontsel/package.py b/var/spack/repos/builtin/packages/xfontsel/package.py index 772ff8d5705..ca14f1460c1 100644 --- a/var/spack/repos/builtin/packages/xfontsel/package.py +++ b/var/spack/repos/builtin/packages/xfontsel/package.py @@ -25,7 +25,7 @@ from spack import * -class Xfontsel(Package): +class Xfontsel(AutotoolsPackage): """xfontsel application provides a simple way to display the X11 core protocol fonts known to your X server, examine samples of each, and retrieve the X Logical Font Description ("XLFD") full name for a font.""" @@ -42,9 +42,3 @@ class Xfontsel(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xfs/package.py b/var/spack/repos/builtin/packages/xfs/package.py index 72429dee90e..e5a71e4a278 100644 --- a/var/spack/repos/builtin/packages/xfs/package.py +++ b/var/spack/repos/builtin/packages/xfs/package.py @@ -25,7 +25,7 @@ from spack import * -class Xfs(Package): +class Xfs(AutotoolsPackage): """X Font Server.""" homepage = "http://cgit.freedesktop.org/xorg/app/xfs" @@ -40,9 +40,3 @@ class Xfs(Package): depends_on('xtrans', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xfsinfo/package.py b/var/spack/repos/builtin/packages/xfsinfo/package.py index b31ad1c1e05..9913537995e 100644 --- a/var/spack/repos/builtin/packages/xfsinfo/package.py +++ b/var/spack/repos/builtin/packages/xfsinfo/package.py @@ -25,7 +25,7 @@ from spack import * -class Xfsinfo(Package): +class Xfsinfo(AutotoolsPackage): """xfsinfo is a utility for displaying information about an X font server. It is used to examine the capabilities of a server, the predefined values for various parameters used in communicating between @@ -42,9 +42,3 @@ class Xfsinfo(Package): depends_on('xproto@7.0.17:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xfwp/package.py b/var/spack/repos/builtin/packages/xfwp/package.py index 5f073a88068..c199b50f6cf 100644 --- a/var/spack/repos/builtin/packages/xfwp/package.py +++ b/var/spack/repos/builtin/packages/xfwp/package.py @@ -25,7 +25,7 @@ from spack import * -class Xfwp(Package): +class Xfwp(AutotoolsPackage): """xfwp proxies X11 protocol connections, such as through a firewall.""" homepage = "http://cgit.freedesktop.org/xorg/app/xfwp" @@ -40,11 +40,5 @@ class Xfwp(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - # FIXME: fails with the error message: - # io.c:1039:7: error: implicit declaration of function 'swab' - - make() - make('install') + # FIXME: fails with the error message: + # io.c:1039:7: error: implicit declaration of function 'swab' diff --git a/var/spack/repos/builtin/packages/xgamma/package.py b/var/spack/repos/builtin/packages/xgamma/package.py index b8abec293a1..845f2a54e36 100644 --- a/var/spack/repos/builtin/packages/xgamma/package.py +++ b/var/spack/repos/builtin/packages/xgamma/package.py @@ -25,7 +25,7 @@ from spack import * -class Xgamma(Package): +class Xgamma(AutotoolsPackage): """xgamma allows X users to query and alter the gamma correction of a monitor via the X video mode extension (XFree86-VidModeExtension).""" @@ -40,9 +40,3 @@ class Xgamma(Package): depends_on('xproto@7.0.17:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xgc/package.py b/var/spack/repos/builtin/packages/xgc/package.py index 608e6e0360d..23ba36809e5 100644 --- a/var/spack/repos/builtin/packages/xgc/package.py +++ b/var/spack/repos/builtin/packages/xgc/package.py @@ -25,7 +25,7 @@ from spack import * -class Xgc(Package): +class Xgc(AutotoolsPackage): """xgc is an X11 graphics demo that shows various features of the X11 core protocol graphics primitives.""" @@ -41,9 +41,3 @@ class Xgc(Package): depends_on('bison', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xhost/package.py b/var/spack/repos/builtin/packages/xhost/package.py index f01c481ee7e..3928593611d 100644 --- a/var/spack/repos/builtin/packages/xhost/package.py +++ b/var/spack/repos/builtin/packages/xhost/package.py @@ -25,7 +25,7 @@ from spack import * -class Xhost(Package): +class Xhost(AutotoolsPackage): """xhost is used to manage the list of host names or user names allowed to make connections to the X server.""" @@ -41,9 +41,3 @@ class Xhost(Package): depends_on('xproto@7.0.22:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xineramaproto/package.py b/var/spack/repos/builtin/packages/xineramaproto/package.py index baededbb253..0a3374b1b6c 100644 --- a/var/spack/repos/builtin/packages/xineramaproto/package.py +++ b/var/spack/repos/builtin/packages/xineramaproto/package.py @@ -25,7 +25,7 @@ from spack import * -class Xineramaproto(Package): +class Xineramaproto(AutotoolsPackage): """X Xinerama Extension. This is an X extension that allows multiple physical screens controlled @@ -38,8 +38,3 @@ class Xineramaproto(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make('install') diff --git a/var/spack/repos/builtin/packages/xinit/package.py b/var/spack/repos/builtin/packages/xinit/package.py index 9f3bc092297..8bf7227cc8f 100644 --- a/var/spack/repos/builtin/packages/xinit/package.py +++ b/var/spack/repos/builtin/packages/xinit/package.py @@ -25,7 +25,7 @@ from spack import * -class Xinit(Package): +class Xinit(AutotoolsPackage): """The xinit program is used to start the X Window System server and a first client program on systems that are not using a display manager such as xdm.""" @@ -40,9 +40,3 @@ class Xinit(Package): depends_on('xproto@7.0.17:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xinput/package.py b/var/spack/repos/builtin/packages/xinput/package.py index 3c4fb35503d..b512d864958 100644 --- a/var/spack/repos/builtin/packages/xinput/package.py +++ b/var/spack/repos/builtin/packages/xinput/package.py @@ -25,7 +25,7 @@ from spack import * -class Xinput(Package): +class Xinput(AutotoolsPackage): """xinput is a utility to configure and test XInput devices.""" homepage = "http://cgit.freedesktop.org/xorg/app/xinput" @@ -42,9 +42,3 @@ class Xinput(Package): depends_on('inputproto@2.1.99.1:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xkbcomp/package.py b/var/spack/repos/builtin/packages/xkbcomp/package.py index e6e8875fa7a..315c49a22d2 100644 --- a/var/spack/repos/builtin/packages/xkbcomp/package.py +++ b/var/spack/repos/builtin/packages/xkbcomp/package.py @@ -25,7 +25,7 @@ from spack import * -class Xkbcomp(Package): +class Xkbcomp(AutotoolsPackage): """The X Keyboard (XKB) Extension essentially replaces the core protocol definition of a keyboard. The extension makes it possible to specify clearly and explicitly most aspects of keyboard behaviour on a per-key @@ -45,9 +45,3 @@ class Xkbcomp(Package): depends_on('bison', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xkbdata/package.py b/var/spack/repos/builtin/packages/xkbdata/package.py index fc84631e369..c67e047d71c 100644 --- a/var/spack/repos/builtin/packages/xkbdata/package.py +++ b/var/spack/repos/builtin/packages/xkbdata/package.py @@ -25,7 +25,7 @@ from spack import * -class Xkbdata(Package): +class Xkbdata(AutotoolsPackage): """The XKB data files for the various keyboard models, layouts, and locales.""" @@ -35,9 +35,3 @@ class Xkbdata(Package): version('1.0.1', 'a7e0fbc9cc84c621243c777694388064') depends_on('xkbcomp', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xkbevd/package.py b/var/spack/repos/builtin/packages/xkbevd/package.py index 462d989db2e..8793a3a38bd 100644 --- a/var/spack/repos/builtin/packages/xkbevd/package.py +++ b/var/spack/repos/builtin/packages/xkbevd/package.py @@ -25,7 +25,7 @@ from spack import * -class Xkbevd(Package): +class Xkbevd(AutotoolsPackage): """XKB event daemon demo.""" homepage = "http://cgit.freedesktop.org/xorg/app/xkbevd" @@ -39,9 +39,3 @@ class Xkbevd(Package): depends_on('bison', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xkbprint/package.py b/var/spack/repos/builtin/packages/xkbprint/package.py index dc92ac41264..100d4e44361 100644 --- a/var/spack/repos/builtin/packages/xkbprint/package.py +++ b/var/spack/repos/builtin/packages/xkbprint/package.py @@ -25,7 +25,7 @@ from spack import * -class Xkbprint(Package): +class Xkbprint(AutotoolsPackage): """xkbprint generates a printable or encapsulated PostScript description of an XKB keyboard description.""" @@ -40,9 +40,3 @@ class Xkbprint(Package): depends_on('xproto@7.0.17:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xkbutils/package.py b/var/spack/repos/builtin/packages/xkbutils/package.py index a4c6c975780..eef24a01455 100644 --- a/var/spack/repos/builtin/packages/xkbutils/package.py +++ b/var/spack/repos/builtin/packages/xkbutils/package.py @@ -25,7 +25,7 @@ from spack import * -class Xkbutils(Package): +class Xkbutils(AutotoolsPackage): """xkbutils is a collection of small utilities utilizing the XKeyboard (XKB) extension to the X11 protocol.""" @@ -42,9 +42,3 @@ class Xkbutils(Package): depends_on('inputproto', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xkeyboard-config/package.py b/var/spack/repos/builtin/packages/xkeyboard-config/package.py index 3ad7ea197c8..d7ae34e1e63 100644 --- a/var/spack/repos/builtin/packages/xkeyboard-config/package.py +++ b/var/spack/repos/builtin/packages/xkeyboard-config/package.py @@ -25,7 +25,7 @@ from spack import * -class XkeyboardConfig(Package): +class XkeyboardConfig(AutotoolsPackage): """This project provides a consistent, well-structured, frequently released, open source database of keyboard configuration data. The project is targeted to XKB-based systems.""" @@ -49,9 +49,3 @@ class XkeyboardConfig(Package): # gmsgfmt # perl@5.8.1: # perl XML::Parser - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xkill/package.py b/var/spack/repos/builtin/packages/xkill/package.py index 061d756eec5..e73fa3b9a29 100644 --- a/var/spack/repos/builtin/packages/xkill/package.py +++ b/var/spack/repos/builtin/packages/xkill/package.py @@ -25,7 +25,7 @@ from spack import * -class Xkill(Package): +class Xkill(AutotoolsPackage): """xkill is a utility for forcing the X server to close connections to clients. This program is very dangerous, but is useful for aborting programs that have displayed undesired windows on a user's screen.""" @@ -41,9 +41,3 @@ class Xkill(Package): depends_on('xproto@7.0.22:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xload/package.py b/var/spack/repos/builtin/packages/xload/package.py index 2fc91043b50..412c0aa0c43 100644 --- a/var/spack/repos/builtin/packages/xload/package.py +++ b/var/spack/repos/builtin/packages/xload/package.py @@ -25,7 +25,7 @@ from spack import * -class Xload(Package): +class Xload(AutotoolsPackage): """xload displays a periodically updating histogram of the system load average.""" @@ -42,9 +42,3 @@ class Xload(Package): depends_on('xproto@7.0.17:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xlogo/package.py b/var/spack/repos/builtin/packages/xlogo/package.py index 77f5bd3639c..8e1250cc69c 100644 --- a/var/spack/repos/builtin/packages/xlogo/package.py +++ b/var/spack/repos/builtin/packages/xlogo/package.py @@ -25,7 +25,7 @@ from spack import * -class Xlogo(Package): +class Xlogo(AutotoolsPackage): """The xlogo program simply displays the X Window System logo.""" homepage = "http://cgit.freedesktop.org/xorg/app/xlogo" @@ -45,9 +45,3 @@ class Xlogo(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xlsatoms/package.py b/var/spack/repos/builtin/packages/xlsatoms/package.py index 8722b57c8c1..5f0dc8adc7c 100644 --- a/var/spack/repos/builtin/packages/xlsatoms/package.py +++ b/var/spack/repos/builtin/packages/xlsatoms/package.py @@ -25,7 +25,7 @@ from spack import * -class Xlsatoms(Package): +class Xlsatoms(AutotoolsPackage): """xlsatoms lists the interned atoms defined on an X11 server.""" homepage = "http://cgit.freedesktop.org/xorg/app/xlsatoms" @@ -38,9 +38,3 @@ class Xlsatoms(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xlsclients/package.py b/var/spack/repos/builtin/packages/xlsclients/package.py index 3714de27069..fb232a1d0f5 100644 --- a/var/spack/repos/builtin/packages/xlsclients/package.py +++ b/var/spack/repos/builtin/packages/xlsclients/package.py @@ -25,7 +25,7 @@ from spack import * -class Xlsclients(Package): +class Xlsclients(AutotoolsPackage): """xlsclients is a utility for listing information about the client applications running on a X11 server.""" @@ -39,9 +39,3 @@ class Xlsclients(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xlsfonts/package.py b/var/spack/repos/builtin/packages/xlsfonts/package.py index 011ca5aa0e7..61696a5010f 100644 --- a/var/spack/repos/builtin/packages/xlsfonts/package.py +++ b/var/spack/repos/builtin/packages/xlsfonts/package.py @@ -25,7 +25,7 @@ from spack import * -class Xlsfonts(Package): +class Xlsfonts(AutotoolsPackage): """xlsfonts lists fonts available from an X server via the X11 core protocol.""" @@ -39,9 +39,3 @@ class Xlsfonts(Package): depends_on('xproto@7.0.17:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xmag/package.py b/var/spack/repos/builtin/packages/xmag/package.py index 27843299c86..65eb9e636be 100644 --- a/var/spack/repos/builtin/packages/xmag/package.py +++ b/var/spack/repos/builtin/packages/xmag/package.py @@ -25,7 +25,7 @@ from spack import * -class Xmag(Package): +class Xmag(AutotoolsPackage): """xmag displays a magnified snapshot of a portion of an X11 screen.""" homepage = "http://cgit.freedesktop.org/xorg/app/xmag" @@ -40,9 +40,3 @@ class Xmag(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xman/package.py b/var/spack/repos/builtin/packages/xman/package.py index 629a457edc0..0a3bf893eee 100644 --- a/var/spack/repos/builtin/packages/xman/package.py +++ b/var/spack/repos/builtin/packages/xman/package.py @@ -25,7 +25,7 @@ from spack import * -class Xman(Package): +class Xman(AutotoolsPackage): """xman is a graphical manual page browser using the Athena Widgets (Xaw) toolkit.""" @@ -40,9 +40,3 @@ class Xman(Package): depends_on('xproto@7.0.17:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xmessage/package.py b/var/spack/repos/builtin/packages/xmessage/package.py index 9b2ee5102ef..7481713c1b0 100644 --- a/var/spack/repos/builtin/packages/xmessage/package.py +++ b/var/spack/repos/builtin/packages/xmessage/package.py @@ -25,7 +25,7 @@ from spack import * -class Xmessage(Package): +class Xmessage(AutotoolsPackage): """xmessage displays a message or query in a window. The user can click on an "okay" button to dismiss it or can select one of several buttons to answer a question. xmessage can also exit after a specified time.""" @@ -40,9 +40,3 @@ class Xmessage(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xmh/package.py b/var/spack/repos/builtin/packages/xmh/package.py index cdde63e1494..1c7bc8a3469 100644 --- a/var/spack/repos/builtin/packages/xmh/package.py +++ b/var/spack/repos/builtin/packages/xmh/package.py @@ -25,7 +25,7 @@ from spack import * -class Xmh(Package): +class Xmh(AutotoolsPackage): """The xmh program provides a graphical user interface to the MH Message Handling System. To actually do things with your mail, it makes calls to the MH package.""" @@ -43,9 +43,3 @@ class Xmh(Package): depends_on('xbitmaps@1.1.0:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xmlto/package.py b/var/spack/repos/builtin/packages/xmlto/package.py index 0dbc81de32c..2ed392b9b86 100644 --- a/var/spack/repos/builtin/packages/xmlto/package.py +++ b/var/spack/repos/builtin/packages/xmlto/package.py @@ -25,7 +25,7 @@ from spack import * -class Xmlto(Package): +class Xmlto(AutotoolsPackage): """Utility xmlto is a simple shell script for converting XML files to various formats. It serves as easy to use command line frontend to make fine output without remembering many long options and searching for the syntax of the @@ -38,9 +38,3 @@ class Xmlto(Package): # FIXME: missing a lot of dependencies depends_on('libxslt') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xmodmap/package.py b/var/spack/repos/builtin/packages/xmodmap/package.py index abe40dbb437..323a16cbe8b 100644 --- a/var/spack/repos/builtin/packages/xmodmap/package.py +++ b/var/spack/repos/builtin/packages/xmodmap/package.py @@ -25,7 +25,7 @@ from spack import * -class Xmodmap(Package): +class Xmodmap(AutotoolsPackage): """The xmodmap program is used to edit and display the keyboard modifier map and keymap table that are used by client applications to convert event keycodes into keysyms. It is usually run from the user's @@ -42,9 +42,3 @@ class Xmodmap(Package): depends_on('xproto@7.0.25:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xmore/package.py b/var/spack/repos/builtin/packages/xmore/package.py index 8f8ccd71383..bb1f0ada276 100644 --- a/var/spack/repos/builtin/packages/xmore/package.py +++ b/var/spack/repos/builtin/packages/xmore/package.py @@ -25,7 +25,7 @@ from spack import * -class Xmore(Package): +class Xmore(AutotoolsPackage): """xmore - plain text display program for the X Window System.""" homepage = "http://cgit.freedesktop.org/xorg/app/xmore" @@ -38,9 +38,3 @@ class Xmore(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xorg-cf-files/package.py b/var/spack/repos/builtin/packages/xorg-cf-files/package.py index c7b22d904fb..a203911d0eb 100644 --- a/var/spack/repos/builtin/packages/xorg-cf-files/package.py +++ b/var/spack/repos/builtin/packages/xorg-cf-files/package.py @@ -25,7 +25,7 @@ from spack import * -class XorgCfFiles(Package): +class XorgCfFiles(AutotoolsPackage): """The xorg-cf-files package contains the data files for the imake utility, defining the known settings for a wide variety of platforms (many of which have not been verified or tested in over a decade), and for many of the @@ -37,8 +37,3 @@ class XorgCfFiles(Package): version('1.0.6', 'c0ce98377c70d95fb48e1bd856109bf8') depends_on('pkg-config@0.9.0:', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make('install') diff --git a/var/spack/repos/builtin/packages/xorg-docs/package.py b/var/spack/repos/builtin/packages/xorg-docs/package.py index 5c320bba7b9..7bee98859da 100644 --- a/var/spack/repos/builtin/packages/xorg-docs/package.py +++ b/var/spack/repos/builtin/packages/xorg-docs/package.py @@ -25,7 +25,7 @@ from spack import * -class XorgDocs(Package): +class XorgDocs(AutotoolsPackage): """This package provides miscellaneous documentation for the X Window System that doesn't better fit into other packages. @@ -40,9 +40,3 @@ class XorgDocs(Package): depends_on('util-macros', type='build') depends_on('xorg-sgml-doctools@1.8:', type='build') depends_on('xmlto', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xorg-gtest/package.py b/var/spack/repos/builtin/packages/xorg-gtest/package.py index 6978d610d32..ede26149e1f 100644 --- a/var/spack/repos/builtin/packages/xorg-gtest/package.py +++ b/var/spack/repos/builtin/packages/xorg-gtest/package.py @@ -25,7 +25,7 @@ from spack import * -class XorgGtest(Package): +class XorgGtest(AutotoolsPackage): """Provides a Google Test environment for starting and stopping a X server for testing purposes.""" @@ -43,9 +43,3 @@ class XorgGtest(Package): # TODO: may be missing evemu package? # TODO: what is the difference between xorg-gtest and googletest packages? - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xorg-server/package.py b/var/spack/repos/builtin/packages/xorg-server/package.py index 9d9b49f9c26..fcc4918a02c 100644 --- a/var/spack/repos/builtin/packages/xorg-server/package.py +++ b/var/spack/repos/builtin/packages/xorg-server/package.py @@ -25,7 +25,7 @@ from spack import * -class XorgServer(Package): +class XorgServer(AutotoolsPackage): """X.Org Server is the free and open source implementation of the display server for the X Window System stewarded by the X.Org Foundation.""" @@ -100,9 +100,3 @@ class XorgServer(Package): # LIBUDEV="libudev >= 143" # LIBSELINUX="libselinux >= 2.0.86" # LIBDBUS="dbus-1 >= 1.0" - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xorg-sgml-doctools/package.py b/var/spack/repos/builtin/packages/xorg-sgml-doctools/package.py index c2e5797efa9..c9a5d4fd80f 100644 --- a/var/spack/repos/builtin/packages/xorg-sgml-doctools/package.py +++ b/var/spack/repos/builtin/packages/xorg-sgml-doctools/package.py @@ -25,7 +25,7 @@ from spack import * -class XorgSgmlDoctools(Package): +class XorgSgmlDoctools(AutotoolsPackage): """This package provides a common set of SGML entities and XML/CSS style sheets used in building/formatting the documentation provided in other X.Org packages.""" @@ -37,9 +37,3 @@ class XorgSgmlDoctools(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xphelloworld/package.py b/var/spack/repos/builtin/packages/xphelloworld/package.py index 6d445d69bed..ce593e746bf 100644 --- a/var/spack/repos/builtin/packages/xphelloworld/package.py +++ b/var/spack/repos/builtin/packages/xphelloworld/package.py @@ -25,7 +25,7 @@ from spack import * -class Xphelloworld(Package): +class Xphelloworld(AutotoolsPackage): """Xprint sample applications.""" homepage = "http://cgit.freedesktop.org/xorg/app/xphelloworld" @@ -46,9 +46,3 @@ class Xphelloworld(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xplsprinters/package.py b/var/spack/repos/builtin/packages/xplsprinters/package.py index 55de272a337..b8fdb084721 100644 --- a/var/spack/repos/builtin/packages/xplsprinters/package.py +++ b/var/spack/repos/builtin/packages/xplsprinters/package.py @@ -25,7 +25,7 @@ from spack import * -class Xplsprinters(Package): +class Xplsprinters(AutotoolsPackage): """List Xprint printers.""" homepage = "http://cgit.freedesktop.org/xorg/app/xplsprinters" @@ -39,9 +39,3 @@ class Xplsprinters(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xpr/package.py b/var/spack/repos/builtin/packages/xpr/package.py index 669693e0842..6e933e0994e 100644 --- a/var/spack/repos/builtin/packages/xpr/package.py +++ b/var/spack/repos/builtin/packages/xpr/package.py @@ -25,7 +25,7 @@ from spack import * -class Xpr(Package): +class Xpr(AutotoolsPackage): """xpr takes as input a window dump file produced by xwd and formats it for output on various types of printers.""" @@ -40,9 +40,3 @@ class Xpr(Package): depends_on('xproto@7.0.17:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xprehashprinterlist/package.py b/var/spack/repos/builtin/packages/xprehashprinterlist/package.py index 4578c3c1918..3f7de96c123 100644 --- a/var/spack/repos/builtin/packages/xprehashprinterlist/package.py +++ b/var/spack/repos/builtin/packages/xprehashprinterlist/package.py @@ -25,7 +25,7 @@ from spack import * -class Xprehashprinterlist(Package): +class Xprehashprinterlist(AutotoolsPackage): """Rehash list of Xprint printers.""" homepage = "http://cgit.freedesktop.org/xorg/app/xprehashprinterlist" @@ -38,9 +38,3 @@ class Xprehashprinterlist(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xprop/package.py b/var/spack/repos/builtin/packages/xprop/package.py index 0e1a591bcbf..ece50c92052 100644 --- a/var/spack/repos/builtin/packages/xprop/package.py +++ b/var/spack/repos/builtin/packages/xprop/package.py @@ -25,7 +25,7 @@ from spack import * -class Xprop(Package): +class Xprop(AutotoolsPackage): """xprop is a command line tool to display and/or set window and font properties of an X server.""" @@ -39,9 +39,3 @@ class Xprop(Package): depends_on('xproto@7.0.17:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xproto/package.py b/var/spack/repos/builtin/packages/xproto/package.py index 67074a69939..9e1b6d44742 100644 --- a/var/spack/repos/builtin/packages/xproto/package.py +++ b/var/spack/repos/builtin/packages/xproto/package.py @@ -25,7 +25,7 @@ from spack import * -class Xproto(Package): +class Xproto(AutotoolsPackage): """X Window System Core Protocol. This package provides the headers and specification documents defining @@ -42,8 +42,3 @@ class Xproto(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make('install') diff --git a/var/spack/repos/builtin/packages/xproxymanagementprotocol/package.py b/var/spack/repos/builtin/packages/xproxymanagementprotocol/package.py index e5bfcb8cbcb..cec6a13f5f8 100644 --- a/var/spack/repos/builtin/packages/xproxymanagementprotocol/package.py +++ b/var/spack/repos/builtin/packages/xproxymanagementprotocol/package.py @@ -25,7 +25,7 @@ from spack import * -class Xproxymanagementprotocol(Package): +class Xproxymanagementprotocol(AutotoolsPackage): """The Proxy Management Protocol is an ICE based protocol that provides a way for application servers to easily locate proxy services available to them.""" @@ -34,8 +34,3 @@ class Xproxymanagementprotocol(Package): url = "https://www.x.org/archive/individual/proto/xproxymanagementprotocol-1.0.3.tar.gz" version('1.0.3', 'c4ab05a6174b4e9b6ae5b7cfbb6d718e') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make('install') diff --git a/var/spack/repos/builtin/packages/xrandr/package.py b/var/spack/repos/builtin/packages/xrandr/package.py index 35e21c60477..6fdc4da4feb 100644 --- a/var/spack/repos/builtin/packages/xrandr/package.py +++ b/var/spack/repos/builtin/packages/xrandr/package.py @@ -25,7 +25,7 @@ from spack import * -class Xrandr(Package): +class Xrandr(AutotoolsPackage): """xrandr - primitive command line interface to X11 Resize, Rotate, and Reflect (RandR) extension.""" @@ -41,9 +41,3 @@ class Xrandr(Package): depends_on('xproto@7.0.17:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xrdb/package.py b/var/spack/repos/builtin/packages/xrdb/package.py index 93847a19a0b..c0374e7056d 100644 --- a/var/spack/repos/builtin/packages/xrdb/package.py +++ b/var/spack/repos/builtin/packages/xrdb/package.py @@ -25,7 +25,7 @@ from spack import * -class Xrdb(Package): +class Xrdb(AutotoolsPackage): """xrdb - X server resource database utility.""" homepage = "http://cgit.freedesktop.org/xorg/app/xrdb" @@ -39,9 +39,3 @@ class Xrdb(Package): depends_on('xproto@7.0.17:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xrefresh/package.py b/var/spack/repos/builtin/packages/xrefresh/package.py index f99810beea8..3a2c47b0865 100644 --- a/var/spack/repos/builtin/packages/xrefresh/package.py +++ b/var/spack/repos/builtin/packages/xrefresh/package.py @@ -25,7 +25,7 @@ from spack import * -class Xrefresh(Package): +class Xrefresh(AutotoolsPackage): """xrefresh - refresh all or part of an X screen.""" homepage = "http://cgit.freedesktop.org/xorg/app/xrefresh" @@ -38,9 +38,3 @@ class Xrefresh(Package): depends_on('xproto@7.0.17:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xrx/package.py b/var/spack/repos/builtin/packages/xrx/package.py index 4457c2f1646..eae7b76768f 100644 --- a/var/spack/repos/builtin/packages/xrx/package.py +++ b/var/spack/repos/builtin/packages/xrx/package.py @@ -25,7 +25,7 @@ from spack import * -class Xrx(Package): +class Xrx(AutotoolsPackage): """The remote execution (RX) service specifies a MIME format for invoking applications remotely, for example via a World Wide Web browser. This RX format specifies a syntax for listing network services required by @@ -49,9 +49,3 @@ class Xrx(Package): depends_on('xproxymanagementprotocol', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xscope/package.py b/var/spack/repos/builtin/packages/xscope/package.py index cf33c9767ea..04f00a5f5d2 100644 --- a/var/spack/repos/builtin/packages/xscope/package.py +++ b/var/spack/repos/builtin/packages/xscope/package.py @@ -25,7 +25,7 @@ from spack import * -class Xscope(Package): +class Xscope(AutotoolsPackage): """XSCOPE -- a program to monitor X11/Client conversations.""" homepage = "http://cgit.freedesktop.org/xorg/app/xscope" @@ -37,9 +37,3 @@ class Xscope(Package): depends_on('xtrans', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xset/package.py b/var/spack/repos/builtin/packages/xset/package.py index 462bea8cfe8..5ca84431fd6 100644 --- a/var/spack/repos/builtin/packages/xset/package.py +++ b/var/spack/repos/builtin/packages/xset/package.py @@ -25,7 +25,7 @@ from spack import * -class Xset(Package): +class Xset(AutotoolsPackage): """User preference utility for X.""" homepage = "http://cgit.freedesktop.org/xorg/app/xset" @@ -39,9 +39,3 @@ class Xset(Package): depends_on('xproto@7.0.17:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xsetmode/package.py b/var/spack/repos/builtin/packages/xsetmode/package.py index f05fd0f123b..8d39de26a45 100644 --- a/var/spack/repos/builtin/packages/xsetmode/package.py +++ b/var/spack/repos/builtin/packages/xsetmode/package.py @@ -25,7 +25,7 @@ from spack import * -class Xsetmode(Package): +class Xsetmode(AutotoolsPackage): """Set the mode for an X Input device.""" homepage = "http://cgit.freedesktop.org/xorg/app/xsetmode" @@ -38,9 +38,3 @@ class Xsetmode(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xsetpointer/package.py b/var/spack/repos/builtin/packages/xsetpointer/package.py index e9bf2fc9fe2..194ef186ae2 100644 --- a/var/spack/repos/builtin/packages/xsetpointer/package.py +++ b/var/spack/repos/builtin/packages/xsetpointer/package.py @@ -25,7 +25,7 @@ from spack import * -class Xsetpointer(Package): +class Xsetpointer(AutotoolsPackage): """Set an X Input device as the main pointer.""" homepage = "http://cgit.freedesktop.org/xorg/app/xsetpointer" @@ -39,9 +39,3 @@ class Xsetpointer(Package): depends_on('inputproto@1.4:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xsetroot/package.py b/var/spack/repos/builtin/packages/xsetroot/package.py index 3e62d41e9b2..8be0625ff1a 100644 --- a/var/spack/repos/builtin/packages/xsetroot/package.py +++ b/var/spack/repos/builtin/packages/xsetroot/package.py @@ -25,7 +25,7 @@ from spack import * -class Xsetroot(Package): +class Xsetroot(AutotoolsPackage): """xsetroot - root window parameter setting utility for X.""" homepage = "http://cgit.freedesktop.org/xorg/app/xsetroot" @@ -41,9 +41,3 @@ class Xsetroot(Package): depends_on('xproto@7.0.17:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xsm/package.py b/var/spack/repos/builtin/packages/xsm/package.py index 9d9c8963657..4d91dae1422 100644 --- a/var/spack/repos/builtin/packages/xsm/package.py +++ b/var/spack/repos/builtin/packages/xsm/package.py @@ -25,7 +25,7 @@ from spack import * -class Xsm(Package): +class Xsm(AutotoolsPackage): """X Session Manager.""" homepage = "http://cgit.freedesktop.org/xorg/app/xsm" @@ -41,9 +41,3 @@ class Xsm(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xstdcmap/package.py b/var/spack/repos/builtin/packages/xstdcmap/package.py index bb19bdff1ae..8c3a081ae76 100644 --- a/var/spack/repos/builtin/packages/xstdcmap/package.py +++ b/var/spack/repos/builtin/packages/xstdcmap/package.py @@ -25,7 +25,7 @@ from spack import * -class Xstdcmap(Package): +class Xstdcmap(AutotoolsPackage): """The xstdcmap utility can be used to selectively define standard colormap properties. It is intended to be run from a user's X startup script to create standard colormap definitions in order to facilitate sharing of @@ -42,9 +42,3 @@ class Xstdcmap(Package): depends_on('xproto@7.0.17:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xterm/package.py b/var/spack/repos/builtin/packages/xterm/package.py new file mode 100644 index 00000000000..f4212021e95 --- /dev/null +++ b/var/spack/repos/builtin/packages/xterm/package.py @@ -0,0 +1,55 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# 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/llnl/spack +# Please also see the LICENSE file 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 +############################################################################## +from spack import * + + +class Xterm(AutotoolsPackage): + """The xterm program is a terminal emulator for the X Window System. It + provides DEC VT102 and Tektronix 4014 compatible terminals for programs + that can't use the window system directly.""" + + homepage = "http://invisible-island.net/xterm/" + url = "http://invisible-island.net/xterm/xterm-327.tgz" + + version('327', '3c32e931adcad44e64e57892e75d9e02') + + depends_on('libxft') + depends_on('fontconfig') + depends_on('libxaw') + depends_on('libxmu') + depends_on('libxt') + depends_on('libx11') + depends_on('libxinerama') + depends_on('libxpm') + depends_on('libice') + depends_on('freetype') + depends_on('libxrender') + depends_on('libxext') + depends_on('libsm') + depends_on('libxcb') + depends_on('libxau') + depends_on('bzip2') + + depends_on('pkg-config', type='build') diff --git a/var/spack/repos/builtin/packages/xtrans/package.py b/var/spack/repos/builtin/packages/xtrans/package.py index ed46059d9d5..62f74b8cec0 100644 --- a/var/spack/repos/builtin/packages/xtrans/package.py +++ b/var/spack/repos/builtin/packages/xtrans/package.py @@ -25,7 +25,7 @@ from spack import * -class Xtrans(Package): +class Xtrans(AutotoolsPackage): """xtrans is a library of code that is shared among various X packages to handle network protocol transport in a modular fashion, allowing a single place to add new transport types. It is used by the X server, @@ -38,8 +38,3 @@ class Xtrans(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make('install') diff --git a/var/spack/repos/builtin/packages/xtrap/package.py b/var/spack/repos/builtin/packages/xtrap/package.py index 405ec2f8485..4a899b5111b 100644 --- a/var/spack/repos/builtin/packages/xtrap/package.py +++ b/var/spack/repos/builtin/packages/xtrap/package.py @@ -25,7 +25,7 @@ from spack import * -class Xtrap(Package): +class Xtrap(AutotoolsPackage): """XTrap sample clients.""" homepage = "http://cgit.freedesktop.org/xorg/app/xtrap" @@ -38,9 +38,3 @@ class Xtrap(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xts/package.py b/var/spack/repos/builtin/packages/xts/package.py index c3993cf3913..9dd3e4a05ce 100644 --- a/var/spack/repos/builtin/packages/xts/package.py +++ b/var/spack/repos/builtin/packages/xts/package.py @@ -25,7 +25,7 @@ from spack import * -class Xts(Package): +class Xts(AutotoolsPackage): """This is a revamped version of X Test Suite (XTS) which removes some of the ugliness of building and running the tests.""" @@ -50,11 +50,5 @@ class Xts(Package): depends_on('xset', type='build') depends_on('xdpyinfo', type='build') - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - # FIXME: Crashes during compilation - # error: redeclaration of enumerator 'XawChainTop' - - make() - make('install') + # FIXME: Crashes during compilation + # error: redeclaration of enumerator 'XawChainTop' diff --git a/var/spack/repos/builtin/packages/xvidtune/package.py b/var/spack/repos/builtin/packages/xvidtune/package.py index ac5352df5f5..42dbc23aa00 100644 --- a/var/spack/repos/builtin/packages/xvidtune/package.py +++ b/var/spack/repos/builtin/packages/xvidtune/package.py @@ -25,7 +25,7 @@ from spack import * -class Xvidtune(Package): +class Xvidtune(AutotoolsPackage): """xvidtune is a client interface to the X server video mode extension (XFree86-VidModeExtension).""" @@ -42,9 +42,3 @@ class Xvidtune(Package): depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xvinfo/package.py b/var/spack/repos/builtin/packages/xvinfo/package.py index 359f1f23dea..f7a275f452f 100644 --- a/var/spack/repos/builtin/packages/xvinfo/package.py +++ b/var/spack/repos/builtin/packages/xvinfo/package.py @@ -25,7 +25,7 @@ from spack import * -class Xvinfo(Package): +class Xvinfo(AutotoolsPackage): """xvinfo prints out the capabilities of any video adaptors associated with the display that are accessible through the X-Video extension.""" @@ -40,9 +40,3 @@ class Xvinfo(Package): depends_on('xproto@7.0.25:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xwd/package.py b/var/spack/repos/builtin/packages/xwd/package.py index d1f9ee1dfbf..9016e17915c 100644 --- a/var/spack/repos/builtin/packages/xwd/package.py +++ b/var/spack/repos/builtin/packages/xwd/package.py @@ -25,7 +25,7 @@ from spack import * -class Xwd(Package): +class Xwd(AutotoolsPackage): """xwd - dump an image of an X window.""" homepage = "http://cgit.freedesktop.org/xorg/app/xwd" @@ -39,9 +39,3 @@ class Xwd(Package): depends_on('xproto@7.0.17:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xwininfo/package.py b/var/spack/repos/builtin/packages/xwininfo/package.py index bba97ca6710..61aa86bf461 100644 --- a/var/spack/repos/builtin/packages/xwininfo/package.py +++ b/var/spack/repos/builtin/packages/xwininfo/package.py @@ -25,7 +25,7 @@ from spack import * -class Xwininfo(Package): +class Xwininfo(AutotoolsPackage): """xwininfo prints information about windows on an X server. Various information is displayed depending on which options are selected.""" @@ -40,9 +40,3 @@ class Xwininfo(Package): depends_on('xproto@7.0.17:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xwud/package.py b/var/spack/repos/builtin/packages/xwud/package.py index a30d55b7c68..9294156e161 100644 --- a/var/spack/repos/builtin/packages/xwud/package.py +++ b/var/spack/repos/builtin/packages/xwud/package.py @@ -25,7 +25,7 @@ from spack import * -class Xwud(Package): +class Xwud(AutotoolsPackage): """xwud allows X users to display in a window an image saved in a specially formatted dump file, such as produced by xwd.""" @@ -39,9 +39,3 @@ class Xwud(Package): depends_on('xproto@7.0.17:', type='build') depends_on('pkg-config@0.9.0:', type='build') depends_on('util-macros', type='build') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - make('install') diff --git a/var/spack/repos/builtin/packages/xz/package.py b/var/spack/repos/builtin/packages/xz/package.py index 8b0609f50e1..839f5130582 100644 --- a/var/spack/repos/builtin/packages/xz/package.py +++ b/var/spack/repos/builtin/packages/xz/package.py @@ -25,21 +25,15 @@ from spack import * -class Xz(Package): +class Xz(AutotoolsPackage): """XZ Utils is free general-purpose data compression software with high compression ratio. XZ Utils were written for POSIX-like systems, but also work on some not-so-POSIX systems. XZ Utils are the successor to LZMA Utils.""" homepage = "http://tukaani.org/xz/" url = "http://tukaani.org/xz/xz-5.2.0.tar.bz2" + list_url = "http://tukaani.org/xz/old.html" - version('5.2.0', '867cc8611760240ebf3440bd6e170bb9') + version('5.2.3', '1592e7ca3eece099b03b35f4d9179e7c') version('5.2.2', 'f90c9a0c8b259aee2234c4e0d7fd70af') - - def install(self, spec, prefix): - configure('--prefix={0}'.format(prefix)) - - make() - if self.run_tests: - make('check') - make('install') + version('5.2.0', '867cc8611760240ebf3440bd6e170bb9') diff --git a/var/spack/repos/builtin/packages/yasm/package.py b/var/spack/repos/builtin/packages/yasm/package.py index f14bdbcee71..e42ea6a5a77 100644 --- a/var/spack/repos/builtin/packages/yasm/package.py +++ b/var/spack/repos/builtin/packages/yasm/package.py @@ -25,7 +25,7 @@ from spack import * -class Yasm(Package): +class Yasm(AutotoolsPackage): """Yasm is a complete rewrite of the NASM-2.11.06 assembler. It supports the x86 and AMD64 instruction sets, accepts NASM and GAS assembler syntaxes and outputs binary, ELF32 and ELF64 @@ -34,8 +34,3 @@ class Yasm(Package): url = "http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz" version('1.3.0', 'fc9e586751ff789b34b1f21d572d96af') - - def install(self, spec, prefix): - configure("--prefix=%s" % prefix) - make() - make("install") diff --git a/var/spack/repos/builtin/packages/zeromq/package.py b/var/spack/repos/builtin/packages/zeromq/package.py index cafd3c21252..51fff7222d4 100644 --- a/var/spack/repos/builtin/packages/zeromq/package.py +++ b/var/spack/repos/builtin/packages/zeromq/package.py @@ -25,7 +25,7 @@ from spack import * -class Zeromq(Package): +class Zeromq(AutotoolsPackage): """ The ZMQ networking/concurrency library and core API """ homepage = "http://zguide.zeromq.org/" url = "http://download.zeromq.org/zeromq-4.1.2.tar.gz" @@ -40,8 +40,5 @@ class Zeromq(Package): depends_on("libsodium") depends_on("libsodium@:1.0.3", when='@:4.1.2') - def install(self, spec, prefix): - configure("--with-libsodium", "--prefix=%s" % prefix) - - make() - make("install") + def configure_args(self): + return ['--with-libsodium'] diff --git a/var/spack/repos/builtin/packages/zlib/package.py b/var/spack/repos/builtin/packages/zlib/package.py index ea758e01889..05b9bb8deda 100644 --- a/var/spack/repos/builtin/packages/zlib/package.py +++ b/var/spack/repos/builtin/packages/zlib/package.py @@ -40,7 +40,15 @@ class Zlib(AutotoolsPackage): variant('pic', default=True, description='Produce position-independent code (for shared libs)') + variant('shared', default=True, + description='Enables the build of shared libraries.') def setup_environment(self, spack_env, run_env): if '+pic' in self.spec: spack_env.set('CFLAGS', self.compiler.pic_flag) + + def configure_args(self): + config_args = [] + if '+shared' not in self.spec: + config_args.append('--static') + return config_args diff --git a/var/spack/repos/builtin/packages/zsh/package.py b/var/spack/repos/builtin/packages/zsh/package.py index a70d307be93..7b9c485966d 100644 --- a/var/spack/repos/builtin/packages/zsh/package.py +++ b/var/spack/repos/builtin/packages/zsh/package.py @@ -25,7 +25,7 @@ from spack import * -class Zsh(Package): +class Zsh(AutotoolsPackage): """Zsh is a shell designed for interactive use, although it is also a powerful scripting language. Many of the useful features of bash, ksh, and tcsh were incorporated into zsh; many original features were added. @@ -37,9 +37,3 @@ class Zsh(Package): version('5.1.1', checksum='8ba28a9ef82e40c3a271602f18343b2f') depends_on("pcre") - - def install(self, spec, prefix): - configure('--prefix=%s' % prefix) - - make() - make("install") diff --git a/var/spack/repos/builtin/packages/zstd/package.py b/var/spack/repos/builtin/packages/zstd/package.py new file mode 100644 index 00000000000..e5e34591f77 --- /dev/null +++ b/var/spack/repos/builtin/packages/zstd/package.py @@ -0,0 +1,42 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# 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/llnl/spack +# Please also see the LICENSE file 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 +############################################################################## +from spack import * + + +class Zstd(Package): + """Zstandard, or zstd as short version, is a fast lossless compression + algorithm, targeting real-time compression scenarios at zlib-level and + better compression ratios.""" + + homepage = "http://facebook.github.io/zstd/" + url = "https://github.com/facebook/zstd/archive/v1.1.2.tar.gz" + + version('1.1.2', '4c57a080d194bdaac83f2d3251fc7ffc') + + def install(self, spec, prefix): + make() + if self.run_tests: + make('test') + make('install', 'PREFIX={0}'.format(prefix))