Gentoo Archives: gentoo-commits

From: David Seifert <soap@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-mathematics/cvc3/
Date: Sat, 29 Oct 2016 22:30:44
Message-Id: 1477780182.6ba8a2fb02fc8056a10a787d789124f4aa69110e.soap@gentoo
1 commit: 6ba8a2fb02fc8056a10a787d789124f4aa69110e
2 Author: Matthew Dawson <matthew <AT> mjdsystems <DOT> ca>
3 AuthorDate: Mon Oct 17 03:09:19 2016 +0000
4 Commit: David Seifert <soap <AT> gentoo <DOT> org>
5 CommitDate: Sat Oct 29 22:29:42 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6ba8a2fb
7
8 sci-mathematics/cvc3: Bump EAPI to 6
9
10 Make sure to call default in src_prepare, and switch
11 to new einstalldocs for the HTML documentation.
12
13 Package-Manager: portage-2.2.28
14 Closes: https://github.com/gentoo/gentoo/pull/2575
15
16 Signed-off-by: David Seifert <soap <AT> gentoo.org>
17
18 sci-mathematics/cvc3/cvc3-2.4.1-r1.ebuild | 140 ++++++++++++++++++++++++++++++
19 1 file changed, 140 insertions(+)
20
21 diff --git a/sci-mathematics/cvc3/cvc3-2.4.1-r1.ebuild b/sci-mathematics/cvc3/cvc3-2.4.1-r1.ebuild
22 new file mode 100644
23 index 00000000..8531710
24 --- /dev/null
25 +++ b/sci-mathematics/cvc3/cvc3-2.4.1-r1.ebuild
26 @@ -0,0 +1,140 @@
27 +# Copyright 1999-2016 Gentoo Foundation
28 +# Distributed under the terms of the GNU General Public License v2
29 +# $Id$
30 +
31 +EAPI=6
32 +
33 +inherit elisp-common
34 +
35 +DESCRIPTION="CVC3 is a theorem prover for Satisfiability Modulo Theories (SMT) problems"
36 +HOMEPAGE="http://www.cs.nyu.edu/acsys/cvc3/index.html"
37 +SRC_URI="http://www.cs.nyu.edu/acsys/cvc3/releases/2.4.1/${P}.tar.gz"
38 +
39 +LICENSE="BSD MIT HPND zchaff? ( zchaff )"
40 +RESTRICT="mirror zchaff? ( bindist )"
41 +SLOT="0/${PV}"
42 +KEYWORDS="~amd64 ~x86"
43 +IUSE="doc emacs isabelle test zchaff"
44 +
45 +RDEPEND="dev-libs/gmp:0=
46 + isabelle? ( >=sci-mathematics/isabelle-2011.1-r1:= )"
47 +DEPEND="${RDEPEND}
48 + doc? (
49 + app-doc/doxygen
50 + media-gfx/graphviz
51 + )
52 + emacs? (
53 + virtual/emacs
54 + )"
55 +
56 +SITEFILE="50${PN}-gentoo.el"
57 +
58 +src_prepare() {
59 + default
60 +
61 + sed -e 's#prefix=@prefix@#prefix=$(patsubst %/,%,$(DESTDIR))@prefix@#' \
62 + -e 's#libdir=@libdir@#libdir=$(patsubst %/,%,$(DESTDIR))@libdir@#' \
63 + -e 's#mandir=@mandir@#mandir=$(patsubst %/,%,$(DESTDIR))@mandir@#' \
64 + -i "${S}/Makefile.local.in" \
65 + || die "Could not set DESTDIR in Makefile.local.in"
66 +}
67 +
68 +src_configure() {
69 + # --enable-static disables building of shared libraries, statically
70 + # links /usr/bin/cvc3 and installs static libraries.
71 + # --enable-static --enable-sharedlibs behaves the same as just --enable-static
72 + econf \
73 + --enable-dynamic \
74 + $(use_enable zchaff)
75 +
76 + if use test; then
77 + sed -e 's@LD_LIBS = @LD_LIBS = -L'"${S}"'/lib -Wl,-R'"${S}"'/lib @' \
78 + -i "${S}/test/Makefile" \
79 + || die "Could not set library paths in test/Makefile"
80 + fi
81 +}
82 +
83 +src_compile() {
84 + emake
85 +
86 + use doc && emake -C doc
87 +
88 + if use emacs; then
89 + pushd emacs >/dev/null || die
90 + elisp-compile *.el || die "emacs elisp compile failed"
91 + popd >/dev/null || die
92 + fi
93 +
94 + use test && emake -C test
95 +}
96 +
97 +src_test() {
98 + pushd test >/dev/null || die
99 + ./bin/test || die "Testsuite failed"
100 + popd >/dev/null || die
101 +}
102 +
103 +src_install() {
104 + use doc && local HTML_DOCS=( doc/html/*.{html,gif,png,css} )
105 + default
106 +
107 + if use emacs; then
108 + elisp-install ${PN} emacs/*.{el,elc}
109 + cp "${FILESDIR}"/${SITEFILE} "${S}" || die "Failed to copy Emacs files"
110 + elisp-site-file-install ${SITEFILE}
111 + fi
112 +
113 + if use isabelle; then
114 + ISABELLE_HOME="$(isabelle getenv ISABELLE_HOME | cut -d'=' -f 2)" \
115 + || die "isabelle getenv ISABELLE_HOME failed"
116 + [[ -n "${ISABELLE_HOME}" ]] || die "ISABELLE_HOME empty"
117 + dodir "${ISABELLE_HOME}/contrib/${PN}-${PV}/etc"
118 + cat >> settings <<- EOF || die "Failed to create Isabelle configuration for CVC3"
119 + CVC3_COMPONENT="\$COMPONENT"
120 + CVC3_HOME="${EPREFIX}/usr/bin"
121 + CVC3_SOLVER="\$CVC3_HOME/cvc3"
122 + CVC3_REMOTE_SOLVER="cvc3"
123 + CVC3_INSTALLED="yes"
124 + EOF
125 + insinto "${ISABELLE_HOME}/contrib/${PN}-${PV}/etc"
126 + doins settings
127 + fi
128 +}
129 +
130 +pkg_postinst() {
131 + use emacs && elisp-site-regen
132 + if use isabelle; then
133 + if [[ -f "${EROOT%/}/etc/isabelle/components" ]]; then
134 + if egrep "contrib/${PN}-[0-9.]*" "${EROOT%/}/etc/isabelle/components"; then
135 + sed -e "/contrib\/${PN}-[0-9.]*/d" \
136 + -i "${EROOT%/}/etc/isabelle/components" || die "Failed to remove old CVC3 registrations in Isabelle"
137 + fi
138 + cat >> "${EROOT%/}/etc/isabelle/components" <<- EOF || die "Failed to register CVC3 with Isabelle"
139 + contrib/${PN}-${PV}
140 + EOF
141 + fi
142 + fi
143 + if use zchaff; then
144 + einfo "This copy of CVC3 is also configured to use the SAT solver zchaff whose"
145 + einfo "copyright is owned by Princeton University and is more restrictive."
146 + einfo "Specifically, it may be used for internal, noncommercial, research purposes"
147 + einfo "only. See the copyright notices from the zchaff source files which are"
148 + einfo "included in the LICENSE file."
149 + einfo "To build CVC3 without these files, please build cvc3 without the zchaff"
150 + einfo "use flag (note: zchaff is disabled by default):"
151 + einfo "USE=-zchaff emerge sci-mathemathematics/cvc3"
152 + fi
153 +}
154 +
155 +pkg_postrm() {
156 + use emacs && elisp-site-regen
157 + if use isabelle; then
158 + if [[ ! -f "${EROOT%/}/usr/bin/cvc3" && -f "${EROOT%/}/etc/isabelle/components" ]]; then
159 + # Note: this sed should only match the version of this ebuild
160 + # Which is what we want as we do not want to remove the line
161 + # of a new CVC3 being installed during an upgrade.
162 + sed -e "/contrib\/${PN}-${PV}/d" \
163 + -i "${EROOT%/}/etc/isabelle/components" || die "Failed to unregister CVC3 from Isabelle"
164 + fi
165 + fi
166 +}