mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-26 23:54:01 +00:00
fd78240ac8
At some point, I'd like to make another attempt at71f1f4884b
("openssl: stop static binaries referencing libs"), which was reverted in195c7da07d
. One problem with my previous attempt is that I moved OpenSSL's libraries to a lib output, but many dependent packages were hardcoding the out output as the location of the libraries. This patch fixes every such case I could find in the tree. It won't have any effect immediately, but will mean these packages will automatically use an OpenSSL lib output if it is reintroduced in future. This patch should cause very few rebuilds, because it shouldn't make any change at all to most packages I'm touching. The few rebuilds that are introduced come from when I've changed a package builder not to use variable names like openssl.out in scripts / substitution patterns, which would be confusing since they don't hardcode the output any more. I started by making the following global replacements: ${pkgs.openssl.out}/lib -> ${lib.getLib pkgs.openssl}/lib ${openssl.out}/lib -> ${lib.getLib openssl}/lib Then I removed the ".out" suffix when part of the argument to lib.makeLibraryPath, since that function uses lib.getLib internally. Then I fixed up cases where openssl was part of the -L flag to the compiler/linker, since that unambigously is referring to libraries. Then I manually investigated and fixed the following packages: - pycurl - citrix-workspace - ppp - wraith - unbound - gambit - acl2 I'm reasonably confindent in my fixes for all of them. For acl2, since the openssl library paths are manually provided above anyway, I don't think openssl is required separately as a build input at all. Removing it doesn't make a difference to the output size, the file list, or the closure. I've tested evaluation with the OfBorg meta checks, to protect against introducing evaluation failures.
64 lines
2.3 KiB
Nix
64 lines
2.3 KiB
Nix
{ lib, stdenv, fetchurl, fetchpatch, pam, openssl }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "uw-imap";
|
|
version = "2007f";
|
|
|
|
src = fetchurl {
|
|
url = "ftp://ftp.cac.washington.edu/imap/imap-${version}.tar.gz";
|
|
sha256 = "0a2a00hbakh0640r2wdpnwr8789z59wnk7rfsihh3j0vbhmmmqak";
|
|
};
|
|
|
|
makeFlags = [ (if stdenv.isDarwin
|
|
then "osx"
|
|
else "lnp") ] # Linux with PAM modules;
|
|
# -fPIC is required to compile php with imap on x86_64 systems
|
|
++ lib.optional stdenv.isx86_64 "EXTRACFLAGS=-fPIC"
|
|
++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "CC=${stdenv.hostPlatform.config}-gcc" "RANLIB=${stdenv.hostPlatform.config}-ranlib" ];
|
|
|
|
hardeningDisable = [ "format" ];
|
|
|
|
buildInputs = [ openssl ]
|
|
++ lib.optional (!stdenv.isDarwin) pam;
|
|
|
|
patches = [ (fetchpatch {
|
|
url = "https://salsa.debian.org/holmgren/uw-imap/raw/dcb42981201ea14c2d71c01ebb4a61691b6f68b3/debian/patches/1006_openssl1.1_autoverify.patch";
|
|
sha256 = "09xb58awvkhzmmjhrkqgijzgv7ia381ablf0y7i1rvhcqkb5wga7";
|
|
}) ];
|
|
|
|
postPatch = ''
|
|
sed -i src/osdep/unix/Makefile -e 's,/usr/local/ssl,${openssl.dev},'
|
|
sed -i src/osdep/unix/Makefile -e 's,^SSLCERTS=.*,SSLCERTS=/etc/ssl/certs,'
|
|
sed -i src/osdep/unix/Makefile -e 's,^SSLLIB=.*,SSLLIB=${lib.getLib openssl}/lib,'
|
|
'';
|
|
|
|
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin
|
|
"-I${openssl.dev}/include/openssl";
|
|
|
|
installPhase = ''
|
|
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/
|
|
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 = {
|
|
homepage = "https://www.washington.edu/imap/";
|
|
description = "UW IMAP toolkit - IMAP-supporting software developed by the UW";
|
|
license = lib.licenses.asl20;
|
|
platforms = with lib.platforms; linux;
|
|
};
|
|
|
|
passthru = {
|
|
withSSL = true;
|
|
};
|
|
} // lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform) {
|
|
# 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")
|
|
'';
|
|
}
|