2021-02-04 01:09:00 +01:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub
|
2020-08-29 00:15:20 +02:00
|
|
|
, pkg-config, taglib, alsaLib
|
|
|
|
|
|
|
|
# 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.
|
2021-02-04 01:09:00 +01:00
|
|
|
, transcodingSupport ? true, ffmpeg }:
|
2020-08-29 00:15:20 +02:00
|
|
|
|
2021-02-04 01:09:00 +01:00
|
|
|
buildGoModule rec {
|
|
|
|
pname = "gonic";
|
2021-02-22 06:10:17 +01:00
|
|
|
version = "0.12.2";
|
2020-08-29 00:15:20 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sentriz";
|
2021-02-04 01:09:00 +01:00
|
|
|
repo = pname;
|
2021-02-22 06:10:17 +01:00
|
|
|
rev = "7d420f61a90739cd82a81c2740274c538405d950";
|
|
|
|
sha256 = "0ix33cbhik1580h1jgv6n512dcgip436wmljpiw53c9v438k0ps5";
|
2020-08-29 00:15:20 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2021-05-05 13:02:52 +02:00
|
|
|
buildInputs = [ taglib alsaLib ];
|
2021-02-04 01:09:00 +01:00
|
|
|
vendorSha256 = "0inxlqxnkglz4j14jav8080718a80nqdcl866lkql8r6zcxb4fm9";
|
2020-08-29 00:15:20 +02:00
|
|
|
|
2021-05-05 13:02:52 +02:00
|
|
|
# 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"'
|
|
|
|
'';
|
|
|
|
|
2020-08-29 00:15:20 +02:00
|
|
|
meta = {
|
|
|
|
homepage = "https://github.com/sentriz/gonic";
|
|
|
|
description = "Music streaming server / subsonic server API implementation";
|
2021-02-04 01:09:00 +01:00
|
|
|
license = lib.licenses.gpl3Plus;
|
2020-08-29 00:15:20 +02:00
|
|
|
maintainers = with lib.maintainers; [ Profpatsch ];
|
|
|
|
};
|
|
|
|
}
|