From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id C852C139085 for ; Sat, 28 Jan 2017 08:49:58 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0BC3E14208; Sat, 28 Jan 2017 08:49:43 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id CB83014208 for ; Sat, 28 Jan 2017 08:49:42 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 9183D34165A for ; Sat, 28 Jan 2017 08:49:41 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id F2937329C for ; Sat, 28 Jan 2017 08:49:39 +0000 (UTC) From: "Mark Wright" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mark Wright" Message-ID: <1485593357.7cea2dfa7e45f8d6fb0a0fbd5b3ff808ca25a585.gienah@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sci-mathematics/z3/ X-VCS-Repository: repo/gentoo X-VCS-Files: sci-mathematics/z3/z3-4.4.1.ebuild sci-mathematics/z3/z3-4.5.0.ebuild X-VCS-Directories: sci-mathematics/z3/ X-VCS-Committer: gienah X-VCS-Committer-Name: Mark Wright X-VCS-Revision: 7cea2dfa7e45f8d6fb0a0fbd5b3ff808ca25a585 X-VCS-Branch: master Date: Sat, 28 Jan 2017 08:49:39 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: de7c3667-2a92-4d19-befd-3d8bd7fa3344 X-Archives-Hash: 42c02f607c31f48980abe8d0fe3c2cf6 commit: 7cea2dfa7e45f8d6fb0a0fbd5b3ff808ca25a585 Author: Mark Wright gentoo org> AuthorDate: Sat Jan 28 08:48:44 2017 +0000 Commit: Mark Wright gentoo org> CommitDate: Sat Jan 28 08:49:17 2017 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7cea2dfa sci-mathematics/z3: Fix python API, thanks to Jonas Jelten for reporting. Create shared library soname symlinks. Add examples USE flag. Add || die on cat of files, except in pkg_postinst() where we want it to ignore any errors. Gentoo-Bug: 605892 Package-Manager: portage-2.3.3 sci-mathematics/z3/z3-4.4.1.ebuild | 51 ++++++++++++++++++++++++++++++++------ sci-mathematics/z3/z3-4.5.0.ebuild | 37 ++++++++++++++++++++++----- 2 files changed, 75 insertions(+), 13 deletions(-) diff --git a/sci-mathematics/z3/z3-4.4.1.ebuild b/sci-mathematics/z3/z3-4.4.1.ebuild index aacd12c..b5e329e 100644 --- a/sci-mathematics/z3/z3-4.4.1.ebuild +++ b/sci-mathematics/z3/z3-4.4.1.ebuild @@ -15,7 +15,7 @@ SRC_URI="https://github.com/Z3Prover/z3/archive/${P}.tar.gz" SLOT="0" LICENSE="MIT" KEYWORDS="~amd64 ~x86" -IUSE="doc gmp isabelle java python" +IUSE="doc examples gmp isabelle java python" REQUIRED_USE="${PYTHON_REQUIRED_USE}" @@ -27,7 +27,13 @@ DEPEND="${RDEPEND} S=${WORKDIR}/${PN}-${P} JAVA_SRC_DIR=${S}/src/api/java +SO1="0" +SO2="1" +SOVER="${SO1}.${SO2}" + pkg_setup() { + python_setup + if [[ ${MERGE_TYPE} != binary ]]; then if [[ $(tc-getCXX)$ == *g++* ]] && ! tc-has-openmp; then ewarn "Please use an openmp compatible compiler" @@ -51,15 +57,28 @@ src_prepare() { -i scripts/*mk* || die sed \ - -e "s:SLIBEXTRAFLAGS = '':SLIBEXTRAFLAGS = '-Wl,-soname,lib${PN}.so.0.1':" \ + -e "s:SLIBEXTRAFLAGS = '':SLIBEXTRAFLAGS = '-Wl,-soname,lib${PN}.so.${SOVER}':" \ -i scripts/mk_util.py || die append-ldflags -fopenmp + + cat <<- EOF > "${S}/src/api/python/__init__.py" || die + from .z3 import * + + from . import z3num + from . import z3poly + from . import z3printer + from . import z3rcf + from . import z3types + from . import z3util + + # generated files + from . import z3core + from . import z3consts + EOF } src_configure() { - python_setup - python_export PYTHON_SITEDIR export Z3_INSTALL_LIB_DIR="$(get_libdir)" export Z3_INSTALL_INCLUDE_DIR="include/z3" set -- \ @@ -84,11 +103,29 @@ src_install() { dodir /usr/include/${PN} insinto /usr/include/${PN} doins src/api/z3*.h src/api/c++/z3*.h - dolib.so build/*.so + dolib.so build/lib${PN}.so + dosym "/usr/$(get_libdir)/lib${PN}.so" \ + "/usr/$(get_libdir)/lib${PN}.so.${SO1}" \ + || die "Could not create /usr/$(get_libdir)/lib${PN}.so.${SO1} symlink" + dosym "/usr/$(get_libdir)/lib${PN}.so" \ + "/usr/$(get_libdir)/lib${PN}.so.${SOVER}" \ + || die "Could not create libz3.so soname symlink" dobin build/z3 + if use examples; then + insinto /usr/share/${PN}/examples + doins -r examples + fi + if use python; then - python_foreach_impl python_domodule src/api/python/*.py + python_moduleinto "${PN}" + instpybind() { + python_domodule src/api/python/*.py + dosym "/usr/$(get_libdir)/lib${PN}.so" \ + "$(python_get_sitedir)/${PN}/lib${PN}.so" \ + || die "Could not create $(python_get_sitedir)/lib${PN}.so symlink for python module" + } + python_foreach_impl instpybind fi use java && java-pkg-simple_src_install @@ -96,7 +133,7 @@ src_install() { if use isabelle; then ISABELLE_HOME="${ROOT}usr/share/Isabelle" dodir "${ISABELLE_HOME}/contrib/${PN}-${PV}/etc" - cat <<- EOF >> "${S}/settings" + cat <<- EOF >> "${S}/settings" || die Z3_COMPONENT="\$COMPONENT" Z3_HOME="${ROOT}usr/bin" Z3_SOLVER="${ROOT}usr/bin/z3" diff --git a/sci-mathematics/z3/z3-4.5.0.ebuild b/sci-mathematics/z3/z3-4.5.0.ebuild index 98a18ca..fce9a72 100644 --- a/sci-mathematics/z3/z3-4.5.0.ebuild +++ b/sci-mathematics/z3/z3-4.5.0.ebuild @@ -15,7 +15,7 @@ SRC_URI="https://github.com/Z3Prover/z3/archive/${P}.tar.gz" SLOT="0" LICENSE="MIT" KEYWORDS="~amd64 ~x86" -IUSE="doc gmp isabelle java python" +IUSE="doc examples gmp isabelle java python" REQUIRED_USE="${PYTHON_REQUIRED_USE}" @@ -28,7 +28,13 @@ DEPEND="${RDEPEND} S=${WORKDIR}/${PN}-${P} JAVA_SRC_DIR=${S}/src/api/java +SO1="0" +SO2="1" +SOVER="${SO1}.${SO2}" + pkg_setup() { + python_setup + if [[ ${MERGE_TYPE} != binary ]]; then if [[ $(tc-getCXX)$ == *g++* ]] && ! tc-has-openmp; then ewarn "Please use an openmp compatible compiler" @@ -51,7 +57,7 @@ src_prepare() { -i scripts/*mk* || die sed \ - -e "s:SLIBEXTRAFLAGS = '':SLIBEXTRAFLAGS = '-Wl,-soname,lib${PN}.so.0.1':" \ + -e "s:SLIBEXTRAFLAGS = '':SLIBEXTRAFLAGS = '-Wl,-soname,lib${PN}.so.${SOVER}':" \ -i scripts/mk_util.py || die sed -e 's:api\\html\\ml:api/html/ml:' \ @@ -62,12 +68,12 @@ src_prepare() { } src_configure() { - python_setup + local PYTHON_SITEDIR python_export PYTHON_SITEDIR export Z3_INSTALL_LIB_DIR="$(get_libdir)" export Z3_INSTALL_INCLUDE_DIR="include/z3" set -- \ - --pypkgdir="${PYTHON_SITEDIR}" \ + --pypkgdir="${PYTHON_SITEDIR}/${PN}" \ --prefix="${ROOT}usr" \ $(usex gmp --gmp "") \ $(usex python --python "") \ @@ -101,8 +107,27 @@ src_install() { LINK_FLAGS="${LDFLAGS}" \ install DESTDIR="${D}" + dosym "/usr/$(get_libdir)/lib${PN}.so" \ + "/usr/$(get_libdir)/lib${PN}.so.${SO1}" \ + || die "Could not create /usr/$(get_libdir)/lib${PN}.so.${SO1} symlink" + dosym "/usr/$(get_libdir)/lib${PN}.so" \ + "/usr/$(get_libdir)/lib${PN}.so.${SOVER}" \ + || die "Could not create libz3.so soname symlink" + + if use examples; then + insinto /usr/share/${PN}/examples + doins -r examples + fi + if use python; then - python_foreach_impl python_domodule src/api/python/*.py + python_moduleinto "${PN}" + instpybind() { + python_domodule src/api/python/z3/*.py + dosym "/usr/$(get_libdir)/lib${PN}.so" \ + "$(python_get_sitedir)/${PN}/lib${PN}.so" \ + || die "Could not create $(python_get_sitedir)/lib${PN}.so symlink for python module" + } + python_foreach_impl instpybind fi use java && java-pkg-simple_src_install @@ -110,7 +135,7 @@ src_install() { if use isabelle; then ISABELLE_HOME="${ROOT}usr/share/Isabelle" dodir "${ISABELLE_HOME}/contrib/${PN}-${PV}/etc" - cat <<- EOF >> "${S}/settings" + cat <<- EOF >> "${S}/settings" || die Z3_COMPONENT="\$COMPONENT" Z3_HOME="${ROOT}usr/bin" Z3_SOLVER="${ROOT}usr/bin/z3"