mirror of
https://github.com/vale981/poetry2nix
synced 2025-03-04 08:41:42 -05:00
overrides: Remove condition from wheel override
This commit is contained in:
parent
f4ab52a42c
commit
b6f9670d56
4 changed files with 57 additions and 10 deletions
|
@ -114,7 +114,7 @@ lib.makeScope pkgs.newScope (self: {
|
|||
|
||||
__toPluginAble = toPluginAble self;
|
||||
|
||||
inherit (hooks) pipBuildHook removePathDependenciesHook poetry2nixFixupHook;
|
||||
inherit (hooks) pipBuildHook removePathDependenciesHook poetry2nixFixupHook wheelUnpackHook;
|
||||
}
|
||||
)
|
||||
# Null out any filtered packages, we don't want python.pkgs from nixpkgs
|
||||
|
|
|
@ -49,4 +49,16 @@ in
|
|||
} ./fixup-hook.sh
|
||||
) { };
|
||||
|
||||
# When the "wheel" package itself is a wheel the nixpkgs hook (which pulls in "wheel") leads to infinite recursion
|
||||
# It doesn't _really_ depend on wheel though, it just copies the wheel.
|
||||
wheelUnpackHook = callPackage
|
||||
({}:
|
||||
makeSetupHook
|
||||
{
|
||||
name = "wheel-unpack-hook.sh";
|
||||
deps = [ ];
|
||||
} ./wheel-unpack-hook.sh
|
||||
) { };
|
||||
|
||||
|
||||
}
|
||||
|
|
18
hooks/wheel-unpack-hook.sh
Normal file
18
hooks/wheel-unpack-hook.sh
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Setup hook to use in case a wheel is fetched
|
||||
echo "Sourcing wheel setup hook"
|
||||
|
||||
wheelUnpackPhase(){
|
||||
echo "Executing wheelUnpackPhase"
|
||||
runHook preUnpack
|
||||
|
||||
mkdir -p dist
|
||||
cp "$src" "dist/$(stripHash "$src")"
|
||||
|
||||
# runHook postUnpack # Calls find...?
|
||||
echo "Finished executing wheelUnpackPhase"
|
||||
}
|
||||
|
||||
if [ -z "${dontUseWheelUnpack-}" ] && [ -z "${unpackPhase-}" ]; then
|
||||
echo "Using wheelUnpackPhase"
|
||||
unpackPhase=wheelUnpackPhase
|
||||
fi
|
|
@ -944,17 +944,34 @@ self: super:
|
|||
}
|
||||
);
|
||||
|
||||
|
||||
# Stop infinite recursion by using bootstrapped pkg from nixpkgs
|
||||
wheel = (
|
||||
pkgs.python3.pkgs.override {
|
||||
bootstrapped-pip = super.bootstrapped-pip.override {
|
||||
wheel = (pkgs.python3.pkgs.override {
|
||||
python = self.python;
|
||||
}
|
||||
).wheel.overridePythonAttrs (
|
||||
old:
|
||||
if old.format == "other" then old else {
|
||||
inherit (super.wheel) pname name version src;
|
||||
}
|
||||
);
|
||||
}).wheel;
|
||||
};
|
||||
wheel =
|
||||
let
|
||||
isWheel = super.wheel.src.isWheel or false;
|
||||
# If "wheel" is a pre-built binary wheel
|
||||
wheelPackage = super.buildPythonPackage {
|
||||
inherit (super.wheel) pname name version src;
|
||||
inherit (pkgs.python3.pkgs.wheel) meta;
|
||||
format = "wheel";
|
||||
};
|
||||
# If "wheel" is built from source
|
||||
sourcePackage = (
|
||||
pkgs.python3.pkgs.override {
|
||||
python = self.python;
|
||||
}
|
||||
).wheel.overridePythonAttrs (
|
||||
old: {
|
||||
inherit (super.wheel) pname name version src;
|
||||
}
|
||||
);
|
||||
in
|
||||
if isWheel then wheelPackage else sourcePackage;
|
||||
|
||||
zipp =
|
||||
(
|
||||
|
|
Loading…
Add table
Reference in a new issue