gnu: clamav: Use new style and G-expressions.

* gnu/packages/antivirus.scm (clamav)[source]: Remove trailing #t from snippet.
[inputs]: Use new input style.
[arguments]: Use G-expressions. Remove trailing #t from phases
[configure-flags]: Adjust to new input style.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
kiasoc5 2022-05-18 22:51:14 -04:00 committed by Ludovic Courtès
parent 48c748226e
commit d9f15a0b7b
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -21,6 +21,7 @@
(define-module (gnu packages antivirus) (define-module (gnu packages antivirus)
#:use-module ((guix licenses) #:prefix license:) #:use-module ((guix licenses) #:prefix license:)
#:use-module (guix build-system gnu) #:use-module (guix build-system gnu)
#:use-module (guix gexp)
#:use-module (guix packages) #:use-module (guix packages)
#:use-module (guix download) #:use-module (guix download)
#:use-module (guix utils) #:use-module (guix utils)
@ -59,8 +60,7 @@
'("win32" ; unnecessary '("win32" ; unnecessary
"libclamav/c++/llvm" ; use system llvm "libclamav/c++/llvm" ; use system llvm
"libclamav/tomsfastmath" ; use system tomsfastmath "libclamav/tomsfastmath" ; use system tomsfastmath
"libclamunrar")) ; non-free license "libclamunrar")))) ; non-free license
#t))
(patches (patches
(search-patches "clamav-system-tomsfastmath.patch" (search-patches "clamav-system-tomsfastmath.patch"
"clamav-config-llvm-libs.patch")))) "clamav-config-llvm-libs.patch"))))
@ -72,70 +72,70 @@
libtool libtool
pkg-config)) pkg-config))
(inputs (inputs
`(("bzip2" ,bzip2) (list bzip2
("libcurl" ,curl) curl
("libjson" ,json-c) json-c
("libltdl" ,libltdl) libltdl
("libmspack" ,libmspack) libmspack
("llvm" ,llvm-3.6) ; requires <3.7, for JIT/verifier llvm-3.6 ; requires <3.7, for JIT/verifier
("ncurses" ,ncurses) ncurses
("openssl" ,libressl) libressl
("pcre2" ,pcre2) pcre2
("sasl" ,cyrus-sasl) ; for linking curl with libtool cyrus-sasl ; for linking curl with libtool
("tomsfastmath" ,tomsfastmath) tomsfastmath
("xml" ,libxml2) libxml2
("zlib" ,zlib))) zlib))
(arguments (arguments
`(#:configure-flags (list #:configure-flags
(let-syntax ((with (syntax-rules () #~(let-syntax ((with (syntax-rules ()
((_ name) ((_ name use)
(string-append "--with-" name "=" (string-append "--with-" name "="
(assoc-ref %build-inputs name)))))) (assoc-ref %build-inputs use))))))
(list "--disable-unrar" (list "--disable-unrar"
"--enable-llvm" "--enable-llvm"
"--with-system-llvm" "--with-system-llvm"
"--with-system-libmspack" "--with-system-libmspack"
"--without-included-ltdl" "--without-included-ltdl"
(with "xml") (with "xml" "libxml2")
(with "openssl") (with "openssl" "libressl")
(with "libjson") (with "libjson" "json-c")
(with "pcre2") (with "pcre2" "pcre2")
(with "zlib") (with "zlib" "zlib")
(with "libcurl") (with "libcurl" "curl")
;; For sanity, specifying --enable-* flags turns ;; For sanity, specifying --enable-* flags turns
;; "support unavailable" warnings into errors. ;; "support unavailable" warnings into errors.
"--enable-bzip2" "--enable-bzip2"
"--enable-check" "--enable-check"
"--sysconfdir=/etc/clamav" "--sysconfdir=/etc/clamav"
;; Default database directory needs to be writeable ;; Default database directory needs to be writeable
"--with-dbdir=/var/db/clamav")) "--with-dbdir=/var/db/clamav"))
;; install sample .conf files to %output/etc rather than /etc/clamav ;; install sample .conf files to %output/etc rather than /etc/clamav
#:make-flags (list (string-append "sysconfdir=" %output "/etc")) #:make-flags
#:phases (modify-phases %standard-phases #~(list (string-append "sysconfdir=" %output "/etc"))
;; Regenerate configure script. Without this we don't get #:phases
;; the correct value for LLVM linker variables. #~(modify-phases %standard-phases
(add-after 'unpack 'reconf ;; Regenerate configure script. Without this we don't get
(lambda _ (invoke "autoreconf" "-vfi"))) ;; the correct value for LLVM linker variables.
(add-before 'configure 'patch-llvm-config (add-after 'unpack 'reconf
(lambda _ (lambda _ (invoke "autoreconf" "-vfi")))
(substitute* '("libclamav/c++/detect.cpp" (add-before 'configure 'patch-llvm-config
"libclamav/c++/ClamBCRTChecks.cpp" (lambda _
"libclamav/c++/bytecode2llvm.cpp") (substitute* '("libclamav/c++/detect.cpp"
(("llvm/Config/config.h") "llvm/Config/llvm-config.h")) "libclamav/c++/ClamBCRTChecks.cpp"
;; `llvm-config --libfiles` inappropriately lists lib*.a "libclamav/c++/bytecode2llvm.cpp")
;; libraries, rather than the lib*.so's that our llvm (("llvm/Config/config.h") "llvm/Config/llvm-config.h"))
;; contains. They're used only for listing extra build ;; `llvm-config --libfiles` inappropriately lists lib*.a
;; dependencies, so ignore them until that's fixed. ;; libraries, rather than the lib*.so's that our llvm
(substitute* "libclamav/c++/Makefile.in" ;; contains. They're used only for listing extra build
(("@LLVMCONFIG_LIBFILES@") "")) ;; dependencies, so ignore them until that's fixed.
#t)) (substitute* "libclamav/c++/Makefile.in"
(add-before 'check 'skip-clamd-tests (("@LLVMCONFIG_LIBFILES@") ""))))
;; XXX: The check?_clamd tests fail inside the build (add-before 'check 'skip-clamd-tests
;; chroot, but pass outside. ;; XXX: The check?_clamd tests fail inside the build
(lambda _ ;; chroot, but pass outside.
(substitute* "unit_tests/Makefile" (lambda _
(("check2_clamd.sh.*check4_clamd.sh") "")) (substitute* "unit_tests/Makefile"
#t))))) (("check2_clamd.sh.*check4_clamd.sh") "")))))))
(home-page "https://www.clamav.net") (home-page "https://www.clamav.net")
(synopsis "Antivirus engine") (synopsis "Antivirus engine")
(description (description