ogre: 14.3.3 -> 14.3.4 (#380101)
[NixPkgs.git] / pkgs / by-name / pr / prowlarr / package.nix
blob148d6baf185a2ea45e8d720255f369ec3391f148
2   lib,
3   stdenv,
4   fetchurl,
5   mono,
6   libmediainfo,
7   sqlite,
8   curl,
9   makeWrapper,
10   icu,
11   dotnet-runtime,
12   openssl,
13   nixosTests,
14   zlib,
16 let
17   pname = "prowlarr";
19   unsupported = throw "Unsupported system ${stdenv.hostPlatform.system} for ${pname}";
21   os =
22     if stdenv.hostPlatform.isDarwin then
23       "osx"
24     else if stdenv.hostPlatform.isLinux then
25       "linux"
26     else
27       unsupported;
29   arch =
30     {
31       aarch64-darwin = "arm64";
32       aarch64-linux = "arm64";
33       x86_64-darwin = "x64";
34       x86_64-linux = "x64";
35     }
36     .${stdenv.hostPlatform.system} or unsupported;
38   hash =
39     {
40       aarch64-darwin = "sha256-F6q0JFiwESTenh9xAjqoqqQh911d8DMEWYm3CrYHoxI=";
41       aarch64-linux = "sha256-izh5er3uLUKFMjUCiZYBqtS9sosicSCo+qvavcnX/6s=";
42       x86_64-darwin = "sha256-BLklmXj8UbN8jjEXnHe1xsr2fF5H1enwztbKDU3IpPU=";
43       x86_64-linux = "sha256-aiH4bv47cnBzUtFwfJfmrY+2LaqgZkRXT2Jx8FkSX7M=";
44     }
45     .${stdenv.hostPlatform.system} or unsupported;
47 stdenv.mkDerivation rec {
48   inherit pname;
49   version = "1.30.2.4939";
51   src = fetchurl {
52     url = "https://github.com/Prowlarr/Prowlarr/releases/download/v${version}/Prowlarr.master.${version}.${os}-core-${arch}.tar.gz";
53     inherit hash;
54   };
56   nativeBuildInputs = [ makeWrapper ];
58   installPhase = ''
59     runHook preInstall
61     mkdir -p $out/{bin,share/${pname}-${version}}
62     cp -r * $out/share/${pname}-${version}/.
64     makeWrapper "${dotnet-runtime}/bin/dotnet" $out/bin/Prowlarr \
65       --add-flags "$out/share/${pname}-${version}/Prowlarr.dll" \
66       --prefix LD_LIBRARY_PATH : ${
67         lib.makeLibraryPath [
68           curl
69           sqlite
70           libmediainfo
71           mono
72           openssl
73           icu
74           zlib
75         ]
76       }
78     runHook postInstall
79   '';
81   passthru = {
82     updateScript = ./update.sh;
83     tests.smoke-test = nixosTests.prowlarr;
84   };
86   meta = with lib; {
87     description = "Indexer manager/proxy built on the popular arr .net/reactjs base stack";
88     homepage = "https://wiki.servarr.com/prowlarr";
89     changelog = "https://github.com/Prowlarr/Prowlarr/releases/tag/v${version}";
90     license = licenses.gpl3Only;
91     maintainers = with maintainers; [ pizzapim ];
92     mainProgram = "Prowlarr";
93     platforms = [
94       "aarch64-darwin"
95       "aarch64-linux"
96       "x86_64-darwin"
97       "x86_64-linux"
98     ];
99   };