From patchwork Tue Nov 5 23:14:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nicolas Graves X-Patchwork-Id: 69892 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id AAE8427BBEA; Tue, 5 Nov 2024 23:16:44 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 6442627BBE2 for ; Tue, 5 Nov 2024 23:16:43 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t8SmP-00036l-EJ; Tue, 05 Nov 2024 18:16:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t8SmM-00035D-Ex for guix-patches@gnu.org; Tue, 05 Nov 2024 18:16:06 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t8SmL-0002Fv-1p for guix-patches@gnu.org; Tue, 05 Nov 2024 18:16:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=/Q0deePCOY1xrpPwRwUuQuwnHGBOJB1hVB2SPOwvZQI=; b=cHmkSbqNgUCMK9uh5jptTGrhEydIXCVg1X0pE0JKDP0+1ABrkthXb04tHJI5vWkWQv4OLqCXDbf1BNZHi34nOL8n2t8eX6XO9yzKPQX/49AXpKpn+lNbvzuV3e6RAsEDqbOa/nTgI+oPyUTEXAl9yzRwYL6eS8RGOY1h1s18JtNMwGAdfLxOyPzw+rGB6HXRpmLmK2QNW5YGu1y57eUUZ/8ZF+Zzm8s+ToKmr4dsQBjKoDxGqAdu/nIjb4On5N0eIBoOu+H6I0E0Fh1zhIyN2nVmgYNdlSFa60BZX1RZI1ZRM5gvZeCbHGdEaJ4FISbTKBQncwP47jcB3BLovsPQ8A==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t8SmK-0004LL-UD for guix-patches@gnu.org; Tue, 05 Nov 2024 18:16:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#73896] [PATCH v4 06/20] gnu: clamav: Update to 1.4.1. Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 05 Nov 2024 23:16:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73896 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 73896@debbugs.gnu.org Cc: Nicolas Graves Received: via spool by 73896-submit@debbugs.gnu.org id=B73896.173084855616618 (code B ref 73896); Tue, 05 Nov 2024 23:16:04 +0000 Received: (at 73896) by debbugs.gnu.org; 5 Nov 2024 23:15:56 +0000 Received: from localhost ([127.0.0.1]:38416 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t8SmB-0004Jy-C5 for submit@debbugs.gnu.org; Tue, 05 Nov 2024 18:15:56 -0500 Received: from 1.mo550.mail-out.ovh.net ([178.32.127.22]:44497) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t8Sm8-0004Jo-8b for 73896@debbugs.gnu.org; Tue, 05 Nov 2024 18:15:54 -0500 Received: from director9.ghost.mail-out.ovh.net (unknown [10.109.140.196]) by mo550.mail-out.ovh.net (Postfix) with ESMTP id 4Xjkj23mWNz1PB3 for <73896@debbugs.gnu.org>; Tue, 5 Nov 2024 23:15:50 +0000 (UTC) Received: from ghost-submission-5b5ff79f4f-d8ddd (unknown [10.108.54.32]) by director9.ghost.mail-out.ovh.net (Postfix) with ESMTPS id B18DC1FD77; Tue, 5 Nov 2024 23:15:49 +0000 (UTC) Received: from ngraves.fr ([37.59.142.105]) by ghost-submission-5b5ff79f4f-d8ddd with ESMTPSA id 1we4GiWnKmdD+gUADMDNBQ (envelope-from ); Tue, 05 Nov 2024 23:15:49 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-105G0068c7deaec-e745-4a09-874d-40ea44576569, 7DA11F85E05AC71F4B07BAB71687C1137F5318AF) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 86.246.19.221 Date: Wed, 6 Nov 2024 00:14:54 +0100 Message-ID: <20241105231519.22378-6-ngraves@ngraves.fr> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241105231519.22378-1-ngraves@ngraves.fr> References: <20241105231519.22378-1-ngraves@ngraves.fr> MIME-Version: 1.0 X-Ovh-Tracer-Id: 12044314257680360162 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeefuddrtddugddtlecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecunecujfgurhephffvvefufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepudevvdeuieeiiedtkeeghfetffeiiefhleekfeejudetteeukeeigfejvdegiefhnecuffhomhgrihhnpegtlhgrmhgrvhdrnhgvthenucfkphepuddvjedrtddrtddruddpkeeirddvgeeirdduledrvddvuddpfeejrdehledrudegvddruddtheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepnhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrpdhnsggprhgtphhtthhopedupdhrtghpthhtohepjeefkeelieesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheehtdgmpdhmohguvgepshhmthhpohhuth DKIM-Signature: a=rsa-sha256; bh=/Q0deePCOY1xrpPwRwUuQuwnHGBOJB1hVB2SPOwvZQI=; c=relaxed/relaxed; d=ngraves.fr; h=From; s=ovhmo4487190-selector1; t=1730848550; v=1; b=nboMjZK5bhUOGOBN/UBCiFOFwnrgvCETFhEDDxpuAYZALQRWsRaoJwd/IYAHGQHNvxtvQmW4 HiSCJQp6cGJaWOcbzAvE9Aj3Yvr2dZgb3FxuchoNfJWPwHv3haRlVElaOpTXHCCMq5j7fUNDh4P WNX2p/F1D5oMAimWO1DgStKqawTsfAiXA/A3V2ID3mvNpkesiQFNrwiNZOkhAlTOqNUoqeIF/Mp 12XJv0VruQKGtIYX5v7hHZkVR3hpEvoWplAMPgLsWyu2eQ/ONP52Cyf4ms1on3Vw3s0JS/fXVxT FHvtQB47mMSopX/U42mp6LdFVlb85fbDN6RWMGsu5pR5Q== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Nicolas Graves X-ACL-Warn: , Nicolas Graves via Guix-patches X-Patchwork-Original-From: Nicolas Graves via Guix-patches via From: Nicolas Graves Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/antivirus.scm (clamav): Update to 1.4.1. [source]: 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 ;;; Copyright © 2018 Christopher Baines ;;; Copyright © 2019–2021 Tobias Geerinckx-Rice +;;; Copyright © 2024 Nicolas Graves ;;; ;;; 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