Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
77 lines
1.8 KiB
Nix
77 lines
1.8 KiB
Nix
{
|
|
lib,
|
|
buildGoModule,
|
|
fetchFromGitHub,
|
|
nixosTests,
|
|
pkg-config,
|
|
taglib,
|
|
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,
|
|
mpv,
|
|
}:
|
|
|
|
buildGoModule rec {
|
|
pname = "gonic";
|
|
version = "0.18.0";
|
|
src = fetchFromGitHub {
|
|
owner = "sentriz";
|
|
repo = "gonic";
|
|
rev = "v${version}";
|
|
sha256 = "sha256-qWUADZntJg8722Kxt3z1cwIOTcjxS0PYC0RHzselkdI=";
|
|
};
|
|
|
|
nativeBuildInputs = [ pkg-config ];
|
|
buildInputs = [
|
|
taglib
|
|
zlib
|
|
];
|
|
vendorHash = "sha256-HY+57SJsz/kPxSadjFl4LQ1Jlu3A5I+rpih67cMMGHA=";
|
|
|
|
# TODO(Profpatsch): write a test for transcoding support,
|
|
# since it is prone to break
|
|
postPatch =
|
|
lib.optionalString transcodingSupport ''
|
|
substituteInPlace \
|
|
transcode/transcode.go \
|
|
--replace-fail \
|
|
'`ffmpeg' \
|
|
'`${lib.getBin ffmpeg}/bin/ffmpeg'
|
|
''
|
|
+ ''
|
|
substituteInPlace \
|
|
jukebox/jukebox.go \
|
|
--replace-fail \
|
|
'"mpv"' \
|
|
'"${lib.getBin mpv}/bin/mpv"'
|
|
''
|
|
+ ''
|
|
substituteInPlace server/ctrlsubsonic/testdata/test* \
|
|
--replace-quiet \
|
|
'"audio/flac"' \
|
|
'"audio/x-flac"'
|
|
'';
|
|
|
|
passthru = {
|
|
tests.gonic = nixosTests.gonic;
|
|
};
|
|
|
|
# tests require it
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
meta = {
|
|
homepage = "https://github.com/sentriz/gonic";
|
|
description = "Music streaming server / subsonic server API implementation";
|
|
license = lib.licenses.gpl3Plus;
|
|
maintainers = with lib.maintainers; [ autrimpo ];
|
|
mainProgram = "gonic";
|
|
};
|
|
}
|