From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 0BA0213873B for ; Thu, 6 Mar 2014 18:13:06 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 70298E0AE2; Thu, 6 Mar 2014 18:13:05 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id DED49E0AE2 for ; Thu, 6 Mar 2014 18:13:04 +0000 (UTC) Received: from spoonbill.gentoo.org (spoonbill.gentoo.org [81.93.255.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C54AD33FA7E for ; Thu, 6 Mar 2014 18:13:03 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id 8683118875 for ; Thu, 6 Mar 2014 18:12:59 +0000 (UTC) From: "Brian Evans" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Evans" Message-ID: <1394129443.4a4e3a366991d77e9c4cc00fe2e377acc3880436.grknight.pub@gentoo> Subject: [gentoo-commits] proj/mysql:master commit in: eclass/ X-VCS-Repository: proj/mysql X-VCS-Files: eclass/mysql-cmake-multilib.eclass eclass/mysql-multilib.eclass eclass/mysql-v2.eclass X-VCS-Directories: eclass/ X-VCS-Committer: grknight.pub X-VCS-Committer-Name: Brian Evans X-VCS-Revision: 4a4e3a366991d77e9c4cc00fe2e377acc3880436 X-VCS-Branch: master Date: Thu, 6 Mar 2014 18:12:59 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: a6632ebf-d227-4ee5-9b1f-158eb4514e8e X-Archives-Hash: a8a64dc66c1c231183b7c408d28f9596 commit: 4a4e3a366991d77e9c4cc00fe2e377acc3880436 Author: Brian Evans tuffmail com> AuthorDate: Thu Mar 6 18:10:43 2014 +0000 Commit: Brian Evans lavabit com> CommitDate: Thu Mar 6 18:10:43 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/mysql.git;a=commit;h=4a4e3a36 [eclass] Move mysql-cmake-multilib to mysql-multilib as mysql-v2 could not be used for multilib --- eclass/mysql-cmake-multilib.eclass | 156 -------- eclass/{mysql-v2.eclass => mysql-multilib.eclass} | 440 +++++++++++----------- eclass/mysql-v2.eclass | 5 +- 3 files changed, 216 insertions(+), 385 deletions(-) diff --git a/eclass/mysql-cmake-multilib.eclass b/eclass/mysql-cmake-multilib.eclass deleted file mode 100644 index 4edca87..0000000 --- a/eclass/mysql-cmake-multilib.eclass +++ /dev/null @@ -1,156 +0,0 @@ -# Copyright 1999-2013 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ - -# @ECLASS: mysql-cmake-multilib.eclass -# @MAINTAINER: -# Maintainers: -# - MySQL Team -# - Robin H. Johnson -# - Jorge Manuel B. S. Vicetto -# @BLURB: This eclass provides the support for cmake based mysql releases -# @DESCRIPTION: -# The mysql-cmake-multilib.eclass provides the support to build the mysql -# ebuilds using the cmake build system. This eclass provides -# the src_prepare, src_configure, src_compile and src_install -# phase hooks. - -inherit cmake-utils multilib-build flag-o-matic mysql-cmake - -# -# HELPER FUNCTIONS: -# - -# @FUNCTION: mysql_cmake_disable_test -# @DESCRIPTION: -# Helper function to disable specific tests. -mysql-cmake-multilib_disable_test() { - mysql-cmake_disable_test "$@" -} - -# -# EBUILD FUNCTIONS -# - -# @FUNCTION: mysql-cmake-multilib_src_prepare -# @DESCRIPTION: -# Apply patches to the source code and remove unneeded bundled libs. -mysql-cmake-multilib_src_prepare() { - - debug-print-function ${FUNCNAME} "$@" - - mysql-cmake_src_prepare "$@" -} - -_mysql-multilib_src_configure() { - - debug-print-function ${FUNCNAME} "$@" - - CMAKE_BUILD_TYPE="RelWithDebInfo" - - mycmakeargs=( - -DCMAKE_INSTALL_PREFIX=${EPREFIX}/usr - -DMYSQL_DATADIR=${EPREFIX}/var/lib/mysql - -DSYSCONFDIR=${EPREFIX}/etc/mysql - -DINSTALL_BINDIR=bin - -DINSTALL_DOCDIR=share/doc/${P} - -DINSTALL_DOCREADMEDIR=share/doc/${P} - -DINSTALL_INCLUDEDIR=include/mysql - -DINSTALL_INFODIR=share/info - -DINSTALL_LIBDIR=$(get_libdir)/mysql - -DINSTALL_MANDIR=share/man - -DINSTALL_MYSQLDATADIR=${EPREFIX}/var/lib/mysql - -DINSTALL_MYSQLSHAREDIR=share/mysql - -DINSTALL_MYSQLTESTDIR=share/mysql/mysql-test - -DINSTALL_PLUGINDIR=$(get_libdir)/mysql/plugin - -DINSTALL_SBINDIR=sbin - -DINSTALL_SCRIPTDIR=share/mysql/scripts - -DINSTALL_SQLBENCHDIR=share/mysql - -DINSTALL_SUPPORTFILESDIR=${EPREFIX}/usr/share/mysql - -DWITH_COMMENT="Gentoo Linux ${PF}" - $(cmake-utils_use_with test UNIT_TESTS) - ) - - # Bug 412851 - # MariaDB requires this flag to compile with GPLv3 readline linked - # Adds a warning about redistribution to configure - if [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]] ; then - mycmakeargs+=( -DNOT_FOR_DISTRIBUTION=1 ) - fi - - configure_cmake_locale - - if multilib_build_binaries ; then - if use minimal ; then - configure_cmake_minimal - else - configure_cmake_standard - fi - else - configure_cmake_minimal - fi - - # Bug #114895, bug #110149 - filter-flags "-O" "-O[01]" - - CXXFLAGS="${CXXFLAGS} -fno-strict-aliasing" - CXXFLAGS="${CXXFLAGS} -felide-constructors -fno-rtti" - # Causes linkage failures. Upstream bug #59607 removes it - if ! mysql_version_is_at_least "5.6" ; then - CXXFLAGS="${CXXFLAGS} -fno-implicit-templates" - fi - # As of 5.7, exceptions are used! - if ! mysql_version_is_at_least "5.7" ; then - CXXFLAGS="${CXXFLAGS} -fno-exceptions" - fi - export CXXFLAGS - - # bug #283926, with GCC4.4, this is required to get correct behavior. - append-flags -fno-strict-aliasing - - cmake-utils_src_configure -} - - -# @FUNCTION: mysql-cmake-multilib_src_configure -# @DESCRIPTION: -# Configure mysql to build the code for Gentoo respecting the use flags. -mysql-cmake-multilib_src_configure() { - multilib_parallel_foreach_abi _mysql-multilib_src_configure "${@}" -} - -_mysql-multilib_src_compile() { - - if ! multilib_build_binaries ; then - BUILD_DIR="${BUILD_DIR}/libmysql" cmake-utils_src_compile - else - cmake-utils_src_compile - fi -} - -# @FUNCTION: mysql-cmake-multilib_src_compile -# @DESCRIPTION: -# Compile the mysql code. -mysql-cmake-multilib_src_compile() { - - debug-print-function ${FUNCNAME} "$@" - - multilib_foreach_abi _mysql-multilib_src_compile "${@}" -} - -_mysql-multilib_src_install() { - debug-print-function ${FUNCNAME} "$@" - - if multilib_build_binaries; then - mysql-cmake_src_install - else - BUILD_DIR="${BUILD_DIR}/libmysql" cmake-utils_src_install - fi -} - -# @FUNCTION: mysql-cmake-multilib_src_install -# @DESCRIPTION: -# Install mysql. -mysql-cmake-multilib_src_install() { - multilib_foreach_abi _mysql-multilib_src_install "${@}" -} diff --git a/eclass/mysql-v2.eclass b/eclass/mysql-multilib.eclass similarity index 72% copy from eclass/mysql-v2.eclass copy to eclass/mysql-multilib.eclass index 0b44d19..a606766 100644 --- a/eclass/mysql-v2.eclass +++ b/eclass/mysql-multilib.eclass @@ -1,8 +1,8 @@ -# Copyright 1999-2012 Gentoo Foundation +# Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/mysql-v2.eclass,v 1.24 2013/02/13 00:40:57 robbat2 Exp $ +# $Header: $ -# @ECLASS: mysql-v2.eclass +# @ECLASS: mysql-v3.eclass # @MAINTAINER: # Maintainers: # - MySQL Team @@ -10,37 +10,14 @@ # - Jorge Manuel B. S. Vicetto # @BLURB: This eclass provides most of the functions for mysql ebuilds # @DESCRIPTION: -# The mysql-v2.eclass is the base eclass to build the mysql and +# The mysql-v3.eclass is the base eclass to build the mysql and # alternative projects (mariadb and percona) ebuilds. -# This eclass uses the mysql-autotools and mysql-cmake eclasses for the +# This eclass uses the mysql-cmake eclass for the # specific bits related to the build system. # It provides the src_unpack, src_prepare, src_configure, src_compile, # src_install, pkg_preinst, pkg_postinst, pkg_config and pkg_postrm # phase hooks. -# @ECLASS-VARIABLE: BUILD -# @DESCRIPTION: -# Build type of the mysql version -: ${BUILD:=autotools} - -case ${BUILD} in - "cmake") - BUILD_INHERIT="mysql-cmake" - ;; - "cmake-multilib") - BUILD_INHERIT="mysql-cmake-multilib" - ;; - "autotools") - BUILD_INHERIT="mysql-autotools" - - WANT_AUTOCONF="latest" - WANT_AUTOMAKE="latest" - ;; - *) - die "${BUILD} is not a valid build system for mysql" - ;; -esac - MYSQL_EXTRAS="" # @ECLASS-VARIABLE: MYSQL_EXTRAS_VER @@ -49,18 +26,19 @@ MYSQL_EXTRAS="" # Use "none" to disable it's use [[ ${MY_EXTRAS_VER} == "live" ]] && MYSQL_EXTRAS="git-2" -inherit eutils flag-o-matic gnuconfig ${MYSQL_EXTRAS} ${BUILD_INHERIT} mysql_fx versionator toolchain-funcs user +inherit eutils flag-o-matic ${MYSQL_EXTRAS} mysql-cmake mysql_fx versionator \ + toolchain-funcs user cmake-utils multilib-build # # Supported EAPI versions and export functions # case "${EAPI:-0}" in - 4|5) ;; + 5) ;; *) die "Unsupported EAPI: ${EAPI}" ;; esac -EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare src_configure src_compile src_install pkg_preinst pkg_postinst pkg_config pkg_postrm +EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare src_configure src_compile src_install pkg_preinst pkg_postinst pkg_config # # VARIABLES: @@ -87,7 +65,6 @@ MYSQL_PV_MAJOR="$(get_version_component_range 1-2 ${PV})" # Cluster is a special case... if [[ "${PN}" == "mysql-cluster" ]]; then case $PV in - 6.1*|7.0*|7.1*) MYSQL_PV_MAJOR=5.1 ;; 7.2*|7.3*) MYSQL_PV_MAJOR=5.5 ;; esac fi @@ -111,8 +88,8 @@ done # strip leading "0" (otherwise it's considered an octal number by BASH) MYSQL_VERSION_ID=${MYSQL_VERSION_ID##"0"} -# This eclass should only be used with at least mysql-5.1.50 -mysql_version_is_at_least "5.1.50" || die "This eclass should only be used with >=mysql-5.1.50" +# This eclass should only be used with at least mysql-5.5.35 +mysql_version_is_at_least "5.5.35" || die "This eclass should only be used with >=mysql-5.5.35" # @ECLASS-VARIABLE: XTRADB_VER # @DEFAULT_UNSET @@ -147,7 +124,7 @@ if [[ -z ${SERVER_URI} ]]; then MY_PV=$(get_version_component_range 1-3 ${PV}) PERCONA_RELEASE=$(get_version_component_range 4-5 ${PV}) PERCONA_RC=$(get_version_component_range 6 ${PV}) - mysql_version_is_at_least "5.5.34" && PERCONA_RC=${PERCONA_RC:-rel} + PERCONA_RC=${PERCONA_RC:-rel} SERVER_URI="http://www.percona.com/redir/downloads/${PERCONA_PN}-${MIRROR_PV}/${PERCONA_PN}-${MY_PV}-${PERCONA_RC}${PERCONA_RELEASE}/source/${PERCONA_PN}-${MY_PV}-${PERCONA_RC:-rel}${PERCONA_RELEASE}.tar.gz" # http://www.percona.com/redir/downloads/Percona-Server-5.5/LATEST/source/Percona-Server-5.5.30-rel30.2.tar.gz # http://www.percona.com/redir/downloads/Percona-Server-5.6/Percona-Server-5.6.13-rc60.5/source/Percona-Server-5.6.13-rc60.5.tar.gz @@ -174,7 +151,6 @@ SRC_URI="${SERVER_URI}" if [[ ${MY_EXTRAS_VER} != "live" && ${MY_EXTRAS_VER} != "none" ]]; then SRC_URI="${SRC_URI} mirror://gentoo/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 - http://g3nt8.org/patches/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 http://dev.gentoo.org/~robbat2/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2 http://dev.gentoo.org/~jmbsvicetto/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2" fi @@ -196,46 +172,24 @@ fi LICENSE="GPL-2" SLOT="0" -case "${BUILD}" in - "autotools") - IUSE="big-tables debug embedded minimal +perl selinux ssl static test" - ;; - cmake*) - IUSE="debug embedded minimal +perl selinux ssl static static-libs test" - ;; -esac - -# Common IUSE -IUSE="${IUSE} latin1 extraengine cluster max-idx-128 +community profiling" +IUSE="+community cluster debug embedded extraengine jemalloc latin1 max-idx-128 minimal + +perl profiling selinux ssl systemtap static static-libs tcmalloc test" if [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]]; then - mysql_check_version_range "5.1.38 to 5.3.99" && IUSE="${IUSE} libevent" - mysql_version_is_at_least "5.2" && IUSE="${IUSE} oqgraph" && \ - REQUIRED_USE="${REQUIRED_USE} minimal? ( !oqgraph )" - mysql_version_is_at_least "5.2.5" && IUSE="${IUSE} sphinx" && \ - REQUIRED_USE="${REQUIRED_USE} minimal? ( !sphinx )" - mysql_version_is_at_least "5.2.10" && IUSE="${IUSE} pam" + IUSE="${IUSE} oqgraph pam sphinx tokudb" # 5.5.33 and 10.0.5 add TokuDB. Authors strongly recommend jemalloc or perfomance suffers - mysql_version_is_at_least "10.0.5" && IUSE="${IUSE} tokudb odbc xml" && \ - REQUIRED_USE="${REQUIRED_USE} odbc? ( extraengine ) xml? ( extraengine ) tokudb? ( jemalloc )" - mysql_check_version_range "5.5.33 to 5.5.99" && IUSE="${IUSE} tokudb" && \ - REQUIRED_USE="${REQUIRED_USE} tokudb? ( jemalloc )" -fi - -if mysql_version_is_at_least "5.5"; then - REQUIRED_USE="${REQUIRED_USE} tcmalloc? ( !jemalloc ) jemalloc? ( !tcmalloc ) embedded? ( static-libs )" - IUSE="${IUSE} jemalloc tcmalloc" -fi - -if mysql_version_is_at_least "5.5.7"; then - IUSE="${IUSE} systemtap" + mysql_version_is_at_least "10.0.5" && IUSE="${IUSE} odbc xml" && \ + REQUIRED_USE="odbc? ( extraengine !minimal ) xml? ( extraengine !minimal )" + REQUIRED_USE="${REQUIRED_USE} minimal? ( !oqgraph !sphinx ) tokudb? ( jemalloc )" fi if [[ ${PN} == "percona-server" ]]; then - mysql_version_is_at_least "5.5.10" && IUSE="${IUSE} pam" + IUSE="${IUSE} pam" fi -REQUIRED_USE="${REQUIRED_USE} minimal? ( !cluster !extraengine !embedded ) static? ( !ssl )" +REQUIRED_USE=" + ${REQUIRED_USE} tcmalloc? ( !jemalloc ) jemalloc? ( !tcmalloc ) embedded? ( static-libs ) + minimal? ( !cluster !extraengine !embedded ) static? ( !ssl )" # # DEPENDENCIES: @@ -244,35 +198,43 @@ REQUIRED_USE="${REQUIRED_USE} minimal? ( !cluster !extraengine !embedded ) stati # Be warned, *DEPEND are version-dependant # These are used for both runtime and compiletime DEPEND=" - ssl? ( >=dev-libs/openssl-0.9.6d ) - kernel_linux? ( sys-process/procps ) + ssl? ( >=dev-libs/openssl-1.0.0:= + abi_x86_32? ( app-emulation/emul-linux-x86-baselibs ) + ) + kernel_linux? ( + sys-process/procps:= + dev-libs/libaio:= + ) >=sys-apps/sed-4 >=sys-apps/texinfo-4.7-r1 - >=sys-libs/zlib-1.2.3 + >=sys-libs/zlib-1.2.3:=[${MULTILIB_USEDEP}] !dev-db/mariadb-native-client[mysqlcompat] + jemalloc? ( dev-libs/jemalloc:= ) + tcmalloc? ( dev-util/google-perftools:= ) + systemtap? ( >=dev-util/systemtap-1.3:= ) " # dev-db/mysql-5.6.12+ only works with dev-libs/libedit if [[ ${PN} == "mysql" || ${PN} == "percona-server" ]] && mysql_version_is_at_least "5.6.12" ; then - DEPEND="${DEPEND} dev-libs/libedit" + DEPEND="${DEPEND} dev-libs/libedit:=[${MULTILIB_USEDEP}]" else - DEPEND="${DEPEND} >=sys-libs/readline-4.1" + DEPEND="${DEPEND} >=sys-libs/readline-4.1:=[${MULTILIB_USEDEP}]" fi if [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]] ; then - mysql_check_version_range "5.1.38 to 5.3.99" && DEPEND="${DEPEND} libevent? ( >=dev-libs/libevent-1.4 )" - mysql_version_is_at_least "5.2" && DEPEND="${DEPEND} oqgraph? ( >=dev-libs/boost-1.40.0 )" - mysql_version_is_at_least "5.2.5" && DEPEND="${DEPEND} sphinx? ( app-misc/sphinx )" - mysql_version_is_at_least "5.2.10" && DEPEND="${DEPEND} !minimal? ( pam? ( virtual/pam ) )" # Bug 441700 MariaDB >=5.3 include custom mytop - mysql_version_is_at_least "5.3" && DEPEND="${DEPEND} perl? ( !dev-db/mytop )" + DEPEND="${DEPEND} + oqgraph? ( >=dev-libs/boost-1.40.0:= ) + sphinx? ( app-misc/sphinx:= ) + !minimal? ( pam? ( virtual/pam:= ) ) + perl? ( !dev-db/mytop )" if mysql_version_is_at_least "10.0.5" ; then DEPEND="${DEPEND} - odbc? ( dev-db/unixODBC ) - xml? ( dev-libs/libxml2 ) + odbc? ( dev-db/unixODBC:= ) + xml? ( dev-libs/libxml2:= ) " fi - mysql_version_is_at_least "10.0.7" && DEPEND="${DEPEND} oqgraph? ( dev-libs/judy )" + mysql_version_is_at_least "10.0.7" && DEPEND="${DEPEND} oqgraph? ( dev-libs/judy:= )" fi # Having different flavours at the same time is not a good idea @@ -281,21 +243,11 @@ for i in "mysql" "mariadb" "mariadb-galera" "percona-server" "mysql-cluster" ; d DEPEND="${DEPEND} !dev-db/${i}" done -if mysql_version_is_at_least "5.5" ; then - DEPEND="${DEPEND} jemalloc? ( dev-libs/jemalloc )" - DEPEND="${DEPEND} tcmalloc? ( dev-util/google-perftools )" -fi - -if mysql_version_is_at_least "5.5.7" ; then - DEPEND="${DEPEND} systemtap? ( >=dev-util/systemtap-1.3 )" - DEPEND="${DEPEND} kernel_linux? ( dev-libs/libaio )" -fi - if [[ ${PN} == "mysql-cluster" ]] ; then # TODO: This really should include net-misc/memcached # but the package does not install the files it seeks. mysql_version_is_at_least "7.2.3" && \ - DEPEND="${DEPEND} dev-libs/libevent" + DEPEND="${DEPEND} dev-libs/libevent:=" fi # prefix: first need to implement something for #196294 @@ -306,13 +258,11 @@ RDEPEND="${DEPEND} if [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]] ; then # Bug 455016 Add dependencies of mytop - if mysql_version_is_at_least "5.3" ; then - RDEPEND="${RDEPEND} perl? ( - virtual/perl-Getopt-Long - dev-perl/TermReadKey - virtual/perl-Term-ANSIColor - virtual/perl-Time-HiRes ) " - fi + RDEPEND="${RDEPEND} perl? ( + virtual/perl-Getopt-Long + dev-perl/TermReadKey + virtual/perl-Term-ANSIColor + virtual/perl-Time-HiRes ) " fi if [[ ${PN} == "mariadb-galera" ]] ; then @@ -336,12 +286,7 @@ DEPEND="${DEPEND} DEPEND="${DEPEND} static? ( sys-libs/ncurses[static-libs] )" # compile-time-only -DEPEND="${DEPEND} >=dev-util/cmake-2.4.3" - -# compile-time-only -if mysql_version_is_at_least "5.5.8" ; then - DEPEND="${DEPEND} >=dev-util/cmake-2.6.3" -fi +DEPEND="${DEPEND} >=dev-util/cmake-2.8.9" # dev-perl/DBD-mysql is needed by some scripts installed by MySQL PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )" @@ -350,98 +295,27 @@ PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )" PDEPEND="${PDEPEND} =virtual/mysql-${MYSQL_PV_MAJOR}" # -# External patches -# - -# MariaDB has integrated PBXT until it was dropped in version 5.5.33 -# PBXT_VERSION means that we have a PBXT patch for this PV -# PBXT was only introduced after 5.1.12 -pbxt_patch_available() { - [[ ${PN} != "mariadb" && ${PN} != "mariadb-galera" && ( -n "${PBXT_VERSION}" ) ]] - return $? -} - -pbxt_available() { - pbxt_patch_available || [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]] && mysql_check_version_range "5.1 to 5.5.32" - return $? -} - -# Get the percona tarball if XTRADB_VER and PERCONA_VER are both set -# MariaDB has integrated XtraDB -# XTRADB_VERS means that we have a XTRADB patch for this PV -# XTRADB was only introduced after 5.1.26 -xtradb_patch_available() { - [[ ${PN} != "mariadb" && ${PN} != "mariadb-galera" - && ( -n "${XTRADB_VER}" ) && ( -n "${PERCONA_VER}" ) ]] - return $? -} - -if pbxt_patch_available; then - - PBXT_P="pbxt-${PBXT_VERSION}" - PBXT_SRC_URI="http://www.primebase.org/download/${PBXT_P}.tar.gz mirror://sourceforge/pbxt/${PBXT_P}.tar.gz" - SRC_URI="${SRC_URI} pbxt? ( ${PBXT_SRC_URI} )" -fi - -# PBXT_NEWSTYLE means pbxt is in storage/ and gets enabled as other plugins -# vs. built outside the dir -if pbxt_available; then - - IUSE="${IUSE} pbxt" - PBXT_NEWSTYLE=1 - REQUIRED_USE="${REQUIRED_USE} pbxt? ( !embedded ) " -fi - -if xtradb_patch_available; then - XTRADB_P="percona-xtradb-${XTRADB_VER}" - XTRADB_SRC_URI_COMMON="${PERCONA_VER}/source/${XTRADB_P}.tar.gz" - XTRADB_SRC_B1="http://www.percona.com/" - XTRADB_SRC_B2="${XTRADB_SRC_B1}/percona-builds/" - XTRADB_SRC_URI1="${XTRADB_SRC_B2}/Percona-Server/Percona-Server-${XTRADB_SRC_URI_COMMON}" - XTRADB_SRC_URI2="${XTRADB_SRC_B2}/xtradb/${XTRADB_SRC_URI_COMMON}" - XTRADB_SRC_URI3="${XTRADB_SRC_B1}/${PN}/xtradb/${XTRADB_SRC_URI_COMMON}" - SRC_URI="${SRC_URI} xtradb? ( ${XTRADB_SRC_URI1} ${XTRADB_SRC_URI2} ${XTRADB_SRC_URI3} )" - IUSE="${IUSE} xtradb" - REQUIRED_USE="${REQUIRED_USE} xtradb? ( !embedded ) " -fi - -# # HELPER FUNCTIONS: # -# @FUNCTION: mysql-v2_disable_test +# @FUNCTION: mysql-v3_disable_test # @DESCRIPTION: # Helper function to disable specific tests. -mysql-v2_disable_test() { - ${BUILD_INHERIT}_disable_test "$@" -} - -# @FUNCTION: mysql-v2_configure_minimal -# @DESCRIPTION: -# Helper function to configure minimal build -configure_minimal() { - ${BUILD_INHERIT}_configure_minimal "$@" -} - -# @FUNCTION: mysql-v2_configure_common -# @DESCRIPTION: -# Helper function to configure common builds -configure_common() { - ${BUILD_INHERIT}_configure_common "$@" +mysql-v3_disable_test() { + mysql-cmake_disable_test "$@" } # # EBUILD FUNCTIONS # -# @FUNCTION: mysql-v2_pkg_setup +# @FUNCTION: mysql-v3_pkg_setup # @DESCRIPTION: # Perform some basic tests and tasks during pkg_setup phase: # die if FEATURES="test", USE="-minimal" and not using FEATURES="userpriv" -# check for conflicting use flags # create new user and group for mysql # warn about deprecated features -mysql-v2_pkg_setup() { +mysql-v3_pkg_setup() { if has test ${FEATURES} ; then if ! use minimal ; then @@ -451,12 +325,6 @@ mysql-v2_pkg_setup() { fi fi - # Check for USE flag problems in pkg_setup - if ! mysql_version_is_at_least "5.2" && use debug ; then - # Also in package.use.mask - die "Bug #344885: Upstream has broken USE=debug for 5.1 series >=5.1.51" - fi - # This should come after all of the die statements enewgroup mysql 60 || die "problem adding 'mysql' group" enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user" @@ -479,10 +347,10 @@ mysql-v2_pkg_setup() { } -# @FUNCTION: mysql-v2_src_unpack +# @FUNCTION: mysql-v3_src_unpack # @DESCRIPTION: # Unpack the source code -mysql-v2_src_unpack() { +mysql-v3_src_unpack() { # Initialize the proper variables first mysql_init_vars @@ -494,49 +362,176 @@ mysql-v2_src_unpack() { mv -f "${WORKDIR}/${MY_SOURCEDIR}" "${S}" } -# @FUNCTION: mysql-v2_src_prepare +# @FUNCTION: mysql-v3_src_prepare # @DESCRIPTION: # Apply patches to the source code and remove unneeded bundled libs. -mysql-v2_src_prepare() { - ${BUILD_INHERIT}_src_prepare "$@" +mysql-v3_src_prepare() { + mysql-cmake_src_prepare "$@" if [[ ${PN} == "mysql-cluster" ]] ; then mysql_version_is_at_least "7.2.9" && java-pkg-opt-2_src_prepare fi } -# @FUNCTION: mysql-v2_src_configure +_mysql-multilib_src_configure() { + + debug-print-function ${FUNCNAME} "$@" + + CMAKE_BUILD_TYPE="RelWithDebInfo" + + mycmakeargs=( + -DCMAKE_INSTALL_PREFIX=${EPREFIX}/usr + -DMYSQL_DATADIR=${EPREFIX}/var/lib/mysql + -DSYSCONFDIR=${EPREFIX}/etc/mysql + -DINSTALL_BINDIR=bin + -DINSTALL_DOCDIR=share/doc/${P} + -DINSTALL_DOCREADMEDIR=share/doc/${P} + -DINSTALL_INCLUDEDIR=include/mysql + -DINSTALL_INFODIR=share/info + -DINSTALL_LIBDIR=$(get_libdir) + -DINSTALL_ELIBDIR=$(get_libdir)/mysql + -DINSTALL_MANDIR=share/man + -DINSTALL_MYSQLDATADIR=${EPREFIX}/var/lib/mysql + -DINSTALL_MYSQLSHAREDIR=share/mysql + -DINSTALL_MYSQLTESTDIR=share/mysql/mysql-test + -DINSTALL_PLUGINDIR=$(get_libdir)/mysql/plugin + -DINSTALL_SBINDIR=sbin + -DINSTALL_SCRIPTDIR=share/mysql/scripts + -DINSTALL_SQLBENCHDIR=share/mysql + -DINSTALL_SUPPORTFILESDIR=${EPREFIX}/usr/share/mysql + -DWITH_COMMENT="Gentoo Linux ${PF}" + $(cmake-utils_use_with test UNIT_TESTS) + -DWITH_READLINE=0 + -DWITH_LIBEDIT=0 + -DWITH_ZLIB=system + -DWITHOUT_LIBWRAP=1 + -DENABLED_LOCAL_INFILE=1 + ) + + if [[ ${PN} == "mysql" || ${PN} == "percona-server" ]] && mysql_version_is_at_least "5.6.12" ; then + mycmakeargs+=( -DWITH_EDITLINE=system ) + fi + + if use ssl; then + mycmakeargs+=( -DWITH_SSL=system ) + else + mycmakeargs+=( -DWITH_SSL=bundled ) + fi + + # Bug 412851 + # MariaDB requires this flag to compile with GPLv3 readline linked + # Adds a warning about redistribution to configure + if [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]] ; then + mycmakeargs+=( -DNOT_FOR_DISTRIBUTION=1 ) + fi + + if [[ ${PN} == "mariadb" || ${PN} == "mariadb-galera" ]]; then + if use jemalloc ; then + mycmakeargs+=( -DWITH_JEMALLOC="system" ) + else + mycmakeargs+=( -DWITH_JEMALLOC=no ) + fi + fi + + configure_cmake_locale + + if multilib_build_binaries ; then + if use minimal ; then + configure_cmake_minimal + else + configure_cmake_standard + fi + else + configure_cmake_minimal + fi + + # Bug #114895, bug #110149 + filter-flags "-O" "-O[01]" + + CXXFLAGS="${CXXFLAGS} -fno-strict-aliasing" + CXXFLAGS="${CXXFLAGS} -felide-constructors -fno-rtti" + # Causes linkage failures. Upstream bug #59607 removes it + if ! mysql_version_is_at_least "5.6" ; then + CXXFLAGS="${CXXFLAGS} -fno-implicit-templates" + fi + # As of 5.7, exceptions are used! + if ! mysql_version_is_at_least "5.7" ; then + CXXFLAGS="${CXXFLAGS} -fno-exceptions" + fi + export CXXFLAGS + + # bug #283926, with GCC4.4, this is required to get correct behavior. + append-flags -fno-strict-aliasing + + cmake-utils_src_configure +} + +_mysql-multilib_src_compile() { + + if ! multilib_build_binaries ; then + BUILD_DIR="${BUILD_DIR}/libmysql" cmake-utils_src_compile + else + cmake-utils_src_compile + fi +} + +_mysql-multilib_src_install() { + debug-print-function ${FUNCNAME} "$@" + + if multilib_build_binaries; then + mysql-cmake_src_install + else + # BUILD_DIR="${BUILD_DIR}/libmysql" cmake-utils_src_install + cmake-utils_src_install + fi +} + +# @FUNCTION: mysql-v3_src_configure # @DESCRIPTION: # Configure mysql to build the code for Gentoo respecting the use flags. -mysql-v2_src_configure() { - ${BUILD_INHERIT}_src_configure "$@" +mysql-v3_src_configure() { + debug-print-function ${FUNCNAME} "$@" + + multilib_parallel_foreach_abi _mysql-multilib_src_configure "${@}" } -# @FUNCTION: mysql-v2_src_compile +# @FUNCTION: mysql-v3_src_compile # @DESCRIPTION: # Compile the mysql code. -mysql-v2_src_compile() { - ${BUILD_INHERIT}_src_compile "$@" +mysql-v3_src_compile() { + debug-print-function ${FUNCNAME} "$@" + +# multilib_foreach_abi _mysql-multilib_src_compile "${@}" + multilib_foreach_abi cmake-utils_src_compile "${@}" } -# @FUNCTION: mysql-v2_src_install +# @FUNCTION: mysql-v3_src_install # @DESCRIPTION: # Install mysql. -mysql-v2_src_install() { - ${BUILD_INHERIT}_src_install "$@" +mysql-v3_src_install() { + debug-print-function ${FUNCNAME} "$@" + + # Do multilib magic only when >1 ABI is used. + if [[ ${#MULTIBUILD_VARIANTS[@]} -gt 1 ]]; then + multilib_prepare_wrappers + # Make sure all headers are the same for each ABI. + multilib_check_headers + fi + multilib_foreach_abi _mysql-multilib_src_install "${@}" + multilib_install_wrappers } -# @FUNCTION: mysql-v2_pkg_preinst +# @FUNCTION: mysql-v3_pkg_preinst # @DESCRIPTION: # Create the user and groups for mysql - die if that fails. -mysql-v2_pkg_preinst() { +mysql-v3_pkg_preinst() { + debug-print-function ${FUNCNAME} "$@" + if [[ ${PN} == "mysql-cluster" ]] ; then mysql_version_is_at_least "7.2.9" && java-pkg-opt-2_pkg_preinst fi - enewgroup mysql 60 || die "problem adding 'mysql' group" - enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user" } -# @FUNCTION: mysql-v2_pkg_postinst +# @FUNCTION: mysql-v3_pkg_postinst # @DESCRIPTION: # Run post-installation tasks: # create the dir for logfiles if non-existant @@ -544,7 +539,8 @@ mysql-v2_pkg_preinst() { # install scripts # issue required steps for optional features # issue deprecation warnings -mysql-v2_pkg_postinst() { +mysql-v3_pkg_postinst() { + debug-print-function ${FUNCNAME} "$@" # Make sure the vars are correctly initialized mysql_init_vars @@ -621,30 +617,32 @@ mysql-v2_pkg_postinst() { fi } -# @FUNCTION: mysql-v2_getopt +# @FUNCTION: mysql-v3_getopt # @DESCRIPTION: # Use my_print_defaults to extract specific config options -mysql-v2_getopt() { +mysql-v3_getopt() { local mypd="${EROOT}"/usr/bin/my_print_defaults section="$1" flag="--${2}=" "${mypd}" $section | sed -n "/^${flag}/p" } -# @FUNCTION: mysql-v2_getoptval +# @FUNCTION: mysql-v3_getoptval # @DESCRIPTION: # Use my_print_defaults to extract specific config options -mysql-v2_getoptval() { +mysql-v3_getoptval() { local mypd="${EROOT}"/usr/bin/my_print_defaults section="$1" flag="--${2}=" "${mypd}" $section | sed -n "/^${flag}/s,${flag},,gp" } -# @FUNCTION: mysql-v2_pkg_config +# @FUNCTION: mysql-v3_pkg_config # @DESCRIPTION: # Configure mysql environment. -mysql-v2_pkg_config() { +mysql-v3_pkg_config() { + + debug-print-function ${FUNCNAME} "$@" local old_MY_DATADIR="${MY_DATADIR}" local old_HOME="${HOME}" @@ -691,13 +689,13 @@ mysql-v2_pkg_config() { local maxtry=15 if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then - MYSQL_ROOT_PASSWORD="$(mysql-v2_getoptval 'client mysql' password)" + MYSQL_ROOT_PASSWORD="$(mysql-v3_getoptval 'client mysql' password)" fi - MYSQL_TMPDIR="$(mysql-v2_getoptval mysqld tmpdir)" + MYSQL_TMPDIR="$(mysql-v3_getoptval mysqld tmpdir)" # These are dir+prefix - MYSQL_RELAY_LOG="$(mysql-v2_getoptval mysqld relay-log)" + MYSQL_RELAY_LOG="$(mysql-v3_getoptval mysqld relay-log)" MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*} - MYSQL_LOG_BIN="$(mysql-v2_getoptval mysqld log-bin)" + MYSQL_LOG_BIN="$(mysql-v3_getoptval mysqld log-bin)" MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*} if [[ ! -d "${EROOT}"/$MYSQL_TMPDIR ]]; then @@ -863,11 +861,3 @@ mysql-v2_pkg_config() { wait %1 einfo "Done" } - -# @FUNCTION: mysql-v2_pkg_postrm -# @DESCRIPTION: -# Remove mysql symlinks. -mysql-v2_pkg_postrm() { - - : # mysql_lib_symlinks "${ED}" -} diff --git a/eclass/mysql-v2.eclass b/eclass/mysql-v2.eclass index 0b44d19..eee9242 100644 --- a/eclass/mysql-v2.eclass +++ b/eclass/mysql-v2.eclass @@ -27,9 +27,6 @@ case ${BUILD} in "cmake") BUILD_INHERIT="mysql-cmake" ;; - "cmake-multilib") - BUILD_INHERIT="mysql-cmake-multilib" - ;; "autotools") BUILD_INHERIT="mysql-autotools" @@ -200,7 +197,7 @@ case "${BUILD}" in "autotools") IUSE="big-tables debug embedded minimal +perl selinux ssl static test" ;; - cmake*) + "cmake") IUSE="debug embedded minimal +perl selinux ssl static static-libs test" ;; esac