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.
82 lines
2.6 KiB
Nix
82 lines
2.6 KiB
Nix
{ lib, stdenv, fetchurl, makeWrapper, apr, expat, gnused
|
|
, sslSupport ? true, openssl
|
|
, bdbSupport ? true, db
|
|
, ldapSupport ? !stdenv.isCygwin, openldap
|
|
, libiconv
|
|
, cyrus_sasl, autoreconfHook
|
|
}:
|
|
|
|
assert sslSupport -> openssl != null;
|
|
assert bdbSupport -> db != null;
|
|
assert ldapSupport -> openldap != null;
|
|
|
|
with lib;
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "apr-util";
|
|
version = "1.6.1";
|
|
|
|
src = fetchurl {
|
|
url = "mirror://apache/apr/${pname}-${version}.tar.bz2";
|
|
sha256 = "0nq3s1yn13vplgl6qfm09f7n0wm08malff9s59bqf9nid9xjzqfk";
|
|
};
|
|
|
|
patches = optional stdenv.isFreeBSD ./include-static-dependencies.patch;
|
|
|
|
outputs = [ "out" "dev" ];
|
|
outputBin = "dev";
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
buildInputs = optional stdenv.isFreeBSD autoreconfHook;
|
|
|
|
configureFlags = [ "--with-apr=${apr.dev}" "--with-expat=${expat.dev}" ]
|
|
++ optional (!stdenv.isCygwin) "--with-crypto"
|
|
++ optional sslSupport "--with-openssl=${openssl.dev}"
|
|
++ optional bdbSupport "--with-berkeley-db=${db.dev}"
|
|
++ optional ldapSupport "--with-ldap=ldap"
|
|
++ optionals stdenv.isCygwin
|
|
[ "--without-pgsql" "--without-sqlite2" "--without-sqlite3"
|
|
"--without-freetds" "--without-berkeley-db" "--without-crypto" ]
|
|
;
|
|
|
|
# For some reason, db version 6.9 is selected when cross-compiling.
|
|
# It's unclear as to why, it requires someone with more autotools / configure knowledge to go deeper into that.
|
|
# Always replacing the link flag with a generic link flag seems to help though, so let's do that for now.
|
|
postConfigure = lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
|
|
substituteInPlace Makefile \
|
|
--replace "-ldb-6.9" "-ldb"
|
|
'';
|
|
|
|
propagatedBuildInputs = [ apr expat libiconv ]
|
|
++ optional sslSupport openssl
|
|
++ optional bdbSupport db
|
|
++ optional ldapSupport openldap
|
|
++ optional stdenv.isFreeBSD cyrus_sasl;
|
|
|
|
postInstall = ''
|
|
for f in $out/lib/*.la $out/lib/apr-util-1/*.la $dev/bin/apu-1-config; do
|
|
substituteInPlace $f \
|
|
--replace "${expat.dev}/lib" "${expat.out}/lib" \
|
|
--replace "${db.dev}/lib" "${db.out}/lib" \
|
|
--replace "${openssl.dev}/lib" "${lib.getLib openssl}/lib"
|
|
done
|
|
|
|
# Give apr1 access to sed for runtime invocations.
|
|
wrapProgram $dev/bin/apu-1-config --prefix PATH : "${gnused}/bin"
|
|
'';
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
passthru = {
|
|
inherit sslSupport bdbSupport ldapSupport;
|
|
};
|
|
|
|
meta = with lib; {
|
|
homepage = "https://apr.apache.org/";
|
|
description = "A companion library to APR, the Apache Portable Runtime";
|
|
maintainers = [ maintainers.eelco ];
|
|
platforms = platforms.unix;
|
|
license = licenses.asl20;
|
|
};
|
|
}
|