diff --git a/pkgs/tools/networking/nzbget/default.nix b/pkgs/by-name/nz/nzbget/package.nix similarity index 55% rename from pkgs/tools/networking/nzbget/default.nix rename to pkgs/by-name/nz/nzbget/package.nix index 19323e18fc5d7..165ee6dfc827a 100644 --- a/pkgs/tools/networking/nzbget/default.nix +++ b/pkgs/by-name/nz/nzbget/package.nix @@ -1,7 +1,8 @@ { lib , stdenv , fetchFromGitHub -, autoreconfHook +, fetchpatch2 +, cmake , boost , pkg-config , gnutls @@ -13,21 +14,30 @@ , ncurses , openssl , zlib +, deterministic-uname , nixosTests }: stdenv.mkDerivation (finalAttrs: { pname = "nzbget"; - version = "24.1"; + version = "24.2"; src = fetchFromGitHub { owner = "nzbgetcom"; repo = "nzbget"; rev = "v${finalAttrs.version}"; - hash = "sha256-HovfnTsgu07/lp/spI+iA8H7lOj0Qyrri2MOJKyMKHQ="; + hash = "sha256-+iJ5n/meBrMxKHSLxL5QJ7+TI0RMfAM5n/8dwYupGoU="; }; - nativeBuildInputs = [ autoreconfHook pkg-config ]; + patches = [ + (fetchpatch2 { + # status page buffer overflow fix: https://github.com/nzbgetcom/nzbget/pull/346 -- remove when version > 24.2 + url = "https://github.com/nzbgetcom/nzbget/commit/f89978f7479cbb0ff2f96c8632d9d2f31834e6c8.patch"; + hash = "sha256-9K7PGzmoZ8cvEKBm5htfw5fr1GBSddNkDC/Vi4ngRto="; + }) + ]; + + nativeBuildInputs = [ cmake pkg-config ]; buildInputs = [ boost @@ -42,8 +52,13 @@ stdenv.mkDerivation (finalAttrs: { zlib ]; - prePatch = '' - sed -i 's/AC_INIT.*/AC_INIT( nzbget, m4_esyscmd_s( echo ${finalAttrs.version} ) )/' configure.ac + postPatch = '' + substituteInPlace daemon/util/Util.cpp \ + --replace-fail "std::string(\"uname \")" "std::string(\"${lib.getExe deterministic-uname} \")" + ''; + + postInstall = '' + install -Dm444 nzbget.conf $out/share/nzbget/nzbget.conf ''; enableParallelBuilding = true; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0420320704d30..8391bf9fc2f3d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10931,8 +10931,6 @@ with pkgs; inherit (darwin.apple_sdk.frameworks) Security CoreServices; }; - nzbget = callPackage ../tools/networking/nzbget { }; - oapi-codegen = callPackage ../tools/networking/oapi-codegen { }; oath-toolkit = callPackage ../tools/security/oath-toolkit { };