From 769ea09360b8bbc8e5410dfac1d05206ee38b2eb Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Fri, 26 Jun 2015 22:41:25 -0700 Subject: [PATCH] heimdal: Use the git version and breakout into a library --- .../libraries/kerberos/heimdal.nix | 71 +++++++++++++------ pkgs/top-level/all-packages.nix | 9 +-- 2 files changed, 50 insertions(+), 30 deletions(-) diff --git a/pkgs/development/libraries/kerberos/heimdal.nix b/pkgs/development/libraries/kerberos/heimdal.nix index 320e161d3da8..f61af50088b8 100644 --- a/pkgs/development/libraries/kerberos/heimdal.nix +++ b/pkgs/development/libraries/kerberos/heimdal.nix @@ -1,54 +1,79 @@ -{ stdenv, fetchurl, pkgconfig, flex, yacc, readline, openldap, libcap_ng -, sqlite, db, ncurses, openssl, cyrus_sasl +{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, python, perl, yacc, flex +, texinfo, perlPackages +, openldap, libcap_ng, sqlite, openssl, db, libedit, pam + +# Extra Args +, type ? "" }: +let + libOnly = type == "lib"; +in +with stdenv.lib; stdenv.mkDerivation rec { - name = "heimdal-1.5.3"; + name = "${type}heimdal-2015-06-17"; - src = fetchurl { - urls = [ - "http://www.h5l.org/dist/src/${name}.tar.gz" - "http://ftp.pdc.kth.se/pub/heimdal/src/${name}.tar.gz" - ]; - sha256 = "19gypf9vzfrs2bw231qljfl4cqc1riyg0ai0xmm1nd1wngnpphma"; + src = fetchFromGitHub { + owner = "heimdal"; + repo = "heimdal"; + rev = "be63a2914adcbea7d42d56e674ee6edb4883ebaf"; + sha256 = "147gv49gmy94y6f0x1vx523qni0frgcp3r7fill0r06rkfgfzc0j"; }; + nativeBuildInputs = [ autoreconfHook pkgconfig python perl yacc flex ] + ++ (with perlPackages; [ JSON ]) + ++ optional (!libOnly) texinfo; + buildInputs = [ libcap_ng sqlite openssl db libedit ] + ++ optionals (!libOnly) [ openldap pam ]; + ## ugly, X should be made an option configureFlags = [ + "--sysconfdir=/etc" + "--localstatedir=/var" "--enable-hdb-openldap-module" "--with-capng" - "--with-openldap=${openldap}" "--with-sqlite3=${sqlite}" - "--with-openssl-lib=${openssl}/lib" + "--with-berkeley-db=${db}" + "--with-libedit=${libedit}" + "--with-openssl=${openssl}" "--without-x" + ] ++ optionals (!libOnly) [ + "--with-openldap=${openldap}" ]; - preConfigure = '' - export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -pthread" + buildPhase = optionalString libOnly '' + (cd include; make -j $NIX_BUILD_CORES) + (cd lib; make -j $NIX_BUILD_CORES) + (cd tools; make -j $NIX_BUILD_CORES) + ''; + + installPhase = optionalString libOnly '' + (cd include; make -j $NIX_BUILD_CORES install) + (cd lib; make -j $NIX_BUILD_CORES install) + (cd tools; make -j $NIX_BUILD_CORES install) + rm -rf $out/{libexec,sbin,share} + find $out/bin -type f | grep -v 'krb5-config' | xargs rm ''; # We need to build hcrypt for applications like samba postBuild = '' - (cd lib/hcrypto; make) - (cd include/hcrypto; make) + (cd include/hcrypto; make -j $NIX_BUILD_CORES) + (cd lib/hcrypto; make -j $NIX_BUILD_CORES) ''; postInstall = '' # Install hcrypto - (cd lib/hcrypto; make install) - (cd include/hcrypto; make install) + (cd include/hcrypto; make -j $NIX_BUILD_CORES install) + (cd lib/hcrypto; make -j $NIX_BUILD_CORES install) - # dont succeed with --libexec=$out/sbin, so + # Doesn't succeed with --libexec=$out/sbin, so mv "$out/libexec/"* $out/sbin/ rmdir $out/libexec ''; - buildInputs = [ - pkgconfig flex yacc readline openldap libcap_ng sqlite db ncurses - cyrus_sasl openssl - ]; + enableParallelBuilding = true; - meta = with stdenv.lib; { + meta = { description = "an implementation of Kerberos 5 (and some more stuff) largely written in Sweden"; license = licenses.bsd3; platforms = platforms.linux; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 247ff38acd77..a7f70abcee29 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6389,13 +6389,8 @@ let # We are using mit-krb5 because it is better maintained kerberos = libkrb5; - heimdal = callPackage ../development/libraries/kerberos/heimdal.nix { - openldap = openldap.override { - cyrus_sasl = cyrus_sasl.override { kerberos = null; }; - }; - cyrus_sasl = cyrus_sasl.override { kerberos = null; }; - }; - libheimdal = heimdal; + heimdal = callPackage ../development/libraries/kerberos/heimdal.nix { }; + libheimdal = heimdal.override { type = "lib"; }; harfbuzz = callPackage ../development/libraries/harfbuzz { }; harfbuzz-icu = callPackage ../development/libraries/harfbuzz {