kerberos: Modernize build
This commit is contained in:
parent
f73682c526
commit
9740b0d12d
@ -1,7 +1,32 @@
|
|||||||
{ stdenv, fetchurl, pkgconfig, flex, yacc, readline, openldap, libcap_ng
|
{ stdenv, fetchurl, pkgconfig, flex, yacc
|
||||||
, sqlite, db, ncurses, openssl, cyrus_sasl
|
|
||||||
|
# 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
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
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
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "heimdal-1.5.3";
|
name = "heimdal-1.5.3";
|
||||||
|
|
||||||
@ -13,14 +38,43 @@ stdenv.mkDerivation rec {
|
|||||||
sha256 = "19gypf9vzfrs2bw231qljfl4cqc1riyg0ai0xmm1nd1wngnpphma";
|
sha256 = "19gypf9vzfrs2bw231qljfl4cqc1riyg0ai0xmm1nd1wngnpphma";
|
||||||
};
|
};
|
||||||
|
|
||||||
## ugly, X should be made an option
|
nativeBuildInputs = [ pkgconfig flex yacc ];
|
||||||
|
buildInputs = [
|
||||||
|
optOpenldap optLibcap_ng optSqlite optOpenssl optDb optReadline optLibedit
|
||||||
|
optPam
|
||||||
|
];
|
||||||
|
|
||||||
configureFlags = [
|
configureFlags = [
|
||||||
"--enable-hdb-openldap-module"
|
(mkOther "sysconfdir" "/etc")
|
||||||
"--with-capng"
|
(mkOther "localstatedir" "/var")
|
||||||
"--with-openldap=${openldap}"
|
(mkWith (optOpenldap != null) "openldap" optOpenldap)
|
||||||
"--with-sqlite3=${sqlite}"
|
(mkEnable (optOpenldap != null) "hdb-openldap-module" null)
|
||||||
"--with-openssl-lib=${openssl}/lib"
|
(mkEnable true "pk-init" null)
|
||||||
"--without-x"
|
(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)
|
||||||
|
#(mkWith true "libintl" glibc) # TODO libintl fix
|
||||||
|
(mkWith true "hdbdir" "/var/lib/heimdal")
|
||||||
|
(mkWith (optOpenssl != null) "openssl" optOpenssl)
|
||||||
|
(mkEnable true "pthread-support" null)
|
||||||
|
(mkEnable true "dce" null)
|
||||||
|
(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)
|
||||||
];
|
];
|
||||||
|
|
||||||
# We need to build hcrypt for applications like samba
|
# We need to build hcrypt for applications like samba
|
||||||
@ -34,16 +88,11 @@ stdenv.mkDerivation rec {
|
|||||||
(cd lib/hcrypto; make install)
|
(cd lib/hcrypto; make install)
|
||||||
(cd include/hcrypto; make install)
|
(cd include/hcrypto; make install)
|
||||||
|
|
||||||
# dont succeed with --libexec=$out/sbin, so
|
# Doesn't succeed with --libexec=$out/sbin, so
|
||||||
mv "$out/libexec/"* $out/sbin/
|
mv "$out/libexec/"* $out/sbin/
|
||||||
rmdir $out/libexec
|
rmdir $out/libexec
|
||||||
'';
|
'';
|
||||||
|
|
||||||
buildInputs = [
|
|
||||||
pkgconfig flex yacc readline openldap libcap_ng sqlite db ncurses
|
|
||||||
cyrus_sasl openssl
|
|
||||||
];
|
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "an implementation of Kerberos 5 (and some more stuff) largely written in Sweden";
|
description = "an implementation of Kerberos 5 (and some more stuff) largely written in Sweden";
|
||||||
license = licenses.bsd3;
|
license = licenses.bsd3;
|
||||||
|
@ -6191,7 +6191,6 @@ let
|
|||||||
openldap = openldap.override {
|
openldap = openldap.override {
|
||||||
cyrus_sasl = cyrus_sasl.override { kerberos = null; };
|
cyrus_sasl = cyrus_sasl.override { kerberos = null; };
|
||||||
};
|
};
|
||||||
cyrus_sasl = cyrus_sasl.override { kerberos = null; };
|
|
||||||
};
|
};
|
||||||
|
|
||||||
harfbuzz = callPackage ../development/libraries/harfbuzz { };
|
harfbuzz = callPackage ../development/libraries/harfbuzz { };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user