1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 poetry-core,
6 numpy,
7}:
8
9buildPythonPackage rec {
10 pname = "nbtlib";
11 version = "2.0.4";
12 format = "pyproject";
13
14 src = fetchFromGitHub {
15 owner = "vberlier";
16 repo = "nbtlib";
17 rev = "v${version}";
18 hash = "sha256-L8eX6/0qiQ4UxbmDicLedzj+oBjYmlK96NpljE/A3eI=";
19 };
20
21 prePatch = ''
22 substituteInPlace pyproject.toml \
23 --replace "poetry>=0.12" "poetry-core" \
24 --replace "poetry.masonry" "poetry.core.masonry"
25 '';
26
27 nativeBuildInputs = [ poetry-core ];
28
29 propagatedBuildInputs = [ numpy ];
30
31 pythonImportsCheck = [ "nbtlib" ];
32
33 meta = with lib; {
34 description = "Python library to read and edit nbt data";
35 mainProgram = "nbt";
36 homepage = "https://github.com/vberlier/nbtlib";
37 changelog = "https://github.com/vberlier/nbtlib/blob/${src.rev}/CHANGELOG.md";
38 license = licenses.mit;
39 maintainers = with maintainers; [ gdd ];
40 };
41}