summary refs log tree commit diff
path: root/pkgs/applications/audio/deadbeef
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2015-08-17 01:17:53 +0300
committerNikolay Amiantov <ab@fmap.me>2015-08-17 21:05:52 +0300
commit1a22ad6b1805d5b90dbe632aae6d91692464db6b (patch)
tree3a516244298a7f087bfb238e3450ea4374ce4c36 /pkgs/applications/audio/deadbeef
parent4a12ff77cc4374a9dfceb974615d1863025623b8 (diff)
downloadnixpkgs-1a22ad6b1805d5b90dbe632aae6d91692464db6b.tar
nixpkgs-1a22ad6b1805d5b90dbe632aae6d91692464db6b.tar.gz
nixpkgs-1a22ad6b1805d5b90dbe632aae6d91692464db6b.tar.bz2
nixpkgs-1a22ad6b1805d5b90dbe632aae6d91692464db6b.tar.lz
nixpkgs-1a22ad6b1805d5b90dbe632aae6d91692464db6b.tar.xz
nixpkgs-1a22ad6b1805d5b90dbe632aae6d91692464db6b.tar.zst
nixpkgs-1a22ad6b1805d5b90dbe632aae6d91692464db6b.zip
deadbeef: add -with-plugins wrapper and a necessary patch
Diffstat (limited to 'pkgs/applications/audio/deadbeef')
-rw-r--r--pkgs/applications/audio/deadbeef/default.nix10
-rw-r--r--pkgs/applications/audio/deadbeef/wrapper.nix22
2 files changed, 30 insertions, 2 deletions
diff --git a/pkgs/applications/audio/deadbeef/default.nix b/pkgs/applications/audio/deadbeef/default.nix
index 9dd4db68432..410ddb4c6f1 100644
--- a/pkgs/applications/audio/deadbeef/default.nix
+++ b/pkgs/applications/audio/deadbeef/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, intltool, pkgconfig
+{ stdenv, fetchurl, intltool, pkgconfig, fetchpatch
 # deadbeef can use either gtk2 or gtk3
 , gtk2Support ? true, gtk2 ? null
 , gtk3Support ? false, gtk3 ? null, gsettings_desktop_schemas ? null, makeWrapper ? null
@@ -51,7 +51,7 @@ stdenv.mkDerivation rec {
   name = "deadbeef-0.6.2";
 
   src = fetchurl {
-    url = "http://garr.dl.sourceforge.net/project/deadbeef/${name}.tar.bz2";
+    url = "mirror://sourceforge/project/deadbeef/${name}.tar.bz2";
     sha256 = "06jfsqyakpvq0xhah7dlyvdzh5ym3hhb4yfczczw11ijd1kbjcrl";
   };
 
@@ -82,6 +82,12 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
+  patches = [ (fetchpatch {
+                url = "https://github.com/Alexey-Yakovenko/deadbeef/commit/e7725ea73fa1bd279a3651704870156bca8efea8.patch";
+                sha256 = "0a04l2607y3swcq9b1apffl1chdwj38jwfiizxcfmdbia4a0qlyg";
+              })
+            ];
+
   postInstall = if !gtk3Support then "" else ''
     wrapProgram "$out/bin/deadbeef" \
       --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH"
diff --git a/pkgs/applications/audio/deadbeef/wrapper.nix b/pkgs/applications/audio/deadbeef/wrapper.nix
new file mode 100644
index 00000000000..b612f195af3
--- /dev/null
+++ b/pkgs/applications/audio/deadbeef/wrapper.nix
@@ -0,0 +1,22 @@
+{ stdenv, buildEnv, deadbeef, makeWrapper, plugins }:
+
+let
+drv = buildEnv {
+  name = "deadbeef-with-plugins-" + (builtins.parseDrvName deadbeef.name).version;
+
+  paths = [ deadbeef ] ++ plugins;
+
+  postBuild = ''
+    # TODO: This could be avoided if buildEnv could be forced to create all directories
+    if [ -L $out/bin ]; then
+      rm $out/bin
+      mkdir $out/bin
+      for i in ${deadbeef}/bin/*; do
+        ln -s $i $out/bin
+      done
+    fi
+    wrapProgram $out/bin/deadbeef \
+      --set DEADBEEF_PLUGIN_DIR "$out/lib/deadbeef"
+  '';
+  };
+in stdenv.lib.overrideDerivation drv (x : { buildInputs = x.buildInputs ++ [ makeWrapper ]; })