about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/audio/puddletag/default.nix
blob: ddeee09d829df9df1dc1d675f6d32ebd97ae78a6 (plain) (blame)
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
{ lib
, fetchFromGitHub
, python3
, wrapQtAppsHook
}:

# As of 2.1, puddletag has started pinning versions of all dependencies that it
# was built against which is an issue as the chances of us having the exact same
# versions in nixpkgs are slim to none.
#
# There is a difference between explicit and implicit version requirements and
# we should be able to safely ignore the latter. Therefore use requirements.in
# which contains just the explicit version dependencies instead of
# requirements.txt.
#
# Additionally, we do need to override some of the explicit requirements through
# `overrideVersions`. While we technically run the risk of breaking something by
# ignoring the pinned versions, it's just something we will have to accept
# unless we want to vendor those versions.


python3.pkgs.buildPythonApplication rec {
  pname = "puddletag";
  version = "2.3.0";
  format = "setuptools";

  src = fetchFromGitHub {
    owner = "puddletag";
    repo = "puddletag";
    rev = "refs/tags/${version}";
    hash = "sha256-oScT8YcQoDf2qZ+J7xKm22Sbfym3tkVUrWT5D2LU5e8=";
  };

  pythonRelaxDeps = true;

  pythonRemoveDeps = [
    "chromaprint"
    "pyqt5-qt5"
  ];

  postPatch = ''
    substituteInPlace setup.py \
      --replace share/pixmaps share/icons
  '';

  nativeBuildInputs = [
    python3.pkgs.pythonRelaxDepsHook
    wrapQtAppsHook
  ];

  propagatedBuildInputs = with python3.pkgs; [
    configobj
    levenshtein
    lxml
    mutagen
    pyacoustid
    pyparsing
    pyqt5
    rapidfuzz
    unidecode
  ];

  # the file should be executable but it isn't so our wrapper doesn't run
  preFixup = ''
    chmod 555 $out/bin/puddletag
    wrapQtApp $out/bin/puddletag
  '';

  doCheck = false; # there are no tests

  dontStrip = true; # we are not generating any binaries

  meta = with lib; {
    description = "An audio tag editor similar to the Windows program, Mp3tag";
    mainProgram = "puddletag";
    homepage = "https://docs.puddletag.net";
    license = licenses.gpl3Plus;
    maintainers = with maintainers; [ peterhoeg dschrempf ];
    platforms = platforms.linux;
  };
}