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/
Date: Fri, 23 Sep 2022 10:05:23
Message-Id: 1663927452.f705f92749744588bbadac64feff3250712e84da.mgorny@gentoo
1 commit: f705f92749744588bbadac64feff3250712e84da
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri Sep 23 10:04:12 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri Sep 23 10:04:12 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f705f927
7
8 sci-mathematics/z3: Revert "Remove old"
9
10 Reverts: 8f5a05275e21e1ecf49dedfe324a38e86bf874cc
11 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
12
13 sci-mathematics/z3/Manifest | 5 ++
14 sci-mathematics/z3/z3-4.10.1.ebuild | 107 ++++++++++++++++++++++++++++++++++
15 sci-mathematics/z3/z3-4.10.2.ebuild | 107 ++++++++++++++++++++++++++++++++++
16 sci-mathematics/z3/z3-4.11.0.ebuild | 107 ++++++++++++++++++++++++++++++++++
17 sci-mathematics/z3/z3-4.8.17.ebuild | 107 ++++++++++++++++++++++++++++++++++
18 sci-mathematics/z3/z3-4.9.1-r1.ebuild | 107 ++++++++++++++++++++++++++++++++++
19 6 files changed, 540 insertions(+)
20
21 diff --git a/sci-mathematics/z3/Manifest b/sci-mathematics/z3/Manifest
22 index c773e99400fa..c688dbcecdac 100644
23 --- a/sci-mathematics/z3/Manifest
24 +++ b/sci-mathematics/z3/Manifest
25 @@ -1 +1,6 @@
26 +DIST z3-4.10.1.tar.gz 5366092 BLAKE2B 2b857b7a1b3b71e0b7d2c55b8971fb27115f65b6995e0330786d24badfae563e4a63140790c197255ec566b78ff699c5f0aac99ffeb5eb45c05b2175f3395c20 SHA512 6c8e9f074d4b87f9388384d10dcde51fbdf0e1ee58cf2a5d321e3779ac5054a0ec7bfed3df4f8d3563c457ca7f5189ca310909656e500b6a8803f0df2c693baf
27 +DIST z3-4.10.2.tar.gz 5367336 BLAKE2B e710dd3ee34e6ef69a1858281f59e96acdea052fe8ee4f1f2e112189d9aac9323fb1d907b9eff22bd9c179846ce1fd98847bab63fe36a67b13c682108eae2019 SHA512 d0e54036d403d124a7bbf4cf8de9fd9159bab5151f875b546474563811dfb259bc46650df950802031a180375745fb589acbc79d0065944f0631df378dd6d0c3
28 +DIST z3-4.11.0.tar.gz 5392300 BLAKE2B 5b59efdf74d5d358daf23f877a090b240909eab14bebb9f23c68c7eb7fb7f2258afc049665061f61d10c1e092382f707f094f12c20f33c7e06c7939275b231d0 SHA512 a3fd7e013948de6683b16aca03641bb845d02187152bebdee8c62c2a3f80a7710a1d3b9aef9c1490c2340571bb225f457928ac57a2ed28c0084ced34bcf3e905
29 DIST z3-4.11.2.tar.gz 5428273 BLAKE2B 85fe5b94c5bfaeaca5b1dfe42fe9763a278c414955a9aed45abbb3e60c366a86bcdcd7c3bdcf27cc67bc10c76700069d548cb1e27ccf3286c8c6eccfa9d492d1 SHA512 be2573d38c0e50b46fcb025d50335e016769fdeab3c26f5dc2a13102fae889d23039258ea8d38de3f53daa4cf073704d8639ac291e781a74633194adedaae21a
30 +DIST z3-4.8.17.tar.gz 5232392 BLAKE2B 80dbb5d48811eb6022c0d0117d1e954bae7b27ff984f24cdfbc9158eb548349f817f30ea231d1119aadeedaec63765834bff6f6d21276d0bf61c30212444f224 SHA512 95517014ec1798c2552253dd5cde6f955896ab297a4f56294f4bc6f2c5428069015f513c6eb9a090a809cfcf4cb1cc38cc83818f19b5b1051e4e6c06f973747d
31 +DIST z3-4.9.1.tar.gz 5358020 BLAKE2B b707084424b615a43dcefbc395d6cf0519f3d6ea3ab1cc8b34b1810d5eb241afa22eae694e4dfc756fff42179a5dabe10052f88aab02953154ada8334f7e0b64 SHA512 0c44e10d039c3bf16591a7b94e3a3209bc334635106ac7ae4afda95541d13d4fc39214646662683c26b4874846e0d83813215e189ce5422d13f8ce7c2ac4db51
32
33 diff --git a/sci-mathematics/z3/z3-4.10.1.ebuild b/sci-mathematics/z3/z3-4.10.1.ebuild
34 new file mode 100644
35 index 000000000000..25e2b9ca2cb8
36 --- /dev/null
37 +++ b/sci-mathematics/z3/z3-4.10.1.ebuild
38 @@ -0,0 +1,107 @@
39 +# Copyright 1999-2022 Gentoo Authors
40 +# Distributed under the terms of the GNU General Public License v2
41 +
42 +EAPI=8
43 +
44 +PYTHON_COMPAT=( python3_{8..10} )
45 +
46 +inherit cmake-multilib java-pkg-opt-2 python-single-r1
47 +
48 +DESCRIPTION="An efficient theorem prover"
49 +HOMEPAGE="https://github.com/Z3Prover/z3/"
50 +SRC_URI="https://github.com/Z3Prover/z3/archive/${P}.tar.gz"
51 +S=${WORKDIR}/z3-${P}
52 +
53 +SLOT="0/$(ver_cut 1-2)"
54 +LICENSE="MIT"
55 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~sparc ~x86"
56 +IUSE="doc examples gmp isabelle java python"
57 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
58 +
59 +RDEPEND="
60 + ${PYTHON_DEPS}
61 + gmp? ( dev-libs/gmp:0=[cxx(+),${MULTILIB_USEDEP}] )
62 +"
63 +DEPEND="
64 + ${RDEPEND}
65 + java? ( >=virtual/jdk-1.8 )
66 +"
67 +BDEPEND="
68 + doc? ( app-doc/doxygen[dot] )
69 +"
70 +
71 +CMAKE_BUILD_TYPE=RelWithDebInfo
72 +
73 +src_prepare() {
74 + cmake_src_prepare
75 + java-pkg-opt-2_src_prepare
76 +}
77 +
78 +multilib_src_configure() {
79 + local mycmakeargs=(
80 + -DCMAKE_INSTALL_DOCDIR="${EPREFIX}/usr/share/doc/${PF}"
81 + -DZ3_USE_LIB_GMP=$(usex gmp)
82 + -DZ3_ENABLE_EXAMPLE_TARGETS=OFF
83 + -DZ3_BUILD_DOCUMENTATION=$(multilib_native_usex doc)
84 + -DZ3_BUILD_PYTHON_BINDINGS=$(multilib_native_usex python)
85 + -DZ3_BUILD_JAVA_BINDINGS=$(multilib_native_usex java)
86 + -DZ3_INCLUDE_GIT_DESCRIBE=OFF
87 + -DZ3_INCLUDE_GIT_HASH=OFF
88 + )
89 +
90 + multilib_is_native_abi && use java && mycmakeargs+=( -DJAVA_HOME="$(java-config -g JAVA_HOME )" )
91 +
92 + cmake_src_configure
93 +}
94 +
95 +multilib_src_test() {
96 + cmake_build test-z3
97 + set -- "${BUILD_DIR}"/test-z3 /a
98 + echo "${@}" >&2
99 + "${@}" || die
100 +}
101 +
102 +multilib_src_install_all() {
103 + dodoc README.md
104 + use examples && dodoc -r examples
105 + use python && python_optimize
106 +
107 + if use isabelle; then
108 + insinto /usr/share/Isabelle/contrib/${P}/etc
109 + newins - settings <<-EOF
110 + Z3_COMPONENT="\$COMPONENT"
111 + Z3_HOME="${EPREFIX}/usr/bin"
112 + Z3_SOLVER="${EPREFIX}/usr/bin/z3"
113 + Z3_REMOTE_SOLVER="z3"
114 + Z3_VERSION="${PV}"
115 + Z3_INSTALLED="yes"
116 + Z3_NON_COMMERCIAL="yes"
117 + EOF
118 + fi
119 +}
120 +
121 +pkg_postinst() {
122 + if use isabelle; then
123 + if [[ -f ${ROOT}/etc/isabelle/components ]]; then
124 + sed -e "/contrib\/${PN}-[0-9.]*/d" \
125 + -i "${ROOT}/etc/isabelle/components" || die
126 + cat <<-EOF >> "${ROOT}/etc/isabelle/components" || die
127 + contrib/${P}
128 + EOF
129 + fi
130 + fi
131 +}
132 +
133 +pkg_postrm() {
134 + if use isabelle; then
135 + if [[ ! ${REPLACING_VERSIONS} ]]; then
136 + if [[ -f "${ROOT}/etc/isabelle/components" ]]; then
137 + # Note: this sed should only match the version of this ebuild
138 + # Which is what we want as we do not want to remove the line
139 + # of a new Isabelle component being installed during an upgrade.
140 + sed -e "/contrib\/${P}/d" \
141 + -i "${ROOT}/etc/isabelle/components" || die
142 + fi
143 + fi
144 + fi
145 +}
146
147 diff --git a/sci-mathematics/z3/z3-4.10.2.ebuild b/sci-mathematics/z3/z3-4.10.2.ebuild
148 new file mode 100644
149 index 000000000000..16e3a209e6d1
150 --- /dev/null
151 +++ b/sci-mathematics/z3/z3-4.10.2.ebuild
152 @@ -0,0 +1,107 @@
153 +# Copyright 1999-2022 Gentoo Authors
154 +# Distributed under the terms of the GNU General Public License v2
155 +
156 +EAPI=8
157 +
158 +PYTHON_COMPAT=( python3_{8..10} )
159 +
160 +inherit cmake-multilib java-pkg-opt-2 python-single-r1
161 +
162 +DESCRIPTION="An efficient theorem prover"
163 +HOMEPAGE="https://github.com/Z3Prover/z3/"
164 +SRC_URI="https://github.com/Z3Prover/z3/archive/${P}.tar.gz"
165 +S=${WORKDIR}/z3-${P}
166 +
167 +SLOT="0/$(ver_cut 1-2)"
168 +LICENSE="MIT"
169 +KEYWORDS="amd64 arm arm64 ~ppc ~ppc64 ~riscv ~sparc x86"
170 +IUSE="doc examples gmp isabelle java python"
171 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
172 +
173 +RDEPEND="
174 + ${PYTHON_DEPS}
175 + gmp? ( dev-libs/gmp:0=[cxx(+),${MULTILIB_USEDEP}] )
176 +"
177 +DEPEND="
178 + ${RDEPEND}
179 + java? ( >=virtual/jdk-1.8 )
180 +"
181 +BDEPEND="
182 + doc? ( app-doc/doxygen[dot] )
183 +"
184 +
185 +CMAKE_BUILD_TYPE=RelWithDebInfo
186 +
187 +src_prepare() {
188 + cmake_src_prepare
189 + java-pkg-opt-2_src_prepare
190 +}
191 +
192 +multilib_src_configure() {
193 + local mycmakeargs=(
194 + -DCMAKE_INSTALL_DOCDIR="${EPREFIX}/usr/share/doc/${PF}"
195 + -DZ3_USE_LIB_GMP=$(usex gmp)
196 + -DZ3_ENABLE_EXAMPLE_TARGETS=OFF
197 + -DZ3_BUILD_DOCUMENTATION=$(multilib_native_usex doc)
198 + -DZ3_BUILD_PYTHON_BINDINGS=$(multilib_native_usex python)
199 + -DZ3_BUILD_JAVA_BINDINGS=$(multilib_native_usex java)
200 + -DZ3_INCLUDE_GIT_DESCRIBE=OFF
201 + -DZ3_INCLUDE_GIT_HASH=OFF
202 + )
203 +
204 + multilib_is_native_abi && use java && mycmakeargs+=( -DJAVA_HOME="$(java-config -g JAVA_HOME )" )
205 +
206 + cmake_src_configure
207 +}
208 +
209 +multilib_src_test() {
210 + cmake_build test-z3
211 + set -- "${BUILD_DIR}"/test-z3 /a
212 + echo "${@}" >&2
213 + "${@}" || die
214 +}
215 +
216 +multilib_src_install_all() {
217 + dodoc README.md
218 + use examples && dodoc -r examples
219 + use python && python_optimize
220 +
221 + if use isabelle; then
222 + insinto /usr/share/Isabelle/contrib/${P}/etc
223 + newins - settings <<-EOF
224 + Z3_COMPONENT="\$COMPONENT"
225 + Z3_HOME="${EPREFIX}/usr/bin"
226 + Z3_SOLVER="${EPREFIX}/usr/bin/z3"
227 + Z3_REMOTE_SOLVER="z3"
228 + Z3_VERSION="${PV}"
229 + Z3_INSTALLED="yes"
230 + Z3_NON_COMMERCIAL="yes"
231 + EOF
232 + fi
233 +}
234 +
235 +pkg_postinst() {
236 + if use isabelle; then
237 + if [[ -f ${ROOT}/etc/isabelle/components ]]; then
238 + sed -e "/contrib\/${PN}-[0-9.]*/d" \
239 + -i "${ROOT}/etc/isabelle/components" || die
240 + cat <<-EOF >> "${ROOT}/etc/isabelle/components" || die
241 + contrib/${P}
242 + EOF
243 + fi
244 + fi
245 +}
246 +
247 +pkg_postrm() {
248 + if use isabelle; then
249 + if [[ ! ${REPLACING_VERSIONS} ]]; then
250 + if [[ -f "${ROOT}/etc/isabelle/components" ]]; then
251 + # Note: this sed should only match the version of this ebuild
252 + # Which is what we want as we do not want to remove the line
253 + # of a new Isabelle component being installed during an upgrade.
254 + sed -e "/contrib\/${P}/d" \
255 + -i "${ROOT}/etc/isabelle/components" || die
256 + fi
257 + fi
258 + fi
259 +}
260
261 diff --git a/sci-mathematics/z3/z3-4.11.0.ebuild b/sci-mathematics/z3/z3-4.11.0.ebuild
262 new file mode 100644
263 index 000000000000..4c7fa51d483e
264 --- /dev/null
265 +++ b/sci-mathematics/z3/z3-4.11.0.ebuild
266 @@ -0,0 +1,107 @@
267 +# Copyright 1999-2022 Gentoo Authors
268 +# Distributed under the terms of the GNU General Public License v2
269 +
270 +EAPI=8
271 +
272 +PYTHON_COMPAT=( python3_{8..11} )
273 +
274 +inherit cmake-multilib java-pkg-opt-2 python-single-r1
275 +
276 +DESCRIPTION="An efficient theorem prover"
277 +HOMEPAGE="https://github.com/Z3Prover/z3/"
278 +SRC_URI="https://github.com/Z3Prover/z3/archive/${P}.tar.gz"
279 +S=${WORKDIR}/z3-${P}
280 +
281 +SLOT="0/$(ver_cut 1-2)"
282 +LICENSE="MIT"
283 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~sparc ~x86"
284 +IUSE="doc examples gmp isabelle java python"
285 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
286 +
287 +RDEPEND="
288 + ${PYTHON_DEPS}
289 + gmp? ( dev-libs/gmp:0=[cxx(+),${MULTILIB_USEDEP}] )
290 +"
291 +DEPEND="
292 + ${RDEPEND}
293 + java? ( >=virtual/jdk-1.8 )
294 +"
295 +BDEPEND="
296 + doc? ( app-doc/doxygen[dot] )
297 +"
298 +
299 +CMAKE_BUILD_TYPE=RelWithDebInfo
300 +
301 +src_prepare() {
302 + cmake_src_prepare
303 + java-pkg-opt-2_src_prepare
304 +}
305 +
306 +multilib_src_configure() {
307 + local mycmakeargs=(
308 + -DCMAKE_INSTALL_DOCDIR="${EPREFIX}/usr/share/doc/${PF}"
309 + -DZ3_USE_LIB_GMP=$(usex gmp)
310 + -DZ3_ENABLE_EXAMPLE_TARGETS=OFF
311 + -DZ3_BUILD_DOCUMENTATION=$(multilib_native_usex doc)
312 + -DZ3_BUILD_PYTHON_BINDINGS=$(multilib_native_usex python)
313 + -DZ3_BUILD_JAVA_BINDINGS=$(multilib_native_usex java)
314 + -DZ3_INCLUDE_GIT_DESCRIBE=OFF
315 + -DZ3_INCLUDE_GIT_HASH=OFF
316 + )
317 +
318 + multilib_is_native_abi && use java && mycmakeargs+=( -DJAVA_HOME="$(java-config -g JAVA_HOME )" )
319 +
320 + cmake_src_configure
321 +}
322 +
323 +multilib_src_test() {
324 + cmake_build test-z3
325 + set -- "${BUILD_DIR}"/test-z3 /a
326 + echo "${@}" >&2
327 + "${@}" || die
328 +}
329 +
330 +multilib_src_install_all() {
331 + dodoc README.md
332 + use examples && dodoc -r examples
333 + use python && python_optimize
334 +
335 + if use isabelle; then
336 + insinto /usr/share/Isabelle/contrib/${P}/etc
337 + newins - settings <<-EOF
338 + Z3_COMPONENT="\$COMPONENT"
339 + Z3_HOME="${EPREFIX}/usr/bin"
340 + Z3_SOLVER="${EPREFIX}/usr/bin/z3"
341 + Z3_REMOTE_SOLVER="z3"
342 + Z3_VERSION="${PV}"
343 + Z3_INSTALLED="yes"
344 + Z3_NON_COMMERCIAL="yes"
345 + EOF
346 + fi
347 +}
348 +
349 +pkg_postinst() {
350 + if use isabelle; then
351 + if [[ -f ${ROOT}/etc/isabelle/components ]]; then
352 + sed -e "/contrib\/${PN}-[0-9.]*/d" \
353 + -i "${ROOT}/etc/isabelle/components" || die
354 + cat <<-EOF >> "${ROOT}/etc/isabelle/components" || die
355 + contrib/${P}
356 + EOF
357 + fi
358 + fi
359 +}
360 +
361 +pkg_postrm() {
362 + if use isabelle; then
363 + if [[ ! ${REPLACING_VERSIONS} ]]; then
364 + if [[ -f "${ROOT}/etc/isabelle/components" ]]; then
365 + # Note: this sed should only match the version of this ebuild
366 + # Which is what we want as we do not want to remove the line
367 + # of a new Isabelle component being installed during an upgrade.
368 + sed -e "/contrib\/${P}/d" \
369 + -i "${ROOT}/etc/isabelle/components" || die
370 + fi
371 + fi
372 + fi
373 +}
374
375 diff --git a/sci-mathematics/z3/z3-4.8.17.ebuild b/sci-mathematics/z3/z3-4.8.17.ebuild
376 new file mode 100644
377 index 000000000000..d3d41342bf18
378 --- /dev/null
379 +++ b/sci-mathematics/z3/z3-4.8.17.ebuild
380 @@ -0,0 +1,107 @@
381 +# Copyright 1999-2022 Gentoo Authors
382 +# Distributed under the terms of the GNU General Public License v2
383 +
384 +EAPI=8
385 +
386 +PYTHON_COMPAT=( python3_{8..10} )
387 +
388 +inherit cmake-multilib java-pkg-opt-2 python-single-r1
389 +
390 +DESCRIPTION="An efficient theorem prover"
391 +HOMEPAGE="https://github.com/Z3Prover/z3/"
392 +SRC_URI="https://github.com/Z3Prover/z3/archive/${P}.tar.gz"
393 +S=${WORKDIR}/z3-${P}
394 +
395 +SLOT="0/4.8"
396 +LICENSE="MIT"
397 +KEYWORDS="amd64 arm arm64 ~ppc ppc64 ~riscv sparc x86"
398 +IUSE="doc examples gmp isabelle java python"
399 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
400 +
401 +RDEPEND="
402 + ${PYTHON_DEPS}
403 + gmp? ( dev-libs/gmp:0=[cxx(+),${MULTILIB_USEDEP}] )
404 +"
405 +DEPEND="
406 + ${RDEPEND}
407 + java? ( >=virtual/jdk-1.8 )
408 +"
409 +BDEPEND="
410 + doc? ( app-doc/doxygen[dot] )
411 +"
412 +
413 +CMAKE_BUILD_TYPE=RelWithDebInfo
414 +
415 +src_prepare() {
416 + cmake_src_prepare
417 + java-pkg-opt-2_src_prepare
418 +}
419 +
420 +multilib_src_configure() {
421 + local mycmakeargs=(
422 + -DCMAKE_INSTALL_DOCDIR="${EPREFIX}/usr/share/doc/${PF}"
423 + -DZ3_USE_LIB_GMP=$(usex gmp)
424 + -DZ3_ENABLE_EXAMPLE_TARGETS=OFF
425 + -DZ3_BUILD_DOCUMENTATION=$(multilib_native_usex doc)
426 + -DZ3_BUILD_PYTHON_BINDINGS=$(multilib_native_usex python)
427 + -DZ3_BUILD_JAVA_BINDINGS=$(multilib_native_usex java)
428 + -DZ3_INCLUDE_GIT_DESCRIBE=OFF
429 + -DZ3_INCLUDE_GIT_HASH=OFF
430 + )
431 +
432 + multilib_is_native_abi && use java && mycmakeargs+=( -DJAVA_HOME="$(java-config -g JAVA_HOME )" )
433 +
434 + cmake_src_configure
435 +}
436 +
437 +multilib_src_test() {
438 + cmake_build test-z3
439 + set -- "${BUILD_DIR}"/test-z3 /a
440 + echo "${@}" >&2
441 + "${@}" || die
442 +}
443 +
444 +multilib_src_install_all() {
445 + dodoc README.md RELEASE_NOTES
446 + use examples && dodoc -r examples
447 + use python && python_optimize
448 +
449 + if use isabelle; then
450 + insinto /usr/share/Isabelle/contrib/${P}/etc
451 + newins - settings <<-EOF
452 + Z3_COMPONENT="\$COMPONENT"
453 + Z3_HOME="${EPREFIX}/usr/bin"
454 + Z3_SOLVER="${EPREFIX}/usr/bin/z3"
455 + Z3_REMOTE_SOLVER="z3"
456 + Z3_VERSION="${PV}"
457 + Z3_INSTALLED="yes"
458 + Z3_NON_COMMERCIAL="yes"
459 + EOF
460 + fi
461 +}
462 +
463 +pkg_postinst() {
464 + if use isabelle; then
465 + if [[ -f ${ROOT}/etc/isabelle/components ]]; then
466 + sed -e "/contrib\/${PN}-[0-9.]*/d" \
467 + -i "${ROOT}/etc/isabelle/components" || die
468 + cat <<-EOF >> "${ROOT}/etc/isabelle/components" || die
469 + contrib/${P}
470 + EOF
471 + fi
472 + fi
473 +}
474 +
475 +pkg_postrm() {
476 + if use isabelle; then
477 + if [[ ! ${REPLACING_VERSIONS} ]]; then
478 + if [[ -f "${ROOT}/etc/isabelle/components" ]]; then
479 + # Note: this sed should only match the version of this ebuild
480 + # Which is what we want as we do not want to remove the line
481 + # of a new Isabelle component being installed during an upgrade.
482 + sed -e "/contrib\/${P}/d" \
483 + -i "${ROOT}/etc/isabelle/components" || die
484 + fi
485 + fi
486 + fi
487 +}
488
489 diff --git a/sci-mathematics/z3/z3-4.9.1-r1.ebuild b/sci-mathematics/z3/z3-4.9.1-r1.ebuild
490 new file mode 100644
491 index 000000000000..25e2b9ca2cb8
492 --- /dev/null
493 +++ b/sci-mathematics/z3/z3-4.9.1-r1.ebuild
494 @@ -0,0 +1,107 @@
495 +# Copyright 1999-2022 Gentoo Authors
496 +# Distributed under the terms of the GNU General Public License v2
497 +
498 +EAPI=8
499 +
500 +PYTHON_COMPAT=( python3_{8..10} )
501 +
502 +inherit cmake-multilib java-pkg-opt-2 python-single-r1
503 +
504 +DESCRIPTION="An efficient theorem prover"
505 +HOMEPAGE="https://github.com/Z3Prover/z3/"
506 +SRC_URI="https://github.com/Z3Prover/z3/archive/${P}.tar.gz"
507 +S=${WORKDIR}/z3-${P}
508 +
509 +SLOT="0/$(ver_cut 1-2)"
510 +LICENSE="MIT"
511 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~sparc ~x86"
512 +IUSE="doc examples gmp isabelle java python"
513 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
514 +
515 +RDEPEND="
516 + ${PYTHON_DEPS}
517 + gmp? ( dev-libs/gmp:0=[cxx(+),${MULTILIB_USEDEP}] )
518 +"
519 +DEPEND="
520 + ${RDEPEND}
521 + java? ( >=virtual/jdk-1.8 )
522 +"
523 +BDEPEND="
524 + doc? ( app-doc/doxygen[dot] )
525 +"
526 +
527 +CMAKE_BUILD_TYPE=RelWithDebInfo
528 +
529 +src_prepare() {
530 + cmake_src_prepare
531 + java-pkg-opt-2_src_prepare
532 +}
533 +
534 +multilib_src_configure() {
535 + local mycmakeargs=(
536 + -DCMAKE_INSTALL_DOCDIR="${EPREFIX}/usr/share/doc/${PF}"
537 + -DZ3_USE_LIB_GMP=$(usex gmp)
538 + -DZ3_ENABLE_EXAMPLE_TARGETS=OFF
539 + -DZ3_BUILD_DOCUMENTATION=$(multilib_native_usex doc)
540 + -DZ3_BUILD_PYTHON_BINDINGS=$(multilib_native_usex python)
541 + -DZ3_BUILD_JAVA_BINDINGS=$(multilib_native_usex java)
542 + -DZ3_INCLUDE_GIT_DESCRIBE=OFF
543 + -DZ3_INCLUDE_GIT_HASH=OFF
544 + )
545 +
546 + multilib_is_native_abi && use java && mycmakeargs+=( -DJAVA_HOME="$(java-config -g JAVA_HOME )" )
547 +
548 + cmake_src_configure
549 +}
550 +
551 +multilib_src_test() {
552 + cmake_build test-z3
553 + set -- "${BUILD_DIR}"/test-z3 /a
554 + echo "${@}" >&2
555 + "${@}" || die
556 +}
557 +
558 +multilib_src_install_all() {
559 + dodoc README.md
560 + use examples && dodoc -r examples
561 + use python && python_optimize
562 +
563 + if use isabelle; then
564 + insinto /usr/share/Isabelle/contrib/${P}/etc
565 + newins - settings <<-EOF
566 + Z3_COMPONENT="\$COMPONENT"
567 + Z3_HOME="${EPREFIX}/usr/bin"
568 + Z3_SOLVER="${EPREFIX}/usr/bin/z3"
569 + Z3_REMOTE_SOLVER="z3"
570 + Z3_VERSION="${PV}"
571 + Z3_INSTALLED="yes"
572 + Z3_NON_COMMERCIAL="yes"
573 + EOF
574 + fi
575 +}
576 +
577 +pkg_postinst() {
578 + if use isabelle; then
579 + if [[ -f ${ROOT}/etc/isabelle/components ]]; then
580 + sed -e "/contrib\/${PN}-[0-9.]*/d" \
581 + -i "${ROOT}/etc/isabelle/components" || die
582 + cat <<-EOF >> "${ROOT}/etc/isabelle/components" || die
583 + contrib/${P}
584 + EOF
585 + fi
586 + fi
587 +}
588 +
589 +pkg_postrm() {
590 + if use isabelle; then
591 + if [[ ! ${REPLACING_VERSIONS} ]]; then
592 + if [[ -f "${ROOT}/etc/isabelle/components" ]]; then
593 + # Note: this sed should only match the version of this ebuild
594 + # Which is what we want as we do not want to remove the line
595 + # of a new Isabelle component being installed during an upgrade.
596 + sed -e "/contrib\/${P}/d" \
597 + -i "${ROOT}/etc/isabelle/components" || die
598 + fi
599 + fi
600 + fi
601 +}