diff --git a/gnu-system.am b/gnu-system.am index 360100932f074dee6933f0a2ca3588965f0bb4e6..fa04f822c1f0d17f95adbcaa38cace0ac6dc5bce 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -251,6 +251,7 @@ dist_patch_DATA = \ gnu/packages/patches/m4-readlink-EINVAL.patch \ gnu/packages/patches/make-impure-dirs.patch \ gnu/packages/patches/mcron-install.patch \ + gnu/packages/patches/mit-krb5-init-fix.patch \ gnu/packages/patches/perl-no-sys-dirs.patch \ gnu/packages/patches/plotutils-libpng-jmpbuf.patch \ gnu/packages/patches/procps-make-3.82.patch \ diff --git a/gnu/packages/mit-krb5.scm b/gnu/packages/mit-krb5.scm index 8222212d9549c825796353b783d2bda571038a76..361cd36f25793cc1998298736e294ccc70f8cf25 100644 --- a/gnu/packages/mit-krb5.scm +++ b/gnu/packages/mit-krb5.scm @@ -37,6 +37,8 @@ (define-public mit-krb5 (sha256 (base32 "1daiaxgkxcryqs37w28v4x1vajqmay4l144d1zd9c2d7jjxr9gcs")))) (build-system gnu-build-system) + (native-inputs + `(("patch/init-fix" ,(search-patch "mit-krb5-init-fix.patch")))) (inputs `(("bison" ,bison) ("perl" ,perl))) (arguments @@ -51,7 +53,12 @@ (define-public mit-krb5 (and (zero? (system* "tar" "xvf" source)) (zero? (system* "tar" "xvf" (string-append inner ".tar.gz"))) (chdir inner) - (chdir "src")))) + (chdir "src") + ;; XXX The current patch system does not support unusual + ;; source unpack methods, so we have to apply this patch in a + ;; non-standard way. + (zero? (system* "patch" "-p1" "--batch" "-i" + (assoc-ref %build-inputs "patch/init-fix")))))) (alist-replace 'check (lambda* (#:key inputs #:allow-other-keys #:rest args) diff --git a/gnu/packages/patches/mit-krb5-init-fix.patch b/gnu/packages/patches/mit-krb5-init-fix.patch new file mode 100644 index 0000000000000000000000000000000000000000..13e49c2789035d16651e7604ec1aa8d7c908f6b3 --- /dev/null +++ b/gnu/packages/patches/mit-krb5-init-fix.patch @@ -0,0 +1,18 @@ +Fix the early context initialization code to avoid assuming that +arguments will be evaluated from right to left. + +Patch by Mark H Weaver <mhw@netris.org>. + +--- src/lib/krb5/krb/t_cc_config.c.orig 2012-12-17 21:47:05.000000000 -0500 ++++ src/lib/krb5/krb/t_cc_config.c 2013-10-29 18:19:16.547994590 -0400 +@@ -117,8 +117,8 @@ + int c; + unsigned int i; + +- bail_on_err(context, "Error initializing Kerberos library", +- krb5_init_context(&context)); ++ ret = krb5_init_context(&context); ++ bail_on_err(context, "Error initializing Kerberos library", ret); + bail_on_err(context, "Error getting location of default ccache", + krb5_cc_default(context, &ccache)); + server = NULL;