about summary refs log tree commit diff
path: root/pkgs/applications/audio/puddletag
diff options
context:
space:
mode:
authorPeter Hoeg <peter@hoeg.com>2022-03-09 13:30:00 +0800
committerPeter Hoeg <peter@hoeg.com>2022-03-11 11:33:40 +0800
commitbbd64cbe3ca10ab12244eeb535766ba3e524f29f (patch)
tree067dbbb3f7f29c1f5f40c8430ef99bcbfe898a6c /pkgs/applications/audio/puddletag
parent060355b3b53998b762fe3f620b9d16a79d5b5d59 (diff)
puddletag: 2.0.1 -> 2.1.1
Diffstat (limited to 'pkgs/applications/audio/puddletag')
-rw-r--r--pkgs/applications/audio/puddletag/default.nix54
1 files changed, 45 insertions, 9 deletions
diff --git a/pkgs/applications/audio/puddletag/default.nix b/pkgs/applications/audio/puddletag/default.nix
index efa1d94361007..701e6fffbbb89 100644
--- a/pkgs/applications/audio/puddletag/default.nix
+++ b/pkgs/applications/audio/puddletag/default.nix
@@ -1,26 +1,62 @@
-{ lib, fetchFromGitHub, python3Packages, wrapQtAppsHook, chromaprint }:
+{ 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.0.1";
+  version = "2.1.1";
 
   src = fetchFromGitHub {
-    owner = "keithgg";
+    owner = "puddletag";
     repo = "puddletag";
     rev = version;
-    sha256 = "sha256-9l8Pc77MX5zFkOqU00HFS8//3Bzd2OMnVV1brmWsNAQ=";
+    hash = "sha256-eilETaFvvPMopIbccV1uLbpD55kHX9KGTCcGVXaHPgM=";
   };
 
-  sourceRoot = "source/source";
+  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 = [ chromaprint ] ++ (with python3Packages; [
+  propagatedBuildInputs = with python3Packages; [
+    pyacoustid
+    chromaprint
     configobj
+    levenshtein
+    lxml
     mutagen
     pyparsing
     pyqt5
-  ]);
+    rapidfuzz
+  ];
 
   preFixup = ''
     makeWrapperArgs+=("''${qtWrapperArgs[@]}")
@@ -33,8 +69,8 @@ python3Packages.buildPythonApplication rec {
   meta = with lib; {
     description = "An audio tag editor similar to the Windows program, Mp3tag";
     homepage = "https://docs.puddletag.net";
-    license = licenses.gpl3;
-    maintainers = with maintainers; [ peterhoeg ];
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ peterhoeg dschrempf ];
     platforms = platforms.linux;
   };
 }