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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

51 lines
1.5 KiB
Nix
Raw Normal View History

2021-07-24 06:20:00 +02:00
{ lib, stdenv, buildGoModule, fetchFromGitHub
2022-12-04 13:43:38 +01:00
, 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.
2022-12-04 13:43:38 +01:00
, transcodingSupport ? true, ffmpeg
, mpv }:
2021-02-04 01:09:00 +01:00
buildGoModule rec {
pname = "gonic";
2022-12-31 08:51:05 +01:00
version = "0.15.2";
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}";
2022-12-31 08:51:05 +01:00
sha256 = "sha256-lyKKD6Rxr4psFUxqGTtqQ3M/vQXoNPbcg0cTam9MkXk=";
};
nativeBuildInputs = [ pkg-config ];
2022-12-04 13:43:38 +01:00
buildInputs = [ taglib zlib ];
2022-12-26 10:37:12 +01:00
vendorSha256 = "sha256-+PUKPqW+ER7mmZXrDIc0cE4opoTxA3po3WXSeZO+Xwo=";
# TODO(Profpatsch): write a test for transcoding support,
# since it is prone to break
postPatch = lib.optionalString transcodingSupport ''
substituteInPlace \
2022-12-04 13:43:38 +01:00
transcode/transcode.go \
--replace \
2022-12-04 13:43:38 +01:00
'`ffmpeg' \
'`${lib.getBin ffmpeg}/bin/ffmpeg'
'' + ''
substituteInPlace \
jukebox/jukebox.go \
--replace \
'"mpv"' \
'"${lib.getBin mpv}/bin/mpv"'
'';
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 ];
2022-12-04 13:43:38 +01:00
platforms = lib.platforms.linux;
};
}