commit:     5db1900a1385533b74c8459715a03177d607003f
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Oct  8 06:24:03 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Oct  8 06:29:10 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5db1900a

dev-perl/DBD-mysql: add 5.1.0

Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-perl/DBD-mysql/DBD-mysql-5.1.0.ebuild          | 141 +++++++++++++++++++++
 dev-perl/DBD-mysql/Manifest                        |   1 +
 .../DBD-mysql/files/DBD-mysql-5.001-tests.patch    |  39 ++++++
 profiles/arch/loong/package.use                    |   7 +
 profiles/arch/loong/package.use.mask               |   3 +
 profiles/arch/powerpc/ppc32/package.use            |   6 +
 profiles/arch/powerpc/ppc32/package.use.mask       |   4 +
 7 files changed, 201 insertions(+)

diff --git a/dev-perl/DBD-mysql/DBD-mysql-5.1.0.ebuild 
b/dev-perl/DBD-mysql/DBD-mysql-5.1.0.ebuild
new file mode 100644
index 000000000000..6c330056ca36
--- /dev/null
+++ b/dev-perl/DBD-mysql/DBD-mysql-5.1.0.ebuild
@@ -0,0 +1,141 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DIST_AUTHOR=DVEEDEN
+# Parallel testing is broken as 2 tests create the same table
+# and mysql isn't acid compliant and can't limit visibility of tables
+# to a transaction...
+DIST_TEST="do"
+DIST_WIKI=tests
+DIST_VERSION=5.001
+inherit perl-module
+
+DESCRIPTION="MySQL driver for the Perl5 Database Interface (DBI)"
+
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 
~riscv ~s390 ~sparc ~x86 ~x64-macos"
+IUSE="mariadb +mysql test"
+RESTRICT="!test? ( test )"
+REQUIRED_USE="^^ ( mysql mariadb )"
+
+DB_DEPENDS="
+       mysql? ( >=dev-db/mysql-connector-c-8:= )
+       mariadb? ( >=dev-db/mariadb-connector-c-3.1:=[ssl(+)] )
+"
+RDEPEND="
+       >=dev-perl/DBI-1.609.0
+       >=dev-perl/Devel-CheckLib-1.109.0
+       ${DB_DEPENDS}
+"
+DEPEND="
+       ${DB_DEPENDS}
+"
+BDEPEND="
+       ${RDEPEND}
+       virtual/perl-ExtUtils-MakeMaker
+       virtual/perl-Data-Dumper
+       test? (
+               dev-perl/Test-Deep
+               >=virtual/perl-Test-Simple-0.900.0
+               virtual/perl-Time-HiRes
+               mariadb? ( dev-db/mariadb:* )
+               mysql? ( >=dev-db/mysql-8:* )
+       )
+"
+
+PATCHES=(
+       "${FILESDIR}/${PN}-4.050-no-dot-inc.patch"
+       "${FILESDIR}/${PN}-5.001-tests.patch"
+)
+
+PERL_RM_FILES=(
+       t/pod.t
+       t/manifest.t
+
+       #   Failed test 'USE is not supported with 
mysql_server_prepare_disable_fallback=1'
+       #   at t/40server_prepare.t line 93.
+       t/40server_prepare.t
+)
+
+src_configure() {
+       local impl=$(usex mariadb mariadb mysql)
+       local myconf=()
+
+       if use test; then
+               myconf+=(
+                       --testdb=test
+                       --testhost=localhost
+                       --testsocket="${T}"/mysqld.sock
+                       --testuser=root
+               )
+       fi
+
+       myconf+=( --mysql_config="${EPREFIX}"/usr/bin/${impl}_config )
+
+       perl-module_src_configure
+}
+
+src_test() {
+       local -x USER=$(whoami)
+
+       einfo "Creating mysql test instance ..."
+       mkdir -p "${T}"/mysql || die
+       if use mariadb ; then
+               local -x PATH="${BROOT}/usr/share/mariadb/scripts:${PATH}"
+
+               mysql_install_db \
+                       --no-defaults \
+                       --auth-root-authentication-method=normal \
+                       --basedir="${EPREFIX}/usr" \
+                       --datadir="${T}"/mysql 1>"${T}"/mysqld_install.log || 
die
+       else
+               mysqld \
+                       --no-defaults \
+                       --initialize-insecure \
+                       --user ${USER} \
+                       --basedir="${EPREFIX}/usr" \
+                       --datadir="${T}"/mysql 1>"${T}"/mysqld_install.log || 
die
+       fi
+
+       einfo "Starting mysql test instance ..."
+       mysqld \
+               --no-defaults \
+               --character-set-server=utf8 \
+               --bind-address=127.0.0.1 \
+               --pid-file="${T}"/mysqld.pid \
+               --socket="${T}"/mysqld.sock \
+               --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 "Configuring test mysql instance ..."
+       mysql -u root \
+               -e 'CREATE DATABASE /*M!50701 IF NOT EXISTS */ test' \
+               -S "${T}"/mysqld.sock || die "Failed to create test database"
+
+       # Don't be a hero and try to do EXTENDED_TESTING=1 unless you can figure
+       # out why 60leaks.t fails
+       nonfatal perl-module_src_test
+       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
+}

diff --git a/dev-perl/DBD-mysql/Manifest b/dev-perl/DBD-mysql/Manifest
index af5b640918d2..7c153d885cb9 100644
--- a/dev-perl/DBD-mysql/Manifest
+++ b/dev-perl/DBD-mysql/Manifest
@@ -1 +1,2 @@
 DIST DBD-mysql-4.050.tar.gz 161579 BLAKE2B 
fb17e151db730fd6955d3e4424dd495a9fcf5f3f4e2b6b79d9fdc86bc42c3314b68771f1d3c393fd80ea14aeda626a5c5d21f5b921d487350ffd79802edab1f6
 SHA512 
910f5b4ba7a7890d50a79f37d04ec8971a4f62acd0fe30bf3ab634f66e3128f0cd6513e5c9da8c807a0f4477d0cc766682ea8dd0d8072d02821b78df51f37879
+DIST DBD-mysql-5.001.tar.gz 151639 BLAKE2B 
02edf5454d46ca16886c5fc559466f63c57352354983095feda7568822eb0cf4d87e44aa63754d873c6889d070b2108dc40e32a253532b893987a779d71808c9
 SHA512 
1aea86bba76f371ed11eb22e9fe1f99dfaefafd83dea69ee0ac5ea175c1328ff324934ad45bfa73851463931656471ca890b3d7656e9db3861a8465d6130d5c0

diff --git a/dev-perl/DBD-mysql/files/DBD-mysql-5.001-tests.patch 
b/dev-perl/DBD-mysql/files/DBD-mysql-5.001-tests.patch
new file mode 100644
index 000000000000..71de32ef0af4
--- /dev/null
+++ b/dev-perl/DBD-mysql/files/DBD-mysql-5.001-tests.patch
@@ -0,0 +1,39 @@
+https://github.com/perl5-dbi/DBD-mysql/commit/18626cfefdc4568ed0de7129a1bfb5916c21f5e6
+
+From 18626cfefdc4568ed0de7129a1bfb5916c21f5e6 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= <g...@myname.nl>
+Date: Thu, 5 Oct 2023 09:45:44 +0200
+Subject: [PATCH] Update version test for v5.x
+
+---
+ t/10connect.t | 2 +-
+ t/version.t   | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/t/10connect.t b/t/10connect.t
+index 6f36c4db..bfca3448 100644
+--- a/t/10connect.t
++++ b/t/10connect.t
+@@ -45,7 +45,7 @@ like(
+   'get_info SQL_DRIVER_VER like dd.dd.dddd'
+ );
+ 
+-like($driver_ver, qr/^04\./, 'SQL_DRIVER_VER starts with "04." (update for 
5.x)');
++like($driver_ver, qr/^05\./, 'SQL_DRIVER_VER starts with "05." (update for 
6.x)');
+ 
+ # storage engine function is @@storage_engine in up to 5.5.03
+ # at that version, @@default_storage_engine is introduced
+diff --git a/t/version.t b/t/version.t
+index 47d1778f..87b0db04 100644
+--- a/t/version.t
++++ b/t/version.t
+@@ -6,7 +6,7 @@ use Bundle::DBD::mysql;
+ use Test::More;
+ 
+ like($DBD::mysql::VERSION, qr/^\d\.\d{2,3}(|_\d\d)$/, 'version format');
+-like($DBD::mysql::VERSION, qr/^4\./, 'version starts with "4." (update for 
5.x)');
++like($DBD::mysql::VERSION, qr/^5\./, 'version starts with "5." (update for 
6.x)');
+ is(
+   $DBD::mysql::VERSION,
+   $Bundle::DBD::mysql::VERSION,
+

diff --git a/profiles/arch/loong/package.use b/profiles/arch/loong/package.use
index 77df43ba64a2..31164c09ea68 100644
--- a/profiles/arch/loong/package.use
+++ b/profiles/arch/loong/package.use
@@ -1,2 +1,9 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# Sam James <s...@gentoo.org> (2023-10-08)
+# dev-db/mysql not keyworded here
+dev-perl/DBD-mysql -mysql mariadb
+
 # LoongArch systems boot with EFI
 sys-boot/grub:2 grub_platforms_efi-64

diff --git a/profiles/arch/loong/package.use.mask 
b/profiles/arch/loong/package.use.mask
index 552d187818f7..b9efb1211890 100644
--- a/profiles/arch/loong/package.use.mask
+++ b/profiles/arch/loong/package.use.mask
@@ -1,6 +1,9 @@
 # Copyright 2022-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
+# Sam James <s...@gentoo.org> (2023-10-08)
+# dev-db/mysql not keyworded here
+dev-perl/DBD-mysql mysql
 
 # Patrick Lauer <patr...@gentoo.org> (2023-10-05)
 # JIT / llvm support needs too old llvm

diff --git a/profiles/arch/powerpc/ppc32/package.use 
b/profiles/arch/powerpc/ppc32/package.use
new file mode 100644
index 000000000000..1a4a6c6d080f
--- /dev/null
+++ b/profiles/arch/powerpc/ppc32/package.use
@@ -0,0 +1,6 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# Sam James <s...@gentoo.org> (2023-10-08)
+# dev-db/mysql not keyworded here
+>=dev-perl/DBD-mysql-5 -mysql mariadb

diff --git a/profiles/arch/powerpc/ppc32/package.use.mask 
b/profiles/arch/powerpc/ppc32/package.use.mask
index 7a0a92b844cc..64901a22fcca 100644
--- a/profiles/arch/powerpc/ppc32/package.use.mask
+++ b/profiles/arch/powerpc/ppc32/package.use.mask
@@ -1,6 +1,10 @@
 # Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
+# Sam James <s...@gentoo.org> (2023-10-08)
+# dev-db/mysql not keyworded/stable here
+dev-perl/DBD-mysql mysql
+
 # Sam James <s...@gentoo.org> (2023-09-22)
 # Qt 6 not keyworded here.
 dev-util/cmake gui

Reply via email to