1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit toolchain-funcs
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"
15 IUSE="debug doc mysql postgres +sqlite ssl static-libs"
16 REQUIRED_USE=" || ( postgres mysql sqlite )"
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= )"
26 doc? ( app-doc/doxygen )"
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
36 ## TODO: check what --enable-optimized actually does
37 ## TODO: find someone with oracle db to add oci8 support
39 # enable default hidden visibility
40 myconf="${myconf} --enable-protected"
43 myconf="${myconf} --with-sqlite=${EPREFIX}/usr/ --enable-sqliteunlock"
45 myconf="${myconf} --without-sqlite"
49 myconf="${myconf} --with-mysql=${EPREFIX}/usr/bin/mysql_config"
51 myconf="${myconf} --without-mysql"
55 myconf="${myconf} --with-postgresql=${EPREFIX}/usr/bin/pg_config"
57 myconf="${myconf} --without-postgresql"
61 $(use_enable debug profiling) \
62 $(use_enable static-libs static) \
63 $(use_enable ssl openssl) \
78 # the --disable-static flag only skips .a
79 use static-libs || rm -f "${D}"/usr/lib*/libzdb.la
81 dodoc AUTHORS CHANGES README
84 dodoc -r "${S}/doc/api-docs"/*