Skip to content

Commit

Permalink
Merge #29785: curl: enable kerberos
Browse files Browse the repository at this point in the history
  • Loading branch information
vcunat committed Dec 19, 2017
2 parents 4378dc9 + 13e6a5c commit 9b54a00
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 21 deletions.
35 changes: 22 additions & 13 deletions pkgs/development/libraries/kerberos/krb5.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,41 @@ stdenv.mkDerivation rec {
sha256 = "0zn8s7anb10hw3nzwjz7vg10fgmmgvwnibn2zrn3nppjxn9f6f8n";
};

outputs = [ "out" "dev" ];

configureFlags = [ "--with-tcl=no" "--localstatedir=/var/lib"]
++ optional stdenv.isFreeBSD ''WARN_CFLAGS=""'';

nativeBuildInputs = [ pkgconfig perl yacc ]
nativeBuildInputs = [ pkgconfig perl ]
++ optional (!libOnly) yacc
# Provides the mig command used by the build scripts
++ optional stdenv.isDarwin bootstrap_cmds;
++ optional (stdenv.isDarwin && !libOnly) bootstrap_cmds;
buildInputs = [ openssl ]
++ optionals (!libOnly) [ openldap libedit ];

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;
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/libraries/serf/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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}\""
}
'';

Expand Down
9 changes: 8 additions & 1 deletion pkgs/os-specific/linux/nfs-utils/default.nix
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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"
]
Expand Down
2 changes: 1 addition & 1 deletion pkgs/servers/openafs-client/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,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"
Expand Down
7 changes: 4 additions & 3 deletions pkgs/tools/networking/curl/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
, sslSupport ? false, openssl ? null
, gnutlsSupport ? false, gnutls ? null
, scpSupport ? false, libssh2 ? null
, gssSupport ? false, gss ? null
, gssSupport ? false, kerberos ? null
, c-aresSupport ? false, c-ares ? null
, brotliSupport ? false, brotli ? null
}:
Expand All @@ -21,6 +21,7 @@ assert gnutlsSupport -> gnutls != null;
assert scpSupport -> libssh2 != null;
assert c-aresSupport -> c-ares != null;
assert brotliSupport -> brotli != null;
assert gssSupport -> kerberos != null;

stdenv.mkDerivation rec {
name = "curl-7.57.0";
Expand All @@ -45,7 +46,7 @@ stdenv.mkDerivation rec {
optional idnSupport libidn ++
optional ldapSupport openldap ++
optional zlibSupport zlib ++
optional gssSupport gss ++
optional gssSupport kerberos ++
optional c-aresSupport c-ares ++
optional sslSupport openssl ++
optional gnutlsSupport gnutls ++
Expand All @@ -70,7 +71,7 @@ stdenv.mkDerivation rec {
( if brotliSupport then "--with-brotli" else "--without-brotli" )
]
++ stdenv.lib.optional c-aresSupport "--enable-ares=${c-ares}"
++ stdenv.lib.optional gssSupport "--with-gssapi=${gss}";
++ stdenv.lib.optional gssSupport "--with-gssapi=${kerberos.dev}";

CXX = "c++";
CXXCPP = "c++ -E";
Expand Down
8 changes: 6 additions & 2 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ with pkgs;

# `fetchurl' downloads a file from the network.
fetchurl = import ../build-support/fetchurl {
inherit curl stdenv;
inherit stdenv curl;
};

fetchRepoProject = callPackage ../build-support/fetchrepoproject { };
Expand Down Expand Up @@ -1676,6 +1676,7 @@ with pkgs;
zlibSupport = true;
sslSupport = zlibSupport;
scpSupport = zlibSupport && !stdenv.isSunOS && !stdenv.isCygwin;
gssSupport = true;
};

curl_unix_socket = callPackage ../tools/networking/curl-unix-socket rec { };
Expand Down Expand Up @@ -8969,7 +8970,10 @@ with pkgs;
krb5Full = callPackage ../development/libraries/kerberos/krb5.nix {
inherit (darwin) bootstrap_cmds;
};
libkrb5 = krb5Full.override { type = "lib"; };
libkrb5 = krb5Full.override {
fetchurl = fetchurlBoot;
type = "lib";
};

languageMachines = recurseIntoAttrs (import ../development/libraries/languagemachines/packages.nix { inherit callPackage; });

Expand Down

0 comments on commit 9b54a00

Please sign in to comment.