summary refs log tree commit diff
path: root/pkgs/servers/gonic/default.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-08-04 10:43:07 +0000
committerAlyssa Ross <hi@alyssa.is>2021-08-04 10:43:07 +0000
commit62614cbef7da005c1eda8c9400160f6bcd6546b8 (patch)
treec2630f69080637987b68acb1ee8676d2681fe304 /pkgs/servers/gonic/default.nix
parentd9c82ed3044c72cecf01c6ea042489d30914577c (diff)
parente24069138dfec3ef94f211f1da005bb5395adc11 (diff)
downloadnixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.gz
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.bz2
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.lz
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.xz
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.zst
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.zip
Merge branch 'nixpkgs-update' into master
Diffstat (limited to 'pkgs/servers/gonic/default.nix')
-rw-r--r--pkgs/servers/gonic/default.nix43
1 files changed, 43 insertions, 0 deletions
diff --git a/pkgs/servers/gonic/default.nix b/pkgs/servers/gonic/default.nix
new file mode 100644
index 00000000000..1ff50079ebd
--- /dev/null
+++ b/pkgs/servers/gonic/default.nix
@@ -0,0 +1,43 @@
+{ lib, buildGoModule, fetchFromGitHub
+, pkg-config, taglib, alsa-lib
+, zlib
+
+# Disable on-the-fly transcoding,
+# removing the dependency on ffmpeg.
+# The server will (as of 0.11.0) gracefully fall back
+# to the original file, but if transcoding is configured
+# that takes a while. So best to disable all transcoding
+# in the configuration if you disable transcodingSupport.
+, transcodingSupport ? true, ffmpeg }:
+
+buildGoModule rec {
+  pname = "gonic";
+  version = "0.12.2";
+  src = fetchFromGitHub {
+    owner = "sentriz";
+    repo = pname;
+    rev = "7d420f61a90739cd82a81c2740274c538405d950";
+    sha256 = "0ix33cbhik1580h1jgv6n512dcgip436wmljpiw53c9v438k0ps5";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  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";
+    license = lib.licenses.gpl3Plus;
+    maintainers = with lib.maintainers; [ Profpatsch ];
+  };
+}