about summary refs log tree commit diff stats
path: root/package/blake3/blake3.nix
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-08-22 13:58:47 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-08-22 13:59:09 +0200
commit812dde842c25183a482a98e02eeca724a5d24320 (patch)
treeb97831f368f48e9a05434e34b868ae209c71a6d8 /package/blake3/blake3.nix
parentchore(version): v0.1.3 (diff)
downloadyt-812dde842c25183a482a98e02eeca724a5d24320.tar.gz
yt-812dde842c25183a482a98e02eeca724a5d24320.zip
build(package): Include python `blake3` dependency
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];
+}