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: Wed, 09 Jan 2019 20:30:58
Message-Id: 1547065845.d0fee11357ffe0565595fdc1822fe8556dbf730e.mgorny@gentoo
1 commit: d0fee11357ffe0565595fdc1822fe8556dbf730e
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jan 9 19:31:06 2019 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Wed Jan 9 20:30:45 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d0fee113
7
8 sci-mathematics/z3: Enable multilib support
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 sci-mathematics/z3/z3-4.8.3-r1.ebuild | 106 ++++++++++++++++++++++++++++++++++
13 1 file changed, 106 insertions(+)
14
15 diff --git a/sci-mathematics/z3/z3-4.8.3-r1.ebuild b/sci-mathematics/z3/z3-4.8.3-r1.ebuild
16 new file mode 100644
17 index 00000000000..6c92ed32341
18 --- /dev/null
19 +++ b/sci-mathematics/z3/z3-4.8.3-r1.ebuild
20 @@ -0,0 +1,106 @@
21 +# Copyright 1999-2019 Gentoo Authors
22 +# Distributed under the terms of the GNU General Public License v2
23 +
24 +EAPI=6
25 +
26 +PYTHON_COMPAT=( python{2_7,3_{4,5,6,7}} )
27 +
28 +inherit cmake-multilib python-single-r1 toolchain-funcs
29 +
30 +DESCRIPTION="An efficient theorem prover"
31 +HOMEPAGE="http://z3.codeplex.com/"
32 +SRC_URI="https://github.com/Z3Prover/z3/archive/${P}.tar.gz"
33 +
34 +SLOT="0/4.8"
35 +LICENSE="MIT"
36 +KEYWORDS="~amd64 ~x86"
37 +IUSE="doc examples gmp isabelle java openmp python"
38 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
39 +
40 +RDEPEND="${PYTHON_DEPS}
41 + gmp? ( dev-libs/gmp:0=[${MULTILIB_USEDEP}] )"
42 +DEPEND="${RDEPEND}
43 + doc? ( app-doc/doxygen )
44 + java? ( >=virtual/jdk-1.8 )"
45 +
46 +S=${WORKDIR}/${PN}-${P}
47 +
48 +CMAKE_BUILD_TYPE=RelWithDebInfo
49 +
50 +pkg_setup() {
51 + python_setup
52 +
53 + if [[ ${MERGE_TYPE} != binary ]]; then
54 + if use openmp && ! tc-has-openmp; then
55 + ewarn "Please use an openmp compatible compiler"
56 + ewarn "like >gcc-4.2 with USE=openmp"
57 + die "Openmp support missing in compiler"
58 + fi
59 + fi
60 +}
61 +
62 +multilib_src_configure() {
63 + local mycmakeargs=(
64 + -DCMAKE_INSTALL_DOCDIR="${EPREFIX}/usr/share/doc/${P}"
65 + -DUSE_LIB_GMP=$(usex gmp)
66 + -DUSE_OPENMP=$(usex openmp)
67 + -DENABLE_EXAMPLE_TARGETS=OFF
68 + -DBUILD_DOCUMENTATION=$(multilib_native_usex doc)
69 + -DBUILD_PYTHON_BINDINGS=$(multilib_native_usex python)
70 + -DBUILD_JAVA_BINDINGS=$(multilib_native_usex java)
71 + )
72 +
73 + cmake-utils_src_configure
74 +}
75 +
76 +multilib_src_test() {
77 + cmake-utils_src_make test-z3
78 + set -- "${BUILD_DIR}"/test-z3 /a
79 + echo "${@}" >&2
80 + "${@}" || die
81 +}
82 +
83 +multilib_src_install_all() {
84 + dodoc README.md RELEASE_NOTES
85 + use examples && dodoc -r examples
86 + use python && python_optimize
87 +
88 + if use isabelle; then
89 + insinto /usr/share/Isabelle/contrib/${P}/etc
90 + newins - settings <<-EOF
91 + Z3_COMPONENT="\$COMPONENT"
92 + Z3_HOME="${EPREFIX}/usr/bin"
93 + Z3_SOLVER="${EPREFIX}/usr/bin/z3"
94 + Z3_REMOTE_SOLVER="z3"
95 + Z3_VERSION="${PV}"
96 + Z3_INSTALLED="yes"
97 + Z3_NON_COMMERCIAL="yes"
98 + EOF
99 + fi
100 +}
101 +
102 +pkg_postinst() {
103 + if use isabelle; then
104 + if [[ -f ${ROOT%/}/etc/isabelle/components ]]; then
105 + sed -e "/contrib\/${PN}-[0-9.]*/d" \
106 + -i "${ROOT%/}/etc/isabelle/components" || die
107 + cat <<-EOF >> "${ROOT%/}/etc/isabelle/components" || die
108 + contrib/${P}
109 + EOF
110 + fi
111 + fi
112 +}
113 +
114 +pkg_postrm() {
115 + if use isabelle; then
116 + if [[ ! ${REPLACING_VERSIONS} ]]; then
117 + if [[ -f "${ROOT%/}/etc/isabelle/components" ]]; then
118 + # Note: this sed should only match the version of this ebuild
119 + # Which is what we want as we do not want to remove the line
120 + # of a new Isabelle component being installed during an upgrade.
121 + sed -e "/contrib\/${P}/d" \
122 + -i "${ROOT%/}/etc/isabelle/components" || die
123 + fi
124 + fi
125 + fi
126 +}