diff --git a/pkgs/applications/networking/testssl/default.nix b/pkgs/applications/networking/testssl/default.nix index 97c05dfafdb..5a548d5ff65 100644 --- a/pkgs/applications/networking/testssl/default.nix +++ b/pkgs/applications/networking/testssl/default.nix @@ -1,9 +1,8 @@ -{ stdenv, fetchFromGitHub, pkgs }: +{ stdenv, fetchFromGitHub, makeWrapper, lib +, dnsutils, coreutils, openssl, nettools, utillinux, procps }: let - version = "2.9.5-4"; - pwdBinPath = "${stdenv.lib.makeBinPath (with pkgs; [ coreutils ])}/pwd"; - opensslBinPath = "${stdenv.lib.makeBinPath (with pkgs; [ openssl ])}/openssl"; + version = "2.9.5-5"; in stdenv.mkDerivation rec { name = "testssl.sh-${version}"; @@ -12,22 +11,32 @@ in stdenv.mkDerivation rec { owner = "drwetter"; repo = "testssl.sh"; rev = "v${version}"; - sha256 = "0pfp7r4jhvkh06vawqlvq7vp4imwp6dpq6jx8m0k3j85ywwp45pd"; + sha256 = "0zgj9vhd8fv3a1cn8dxqmjd8qmgryc867gq7zbvbr41lkqc06a1r"; }; - patches = [ ./testssl.patch ]; + nativeBuildInputs = [ makeWrapper ]; + buildInputs = [ + coreutils # for pwd and printf + dnsutils # for dig + nettools # for hostname + openssl # for openssl + procps # for ps + utillinux # for hexdump + ]; postPatch = '' substituteInPlace testssl.sh \ - --replace /bin/pwd ${pwdBinPath} \ - --replace TESTSSL_INSTALL_DIR:-\"\" TESTSSL_INSTALL_DIR:-\"$out\" \ - --replace @@openssl-path@@ ${opensslBinPath} + --replace /bin/pwd pwd \ + --replace TESTSSL_INSTALL_DIR:-\"\" TESTSSL_INSTALL_DIR:-\"$out\" ''; installPhase = '' - mkdir -p $out/bin $out/etc - cp -r etc/ $out/ - cp testssl.sh $out/bin/testssl.sh + install -Dt $out/bin testssl.sh + + wrapProgram $out/bin/testssl.sh \ + --prefix PATH ':' ${lib.makeBinPath buildInputs} + + cp -r etc $out ''; meta = with stdenv.lib; { @@ -38,6 +47,6 @@ in stdenv.mkDerivation rec { ''; homepage = https://testssl.sh/; license = licenses.gpl2; - maintainers = [ maintainers.etu ]; + maintainers = with maintainers; [ etu ]; }; } diff --git a/pkgs/applications/networking/testssl/testssl.patch b/pkgs/applications/networking/testssl/testssl.patch deleted file mode 100644 index ffc9e4b1c16..00000000000 --- a/pkgs/applications/networking/testssl/testssl.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- testssl/testssl.sh 2017-09-24 16:53:29.395263437 +0200 -+++ testssl-new/testssl.sh 2017-09-24 16:53:41.221154492 +0200 -@@ -165,6 +165,7 @@ - # following variables make use of $ENV, e.g. OPENSSL= ./testssl.sh - # 0 means (normally) true here. Some of the variables are also accessible with a command line switch, see --help - declare -x OPENSSL OPENSSL_TIMEOUT -+OPENSSL=${OPENSSL:-"@@openssl-path@@"} - FAST_SOCKET=${FAST_SOCKET:-false} # EXPERIMENTAL feature to accelerate sockets -- DO NOT USE it for production - COLOR=${COLOR:-2} # 2: Full color, 1: b/w+positioning, 0: no ESC at all - COLORBLIND=${COLORBLIND:-false} # if true, swap blue and green in the output