summary refs log tree commit diff
path: root/pkgs/tools/audio
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2016-05-02 17:18:07 +0200
committerProfpatsch <mail@profpatsch.de>2016-05-02 18:39:46 +0200
commit1a350e6b583786c5d45b9d2a2987b82e3c5e08e2 (patch)
tree7f48f75d012e0cd572acdedf23211df78589549a /pkgs/tools/audio
parente86c2058a0d33ba5a39112bd44d4fdc446eb5468 (diff)
downloadnixlib-1a350e6b583786c5d45b9d2a2987b82e3c5e08e2.tar
nixlib-1a350e6b583786c5d45b9d2a2987b82e3c5e08e2.tar.gz
nixlib-1a350e6b583786c5d45b9d2a2987b82e3c5e08e2.tar.bz2
nixlib-1a350e6b583786c5d45b9d2a2987b82e3c5e08e2.tar.lz
nixlib-1a350e6b583786c5d45b9d2a2987b82e3c5e08e2.tar.xz
nixlib-1a350e6b583786c5d45b9d2a2987b82e3c5e08e2.tar.zst
nixlib-1a350e6b583786c5d45b9d2a2987b82e3c5e08e2.zip
beets: patch ffmpeg invocation in convert plugin
The default convert configuration invokes ffmpeg, so this patches in the
right storepath. Since it patches the shlex split, even user config will
use the correct path. kudos @aszlig.
Diffstat (limited to 'pkgs/tools/audio')
-rw-r--r--pkgs/tools/audio/beets/default.nix8
1 files changed, 7 insertions, 1 deletions
diff --git a/pkgs/tools/audio/beets/default.nix b/pkgs/tools/audio/beets/default.nix
index 0079270e29fa..806cb07c610f 100644
--- a/pkgs/tools/audio/beets/default.nix
+++ b/pkgs/tools/audio/beets/default.nix
@@ -4,6 +4,7 @@
 , enableAcousticbrainz ? true
 , enableAcoustid       ? true
 , enableBadfiles       ? true, flac ? null, mp3val ? null
+, enableConvert        ? true, ffmpeg ? null
 , enableDiscogs        ? true
 , enableEchonest       ? true
 , enableEmbyupdate     ? true
@@ -22,6 +23,7 @@
 
 assert enableAcoustid    -> pythonPackages.pyacoustid     != null;
 assert enableBadfiles    -> flac != null && mp3val != null;
+assert enableConvert     -> ffmpeg != null;
 assert enableDiscogs     -> pythonPackages.discogs_client != null;
 assert enableEchonest    -> pythonPackages.pyechonest     != null;
 assert enableFetchart    -> pythonPackages.responses      != null;
@@ -38,6 +40,7 @@ let
     acousticbrainz = enableAcousticbrainz;
     badfiles = enableBadfiles;
     chroma = enableAcoustid;
+    convert = enableConvert;
     discogs = enableDiscogs;
     echonest = enableEchonest;
     embyupdate = enableEmbyupdate;
@@ -52,7 +55,7 @@ let
   };
 
   pluginsWithoutDeps = [
-    "bench" "bpd" "bpm" "bucket" "convert" "cue" "duplicates" "edit" "embedart"
+    "bench" "bpd" "bpm" "bucket" "cue" "duplicates" "edit" "embedart"
     "filefilter" "freedesktop" "fromfilename" "ftintitle" "fuzzy" "ihate"
     "importadded" "importfeeds" "info" "inline" "ipfs" "keyfinder" "lyrics"
     "mbcollection" "mbsubmit" "mbsync" "metasync" "missing" "permissions" "play"
@@ -96,6 +99,7 @@ in buildPythonApplication rec {
               || enableEmbyupdate
               || enableAcousticbrainz)
                                    pythonPackages.requests2
+    ++ optional enableConvert      ffmpeg
     ++ optional enableDiscogs      pythonPackages.discogs_client
     ++ optional enableEchonest     pythonPackages.pyechonest
     ++ optional enableLastfm       pythonPackages.pylast
@@ -131,6 +135,8 @@ in buildPythonApplication rec {
       s,"flac","${flac.bin}/bin/flac",
       s,"mp3val","${mp3val}/bin/mp3val",
     }' beetsplug/badfiles.py
+  '' + optionalString enableConvert ''
+    sed -i -e 's,\(util\.command_output(\)\([^)]\+\)),\1[b"${ffmpeg.bin}/bin/ffmpeg" if args[0] == b"ffmpeg" else args[0]] + \2[1:]),' beetsplug/convert.py 
   '' + optionalString enableReplaygain ''
     sed -i -re '
       s!^( *cmd *= *b?['\'''"])(bs1770gain['\'''"])!\1${bs1770gain}/bin/\2!