1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
9 DESCRIPTION="PostgreSQL database driver for the DBI module"
12 KEYWORDS="~alpha amd64 arm arm64 ~hppa ia64 ~mips ppc ppc64 s390 ~sh sparc x86 ~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
17 >=dev-perl/DBI-1.614.0
21 virtual/perl-ExtUtils-MakeMaker
24 postgres_include="$(readlink -f "${EPREFIX}"/usr/include/postgresql)"
25 postgres_lib="${postgres_include//include/lib}"
26 # Fall-through case is the non-split postgresql
27 # The active cases instead get us the matching libdir for the includedir.
28 for i in lib lib64 ; do
29 if [ -d "${postgres_lib}/${i}" ]; then
30 postgres_lib="${postgres_lib}/${i}"
35 # env variables for compilation:
36 export POSTGRES_INCLUDE="${postgres_include}"
37 export POSTGRES_LIB="${postgres_lib}"
38 perl-module_src_prepare
43 # Compile failure: https://rt.cpan.org/Ticket/Display.html?id=123218
44 # "Bundle::DBD::Pg v${PV}"
48 for dep in "${MODULES[@]}"; do
49 ebegin "Compile testing ${dep}"
50 perl -Mblib="${S}" -M"${dep} ()" -e1 #||
51 #die "Could not load ${dep}"
52 eend $? || failed+=( "$dep" )
54 if [[ ${failed[@]} ]]; then
56 eerror "One or more modules failed compile:";
57 for dep in "${failed[@]}"; do
60 die "Failing due to module compilation errors";
80 if [[ ! -v DBI_DSN ]]; then
81 ewarn "Functional database tests disabled due to lack of configuration."
82 ewarn "Please set the following environment variables values pertaining to a"
83 ewarn "pre-configured Postgres installation in order for tests to work:"
84 ewarn " DBI_DSN - A DBI-compatible connection string for a Postgres Database"
85 ewarn " ( eg: dbi:Pg:dbname=testdb )"
86 ewarn " DBI_USER - A Postgres Database Username"
87 ewarn " DBI_PASS - A Postgres Database Password"
89 ewarn "For details, visit:"
90 ewarn "https://wiki.gentoo.org/wiki/Project:Perl/maint-notes/dev-perl/DBD-Pg"
91 SKIP_TESTS+=( "${LIVEDB_TESTS[@]}" )
93 perl_rm_files "${SKIP_TESTS[@]}"
94 # Parallel testing breaks database access
95 DBDPG_TEST_ALWAYS_ENV=1 DIST_TEST="do" perl-module_src_test