20 jre' = if preferZulu then zulu else jre;
21 gtk' = if preferGtk3 then gtk3 else gtk2;
23 stdenv.mkDerivation rec {
28 url = "mirror://sourceforge/${pname}/${version}/${pname}-${version}-${toString rev}.zip";
29 hash = "sha256-45paGy6SfUFXK6vY8L4tHFYiio1/5ah9vTyGImdgwHI=";
33 sed -i -e '/^JAVA_OPTS/d' davmail
38 nativeBuildInputs = [ makeWrapper unzip ];
43 mkdir -p $out/share/davmail
44 cp -vR ./* $out/share/davmail
45 makeWrapper $out/share/davmail/davmail $out/bin/davmail \
46 --set-default JAVA_OPTS "-Xmx512M -Dsun.net.inetaddr.ttl=60 -Djdk.gtk.version=${lib.versions.major gtk'.version}" \
47 --prefix PATH : ${lib.makeBinPath [ jre' coreutils gnugrep ]} \
48 --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ glib gtk' libXtst ]}
54 description = "Java application which presents a Microsoft Exchange server as local CALDAV, IMAP and SMTP servers";
55 homepage = "https://davmail.sourceforge.net/";
56 license = licenses.gpl2Plus;
57 maintainers = with maintainers; [ peterhoeg ];
58 platforms = platforms.all;
59 mainProgram = "davmail";