/[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.9 Revision 1.13
1# Copyright 1999-2012 Gentoo Foundation 1# Copyright 1999-2012 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.9 2012/06/07 22:06:04 zmedico Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-cmake.eclass,v 1.13 2013/01/20 02:37:51 robbat2 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>
13# The mysql-cmake.eclass provides the support to build the mysql 13# The mysql-cmake.eclass provides the support to build the mysql
14# ebuilds using the cmake build system. This eclass provides 14# ebuilds using the cmake build system. This eclass provides
15# the src_unpack, src_prepare, src_configure, src_compile, scr_install, 15# the src_unpack, src_prepare, src_configure, src_compile, scr_install,
16# pkg_preinst, pkg_postinst, pkg_config and pkg_postrm phase hooks. 16# pkg_preinst, pkg_postinst, pkg_config and pkg_postrm phase hooks.
17 17
18inherit cmake-utils flag-o-matic multilib 18inherit cmake-utils flag-o-matic multilib prefix
19 19
20# 20#
21# HELPER FUNCTIONS: 21# HELPER FUNCTIONS:
22# 22#
23 23
24# @FUNCTION: mysql_cmake_disable_test 24# @FUNCTION: mysql_cmake_disable_test
25# @DESCRIPTION: 25# @DESCRIPTION:
26# Helper function to disable specific tests. 26# Helper function to disable specific tests.
27mysql-cmake_disable_test() { 27mysql-cmake_disable_test() {
28 28
29 local rawtestname testname testsuite reason mysql_disable_file 29 local rawtestname testname testsuite reason mysql_disabled_file mysql_disabled_dir
30 rawtestname="${1}" ; shift 30 rawtestname="${1}" ; shift
31 reason="${@}" 31 reason="${@}"
32 ewarn "test '${rawtestname}' disabled: '${reason}'" 32 ewarn "test '${rawtestname}' disabled: '${reason}'"
33 33
34 testsuite="${rawtestname/.*}" 34 testsuite="${rawtestname/.*}"
35 testname="${rawtestname/*.}" 35 testname="${rawtestname/*.}"
36 for mysql_disabled_file in \
37 ${S}/mysql-test/disabled.def \
38 ${S}/mysql-test/t/disabled.def ; do
39 [ -f "${mysql_disabled_file}" ] && break
40 done
36 mysql_disable_file="${S}/mysql-test/t/disabled.def" 41 #mysql_disabled_file="${S}/mysql-test/t/disabled.def"
37 #einfo "rawtestname=${rawtestname} testname=${testname} testsuite=${testsuite}" 42 #einfo "rawtestname=${rawtestname} testname=${testname} testsuite=${testsuite}"
38 echo ${testname} : ${reason} >> "${mysql_disable_file}" 43 echo ${testname} : ${reason} >> "${mysql_disabled_file}"
39 44
40 if [ -n "${testsuite}" ]; then 45 if [ -n "${testsuite}" ] && [ "${testsuite}" != "main" ]; then
41 for mysql_disable_file in \ 46 for mysql_disabled_file in \
42 ${S}/mysql-test/suite/${testsuite}/disabled.def \ 47 ${S}/mysql-test/suite/${testsuite}/disabled.def \
43 ${S}/mysql-test/suite/${testsuite}/t/disabled.def \ 48 ${S}/mysql-test/suite/${testsuite}/t/disabled.def \
44 FAILED ; do 49 FAILED ; do
45 [ -f "${mysql_disable_file}" ] && break 50 [ -f "${mysql_disabled_file}" ] && break
46 done 51 done
47 if [ "${mysql_disabled_file}" != "FAILED" ]; then 52 if [ "${mysql_disabled_file}" != "FAILED" ]; then
48 echo "${testname} : ${reason}" >> "${mysql_disable_file}" 53 echo "${testname} : ${reason}" >> "${mysql_disabled_file}"
49 else 54 else
55 for mysql_disabled_dir in \
56 ${S}/mysql-test/suite/${testsuite} \
57 ${S}/mysql-test/suite/${testsuite}/t \
58 FAILED ; do
59 [ -d "${mysql_disabled_dir}" ] && break
60 done
61 if [ "${mysql_disabled_dir}" != "FAILED" ]; then
62 echo "${testname} : ${reason}" >> "${mysql_disabled_dir}/disabled.def"
63 else
50 ewarn "Could not find testsuite disabled.def location for ${rawtestname}" 64 ewarn "Could not find testsuite disabled.def location for ${rawtestname}"
65 fi
51 fi 66 fi
52 fi 67 fi
53} 68}
54 69
55# @FUNCTION: configure_cmake_locale 70# @FUNCTION: configure_cmake_locale
92 -DEXTRA_CHARSETS=none 107 -DEXTRA_CHARSETS=none
93 -DINSTALL_SQLBENCHDIR= 108 -DINSTALL_SQLBENCHDIR=
94 -DWITH_SSL=system 109 -DWITH_SSL=system
95 -DWITH_ZLIB=system 110 -DWITH_ZLIB=system
96 -DWITHOUT_LIBWRAP=1 111 -DWITHOUT_LIBWRAP=1
97 -DWITHOUT_READLINE=1 112 -DWITH_READLINE=0
113 -DWITH_LIBEDIT=0
98 -DWITHOUT_ARCHIVE_STORAGE_ENGINE=1 114 -DWITHOUT_ARCHIVE_STORAGE_ENGINE=1
99 -DWITHOUT_BLACKHOLE_STORAGE_ENGINE=1 115 -DWITHOUT_BLACKHOLE_STORAGE_ENGINE=1
100 -DWITHOUT_CSV_STORAGE_ENGINE=1 116 -DWITHOUT_CSV_STORAGE_ENGINE=1
101 -DWITHOUT_FEDERATED_STORAGE_ENGINE=1 117 -DWITHOUT_FEDERATED_STORAGE_ENGINE=1
102 -DWITHOUT_HEAP_STORAGE_ENGINE=1 118 -DWITHOUT_HEAP_STORAGE_ENGINE=1
116 mycmakeargs+=( 132 mycmakeargs+=(
117 -DENABLED_LOCAL_INFILE=1 133 -DENABLED_LOCAL_INFILE=1
118 -DEXTRA_CHARSETS=all 134 -DEXTRA_CHARSETS=all
119 -DMYSQL_USER=mysql 135 -DMYSQL_USER=mysql
120 -DMYSQL_UNIX_ADDR=${EPREFIX}/var/run/mysqld/mysqld.sock 136 -DMYSQL_UNIX_ADDR=${EPREFIX}/var/run/mysqld/mysqld.sock
121 -DWITHOUT_READLINE=1 137 -DWITH_READLINE=0
138 -DWITH_LIBEDIT=0
122 -DWITH_ZLIB=system 139 -DWITH_ZLIB=system
123 -DWITHOUT_LIBWRAP=1 140 -DWITHOUT_LIBWRAP=1
124 ) 141 )
125 142
126 mycmakeargs+=( 143 mycmakeargs+=(
133 150
134 if use ssl; then 151 if use ssl; then
135 mycmakeargs+=( -DWITH_SSL=system ) 152 mycmakeargs+=( -DWITH_SSL=system )
136 else 153 else
137 mycmakeargs+=( -DWITH_SSL=0 ) 154 mycmakeargs+=( -DWITH_SSL=0 )
155 fi
156
157 if mysql_version_is_at_least "5.5" && use jemalloc; then
158 mycmakeargs+=( -DCMAKE_EXE_LINKER_FLAGS='-ljemalloc' -DWITH_SAFEMALLOC=OFF )
159 fi
160
161 if mysql_version_is_at_least "5.5" && use tcmalloc; then
162 mycmakeargs+=( -DCMAKE_EXE_LINKER_FLAGS='-ltcmalloc' -DWITH_SAFEMALLOC=OFF )
138 fi 163 fi
139 164
140 # Storage engines 165 # Storage engines
141 mycmakeargs+=( 166 mycmakeargs+=(
142 -DWITH_ARCHIVE_STORAGE_ENGINE=1 167 -DWITH_ARCHIVE_STORAGE_ENGINE=1
147 -DWITH_MYISAMMRG_STORAGE_ENGINE=1 172 -DWITH_MYISAMMRG_STORAGE_ENGINE=1
148 -DWITH_MYISAM_STORAGE_ENGINE=1 173 -DWITH_MYISAM_STORAGE_ENGINE=1
149 -DWITH_PARTITION_STORAGE_ENGINE=1 174 -DWITH_PARTITION_STORAGE_ENGINE=1
150 $(cmake-utils_use_with extraengine FEDERATED_STORAGE_ENGINE) 175 $(cmake-utils_use_with extraengine FEDERATED_STORAGE_ENGINE)
151 ) 176 )
177
178 if pbxt_available ; then
179 mycmakeargs+=( $(cmake-utils_use_with pbxt PBXT_STORAGE_ENGINE) )
180 fi
181
182 if [ "${PN}" == "mariadb" ]; then
183 mycmakeargs+=(
184 $(cmake-utils_use_with oqgraph OQGRAPH_STORAGE_ENGINE)
185 $(cmake-utils_use_with sphinx SPHINX_STORAGE_ENGINE)
186 $(cmake-utils_use_with extraengine FEDERATEDX_STORAGE_ENGINE)
187 )
188 fi
152} 189}
153 190
154# 191#
155# EBUILD FUNCTIONS 192# EBUILD FUNCTIONS
156# 193#
211 -DINSTALL_SUPPORTFILESDIR=${EPREFIX}/usr/share/mysql 248 -DINSTALL_SUPPORTFILESDIR=${EPREFIX}/usr/share/mysql
212 -DWITH_COMMENT="Gentoo Linux ${PF}" 249 -DWITH_COMMENT="Gentoo Linux ${PF}"
213 -DWITHOUT_UNIT_TESTS=1 250 -DWITHOUT_UNIT_TESTS=1
214 ) 251 )
215 252
253 # Bug 412851
254 # MariaDB requires this flag to compile with GPLv3 readline linked
255 # Adds a warning about redistribution to configure
256 if [[ "${PN}" == "mariadb" ]] ; then
257 mycmakeargs+=( -DNOT_FOR_DISTRIBUTION=1 )
258 fi
259
216 configure_cmake_locale 260 configure_cmake_locale
217 261
218 if use minimal ; then 262 if use minimal ; then
219 configure_cmake_minimal 263 configure_cmake_minimal
220 else 264 else
285 rm -rf "${D}"/${MY_SHAREDSTATEDIR}/mysql-test 329 rm -rf "${D}"/${MY_SHAREDSTATEDIR}/mysql-test
286 fi 330 fi
287 331
288 # Configuration stuff 332 # Configuration stuff
289 case ${MYSQL_PV_MAJOR} in 333 case ${MYSQL_PV_MAJOR} in
334 5.[1-4]*) mysql_mycnf_version="5.1" ;;
290 5.[1-9]|6*|7*) mysql_mycnf_version="5.1" ;; 335 5.[5-9]|6*|7*) mysql_mycnf_version="5.5" ;;
291 esac 336 esac
292 einfo "Building default my.cnf (${mysql_mycnf_version})" 337 einfo "Building default my.cnf (${mysql_mycnf_version})"
293 insinto "${MY_SYSCONFDIR}" 338 insinto "${MY_SYSCONFDIR#${EPREFIX}}"
294 doins scripts/mysqlaccess.conf 339 doins scripts/mysqlaccess.conf
295 mycnf_src="my.cnf-${mysql_mycnf_version}" 340 mycnf_src="my.cnf-${mysql_mycnf_version}"
296 sed -e "s!@DATADIR@!${MY_DATADIR}!g" \ 341 sed -e "s!@DATADIR@!${MY_DATADIR}!g" \
297 "${FILESDIR}/${mycnf_src}" \ 342 "${FILESDIR}/${mycnf_src}" \
298 > "${TMPDIR}/my.cnf.ok" 343 > "${TMPDIR}/my.cnf.ok"
299 if use latin1 ; then 344 if use latin1 ; then
300 sed -i \ 345 sed -i \
301 -e "/character-set/s|utf8|latin1|g" \ 346 -e "/character-set/s|utf8|latin1|g" \
302 "${TMPDIR}/my.cnf.ok" 347 "${TMPDIR}/my.cnf.ok"
303 fi 348 fi
349 eprefixify "${TMPDIR}/my.cnf.ok"
304 newins "${TMPDIR}/my.cnf.ok" my.cnf 350 newins "${TMPDIR}/my.cnf.ok" my.cnf
305 351
306 # Minimal builds don't have the MySQL server 352 # Minimal builds don't have the MySQL server
307 if ! use minimal ; then 353 if ! use minimal ; then
308 einfo "Creating initial directories" 354 einfo "Creating initial directories"

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.13

  ViewVC Help
Powered by ViewVC 1.1.20