summary refs log tree commit diff
path: root/pkgs/development/libraries/gaia
diff options
context:
space:
mode:
authorDoron Behar <doron.behar@gmail.com>2019-10-08 10:20:53 +0300
committerDoron Behar <doron.behar@gmail.com>2019-10-08 10:31:09 +0300
commitd4c7ab3d85bce04d59a398136a9e89e93297d2be (patch)
treeb9fd8fada5b639bbb9e2eb30755501657c846982 /pkgs/development/libraries/gaia
parenta45c9f541c35ae52ef72afdce41402e6096da87d (diff)
downloadnixpkgs-d4c7ab3d85bce04d59a398136a9e89e93297d2be.tar
nixpkgs-d4c7ab3d85bce04d59a398136a9e89e93297d2be.tar.gz
nixpkgs-d4c7ab3d85bce04d59a398136a9e89e93297d2be.tar.bz2
nixpkgs-d4c7ab3d85bce04d59a398136a9e89e93297d2be.tar.lz
nixpkgs-d4c7ab3d85bce04d59a398136a9e89e93297d2be.tar.xz
nixpkgs-d4c7ab3d85bce04d59a398136a9e89e93297d2be.tar.zst
nixpkgs-d4c7ab3d85bce04d59a398136a9e89e93297d2be.zip
Use wrapPython in postFixup instead of wrapProgram
Diffstat (limited to 'pkgs/development/libraries/gaia')
-rw-r--r--pkgs/development/libraries/gaia/default.nix43
1 files 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";