2015-06-27 07:41:25 +02:00
|
|
|
{ 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
|
|
|
}:
|
2009-04-22 01:18:09 +02:00
|
|
|
|
2015-06-27 07:41:25 +02:00
|
|
|
let
|
|
|
|
libOnly = type == "lib";
|
|
|
|
in
|
|
|
|
with stdenv.lib;
|
2008-01-28 20:41:25 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2015-06-27 07:41:25 +02:00
|
|
|
name = "${type}heimdal-2015-06-17";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "heimdal";
|
|
|
|
repo = "heimdal";
|
|
|
|
rev = "be63a2914adcbea7d42d56e674ee6edb4883ebaf";
|
|
|
|
sha256 = "147gv49gmy94y6f0x1vx523qni0frgcp3r7fill0r06rkfgfzc0j";
|
2009-04-22 01:18:09 +02:00
|
|
|
};
|
2008-01-28 20:41:25 +01:00
|
|
|
|
2015-06-27 07:41:25 +02:00
|
|
|
nativeBuildInputs = [ autoreconfHook pkgconfig python perl yacc flex ]
|
|
|
|
++ (with perlPackages; [ JSON ])
|
|
|
|
++ optional (!libOnly) texinfo;
|
|
|
|
buildInputs = [ libcap_ng sqlite openssl db libedit ]
|
|
|
|
++ optionals (!libOnly) [ openldap pam ];
|
|
|
|
|
2015-06-02 11:35:28 +02:00
|
|
|
## ugly, X should be made an option
|
2010-08-06 10:52:47 +02:00
|
|
|
configureFlags = [
|
2015-06-27 07:41:25 +02:00
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--localstatedir=/var"
|
2015-06-02 11:35:28 +02:00
|
|
|
"--enable-hdb-openldap-module"
|
|
|
|
"--with-capng"
|
|
|
|
"--with-sqlite3=${sqlite}"
|
2015-06-27 07:41:25 +02:00
|
|
|
"--with-berkeley-db=${db}"
|
|
|
|
"--with-libedit=${libedit}"
|
|
|
|
"--with-openssl=${openssl}"
|
2015-06-02 11:35:28 +02:00
|
|
|
"--without-x"
|
2015-06-27 07:41:25 +02:00
|
|
|
] ++ optionals (!libOnly) [
|
|
|
|
"--with-openldap=${openldap}"
|
2010-08-06 10:52:47 +02:00
|
|
|
];
|
2014-12-30 09:32:41 +01:00
|
|
|
|
2015-06-27 07:41:25 +02: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)
|
2015-06-27 07:41:25 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
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)
|
2015-06-27 07:41:25 +02:00
|
|
|
rm -rf $out/{libexec,sbin,share}
|
|
|
|
find $out/bin -type f | grep -v 'krb5-config' | xargs rm
|
2015-06-06 09:21:21 +02:00
|
|
|
'';
|
|
|
|
|
2015-01-03 02:18:57 +01:00
|
|
|
# We need to build hcrypt for applications like samba
|
|
|
|
postBuild = ''
|
2015-06-27 07:41:25 +02:00
|
|
|
(cd include/hcrypto; make -j $NIX_BUILD_CORES)
|
|
|
|
(cd lib/hcrypto; make -j $NIX_BUILD_CORES)
|
2015-01-03 02:18:57 +01:00
|
|
|
'';
|
|
|
|
|
2010-08-06 10:52:47 +02:00
|
|
|
postInstall = ''
|
2015-01-03 02:18:57 +01:00
|
|
|
# Install hcrypto
|
2015-06-27 07:41:25 +02:00
|
|
|
(cd include/hcrypto; make -j $NIX_BUILD_CORES install)
|
|
|
|
(cd lib/hcrypto; make -j $NIX_BUILD_CORES install)
|
2015-01-03 02:18:57 +01:00
|
|
|
|
2015-06-27 07:41:25 +02:00
|
|
|
# Doesn't succeed with --libexec=$out/sbin, so
|
2013-06-06 10:48:32 +02:00
|
|
|
mv "$out/libexec/"* $out/sbin/
|
2010-08-06 10:52:47 +02:00
|
|
|
rmdir $out/libexec
|
|
|
|
'';
|
|
|
|
|
2015-06-27 07:41:25 +02:00
|
|
|
enableParallelBuilding = true;
|
2015-06-02 11:35:28 +02:00
|
|
|
|
2015-06-27 07:41:25 +02:00
|
|
|
meta = {
|
2014-12-30 09:32:41 +01:00
|
|
|
description = "an implementation of Kerberos 5 (and some more stuff) largely written in Sweden";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ wkennington ];
|
2014-08-08 17:58:34 +02:00
|
|
|
};
|
2015-03-05 01:48:20 +01:00
|
|
|
|
|
|
|
passthru.implementation = "heimdal";
|
2008-01-28 20:41:25 +01:00
|
|
|
}
|