1 { lib, stdenv, fetchurl, pkg-config
2 , libgcrypt, libgpg-error, libtasn1
4 # Optional Dependencies
5 , pam ? null, libidn ? null, gnutls ? null
9 shouldUsePkg = pkg: if pkg != null && lib.meta.availableOn stdenv.hostPlatform pkg then pkg else null;
11 optPam = shouldUsePkg pam;
12 optLibidn = shouldUsePkg libidn;
13 optGnutls = shouldUsePkg gnutls;
15 inherit (lib) enableFeature withFeature optionalString;
17 stdenv.mkDerivation rec {
22 url = "mirror://gnu/shishi/shishi-${version}.tar.gz";
23 sha256 = "032qf72cpjdfffq1yq54gz3ahgqf2ijca4vl31sfabmjzq9q370d";
26 separateDebugInfo = true;
28 # Fixes support for gcrypt 1.6+
29 patches = [ ./gcrypt-fix.patch ./freebsd-unistd.patch ];
31 nativeBuildInputs = [ pkg-config ];
32 buildInputs = [ libgcrypt libgpg-error libtasn1 optPam optLibidn optGnutls ];
36 "--localstatedir=/var"
37 (enableFeature true "libgcrypt")
38 (enableFeature (optPam != null) "pam")
39 (enableFeature true "ipv6")
40 (withFeature (optLibidn != null) "stringprep")
41 (enableFeature (optGnutls != null) "starttls")
42 (enableFeature true "des")
43 (enableFeature true "3des")
44 (enableFeature true "aes")
45 (enableFeature true "md")
46 (enableFeature false "null")
47 (enableFeature true "arcfour")
50 env.NIX_CFLAGS_COMPILE
51 = optionalString stdenv.hostPlatform.isDarwin "-DBIND_8_COMPAT";
55 installFlags = [ "sysconfdir=\${out}/etc" ];
59 sed -i $out/lib/libshi{sa,shi}.la \
60 '' + optionalString (optLibidn != null) ''
61 -e 's,\(-lidn\),-L${optLibidn.out}/lib \1,' \
62 '' + optionalString (optGnutls != null) ''
63 -e 's,\(-lgnutls\),-L${optGnutls.out}/lib \1,' \
65 -e 's,\(-lgcrypt\),-L${libgcrypt.out}/lib \1,' \
66 -e 's,\(-lgpg-error\),-L${libgpg-error.out}/lib \1,' \
67 -e 's,\(-ltasn1\),-L${libtasn1.out}/lib \1,'
71 homepage = "https://www.gnu.org/software/shishi/";
72 description = "Implementation of the Kerberos 5 network security system";
73 license = licenses.gpl3Plus;
74 maintainers = with maintainers; [ lovek323 ];
75 platforms = platforms.linux;