Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/apr-util/files/, dev-libs/apr-util/
Date: Fri, 01 Jul 2022 07:49:19
Message-Id: 1656661596.fda5d0d0e2f3a13c77a03b3e3622594017980d99.sam@gentoo
1 commit: fda5d0d0e2f3a13c77a03b3e3622594017980d99
2 Author: orbea <orbea <AT> riseup <DOT> net>
3 AuthorDate: Sun Jun 19 03:29:04 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Fri Jul 1 07:46:36 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fda5d0d0
7
8 dev-libs/apr-util: Fix the build with rlibtool
9
10 Bug: https://bugs.gentoo.org/779487
11 Signed-off-by: orbea <orbea <AT> riseup.net>
12 Closes: https://github.com/gentoo/gentoo/pull/25968
13 Signed-off-by: Sam James <sam <AT> gentoo.org>
14
15 dev-libs/apr-util/apr-util-1.6.1-r9.ebuild | 148 +++++++++++++++++++++
16 .../apr-util/files/apr-util-1.6.1-libtool.patch | 20 +++
17 2 files changed, 168 insertions(+)
18
19 diff --git a/dev-libs/apr-util/apr-util-1.6.1-r9.ebuild b/dev-libs/apr-util/apr-util-1.6.1-r9.ebuild
20 new file mode 100644
21 index 000000000000..445641cf3612
22 --- /dev/null
23 +++ b/dev-libs/apr-util/apr-util-1.6.1-r9.ebuild
24 @@ -0,0 +1,148 @@
25 +# Copyright 1999-2022 Gentoo Authors
26 +# Distributed under the terms of the GNU General Public License v2
27 +
28 +EAPI=7
29 +
30 +# Usually apr-util has the same PV as apr, but in case of security fixes, this may change.
31 +# APR_PV="${PV}"
32 +APR_PV="1.6.2"
33 +
34 +inherit autotools db-use libtool multilib toolchain-funcs
35 +
36 +DESCRIPTION="Apache Portable Runtime Utility Library"
37 +HOMEPAGE="https://apr.apache.org/"
38 +SRC_URI="mirror://apache/apr/${P}.tar.bz2"
39 +
40 +LICENSE="Apache-2.0"
41 +SLOT="1"
42 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
43 +IUSE="berkdb doc gdbm ldap mysql nss odbc openssl postgres sqlite static-libs"
44 +#RESTRICT="test"
45 +
46 +RDEPEND="
47 + >=dev-libs/apr-${APR_PV}:1=
48 + dev-libs/expat
49 + virtual/libcrypt:=
50 + berkdb? ( >=sys-libs/db-4:= )
51 + gdbm? ( sys-libs/gdbm:= )
52 + ldap? ( net-nds/openldap:= )
53 + mysql? ( || (
54 + dev-db/mariadb-connector-c
55 + >=dev-db/mysql-connector-c-8
56 + ) )
57 + nss? ( dev-libs/nss )
58 + odbc? ( dev-db/unixODBC )
59 + openssl? (
60 + dev-libs/openssl:0=
61 + )
62 + postgres? ( dev-db/postgresql:= )
63 + sqlite? ( dev-db/sqlite:3 )
64 +"
65 +DEPEND="
66 + ${RDEPEND}
67 + >=sys-devel/libtool-2.4.2
68 + doc? ( app-doc/doxygen )
69 +"
70 +
71 +DOCS=(CHANGES NOTICE README)
72 +
73 +PATCHES=(
74 + "${FILESDIR}"/${PN}-1.5.3-sysroot.patch #385775
75 + "${FILESDIR}"/${PN}-1.6.1-fix-gdbm-error-handling.patch
76 + "${FILESDIR}"/${PN}-1.6.1-libtool.patch # 779487
77 + "${FILESDIR}"/${PN}-1.6.1-mariadb-support.patch
78 + "${FILESDIR}"/${PN}-1.6.1-my_bool.patch
79 + "${FILESDIR}"/${PN}-1.6.1-drop-my_init.patch
80 +)
81 +
82 +src_prepare() {
83 + default
84 +
85 + # Fix usage of libmysqlclient (bug #620230)
86 + grep -lrF "libmysqlclient_r" "${S}" \
87 + | xargs sed 's@libmysqlclient_r@libmysqlclient@g' -i \
88 + || die
89 +
90 + mv configure.{in,ac} || die
91 + eautoreconf
92 + elibtoolize
93 +}
94 +
95 +src_configure() {
96 + local myconf=(
97 + --datadir="${EPREFIX}"/usr/share/apr-util-1
98 + --with-apr="${ESYSROOT}"/usr
99 + --with-expat="${EPREFIX}"/usr
100 + --without-sqlite2
101 + $(use_with gdbm)
102 + $(use_with ldap)
103 + $(use_with mysql)
104 + $(use_with nss)
105 + $(use_with odbc)
106 + $(use_with openssl)
107 + $(use_with postgres pgsql)
108 + $(use_with sqlite sqlite3)
109 + )
110 +
111 + tc-is-static-only && myconf+=( --disable-util-dso )
112 +
113 + if use berkdb; then
114 + local db_version
115 + db_version="$(db_findver sys-libs/db)" || die "Unable to find Berkeley DB version"
116 + db_version="$(db_ver_to_slot "${db_version}")"
117 + db_version="${db_version/\./}"
118 + myconf+=(
119 + --with-dbm=db${db_version}
120 + # We use $T for the libdir because otherwise it'd simply be the normal
121 + # system libdir. That's pointless as the compiler will search it for
122 + # us already. This makes cross-compiling and such easier.
123 + --with-berkeley-db="${SYSROOT}$(db_includedir 2>/dev/null):${T}"
124 + )
125 + else
126 + myconf+=( --without-berkeley-db )
127 + fi
128 +
129 + if use nss || use openssl ; then
130 + myconf+=( --with-crypto ) # 518708
131 + fi
132 +
133 + econf "${myconf[@]}"
134 + # Use the current env build settings rather than whatever apr was built with.
135 + sed -i -r \
136 + -e "/^(apr_builddir|apr_builders|top_builddir)=/s:=:=${SYSROOT}:" \
137 + -e "/^CC=/s:=.*:=$(tc-getCC):" \
138 + -e '/^(C|CPP|CXX|LD)FLAGS=/d' \
139 + -e '/^LTFLAGS/s:--silent::' \
140 + build/rules.mk || die
141 +}
142 +
143 +src_compile() {
144 + emake
145 + use doc && emake dox
146 +}
147 +
148 +src_test() {
149 + # Building tests in parallel is broken
150 + emake -j1 check
151 +}
152 +
153 +src_install() {
154 + default
155 +
156 + find "${ED}" -name "*.la" -delete || die
157 + if [[ -d "${ED}/usr/$(get_libdir)/apr-util-${SLOT}" ]] ; then
158 + find "${ED}/usr/$(get_libdir)/apr-util-${SLOT}" -name "*.a" -delete || die
159 + fi
160 + if ! use static-libs ; then
161 + find "${ED}" -name "*.a" -not -name "*$(get_libname)" -delete || die
162 + fi
163 +
164 + if use doc ; then
165 + docinto html
166 + dodoc -r docs/dox/html/*
167 + fi
168 +
169 + # This file is only used on AIX systems, which Gentoo is not,
170 + # and causes collisions between the SLOTs, so remove it.
171 + rm "${ED}/usr/$(get_libdir)/aprutil.exp" || die
172 +}
173
174 diff --git a/dev-libs/apr-util/files/apr-util-1.6.1-libtool.patch b/dev-libs/apr-util/files/apr-util-1.6.1-libtool.patch
175 new file mode 100644
176 index 000000000000..5c2015b64fd7
177 --- /dev/null
178 +++ b/dev-libs/apr-util/files/apr-util-1.6.1-libtool.patch
179 @@ -0,0 +1,20 @@
180 +https://bugs.gentoo.org/779487
181 +
182 +From: orbea <orbea@××××××.net>
183 +Date: Sat, 18 Jun 2022 20:20:09 -0700
184 +Subject: [PATCH] configure: Add missing LT_INIT
185 +
186 +This fixes the build with rlibtool which requires the generated libtool
187 +to determine if building shared or static libraries.
188 +
189 +--- a/configure.in
190 ++++ b/configure.in
191 +@@ -8,6 +8,8 @@ AC_INIT(export_vars.sh.in)
192 + AC_CONFIG_HEADER(include/private/apu_config.h)
193 + AC_CONFIG_AUX_DIR(build)
194 +
195 ++LT_INIT
196 ++
197 + sinclude(build/apu-conf.m4)
198 + sinclude(build/apu-iconv.m4)
199 + sinclude(build/apu-hints.m4)