on the z3 ebuilds. Thanks to David E. Narv?ez for reporting and patching.
Gentoo-bug: 602498, 602600
Package-Manager: portage-2.3.3
--- /dev/null
+DIST z3-4.4.1.tar.gz 3347371 SHA256 50967cca12c5c6e1612d0ccf8b6ebf5f99840a783d6cf5216336a2b59c37c0ce SHA512 76991a24f47f2b53ceb8d7a9a6be19913c57994ffb6cf6acfe30f61b2e73959cf02a99f656053594fccb5aaf4d1f44b3ae7e51f1c8953b213d738ceeeaea74f8 WHIRLPOOL aea616b43ae1a962cf00f4748b5a51b38586ccee393e4e27efbf806635a35af416edd6143b4cf01cf2b0df043f64ab4822f7767bb1c0a340fd57ee03627d39e5
+DIST z3-4.5.0.tar.gz 3573695 SHA256 aeae1d239c5e06ac183be7dd853775b84698db1265cb2258e5918a28372d4a0c SHA512 1ebc2c908d90b6b879f1e819c864ff894613276af47a440f27cf94968c195656952434754c3eb20f4bdbdd8497d227d22e1b4821c0d320b11052b5648d9e2dc7 WHIRLPOOL 3178973c2cce1ab3a87db134f7314d54aa5b491500c9f7c30c74d5672cb4995f7d468e62cd18d54b312d4d94fee8b1267c25d09e95075361e869bb36859810ab
--- /dev/null
+--- z3-orig/configure.in 2012-10-04 16:41:04.000000000 +1000
++++ z3/configure.in 2012-10-18 15:56:49.895967069 +1100
+@@ -22,20 +22,29 @@
+ \r
+ host_os=`uname -s`\r
+ \r
++AC_ARG_ENABLE([static],\r
++[ --disable-static disable static],\r
++[static=${enableval}], [static=yes])\r
++\r
++if test "$static" = "yes"; then\r
++ STATIC_FLAGS=-static\r
++else\r
++ STATIC_FLAGS=\r
++fi\r
++\r
+ AS_IF([test "$host_os" = "Darwin"], [\r
+ PLATFORM=osx\r
+ SO_EXT=dylib\r
+- SLIBFLAGS="-dynamiclib -fopenmp"\r
++ LDFLAGS="${LDFLAGS}"\r
++ SLIBFLAGS="${LDFLAGS} -dynamiclib -fopenmp"\r
+ COMP_VERSIONS="-compatibility_version \$(Z3_VERSION) -current_version \$(Z3_VERSION)"\r
+- STATIC_FLAGS=\r
+ CPPFLAGS+=" -mmacosx-version-min=10.4"\r
+ ], [test "$host_os" = "Linux"], [\r
+ PLATFORM=linux\r
+- SO_EXT=so\r
+- LDFLAGS=-lrt\r
+- SLIBFLAGS="-shared -fopenmp"\r
++ SO_EXT=so.1.0\r
++ LDFLAGS="${LDFLAGS} -lrt"\r
++ SLIBFLAGS="${LDFLAGS} -shared -fopenmp"\r
+ COMP_VERSIONS=\r
+- STATIC_FLAGS=-static\r
+ ], [\r
+ AC_MSG_ERROR([Unknown host platform: $host_os])\r
+ ])\r
+@@ -88,15 +97,17 @@
+ AC_CHECK_LIB(gmp, __gmpz_cmp, LIBS="-lgmp $LIBS", AC_MSG_ERROR([GMP library not found]))\r
+ dnl Look for libgmp.a at /usr/local/lib and /usr/lib\r
+ dnl TODO: make the following test more robust...\r
+- if test -e /usr/local/lib/libgmp.a; then\r
+- GMP_STATIC_LIB="/usr/local/lib/libgmp.a"\r
+- else if test -e /usr/lib/libgmp.a; then\r
+- GMP_STATIC_LIB="/usr/lib/libgmp.a"\r
+- else if test -e /usr/lib/libgmp.dll.a; then\r
+- GMP_STATIC_LIB="/usr/lib/libgmp.dll.a"\r
+- else\r
+- AC_MSG_ERROR([Failed to find libgmp.a]) \r
+- fi fi fi\r
++ if test "$static" = "yes"; then\r
++ if test -e /usr/local/lib/libgmp.a; then\r
++ GMP_STATIC_LIB="/usr/local/lib/libgmp.a"\r
++ else if test -e /usr/lib/libgmp.a; then\r
++ GMP_STATIC_LIB="/usr/lib/libgmp.a"\r
++ else if test -e /usr/lib/libgmp.dll.a; then\r
++ GMP_STATIC_LIB="/usr/lib/libgmp.dll.a"\r
++ else\r
++ AC_MSG_ERROR([Failed to find libgmp.a]) \r
++ fi fi fi\r
++ fi\r
+ fi\r
+ \r
+ AC_PROG_CXXCPP\r
+--- z3-orig/Makefile.in 2012-10-04 16:41:02.000000000 +1000
++++ z3/Makefile.in 2012-10-18 15:25:00.716162723 +1100
+@@ -175,7 +175,7 @@
+ \r
+ $(BIN_DIR)/lib$(Z3).@SO_EXT@: $(OBJ_DIR) $(BIN_DIR) $(LIB_OBJS)\r
+ @mkdir -p $(BIN_DIR)\r
+- $(CXX) -o $(BIN_DIR)/lib$(Z3).@SO_EXT@ $(LIB_OBJS) $(LIBFLAGS) $(LIBS) @COMP_VERSIONS@\r
++ $(CXX) -Wl,-soname=lib$(Z3).@SO_EXT@ -o $(BIN_DIR)/lib$(Z3).@SO_EXT@ $(LIB_OBJS) $(LIBFLAGS) $(LIBS) @COMP_VERSIONS@\r
+ \r
+ $(BIN_DIR)/lib$(Z3).a: $(OBJ_DIR) $(BIN_DIR) $(LIB_OBJS)\r
+ @mkdir -p $(BIN_DIR)\r
--- /dev/null
+diff --git a/src/util/debug.cpp b/src/util/debug.cpp
+index 54c67fe..66676c6 100644
+--- a/src/util/debug.cpp
++++ b/src/util/debug.cpp
+@@ -78,3 +78,3 @@ void invoke_gdb() {
+ char result;
+- bool ok = (std::cin >> result);
++ bool ok = bool(std::cin >> result);
+ if (!ok) exit(ERR_INTERNAL_FATAL); // happens if std::cin is eof or unattached.
+diff --git a/src/util/mpz.cpp b/src/util/mpz.cpp
+index 8559279..7dca14b 100644
+--- a/src/util/mpz.cpp
++++ b/src/util/mpz.cpp
+@@ -136,3 +136,3 @@ mpz_manager<SYNCH>::mpz_manager():
+ mpz one(1);
+- set(m_two64, UINT64_MAX);
++ set(m_two64, (uint64)UINT64_MAX);
+ add(m_two64, one, m_two64);
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>gienah@gentoo.org</email>
+ </maintainer>
+ <maintainer type="project">
+ <email>haskell@gentoo.org</email>
+ <name>Gentoo Haskell</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>sci@gentoo.org</email>
+ <name>Gentoo Science Project</name>
+ </maintainer>
+<longdescription lang='en'>
+Z3 is a high-performance theorem prover being developed at Microsoft Research.
+</longdescription>
+<use>
+ <flag name='isabelle'>Add integration support for the Isabelle/HOL
+ theorem prover.</flag>
+</use>
+</pkgmetadata>
--- /dev/null
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit flag-o-matic java-pkg-2 java-pkg-simple python-r1 toolchain-funcs
+
+DESCRIPTION="An efficient theorem prover"
+HOMEPAGE="http://z3.codeplex.com/"
+SRC_URI="https://github.com/Z3Prover/z3/archive/${P}.tar.gz"
+
+SLOT="0"
+LICENSE="MIT"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc gmp isabelle java python"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="${PYTHON_DEPS}
+ gmp? ( dev-libs/gmp:0 )"
+DEPEND="${RDEPEND}
+ java? ( >=virtual/jdk-1.8 )"
+
+S=${WORKDIR}/${PN}-${P}
+JAVA_SRC_DIR=${S}/src/api/java
+
+pkg_setup() {
+ if [[ ${MERGE_TYPE} != binary ]]; then
+ if [[ $(tc-getCXX)$ == *g++* ]] && ! tc-has-openmp; then
+ ewarn "Please use an openmp compatible compiler"
+ ewarn "like >gcc-4.2 with USE=openmp"
+ die "Openmp support missing in compiler"
+ fi
+ fi
+}
+
+src_prepare() {
+ eapply "${FILESDIR}"/${P}-gcc-6.patch
+ default
+
+ sed \
+ -e 's:-O3::g' \
+ -e 's:-fomit-frame-pointer::' \
+ -e 's:-msse2::g' \
+ -e 's:-msse::g' \
+ -e "/LINK_EXTRA_FLAGS/s:@LDFLAGS@:-lrt $(usex gmp -lgmp ""):g" \
+ -e 's:t@\$:t\$:g' \
+ -i scripts/*mk* || die
+
+ sed \
+ -e "s:SLIBEXTRAFLAGS = '':SLIBEXTRAFLAGS = '-Wl,-soname,lib${PN}.so.0.1':" \
+ -i scripts/mk_util.py || die
+
+ append-ldflags -fopenmp
+}
+
+src_configure() {
+ python_setup
+ python_export PYTHON_SITEDIR
+ export Z3_INSTALL_LIB_DIR="$(get_libdir)"
+ export Z3_INSTALL_INCLUDE_DIR="include/z3"
+ set -- \
+ $(usex gmp --gmp "") \
+ $(usex java --java "")
+ elog ./configure "$@"
+ ./configure "$@" || die
+ ${EPYTHON} scripts/mk_make.py || die
+}
+
+src_compile() {
+ emake \
+ --directory="build" \
+ CXX=$(tc-getCXX) \
+ LINK="$(tc-getCXX) ${LDFLAGS}" \
+ LINK_FLAGS="${LDFLAGS}"
+
+ use java && java-pkg-simple_src_compile
+}
+
+src_install() {
+ dodir /usr/include/${PN}
+ insinto /usr/include/${PN}
+ doins src/api/z3*.h src/api/c++/z3*.h
+ dolib.so build/*.so
+ dobin build/z3
+
+ if use python; then
+ python_foreach_impl python_domodule src/api/python/*.py
+ fi
+
+ use java && java-pkg-simple_src_install
+
+ if use isabelle; then
+ ISABELLE_HOME="${ROOT}usr/share/Isabelle"
+ dodir "${ISABELLE_HOME}/contrib/${PN}-${PV}/etc"
+ cat <<- EOF >> "${S}/settings"
+ Z3_COMPONENT="\$COMPONENT"
+ Z3_HOME="${ROOT}usr/bin"
+ Z3_SOLVER="${ROOT}usr/bin/z3"
+ Z3_REMOTE_SOLVER="z3"
+ Z3_VERSION="${PV}"
+ Z3_INSTALLED="yes"
+ Z3_NON_COMMERCIAL="yes"
+ EOF
+ insinto "${ISABELLE_HOME}/contrib/${PN}-${PV}/etc"
+ doins "${S}/settings"
+ fi
+
+ local DOCS=( "README" "RELEASE_NOTES" )
+ einstalldocs
+}
+
+pkg_postinst() {
+ if use isabelle; then
+ if [ -f "${ROOT}etc/isabelle/components" ]; then
+ if egrep "contrib/${PN}-[0-9.]*" "${ROOT}etc/isabelle/components"; then
+ sed -e "/contrib\/${PN}-[0-9.]*/d" \
+ -i "${ROOT}etc/isabelle/components"
+ fi
+ cat <<- EOF >> "${ROOT}etc/isabelle/components"
+ contrib/${PN}-${PV}
+ EOF
+ fi
+ fi
+}
+
+pkg_postrm() {
+ if use isabelle; then
+ if [ ! -f "${ROOT}usr/bin/Z3" ]; then
+ if [ -f "${ROOT}etc/isabelle/components" ]; then
+ # Note: this sed should only match the version of this ebuild
+ # Which is what we want as we do not want to remove the line
+ # of a new Isabelle component being installed during an upgrade.
+ sed -e "/contrib\/${PN}-${PV}/d" \
+ -i "${ROOT}etc/isabelle/components"
+ fi
+ fi
+ fi
+}
--- /dev/null
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit flag-o-matic java-pkg-2 java-pkg-simple python-r1 toolchain-funcs
+
+DESCRIPTION="An efficient theorem prover"
+HOMEPAGE="http://z3.codeplex.com/"
+SRC_URI="https://github.com/Z3Prover/z3/archive/${P}.tar.gz"
+
+SLOT="0"
+LICENSE="MIT"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc gmp isabelle java python"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="${PYTHON_DEPS}
+ gmp? ( dev-libs/gmp:0 )"
+DEPEND="${RDEPEND}
+ java? ( >=virtual/jdk-1.8 )"
+
+S=${WORKDIR}/${PN}-${P}
+JAVA_SRC_DIR=${S}/src/api/java
+
+pkg_setup() {
+ if [[ ${MERGE_TYPE} != binary ]]; then
+ if [[ $(tc-getCXX)$ == *g++* ]] && ! tc-has-openmp; then
+ ewarn "Please use an openmp compatible compiler"
+ ewarn "like >gcc-4.2 with USE=openmp"
+ die "Openmp support missing in compiler"
+ fi
+ fi
+}
+
+src_prepare() {
+ default
+
+ sed \
+ -e 's:-O3::g' \
+ -e 's:-fomit-frame-pointer::' \
+ -e 's:-msse2::g' \
+ -e 's:-msse::g' \
+ -e "/LINK_EXTRA_FLAGS/s:@LDFLAGS@:-lrt $(usex gmp -lgmp ""):g" \
+ -e 's:t@\$:t\$:g' \
+ -i scripts/*mk* || die
+
+ sed \
+ -e "s:SLIBEXTRAFLAGS = '':SLIBEXTRAFLAGS = '-Wl,-soname,lib${PN}.so.0.1':" \
+ -i scripts/mk_util.py || die
+
+ sed -e 's:api\\html\\ml:api/html/ml:' \
+ -e 's:python/z3.py:python/z3/z3.py:' \
+ -i doc/mk_api_doc.py || die
+
+ append-ldflags -fopenmp
+}
+
+src_configure() {
+ python_setup
+ python_export PYTHON_SITEDIR
+ export Z3_INSTALL_LIB_DIR="$(get_libdir)"
+ export Z3_INSTALL_INCLUDE_DIR="include/z3"
+ set -- \
+ --pypkgdir="${PYTHON_SITEDIR}" \
+ --prefix="${ROOT}usr" \
+ $(usex gmp --gmp "") \
+ $(usex python --python "") \
+ $(usex java --java "")
+ elog ./configure "$@"
+ ./configure "$@" || die
+ ${EPYTHON} scripts/mk_make.py || die
+}
+
+src_compile() {
+ emake \
+ --directory="build" \
+ CXX=$(tc-getCXX) \
+ LINK="$(tc-getCXX) ${LDFLAGS}" \
+ LINK_FLAGS="${LDFLAGS}"
+
+ use java && java-pkg-simple_src_compile
+
+ if use doc; then
+ pushd doc || die
+ ${EPYTHON} mk_api_doc.py || die
+ popd || die
+ fi
+}
+
+src_install() {
+ emake \
+ --directory="build" \
+ CXX=$(tc-getCXX) \
+ LINK="$(tc-getCXX) ${LDFLAGS}" \
+ LINK_FLAGS="${LDFLAGS}" \
+ install DESTDIR="${D}"
+
+ if use python; then
+ python_foreach_impl python_domodule src/api/python/*.py
+ fi
+
+ use java && java-pkg-simple_src_install
+
+ if use isabelle; then
+ ISABELLE_HOME="${ROOT}usr/share/Isabelle"
+ dodir "${ISABELLE_HOME}/contrib/${PN}-${PV}/etc"
+ cat <<- EOF >> "${S}/settings"
+ Z3_COMPONENT="\$COMPONENT"
+ Z3_HOME="${ROOT}usr/bin"
+ Z3_SOLVER="${ROOT}usr/bin/z3"
+ Z3_REMOTE_SOLVER="z3"
+ Z3_VERSION="${PV}"
+ Z3_INSTALLED="yes"
+ Z3_NON_COMMERCIAL="yes"
+ EOF
+ insinto "${ISABELLE_HOME}/contrib/${PN}-${PV}/etc"
+ doins "${S}/settings"
+ fi
+
+ local DOCS=( "README.md" "RELEASE_NOTES" )
+ local HTML_DOCS=( "doc/api/html" )
+ einstalldocs
+}
+
+pkg_postinst() {
+ if use isabelle; then
+ if [ -f "${ROOT}etc/isabelle/components" ]; then
+ if egrep "contrib/${PN}-[0-9.]*" "${ROOT}etc/isabelle/components"; then
+ sed -e "/contrib\/${PN}-[0-9.]*/d" \
+ -i "${ROOT}etc/isabelle/components"
+ fi
+ cat <<- EOF >> "${ROOT}etc/isabelle/components"
+ contrib/${PN}-${PV}
+ EOF
+ fi
+ fi
+}
+
+pkg_postrm() {
+ if use isabelle; then
+ if [ ! -f "${ROOT}usr/bin/Z3" ]; then
+ if [ -f "${ROOT}etc/isabelle/components" ]; then
+ # Note: this sed should only match the version of this ebuild
+ # Which is what we want as we do not want to remove the line
+ # of a new Isabelle component being installed during an upgrade.
+ sed -e "/contrib\/${PN}-${PV}/d" \
+ -i "${ROOT}etc/isabelle/components"
+ fi
+ fi
+ fi
+}