about summary refs log tree commit diff
path: root/nixpkgs/pkgs/servers/gonic/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/servers/gonic/default.nix')
-rw-r--r--nixpkgs/pkgs/servers/gonic/default.nix15
1 files changed, 13 insertions, 2 deletions
diff --git a/nixpkgs/pkgs/servers/gonic/default.nix b/nixpkgs/pkgs/servers/gonic/default.nix
index fbefca063a84..1ff50079ebd7 100644
--- a/nixpkgs/pkgs/servers/gonic/default.nix
+++ b/nixpkgs/pkgs/servers/gonic/default.nix
@@ -1,5 +1,6 @@
 { lib, buildGoModule, fetchFromGitHub
-, pkg-config, taglib, alsaLib
+, pkg-config, taglib, alsa-lib
+, zlib
 
 # Disable on-the-fly transcoding,
 # removing the dependency on ffmpeg.
@@ -20,9 +21,19 @@ buildGoModule rec {
   };
 
   nativeBuildInputs = [ pkg-config ];
-  buildInputs = [ taglib alsaLib ] ++ lib.optionals transcodingSupport [ ffmpeg ];
+  buildInputs = [ taglib alsa-lib zlib ];
   vendorSha256 = "0inxlqxnkglz4j14jav8080718a80nqdcl866lkql8r6zcxb4fm9";
 
+  # TODO(Profpatsch): write a test for transcoding support,
+  # since it is prone to break
+  postPatch = lib.optionalString transcodingSupport ''
+    substituteInPlace \
+      server/encode/encode.go \
+      --replace \
+        '"ffmpeg"' \
+        '"${lib.getBin ffmpeg}/bin/ffmpeg"'
+  '';
+
   meta = {
     homepage = "https://github.com/sentriz/gonic";
     description = "Music streaming server / subsonic server API implementation";