squalus 19705d04f1 navidrome: 0.53.3 -> 0.54.3
- Update to 0.54.3
- Add netgo tag required for build (https://github.com/navidrome/navidrome/issues/700)
- Add patchShebangs step for a script called by UI build
- Add settings option for telemetry

0.54.1 changelog: https://github.com/navidrome/navidrome/releases/tag/v0.54.1
0.54.2 changelog: https://github.com/navidrome/navidrome/releases/tag/v0.54.2
0.54.3 changelog: https://github.com/navidrome/navidrome/releases/tag/v0.54.3

Fixes CVE-2024-56362
2025-01-01 08:10:37 -08:00

100 lines
2.1 KiB
Nix

{
buildGo123Module,
buildPackages,
fetchFromGitHub,
fetchNpmDeps,
lib,
nodejs,
npmHooks,
pkg-config,
stdenv,
ffmpeg-headless,
taglib,
zlib,
nixosTests,
nix-update-script,
ffmpegSupport ? true,
}:
buildGo123Module rec {
pname = "navidrome";
version = "0.54.3";
src = fetchFromGitHub {
owner = "navidrome";
repo = "navidrome";
rev = "v${version}";
hash = "sha256-mOJSgX+1id8tZU8KVjWbf2LycrzdudhUV/9pxKa4yHw=";
};
vendorHash = "sha256-LpSmSbReQ3yHFvHhN/LERWQjf72/ELTjk4qhO4lyzW0=";
npmRoot = "ui";
npmDeps = fetchNpmDeps {
inherit src;
sourceRoot = "${src.name}/ui";
hash = "sha256-PaE1xcZX9wZRcKeqQCXbdhi4cIBWBL8ZQdww6AOB7sQ=";
};
nativeBuildInputs = [
buildPackages.makeWrapper
nodejs
npmHooks.npmConfigHook
pkg-config
];
overrideModAttrs = oldAttrs: {
nativeBuildInputs = lib.filter (drv: drv != npmHooks.npmConfigHook) oldAttrs.nativeBuildInputs;
preBuild = null;
};
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" ];
postPatch = ''
patchShebangs ui/bin/update-workbox.sh
'';
preBuild = ''
make buildjs
'';
tags = [
"netgo"
];
postFixup = lib.optionalString ffmpegSupport ''
wrapProgram $out/bin/navidrome \
--prefix PATH : ${lib.makeBinPath [ ffmpeg-headless ]}
'';
passthru = {
tests.navidrome = nixosTests.navidrome;
updateScript = nix-update-script { };
};
meta = {
description = "Navidrome Music Server and Streamer compatible with Subsonic/Airsonic";
mainProgram = "navidrome";
homepage = "https://www.navidrome.org/";
license = lib.licenses.gpl3Only;
sourceProvenance = with lib.sourceTypes; [ fromSource ];
maintainers = with lib.maintainers; [
aciceri
squalus
];
# Broken on Darwin: sandbox-exec: pattern serialization length exceeds maximum (NixOS/nix#4119)
broken = stdenv.hostPlatform.isDarwin;
};
}