dev-libs/redland: Drop 1.0.17-r1
[gentoo.git] / dev-libs / redland / redland-1.0.17-r2.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5 inherit db-use libtool
6
7 DESCRIPTION="High-level interface for the Resource Description Framework"
8 HOMEPAGE="http://librdf.org/"
9 SRC_URI="http://download.librdf.org/source/${P}.tar.gz"
10
11 LICENSE="Apache-2.0 GPL-2 LGPL-2.1"
12 SLOT="0"
13 KEYWORDS="alpha amd64 arm ~arm64 ~hppa ia64 ppc ppc64 sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos"
14 IUSE="berkdb iodbc mysql odbc postgres sqlite static-libs"
15
16 RDEPEND="dev-libs/libltdl:0
17         mysql? ( dev-db/mysql-connector-c:0= )
18         sqlite? ( =dev-db/sqlite-3* )
19         berkdb? ( sys-libs/db )
20         >=media-libs/raptor-2.0.14
21         >=dev-libs/rasqal-0.9.32
22         postgres? ( dev-db/postgresql )
23         iodbc? ( dev-db/libiodbc )
24         odbc? ( dev-db/unixODBC )"
25 DEPEND="${RDEPEND}
26         virtual/pkgconfig"
27
28 MAKEOPTS="${MAKEOPTS} -j1" #500574, required for both src_compile() and src_install()
29
30 src_prepare() {
31         default
32         elibtoolize # NOTE: this is for fbsd .so version
33 }
34
35 src_configure() {
36         local myconf=( --without-virtuoso )
37         if use iodbc; then
38                 myconf=( --with-virtuoso --with-iodbc --without-unixodbc )
39         elif use odbc; then
40                 myconf=( --with-virtuoso --with-unixodbc --without-iodbc )
41         fi
42
43         if use berkdb; then
44                 myconf+=(
45                         --with-bdb-include="$(db_includedir)"
46                         --with-bdb-lib="${EPREFIX}"/usr/$(get_libdir)
47                         --with-bdb-dbname="$(db_libname)"
48                 )
49         fi
50
51         # FIXME: upstream doesn't test with --with-threads and testsuite fails
52         econf \
53                 $(use_enable static-libs static) \
54                 $(use_with berkdb bdb) \
55                 $(use_with mysql) \
56                 $(use_with sqlite) \
57                 $(use_with postgres postgresql) \
58                 --without-threads \
59                 --with-html-dir="${EPREFIX}"/usr/share/doc/${PF}/html \
60                 "${myconf[@]}"
61 }
62
63 src_test() {
64         if ! use berkdb; then
65                 export REDLAND_TEST_CLONING_STORAGE_TYPE=hashes
66                 export REDLAND_TEST_CLONING_STORAGE_NAME=test
67                 export REDLAND_TEST_CLONING_STORAGE_OPTIONS="hash-type='memory',dir='.',write='yes',new='yes',contexts='yes'"
68         fi
69         default
70 }
71
72 src_install() {
73         default
74         docinto html
75         dodoc {FAQS,NEWS,README,RELEASE,TODO}.html
76         find "${ED}" -name '*.la' -exec sed -i -e "/^dependency_libs/s:=.*:='':" {} +
77
78         # !!! REMOVE THIS ON VERSION BUMP, see bug 468298 for proper fix !!!
79         if [[ -n ${LDFLAGS} ]]; then
80                 sed -i \
81                         -e "s:${LDFLAGS} ::g" \
82                         "${ED}"/usr/$(get_libdir)/pkgconfig/${PN}.pc || die
83         fi
84
85         # https://bugs.gentoo.org/467768
86         local _rdocdir=/usr/share/doc/${PF}/html/${PN}
87         [[ -d ${ED}/${_rdocdir} ]] && dosym ${_rdocdir} /usr/share/gtk-doc/html/${PN}
88 }