1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-11 07:04:28 +00:00
nixpkgs/pkgs/servers/shishi/default.nix

81 lines
2.7 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, pkgconfig
2015-05-02 12:05:32 +01:00
, libgcrypt, libgpgerror, libtasn1
2015-05-02 12:05:32 +01:00
# Optional Dependencies
, pam ? null, libidn ? null, gnutls ? null
}:
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;
optPam = shouldUsePkg pam;
optLibidn = shouldUsePkg libidn;
optGnutls = shouldUsePkg gnutls;
in
with stdenv.lib;
stdenv.mkDerivation rec {
name = "shishi-1.0.2";
src = fetchurl {
url = "mirror://gnu/shishi/${name}.tar.gz";
sha256 = "032qf72cpjdfffq1yq54gz3ahgqf2ijca4vl31sfabmjzq9q370d";
};
2015-05-02 12:05:32 +01:00
# Fixes support for gcrypt 1.6+
patches = [ ./gcrypt-fix.patch ];
nativeBuildInputs = [ pkgconfig ];
2015-05-02 12:05:32 +01: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)
];
2013-05-27 12:29:11 +01:00
NIX_CFLAGS_COMPILE
2015-05-02 12:05:32 +01:00
= optionalString stdenv.isDarwin "-DBIND_8_COMPAT";
2013-05-27 12:29:11 +01:00
doCheck = true;
2015-05-02 12:05:32 +01:00
installFlags = [ "sysconfdir=\${out}/etc" ];
# Fix *.la files
postInstall = ''
sed -i $out/lib/libshi{sa,shi}.la \
'' + optionalString (optLibidn != null) ''
-e 's,\(-lidn\),-L${optLibidn.out}/lib \1,' \
2015-05-02 12:05:32 +01:00
'' + optionalString (optGnutls != null) ''
-e 's,\(-lgnutls\),-L${optGnutls.out}/lib \1,' \
2015-05-02 12:05:32 +01:00
'' + ''
-e 's,\(-lgcrypt\),-L${libgcrypt.out}/lib \1,' \
-e 's,\(-lgpg-error\),-L${libgpgerror.out}/lib \1,' \
-e 's,\(-ltasn1\),-L${libtasn1.out}/lib \1,'
2015-05-02 12:05:32 +01:00
'';
meta = {
2013-05-27 12:29:11 +01:00
homepage = http://www.gnu.org/software/shishi/;
2015-05-02 12:05:32 +01:00
description = "An implementation of the Kerberos 5 network security system";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ bjg lovek323 wkennington ];
platforms = platforms.all;
};
}