Merge pull request #330634 from r-ryantm/auto-update/circumflex
[NixPkgs.git] / pkgs / servers / nzbhydra2 / default.nix
blob080a147931ed9d0b4240808a166ec6cf3bbf2434
2   lib,
3   stdenv,
4   fetchzip,
5   makeWrapper,
6   jre,
7   python3,
8   unzip,
9 }:
10 stdenv.mkDerivation rec {
11   pname = "nzbhydra2";
12   version = "7.3.0";
14   src = fetchzip {
15     url = "https://github.com/theotherp/${pname}/releases/download/v${version}/${pname}-${version}-generic.zip";
16     hash = "sha256-ybI6nCw8yY2XceXiMkION7/p7gl58lrAPpUq6EpManU=";
17     stripRoot = false;
18   };
20   nativeBuildInputs = [
21     jre
22     makeWrapper
23     unzip
24   ];
26   installPhase = ''
27     runHook preInstall
29     install -d -m 755 "$out/lib/${pname}"
30     cp -dpr --no-preserve=ownership "lib" "readme.md" "$out/lib/nzbhydra2"
31     install -D -m 755 "nzbhydra2wrapperPy3.py" "$out/lib/nzbhydra2/nzbhydra2wrapperPy3.py"
33     makeWrapper ${python3}/bin/python $out/bin/nzbhydra2 \
34       --add-flags "$out/lib/nzbhydra2/nzbhydra2wrapperPy3.py" \
35       --prefix PATH ":" ${jre}/bin
37     runHook postInstall
38   '';
40   meta = {
41     description = "Usenet meta search";
42     homepage = "https://github.com/theotherp/nzbhydra2";
43     license = lib.licenses.asl20;
44     maintainers = with lib.maintainers; [ matteopacini ];
45     platforms = lib.platforms.linux;
46     mainProgram = "nzbhydra2";
47   };