1{
2 lib,
3 pkg-config,
4 exiv2,
5 gettext,
6 fetchFromGitHub,
7 gitUpdater,
8 buildPythonPackage,
9 setuptools,
10 toml,
11 unittestCheckHook,
12}:
13buildPythonPackage rec {
14 pname = "exiv2";
15 version = "0.17.5";
16 pyproject = true;
17
18 src = fetchFromGitHub {
19 owner = "jim-easterbrook";
20 repo = "python-exiv2";
21 tag = version;
22 hash = "sha256-MQNovei1Y8EZTF8hEyIWLaL2NbQPCB6FGbVfDHIvNVo=";
23 };
24
25 # FAIL: test_localisation (test_types.TestTypesModule.test_localisation)
26 # FAIL: test_TimeValue (test_value.TestValueModule.test_TimeValue)
27 postPatch = ''
28 substituteInPlace tests/test_value.py \
29 --replace-fail "def test_TimeValue(self):" "@unittest.skip('skipping')
30 def test_TimeValue(self):"
31 substituteInPlace tests/test_types.py \
32 --replace-fail "def test_localisation(self):" "@unittest.skip('skipping')
33 def test_localisation(self):"
34 '';
35
36 build-system = [
37 setuptools
38 toml
39 ];
40 nativeBuildInputs = [ pkg-config ];
41
42 buildInputs = [
43 exiv2
44 gettext
45 ];
46
47 pythonImportsCheck = [ "exiv2" ];
48 nativeCheckInputs = [ unittestCheckHook ];
49 unittestFlagsArray = [
50 "-s"
51 "tests"
52 "-v"
53 ];
54
55 passthru.updateScript = gitUpdater { };
56
57 meta = {
58 description = "Low level Python interface to the Exiv2 C++ library";
59 homepage = "https://github.com/jim-easterbrook/python-exiv2";
60 changelog = "https://python-exiv2.readthedocs.io/en/release-${version}/misc/changelog.html";
61 license = lib.licenses.gpl3Plus;
62 maintainers = with lib.maintainers; [ zebreus ];
63 };
64}