2015-10-07 20:24:10 +00:00
|
|
|
{ stdenv, fetchurl, pkgconfig
|
2015-05-02 11:05:32 +00:00
|
|
|
, libgcrypt, libgpgerror, libtasn1
|
2010-04-26 08:45:23 +00:00
|
|
|
|
2015-05-02 11:05:32 +00:00
|
|
|
# Optional Dependencies
|
|
|
|
, pam ? null, libidn ? null, gnutls ? null
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2017-04-17 20:48:10 +00:00
|
|
|
mkFlag = trueStr: falseStr: cond: name: val: "--"
|
|
|
|
+ (if cond then trueStr else falseStr)
|
|
|
|
+ name
|
|
|
|
+ stdenv.lib.optionalString (val != null && cond != false) "=${val}";
|
2015-05-02 11:05:32 +00:00
|
|
|
mkEnable = mkFlag "enable-" "disable-";
|
|
|
|
mkWith = mkFlag "with-" "without-";
|
|
|
|
mkOther = mkFlag "" "" true;
|
|
|
|
|
2018-08-28 22:20:54 +00:00
|
|
|
shouldUsePkg = pkg: if pkg != null && stdenv.lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) pkg.meta.platforms then pkg else null;
|
2015-05-02 11:05:32 +00:00
|
|
|
|
|
|
|
optPam = shouldUsePkg pam;
|
|
|
|
optLibidn = shouldUsePkg libidn;
|
|
|
|
optGnutls = shouldUsePkg gnutls;
|
|
|
|
in
|
|
|
|
with stdenv.lib;
|
2010-04-26 08:45:23 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2014-03-29 18:44:30 +00:00
|
|
|
name = "shishi-1.0.2";
|
2010-04-26 08:45:23 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2010-06-17 17:06:47 +00:00
|
|
|
url = "mirror://gnu/shishi/${name}.tar.gz";
|
2014-03-29 18:44:30 +00:00
|
|
|
sha256 = "032qf72cpjdfffq1yq54gz3ahgqf2ijca4vl31sfabmjzq9q370d";
|
2010-04-26 08:45:23 +00:00
|
|
|
};
|
|
|
|
|
2015-05-02 11:05:32 +00:00
|
|
|
# Fixes support for gcrypt 1.6+
|
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
|
|
|
patches = [ ./gcrypt-fix.patch ./freebsd-unistd.patch ];
|
2015-05-02 11:05:32 +00:00
|
|
|
|
2015-10-07 20:24:10 +00:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
2015-05-02 11:05:32 +00:00
|
|
|
buildInputs = [ libgcrypt libgpgerror libtasn1 optPam optLibidn optGnutls ];
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
(mkOther "sysconfdir" "/etc")
|
|
|
|
(mkOther "localstatedir" "/var")
|
|
|
|
(mkEnable true "libgcrypt" null)
|
|
|
|
(mkEnable (optPam != null) "pam" null)
|
|
|
|
(mkEnable true "ipv6" null)
|
|
|
|
(mkWith (optLibidn != null) "stringprep" null)
|
|
|
|
(mkEnable (optGnutls != null) "starttls" null)
|
|
|
|
(mkEnable true "des" null)
|
|
|
|
(mkEnable true "3des" null)
|
|
|
|
(mkEnable true "aes" null)
|
|
|
|
(mkEnable true "md" null)
|
|
|
|
(mkEnable false "null" null)
|
|
|
|
(mkEnable true "arcfour" null)
|
|
|
|
];
|
2010-04-26 08:45:23 +00:00
|
|
|
|
2013-05-27 11:29:11 +00:00
|
|
|
NIX_CFLAGS_COMPILE
|
2015-05-02 11:05:32 +00:00
|
|
|
= optionalString stdenv.isDarwin "-DBIND_8_COMPAT";
|
2013-05-27 11:29:11 +00:00
|
|
|
|
2010-04-26 08:45:23 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
2015-05-02 11:05:32 +00:00
|
|
|
installFlags = [ "sysconfdir=\${out}/etc" ];
|
|
|
|
|
|
|
|
# Fix *.la files
|
|
|
|
postInstall = ''
|
|
|
|
sed -i $out/lib/libshi{sa,shi}.la \
|
|
|
|
'' + optionalString (optLibidn != null) ''
|
2015-10-11 19:59:52 +00:00
|
|
|
-e 's,\(-lidn\),-L${optLibidn.out}/lib \1,' \
|
2015-05-02 11:05:32 +00:00
|
|
|
'' + optionalString (optGnutls != null) ''
|
2015-10-07 20:24:10 +00:00
|
|
|
-e 's,\(-lgnutls\),-L${optGnutls.out}/lib \1,' \
|
2015-05-02 11:05:32 +00:00
|
|
|
'' + ''
|
2015-10-11 19:59:52 +00:00
|
|
|
-e 's,\(-lgcrypt\),-L${libgcrypt.out}/lib \1,' \
|
|
|
|
-e 's,\(-lgpg-error\),-L${libgpgerror.out}/lib \1,' \
|
2015-10-07 20:24:10 +00:00
|
|
|
-e 's,\(-ltasn1\),-L${libtasn1.out}/lib \1,'
|
2015-05-02 11:05:32 +00:00
|
|
|
'';
|
|
|
|
|
2010-04-26 08:45:23 +00:00
|
|
|
meta = {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://www.gnu.org/software/shishi/";
|
2015-05-02 11:05:32 +00:00
|
|
|
description = "An implementation of the Kerberos 5 network security system";
|
|
|
|
license = licenses.gpl3Plus;
|
2019-01-26 10:01:09 +00:00
|
|
|
maintainers = with maintainers; [ bjg lovek323 ];
|
2016-09-01 17:39:33 +00:00
|
|
|
platforms = platforms.linux;
|
2010-04-26 08:45:23 +00:00
|
|
|
};
|
|
|
|
}
|