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-db/mysql/
Date: Sun, 14 Oct 2018 01:21:50
Message-Id: 1539480084.03afe8693d0935688fc27cf6b72b5c044645c9a8.whissi@gentoo
1 commit: 03afe8693d0935688fc27cf6b72b5c044645c9a8
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Sun Oct 14 01:21:08 2018 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Sun Oct 14 01:21:24 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=03afe869
7
8 dev-db/mysql: rev bump
9
10 - Add USE=mecab to build MeCab full-text parser plugin
11
12 - Enable libevent support
13
14 - Fix multiple build issues
15
16 - Fix tests
17
18 - Adjust ebuild style
19
20 Bug: https://bugs.gentoo.org/658822
21 Closes: https://bugs.gentoo.org/662816
22 Closes: https://bugs.gentoo.org/662826
23 Package-Manager: Portage-2.3.50, Repoman-2.3.11
24 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
25
26 dev-db/mysql/Manifest | 1 +
27 dev-db/mysql/metadata.xml | 1 +
28 ...{mysql-5.7.23.ebuild => mysql-5.7.23-r1.ebuild} | 421 ++++++++++++---------
29 3 files changed, 242 insertions(+), 181 deletions(-)
30
31 diff --git a/dev-db/mysql/Manifest b/dev-db/mysql/Manifest
32 index f1639c3db62..c5d769125da 100644
33 --- a/dev-db/mysql/Manifest
34 +++ b/dev-db/mysql/Manifest
35 @@ -3,3 +3,4 @@ DIST mysql-5.6.40.tar.gz 32083035 BLAKE2B efcc078341bae239df28ac0504111aa3492688
36 DIST mysql-5.6.41.tar.gz 32111985 BLAKE2B 5ccad59333525b354db4fa892857e237cddf8fe1a4d289c6e410c31d6142a71d3ce4dab8d954fa9932ec1f83b50e8eccd5845e082deaaa56f1c0c5e21b2ce6c0 SHA512 a62d7a68c6bb49de33f8c9e634bce53cb453a87238e92967115e8e928fa9ed291727b8bd5a5271a0b5b634d957eb310c745edfb14b6be1deb9099bb757aa2cff
37 DIST mysql-boost-5.7.23.tar.gz 49025014 BLAKE2B 669f10779bc2cda866d6bd876b4efe55fb4b0c796f596f66513a3ca85f322e2a03e9879eecd72a69729a0cb71d408c46cdd9086ae456712b4adff6ae7c584c97 SHA512 e4317f89d108a68652cd95e41ffd670c37b6663aabd6af3985d18052fb7e8d8879b5822399caf9091cecc0a949ec588c121c87cfd60d69941f68d0ecbedd0953
38 DIST mysql-extras-20180804-2323Z.tar.bz2 322215 BLAKE2B cca9e502e375bf43473335868517f6c450fc7bcf03e55de5a294c8bdcfcac2bb783dec09bbb3b6c30a561ba7e3a943543c017e2d42b61d466e699acdef4c0231 SHA512 efd9d416f394cc61b977ab76f05ab3acc5803ff8bdee8e1dbc65cc5b3f07e4f9742140d9586c028908b10fcc44f21c98ebffdebcc5c3578acbe05b07526bcb3d
39 +DIST mysql-extras-20181013-2117Z.tar.bz2 326504 BLAKE2B 5df10abacafc6835536742b10fc268d76ed39818ed704fca21e3b0d5241152640557a37ad1c0a87173223763efd6f6cba87c2e203088227738cb6eb9f4224beb SHA512 03d3ef9add033699dc6d8b6120d1fb323268a2e2b8ec9f375edfeb1c6b3878724db091bf4ae78462872efa81d1bb2e23f8ff4f6e0831d2ce8efd30465e415fa9
40
41 diff --git a/dev-db/mysql/metadata.xml b/dev-db/mysql/metadata.xml
42 index 8ae0465d923..102079013c4 100644
43 --- a/dev-db/mysql/metadata.xml
44 +++ b/dev-db/mysql/metadata.xml
45 @@ -16,6 +16,7 @@ dev-db/mariadb
46 <flag name="jemalloc">Use <pkg>dev-libs/jemalloc</pkg> for allocations.</flag>
47 <flag name="latin1">Use LATIN1 encoding instead of UTF8</flag>
48 <flag name="libressl">Enable SSL connections and crypto functions using <pkg>dev-libs/libressl</pkg></flag>
49 + <flag name="mecab">Build MeCab full-text parser plugin using <pkg>app-text/mecab</pkg></flag>
50 <flag name="numa">Enable NUMA support using <pkg>sys-process/numactl</pkg> (NUMA kernel support is also required)</flag>
51 <flag name="profiling">Add support for statement profiling (requires USE=community).</flag>
52 <flag name="server">Build the server program</flag>
53
54 diff --git a/dev-db/mysql/mysql-5.7.23.ebuild b/dev-db/mysql/mysql-5.7.23-r1.ebuild
55 similarity index 86%
56 rename from dev-db/mysql/mysql-5.7.23.ebuild
57 rename to dev-db/mysql/mysql-5.7.23-r1.ebuild
58 index aad033f5ecc..6d781dc5a4c 100644
59 --- a/dev-db/mysql/mysql-5.7.23.ebuild
60 +++ b/dev-db/mysql/mysql-5.7.23-r1.ebuild
61 @@ -1,8 +1,8 @@
62 -# Copyright 1999-2018 Gentoo Foundation
63 +# Copyright 1999-2018 Gentoo Authors
64 # Distributed under the terms of the GNU General Public License v2
65
66 EAPI="6"
67 -MY_EXTRAS_VER="20180804-2323Z"
68 +MY_EXTRAS_VER="20181013-2117Z"
69
70 CMAKE_MAKEFILE_GENERATOR=emake
71
72 @@ -11,7 +11,7 @@ CMAKE_MAKEFILE_GENERATOR=emake
73 inherit eutils flag-o-matic prefix toolchain-funcs \
74 user cmake-utils multilib-minimal
75
76 -SRC_URI="http://cdn.mysql.com/Downloads/MySQL-5.7/${PN}-boost-${PV}.tar.gz
77 +SRC_URI="https://cdn.mysql.com/Downloads/MySQL-5.7/${PN}-boost-${PV}.tar.gz
78 https://cdn.mysql.com/archives/mysql-5.7/mysql-boost-${PV}.tar.gz
79 http://downloads.mysql.com/archives/MySQL-5.7/${PN}-boost-${PV}.tar.gz"
80
81 @@ -19,17 +19,14 @@ SRC_URI="http://cdn.mysql.com/Downloads/MySQL-5.7/${PN}-boost-${PV}.tar.gz
82 if [[ "${MY_EXTRAS_VER}" != "live" && "${MY_EXTRAS_VER}" != "none" ]]; then
83 SRC_URI="${SRC_URI}
84 mirror://gentoo/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
85 - https://gitweb.gentoo.org/proj/mysql-extras.git/snapshot/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
86 - https://dev.gentoo.org/~grknight/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
87 - https://dev.gentoo.org/~robbat2/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
88 - https://dev.gentoo.org/~jmbsvicetto/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2"
89 + https://gitweb.gentoo.org/proj/mysql-extras.git/snapshot/mysql-extras-${MY_EXTRAS_VER}.tar.bz2"
90 fi
91
92 HOMEPAGE="https://www.mysql.com/"
93 DESCRIPTION="A fast, multi-threaded, multi-user SQL database server"
94 LICENSE="GPL-2"
95 SLOT="0/18"
96 -IUSE="client-libs cracklib debug jemalloc latin1 libressl numa +perl profiling selinux
97 +IUSE="client-libs cracklib debug jemalloc latin1 libressl mecab numa +perl profiling selinux
98 +server static static-libs systemtap tcmalloc test yassl"
99
100 # Tests always fail when libressl is enabled due to hard-coded ciphers in the tests
101 @@ -56,25 +53,39 @@ fi
102 PATCHES=(
103 "${MY_PATCH_DIR}"/20001_all_fix-minimal-build-cmake-mysql-5.7.patch
104 "${MY_PATCH_DIR}"/20007_all_cmake-debug-werror-5.7.patch
105 -# "${MY_PATCH_DIR}"/20008_all_mysql-tzinfo-symlink-5.7.6.patch
106 "${MY_PATCH_DIR}"/20009_all_mysql_myodbc_symbol_fix-5.7.10.patch
107 "${MY_PATCH_DIR}"/20018_all_mysql-5.7.21-without-clientlibs-tools.patch
108 + "${MY_PATCH_DIR}"/20018_all_mysql-5.7.23-fix-libressl-support.patch
109 + "${MY_PATCH_DIR}"/20018_all_mysql-5.7.23-add-missing-gcc-8-fix.patch
110 + "${MY_PATCH_DIR}"/20018_all_mysql-5.7.23-fix-grant_user_lock-a-root.patch
111 + "${MY_PATCH_DIR}"/20018_all_mysql-5.7.23-round-off-test-values-for-same-output-on-all-architectures.patch
112 + "${MY_PATCH_DIR}"/20018_all_mysql-5.7.23-fix-mips-ASM.patch
113 )
114
115 # Be warned, *DEPEND are version-dependant
116 # These are used for both runtime and compiletime
117 # MULTILIB_USEDEP only set for libraries used by the client library
118 -COMMON_DEPEND="
119 - kernel_linux? (
120 - sys-process/procps:0=
121 - dev-libs/libaio:0=
122 - )
123 - net-misc/curl
124 +COMMON_DEPEND="net-misc/curl
125 >=sys-apps/sed-4
126 >=sys-apps/texinfo-4.7-r1
127 + sys-libs/ncurses:0=
128 + client-libs? ( >=sys-libs/zlib-1.2.3:0=[${MULTILIB_USEDEP},static-libs?] )
129 + !client-libs? (
130 + dev-db/mysql-connector-c[${MULTILIB_USEDEP},static-libs?]
131 + >=sys-libs/zlib-1.2.3:0=
132 + )
133 jemalloc? ( dev-libs/jemalloc:0= )
134 - tcmalloc? ( dev-util/google-perftools:0= )
135 + kernel_linux? (
136 + dev-libs/libaio:0=
137 + sys-process/procps:0=
138 + )
139 + server? (
140 + >=app-arch/lz4-0_p131:=
141 + mecab? ( app-text/mecab:= )
142 + numa? ( sys-process/numactl )
143 + )
144 systemtap? ( >=dev-util/systemtap-1.3:0= )
145 + tcmalloc? ( dev-util/google-perftools:0= )
146 !yassl? (
147 client-libs? (
148 !libressl? ( >=dev-libs/openssl-1.0.0:0=[${MULTILIB_USEDEP},static-libs?] )
149 @@ -85,36 +96,85 @@ COMMON_DEPEND="
150 libressl? ( dev-libs/libressl:0= )
151 )
152 )
153 - client-libs? ( >=sys-libs/zlib-1.2.3:0=[${MULTILIB_USEDEP},static-libs?] )
154 - !client-libs? ( >=sys-libs/zlib-1.2.3:0= )
155 - sys-libs/ncurses:0=
156 - server? (
157 - >=app-arch/lz4-0_p131:=
158 - >=dev-libs/boost-1.65.0:=
159 - numa? ( sys-process/numactl )
160 - )
161 - !client-libs? ( dev-db/mysql-connector-c[${MULTILIB_USEDEP},static-libs?] )
162 "
163 -DEPEND="virtual/yacc
164 +DEPEND="${COMMON_DEPEND}
165 dev-libs/protobuf
166 - static? ( sys-libs/ncurses[static-libs] )
167 || ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 )
168 - ${COMMON_DEPEND}"
169 -RDEPEND="selinux? ( sec-policy/selinux-mysql )
170 - client-libs? ( !dev-db/mariadb-connector-c[mysqlcompat] !dev-db/mysql-connector-c dev-libs/protobuf:= )
171 + virtual/yacc
172 + server? ( dev-libs/libevent )
173 + static? ( sys-libs/ncurses[static-libs] )
174 +"
175 +RDEPEND="${COMMON_DEPEND}
176 !dev-db/mariadb !dev-db/mariadb-galera !dev-db/percona-server !dev-db/mysql-cluster
177 + client-libs? ( !dev-db/mariadb-connector-c[mysqlcompat] !dev-db/mysql-connector-c dev-libs/protobuf:= )
178 + selinux? ( sec-policy/selinux-mysql )
179 server? ( !prefix? ( dev-db/mysql-init-scripts ) )
180 - ${COMMON_DEPEND}
181 "
182 # For other stuff to bring us in
183 # dev-perl/DBD-mysql is needed by some scripts installed by MySQL
184 PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )"
185
186 +mysql_init_vars() {
187 + MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="${EPREFIX%/}/usr/share/mysql"}
188 + MY_SYSCONFDIR=${MY_SYSCONFDIR="${EPREFIX%/}/etc/mysql"}
189 + MY_LOCALSTATEDIR=${MY_LOCALSTATEDIR="${EPREFIX%/}/var/lib/mysql"}
190 + MY_LOGDIR=${MY_LOGDIR="${EPREFIX%/}/var/log/mysql"}
191 +
192 + if [[ -z "${MY_DATADIR}" ]] ; then
193 + MY_DATADIR=""
194 + if [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] ; then
195 + MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \
196 + | sed -ne '/datadir/s|^--datadir=||p' \
197 + | tail -n1`
198 + if [[ -z "${MY_DATADIR}" ]] ; then
199 + MY_DATADIR=`grep ^datadir "${MY_SYSCONFDIR}/my.cnf" \
200 + | sed -e 's/.*=\s*//' \
201 + | tail -n1`
202 + fi
203 + fi
204 + if [[ -z "${MY_DATADIR}" ]] ; then
205 + MY_DATADIR="${MY_LOCALSTATEDIR}"
206 + einfo "Using default MY_DATADIR"
207 + fi
208 + elog "MySQL MY_DATADIR is ${MY_DATADIR}"
209 +
210 + if [[ -z "${PREVIOUS_DATADIR}" ]] ; then
211 + if [[ -e "${MY_DATADIR}" ]] ; then
212 + # If you get this and you're wondering about it, see bug #207636
213 + elog "MySQL datadir found in ${MY_DATADIR}"
214 + elog "A new one will not be created."
215 + PREVIOUS_DATADIR="yes"
216 + else
217 + PREVIOUS_DATADIR="no"
218 + fi
219 + export PREVIOUS_DATADIR
220 + fi
221 + else
222 + if [[ ${EBUILD_PHASE} == "config" ]]; then
223 + local new_MY_DATADIR
224 + new_MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \
225 + | sed -ne '/datadir/s|^--datadir=||p' \
226 + | tail -n1`
227 +
228 + if [[ ( -n "${new_MY_DATADIR}" ) && ( "${new_MY_DATADIR}" != "${MY_DATADIR}" ) ]]; then
229 + ewarn "MySQL MY_DATADIR has changed"
230 + ewarn "from ${MY_DATADIR}"
231 + ewarn "to ${new_MY_DATADIR}"
232 + MY_DATADIR="${new_MY_DATADIR}"
233 + fi
234 + fi
235 + fi
236 +
237 + export MY_SHAREDSTATEDIR MY_SYSCONFDIR
238 + export MY_LOCALSTATEDIR MY_LOGDIR
239 + export MY_DATADIR
240 +}
241 +
242 pkg_setup() {
243 if [[ ${MERGE_TYPE} != binary ]] ; then
244 local GCC_MAJOR_SET=$(gcc-major-version)
245 local GCC_MINOR_SET=$(gcc-minor-version)
246 - # Bug 565584. InnoDB now requires atomic functions introduced with gcc-4.7 on
247 + # Bug 565584: InnoDB now requires atomic functions introduced with gcc-4.7 on
248 # non x86{,_64} arches
249 if ! use amd64 && ! use x86 && [[ ${GCC_MAJOR_SET} -lt 4 || \
250 ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then
251 @@ -178,7 +238,7 @@ pkg_postinst() {
252 elog "Please backup any changes you made to /etc/mysql/my.cnf"
253 elog "and add them as a new file under /etc/mysql/${PN}.d with a .cnf extension."
254 elog "You may have as many files as needed and they are read alphabetically."
255 - elog "Be sure the options have the appropitate section headers, i.e. [mysqld]."
256 + elog "Be sure the options have the appropriate section headers, i.e. [mysqld]."
257 einfo
258 }
259
260 @@ -243,9 +303,9 @@ multilib_src_configure() {
261 mycmakeargs=(
262 -DCMAKE_C_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')"
263 -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')"
264 - -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr"
265 - -DMYSQL_DATADIR="${EPREFIX}/var/lib/mysql"
266 - -DSYSCONFDIR="${EPREFIX}/etc/mysql"
267 + -DCMAKE_INSTALL_PREFIX="${EPREFIX%/}/usr"
268 + -DMYSQL_DATADIR="${EPREFIX%/}/var/lib/mysql"
269 + -DSYSCONFDIR="${EPREFIX%/}/etc/mysql"
270 -DINSTALL_BINDIR=bin
271 -DINSTALL_DOCDIR=share/doc/${PF}
272 -DINSTALL_DOCREADMEDIR=share/doc/${PF}
273 @@ -256,9 +316,9 @@ multilib_src_configure() {
274 -DINSTALL_MYSQLSHAREDIR=share/mysql
275 -DINSTALL_PLUGINDIR=$(get_libdir)/mysql/plugin
276 -DINSTALL_SCRIPTDIR=share/mysql/scripts
277 - -DINSTALL_MYSQLDATADIR="${EPREFIX}/var/lib/mysql"
278 + -DINSTALL_MYSQLDATADIR="${EPREFIX%/}/var/lib/mysql"
279 -DINSTALL_SBINDIR=sbin
280 - -DINSTALL_SUPPORTFILESDIR="${EPREFIX}/usr/share/mysql"
281 + -DINSTALL_SUPPORTFILESDIR="${EPREFIX%/}/usr/share/mysql"
282 -DCOMPILATION_COMMENT="Gentoo Linux ${PF}"
283 -DWITH_UNIT_TESTS=$(usex test ON OFF)
284 ### TODO: make this system but issues with UTF-8 prevent it
285 @@ -266,14 +326,13 @@ multilib_src_configure() {
286 -DWITH_ZLIB=system
287 -DWITH_LIBWRAP=0
288 -DENABLED_LOCAL_INFILE=1
289 - -DMYSQL_UNIX_ADDR="${EPREFIX}/var/run/mysqld/mysqld.sock"
290 + -DMYSQL_UNIX_ADDR="${EPREFIX%/}/var/run/mysqld/mysqld.sock"
291 -DWITH_DEFAULT_COMPILER_OPTIONS=0
292 -DWITH_DEFAULT_FEATURE_SET=0
293 - # The build forces this to be defined when cross-compiling. We pass it
294 + # The build forces this to be defined when cross-compiling. We pass it
295 # all the time for simplicity and to make sure it is actually correct.
296 -DSTACK_DIRECTION=$(tc-stack-grows-down && echo -1 || echo 1)
297 -DWITH_RAPID=OFF
298 - -DWITH_LIBEVENT=NO
299 -DWITH_CURL=system
300 -DWITH_BOOST="${S}/boost"
301 -DWITH_PROTOBUF=system
302 @@ -295,7 +354,7 @@ multilib_src_configure() {
303 fi
304
305 # bfd.h is only used starting with 10.1 and can be controlled by NOT_FOR_DISTRIBUTION
306 - # systemtap only works on native ABI bug 530132
307 + # systemtap only works on native ABI, bug 530132
308 if multilib_is_native_abi; then
309 mycmakeargs+=(
310 -DENABLE_DTRACE=$(usex systemtap)
311 @@ -311,7 +370,9 @@ multilib_src_configure() {
312 if multilib_is_native_abi && use server ; then
313
314 mycmakeargs+=(
315 + -DWITH_LIBEVENT=system
316 -DWITH_LZ4=system
317 + -DWITH_MECAB=$(usex mecab system OFF)
318 -DWITH_NUMA=$(usex numa ON OFF)
319 )
320
321 @@ -324,7 +385,6 @@ multilib_src_configure() {
322 -DDEFAULT_CHARSET=${MYSQL_DEFAULT_CHARSET}
323 -DDEFAULT_COLLATION=${MYSQL_DEFAULT_COLLATION}
324 )
325 -
326 elif ! use latin1 ; then
327 mycmakeargs+=(
328 -DDEFAULT_CHARSET=utf8
329 @@ -336,14 +396,21 @@ multilib_src_configure() {
330 -DDEFAULT_COLLATION=latin1_swedish_ci
331 )
332 fi
333 +
334 mycmakeargs+=(
335 -DEXTRA_CHARSETS=all
336 -DDISABLE_SHARED=$(usex static YES NO)
337 -DWITH_DEBUG=$(usex debug)
338 -DWITH_EMBEDDED_SERVER=OFF
339 - -DENABLED_PROFILING=$(usex profiling)
340 )
341
342 + if use profiling ; then
343 + # Setting to OFF doesn't work: Once set, profiling options will be added
344 + # to `mysqld --help` output via sql/sys_vars.cc causing
345 + # "main.mysqld--help-notwin" test to fail
346 + mycmakeargs+=( -DENABLED_PROFILING=ON )
347 + fi
348 +
349 if use static; then
350 mycmakeargs+=( -DWITH_PIC=1 )
351 fi
352 @@ -354,6 +421,7 @@ multilib_src_configure() {
353 -DWITH_ARCHIVE_STORAGE_ENGINE=1
354 -DWITH_BLACKHOLE_STORAGE_ENGINE=1
355 -DWITH_CSV_STORAGE_ENGINE=1
356 + -DWITH_FEDERATED_STORAGE_ENGINE=1
357 -DWITH_HEAP_STORAGE_ENGINE=1
358 -DWITH_INNOBASE_STORAGE_ENGINE=1
359 -DWITH_MYISAMMRG_STORAGE_ENGINE=1
360 @@ -385,6 +453,133 @@ multilib_src_compile() {
361 cmake-utils_src_compile
362 }
363
364 +# Official test instructions:
365 +# ulimit -n 16500 && \
366 +# USE='latin1 perl server' \
367 +# FEATURES='test userpriv -usersandbox' \
368 +# ebuild mysql-X.X.XX.ebuild \
369 +# digest clean package
370 +src_test() {
371 + _disable_test() {
372 + local rawtestname reason
373 + rawtestname="${1}" ; shift
374 + reason="${@}"
375 + ewarn "test '${rawtestname}' disabled: '${reason}'"
376 + echo ${rawtestname} : ${reason} >> "${T}/disabled.def"
377 + }
378 +
379 + local TESTDIR="${BUILD_DIR}/mysql-test"
380 + local retstatus_unit
381 + local retstatus_tests
382 +
383 + if ! use server ; then
384 + einfo "Skipping server tests due to minimal build."
385 + return 0
386 + fi
387 +
388 + # Bug #213475 - MySQL _will_ object strenously if your machine is named
389 + # localhost. Also causes weird failures.
390 + [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost"
391 +
392 + if [[ $UID -eq 0 ]]; then
393 + die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
394 + fi
395 + has usersandbox $FEATURES && ewarn "Some tests may fail with FEATURES=usersandbox"
396 +
397 + einfo ">>> Test phase [test]: ${CATEGORY}/${PF}"
398 +
399 + # Run CTest (test-units)
400 + cmake-utils_src_test
401 + retstatus_unit=$?
402 +
403 + # Ensure that parallel runs don't die
404 + export MTR_BUILD_THREAD="$((${RANDOM} % 100))"
405 + # Enable parallel testing, auto will try to detect number of cores
406 + # You may set this by hand.
407 + # The default maximum is 8 unless MTR_MAX_PARALLEL is increased
408 + export MTR_PARALLEL="${MTR_PARALLEL:-auto}"
409 +
410 + # create directories because mysqladmin might run out of order
411 + mkdir -p "${T}"/var-tests{,/log} || die
412 +
413 + # Run mysql tests
414 + pushd "${TESTDIR}" &>/dev/null || die
415 +
416 + touch "${T}/disabled.def"
417 + # These are failing in MySQL 5.7 for now and are believed to be
418 + # false positives:
419 + #
420 + local t
421 +
422 + for t in auth_sec.keyring_udf ; do
423 + _disable_test "$t" "False positives in Gentoo"
424 + done
425 +
426 + if ! use latin1 ; then
427 + # The following tests will fail if DEFAULT_CHARSET
428 + # isn't set to latin1:
429 + for t in \
430 + binlog.binlog_mysqlbinlog_filter \
431 + binlog.binlog_xa_prepared_disconnect \
432 + funcs_1.is_columns_mysql \
433 + funcs_1.is_tables_mysql \
434 + funcs_1.is_triggers \
435 + innodb.innodb_pagesize_max_recordsize \
436 + innodb.innodb-system-table-view \
437 + innodb.mysqldump_max_recordsize \
438 + main.mysql_client_test \
439 + main.mysqld--help-notwin \
440 + main.type_string \
441 + main.information_schema \
442 + perfschema.binlog_edge_mix \
443 + perfschema.binlog_edge_stmt \
444 + rpl.rpl_xa_survive_disconnect \
445 + rpl.rpl_xa_survive_disconnect_lsu_off \
446 + rpl.rpl_xa_survive_disconnect_table \
447 + ; do
448 + _disable_test "$t" "requires DEFAULT_CHARSET=latin1 but USE=-latin1 is set"
449 + done
450 + fi
451 +
452 + # Try to increase file limits to increase test coverage
453 + if ! ulimit -n 16500 1>/dev/null 2>&1 ; then
454 + # Upper limit comes from parts.partition_* tests
455 + ewarn "For maximum test coverage please raise open file limit to 16500 (ulimit -n 16500) before calling the package manager."
456 +
457 + if ! ulimit -n 4162 1>/dev/null 2>&1 ; then
458 + # Medium limit comes from '[Warning] Buffered warning: Could not increase number of max_open_files to more than 3000 (request: 4162)'
459 + ewarn "For medium test coverage please raise open file limit to 4162 (ulimit -n 4162) before calling the package manager."
460 +
461 + if ! ulimit -n 3000 1>/dev/null 2>&1 ; then
462 + ewarn "For minimum test coverage please raise open file limit to 3000 (ulimit -n 3000) before calling the package manager."
463 + else
464 + einfo "Will run test suite with open file limit set to 3000 (minimum test coverage)."
465 + fi
466 + else
467 + einfo "Will run test suite with open file limit set to 4162 (medium test coverage)."
468 + fi
469 + else
470 + einfo "Will run test suite with open file limit set to 16500 (best test coverage)."
471 + fi
472 +
473 + # run mysql-test tests
474 + perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder --skip-test=tokudb --skip-test-list="${T}/disabled.def"
475 + retstatus_tests=$?
476 +
477 + popd &>/dev/null || die
478 +
479 + # Cleanup is important for these testcases.
480 + pkill -9 -f "${S}/ndb" 2>/dev/null
481 + pkill -9 -f "${S}/sql" 2>/dev/null
482 +
483 + local failures=""
484 + [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit"
485 + [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests"
486 +
487 + [[ -z "$failures" ]] || die "Test failures: $failures"
488 + einfo "Tests successfully completed"
489 +}
490 +
491 src_install() {
492 local MULTILIB_WRAPPED_HEADERS
493 local MULTILIB_CHOST_TOOLS
494 @@ -408,7 +603,7 @@ multilib_src_install() {
495
496 cmake-utils_src_install
497
498 - # Kill old libmysqclient_r symlinks if they exist. Time to fix what depends on them.
499 + # Kill old libmysqclient_r symlinks if they exist. Time to fix what depends on them.
500 find "${D}" -name 'libmysqlclient_r.*' -type l -delete || die
501 }
502
503 @@ -482,142 +677,6 @@ multilib_src_install_all() {
504 [[ -e "${ED}/usr/bin/mytop" ]] && ! use perl && rm -f "${ED}/usr/bin/mytop"
505 }
506
507 -# Official test instructions:
508 -# USE='perl server' \
509 -# FEATURES='test userpriv -usersandbox' \
510 -# ebuild mysql-X.X.XX.ebuild \
511 -# digest clean package
512 -src_test() {
513 -
514 - _disable_test() {
515 - local rawtestname reason
516 - rawtestname="${1}" ; shift
517 - reason="${@}"
518 - ewarn "test '${rawtestname}' disabled: '${reason}'"
519 - echo ${rawtestname} : ${reason} >> "${T}/disabled.def"
520 - }
521 -
522 - local TESTDIR="${BUILD_DIR}/mysql-test"
523 - local retstatus_unit
524 - local retstatus_tests
525 -
526 - if ! use server ; then
527 - einfo "Skipping server tests due to minimal build."
528 - return 0
529 - fi
530 -
531 - # Bug #213475 - MySQL _will_ object strenously if your machine is named
532 - # localhost. Also causes weird failures.
533 - [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost"
534 -
535 - if [[ $UID -eq 0 ]]; then
536 - die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
537 - fi
538 - has usersandbox $FEATURES && ewarn "Some tests may fail with FEATURES=usersandbox"
539 -
540 - einfo ">>> Test phase [test]: ${CATEGORY}/${PF}"
541 -
542 - # Run CTest (test-units)
543 - cmake-utils_src_test
544 - retstatus_unit=$?
545 -
546 - # Ensure that parallel runs don't die
547 - export MTR_BUILD_THREAD="$((${RANDOM} % 100))"
548 - # Enable parallel testing, auto will try to detect number of cores
549 - # You may set this by hand.
550 - # The default maximum is 8 unless MTR_MAX_PARALLEL is increased
551 - export MTR_PARALLEL="${MTR_PARALLEL:-auto}"
552 -
553 - # create directories because mysqladmin might run out of order
554 - mkdir -p "${T}"/var-tests{,/log} || die
555 -
556 - # Run mysql tests
557 - pushd "${TESTDIR}" > /dev/null || die
558 -
559 - touch "${T}/disabled.def"
560 - # These are failing in MySQL 5.7 for now and are believed to be
561 - # false positives:
562 - #
563 - local t
564 -
565 - for t in auth_sec.keyring_udf federated.federated_plugin ; do
566 - _disable_test "$t" "False positives in Gentoo"
567 - done
568 -
569 - # run mysql-test tests
570 - perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder --skip-test=tokudb --skip-test-list="${T}/disabled.def"
571 - retstatus_tests=$?
572 -
573 - popd > /dev/null || die
574 -
575 - # Cleanup is important for these testcases.
576 - pkill -9 -f "${S}/ndb" 2>/dev/null
577 - pkill -9 -f "${S}/sql" 2>/dev/null
578 -
579 - local failures=""
580 - [[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit"
581 - [[ $retstatus_tests -eq 0 ]] || failures="${failures} tests"
582 -
583 - [[ -z "$failures" ]] || die "Test failures: $failures"
584 - einfo "Tests successfully completed"
585 -}
586 -
587 -mysql_init_vars() {
588 - MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="${EPREFIX%/}/usr/share/mysql"}
589 - MY_SYSCONFDIR=${MY_SYSCONFDIR="${EPREFIX%/}/etc/mysql"}
590 - MY_LOCALSTATEDIR=${MY_LOCALSTATEDIR="${EPREFIX%/}/var/lib/mysql"}
591 - MY_LOGDIR=${MY_LOGDIR="${EPREFIX%/}/var/log/mysql"}
592 -
593 - if [[ -z "${MY_DATADIR}" ]] ; then
594 - MY_DATADIR=""
595 - if [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] ; then
596 - MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \
597 - | sed -ne '/datadir/s|^--datadir=||p' \
598 - | tail -n1`
599 - if [[ -z "${MY_DATADIR}" ]] ; then
600 - MY_DATADIR=`grep ^datadir "${MY_SYSCONFDIR}/my.cnf" \
601 - | sed -e 's/.*=\s*//' \
602 - | tail -n1`
603 - fi
604 - fi
605 - if [[ -z "${MY_DATADIR}" ]] ; then
606 - MY_DATADIR="${MY_LOCALSTATEDIR}"
607 - einfo "Using default MY_DATADIR"
608 - fi
609 - elog "MySQL MY_DATADIR is ${MY_DATADIR}"
610 -
611 - if [[ -z "${PREVIOUS_DATADIR}" ]] ; then
612 - if [[ -e "${MY_DATADIR}" ]] ; then
613 - # If you get this and you're wondering about it, see bug #207636
614 - elog "MySQL datadir found in ${MY_DATADIR}"
615 - elog "A new one will not be created."
616 - PREVIOUS_DATADIR="yes"
617 - else
618 - PREVIOUS_DATADIR="no"
619 - fi
620 - export PREVIOUS_DATADIR
621 - fi
622 - else
623 - if [[ ${EBUILD_PHASE} == "config" ]]; then
624 - local new_MY_DATADIR
625 - new_MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \
626 - | sed -ne '/datadir/s|^--datadir=||p' \
627 - | tail -n1`
628 -
629 - if [[ ( -n "${new_MY_DATADIR}" ) && ( "${new_MY_DATADIR}" != "${MY_DATADIR}" ) ]]; then
630 - ewarn "MySQL MY_DATADIR has changed"
631 - ewarn "from ${MY_DATADIR}"
632 - ewarn "to ${new_MY_DATADIR}"
633 - MY_DATADIR="${new_MY_DATADIR}"
634 - fi
635 - fi
636 - fi
637 -
638 - export MY_SHAREDSTATEDIR MY_SYSCONFDIR
639 - export MY_LOCALSTATEDIR MY_LOGDIR
640 - export MY_DATADIR
641 -}
642 -
643 pkg_config() {
644 _getoptval() {
645 local mypd="${EROOT%/}"/usr/bin/my_print_defaults