diff --git a/pkgs/by-name/pl/plfit/package.nix b/pkgs/by-name/pl/plfit/package.nix index 90f103aea0e3..c0fd37234e2d 100644 --- a/pkgs/by-name/pl/plfit/package.nix +++ b/pkgs/by-name/pl/plfit/package.nix @@ -3,11 +3,14 @@ fetchFromGitHub, lib, llvmPackages, + withPython ? false, python ? null, stdenv, swig, }: +assert withPython -> python != null; + stdenv.mkDerivation (finalAttrs: { pname = "plfit"; version = "1.0.1"; @@ -19,7 +22,7 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-0JrPAq/4yzr7XbxvcnFj8CKmMyZT05PkSdGprNdAsJA="; }; - postPatch = lib.optionalString (python != null) '' + postPatch = lib.optionalString withPython '' substituteInPlace src/CMakeLists.txt \ --replace-fail ' ''${Python3_SITEARCH}' ' ${placeholder "out"}/${python.sitePackages}' \ --replace-fail ' ''${Python3_SITELIB}' ' ${placeholder "out"}/${python.sitePackages}' @@ -28,7 +31,7 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ cmake ] - ++ lib.optionals (python != null) [ + ++ lib.optionals withPython [ python swig ]; @@ -36,7 +39,7 @@ stdenv.mkDerivation (finalAttrs: { cmakeFlags = [ "-DPLFIT_USE_OPENMP=ON" ] - ++ lib.optionals (python != null) [ + ++ lib.optionals withPython [ "-DPLFIT_COMPILE_PYTHON_MODULE=ON" ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 72cbab75b289..5ab11ab15070 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3438,10 +3438,6 @@ with pkgs; tautulli = python3Packages.callPackage ../servers/tautulli { }; - plfit = callPackage ../by-name/pl/plfit/package.nix { - python = null; - }; - inherit (callPackage ../development/tools/pnpm { }) pnpm_8 pnpm_9 diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index f1642cfce460..a00111cb5d7a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -12360,7 +12360,12 @@ self: super: with self; { plexwebsocket = callPackage ../development/python-modules/plexwebsocket { }; - plfit = toPythonModule (pkgs.plfit.override { inherit (self) python; }); + plfit = toPythonModule ( + pkgs.plfit.override { + withPython = true; + inherit (self) python; + } + ); plink = callPackage ../development/python-modules/plink { };