2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, pkg-config
|
2021-10-08 15:17:17 +00:00
|
|
|
, libgcrypt, libgpg-error, libtasn1
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# Optional Dependencies
|
|
|
|
, pam ? null, libidn ? null, gnutls ? null
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2021-05-20 23:08:51 +00:00
|
|
|
shouldUsePkg = pkg: if pkg != null && lib.meta.availableOn stdenv.hostPlatform pkg then pkg else null;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
optPam = shouldUsePkg pam;
|
|
|
|
optLibidn = shouldUsePkg libidn;
|
|
|
|
optGnutls = shouldUsePkg gnutls;
|
|
|
|
in
|
2021-01-15 22:18:51 +00:00
|
|
|
with lib;
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2021-08-05 21:33:18 +00:00
|
|
|
pname = "shishi";
|
|
|
|
version = "1.0.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-08-05 21:33:18 +00:00
|
|
|
url = "mirror://gnu/shishi/shishi-${version}.tar.gz";
|
2020-04-24 23:36:52 +00:00
|
|
|
sha256 = "032qf72cpjdfffq1yq54gz3ahgqf2ijca4vl31sfabmjzq9q370d";
|
|
|
|
};
|
|
|
|
|
|
|
|
# Fixes support for gcrypt 1.6+
|
|
|
|
patches = [ ./gcrypt-fix.patch ./freebsd-unistd.patch ];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2021-10-08 15:17:17 +00:00
|
|
|
buildInputs = [ libgcrypt libgpg-error libtasn1 optPam optLibidn optGnutls ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
configureFlags = [
|
2022-08-12 12:06:08 +00:00
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--localstatedir=/var"
|
|
|
|
(enableFeature true "libgcrypt")
|
|
|
|
(enableFeature (optPam != null) "pam")
|
|
|
|
(enableFeature true "ipv6")
|
|
|
|
(withFeature (optLibidn != null) "stringprep")
|
|
|
|
(enableFeature (optGnutls != null) "starttls")
|
|
|
|
(enableFeature true "des")
|
|
|
|
(enableFeature true "3des")
|
|
|
|
(enableFeature true "aes")
|
|
|
|
(enableFeature true "md")
|
|
|
|
(enableFeature false "null")
|
|
|
|
(enableFeature true "arcfour")
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
NIX_CFLAGS_COMPILE
|
|
|
|
= optionalString stdenv.isDarwin "-DBIND_8_COMPAT";
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
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,' \
|
|
|
|
'' + optionalString (optGnutls != null) ''
|
|
|
|
-e 's,\(-lgnutls\),-L${optGnutls.out}/lib \1,' \
|
|
|
|
'' + ''
|
|
|
|
-e 's,\(-lgcrypt\),-L${libgcrypt.out}/lib \1,' \
|
2021-10-08 15:17:17 +00:00
|
|
|
-e 's,\(-lgpg-error\),-L${libgpg-error.out}/lib \1,' \
|
2020-04-24 23:36:52 +00:00
|
|
|
-e 's,\(-ltasn1\),-L${libtasn1.out}/lib \1,'
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "https://www.gnu.org/software/shishi/";
|
|
|
|
description = "An implementation of the Kerberos 5 network security system";
|
|
|
|
license = licenses.gpl3Plus;
|
2022-07-14 12:49:19 +00:00
|
|
|
maintainers = with maintainers; [ lovek323 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|