diff --git a/pkgs/development/interpreters/python/hooks/default.nix b/pkgs/development/interpreters/python/hooks/default.nix index ca70d452c8087..f6e20973437ce 100644 --- a/pkgs/development/interpreters/python/hooks/default.nix +++ b/pkgs/development/interpreters/python/hooks/default.nix @@ -3,7 +3,7 @@ self: dontUse: with self; let inherit (python) pythonOnBuildForHost; inherit (pkgs) runCommand; - pythonInterpreter = pythonOnBuildForHost.interpreter; + pythonInterpreter = python.interpreter; pythonSitePackages = python.sitePackages; pythonCheckInterpreter = python.interpreter; setuppy = ../run_setup.py; @@ -74,7 +74,7 @@ in { inherit pythonOnBuildForHost; }; } ./pypa-build-hook.sh) { - inherit (pythonOnBuildForHost.pkgs) build; + inherit build; }; pipInstallHook = callPackage ({ makePythonHook, pip }: @@ -94,7 +94,7 @@ in { inherit pythonInterpreter pythonSitePackages; }; } ./pypa-install-hook.sh) { - inherit (pythonOnBuildForHost.pkgs) installer; + inherit installer; }; pytestCheckHook = callPackage ({ makePythonHook, pytest }: @@ -237,16 +237,14 @@ in { propagatedBuildInputs = [ wheel ]; } ./wheel-unpack-hook.sh) {}; - wrapPython = callPackage ../wrap-python.nix { - inherit (pkgs.buildPackages) makeWrapper; - }; + wrapPython = callPackage ../wrap-python.nix { }; sphinxHook = callPackage ({ makePythonHook, installShellFiles }: makePythonHook { name = "python${python.pythonVersion}-sphinx-hook"; - propagatedBuildInputs = [ pythonOnBuildForHost.pkgs.sphinx installShellFiles ]; + propagatedBuildInputs = [ sphinx installShellFiles ]; substitutions = { - sphinxBuild = "${pythonOnBuildForHost.pkgs.sphinx}/bin/sphinx-build"; + sphinxBuild = "${sphinx}/bin/sphinx-build"; }; } ./sphinx-hook.sh) {}; } diff --git a/pkgs/development/interpreters/python/mk-python-derivation.nix b/pkgs/development/interpreters/python/mk-python-derivation.nix index d75fea0eaef14..35a86a43fcfef 100644 --- a/pkgs/development/interpreters/python/mk-python-derivation.nix +++ b/pkgs/development/interpreters/python/mk-python-derivation.nix @@ -26,7 +26,7 @@ , eggUnpackHook , eggBuildHook , eggInstallHook -}: +}@things: let inherit (builtins) unsafeGetAttrPos; @@ -262,7 +262,7 @@ let setuptoolsBuildHook ] ++ optionals (format' == "pyproject") [( if isBootstrapPackage then - pypaBuildHook.override { + python.pythonOnBuildForHost.pkgs.pypaBuildHook.override { inherit (python.pythonOnBuildForHost.pkgs.bootstrap) build; wheel = null; } @@ -270,7 +270,7 @@ let pypaBuildHook ) ( if isBootstrapPackage then - pythonRuntimeDepsCheckHook.override { + python.pythonOnBuildForHost.pkgs.pythonRuntimeDepsCheckHook.override { inherit (python.pythonOnBuildForHost.pkgs.bootstrap) packaging; } else @@ -281,7 +281,7 @@ let eggUnpackHook eggBuildHook eggInstallHook ] ++ optionals (format' != "other") [( if isBootstrapInstallPackage then - pypaInstallHook.override { + python.pythonOnBuildForHost.pkgs.pypaInstallHook.override { inherit (python.pythonOnBuildForHost.pkgs.bootstrap) installer; } else @@ -324,7 +324,7 @@ let outputs = outputs ++ optional withDistOutput "dist"; - inherit passthru; + passthru = { inherit things; } // passthru; meta = { # default to python's platforms diff --git a/pkgs/development/interpreters/python/passthrufun.nix b/pkgs/development/interpreters/python/passthrufun.nix index b06433113b6b3..5a577d6377d2a 100644 --- a/pkgs/development/interpreters/python/passthrufun.nix +++ b/pkgs/development/interpreters/python/passthrufun.nix @@ -47,7 +47,7 @@ selfTargetTarget = pythonOnTargetForTarget.pkgs or {}; # There is no Python TargetTarget. }; hooks = import ./hooks/default.nix; - keep = self: hooks self {}; + keep = _: { }; optionalExtensions = cond: as: lib.optionals cond as; pythonExtension = import ../../../top-level/python-packages.nix; python2Extension = import ../../../top-level/python2-packages.nix; diff --git a/pkgs/development/interpreters/python/wrap-python.nix b/pkgs/development/interpreters/python/wrap-python.nix index 8817d091a283a..6bffd67c32147 100644 --- a/pkgs/development/interpreters/python/wrap-python.nix +++ b/pkgs/development/interpreters/python/wrap-python.nix @@ -1,15 +1,33 @@ { lib , python , makePythonHook -, makeWrapper }: +, makeWrapper +, stdenv +, targetPackages +}: makePythonHook { name = "wrap-python-hook"; propagatedBuildInputs = [ makeWrapper ]; substitutions.sitePackages = python.sitePackages; substitutions.executable = python.interpreter; - substitutions.python = python.pythonOnBuildForHost; - substitutions.pythonHost = python; + substitutions.python = python; + #substitutions.pythonHost = + #if ((targetPackages.stdenv.buildPlatform != targetPackages.stdenv.targetPlatform) && (targetPackages.stdenv.hostPlatform == targetPackages.stdenv.targetPlatform)) + # then python.__spliced.hostHost + #else if (stdenv.buildPlatform != (stdenv.hostPlatform == stdenv.targetPlatform)) + # then python + #else if (stdenv.hostPlatform != stdenv.targetPlatform) + # then python.__spliced.hostHost + #else throw "don't reach"; + substitutions.pythonHost = + if ((targetPackages.stdenv.buildPlatform != targetPackages.stdenv.targetPlatform) && (targetPackages.stdenv.hostPlatform == targetPackages.stdenv.targetPlatform)) + then python.__spliced.hostHost + else python; + passthru = { + python1 = python; + targetstdenv = targetPackages.stdenv; + }; substitutions.magicalSedExpression = let # Looks weird? Of course, it's between single quoted shell strings. # NOTE: Order DOES matter here, so single character quotes need to be diff --git a/pkgs/misc/flashfocus/default.nix b/pkgs/misc/flashfocus/default.nix index 8c7fb067f1ab0..3905d8a6d2bf5 100644 --- a/pkgs/misc/flashfocus/default.nix +++ b/pkgs/misc/flashfocus/default.nix @@ -38,6 +38,10 @@ python3Packages.buildPythonApplication rec { # Tests require access to a X session doCheck = false; + preFixup = '' + set -x + ''; + pythonImportsCheck = [ "flashfocus" ]; passthru.updateScript = nix-update-script { };