Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-mathematics/z3/, sci-mathematics/z3/files/
Date: Wed, 10 Apr 2019 17:45:28
Message-Id: 1554918317.0e7a59ce50c3202ff2c3a4bff22be3a9fe69f581.mgorny@gentoo
1 commit: 0e7a59ce50c3202ff2c3a4bff22be3a9fe69f581
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Wed Apr 10 17:44:38 2019 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Wed Apr 10 17:45:17 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0e7a59ce
7
8 sci-mathematics/z3: Revert "Drop old"
9
10 This broke sci-mathematics/isabelle.
11
12 Reverts: 6785f3b5e8a6e7969ed07ed59c5b2e7a82aea188.
13 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
14
15 sci-mathematics/z3/Manifest | 1 +
16 sci-mathematics/z3/files/z3-4.4.1-gcc-6.patch | 18 +++
17 sci-mathematics/z3/z3-4.4.1.ebuild | 178 ++++++++++++++++++++++++++
18 3 files changed, 197 insertions(+)
19
20 diff --git a/sci-mathematics/z3/Manifest b/sci-mathematics/z3/Manifest
21 index 6ef6cbd0cc1..8fa3186e1cc 100644
22 --- a/sci-mathematics/z3/Manifest
23 +++ b/sci-mathematics/z3/Manifest
24 @@ -1,2 +1,3 @@
25 +DIST z3-4.4.1.tar.gz 3347371 BLAKE2B 57f090b891618613c4647a89620d12f2ac05ea110268e63b343594f53fa2cc7aa347781001e2778ea7dc1ce475c964ddeced7a82c304b4be706ad164fd17a285 SHA512 76991a24f47f2b53ceb8d7a9a6be19913c57994ffb6cf6acfe30f61b2e73959cf02a99f656053594fccb5aaf4d1f44b3ae7e51f1c8953b213d738ceeeaea74f8
26 DIST z3-4.5.0.tar.gz 3573695 BLAKE2B 285cc4d1f998d61ddb0b854044b7c79c1bb4cccf51bbdcba7c4a45698d74d9591f84d0aa74c5ef7c8aea2c6539ac987f29e326b44037e954108df67644dff594 SHA512 1ebc2c908d90b6b879f1e819c864ff894613276af47a440f27cf94968c195656952434754c3eb20f4bdbdd8497d227d22e1b4821c0d320b11052b5648d9e2dc7
27 DIST z3-4.8.4.tar.gz 4117081 BLAKE2B 6912defbae0e5444c451c4d7c6fb5d51167a1ae166257c7bfc53044ce7e9b9c4bd9824986c2ae1e6abfd6fef495234c9bea60078f8db2c1faaae11f34d666831 SHA512 4660ba6ab33a6345b2e8396c332d4afcfc73eda66ceb2595a39f152df4d62a9ea0f349b0f9212389ba84ecba6bdae6ad9b62b376ba44dc4d9c74f80d7a818bf4
28
29 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
30 new file mode 100644
31 index 00000000000..2dc0ddd12f2
32 --- /dev/null
33 +++ b/sci-mathematics/z3/files/z3-4.4.1-gcc-6.patch
34 @@ -0,0 +1,18 @@
35 +diff --git a/src/util/debug.cpp b/src/util/debug.cpp
36 +index 54c67fe..66676c6 100644
37 +--- a/src/util/debug.cpp
38 ++++ b/src/util/debug.cpp
39 +@@ -78,3 +78,3 @@ void invoke_gdb() {
40 + char result;
41 +- bool ok = (std::cin >> result);
42 ++ bool ok = bool(std::cin >> result);
43 + if (!ok) exit(ERR_INTERNAL_FATAL); // happens if std::cin is eof or unattached.
44 +diff --git a/src/util/mpz.cpp b/src/util/mpz.cpp
45 +index 8559279..7dca14b 100644
46 +--- a/src/util/mpz.cpp
47 ++++ b/src/util/mpz.cpp
48 +@@ -136,3 +136,3 @@ mpz_manager<SYNCH>::mpz_manager():
49 + mpz one(1);
50 +- set(m_two64, UINT64_MAX);
51 ++ set(m_two64, (uint64)UINT64_MAX);
52 + add(m_two64, one, m_two64);
53
54 diff --git a/sci-mathematics/z3/z3-4.4.1.ebuild b/sci-mathematics/z3/z3-4.4.1.ebuild
55 new file mode 100644
56 index 00000000000..8fd027f17fe
57 --- /dev/null
58 +++ b/sci-mathematics/z3/z3-4.4.1.ebuild
59 @@ -0,0 +1,178 @@
60 +# Copyright 1999-2017 Gentoo Foundation
61 +# Distributed under the terms of the GNU General Public License v2
62 +
63 +EAPI=6
64 +
65 +PYTHON_COMPAT=( python2_7 )
66 +
67 +inherit flag-o-matic java-pkg-2 java-pkg-simple python-r1 toolchain-funcs
68 +
69 +DESCRIPTION="An efficient theorem prover"
70 +HOMEPAGE="http://z3.codeplex.com/"
71 +SRC_URI="https://github.com/Z3Prover/z3/archive/${P}.tar.gz"
72 +
73 +SLOT="0"
74 +LICENSE="MIT"
75 +KEYWORDS="~amd64 ~x86"
76 +IUSE="doc examples gmp isabelle java python"
77 +
78 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
79 +
80 +RDEPEND="${PYTHON_DEPS}
81 + gmp? ( dev-libs/gmp:0 )"
82 +DEPEND="${RDEPEND}
83 + java? ( >=virtual/jdk-1.8 )"
84 +
85 +S=${WORKDIR}/${PN}-${P}
86 +JAVA_SRC_DIR=${S}/src/api/java
87 +
88 +SO1="0"
89 +SO2="1"
90 +SOVER="${SO1}.${SO2}"
91 +
92 +pkg_setup() {
93 + python_setup
94 +
95 + if [[ ${MERGE_TYPE} != binary ]]; then
96 + if [[ $(tc-getCXX)$ == *g++* ]] && ! tc-has-openmp; then
97 + ewarn "Please use an openmp compatible compiler"
98 + ewarn "like >gcc-4.2 with USE=openmp"
99 + die "Openmp support missing in compiler"
100 + fi
101 + fi
102 +}
103 +
104 +src_prepare() {
105 + eapply "${FILESDIR}"/${P}-gcc-6.patch
106 + default
107 +
108 + sed \
109 + -e 's:-O3::g' \
110 + -e 's:-fomit-frame-pointer::' \
111 + -e 's:-msse2::g' \
112 + -e 's:-msse::g' \
113 + -e "/LINK_EXTRA_FLAGS/s:@LDFLAGS@:-lrt $(usex gmp -lgmp ""):g" \
114 + -e 's:t@\$:t\$:g' \
115 + -i scripts/*mk* || die
116 +
117 + sed \
118 + -e "s:SLIBEXTRAFLAGS = '':SLIBEXTRAFLAGS = '-Wl,-soname,lib${PN}.so.${SOVER}':" \
119 + -i scripts/mk_util.py || die
120 +
121 + append-ldflags -fopenmp
122 +
123 + cat <<- EOF > "${S}/src/api/python/__init__.py" || die
124 + from .z3 import *
125 +
126 + from . import z3num
127 + from . import z3poly
128 + from . import z3printer
129 + from . import z3rcf
130 + from . import z3types
131 + from . import z3util
132 +
133 + # generated files
134 + from . import z3core
135 + from . import z3consts
136 + EOF
137 +}
138 +
139 +src_configure() {
140 + export Z3_INSTALL_LIB_DIR="$(get_libdir)"
141 + export Z3_INSTALL_INCLUDE_DIR="include/z3"
142 + set -- \
143 + $(usex gmp --gmp "") \
144 + $(usex java --java "")
145 + echo ./configure "$@" >&2
146 + ./configure "$@" || die
147 + ${EPYTHON} scripts/mk_make.py || die
148 +}
149 +
150 +src_compile() {
151 + emake \
152 + --directory="build" \
153 + CXX=$(tc-getCXX) \
154 + LINK="$(tc-getCXX) ${LDFLAGS}" \
155 + LINK_FLAGS="${LDFLAGS}"
156 +
157 + use java && java-pkg-simple_src_compile
158 +}
159 +
160 +src_install() {
161 + dodir /usr/include/${PN}
162 + insinto /usr/include/${PN}
163 + doins src/api/z3*.h src/api/c++/z3*.h
164 + dolib.so build/lib${PN}.so
165 + dosym "/usr/$(get_libdir)/lib${PN}.so" \
166 + "/usr/$(get_libdir)/lib${PN}.so.${SO1}" \
167 + || die "Could not create /usr/$(get_libdir)/lib${PN}.so.${SO1} symlink"
168 + dosym "/usr/$(get_libdir)/lib${PN}.so" \
169 + "/usr/$(get_libdir)/lib${PN}.so.${SOVER}" \
170 + || die "Could not create libz3.so soname symlink"
171 + dobin build/z3
172 +
173 + if use examples; then
174 + insinto /usr/share/${PN}
175 + doins -r examples
176 + fi
177 +
178 + if use python; then
179 + python_moduleinto "${PN}"
180 + instpybind() {
181 + python_domodule src/api/python/*.py
182 + dosym "/usr/$(get_libdir)/lib${PN}.so" \
183 + "$(python_get_sitedir)/${PN}/lib${PN}.so" \
184 + || die "Could not create $(python_get_sitedir)/lib${PN}.so symlink for python module"
185 + }
186 + python_foreach_impl instpybind
187 + fi
188 +
189 + use java && java-pkg-simple_src_install
190 +
191 + if use isabelle; then
192 + ISABELLE_HOME="${ROOT}usr/share/Isabelle"
193 + dodir "${ISABELLE_HOME}/contrib/${PN}-${PV}/etc"
194 + cat <<- EOF >> "${S}/settings" || die
195 + Z3_COMPONENT="\$COMPONENT"
196 + Z3_HOME="${ROOT}usr/bin"
197 + Z3_SOLVER="${ROOT}usr/bin/z3"
198 + Z3_REMOTE_SOLVER="z3"
199 + Z3_VERSION="${PV}"
200 + Z3_INSTALLED="yes"
201 + Z3_NON_COMMERCIAL="yes"
202 + EOF
203 + insinto "${ISABELLE_HOME}/contrib/${PN}-${PV}/etc"
204 + doins "${S}/settings"
205 + fi
206 +
207 + local DOCS=( "README" "RELEASE_NOTES" )
208 + use doc && einstalldocs
209 +}
210 +
211 +pkg_postinst() {
212 + if use isabelle; then
213 + if [ -f "${ROOT}etc/isabelle/components" ]; then
214 + if egrep "contrib/${PN}-[0-9.]*" "${ROOT}etc/isabelle/components"; then
215 + sed -e "/contrib\/${PN}-[0-9.]*/d" \
216 + -i "${ROOT}etc/isabelle/components"
217 + fi
218 + cat <<- EOF >> "${ROOT}etc/isabelle/components"
219 + contrib/${PN}-${PV}
220 + EOF
221 + fi
222 + fi
223 +}
224 +
225 +pkg_postrm() {
226 + if use isabelle; then
227 + if [ ! -f "${ROOT}usr/bin/Z3" ]; then
228 + if [ -f "${ROOT}etc/isabelle/components" ]; then
229 + # Note: this sed should only match the version of this ebuild
230 + # Which is what we want as we do not want to remove the line
231 + # of a new Isabelle component being installed during an upgrade.
232 + sed -e "/contrib\/${PN}-${PV}/d" \
233 + -i "${ROOT}etc/isabelle/components"
234 + fi
235 + fi
236 + fi
237 +}