nixpkgs-suyu/pkgs/servers/gonic/default.nix

44 lines
1.3 KiB
Nix
Raw Normal View History

2021-02-04 01:09:00 +01:00
{ 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.
2021-02-04 01:09:00 +01:00
, transcodingSupport ? true, ffmpeg }:
2021-02-04 01:09:00 +01:00
buildGoModule rec {
pname = "gonic";
2021-07-24 06:20:00 +02:00
version = "0.13.1";
src = fetchFromGitHub {
owner = "sentriz";
2021-02-04 01:09:00 +01:00
repo = pname;
2021-07-24 06:20:00 +02:00
rev = "v${version}";
sha256 = "08zr5cbmn25wfi1sjfsb311ycn1855x57ypyn5165zcz49pcfzxn";
};
nativeBuildInputs = [ pkg-config ];
buildInputs = [ taglib alsa-lib zlib ];
2021-02-04 01:09:00 +01:00
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";
2021-02-04 01:09:00 +01:00
license = lib.licenses.gpl3Plus;
maintainers = with lib.maintainers; [ Profpatsch ];
};
}