From 11db53952828b533fbcd5f72cb78a176a996dfe4 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Wed, 31 Dec 2025 10:35:04 +0000 Subject: [PATCH] python3Packages.rocksdict: init at 0.3.29 --- .../python-modules/rocksdict/default.nix | 67 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 69 insertions(+) create mode 100644 pkgs/development/python-modules/rocksdict/default.nix diff --git a/pkgs/development/python-modules/rocksdict/default.nix b/pkgs/development/python-modules/rocksdict/default.nix new file mode 100644 index 000000000000..01152c1c85ec --- /dev/null +++ b/pkgs/development/python-modules/rocksdict/default.nix @@ -0,0 +1,67 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + rustPlatform, + pkgs, + + # tests + pytestCheckHook, +}: + +buildPythonPackage (finalAttrs: { + pname = "rocksdict"; + version = "0.3.29"; + pyproject = true; + + src = fetchFromGitHub { + owner = "rocksdict"; + repo = "RocksDict"; + tag = "v${finalAttrs.version}"; + fetchSubmodules = true; + hash = "sha256-yP+OAVioKOGPvcYM8s1TTNHzzaFxw1sUQDrWxmptuJo="; + }; + + cargoDeps = rustPlatform.fetchCargoVendor { + inherit (finalAttrs) src pname version; + hash = "sha256-E7DrHMla7af7IjPxS5EV2bWorXjHCsclnONVkkLAUrk="; + }; + + nativeBuildInputs = [ + rustPlatform.cargoSetupHook + rustPlatform.maturinBuildHook + ]; + + env = { + # libclang.so + LIBCLANG_PATH = "${lib.getLib pkgs.libclang}/lib"; + }; + + maturinBuildFlags = [ + # We disable LTO because it is incompatible with gcc + # LTO is only supported with clang. Either disable the `lto` feature or set + # `CC=/usr/bin/clang CXX=/usr/bin/clang++` environment variables. + + # Disable all default features to get rid of "lto" + "--no-default-features" + # Manually re-enable bindgen-runtime + "--features bindgen-runtime" + ]; + + pythonImportsCheck = [ "rocksdict" ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + enabledTestPaths = [ + "test" + ]; + + meta = { + description = "Python fast on-disk dictionary / RocksDB & SpeeDB Python binding"; + homepage = "https://github.com/rocksdict/RocksDict"; + changelog = "https://github.com/rocksdict/RocksDict/releases/tag/${finalAttrs.src.tag}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ GaetanLepage ]; + }; +}) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 8a41751e47b0..39ffa9228c5d 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -16605,6 +16605,8 @@ self: super: with self; { rocketchat-api = callPackage ../development/python-modules/rocketchat-api { }; + rocksdict = callPackage ../development/python-modules/rocksdict { }; + roku = callPackage ../development/python-modules/roku { }; rokuecp = callPackage ../development/python-modules/rokuecp { };