about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/kerberos
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:36 +0000
committerAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:47 +0000
commit36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch)
treeb3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/development/libraries/kerberos
parent4e31070265257dc67d120c27e0f75c2344fdfa9a (diff)
parentabf060725d7614bd3b9f96764262dfbc2f9c2199 (diff)
downloadnixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs
git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a
git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/kerberos')
-rw-r--r--nixpkgs/pkgs/development/libraries/kerberos/heimdal-make-missing-headers.patch10
-rw-r--r--nixpkgs/pkgs/development/libraries/kerberos/heimdal.nix99
-rw-r--r--nixpkgs/pkgs/development/libraries/kerberos/krb5.nix83
3 files changed, 192 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/kerberos/heimdal-make-missing-headers.patch b/nixpkgs/pkgs/development/libraries/kerberos/heimdal-make-missing-headers.patch
new file mode 100644
index 000000000000..a0fa625538b7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kerberos/heimdal-make-missing-headers.patch
@@ -0,0 +1,10 @@
+--- a/lib/hx509/Makefile.am 2018-03-21 15:41:38.622968809 +0100
++++ b/lib/hx509/Makefile.am 2018-03-21 15:41:32.655162197 +0100
+@@ -9,6 +9,8 @@
+	sel-gram.h			\
+	$(gen_files_ocsp:.x=.c)		\
+	$(gen_files_pkcs10:.x=.c)	\
++	ocsp_asn1.h			\
++	pkcs10_asn1.h			\
+	hx509_err.c			\
+	hx509_err.h
diff --git a/nixpkgs/pkgs/development/libraries/kerberos/heimdal.nix b/nixpkgs/pkgs/development/libraries/kerberos/heimdal.nix
new file mode 100644
index 000000000000..5b92458d89e9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kerberos/heimdal.nix
@@ -0,0 +1,99 @@
+{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, python2, perl, yacc, flex
+, texinfo, perlPackages
+, openldap, libcap_ng, sqlite, openssl, db, libedit, pam
+, CoreFoundation, Security, SystemConfiguration
+}:
+
+with stdenv.lib;
+stdenv.mkDerivation rec {
+  name = "heimdal-${version}";
+  version = "7.5.0";
+
+  src = fetchFromGitHub {
+    owner = "heimdal";
+    repo = "heimdal";
+    rev = "heimdal-${version}";
+    sha256 = "1j38wjj4k0q8vx168k3d3k0fwa8j1q5q8f2688nnx1b9qgjd6w1d";
+  };
+
+  outputs = [ "out" "dev" "man" "info" ];
+
+  patches = [ ./heimdal-make-missing-headers.patch ];
+
+  nativeBuildInputs = [ autoreconfHook pkgconfig python2 perl yacc flex texinfo ]
+    ++ (with perlPackages; [ JSON ]);
+  buildInputs = optionals (stdenv.isLinux) [ libcap_ng ]
+    ++ [ db sqlite openssl libedit openldap pam]
+    ++ optionals (stdenv.isDarwin) [ CoreFoundation Security SystemConfiguration ];
+
+  ## ugly, X should be made an option
+  configureFlags = [
+    "--sysconfdir=/etc"
+    "--localstatedir=/var"
+    "--infodir=$info/share/info"
+    "--enable-hdb-openldap-module"
+    "--with-sqlite3=${sqlite.dev}"
+
+  # ugly, --with-libedit is not enought, it fall back to bundled libedit
+    "--with-libedit-include=${libedit.dev}/include"
+    "--with-libedit-lib=${libedit}/lib"
+    "--with-openssl=${openssl.dev}"
+    "--without-x"
+    "--with-berkeley-db"
+    "--with-berkeley-db-include=${db.dev}/include"
+    "--with-openldap=${openldap.dev}"
+  ] ++ optionals (stdenv.isLinux) [
+    "--with-capng"
+  ];
+
+  postUnpack = ''
+    sed -i '/^DEFAULT_INCLUDES/ s,$, -I..,' source/cf/Makefile.am.common
+    sed -i -e 's/date/date --date="@$SOURCE_DATE_EPOCH"/' source/configure.ac 
+  '';
+
+  preConfigure = ''
+    configureFlagsArray+=(
+      "--bindir=$out/bin"
+      "--sbindir=$out/sbin"
+      "--libexecdir=$out/libexec/heimdal"
+      "--mandir=$man/share/man"
+      "--infodir=$man/share/info"
+      "--includedir=$dev/include")
+  '';
+
+  # We need to build hcrypt for applications like samba
+  postBuild = ''
+    (cd include/hcrypto; make -j $NIX_BUILD_CORES)
+    (cd lib/hcrypto; make -j $NIX_BUILD_CORES)
+  '';
+
+  postInstall = ''
+    # Install hcrypto
+    (cd include/hcrypto; make -j $NIX_BUILD_CORES install)
+    (cd lib/hcrypto; make -j $NIX_BUILD_CORES install)
+
+    # Do we need it?
+    rm $out/bin/su
+
+    mkdir -p $dev/bin
+    mv $out/bin/krb5-config $dev/bin/
+
+    # asn1 compilers, move them to $dev
+    mv $out/libexec/heimdal/heimdal/* $dev/bin
+    rmdir $out/libexec/heimdal/heimdal
+  '';
+
+  # Issues with hydra
+  #  In file included from hxtool.c:34:0:
+  #  hx_locl.h:67:25: fatal error: pkcs10_asn1.h: No such file or directory
+  #enableParallelBuilding = true;
+
+  meta = {
+    description = "An implementation of Kerberos 5 (and some more stuff)";
+    license = licenses.bsd3;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ wkennington ];
+  };
+
+  passthru.implementation = "heimdal";
+}
diff --git a/nixpkgs/pkgs/development/libraries/kerberos/krb5.nix b/nixpkgs/pkgs/development/libraries/kerberos/krb5.nix
new file mode 100644
index 000000000000..165f9139ff1f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kerberos/krb5.nix
@@ -0,0 +1,83 @@
+{ stdenv, fetchurl, pkgconfig, perl, yacc, bootstrap_cmds
+, openssl, openldap, libedit, keyutils
+
+# Extra Arguments
+, type ? ""
+# This is called "staticOnly" because krb5 does not support
+# builting both static and shared, see below.
+, staticOnly ? false
+}:
+
+let
+  libOnly = type == "lib";
+in
+with stdenv.lib;
+stdenv.mkDerivation rec {
+  name = "${type}krb5-${version}";
+  majorVersion = "1.15";
+  version = "${majorVersion}.2";
+
+  src = fetchurl {
+    url = "${meta.homepage}dist/krb5/${majorVersion}/krb5-${version}.tar.gz";
+    sha256 = "0zn8s7anb10hw3nzwjz7vg10fgmmgvwnibn2zrn3nppjxn9f6f8n";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  configureFlags = [ "--with-tcl=no" "--localstatedir=/var/lib"]
+    # krb5's ./configure does not allow passing --enable-shared and --enable-static at the same time.
+    # See https://bbs.archlinux.org/viewtopic.php?pid=1576737#p1576737
+    ++ optional staticOnly [ "--enable-static" "--disable-shared" ]
+    ++ optional stdenv.isFreeBSD ''WARN_CFLAGS=""''
+    ++ optionals (stdenv.buildPlatform != stdenv.hostPlatform)
+       [ "krb5_cv_attr_constructor_destructor=yes,yes"
+         "ac_cv_func_regcomp=yes"
+         "ac_cv_printf_positional=yes"
+       ];
+
+  nativeBuildInputs = [ pkgconfig perl ]
+    ++ optional (!libOnly) yacc
+    # Provides the mig command used by the build scripts
+    ++ optional stdenv.isDarwin bootstrap_cmds;
+  buildInputs = [ openssl ]
+    ++ optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.libc != "bionic") [ keyutils ]
+    ++ optionals (!libOnly) [ openldap libedit ];
+
+  preConfigure = "cd ./src";
+
+  buildPhase = optionalString libOnly ''
+    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,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;
+  doCheck = false; # fails with "No suitable file for testing purposes"
+
+  meta = {
+    description = "MIT Kerberos 5";
+    homepage = http://web.mit.edu/kerberos/;
+    license = licenses.mit;
+    platforms = platforms.unix ++ platforms.windows;
+    maintainers = with maintainers; [ wkennington ];
+  };
+
+  passthru.implementation = "krb5";
+}