2021-07-24 05:20:00 +01:00
|
|
|
{ lib, stdenv, buildGoModule, fetchFromGitHub
|
2022-12-21 00:08:48 +00:00
|
|
|
, nixosTests
|
2022-12-04 12:43:38 +00:00
|
|
|
, pkg-config, taglib, zlib
|
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.
|
2022-12-04 12:43:38 +00:00
|
|
|
, transcodingSupport ? true, ffmpeg
|
|
|
|
, mpv }:
|
2020-08-28 23:15:20 +01:00
|
|
|
|
2021-02-04 00:09:00 +00:00
|
|
|
buildGoModule rec {
|
|
|
|
pname = "gonic";
|
2022-12-31 07:51:05 +00:00
|
|
|
version = "0.15.2";
|
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}";
|
2022-12-31 07:51:05 +00:00
|
|
|
sha256 = "sha256-lyKKD6Rxr4psFUxqGTtqQ3M/vQXoNPbcg0cTam9MkXk=";
|
2020-08-28 23:15:20 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2022-12-04 12:43:38 +00:00
|
|
|
buildInputs = [ taglib zlib ];
|
2023-09-13 05:44:46 +01:00
|
|
|
vendorHash = "sha256-+PUKPqW+ER7mmZXrDIc0cE4opoTxA3po3WXSeZO+Xwo=";
|
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 \
|
2022-12-04 12:43:38 +00:00
|
|
|
transcode/transcode.go \
|
2021-05-05 12:02:52 +01:00
|
|
|
--replace \
|
2022-12-04 12:43:38 +00:00
|
|
|
'`ffmpeg' \
|
|
|
|
'`${lib.getBin ffmpeg}/bin/ffmpeg'
|
|
|
|
'' + ''
|
|
|
|
substituteInPlace \
|
|
|
|
jukebox/jukebox.go \
|
|
|
|
--replace \
|
|
|
|
'"mpv"' \
|
|
|
|
'"${lib.getBin mpv}/bin/mpv"'
|
2021-05-05 12:02:52 +01:00
|
|
|
'';
|
|
|
|
|
2022-12-21 00:08:48 +00:00
|
|
|
passthru = {
|
|
|
|
tests.gonic = nixosTests.gonic;
|
|
|
|
};
|
|
|
|
|
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;
|
2023-07-07 11:52:12 +01:00
|
|
|
maintainers = with lib.maintainers; [ ];
|
2022-12-04 12:43:38 +00:00
|
|
|
platforms = lib.platforms.linux;
|
2023-11-27 01:17:53 +00:00
|
|
|
mainProgram = "gonic";
|
2020-08-28 23:15:20 +01:00
|
|
|
};
|
|
|
|
}
|