Subject: [bug#46685] [PATCH] started whatweb

From: rdes <[email-masked]>
Date: Sun, 21 Feb 2021 13:39:04 +0000

Hello,

I've attached the following patches looking for feedback on how to resolve the following error I get when running `./pre-inst-env guix build whatweb`.

#+begin_example
starting phase `replace-git-ls-files'
Backtrace:
8 (primitive-load "/gnu/store/dznkg7ciirpr9crslkn73cql4mk…")
In ice-9/eval.scm:
191:35 7 (_ _)
In guix/build/gnu-build-system.scm:
838:2 6 (gnu-build #:source _ #:outputs _ #:inputs _ #:phases . #)
In ice-9/boot-9.scm:
1736:10 5 (with-exception-handler _ _ #:unwind? _ # _)
In srfi/srfi-1.scm:
857:16 4 (every1 #<procedure 7ffff3facae0 at guix/build/gnu-bui…> …)
In guix/build/gnu-build-system.scm:
847:30 3 (_ _)
In guix/build/ruby-build-system.scm:
72:2 2 (replace-git-ls-files #:source _)
45:8 1 (first-matching-file _)
In ice-9/boot-9.scm:
1669:16 0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1669:16: In procedure raise-exception:
No files matching pattern: "\\.gemspec$"
#+end_example

Also, I wasn't sure if bundler-audit should be named ruby-bundler-audit. The bundler package didn't start with 'ruby-' so I left it off for bundler-audit as well, but can change it if it's wrong.

Both 'bundler-audit' and 'ruby-ippaddr' can be built without issues.

Thanks,
Ryan Desfosses

Sent with [ProtonMail](https://protonmail.com) Secure Email.

From 754354c9280bf36c234fa954fd7ce81460812629 Mon Sep 17 00:00:00 2001
From: Ryan Desfosses <[email-masked]>
Date: Sat, 20 Feb 2021 15:36:39 -0500
Subject: [PATCH 3/3] Added whatweb and added copyright lines

---
 gnu/packages/cybersecurity.scm | 39 ++++++++++++++++++++++++++++++++++
 gnu/packages/networking.scm    | 14 +++++++-----
 gnu/packages/ruby.scm          |  1 +
 3 files changed, 49 insertions(+), 5 deletions(-)

diff --git a/gnu/packages/cybersecurity.scm b/gnu/packages/cybersecurity.scm
index e13c342342..7a49e89e44 100644
--- a/gnu/packages/cybersecurity.scm
+++ b/gnu/packages/cybersecurity.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2020 Jakub Kądziołka <[email-masked]>
 ;;; Copyright © 2020, 2021 Tobias Geerinckx-Rice <[email-masked]>
+;;; Copyright © 2021 Ryan Desfosses <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -19,9 +20,12 @@
 
 (define-module (gnu packages cybersecurity)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix packages)
+  #:use-module (gnu packages ruby)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system ruby)
   #:use-module (gnu packages engineering))
 
 (define-public ropgadget
@@ -44,3 +48,38 @@
 gadgets in binaries.  Some facilities are included for automatically generating
 chains of gadgets to execute system calls.")
     (license license:bsd-3)))
+
+(define-public whatweb
+  (package
+    (name "whatweb")
+    (version "0.5.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/urbanadventurer/WhatWeb")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "108426k32rj134ddbbi4rmxikp37g93j64pf7hd7zwh23vkpkc8w"))))
+    (build-system ruby-build-system)
+    (arguments
+     `(#:tests? #f)); FIXME: No files matching pattern:  "\\.gemspec$"
+    (propagated-inputs
+     `(("ruby-addressable" ,ruby-addressable)
+       ("ruby-json" ,ruby-json)
+       ("ruby-ipaddr" ,ruby-ipaddr)))
+    (native-inputs
+     `(("ruby-rake" ,ruby-rake)
+       ("ruby-minitest" ,ruby-minitest)
+       ("ruby-rubocop" ,ruby-rubocop)
+       ("ruby-rdoc" ,ruby-rdoc)
+       ("ruby-coderay" ,ruby-coderay)
+       ("budler-audit" ,bundler-audit)
+       ("ruby-simplecov" ,ruby-simplecov)))
+    (synopsis "Web scanner")
+    (description "Identify the technology stack that powers a website
+ and explore the Web of Things.")
+    (home-page "https://morningstarsecurity.com/research/whatweb")
+    (license license:gpl2)))
diff --git a/gnu/packages/networking.scm b/gnu/packages/networking.scm
index 804d4dce0c..c7955abebb 100644
--- a/gnu/packages/networking.scm
+++ b/gnu/packages/networking.scm
@@ -1426,6 +1426,13 @@ network frames.")
     (home-page "https://www.wireshark.org/")
     (license license:gpl2+)))
 
+(define-public tshark
+  (package
+    (inherit wireshark)
+    (name "tshark")
+    (arguments
+     `(#:configure-flags '("-DBUILD_wireshark=OFF")))))
+
 (define-public fping
   (package
     (name "fping")
@@ -1454,13 +1461,13 @@ round-robin fashion.")
 (define-public gandi.cli
   (package
     (name "gandi.cli")
-    (version "1.6")
+    (version "1.5")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri name version))
        (sha256
-        (base32 "1h36jahbp7273wn3yd747kbiwjc0bm3sja67bcxdsd54ln0vyndg"))))
+        (base32 "110wc9zgxsrvw4yzp21p0ian5lcf7vhcpxhnmsc4fg9pzl2bwxd5"))))
     (build-system python-build-system)
     (arguments
      `(#:phases
@@ -1484,11 +1491,8 @@ round-robin fashion.")
                #t))))))
     (native-inputs
      `(("python-docutils" ,python-docutils)   ; for rst2man.py
-       ("python-pytest" ,python-pytest)
        ("python-pytest-cov" ,python-pytest-cov)
        ("python-tox" ,python-tox)))
-    (propagated-inputs
-     `(("openssh" ,openssh)))           ; used by gandi/cli/modules/iass.py
     (inputs
      `(("openssl" ,openssl)
        ("python-click" ,python-click)
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 5be7638600..85bb626a70 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -26,6 +26,7 @@
 ;;; Copyright © 2020 Holgr Peters <[email-masked]>
 ;;; Copyright © 2020 Giacomo Leidi <[email-masked]>
 ;;; Copyright © 2021 EuAndreh <[email-masked]>
+;;; Copyright © 2021 Ryan Desfosses <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
-- 
2.30.1

From 065ecf9b2e5bc5b1b8665c44aeae2c62e6c12492 Mon Sep 17 00:00:00 2001
From: Ryan Desfosses <[email-masked]>
Date: Sat, 20 Feb 2021 14:32:22 -0500
Subject: [PATCH 2/3] gnu: Add bundler-audit

* gnu/packages/ruby.scm (bundler-audit): New variable.
---
 gnu/packages/ruby.scm | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index ecca0b8bf4..5be7638600 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -12164,3 +12164,37 @@ options.")
 an IP address.  Both IPv4 and IPv6 are supported.")
     (home-page "https://github.com/ruby/ipaddr")
     (license license:bsd-2)))
+
+(define-public bundler-audit
+  (package
+    (name "bundler-audit")
+    (version "0.7.0.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/rubysec/bundler-audit")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "1qzr8fwik5g95n0nvhfyz6rrhr3cvnzv8jzzaz5z3j57hi20d39i"))))
+    (build-system ruby-build-system)
+    (arguments `(#:tests? #f)); FIXME: some test failures
+    (inputs
+     `(("libgit2" ,libgit2)))
+    (propagated-inputs
+     `(("bundler" ,bundler)
+       ("ruby-thor" ,ruby-thor)))
+    (native-inputs
+     `(("ruby-rake" ,ruby-rake)
+       ("ruby-kramdown" ,ruby-kramdown)
+       ("ruby-rubygems-tasks" ,ruby-rubygems-tasks)
+       ("ruby-rspec" ,ruby-rspec)
+       ("ruby-yard" ,ruby-yard)
+       ("ruby-simplecov" ,ruby-simplecov)))
+    (synopsis "Patch-level verification for Bundler")
+    (description "Checks for vulnerable versions of gems in
+Gemfile.lock as well as insecure gem sources (http://).")
+    (home-page "https://github.com/rubysec/bundler-audit")
+    (license license:gpl3)))
-- 
2.30.1

From 97dff6693bf8bcda97189a3595e21997c1790e89 Mon Sep 17 00:00:00 2001
From: Ryan Desfosses <[email-masked]>
Date: Sat, 20 Feb 2021 14:06:53 -0500
Subject: [PATCH 1/3] gnu: Add ruby-ippaddr

* gnu/packages/ruby.scm (ruby-ipaddr): New variable.
---
 gnu/packages/ruby.scm | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 6c9583b3cf..ecca0b8bf4 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -12139,3 +12139,28 @@ multiple adapters, various log level combinations and message formatting
 options.")
     (home-page "https://github.com/rudionrails/yell")
     (license license:expat)))
+
+(define-public ruby-ipaddr
+  (package
+    (name "ruby-ipaddr")
+    (version "1.2.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/ruby/ipaddr")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "0df6y3k42ylaacfwyrpfs2z5bhz09fypvz8dw8s96h934y5swyph"))))
+    (build-system ruby-build-system)
+    (native-inputs
+     `(("ruby-rake" ,ruby-rake)
+       ("rbundler" ,bundler)
+       ("ruby-test-unit" ,ruby-test-unit)))
+    (synopsis "Class to manipulate an IP address")
+    (description "IPAddr provides a set of methods to manipulate
+an IP address.  Both IPv4 and IPv6 are supported.")
+    (home-page "https://github.com/ruby/ipaddr")
+    (license license:bsd-2)))
-- 
2.30.1