linux_xanmod: 5.11.14 -> 5.11.15
[NixPkgs.git] / pkgs / development / python-modules / pytaglib / default.nix
blob9155151950a8034cb8134184573d00f741a036d9
1 { lib
2 , buildPythonPackage
3 , fetchFromGitHub
4 , taglib
5 , cython
6 , pytest
7 , glibcLocales
8 , fetchpatch
9 }:
11 buildPythonPackage rec {
12   pname   = "pytaglib";
13   version = "1.4.5";
15   src = fetchFromGitHub {
16     owner = "supermihi";
17     repo = pname;
18     rev = "v${version}";
19     sha256 = "1gvvadlgk8ny8bg76gwvvfcwp1nfgrjphi60h5f9ha7h5ff1g2wb";
20   };
22   patches = [
23     # fix tests on python 2.7
24     (fetchpatch {
25       url = "https://github.com/supermihi/pytaglib/commit/0c4ae750fcd5b18d2553975c7e3e183e9dca5bf1.patch";
26       sha256 = "1kv3c68vimx5dc8aacvzphiaq916avmprxddi38wji8p2ql6vngj";
27     })
29     # properly install pyprinttags
30     (fetchpatch {
31       url = "https://github.com/supermihi/pytaglib/commit/ba7a1406ddf35ddc41ed57f1c8d1f2bc2ed2c93a.patch";
32       sha256 = "0pi0dcq7db5fd3jnbwnfsfsgxvlhnm07z5yhpp93shk0s7ci2bwp";
33     })
34     (fetchpatch {
35       url = "https://github.com/supermihi/pytaglib/commit/28772f6f94d37f05728071381a0fa04c6a14783a.patch";
36       sha256 = "0h259vzj1l0gpibdf322yclyd10x5rh1anzhsjj2ghm6rj6q0r0m";
37     })
38   ];
40   postPatch = ''
41     substituteInPlace setup.py --replace "'pytest-runner', " ""
42   '';
44   buildInputs = [ taglib cython ];
46   checkInputs = [ pytest glibcLocales ];
48   checkPhase = ''
49     LC_ALL=en_US.utf-8 pytest .
50   '';
52   meta = {
53     homepage = "https://github.com/supermihi/pytaglib";
54     description = "Python 2.x/3.x bindings for the Taglib audio metadata library";
55     license = lib.licenses.gpl3;
56     maintainers = [ lib.maintainers.mrkkrp ];
57   };