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/kodkod/
Date: Mon, 02 Jan 2017 22:52:55
Message-Id: 1483397555.9d42d1b6bb6bcba7e6617511ae617cef326fd851.gienah@gentoo
1 commit: 9d42d1b6bb6bcba7e6617511ae617cef326fd851
2 Author: Mark Wright <gienah <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jan 2 22:52:35 2017 +0000
4 Commit: Mark Wright <gienah <AT> gentoo <DOT> org>
5 CommitDate: Mon Jan 2 22:52:35 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9d42d1b6
7
8 sci-mathematics/kodkod: Fix get_libdir called in global scope, thanks to
9
10 mgorny for reporting.
11
12 Gentoo-bug: 593380
13
14 Package-Manager: portage-2.3.3
15
16 sci-mathematics/kodkod/kodkod-1.5.2-r1.ebuild | 141 ++++++++++++++++++++++++++
17 1 file changed, 141 insertions(+)
18
19 diff --git a/sci-mathematics/kodkod/kodkod-1.5.2-r1.ebuild b/sci-mathematics/kodkod/kodkod-1.5.2-r1.ebuild
20 new file mode 100644
21 index 00000000..a63600c
22 --- /dev/null
23 +++ b/sci-mathematics/kodkod/kodkod-1.5.2-r1.ebuild
24 @@ -0,0 +1,141 @@
25 +# Copyright 1999-2017 Gentoo Foundation
26 +# Distributed under the terms of the GNU General Public License v2
27 +# $Id$
28 +
29 +EAPI="6"
30 +
31 +JAVA_PKG_IUSE="doc source"
32 +PYTHON_COMPAT=( python2_7 )
33 +PYTHON_REQ_USE='threads(+)'
34 +
35 +inherit eutils java-pkg-2 python-any-r1 waf-utils
36 +
37 +DESCRIPTION="a constraint solver for relational logic"
38 +HOMEPAGE="http://alloy.mit.edu/kodkod/index.html"
39 +SRC_URI="http://alloy.mit.edu/kodkod/${PV}/${P}.zip
40 + https://waf.googlecode.com/files/waf-1.7.16"
41 +LICENSE="MIT"
42 +SLOT="0/${PV}"
43 +KEYWORDS="~amd64 ~x86"
44 +IUSE=""
45 +
46 +COMMON_DEP=""
47 +RDEPEND="${COMMON_DEP}
48 + >=virtual/jre-1.6"
49 +DEPEND="${COMMON_DEP}
50 + >=virtual/jdk-1.6
51 + app-arch/unzip"
52 +
53 +S="${WORKDIR}/kodkod-1.5"
54 +
55 +JAVA_SRC_DIR="src"
56 +
57 +pkg_setup() {
58 + python-any-r1_pkg_setup
59 + java-pkg-2_pkg_setup
60 +}
61 +
62 +src_unpack() {
63 + unpack "${A% *}"
64 + cp "${DISTDIR}/${A#* }" "${S}/waf" || die "Could not copy waf"
65 +}
66 +
67 +src_prepare() {
68 + java-pkg-2_src_prepare
69 + chmod u+x waf \
70 + || die "Could not set execute permisions on waf file"
71 + sed -e 's@private N parent, left, right@protected N parent, left, right@' \
72 + -e 's@private boolean color@protected boolean color@' \
73 + -i "${S}/src/kodkod/util/ints/IntTree.java" \
74 + || die "Could not change private to protected in IntTree.java"
75 + sed -e 's@××××××××.LINKFLAGS =@conf.env.LINKFLAGS +=@' \
76 + -i "${S}/lib/cryptominisat-2.9.1/wscript" \
77 + -i "${S}/lib/lingeling-276/wscript" \
78 + || die "Could not fix wscripts to respect LDFLAGS"
79 + # Fix bug 453162 - sci-mathematics/kodkod-1.5.2: fails to build
80 + epatch "${FILESDIR}/${PN}-1.5.2-changes-in-most-specific-varargs-method-selection.patch"
81 +
82 + # Fix Bug 458462 sci-mathematics/kodkod-1.5.2: fails to build with JAVA_PKG_STRICT
83 + local x=""
84 + for i in $JAVACFLAGS
85 + do
86 + if [ "${x}" == "" ]; then
87 + x="'${i}'"
88 + else
89 + x="${x}, '${i}'"
90 + fi
91 + done
92 + for j in $(find . -name wscript -print)
93 + do
94 + sed -e "s@def configure(conf):@def configure(conf):\n conf.env.JAVACFLAGS = [${x}]@" \
95 + -i "${j}" \
96 + || die "Could not set JAVACFLAGS in ${j}"
97 + done
98 +}
99 +
100 +# note: kodkod waf fails when passed --libdir:
101 +# waf: error: no such option: --libdir
102 +src_configure() {
103 + ${WAF_BINARY:="${S}/waf"}
104 +
105 + tc-export AR CC CPP CXX RANLIB
106 + echo "CCFLAGS=\"${CFLAGS}\" LINKFLAGS=\"${LDFLAGS}\" \"${WAF_BINARY}\" --prefix=${EPREFIX}/usr $@ configure"
107 +
108 + CCFLAGS="${CFLAGS}" LINKFLAGS="${LDFLAGS}" "${WAF_BINARY}" \
109 + "--prefix=${EPREFIX}/usr" \
110 + "$@" \
111 + configure || die "configure failed"
112 +}
113 +
114 +src_compile() {
115 + waf-utils_src_compile
116 + if has doc ${JAVA_PKG_IUSE} && use doc; then
117 + pushd src/kodkod || die "Could not cd to src/kodkod"
118 + local doclint="-Xdoclint:none"
119 + local jv="$(javac -version 2>&1 | cut -d' ' -f 2)"
120 + if [[ "${jv}" == 1.6* ]] || [[ "${jv}" == 1.7* ]]; then
121 + doclint=""
122 + fi
123 + javadoc ${doclint} -sourcepath "${S}"/src/kodkod:"${S}"/build/src/kodkod \
124 + -classpath $(find "${PWD}" -name \*.jar -print | xargs | sed -e 's@ @:@g') \
125 + $(find . -name \*.java -print) \
126 + || die "javadoc failed"
127 + popd
128 + fi
129 +}
130 +
131 +src_install() {
132 + insinto "/usr/"$(get_libdir)
133 + dodir "/usr/"$(get_libdir)"/${PN}"
134 + exeinto "/usr/"$(get_libdir)"/${PN}"
135 + for i in $(find . \( -name \*.so -o -name plingeling \) -print | xargs); do
136 + doexe $i
137 + done
138 +
139 + for i in $(find . \( -name kodkod.jar -o -name org.sat4j.core.jar \) -print | xargs); do
140 + einfo "java-pkg_dojar $i"
141 + java-pkg_dojar $i
142 + done
143 +
144 + # javadoc
145 + if has doc ${JAVA_PKG_IUSE} && use doc; then
146 + java-pkg_dojavadoc src/kodkod
147 + fi
148 +
149 + # dosrc
150 + if has source ${JAVA_PKG_IUSE} && use source; then
151 + local srcdirs=""
152 + if [[ ${JAVA_SRC_DIR} ]]; then
153 + local parent child
154 + for parent in ${JAVA_SRC_DIR}; do
155 + for child in ${parent}/*; do
156 + srcdirs="${srcdirs} ${child}"
157 + done
158 + done
159 + else
160 + # take all directories actually containing any sources
161 + srcdirs="$(cut -d/ -f1 ${sources} | sort -u)"
162 + fi
163 + java-pkg_dosrc ${srcdirs}
164 + fi
165 +}