Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at netboot-syslinux-multiplatform 87 lines 2.0 kB view raw
1{ buildGoModule 2, fetchFromGitHub 3, fetchNpmDeps 4, lib 5, nodejs 6, npmHooks 7, pkg-config 8, stdenv 9, ffmpeg-headless 10, taglib 11, zlib 12, makeWrapper 13, nixosTests 14, nix-update-script 15, ffmpegSupport ? true 16}: 17 18buildGoModule rec { 19 pname = "navidrome"; 20 version = "0.49.3"; 21 22 src = fetchFromGitHub { 23 owner = "navidrome"; 24 repo = "navidrome"; 25 rev = "v${version}"; 26 hash = "sha256-JBvY+0QAouEc0im62aVSJ27GAB7jt0qVnYtc6VN2qTA="; 27 }; 28 29 vendorHash = "sha256-C8w/qCts8VqNDTQVXtykjmSbo5uDrvS9NOu3SHpAlDE="; 30 31 npmRoot = "ui"; 32 33 npmDeps = fetchNpmDeps { 34 inherit src; 35 sourceRoot = "source/ui"; 36 hash = "sha256-qxwTiXLmZnTnmTSBmWPjeFCP7qzvTFN0xXp5lFkWFog="; 37 }; 38 39 nativeBuildInputs = [ 40 makeWrapper 41 nodejs 42 npmHooks.npmConfigHook 43 pkg-config 44 ]; 45 46 overrideModAttrs = oldAttrs: { 47 nativeBuildInputs = lib.filter (drv: drv != npmHooks.npmConfigHook) oldAttrs.nativeBuildInputs; 48 preBuild = null; 49 }; 50 51 buildInputs = [ 52 taglib 53 zlib 54 ]; 55 56 ldflags = [ 57 "-X github.com/navidrome/navidrome/consts.gitSha=${src.rev}" 58 "-X github.com/navidrome/navidrome/consts.gitTag=v${version}" 59 ]; 60 61 CGO_CFLAGS = lib.optionals stdenv.cc.isGNU [ "-Wno-return-local-addr" ]; 62 63 preBuild = '' 64 make buildjs 65 ''; 66 67 postFixup = lib.optionalString ffmpegSupport '' 68 wrapProgram $out/bin/navidrome \ 69 --prefix PATH : ${lib.makeBinPath [ ffmpeg-headless ]} 70 ''; 71 72 passthru = { 73 tests.navidrome = nixosTests.navidrome; 74 updateScript = nix-update-script { }; 75 }; 76 77 meta = { 78 description = "Navidrome Music Server and Streamer compatible with Subsonic/Airsonic"; 79 homepage = "https://www.navidrome.org/"; 80 license = lib.licenses.gpl3Only; 81 sourceProvenance = with lib.sourceTypes; [ fromSource ]; 82 platforms = lib.platforms.unix; 83 maintainers = with lib.maintainers; [ aciceri squalus ]; 84 # Broken on Darwin: sandbox-exec: pattern serialization length exceeds maximum (NixOS/nix#4119) 85 broken = stdenv.isDarwin; 86 }; 87}