1{
2 buildPythonPackage,
3 exempi,
4 fetchFromGitHub,
5 mock,
6 pytz,
7 lib,
8 stdenv,
9}:
10
11buildPythonPackage {
12 pname = "python-xmp-toolkit";
13 version = "2.0.2";
14 format = "setuptools";
15
16 # PyPi has version 2.0.1; the tests fail
17 # There are commits for a 2.0.2 release that was never published
18 # Not to github, not to PyPi
19 # This is the latest commit from Jun 29, 2017 (as of Mar 13, 2019)
20 # It includes the commits for the unreleased version 2.0.2 and more
21 # Tests pass with this version
22 src = fetchFromGitHub {
23 owner = "python-xmp-toolkit";
24 repo = "python-xmp-toolkit";
25 rev = "5692bdf8dac3581a0d5fb3c5aeb29be0ab6a54fc";
26 sha256 = "16bylcm183ilzp7mrpdzw0pzp6csv9v5v247914qsv2abg0hgl5y";
27 };
28
29 buildInputs = [ exempi ];
30
31 propagatedBuildInputs = [ pytz ];
32
33 postPatch = ''
34 substituteInPlace libxmp/exempi.py \
35 --replace "ctypes.util.find_library('exempi')" "'${exempi}/lib/libexempi${stdenv.hostPlatform.extensions.sharedLibrary}'"
36 '';
37
38 # hangs on darwin + sandbox
39 doCheck = !stdenv.isDarwin;
40
41 preCheck = ''
42 rm test/{test_exempi,test_files}.py
43 '';
44
45 meta = with lib; {
46 homepage = "https://github.com/python-xmp-toolkit/python-xmp-toolkit";
47 description = "Python XMP Toolkit for working with metadata";
48 license = licenses.bsd3;
49 maintainers = [ maintainers.kiwi ];
50 };
51}