mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-10 22:30:59 +00:00
also: - enable structuredAttrs - add optional-dependencies - package optional rust backend as sub-package in passthru - add updateScript (i tested it and it works)
53 lines
1.2 KiB
Nix
53 lines
1.2 KiB
Nix
{
|
|
buildPythonPackage,
|
|
rustPlatform,
|
|
pythonOlder,
|
|
# attributes from dirsearch
|
|
src,
|
|
meta,
|
|
}:
|
|
buildPythonPackage (finalAttrs: {
|
|
pname = "dirsearch-native";
|
|
# dirsearchs updateScript will fail if upstream bumps the version string for dirsearch_native.
|
|
# I don't think there is anything I can do about until upstream either releases the 2 python
|
|
# packages separately or versions them alongside each other
|
|
# upstream issue https://github.com/maurosoria/dirsearch/issues/1640
|
|
version = "0.1.0";
|
|
|
|
disabled = pythonOlder "3.14";
|
|
|
|
inherit src;
|
|
sourceRoot = "${finalAttrs.src.name}/native";
|
|
|
|
cargoDeps = rustPlatform.fetchCargoVendor {
|
|
inherit (finalAttrs)
|
|
pname
|
|
version
|
|
src
|
|
sourceRoot
|
|
;
|
|
hash = "sha256-5LgxxVknZXMYkh9ozuUx0UGfDeuU2dzFy7nLPhlrvJs=";
|
|
};
|
|
|
|
pyproject = true;
|
|
build-system = [
|
|
rustPlatform.cargoSetupHook
|
|
rustPlatform.maturinBuildHook
|
|
];
|
|
nativeCheckInputs = [
|
|
rustPlatform.cargoCheckHook
|
|
];
|
|
|
|
pythonImportsCheck = [ "dirsearch_native" ];
|
|
|
|
meta = {
|
|
description = "Rust native backend for dirsearch";
|
|
inherit (meta)
|
|
homepage
|
|
changelog
|
|
license
|
|
maintainers
|
|
;
|
|
};
|
|
})
|