Gentoo Archives: gentoo-commits

From: Hans de Graaff <graaff@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/Ice/
Date: Mon, 30 Mar 2020 05:39:57
Message-Id: 1585546688.1836a6cd1ae1ed8856e7a72ad7f2821607e72591.graaff@gentoo
1 commit: 1836a6cd1ae1ed8856e7a72ad7f2821607e72591
2 Author: Hans de Graaff <graaff <AT> gentoo <DOT> org>
3 AuthorDate: Sun Mar 29 18:05:02 2020 +0000
4 Commit: Hans de Graaff <graaff <AT> gentoo <DOT> org>
5 CommitDate: Mon Mar 30 05:38:08 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1836a6cd
7
8 dev-libs/Ice: use ruby25
9
10 Package-Manager: Portage-2.3.89, Repoman-2.3.20
11 Signed-off-by: Hans de Graaff <graaff <AT> gentoo.org>
12
13 dev-libs/Ice/Ice-3.6.4-r1.ebuild | 357 +++++++++++++++++++++++++++++++++++++++
14 1 file changed, 357 insertions(+)
15
16 diff --git a/dev-libs/Ice/Ice-3.6.4-r1.ebuild b/dev-libs/Ice/Ice-3.6.4-r1.ebuild
17 new file mode 100644
18 index 00000000000..1f62f1c3f98
19 --- /dev/null
20 +++ b/dev-libs/Ice/Ice-3.6.4-r1.ebuild
21 @@ -0,0 +1,357 @@
22 +# Copyright 1999-2020 Gentoo Authors
23 +# Distributed under the terms of the GNU General Public License v2
24 +
25 +EAPI=6
26 +
27 +PYTHON_COMPAT=( python3_6 )
28 +
29 +RUBY_OPTIONAL="yes"
30 +USE_RUBY="ruby25"
31 +
32 +PHP_EXT_NAME="IcePHP"
33 +PHP_EXT_INI="yes"
34 +PHP_EXT_ZENDEXT="no"
35 +
36 +PHP_EXT_OPTIONAL_USE=php
37 +
38 +USE_PHP="php7-0"
39 +
40 +# This variable does not belong to any eclass. It is solely used in this ebuild
41 +# db:6.2 breaks the build process
42 +BERKDB_SLOTS=( 6.1 5.3 5.1 4.8 )
43 +
44 +inherit db-use mono-env php-ext-source-r3 python-r1 ruby-ng toolchain-funcs eapi7-ver
45 +
46 +DESCRIPTION="ICE middleware C++ library and generator tools"
47 +HOMEPAGE="https://zeroc.com/products/ice"
48 +SRC_URI="https://github.com/zeroc-ice/ice/archive/v${PV}.tar.gz -> ${P}.tar.gz
49 + doc? ( http://download.zeroc.com/Ice/$(ver_cut 1-2)/${P}.pdf )"
50 +LICENSE="GPL-2"
51 +SLOT="0/36"
52 +KEYWORDS="~amd64 ~arm ~x86"
53 +IUSE="doc examples libressl +ncurses mono php python ruby test debug"
54 +RESTRICT="test"
55 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
56 +
57 +RDEPEND=">=dev-libs/expat-2.0.1
58 + >=app-arch/bzip2-1.0.5
59 + !libressl? ( dev-libs/openssl:0= )
60 + libressl? ( dev-libs/libressl:0= )
61 + || (
62 + $(for slot in ${BERKDB_SLOTS[@]} ; do printf '%s\n' "sys-libs/db:${slot}[cxx]" ; done)
63 + )
64 + dev-cpp/libmcpp
65 + python? ( ${PYTHON_DEPS} )
66 + ruby? ( $(ruby_implementation_depend ruby25) )
67 + mono? ( dev-lang/mono )
68 + php? ( dev-lang/php:7.0 )
69 + !dev-python/IcePy
70 + !dev-ruby/IceRuby"
71 +DEPEND="${RDEPEND}
72 + ncurses? ( sys-libs/ncurses:0= sys-libs/readline:0= )
73 + test? (
74 + ${PYTHON_DEPS}
75 + dev-python/passlib[${PYTHON_USEDEP}]
76 + )"
77 +
78 +# Maintainer notes:
79 +# TODO: java bindings, multiple ruby versions (supports 2.{1,2,3})
80 +
81 +S="${WORKDIR}/${P/I/i}"
82 +PHP_EXT_S="${S}/php"
83 +
84 +PATCHES=(
85 + "${FILESDIR}/${PN}-3.6.3-no-arch-opts.patch"
86 + "${FILESDIR}/${PN}-3.6.3-csharp.patch"
87 + #"${FILESDIR}/${PN}-3.6.3-libressl.patch"
88 +)
89 +
90 +pkg_setup() {
91 + # prevent ruby-ng.eclass from messing with pkg_setup
92 + return
93 +}
94 +
95 +src_unpack() {
96 + # prevent ruby-ng.eclass from messing with src_unpack
97 + default
98 +}
99 +
100 +src_prepare() {
101 + default
102 +
103 + sed -i \
104 + -e 's|\(install_configdir[[:space:]]*\):=|\1?=|' \
105 + -e 's|-L\$\(libdir\)||' \
106 + cpp/config/Make.rules || die "sed failed"
107 +
108 + sed -i \
109 + -e 's|\(install_phpdir[[:space:]]*\):=|\1?=|' \
110 + -e 's|\(install_libdir[[:space:]]*\):=|\1?=|' \
111 + php/config/Make.rules.php || die "sed failed"
112 +
113 + sed -i \
114 + -e 's|\(install_pythondir[[:space:]]*\)=|\1?=|' \
115 + -e 's|\(install_rubydir[[:space:]]*\)=|\1?=|' \
116 + -e 's|\(install_libdir[[:space:]]*\):=|\1?=|' \
117 + {python,ruby}/config/Make.rules || die "sed failed"
118 +
119 + sed -i \
120 + -e 's|-O2 ||g' \
121 + -e 's|-Werror ||g' \
122 + cpp/config/Make.rules.Linux || die "sed failed"
123 +
124 + sed -i \
125 + -e 's|install-common||' \
126 + {cpp,csharp,php,python,ruby}/Makefile || die "sed failed"
127 +
128 + sed -i \
129 + -e 's|-f -root|-f -gacdir $(GAC_DIR) -root|' \
130 + -e 's|\(install_libdir[[:space:]]*\):=|\1?=|' \
131 + -e 's|\(install_pkgconfigdir[[:space:]]*\):=|\1?=|' \
132 + csharp/config/Make.rules.cs || die "sed failed"
133 +
134 + # skip mono tests, bug #498484
135 + sed -i \
136 + -e '/SUBDIRS/s|\ test||' \
137 + csharp/Makefile || die "sed failed"
138 +
139 + # skip udp test due to multicast
140 + # skip IceGrid/admin bug #649850
141 + # skip IceSSL tests due to requirement of internet connection
142 + # skip IceStorm/single bug #636834
143 + # IceStorm/stress fails without USE=debug
144 + # IceUtil/stacktrace fails with USE=debug
145 + sed -i \
146 + -e 's|allTests.py|allTests.py --rfilter=IceUtil\/stacktrace --rfilter=udp --rfilter=IceGrid\/admin --rfilter=IceSSL --rfilter=IceStorm\/single --rfilter=IceStorm\/stress|' \
147 + cpp/Makefile || die "sed failed"
148 +
149 + # mainly broken .ice files
150 + sed -i \
151 + -e 's|allTests.py|allTests.py --rfilter=operations --rfilter=slicing\/objects|' \
152 + python/Makefile || die "sed failed"
153 +
154 + # fails even on unicode locale
155 + sed -i \
156 + -e 's|allTests.py|allTests.py --rfilter=Slice\/unicodePaths|' \
157 + ruby/Makefile || die "sed failed"
158 +
159 + # fix for x86 IceBox test
160 + sed -i \
161 + -e 's|"32"|""|' \
162 + scripts/TestUtil.py || die "sed failed"
163 +}
164 +
165 +src_configure() {
166 + suitable_db_version() {
167 + local ver
168 + for ver in "${BERKDB_SLOTS[@]}"; do
169 + if [[ -n $(db_findver sys-libs/db:${ver}) ]]; then
170 + echo "${ver}"
171 + return 0
172 + fi
173 + done
174 + die "No suitable BerkDB versions found, aborting"
175 + }
176 +
177 + MAKE_RULES=(
178 + "prefix=\"${ED%/}/usr\""
179 + "install_docdir=\"${ED%/}/usr/share/doc/${PF}\""
180 + "install_configdir=\"${ED%/}/usr/share/${P}/config\""
181 + "install_mandir=\"${ED%/}/usr/share/man/man1\""
182 + "embedded_runpath_prefix=\"${EPREFIX}/usr\""
183 + "LP64=yes"
184 + "new_dtags=yes"
185 + "NOTEST=$(usex !test)"
186 + "USE_READLINE=$(usex ncurses)"
187 + "OPTIMIZE=$(usex !debug)"
188 + )
189 +
190 + local BERKDB_VERSION="$(suitable_db_version)"
191 + MAKE_RULES+=("DB_FLAGS=-I$(db_includedir ${BERKDB_VERSION})")
192 + sed -i \
193 + -e "s|g++|$(tc-getCXX)|" \
194 + -e "s|\(CFLAGS[[:space:]]*=\)|\1 ${CFLAGS}|" \
195 + -e "s|\(CXXFLAGS[[:space:]]*=\)|\1 ${CXXFLAGS}|" \
196 + -e "s|\(LDFLAGS[[:space:]]*=\)|\1 ${LDFLAGS}|" \
197 + -e "s|\(DB_LIBS[[:space:]]*=\) \-ldb_cxx|\1 -ldb_cxx-$(db_findver sys-libs/db:${BERKDB_VERSION})|" \
198 + cpp/config/Make.rules{,.Linux} python/config/Make.rules || die "sed failed"
199 +
200 + if use python; then
201 + local S="${S}/python"
202 + python_copy_sources
203 + fi
204 +
205 + if use ruby; then
206 + SITERUBY="$(ruby25 -r rbconfig -e 'print RbConfig::CONFIG["sitelibdir"]')"
207 + MAKE_RULES_RUBY=(
208 + "install_rubydir=\"${ED%/}/${SITERUBY}\""
209 + "install_libdir=\"${ED%/}/${SITERUBY}\""
210 + )
211 +
212 + # make it use ruby25 only
213 + sed -i \
214 + -e 's|RUBY = ruby|\025|' \
215 + ruby/config/Make.rules || die "sed failed"
216 + sed -i \
217 + -e 's|env ruby|\025|' \
218 + ruby/config/s2rb.rb || die "sed failed"
219 + sed -i \
220 + -e 's|env ruby|\025|' \
221 + ruby/scripts/slice2rb || die "sed failed"
222 + sed -i \
223 + -e 's|output.write("ruby|\025|' \
224 + scripts/TestUtil.py || die "sed failed"
225 + fi
226 +
227 + MAKE_RULES_MONO=(
228 + "GACINSTALL=yes"
229 + "GAC_ROOT=\"${ED%/}/usr/$(get_libdir)\""
230 + "GAC_DIR=\"${EPREFIX}/usr/$(get_libdir)\""
231 + "install_libdir=\"${ED%/}/usr/$(get_libdir)\""
232 + "install_pkgconfigdir=\"${ED%/}/usr/$(get_libdir)/pkgconfig\""
233 + )
234 +
235 + if has_version ">dev-lang/mono-4"; then
236 + MAKE_RULES_MONO+=("MCS=mcs")
237 + fi
238 +
239 + use test && python_setup
240 +}
241 +
242 +src_compile() {
243 + # Do not remove this export or build will break!
244 + tc-export CXX
245 +
246 + emake -C cpp "${MAKE_RULES[@]}"
247 +
248 + if use php; then
249 + local i
250 + for i in $(php_get_slots); do
251 + mkdir -p "${WORKDIR}/${i}" || die
252 + cp -r "${PHP_EXT_S}" "${WORKDIR}/${i}/" || die "Failed to copy source ${PHP_EXT_S} to PHP target directory"
253 +
254 + pushd "${WORKDIR}/${i}" >/dev/null || die
255 + ln -s "${S}/cpp" || die
256 + ln -s "${S}/config" || die
257 + ln -s "${S}/slice" || die
258 + ln -s "${S}/Makefile" || die
259 +
260 + emake -C php "${MAKE_RULES[@]}" USE_NAMESPACES=yes "PHP_CONFIG=\"${EPREFIX}/usr/$(get_libdir)/${i}/bin/php-config\""
261 + popd >/dev/null || die
262 + done
263 + fi
264 +
265 + if use python; then
266 + building() {
267 + emake -C "${BUILD_DIR}" "${MAKE_RULES[@]}" PYTHON="${EPYTHON}"
268 + }
269 + local S="${S}/python"
270 + python_foreach_impl building
271 + fi
272 +
273 + if use ruby; then
274 + emake -C ruby "${MAKE_RULES[@]}" "${MAKE_RULES_RUBY[@]}"
275 + fi
276 +
277 + if use mono; then
278 + emake -C csharp "${MAKE_RULES[@]}" "${MAKE_RULES_MONO[@]}"
279 + fi
280 +}
281 +
282 +src_test() {
283 + local -x LD_LIBRARY_PATH="${S}/cpp/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}"
284 + emake -C cpp "${MAKE_RULES[@]}" test
285 +
286 + # php tests require the extension loaded and are therefore skipped
287 +
288 + if use python; then
289 + testing() {
290 + emake -C "${BUILD_DIR}" \
291 + "${MAKE_RULES[@]}" \
292 + PYTHON="${EPYTHON}" \
293 + install_pythondir="\"${D%/}/$(python_get_sitedir)\"" \
294 + install_libdir="\"${D%/}/$(python_get_sitedir)\"" test
295 + }
296 + local S="${S}/python"
297 + python_foreach_impl testing
298 + fi
299 +
300 + if use ruby; then
301 + emake -C ruby "${MAKE_RULES[@]}" "${MAKE_RULES_RUBY[@]}" test
302 + fi
303 +
304 + if use mono; then
305 + # skip mono tests, bug #498484
306 + ewarn "Tests for C# are currently disabled."
307 + #emake -C csharp "${MAKE_RULES[@]}" "${MAKE_RULES_MONO[@]}" test
308 + fi
309 +}
310 +
311 +src_install() {
312 + local DOCS=( CHANGELOG*.md README.md )
313 + use doc && DOCS+=( "${DISTDIR}/${P}.pdf" )
314 + einstalldocs
315 +
316 + insinto /usr/share/${P}
317 + doins -r slice
318 +
319 + emake -C cpp "${MAKE_RULES[@]}" install
320 +
321 + if use examples; then
322 + docinto examples-cpp
323 + dodoc cpp/config/*.cfg
324 + docompress -x /usr/share/doc/${PF}/examples-cpp
325 + fi
326 +
327 + if use php; then
328 + insinto "/usr/share/php/${PN}"
329 +
330 + local i
331 + while IFS="" read -d $'\0' -r i; do
332 + doins "${i}"
333 + done < <(find "${S}/php/lib/" -name '*.php' -print0)
334 +
335 + pushd "${ED%/}/usr/share/${P}/slice" >/dev/null || die
336 +
337 + local -x LD_LIBRARY_PATH="${ED%/}/usr/$(get_libdir):${LD_LIBRARY_PATH}"
338 + for i in *; do
339 + mkdir -p "${ED%/}/usr/share/php/${i}" || die
340 + "${ED%/}"/usr/bin/slice2php \
341 + -I"${ED%/}/usr/share/${P}/slice/" --all \
342 + --output-dir "${ED%/}/usr/share/php/${i}" \
343 + --ice "${ED%/}/usr/share/${P}/slice/${i}"/*
344 + done
345 +
346 + for i in $(php_get_slots); do
347 + php_init_slot_env "${i}"
348 + insinto "${EXT_DIR}"
349 + newins "php/lib/${PHP_EXT_NAME}.so" "${PHP_EXT_NAME}.so"
350 + done
351 + php-ext-source-r2_createinifiles
352 +
353 + popd >/dev/null || die
354 + fi
355 +
356 + if use python; then
357 + installation() {
358 + mkdir -p "${D%/}/$(python_get_sitedir)" || die
359 +
360 + emake -C "${BUILD_DIR}" \
361 + "${MAKE_RULES[@]}" \
362 + install_pythondir="\"${D%/}/$(python_get_sitedir)\"" \
363 + install_libdir="\"${D%/}/$(python_get_sitedir)\"" \
364 + install
365 + }
366 + local S="${S}/python"
367 + python_foreach_impl installation
368 + fi
369 +
370 + if use ruby; then
371 + dodir "${SITERUBY}"
372 + emake -C ruby "${MAKE_RULES[@]}" "${MAKE_RULES_RUBY[@]}" install
373 + fi
374 +
375 + if use mono; then
376 + emake -C csharp "${MAKE_RULES[@]}" "${MAKE_RULES_MONO[@]}" install
377 + fi
378 +}