From 13e6a5c56103cad7aa5ecdd8888aa9172d20a6ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Sun, 17 Dec 2017 14:51:32 +0100 Subject: [PATCH] kerberos: split headers into $dev --- pkgs/development/libraries/kerberos/krb5.nix | 30 +++++++++++++------- pkgs/development/libraries/serf/default.nix | 2 +- pkgs/os-specific/linux/nfs-utils/default.nix | 9 +++++- pkgs/servers/openafs-client/default.nix | 2 +- pkgs/tools/networking/curl/default.nix | 2 +- 5 files changed, 30 insertions(+), 15 deletions(-) diff --git a/pkgs/development/libraries/kerberos/krb5.nix b/pkgs/development/libraries/kerberos/krb5.nix index 64fa3d3d7d66..1c589be521ea 100644 --- a/pkgs/development/libraries/kerberos/krb5.nix +++ b/pkgs/development/libraries/kerberos/krb5.nix @@ -19,6 +19,8 @@ stdenv.mkDerivation rec { sha256 = "0zn8s7anb10hw3nzwjz7vg10fgmmgvwnibn2zrn3nppjxn9f6f8n"; }; + outputs = [ "out" "dev" ]; + configureFlags = [ "--with-tcl=no" "--localstatedir=/var/lib"] ++ optional stdenv.isFreeBSD ''WARN_CFLAGS=""''; @@ -32,20 +34,26 @@ stdenv.mkDerivation rec { preConfigure = "cd ./src"; buildPhase = optionalString libOnly '' - (cd util; make -j $NIX_BUILD_CORES) - (cd include; make -j $NIX_BUILD_CORES) - (cd lib; make -j $NIX_BUILD_CORES) - (cd build-tools; make -j $NIX_BUILD_CORES) + MAKE="make -j $NIX_BUILD_CORES -l $NIX_BUILD_CORES" + (cd util; $MAKE) + (cd include; $MAKE) + (cd lib; $MAKE) + (cd build-tools; $MAKE) ''; installPhase = optionalString libOnly '' - mkdir -p $out/{bin,include/{gssapi,gssrpc,kadm5,krb5},lib/pkgconfig,sbin,share/{et,man/man1}} - (cd util; make -j $NIX_BUILD_CORES install) - (cd include; make -j $NIX_BUILD_CORES install) - (cd lib; make -j $NIX_BUILD_CORES install) - (cd build-tools; make -j $NIX_BUILD_CORES install) - rm -rf $out/{sbin,share} - find $out/bin -type f | grep -v 'krb5-config' | xargs rm + mkdir -p "$out"/{bin,sbin,lib/pkgconfig,share/{et,man/man1}} \ + "$dev"/include/{gssapi,gssrpc,kadm5,krb5} + (cd util; $MAKE install) + (cd include; $MAKE install) + (cd lib; $MAKE install) + (cd build-tools; $MAKE install) + ${postInstall} + ''; + + # not via outputBin, due to reference from libkrb5.so + postInstall = '' + moveToOutput bin "$dev" ''; enableParallelBuilding = true; diff --git a/pkgs/development/libraries/serf/default.nix b/pkgs/development/libraries/serf/default.nix index 001199cd8212..81dff49571da 100644 --- a/pkgs/development/libraries/serf/default.nix +++ b/pkgs/development/libraries/serf/default.nix @@ -28,7 +28,7 @@ stdenv.mkDerivation rec { APU="$(echo "${aprutil.dev}"/bin/*-config)" CC="${ if stdenv.cc.isClang then "clang" else "${stdenv.cc}/bin/gcc" }" ${ - if (stdenv.isDarwin || stdenv.isCygwin) then "" else "GSSAPI=\"${kerberos}\"" + if (stdenv.isDarwin || stdenv.isCygwin) then "" else "GSSAPI=\"${kerberos.dev}\"" } ''; diff --git a/pkgs/os-specific/linux/nfs-utils/default.nix b/pkgs/os-specific/linux/nfs-utils/default.nix index 294dde2a0a69..515a7d1d8f41 100644 --- a/pkgs/os-specific/linux/nfs-utils/default.nix +++ b/pkgs/os-specific/linux/nfs-utils/default.nix @@ -1,10 +1,17 @@ { stdenv, fetchurl, lib, pkgconfig, utillinux, libcap, libtirpc, libevent, libnfsidmap , sqlite, kerberos, kmod, libuuid, keyutils, lvm2, systemd, coreutils, tcp_wrappers +, buildEnv }: let statdPath = lib.makeBinPath [ systemd utillinux coreutils ]; + # Not nice; feel free to find a nicer solution. + kerberosEnv = buildEnv { + name = "kerberos-env-${kerberos.version}"; + paths = with lib; [ (getDev kerberos) (getLib kerberos) ]; + }; + in stdenv.mkDerivation rec { name = "nfs-utils-${version}"; version = "2.1.1"; @@ -26,7 +33,7 @@ in stdenv.mkDerivation rec { configureFlags = [ "--enable-gss" "--with-statedir=/var/lib/nfs" - "--with-krb5=${kerberos}" + "--with-krb5=${kerberosEnv}" "--with-systemd=$(out)/etc/systemd/system" "--enable-libmount-mount" ] diff --git a/pkgs/servers/openafs-client/default.nix b/pkgs/servers/openafs-client/default.nix index 263df09ebb56..6eae365af01f 100644 --- a/pkgs/servers/openafs-client/default.nix +++ b/pkgs/servers/openafs-client/default.nix @@ -30,7 +30,7 @@ stdenv.mkDerivation rec { ./regen.sh ${stdenv.lib.optionalString (kerberos != null) - "export KRB5_CONFIG=${kerberos}/bin/krb5-config"} + "export KRB5_CONFIG=${kerberos.dev}/bin/krb5-config"} configureFlagsArray=( "--with-linux-kernel-build=$TMP/linux" diff --git a/pkgs/tools/networking/curl/default.nix b/pkgs/tools/networking/curl/default.nix index 814bc1c5ff36..52e902ec3a58 100644 --- a/pkgs/tools/networking/curl/default.nix +++ b/pkgs/tools/networking/curl/default.nix @@ -67,7 +67,7 @@ stdenv.mkDerivation rec { ( if idnSupport then "--with-libidn=${libidn.dev}" else "--without-libidn" ) ] ++ stdenv.lib.optional c-aresSupport "--enable-ares=${c-ares}" - ++ stdenv.lib.optional gssSupport "--with-gssapi=${kerberos}"; + ++ stdenv.lib.optional gssSupport "--with-gssapi=${kerberos.dev}"; CXX = "c++"; CXXCPP = "c++ -E";