Gentoo Archives: gentoo-commits

From: Kent Fredric <kentnl@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-perl/DBD-mysql/
Date: Thu, 29 Aug 2019 09:41:17
Message-Id: 1567071635.a47a3415690d554c17ecc6a5f7a6ed35de92188d.kentnl@gentoo
1 commit: a47a3415690d554c17ecc6a5f7a6ed35de92188d
2 Author: Kent Fredric <kentnl <AT> gentoo <DOT> org>
3 AuthorDate: Thu Aug 29 06:07:27 2019 +0000
4 Commit: Kent Fredric <kentnl <AT> gentoo <DOT> org>
5 CommitDate: Thu Aug 29 09:40:35 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a47a3415
7
8 dev-perl/DBD-mysql: Add mysql/mariadb switching
9
10 This was tangentially supported back with the virtual/mysqlclient stuff
11 and this attempts to bring this logic back.
12
13 However, in testing, this release currently failed to compile with
14 USE="mariadb -mysql", as DBD-mysql supporting mariadb is merely "best
15 effort", not a primary design goal, so can often be a bit behind the
16 curve.
17
18 Future releases may however work fine.
19
20 Though its recommended if you work with MariaDB to:
21 a. use DBD-MariaDB instead
22 b. use "mysql -mariadb" to use the mysql-connector-c implementation
23 and then use that to connect to mariadb, which *may* work better.
24
25 As such, this flag is primarily to give user choice, but will be
26 use.stable.masked' until we can expect it to be reliable
27
28 Keywords dropped:
29 - alpha ( due to mariadb-connector-c )
30
31 Package-Manager: Portage-2.3.72, Repoman-2.3.16
32 Signed-off-by: Kent Fredric <kentnl <AT> gentoo.org>
33
34 dev-perl/DBD-mysql/DBD-mysql-4.44.0-r2.ebuild | 68 +++++++++++++++++++++++++++
35 dev-perl/DBD-mysql/metadata.xml | 2 +
36 2 files changed, 70 insertions(+)
37
38 diff --git a/dev-perl/DBD-mysql/DBD-mysql-4.44.0-r2.ebuild b/dev-perl/DBD-mysql/DBD-mysql-4.44.0-r2.ebuild
39 new file mode 100644
40 index 00000000000..293180230ee
41 --- /dev/null
42 +++ b/dev-perl/DBD-mysql/DBD-mysql-4.44.0-r2.ebuild
43 @@ -0,0 +1,68 @@
44 +# Copyright 1999-2019 Gentoo Authors
45 +# Distributed under the terms of the GNU General Public License v2
46 +
47 +EAPI=6
48 +
49 +DIST_AUTHOR=CAPTTOFU
50 +DIST_VERSION=4.044
51 +inherit eutils perl-module
52 +
53 +DESCRIPTION="MySQL driver for the Perl5 Database Interface (DBI)"
54 +
55 +SLOT="0"
56 +KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
57 +
58 +IUSE="mariadb +mysql test +ssl"
59 +REQUIRED_USE="^^ ( mysql mariadb )"
60 +
61 +RDEPEND=">=dev-perl/DBI-1.609.0
62 + mysql? ( dev-db/mysql-connector-c:= )
63 + mariadb? ( dev-db/mariadb-connector-c:=[ssl(+)?] )
64 +"
65 +DEPEND="${RDEPEND}
66 + virtual/perl-ExtUtils-MakeMaker
67 + virtual/perl-Data-Dumper
68 + test? (
69 + dev-perl/Test-Deep
70 + >=virtual/perl-Test-Simple-0.900.0
71 + virtual/perl-Time-HiRes
72 + )
73 +"
74 +PATCHES=(
75 + "${FILESDIR}/${PN}-${DIST_VERSION}-amvis-type-conversions.patch"
76 + "${FILESDIR}/${PN}-${DIST_VERSION}-no-dot-inc.patch"
77 + "${FILESDIR}/4.041-mariadb-10.2.patch"
78 +)
79 +src_configure() {
80 + local impl
81 + impl=$(usex mariadb mariadb mysql)
82 + if use test; then
83 + myconf="${myconf} --testdb=test \
84 + --testhost=localhost \
85 + --testuser=test \
86 + --testpassword=test"
87 + fi
88 + myconf="${myconf} --$(usex ssl ssl nossl) --mysql_config=${EPREFIX%/}/usr/bin/${impl}_config"
89 + perl-module_src_configure
90 +}
91 +
92 +# Parallel testing is broken as 2 tests create the same table
93 +# and mysql isn't acid compliant and can't limit visibility of tables
94 +# to a transaction...
95 +DIST_TEST="do"
96 +
97 +src_test() {
98 + einfo
99 + einfo "If tests fail, you have to configure your MySQL instance to create"
100 + einfo "and grant some privileges to the test user."
101 + einfo "You can run the following commands at the MySQL prompt: "
102 + einfo "> CREATE USER 'test'@'localhost' IDENTIFIED BY 'test';"
103 + einfo "> CREATE DATABASE test;"
104 + einfo "> GRANT ALL PRIVILEGES ON test.* TO 'test'@'localhost';"
105 + einfo
106 + sleep 5
107 + perl_rm_files t/pod.t t/manifest.t
108 + # Don't be a hero and try to do EXTENDED_TESTING=1 unless you can figure
109 + # out why 60leaks.t fails
110 + perl-module_src_test
111 +}
112
113 diff --git a/dev-perl/DBD-mysql/metadata.xml b/dev-perl/DBD-mysql/metadata.xml
114 index 8b79ff55907..59ac82b1e1b 100644
115 --- a/dev-perl/DBD-mysql/metadata.xml
116 +++ b/dev-perl/DBD-mysql/metadata.xml
117 @@ -17,5 +17,7 @@
118 <use>
119 <flag name="embedded">Support embedded server (libmysqld)</flag>
120 <flag name="ssl">Compile in support for SSL connections via libmysqlclient</flag>
121 + <flag name="mariadb">Use <pkg>dev-db/mariadb-connector-c</pkg> as the client library</flag>
122 + <flag name="mysql">Use <pkg>dev-db/mysql-connector-c</pkg> as the client library</flag>
123 </use>
124 </pkgmetadata>