1{
2 lib,
3 buildPythonPackage,
4 pythonOlder,
5 fetchFromGitHub,
6 exiftool,
7 setuptools,
8 pytestCheckHook,
9}:
10
11buildPythonPackage rec {
12 pname = "pyexiftool";
13 version = "0.5.6";
14 pyproject = true;
15
16 disabled = pythonOlder "3.6";
17
18 src = fetchFromGitHub {
19 owner = "sylikc";
20 repo = "pyexiftool";
21 tag = "v${version}";
22 hash = "sha256-dgQkbpCbdq2JbupY0DyQbHPR9Bg+bwDo7yN03o3sX+A=";
23 };
24
25 postPatch = ''
26 substituteInPlace exiftool/constants.py \
27 --replace-fail 'DEFAULT_EXECUTABLE = "exiftool"' \
28 'DEFAULT_EXECUTABLE = "${lib.getExe exiftool}"'
29 '';
30
31 nativeBuildInputs = [ setuptools ];
32
33 pythonImportsCheck = [ "exiftool" ];
34
35 nativeCheckInputs = [ pytestCheckHook ];
36
37 meta = {
38 changelog = "https://github.com/sylikc/pyexiftool/blob/${src.rev}/CHANGELOG.md";
39 description = "Python wrapper for exiftool";
40 homepage = "https://github.com/sylikc/pyexiftool";
41 license = with lib.licenses; [
42 bsd3 # or
43 gpl3Plus
44 ];
45 maintainers = with lib.maintainers; [ dotlambda ];
46 };
47}