2022-08-12 12:06:08 +00:00
|
|
|
{ callPackage
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, lib
|
|
|
|
, pkg-config
|
|
|
|
, stdenv
|
|
|
|
, ffmpeg
|
|
|
|
, taglib
|
|
|
|
, zlib
|
|
|
|
, makeWrapper
|
|
|
|
, nixosTests
|
|
|
|
, ffmpegSupport ? true
|
|
|
|
}:
|
2020-06-15 15:56:04 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
let
|
2020-06-15 15:56:04 +00:00
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
version = "0.47.5";
|
2020-06-15 15:56:04 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "navidrome";
|
|
|
|
repo = "navidrome";
|
|
|
|
rev = "v${version}";
|
|
|
|
hash = "sha256-gTvJI+brdEpdpbEcdQycqw15seI+k5dMDVrjY3v6i14=";
|
|
|
|
};
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
# FIXME: we currently manually inject a patch for react-scripts in here
|
|
|
|
# See https://github.com/navidrome/navidrome/pull/1767
|
2022-08-12 12:06:08 +00:00
|
|
|
ui = callPackage ./ui {
|
|
|
|
inherit src version;
|
|
|
|
};
|
2021-09-18 10:52:07 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
in
|
2020-06-15 15:56:04 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
buildGoModule {
|
2020-06-15 15:56:04 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
pname = "navidrome";
|
2020-06-15 15:56:04 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
inherit src version;
|
2021-05-20 23:08:51 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
vendorSha256 = "sha256-xMAxGbq2VSXkF9R9hxB9EEk2CnqsRxg2Nmt7zyXohJI=";
|
2021-05-20 23:08:51 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper pkg-config ];
|
|
|
|
|
|
|
|
buildInputs = [ taglib zlib ];
|
|
|
|
|
|
|
|
ldflags = [
|
|
|
|
"-X github.com/navidrome/navidrome/consts.gitSha=${src.rev}"
|
|
|
|
"-X github.com/navidrome/navidrome/consts.gitTag=v${version}"
|
|
|
|
];
|
|
|
|
|
|
|
|
CGO_CFLAGS = lib.optionals stdenv.cc.isGNU [ "-Wno-return-local-addr" ];
|
|
|
|
|
|
|
|
prePatch = ''
|
|
|
|
cp -r ${ui}/* ui/build
|
2020-06-15 15:56:04 +00:00
|
|
|
'';
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
postFixup = lib.optionalString ffmpegSupport ''
|
2020-06-15 15:56:04 +00:00
|
|
|
wrapProgram $out/bin/navidrome \
|
2022-08-12 12:06:08 +00:00
|
|
|
--prefix PATH : ${lib.makeBinPath [ ffmpeg ]}
|
2020-06-15 15:56:04 +00:00
|
|
|
'';
|
2020-11-24 20:58:05 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
passthru = {
|
|
|
|
inherit ui;
|
|
|
|
tests.navidrome = nixosTests.navidrome;
|
|
|
|
updateScript = callPackage ./update.nix {};
|
|
|
|
};
|
2021-08-18 13:19:15 +00:00
|
|
|
|
2020-06-15 15:56:04 +00:00
|
|
|
meta = {
|
|
|
|
description = "Navidrome Music Server and Streamer compatible with Subsonic/Airsonic";
|
|
|
|
homepage = "https://www.navidrome.org/";
|
2022-08-12 12:06:08 +00:00
|
|
|
license = lib.licenses.gpl3Only;
|
|
|
|
sourceProvenance = with lib.sourceTypes; [ fromSource ];
|
|
|
|
platforms = lib.platforms.unix;
|
|
|
|
maintainers = with lib.maintainers; [ aciceri squalus ];
|
2020-06-15 15:56:04 +00:00
|
|
|
};
|
|
|
|
}
|