From c10ec04c4cdf61f956b09d7afe7a52619bbeb1b6 Mon Sep 17 00:00:00 2001 From: d-brasher <175485311+d-brasher@users.noreply.github.com> Date: Wed, 25 Mar 2026 15:47:22 +0100 Subject: [PATCH] python3Packages.scalib: init at 0.6.4 --- .../python-modules/scalib/default.nix | 80 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 82 insertions(+) create mode 100644 pkgs/development/python-modules/scalib/default.nix diff --git a/pkgs/development/python-modules/scalib/default.nix b/pkgs/development/python-modules/scalib/default.nix new file mode 100644 index 000000000000..924d1a4e8d18 --- /dev/null +++ b/pkgs/development/python-modules/scalib/default.nix @@ -0,0 +1,80 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + rustPlatform, + + setuptools, + setuptools-scm, + + cargo, + rustc, + setuptools-rust, + + numpy, + + pytestCheckHook, + pytest-cov-stub, + scikit-learn, + scipy, +}: +buildPythonPackage (finalAttrs: { + pname = "scalib"; + version = "0.6.4"; + pyproject = true; + src = fetchFromGitHub { + owner = "simple-crypto"; + repo = "SCALib"; + tag = "v${finalAttrs.version}"; + hash = "sha256-DVXb93W0TmOcyGyMN5GmIJNAdbLeeFnNm+3QfTw2j5s="; + }; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail '"setuptools-scm-git-archive",' "" + ''; + + cargoDeps = rustPlatform.fetchCargoVendor { + inherit (finalAttrs) + pname + version + src + cargoRoot + ; + hash = "sha256-mzzp5EnaBYIbGGxJ9mJ6dqRVcTDS406BRx7hWVZ11SY="; + }; + + cargoRoot = "src/scalib_ext"; + + build-system = [ + setuptools + setuptools-scm + ]; + + nativeBuildInputs = [ + cargo + rustPlatform.cargoSetupHook + rustc + setuptools-rust + ]; + + dependencies = [ + numpy + ]; + + nativeCheckInputs = [ + pytestCheckHook + pytest-cov-stub + scikit-learn + scipy + numpy + ]; + + meta = { + description = "Side-Channel Analysis Library"; + homepage = "https://github.com/simple-crypto/scalib"; + changelog = "https://github.com/simple-crypto/SCALib/blob/${finalAttrs.src.tag}/CHANGELOG.rst"; + license = lib.licenses.agpl3Only; + maintainers = with lib.maintainers; [ d-brasher ]; + }; +}) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 4c320588d721..e5760de0b8af 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -17223,6 +17223,8 @@ self: super: with self; { scales = callPackage ../development/python-modules/scales { }; + scalib = callPackage ../development/python-modules/scalib { }; + scancode-toolkit = callPackage ../development/python-modules/scancode-toolkit { }; scanpy = callPackage ../development/python-modules/scanpy { };