2015-05-02 21:45:10 +01:00
|
|
|
{ stdenv, fetchurl, pkgconfig, flex, yacc
|
|
|
|
|
|
|
|
# Optional Dependencies
|
|
|
|
, openldap ? null, libcap_ng ? null, sqlite ? null, openssl ? null, db ? null
|
|
|
|
, readline ? null, libedit ? null, pam ? null
|
|
|
|
|
|
|
|
#, readline, openldap, libcap_ng
|
|
|
|
#, sqlite, db, ncurses, openssl, cyrus_sasl
|
2014-12-30 08:32:41 +00:00
|
|
|
}:
|
2009-04-22 00:18:09 +01:00
|
|
|
|
2015-05-02 21:45:10 +01:00
|
|
|
let
|
|
|
|
mkFlag = trueStr: falseStr: cond: name: val:
|
|
|
|
if cond == null then null else
|
|
|
|
"--${if cond != false then trueStr else falseStr}${name}${if val != null && cond != false then "=${val}" else ""}";
|
|
|
|
mkEnable = mkFlag "enable-" "disable-";
|
|
|
|
mkWith = mkFlag "with-" "without-";
|
|
|
|
mkOther = mkFlag "" "" true;
|
|
|
|
|
|
|
|
shouldUsePkg = pkg: if pkg != null && stdenv.lib.any (x: x == stdenv.system) pkg.meta.platforms then pkg else null;
|
|
|
|
|
|
|
|
optOpenldap = shouldUsePkg openldap;
|
|
|
|
optLibcap_ng = shouldUsePkg libcap_ng;
|
|
|
|
optSqlite = shouldUsePkg sqlite;
|
|
|
|
optOpenssl = shouldUsePkg openssl;
|
|
|
|
optDb = shouldUsePkg db;
|
|
|
|
optReadline = shouldUsePkg readline;
|
|
|
|
optLibedit = shouldUsePkg libedit;
|
|
|
|
optPam = shouldUsePkg pam;
|
|
|
|
in
|
2008-01-28 19:41:25 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2013-12-04 11:57:36 +00:00
|
|
|
name = "heimdal-1.5.3";
|
2008-01-28 19:41:25 +00:00
|
|
|
|
2009-04-22 00:18:09 +01:00
|
|
|
src = fetchurl {
|
|
|
|
urls = [
|
|
|
|
"http://www.h5l.org/dist/src/${name}.tar.gz"
|
|
|
|
"http://ftp.pdc.kth.se/pub/heimdal/src/${name}.tar.gz"
|
|
|
|
];
|
2013-12-04 11:57:36 +00:00
|
|
|
sha256 = "19gypf9vzfrs2bw231qljfl4cqc1riyg0ai0xmm1nd1wngnpphma";
|
2009-04-22 00:18:09 +01:00
|
|
|
};
|
2008-01-28 19:41:25 +00:00
|
|
|
|
2015-05-02 21:45:10 +01:00
|
|
|
nativeBuildInputs = [ pkgconfig flex yacc ];
|
|
|
|
buildInputs = [
|
|
|
|
optOpenldap optLibcap_ng optSqlite optOpenssl optDb optReadline optLibedit
|
|
|
|
optPam
|
|
|
|
];
|
|
|
|
|
2010-08-06 09:52:47 +01:00
|
|
|
configureFlags = [
|
2015-05-02 21:45:10 +01:00
|
|
|
(mkOther "sysconfdir" "/etc")
|
|
|
|
(mkOther "localstatedir" "/var")
|
|
|
|
(mkWith (optOpenldap != null) "openldap" optOpenldap)
|
|
|
|
(mkEnable (optOpenldap != null) "hdb-openldap-module" null)
|
|
|
|
(mkEnable true "pk-init" null)
|
|
|
|
(mkEnable true "digest" null)
|
|
|
|
(mkEnable true "kx509" null)
|
|
|
|
(mkWith (optLibcap_ng != null) "capng" null)
|
|
|
|
(mkWith (optSqlite != null) "sqlite3" sqlite)
|
|
|
|
(mkEnable (optSqlite != null) "sqlite-cache" null)
|
2015-05-05 21:49:40 +01:00
|
|
|
(mkWith false "libintl" null) # TODO libintl fix
|
2015-05-02 21:45:10 +01:00
|
|
|
(mkWith true "hdbdir" "/var/lib/heimdal")
|
|
|
|
(mkWith (optOpenssl != null) "openssl" optOpenssl)
|
|
|
|
(mkEnable true "pthread-support" null)
|
2015-05-05 21:49:40 +01:00
|
|
|
(mkEnable false "dce" null) # TODO: Add support
|
2015-05-02 21:45:10 +01:00
|
|
|
(mkEnable true "afs-support" null)
|
|
|
|
(mkWith (optDb != null) "berkeley-db" optDb)
|
|
|
|
(mkEnable false "nmdb" null)
|
|
|
|
(mkEnable false "developer" null)
|
|
|
|
(mkWith true "ipv6" null)
|
|
|
|
(mkEnable false "socket-wrapper" null)
|
|
|
|
(mkEnable true "otp" null)
|
|
|
|
(mkEnable false "osfc2" null)
|
|
|
|
(mkEnable true "mmap" null)
|
|
|
|
(mkEnable true "afs-string-to-key" null)
|
|
|
|
(mkWith (optReadline != null) "readline" optReadline)
|
|
|
|
(mkWith (optLibedit != null) "libedit" optLibedit)
|
|
|
|
(mkWith false "x" null)
|
|
|
|
(mkEnable true "kcm" null)
|
|
|
|
(mkEnable true "heimdal-documentation" null)
|
2010-08-06 09:52:47 +01:00
|
|
|
];
|
2014-12-30 08:32:41 +00:00
|
|
|
|
2015-05-10 10:46:21 +01:00
|
|
|
preConfigure = ''
|
|
|
|
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -pthread"
|
|
|
|
'';
|
|
|
|
|
2015-01-03 01:18:57 +00:00
|
|
|
# We need to build hcrypt for applications like samba
|
|
|
|
postBuild = ''
|
|
|
|
(cd lib/hcrypto; make)
|
|
|
|
(cd include/hcrypto; make)
|
|
|
|
'';
|
|
|
|
|
2010-08-06 09:52:47 +01:00
|
|
|
postInstall = ''
|
2015-01-03 01:18:57 +00:00
|
|
|
# Install hcrypto
|
|
|
|
(cd lib/hcrypto; make install)
|
|
|
|
(cd include/hcrypto; make install)
|
|
|
|
|
2015-05-02 21:45:10 +01:00
|
|
|
# Doesn't succeed with --libexec=$out/sbin, so
|
2013-06-06 09:48:32 +01:00
|
|
|
mv "$out/libexec/"* $out/sbin/
|
2010-08-06 09:52:47 +01:00
|
|
|
rmdir $out/libexec
|
|
|
|
'';
|
|
|
|
|
2014-12-30 08:32:41 +00:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
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 16:58:34 +01:00
|
|
|
};
|
2015-03-05 00:48:20 +00:00
|
|
|
|
|
|
|
passthru.implementation = "heimdal";
|
2008-01-28 19:41:25 +00:00
|
|
|
}
|