about summary refs log tree commit diff
path: root/pkgs/applications/audio/puddletag/default.nix
blob: 701e6fffbbb89b52b8c8c6dae779d0ba2999b48d (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
{ lib, fetchFromGitHub, python3Packages, 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.

let
  # NOTE: check if we can drop any of these overrides when bumping the version
  overrideVersions = [
    "pyparsing"
    "pyqt5"
  ];

in
python3Packages.buildPythonApplication rec {
  pname = "puddletag";
  version = "2.1.1";

  src = fetchFromGitHub {
    owner = "puddletag";
    repo = "puddletag";
    rev = version;
    hash = "sha256-eilETaFvvPMopIbccV1uLbpD55kHX9KGTCcGVXaHPgM=";
  };

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

    cp requirements.in requirements.txt
  '' + lib.concatMapStringsSep "\n"
    (e: ''
      sed -i requirements.txt -e 's/^${e}.*/${e}/'
    '')
    overrideVersions;

  nativeBuildInputs = [ wrapQtAppsHook ];

  propagatedBuildInputs = with python3Packages; [
    pyacoustid
    chromaprint
    configobj
    levenshtein
    lxml
    mutagen
    pyparsing
    pyqt5
    rapidfuzz
  ];

  preFixup = ''
    makeWrapperArgs+=("''${qtWrapperArgs[@]}")
  '';

  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";
    homepage = "https://docs.puddletag.net";
    license = licenses.gpl3Plus;
    maintainers = with maintainers; [ peterhoeg dschrempf ];
    platforms = platforms.linux;
  };
}