Gentoo Archives: gentoo-commits

From: Justin Lecher <jlec@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/sci:master commit in: sci-mathematics/z3/
Date: Mon, 02 Dec 2013 16:21:45
Message-Id: 1386001016.d5bc424a65eca8d0a8097971559084c66ff42a14.jlec@gentoo
1 commit: d5bc424a65eca8d0a8097971559084c66ff42a14
2 Author: Justin Lecher <jlec <AT> gentoo <DOT> org>
3 AuthorDate: Mon Dec 2 16:16:56 2013 +0000
4 Commit: Justin Lecher <jlec <AT> gentoo <DOT> org>
5 CommitDate: Mon Dec 2 16:16:56 2013 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=d5bc424a
7
8 sci-mathematics/z3: Make build verbose; respect CXX, CXXFLAGS, LDFLAGS; use EPYTHON instead of a direct python call; check for openmp compatibility of the c++ compiler; add USE=gmp; drop unnecessary eclass; add missing metadata.xml
9
10 Package-Manager: portage-2.2.7
11
12 ---
13 sci-mathematics/z3/ChangeLog | 10 +++++++
14 sci-mathematics/z3/metadata.xml | 5 ++++
15 sci-mathematics/z3/z3-4.3.1.ebuild | 47 ++++++++++++++++++++++++------
16 sci-mathematics/z3/z3-9999.ebuild | 59 +++++++++++++++++++++++++++++++-------
17 4 files changed, 103 insertions(+), 18 deletions(-)
18
19 diff --git a/sci-mathematics/z3/ChangeLog b/sci-mathematics/z3/ChangeLog
20 new file mode 100644
21 index 0000000..a078c2a
22 --- /dev/null
23 +++ b/sci-mathematics/z3/ChangeLog
24 @@ -0,0 +1,10 @@
25 +# ChangeLog for sci-mathematics/z3
26 +# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
27 +# $Header: $
28 +
29 + 02 Dec 2013; Justin Lecher <jlec@g.o> z3-4.3.1.ebuild, z3-9999.ebuild,
30 + +metadata.xml:
31 + Make build verbose; respect CXX, CXXFLAGS, LDFLAGS; use EPYTHON instead of a
32 + direct python call; check for openmp compatibility of the c++ compiler; add
33 + USE=gmp; drop unnecessary eclass; add missing metadata.xml
34 +
35
36 diff --git a/sci-mathematics/z3/metadata.xml b/sci-mathematics/z3/metadata.xml
37 new file mode 100644
38 index 0000000..897aa2e
39 --- /dev/null
40 +++ b/sci-mathematics/z3/metadata.xml
41 @@ -0,0 +1,5 @@
42 +<?xml version="1.0" encoding="UTF-8"?>
43 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
44 +<pkgmetadata>
45 + <herd>sci</herd>
46 +</pkgmetadata>
47
48 diff --git a/sci-mathematics/z3/z3-4.3.1.ebuild b/sci-mathematics/z3/z3-4.3.1.ebuild
49 index 749e8e0..adf4f6e 100644
50 --- a/sci-mathematics/z3/z3-4.3.1.ebuild
51 +++ b/sci-mathematics/z3/z3-4.3.1.ebuild
52 @@ -6,7 +6,7 @@ EAPI=5
53
54 PYTHON_COMPAT=( python2_7 )
55
56 -inherit autotools python-r1 vcs-snapshot
57 +inherit autotools flag-o-matic python-r1 toolchain-funcs vcs-snapshot
58
59 DESCRIPTION="An efficient theorem prover"
60 HOMEPAGE="http://z3.codeplex.com/"
61 @@ -15,28 +15,59 @@ SRC_URI="http://dev.gentoo.org/~jlec/distfiles/${P}.tar.xz"
62 SLOT="0"
63 LICENSE="MSR-LA"
64 KEYWORDS="~amd64 ~x86"
65 -IUSE=""
66 +IUSE="gmp"
67
68 -RDEPEND="${PYTHON_DEPS}"
69 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
70 +
71 +RDEPEND="${PYTHON_DEPS}
72 + gmp? ( dev-libs/gmp )"
73 DEPEND="${RDEPEND}"
74
75 +pkg_setup() {
76 + if [[ ${MERGE_TYPE} != binary ]]; then
77 + if [[ $(tc-getCXX)$ == *g++* ]] && ! tc-has-openmp; then
78 + ewarn "Please use an openmp compatible compiler"
79 + ewarn "like >gcc-4.2 with USE=openmp"
80 + die "Openmp support missing in compiler"
81 + fi
82 + fi
83 +}
84 +
85 src_prepare() {
86 + sed \
87 + -e 's:-O3::g' \
88 + -e 's:-fomit-frame-pointer::' \
89 + -e 's:-msse2::g' \
90 + -e 's:-msse::g' \
91 + -e "/LINK_EXTRA_FLAGS/s:@LDFLAGS@:-lrt $(usex gmp -lgmp):g" \
92 + -e 's:t@\$:t\$:g' \
93 + -i scripts/*mk* || die
94 +
95 + append-ldflags -fopenmp
96 +
97 eautoreconf
98 }
99
100 src_configure() {
101 python_export_best
102 - econf --host="" --with-python="${PYTHON}"
103 - python2 scripts/mk_make.py
104 + econf \
105 + --host="" \
106 + --with-python="${PYTHON}" \
107 + $(use_with gmp) \
108 + SLIBFLAGS=" -Wl,-soname,lib${PN}.so.0.1 "
109 + ${EPYTHON} scripts/mk_make.py || die
110 }
111
112 src_compile() {
113 - emake --directory="build"
114 + emake \
115 + --directory="build" \
116 + CXX=$(tc-getCXX) \
117 + LINK="$(tc-getCXX) ${LDFLAGS}" \
118 + LINK_FLAGS="${LDFLAGS}"
119 }
120
121 src_install() {
122 - doheader src/api/z3*.h
123 - doheader src/api/c++/z3*.h
124 + doheader src/api/z3*.h src/api/c++/z3*.h
125 dolib.so build/*.so
126 dobin build/z3
127
128
129 diff --git a/sci-mathematics/z3/z3-9999.ebuild b/sci-mathematics/z3/z3-9999.ebuild
130 index 434e866..15c338b 100644
131 --- a/sci-mathematics/z3/z3-9999.ebuild
132 +++ b/sci-mathematics/z3/z3-9999.ebuild
133 @@ -1,40 +1,79 @@
134 +# Copyright 1999-2013 Gentoo Foundation
135 +# Distributed under the terms of the GNU General Public License v2
136 +# $Header: $
137 +
138 EAPI=5
139
140 PYTHON_COMPAT=( python2_7 )
141
142 -inherit eutils git-r3 autotools python-r1
143 +inherit autotools flag-o-matic git-r3 python-r1 toolchain-funcs
144
145 DESCRIPTION="An efficient theorem prover"
146 HOMEPAGE="http://z3.codeplex.com/"
147 +SRC_URI=""
148 EGIT_REPO_URI="https://git01.codeplex.com/z3"
149 -EGIT_NONSHALLOW=1
150 -KEYWORDS=""
151
152 SLOT="0"
153 -IUSE=""
154 +LICENSE="MSR-LA"
155 +KEYWORDS=""
156 +IUSE="gmp"
157 +
158 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
159 +
160 +RDEPEND="${PYTHON_DEPS}
161 + gmp? ( dev-libs/gmp )"
162 # A new curl is needed because codeplex has a bug and early version of libcurl
163 # will cause a failed git clone.
164 -RDEPEND="${PYTHON_DEPS}"
165 DEPEND="${RDEPEND}
166 >=net-misc/curl-7.33"
167
168 +EGIT_NONSHALLOW=1
169 +
170 +pkg_setup() {
171 + if [[ ${MERGE_TYPE} != binary ]]; then
172 + if [[ $(tc-getCXX)$ == *g++* ]] && ! tc-has-openmp; then
173 + ewarn "Please use an openmp compatible compiler"
174 + ewarn "like >gcc-4.2 with USE=openmp"
175 + die "Openmp support missing in compiler"
176 + fi
177 + fi
178 +}
179 +
180 src_prepare() {
181 + sed \
182 + -e 's:-O3::g' \
183 + -e 's:-fomit-frame-pointer::' \
184 + -e 's:-msse2::g' \
185 + -e 's:-msse::g' \
186 + -e "/LINK_EXTRA_FLAGS/s:@LDFLAGS@:-lrt $(usex gmp -lgmp):g" \
187 + -e 's:t@\$:t\$:g' \
188 + -i scripts/*mk* || die
189 +
190 + append-ldflags -fopenmp
191 +
192 eautoreconf
193 }
194
195 src_configure() {
196 python_export_best
197 - econf --host="" --with-python="${PYTHON}"
198 - python2 scripts/mk_make.py
199 + econf \
200 + --host="" \
201 + --with-python="${PYTHON}" \
202 + $(use_with gmp) \
203 + SLIBFLAGS=" -Wl,-soname,lib${PN}.so.0.1 "
204 + ${EPYTHON} scripts/mk_make.py || die
205 }
206
207 src_compile() {
208 - emake --directory="build"
209 + emake \
210 + --directory="build" \
211 + CXX=$(tc-getCXX) \
212 + LINK="$(tc-getCXX) ${LDFLAGS}" \
213 + LINK_FLAGS="${LDFLAGS}"
214 }
215
216 src_install() {
217 - doheader src/api/z3*.h
218 - doheader src/api/c++/z3*.h
219 + doheader src/api/z3*.h src/api/c++/z3*.h
220 dolib.so build/*.so
221 dobin build/z3