/[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.13 Revision 1.25
1# Copyright 1999-2012 Gentoo Foundation 1# Copyright 1999-2014 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.13 2013/01/20 02:37:51 robbat2 Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-cmake.eclass,v 1.25 2014/10/08 17:25:46 grknight 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>
9# - Robin H. Johnson <robbat2@gentoo.org> 9# - Robin H. Johnson <robbat2@gentoo.org>
10# - Jorge Manuel B. S. Vicetto <jmbsvicetto@gentoo.org> 10# - Jorge Manuel B. S. Vicetto <jmbsvicetto@gentoo.org>
11# - Brian Evans <grknight@gentoo.org>
11# @BLURB: This eclass provides the support for cmake based mysql releases 12# @BLURB: This eclass provides the support for cmake based mysql releases
12# @DESCRIPTION: 13# @DESCRIPTION:
13# The mysql-cmake.eclass provides the support to build the mysql 14# The mysql-cmake.eclass provides the support to build the mysql
14# ebuilds using the cmake build system. This eclass provides 15# ebuilds using the cmake build system. This eclass provides
15# the src_unpack, src_prepare, src_configure, src_compile, scr_install, 16# the src_prepare, src_configure, src_compile, and src_install
16# pkg_preinst, pkg_postinst, pkg_config and pkg_postrm phase hooks. 17# phase hooks.
17 18
18inherit cmake-utils flag-o-matic multilib prefix 19inherit cmake-utils flag-o-matic multilib prefix eutils
19 20
20# 21#
21# HELPER FUNCTIONS: 22# HELPER FUNCTIONS:
22# 23#
23 24
32 ewarn "test '${rawtestname}' disabled: '${reason}'" 33 ewarn "test '${rawtestname}' disabled: '${reason}'"
33 34
34 testsuite="${rawtestname/.*}" 35 testsuite="${rawtestname/.*}"
35 testname="${rawtestname/*.}" 36 testname="${rawtestname/*.}"
36 for mysql_disabled_file in \ 37 for mysql_disabled_file in \
37 ${S}/mysql-test/disabled.def \ 38 ${S}/mysql-test/disabled.def \
38 ${S}/mysql-test/t/disabled.def ; do 39 ${S}/mysql-test/t/disabled.def ; do
39 [ -f "${mysql_disabled_file}" ] && break 40 [[ -f ${mysql_disabled_file} ]] && break
40 done 41 done
41 #mysql_disabled_file="${S}/mysql-test/t/disabled.def" 42 #mysql_disabled_file="${S}/mysql-test/t/disabled.def"
42 #einfo "rawtestname=${rawtestname} testname=${testname} testsuite=${testsuite}" 43 #einfo "rawtestname=${rawtestname} testname=${testname} testsuite=${testsuite}"
43 echo ${testname} : ${reason} >> "${mysql_disabled_file}" 44 echo ${testname} : ${reason} >> "${mysql_disabled_file}"
44 45
45 if [ -n "${testsuite}" ] && [ "${testsuite}" != "main" ]; then 46 if [[ ( -n ${testsuite} ) && ( ${testsuite} != "main" ) ]]; then
46 for mysql_disabled_file in \ 47 for mysql_disabled_file in \
47 ${S}/mysql-test/suite/${testsuite}/disabled.def \ 48 ${S}/mysql-test/suite/${testsuite}/disabled.def \
48 ${S}/mysql-test/suite/${testsuite}/t/disabled.def \ 49 ${S}/mysql-test/suite/${testsuite}/t/disabled.def \
49 FAILED ; do 50 FAILED ; do
50 [ -f "${mysql_disabled_file}" ] && break 51 [[ -f ${mysql_disabled_file} ]] && break
51 done 52 done
52 if [ "${mysql_disabled_file}" != "FAILED" ]; then 53 if [[ ${mysql_disabled_file} != "FAILED" ]]; then
53 echo "${testname} : ${reason}" >> "${mysql_disabled_file}" 54 echo "${testname} : ${reason}" >> "${mysql_disabled_file}"
54 else 55 else
55 for mysql_disabled_dir in \ 56 for mysql_disabled_dir in \
56 ${S}/mysql-test/suite/${testsuite} \ 57 ${S}/mysql-test/suite/${testsuite} \
57 ${S}/mysql-test/suite/${testsuite}/t \ 58 ${S}/mysql-test/suite/${testsuite}/t \
58 FAILED ; do 59 FAILED ; do
59 [ -d "${mysql_disabled_dir}" ] && break 60 [[ -d ${mysql_disabled_dir} ]] && break
60 done 61 done
61 if [ "${mysql_disabled_dir}" != "FAILED" ]; then 62 if [[ ${mysql_disabled_dir} != "FAILED" ]]; then
62 echo "${testname} : ${reason}" >> "${mysql_disabled_dir}/disabled.def" 63 echo "${testname} : ${reason}" >> "${mysql_disabled_dir}/disabled.def"
63 else 64 else
64 ewarn "Could not find testsuite disabled.def location for ${rawtestname}" 65 ewarn "Could not find testsuite disabled.def location for ${rawtestname}"
65 fi 66 fi
66 fi 67 fi
67 fi 68 fi
68} 69}
69 70
71# @FUNCTION: mysql-cmake_use_plugin
72# @DESCRIPTION:
73# Helper function to enable/disable plugins by use flags
74# cmake-utils_use_with is not enough as some references check WITH_ (0|1)
75# and some check WITHOUT_. Also, this can easily extend to non-storage plugins.
76mysql-cmake_use_plugin() {
77 [[ -z $2 ]] && die "mysql-cmake_use_plugin <USE flag> <flag name>"
78 if use_if_iuse $1 ; then
79 echo "-DWITH_$2=1 -DPLUGIN_$2=YES"
80 else
81 echo "-DWITHOUT_$2=1 -DWITH_$2=0 -DPLUGIN_$2=NO"
82 fi
83}
84
70# @FUNCTION: configure_cmake_locale 85# @FUNCTION: configure_cmake_locale
71# @DESCRIPTION: 86# @DESCRIPTION:
72# Helper function to configure locale cmake options 87# Helper function to configure locale cmake options
73configure_cmake_locale() { 88configure_cmake_locale() {
74 89
75 if ! use minimal && [ -n "${MYSQL_DEFAULT_CHARSET}" -a -n "${MYSQL_DEFAULT_COLLATION}" ]; then 90 if ! use minimal && [[ ( -n ${MYSQL_DEFAULT_CHARSET} ) && ( -n ${MYSQL_DEFAULT_COLLATION} ) ]]; then
76 ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}" 91 ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}"
77 ewarn "and a collation of ${MYSQL_DEFAULT_COLLATION}." 92 ewarn "and a collation of ${MYSQL_DEFAULT_COLLATION}."
78 ewarn "You MUST file bugs without these variables set." 93 ewarn "You MUST file bugs without these variables set."
79 94
80 mycmakeargs+=( 95 mycmakeargs+=(
101configure_cmake_minimal() { 116configure_cmake_minimal() {
102 117
103 mycmakeargs+=( 118 mycmakeargs+=(
104 -DWITHOUT_SERVER=1 119 -DWITHOUT_SERVER=1
105 -DWITHOUT_EMBEDDED_SERVER=1 120 -DWITHOUT_EMBEDDED_SERVER=1
106 -DENABLED_LOCAL_INFILE=1
107 -DEXTRA_CHARSETS=none 121 -DEXTRA_CHARSETS=none
108 -DINSTALL_SQLBENCHDIR= 122 -DINSTALL_SQLBENCHDIR=
109 -DWITH_SSL=system
110 -DWITH_ZLIB=system
111 -DWITHOUT_LIBWRAP=1
112 -DWITH_READLINE=0
113 -DWITH_LIBEDIT=0
114 -DWITHOUT_ARCHIVE_STORAGE_ENGINE=1 123 -DWITHOUT_ARCHIVE_STORAGE_ENGINE=1
115 -DWITHOUT_BLACKHOLE_STORAGE_ENGINE=1 124 -DWITHOUT_BLACKHOLE_STORAGE_ENGINE=1
116 -DWITHOUT_CSV_STORAGE_ENGINE=1 125 -DWITHOUT_CSV_STORAGE_ENGINE=1
117 -DWITHOUT_FEDERATED_STORAGE_ENGINE=1 126 -DWITHOUT_FEDERATED_STORAGE_ENGINE=1
118 -DWITHOUT_HEAP_STORAGE_ENGINE=1 127 -DWITHOUT_HEAP_STORAGE_ENGINE=1
119 -DWITHOUT_INNOBASE_STORAGE_ENGINE=1 128 -DWITHOUT_INNOBASE_STORAGE_ENGINE=1
120 -DWITHOUT_MYISAMMRG_STORAGE_ENGINE=1 129 -DWITHOUT_MYISAMMRG_STORAGE_ENGINE=1
121 -DWITHOUT_MYISAM_STORAGE_ENGINE=1 130 -DWITHOUT_MYISAM_STORAGE_ENGINE=1
122 -DWITHOUT_PARTITION_STORAGE_ENGINE=1 131 -DWITHOUT_PARTITION_STORAGE_ENGINE=1
123 -DWITHOUT_INNOBASE_STORAGE_ENGINE=1 132 -DPLUGIN_ARCHIVE=NO
133 -DPLUGIN_BLACKHOLE=NO
134 -DPLUGIN_CSV=NO
135 -DPLUGIN_FEDERATED=NO
136 -DPLUGIN_HEAP=NO
137 -DPLUGIN_INNOBASE=NO
138 -DPLUGIN_MYISAMMRG=NO
139 -DPLUGIN_MYISAM=NO
140 -DPLUGIN_PARTITION=NO
124 ) 141 )
125} 142}
126 143
127# @FUNCTION: configure_cmake_standard 144# @FUNCTION: configure_cmake_standard
128# @DESCRIPTION: 145# @DESCRIPTION:
129# Helper function to configure standard build 146# Helper function to configure standard build
130configure_cmake_standard() { 147configure_cmake_standard() {
131 148
132 mycmakeargs+=( 149 mycmakeargs+=(
133 -DENABLED_LOCAL_INFILE=1
134 -DEXTRA_CHARSETS=all 150 -DEXTRA_CHARSETS=all
135 -DMYSQL_USER=mysql 151 -DMYSQL_USER=mysql
136 -DMYSQL_UNIX_ADDR=${EPREFIX}/var/run/mysqld/mysqld.sock 152 -DMYSQL_UNIX_ADDR=${EPREFIX}/var/run/mysqld/mysqld.sock
137 -DWITH_READLINE=0
138 -DWITH_LIBEDIT=0
139 -DWITH_ZLIB=system
140 -DWITHOUT_LIBWRAP=1
141 )
142
143 mycmakeargs+=(
144 $(cmake-utils_use_disable !static SHARED) 153 $(cmake-utils_use_disable !static SHARED)
145 $(cmake-utils_use_with debug) 154 $(cmake-utils_use_with debug)
146 $(cmake-utils_use_with embedded EMBEDDED_SERVER) 155 $(cmake-utils_use_with embedded EMBEDDED_SERVER)
147 $(cmake-utils_use_with profiling) 156 $(cmake-utils_use_with profiling)
148 $(cmake-utils_use_enable systemtap DTRACE) 157 $(cmake-utils_use_enable systemtap DTRACE)
149 ) 158 )
150 159
151 if use ssl; then 160 if use static; then
152 mycmakeargs+=( -DWITH_SSL=system )
153 else
154 mycmakeargs+=( -DWITH_SSL=0 ) 161 mycmakeargs+=( -DWITH_PIC=1 )
155 fi 162 fi
156 163
157 if mysql_version_is_at_least "5.5" && use jemalloc; then 164 if use jemalloc; then
158 mycmakeargs+=( -DCMAKE_EXE_LINKER_FLAGS='-ljemalloc' -DWITH_SAFEMALLOC=OFF ) 165 mycmakeargs+=( -DWITH_SAFEMALLOC=OFF )
159 fi 166 fi
160 167
161 if mysql_version_is_at_least "5.5" && use tcmalloc; then 168 if use tcmalloc; then
162 mycmakeargs+=( -DCMAKE_EXE_LINKER_FLAGS='-ltcmalloc' -DWITH_SAFEMALLOC=OFF ) 169 mycmakeargs+=( -DWITH_SAFEMALLOC=OFF )
163 fi 170 fi
164 171
165 # Storage engines 172 # Storage engines
166 mycmakeargs+=( 173 mycmakeargs+=(
167 -DWITH_ARCHIVE_STORAGE_ENGINE=1 174 -DWITH_ARCHIVE_STORAGE_ENGINE=1
173 -DWITH_MYISAM_STORAGE_ENGINE=1 180 -DWITH_MYISAM_STORAGE_ENGINE=1
174 -DWITH_PARTITION_STORAGE_ENGINE=1 181 -DWITH_PARTITION_STORAGE_ENGINE=1
175 $(cmake-utils_use_with extraengine FEDERATED_STORAGE_ENGINE) 182 $(cmake-utils_use_with extraengine FEDERATED_STORAGE_ENGINE)
176 ) 183 )
177 184
178 if pbxt_available ; then 185 if in_iuse pbxt ; then
179 mycmakeargs+=( $(cmake-utils_use_with pbxt PBXT_STORAGE_ENGINE) ) 186 mycmakeargs+=( $(cmake-utils_use_with pbxt PBXT_STORAGE_ENGINE) )
180 fi 187 fi
181 188
182 if [ "${PN}" == "mariadb" ]; then 189 if [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]]; then
190 mycmakeargs+=(
191 $(mysql-cmake_use_plugin oqgraph OQGRAPH)
192 $(mysql-cmake_use_plugin sphinx SPHINX)
193 $(mysql-cmake_use_plugin extraengine FEDERATEDX)
194 $(mysql-cmake_use_plugin tokudb TOKUDB)
195 $(mysql-cmake_use_plugin pam AUTH_PAM)
196 )
197
198 if mysql_version_is_at_least 10.0.5 ; then
199 # CassandraSE needs Apache Thrift which is not in portage
183 mycmakeargs+=( 200 mycmakeargs+=(
184 $(cmake-utils_use_with oqgraph OQGRAPH_STORAGE_ENGINE) 201 -DWITHOUT_CASSANDRA=1 -DWITH_CASSANDRA=0
185 $(cmake-utils_use_with sphinx SPHINX_STORAGE_ENGINE) 202 -DPLUGIN_CASSANDRA=NO
186 $(cmake-utils_use_with extraengine FEDERATEDX_STORAGE_ENGINE) 203 $(mysql-cmake_use_plugin extraengine SEQUENCE)
204 $(mysql-cmake_use_plugin extraengine SPIDER)
205 $(mysql-cmake_use_plugin extraengine CONNECT)
206 -DCONNECT_WITH_MYSQL=1
207 -DPLUGIN_CONNECT_WITH_MYSQL=YES
208 $(cmake-utils_use xml CONNECT_WITH_LIBXML2)
209 $(cmake-utils_use odbc CONNECT_WITH_ODBC)
210 )
211 fi
212 fi
213
214 if [[ ${PN} == "percona-server" ]]; then
215 mycmakeargs+=(
216 $(cmake-utils_use_with pam)
217 )
218 fi
219
220 if [[ ${PN} == "mysql-cluster" ]]; then
221 # TODO: This really should include the following options,
222 # but the memcached package doesn't install the files it seeks.
223 # -DWITH_BUNDLED_MEMCACHED=OFF
224 # -DMEMCACHED_HOME=${EPREFIX}/usr
225 mycmakeargs+=(
226 -DWITH_BUNDLED_LIBEVENT=OFF
227 $(cmake-utils_use_with java NDB_JAVA)
187 ) 228 )
188 fi 229 fi
189} 230}
190 231
191# 232#
199 240
200 debug-print-function ${FUNCNAME} "$@" 241 debug-print-function ${FUNCNAME} "$@"
201 242
202 cd "${S}" 243 cd "${S}"
203 244
245 if [[ ${MY_EXTRAS_VER} != none ]]; then
246
204 # Apply the patches for this MySQL version 247 # Apply the patches for this MySQL version
205 EPATCH_SUFFIX="patch" 248 EPATCH_SUFFIX="patch"
206 mkdir -p "${EPATCH_SOURCE}" || die "Unable to create epatch directory" 249 mkdir -p "${EPATCH_SOURCE}" || die "Unable to create epatch directory"
207 # Clean out old items 250 # Clean out old items
208 rm -f "${EPATCH_SOURCE}"/* 251 rm -f "${EPATCH_SOURCE}"/*
209 # Now link in right patches 252 # Now link in right patches
210 mysql_mv_patches 253 mysql_mv_patches
211 # And apply 254 # And apply
212 epatch 255 epatch
256 fi
213 257
214 # last -fPIC fixup, per bug #305873 258 # last -fPIC fixup, per bug #305873
215 i="${S}"/storage/innodb_plugin/plug.in 259 i="${S}"/storage/innodb_plugin/plug.in
216 [ -f "${i}" ] && sed -i -e '/CFLAGS/s,-prefer-non-pic,,g' "${i}" 260 [[ -f ${i} ]] && sed -i -e '/CFLAGS/s,-prefer-non-pic,,g' "${i}"
217 261
218 rm -f "scripts/mysqlbug" 262 rm -f "scripts/mysqlbug"
263 if use jemalloc && ! ( [[ ${PN} == "mariadb" ]] && mysql_version_is_at_least "5.5.33" ); then
264 echo "TARGET_LINK_LIBRARIES(mysqld jemalloc)" >> "${S}/sql/CMakeLists.txt" || die
265 fi
266
267 if use tcmalloc; then
268 echo "TARGET_LINK_LIBRARIES(mysqld tcmalloc)" >> "${S}/sql/CMakeLists.txt"
269 fi
270
271 if in_iuse tokudb ; then
272 # Don't build bundled xz-utils
273 rm -f "${S}/storage/tokudb/ft-index/cmake_modules/TokuThirdParty.cmake"
274 touch "${S}/storage/tokudb/ft-index/cmake_modules/TokuThirdParty.cmake"
275 sed -i 's/ build_lzma//' "${S}/storage/tokudb/ft-index/ft/CMakeLists.txt" || die
276 fi
277
278 epatch_user
219} 279}
220 280
221# @FUNCTION: mysql-cmake_src_configure 281# @FUNCTION: mysql-cmake_src_configure
222# @DESCRIPTION: 282# @DESCRIPTION:
223# Configure mysql to build the code for Gentoo respecting the use flags. 283# Configure mysql to build the code for Gentoo respecting the use flags.
225 285
226 debug-print-function ${FUNCNAME} "$@" 286 debug-print-function ${FUNCNAME} "$@"
227 287
228 CMAKE_BUILD_TYPE="RelWithDebInfo" 288 CMAKE_BUILD_TYPE="RelWithDebInfo"
229 289
290 # debug hack wrt #497532
230 mycmakeargs=( 291 mycmakeargs=(
292 -DCMAKE_C_FLAGS_RELWITHDEBINFO="$(usex debug "" "-DNDEBUG")"
293 -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="$(usex debug "" "-DNDEBUG")"
231 -DCMAKE_INSTALL_PREFIX=${EPREFIX}/usr 294 -DCMAKE_INSTALL_PREFIX=${EPREFIX}/usr
232 -DMYSQL_DATADIR=${EPREFIX}/var/lib/mysql 295 -DMYSQL_DATADIR=${EPREFIX}/var/lib/mysql
233 -DSYSCONFDIR=${EPREFIX}/etc/mysql 296 -DSYSCONFDIR=${EPREFIX}/etc/mysql
234 -DINSTALL_BINDIR=bin 297 -DINSTALL_BINDIR=bin
235 -DINSTALL_DOCDIR=share/doc/${P} 298 -DINSTALL_DOCDIR=share/doc/${P}
236 -DINSTALL_DOCREADMEDIR=share/doc/${P} 299 -DINSTALL_DOCREADMEDIR=share/doc/${P}
237 -DINSTALL_INCLUDEDIR=include/mysql 300 -DINSTALL_INCLUDEDIR=include/mysql
238 -DINSTALL_INFODIR=share/info 301 -DINSTALL_INFODIR=share/info
302 -DINSTALL_LIBDIR=$(get_libdir)
239 -DINSTALL_LIBDIR=$(get_libdir)/mysql 303 -DINSTALL_ELIBDIR=$(get_libdir)/mysql
240 -DINSTALL_MANDIR=share/man 304 -DINSTALL_MANDIR=share/man
241 -DINSTALL_MYSQLDATADIR=${EPREFIX}/var/lib/mysql 305 -DINSTALL_MYSQLDATADIR=${EPREFIX}/var/lib/mysql
242 -DINSTALL_MYSQLSHAREDIR=share/mysql 306 -DINSTALL_MYSQLSHAREDIR=share/mysql
243 -DINSTALL_MYSQLTESTDIR=share/mysql/mysql-test 307 -DINSTALL_MYSQLTESTDIR=share/mysql/mysql-test
244 -DINSTALL_PLUGINDIR=$(get_libdir)/mysql/plugin 308 -DINSTALL_PLUGINDIR=$(get_libdir)/mysql/plugin
245 -DINSTALL_SBINDIR=sbin 309 -DINSTALL_SBINDIR=sbin
246 -DINSTALL_SCRIPTDIR=share/mysql/scripts 310 -DINSTALL_SCRIPTDIR=share/mysql/scripts
247 -DINSTALL_SQLBENCHDIR=share/mysql 311 -DINSTALL_SQLBENCHDIR=share/mysql
248 -DINSTALL_SUPPORTFILESDIR=${EPREFIX}/usr/share/mysql 312 -DINSTALL_SUPPORTFILESDIR=${EPREFIX}/usr/share/mysql
249 -DWITH_COMMENT="Gentoo Linux ${PF}" 313 -DWITH_COMMENT="Gentoo Linux ${PF}"
250 -DWITHOUT_UNIT_TESTS=1 314 $(cmake-utils_use_with test UNIT_TESTS)
315 -DWITH_LIBEDIT=0
316 -DWITH_ZLIB=system
317 -DWITHOUT_LIBWRAP=1
318 -DENABLED_LOCAL_INFILE=1
319 $(cmake-utils_use_enable static-libs STATIC_LIBS)
320 -DWITH_SSL=$(usex ssl system bundled)
321 -DWITH_DEFAULT_COMPILER_OPTIONS=0
322 -DWITH_DEFAULT_FEATURE_SET=0
251 ) 323 )
252 324
253 # Bug 412851 325 if in_iuse bindist ; then
254 # MariaDB requires this flag to compile with GPLv3 readline linked 326 mycmakeargs+=(
255 # Adds a warning about redistribution to configure 327 -DWITH_READLINE=$(usex bindist 1 0)
256 if [[ "${PN}" == "mariadb" ]] ; then 328 -DNOT_FOR_DISTRIBUTION=$(usex bindist 0 1)
257 mycmakeargs+=( -DNOT_FOR_DISTRIBUTION=1 ) 329 $(usex bindist -DHAVE_BFD_H=0 '')
330 )
331 fi
332
333 mycmakeargs+=( -DWITH_EDITLINE=system )
334
335 if [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]] ; then
336 mycmakeargs+=(
337 -DWITH_JEMALLOC=$(usex jemalloc system)
338 )
339 mysql_version_is_at_least "10.0.9" && mycmakeargs+=( -DWITH_PCRE=system )
258 fi 340 fi
259 341
260 configure_cmake_locale 342 configure_cmake_locale
261 343
262 if use minimal ; then 344 if use minimal ; then
266 fi 348 fi
267 349
268 # Bug #114895, bug #110149 350 # Bug #114895, bug #110149
269 filter-flags "-O" "-O[01]" 351 filter-flags "-O" "-O[01]"
270 352
271 CXXFLAGS="${CXXFLAGS} -fno-exceptions -fno-strict-aliasing" 353 CXXFLAGS="${CXXFLAGS} -fno-strict-aliasing"
272 CXXFLAGS="${CXXFLAGS} -felide-constructors -fno-rtti" 354 CXXFLAGS="${CXXFLAGS} -felide-constructors"
355 # Causes linkage failures. Upstream bug #59607 removes it
356 if ! mysql_version_is_at_least "5.6" ; then
273 CXXFLAGS="${CXXFLAGS} -fno-implicit-templates" 357 CXXFLAGS="${CXXFLAGS} -fno-implicit-templates"
358 fi
359 # As of 5.7, exceptions and rtti are used!
360 if ! mysql_version_is_at_least "5.7" ; then
361 CXXFLAGS="${CXXFLAGS} -fno-exceptions -fno-rtti"
362 fi
274 export CXXFLAGS 363 export CXXFLAGS
275 364
276 # bug #283926, with GCC4.4, this is required to get correct behavior. 365 # bug #283926, with GCC4.4, this is required to get correct behavior.
277 append-flags -fno-strict-aliasing 366 append-flags -fno-strict-aliasing
278 367
305 einfo "Making Convenience links for mysqlcheck multi-call binary" 394 einfo "Making Convenience links for mysqlcheck multi-call binary"
306 dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqlanalyze" 395 dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqlanalyze"
307 dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqlrepair" 396 dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqlrepair"
308 dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqloptimize" 397 dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqloptimize"
309 398
399 # Create a mariadb_config symlink
400 [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]] && dosym "/usr/bin/mysql_config" "/usr/bin/mariadb_config"
401
310 # INSTALL_LAYOUT=STANDALONE causes cmake to create a /usr/data dir 402 # INSTALL_LAYOUT=STANDALONE causes cmake to create a /usr/data dir
311 rm -Rf "${ED}/usr/data" 403 rm -Rf "${ED}/usr/data"
312 404
313 # Various junk (my-*.cnf moved elsewhere) 405 # Various junk (my-*.cnf moved elsewhere)
314 einfo "Removing duplicate /usr/share/mysql files" 406 einfo "Removing duplicate /usr/share/mysql files"
315
316 # Clean up stuff for a minimal build
317# if use minimal ; then
318# einfo "Remove all extra content for minimal build"
319# rm -Rf "${D}${MY_SHAREDSTATEDIR}"/{mysql-test,sql-bench}
320# rm -f "${ED}"/usr/bin/{mysql{_install_db,manager*,_secure_installation,_fix_privilege_tables,hotcopy,_convert_table_format,d_multi,_fix_extensions,_zap,_explain_log,_tableinfo,d_safe,_install,_waitpid,binlog,test},myisam*,isam*,pack_isam}
321# rm -f "${ED}/usr/sbin/mysqld"
322# rm -f "${D}${MY_LIBDIR}"/lib{heap,merge,nisam,my{sys,strings,sqld,isammrg,isam},vio,dbug}.a
323# fi
324 407
325 # Unless they explicitly specific USE=test, then do not install the 408 # Unless they explicitly specific USE=test, then do not install the
326 # testsuite. It DOES have a use to be installed, esp. when you want to do a 409 # testsuite. It DOES have a use to be installed, esp. when you want to do a
327 # validation of your database configuration after tuning it. 410 # validation of your database configuration after tuning it.
328 if ! use test ; then 411 if ! use test ; then
330 fi 413 fi
331 414
332 # Configuration stuff 415 # Configuration stuff
333 case ${MYSQL_PV_MAJOR} in 416 case ${MYSQL_PV_MAJOR} in
334 5.[1-4]*) mysql_mycnf_version="5.1" ;; 417 5.[1-4]*) mysql_mycnf_version="5.1" ;;
335 5.[5-9]|6*|7*) mysql_mycnf_version="5.5" ;; 418 5.5) mysql_mycnf_version="5.5" ;;
419 5.[6-9]|6*|7*|8*|9*|10*) mysql_mycnf_version="5.6" ;;
336 esac 420 esac
337 einfo "Building default my.cnf (${mysql_mycnf_version})" 421 einfo "Building default my.cnf (${mysql_mycnf_version})"
338 insinto "${MY_SYSCONFDIR#${EPREFIX}}" 422 insinto "${MY_SYSCONFDIR#${EPREFIX}}"
339 doins scripts/mysqlaccess.conf 423 [[ -f "${S}/scripts/mysqlaccess.conf" ]] && doins "${S}"/scripts/mysqlaccess.conf
340 mycnf_src="my.cnf-${mysql_mycnf_version}" 424 mycnf_src="my.cnf-${mysql_mycnf_version}"
341 sed -e "s!@DATADIR@!${MY_DATADIR}!g" \ 425 sed -e "s!@DATADIR@!${MY_DATADIR}!g" \
342 "${FILESDIR}/${mycnf_src}" \ 426 "${FILESDIR}/${mycnf_src}" \
343 > "${TMPDIR}/my.cnf.ok" 427 > "${TMPDIR}/my.cnf.ok" || die
428 use prefix && sed -i -r -e '/^user[[:space:]]*=[[:space:]]*mysql$/d' "${TMPDIR}/my.cnf.ok"
344 if use latin1 ; then 429 if use latin1 ; then
345 sed -i \ 430 sed -i \
346 -e "/character-set/s|utf8|latin1|g" \ 431 -e "/character-set/s|utf8|latin1|g" \
347 "${TMPDIR}/my.cnf.ok" 432 "${TMPDIR}/my.cnf.ok" || die
348 fi 433 fi
349 eprefixify "${TMPDIR}/my.cnf.ok" 434 eprefixify "${TMPDIR}/my.cnf.ok"
350 newins "${TMPDIR}/my.cnf.ok" my.cnf 435 newins "${TMPDIR}/my.cnf.ok" my.cnf
351 436
352 # Minimal builds don't have the MySQL server 437 # Minimal builds don't have the MySQL server
353 if ! use minimal ; then 438 if ! use minimal ; then
354 einfo "Creating initial directories" 439 einfo "Creating initial directories"
355 # Empty directories ... 440 # Empty directories ...
356 diropts "-m0750" 441 diropts "-m0750"
357 if [[ "${PREVIOUS_DATADIR}" != "yes" ]] ; then 442 if [[ ${PREVIOUS_DATADIR} != "yes" ]] ; then
358 dodir "${MY_DATADIR#${EPREFIX}}" 443 dodir "${MY_DATADIR#${EPREFIX}}"
359 keepdir "${MY_DATADIR#${EPREFIX}}" 444 keepdir "${MY_DATADIR#${EPREFIX}}"
360 chown -R mysql:mysql "${D}/${MY_DATADIR}" 445 chown -R mysql:mysql "${D}/${MY_DATADIR}"
361 fi 446 fi
362 447
363 diropts "-m0755" 448 diropts "-m0755"
364 for folder in "${MY_LOGDIR#${EPREFIX}}" "/var/run/mysqld" ; do 449 for folder in "${MY_LOGDIR#${EPREFIX}}" ; do
365 dodir "${folder}" 450 dodir "${folder}"
366 keepdir "${folder}" 451 keepdir "${folder}"
367 chown -R mysql:mysql "${ED}/${folder}" 452 chown -R mysql:mysql "${ED}/${folder}"
368 done 453 done
369 fi 454 fi
375 for script in \ 460 for script in \
376 "${S}"/support-files/my-*.cnf.sh \ 461 "${S}"/support-files/my-*.cnf.sh \
377 "${S}"/support-files/magic \ 462 "${S}"/support-files/magic \
378 "${S}"/support-files/ndb-config-2-node.ini.sh 463 "${S}"/support-files/ndb-config-2-node.ini.sh
379 do 464 do
380 [[ -f "$script" ]] && dodoc "${script}" 465 [[ -f $script ]] && dodoc "${script}"
381 done 466 done
382 467
383 docinto "scripts" 468 docinto "scripts"
384 for script in "${S}"/scripts/mysql* ; do 469 for script in "${S}"/scripts/mysql* ; do
385 [[ -f "$script" ]] && [[ "${script%.sh}" == "${script}" ]] && dodoc "${script}" 470 [[ ( -f $script ) && ( ${script%.sh} == ${script} ) ]] && dodoc "${script}"
386 done 471 done
472 fi
387 473
474 #Remove mytop if perl is not selected
475 [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]] && ! use perl \
476 && rm -f "${ED}/usr/bin/mytop"
477
478 # Percona has decided to rename libmysqlclient to libperconaserverclient
479 # Use a symlink to preserve linkages for those who don't use mysql_config
480 if [[ ${PN} == "percona-server" ]] && mysql_version_is_at_least "5.5.36" ; then
481 dosym libperconaserverclient.so /usr/$(get_libdir)/libmysqlclient.so
482 dosym libperconaserverclient.so /usr/$(get_libdir)/libmysqlclient_r.so
483 if use static-libs ; then
484 dosym libperconaserverclient.a /usr/$(get_libdir)/libmysqlclient.a
485 dosym libperconaserverclient.a /usr/$(get_libdir)/libmysqlclient_r.a
388 fi 486 fi
389 487 fi
390 mysql_lib_symlinks "${ED}"
391} 488}

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

  ViewVC Help
Powered by ViewVC 1.1.20