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