2021-01-23 04:26:19 -08:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fetchpatch, python3, buildDocs ? true, asciidoc, docbook_xml_dtd_45, docbook_xsl, libxslt, re2c }:
|
2018-09-09 10:36:05 -07:00
|
|
|
|
2021-01-23 04:26:19 -08:00
|
|
|
with lib;
|
2013-05-11 02:39:52 -07:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 05:41:18 -07:00
|
|
|
pname = "ninja";
|
2020-11-30 19:49:11 -08:00
|
|
|
version = "1.10.2";
|
2013-05-11 02:39:52 -07:00
|
|
|
|
2017-11-18 08:55:01 -08:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ninja-build";
|
|
|
|
repo = "ninja";
|
|
|
|
rev = "v${version}";
|
2020-11-30 19:49:11 -08:00
|
|
|
sha256 = "0mspq4mvx41qri2v2zlg2y3znx5gfw6d8s3czbcfpr2218qbpz55";
|
2013-05-11 02:39:52 -07:00
|
|
|
};
|
|
|
|
|
2020-01-12 12:12:59 -08:00
|
|
|
nativeBuildInputs = [ python3 re2c ] ++ optionals buildDocs [ asciidoc docbook_xml_dtd_45 docbook_xsl libxslt.bin ];
|
2013-05-11 02:39:52 -07:00
|
|
|
|
|
|
|
buildPhase = ''
|
2017-11-18 08:55:01 -08:00
|
|
|
python configure.py --bootstrap
|
2018-09-09 10:36:05 -07:00
|
|
|
'' + optionalString buildDocs ''
|
2018-09-15 15:36:21 -07:00
|
|
|
# "./ninja -vn manual" output copied here to support cross compilation.
|
2018-06-03 15:42:52 -07:00
|
|
|
asciidoc -b docbook -d book -o build/manual.xml doc/manual.asciidoc
|
|
|
|
xsltproc --nonet doc/docbook.xsl build/manual.xml > doc/manual.html
|
2013-05-11 02:39:52 -07:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2017-11-18 08:55:01 -08:00
|
|
|
install -Dm555 -t $out/bin ninja
|
|
|
|
install -Dm444 misc/bash-completion $out/share/bash-completion/completions/ninja
|
|
|
|
install -Dm444 misc/zsh-completion $out/share/zsh/site-functions/_ninja
|
2018-09-09 10:36:05 -07:00
|
|
|
'' + optionalString buildDocs ''
|
|
|
|
install -Dm444 -t $out/share/doc/ninja doc/manual.asciidoc doc/manual.html
|
2013-05-11 02:39:52 -07:00
|
|
|
'';
|
|
|
|
|
2017-08-27 10:42:21 -07:00
|
|
|
setupHook = ./setup-hook.sh;
|
|
|
|
|
2018-09-09 10:36:05 -07:00
|
|
|
meta = {
|
2013-05-11 02:49:32 -07:00
|
|
|
description = "Small build system with a focus on speed";
|
|
|
|
longDescription = ''
|
|
|
|
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.
|
|
|
|
'';
|
2020-03-31 18:11:51 -07:00
|
|
|
homepage = "https://ninja-build.org/";
|
2013-05-20 10:33:18 -07:00
|
|
|
license = licenses.asl20;
|
2014-04-12 09:37:45 -07:00
|
|
|
platforms = platforms.unix;
|
2017-11-18 08:55:01 -08:00
|
|
|
maintainers = with maintainers; [ thoughtpolice bjornfor orivej ];
|
2013-05-11 02:49:32 -07:00
|
|
|
};
|
2013-05-11 02:39:52 -07:00
|
|
|
}
|