2021-01-15 10:19:50 +01:00
|
|
|
{ lib, stdenv, fetchurl, fetchpatch, pam, openssl }:
|
2011-11-08 22:07:57 +01:00
|
|
|
|
2019-08-21 15:45:17 +02:00
|
|
|
stdenv.mkDerivation ({
|
2013-07-13 22:44:33 +02:00
|
|
|
name = "uw-imap-2007f";
|
2011-11-08 22:07:57 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "ftp://ftp.cac.washington.edu/imap/imap-2007f.tar.gz";
|
|
|
|
sha256 = "0a2a00hbakh0640r2wdpnwr8789z59wnk7rfsihh3j0vbhmmmqak";
|
|
|
|
};
|
|
|
|
|
2019-10-27 22:48:01 +01:00
|
|
|
makeFlags = [ (if stdenv.isDarwin
|
2013-07-14 03:47:14 +02:00
|
|
|
then "osx"
|
2019-10-27 22:48:01 +01:00
|
|
|
else "lnp") ] # Linux with PAM modules;
|
2013-06-24 14:32:02 +02:00
|
|
|
# -fPIC is required to compile php with imap on x86_64 systems
|
2021-01-15 10:19:50 +01:00
|
|
|
++ lib.optional stdenv.isx86_64 "EXTRACFLAGS=-fPIC"
|
|
|
|
++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "CC=${stdenv.hostPlatform.config}-gcc" "RANLIB=${stdenv.hostPlatform.config}-ranlib" ];
|
2011-11-08 22:07:57 +01:00
|
|
|
|
2016-02-26 18:38:15 +01:00
|
|
|
hardeningDisable = [ "format" ];
|
2016-02-07 23:28:15 +01:00
|
|
|
|
2013-07-14 03:47:14 +02:00
|
|
|
buildInputs = [ openssl ]
|
2021-01-15 10:19:50 +01:00
|
|
|
++ lib.optional (!stdenv.isDarwin) pam;
|
2011-11-08 22:07:57 +01:00
|
|
|
|
2017-02-14 01:30:22 +01:00
|
|
|
patches = [ (fetchpatch {
|
2019-10-04 12:42:21 +02:00
|
|
|
url = "https://salsa.debian.org/holmgren/uw-imap/raw/dcb42981201ea14c2d71c01ebb4a61691b6f68b3/debian/patches/1006_openssl1.1_autoverify.patch";
|
2017-02-14 01:30:22 +01:00
|
|
|
sha256 = "09xb58awvkhzmmjhrkqgijzgv7ia381ablf0y7i1rvhcqkb5wga7";
|
|
|
|
}) ];
|
|
|
|
|
|
|
|
postPatch = ''
|
2016-04-16 19:44:32 +02:00
|
|
|
sed -i src/osdep/unix/Makefile -e 's,/usr/local/ssl,${openssl.dev},'
|
2015-10-15 21:02:04 +02:00
|
|
|
sed -i src/osdep/unix/Makefile -e 's,^SSLCERTS=.*,SSLCERTS=/etc/ssl/certs,'
|
|
|
|
sed -i src/osdep/unix/Makefile -e 's,^SSLLIB=.*,SSLLIB=${openssl.out}/lib,'
|
2011-11-08 22:07:57 +01:00
|
|
|
'';
|
|
|
|
|
2021-01-15 10:19:50 +01:00
|
|
|
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin
|
2016-04-16 19:44:32 +02:00
|
|
|
"-I${openssl.dev}/include/openssl";
|
2013-07-14 03:47:14 +02:00
|
|
|
|
2011-11-08 22:07:57 +01:00
|
|
|
installPhase = ''
|
2017-12-04 10:08:25 +01:00
|
|
|
mkdir -p $out/bin $out/lib $out/include/c-client
|
|
|
|
cp c-client/*.h osdep/unix/*.h c-client/linkage.c c-client/auths.c $out/include/c-client/
|
2011-11-08 22:07:57 +01:00
|
|
|
cp c-client/c-client.a $out/lib/libc-client.a
|
|
|
|
cp mailutil/mailutil imapd/imapd dmail/dmail mlock/mlock mtest/mtest tmail/tmail \
|
|
|
|
tools/{an,ua} $out/bin
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://www.washington.edu/imap/";
|
2011-11-08 22:07:57 +01:00
|
|
|
description = "UW IMAP toolkit - IMAP-supporting software developed by the UW";
|
2021-01-15 10:19:50 +01:00
|
|
|
license = lib.licenses.asl20;
|
|
|
|
platforms = with lib.platforms; linux;
|
2011-11-08 22:07:57 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
withSSL = true;
|
|
|
|
};
|
2021-01-15 10:19:50 +01:00
|
|
|
} // lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform) {
|
2019-08-21 15:45:17 +02:00
|
|
|
# This is set here to prevent rebuilds on native compilation.
|
|
|
|
# Configure phase is a no-op there, because this package doesn't use ./configure scripts.
|
|
|
|
configurePhase = ''
|
|
|
|
echo "Cross-compilation, injecting make flags"
|
|
|
|
makeFlagsArray+=("ARRC=${stdenv.hostPlatform.config}-ar rc")
|
|
|
|
'';
|
|
|
|
})
|