3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/libraries/kerberos/heimdal.nix

103 lines
3 KiB
Nix
Raw Normal View History

{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, python2, perl, yacc, flex
, texinfo, perlPackages
, openldap, libcap_ng, sqlite, openssl, db, libedit, pam
2018-05-22 01:29:14 +01:00
, CoreFoundation, Security, SystemConfiguration
# Extra Args
, type ? ""
2014-12-30 08:32:41 +00:00
}:
let
libOnly = type == "lib";
in
with stdenv.lib;
stdenv.mkDerivation rec {
name = "${type}heimdal-${version}";
version = "7.5.0";
src = fetchFromGitHub {
owner = "heimdal";
repo = "heimdal";
rev = "heimdal-${version}";
sha256 = "1j38wjj4k0q8vx168k3d3k0fwa8j1q5q8f2688nnx1b9qgjd6w1d";
};
patches = [ ./heimdal-make-missing-headers.patch ];
nativeBuildInputs = [ autoreconfHook pkgconfig python2 perl yacc flex ]
++ (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 ]
++ optionals (!libOnly) [ openldap pam ];
## ugly, X should be made an option
configureFlags = [
"--sysconfdir=/etc"
"--localstatedir=/var"
"--enable-hdb-openldap-module"
"--with-sqlite3=${sqlite.dev}"
"--with-libedit=${libedit}"
"--with-openssl=${openssl.dev}"
"--without-x"
"--with-berkeley-db"
"--with-berkeley-db-include=${db.dev}/include"
] ++ optionals (!libOnly) [
"--with-openldap=${openldap.dev}"
2018-05-22 01:29:14 +01:00
] ++ optionals (stdenv.isLinux) [
"--with-capng"
];
2014-12-30 08:32:41 +00:00
postUnpack = ''
sed -i '/^DEFAULT_INCLUDES/ s,$, -I..,' source/cf/Makefile.am.common
'';
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)
'';
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)
rm -rf $out/{libexec,sbin,share}
find $out/bin -type f | grep -v 'krb5-config' | xargs rm
'';
# We need to build hcrypt for applications like samba
postBuild = ''
(cd include/hcrypto; make -j $NIX_BUILD_CORES)
(cd lib/hcrypto; make -j $NIX_BUILD_CORES)
'';
postInstall = ''
# Install hcrypto
(cd include/hcrypto; make -j $NIX_BUILD_CORES install)
(cd lib/hcrypto; make -j $NIX_BUILD_CORES install)
# Doesn't succeed with --libexec=$out/sbin, so
mv "$out/libexec/"* $out/sbin/
rmdir $out/libexec
'';
# 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;
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 ];
};
2015-03-05 00:48:20 +00:00
passthru.implementation = "heimdal";
}