gnu: nmap: Update to 7.96.

* gnu/packages/admin.scm (nmap): Update to 7.96.
[inputs]: Remove lua, pcre, and python-2; add lua-5.4, pcre2, perl, and
python-wrapper.
[native-inputs]: Add python-pypa-build, python-setuptools, and python-wheel.
[arguments]: Use GEXPs.  Remove "patch-Makefile" phase.  Add
"patch-Makefile.in" phase.  Update "install" phase.

Change-Id: I31da6982da6ced4489e6f330d5e7eeabe1e648cc
This commit is contained in:
Artyom V. Poptsov 2025-05-10 23:22:48 +03:00
parent 770c9078fa
commit 2d2a921e99
No known key found for this signature in database
GPG key ID: 935EBE0736DC857E

View file

@ -3744,14 +3744,14 @@ rules is done with the @code{auditctl} utility.")
(define-public nmap
(package
(name "nmap")
(version "7.93")
(version "7.96")
(source (origin
(method url-fetch)
(uri (string-append "https://nmap.org/dist/nmap-" version
".tar.bz2"))
(sha256
(base32
"0lb6s4nmmicfnc221mzgx2w51dcd4b2dhx22pabcqnp2jd3zxg2m"))
"12lcvyzfl1hblbklcss44dr92fr86w0z1y1a90yilv5n5x7pmblq"))
(modules '((guix build utils)))
(snippet
'(begin
@ -3766,29 +3766,42 @@ rules is done with the @code{auditctl} utility.")
(build-system gnu-build-system)
(outputs '("out" "ndiff")) ; TODO Add zenmap output
(arguments
`(#:configure-flags '("--without-zenmap")
(list
#:configure-flags #~(list "--without-zenmap")
#:phases
(modify-phases %standard-phases
(add-after 'configure 'patch-Makefile
#~(modify-phases %standard-phases
(add-after 'unpack 'patch-Makefile.in
(lambda _
(substitute* "Makefile"
;; Do not attempt to build lua.
(("build-dnet build-lua") "build-dnet"))))
(substitute* "Makefile.in"
(("\\$\\(PYTHON\\) -m build \\$\\(NDIFFDIR\\)/")
"$(PYTHON) -m build --wheel --no-isolation $(NDIFFDIR)/")
(("\\$\\(PYTHON\\) -m pip install \\$\\(NDIFFDIR\\).*")
(string-append "pip"
" --no-cache-dir"
" --no-input"
" install"
" --no-build-isolation"
" --no-deps"
" --prefix"
" $(prefix)"
" $(NDIFFDIR)/\n")))))
(replace 'install
(lambda* (#:key outputs #:allow-other-keys)
(lambda* (#:key inputs outputs #:allow-other-keys)
(define (make out . args)
(apply invoke "make"
(string-append "PYTHON="
(search-input-file inputs "/bin/python"))
(string-append "CC=" #$(cc-for-target))
(string-append "prefix=" out)
args))
(define (python-path dir)
(string-append dir "/lib/python"
,(version-major+minor
#$(version-major+minor
(package-version python))
"/site-packages"))
(let ((out (assoc-ref outputs "out"))
(ndiff (assoc-ref outputs "ndiff")))
(for-each mkdir-p (list out ndiff))
(make out
(let ((ndiff (assoc-ref outputs "ndiff")))
(for-each mkdir-p (list #$output ndiff))
(make #$output
"install-nmap"
"install-nse"
"install-ncat"
@ -3803,18 +3816,19 @@ rules is done with the @code{auditctl} utility.")
(when tests?
(invoke "make"
"check-nse"
"check-ndiff"
"check-dns")))))
"check-ndiff")))))
;; Nmap can't cope with out-of-source building.
#:out-of-source? #f))
(native-inputs (list python-pypa-build python-setuptools python-wheel))
(inputs
(list bash-minimal ;for wrap-program
libpcap
lua
lua-5.4
openssl-3.0
pcre
pcre2
zlib ; for NSE compression
python-2)) ; for ndiff
perl
python-wrapper)) ; for ndiff
(home-page "https://nmap.org/")
(synopsis "Network discovery and security auditing tool")
(description