2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
2024-10-04 16:56:33 +00:00
|
|
|
|
|
|
|
# buildInputs
|
2024-06-05 15:53:02 +00:00
|
|
|
libiconv,
|
2024-10-04 16:56:33 +00:00
|
|
|
|
|
|
|
# nativeBuildInputs
|
2024-06-05 15:53:02 +00:00
|
|
|
rustPlatform,
|
2024-10-04 16:56:33 +00:00
|
|
|
|
|
|
|
# tests
|
2024-07-27 06:49:29 +00:00
|
|
|
anyio,
|
2024-06-05 15:53:02 +00:00
|
|
|
objsize,
|
|
|
|
pydantic,
|
|
|
|
pytestCheckHook,
|
2024-07-27 06:49:29 +00:00
|
|
|
trio,
|
2024-06-05 15:53:02 +00:00
|
|
|
y-py,
|
2024-10-04 16:56:33 +00:00
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
nix-update-script,
|
2024-01-02 11:29:13 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pycrdt";
|
2024-10-04 16:56:33 +00:00
|
|
|
version = "0.9.16";
|
2024-01-02 11:29:13 +00:00
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "jupyter-server";
|
|
|
|
repo = "pycrdt";
|
|
|
|
rev = "refs/tags/v${version}";
|
2024-10-04 16:56:33 +00:00
|
|
|
hash = "sha256-AO5KGBG4I+D5q/VSifzmg0ImAujR1ol9zGU4Y61fImc=";
|
2024-01-02 11:29:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
cp ${./Cargo.lock} Cargo.lock
|
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
cargoDeps = rustPlatform.importCargoLock { lockFile = ./Cargo.lock; };
|
2024-01-02 11:29:13 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
rustPlatform.cargoSetupHook
|
|
|
|
rustPlatform.maturinBuildHook
|
|
|
|
];
|
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];
|
2024-01-02 11:29:13 +00:00
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
dependencies = [ anyio ];
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
pythonImportsCheck = [ "pycrdt" ];
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
2024-07-27 06:49:29 +00:00
|
|
|
anyio
|
2024-05-15 15:35:15 +00:00
|
|
|
objsize
|
|
|
|
pydantic
|
2024-01-02 11:29:13 +00:00
|
|
|
pytestCheckHook
|
2024-07-27 06:49:29 +00:00
|
|
|
trio
|
2024-01-02 11:29:13 +00:00
|
|
|
y-py
|
|
|
|
];
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
passthru.updateScript = nix-update-script { extraArgs = [ "--generate-lockfile" ]; };
|
|
|
|
|
|
|
|
meta = {
|
2024-01-02 11:29:13 +00:00
|
|
|
description = "CRDTs based on Yrs";
|
|
|
|
homepage = "https://github.com/jupyter-server/pycrdt";
|
2024-09-19 14:19:46 +00:00
|
|
|
changelog = "https://github.com/jupyter-server/pycrdt/releases/tag/${lib.removePrefix "refs/tags/" src.rev}";
|
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = lib.teams.jupyter.members;
|
2024-01-02 11:29:13 +00:00
|
|
|
};
|
|
|
|
}
|