From: Nicolas Graves via Guix-patches via <guix-patches@gnu.org>
To: 73896@debbugs.gnu.org
Cc: Nicolas Graves <ngraves@ngraves.fr>
Subject: [bug#73896] [PATCH v3 06/20] gnu: clamav: Update to 1.4.1.
Date: Sun, 3 Nov 2024 02:30:13 +0100 [thread overview]
Message-ID: <20241103013258.26141-7-ngraves@ngraves.fr> (raw)
In-Reply-To: <20241103013258.26141-1-ngraves@ngraves.fr>
* gnu/packages/antivirus.scm (clamav): Update to 1.4.1.
[source]<origin>: Adapt source. This currently is not unbundling all
cargo vendored packages.
[build-system]: Switch to cmake-build-system.
[arguments]: Move field up.
<#:configure-flags>: Set option.
<#:imported-modules>: Set option for patching cargo checksums.
<#:phases>: Remove all phases except adapted 'skip-clamd_tests. Add
phases 'inject-rust-onenote and 'patch-cargo-checksums.
[native-inputs]: Remove autoconf, automake, libtool. Add
python-minimal, python-pytest, rust and rust:cargo.
[inputs]: Remove libltdl, libmspack, llvm-3.6, cyrus-sasl,
tomsfastmath.
---
gnu/packages/antivirus.scm | 129 +++++++++++++++----------------------
1 file changed, 51 insertions(+), 78 deletions(-)
diff --git a/gnu/packages/antivirus.scm b/gnu/packages/antivirus.scm
index 2161d60398..1a23657a61 100644
--- a/gnu/packages/antivirus.scm
+++ b/gnu/packages/antivirus.scm
@@ -2,6 +2,7 @@
;;; Copyright © 2016, 2017, 2018, 2019, 2020 Eric Bavier <bavier@posteo.net>
;;; Copyright © 2018 Christopher Baines <mail@cbaines.net>
;;; Copyright © 2019–2021 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2024 Nicolas Graves <ngraves@ngraves.fr>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -20,24 +21,23 @@
(define-module (gnu packages antivirus)
#:use-module ((guix licenses) #:prefix license:)
+ #:use-module (guix build-system cargo)
+ #:use-module (guix build-system cmake)
#:use-module (guix build-system gnu)
#:use-module (guix gexp)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix utils)
#:use-module (gnu packages)
- #:use-module (gnu packages autotools)
- #:use-module (gnu packages bison)
#:use-module (gnu packages check)
#:use-module (gnu packages compression)
#:use-module (gnu packages curl)
- #:use-module (gnu packages cyrus-sasl)
- #:use-module (gnu packages flex)
- #:use-module (gnu packages llvm)
- #:use-module (gnu packages multiprecision)
#:use-module (gnu packages ncurses)
#:use-module (gnu packages pcre)
#:use-module (gnu packages pkg-config)
+ #:use-module (gnu packages python)
+ #:use-module (gnu packages python-check)
+ #:use-module (gnu packages rust)
#:use-module (gnu packages tls)
#:use-module (gnu packages web)
#:use-module (gnu packages xml))
@@ -45,7 +45,7 @@ (define-module (gnu packages antivirus)
(define-public clamav
(package
(name "clamav")
- (version "0.103.11")
+ (version "1.4.1")
(source (origin
(method url-fetch)
(uri
@@ -57,90 +57,63 @@ (define-public clamav
"/clamav-" version ".tar.gz")))
(sha256
(base32
- "04by1g3p6awhi3j1y6zpwzmasdnvjgi6lwm34l2gadlwgkdfpmv1"))
+ "1n3a87niad76h3mn3qxq9379gppdjqpkhwb9qkbb79irmj0ff653"))
(modules '((guix build utils)))
(snippet
'(begin
+ (delete-file "Cargo.lock")
+ (for-each
+ delete-file
+ (find-files ".cargo/vendor" ".cargo-checksum\\.json"))
(for-each delete-file-recursively
'("win32" ; unnecessary
- "libclamav/c++/llvm" ; use system llvm
- "libclamav/tomsfastmath" ; use system tomsfastmath
- "libclamunrar")))) ; non-free license
- (patches
- (search-patches "clamav-system-tomsfastmath.patch"
- "clamav-config-llvm-libs.patch"))))
- (build-system gnu-build-system)
+ "libclamunrar")))))) ; non-free license
+ (build-system cmake-build-system)
+ (arguments
+ (list
+ #:configure-flags
+ #~(list "-DENABLE_MILTER=OFF" "-DENABLE_UNRAR=OFF")
+ #:imported-modules `((guix build cargo-utils)
+ ,@%cmake-build-system-modules)
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'inject-rust-onenote
+ (lambda _
+ (substitute* "libclamav_rust/Cargo.toml"
+ (("onenote_parser = .*")
+ "onenote_parser = \"0.3.1\"\n"))))
+ (add-after 'patch-source-shebangs 'patch-cargo-checksums
+ (lambda _
+ (use-modules
+ (srfi srfi-1) (ice-9 ftw) (guix build cargo-utils))
+ (with-directory-excursion ".cargo/vendor"
+ (for-each generate-all-checksums
+ (delete "." (delete ".." (scandir ".")))))))
+ (add-after 'unpack 'skip-clamd-tests
+ ;; XXX: The check?_clamd tests fail inside the build
+ ;; chroot, but pass outside.
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (substitute* "unit_tests/CMakeLists.txt"
+ (("clamd_test\\.py" test)
+ (string-append
+ test " -k \"not test_clamd_08_VirusEvent\"")))))))))
(native-inputs
- (list autoconf
- automake
- check ; for tests
- libtool
- pkg-config))
+ (list check ; for tests
+ pkg-config
+ python-minimal
+ python-pytest
+ rust
+ (list rust "cargo")))
(inputs
(list bzip2
curl
json-c
- libltdl
- libmspack
- llvm-3.6 ; requires <3.7, for JIT/verifier
- ncurses
libressl
- pcre2
- cyrus-sasl ; for linking curl with libtool
- tomsfastmath
libxml2
+ ncurses
+ pcre2
zlib))
- (arguments
- (list #:configure-flags
- #~(let-syntax ((with (syntax-rules ()
- ((_ name use)
- (string-append "--with-" name "="
- (assoc-ref %build-inputs use))))))
- (list "--disable-unrar"
- "--enable-llvm"
- "--with-system-llvm"
- "--with-system-libmspack"
- "--without-included-ltdl"
- (with "xml" "libxml2")
- (with "openssl" "libressl")
- (with "libjson" "json-c")
- (with "pcre2" "pcre2")
- (with "zlib" "zlib")
- (with "libcurl" "curl")
- ;; For sanity, specifying --enable-* flags turns
- ;; "support unavailable" warnings into errors.
- "--enable-bzip2"
- "--enable-check"
- "--sysconfdir=/etc/clamav"
- ;; Default database directory needs to be writeable
- "--with-dbdir=/var/db/clamav"))
- ;; install sample .conf files to %output/etc rather than /etc/clamav
- #:make-flags
- #~(list (string-append "sysconfdir=" %output "/etc"))
- #:phases
- #~(modify-phases %standard-phases
- ;; Regenerate configure script. Without this we don't get
- ;; the correct value for LLVM linker variables.
- (add-after 'unpack 'reconf
- (lambda _ (invoke "autoreconf" "-vfi")))
- (add-before 'configure 'patch-llvm-config
- (lambda _
- (substitute* '("libclamav/c++/detect.cpp"
- "libclamav/c++/ClamBCRTChecks.cpp"
- "libclamav/c++/bytecode2llvm.cpp")
- (("llvm/Config/config.h") "llvm/Config/llvm-config.h"))
- ;; `llvm-config --libfiles` inappropriately lists lib*.a
- ;; libraries, rather than the lib*.so's that our llvm
- ;; contains. They're used only for listing extra build
- ;; dependencies, so ignore them until that's fixed.
- (substitute* "libclamav/c++/Makefile.in"
- (("@LLVMCONFIG_LIBFILES@") ""))))
- (add-before 'check 'skip-clamd-tests
- ;; XXX: The check?_clamd tests fail inside the build
- ;; chroot, but pass outside.
- (lambda _
- (substitute* "unit_tests/Makefile"
- (("check2_clamd.sh.*check4_clamd.sh") "")))))))
(home-page "https://www.clamav.net")
(synopsis "Antivirus engine")
(description
--
2.46.0
next prev parent reply other threads:[~2024-11-03 1:34 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-19 23:08 [bug#73896] [PATCH] gnu: clamav: Add release-monitoring-url property Nicolas Graves via Guix-patches via
2024-10-21 9:05 ` [bug#73896] [PATCH v2 1/2] " Nicolas Graves via Guix-patches via
2024-10-21 9:05 ` [bug#73896] [PATCH v2 2/2] gnu: clamav: Update to 1.4.1 Nicolas Graves via Guix-patches via
2024-11-03 1:30 ` [bug#73896] [PATCH v3 00/20] Clamav update [security fixes] Nicolas Graves via Guix-patches via
2024-11-03 1:30 ` [bug#73896] [PATCH v3 01/20] gnu: rust-widestring-0.4: Update to 0.4.3 Nicolas Graves via Guix-patches via
2024-11-03 1:30 ` [bug#73896] [PATCH v3 02/20] gnu: rust-enum-primitive-derive-0.2: Update to 0.2.2 Nicolas Graves via Guix-patches via
2024-11-03 1:30 ` [bug#73896] [PATCH v3 03/20] gnu: Add rust-onenote-parser-0.3 Nicolas Graves via Guix-patches via
2024-11-03 1:30 ` [bug#73896] [PATCH v3 04/20] gnu: Add rust-onenote-parser-for-clamav Nicolas Graves via Guix-patches via
2024-11-03 1:30 ` [bug#73896] [PATCH v3 05/20] gnu: clamav: Add release-monitoring-url property Nicolas Graves via Guix-patches via
2024-11-03 1:30 ` Nicolas Graves via Guix-patches via [this message]
2024-11-03 1:30 ` [bug#73896] [PATCH v3 07/20] gnu: Add rust-hamming-0.1 Nicolas Graves via Guix-patches via
2024-11-03 1:30 ` [bug#73896] [PATCH v3 08/20] gnu: Add rust-primal-bit-0.3 Nicolas Graves via Guix-patches via
2024-11-03 1:30 ` [bug#73896] [PATCH v3 09/20] gnu: Add rust-primal-check-0.3 Nicolas Graves via Guix-patches via
2024-11-03 1:30 ` [bug#73896] [PATCH v3 10/20] gnu: Add rust-primal-estimate-0.3 Nicolas Graves via Guix-patches via
2024-11-03 1:30 ` [bug#73896] [PATCH v3 11/20] gnu: Add rust-primal-sieve-0.3 Nicolas Graves via Guix-patches via
2024-11-03 1:30 ` [bug#73896] [PATCH v3 12/20] gnu: Add rust-primal-slowsieve-0.3 Nicolas Graves via Guix-patches via
2024-11-03 1:30 ` [bug#73896] [PATCH v3 13/20] gnu: Add rust-primal-0.3 Nicolas Graves via Guix-patches via
2024-11-03 1:30 ` [bug#73896] [PATCH v3 14/20] gnu: rust-crc-any-2: Update to 2.5.0 Nicolas Graves via Guix-patches via
2024-11-03 1:30 ` [bug#73896] [PATCH v3 15/20] gnu: Add rust-delharc-0.6 Nicolas Graves via Guix-patches via
2024-11-03 1:30 ` [bug#73896] [PATCH v3 16/20] gnu: Add rust-transpose-0.2 Nicolas Graves via Guix-patches via
2024-11-03 1:30 ` [bug#73896] [PATCH v3 17/20] gnu: rust-strength-reduce-0.2: Update to 0.2.4 Nicolas Graves via Guix-patches via
2024-11-03 1:30 ` [bug#73896] [PATCH v3 18/20] gnu: Add rust-rustfft-6 Nicolas Graves via Guix-patches via
2024-11-03 1:30 ` [bug#73896] [PATCH v3 19/20] gnu: Add rust-rustdct-0.7 Nicolas Graves via Guix-patches via
2024-11-03 1:30 ` [bug#73896] [PATCH v3 20/20] gnu: clamav: Unbundle rust dependencies Nicolas Graves via Guix-patches via
2024-11-05 23:14 ` [bug#73896] [PATCH v4 01/20] gnu: rust-widestring-0.4: Update to 0.4.3 Nicolas Graves via Guix-patches via
2024-11-05 23:14 ` [bug#73896] [PATCH v4 02/20] gnu: rust-enum-primitive-derive-0.2: Update to 0.2.2 Nicolas Graves via Guix-patches via
2024-11-05 23:14 ` [bug#73896] [PATCH v4 03/20] gnu: Add rust-onenote-parser-0.3 Nicolas Graves via Guix-patches via
2024-11-05 23:14 ` [bug#73896] [PATCH v4 04/20] gnu: Add rust-onenote-parser-for-clamav Nicolas Graves via Guix-patches via
2024-11-05 23:14 ` [bug#73896] [PATCH v4 05/20] gnu: clamav: Add release-monitoring-url property Nicolas Graves via Guix-patches via
2024-11-05 23:14 ` [bug#73896] [PATCH v4 06/20] gnu: clamav: Update to 1.4.1 Nicolas Graves via Guix-patches via
2024-11-05 23:14 ` [bug#73896] [PATCH v4 07/20] gnu: Add rust-hamming-0.1 Nicolas Graves via Guix-patches via
2024-11-05 23:14 ` [bug#73896] [PATCH v4 08/20] gnu: Add rust-primal-bit-0.3 Nicolas Graves via Guix-patches via
2024-11-05 23:14 ` [bug#73896] [PATCH v4 09/20] gnu: Add rust-primal-check-0.3 Nicolas Graves via Guix-patches via
2024-11-05 23:14 ` [bug#73896] [PATCH v4 10/20] gnu: Add rust-primal-estimate-0.3 Nicolas Graves via Guix-patches via
2024-11-05 23:14 ` [bug#73896] [PATCH v4 11/20] gnu: Add rust-primal-sieve-0.3 Nicolas Graves via Guix-patches via
2024-11-05 23:15 ` [bug#73896] [PATCH v4 12/20] gnu: Add rust-primal-slowsieve-0.3 Nicolas Graves via Guix-patches via
2024-11-05 23:15 ` [bug#73896] [PATCH v4 13/20] gnu: Add rust-primal-0.3 Nicolas Graves via Guix-patches via
2024-11-05 23:15 ` [bug#73896] [PATCH v4 14/20] gnu: rust-crc-any-2: Update to 2.5.0 Nicolas Graves via Guix-patches via
2024-11-05 23:15 ` [bug#73896] [PATCH v4 15/20] gnu: Add rust-delharc-0.6 Nicolas Graves via Guix-patches via
2024-11-05 23:15 ` [bug#73896] [PATCH v4 16/20] gnu: Add rust-transpose-0.2 Nicolas Graves via Guix-patches via
2024-11-05 23:15 ` [bug#73896] [PATCH v4 17/20] gnu: rust-strength-reduce-0.2: Update to 0.2.4 Nicolas Graves via Guix-patches via
2024-11-05 23:15 ` [bug#73896] [PATCH v4 18/20] gnu: Add rust-rustfft-6 Nicolas Graves via Guix-patches via
2024-11-05 23:15 ` [bug#73896] [PATCH v4 19/20] gnu: Add rust-rustdct-0.7 Nicolas Graves via Guix-patches via
2024-11-05 23:15 ` [bug#73896] [PATCH v4 20/20] gnu: clamav: Unbundle rust dependencies Nicolas Graves via Guix-patches via
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241103013258.26141-7-ngraves@ngraves.fr \
--to=guix-patches@gnu.org \
--cc=73896@debbugs.gnu.org \
--cc=ngraves@ngraves.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.