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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Wed Jun 3 11:45:25 2015 UTC (3 years, 4 months ago) by blueness
Branch: MAIN
CVS Tags: HEAD
Version bump

(Portage version: 2.2.18/cvs/Linux x86_64, signed Manifest commit with key 0xF52D4BBA)

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.3.2.ebuild,v 1.2 2015/05/08 19:56:44 blueness Exp $
4
5 EAPI="5"
6
7 PYTHON_DEPEND="python? 2"
8 PYTHON_USE_WITH="threads"
9 SUPPORT_PYTHON_ABIS="1"
10 RESTRICT_PYTHON_ABIS="3.* *-jython 2.7-pypy-*"
11
12 USE_PHP="php5-4"
13
14 PHP_EXT_NAME="xapian"
15 PHP_EXT_INI="yes"
16 PHP_EXT_OPTIONAL_USE="php"
17
18 inherit java-pkg-opt-2 mono-env php-ext-source-r2 python
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
30 COMMONDEPEND="=dev-libs/xapian-${PV}*
31 lua? ( dev-lang/lua:= )
32 mono? ( >=dev-lang/mono-1.0.8 )
33 perl? ( dev-lang/perl:= )
34 ruby? ( dev-lang/ruby:= )
35 tcl? ( >=dev-lang/tcl-8.1:0= )"
36 DEPEND="${COMMONDEPEND}
37 java? ( >=virtual/jdk-1.3 )"
38 RDEPEND="${COMMONDEPEND}
39 java? ( >=virtual/jre-1.3 )"
40
41 pkg_setup() {
42 mono-env_pkg_setup
43 java-pkg-opt-2_pkg_setup
44
45 if use python; then
46 python_pkg_setup
47 fi
48 }
49
50 src_prepare() {
51 java-pkg-opt-2_src_prepare
52
53 if use python; then
54 sed \
55 -e 's|\(^pkgpylib_DATA = xapian/__init__.py\).*|\1|' \
56 -e '/\s\sxapian\/__init__.pyc/d' \
57 -e '/\s\sxapian\/__init__.pyo/d' \
58 -e 's|\(^xapian/__init__.py: modern/xapian.py\)|\1 xapian/_xapian$(PYTHON_SO)|' \
59 -i python/Makefile.in || die "sed failed"
60 fi
61 }
62
63 src_configure() {
64 if use java; then
65 CXXFLAGS="${CXXFLAGS} $(java-pkg_get-jni-cflags)"
66 fi
67
68 if use perl; then
69 export PERL_ARCH="$(perl -MConfig -e 'print $Config{installvendorarch}')"
70 export PERL_LIB="$(perl -MConfig -e 'print $Config{installvendorlib}')"
71 fi
72
73 if use lua; then
74 export LUA_LIB="$(pkg-config --variable=INSTALL_CMOD lua)"
75 fi
76
77 econf \
78 $(use_with java) \
79 $(use_with lua) \
80 $(use_with mono csharp) \
81 $(use_with perl) \
82 $(use_with php) \
83 $(use_with python) \
84 $(use_with ruby) \
85 $(use_with tcl)
86
87 # Python bindings are built/tested/installed manually.
88 sed -e "/SUBDIRS =/s/ python//" -i Makefile || die "sed Makefile"
89 }
90
91 src_compile() {
92 default
93
94 if use python; then
95 python_copy_sources python
96 building() {
97 emake \
98 PYTHON="$(PYTHON)" \
99 PYTHON_INC="$(python_get_includedir)" \
100 PYTHON_LIB="$(python_get_libdir)" \
101 PYTHON_SO="$("$(PYTHON)" -c 'import distutils.sysconfig; print(distutils.sysconfig.get_config_vars("SO")[0])')" \
102 pkgpylibdir="$(python_get_sitedir)/xapian"
103 }
104 python_execute_function -s --source-dir python building
105 fi
106 }
107
108 src_test() {
109 default
110
111 if use python; then
112 testing() {
113 emake \
114 PYTHON="$(PYTHON)" \
115 PYTHON_INC="$(python_get_includedir)" \
116 PYTHON_LIB="$(python_get_libdir)" \
117 PYTHON_SO="$("$(PYTHON)" -c 'import distutils.sysconfig; print(distutils.sysconfig.get_config_vars("SO")[0])')" \
118 pkgpylibdir="$(python_get_sitedir)/xapian" \
119 VERBOSE="1" \
120 check
121 }
122 python_execute_function -s --source-dir python testing
123 fi
124 }
125
126 src_install () {
127 emake DESTDIR="${D}" install || die "emake install failed"
128
129 if use java; then
130 java-pkg_dojar java/built/xapian_jni.jar
131 # TODO: make the build system not install this...
132 java-pkg_doso "${D}/${S}/java/built/libxapian_jni.so"
133 rm "${D}/${S}/java/built/libxapian_jni.so"
134 rmdir -p "${D}/${S}/java/built"
135 rmdir -p "${D}/${S}/java/native"
136 fi
137
138 if use python; then
139 installation() {
140 emake \
141 DESTDIR="${D}" \
142 PYTHON="$(PYTHON)" \
143 PYTHON_INC="$(python_get_includedir)" \
144 PYTHON_LIB="$(python_get_libdir)" \
145 PYTHON_SO="$("$(PYTHON)" -c 'import distutils.sysconfig; print(distutils.sysconfig.get_config_vars("SO")[0])')" \
146 pkgpylibdir="$(python_get_sitedir)/xapian" \
147 install
148 }
149 python_execute_function -s --source-dir python installation
150 fi
151
152 if use php; then
153 php-ext-source-r2_createinifiles
154 fi
155
156 # For some USE combinations this directory is not created
157 if [[ -d "${D}/usr/share/doc/xapian-bindings" ]]; then
158 mv "${D}/usr/share/doc/xapian-bindings" "${D}/usr/share/doc/${PF}"
159 fi
160
161 dodoc AUTHORS HACKING NEWS TODO README || die "dodoc failed"
162 }
163
164 pkg_postinst() {
165 if use python; then
166 python_mod_optimize xapian
167 fi
168
169 if use php_targets_php5-4; then
170 ewarn "Note: subclassing Xapian classes in PHP currently doesn't work with PHP 5.4"
171 fi
172 }
173
174 pkg_postrm() {
175 if use python; then
176 python_mod_cleanup xapian
177 fi
178 }

  ViewVC Help
Powered by ViewVC 1.1.20