From f0a1ab78b492015f8a60bb49065579195fe1dc86 Mon Sep 17 00:00:00 2001 From: Lukas Werling Date: Sun, 27 Aug 2017 19:42:21 +0200 Subject: [PATCH] meson/ninja: add setup hooks (#28444) * Add setupHook for meson/ninja build * libhttpseverywhere: Use meson/ninja setupHooks * jamomacore: Remove superfluous ninja buildInput * Remove obsolete ninja buildPhases These are all handled by ninja's setup hook. * lean2, xcbuild: fix build with ninja setup hook Ninja is a runtime dependency here. However, cmake can generate Ninja build files as well to satisfy the setup hook. * qtwebengine: fix build with ninja setup hook --- pkgs/applications/audio/i-score/default.nix | 4 -- pkgs/applications/graphics/ao/default.nix | 1 - .../science/logic/lean2/default.nix | 2 + .../libraries/audio/jamomacore/default.nix | 4 +- .../libraries/libhttpseverywhere/default.nix | 12 ------ .../qt-5/5.9/qtwebengine/default.nix | 4 ++ .../tools/build-managers/meson/default.nix | 2 + .../tools/build-managers/meson/setup-hook.sh | 22 ++++++++++ .../tools/build-managers/ninja/default.nix | 2 + .../tools/build-managers/ninja/setup-hook.sh | 43 +++++++++++++++++++ pkgs/development/tools/xcbuild/default.nix | 2 + pkgs/tools/system/illum/default.nix | 4 -- 12 files changed, 79 insertions(+), 23 deletions(-) create mode 100644 pkgs/development/tools/build-managers/meson/setup-hook.sh create mode 100644 pkgs/development/tools/build-managers/ninja/setup-hook.sh diff --git a/pkgs/applications/audio/i-score/default.nix b/pkgs/applications/audio/i-score/default.nix index 1a47b74e21c7..eb2b2ca0702a 100644 --- a/pkgs/applications/audio/i-score/default.nix +++ b/pkgs/applications/audio/i-score/default.nix @@ -67,10 +67,6 @@ stdenv.mkDerivation rec { export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH:$(echo "${jamomacore}/jamoma/share/cmake/Jamoma")" ''; - preBuild = '' - ninja - ''; - installPhase = '' cmake --build . --target install ''; diff --git a/pkgs/applications/graphics/ao/default.nix b/pkgs/applications/graphics/ao/default.nix index 2bba73fae1a7..7396fdc045f1 100644 --- a/pkgs/applications/graphics/ao/default.nix +++ b/pkgs/applications/graphics/ao/default.nix @@ -18,7 +18,6 @@ stdenv.mkDerivation rec { }; cmakeFlags = "-G Ninja"; - buildPhase = "ninja"; installPhase = '' ninja install cd .. diff --git a/pkgs/applications/science/logic/lean2/default.nix b/pkgs/applications/science/logic/lean2/default.nix index f45f65e90826..2b861b6d06d9 100644 --- a/pkgs/applications/science/logic/lean2/default.nix +++ b/pkgs/applications/science/logic/lean2/default.nix @@ -20,6 +20,8 @@ stdenv.mkDerivation rec { cd src ''; + cmakeFlags = [ "-GNinja" ]; + postInstall = '' wrapProgram $out/bin/linja --prefix PATH : $out/bin:${ninja}/bin ''; diff --git a/pkgs/development/libraries/audio/jamomacore/default.nix b/pkgs/development/libraries/audio/jamomacore/default.nix index a3d04fee7f64..5dac4d8e5925 100644 --- a/pkgs/development/libraries/audio/jamomacore/default.nix +++ b/pkgs/development/libraries/audio/jamomacore/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, pkgconfig, alsaLib, portaudio, portmidi, libsndfile, cmake, libxml2, ninja }: +{ stdenv, fetchFromGitHub, pkgconfig, alsaLib, portaudio, portmidi, libsndfile, cmake, libxml2 }: stdenv.mkDerivation rec { version = "1.0-beta.1"; @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { sha256 = "1hb9b6qc18rsvzvixgllknn756m6zwcn22c79rdibbyz1bhrcnln"; }; - buildInputs = [ pkgconfig alsaLib portaudio portmidi libsndfile cmake libxml2 ninja ]; + buildInputs = [ pkgconfig alsaLib portaudio portmidi libsndfile cmake libxml2 ]; meta = { description = "A C++ platform for building dynamic and reflexive systems with an emphasis on audio and media"; diff --git a/pkgs/development/libraries/libhttpseverywhere/default.nix b/pkgs/development/libraries/libhttpseverywhere/default.nix index 239536140ec0..88a3ebbc4fbe 100644 --- a/pkgs/development/libraries/libhttpseverywhere/default.nix +++ b/pkgs/development/libraries/libhttpseverywhere/default.nix @@ -15,18 +15,6 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ gnome3.vala valadoc gobjectIntrospection meson ninja pkgconfig ]; buildInputs = [ glib gnome3.libgee libxml2 json_glib libsoup libarchive ]; - configurePhase = '' - mkdir build - cd build - meson --prefix "$out" .. - ''; - - buildPhase = '' - ninja - ''; - - installPhase = "ninja install"; - doCheck = true; checkPhase = "./httpseverywhere_test"; diff --git a/pkgs/development/libraries/qt-5/5.9/qtwebengine/default.nix b/pkgs/development/libraries/qt-5/5.9/qtwebengine/default.nix index 1684e6aac707..c0b9aa83e194 100644 --- a/pkgs/development/libraries/qt-5/5.9/qtwebengine/default.nix +++ b/pkgs/development/libraries/qt-5/5.9/qtwebengine/default.nix @@ -100,6 +100,10 @@ qtSubmodule { xlibs.libXcomposite ]; patches = optional stdenv.needsPax ./qtwebengine-paxmark-mksnapshot.patch; + + dontUseNinjaBuild = true; + dontUseNinjaInstall = true; + postInstall = '' cat > $out/libexec/qt.conf <