Magellan Linux

Contents of /branches/magellan-next/extras/antlr2/antlr2-2.7.7-r2.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 8672 - (show annotations) (download)
Wed Jul 27 18:33:33 2011 UTC (12 years, 9 months ago) by niro
File size: 1782 byte(s)
-rebuild against fixed python
1 # $Id$
2
3 PNAME="antlr2"
4 PVER="2.7.7"
5 PBUILD="r2"
6
7 SPLIT_PACKAGES="antlr2 antlr2-python"
8
9 PCATEGORIE="dev-java"
10
11 HOMEPAGE="http://www.antlr2.org/"
12
13 SDEPEND=">= virtual/java-jdk
14 >= dev-lang/python-2.7"
15
16 SRCFILE="${PNAME/2/}-${PVER}.tar.gz"
17 SRCDIR="${BUILDDIR}/${PNAME/2/}-${PVER}"
18
19 sminclude mtools python
20
21 SRC_URI=(
22 http://www.antlr2.org/download/${SRCFILE}
23 mirror://${PNAME}/${SRCFILE}
24 mirror://${PNAME}/${PNAME}-${PVER}-gcc46.patch
25 )
26
27 UP2DATE="updatecmd ${HOMEPAGE}/download/ | grep ${PNAME/2/}-2 | grep -v rc | lasttarball gz"
28
29 split_info_antlr2()
30 {
31 DESCRIPTION="A parser generator for C++, C#, Java, and Python."
32 DEPEND=">= virtual/java"
33 }
34
35 split_info_antlr2-python()
36 {
37 DESCRIPTION="ANTLR v2 python module."
38 DEPEND="== dev-java/antlr2-${PVER}
39 >= dev-lang/python-2.7"
40 PCATEGORIE="dev-python"
41 }
42
43 src_prepare()
44 {
45 munpack ${SRCFILE} || die
46 cd ${SRCDIR}
47
48 # fix build against gcc-4.6
49 mpatch -Np0 ${PNAME}-${PVER}-gcc46.patch || die
50 }
51
52 src_compile()
53 {
54 cd ${SRCDIR}
55 mconfigure --disable-examples --disable-csharp || die
56 mmake || die
57
58 # python
59 cd ${SRCDIR}/lib/python
60 python_docompile || die
61 }
62
63 src_install_antlr2()
64 {
65 cd ${SRCDIR}
66 mmake prefix=${BINDIR}/usr install || die
67
68 # install jar
69 minstalldir /usr/share/java || die
70 minstallfile antlr/antlr.jar /usr/share/java/antlr-${PVER}.jar || die
71 mlink antlr-${PVER}.jar /usr/share/java/antlr.jar || die
72 # expand classpath
73 minstalldir /etc/env.d
74 MCONFIG=/etc/env.d/25antlr
75 mclearconfig || die
76 maddconfig "CLASSPATH=\"/usr/share/java/antlr.jar\"" || die
77 # overwrite the runscript
78 cat > ${SRCDIR}/runantlr.sh << EOF
79 #!/bin/sh
80 java antlr.Tool \$*
81 EOF
82 minstallexec runantlr.sh /usr/bin/antlr || die
83
84 minstalldocs *.txt || die
85 }
86
87 src_install_antlr2-python()
88 {
89 cd ${SRCDIR}/lib/python
90 python_doinstall || die
91 }