Add latest version of Ninja (#4987)

* Add latest version of Ninja

* Re-add symlinks, add latest version of ninja-fortran
This commit is contained in:
Adam J. Stewart
2017-08-08 13:33:24 -05:00
committed by becker33
parent 48f0e9592e
commit 97958d8347
2 changed files with 53 additions and 17 deletions

View File

@@ -23,23 +23,41 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
from spack import *
import os
class Ninja(Package):
""" A small, fast Make alternative """
homepage = "https://martine.github.io/ninja/"
url = "https://github.com/martine/ninja/archive/v1.6.0.tar.gz"
"""Ninja is a small build system with a focus on speed. It differs from
other build systems in two major respects: it is designed to have its input
files generated by a higher-level build system, and it is designed to run
builds as fast as possible."""
homepage = "https://ninja-build.org/"
url = "https://github.com/ninja-build/ninja/archive/v1.7.2.tar.gz"
version('1.7.2', '7b482218757acbaeac4d4d54a3cd94e1')
version('1.6.0', '254133059f2da79d8727f654d7198f43')
extends('python')
depends_on('python', type=('build', 'run'))
def install(self, spec, prefix):
phases = ['configure', 'install']
def configure(self, spec, prefix):
python('configure.py', '--bootstrap')
@run_after('configure')
@on_package_attributes(run_tests=True)
def test(self):
ninja = Executable('./ninja')
ninja('-j{0}'.format(make_jobs), 'ninja_test')
ninja_test = Executable('./ninja_test')
ninja_test()
def install(self, spec, prefix):
mkdir(prefix.bin)
install('ninja', prefix.bin)
install_tree('misc', join_path(prefix, 'misc'))
install_tree('misc', prefix.misc)
# Some distros like Fedora install a 'ninja-build' executable
# instead of 'ninja'. Install both for uniformity.
with working_dir(prefix.bin):
os.symlink('ninja', 'ninja-build')
symlink('ninja', 'ninja-build')