/[gentoo-x86]/eclass/mysql-cmake.eclass
Gentoo

Diff of /eclass/mysql-cmake.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.15 Revision 1.16
1# Copyright 1999-2013 Gentoo Foundation 1# Copyright 1999-2013 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-cmake.eclass,v 1.15 2013/03/04 19:10:31 robbat2 Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-cmake.eclass,v 1.16 2013/06/26 19:31:49 jmbsvicetto Exp $
4 4
5# @ECLASS: mysql-cmake.eclass 5# @ECLASS: mysql-cmake.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Maintainers: 7# Maintainers:
8# - MySQL Team <mysql-bugs@gentoo.org> 8# - MySQL Team <mysql-bugs@gentoo.org>
34 testsuite="${rawtestname/.*}" 34 testsuite="${rawtestname/.*}"
35 testname="${rawtestname/*.}" 35 testname="${rawtestname/*.}"
36 for mysql_disabled_file in \ 36 for mysql_disabled_file in \
37 ${S}/mysql-test/disabled.def \ 37 ${S}/mysql-test/disabled.def \
38 ${S}/mysql-test/t/disabled.def ; do 38 ${S}/mysql-test/t/disabled.def ; do
39 [ -f "${mysql_disabled_file}" ] && break 39 [[ -f ${mysql_disabled_file} ]] && break
40 done 40 done
41 #mysql_disabled_file="${S}/mysql-test/t/disabled.def" 41 #mysql_disabled_file="${S}/mysql-test/t/disabled.def"
42 #einfo "rawtestname=${rawtestname} testname=${testname} testsuite=${testsuite}" 42 #einfo "rawtestname=${rawtestname} testname=${testname} testsuite=${testsuite}"
43 echo ${testname} : ${reason} >> "${mysql_disabled_file}" 43 echo ${testname} : ${reason} >> "${mysql_disabled_file}"
44 44
45 if [ -n "${testsuite}" ] && [ "${testsuite}" != "main" ]; then 45 if [[ ( -n ${testsuite} ) && ( ${testsuite} != "main" ) ]]; then
46 for mysql_disabled_file in \ 46 for mysql_disabled_file in \
47 ${S}/mysql-test/suite/${testsuite}/disabled.def \ 47 ${S}/mysql-test/suite/${testsuite}/disabled.def \
48 ${S}/mysql-test/suite/${testsuite}/t/disabled.def \ 48 ${S}/mysql-test/suite/${testsuite}/t/disabled.def \
49 FAILED ; do 49 FAILED ; do
50 [ -f "${mysql_disabled_file}" ] && break 50 [[ -f ${mysql_disabled_file} ]] && break
51 done 51 done
52 if [ "${mysql_disabled_file}" != "FAILED" ]; then 52 if [[ ${mysql_disabled_file} != "FAILED" ]]; then
53 echo "${testname} : ${reason}" >> "${mysql_disabled_file}" 53 echo "${testname} : ${reason}" >> "${mysql_disabled_file}"
54 else 54 else
55 for mysql_disabled_dir in \ 55 for mysql_disabled_dir in \
56 ${S}/mysql-test/suite/${testsuite} \ 56 ${S}/mysql-test/suite/${testsuite} \
57 ${S}/mysql-test/suite/${testsuite}/t \ 57 ${S}/mysql-test/suite/${testsuite}/t \
58 FAILED ; do 58 FAILED ; do
59 [ -d "${mysql_disabled_dir}" ] && break 59 [[ -d ${mysql_disabled_dir} ]] && break
60 done 60 done
61 if [ "${mysql_disabled_dir}" != "FAILED" ]; then 61 if [[ ${mysql_disabled_dir} != "FAILED" ]]; then
62 echo "${testname} : ${reason}" >> "${mysql_disabled_dir}/disabled.def" 62 echo "${testname} : ${reason}" >> "${mysql_disabled_dir}/disabled.def"
63 else 63 else
64 ewarn "Could not find testsuite disabled.def location for ${rawtestname}" 64 ewarn "Could not find testsuite disabled.def location for ${rawtestname}"
65 fi 65 fi
66 fi 66 fi
70# @FUNCTION: configure_cmake_locale 70# @FUNCTION: configure_cmake_locale
71# @DESCRIPTION: 71# @DESCRIPTION:
72# Helper function to configure locale cmake options 72# Helper function to configure locale cmake options
73configure_cmake_locale() { 73configure_cmake_locale() {
74 74
75 if ! use minimal && [ -n "${MYSQL_DEFAULT_CHARSET}" -a -n "${MYSQL_DEFAULT_COLLATION}" ]; then 75 if ! use minimal && [[ ( -n ${MYSQL_DEFAULT_CHARSET} ) && ( -n ${MYSQL_DEFAULT_COLLATION} ) ]]; then
76 ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}" 76 ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}"
77 ewarn "and a collation of ${MYSQL_DEFAULT_COLLATION}." 77 ewarn "and a collation of ${MYSQL_DEFAULT_COLLATION}."
78 ewarn "You MUST file bugs without these variables set." 78 ewarn "You MUST file bugs without these variables set."
79 79
80 mycmakeargs+=( 80 mycmakeargs+=(
149 ) 149 )
150 150
151 if use ssl; then 151 if use ssl; then
152 mycmakeargs+=( -DWITH_SSL=system ) 152 mycmakeargs+=( -DWITH_SSL=system )
153 else 153 else
154 mycmakeargs+=( -DWITH_SSL=0 ) 154 mycmakeargs+=( -DWITH_SSL=bundled )
155 fi 155 fi
156 156
157 if mysql_version_is_at_least "5.5" && use jemalloc; then 157 if mysql_version_is_at_least "5.5" && use jemalloc; then
158 mycmakeargs+=( -DCMAKE_EXE_LINKER_FLAGS='-ljemalloc' -DWITH_SAFEMALLOC=OFF ) 158 mycmakeargs+=( -DCMAKE_EXE_LINKER_FLAGS='-ljemalloc' -DWITH_SAFEMALLOC=OFF )
159 fi 159 fi
177 177
178 if pbxt_available ; then 178 if pbxt_available ; then
179 mycmakeargs+=( $(cmake-utils_use_with pbxt PBXT_STORAGE_ENGINE) ) 179 mycmakeargs+=( $(cmake-utils_use_with pbxt PBXT_STORAGE_ENGINE) )
180 fi 180 fi
181 181
182 if [ "${PN}" == "mariadb" ]; then 182 if [[ ${PN} == "mariadb" ]]; then
183 mycmakeargs+=( 183 mycmakeargs+=(
184 $(cmake-utils_use_with oqgraph OQGRAPH_STORAGE_ENGINE) 184 $(cmake-utils_use_with oqgraph OQGRAPH_STORAGE_ENGINE)
185 $(cmake-utils_use_with sphinx SPHINX_STORAGE_ENGINE) 185 $(cmake-utils_use_with sphinx SPHINX_STORAGE_ENGINE)
186 $(cmake-utils_use_with extraengine FEDERATEDX_STORAGE_ENGINE) 186 $(cmake-utils_use_with extraengine FEDERATEDX_STORAGE_ENGINE)
187 ) 187 )
188 188
189 if ! use pam ; then 189 if ! use pam ; then
190 mycmakeargs+=( -DAUTH_PAM_DISABLED=1 ) 190 mycmakeargs+=( -DAUTH_PAM_DISABLED=1 )
191 fi 191 fi
192 fi
193
194 if [[ ${PN} == "percona-server" ]]; then
195 mycmakeargs+=(
196 $(cmake-utils_use_with pam)
192 197 )
193 fi 198 fi
194} 199}
195 200
196# 201#
197# EBUILD FUNCTIONS 202# EBUILD FUNCTIONS
216 # And apply 221 # And apply
217 epatch 222 epatch
218 223
219 # last -fPIC fixup, per bug #305873 224 # last -fPIC fixup, per bug #305873
220 i="${S}"/storage/innodb_plugin/plug.in 225 i="${S}"/storage/innodb_plugin/plug.in
221 [ -f "${i}" ] && sed -i -e '/CFLAGS/s,-prefer-non-pic,,g' "${i}" 226 [[ -f ${i} ]] && sed -i -e '/CFLAGS/s,-prefer-non-pic,,g' "${i}"
222 227
223 rm -f "scripts/mysqlbug" 228 rm -f "scripts/mysqlbug"
224 epatch_user 229 epatch_user
225} 230}
226 231
251 -DINSTALL_SBINDIR=sbin 256 -DINSTALL_SBINDIR=sbin
252 -DINSTALL_SCRIPTDIR=share/mysql/scripts 257 -DINSTALL_SCRIPTDIR=share/mysql/scripts
253 -DINSTALL_SQLBENCHDIR=share/mysql 258 -DINSTALL_SQLBENCHDIR=share/mysql
254 -DINSTALL_SUPPORTFILESDIR=${EPREFIX}/usr/share/mysql 259 -DINSTALL_SUPPORTFILESDIR=${EPREFIX}/usr/share/mysql
255 -DWITH_COMMENT="Gentoo Linux ${PF}" 260 -DWITH_COMMENT="Gentoo Linux ${PF}"
256 -DWITHOUT_UNIT_TESTS=1 261 $(cmake-utils_use_with test UNIT_TESTS)
257 ) 262 )
258 263
259 # Bug 412851 264 # Bug 412851
260 # MariaDB requires this flag to compile with GPLv3 readline linked 265 # MariaDB requires this flag to compile with GPLv3 readline linked
261 # Adds a warning about redistribution to configure 266 # Adds a warning about redistribution to configure
262 if [[ "${PN}" == "mariadb" ]] ; then 267 if [[ ${PN} == "mariadb" ]] ; then
263 mycmakeargs+=( -DNOT_FOR_DISTRIBUTION=1 ) 268 mycmakeargs+=( -DNOT_FOR_DISTRIBUTION=1 )
264 fi 269 fi
265 270
266 configure_cmake_locale 271 configure_cmake_locale
267 272
272 fi 277 fi
273 278
274 # Bug #114895, bug #110149 279 # Bug #114895, bug #110149
275 filter-flags "-O" "-O[01]" 280 filter-flags "-O" "-O[01]"
276 281
277 CXXFLAGS="${CXXFLAGS} -fno-exceptions -fno-strict-aliasing" 282 CXXFLAGS="${CXXFLAGS} -fno-strict-aliasing"
278 CXXFLAGS="${CXXFLAGS} -felide-constructors -fno-rtti" 283 CXXFLAGS="${CXXFLAGS} -felide-constructors -fno-rtti"
279 # Causes linkage failures. Upstream bug #59607 removes it 284 # Causes linkage failures. Upstream bug #59607 removes it
280 if ! mysql_version_is_at_least "5.6" ; then 285 if ! mysql_version_is_at_least "5.6" ; then
281 CXXFLAGS="${CXXFLAGS} -fno-implicit-templates" 286 CXXFLAGS="${CXXFLAGS} -fno-implicit-templates"
287 fi
288 # As of 5.7, exceptions are used!
289 if ! mysql_version_is_at_least "5.7" ; then
290 CXXFLAGS="${CXXFLAGS} -fno-exceptions"
282 fi 291 fi
283 export CXXFLAGS 292 export CXXFLAGS
284 293
285 # bug #283926, with GCC4.4, this is required to get correct behavior. 294 # bug #283926, with GCC4.4, this is required to get correct behavior.
286 append-flags -fno-strict-aliasing 295 append-flags -fno-strict-aliasing
313 # Convenience links 322 # Convenience links
314 einfo "Making Convenience links for mysqlcheck multi-call binary" 323 einfo "Making Convenience links for mysqlcheck multi-call binary"
315 dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqlanalyze" 324 dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqlanalyze"
316 dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqlrepair" 325 dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqlrepair"
317 dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqloptimize" 326 dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqloptimize"
327
328 # Create a mariadb_config symlink
329 [[ ${PN} == "mariadb" ]] && dosym "/usr/bin/mysql_config" "/usr/bin/mariadb_config"
318 330
319 # INSTALL_LAYOUT=STANDALONE causes cmake to create a /usr/data dir 331 # INSTALL_LAYOUT=STANDALONE causes cmake to create a /usr/data dir
320 rm -Rf "${ED}/usr/data" 332 rm -Rf "${ED}/usr/data"
321 333
322 # Various junk (my-*.cnf moved elsewhere) 334 # Various junk (my-*.cnf moved elsewhere)
339 fi 351 fi
340 352
341 # Configuration stuff 353 # Configuration stuff
342 case ${MYSQL_PV_MAJOR} in 354 case ${MYSQL_PV_MAJOR} in
343 5.[1-4]*) mysql_mycnf_version="5.1" ;; 355 5.[1-4]*) mysql_mycnf_version="5.1" ;;
344 5.[5-9]|6*|7*) mysql_mycnf_version="5.5" ;; 356 5.[5-9]|6*|7*|8*|9*|10*) mysql_mycnf_version="5.5" ;;
345 esac 357 esac
346 einfo "Building default my.cnf (${mysql_mycnf_version})" 358 einfo "Building default my.cnf (${mysql_mycnf_version})"
347 insinto "${MY_SYSCONFDIR#${EPREFIX}}" 359 insinto "${MY_SYSCONFDIR#${EPREFIX}}"
348 doins scripts/mysqlaccess.conf 360 doins scripts/mysqlaccess.conf
349 mycnf_src="my.cnf-${mysql_mycnf_version}" 361 mycnf_src="my.cnf-${mysql_mycnf_version}"
361 # Minimal builds don't have the MySQL server 373 # Minimal builds don't have the MySQL server
362 if ! use minimal ; then 374 if ! use minimal ; then
363 einfo "Creating initial directories" 375 einfo "Creating initial directories"
364 # Empty directories ... 376 # Empty directories ...
365 diropts "-m0750" 377 diropts "-m0750"
366 if [[ "${PREVIOUS_DATADIR}" != "yes" ]] ; then 378 if [[ ${PREVIOUS_DATADIR} != "yes" ]] ; then
367 dodir "${MY_DATADIR#${EPREFIX}}" 379 dodir "${MY_DATADIR#${EPREFIX}}"
368 keepdir "${MY_DATADIR#${EPREFIX}}" 380 keepdir "${MY_DATADIR#${EPREFIX}}"
369 chown -R mysql:mysql "${D}/${MY_DATADIR}" 381 chown -R mysql:mysql "${D}/${MY_DATADIR}"
370 fi 382 fi
371 383
384 for script in \ 396 for script in \
385 "${S}"/support-files/my-*.cnf.sh \ 397 "${S}"/support-files/my-*.cnf.sh \
386 "${S}"/support-files/magic \ 398 "${S}"/support-files/magic \
387 "${S}"/support-files/ndb-config-2-node.ini.sh 399 "${S}"/support-files/ndb-config-2-node.ini.sh
388 do 400 do
389 [[ -f "$script" ]] && dodoc "${script}" 401 [[ -f $script ]] && dodoc "${script}"
390 done 402 done
391 403
392 docinto "scripts" 404 docinto "scripts"
393 for script in "${S}"/scripts/mysql* ; do 405 for script in "${S}"/scripts/mysql* ; do
394 [[ -f "$script" ]] && [[ "${script%.sh}" == "${script}" ]] && dodoc "${script}" 406 [[ ( -f $script ) && ( ${script%.sh} == ${script} ) ]] && dodoc "${script}"
395 done 407 done
396
397 fi 408 fi
398
399 mysql_lib_symlinks "${ED}"
400 409
401 #Remove mytop if perl is not selected 410 #Remove mytop if perl is not selected
402 [[ "${PN}" == "mariadb" ]] && ! use perl \ 411 [[ ${PN} == "mariadb" ]] && ! use perl \
403 && rm -f "${ED}/usr/bin/mytop" 412 && rm -f "${ED}/usr/bin/mytop"
404} 413}

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16

  ViewVC Help
Powered by ViewVC 1.1.20