heimdal: Use the git version and breakout into a library

This commit is contained in:
William A. Kennington III 2015-06-26 22:41:25 -07:00
parent ccc47a6a42
commit 769ea09360
2 changed files with 50 additions and 30 deletions

View File

@ -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;

View File

@ -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 {