From 5ab346a327667763326b1c2a4661ac4e2dd42897 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Sat, 11 May 2013 11:39:52 +0200 Subject: [PATCH 1/3] ninja: move out of pythonPackages ninja is a build system written in C++ that just happens to use python to build/install *itself*. It is not a "python package". After this commit, ninja will be at pkgs.ninja instead of pkgs.pythonPackages.ninja. --- .../tools/build-managers/ninja/default.nix | 28 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ pkgs/top-level/python-packages.nix | 22 --------------- 3 files changed, 30 insertions(+), 22 deletions(-) create mode 100644 pkgs/development/tools/build-managers/ninja/default.nix diff --git a/pkgs/development/tools/build-managers/ninja/default.nix b/pkgs/development/tools/build-managers/ninja/default.nix new file mode 100644 index 00000000000..cf6eee99e1d --- /dev/null +++ b/pkgs/development/tools/build-managers/ninja/default.nix @@ -0,0 +1,28 @@ +{ stdenv, fetchurl, unzip, python, asciidoc, re2c }: + +stdenv.mkDerivation rec { + name = "ninja-1.2.0"; + + src = fetchurl { + url = "https://github.com/martine/ninja/archive/v1.2.0.zip"; + sha256 = "15ynh806ah37bqb57hcs3mj2g82900sncp6n3bssfggb4azgjlh3"; + }; + + buildInputs = [ python asciidoc unzip re2c ]; + + buildPhase = '' + python bootstrap.py + asciidoc doc/manual.asciidoc + ''; + + installPhase = '' + mkdir -p $out/bin + cp ninja $out/bin/ + + mkdir -p $out/share/doc/ninja + cp doc/manual.asciidoc $out/share/doc/ninja/ + cp doc/manual.html $out/share/doc/ninja/ + ''; + + homepage = http://martine.github.io/ninja/; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6e31d304297..852f9a70939 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3328,6 +3328,8 @@ let licenseAccepted = (config.neoload.accept_license or false); }; + ninja = callPackage ../development/tools/build-managers/ninja { }; + noweb = callPackage ../development/tools/literate-programming/noweb { }; omake = callPackage ../development/tools/ocaml/omake { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index dd62e3b868b..b764667d826 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2603,28 +2603,6 @@ pythonPackages = python.modules // rec { }; }); - ninja = pkgs.stdenv.mkDerivation rec { - name = "ninja-1.2.0"; - src = fetchurl { - url = "https://github.com/martine/ninja/archive/v1.2.0.zip"; - sha256 = "15ynh806ah37bqb57hcs3mj2g82900sncp6n3bssfggb4azgjlh3"; - }; - buildInputs = [ python pkgs.asciidoc pkgs.unzip pkgs.re2c ]; - buildPhase = '' - python bootstrap.py - asciidoc doc/manual.asciidoc - ''; - installPhase = '' - mkdir -p $out/bin - cp ninja $out/bin/ - - mkdir -p $out/share/doc/ninja - cp doc/manual.asciidoc $out/share/doc/ninja/ - cp doc/manual.html $out/share/doc/ninja/ - ''; - homepage = http://martine.github.io/ninja/; - }; - nose = buildPythonPackage rec { name = "nose-1.2.1"; From beb2a7a579a33e6e673506090413887869b97798 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Sat, 11 May 2013 11:49:32 +0200 Subject: [PATCH 2/3] ninja: add description and license --- .../tools/build-managers/ninja/default.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pkgs/development/tools/build-managers/ninja/default.nix b/pkgs/development/tools/build-managers/ninja/default.nix index cf6eee99e1d..b6f8e111f88 100644 --- a/pkgs/development/tools/build-managers/ninja/default.nix +++ b/pkgs/development/tools/build-managers/ninja/default.nix @@ -24,5 +24,15 @@ stdenv.mkDerivation rec { cp doc/manual.html $out/share/doc/ninja/ ''; - homepage = http://martine.github.io/ninja/; + meta = { + 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. + ''; + homepage = http://martine.github.io/ninja/; + license = stdenv.lib.licenses.asl20; + }; } From 7f1509aba6962b9972764252ffb3081583a6bda7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Sat, 11 May 2013 11:50:29 +0200 Subject: [PATCH 3/3] ninja: use version attribute ...to avoid the risk of downloading a different version than the package name suggests (i.e. on the next version bump). --- pkgs/development/tools/build-managers/ninja/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/build-managers/ninja/default.nix b/pkgs/development/tools/build-managers/ninja/default.nix index b6f8e111f88..6edf6d78878 100644 --- a/pkgs/development/tools/build-managers/ninja/default.nix +++ b/pkgs/development/tools/build-managers/ninja/default.nix @@ -1,10 +1,11 @@ { stdenv, fetchurl, unzip, python, asciidoc, re2c }: stdenv.mkDerivation rec { - name = "ninja-1.2.0"; + name = "ninja-${version}"; + version = "1.2.0"; src = fetchurl { - url = "https://github.com/martine/ninja/archive/v1.2.0.zip"; + url = "https://github.com/martine/ninja/archive/v${version}.zip"; sha256 = "15ynh806ah37bqb57hcs3mj2g82900sncp6n3bssfggb4azgjlh3"; };