public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Hans de Graaff" <graaff@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-ruby/mysql2/
Date: Fri,  9 Feb 2024 07:49:37 +0000 (UTC)	[thread overview]
Message-ID: <1707464342.44fcd9f0f6abf1e49177352d6f07925813f25cd3.graaff@gentoo> (raw)

commit:     44fcd9f0f6abf1e49177352d6f07925813f25cd3
Author:     Hans de Graaff <graaff <AT> gentoo <DOT> org>
AuthorDate: Fri Feb  9 07:39:02 2024 +0000
Commit:     Hans de Graaff <graaff <AT> gentoo <DOT> org>
CommitDate: Fri Feb  9 07:39:02 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=44fcd9f0

dev-ruby/mysql2: add 0.5.6

Signed-off-by: Hans de Graaff <graaff <AT> gentoo.org>

 dev-ruby/mysql2/Manifest            |   1 +
 dev-ruby/mysql2/mysql2-0.5.6.ebuild | 139 ++++++++++++++++++++++++++++++++++++
 2 files changed, 140 insertions(+)

diff --git a/dev-ruby/mysql2/Manifest b/dev-ruby/mysql2/Manifest
index b9c4c9d64e1a..465817ce280c 100644
--- a/dev-ruby/mysql2/Manifest
+++ b/dev-ruby/mysql2/Manifest
@@ -1 +1,2 @@
 DIST mysql2-0.5.5.tar.gz 124769 BLAKE2B 698b18434691b2b7734c6fa314c931a38e973813a1912166838541f35c181813bff2db2c0967df72e8d9108b9ea71a030af09f39354a9c902674fab287b82331 SHA512 fa43e464bfd495d335c6f95b1897009813b7d6fbfeebe8d9c533c4f88c664a61a140227df73eb892c0314f76ebb5d0f2e06265284512dd35950bbab78d20e0fc
+DIST mysql2-0.5.6.tar.gz 125108 BLAKE2B cdecc8912a5cd1c1cb9ea1a428c930cf0acad8832db3c8fcee93c8a3ef898fff47f09735d7b646e782e4a908e555c704a11e68ffc10ef735705438d0090e2883 SHA512 44b6e0bfe819d9a9ce056d4cd99b547dbb2bebe512a00eadf030885a8b7b147bc08a334dc583585bddf36998d46242aa0aadc9dc159f2296d6f3640a74362de9

diff --git a/dev-ruby/mysql2/mysql2-0.5.6.ebuild b/dev-ruby/mysql2/mysql2-0.5.6.ebuild
new file mode 100644
index 000000000000..380f6a06f03d
--- /dev/null
+++ b/dev-ruby/mysql2/mysql2-0.5.6.ebuild
@@ -0,0 +1,139 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+USE_RUBY="ruby31 ruby32 ruby33"
+
+RUBY_FAKEGEM_RECIPE_TEST="rspec3"
+
+RUBY_FAKEGEM_TASK_DOC=""
+
+RUBY_FAKEGEM_EXTRADOC="README.md"
+
+RUBY_FAKEGEM_EXTENSIONS=(ext/mysql2/extconf.rb)
+RUBY_FAKEGEM_EXTENSION_LIBDIR=lib/mysql2
+
+RUBY_FAKEGEM_GEMSPEC="mysql2.gemspec"
+
+inherit ruby-fakegem
+
+DESCRIPTION="A modern, simple and very fast Mysql library for Ruby - binding to libmysql"
+HOMEPAGE="https://github.com/brianmario/mysql2"
+SRC_URI="https://github.com/brianmario/mysql2/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="$(ver_cut 1-2)"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~sparc ~x86"
+IUSE="mysql mariadb"
+REQUIRED_USE="^^ ( mariadb mysql )"
+
+SQL_DEPEND="mysql? ( dev-db/mysql-connector-c:= ) mariadb? ( dev-db/mariadb-connector-c:= )"
+DEPEND="${DEPEND} ${SQL_DEPEND}"
+RDEPEND="${RDEPEND} ${SQL_DEPEND}"
+BDEPEND="
+	test? (
+		mariadb? ( dev-db/mariadb:* )
+		mysql? ( >=dev-db/mysql-8:* )
+	)
+"
+
+all_ruby_prepare() {
+	sed -i -e '/s.version/ s/Mysql2::VERSION/"'${PV}'"/' ${RUBY_FAKEGEM_GEMSPEC} || die
+}
+
+each_ruby_configure() {
+	local config
+	if use mysql ; then
+		config="${EPREFIX}/usr/bin/mysql_config"
+	fi
+	if use mariadb ; then
+		config="${EPREFIX}/usr/bin/mariadb_config"
+	fi
+
+	${RUBY} -Cext/mysql2 extconf.rb --with-mysql-config="${config}" || die
+}
+
+each_ruby_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 --socket="${T}"/mysqld.sock -s -e '
+		CREATE DATABASE test1 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
+	' || die "Failed to create test databases"
+
+	# https://github.com/brianmario/mysql2/blob/master/ci/setup.sh
+	mysql -u root \
+		-e 'CREATE DATABASE /*M!50701 IF NOT EXISTS */ test' \
+		-S "${T}"/mysqld.sock || die
+
+	# https://github.com/brianmario/mysql2/blob/master/tasks/rspec.rake
+	cat <<-EOF > spec/configuration.yml || die
+	root:
+	  host: localhost
+	  username: root
+	  password:
+	  database: test
+	  socket: ${T}/mysqld.sock
+
+	user:
+	  host: localhost
+	  username: root
+	  password:
+	  database: mysql2_test
+	  socket: ${T}/mysqld.sock
+	EOF
+
+	nonfatal each_fakegem_test
+	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
+}


             reply	other threads:[~2024-02-09  7:49 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-09  7:49 Hans de Graaff [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-04-01 16:57 [gentoo-commits] repo/gentoo:master commit in: dev-ruby/mysql2/ Hans de Graaff
2025-04-01 16:57 Hans de Graaff
2025-02-08 10:16 Arthur Zamarin
2024-01-21  8:41 Hans de Graaff
2023-09-16  9:27 Sam James
2023-03-28 22:54 Sam James
2023-01-23  7:17 Hans de Graaff
2023-01-23  7:17 Hans de Graaff
2022-05-04  5:26 Hans de Graaff
2022-05-01  9:12 Hans de Graaff
2021-11-08  5:43 Hans de Graaff
2021-11-08  2:51 Yixun Lan
2021-11-07 12:06 Hans de Graaff
2021-09-18  7:59 Hans de Graaff
2021-09-18  7:59 Hans de Graaff
2021-02-13  9:51 Hans de Graaff
2020-09-16  6:18 Hans de Graaff
2020-08-08  5:49 Hans de Graaff
2020-04-20 17:05 Sergei Trofimovich
2020-04-20 17:05 Sergei Trofimovich
2020-04-20 17:05 Sergei Trofimovich
2020-02-27  6:05 Hans de Graaff
2020-02-27  6:05 Hans de Graaff
2019-11-28  6:18 Hans de Graaff
2019-08-28 11:17 Thomas Deutschmann
2019-08-24 10:30 Thomas Deutschmann
2019-05-13 16:46 Mikle Kolyada
2019-04-11  6:49 Hans de Graaff
2019-01-31  7:35 Hans de Graaff
2018-07-27  5:22 Hans de Graaff
2018-07-27  5:22 Hans de Graaff
2018-07-24  9:25 Hans de Graaff
2018-07-08  3:36 Hans de Graaff
2018-04-13  6:20 Hans de Graaff
2018-03-21  6:41 Hans de Graaff
2018-02-04 15:15 Hans de Graaff
2018-02-04 15:15 Hans de Graaff
2017-11-16  7:05 Hans de Graaff
2017-11-16  7:05 Hans de Graaff
2017-08-11  5:16 Hans de Graaff
2017-07-11  5:04 Hans de Graaff
2017-07-11  5:04 Hans de Graaff
2017-07-03  5:35 Hans de Graaff
2017-07-01 13:45 Alexis Ballier
2017-05-05  5:11 Hans de Graaff
2017-05-05  5:11 Hans de Graaff
2016-10-23  5:40 Hans de Graaff
2016-10-23  5:40 Hans de Graaff
2016-04-19 21:45 Manuel Rüger
2016-04-19 21:45 Manuel Rüger
2016-03-24  6:17 Hans de Graaff
2016-03-24  6:17 Hans de Graaff
2016-02-24 21:22 Manuel Rüger
2016-02-24 21:22 Manuel Rüger
2015-11-26  7:13 Hans de Graaff
2015-10-04  9:00 Hans de Graaff
2015-10-04  9:00 Hans de Graaff
2015-09-16 19:50 Manuel Rüger
2015-09-12  0:29 Manuel Rüger
2015-08-26  5:59 Hans de Graaff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1707464342.44fcd9f0f6abf1e49177352d6f07925813f25cd3.graaff@gentoo \
    --to=graaff@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox