2022-05-18 14:49:53 +00:00
|
|
|
{ lib, stdenv, fetchurl, pkg-config, cmake
|
2020-04-24 23:36:52 +00:00
|
|
|
, zlib, bzip2, libiconv, libxml2, openssl, ncurses, curl, libmilter, pcre2
|
2020-12-09 12:39:15 +00:00
|
|
|
, libmspack, systemd, Foundation, json_c, check
|
2022-05-18 14:49:53 +00:00
|
|
|
, rustc, rust-bindgen, rustfmt, cargo, python3
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "clamav";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "1.2.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://www.clamav.net/downloads/production/${pname}-${version}.tar.gz";
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-l6GS3/4UFIC1bKvxBj15qfxVzVkgMkH6Qb/HqYpUgCA=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
patches = [
|
|
|
|
# Flaky test, remove this when https://github.com/Cisco-Talos/clamav/issues/343 is fixed
|
|
|
|
./remove-freshclam-test.patch
|
|
|
|
./sample-cofiguration-file-install-location.patch
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-12-09 12:39:15 +00:00
|
|
|
enableParallelBuilding = true;
|
2022-05-18 14:49:53 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config rustc rust-bindgen rustfmt cargo python3 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
2020-12-09 12:39:15 +00:00
|
|
|
zlib bzip2 libxml2 openssl ncurses curl libiconv libmilter pcre2 libmspack json_c check
|
2021-01-15 22:18:51 +00:00
|
|
|
] ++ lib.optional stdenv.isLinux systemd
|
|
|
|
++ lib.optional stdenv.isDarwin Foundation;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DSYSTEMD_UNIT_DIR=${placeholder "out"}/lib/systemd"
|
2022-06-16 17:23:12 +00:00
|
|
|
"-DAPP_CONFIG_DIRECTORY=/etc/clamav"
|
2022-05-18 14:49:53 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-12-09 12:39:15 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://www.clamav.net";
|
|
|
|
description = "Antivirus engine designed for detecting Trojans, viruses, malware and other malicious threats";
|
|
|
|
license = licenses.gpl2;
|
2022-08-12 12:06:08 +00:00
|
|
|
maintainers = with maintainers; [ robberer qknight globin ];
|
2020-07-18 16:06:22 +00:00
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|