Gentoo Archives: gentoo-commits

From: "Sebastien Fabbro (bicatali)" <bicatali@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-java/antlr: ChangeLog antlr-2.7.7-r5.ebuild
Date: Thu, 22 Dec 2011 19:39:15
Message-Id: 20111222193855.3381D2004B@flycatcher.gentoo.org
1 bicatali 11/12/22 19:38:55
2
3 Modified: ChangeLog
4 Added: antlr-2.7.7-r5.ebuild
5 Log:
6 Fixed wrong linking (CC instead of CXX) which caused as-needed failures. Switched to EAPI4. Ebuild cleanup.
7
8 (Portage version: 2.1.10.41/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.91 dev-java/antlr/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-java/antlr/ChangeLog?rev=1.91&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-java/antlr/ChangeLog?rev=1.91&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-java/antlr/ChangeLog?r1=1.90&r2=1.91
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/dev-java/antlr/ChangeLog,v
20 retrieving revision 1.90
21 retrieving revision 1.91
22 diff -u -r1.90 -r1.91
23 --- ChangeLog 19 Oct 2011 01:42:15 -0000 1.90
24 +++ ChangeLog 22 Dec 2011 19:38:55 -0000 1.91
25 @@ -1,6 +1,12 @@
26 # ChangeLog for dev-java/antlr
27 # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/dev-java/antlr/ChangeLog,v 1.90 2011/10/19 01:42:15 fordfrog Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/dev-java/antlr/ChangeLog,v 1.91 2011/12/22 19:38:55 bicatali Exp $
30 +
31 +*antlr-2.7.7-r5 (22 Dec 2011)
32 +
33 + 22 Dec 2011; Sébastien Fabbro <bicatali@g.o> +antlr-2.7.7-r5.ebuild:
34 + Fixed wrong linking (CC instead of CXX) which caused as-needed failures.
35 + Switched to EAPI4. Ebuild cleanup.
36
37 *antlr-2.7.7-r4 (19 Oct 2011)
38
39
40
41
42 1.1 dev-java/antlr/antlr-2.7.7-r5.ebuild
43
44 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-java/antlr/antlr-2.7.7-r5.ebuild?rev=1.1&view=markup
45 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-java/antlr/antlr-2.7.7-r5.ebuild?rev=1.1&content-type=text/plain
46
47 Index: antlr-2.7.7-r5.ebuild
48 ===================================================================
49 # Copyright 1999-2011 Gentoo Foundation
50 # Distributed under the terms of the GNU General Public License v2
51 # $Header: /var/cvsroot/gentoo-x86/dev-java/antlr/antlr-2.7.7-r5.ebuild,v 1.1 2011/12/22 19:38:55 bicatali Exp $
52
53 EAPI=4
54 PYTHON_DEPEND="python? 2"
55
56 inherit base java-pkg-2 mono distutils multilib toolchain-funcs versionator
57
58 DESCRIPTION="A parser generator for C++, C#, Java, and Python"
59 HOMEPAGE="http://www.antlr2.org/"
60 SRC_URI="http://www.antlr2.org/download/${P}.tar.gz"
61
62 LICENSE="ANTLR"
63 SLOT="0"
64 KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
65 IUSE="doc debug examples mono +cxx +java python script source static-libs"
66
67 # TODO do we actually need jdk at runtime?
68 RDEPEND=">=virtual/jdk-1.3
69 mono? ( dev-lang/mono )"
70 DEPEND="${RDEPEND}
71 script? ( !dev-util/pccts )
72 source? ( app-arch/zip )"
73
74 PATCHES=( "${FILESDIR}"/${PV}-{gcc-4.3,gcc-4.4,makefixes}.patch )
75
76 make_shared_lib() {
77 local soname=$(basename "${1%.a}")$(get_libname $(get_major_version))
78 einfo "Making ${soname}"
79 [[ ${CHOST} == *-darwin* ]] \
80 && make_shared_lib_macho "${soname}" "$1" "$2"\
81 || make_shared_lib_elf "${soname}" "$1" "$2"
82 }
83
84 make_shared_lib_elf() {
85 local soname=$1 archive=$2 cc=$3
86 ${cc:-$(tc-getCXX)} ${LDFLAGS} \
87 -shared -Wl,-soname="${soname}" \
88 -Wl,--whole-archive "${archive}" -Wl,--no-whole-archive \
89 -o $(dirname "${archive}")/"${soname}" || return 1
90 }
91
92 make_shared_lib_macho() {
93 local soname=$1 archive=$2 cc=$3
94 ${cc:-$(tc-getCXX)} ${LDFLAGS} \
95 -dynamiclib -install_name "${EPREFIX}/usr/$(get_libdir)/${soname}" \
96 -force_load "${archive}" \
97 -o $(dirname "${archive}")/"${soname}" || return 1
98 }
99
100 pkg_setup() {
101 java-pkg-2_pkg_setup
102
103 if use python; then
104 python_set_active_version 2
105 python_pkg_setup
106 fi
107 }
108
109 src_prepare() {
110 base_src_prepare
111 sed -i \
112 -e 's/install:.*this-install/install:/' \
113 lib/cpp/src/Makefile.in || die
114
115 use static-libs || epatch "${FILESDIR}/${PV}-static-libs-fix.patch"
116 }
117
118 src_configure() {
119 # don't ask why, but this is needed for stuff to get built properly
120 # across the various JDKs
121 JAVACFLAGS="+ ${JAVACFLAGS}"
122
123 # mcs for https://bugs.gentoo.org/show_bug.cgi?id=172104
124 CSHARPC="mcs" econf $(use_enable java) \
125 $(use_enable python) \
126 $(use_enable mono csharp) \
127 $(use_enable debug) \
128 $(use_enable examples) \
129 $(use_enable cxx) \
130 --enable-verbose
131 }
132
133 src_compile() {
134 emake CXXFLAGS="${CXXFLAGS} -fPIC"
135 if use cxx; then
136 pushd lib/cpp/src > /dev/null
137 make_shared_lib libantlr.a || die
138 if use static-libs; then
139 make clean
140 emake
141 fi
142 popd > /dev/null
143 fi
144 }
145
146 src_install() {
147 exeinto /usr/bin
148 doexe scripts/antlr-config
149
150 if use cxx ; then
151 pushd lib/cpp > /dev/null
152 einstall
153 dolib.so src/libantlr$(get_libname $(get_major_version))
154 dosym libantlr$(get_libname $(get_major_version)) \
155 /usr/$(get_libdir)/libantlr$(get_libname)
156 use static-libs && dolib.a src/libantlr.a
157 newdoc AUTHORS{,.cpp}
158 newdoc ChangeLog{,.cpp}
159 newdoc TODO{,.cpp}
160 popd > /dev/null
161 fi
162
163 if use java ; then
164 java-pkg_dojar antlr/antlr.jar
165 use script && java-pkg_dolauncher antlr --main antlr.Tool
166 use source && java-pkg_dosrc antlr
167 use doc && java-pkg_dohtml -r doc/*
168 fi
169
170 if use mono ; then
171 pushd lib > /dev/null
172 dodir /usr/$(get_libdir)/antlr/
173 insinto /usr/$(get_libdir)/antlr/
174 doins antlr.astframe.dll
175 doins antlr.runtime.dll
176 sed -e "s|@prefix@|${EPREFIX}/usr|" \
177 -e 's|@exec_prefix@|${prefix}|' \
178 -e "s|@libdir@|\$\{exec_prefix\}/$(get_libdir)/antlr|" \
179 -e 's|@libs@|-r:${libdir}/antlr.astframe.dll -r:${libdir}/antlr.runtime.dll|' \
180 -e "s|@VERSION@|${PV}|" \
181 "${FILESDIR}"/antlr.pc.in > antlr.pc
182 insinto /usr/$(get_libdir)/pkgconfig
183 doins antlr.pc
184 popd > /dev/null
185 fi
186
187 if use python ; then
188 pushd lib/python > /dev/null
189 distutils_src_install
190 popd > /dev/null
191 fi
192
193 if use examples ; then
194 find "${S}"/examples -iname Makefile\* -exec rm \{\} \;
195 insinto /usr/share/doc/${PF}/examples
196 use cxx && doins -r "${S}"/examples/cpp
197 use java && doins -r "${S}"/examples/java
198 use mono && doins -r "${S}"/examples/csharp
199 use python && doins -r "${S}"/examples/python
200 fi
201
202 dodoc README.txt
203 }
204
205 pkg_postinst() {
206 use python && distutils_pkg_postinst
207 }
208
209 pkg_postrm() {
210 use python && distutils_pkg_postrm
211 }