Merge pull request #329823 from ExpidusOS/fix/pkgsllvm/elfutils
[NixPkgs.git] / pkgs / servers / prowlarr / default.nix
blob3573faf1b4f2ecd2d9685df8a1a67c4fd4e1df91
1 { lib, stdenv, fetchurl, mono, libmediainfo, sqlite, curl, makeWrapper, icu, dotnet-runtime, openssl, nixosTests, zlib }:
3 let
4   pname = "prowlarr";
6   unsupported = throw "Unsupported system ${stdenv.hostPlatform.system} for ${pname}";
8   os =
9     if stdenv.isDarwin then
10       "osx"
11     else if stdenv.isLinux then
12       "linux"
13     else
14       unsupported;
16   arch = {
17     aarch64-darwin = "arm64";
18     aarch64-linux = "arm64";
19     x86_64-darwin = "x64";
20     x86_64-linux = "x64";
21   }.${stdenv.hostPlatform.system} or unsupported;
23   hash = {
24     aarch64-darwin = "sha256-LmRF4hXVbjYj/4v4SKwBm5lRFUuHv11h3tmWo2vOskQ=";
25     aarch64-linux = "sha256-fj0E1lcCLJs4jQwQQBmbh6uts0axubhxDz7kn1Qzuk4=";
26     x86_64-darwin = "sha256-1P+R9MBaWsLYVST+WlyI7TH+1ZmB90J9P2IP2WVZEvE=";
27     x86_64-linux = "sha256-V0MNjLswcxtyU7kl7Gn5474SGSAfwUVHbJcsYVE4WfY=";
28   }.${stdenv.hostPlatform.system} or unsupported;
30 in stdenv.mkDerivation rec {
31   inherit pname;
32   version = "1.20.1.4603";
34   src = fetchurl {
35     url = "https://github.com/Prowlarr/Prowlarr/releases/download/v${version}/Prowlarr.master.${version}.${os}-core-${arch}.tar.gz";
36     inherit hash;
37   };
39   nativeBuildInputs = [ makeWrapper ];
41   installPhase = ''
42     runHook preInstall
44     mkdir -p $out/{bin,share/${pname}-${version}}
45     cp -r * $out/share/${pname}-${version}/.
47     makeWrapper "${dotnet-runtime}/bin/dotnet" $out/bin/Prowlarr \
48       --add-flags "$out/share/${pname}-${version}/Prowlarr.dll" \
49       --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [
50         curl sqlite libmediainfo mono openssl icu zlib ]}
52     runHook postInstall
53   '';
55   passthru = {
56     updateScript = ./update.sh;
57     tests.smoke-test = nixosTests.prowlarr;
58   };
60   meta = with lib; {
61     description = "Indexer manager/proxy built on the popular arr .net/reactjs base stack";
62     homepage = "https://wiki.servarr.com/prowlarr";
63     changelog = "https://github.com/Prowlarr/Prowlarr/releases/tag/v${version}";
64     license = licenses.gpl3Only;
65     maintainers = with maintainers; [ jdreaver ];
66     mainProgram = "Prowlarr";
67     platforms = [
68       "aarch64-darwin"
69       "aarch64-linux"
70       "x86_64-darwin"
71       "x86_64-linux"
72     ];
73   };