Annotation of /branches/magellan-next/extras/antlr2/antlr2-2.7.7-r1.smage2
Parent Directory | Revision Log
Revision 8637 -
(hide annotations)
(download)
Wed Jul 27 09:51:56 2011 UTC (12 years, 9 months ago) by niro
File size: 1730 byte(s)
Wed Jul 27 09:51:56 2011 UTC (12 years, 9 months ago) by niro
File size: 1730 byte(s)
-fixed build against gcc-4.6
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 | DEPEND="== dev-java//antlr2-${PVER} | ||
39 | >= dev-lang/python-2.7" | ||
40 | } | ||
41 | |||
42 | niro | 8637 | src_prepare() |
43 | { | ||
44 | munpack ${SRCFILE} || die | ||
45 | cd ${SRCDIR} | ||
46 | |||
47 | # fix build against gcc-4.6 | ||
48 | mpatch ${PNAME}-${PVER}-gcc46.patch || die | ||
49 | } | ||
50 | |||
51 | niro | 8636 | src_compile() |
52 | { | ||
53 | cd ${SRCDIR} | ||
54 | mconfigure --disable-examples --disable-csharp || die | ||
55 | mmake || die | ||
56 | |||
57 | # python | ||
58 | cd ${SRCDIR}/lib/python | ||
59 | python_src_compile || die | ||
60 | } | ||
61 | |||
62 | src_install_antlr2() | ||
63 | { | ||
64 | cd ${SRCDIR} | ||
65 | mmake prefix=${BINDIR}/usr install || die | ||
66 | |||
67 | # install jar | ||
68 | minstalldir /usr/share/java || die | ||
69 | minstallfile antlr/antlr.jar /usr/share/java/antlr-${PVER}.jar || die | ||
70 | mlink antlr-${PVER}.jar /usr/share/java/antlr.jar || die | ||
71 | # expand classpath | ||
72 | minstalldir /etc/env.d | ||
73 | MCONFIG=/etc/env.d/70antlr | ||
74 | mclearconfig || die | ||
75 | maddconfig "CLASSPATH=\"/usr/share/java/antlr.jar\"" || die | ||
76 | # runscript | ||
77 | cat ${SRCDIR}/runantlr.sh << EOF | ||
78 | #!/bin/sh | ||
79 | java antlr.Tool $* | ||
80 | EOF | ||
81 | minstallexec runantlr.sh /usr/bin/antlr2 || die | ||
82 | |||
83 | minstalldocs *.txt || die | ||
84 | } | ||
85 | |||
86 | src_install_antlr2-python() | ||
87 | { | ||
88 | cd ${SRCDIR} | ||
89 | python_src_install || die | ||
90 | } |