2023-11-04 13:58:18 +00:00
|
|
|
{ lib
|
|
|
|
, perlPackages
|
|
|
|
, fetchFromGitHub
|
2024-04-26 20:24:03 +00:00
|
|
|
, wrapGAppsHook3
|
2023-11-04 13:58:18 +00:00
|
|
|
, gobject-introspection
|
|
|
|
, perl
|
|
|
|
, clamav
|
|
|
|
}:
|
|
|
|
|
|
|
|
perlPackages.buildPerlPackage rec {
|
|
|
|
pname = "clamtk";
|
2024-01-27 08:30:50 +00:00
|
|
|
version = "6.18";
|
2023-11-04 13:58:18 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "dave-theunsub";
|
|
|
|
repo = "clamtk";
|
|
|
|
rev = "v${version}";
|
2024-01-27 08:30:50 +00:00
|
|
|
hash = "sha256-ClBsBXbGj67zgrkA9EjgK7s3OmXOJA+xV5xLGOcMsbI=";
|
2023-11-04 13:58:18 +00:00
|
|
|
};
|
|
|
|
|
2024-04-26 20:24:03 +00:00
|
|
|
nativeBuildInputs = [ wrapGAppsHook3 gobject-introspection ];
|
2023-11-04 13:58:18 +00:00
|
|
|
buildInputs = [ perl clamav ];
|
|
|
|
propagatedBuildInputs = with perlPackages; [ Glib LWP LWPProtocolHttps TextCSV JSON LocaleGettext Gtk3 ];
|
|
|
|
|
|
|
|
preConfigure = "touch Makefile.PL";
|
|
|
|
# no tests implemented
|
|
|
|
doCheck = false;
|
|
|
|
outputs = [ "out" "man" ];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# Set correct nix paths in perl scripts
|
|
|
|
substituteInPlace lib/App.pm \
|
|
|
|
--replace /usr/bin/freshclam ${lib.getBin clamav}/bin/freshclam \
|
|
|
|
--replace /usr/bin/sigtool ${lib.getBin clamav}/bin/sigtool \
|
|
|
|
--replace /usr/bin/clamscan ${lib.getBin clamav}/bin/clamscan \
|
|
|
|
--replace /usr/bin/clamdscan ${lib.getBin clamav}/bin/clamdscan \
|
|
|
|
--replace /usr/share/pixmaps $out/share/pixmaps
|
|
|
|
|
|
|
|
# We want to catch the crontab wrapper on NixOS and the
|
|
|
|
# System crontab on non-NixOS so we don't give a full path.
|
|
|
|
substituteInPlace lib/Schedule.pm \
|
|
|
|
--replace "( -e '/usr/bin/crontab' )" "(1)" \
|
|
|
|
--replace /usr/bin/crontab crontab
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
2024-01-27 08:30:50 +00:00
|
|
|
install -Dm755 clamtk -t $out/bin
|
|
|
|
install -Dm444 lib/*.pm -t $out/lib/perl5/site_perl/ClamTk
|
|
|
|
install -Dm444 clamtk.desktop -t $out/share/applications
|
|
|
|
install -Dm444 images/* -t $out/share/pixmaps
|
|
|
|
install -Dm444 clamtk.1.gz -t $out/share/man/man1
|
|
|
|
install -Dm444 {CHANGES,LICENSE,*.md} -t $out/share/doc/clamtk
|
2023-11-04 13:58:18 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2023-11-21 04:59:07 +00:00
|
|
|
preFixup = ''
|
|
|
|
gappsWrapperArgs+=(
|
|
|
|
--prefix PERL5LIB : $PERL5LIB
|
|
|
|
--set GI_TYPELIB_PATH "$GI_TYPELIB_PATH"
|
|
|
|
)
|
|
|
|
'';
|
|
|
|
|
2023-11-04 13:58:18 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = ''
|
|
|
|
Easy to use, lightweight front-end for ClamAV (Clam Antivirus).
|
|
|
|
'';
|
2024-03-19 02:14:51 +00:00
|
|
|
mainProgram = "clamtk";
|
2023-11-04 13:58:18 +00:00
|
|
|
license = licenses.gpl1Plus;
|
|
|
|
homepage = "https://github.com/dave-theunsub/clamtk";
|
|
|
|
platforms = platforms.linux;
|
2023-11-24 13:32:09 +00:00
|
|
|
maintainers = with maintainers; [ chewblacka ShamrockLee ];
|
2023-11-04 13:58:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|