spack/var/spack/repos/builtin/packages/ninja/package.py
Chuck Atkins 251f3f5058
ninja: drop python as a run dep (#11347)
* ninja: Make python a build-only dependency

* ninja, ninja-fortran: allow the packages to provide eachother
2019-05-07 13:07:24 -04:00

51 lines
1.8 KiB
Python

# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Ninja(Package):
"""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"
git = "https://github.com/Kitware/ninja.git"
version('kitware', branch='features-for-fortran')
version('1.9.0', sha256='5d7ec75828f8d3fd1a0c2f31b5b0cea780cdfe1031359228c428c1a48bfcd5b9')
version('1.8.2', '5fdb04461cc7f5d02536b3bfc0300166')
version('1.7.2', '7b482218757acbaeac4d4d54a3cd94e1')
version('1.6.0', '254133059f2da79d8727f654d7198f43')
depends_on('python', type='build')
provides('ninja-fortran', when='@kitware')
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', prefix.misc)
# Some distros like Fedora install a 'ninja-build' executable
# instead of 'ninja'. Install both for uniformity.
with working_dir(prefix.bin):
symlink('ninja', 'ninja-build')