From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 1F02E1582EF for ; Mon, 10 Mar 2025 00:23:19 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 0BAF4343160 for ; Mon, 10 Mar 2025 00:23:19 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 2692E11046F; Mon, 10 Mar 2025 00:23:02 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 2279211046F for ; Mon, 10 Mar 2025 00:23:02 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 9E837343148 for ; Mon, 10 Mar 2025 00:23:01 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 2A45928BE for ; Mon, 10 Mar 2025 00:22:59 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1741566096.b3e4cd1362c31f19f49de4397448682245179585.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-db/mysql-connector-c++/files/, dev-db/mysql-connector-c++/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-db/mysql-connector-c++/Manifest dev-db/mysql-connector-c++/files/mysql-connector-c++-9.2.0-gcc-15-cstdint.patch dev-db/mysql-connector-c++/files/mysql-connector-c++-9.2.0-hookup-tests.patch dev-db/mysql-connector-c++/files/mysql-connector-c++-9.2.0-test-iomanip.patch dev-db/mysql-connector-c++/mysql-connector-c++-9.2.0.ebuild X-VCS-Directories: dev-db/mysql-connector-c++/ dev-db/mysql-connector-c++/files/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: b3e4cd1362c31f19f49de4397448682245179585 X-VCS-Branch: master Date: Mon, 10 Mar 2025 00:22: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-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: a76b832b-0837-4e68-a883-b72337c847df X-Archives-Hash: 38bc961fb47560fa0731e8bba66d59c3 commit: b3e4cd1362c31f19f49de4397448682245179585 Author: Alfred Wingate protonmail com> AuthorDate: Sun Mar 9 00:59:29 2025 +0000 Commit: Sam James gentoo org> CommitDate: Mon Mar 10 00:21:36 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b3e4cd13 dev-db/mysql-connector-c++: add 9.2.0 * Add tests. Bug: https://bugs.gentoo.org/863188 Signed-off-by: Alfred Wingate protonmail.com> Signed-off-by: Sam James gentoo.org> dev-db/mysql-connector-c++/Manifest | 1 + .../mysql-connector-c++-9.2.0-gcc-15-cstdint.patch | 16 ++ .../mysql-connector-c++-9.2.0-hookup-tests.patch | 64 +++++++ .../mysql-connector-c++-9.2.0-test-iomanip.patch | 15 ++ .../mysql-connector-c++-9.2.0.ebuild | 184 +++++++++++++++++++++ 5 files changed, 280 insertions(+) diff --git a/dev-db/mysql-connector-c++/Manifest b/dev-db/mysql-connector-c++/Manifest index 1f03e10738cc..46b67b25689b 100644 --- a/dev-db/mysql-connector-c++/Manifest +++ b/dev-db/mysql-connector-c++/Manifest @@ -1 +1,2 @@ DIST mysql-connector-c++-8.0.33-src.tar.gz 4531693 BLAKE2B b8f426742fa343ebc1f1da5ba1fbf7dfc0db39493bafd0f5d16e355d43277d78ff27b183edad31792a7591ac59bbfb4033f3498dc646883988cba189535a8ddf SHA512 a625a28f63161c97d727d90e7b1211273fe931ae1325c2fbeca16e770761e3159abdcaba1fb6eb1a557674fd817bf266875a089c8c2ea4d2dd1553e6fa887ef1 +DIST mysql-connector-c++-9.2.0-src.tar.gz 4784018 BLAKE2B 74ddf9d4d7bf6b679d8cbacae1de848c0957cb5ab196dfc1ed42927bff9924b12f73f6e58ceeb07b586fd60a79bd0313c395e21393c303ddaa0f525d7d8c5375 SHA512 bbd829ba426772702c8109e8706e5e542bc2a102dae6cddc0ba4f9f6d26952b4652210930d9a983cfadd3a72cf95ba430a401eeb100d766de69ddc2ec6eefa71 diff --git a/dev-db/mysql-connector-c++/files/mysql-connector-c++-9.2.0-gcc-15-cstdint.patch b/dev-db/mysql-connector-c++/files/mysql-connector-c++-9.2.0-gcc-15-cstdint.patch new file mode 100644 index 000000000000..8e4bd1811f75 --- /dev/null +++ b/dev-db/mysql-connector-c++/files/mysql-connector-c++-9.2.0-gcc-15-cstdint.patch @@ -0,0 +1,16 @@ +https://bugs.gentoo.org/863188 + +diff --git a/include/mysqlx/common/value.h b/include/mysqlx/common/value.h +index 4f1b7a38..c30bbd0a 100644 +--- a/include/mysqlx/common/value.h ++++ b/include/mysqlx/common/value.h +@@ -39,7 +39,7 @@ + PUSH_SYS_WARNINGS + #include + POP_SYS_WARNINGS +- ++#include + + namespace mysqlx { + MYSQLX_ABI_BEGIN(2,0) + diff --git a/dev-db/mysql-connector-c++/files/mysql-connector-c++-9.2.0-hookup-tests.patch b/dev-db/mysql-connector-c++/files/mysql-connector-c++-9.2.0-hookup-tests.patch new file mode 100644 index 000000000000..ba3cb5aaf7c8 --- /dev/null +++ b/dev-db/mysql-connector-c++/files/mysql-connector-c++-9.2.0-hookup-tests.patch @@ -0,0 +1,64 @@ +From 8d344b6c4ebb1f0029aecaee9cb0b5522e7db27e Mon Sep 17 00:00:00 2001 +From: Alfred Wingate +Date: Sat, 8 Mar 2025 00:05:15 +0200 +Subject: [PATCH] Build correctly against shared library gtest + +Not upstreamable as is. +--- a/cdk/cmake/gtest.cmake ++++ b/cdk/cmake/gtest.cmake +@@ -132,19 +132,8 @@ MESSAGE("gtest location: ${gtest_location}") + MESSAGE("gtest_main location: ${gtest_main_location}") + + +-add_library(gtest STATIC IMPORTED) +-add_library(gtest_main STATIC IMPORTED) +- +-set_target_properties(gtest PROPERTIES +- IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" +- IMPORTED_LOCATION "${gtest_location}" +-) +- +-set_target_properties(gtest_main PROPERTIES +- IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" +- IMPORTED_LINK_INTERFACE_LIBRARIES "gtest" +- IMPORTED_LOCATION "${gtest_main_location}" +-) ++add_library(gtest ALIAS GTest::gtest) ++add_library(gtest_main ALIAS GTest::gtest_main) + + # + # Setup configuration-specific locations for Win +@@ -193,11 +182,5 @@ IF(WIN32) + + ENDFOREACH(Config) + +-ELSE(WIN32) +- +- # On unix gtest depends on pthread library +- set_property(TARGET gtest APPEND PROPERTY INTERFACE_LINK_LIBRARIES pthread) +- set_property(TARGET gtest APPEND PROPERTY IMPORTED_LINK_INTERFACE_LIBRARIES pthread) +- + ENDIF(WIN32) + +-- +2.48.1 + +From 1d0f1fbb800517583029b6bc88d285bcb1245111 Mon Sep 17 00:00:00 2001 +From: Alfred Wingate +Date: Sat, 8 Mar 2025 00:06:41 +0200 +Subject: [PATCH] Hook cdk unittests to ctest + +--- a/cdk/cmake/testing.cmake ++++ b/cdk/cmake/testing.cmake +@@ -370,6 +370,8 @@ IF(WITH_TESTS) + COMMENT "# Generating test group definitons." + ) + ++ gtest_discover_tests(${target_run_unit_tests}) ++ + ENDIF() + ENDMACRO(ADD_TEST_TARGET) + +-- +2.48.1 + diff --git a/dev-db/mysql-connector-c++/files/mysql-connector-c++-9.2.0-test-iomanip.patch b/dev-db/mysql-connector-c++/files/mysql-connector-c++-9.2.0-test-iomanip.patch new file mode 100644 index 000000000000..ae9b58f519ea --- /dev/null +++ b/dev-db/mysql-connector-c++/files/mysql-connector-c++-9.2.0-test-iomanip.patch @@ -0,0 +1,15 @@ +Implicit requirement due to use of std::setw + +diff --git a/devapi/tests/session-t.cc b/devapi/tests/session-t.cc +index 758a0b8f..138cdcac 100644 +--- a/devapi/tests/session-t.cc ++++ b/devapi/tests/session-t.cc +@@ -35,6 +35,7 @@ + #include + #include + #include ++#include + + using std::cout; + using std::endl; + diff --git a/dev-db/mysql-connector-c++/mysql-connector-c++-9.2.0.ebuild b/dev-db/mysql-connector-c++/mysql-connector-c++-9.2.0.ebuild new file mode 100644 index 000000000000..64517a13b8e8 --- /dev/null +++ b/dev-db/mysql-connector-c++/mysql-connector-c++-9.2.0.ebuild @@ -0,0 +1,184 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit cmake + +URI_DIR="Connector-C++" +DESCRIPTION="MySQL database connector for C++ (mimics JDBC 4.0 API)" +HOMEPAGE="https://dev.mysql.com/downloads/connector/cpp/" +SRC_URI=" + https://dev.mysql.com/get/Downloads/${URI_DIR}/${P}-src.tar.gz +" +S="${WORKDIR}/${P}-src" + +LICENSE="Artistic GPL-2" +# See ABI_VERSION(s) is version.cmake +SLOT="0/2.10" # ABI_VERSION_MAJOR/JDBC_ABI_VERSION_MAJOR +# -ppc, -sparc for bug #711940 +KEYWORDS="~amd64 ~arm ~arm64 -ppc ~ppc64 -sparc ~x86" +IUSE="+legacy test" + +RESTRICT="!test? ( test )" + +RDEPEND=" + app-arch/lz4:= + app-arch/zstd:= + dev-libs/openssl:= + sys-libs/zlib + legacy? ( + >=dev-db/mysql-connector-c-8.0.27:= + ) +" +DEPEND=" + ${RDEPEND} + test? ( + dev-cpp/gtest + ) +" +BDEPEND=" + test? ( + >=dev-db/mysql-8[server] + ) +" + +PATCHES=( + "${FILESDIR}"/${PN}-8.0.27-mysqlclient_r.patch + "${FILESDIR}"/${PN}-8.0.33-jdbc.patch + "${FILESDIR}"/${PN}-9.2.0-gcc-15-cstdint.patch + "${FILESDIR}"/${PN}-9.2.0-test-iomanip.patch + "${FILESDIR}"/${PN}-9.2.0-hookup-tests.patch +) + +src_prepare() { + cmake_src_prepare + + # ignores MAKEOPTS and runs recursive make -j$(nproc). Clobbers jobs badly + # enough that your system immediately freezes. + # + # https://bugs.gentoo.org/921309 + # https://bugs.mysql.com/bug.php?id=115734 + sed -i 's/prc_cnt AND NOT/FALSE AND NOT/' cdk/cmake/dependency.cmake || die +} + +src_configure() { + # sanity check subslot to kick would be drive by bumpers + local detected_abi + detected_abi="$(awk '$1 ~ "set.*ABI_VERSION_MAJOR" {printf("%s.",$2)}' version.cmake)" + detected_abi="${detected_abi%.}" + if [[ "${SLOT#0/}" != "${detected_abi}" ]]; then + die "Sub slot ${SLOT#0/} doesn't match upstream specified ABI ${detected_abi}." + fi + + local mycmakeargs=( + -DBUNDLE_DEPENDENCIES=OFF + # Cannot handle protobuf >23, bug #912797 + #-DWITH_PROTOBUF=system + -DWITH_LZ4=system + -DWITH_SSL=system + -DWITH_ZLIB=system + -DWITH_ZSTD=system + -DWITH_JDBC=$(usex legacy) + -DWITH_TESTS=$(usex test) + ) + + if use legacy ; then + mycmakeargs+=( + -DMYSQLCLIENT_STATIC_BINDING=0 + -DMYSQLCLIENT_STATIC_LINKING=0 + ) + fi + + cmake_src_configure +} + +# NOTE: Test failures in jdbc may be a sign of issues in mysql-connector-c. +src_test() { + local CMAKE_SKIP_TESTS=( + # Test that configures, builds and install a test project again. It gets caught on the install phase. + Link_test + # Only ipv4 will work as only the ipv4 local address is specified. A future task for someone... + # https://dev.mysql.com/doc/refman/8.4/en/x-plugin-options-system-variables.html#sysvar_mysqlx_bind_address + Sess.ipv6 + # FIXME: + # not ok 15 - preparedstatement::queryAttributes # assertEquals(int) failed in + # /var/tmp/portage/dev-db/mysql-connector-c++-9.2.0/work/mysql-connector-c++-9.2.0-src/jdbc/test/unit/classes/preparedstatement.cpp, + # line #1582 expecting '200' got '0' + jdbc_test_preparedstatement + ) + + local -x MYSQL_HOST="127.0.0.1" + local -x MYSQL_PORT="5555" + local -x MYSQL_USER="$(whoami)" + local -x MYSQL_PASSWORD="insecure" + local -x XPLUGIN_PORT="5556" + + einfo "Creating mysql test instance" + mkdir -p "${T}"/mysql || die + mysqld \ + --no-defaults \ + --initialize-insecure \ + --user root \ + --basedir="${EPREFIX}/usr" \ + --datadir="${T}"/mysql 1>"${T}"/mysqld_install.log || die + + einfo "Starting mysql test instance ..." + mysqld \ + --no-defaults \ + --character-set-server=utf8 \ + --bind-address=${MYSQL_HOST} \ + --port=${MYSQL_PORT} \ + --socket="${T}"/mysqld.sock \ + --mysqlx-bind-address=${MYSQL_HOST} \ + --mysqlx-port=${XPLUGIN_PORT} \ + --mysqlx-socket="${T}"/mysqlx.sock \ + --pid-file="${T}"/mysqld.pid \ + --datadir="${T}"/mysql 1>"${T}"/mysqld.log 2>&1 & + + # wait for it to start + local i + for (( i = 0; i < 10; i++ )); do + [[ -S ${T}/mysqld.sock ]] && break + sleep 1 + done + [[ ! -S ${T}/mysqld.sock ]] && die "mysqld failed to start" + + einfo "Configure mysql test instance ..." + # https://github.com/mysql/mysql-connector-cpp/blob/trunk/jdbc/test/CJUnitTestsPort/README + mysql -u root \ + -e "CREATE USER ${MYSQL_USER} IDENTIFIED BY '${MYSQL_PASSWORD}'; GRANT ALL PRIVILEGES ON *.* TO ${MYSQL_USER} WITH GRANT OPTION;" \ + -S "${T}/mysqld.sock" \ + -h ${MYSQL_HOST} \ + -P ${MYSQL_PORT} || die + mysql -u root \ + -S "${T}/mysqld.sock" \ + -h ${MYSQL_HOST} \ + -P ${MYSQL_PORT} < "${S}"/jdbc/test/CJUnitTestsPort/cts.sql || die + + # Do tests with one job for proper clean up in database tests. + nonfatal cmake_src_test -j1 + local ret=${?} + + einfo "Stopping mysql test instance ..." + pkill -F "${T}"/mysqld.pid || die + # wait for it to stop + local i + for (( i = 0; i < 10; i++ )); do + [[ -S ${T}/mysqld.sock ]] || break + sleep 1 + done + + rm -rf "${T}"/mysql || die + + [[ ${ret} -ne 0 ]] && die +} + +src_install() { + cmake_src_install + einstalldocs + + # cmake package config file appears to be broken in multiple ways + rm "${ED}/usr/mysql-concpp-config.cmake" || die + rm "${ED}/usr/mysql-concpp-config-version.cmake" || die +}