From e54901d3a628dfcc5f3e179f436ad4c74df25369 Mon Sep 17 00:00:00 2001 From: Derek Kulinski Date: Tue, 27 Jun 2023 13:52:24 -0700 Subject: [PATCH] jsondiff override not needed for versions >2.0.0 --- overrides/default.nix | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/overrides/default.nix b/overrides/default.nix index f9263ea..36d8f05 100644 --- a/overrides/default.nix +++ b/overrides/default.nix @@ -988,14 +988,21 @@ lib.composeManyExtensions [ ]; }); - jsondiff = super.jsondiff.overridePythonAttrs ( - old: { - preBuild = (old.preBuild or "") + '' - substituteInPlace setup.py \ - --replace "'jsondiff=jsondiff.cli:main_deprecated'," "" - ''; - } - ); + jsondiff = + if lib.versionOlder "2.0.0" + then + super.jsondiff.overridePythonAttrs + ( + old: { + preBuild = lib.optionalString (!(old.src.isWheel or false)) ( + (old.preBuild or "") + '' + substituteInPlace setup.py \ + --replace "'jsondiff=jsondiff.cli:main_deprecated'," "" + '' + ); + } + ) + else super.jsondiff; jsonslicer = super.jsonslicer.overridePythonAttrs (old: { nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.pkgconfig ];