Skip to content
Merged
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
19 changes: 9 additions & 10 deletions pkgs/by-name/py/pyspread/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,20 @@
}:

let
# get rid of rec
pname = "pyspread";
version = "2.4";
src = fetchPypi {
inherit pname version;
hash = "sha256-MZlR2Rap5oMRfCmswg9W//FYFkSEki7eyMNhLoGZgJM=";
};
inherit (libsForQt5)
qtsvg
wrapQtAppsHook
;
in
python3.pkgs.buildPythonApplication {
python3.pkgs.buildPythonApplication (finalAttrs: {
format = "setuptools";
inherit pname version src;
pname = "pyspread";
version = "2.4";
src = fetchPypi {
pname = "pyspread";
inherit (finalAttrs) version;
hash = "sha256-MZlR2Rap5oMRfCmswg9W//FYFkSEki7eyMNhLoGZgJM=";
};

nativeBuildInputs = [
copyDesktopItems
Expand Down Expand Up @@ -86,4 +85,4 @@ python3.pkgs.buildPythonApplication {
mainProgram = "pyspread";
maintainers = [ ];
};
}
})
145 changes: 71 additions & 74 deletions pkgs/development/interpreters/python/mk-python-derivation.nix
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,12 @@ let
"wheel"
];

cleanAttrs = flip removeAttrs [
in

lib.extendMkDerivation {
constructDrv = stdenv.mkDerivation;

excludeDrvArgNames = [
"disabled"
"checkPhase"
"checkInputs"
Expand All @@ -114,93 +119,89 @@ let
"build-system"
];

in

{
# Build-time dependencies for the package
nativeBuildInputs ? [ ],
extendDrvArgs =
finalAttrs:
{
# Build-time dependencies for the package
nativeBuildInputs ? [ ],

# Run-time dependencies for the package
buildInputs ? [ ],
# Run-time dependencies for the package
buildInputs ? [ ],

# Dependencies needed for running the checkPhase.
# These are added to buildInputs when doCheck = true.
checkInputs ? [ ],
nativeCheckInputs ? [ ],
# Dependencies needed for running the checkPhase.
# These are added to buildInputs when doCheck = true.
checkInputs ? [ ],
nativeCheckInputs ? [ ],

# propagate build dependencies so in case we have A -> B -> C,
# C can import package A propagated by B
propagatedBuildInputs ? [ ],
# propagate build dependencies so in case we have A -> B -> C,
# C can import package A propagated by B
propagatedBuildInputs ? [ ],

# Python module dependencies.
# These are named after PEP-621.
dependencies ? [ ],
optional-dependencies ? { },
# Python module dependencies.
# These are named after PEP-621.
dependencies ? [ ],
optional-dependencies ? { },

# Python PEP-517 build systems.
build-system ? [ ],
# Python PEP-517 build systems.
build-system ? [ ],

# DEPRECATED: use propagatedBuildInputs
pythonPath ? [ ],
# DEPRECATED: use propagatedBuildInputs
pythonPath ? [ ],

# Enabled to detect some (native)BuildInputs mistakes
strictDeps ? true,
# Enabled to detect some (native)BuildInputs mistakes
strictDeps ? true,

outputs ? [ "out" ],
outputs ? [ "out" ],

# used to disable derivation, useful for specific python versions
disabled ? false,
# used to disable derivation, useful for specific python versions
disabled ? false,

# Raise an error if two packages are installed with the same name
# TODO: For cross we probably need a different PYTHONPATH, or not
# add the runtime deps until after buildPhase.
catchConflicts ? (python.stdenv.hostPlatform == python.stdenv.buildPlatform),
# Raise an error if two packages are installed with the same name
# TODO: For cross we probably need a different PYTHONPATH, or not
# add the runtime deps until after buildPhase.
catchConflicts ? (python.stdenv.hostPlatform == python.stdenv.buildPlatform),

# Additional arguments to pass to the makeWrapper function, which wraps
# generated binaries.
makeWrapperArgs ? [ ],
# Additional arguments to pass to the makeWrapper function, which wraps
# generated binaries.
makeWrapperArgs ? [ ],

# Skip wrapping of python programs altogether
dontWrapPythonPrograms ? false,
# Skip wrapping of python programs altogether
dontWrapPythonPrograms ? false,

# Don't use Pip to install a wheel
# Note this is actually a variable for the pipInstallPhase in pip's setupHook.
# It's included here to prevent an infinite recursion.
dontUsePipInstall ? false,
# Don't use Pip to install a wheel
# Note this is actually a variable for the pipInstallPhase in pip's setupHook.
# It's included here to prevent an infinite recursion.
dontUsePipInstall ? false,

# Skip setting the PYTHONNOUSERSITE environment variable in wrapped programs
permitUserSite ? false,
# Skip setting the PYTHONNOUSERSITE environment variable in wrapped programs
permitUserSite ? false,

# Remove bytecode from bin folder.
# When a Python script has the extension `.py`, bytecode is generated
# Typically, executables in bin have no extension, so no bytecode is generated.
# However, some packages do provide executables with extensions, and thus bytecode is generated.
removeBinBytecode ? true,
# Remove bytecode from bin folder.
# When a Python script has the extension `.py`, bytecode is generated
# Typically, executables in bin have no extension, so no bytecode is generated.
# However, some packages do provide executables with extensions, and thus bytecode is generated.
removeBinBytecode ? true,

# pyproject = true <-> format = "pyproject"
# pyproject = false <-> format = "other"
# https://github.com/NixOS/nixpkgs/issues/253154
pyproject ? null,
# pyproject = true <-> format = "pyproject"
# pyproject = false <-> format = "other"
# https://github.com/NixOS/nixpkgs/issues/253154
pyproject ? null,

# Several package formats are supported.
# "setuptools" : Install a common setuptools/distutils based package. This builds a wheel.
# "wheel" : Install from a pre-compiled wheel.
# "pyproject": Install a package using a ``pyproject.toml`` file (PEP517). This builds a wheel.
# "egg": Install a package from an egg.
# "other" : Provide your own buildPhase and installPhase.
format ? null,
# Several package formats are supported.
# "setuptools" : Install a common setuptools/distutils based package. This builds a wheel.
# "wheel" : Install from a pre-compiled wheel.
# "pyproject": Install a package using a ``pyproject.toml`` file (PEP517). This builds a wheel.
# "egg": Install a package from an egg.
# "other" : Provide your own buildPhase and installPhase.
format ? null,

meta ? { },
meta ? { },

doCheck ? true,
doCheck ? true,

...
}@attrs:
...
}@attrs:

let
# Keep extra attributes from `attrs`, e.g., `patchPhase', etc.
self = stdenv.mkDerivation (
finalAttrs:
let
getFinalPassthru =
let
Expand Down Expand Up @@ -283,8 +284,7 @@ let
name = namePrefix + attrs.name or "${finalAttrs.pname}-${finalAttrs.version}";

in
(cleanAttrs attrs)
// {
{
inherit name;

inherit catchConflicts;
Expand Down Expand Up @@ -447,8 +447,7 @@ let
"enabledTestPaths"
"enabledTests"
] attrs
)
);
);

# This derivation transformation function must be independent to `attrs`
# for fixed-point arguments support in the future.
Expand All @@ -468,6 +467,4 @@ let
};
in
drv: disablePythonPackage (toPythonModule drv);

in
transformDrv self
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ let
origArgs:
let
result = f origArgs;
overrideWith = newArgs: origArgs // lib.toFunction newArgs origArgs;
overrideWith =
if lib.isFunction origArgs then
newArgs: lib.extends (_: lib.toFunction newArgs) origArgs
else
newArgs: origArgs // lib.toFunction newArgs origArgs;
in
if lib.isAttrs result then
result
Expand Down
Loading