forgejo-lts: 7.0.10 -> 7.0.11
[NixPkgs.git] / pkgs / by-name / re / readarr / package.nix
blob42515cd443c551495f0c70bee2e06593ba4f7eae
1 { lib, stdenv, fetchurl, libmediainfo, sqlite, curl, makeWrapper, icu, dotnet-runtime, openssl, nixosTests, zlib }:
3 let
4   os = if stdenv.hostPlatform.isDarwin then "osx" else "linux";
5   arch = {
6     x86_64-linux = "x64";
7     aarch64-linux = "arm64";
8     x86_64-darwin = "x64";
9   }."${stdenv.hostPlatform.system}" or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
10   hash = {
11     x64-linux_hash = "sha256-VI0mdNGPyT45GUrp3hpBQVe1xx/BBbMWz7iJQvvrg9E=";
12     arm64-linux_hash = "sha256-4ahiRo13qOEUSzrwXFVRj26U0l5GblXfw7sjY8sCLxQ=";
13     x64-osx_hash = "sha256-1HtarF+eAU2d3dQiw3n/DCIFCbgN4GEUFMlYxy8uglA=";
14   }."${arch}-${os}_hash";
15 in stdenv.mkDerivation rec {
16   pname = "readarr";
17   version = "0.4.3.2665";
19   src = fetchurl {
20     url = "https://github.com/Readarr/Readarr/releases/download/v${version}/Readarr.develop.${version}.${os}-core-${arch}.tar.gz";
21     sha256 = hash;
22   };
24   nativeBuildInputs = [ makeWrapper ];
26   installPhase = ''
27     runHook preInstall
29     mkdir -p $out/{bin,share/${pname}-${version}}
30     cp -r * $out/share/${pname}-${version}/.
31     makeWrapper "${dotnet-runtime}/bin/dotnet" $out/bin/Readarr \
32       --add-flags "$out/share/${pname}-${version}/Readarr.dll" \
33       --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ curl sqlite libmediainfo icu openssl zlib ]}
35     runHook postInstall
36   '';
39   passthru = {
40     updateScript = ./update.sh;
41     tests.smoke-test = nixosTests.readarr;
42   };
44   meta = {
45     description = "Usenet/BitTorrent ebook downloader";
46     homepage = "https://readarr.com";
47     license = lib.licenses.gpl3;
48     maintainers = with lib.maintainers; [ jocelynthode devusb ];
49     mainProgram = "Readarr";
50     sourceProvenance = with lib.sourceTypes; [ binaryBytecode ];
51     platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" ];
52   };