nixpkgs/pkgs/development/python-modules/nbtlib/default.nix
stuebinm ff1a94e523 treewide: add meta.mainProgram to packages with a single binary
The nixpkgs-unstable channel's programs.sqlite was used to identify
packages producing exactly one binary, and these automatically added
to their package definitions wherever possible.
2024-03-19 03:14:51 +01:00

44 lines
950 B
Nix

{ lib
, buildPythonPackage
, fetchFromGitHub
, poetry-core
, numpy
}:
buildPythonPackage rec {
pname = "nbtlib";
version = "2.0.4";
format = "pyproject";
src = fetchFromGitHub {
owner = "vberlier";
repo = "nbtlib";
rev = "v${version}";
hash = "sha256-L8eX6/0qiQ4UxbmDicLedzj+oBjYmlK96NpljE/A3eI=";
};
prePatch = ''
substituteInPlace pyproject.toml \
--replace "poetry>=0.12" "poetry-core" \
--replace "poetry.masonry" "poetry.core.masonry"
'';
nativeBuildInputs = [
poetry-core
];
propagatedBuildInputs = [
numpy
];
pythonImportsCheck = [ "nbtlib" ];
meta = with lib; {
description = "A python library to read and edit nbt data";
mainProgram = "nbt";
homepage = "https://github.com/vberlier/nbtlib";
changelog = "https://github.com/vberlier/nbtlib/blob/${src.rev}/CHANGELOG.md";
license = licenses.mit;
maintainers = with maintainers; [ gdd ];
};
}