1 |
commit: 0ba7387a2bb4954e38129fa37d107257476066d4 |
2 |
Author: Brian Evans <grknight <AT> tuffmail <DOT> com> |
3 |
AuthorDate: Thu Nov 7 15:35:28 2013 +0000 |
4 |
Commit: Brian Evans <grknight <AT> lavabit <DOT> com> |
5 |
CommitDate: Thu Nov 7 17:29:24 2013 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/mysql.git;a=commit;h=0ba7387a |
7 |
|
8 |
Bring cmake-multilib in sync and add MariaDB 10.0.5 options |
9 |
|
10 |
--- |
11 |
eclass/mysql-cmake-multilib.eclass | 65 +++++++++++++++++++++++++++++++------- |
12 |
eclass/mysql-cmake.eclass | 18 +++++++++-- |
13 |
2 files changed, 70 insertions(+), 13 deletions(-) |
14 |
|
15 |
diff --git a/eclass/mysql-cmake-multilib.eclass b/eclass/mysql-cmake-multilib.eclass |
16 |
index 6314193..8834c37 100644 |
17 |
--- a/eclass/mysql-cmake-multilib.eclass |
18 |
+++ b/eclass/mysql-cmake-multilib.eclass |
19 |
@@ -67,6 +67,20 @@ mysql-cmake-multilib_disable_test() { |
20 |
fi |
21 |
} |
22 |
|
23 |
+# @FUNCTION: mysql-cmake_use_plugin |
24 |
+# @DESCRIPTION: |
25 |
+# Helper function to enable/disable plugins by use flags |
26 |
+# cmake-utils_use_with is not enough as some references check WITH_ (0|1) |
27 |
+# and some check WITHOUT_. Also, this can easily extend to non-storage plugins. |
28 |
+mysql-cmake_use_plugin() { |
29 |
+ [[ -z $2 ]] && die "mysql-cmake_use_plugin <USE flag> <flag name>" |
30 |
+ if use $1 ; then |
31 |
+ echo "-DWITH_$2=1" |
32 |
+ else |
33 |
+ echo "-DWITHOUT_$2=1 -DWITH_$2=0" |
34 |
+ fi |
35 |
+} |
36 |
+ |
37 |
# @FUNCTION: configure_cmake_locale |
38 |
# @DESCRIPTION: |
39 |
# Helper function to configure locale cmake options |
40 |
@@ -148,6 +162,10 @@ configure_cmake_standard() { |
41 |
$(cmake-utils_use_enable systemtap DTRACE) |
42 |
) |
43 |
|
44 |
+ if use static; then |
45 |
+ mycmakeargs+=( -DWITH_PIC=1 ) |
46 |
+ fi |
47 |
+ |
48 |
if use ssl; then |
49 |
mycmakeargs+=( -DWITH_SSL=system ) |
50 |
else |
51 |
@@ -179,15 +197,33 @@ configure_cmake_standard() { |
52 |
mycmakeargs+=( $(cmake-utils_use_with pbxt PBXT_STORAGE_ENGINE) ) |
53 |
fi |
54 |
|
55 |
- if [[ ${PN} == "mariadb" ]]; then |
56 |
+ if [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]]; then |
57 |
mycmakeargs+=( |
58 |
- $(cmake-utils_use_with oqgraph OQGRAPH_STORAGE_ENGINE) |
59 |
- $(cmake-utils_use_with sphinx SPHINX_STORAGE_ENGINE) |
60 |
- $(cmake-utils_use_with extraengine FEDERATEDX_STORAGE_ENGINE) |
61 |
+ $(mysql-cmake_use_plugin oqgraph OQGRAPH) |
62 |
+ $(mysql-cmake_use_plugin sphinx SPHINX) |
63 |
+ $(mysql-cmake_use_plugin extraengine FEDERATEDX) |
64 |
+ $(mysql-cmake_use_plugin tokudb TOKUDB) |
65 |
+ $(mysql-cmake_use_plugin pam AUTH_PAM) |
66 |
) |
67 |
|
68 |
- if ! use pam ; then |
69 |
- mycmakeargs+=( -DAUTH_PAM_DISABLED=1 ) |
70 |
+ if use jemalloc ; then |
71 |
+ mycmakeargs+=( -DWITH_JEMALLOC="system" ) |
72 |
+ else |
73 |
+ mycmakeargs+=( -DWITH_JEMALLOC=no ) |
74 |
+ fi |
75 |
+ |
76 |
+ if mysql_version_is_at_least 10.0.5 ; then |
77 |
+ # CassandraSE needs Apache Thrift which is not in portage |
78 |
+ # TODO: Add use and deps for Connect SE external deps |
79 |
+ mycmakeargs+= ( |
80 |
+ -DWITHOUT_CASSANDRA=1 -DWITH_CASSANDRA=0 |
81 |
+ $(mysql-cmake_use_plugin extraengine SEQUENCE) |
82 |
+ $(mysql-cmake_use_plugin extraengine SPIDER) |
83 |
+ $(mysql-cmake_use_plugin extraengine CONNECT) |
84 |
+ -DCONNECT_WITH_MYSQL=1 |
85 |
+ -DCONNECT_WITH_LIBXML=0 |
86 |
+ -DCONNECT_WITH_ODBC=0 |
87 |
+ ) |
88 |
fi |
89 |
fi |
90 |
|
91 |
@@ -240,13 +276,20 @@ mysql-cmake-multilib_src_prepare() { |
92 |
[[ -f ${i} ]] && sed -i -e '/CFLAGS/s,-prefer-non-pic,,g' "${i}" |
93 |
|
94 |
rm -f "scripts/mysqlbug" |
95 |
- if use jemalloc; then |
96 |
+ if use jemalloc && ! ( [[ ${PN} == "mariadb" ]] && mysql_version_is_at_least "5.5.33" ); then |
97 |
echo "TARGET_LINK_LIBRARIES(mysqld jemalloc)" >> "${S}/sql/CMakeLists.txt" |
98 |
fi |
99 |
|
100 |
if use tcmalloc; then |
101 |
echo "TARGET_LINK_LIBRARIES(mysqld tcmalloc)" >> "${S}/sql/CMakeLists.txt" |
102 |
fi |
103 |
+ |
104 |
+ if has tokudb ${IUSE} ; then |
105 |
+ # Don't build bundled xz-utils |
106 |
+ rm -f "${S}/storage/tokudb/ft-index/cmake_modules/TokuThirdParty.cmake" |
107 |
+ touch "${S}/storage/tokudb/ft-index/cmake_modules/TokuThirdParty.cmake" |
108 |
+ fi |
109 |
+ |
110 |
epatch_user |
111 |
} |
112 |
|
113 |
@@ -282,7 +325,7 @@ _cmake-multilib_src_configure() { |
114 |
# Bug 412851 |
115 |
# MariaDB requires this flag to compile with GPLv3 readline linked |
116 |
# Adds a warning about redistribution to configure |
117 |
- if [[ ${PN} == "mariadb" ]] ; then |
118 |
+ if [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]] ; then |
119 |
mycmakeargs+=( -DNOT_FOR_DISTRIBUTION=1 ) |
120 |
fi |
121 |
|
122 |
@@ -345,7 +388,7 @@ mysql-cmake-multilib_src_compile() { |
123 |
} |
124 |
|
125 |
_mysql-cmake-multilib_src_install() { |
126 |
- |
127 |
+ |
128 |
debug-print-function ${FUNCNAME} "$@" |
129 |
|
130 |
# Make sure the vars are correctly initialized |
131 |
@@ -364,7 +407,7 @@ _mysql-cmake-multilib_src_install() { |
132 |
dosym "/usr/bin/mysqlcheck" "/usr/bin/mysqloptimize" |
133 |
|
134 |
# Create a mariadb_config symlink |
135 |
- [[ ${PN} == "mariadb" ]] && dosym "/usr/bin/mysql_config" "/usr/bin/mariadb_config" |
136 |
+ [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]] && dosym "/usr/bin/mysql_config" "/usr/bin/mariadb_config" |
137 |
|
138 |
# INSTALL_LAYOUT=STANDALONE causes cmake to create a /usr/data dir |
139 |
rm -Rf "${ED}/usr/data" |
140 |
@@ -451,7 +494,7 @@ _mysql-cmake-multilib_src_install() { |
141 |
doenvd "${T}"/80mysql-libdir |
142 |
|
143 |
#Remove mytop if perl is not selected |
144 |
- [[ ${PN} == "mariadb" ]] && ! use perl \ |
145 |
+ [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]] && ! use perl \ |
146 |
&& rm -f "${ED}/usr/bin/mytop" |
147 |
} |
148 |
|
149 |
|
150 |
diff --git a/eclass/mysql-cmake.eclass b/eclass/mysql-cmake.eclass |
151 |
index 1b9985f..d6a965e 100644 |
152 |
--- a/eclass/mysql-cmake.eclass |
153 |
+++ b/eclass/mysql-cmake.eclass |
154 |
@@ -12,8 +12,8 @@ |
155 |
# @DESCRIPTION: |
156 |
# The mysql-cmake.eclass provides the support to build the mysql |
157 |
# ebuilds using the cmake build system. This eclass provides |
158 |
-# the src_unpack, src_prepare, src_configure, src_compile, scr_install, |
159 |
-# pkg_preinst, pkg_postinst, pkg_config and pkg_postrm phase hooks. |
160 |
+# the src_prepare, src_configure, src_compile, and src_install |
161 |
+# phase hooks. |
162 |
|
163 |
inherit cmake-utils flag-o-matic multilib prefix |
164 |
|
165 |
@@ -211,6 +211,20 @@ configure_cmake_standard() { |
166 |
else |
167 |
mycmakeargs+=( -DWITH_JEMALLOC=no ) |
168 |
fi |
169 |
+ |
170 |
+ if mysql_version_is_at_least 10.0.5 ; then |
171 |
+ # CassandraSE needs Apache Thrift which is not in portage |
172 |
+ # TODO: Add use and deps for Connect SE external deps |
173 |
+ mycmakeargs+=( |
174 |
+ -DWITHOUT_CASSANDRA=1 -DWITH_CASSANDRA=0 |
175 |
+ $(mysql-cmake_use_plugin extraengine SEQUENCE) |
176 |
+ $(mysql-cmake_use_plugin extraengine SPIDER) |
177 |
+ $(mysql-cmake_use_plugin extraengine CONNECT) |
178 |
+ -DCONNECT_WITH_MYSQL=1 |
179 |
+ -DCONNECT_WITH_LIBXML=0 |
180 |
+ -DCONNECT_WITH_ODBC=0 |
181 |
+ ) |
182 |
+ fi |
183 |
fi |
184 |
|
185 |
if [[ ${PN} == "percona-server" ]]; then |