/[gentoo-x86]/dev-libs/xapian-bindings/xapian-bindings-1.2.19.ebuild
Gentoo

Contents of /dev-libs/xapian-bindings/xapian-bindings-1.2.19.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.11 - (show annotations) (download)
Sun Apr 19 06:56:05 2015 UTC (3 years, 6 months ago) by pacho
Branch: MAIN
CVS Tags: HEAD
Changes since 1.10: +2 -2 lines
x86 stable wrt bug #531758

(Portage version: 2.2.18/cvs/Linux x86_64, RepoMan options: --include-arches="x86", signed Manifest commit with key A188FBD4)

1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-libs/xapian-bindings/xapian-bindings-1.2.19.ebuild,v 1.10 2015/04/14 10:53:43 ago Exp $
4
5 EAPI="5"
6
7 PYTHON_COMPAT=( python2_7 )
8 PYTHON_REQ_USE="threads"
9
10 USE_PHP="php5-4 php5-5 php5-6"
11
12 PHP_EXT_NAME="xapian"
13 PHP_EXT_INI="yes"
14 PHP_EXT_OPTIONAL_USE="php"
15
16 #mono violates sandbox, we disable it until we figure this out
17 #inherit java-pkg-opt-2 mono-env php-ext-source-r2 python
18 inherit java-pkg-opt-2 php-ext-source-r2 python-r1
19
20 DESCRIPTION="SWIG and JNI bindings for Xapian"
21 HOMEPAGE="http://www.xapian.org/"
22 SRC_URI="http://oligarchy.co.uk/xapian/${PV}/${P}.tar.xz"
23
24 LICENSE="GPL-2"
25 SLOT="0"
26 KEYWORDS="alpha amd64 arm ia64 ~mips ppc ppc64 sparc x86"
27 #IUSE="java lua mono perl php python ruby tcl"
28 #REQUIRED_USE="|| ( java lua mono perl php python ruby tcl )"
29 IUSE="java lua perl php python ruby tcl"
30 REQUIRED_USE="|| ( java lua perl php python ruby tcl )"
31
32 COMMONDEPEND="=dev-libs/xapian-${PV}*
33 lua? ( >=dev-lang/lua-5.1 )
34 perl? ( dev-lang/perl:= )
35 ruby? ( dev-lang/ruby )
36 tcl? ( >=dev-lang/tcl-8.1:0= )"
37 # mono? ( >=dev-lang/mono-1.0.8 )
38 DEPEND="${COMMONDEPEND}
39 java? ( >=virtual/jdk-1.3 )"
40 RDEPEND="${COMMONDEPEND}
41 java? ( >=virtual/jre-1.3 )"
42
43 pkg_setup() {
44 java-pkg-opt-2_pkg_setup
45 }
46
47 src_unpack() {
48 default
49 }
50
51 src_prepare() {
52 java-pkg-opt-2_src_prepare
53 if use java; then
54 sed \
55 -e 's/$(JAVAC)/$(JAVAC) $(JAVACFLAGS)/' \
56 -i java{/,/org/xapian/errors/,/org/xapian/}Makefile.in || die "sed failed"
57 fi
58
59 if use python; then
60 sed \
61 -e 's:\(^pkgpylib_DATA = xapian/__init__.py\).*:\1:' \
62 -e 's|\(^xapian/__init__.py: modern/xapian.py\)|\1 xapian/_xapian.so|' \
63 -i python/Makefile.in || die "sed failed"
64 fi
65 }
66
67 src_configure() {
68 if use java; then
69 CXXFLAGS="${CXXFLAGS} $(java-pkg_get-jni-cflags)"
70 fi
71
72 if use perl; then
73 export PERL_ARCH="$(perl -MConfig -e 'print $Config{installvendorarch}')"
74 export PERL_LIB="$(perl -MConfig -e 'print $Config{installvendorlib}')"
75 fi
76
77 if use lua; then
78 export LUA_LIB="$(pkg-config --variable=INSTALL_CMOD lua)"
79 fi
80
81 econf \
82 $(use_with java) \
83 $(use_with lua) \
84 $(use_with perl) \
85 $(use_with php) \
86 $(use_with python) \
87 $(use_with ruby) \
88 $(use_with tcl)
89 # $(use_with mono csharp) \
90
91 # PHP and Python bindings are built/tested/installed manually.
92 sed -e "/SUBDIRS =/s/ php//" -i Makefile || die "sed Makefile"
93 sed -e "/SUBDIRS =/s/ python//" -i Makefile || die "sed Makefile"
94 }
95
96 src_compile() {
97 default
98
99 if use php; then
100 local php_slot
101 for php_slot in $(php_get_slots); do
102 cp -r php php-${php_slot}
103 emake -C php-${php_slot} \
104 PHP="${EPREFIX}/usr/$(get_libdir)/${php_slot}/bin/php" \
105 PHP_CONFIG="${EPREFIX}/usr/$(get_libdir)/${php_slot}/bin/php-config" \
106 PHP_EXTENSION_DIR="$("${EPREFIX}/usr/$(get_libdir)/${php_slot}/bin/php-config" --extension-dir)" \
107 PHP_INC="$("${EPREFIX}/usr/$(get_libdir)/${php_slot}/bin/php-config" --includes)"
108 done
109 fi
110
111 if use python; then
112 python_copy_sources
113 # building() {
114 # emake -C python \
115 # PYTHON="$(PYTHON)" \
116 # PYTHON_INC="$(python_get_includedir)" \
117 # PYTHON_LIB="$(python_get_libdir)" \
118 # PYTHON_SO="$("$(PYTHON)" -c 'import distutils.sysconfig; print(distutils.sysconfig.get_config_vars("SO")[0])')" \
119 # pkgpylibdir="$(python_get_sitedir)/xapian"
120 # }
121 building() {
122 emake -C python \
123 PYTHON_INC="$(python_get_includedir)" \
124 pkgpylibdir="$(python_get_sitedir)/xapian"
125 VERBOSE="1"
126 }
127 python_foreach_impl building
128 fi
129 }
130
131 src_test() {
132 default
133
134 if use php; then
135 local php_slot
136 for php_slot in $(php_get_slots); do
137 emake -C php-${php_slot} \
138 PHP="${EPREFIX}/usr/$(get_libdir)/${php_slot}/bin/php" \
139 PHP_CONFIG="${EPREFIX}/usr/$(get_libdir)/${php_slot}/bin/php-config" \
140 PHP_EXTENSION_DIR="$("${EPREFIX}/usr/$(get_libdir)/${php_slot}/bin/php-config" --extension-dir)" \
141 PHP_INC="$("${EPREFIX}/usr/$(get_libdir)/${php_slot}/bin/php-config" --includes)" \
142 check
143 done
144 fi
145
146 if use python; then
147 testing() {
148 emake -C python \
149 PYTHON_INC="$(python_get_includedir)" \
150 pkgpylibdir="$(python_get_sitedir)/xapian" \
151 VERBOSE="1" \
152 check
153 }
154 python_foreach_impl testing
155 fi
156 }
157
158 src_install () {
159 emake DESTDIR="${D}" install
160
161 if use java; then
162 java-pkg_dojar java/built/xapian_jni.jar
163 # TODO: make the build system not install this...
164 java-pkg_doso "${D}/${S}/java/built/libxapian_jni.so"
165 rm "${D}/${S}/java/built/libxapian_jni.so"
166 rmdir -p "${D}/${S}/java/built"
167 rmdir -p "${D}/${S}/java/native"
168 fi
169
170 if use php; then
171 local php_slot
172 for php_slot in $(php_get_slots); do
173 emake DESTDIR="${D}" -C php-${php_slot} \
174 PHP="${EPREFIX}/usr/$(get_libdir)/${php_slot}/bin/php" \
175 PHP_CONFIG="${EPREFIX}/usr/$(get_libdir)/${php_slot}/bin/php-config" \
176 PHP_EXTENSION_DIR="$("${EPREFIX}/usr/$(get_libdir)/${php_slot}/bin/php-config" --extension-dir)" \
177 PHP_INC="$("${EPREFIX}/usr/$(get_libdir)/${php_slot}/bin/php-config" --includes)" \
178 install
179 done
180
181 php-ext-source-r2_createinifiles
182 fi
183
184 if use python; then
185 installation() {
186 emake -C python \
187 DESTDIR="${D}" \
188 PYTHON_INC="$(python_get_includedir)" \
189 pkgpylibdir="$(python_get_sitedir)/xapian" \
190 VERBOSE="1" \
191 install
192 }
193 python_foreach_impl installation
194 fi
195
196 # For some USE combinations this directory is not created
197 if [[ -d "${D}/usr/share/doc/xapian-bindings" ]]; then
198 mv "${D}/usr/share/doc/xapian-bindings" "${D}/usr/share/doc/${PF}"
199 fi
200
201 dodoc AUTHORS HACKING NEWS TODO README
202 }

  ViewVC Help
Powered by ViewVC 1.1.20