2023-05-24 13:37:59 +00:00
|
|
|
{ buildGoModule
|
2022-08-12 12:06:08 +00:00
|
|
|
, fetchFromGitHub
|
2023-05-24 13:37:59 +00:00
|
|
|
, fetchNpmDeps
|
2022-08-12 12:06:08 +00:00
|
|
|
, lib
|
2023-05-24 13:37:59 +00:00
|
|
|
, nodejs
|
|
|
|
, npmHooks
|
2022-08-12 12:06:08 +00:00
|
|
|
, 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
|
2023-05-24 13:37:59 +00:00
|
|
|
, nix-update-script
|
2022-08-12 12:06:08 +00:00
|
|
|
, ffmpegSupport ? true
|
|
|
|
}:
|
2020-06-15 15:56:04 +00:00
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
buildGoModule rec {
|
|
|
|
pname = "navidrome";
|
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
|
|
|
};
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
vendorHash = "sha256-C8w/qCts8VqNDTQVXtykjmSbo5uDrvS9NOu3SHpAlDE=";
|
2020-06-15 15:56:04 +00:00
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
npmRoot = "ui";
|
2020-06-15 15:56:04 +00:00
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
npmDeps = fetchNpmDeps {
|
|
|
|
inherit src;
|
|
|
|
sourceRoot = "source/ui";
|
|
|
|
hash = "sha256-qxwTiXLmZnTnmTSBmWPjeFCP7qzvTFN0xXp5lFkWFog=";
|
|
|
|
};
|
2021-05-20 23:08:51 +00:00
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
makeWrapper
|
|
|
|
nodejs
|
|
|
|
npmHooks.npmConfigHook
|
|
|
|
pkg-config
|
|
|
|
];
|
2021-05-20 23:08:51 +00:00
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
overrideModAttrs = oldAttrs: {
|
|
|
|
nativeBuildInputs = lib.filter (drv: drv != npmHooks.npmConfigHook) oldAttrs.nativeBuildInputs;
|
|
|
|
preBuild = null;
|
|
|
|
};
|
2022-08-12 12:06:08 +00:00
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
buildInputs = [
|
|
|
|
taglib
|
|
|
|
zlib
|
|
|
|
];
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
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" ];
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
preBuild = ''
|
|
|
|
make buildjs
|
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 = {
|
|
|
|
tests.navidrome = nixosTests.navidrome;
|
2023-05-24 13:37:59 +00:00
|
|
|
updateScript = nix-update-script { };
|
2022-08-12 12:06:08 +00:00
|
|
|
};
|
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
|
|
|
};
|
|
|
|
}
|