From 8127edc33590cc9a156afa762b57a4151e1253c5 Mon Sep 17 00:00:00 2001 From: Charles Strahan Date: Sun, 21 Dec 2014 23:38:13 -0500 Subject: [PATCH] mailcore2: new package MailCore 2 provides a simple and asynchronous API to work with e-mail protocols IMAP, POP and SMTP. Closes #5430 --- .../libraries/mailcore2/default.nix | 55 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 57 insertions(+) create mode 100644 pkgs/development/libraries/mailcore2/default.nix diff --git a/pkgs/development/libraries/mailcore2/default.nix b/pkgs/development/libraries/mailcore2/default.nix new file mode 100644 index 000000000000..a2891f9207d3 --- /dev/null +++ b/pkgs/development/libraries/mailcore2/default.nix @@ -0,0 +1,55 @@ +{ stdenv, lib, fetchFromGitHub, cmake, libetpan, icu, cyrus_sasl, libctemplate +, libuchardet, pkgconfig, glib, libtidy, libxml2, libuuid, openssl +}: + +stdenv.mkDerivation rec { + name = "mailcore2-${version}"; + + version = "0.5"; + + src = fetchFromGitHub { + owner = "MailCore"; + repo = "mailcore2"; + rev = version; + sha256 = "1f2kpw8ha4j43jlimw0my9b7x1gbik7yyg1m87q6nhbbsci78qly"; + }; + + buildInputs = [ + libetpan cmake icu cyrus_sasl libctemplate libuchardet pkgconfig glib + libtidy libxml2 libuuid openssl + ]; + + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace "tidy/tidy.h" "tidy.h" \ + --replace "/usr/include/tidy" "${libtidy}/include" \ + --replace "/usr/include/libxml2" "${libxml2}/include/libxml2" \ + ''; + + 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 ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1fbe58aeb50f..a2e87913768a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12597,6 +12597,8 @@ let lilypond = callPackage ../misc/lilypond { guile = guile_1_8; }; + mailcore2 = callPackage ../development/libraries/mailcore2 { }; + martyr = callPackage ../development/libraries/martyr { }; mess = callPackage ../misc/emulators/mess {