# Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI="2" inherit base cmake-utils flag-o-matic DESCRIPTION="MySQL database connector for C++ (mimics JDBC 4.0 API)" HOMEPAGE="http://forge.mysql.com/wiki/Connector_C++" SRC_URI="http://ftp.debian.org/debian/pool/main/m/${PN}/${PN}_${PV/_pre/~r}.orig.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86" IUSE="debug examples gcov static-libs" DEPEND=">=virtual/mysql-5.1 dev-libs/boost dev-libs/openssl" RDEPEND="${DEPEND}" RESTRICT="debug? ( strip )" S="${WORKDIR}/${P/_pre/~r}" # cmake config helper function use_cmake() { local i_use="0" use ${1} && i_use="1" echo ${i_use} } # cmake config that works ... CMAKE_USE_DIR="." CMAKE_IN_SOURCE_BUILD="1" mycmakeargs="-DMYSQLCPPCONN_TRACE_ENABLE:BOOL=$(use_cmake debug) \ -DMYSQLCPPCONN_BUILD_EXAMPLES:BOOL=0 \ MYSQLCPPCONN_GCOV_ENABLE:BOOL=$(use_cmake gcov) \ -DMYSQLCPPCONN_ICU_ENABLE:BOOL=0" PATCHES="${FILESDIR}/02_no_README_LICENSE.mysql.diff ${FILESDIR}/05_disable_tests.diff ${FILESDIR}/07_attribute_visibility_default_for_exceptions.diff" src_configure() { # native lib/wrapper needs this! append-flags "-fno-strict-aliasing" # debug use debug && append-flags "-g" # configure cmake-utils_src_configure } src_compile() { # make cmake-utils_src_compile mysqlcppconn # make static use static-libs && cmake-utils_src_compile mysqlcppconn-static } src_install() { # install - ignore failure for now ... make DESTDIR="${D}" install/fast # fast install fails on useflag [-static-libs] # http://bugs.mysql.com/bug.php?id=52281 insinto /usr/include doins driver/mysql_{connection,driver}.h # examples if use examples; then insinto /usr/share/doc/${PF}/examples doins "${S}"/examples/* fi }