2014-12-22 05:38:13 +01:00
|
|
|
{ stdenv, lib, fetchFromGitHub, cmake, libetpan, icu, cyrus_sasl, libctemplate
|
|
|
|
, libuchardet, pkgconfig, glib, libtidy, libxml2, libuuid, openssl
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "mailcore2-${version}";
|
|
|
|
|
2018-03-08 06:30:33 +01:00
|
|
|
version = "0.6.2";
|
2014-12-22 05:38:13 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "MailCore";
|
|
|
|
repo = "mailcore2";
|
|
|
|
rev = version;
|
2018-03-08 06:30:33 +01:00
|
|
|
sha256 = "1d0wmnkk9vnjqc28i79z3fwaaycdbprfspagik4mzdkgval5r5pm";
|
2014-12-22 05:38:13 +01:00
|
|
|
};
|
|
|
|
|
2017-09-14 21:24:37 +02:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
2014-12-22 05:38:13 +01:00
|
|
|
buildInputs = [
|
2017-09-14 21:24:37 +02:00
|
|
|
libetpan cmake icu cyrus_sasl libctemplate libuchardet glib
|
2014-12-22 05:38:13 +01:00
|
|
|
libtidy libxml2 libuuid openssl
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace CMakeLists.txt \
|
2017-03-22 14:06:43 +01:00
|
|
|
--replace " icule iculx" "" \
|
2014-12-22 05:38:13 +01:00
|
|
|
--replace "tidy/tidy.h" "tidy.h" \
|
|
|
|
--replace "/usr/include/tidy" "${libtidy}/include" \
|
2015-11-29 16:50:26 +01:00
|
|
|
--replace "/usr/include/libxml2" "${libxml2.dev}/include/libxml2"
|
2015-11-29 09:33:50 +01:00
|
|
|
substituteInPlace src/core/basetypes/MCHTMLCleaner.cpp \
|
|
|
|
--replace buffio.h tidybuffio.h
|
2014-12-22 05:38:13 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DBUILD_SHARED_LIBS=ON"
|
|
|
|
];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir $out
|
|
|
|
cp -r src/include $out
|
|
|
|
|
|
|
|
mkdir $out/lib
|
|
|
|
cp src/libMailCore.so $out/lib
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
checkPhase = ''
|
|
|
|
(
|
|
|
|
cd unittest
|
|
|
|
LD_LIBRARY_PATH="$(cd ../src; pwd)" TZ=PST8PDT ./unittestcpp ../../unittest/data
|
|
|
|
)
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A simple and asynchronous API to work with e-mail protocols IMAP, POP and SMTP";
|
|
|
|
homepage = http://libmailcore.com;
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ cstrahan ];
|
|
|
|
};
|
|
|
|
}
|