2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
python,
|
|
|
|
glibcLocales,
|
|
|
|
fetchFromGitHub,
|
|
|
|
six,
|
|
|
|
simplejson,
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "mail-parser";
|
2021-04-26 19:14:03 +00:00
|
|
|
version = "3.15.0";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "SpamScope";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-04-26 19:14:03 +00:00
|
|
|
sha256 = "0da2qr4p8jnjw6jdhbagm6slfcjnjyyjkszwfcfqvcywh1zm1sdw";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
LC_ALL = "en_US.utf-8";
|
|
|
|
|
|
|
|
nativeBuildInputs = [ glibcLocales ];
|
2024-06-05 15:53:02 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
simplejson
|
|
|
|
six
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# Taken from .travis.yml
|
|
|
|
checkPhase = ''
|
|
|
|
${python.interpreter} tests/test_main.py
|
|
|
|
${python.interpreter} -m mailparser -v
|
|
|
|
${python.interpreter} -m mailparser -h
|
|
|
|
${python.interpreter} -m mailparser -f tests/mails/mail_malformed_3 -j
|
|
|
|
cat tests/mails/mail_malformed_3 | ${python.interpreter} -m mailparser -k -j
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Mail parser for python 2 and 3";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "mailparser";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/SpamScope/mail-parser";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ psyanticy ];
|
|
|
|
};
|
|
|
|
}
|