Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions pkgs/development/interpreters/python/hooks/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -74,7 +74,7 @@ in {
inherit pythonOnBuildForHost;
};
} ./pypa-build-hook.sh) {
inherit (pythonOnBuildForHost.pkgs) build;
inherit build;
};

pipInstallHook = callPackage ({ makePythonHook, pip }:
Expand All @@ -94,7 +94,7 @@ in {
inherit pythonInterpreter pythonSitePackages;
};
} ./pypa-install-hook.sh) {
inherit (pythonOnBuildForHost.pkgs) installer;
inherit installer;
};

pytestCheckHook = callPackage ({ makePythonHook, pytest }:
Expand Down Expand Up @@ -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) {};
}
10 changes: 5 additions & 5 deletions pkgs/development/interpreters/python/mk-python-derivation.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
, eggUnpackHook
, eggBuildHook
, eggInstallHook
}:
}@things:

let
inherit (builtins) unsafeGetAttrPos;
Expand Down Expand Up @@ -262,15 +262,15 @@ let
setuptoolsBuildHook
] ++ optionals (format' == "pyproject") [(
if isBootstrapPackage then
pypaBuildHook.override {
python.pythonOnBuildForHost.pkgs.pypaBuildHook.override {
inherit (python.pythonOnBuildForHost.pkgs.bootstrap) build;
wheel = null;
}
else
pypaBuildHook
) (
if isBootstrapPackage then
pythonRuntimeDepsCheckHook.override {
python.pythonOnBuildForHost.pkgs.pythonRuntimeDepsCheckHook.override {
inherit (python.pythonOnBuildForHost.pkgs.bootstrap) packaging;
}
else
Expand All @@ -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
Expand Down Expand Up @@ -324,7 +324,7 @@ let

outputs = outputs ++ optional withDistOutput "dist";

inherit passthru;
passthru = { inherit things; } // passthru;

meta = {
# default to python's platforms
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/interpreters/python/passthrufun.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
24 changes: 21 additions & 3 deletions pkgs/development/interpreters/python/wrap-python.nix
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 4 additions & 0 deletions pkgs/misc/flashfocus/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 { };
Expand Down
Loading