2015-06-27 08:41:25 +03: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 11:32:41 +03:00
|
|
|
}:
|
2009-04-22 03:18:09 +04:00
|
|
|
|
2015-06-27 08:41:25 +03:00
|
|
|
let
|
|
|
|
libOnly = type == "lib";
|
|
|
|
in
|
|
|
|
with stdenv.lib;
|
2008-01-28 22:41:25 +03:00
|
|
|
stdenv.mkDerivation rec {
|
2015-09-16 23:14:23 +03:00
|
|
|
name = "${type}heimdal-2015-09-13";
|
2015-06-27 08:41:25 +03:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "heimdal";
|
|
|
|
repo = "heimdal";
|
2015-09-16 23:14:23 +03:00
|
|
|
rev = "c81572ab5dcee3062e715b9e25ca7a20f6ec456b";
|
|
|
|
sha256 = "1r60i4v6y5lpll0l2qpn0ycp6q6f1xjg7k1csi547zls8k96yk9s";
|
2009-04-22 03:18:09 +04:00
|
|
|
};
|
2008-01-28 22:41:25 +03:00
|
|
|
|
2015-06-27 08:41:25 +03:00
|
|
|
nativeBuildInputs = [ autoreconfHook pkgconfig python perl yacc flex ]
|
|
|
|
++ (with perlPackages; [ JSON ])
|
|
|
|
++ optional (!libOnly) texinfo;
|
2015-12-30 11:54:36 +03:00
|
|
|
buildInputs = optionals (!stdenv.isFreeBSD) [ libcap_ng db ]
|
|
|
|
++ [ sqlite openssl libedit ]
|
2015-06-27 08:41:25 +03:00
|
|
|
++ optionals (!libOnly) [ openldap pam ];
|
|
|
|
|
2015-06-02 12:35:28 +03:00
|
|
|
## ugly, X should be made an option
|
2010-08-06 12:52:47 +04:00
|
|
|
configureFlags = [
|
2015-06-27 08:41:25 +03:00
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--localstatedir=/var"
|
2015-06-02 12:35:28 +03:00
|
|
|
"--enable-hdb-openldap-module"
|
2016-04-16 20:47:23 +03:00
|
|
|
"--with-sqlite3=${sqlite.dev}"
|
2015-06-27 08:41:25 +03:00
|
|
|
"--with-libedit=${libedit}"
|
2016-04-16 20:44:32 +03:00
|
|
|
"--with-openssl=${openssl.dev}"
|
2015-06-02 12:35:28 +03:00
|
|
|
"--without-x"
|
2015-12-23 16:51:11 +03:00
|
|
|
"--with-berkeley-db=${db}"
|
2015-06-27 08:41:25 +03:00
|
|
|
] ++ optionals (!libOnly) [
|
2016-04-16 20:41:33 +03:00
|
|
|
"--with-openldap=${openldap.dev}"
|
FreeBSD: apr-util, cyrus-sasl, berkeley db, glib, gnutls, kerberos, libelf-freebsd, openldap, serf, guile, tet, shishi, gawk, gnugrep
2015-11-28 03:46:00 +03:00
|
|
|
] ++ optionals (!stdenv.isFreeBSD) [
|
|
|
|
"--with-capng"
|
2010-08-06 12:52:47 +04:00
|
|
|
];
|
2014-12-30 11:32:41 +03:00
|
|
|
|
2015-06-27 08:41:25 +03: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 08:45:20 +03:00
|
|
|
(cd include/hcrypto; make -j $NIX_BUILD_CORES)
|
|
|
|
(cd lib/hcrypto; make -j $NIX_BUILD_CORES)
|
2015-06-27 08:41:25 +03: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 08:45:20 +03:00
|
|
|
(cd include/hcrypto; make -j $NIX_BUILD_CORES install)
|
|
|
|
(cd lib/hcrypto; make -j $NIX_BUILD_CORES install)
|
2015-06-27 08:41:25 +03:00
|
|
|
rm -rf $out/{libexec,sbin,share}
|
|
|
|
find $out/bin -type f | grep -v 'krb5-config' | xargs rm
|
2015-06-06 10:21:21 +03:00
|
|
|
'';
|
|
|
|
|
2015-01-03 04:18:57 +03:00
|
|
|
# We need to build hcrypt for applications like samba
|
|
|
|
postBuild = ''
|
2015-06-27 08:41:25 +03:00
|
|
|
(cd include/hcrypto; make -j $NIX_BUILD_CORES)
|
|
|
|
(cd lib/hcrypto; make -j $NIX_BUILD_CORES)
|
2015-01-03 04:18:57 +03:00
|
|
|
'';
|
|
|
|
|
2010-08-06 12:52:47 +04:00
|
|
|
postInstall = ''
|
2015-01-03 04:18:57 +03:00
|
|
|
# Install hcrypto
|
2015-06-27 08:41:25 +03:00
|
|
|
(cd include/hcrypto; make -j $NIX_BUILD_CORES install)
|
|
|
|
(cd lib/hcrypto; make -j $NIX_BUILD_CORES install)
|
2015-01-03 04:18:57 +03:00
|
|
|
|
2015-06-27 08:41:25 +03:00
|
|
|
# Doesn't succeed with --libexec=$out/sbin, so
|
2013-06-06 12:48:32 +04:00
|
|
|
mv "$out/libexec/"* $out/sbin/
|
2010-08-06 12:52:47 +04:00
|
|
|
rmdir $out/libexec
|
|
|
|
'';
|
|
|
|
|
2015-09-29 11:49:33 +03:00
|
|
|
# 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;
|
2015-06-02 12:35:28 +03:00
|
|
|
|
2015-06-27 08:41:25 +03:00
|
|
|
meta = {
|
2015-07-27 01:20:36 +03:00
|
|
|
description = "An implementation of Kerberos 5 (and some more stuff)";
|
2014-12-30 11:32:41 +03:00
|
|
|
license = licenses.bsd3;
|
FreeBSD: apr-util, cyrus-sasl, berkeley db, glib, gnutls, kerberos, libelf-freebsd, openldap, serf, guile, tet, shishi, gawk, gnugrep
2015-11-28 03:46:00 +03:00
|
|
|
platforms = platforms.linux ++ platforms.freebsd;
|
2014-12-30 11:32:41 +03:00
|
|
|
maintainers = with maintainers; [ wkennington ];
|
2014-08-08 19:58:34 +04:00
|
|
|
};
|
2015-03-05 03:48:20 +03:00
|
|
|
|
|
|
|
passthru.implementation = "heimdal";
|
2008-01-28 22:41:25 +03:00
|
|
|
}
|