nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchgit,
5 pkg-config,
6 perl,
7 openssl,
8 db,
9 cyrus_sasl,
10 zlib,
11 perlPackages,
12 autoreconfHook,
13 # Disabled by default as XOAUTH2 is an "OBSOLETE" SASL mechanism and this relies
14 # on a package that isn't really maintained anymore:
15 withCyrusSaslXoauth2 ? false,
16 cyrus-sasl-xoauth2,
17 makeWrapper,
18}:
19
20stdenv.mkDerivation (finalAttrs: {
21 pname = "isync";
22 version = "1.5.1";
23
24 src = fetchgit {
25 url = "https://git.code.sf.net/p/isync/isync";
26 tag = "v${finalAttrs.version}";
27 hash = "sha256-l0jL4CzAdFtQGekbywic1Kuihy3ZQi4ozhSEcbJI0t0=";
28 };
29
30 # Fixes "Fatal: buffer too small" error
31 # see https://sourceforge.net/p/isync/mailman/isync-devel/thread/87fsevvebj.fsf%40steelpick.2x.cz/
32 env.NIX_CFLAGS_COMPILE = "-DQPRINTF_BUFF=4000";
33
34 autoreconfPhase = ''
35 echo "${finalAttrs.version}" > VERSION
36 ./autogen.sh
37 '';
38
39 nativeBuildInputs = [
40 autoreconfHook
41 pkg-config
42 perl
43 ]
44 ++ lib.optionals withCyrusSaslXoauth2 [ makeWrapper ];
45 buildInputs = [
46 perlPackages.TimeDate
47 openssl
48 db
49 cyrus_sasl
50 zlib
51 ];
52
53 postInstall = lib.optionalString withCyrusSaslXoauth2 ''
54 wrapProgram "$out/bin/mbsync" \
55 --prefix SASL_PATH : "${
56 lib.makeSearchPath "lib/sasl2" [
57 cyrus-sasl-xoauth2
58 cyrus_sasl.out
59 ]
60 }"
61 '';
62
63 meta = {
64 homepage = "http://isync.sourceforge.net/";
65 # https://sourceforge.net/projects/isync/
66 changelog = "https://sourceforge.net/p/isync/isync/ci/v${finalAttrs.version}/tree/NEWS";
67 description = "Free IMAP and MailDir mailbox synchronizer";
68 longDescription = ''
69 mbsync (formerly isync) is a command line application which synchronizes
70 mailboxes. Currently Maildir and IMAP4 mailboxes are supported. New
71 messages, message deletions and flag changes can be propagated both ways.
72 '';
73 license = lib.licenses.gpl2Plus;
74 platforms = lib.platforms.unix;
75 maintainers = [ ];
76 mainProgram = "mbsync";
77 };
78})