From 4e7b4a533248c5a47eae337453f53a6adab413fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Reu=C3=9Fe?= Date: Wed, 6 Jul 2022 16:44:47 +0200 Subject: [PATCH 1/3] maintainers: add eigengrau --- maintainers/maintainer-list.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index be0cfb4930ca..f012c1b4495d 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -3744,6 +3744,12 @@ githubId = 537775; name = "Emery Hemingway"; }; + eigengrau = { + email = "seb@schattenkopie.de"; + name = "Sebastian Reuße"; + github = "eigengrau"; + githubId = 4939947; + }; eikek = { email = "eike.kettner@posteo.de"; github = "eikek"; From 8d9ea37e808595ccf70da2aeb3e8849574a6cbc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Reu=C3=9Fe?= Date: Sat, 9 Jul 2022 18:39:07 +0200 Subject: [PATCH 2/3] sgrep: init at 1.94a --- pkgs/tools/text/sgrep/default.nix | 31 +++++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 33 insertions(+) create mode 100644 pkgs/tools/text/sgrep/default.nix diff --git a/pkgs/tools/text/sgrep/default.nix b/pkgs/tools/text/sgrep/default.nix new file mode 100644 index 000000000000..d7dc04645c33 --- /dev/null +++ b/pkgs/tools/text/sgrep/default.nix @@ -0,0 +1,31 @@ +{ stdenv, fetchurl, lib, m4, makeWrapper }: + +stdenv.mkDerivation rec { + pname = "sgrep"; + version = "1.94a"; + + src = fetchurl { + url = "https://www.cs.helsinki.fi/pub/Software/Local/Sgrep/sgrep-${version}.tar.gz"; + sha256 = "sha256-1bFkeOOrRHNeJCg9LYldLJyAE5yVIo3zvbKsRGOV+vk="; + }; + + nativeBuildInputs = [ makeWrapper ]; + + postInstall = '' + wrapProgram $out/bin/sgrep \ + --prefix PATH : ${lib.makeBinPath [ m4 ]} + ''; + + meta = with lib; { + homepage = "https://www.cs.helsinki.fi/u/jjaakkol/sgrep.html"; + description = "A grep for structured text formats such as XML"; + longDescription = '' + sgrep (structured grep) is a tool for searching and indexing text, + SGML, XML and HTML files and filtering text streams using + structural criteria. + ''; + platforms = platforms.unix; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ eigengrau ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f0f42fc7ef6d..ed211fb74c07 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1296,6 +1296,8 @@ with pkgs; sdlookup = callPackage ../tools/security/sdlookup { }; + sgrep = callPackage ../tools/text/sgrep { }; + smbscan = callPackage ../tools/security/smbscan { }; spectre-cli = callPackage ../tools/security/spectre-cli { }; From 37681056c20e48fdbca2e0c4701fe4d09d2afbc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Reu=C3=9Fe?= Date: Sat, 9 Jul 2022 18:50:01 +0200 Subject: [PATCH 3/3] sgrep: add smoke test --- pkgs/tools/text/sgrep/default.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/text/sgrep/default.nix b/pkgs/tools/text/sgrep/default.nix index d7dc04645c33..f3d23d166696 100644 --- a/pkgs/tools/text/sgrep/default.nix +++ b/pkgs/tools/text/sgrep/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, lib, m4, makeWrapper }: +{ stdenv, sgrep, fetchurl, runCommand, lib, m4, makeWrapper }: stdenv.mkDerivation rec { pname = "sgrep"; @@ -16,6 +16,14 @@ stdenv.mkDerivation rec { --prefix PATH : ${lib.makeBinPath [ m4 ]} ''; + passthru.tests.smokeTest = runCommand "test-sgrep" { } '' + expr='"" __ ""' + data="12" + ${sgrep}/bin/sgrep "$expr" <<<$data >$out + read result <$out + [[ $result = 1 ]] + ''; + meta = with lib; { homepage = "https://www.cs.helsinki.fi/u/jjaakkol/sgrep.html"; description = "A grep for structured text formats such as XML";