From 67f989dc5ed9d7ca7265b268bc0037f737318389 Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Fri, 7 Aug 2020 15:12:54 +1200 Subject: [PATCH] jackett: 0.16.175 -> 0.16.998, switch to Mono, adding Darwin support --- pkgs/servers/jackett/default.nix | 42 ++++++++++---------------------- 1 file changed, 13 insertions(+), 29 deletions(-) diff --git a/pkgs/servers/jackett/default.nix b/pkgs/servers/jackett/default.nix index aaa762836bdd..f5b1c547921f 100644 --- a/pkgs/servers/jackett/default.nix +++ b/pkgs/servers/jackett/default.nix @@ -1,39 +1,23 @@ -{ lib, stdenv, fetchurl, makeWrapper, curl, icu60, openssl, zlib }: +{ lib, stdenv, fetchurl, mono, makeWrapper, curl, icu60, openssl, zlib }: stdenv.mkDerivation rec { pname = "jackett"; - version = "0.16.175"; + version = "0.16.998"; - src = { - x86_64-linux = fetchurl { - url = "https://github.com/Jackett/Jackett/releases/download/v${version}/Jackett.Binaries.LinuxAMDx64.tar.gz"; - sha512 = "269n84qc8sfrmnidgrjywanbqr65mhkmk24dlqfi17pi0l27wi4fc4qmnjj683xwprz5hqjsmkqf963pbx4k3jaz0rp0jnizan91wij"; - }; - aarch64-linux = fetchurl { - url = "https://github.com/Jackett/Jackett/releases/download/v${version}/Jackett.Binaries.LinuxARM64.tar.gz"; - sha512 = "0dmyhprd2vi2z9q5g79psqgsc3w0zdac4s6k20rngi8jxm5jgphzrzcic4rgdijyryap99my619k447w701a08vh9sfcfk0fjg9pgwb"; - }; - }."${stdenv.targetPlatform.system}" or (throw "Missing hash for host system: ${stdenv.targetPlatform.system}"); + src = fetchurl { + url = "https://github.com/Jackett/Jackett/releases/download/v${version}/Jackett.Binaries.Mono.tar.gz"; + sha256 = "16f8ipw4sbdxwv79zjhr5ihd3m6biyhj1gj7cqpjr34ad7zqna3c"; + }; - buildInputs = [ makeWrapper ]; + nativeBuildInputs = [ makeWrapper ]; installPhase = '' - mkdir -p $out/{bin,opt/${pname}-${version}} - cp -r * $out/opt/${pname}-${version} + mkdir -p $out/{bin,share/${pname}-${version}} + cp -r * $out/share/${pname}-${version} - makeWrapper "$out/opt/${pname}-${version}/jackett" $out/bin/Jackett \ - --prefix LD_LIBRARY_PATH ':' "${curl.out}/lib:${icu60.out}/lib:${openssl.out}/lib:${zlib.out}/lib" - ''; - - preFixup = let - libPath = lib.makeLibraryPath [ - stdenv.cc.cc.lib # libstdc++.so.6 - ]; - in '' - patchelf \ - --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ - --set-rpath "${libPath}" \ - $out/opt/${pname}-${version}/jackett + makeWrapper "${mono}/bin/mono" $out/bin/Jackett \ + --add-flags "$out/share/${pname}-${version}/JackettConsole.exe" \ + --prefix LD_LIBRARY_PATH : ${stdenv.lib.makeLibraryPath [ curl icu60 openssl zlib ]} ''; meta = with stdenv.lib; { @@ -41,6 +25,6 @@ stdenv.mkDerivation rec { homepage = "https://github.com/Jackett/Jackett/"; license = licenses.gpl2; maintainers = with maintainers; [ edwtjo nyanloutre ]; - platforms = [ "x86_64-linux" "aarch64-linux" ]; + platforms = platforms.all; }; }