nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 libversion,
6 pkg-config,
7 pytestCheckHook,
8}:
9
10buildPythonPackage rec {
11 pname = "libversion";
12 version = "1.2.4";
13 format = "setuptools";
14
15 src = fetchFromGitHub {
16 owner = "repology";
17 repo = "py-libversion";
18 rev = version;
19 hash = "sha256-p0wtSB+QXAERf+57MMb8cqWoy1bG3XaCpR9GPwYYvJM=";
20 };
21
22 postPatch = ''
23 substituteInPlace setup.py \
24 --replace "'pkg-config'" "'$(command -v $PKG_CONFIG)'"
25 '';
26
27 nativeBuildInputs = [ pkg-config ];
28
29 buildInputs = [ libversion ];
30
31 nativeCheckInputs = [ pytestCheckHook ];
32
33 preCheck = ''
34 # import from $out
35 rm -r libversion
36 '';
37
38 pythonImportsCheck = [ "libversion" ];
39
40 meta = {
41 description = "Python bindings for libversion, which provides fast, powerful and correct generic version string comparison algorithm";
42 homepage = "https://github.com/repology/py-libversion";
43 license = lib.licenses.mit;
44 maintainers = with lib.maintainers; [ ryantm ];
45 };
46}