From a246b74f21765bf08b57c6e1ca2d5bef6226ca1c Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Sat, 5 Oct 2019 08:38:15 +0300 Subject: [PATCH] Improve pythonSupport handling Use pythonPackages instead of just python and add an attribute to python-packages.nix. --- pkgs/development/libraries/gaia/default.nix | 14 +++++++------- pkgs/top-level/python-packages.nix | 5 +++++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/pkgs/development/libraries/gaia/default.nix b/pkgs/development/libraries/gaia/default.nix index 0809f4d62a1f..9195317b7b4e 100644 --- a/pkgs/development/libraries/gaia/default.nix +++ b/pkgs/development/libraries/gaia/default.nix @@ -7,15 +7,15 @@ , wafHook , makeWrapper , qt4 -, python -, pythonSupport ? true +, pythonPackages +, pythonSupport ? false # Default to false since it breaks the build, see https://github.com/MTG/gaia/issues/11 , stlfacadeSupport ? false , assertsSupport ? true , cyclopsSupport ? true }: -assert pythonSupport -> python != null; +assert pythonSupport -> pythonPackages != null; stdenv.mkDerivation rec { pname = "gaia"; @@ -37,9 +37,9 @@ stdenv.mkDerivation rec { ''; # This is not exactly specified in upstream's README but it's needed by the - # resultings $out/bin/gaiafusion script + # resulting $out/bin/gaiafusion script pythonEnv = (if pythonSupport then - python.withPackages(ps: with ps; [ + pythonPackages.python.withPackages(ps: with ps; [ pyyaml ]) else null); @@ -66,10 +66,10 @@ stdenv.mkDerivation rec { ++ lib.optionals (cyclopsSupport) [ "--with-cyclops" ] ; # only gaiafusion is a python executable that needs patchShebangs - postInstall = lib.optionalString '' + 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/${python.sitePackages}:${pythonEnv}/${python.sitePackages} + wrapProgram $out/bin/gaiafusion --prefix PYTHONPATH : $out/${pythonPackages.python.sitePackages}:${pythonEnv}/${pythonPackages.python.sitePackages} ''; meta = with lib; { diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index c269c830fdfb..3c9786fa45ba 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2372,6 +2372,11 @@ in { fx2 = callPackage ../development/python-modules/fx2 { }; + gaia = (toPythonModule (pkgs.gaia.override { + pythonPackages = self; + pythonSupport = true; + })); + gateone = callPackage ../development/python-modules/gateone { }; GeoIP = callPackage ../development/python-modules/GeoIP { };