nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchurl,
5 pkg-config,
6 libgcrypt,
7 libgpg-error,
8 libtasn1,
9
10 # Optional Dependencies
11 pam ? null,
12 libidn ? null,
13 gnutls ? null,
14}:
15
16let
17 shouldUsePkg =
18 pkg: if pkg != null && lib.meta.availableOn stdenv.hostPlatform pkg then pkg else null;
19
20 optPam = shouldUsePkg pam;
21 optLibidn = shouldUsePkg libidn;
22 optGnutls = shouldUsePkg gnutls;
23
24 inherit (lib) enableFeature withFeature optionalString;
25in
26stdenv.mkDerivation rec {
27 pname = "shishi";
28 version = "1.0.3";
29
30 src = fetchurl {
31 url = "mirror://gnu/shishi/shishi-${version}.tar.gz";
32 hash = "sha256-lXmP/RLdAaT4jgMR7gPKSibly05ekFmkDk/E2fKRfpI=";
33 };
34
35 separateDebugInfo = true;
36
37 nativeBuildInputs = [ pkg-config ];
38 buildInputs = [
39 libgcrypt
40 libgpg-error
41 libtasn1
42 optPam
43 optLibidn
44 optGnutls
45 ];
46
47 configureFlags = [
48 "--sysconfdir=/etc"
49 "--localstatedir=/var"
50 (enableFeature true "libgcrypt")
51 (enableFeature (optPam != null) "pam")
52 (enableFeature true "ipv6")
53 (withFeature (optLibidn != null) "stringprep")
54 (enableFeature (optGnutls != null) "starttls")
55 (enableFeature true "des")
56 (enableFeature true "3des")
57 (enableFeature true "aes")
58 (enableFeature true "md")
59 (enableFeature false "null")
60 (enableFeature true "arcfour")
61 ];
62
63 env.NIX_CFLAGS_COMPILE = optionalString stdenv.hostPlatform.isDarwin "-DBIND_8_COMPAT";
64
65 doCheck = true;
66
67 installFlags = [ "sysconfdir=\${out}/etc" ];
68
69 # Fix *.la files
70 postInstall = ''
71 sed -i $out/lib/libshi{sa,shi}.la \
72 ''
73 + optionalString (optLibidn != null) ''
74 -e 's,\(-lidn\),-L${optLibidn.out}/lib \1,' \
75 ''
76 + optionalString (optGnutls != null) ''
77 -e 's,\(-lgnutls\),-L${optGnutls.out}/lib \1,' \
78 ''
79 + ''
80 -e 's,\(-lgcrypt\),-L${libgcrypt.out}/lib \1,' \
81 -e 's,\(-lgpg-error\),-L${libgpg-error.out}/lib \1,' \
82 -e 's,\(-ltasn1\),-L${libtasn1.out}/lib \1,'
83 '';
84
85 meta = {
86 homepage = "https://www.gnu.org/software/shishi/";
87 description = "Implementation of the Kerberos 5 network security system";
88 license = lib.licenses.gpl3Plus;
89 maintainers = with lib.maintainers; [ lovek323 ];
90 platforms = lib.platforms.linux;
91 };
92}