summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/pyexiftool/default.nix
blob: e8604a11229f4df268a350f93e004c4bdb2f78da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  exiftool,
  setuptools,
  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "pyexiftool";
  version = "0.5.6";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "sylikc";
    repo = "pyexiftool";
    tag = "v${version}";
    hash = "sha256-dgQkbpCbdq2JbupY0DyQbHPR9Bg+bwDo7yN03o3sX+A=";
  };

  postPatch = ''
    substituteInPlace exiftool/constants.py \
      --replace-fail 'DEFAULT_EXECUTABLE = "exiftool"' \
                     'DEFAULT_EXECUTABLE = "${lib.getExe exiftool}"'
  '';

  nativeBuildInputs = [ setuptools ];

  pythonImportsCheck = [ "exiftool" ];

  nativeCheckInputs = [ pytestCheckHook ];

  meta = {
    changelog = "https://github.com/sylikc/pyexiftool/blob/${src.rev}/CHANGELOG.md";
    description = "Python wrapper for exiftool";
    homepage = "https://github.com/sylikc/pyexiftool";
    license = with lib.licenses; [
      bsd3 # or
      gpl3Plus
    ];
    maintainers = with lib.maintainers; [ dotlambda ];
  };
}