mysql-connector-c-6.1.9-r1.ebuild 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit cmake-multilib
  5. MULTILIB_WRAPPED_HEADERS+=(
  6. /usr/include/mysql/my_config.h
  7. )
  8. # wrap the config script
  9. MULTILIB_CHOST_TOOLS=( /usr/bin/mysql_config )
  10. DESCRIPTION="C client library for MariaDB/MySQL"
  11. HOMEPAGE="https://dev.mysql.com/downloads/connector/c/"
  12. LICENSE="GPL-2"
  13. SRC_URI="mirror://mysql/Downloads/Connector-C/${P}-src.tar.gz"
  14. S="${WORKDIR}/${P}-src"
  15. KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc64 ~x86"
  16. SUBSLOT="18"
  17. SLOT="0/${SUBSLOT}"
  18. IUSE="+ssl static-libs"
  19. CDEPEND="
  20. sys-libs/zlib:=[${MULTILIB_USEDEP}]
  21. ssl? ( dev-libs/openssl:0=[${MULTILIB_USEDEP}] )
  22. "
  23. RDEPEND="${CDEPEND}
  24. !dev-db/mysql[client-libs(+)]
  25. !dev-db/mysql-cluster[client-libs(+)]
  26. !dev-db/mariadb[client-libs(+)]
  27. !dev-db/mariadb-connector-c[mysqlcompat]
  28. !dev-db/mariadb-galera[client-libs(+)]
  29. !dev-db/percona-server[client-libs(+)]
  30. "
  31. DEPEND="${CDEPEND}"
  32. DOCS=( README Docs/ChangeLog )
  33. PATCHES=(
  34. "${FILESDIR}/mysql_com.patch" )
  35. src_prepare() {
  36. sed -i -e 's/CLIENT_LIBS/CONFIG_CLIENT_LIBS/' "${S}/scripts/CMakeLists.txt" || die
  37. default
  38. }
  39. multilib_src_configure() {
  40. mycmakeargs+=(
  41. -DINSTALL_LAYOUT=RPM
  42. -DINSTALL_LIBDIR=$(get_libdir)
  43. -DWITH_DEFAULT_COMPILER_OPTIONS=OFF
  44. -DWITH_DEFAULT_FEATURE_SET=OFF
  45. -DENABLED_LOCAL_INFILE=ON
  46. -DMYSQL_UNIX_ADDR="${EPREFIX}/var/run/mysqld/mysqld.sock"
  47. -DWITH_ZLIB=system
  48. -DENABLE_DTRACE=OFF
  49. -DWITH_SSL=$(usex ssl system bundled)
  50. -DLIBMYSQL_OS_OUTPUT_NAME=mysqlclient
  51. -DSHARED_LIB_PATCH_VERSION="0"
  52. )
  53. cmake-utils_src_configure
  54. }
  55. multilib_src_install_all() {
  56. if ! use static-libs ; then
  57. find "${ED}" -name "*.a" -delete || die
  58. fi
  59. }
  60. pkg_preinst() {
  61. if [[ -z ${REPLACING_VERSIONS} && -e "${EROOT}usr/$(get_libdir)/libmysqlclient.so" ]] ; then
  62. elog "Due to ABI changes when switching between different client libraries,"
  63. elog "revdep-rebuild must find and rebuild all packages linking to libmysqlclient."
  64. elog "Please run: revdep-rebuild --library libmysqlclient.so.${SUBSLOT}"
  65. ewarn "Failure to run revdep-rebuild may cause issues with other programs or libraries"
  66. fi
  67. }