2022-08-12 12:06:08 +00:00
|
|
|
{ callPackage
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, lib
|
|
|
|
, pkg-config
|
|
|
|
, stdenv
|
2022-12-17 10:02:37 +00:00
|
|
|
, ffmpeg-headless
|
2022-08-12 12:06:08 +00:00
|
|
|
, 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
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
version = "0.49.3";
|
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}";
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-JBvY+0QAouEc0im62aVSJ27GAB7jt0qVnYtc6VN2qTA=";
|
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
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
vendorSha256 = "sha256-C8w/qCts8VqNDTQVXtykjmSbo5uDrvS9NOu3SHpAlDE=";
|
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-12-17 10:02:37 +00:00
|
|
|
--prefix PATH : ${lib.makeBinPath [ ffmpeg-headless ]}
|
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 ];
|
2023-02-16 17:41:37 +00:00
|
|
|
# Broken on Darwin: sandbox-exec: pattern serialization length exceeds maximum (NixOS/nix#4119)
|
|
|
|
broken = stdenv.isDarwin;
|
2020-06-15 15:56:04 +00:00
|
|
|
};
|
|
|
|
}
|