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