Gentoo Archives: gentoo-commits

From: Mark Wright <gienah@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-mathematics/z3/, sci-mathematics/z3/files/
Date: Mon, 02 Jan 2017 00:21:11
Message-Id: 1483316408.e1bee0588417636345663574e7c1ef127abbebe6.gienah@gentoo
1 commit: e1bee0588417636345663574e7c1ef127abbebe6
2 Author: Mark Wright <gienah <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jan 2 00:18:51 2017 +0000
4 Commit: Mark Wright <gienah <AT> gentoo <DOT> org>
5 CommitDate: Mon Jan 2 00:20:08 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e1bee058
7
8 sci-mathematics/z3: Thanks to Yichao Zhou, jlec and slyfox for development
9 on the z3 ebuilds. Thanks to David E. Narv?ez for reporting and patching.
10
11 Gentoo-bug: 602498, 602600
12
13 Package-Manager: portage-2.3.3
14
15 sci-mathematics/z3/Manifest | 2 +
16 sci-mathematics/z3/files/z3-4.1.2-configure.patch | 76 +++++++++++
17 sci-mathematics/z3/files/z3-4.4.1-gcc-6.patch | 18 +++
18 sci-mathematics/z3/metadata.xml | 22 +++
19 sci-mathematics/z3/z3-4.4.1.ebuild | 142 ++++++++++++++++++++
20 sci-mathematics/z3/z3-4.5.0.ebuild | 156 ++++++++++++++++++++++
21 6 files changed, 416 insertions(+)
22
23 diff --git a/sci-mathematics/z3/Manifest b/sci-mathematics/z3/Manifest
24 new file mode 100644
25 index 00000000..45b385a
26 --- /dev/null
27 +++ b/sci-mathematics/z3/Manifest
28 @@ -0,0 +1,2 @@
29 +DIST z3-4.4.1.tar.gz 3347371 SHA256 50967cca12c5c6e1612d0ccf8b6ebf5f99840a783d6cf5216336a2b59c37c0ce SHA512 76991a24f47f2b53ceb8d7a9a6be19913c57994ffb6cf6acfe30f61b2e73959cf02a99f656053594fccb5aaf4d1f44b3ae7e51f1c8953b213d738ceeeaea74f8 WHIRLPOOL aea616b43ae1a962cf00f4748b5a51b38586ccee393e4e27efbf806635a35af416edd6143b4cf01cf2b0df043f64ab4822f7767bb1c0a340fd57ee03627d39e5
30 +DIST z3-4.5.0.tar.gz 3573695 SHA256 aeae1d239c5e06ac183be7dd853775b84698db1265cb2258e5918a28372d4a0c SHA512 1ebc2c908d90b6b879f1e819c864ff894613276af47a440f27cf94968c195656952434754c3eb20f4bdbdd8497d227d22e1b4821c0d320b11052b5648d9e2dc7 WHIRLPOOL 3178973c2cce1ab3a87db134f7314d54aa5b491500c9f7c30c74d5672cb4995f7d468e62cd18d54b312d4d94fee8b1267c25d09e95075361e869bb36859810ab
31
32 diff --git a/sci-mathematics/z3/files/z3-4.1.2-configure.patch b/sci-mathematics/z3/files/z3-4.1.2-configure.patch
33 new file mode 100644
34 index 00000000..08ace2b
35 --- /dev/null
36 +++ b/sci-mathematics/z3/files/z3-4.1.2-configure.patch
37 @@ -0,0 +1,76 @@
38 +--- z3-orig/configure.in 2012-10-04 16:41:04.000000000 +1000
39 ++++ z3/configure.in 2012-10-18 15:56:49.895967069 +1100
40 +@@ -22,20 +22,29 @@
41 +
42 + host_os=`uname -s`
43 +
44 ++AC_ARG_ENABLE([static],
45 ++[ --disable-static disable static],
46 ++[static=${enableval}], [static=yes])
47 ++
48 ++if test "$static" = "yes"; then
49 ++ STATIC_FLAGS=-static
50 ++else
51 ++ STATIC_FLAGS=
52 ++fi
53 ++
54 + AS_IF([test "$host_os" = "Darwin"], [
55 + PLATFORM=osx
56 + SO_EXT=dylib
57 +- SLIBFLAGS="-dynamiclib -fopenmp"
58 ++ LDFLAGS="${LDFLAGS}"
59 ++ SLIBFLAGS="${LDFLAGS} -dynamiclib -fopenmp"
60 + COMP_VERSIONS="-compatibility_version \$(Z3_VERSION) -current_version \$(Z3_VERSION)"
61 +- STATIC_FLAGS=
62 + CPPFLAGS+=" -mmacosx-version-min=10.4"
63 + ], [test "$host_os" = "Linux"], [
64 + PLATFORM=linux
65 +- SO_EXT=so
66 +- LDFLAGS=-lrt
67 +- SLIBFLAGS="-shared -fopenmp"
68 ++ SO_EXT=so.1.0
69 ++ LDFLAGS="${LDFLAGS} -lrt"
70 ++ SLIBFLAGS="${LDFLAGS} -shared -fopenmp"
71 + COMP_VERSIONS=
72 +- STATIC_FLAGS=-static
73 + ], [
74 + AC_MSG_ERROR([Unknown host platform: $host_os])
75 + ])
76 +@@ -88,15 +97,17 @@
77 + AC_CHECK_LIB(gmp, __gmpz_cmp, LIBS="-lgmp $LIBS", AC_MSG_ERROR([GMP library not found]))
78 + dnl Look for libgmp.a at /usr/local/lib and /usr/lib
79 + dnl TODO: make the following test more robust...
80 +- if test -e /usr/local/lib/libgmp.a; then
81 +- GMP_STATIC_LIB="/usr/local/lib/libgmp.a"
82 +- else if test -e /usr/lib/libgmp.a; then
83 +- GMP_STATIC_LIB="/usr/lib/libgmp.a"
84 +- else if test -e /usr/lib/libgmp.dll.a; then
85 +- GMP_STATIC_LIB="/usr/lib/libgmp.dll.a"
86 +- else
87 +- AC_MSG_ERROR([Failed to find libgmp.a])
88 +- fi fi fi
89 ++ if test "$static" = "yes"; then
90 ++ if test -e /usr/local/lib/libgmp.a; then
91 ++ GMP_STATIC_LIB="/usr/local/lib/libgmp.a"
92 ++ else if test -e /usr/lib/libgmp.a; then
93 ++ GMP_STATIC_LIB="/usr/lib/libgmp.a"
94 ++ else if test -e /usr/lib/libgmp.dll.a; then
95 ++ GMP_STATIC_LIB="/usr/lib/libgmp.dll.a"
96 ++ else
97 ++ AC_MSG_ERROR([Failed to find libgmp.a])
98 ++ fi fi fi
99 ++ fi
100 + fi
101 +
102 + AC_PROG_CXXCPP
103 +--- z3-orig/Makefile.in 2012-10-04 16:41:02.000000000 +1000
104 ++++ z3/Makefile.in 2012-10-18 15:25:00.716162723 +1100
105 +@@ -175,7 +175,7 @@
106 +
107 + $(BIN_DIR)/lib$(Z3).@SO_EXT@: $(OBJ_DIR) $(BIN_DIR) $(LIB_OBJS)
108 + @mkdir -p $(BIN_DIR)
109 +- $(CXX) -o $(BIN_DIR)/lib$(Z3).@SO_EXT@ $(LIB_OBJS) $(LIBFLAGS) $(LIBS) @COMP_VERSIONS@
110 ++ $(CXX) -Wl,-soname=lib$(Z3).@SO_EXT@ -o $(BIN_DIR)/lib$(Z3).@SO_EXT@ $(LIB_OBJS) $(LIBFLAGS) $(LIBS) @COMP_VERSIONS@
111 +
112 + $(BIN_DIR)/lib$(Z3).a: $(OBJ_DIR) $(BIN_DIR) $(LIB_OBJS)
113 + @mkdir -p $(BIN_DIR)
114
115 diff --git a/sci-mathematics/z3/files/z3-4.4.1-gcc-6.patch b/sci-mathematics/z3/files/z3-4.4.1-gcc-6.patch
116 new file mode 100644
117 index 00000000..2dc0ddd
118 --- /dev/null
119 +++ b/sci-mathematics/z3/files/z3-4.4.1-gcc-6.patch
120 @@ -0,0 +1,18 @@
121 +diff --git a/src/util/debug.cpp b/src/util/debug.cpp
122 +index 54c67fe..66676c6 100644
123 +--- a/src/util/debug.cpp
124 ++++ b/src/util/debug.cpp
125 +@@ -78,3 +78,3 @@ void invoke_gdb() {
126 + char result;
127 +- bool ok = (std::cin >> result);
128 ++ bool ok = bool(std::cin >> result);
129 + if (!ok) exit(ERR_INTERNAL_FATAL); // happens if std::cin is eof or unattached.
130 +diff --git a/src/util/mpz.cpp b/src/util/mpz.cpp
131 +index 8559279..7dca14b 100644
132 +--- a/src/util/mpz.cpp
133 ++++ b/src/util/mpz.cpp
134 +@@ -136,3 +136,3 @@ mpz_manager<SYNCH>::mpz_manager():
135 + mpz one(1);
136 +- set(m_two64, UINT64_MAX);
137 ++ set(m_two64, (uint64)UINT64_MAX);
138 + add(m_two64, one, m_two64);
139
140 diff --git a/sci-mathematics/z3/metadata.xml b/sci-mathematics/z3/metadata.xml
141 new file mode 100644
142 index 00000000..d8a91e5
143 --- /dev/null
144 +++ b/sci-mathematics/z3/metadata.xml
145 @@ -0,0 +1,22 @@
146 +<?xml version="1.0" encoding="UTF-8"?>
147 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
148 +<pkgmetadata>
149 + <maintainer type="person">
150 + <email>gienah@g.o</email>
151 + </maintainer>
152 + <maintainer type="project">
153 + <email>haskell@g.o</email>
154 + <name>Gentoo Haskell</name>
155 + </maintainer>
156 + <maintainer type="project">
157 + <email>sci@g.o</email>
158 + <name>Gentoo Science Project</name>
159 + </maintainer>
160 +<longdescription lang='en'>
161 +Z3 is a high-performance theorem prover being developed at Microsoft Research.
162 +</longdescription>
163 +<use>
164 + <flag name='isabelle'>Add integration support for the Isabelle/HOL
165 + theorem prover.</flag>
166 +</use>
167 +</pkgmetadata>
168
169 diff --git a/sci-mathematics/z3/z3-4.4.1.ebuild b/sci-mathematics/z3/z3-4.4.1.ebuild
170 new file mode 100644
171 index 00000000..168ae61
172 --- /dev/null
173 +++ b/sci-mathematics/z3/z3-4.4.1.ebuild
174 @@ -0,0 +1,142 @@
175 +# Copyright 1999-2017 Gentoo Foundation
176 +# Distributed under the terms of the GNU General Public License v2
177 +# $Id$
178 +
179 +EAPI=6
180 +
181 +PYTHON_COMPAT=( python2_7 )
182 +
183 +inherit flag-o-matic java-pkg-2 java-pkg-simple python-r1 toolchain-funcs
184 +
185 +DESCRIPTION="An efficient theorem prover"
186 +HOMEPAGE="http://z3.codeplex.com/"
187 +SRC_URI="https://github.com/Z3Prover/z3/archive/${P}.tar.gz"
188 +
189 +SLOT="0"
190 +LICENSE="MIT"
191 +KEYWORDS="~amd64 ~x86"
192 +IUSE="doc gmp isabelle java python"
193 +
194 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
195 +
196 +RDEPEND="${PYTHON_DEPS}
197 + gmp? ( dev-libs/gmp:0 )"
198 +DEPEND="${RDEPEND}
199 + java? ( >=virtual/jdk-1.8 )"
200 +
201 +S=${WORKDIR}/${PN}-${P}
202 +JAVA_SRC_DIR=${S}/src/api/java
203 +
204 +pkg_setup() {
205 + if [[ ${MERGE_TYPE} != binary ]]; then
206 + if [[ $(tc-getCXX)$ == *g++* ]] && ! tc-has-openmp; then
207 + ewarn "Please use an openmp compatible compiler"
208 + ewarn "like >gcc-4.2 with USE=openmp"
209 + die "Openmp support missing in compiler"
210 + fi
211 + fi
212 +}
213 +
214 +src_prepare() {
215 + eapply "${FILESDIR}"/${P}-gcc-6.patch
216 + default
217 +
218 + sed \
219 + -e 's:-O3::g' \
220 + -e 's:-fomit-frame-pointer::' \
221 + -e 's:-msse2::g' \
222 + -e 's:-msse::g' \
223 + -e "/LINK_EXTRA_FLAGS/s:@LDFLAGS@:-lrt $(usex gmp -lgmp ""):g" \
224 + -e 's:t@\$:t\$:g' \
225 + -i scripts/*mk* || die
226 +
227 + sed \
228 + -e "s:SLIBEXTRAFLAGS = '':SLIBEXTRAFLAGS = '-Wl,-soname,lib${PN}.so.0.1':" \
229 + -i scripts/mk_util.py || die
230 +
231 + append-ldflags -fopenmp
232 +}
233 +
234 +src_configure() {
235 + python_setup
236 + python_export PYTHON_SITEDIR
237 + export Z3_INSTALL_LIB_DIR="$(get_libdir)"
238 + export Z3_INSTALL_INCLUDE_DIR="include/z3"
239 + set -- \
240 + $(usex gmp --gmp "") \
241 + $(usex java --java "")
242 + elog ./configure "$@"
243 + ./configure "$@" || die
244 + ${EPYTHON} scripts/mk_make.py || die
245 +}
246 +
247 +src_compile() {
248 + emake \
249 + --directory="build" \
250 + CXX=$(tc-getCXX) \
251 + LINK="$(tc-getCXX) ${LDFLAGS}" \
252 + LINK_FLAGS="${LDFLAGS}"
253 +
254 + use java && java-pkg-simple_src_compile
255 +}
256 +
257 +src_install() {
258 + dodir /usr/include/${PN}
259 + insinto /usr/include/${PN}
260 + doins src/api/z3*.h src/api/c++/z3*.h
261 + dolib.so build/*.so
262 + dobin build/z3
263 +
264 + if use python; then
265 + python_foreach_impl python_domodule src/api/python/*.py
266 + fi
267 +
268 + use java && java-pkg-simple_src_install
269 +
270 + if use isabelle; then
271 + ISABELLE_HOME="${ROOT}usr/share/Isabelle"
272 + dodir "${ISABELLE_HOME}/contrib/${PN}-${PV}/etc"
273 + cat <<- EOF >> "${S}/settings"
274 + Z3_COMPONENT="\$COMPONENT"
275 + Z3_HOME="${ROOT}usr/bin"
276 + Z3_SOLVER="${ROOT}usr/bin/z3"
277 + Z3_REMOTE_SOLVER="z3"
278 + Z3_VERSION="${PV}"
279 + Z3_INSTALLED="yes"
280 + Z3_NON_COMMERCIAL="yes"
281 + EOF
282 + insinto "${ISABELLE_HOME}/contrib/${PN}-${PV}/etc"
283 + doins "${S}/settings"
284 + fi
285 +
286 + local DOCS=( "README" "RELEASE_NOTES" )
287 + einstalldocs
288 +}
289 +
290 +pkg_postinst() {
291 + if use isabelle; then
292 + if [ -f "${ROOT}etc/isabelle/components" ]; then
293 + if egrep "contrib/${PN}-[0-9.]*" "${ROOT}etc/isabelle/components"; then
294 + sed -e "/contrib\/${PN}-[0-9.]*/d" \
295 + -i "${ROOT}etc/isabelle/components"
296 + fi
297 + cat <<- EOF >> "${ROOT}etc/isabelle/components"
298 + contrib/${PN}-${PV}
299 + EOF
300 + fi
301 + fi
302 +}
303 +
304 +pkg_postrm() {
305 + if use isabelle; then
306 + if [ ! -f "${ROOT}usr/bin/Z3" ]; then
307 + if [ -f "${ROOT}etc/isabelle/components" ]; then
308 + # Note: this sed should only match the version of this ebuild
309 + # Which is what we want as we do not want to remove the line
310 + # of a new Isabelle component being installed during an upgrade.
311 + sed -e "/contrib\/${PN}-${PV}/d" \
312 + -i "${ROOT}etc/isabelle/components"
313 + fi
314 + fi
315 + fi
316 +}
317
318 diff --git a/sci-mathematics/z3/z3-4.5.0.ebuild b/sci-mathematics/z3/z3-4.5.0.ebuild
319 new file mode 100644
320 index 00000000..58d2b6b
321 --- /dev/null
322 +++ b/sci-mathematics/z3/z3-4.5.0.ebuild
323 @@ -0,0 +1,156 @@
324 +# Copyright 1999-2017 Gentoo Foundation
325 +# Distributed under the terms of the GNU General Public License v2
326 +# $Id$
327 +
328 +EAPI=6
329 +
330 +PYTHON_COMPAT=( python2_7 )
331 +
332 +inherit flag-o-matic java-pkg-2 java-pkg-simple python-r1 toolchain-funcs
333 +
334 +DESCRIPTION="An efficient theorem prover"
335 +HOMEPAGE="http://z3.codeplex.com/"
336 +SRC_URI="https://github.com/Z3Prover/z3/archive/${P}.tar.gz"
337 +
338 +SLOT="0"
339 +LICENSE="MIT"
340 +KEYWORDS="~amd64 ~x86"
341 +IUSE="doc gmp isabelle java python"
342 +
343 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
344 +
345 +RDEPEND="${PYTHON_DEPS}
346 + gmp? ( dev-libs/gmp:0 )"
347 +DEPEND="${RDEPEND}
348 + java? ( >=virtual/jdk-1.8 )"
349 +
350 +S=${WORKDIR}/${PN}-${P}
351 +JAVA_SRC_DIR=${S}/src/api/java
352 +
353 +pkg_setup() {
354 + if [[ ${MERGE_TYPE} != binary ]]; then
355 + if [[ $(tc-getCXX)$ == *g++* ]] && ! tc-has-openmp; then
356 + ewarn "Please use an openmp compatible compiler"
357 + ewarn "like >gcc-4.2 with USE=openmp"
358 + die "Openmp support missing in compiler"
359 + fi
360 + fi
361 +}
362 +
363 +src_prepare() {
364 + default
365 +
366 + sed \
367 + -e 's:-O3::g' \
368 + -e 's:-fomit-frame-pointer::' \
369 + -e 's:-msse2::g' \
370 + -e 's:-msse::g' \
371 + -e "/LINK_EXTRA_FLAGS/s:@LDFLAGS@:-lrt $(usex gmp -lgmp ""):g" \
372 + -e 's:t@\$:t\$:g' \
373 + -i scripts/*mk* || die
374 +
375 + sed \
376 + -e "s:SLIBEXTRAFLAGS = '':SLIBEXTRAFLAGS = '-Wl,-soname,lib${PN}.so.0.1':" \
377 + -i scripts/mk_util.py || die
378 +
379 + sed -e 's:api\\html\\ml:api/html/ml:' \
380 + -e 's:python/z3.py:python/z3/z3.py:' \
381 + -i doc/mk_api_doc.py || die
382 +
383 + append-ldflags -fopenmp
384 +}
385 +
386 +src_configure() {
387 + python_setup
388 + python_export PYTHON_SITEDIR
389 + export Z3_INSTALL_LIB_DIR="$(get_libdir)"
390 + export Z3_INSTALL_INCLUDE_DIR="include/z3"
391 + set -- \
392 + --pypkgdir="${PYTHON_SITEDIR}" \
393 + --prefix="${ROOT}usr" \
394 + $(usex gmp --gmp "") \
395 + $(usex python --python "") \
396 + $(usex java --java "")
397 + elog ./configure "$@"
398 + ./configure "$@" || die
399 + ${EPYTHON} scripts/mk_make.py || die
400 +}
401 +
402 +src_compile() {
403 + emake \
404 + --directory="build" \
405 + CXX=$(tc-getCXX) \
406 + LINK="$(tc-getCXX) ${LDFLAGS}" \
407 + LINK_FLAGS="${LDFLAGS}"
408 +
409 + use java && java-pkg-simple_src_compile
410 +
411 + if use doc; then
412 + pushd doc || die
413 + ${EPYTHON} mk_api_doc.py || die
414 + popd || die
415 + fi
416 +}
417 +
418 +src_install() {
419 + emake \
420 + --directory="build" \
421 + CXX=$(tc-getCXX) \
422 + LINK="$(tc-getCXX) ${LDFLAGS}" \
423 + LINK_FLAGS="${LDFLAGS}" \
424 + install DESTDIR="${D}"
425 +
426 + if use python; then
427 + python_foreach_impl python_domodule src/api/python/*.py
428 + fi
429 +
430 + use java && java-pkg-simple_src_install
431 +
432 + if use isabelle; then
433 + ISABELLE_HOME="${ROOT}usr/share/Isabelle"
434 + dodir "${ISABELLE_HOME}/contrib/${PN}-${PV}/etc"
435 + cat <<- EOF >> "${S}/settings"
436 + Z3_COMPONENT="\$COMPONENT"
437 + Z3_HOME="${ROOT}usr/bin"
438 + Z3_SOLVER="${ROOT}usr/bin/z3"
439 + Z3_REMOTE_SOLVER="z3"
440 + Z3_VERSION="${PV}"
441 + Z3_INSTALLED="yes"
442 + Z3_NON_COMMERCIAL="yes"
443 + EOF
444 + insinto "${ISABELLE_HOME}/contrib/${PN}-${PV}/etc"
445 + doins "${S}/settings"
446 + fi
447 +
448 + local DOCS=( "README.md" "RELEASE_NOTES" )
449 + local HTML_DOCS=( "doc/api/html" )
450 + einstalldocs
451 +}
452 +
453 +pkg_postinst() {
454 + if use isabelle; then
455 + if [ -f "${ROOT}etc/isabelle/components" ]; then
456 + if egrep "contrib/${PN}-[0-9.]*" "${ROOT}etc/isabelle/components"; then
457 + sed -e "/contrib\/${PN}-[0-9.]*/d" \
458 + -i "${ROOT}etc/isabelle/components"
459 + fi
460 + cat <<- EOF >> "${ROOT}etc/isabelle/components"
461 + contrib/${PN}-${PV}
462 + EOF
463 + fi
464 + fi
465 +}
466 +
467 +pkg_postrm() {
468 + if use isabelle; then
469 + if [ ! -f "${ROOT}usr/bin/Z3" ]; then
470 + if [ -f "${ROOT}etc/isabelle/components" ]; then
471 + # Note: this sed should only match the version of this ebuild
472 + # Which is what we want as we do not want to remove the line
473 + # of a new Isabelle component being installed during an upgrade.
474 + sed -e "/contrib\/${PN}-${PV}/d" \
475 + -i "${ROOT}etc/isabelle/components"
476 + fi
477 + fi
478 + fi
479 +}