From faf0f4fa13c969c9de71642acf56133ad9937107 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 27 Apr 2024 23:03:46 +0200 Subject: [PATCH 1/2] rustscan: refactor --- pkgs/tools/security/rustscan/default.nix | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/pkgs/tools/security/rustscan/default.nix b/pkgs/tools/security/rustscan/default.nix index 5189b7c882b7..d08b44f00f3e 100644 --- a/pkgs/tools/security/rustscan/default.nix +++ b/pkgs/tools/security/rustscan/default.nix @@ -1,4 +1,12 @@ -{ lib, rustPlatform, fetchCrate, nmap, stdenv, Security, perl, python3 }: +{ lib +, stdenv +, rustPlatform +, fetchCrate +, nmap +, Security +, perl +, python3 +}: rustPlatform.buildRustPackage rec { pname = "rustscan"; @@ -6,14 +14,14 @@ rustPlatform.buildRustPackage rec { src = fetchCrate { inherit pname version; - sha256 = "sha256-yGVhbI1LivTIQEgqOK59T1+8SiTJBPIdftiXkwE4lZM="; + hash = "sha256-yGVhbI1LivTIQEgqOK59T1+8SiTJBPIdftiXkwE4lZM="; }; - cargoSha256 = "sha256-UR3ktV80QU0N3f7qmqdhYpc5uwoPq4UvN40zEuMbp+Q="; + cargoHash = "sha256-UR3ktV80QU0N3f7qmqdhYpc5uwoPq4UvN40zEuMbp+Q="; postPatch = '' substituteInPlace src/scripts/mod.rs \ - --replace 'call_format = "nmap' 'call_format = "${nmap}/bin/nmap' + --replace-fail 'call_format = "nmap' 'call_format = "${nmap}/bin/nmap' patchShebangs fixtures/.rustscan_scripts/* ''; @@ -29,9 +37,10 @@ rustPlatform.buildRustPackage rec { meta = with lib; { description = "Faster Nmap Scanning with Rust"; - mainProgram = "rustscan"; homepage = "https://github.com/RustScan/RustScan"; + changelog = "https://github.com/RustScan/RustScan/releases/tag/${version}"; license = licenses.gpl3Only; maintainers = with maintainers; [ figsoda ]; + mainProgram = "rustscan"; }; } From 948a518ccb76b3d529ea6c052a1c7860ce08cc04 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 28 Apr 2024 09:31:01 +0200 Subject: [PATCH 2/2] rustscan: 2.1.1 -> 2.2.2 Diff: https://github.com/RustScan/RustScan/compare/refs/tags/2.1.1...2.2.2 Changelog: https://github.com/RustScan/RustScan/releases/tag/2.2.2 --- pkgs/tools/security/rustscan/default.nix | 36 ++++++++++++++---------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/pkgs/tools/security/rustscan/default.nix b/pkgs/tools/security/rustscan/default.nix index d08b44f00f3e..238fa8fcc5e3 100644 --- a/pkgs/tools/security/rustscan/default.nix +++ b/pkgs/tools/security/rustscan/default.nix @@ -1,23 +1,26 @@ -{ lib -, stdenv -, rustPlatform -, fetchCrate -, nmap -, Security -, perl -, python3 +{ + lib, + stdenv, + fetchFromGitHub, + nmap, + perl, + python3, + rustPlatform, + Security, }: rustPlatform.buildRustPackage rec { pname = "rustscan"; - version = "2.1.1"; + version = "2.2.2"; - src = fetchCrate { - inherit pname version; - hash = "sha256-yGVhbI1LivTIQEgqOK59T1+8SiTJBPIdftiXkwE4lZM="; + src = fetchFromGitHub { + owner = "RustScan"; + repo = "RustScan"; + rev = "refs/tags/${version}"; + hash = "sha256-67XNEKzR72NOYlPbz2E9yf+THa1XN6muFJG2/iJa8AU="; }; - cargoHash = "sha256-UR3ktV80QU0N3f7qmqdhYpc5uwoPq4UvN40zEuMbp+Q="; + cargoHash = "sha256-U9Kn9xAG+emyi8cWUCNP32z7f19MK8AGgGR6vFJd62Q="; postPatch = '' substituteInPlace src/scripts/mod.rs \ @@ -27,10 +30,13 @@ rustPlatform.buildRustPackage rec { buildInputs = lib.optional stdenv.isDarwin Security; - nativeCheckInputs = [ perl python3 ]; + nativeCheckInputs = [ + perl + python3 + ]; - # these tests require network access checkFlags = [ + # These tests require network access "--skip=parse_correct_host_addresses" "--skip=parse_hosts_file_and_incorrect_hosts" ];