public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: sci-biology/bioperl-db/, sci-biology/bioperl-db/files/
@ 2017-07-18  4:40 Kent Fredric
  0 siblings, 0 replies; 2+ messages in thread
From: Kent Fredric @ 2017-07-18  4:40 UTC (permalink / raw
  To: gentoo-commits

commit:     c16e51d89ade3ee46c780185a2aad20555ab154b
Author:     Kent Fredric <kentnl <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 17 23:55:34 2017 +0000
Commit:     Kent Fredric <kentnl <AT> gentoo <DOT> org>
CommitDate: Tue Jul 18 04:38:03 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c16e51d8

sci-biology/bioperl-db: EAPI6/-R1 Bump

- Test infa overhauled slightly
- EAPI6ified
- More test changes planned
- -r1 bump mostly for double-safety around EAPI6 changes

Package-Manager: Portage-2.3.6, Repoman-2.3.2

 sci-biology/bioperl-db/bioperl-db-1.6.9-r1.ebuild  | 61 ++++++++++++++++++++++
 .../bioperl-db/files/bioperl-db-1.6.9-db.patch     | 57 ++++++++++++++++++++
 2 files changed, 118 insertions(+)

diff --git a/sci-biology/bioperl-db/bioperl-db-1.6.9-r1.ebuild b/sci-biology/bioperl-db/bioperl-db-1.6.9-r1.ebuild
new file mode 100644
index 00000000000..fd3a4280fa0
--- /dev/null
+++ b/sci-biology/bioperl-db/bioperl-db-1.6.9-r1.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+BIOPERL_RELEASE=1.6.9
+
+DIST_NAME=BioPerl-DB
+DIST_AUTHOR=CJFIELDS
+DIST_VERSION=1.006900
+inherit perl-module
+
+DESCRIPTION="Perl tools for bioinformatics - Perl API that accesses the BioSQL schema"
+HOMEPAGE="http://www.bioperl.org/"
+
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+
+DIST_TEST="do" # Parallelism probably bad
+
+RDEPEND="
+	>=sci-biology/bioperl-${PV}
+	dev-perl/DBD-mysql
+	dev-perl/DBI
+	sci-biology/biosql"
+DEPEND="${RDEPEND}
+	dev-perl/Module-Build
+	test? (
+		dev-perl/Data-Stag
+		dev-perl/Sub-Uplevel
+		dev-perl/Test-Warn
+		dev-perl/Test-Exception
+		virtual/perl-Test-Simple
+	)
+"
+
+src_prepare() {
+	if use test; then
+		eapply "${FILESDIR}/${PN}-1.6.9-db.patch"
+		einfo "Using the following configuration details for test database:"
+		einfo "  GENTOO_DB_TEST_HOST     : ${GENTOO_DB_TEST_HOST:=localhost}"
+		einfo "  GENTOO_DB_TEST_USER     : ${GENTOO_DB_TEST_USER:=portage}"
+		einfo "  GENTOO_DB_TEST_PORT     : ${GENTOO_DB_TEST_PORT:=3306}"
+		einfo "  GENTOO_DB_TEST_PASSWOWRD: ${GENTOO_DB_TEST_PASSWORD:=sekrit}"
+		einfo "  GENTOO_DB_TEST_DATABASE : ${GENTOO_DB_TEST_DB:=biosql_test}"
+		einfo "Please ensure the relevant mysql database is configured and/or tweak"
+		einfo "environment variables to suit"
+		export GENTOO_DB_TEST_HOST GENTOO_DB_TEST_USER GENTOO_DB_TEST_PORT GENTOO_DB_TEST_PASSWORD GENTOO_DB_TEST_DB
+	fi
+	perl-module_src_prepare
+}
+src_install() {
+	mydoc="AUTHORS BUGS FAQ"
+	perl-module_src_install
+}
+src_test() {
+	einfo "Removing bundled test libraries t/lib"
+	rm -r "${S}/t/lib" || die "Cannot remove t/lib"
+	perl-module_src_test
+}

diff --git a/sci-biology/bioperl-db/files/bioperl-db-1.6.9-db.patch b/sci-biology/bioperl-db/files/bioperl-db-1.6.9-db.patch
new file mode 100644
index 00000000000..9a2d5e7bb0b
--- /dev/null
+++ b/sci-biology/bioperl-db/files/bioperl-db-1.6.9-db.patch
@@ -0,0 +1,57 @@
+From a63725a70ab6d5cbf419d1896007b49609ac5cfa Mon Sep 17 00:00:00 2001
+From: Kent Fredric <kentfredric@gmail.com>
+Date: Tue, 18 Jul 2017 11:06:05 +1200
+Subject: [PATCH] Add env db test controls
+
+---
+ Build.PL           | 10 +++++-----
+ t/DBTestHarness.pm | 11 ++++++-----
+ 2 files changed, 11 insertions(+), 10 deletions(-)
+
+diff --git a/Build.PL b/Build.PL
+index ecc402e..4d55f3a 100755
+--- a/Build.PL
++++ b/Build.PL
+@@ -97,11 +97,11 @@ sub biosql_conf {
+         or die "Error: could not write to config file '$config_file'\n";
+     
+     my %config = (driver     => $drivers[0],
+-                  host       => '127.0.0.1',
+-                  user       => 'root',
+-                  port       => 3306,
+-                  password   => '',
+-                  dbname     => 'bioseqdb',
++                  host       => $ENV{GENTOO_DB_TEST_HOST},
++                  user       => $ENV{GENTOO_DB_TEST_USER},
++                  port       => $ENV{GENTOO_DB_TEST_PORT},
++                  password   => $ENV{GENTOO_DB_TEST_PASSWORD},
++                  dbname     => $ENV{GENTOO_DB_TEST_DB},
+                   database   => 'biosql',
+                   schema_sql => '../biosql-schema/sql/biosqldb-mysql.sql');
+     
+diff --git a/t/DBTestHarness.pm b/t/DBTestHarness.pm
+index b660429..bd0b3b7 100755
+--- a/t/DBTestHarness.pm
++++ b/t/DBTestHarness.pm
+@@ -47,12 +47,13 @@ my $counter=0;
+ # Default settings as a hash
+ my $dflt = {
+     'driver'        => 'mysql',
+-    'host'          => 'localhost',
+-    'user'          => 'root',
+-    'port'          => undef,
+-    'password'      => '',
++    'host'          => $ENV{GENTOO_DB_HOST},
++    'user'          => $ENV{GENTOO_DB_TEST_USER},
++    'port'          => ( defined $ENV{GENTOO_DB_TEST_PORT} and length $ENV{GENTOO_DB_TEST_PORT} ) ?
++                       $ENV{GENTOO_DB_TEST_PORT} : undef,
++    'password'      => $ENV{GENTOO_DB_TEST_PASSWORD},
+     'schema_sql'    => ['../biosql-schema/sql/biosqldb-mysql.sql'],
+-    'database'      => 'biosql',
++    'database'      => $ENV{GENTOO_DB_TEST_DB},
+     'module'        => 'Bio::DB::BioSQL::DBAdaptor'
+     };
+ 
+-- 
+2.13.1
+


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sci-biology/bioperl-db/, sci-biology/bioperl-db/files/
@ 2017-07-18  4:40 Kent Fredric
  0 siblings, 0 replies; 2+ messages in thread
From: Kent Fredric @ 2017-07-18  4:40 UTC (permalink / raw
  To: gentoo-commits

commit:     5ee7db5997fa620007d8d66a1a6dd0cead89a272
Author:     Kent Fredric <kentnl <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 18 04:37:22 2017 +0000
Commit:     Kent Fredric <kentnl <AT> gentoo <DOT> org>
CommitDate: Tue Jul 18 04:38:42 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5ee7db59

sci-biology/bioperl-db: Restrict tests re bug #421701

I've tried an excessive amount to get tests working here. But they
still need a lot of love. The work I've done so far only gets
a mysql test instance up, ( and then, only tested with mariadb )

Somebody needs to work out what's missing to provision the databases
that the tests use.

Somebody needs to add support for initializing the other kinds of
database.

Any help here encouraged, but disabling non-functioning tests
is the best we can do for now.

Package-Manager: Portage-2.3.6, Repoman-2.3.2

 sci-biology/bioperl-db/bioperl-db-1.6.9-r1.ebuild  | 51 +++++++++++++++------
 sci-biology/bioperl-db/bioperl-db-1.6.9.ebuild     |  1 +
 .../bioperl-db/files/bioperl-db-1.6.9-db.patch     | 52 +++++++++-------------
 3 files changed, 58 insertions(+), 46 deletions(-)

diff --git a/sci-biology/bioperl-db/bioperl-db-1.6.9-r1.ebuild b/sci-biology/bioperl-db/bioperl-db-1.6.9-r1.ebuild
index fd3a4280fa0..facab7d5ffb 100644
--- a/sci-biology/bioperl-db/bioperl-db-1.6.9-r1.ebuild
+++ b/sci-biology/bioperl-db/bioperl-db-1.6.9-r1.ebuild
@@ -15,10 +15,11 @@ HOMEPAGE="http://www.bioperl.org/"
 
 SLOT="0"
 KEYWORDS="~amd64 ~x86"
+RESTRICT="test"
 IUSE="test"
 
 DIST_TEST="do" # Parallelism probably bad
-
+PATCHES=( "${FILESDIR}/${PN}-1.6.9-db.patch" )
 RDEPEND="
 	>=sci-biology/bioperl-${PV}
 	dev-perl/DBD-mysql
@@ -34,20 +35,8 @@ DEPEND="${RDEPEND}
 		virtual/perl-Test-Simple
 	)
 "
-
 src_prepare() {
-	if use test; then
-		eapply "${FILESDIR}/${PN}-1.6.9-db.patch"
-		einfo "Using the following configuration details for test database:"
-		einfo "  GENTOO_DB_TEST_HOST     : ${GENTOO_DB_TEST_HOST:=localhost}"
-		einfo "  GENTOO_DB_TEST_USER     : ${GENTOO_DB_TEST_USER:=portage}"
-		einfo "  GENTOO_DB_TEST_PORT     : ${GENTOO_DB_TEST_PORT:=3306}"
-		einfo "  GENTOO_DB_TEST_PASSWOWRD: ${GENTOO_DB_TEST_PASSWORD:=sekrit}"
-		einfo "  GENTOO_DB_TEST_DATABASE : ${GENTOO_DB_TEST_DB:=biosql_test}"
-		einfo "Please ensure the relevant mysql database is configured and/or tweak"
-		einfo "environment variables to suit"
-		export GENTOO_DB_TEST_HOST GENTOO_DB_TEST_USER GENTOO_DB_TEST_PORT GENTOO_DB_TEST_PASSWORD GENTOO_DB_TEST_DB
-	fi
+	export GENTOO_DB_HOSTNAME=localhost
 	perl-module_src_prepare
 }
 src_install() {
@@ -57,5 +46,39 @@ src_install() {
 src_test() {
 	einfo "Removing bundled test libraries t/lib"
 	rm -r "${S}/t/lib" || die "Cannot remove t/lib"
+
+	ebegin "Setting up test database"
+
+	local mysqld="${EPREFIX}/usr/sbin/mysqld"
+	local socket="${T}/mysql.sock"
+	local pidfile="${T}/mysql.pid"
+	local datadir="${T}/mysql-data-dir"
+	local mysql="${EPREFIX}/usr/bin/mysql"
+
+	mkdir -p "${datadir}" || die "Can't make mysql database dir";
+	chmod 755 "${datadir}" || die "Can't fix mysql database dir perms";
+
+	if $mysqld --help | grep -q MariaDB ; then
+		"${EPREFIX}"/usr/share/mysql/scripts/mysql_install_db \
+			--basedir="${EPREFIX}/usr" \
+			--datadir="${datadir}" \
+			--user=$(whoami) || die "Can't initalize database"
+	fi
+
+	${mysqld} --no-defaults	--user=$(whoami) --skip-networking \
+							--socket="${socket}" \
+							--pid-file="${pidfile}" \
+							--datadir="${datadir}" &
+	maxtry=20
+	while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] ; do
+		maxtry=$((${maxtry}-1))
+		echo -n "."
+		sleep 1
+	done
+	eend $?
+	export MYSQL_UNIX_PORT="${socket}"
 	perl-module_src_test
+	ebegin "Shutting down mysql test database"
+	pkill -F "${pidfile}"
+	eend $?
 }

diff --git a/sci-biology/bioperl-db/bioperl-db-1.6.9.ebuild b/sci-biology/bioperl-db/bioperl-db-1.6.9.ebuild
index 7075ef24285..e6f0c45958a 100644
--- a/sci-biology/bioperl-db/bioperl-db-1.6.9.ebuild
+++ b/sci-biology/bioperl-db/bioperl-db-1.6.9.ebuild
@@ -16,6 +16,7 @@ HOMEPAGE="http://www.bioperl.org/"
 SLOT="0"
 KEYWORDS="amd64 x86"
 IUSE="test"
+RESTRICT="test"
 SRC_TEST="do"
 
 CDEPEND="

diff --git a/sci-biology/bioperl-db/files/bioperl-db-1.6.9-db.patch b/sci-biology/bioperl-db/files/bioperl-db-1.6.9-db.patch
index 9a2d5e7bb0b..36698651c7d 100644
--- a/sci-biology/bioperl-db/files/bioperl-db-1.6.9-db.patch
+++ b/sci-biology/bioperl-db/files/bioperl-db-1.6.9-db.patch
@@ -1,57 +1,45 @@
-From a63725a70ab6d5cbf419d1896007b49609ac5cfa Mon Sep 17 00:00:00 2001
+From d689a1473977b0aa368590ba1f913521e4f466c7 Mon Sep 17 00:00:00 2001
 From: Kent Fredric <kentfredric@gmail.com>
-Date: Tue, 18 Jul 2017 11:06:05 +1200
-Subject: [PATCH] Add env db test controls
+Date: Tue, 18 Jul 2017 16:02:26 +1200
+Subject: [PATCH] Allow custom host/port configurations
 
 ---
- Build.PL           | 10 +++++-----
- t/DBTestHarness.pm | 11 ++++++-----
- 2 files changed, 11 insertions(+), 10 deletions(-)
+ Build.PL           | 4 ++--
+ t/DBTestHarness.pm | 4 ++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
 
 diff --git a/Build.PL b/Build.PL
-index ecc402e..4d55f3a 100755
+index ecc402e..a61190f 100755
 --- a/Build.PL
 +++ b/Build.PL
-@@ -97,11 +97,11 @@ sub biosql_conf {
+@@ -97,9 +97,9 @@ sub biosql_conf {
          or die "Error: could not write to config file '$config_file'\n";
      
      my %config = (driver     => $drivers[0],
 -                  host       => '127.0.0.1',
--                  user       => 'root',
++                  host       => $ENV{GENTOO_DB_HOSTNAME} || '127.0.0.1',
+                   user       => 'root',
 -                  port       => 3306,
--                  password   => '',
--                  dbname     => 'bioseqdb',
-+                  host       => $ENV{GENTOO_DB_TEST_HOST},
-+                  user       => $ENV{GENTOO_DB_TEST_USER},
-+                  port       => $ENV{GENTOO_DB_TEST_PORT},
-+                  password   => $ENV{GENTOO_DB_TEST_PASSWORD},
-+                  dbname     => $ENV{GENTOO_DB_TEST_DB},
++                  port       => $ENV{GENTOO_DB_PORT} || undef,
+                   password   => '',
+                   dbname     => 'bioseqdb',
                    database   => 'biosql',
-                   schema_sql => '../biosql-schema/sql/biosqldb-mysql.sql');
-     
 diff --git a/t/DBTestHarness.pm b/t/DBTestHarness.pm
-index b660429..bd0b3b7 100755
+index b660429..91e0c54 100755
 --- a/t/DBTestHarness.pm
 +++ b/t/DBTestHarness.pm
-@@ -47,12 +47,13 @@ my $counter=0;
+@@ -47,9 +47,9 @@ my $counter=0;
  # Default settings as a hash
  my $dflt = {
      'driver'        => 'mysql',
 -    'host'          => 'localhost',
--    'user'          => 'root',
++    'host'          => $ENV{GENTOO_DB_HOST} || 'localhost',
+     'user'          => 'root',
 -    'port'          => undef,
--    'password'      => '',
-+    'host'          => $ENV{GENTOO_DB_HOST},
-+    'user'          => $ENV{GENTOO_DB_TEST_USER},
-+    'port'          => ( defined $ENV{GENTOO_DB_TEST_PORT} and length $ENV{GENTOO_DB_TEST_PORT} ) ?
-+                       $ENV{GENTOO_DB_TEST_PORT} : undef,
-+    'password'      => $ENV{GENTOO_DB_TEST_PASSWORD},
++    'port'          => $ENV{GENTOO_DB_PORT} || undef,
+     'password'      => '',
      'schema_sql'    => ['../biosql-schema/sql/biosqldb-mysql.sql'],
--    'database'      => 'biosql',
-+    'database'      => $ENV{GENTOO_DB_TEST_DB},
-     'module'        => 'Bio::DB::BioSQL::DBAdaptor'
-     };
- 
+     'database'      => 'biosql',
 -- 
 2.13.1
 


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-07-18  4:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-18  4:40 [gentoo-commits] repo/gentoo:master commit in: sci-biology/bioperl-db/, sci-biology/bioperl-db/files/ Kent Fredric
  -- strict thread matches above, loose matches on Subject: below --
2017-07-18  4:40 Kent Fredric

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox