Skip to content

Commit

Permalink
dev-perl/DBD-mysql: add 5.1.0
Browse files Browse the repository at this point in the history
Signed-off-by: Sam James <[email protected]>
  • Loading branch information
thesamesam committed Oct 8, 2023
1 parent 7a9d4cb commit 5db1900
Show file tree
Hide file tree
Showing 7 changed files with 201 additions and 0 deletions.
141 changes: 141 additions & 0 deletions dev-perl/DBD-mysql/DBD-mysql-5.1.0.ebuild
Original file line number Diff line number Diff line change
@@ -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
}
1 change: 1 addition & 0 deletions dev-perl/DBD-mysql/Manifest
Original file line number Diff line number Diff line change
@@ -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
39 changes: 39 additions & 0 deletions dev-perl/DBD-mysql/files/DBD-mysql-5.001-tests.patch
Original file line number Diff line number Diff line change
@@ -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?= <[email protected]>
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,

7 changes: 7 additions & 0 deletions profiles/arch/loong/package.use
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

# Sam James <[email protected]> (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
3 changes: 3 additions & 0 deletions profiles/arch/loong/package.use.mask
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Copyright 2022-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

# Sam James <[email protected]> (2023-10-08)
# dev-db/mysql not keyworded here
dev-perl/DBD-mysql mysql

# Patrick Lauer <[email protected]> (2023-10-05)
# JIT / llvm support needs too old llvm
Expand Down
6 changes: 6 additions & 0 deletions profiles/arch/powerpc/ppc32/package.use
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

# Sam James <[email protected]> (2023-10-08)
# dev-db/mysql not keyworded here
>=dev-perl/DBD-mysql-5 -mysql mariadb
4 changes: 4 additions & 0 deletions profiles/arch/powerpc/ppc32/package.use.mask
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

# Sam James <[email protected]> (2023-10-08)
# dev-db/mysql not keyworded/stable here
dev-perl/DBD-mysql mysql

# Sam James <[email protected]> (2023-09-22)
# Qt 6 not keyworded here.
dev-util/cmake gui
Expand Down

0 comments on commit 5db1900

Please sign in to comment.