Files
nixpkgs/pkgs/development/python-modules/libversion/default.nix
T
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

50 lines
1.0 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
libversion,
pkg-config,
pytestCheckHook,
pythonOlder,
}:
buildPythonPackage rec {
pname = "libversion";
version = "1.2.4";
format = "setuptools";
disabled = pythonOlder "3.6";
src = fetchFromGitHub {
owner = "repology";
repo = "py-libversion";
rev = version;
hash = "sha256-p0wtSB+QXAERf+57MMb8cqWoy1bG3XaCpR9GPwYYvJM=";
};
postPatch = ''
substituteInPlace setup.py \
--replace "'pkg-config'" "'$(command -v $PKG_CONFIG)'"
'';
nativeBuildInputs = [ pkg-config ];
buildInputs = [ libversion ];
nativeCheckInputs = [ pytestCheckHook ];
preCheck = ''
# import from $out
rm -r libversion
'';
pythonImportsCheck = [ "libversion" ];
meta = {
description = "Python bindings for libversion, which provides fast, powerful and correct generic version string comparison algorithm";
homepage = "https://github.com/repology/py-libversion";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ ryantm ];
};
}