app-crypt/mit-krb5: add warn-crossbuild.patch

Set PYTHON_COMPAT to python 3.6 and 3.7 to be suitable for the current
code base.

Add a custom patch to replace error with warning when running autoconf
for cross builds, because libkrb5 is not able to detect
cross-compilation.

See also https://github.com/kinvolk/Flatcar/issues/369 .
This commit is contained in:
Dongsu Park 2021-07-02 09:14:59 +02:00
parent c4e7fd6fca
commit e91efef4ff
2 changed files with 37 additions and 1 deletions

View File

@ -0,0 +1,35 @@
diff --git a/aclocal.m4 b/aclocal.m4
index 8709a7f5..fe6d41b4 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -746,7 +746,7 @@ AC_TRY_RUN([
#include <regex.h>
regex_t x; regmatch_t m;
int main() { return regcomp(&x,"pat.*",0) || regexec(&x,"pattern",1,&m,0); }
-], ac_cv_func_regcomp=yes, ac_cv_func_regcomp=no, AC_MSG_ERROR([Cannot test regcomp when cross compiling]))])
+], ac_cv_func_regcomp=yes, ac_cv_func_regcomp=no, AC_MSG_WARN([Cannot test regcomp when cross compiling]))])
AC_MSG_RESULT($ac_cv_func_regcomp)
test $ac_cv_func_regcomp = yes && AC_DEFINE(HAVE_REGCOMP,1,[Define if regcomp exists and functions])
dnl
@@ -1608,7 +1608,7 @@ void foo2() __attribute__((destructor));
void foo2() { unlink("conftest.2"); }
int main () { return 0; }],
[test -r conftest.1 || a=yes
-test -r conftest.2 || b=yes], , AC_MSG_ERROR(Cannot test for constructor/destructor support when cross compiling))
+test -r conftest.2 || b=yes], , AC_MSG_WARN(Cannot test for constructor/destructor support when cross compiling))
case $krb5_cv_host in
*-*-aix4.*)
# Under AIX 4.3.3, at least, shared library destructor functions
diff --git a/configure.ac b/configure.ac
index 234f4281..0e9f86dd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -928,7 +928,7 @@ int main () {
}],
ac_cv_printf_positional=yes,
ac_cv_printf_positional=no,
- AC_MSG_ERROR([Cannot test for printf positional argument support when cross compiling]))])
+ AC_MSG_WARN([Cannot test for printf positional argument support when cross compiling]))])
# Nothing for autoconf.h for now.
AC_MSG_RESULT($ac_cv_printf_positional)

View File

@ -3,7 +3,7 @@
EAPI=7
PYTHON_COMPAT=( python3_{7,8,9} )
PYTHON_COMPAT=( python3_{6,7} )
inherit autotools flag-o-matic multilib-minimal python-any-r1 systemd toolchain-funcs
MY_P="${P/mit-}"
@ -62,6 +62,7 @@ PATCHES=(
"${FILESDIR}/CVE-2020-28196.patch"
"${FILESDIR}/${PN}-1.18.2-krb5-config.patch"
"${FILESDIR}/${PN}-1.18.2-autoconf-2.70.patch"
"${FILESDIR}/${PN}-warn-crossbuild.patch"
)
MULTILIB_CHOST_TOOLS=(