2024-06-05 15:53:02 +00:00
|
|
|
{
|
2024-07-31 10:19:44 +00:00
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchpatch,
|
|
|
|
fetchFromGitHub,
|
2024-06-05 15:53:02 +00:00
|
|
|
stdenv,
|
2024-07-31 10:19:44 +00:00
|
|
|
|
|
|
|
# nativeBuildInputs
|
|
|
|
cmake,
|
|
|
|
pybind11,
|
|
|
|
|
|
|
|
# buildInputs
|
2024-06-05 15:53:02 +00:00
|
|
|
abseil-cpp,
|
2024-07-31 10:19:44 +00:00
|
|
|
|
|
|
|
# build-system
|
|
|
|
setuptools,
|
|
|
|
|
|
|
|
# checks
|
2024-06-05 15:53:02 +00:00
|
|
|
absl-py,
|
|
|
|
attrs,
|
|
|
|
numpy,
|
|
|
|
wrapt,
|
2021-12-19 01:06:50 +00:00
|
|
|
}:
|
2024-07-31 10:19:44 +00:00
|
|
|
let
|
|
|
|
patchCMakeAbseil = fetchpatch {
|
|
|
|
name = "0001-don-t-rebuild-abseil.patch";
|
|
|
|
url = "https://raw.githubusercontent.com/conda-forge/dm-tree-feedstock/93a91aa2c13240cecf88133e2885ade9121b464a/recipe/patches/0001-don-t-rebuild-abseil.patch";
|
|
|
|
hash = "sha256-bho7lXAV5xHkPmWy94THJtx+6i+px5w6xKKfThvBO/M=";
|
|
|
|
};
|
|
|
|
patchCMakePybind = fetchpatch {
|
|
|
|
name = "0002-don-t-fetch-pybind11.patch";
|
|
|
|
url = "https://raw.githubusercontent.com/conda-forge/dm-tree-feedstock/93a91aa2c13240cecf88133e2885ade9121b464a/recipe/patches/0002-don-t-fetch-pybind11.patch";
|
|
|
|
hash = "sha256-41XIouQ4Fm1yewaxK9erfcnkGBS6vgdvMm/DyF0rsKg=";
|
|
|
|
};
|
|
|
|
in
|
2021-12-19 01:06:50 +00:00
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "dm-tree";
|
2023-01-20 10:41:00 +00:00
|
|
|
version = "0.1.8";
|
2024-07-31 10:19:44 +00:00
|
|
|
pyproject = true;
|
2022-01-03 16:56:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "deepmind";
|
|
|
|
repo = "tree";
|
2023-01-20 10:41:00 +00:00
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
hash = "sha256-VvSJTuEYjIz/4TTibSLkbg65YmcYqHImTHOomeorMJc=";
|
2021-12-19 01:06:50 +00:00
|
|
|
};
|
|
|
|
|
2024-07-31 10:19:44 +00:00
|
|
|
patches = [
|
|
|
|
patchCMakeAbseil
|
|
|
|
patchCMakePybind
|
2024-09-26 11:04:55 +00:00
|
|
|
] ++ (lib.optional stdenv.hostPlatform.isDarwin ./0003-don-t-configure-apple.patch);
|
2022-01-03 16:56:52 +00:00
|
|
|
|
|
|
|
dontUseCmakeConfigure = true;
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
pybind11
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
abseil-cpp
|
|
|
|
pybind11
|
|
|
|
];
|
2021-12-19 01:06:50 +00:00
|
|
|
|
2024-07-31 10:19:44 +00:00
|
|
|
build-system = [ setuptools ];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-01-03 16:56:52 +00:00
|
|
|
absl-py
|
|
|
|
attrs
|
|
|
|
numpy
|
|
|
|
wrapt
|
|
|
|
];
|
2021-12-19 01:06:50 +00:00
|
|
|
|
|
|
|
pythonImportsCheck = [ "tree" ];
|
|
|
|
|
2024-07-31 10:19:44 +00:00
|
|
|
meta = {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Tree is a library for working with nested data structures";
|
2022-01-03 16:56:52 +00:00
|
|
|
homepage = "https://github.com/deepmind/tree";
|
2024-07-31 10:19:44 +00:00
|
|
|
changelog = "https://github.com/google-deepmind/tree/releases/tag/${version}";
|
|
|
|
license = lib.licenses.asl20;
|
|
|
|
maintainers = with lib.maintainers; [
|
2024-06-05 15:53:02 +00:00
|
|
|
samuela
|
|
|
|
ndl
|
|
|
|
];
|
2021-12-19 01:06:50 +00:00
|
|
|
};
|
|
|
|
}
|