2016-10-18 15:16:10 +01:00
|
|
|
{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, python2, perl, yacc, flex
|
2015-06-27 06:41:25 +01:00
|
|
|
, texinfo, perlPackages
|
|
|
|
, openldap, libcap_ng, sqlite, openssl, db, libedit, pam
|
2018-05-22 01:29:14 +01:00
|
|
|
, CoreFoundation, Security, SystemConfiguration
|
2015-06-27 06:41:25 +01:00
|
|
|
# Extra Args
|
|
|
|
, type ? ""
|
2014-12-30 08:32:41 +00:00
|
|
|
}:
|
2009-04-22 00:18:09 +01:00
|
|
|
|
2015-06-27 06:41:25 +01:00
|
|
|
let
|
|
|
|
libOnly = type == "lib";
|
|
|
|
in
|
|
|
|
with stdenv.lib;
|
2008-01-28 19:41:25 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2017-08-01 08:53:44 +01:00
|
|
|
name = "${type}heimdal-${version}";
|
2018-03-21 20:12:39 +00:00
|
|
|
version = "7.5.0";
|
2015-06-27 06:41:25 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "heimdal";
|
|
|
|
repo = "heimdal";
|
2017-08-01 08:53:44 +01:00
|
|
|
rev = "heimdal-${version}";
|
2018-03-21 20:12:39 +00:00
|
|
|
sha256 = "1j38wjj4k0q8vx168k3d3k0fwa8j1q5q8f2688nnx1b9qgjd6w1d";
|
2009-04-22 00:18:09 +01:00
|
|
|
};
|
2008-01-28 19:41:25 +00:00
|
|
|
|
2018-03-21 20:12:39 +00:00
|
|
|
patches = [ ./heimdal-make-missing-headers.patch ];
|
|
|
|
|
2016-10-18 15:16:10 +01:00
|
|
|
nativeBuildInputs = [ autoreconfHook pkgconfig python2 perl yacc flex ]
|
2015-06-27 06:41:25 +01:00
|
|
|
++ (with perlPackages; [ JSON ])
|
|
|
|
++ optional (!libOnly) texinfo;
|
2018-05-22 01:29:14 +01:00
|
|
|
buildInputs = optionals (stdenv.isLinux) [ libcap_ng ]
|
|
|
|
++ [ db sqlite openssl libedit ]
|
|
|
|
++ optionals (stdenv.isDarwin) [ CoreFoundation Security SystemConfiguration ]
|
2015-06-27 06:41:25 +01:00
|
|
|
++ optionals (!libOnly) [ openldap pam ];
|
|
|
|
|
2015-06-02 10:35:28 +01:00
|
|
|
## ugly, X should be made an option
|
2010-08-06 09:52:47 +01:00
|
|
|
configureFlags = [
|
2015-06-27 06:41:25 +01:00
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--localstatedir=/var"
|
2015-06-02 10:35:28 +01:00
|
|
|
"--enable-hdb-openldap-module"
|
2016-04-16 18:47:23 +01:00
|
|
|
"--with-sqlite3=${sqlite.dev}"
|
2015-06-27 06:41:25 +01:00
|
|
|
"--with-libedit=${libedit}"
|
2016-04-16 18:44:32 +01:00
|
|
|
"--with-openssl=${openssl.dev}"
|
2015-06-02 10:35:28 +01:00
|
|
|
"--without-x"
|
2018-05-22 01:28:54 +01:00
|
|
|
"--with-berkeley-db"
|
|
|
|
"--with-berkeley-db-include=${db.dev}/include"
|
2015-06-27 06:41:25 +01:00
|
|
|
] ++ optionals (!libOnly) [
|
2016-04-16 18:41:33 +01:00
|
|
|
"--with-openldap=${openldap.dev}"
|
2018-05-22 01:29:14 +01:00
|
|
|
] ++ optionals (stdenv.isLinux) [
|
FreeBSD: apr-util, cyrus-sasl, berkeley db, glib, gnutls, kerberos, libelf-freebsd, openldap, serf, guile, tet, shishi, gawk, gnugrep
2015-11-28 00:46:00 +00:00
|
|
|
"--with-capng"
|
2010-08-06 09:52:47 +01:00
|
|
|
];
|
2014-12-30 08:32:41 +00:00
|
|
|
|
2018-03-21 20:12:39 +00:00
|
|
|
postUnpack = ''
|
|
|
|
sed -i '/^DEFAULT_INCLUDES/ s,$, -I..,' source/cf/Makefile.am.common
|
|
|
|
'';
|
|
|
|
|
2015-06-27 06:41:25 +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 06:45:20 +01:00
|
|
|
(cd include/hcrypto; make -j $NIX_BUILD_CORES)
|
|
|
|
(cd lib/hcrypto; make -j $NIX_BUILD_CORES)
|
2015-06-27 06:41:25 +01: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 06:45:20 +01:00
|
|
|
(cd include/hcrypto; make -j $NIX_BUILD_CORES install)
|
|
|
|
(cd lib/hcrypto; make -j $NIX_BUILD_CORES install)
|
2015-06-27 06:41:25 +01:00
|
|
|
rm -rf $out/{libexec,sbin,share}
|
|
|
|
find $out/bin -type f | grep -v 'krb5-config' | xargs rm
|
2015-06-06 08:21:21 +01:00
|
|
|
'';
|
|
|
|
|
2015-01-03 01:18:57 +00:00
|
|
|
# We need to build hcrypt for applications like samba
|
|
|
|
postBuild = ''
|
2015-06-27 06:41:25 +01:00
|
|
|
(cd include/hcrypto; make -j $NIX_BUILD_CORES)
|
|
|
|
(cd lib/hcrypto; make -j $NIX_BUILD_CORES)
|
2015-01-03 01:18:57 +00:00
|
|
|
'';
|
|
|
|
|
2010-08-06 09:52:47 +01:00
|
|
|
postInstall = ''
|
2015-01-03 01:18:57 +00:00
|
|
|
# Install hcrypto
|
2015-06-27 06:41:25 +01:00
|
|
|
(cd include/hcrypto; make -j $NIX_BUILD_CORES install)
|
|
|
|
(cd lib/hcrypto; make -j $NIX_BUILD_CORES install)
|
2015-01-03 01:18:57 +00:00
|
|
|
|
2015-06-27 06:41:25 +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
|
|
|
|
'';
|
|
|
|
|
2015-09-29 09:49:33 +01: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 10:35:28 +01:00
|
|
|
|
2015-06-27 06:41:25 +01:00
|
|
|
meta = {
|
2015-07-26 23:20:36 +01:00
|
|
|
description = "An implementation of Kerberos 5 (and some more stuff)";
|
2014-12-30 08:32:41 +00:00
|
|
|
license = licenses.bsd3;
|
2018-05-22 01:29:14 +01:00
|
|
|
platforms = platforms.unix;
|
2014-12-30 08:32:41 +00:00
|
|
|
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
|
|
|
}
|