2024-01-02 11:29:13 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, libiconv
|
|
|
|
, cargo
|
|
|
|
, rustPlatform
|
|
|
|
, rustc
|
2024-05-15 15:35:15 +00:00
|
|
|
, objsize
|
2024-01-02 11:29:13 +00:00
|
|
|
, pydantic
|
|
|
|
, pytestCheckHook
|
|
|
|
, y-py
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pycrdt";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "0.8.24";
|
2024-01-02 11:29:13 +00:00
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "jupyter-server";
|
|
|
|
repo = "pycrdt";
|
|
|
|
rev = "refs/tags/v${version}";
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-3j5OhjeVE42n4EEOOMUGlQGdnQ/xia0KD543uCMFpCo=";
|
2024-01-02 11:29:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
cp ${./Cargo.lock} Cargo.lock
|
|
|
|
'';
|
|
|
|
|
|
|
|
cargoDeps = rustPlatform.importCargoLock {
|
|
|
|
lockFile = ./Cargo.lock;
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cargo
|
|
|
|
rustPlatform.cargoSetupHook
|
|
|
|
rustPlatform.maturinBuildHook
|
|
|
|
rustc
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [
|
|
|
|
libiconv
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "pycrdt" ];
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
2024-05-15 15:35:15 +00:00
|
|
|
objsize
|
|
|
|
pydantic
|
2024-01-02 11:29:13 +00:00
|
|
|
pytestCheckHook
|
|
|
|
y-py
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "CRDTs based on Yrs";
|
|
|
|
homepage = "https://github.com/jupyter-server/pycrdt";
|
|
|
|
changelog = "https://github.com/jupyter-server/pycrdt/releases/tag/${src.rev}";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = teams.jupyter.members;
|
|
|
|
};
|
|
|
|
}
|