about summary refs log tree commit diff stats
path: root/package/blake3/blake3.nix
diff options
context:
space:
mode:
Diffstat (limited to 'package/blake3/blake3.nix')
-rw-r--r--package/blake3/blake3.nix30
1 files changed, 30 insertions, 0 deletions
diff --git a/package/blake3/blake3.nix b/package/blake3/blake3.nix
new file mode 100644
index 0000000..70c556f
--- /dev/null
+++ b/package/blake3/blake3.nix
@@ -0,0 +1,30 @@
+{
+  lib,
+  python3Packages,
+  rustPlatform,
+  fetchFromGitHub,
+}:
+python3Packages.buildPythonPackage rec {
+  pname = "blake3";
+  version = "0.4.1";
+
+  src = fetchFromGitHub {
+    owner = "oconnor663";
+    repo = "blake3-py";
+    rev = version;
+    hash = "sha256-Ju40ea8IQMOPg9BiN47BMmr/WU8HptbqqzVI+jNGpA8=";
+  };
+
+  patches = [
+    ./add_cargo_lock.patch
+  ];
+
+  cargoDeps = rustPlatform.fetchCargoTarball {
+    inherit src patches;
+    hash = "sha256-GwyGSdmJTgsHWfcS2n2FCFrlwRcuANM8/WteYTTyY6o=";
+  };
+
+  format = "pyproject";
+
+  nativeBuildInputs = with rustPlatform; [cargoSetupHook maturinBuildHook];
+}