2016-10-18 14:16:10 +00:00
|
|
|
{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, python2, perl, yacc, flex
|
2015-06-27 05:41:25 +00:00
|
|
|
, texinfo, perlPackages
|
|
|
|
, openldap, libcap_ng, sqlite, openssl, db, libedit, pam
|
2018-05-22 00:29:14 +00:00
|
|
|
, CoreFoundation, Security, SystemConfiguration
|
2014-12-30 08:32:41 +00:00
|
|
|
}:
|
2009-04-21 23:18:09 +00:00
|
|
|
|
2015-06-27 05:41:25 +00:00
|
|
|
with stdenv.lib;
|
2008-01-28 19:41:25 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2018-04-07 10:09:39 +00:00
|
|
|
name = "heimdal-${version}";
|
2019-05-21 16:31:15 +00:00
|
|
|
version = "7.6.0";
|
2015-06-27 05:41:25 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "heimdal";
|
|
|
|
repo = "heimdal";
|
2017-08-01 07:53:44 +00:00
|
|
|
rev = "heimdal-${version}";
|
2019-05-21 16:31:15 +00:00
|
|
|
sha256 = "1i70xas6wddkw2840lk0ah9w6ddx0dzrslby1ggxlwfmcax8rcgp";
|
2009-04-21 23:18:09 +00:00
|
|
|
};
|
2008-01-28 19:41:25 +00:00
|
|
|
|
2018-07-12 17:01:08 +00:00
|
|
|
outputs = [ "out" "dev" "man" "info" ];
|
2018-04-07 10:09:39 +00:00
|
|
|
|
2018-03-21 20:12:39 +00:00
|
|
|
patches = [ ./heimdal-make-missing-headers.patch ];
|
|
|
|
|
2018-04-07 10:09:39 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook pkgconfig python2 perl yacc flex texinfo ]
|
|
|
|
++ (with perlPackages; [ JSON ]);
|
2018-05-22 00:29:14 +00:00
|
|
|
buildInputs = optionals (stdenv.isLinux) [ libcap_ng ]
|
2018-04-07 10:09:39 +00:00
|
|
|
++ [ db sqlite openssl libedit openldap pam]
|
|
|
|
++ optionals (stdenv.isDarwin) [ CoreFoundation Security SystemConfiguration ];
|
2015-06-27 05:41:25 +00:00
|
|
|
|
2015-06-02 09:35:28 +00:00
|
|
|
## ugly, X should be made an option
|
2010-08-06 08:52:47 +00:00
|
|
|
configureFlags = [
|
2015-06-27 05:41:25 +00:00
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--localstatedir=/var"
|
2018-06-21 04:39:53 +00:00
|
|
|
"--infodir=$info/share/info"
|
2015-06-02 09:35:28 +00:00
|
|
|
"--enable-hdb-openldap-module"
|
2016-04-16 17:47:23 +00:00
|
|
|
"--with-sqlite3=${sqlite.dev}"
|
2018-04-07 10:09:39 +00:00
|
|
|
|
|
|
|
# ugly, --with-libedit is not enought, it fall back to bundled libedit
|
|
|
|
"--with-libedit-include=${libedit.dev}/include"
|
|
|
|
"--with-libedit-lib=${libedit}/lib"
|
2016-04-16 17:44:32 +00:00
|
|
|
"--with-openssl=${openssl.dev}"
|
2015-06-02 09:35:28 +00:00
|
|
|
"--without-x"
|
2018-05-22 00:28:54 +00:00
|
|
|
"--with-berkeley-db"
|
|
|
|
"--with-berkeley-db-include=${db.dev}/include"
|
2016-04-16 17:41:33 +00:00
|
|
|
"--with-openldap=${openldap.dev}"
|
2018-05-22 00:29:14 +00: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 08:52:47 +00: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
|
2019-01-26 10:01:09 +00:00
|
|
|
sed -i -e 's/date/date --date="@$SOURCE_DATE_EPOCH"/' source/configure.ac
|
2018-03-21 20:12:39 +00:00
|
|
|
'';
|
|
|
|
|
2018-04-07 10:09:39 +00:00
|
|
|
preConfigure = ''
|
|
|
|
configureFlagsArray+=(
|
2018-07-12 17:01:08 +00:00
|
|
|
"--bindir=$out/bin"
|
2018-04-07 10:09:39 +00:00
|
|
|
"--sbindir=$out/sbin"
|
2018-07-12 17:01:08 +00:00
|
|
|
"--libexecdir=$out/libexec/heimdal"
|
2018-04-07 10:09:39 +00:00
|
|
|
"--mandir=$man/share/man"
|
|
|
|
"--infodir=$man/share/info"
|
|
|
|
"--includedir=$dev/include")
|
2015-06-06 07:21:21 +00:00
|
|
|
'';
|
|
|
|
|
2015-01-03 01:18:57 +00:00
|
|
|
# We need to build hcrypt for applications like samba
|
|
|
|
postBuild = ''
|
2015-06-27 05:41:25 +00: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 08:52:47 +00:00
|
|
|
postInstall = ''
|
2015-01-03 01:18:57 +00:00
|
|
|
# Install hcrypto
|
2015-06-27 05:41:25 +00: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
|
|
|
|
2018-04-07 10:09:39 +00:00
|
|
|
# Do we need it?
|
|
|
|
rm $out/bin/su
|
|
|
|
|
|
|
|
mkdir -p $dev/bin
|
2018-07-12 17:01:08 +00:00
|
|
|
mv $out/bin/krb5-config $dev/bin/
|
2018-04-07 10:09:39 +00:00
|
|
|
|
2018-07-12 17:01:08 +00:00
|
|
|
# asn1 compilers, move them to $dev
|
|
|
|
mv $out/libexec/heimdal/heimdal/* $dev/bin
|
|
|
|
rmdir $out/libexec/heimdal/heimdal
|
2010-08-06 08:52:47 +00:00
|
|
|
'';
|
|
|
|
|
2015-09-29 08:49:33 +00: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 09:35:28 +00:00
|
|
|
|
2015-06-27 05:41:25 +00:00
|
|
|
meta = {
|
2015-07-26 22:20:36 +00: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 00:29:14 +00:00
|
|
|
platforms = platforms.unix;
|
2014-08-08 15:58:34 +00:00
|
|
|
};
|
2015-03-05 00:48:20 +00:00
|
|
|
|
|
|
|
passthru.implementation = "heimdal";
|
2008-01-28 19:41:25 +00:00
|
|
|
}
|