2021-01-15 09:19:50 +00:00
|
|
|
{ lib, stdenv, fetchzip, makeWrapper, perlPackages,
|
2016-01-16 05:16:56 +00:00
|
|
|
... }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
appname = "popfile";
|
|
|
|
version = "1.1.3";
|
|
|
|
name = "${appname}-${version}";
|
|
|
|
|
|
|
|
src = fetchzip {
|
2021-07-31 17:01:50 +00:00
|
|
|
url = "https://getpopfile.org/downloads/${appname}-${version}.zip";
|
2016-01-16 05:16:56 +00:00
|
|
|
sha256 = "0gcib9j7zxk8r2vb5dbdz836djnyfza36vi8215nxcdfx1xc7l63";
|
|
|
|
stripRoot = false;
|
|
|
|
};
|
|
|
|
|
2021-02-07 09:17:39 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = (with perlPackages; [
|
2016-01-16 05:16:56 +00:00
|
|
|
## These are all taken from the popfile documentation as applicable to Linux
|
2021-07-31 17:01:50 +00:00
|
|
|
## https://getpopfile.org/docs/howtos:allplatformsrequireperl
|
2016-01-16 05:16:56 +00:00
|
|
|
perl
|
|
|
|
DBI
|
|
|
|
DBDSQLite
|
|
|
|
HTMLTagset
|
|
|
|
TimeDate # == DateParse
|
|
|
|
HTMLTemplate
|
|
|
|
# IO::Socket::Socks is not in nixpkgs
|
2017-08-11 09:40:08 +00:00
|
|
|
# IOSocketSocks
|
2016-01-16 05:16:56 +00:00
|
|
|
IOSocketSSL
|
|
|
|
NetSSLeay
|
|
|
|
SOAPLite
|
|
|
|
]);
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
# I user `cd` rather than `cp $out/* ...` b/c the * breaks syntax
|
|
|
|
# highlighting in emacs for me.
|
|
|
|
cd $src
|
|
|
|
cp -r * $out/bin
|
|
|
|
cd $out/bin
|
|
|
|
chmod +x *.pl
|
|
|
|
|
|
|
|
find $out -name '*.pl' -executable | while read path; do
|
|
|
|
wrapProgram "$path" \
|
|
|
|
--prefix PERL5LIB : $PERL5LIB:$out/bin \
|
|
|
|
--set POPFILE_ROOT $out/bin \
|
2017-11-17 12:53:54 +00:00
|
|
|
--run 'export POPFILE_USER=''${POPFILE_USER:-$HOME/.popfile}' \
|
2017-11-17 10:15:52 +00:00
|
|
|
--run 'test -d "$POPFILE_USER" || mkdir -m 0700 -p "$POPFILE_USER"'
|
2016-01-16 05:16:56 +00:00
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2016-02-27 17:24:00 +00:00
|
|
|
description = "An email classification system that automatically sorts messages and fights spam";
|
2021-12-31 18:48:29 +00:00
|
|
|
homepage = "https://getpopfile.org/";
|
2021-01-15 09:19:50 +00:00
|
|
|
license = lib.licenses.gpl2;
|
2016-01-16 05:16:56 +00:00
|
|
|
|
2017-08-06 22:05:18 +00:00
|
|
|
# Should work on macOS, but havent tested it.
|
2016-01-16 05:16:56 +00:00
|
|
|
# Windows support is more complicated.
|
2021-07-31 17:01:50 +00:00
|
|
|
# https://getpopfile.org/docs/faq:systemrequirements
|
2021-01-15 09:19:50 +00:00
|
|
|
platforms = lib.platforms.linux;
|
2016-01-16 05:16:56 +00:00
|
|
|
};
|
|
|
|
}
|