python3,python2: partially apply hasSuffix

This commit is contained in:
Eman Resu
2026-07-20 10:30:08 -04:00
parent ee166fb182
commit ac2d0c5710
2 changed files with 7 additions and 2 deletions
@@ -59,6 +59,8 @@ let
in
fixedWidthString len " " name;
hasZipSuffix = hasSuffix "zip";
isPythonModule =
drv:
# all pythonModules have the pythonModule attribute
@@ -317,7 +319,7 @@ lib.extendMkDerivation {
++ optionals removeBinBytecode [
pythonRemoveBinBytecodeHook
]
++ optionals (hasSuffix "zip" (finalAttrs.src.name or "")) [
++ optionals (attrs ? src.name && hasZipSuffix attrs.src.name) [
unzip
]
++ optionals (format' == "setuptools") [
@@ -27,6 +27,9 @@
eggBuildHook,
eggInstallHook,
}:
let
hasZipSuffix = lib.hasSuffix "zip";
in
lib.extendMkDerivation {
constructDrv = stdenv.mkDerivation;
@@ -207,7 +210,7 @@ lib.extendMkDerivation {
++ lib.optionals removeBinBytecode [
pythonRemoveBinBytecodeHook
]
++ lib.optionals (lib.hasSuffix "zip" (attrs.src.name or "")) [
++ lib.optionals (attrs ? src.name && hasZipSuffix attrs.src.name) [
unzip
]
++ lib.optionals (format == "setuptools") [