2021-07-24 05:20:00 +01:00
|
|
|
{ lib, stdenv, buildGoModule, fetchFromGitHub
|
2021-06-10 03:57:09 +01:00
|
|
|
, pkg-config, taglib, alsa-lib
|
2021-07-24 05:20:00 +01:00
|
|
|
, zlib, AudioToolbox, AppKit
|
2020-08-28 23:15:20 +01:00
|
|
|
|
|
|
|
# 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 00:09:00 +00:00
|
|
|
, transcodingSupport ? true, ffmpeg }:
|
2020-08-28 23:15:20 +01:00
|
|
|
|
2021-02-04 00:09:00 +00:00
|
|
|
buildGoModule rec {
|
|
|
|
pname = "gonic";
|
2021-10-04 15:05:53 +01:00
|
|
|
version = "0.14.0";
|
2020-08-28 23:15:20 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sentriz";
|
2021-02-04 00:09:00 +00:00
|
|
|
repo = pname;
|
2021-07-24 05:20:00 +01:00
|
|
|
rev = "v${version}";
|
2021-10-04 15:05:53 +01:00
|
|
|
sha256 = "sha256-wX97HtvHgHpKTDwZl/wHQRpiyDJ7U38CpdzWu/CYizQ=";
|
2020-08-28 23:15:20 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2021-07-24 05:20:00 +01:00
|
|
|
buildInputs = [ taglib zlib ]
|
|
|
|
++ lib.optionals stdenv.isLinux [ alsa-lib ]
|
|
|
|
++ lib.optionals stdenv.isDarwin [ AudioToolbox AppKit ];
|
2021-10-04 15:05:53 +01:00
|
|
|
vendorSha256 = "sha256-oTuaA5ZsZ7zMcjzGh37zO/1XyOfj6xjfNr6A7ecrOiA=";
|
2020-08-28 23:15:20 +01:00
|
|
|
|
2021-05-05 12:02:52 +01: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-28 23:15:20 +01:00
|
|
|
meta = {
|
|
|
|
homepage = "https://github.com/sentriz/gonic";
|
|
|
|
description = "Music streaming server / subsonic server API implementation";
|
2021-02-04 00:09:00 +00:00
|
|
|
license = lib.licenses.gpl3Plus;
|
2020-08-28 23:15:20 +01:00
|
|
|
maintainers = with lib.maintainers; [ Profpatsch ];
|
|
|
|
};
|
|
|
|
}
|