mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-11-27 14:51:15 +03:00
python: apply overrides and fix override system
This commit is contained in:
parent
bc029af0ae
commit
3aa7a1365d
@ -16,6 +16,6 @@
|
||||
source = src;
|
||||
})
|
||||
// {
|
||||
checks.x86_64-linux.aiohttp = self.packages.x86_64-linux.aiohttp;
|
||||
checks.x86_64-linux.aiohttp = self.packages.x86_64-linux.main;
|
||||
};
|
||||
}
|
||||
|
@ -12,6 +12,7 @@
|
||||
getSource,
|
||||
packageVersions,
|
||||
subsystemAttrs,
|
||||
produceDerivation,
|
||||
...
|
||||
}: let
|
||||
l = lib // builtins;
|
||||
@ -22,14 +23,6 @@
|
||||
then python.pkgs.buildPythonApplication
|
||||
else python.pkgs.buildPythonPackage;
|
||||
|
||||
packageName =
|
||||
if defaultPackageName == null
|
||||
then
|
||||
if subsystemAttrs.application
|
||||
then "application"
|
||||
else "environment"
|
||||
else defaultPackageName;
|
||||
|
||||
allDependencySources' =
|
||||
l.flatten
|
||||
(l.mapAttrsToList
|
||||
@ -44,8 +37,8 @@
|
||||
(src: src.original or src)
|
||||
allDependencySources';
|
||||
|
||||
package = buildFunc {
|
||||
name = packageName;
|
||||
package = produceDerivation defaultPackageName (buildFunc {
|
||||
name = defaultPackageName;
|
||||
src = getSource defaultPackageName defaultPackageVersion;
|
||||
format = "setuptools";
|
||||
buildInputs = pkgs.pythonManylinuxPackages.manylinux1;
|
||||
@ -73,7 +66,7 @@
|
||||
--no-cache \
|
||||
$pipInstallFlags
|
||||
'';
|
||||
};
|
||||
});
|
||||
in {
|
||||
packages.${defaultPackageName}.${defaultPackageVersion} = package;
|
||||
};
|
||||
|
@ -131,14 +131,19 @@
|
||||
overrideFuncs =
|
||||
lib.mapAttrsToList
|
||||
(funcName: func: {inherit funcName func;})
|
||||
(lib.filterAttrs (n: v: lib.hasPrefix "override" n) condOverride);
|
||||
(lib.filterAttrs (
|
||||
n: v:
|
||||
lib.hasPrefix "override" n
|
||||
&& (! b.elem n ["overrideDerivation" "overridePythonAttrs"])
|
||||
)
|
||||
condOverride);
|
||||
|
||||
singleArgOverrideFuncs = let
|
||||
availableFunctions =
|
||||
lib.mapAttrs
|
||||
(funcName: func: getOverrideFunctionArgs func)
|
||||
(lib.filterAttrs
|
||||
(funcName: func: lib.hasPrefix "override" funcName)
|
||||
(funcName: func: lib.hasPrefix "override" funcName && funcName != "overrideDerivation" && funcName != "overridePythonAttrs")
|
||||
base_derivation);
|
||||
|
||||
getOverrideFuncNameForAttrName = attrName: let
|
||||
|
Loading…
Reference in New Issue
Block a user