Magellan Linux

Annotation of /branches/magellan-next/extras/antlr2/antlr2-2.7.7-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 8641 - (hide annotations) (download)
Wed Jul 27 10:20:47 2011 UTC (12 years, 10 months ago) by niro
File size: 1774 byte(s)
-fixed a typo in the dependencies
1 niro 8636 # $Id$
2    
3     PNAME="antlr2"
4     PVER="2.7.7"
5     PBUILD="r1"
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 niro 8637 sminclude mtools python
20 niro 8636
21     SRC_URI=(
22     http://www.antlr2.org/download/${SRCFILE}
23     mirror://${PNAME}/${SRCFILE}
24 niro 8637 mirror://${PNAME}/${PNAME}-${PVER}-gcc46.patch
25 niro 8636 )
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 niro 8641 DEPEND="== dev-java/antlr2-${PVER}
39 niro 8636 >= dev-lang/python-2.7"
40 niro 8640 PCATEGORIE="dev-python"
41 niro 8636 }
42    
43 niro 8637 src_prepare()
44     {
45     munpack ${SRCFILE} || die
46     cd ${SRCDIR}
47    
48     # fix build against gcc-4.6
49 niro 8638 mpatch -Np0 ${PNAME}-${PVER}-gcc46.patch || die
50 niro 8637 }
51    
52 niro 8636 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_src_compile || 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/70antlr
75     mclearconfig || die
76     maddconfig "CLASSPATH=\"/usr/share/java/antlr.jar\"" || die
77 niro 8640 # overwrite the runscript
78 niro 8639 cat > ${SRCDIR}/runantlr.sh << EOF
79 niro 8636 #!/bin/sh
80     java antlr.Tool $*
81     EOF
82 niro 8640 minstallexec runantlr.sh /usr/bin/antlr || die
83 niro 8636
84     minstalldocs *.txt || die
85     }
86    
87     src_install_antlr2-python()
88     {
89     cd ${SRCDIR}
90     python_src_install || die
91     }