dev-db/libdbi-drivers: drop to ~hppa because of virtual/mysql
[gentoo.git] / dev-db / libdbi-drivers / libdbi-drivers-0.9.0.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=4
5
6 inherit eutils autotools ltprune
7
8 DESCRIPTION="The libdbi-drivers project maintains drivers for libdbi"
9 SRC_URI="mirror://sourceforge/project/${PN}/${PN}/${P}/${P}.tar.gz"
10 HOMEPAGE="http://libdbi-drivers.sourceforge.net/"
11 LICENSE="LGPL-2.1"
12
13 IUSE="doc firebird mysql oci8 postgres +sqlite static-libs"
14 KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 s390 ~sparc x86"
15 SLOT=0
16 REQUIRED_USE="|| ( mysql postgres sqlite firebird oci8 )"
17 RESTRICT="firebird? ( bindist )"
18
19 RDEPEND="
20         >=dev-db/libdbi-0.9.0
21         firebird? ( dev-db/firebird )
22         mysql? ( virtual/mysql )
23         postgres? ( dev-db/postgresql )
24         sqlite? ( dev-db/sqlite:3 )
25 "
26 DEPEND="${RDEPEND}
27         doc? ( app-text/openjade )
28 "
29
30 DOCS="AUTHORS ChangeLog NEWS README README.osx TODO"
31
32 pkg_setup() {
33         use oci8 && [[ -z "${ORACLE_HOME}" ]] && die "\$ORACLE_HOME is not set!"
34 }
35
36 src_prepare() {
37                 #"${FILESDIR}"/${P}-fix-ac-macro.patch \
38                 #"${FILESDIR}"/${PN}-0.8.3-oracle-build-fix.patch \
39                 #"${FILESDIR}"/${PN}-0.8.3-firebird-fix.patch
40         epatch \
41                 "${FILESDIR}"/${PN}-0.9.0-doc-build-fix.patch
42         eautoreconf
43 }
44
45 src_configure() {
46         local myconf=""
47         # WARNING: the configure script does NOT work correctly
48         # --without-$driver does NOT work
49         # so do NOT use `use_with...`
50         # Future additions:
51         # msql
52         # freetds
53         # ingres
54         # db2
55         use mysql && myconf+=" --with-mysql"
56         use postgres && myconf+=" --with-pgsql"
57         use sqlite && myconf+=" --with-sqlite3"
58         use firebird && myconf+=" --with-firebird"
59         if use oci8; then
60                 [[ -z "${ORACLE_HOME}" ]] && die "\$ORACLE_HOME is not set!"
61                 myconf+=" --with-oracle-dir=${ORACLE_HOME} --with-oracle"
62         fi
63
64         econf \
65                 $(use_enable doc docs) \
66                 $(use_enable static-libs static) \
67                 --with-dbi-libdir=/usr/$(get_libdir) \
68                 ${myconf}
69 }
70
71 src_test() {
72         if [[ -z "${WANT_INTERACTIVE_TESTS}" ]]; then
73                 ewarn "Tests disabled due to interactivity."
74                 ewarn "Run with WANT_INTERACTIVE_TESTS=1 if you want them."
75                 return 0
76         fi
77         einfo "Running interactive tests"
78         emake check
79 }
80
81 src_install() {
82         default
83
84         prune_libtool_files --all
85 }