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/
Date: Sat, 28 Jan 2017 08:49:58
Message-Id: 1485593357.7cea2dfa7e45f8d6fb0a0fbd5b3ff808ca25a585.gienah@gentoo
1 commit: 7cea2dfa7e45f8d6fb0a0fbd5b3ff808ca25a585
2 Author: Mark Wright <gienah <AT> gentoo <DOT> org>
3 AuthorDate: Sat Jan 28 08:48:44 2017 +0000
4 Commit: Mark Wright <gienah <AT> gentoo <DOT> org>
5 CommitDate: Sat Jan 28 08:49:17 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7cea2dfa
7
8 sci-mathematics/z3: Fix python API, thanks to Jonas Jelten for reporting.
9
10 Create shared library soname symlinks. Add examples USE flag. Add || die
11 on cat of files, except in pkg_postinst() where we want it to ignore any
12 errors.
13
14 Gentoo-Bug: 605892
15
16 Package-Manager: portage-2.3.3
17
18 sci-mathematics/z3/z3-4.4.1.ebuild | 51 ++++++++++++++++++++++++++++++++------
19 sci-mathematics/z3/z3-4.5.0.ebuild | 37 ++++++++++++++++++++++-----
20 2 files changed, 75 insertions(+), 13 deletions(-)
21
22 diff --git a/sci-mathematics/z3/z3-4.4.1.ebuild b/sci-mathematics/z3/z3-4.4.1.ebuild
23 index aacd12c..b5e329e 100644
24 --- a/sci-mathematics/z3/z3-4.4.1.ebuild
25 +++ b/sci-mathematics/z3/z3-4.4.1.ebuild
26 @@ -15,7 +15,7 @@ SRC_URI="https://github.com/Z3Prover/z3/archive/${P}.tar.gz"
27 SLOT="0"
28 LICENSE="MIT"
29 KEYWORDS="~amd64 ~x86"
30 -IUSE="doc gmp isabelle java python"
31 +IUSE="doc examples gmp isabelle java python"
32
33 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
34
35 @@ -27,7 +27,13 @@ DEPEND="${RDEPEND}
36 S=${WORKDIR}/${PN}-${P}
37 JAVA_SRC_DIR=${S}/src/api/java
38
39 +SO1="0"
40 +SO2="1"
41 +SOVER="${SO1}.${SO2}"
42 +
43 pkg_setup() {
44 + python_setup
45 +
46 if [[ ${MERGE_TYPE} != binary ]]; then
47 if [[ $(tc-getCXX)$ == *g++* ]] && ! tc-has-openmp; then
48 ewarn "Please use an openmp compatible compiler"
49 @@ -51,15 +57,28 @@ src_prepare() {
50 -i scripts/*mk* || die
51
52 sed \
53 - -e "s:SLIBEXTRAFLAGS = '':SLIBEXTRAFLAGS = '-Wl,-soname,lib${PN}.so.0.1':" \
54 + -e "s:SLIBEXTRAFLAGS = '':SLIBEXTRAFLAGS = '-Wl,-soname,lib${PN}.so.${SOVER}':" \
55 -i scripts/mk_util.py || die
56
57 append-ldflags -fopenmp
58 +
59 + cat <<- EOF > "${S}/src/api/python/__init__.py" || die
60 + from .z3 import *
61 +
62 + from . import z3num
63 + from . import z3poly
64 + from . import z3printer
65 + from . import z3rcf
66 + from . import z3types
67 + from . import z3util
68 +
69 + # generated files
70 + from . import z3core
71 + from . import z3consts
72 + EOF
73 }
74
75 src_configure() {
76 - python_setup
77 - python_export PYTHON_SITEDIR
78 export Z3_INSTALL_LIB_DIR="$(get_libdir)"
79 export Z3_INSTALL_INCLUDE_DIR="include/z3"
80 set -- \
81 @@ -84,11 +103,29 @@ src_install() {
82 dodir /usr/include/${PN}
83 insinto /usr/include/${PN}
84 doins src/api/z3*.h src/api/c++/z3*.h
85 - dolib.so build/*.so
86 + dolib.so build/lib${PN}.so
87 + dosym "/usr/$(get_libdir)/lib${PN}.so" \
88 + "/usr/$(get_libdir)/lib${PN}.so.${SO1}" \
89 + || die "Could not create /usr/$(get_libdir)/lib${PN}.so.${SO1} symlink"
90 + dosym "/usr/$(get_libdir)/lib${PN}.so" \
91 + "/usr/$(get_libdir)/lib${PN}.so.${SOVER}" \
92 + || die "Could not create libz3.so soname symlink"
93 dobin build/z3
94
95 + if use examples; then
96 + insinto /usr/share/${PN}/examples
97 + doins -r examples
98 + fi
99 +
100 if use python; then
101 - python_foreach_impl python_domodule src/api/python/*.py
102 + python_moduleinto "${PN}"
103 + instpybind() {
104 + python_domodule src/api/python/*.py
105 + dosym "/usr/$(get_libdir)/lib${PN}.so" \
106 + "$(python_get_sitedir)/${PN}/lib${PN}.so" \
107 + || die "Could not create $(python_get_sitedir)/lib${PN}.so symlink for python module"
108 + }
109 + python_foreach_impl instpybind
110 fi
111
112 use java && java-pkg-simple_src_install
113 @@ -96,7 +133,7 @@ src_install() {
114 if use isabelle; then
115 ISABELLE_HOME="${ROOT}usr/share/Isabelle"
116 dodir "${ISABELLE_HOME}/contrib/${PN}-${PV}/etc"
117 - cat <<- EOF >> "${S}/settings"
118 + cat <<- EOF >> "${S}/settings" || die
119 Z3_COMPONENT="\$COMPONENT"
120 Z3_HOME="${ROOT}usr/bin"
121 Z3_SOLVER="${ROOT}usr/bin/z3"
122
123 diff --git a/sci-mathematics/z3/z3-4.5.0.ebuild b/sci-mathematics/z3/z3-4.5.0.ebuild
124 index 98a18ca..fce9a72 100644
125 --- a/sci-mathematics/z3/z3-4.5.0.ebuild
126 +++ b/sci-mathematics/z3/z3-4.5.0.ebuild
127 @@ -15,7 +15,7 @@ SRC_URI="https://github.com/Z3Prover/z3/archive/${P}.tar.gz"
128 SLOT="0"
129 LICENSE="MIT"
130 KEYWORDS="~amd64 ~x86"
131 -IUSE="doc gmp isabelle java python"
132 +IUSE="doc examples gmp isabelle java python"
133
134 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
135
136 @@ -28,7 +28,13 @@ DEPEND="${RDEPEND}
137 S=${WORKDIR}/${PN}-${P}
138 JAVA_SRC_DIR=${S}/src/api/java
139
140 +SO1="0"
141 +SO2="1"
142 +SOVER="${SO1}.${SO2}"
143 +
144 pkg_setup() {
145 + python_setup
146 +
147 if [[ ${MERGE_TYPE} != binary ]]; then
148 if [[ $(tc-getCXX)$ == *g++* ]] && ! tc-has-openmp; then
149 ewarn "Please use an openmp compatible compiler"
150 @@ -51,7 +57,7 @@ src_prepare() {
151 -i scripts/*mk* || die
152
153 sed \
154 - -e "s:SLIBEXTRAFLAGS = '':SLIBEXTRAFLAGS = '-Wl,-soname,lib${PN}.so.0.1':" \
155 + -e "s:SLIBEXTRAFLAGS = '':SLIBEXTRAFLAGS = '-Wl,-soname,lib${PN}.so.${SOVER}':" \
156 -i scripts/mk_util.py || die
157
158 sed -e 's:api\\html\\ml:api/html/ml:' \
159 @@ -62,12 +68,12 @@ src_prepare() {
160 }
161
162 src_configure() {
163 - python_setup
164 + local PYTHON_SITEDIR
165 python_export PYTHON_SITEDIR
166 export Z3_INSTALL_LIB_DIR="$(get_libdir)"
167 export Z3_INSTALL_INCLUDE_DIR="include/z3"
168 set -- \
169 - --pypkgdir="${PYTHON_SITEDIR}" \
170 + --pypkgdir="${PYTHON_SITEDIR}/${PN}" \
171 --prefix="${ROOT}usr" \
172 $(usex gmp --gmp "") \
173 $(usex python --python "") \
174 @@ -101,8 +107,27 @@ src_install() {
175 LINK_FLAGS="${LDFLAGS}" \
176 install DESTDIR="${D}"
177
178 + dosym "/usr/$(get_libdir)/lib${PN}.so" \
179 + "/usr/$(get_libdir)/lib${PN}.so.${SO1}" \
180 + || die "Could not create /usr/$(get_libdir)/lib${PN}.so.${SO1} symlink"
181 + dosym "/usr/$(get_libdir)/lib${PN}.so" \
182 + "/usr/$(get_libdir)/lib${PN}.so.${SOVER}" \
183 + || die "Could not create libz3.so soname symlink"
184 +
185 + if use examples; then
186 + insinto /usr/share/${PN}/examples
187 + doins -r examples
188 + fi
189 +
190 if use python; then
191 - python_foreach_impl python_domodule src/api/python/*.py
192 + python_moduleinto "${PN}"
193 + instpybind() {
194 + python_domodule src/api/python/z3/*.py
195 + dosym "/usr/$(get_libdir)/lib${PN}.so" \
196 + "$(python_get_sitedir)/${PN}/lib${PN}.so" \
197 + || die "Could not create $(python_get_sitedir)/lib${PN}.so symlink for python module"
198 + }
199 + python_foreach_impl instpybind
200 fi
201
202 use java && java-pkg-simple_src_install
203 @@ -110,7 +135,7 @@ src_install() {
204 if use isabelle; then
205 ISABELLE_HOME="${ROOT}usr/share/Isabelle"
206 dodir "${ISABELLE_HOME}/contrib/${PN}-${PV}/etc"
207 - cat <<- EOF >> "${S}/settings"
208 + cat <<- EOF >> "${S}/settings" || die
209 Z3_COMPONENT="\$COMPONENT"
210 Z3_HOME="${ROOT}usr/bin"
211 Z3_SOLVER="${ROOT}usr/bin/z3"