gnu: Add qtwayland, version 6.3.1.
[jackhill/guix/guix.git] / gnu / packages / antivirus.scm
CommitLineData
0a41123f 1;;; GNU Guix --- Functional package management for GNU
0e77a62d 2;;; Copyright © 2016, 2017, 2018, 2019, 2020 Eric Bavier <bavier@posteo.net>
0a41123f 3;;; Copyright © 2018 Christopher Baines <mail@cbaines.net>
41863e18 4;;; Copyright © 2019–2021 Tobias Geerinckx-Rice <me@tobias.gr>
0a41123f
EB
5;;;
6;;; This file is part of GNU Guix.
7;;;
8;;; GNU Guix is free software; you can redistribute it and/or modify it
9;;; under the terms of the GNU General Public License as published by
10;;; the Free Software Foundation; either version 3 of the License, or (at
11;;; your option) any later version.
12;;;
13;;; GNU Guix is distributed in the hope that it will be useful, but
14;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16;;; GNU General Public License for more details.
17;;;
18;;; You should have received a copy of the GNU General Public License
19;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21(define-module (gnu packages antivirus)
22 #:use-module ((guix licenses) #:prefix license:)
23 #:use-module (guix build-system gnu)
d9f15a0b 24 #:use-module (guix gexp)
0a41123f
EB
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix utils)
28 #:use-module (gnu packages)
29 #:use-module (gnu packages autotools)
30 #:use-module (gnu packages bison)
31 #:use-module (gnu packages check)
32 #:use-module (gnu packages compression)
33 #:use-module (gnu packages curl)
34 #:use-module (gnu packages cyrus-sasl)
35 #:use-module (gnu packages flex)
36 #:use-module (gnu packages llvm)
37 #:use-module (gnu packages multiprecision)
38 #:use-module (gnu packages ncurses)
39 #:use-module (gnu packages pcre)
40 #:use-module (gnu packages pkg-config)
41 #:use-module (gnu packages tls)
42 #:use-module (gnu packages web)
43 #:use-module (gnu packages xml))
44
45(define-public clamav
46 (package
47 (name "clamav")
20b498b7 48 (version "0.103.6")
0a41123f
EB
49 (source (origin
50 (method url-fetch)
51 (uri (string-append "https://www.clamav.net/downloads/production/"
52 "clamav-" version ".tar.gz"))
53 (sha256
54 (base32
20b498b7 55 "0cxsv5m9pqxxb56qd7hlj11pwmdgm07s3msh3hxk47czq4yjx8da"))
0a41123f
EB
56 (modules '((guix build utils)))
57 (snippet
58 '(begin
59 (for-each delete-file-recursively
fcab568d
TGR
60 '("win32" ; unnecessary
61 "libclamav/c++/llvm" ; use system llvm
62 "libclamav/tomsfastmath" ; use system tomsfastmath
d9f15a0b 63 "libclamunrar")))) ; non-free license
0a41123f
EB
64 (patches
65 (search-patches "clamav-system-tomsfastmath.patch"
66 "clamav-config-llvm-libs.patch"))))
67 (build-system gnu-build-system)
68 (native-inputs
8394619b
LC
69 (list autoconf
70 automake
71 check ; for tests
72 libtool
73 pkg-config))
0a41123f 74 (inputs
d9f15a0b 75 (list bzip2
76 curl
77 json-c
78 libltdl
79 libmspack
80 llvm-3.6 ; requires <3.7, for JIT/verifier
81 ncurses
82 libressl
83 pcre2
84 cyrus-sasl ; for linking curl with libtool
85 tomsfastmath
86 libxml2
87 zlib))
0a41123f 88 (arguments
d9f15a0b 89 (list #:configure-flags
90 #~(let-syntax ((with (syntax-rules ()
91 ((_ name use)
0a41123f 92 (string-append "--with-" name "="
d9f15a0b 93 (assoc-ref %build-inputs use))))))
94 (list "--disable-unrar"
95 "--enable-llvm"
96 "--with-system-llvm"
97 "--with-system-libmspack"
98 "--without-included-ltdl"
99 (with "xml" "libxml2")
100 (with "openssl" "libressl")
101 (with "libjson" "json-c")
102 (with "pcre2" "pcre2")
103 (with "zlib" "zlib")
104 (with "libcurl" "curl")
105 ;; For sanity, specifying --enable-* flags turns
106 ;; "support unavailable" warnings into errors.
107 "--enable-bzip2"
108 "--enable-check"
109 "--sysconfdir=/etc/clamav"
110 ;; Default database directory needs to be writeable
111 "--with-dbdir=/var/db/clamav"))
112 ;; install sample .conf files to %output/etc rather than /etc/clamav
113 #:make-flags
114 #~(list (string-append "sysconfdir=" %output "/etc"))
115 #:phases
116 #~(modify-phases %standard-phases
117 ;; Regenerate configure script. Without this we don't get
118 ;; the correct value for LLVM linker variables.
119 (add-after 'unpack 'reconf
120 (lambda _ (invoke "autoreconf" "-vfi")))
121 (add-before 'configure 'patch-llvm-config
122 (lambda _
123 (substitute* '("libclamav/c++/detect.cpp"
124 "libclamav/c++/ClamBCRTChecks.cpp"
125 "libclamav/c++/bytecode2llvm.cpp")
126 (("llvm/Config/config.h") "llvm/Config/llvm-config.h"))
127 ;; `llvm-config --libfiles` inappropriately lists lib*.a
128 ;; libraries, rather than the lib*.so's that our llvm
129 ;; contains. They're used only for listing extra build
130 ;; dependencies, so ignore them until that's fixed.
131 (substitute* "libclamav/c++/Makefile.in"
132 (("@LLVMCONFIG_LIBFILES@") ""))))
133 (add-before 'check 'skip-clamd-tests
134 ;; XXX: The check?_clamd tests fail inside the build
135 ;; chroot, but pass outside.
136 (lambda _
137 (substitute* "unit_tests/Makefile"
138 (("check2_clamd.sh.*check4_clamd.sh") "")))))))
0a41123f
EB
139 (home-page "https://www.clamav.net")
140 (synopsis "Antivirus engine")
141 (description
142 "Clam AntiVirus is an anti-virus toolkit, designed especially for e-mail
143scanning on mail gateways. It provides a number of utilities including a
144flexible and scalable multi-threaded daemon, a command line scanner, and
145advanced tool for automatic database updates. The core of the package is an
146anti-virus engine available in the form of a shared library.")
147 (license (list license:gpl2+ ;ClamAV itself
148 license:lgpl2.1 ;libclamav/mspack.[ch]
149 license:public-domain ;libclamav/7z/*, libclamav/rijndael.[ch], etc...
150 (package-license bzip2) ;modified bzip2 source in libclamav/nsis
151 license:bsd-2 ;several files in libclamav
152 license:bsd-3 ;libclamav/{regex,qsort.c,swf.[ch]
153 license:ncsa ;libclamav/c++/PointerTracking.cpp
154 license:zlib ;libclamav/inf*.h
155 license:x11 ;libclamav/lzw
156 (license:non-copyleft "libclamav/strlcat.c") ;"OpenBSD" license
157 license:asl2.0 ;libclamav/yara*
158 license:expat)))) ;shared/getopt.[ch]