Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/apr/files/, dev-libs/apr/
Date: Tue, 28 Aug 2018 11:53:55
Message-Id: 1535457205.7c19b3b818b6d32519e916230d409071db195804.whissi@gentoo
1 commit: 7c19b3b818b6d32519e916230d409071db195804
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Tue Aug 28 11:53:25 2018 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Tue Aug 28 11:53:25 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7c19b3b8
7
8 dev-libs/apr: fix building with GCC8, fix tests
9
10 Closes: https://bugs.gentoo.org/635434
11 Package-Manager: Portage-2.3.48, Repoman-2.3.10
12
13 dev-libs/apr/apr-1.6.3-r2.ebuild | 153 +++++++++++++++++++++
14 ...3-fix-overflow-check-in-overflow_strfsize.patch | 21 +++
15 2 files changed, 174 insertions(+)
16
17 diff --git a/dev-libs/apr/apr-1.6.3-r2.ebuild b/dev-libs/apr/apr-1.6.3-r2.ebuild
18 new file mode 100644
19 index 00000000000..a874140ae17
20 --- /dev/null
21 +++ b/dev-libs/apr/apr-1.6.3-r2.ebuild
22 @@ -0,0 +1,153 @@
23 +# Copyright 1999-2018 Gentoo Foundation
24 +# Distributed under the terms of the GNU General Public License v2
25 +
26 +EAPI=6
27 +
28 +inherit autotools libtool ltprune multilib toolchain-funcs
29 +
30 +DESCRIPTION="Apache Portable Runtime Library"
31 +HOMEPAGE="https://apr.apache.org/"
32 +SRC_URI="mirror://apache/apr/${P}.tar.bz2"
33 +
34 +LICENSE="Apache-2.0"
35 +SLOT="1/${PV%.*}"
36 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
37 +IUSE="doc elibc_FreeBSD older-kernels-compatibility selinux static-libs +urandom"
38 +
39 +CDEPEND="elibc_glibc? ( >=sys-apps/util-linux-2.16 )
40 + elibc_mintlib? ( >=sys-apps/util-linux-2.18 )"
41 +RDEPEND="${CDEPEND}
42 + selinux? ( sec-policy/selinux-apache )"
43 +DEPEND="${CDEPEND}
44 + >=sys-devel/libtool-2.4.2
45 + doc? ( app-doc/doxygen )"
46 +
47 +DOCS=( CHANGES NOTICE README )
48 +
49 +PATCHES=(
50 + "${FILESDIR}"/${PN}-1.5.0-mint.patch
51 + "${FILESDIR}"/${PN}-1.5.0-libtool.patch
52 + "${FILESDIR}"/${PN}-1.5.0-cross-types.patch
53 + "${FILESDIR}"/${PN}-1.5.0-sysroot.patch #385775
54 + "${FILESDIR}"/${PN}-1.6.3-fix-overflow-check-in-overflow_strfsize.patch
55 +)
56 +
57 +src_prepare() {
58 + default
59 +
60 + mv configure.in configure.ac || die
61 + AT_M4DIR="build" eautoreconf
62 + elibtoolize
63 +
64 + eapply "${FILESDIR}/config.layout.patch"
65 +}
66 +
67 +src_configure() {
68 + local myconf=(
69 + --enable-layout=gentoo
70 + --enable-nonportable-atomics
71 + --enable-posix-shm
72 + --enable-threads
73 + $(use_enable static-libs static)
74 + )
75 +
76 + [[ ${CHOST} == *-mint* ]] && export ac_cv_func_poll=no
77 +
78 + if use older-kernels-compatibility; then
79 + local apr_cv_accept4 apr_cv_dup3 apr_cv_epoll_create1 apr_cv_sock_cloexec
80 + export apr_cv_accept4="no"
81 + export apr_cv_dup3="no"
82 + export apr_cv_epoll_create1="no"
83 + export apr_cv_sock_cloexec="no"
84 + fi
85 + if tc-is-cross-compiler; then
86 + # The apache project relies heavily on AC_TRY_RUN and doesn't
87 + # have any sane cross-compiling fallback logic.
88 + export \
89 + ac_cv_file__dev_zero="yes" \
90 + ac_cv_func_sem_open="yes" \
91 + ac_cv_negative_eai="yes" \
92 + ac_cv_o_nonblock_inherited="no" \
93 + ac_cv_struct_rlimit="yes" \
94 + ap_cv_atomic_builtins="yes" \
95 + apr_cv_accept4="yes" \
96 + apr_cv_dup3="yes" \
97 + apr_cv_epoll="yes" \
98 + apr_cv_epoll_create1="yes" \
99 + apr_cv_gai_addrconfig="yes" \
100 + apr_cv_mutex_recursive="yes" \
101 + apr_cv_mutex_robust_shared="yes" \
102 + apr_cv_process_shared_works="yes" \
103 + apr_cv_pthreads_lib="-pthread" \
104 + apr_cv_sock_cloexec="yes" \
105 + apr_cv_tcp_nodelay_with_cork="yes"
106 + fi
107 +
108 + if use urandom; then
109 + myconf+=( --with-devrandom=/dev/urandom )
110 + elif (( ${CHOST#*-hpux11.} <= 11 )); then
111 + : # no /dev/*random on hpux11.11 and before, $PN detects this.
112 + else
113 + myconf+=( --with-devrandom=/dev/random )
114 + fi
115 +
116 + tc-is-static-only && myconf+=( --disable-dso )
117 +
118 + # shl_load does not search runpath, but hpux11 supports dlopen
119 + [[ ${CHOST} == *-hpux11* ]] && myconf+=( --enable-dso=dlfcn )
120 +
121 + if [[ ${CHOST} == *-solaris2.10 ]]; then
122 + case $(<$([[ ${CHOST} != ${CBUILD} ]] && echo "${EPREFIX}/usr/${CHOST}")/usr/include/atomic.h) in
123 + *atomic_cas_ptr*) ;;
124 + *)
125 + elog "You do not have Solaris Patch ID "$(
126 + [[ ${CHOST} == sparc* ]] && echo 118884 || echo 118885
127 + )" (Problem 4954703) installed on your host ($(hostname)),"
128 + elog "using generic atomic operations instead."
129 + myconf+=( --disable-nonportable-atomics )
130 + ;;
131 + esac
132 + fi
133 +
134 + econf "${myconf[@]}"
135 +}
136 +
137 +src_compile() {
138 + if tc-is-cross-compiler; then
139 + # This header is the same across targets, so use the build compiler.
140 + emake tools/gen_test_char
141 + tc-export_build_env BUILD_CC
142 + ${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_CPPFLAGS} ${BUILD_LDFLAGS} \
143 + tools/gen_test_char.c -o tools/gen_test_char || die
144 + fi
145 +
146 + emake
147 +
148 + if use doc; then
149 + emake dox
150 + fi
151 +}
152 +
153 +src_test() {
154 + # Building tests in parallel is broken
155 + emake -j1 check
156 +}
157 +
158 +src_install() {
159 + default
160 +
161 + # Prallel install breaks since apr-1.5.1
162 + #make -j1 DESTDIR="${D}" install || die
163 +
164 + prune_libtool_files --all
165 +
166 + if use doc; then
167 + docinto html
168 + dodoc -r docs/dox/html/*
169 + fi
170 +
171 + # This file is only used on AIX systems, which Gentoo is not,
172 + # and causes collisions between the SLOTs, so remove it.
173 + # Even in Prefix, we don't need this on AIX.
174 + rm -f "${ED%/}/usr/$(get_libdir)/apr.exp"
175 +}
176
177 diff --git a/dev-libs/apr/files/apr-1.6.3-fix-overflow-check-in-overflow_strfsize.patch b/dev-libs/apr/files/apr-1.6.3-fix-overflow-check-in-overflow_strfsize.patch
178 new file mode 100644
179 index 00000000000..d6e1f54fc07
180 --- /dev/null
181 +++ b/dev-libs/apr/files/apr-1.6.3-fix-overflow-check-in-overflow_strfsize.patch
182 @@ -0,0 +1,21 @@
183 +https://bz.apache.org/bugzilla/show_bug.cgi?id=62056
184 +
185 +--- apr-1.6.3.orig/test/teststr.c
186 ++++ apr-1.6.3.orig/test/teststr.c
187 +@@ -307,10 +307,15 @@
188 + for (; off < 999999999; off += 999) {
189 + apr_strfsize(off, buf);
190 + }
191 +- for (off = 1; off < LONG_MAX && off > 0; off *= 2) {
192 ++
193 ++ off = 1;
194 ++ while (1) {
195 + apr_strfsize(off, buf);
196 + apr_strfsize(off + 1, buf);
197 + apr_strfsize(off - 1, buf);
198 ++ if (off > LONG_MAX / 2)
199 ++ break;
200 ++ off *= 2;
201 + }
202 +
203 + ABTS_ASSERT(tc, "strfsize overflowed", buf[5] == '$');