nixpkgs/pkgs/development/libraries/kerberos/heimdal.nix

93 lines
2.7 KiB
Nix
Raw Normal View History

{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, python, perl, yacc, flex
, texinfo, perlPackages
, openldap, libcap_ng, sqlite, openssl, db, libedit, pam
# Extra Args
, type ? ""
2014-12-30 09:32:41 +01:00
}:
let
libOnly = type == "lib";
in
with stdenv.lib;
stdenv.mkDerivation rec {
2015-09-16 22:14:23 +02:00
name = "${type}heimdal-2015-09-13";
src = fetchFromGitHub {
owner = "heimdal";
repo = "heimdal";
2015-09-16 22:14:23 +02:00
rev = "c81572ab5dcee3062e715b9e25ca7a20f6ec456b";
sha256 = "1r60i4v6y5lpll0l2qpn0ycp6q6f1xjg7k1csi547zls8k96yk9s";
};
nativeBuildInputs = [ autoreconfHook pkgconfig python perl yacc flex ]
++ (with perlPackages; [ JSON ])
++ optional (!libOnly) texinfo;
buildInputs = (if (!stdenv.isFreeBSD) then [ libcap_ng db ] else []) ++ [ sqlite openssl libedit ]
++ optionals (!libOnly) [ openldap pam ];
## ugly, X should be made an option
configureFlags = [
"--sysconfdir=/etc"
"--localstatedir=/var"
"--enable-hdb-openldap-module"
"--with-sqlite3=${sqlite}"
"--with-libedit=${libedit}"
"--with-openssl=${openssl}"
"--without-x"
2015-12-23 14:51:11 +01:00
"--with-berkeley-db=${db}"
] ++ optionals (!libOnly) [
"--with-openldap=${openldap}"
] ++ optionals (!stdenv.isFreeBSD) [
"--with-capng"
];
2014-12-30 09:32:41 +01:00
buildPhase = optionalString libOnly ''
(cd include; make -j $NIX_BUILD_CORES)
(cd lib; make -j $NIX_BUILD_CORES)
(cd tools; make -j $NIX_BUILD_CORES)
2015-06-27 07:45:20 +02:00
(cd include/hcrypto; make -j $NIX_BUILD_CORES)
(cd lib/hcrypto; 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)
2015-06-27 07:45:20 +02:00
(cd include/hcrypto; make -j $NIX_BUILD_CORES install)
(cd lib/hcrypto; 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 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)
# Doesn't succeed with --libexec=$out/sbin, so
mv "$out/libexec/"* $out/sbin/
rmdir $out/libexec
'';
# 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 = {
2015-07-27 00:20:36 +02:00
description = "An implementation of Kerberos 5 (and some more stuff)";
2014-12-30 09:32:41 +01:00
license = licenses.bsd3;
platforms = platforms.linux ++ platforms.freebsd;
2014-12-30 09:32:41 +01:00
maintainers = with maintainers; [ wkennington ];
};
2015-03-05 01:48:20 +01:00
passthru.implementation = "heimdal";
}