dev-cpp/pangomm: stable 2.42.1 for hppa, bug #717144
[gentoo.git] / dev-db / libzdb / libzdb-3.1-r1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit toolchain-funcs
7
8 DESCRIPTION="A thread safe high level multi-database connection pool library"
9 HOMEPAGE="https://www.tildeslash.com/libzdb/"
10 SRC_URI="https://www.tildeslash.com/${PN}/dist/${P}.tar.gz"
11
12 LICENSE="GPL-3"
13 SLOT="0"
14 KEYWORDS="amd64 x86"
15 IUSE="debug doc mysql postgres +sqlite ssl static-libs"
16 REQUIRED_USE=" || ( postgres mysql sqlite )"
17
18 RESTRICT=test
19
20 RDEPEND="mysql? ( dev-db/mysql-connector-c:0= )
21         postgres? ( dev-db/postgresql )
22         sqlite? ( >=dev-db/sqlite-3.7:3[unlock-notify(+)] )
23         ssl? ( dev-libs/openssl:0= )"
24 DEPEND="${RDEPEND}
25         virtual/pkgconfig
26         doc? ( app-doc/doxygen )"
27
28 src_prepare() {
29         default
30         sed -i -e "s|&& ./pool||g" test/Makefile.in || die
31         # Fix detection of openssl 1.1
32         sed -i -e "s|SSL_library_init|SSL_CTX_new|" configure || die
33 }
34
35 src_configure() {
36         ## TODO: check what --enable-optimized actually does
37         ## TODO: find someone with oracle db to add oci8 support
38         myconf=""
39         # enable default hidden visibility
40         myconf="${myconf} --enable-protected"
41
42         if use sqlite; then
43                 myconf="${myconf} --with-sqlite=${EPREFIX}/usr/ --enable-sqliteunlock"
44         else
45                 myconf="${myconf} --without-sqlite"
46         fi
47
48         if use mysql; then
49                 myconf="${myconf} --with-mysql=${EPREFIX}/usr/bin/mysql_config"
50         else
51                 myconf="${myconf} --without-mysql"
52         fi
53
54         if use postgres; then
55                 myconf="${myconf} --with-postgresql=${EPREFIX}/usr/bin/pg_config"
56         else
57                 myconf="${myconf} --without-postgresql"
58         fi
59
60         econf \
61                 $(use_enable debug profiling) \
62                 $(use_enable static-libs static) \
63                 $(use_enable ssl openssl) \
64                 --without-oci \
65                 ${myconf}
66 }
67
68 src_compile() {
69         default
70         if use doc; then
71                 emake doc
72         fi
73 }
74
75 src_install() {
76         default
77
78         # the --disable-static flag only skips .a
79         use static-libs || rm -f "${D}"/usr/lib*/libzdb.la
80
81         dodoc AUTHORS CHANGES README
82         if use doc;then
83                 docinto html
84                 dodoc -r "${S}/doc/api-docs"/*
85         fi
86 }
87
88 src_test() {
89         emake verify
90 }