Gentoo Archives: gentoo-commits

From: Mike Frysinger <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-admin/setools/files/, app-admin/setools/
Date: Wed, 17 Feb 2016 20:11:24
Message-Id: 1455739863.0467b30c56b1a345d6740182b21794b183ef1b5b.vapier@gentoo
1 commit: 0467b30c56b1a345d6740182b21794b183ef1b5b
2 Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
3 AuthorDate: Wed Feb 17 20:10:25 2016 +0000
4 Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
5 CommitDate: Wed Feb 17 20:11:03 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0467b30c
7
8 app-admin/setools: fix cross-compiling
9
10 .../files/setools-3.3.8-no-check-file.patch | 15 +++++++++++
11 .../setools/files/setools-3.3.8-policy-max.patch | 29 ++++++++++++++++++++++
12 app-admin/setools/setools-3.3.8-r7.ebuild | 3 +++
13 3 files changed, 47 insertions(+)
14
15 diff --git a/app-admin/setools/files/setools-3.3.8-no-check-file.patch b/app-admin/setools/files/setools-3.3.8-no-check-file.patch
16 new file mode 100644
17 index 0000000..31848e9
18 --- /dev/null
19 +++ b/app-admin/setools/files/setools-3.3.8-no-check-file.patch
20 @@ -0,0 +1,15 @@
21 +there's no real need to run AC_CHECK_FILE to see if a file exists. if the
22 +static link fails later on, then the static lib didn't exist. this also
23 +breaks cross-compiling.
24 +
25 +--- a/configure.ac
26 ++++ b/configure.ac
27 +@@ -448,8 +448,6 @@
28 + sepol_srcdir="")
29 + if test "x${sepol_srcdir}" = "x"; then
30 + sepol_srcdir=${sepol_devel_libdir}
31 +- AC_CHECK_FILE([${sepol_srcdir}/libsepol.a],,
32 +- AC_MSG_ERROR([make sure libsepol-static is installed]))
33 + else
34 + AC_MSG_CHECKING([for compatible sepol source tree])
35 + sepol_version=${sepol_srcdir}/VERSION
36
37 diff --git a/app-admin/setools/files/setools-3.3.8-policy-max.patch b/app-admin/setools/files/setools-3.3.8-policy-max.patch
38 new file mode 100644
39 index 0000000..cf6917a
40 --- /dev/null
41 +++ b/app-admin/setools/files/setools-3.3.8-policy-max.patch
42 @@ -0,0 +1,29 @@
43 +trying to run compiled code fails when cross-compiling.
44 +probe the value using the preprocessor instead.
45 +
46 +--- a/configure.ac
47 ++++ b/configure.ac
48 +@@ -621,21 +621,8 @@
49 + sepol_new_errcodes="yes",
50 + sepol_new_errcodes="no")
51 +
52 +-AC_RUN_IFELSE(
53 +- [AC_LANG_SOURCE([
54 +-#include <sepol/policydb/policydb.h>
55 +-#include <stdio.h>
56 +-#include <stdlib.h>
57 +-int main(void) {
58 +- FILE *f = fopen("conftest.data", "w");
59 +- if (f != NULL && fprintf(f, "%d", POLICYDB_VERSION_MAX) > 0) {
60 +- fclose(f);
61 +- exit(EXIT_SUCCESS);
62 +- }
63 +- exit(EXIT_FAILURE);
64 +-}])],
65 +- sepol_policy_version_max=`cat conftest.data`,
66 +- AC_MSG_FAILURE([could not determine maximum libsepol policy version]))
67 ++printf "#include <sepol/policydb/policydb.h>\nPOLICYDB_VERSION_MAX\n" > conftest.c
68 ++sepol_policy_version_max=`${CPP} -E -P ${CPPFLAGS} conftest.c | tail -1`
69 + AC_DEFINE_UNQUOTED(SEPOL_POLICY_VERSION_MAX, ${sepol_policy_version_max}, [maximum policy version supported by libsepol])
70 + CFLAGS="${sepol_save_CFLAGS}"
71 + CPPFLAGS="${sepol_save_CPPFLAGS}"
72
73 diff --git a/app-admin/setools/setools-3.3.8-r7.ebuild b/app-admin/setools/setools-3.3.8-r7.ebuild
74 index 69b4c7c..d719849 100644
75 --- a/app-admin/setools/setools-3.3.8-r7.ebuild
76 +++ b/app-admin/setools/setools-3.3.8-r7.ebuild
77 @@ -58,6 +58,9 @@ src_prepare() {
78 EPATCH_FORCE="yes" \
79 epatch
80
81 + epatch "${FILESDIR}"/${PN}-3.3.8-no-check-file.patch
82 + epatch "${FILESDIR}"/${PN}-3.3.8-policy-max.patch
83 +
84 # Fix build failure due to double __init__.py installation
85 sed -e "s/^wrappedpy_DATA = qpol.py \$(pkgpython_PYTHON)/wrappedpy_DATA = qpol.py/" -i libqpol/swig/python/Makefile.am || die
86 # Disable broken check for SWIG version. Bug #542032