dev-db/myodbc: Version bump for 8.0.16
authorBrian Evans <grknight@gentoo.org>
Tue, 11 Jun 2019 19:01:57 +0000 (15:01 -0400)
committerBrian Evans <grknight@gentoo.org>
Tue, 11 Jun 2019 19:01:57 +0000 (15:01 -0400)
Package-Manager: Portage-2.3.67, Repoman-2.3.14
Signed-off-by: Brian Evans <grknight@gentoo.org>
dev-db/myodbc/Manifest
dev-db/myodbc/files/8.0-cmake-doc-path.patch [new file with mode: 0644]
dev-db/myodbc/files/8.0.16-cxxlinkage.patch [new file with mode: 0644]
dev-db/myodbc/myodbc-8.0.16.ebuild [new file with mode: 0644]

index a3791a4441a1a59ec0a892a0460d51b94be690d0..da72be6d266cc3c5e7df8d445512d08252897d30 100644 (file)
@@ -1,3 +1,4 @@
 DIST mysql-connector-odbc-5.3.10-src.tar.gz 2646571 BLAKE2B e85e179ee8a54c8c98dd254e949c08227adc72141d52bc15935eafd60edaf95f47c12ca51fa9472ae29c761d5de2149277c58e6d3f02a566668be17f595ca7ba SHA512 ebe56b95a1690332959a7a37e8ed381b46730fb9f6fbd6522ddc1a6961e4c8cdac59681a957b33abeb6cae12f210278e4063daa59ce952d92acf427bc188e22b
 DIST mysql-connector-odbc-5.3.9-linux-debian9-x86-32bit.tar.gz 11501665 BLAKE2B e41dd65d940c0c91c67e6ec4c46ea2c3327e96d372c493635d05833862f2aa73919410a9e9a9c090a6fa65fd29e022a9b088c07a5e11089aee04b3b86005ad1e SHA512 02fcf6ac88f6052206aa55b6fc2b37f499da26e596e8e64b1c20e87dc4a24f745416da56c6e1268feff60321f54cb45864b8d34e055ea2f99da37b6efeedc844
 DIST mysql-connector-odbc-5.3.9-linux-debian9-x86-64bit.tar.gz 12013057 BLAKE2B e372cfb6ca49f9f01e9e60d7cd497fc009ec38dee76ca2cfb74cc95213b84ef1eebca85e1400f19c9715c0f9b2ef40fc212196e14189f5506be8d0e887507ce4 SHA512 b54ca167f762b4d8b988b4a91f14dc6a4bf49f55bc639ce8eecc9eba6c11400bd3494d74ef77ebe3348bdefd8fb5b8c1b62b3a6beebb926a1899da17ea4a1b44
+DIST mysql-connector-odbc-8.0.16-src.tar.gz 3986610 BLAKE2B c91760f8e0352a57adb5400700d22f52f70d5210d85ff0932f5288f19c917c771ce9ea9abad097d27a9723c585d1029d56c09f6865f634f9c41ad852690e016d SHA512 b7ddcdf635441bc3ed0325a8562f453e42d3c9768b0fe0b42d9b5417e268f4631e3fca3c2adc417c124ede37254c7b1890c792593d846ecaf5b158ce4b4808cd
diff --git a/dev-db/myodbc/files/8.0-cmake-doc-path.patch b/dev-db/myodbc/files/8.0-cmake-doc-path.patch
new file mode 100644 (file)
index 0000000..405c39e
--- /dev/null
@@ -0,0 +1,42 @@
+diff -aurN a/CMakeLists.txt b/CMakeLists.txt
+--- a/CMakeLists.txt   2019-06-11 11:21:59.723705824 -0400
++++ b/CMakeLists.txt   2019-06-11 11:26:11.109625713 -0400
+@@ -71,6 +71,12 @@
+ INCLUDE(version.cmake)
++IF(WITH_DOCUMENTATION_INSTALL_PATH)
++       set(DOCUMENTATION_INSTALL_PATH ${WITH_DOCUMENTATION_INSTALL_PATH})
++ELSE(WITH_DOCUMENTATION_INSTALL_PATH)
++       set(DOCUMENTATION_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/share/doc/myodbc-${CONNECTOR_MAJOR}.${CONNECTOR_MINOR})
++ENDIF(WITH_DOCUMENTATION_INSTALL_PATH)
++
+ IF(NOT WIN32)
+       INCLUDE(CheckFunctionExists)
+       CHECK_FUNCTION_EXISTS(dlopen DLOPEN_IN_LIBC)
+@@ -520,13 +526,10 @@
+ #------------ Installation ---------------------------
+-INCLUDE(cmake/info_bin.cmake)
+-INSTALL(FILES LICENSE.txt   DESTINATION .)
+-
+ if(EXISTS "${CMAKE_SOURCE_DIR}/README.txt")
+-  INSTALL(FILES README.txt    DESTINATION .)
++  INSTALL(FILES README.txt    DESTINATION ${DOCUMENTATION_INSTALL_PATH})
+ else()
+-  INSTALL(FILES README.md    DESTINATION .)
+-  INSTALL(FILES CONTRIBUTING.md    DESTINATION .)
++  INSTALL(FILES README.md    DESTINATION ${DOCUMENTATION_INSTALL_PATH})
++  INSTALL(FILES CONTRIBUTING.md    DESTINATION ${DOCUMENTATION_INSTALL_PATH})
+ endif()
+ IF(WIN32)
+@@ -567,7 +571,7 @@
+ ELSE(WIN32)
+-  INSTALL(FILES ChangeLog    DESTINATION .)
++  INSTALL(FILES ChangeLog    DESTINATION ${DOCUMENTATION_INSTALL_PATH})
+ ENDIF(WIN32)
diff --git a/dev-db/myodbc/files/8.0.16-cxxlinkage.patch b/dev-db/myodbc/files/8.0.16-cxxlinkage.patch
new file mode 100644 (file)
index 0000000..326036c
--- /dev/null
@@ -0,0 +1,63 @@
+diff -aurN a/cmake/FindMySQL.cmake b/cmake/FindMySQL.cmake
+--- a/cmake/FindMySQL.cmake    2016-11-29 07:40:13.000000000 -0500
++++ b/cmake/FindMySQL.cmake    2017-02-17 13:59:18.115389096 -0500
+@@ -747,7 +747,7 @@
+     endif()
+     if(NOT MYSQL_CXXFLAGS)
+-      if(MYSQL_CXX_LINKAGE OR MYSQL_VERSION_ID GREATER 50603)
++      if(MYSQL_CXX_LINKAGE)
+         _mysql_conf(MYSQL_CXXFLAGS "--cxxflags")
+         set(MYSQL_CXX_LINKAGE 1)
+       else()
+diff -aurN a/CMakeLists.txt b/CMakeLists.txt
+--- a/CMakeLists.txt   2018-02-10 21:41:13.161553751 -0500
++++ b/CMakeLists.txt   2018-02-10 21:45:20.038398824 -0500
+@@ -379,10 +379,9 @@
+ SET(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin")
+ SET(LIBRARY_OUTPUT_PATH "${CMAKE_BINARY_DIR}/lib")
+-SET(LIB_SUBDIR "lib")
+-IF(RPM_BUILD AND CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64|ppc64|ppc64p7|s390x|sparc64|aarch64)")
+-  SET(LIB_SUBDIR "lib64")
+-ENDIF()
++IF(NOT LIB_SUBDIR)
++      MESSAGE(ERROR "LIB_SUBDIR is not set")
++ENDIF(NOT LIB_SUBDIR)
+ MESSAGE(STATUS "Installation library subdir: ${LIB_SUBDIR}")
+diff -aurN a/driver/CMakeLists.txt b/driver/CMakeLists.txt
+--- a/driver/CMakeLists.txt    2019-06-11 13:46:37.863345781 -0400
++++ b/driver/CMakeLists.txt    2019-06-11 14:04:25.758997218 -0400
+@@ -194,29 +194,3 @@
+ ENDWHILE(${DRIVER_INDEX} LESS ${DRIVERS_COUNT})
+-IF(MYSQL8)
+-  SET(ssl_libs_to_find
+-    libcrypto.*
+-    libssl.*
+-    libeay32.*
+-    ssleay32.*
+-  )
+-
+-  SET(_SSL_PATH)
+-
+-  IF(WIN32)
+-    SET(_SSL_PATH ${MYSQL_DIR}/bin/)
+-  ELSE(WIN32)
+-    SET(_SSL_PATH ${MYSQL_DIR}/lib/)
+-  ENDIF(WIN32)
+-
+-  FOREACH(_lib_to_find IN LISTS ssl_libs_to_find)
+-    INSTALL(DIRECTORY ${_SSL_PATH} DESTINATION ${LIB_SUBDIR}
+-          FILES_MATCHING
+-          PATTERN "mecab" EXCLUDE
+-          PATTERN "pkgconfig" EXCLUDE
+-          PATTERN "plugin" EXCLUDE
+-          PATTERN ${_lib_to_find})
+-  ENDFOREACH()
+-
+-ENDIF(MYSQL8)
+\ No newline at end of file
diff --git a/dev-db/myodbc/myodbc-8.0.16.ebuild b/dev-db/myodbc/myodbc-8.0.16.ebuild
new file mode 100644 (file)
index 0000000..a5db40b
--- /dev/null
@@ -0,0 +1,119 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit cmake-multilib
+
+MAJOR="$(ver_cut 1-2)"
+MY_PN="mysql-connector-odbc"
+MY_P="${MY_PN}-${PV/_p/r}-src"
+
+DESCRIPTION="ODBC driver for MySQL"
+HOMEPAGE="http://www.mysql.com/products/myodbc/"
+SRC_URI="https://dev.mysql.com/get/Downloads/Connector-ODBC/${MAJOR}/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="${MAJOR}"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+# Broken when built dynamically against libmysqlclient.so
+RDEPEND="
+       dev-db/unixODBC[${MULTILIB_USEDEP}]
+       >=dev-db/mysql-connector-c-8.0:0=[static-libs,${MULTILIB_USEDEP}]
+"
+DEPEND="${RDEPEND}"
+S=${WORKDIR}/${MY_P}
+
+# Careful!
+DRIVER_NAME="${PN}-${SLOT}"
+
+# Patch document path so it doesn't install files to /usr
+PATCHES=(
+       "${FILESDIR}/${MAJOR}-cmake-doc-path.patch"
+       "${FILESDIR}/8.0.16-cxxlinkage.patch"
+)
+
+src_prepare() {
+       # Remove Tests
+       sed -i -e "s/ADD_SUBDIRECTORY(test)//" \
+               "${S}/CMakeLists.txt"
+
+       cmake-utils_src_prepare
+}
+
+multilib_src_configure() {
+       mycmakeargs+=(
+               -DMYSQLCLIENT_STATIC_LINKING=1
+               -DMYSQL_CXX_LINKAGE=1
+               -DWITH_UNIXODBC=1
+               -DWITH_DOCUMENTATION_INSTALL_PATH=/usr/share/doc/${PF}
+               -DLIB_SUBDIR="$(get_libdir)/${PN}-${MAJOR}"
+               -DMYSQLCLIENT_NO_THREADS=ON
+               -DDISABLE_GUI=ON
+               # The NUMA and LIBWRAP options are not really used.
+               # They are just copied from the server code
+               -DWITH_NUMA=OFF
+               -DWITH_LIBWRAP=OFF
+       )
+       cmake-utils_src_configure
+}
+
+multilib_src_install_all() {
+       debug-print-function ${FUNCNAME} "$@"
+
+       dodir /usr/share/${PN}-${SLOT}
+       for i in odbc.ini odbcinst.ini; do
+               einfo "Building $i"
+                       sed \
+                       -e "s,__PN__,${DRIVER_NAME},g" \
+                       -e "s,__PF__,${MAJOR},g" \
+                       -e "s,lib/libmyodbc3.so,$(get_libdir)/${PN}-${MAJOR}/libmyodbc${SLOT:0:1}a.so,g" \
+                       >"${D}"/usr/share/${PN}-${SLOT}/${i} \
+                       <"${FILESDIR}"/${i}.m4 \
+                       || die "Failed to build $i"
+       done;
+       mv "${D}/usr/bin/myodbc-installer" \
+               "${D}/usr/bin/myodbc-installer-${MAJOR}" || die "failed to move slotted binary"
+}
+
+pkg_config() {
+
+       [ "${ROOT}" != "/" ] && \
+               die 'Sorry, non-standard ROOT setting is not supported :-('
+
+       local msg='MySQL ODBC driver'
+       local drivers=$(/usr/bin/odbcinst -q -d)
+
+       if echo $drivers | grep -vq "^\[${DRIVER_NAME}\]$" ; then
+               ebegin "Installing ${msg}"
+               /usr/bin/odbcinst -i -d -f /usr/share/${PN}-${SLOT}/odbcinst.ini
+               rc=$?
+               eend $rc
+               [ $rc -ne 0 ] && die
+       else
+               einfo "Skipping already installed ${msg}"
+       fi
+
+       local sources=$(/usr/bin/odbcinst -q -s)
+       msg='sample MySQL ODBC DSN'
+       if echo $sources | grep -vq "^\[${DRIVER_NAME}-test\]$"; then
+               ebegin "Installing ${msg}"
+               /usr/bin/odbcinst -i -s -l -f /usr/share/${PN}-${SLOT}/odbc.ini
+               rc=$?
+               eend $rc
+               [ $rc -ne 0 ] && die
+       else
+               einfo "Skipping already installed ${msg}"
+       fi
+}
+
+pkg_postinst() {
+
+       elog "If this is a new install, please run the following command"
+       elog "to configure the MySQL ODBC drivers and sources:"
+       elog "emerge --config =${CATEGORY}/${PF}"
+       elog "Please note that the driver name used to form the DSN now includes the SLOT."
+       elog "The myodbc-install utility is installed as myodbc-install-${MAJOR}"
+}