From d4c7ab3d85bce04d59a398136a9e89e93297d2be Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Tue, 8 Oct 2019 10:20:53 +0300 Subject: Use wrapPython in postFixup instead of wrapProgram --- pkgs/development/libraries/gaia/default.nix | 43 +++++++++++++++-------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/pkgs/development/libraries/gaia/default.nix b/pkgs/development/libraries/gaia/default.nix index 7565ee7a06e..9411f76908e 100644 --- a/pkgs/development/libraries/gaia/default.nix +++ b/pkgs/development/libraries/gaia/default.nix @@ -36,41 +36,44 @@ stdenv.mkDerivation rec { --replace "/etc/init.d" "$out/etc/init.d" ''; - # This is not exactly specified in upstream's README but it's needed by the - # resulting $out/bin/gaiafusion script - pythonEnv = (if pythonSupport then - pythonPackages.python.withPackages(ps: with ps; [ - pyyaml - ]) - else null); - nativeBuildInputs = [ wafHook pkgconfig swig - makeWrapper - ]; + ] + # The gaiafusion binary inside $out/bin needs a shebangs patch, and + # wrapping with the appropriate $PYTHONPATH + ++ lib.optionals (pythonSupport) [ + pythonPackages.wrapPython + ] + ; + buildInputs = [ libyaml qt4 - ] + ]; + + propagatedBuildInputs = [] ++ lib.optionals (pythonSupport) [ - pythonEnv + # This is not exactly specified in upstream's README but it's needed by the + # resulting $out/bin/gaiafusion script + pythonPackages.pyyaml ] ; - wafConfigureFlags = [ - ] + + wafConfigureFlags = [] ++ lib.optionals (pythonSupport) [ "--with-python-bindings" ] ++ lib.optionals (stlfacadeSupport) [ "--with-stlfacade" ] ++ lib.optionals (assertsSupport) [ "--with-asserts" ] ++ lib.optionals (cyclopsSupport) [ "--with-cyclops" ] ; - # only gaiafusion is a python executable that needs patchShebangs - postInstall = lib.optionalString (pythonSupport) '' - # We can't use patchShebangs because it will use bare bones $python/bin/python - # and we need a python environment with pyyaml - wrapProgram $out/bin/gaiafusion --prefix PYTHONPATH : $out/${pythonPackages.python.sitePackages}:${pythonEnv}/${pythonPackages.python.sitePackages} - ''; + + postFixup = '' + '' + + lib.optionalString pythonSupport '' + wrapPythonPrograms + '' + ; meta = with lib; { homepage = "https://github.com/MTG/gaia"; -- cgit 1.4.1