2022-05-13 11:33:40 +01:00
|
|
|
{ lib, stdenv, fetchurl, pkg-config, cmake
|
2018-07-15 21:02:26 +01:00
|
|
|
, zlib, bzip2, libiconv, libxml2, openssl, ncurses, curl, libmilter, pcre2
|
2020-11-26 20:17:17 +00:00
|
|
|
, libmspack, systemd, Foundation, json_c, check
|
2022-05-13 11:33:40 +01:00
|
|
|
, rustc, rust-bindgen, rustfmt, cargo, python3
|
2018-01-26 15:02:29 +00:00
|
|
|
}:
|
2015-09-29 19:08:53 +01:00
|
|
|
|
2012-07-23 15:21:25 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "clamav";
|
2023-10-27 12:16:24 +01:00
|
|
|
version = "1.2.1";
|
2012-07-23 15:21:25 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-08-15 13:41:18 +01:00
|
|
|
url = "https://www.clamav.net/downloads/production/${pname}-${version}.tar.gz";
|
2023-10-27 12:16:24 +01:00
|
|
|
hash = "sha256-mhT+hwy7j1959mi3idyg8lzGviKr4y9PfTZ35O45NbA=";
|
2012-07-23 15:21:25 +01:00
|
|
|
};
|
|
|
|
|
2022-05-19 13:41:51 +01: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
|
|
|
|
];
|
2016-11-15 03:40:33 +00:00
|
|
|
|
2020-11-26 20:17:17 +00:00
|
|
|
enableParallelBuilding = true;
|
2022-05-13 11:33:40 +01:00
|
|
|
nativeBuildInputs = [ cmake pkg-config rustc rust-bindgen rustfmt cargo python3 ];
|
2016-11-15 01:02:25 +00:00
|
|
|
buildInputs = [
|
2020-11-26 20:17:17 +00:00
|
|
|
zlib bzip2 libxml2 openssl ncurses curl libiconv libmilter pcre2 libmspack json_c check
|
2021-01-15 09:19:50 +00:00
|
|
|
] ++ lib.optional stdenv.isLinux systemd
|
|
|
|
++ lib.optional stdenv.isDarwin Foundation;
|
2012-07-23 15:21:25 +01:00
|
|
|
|
2022-05-13 11:33:40 +01:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DSYSTEMD_UNIT_DIR=${placeholder "out"}/lib/systemd"
|
2022-05-19 13:41:51 +01:00
|
|
|
"-DAPP_CONFIG_DIRECTORY=/etc/clamav"
|
2022-05-13 11:33:40 +01:00
|
|
|
];
|
2012-07-23 15:21:25 +01:00
|
|
|
|
2020-11-26 20:17:17 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://www.clamav.net";
|
2013-10-05 15:22:46 +01:00
|
|
|
description = "Antivirus engine designed for detecting Trojans, viruses, malware and other malicious threats";
|
2012-07-23 15:21:25 +01:00
|
|
|
license = licenses.gpl2;
|
2022-08-03 13:13:56 +01:00
|
|
|
maintainers = with maintainers; [ robberer qknight globin ];
|
2020-06-15 11:09:27 +01:00
|
|
|
platforms = platforms.unix;
|
2012-07-23 15:21:25 +01:00
|
|
|
};
|
|
|
|
}
|