/[gentoo-x86]/dev-lang/scala/scala-2.9.2.ebuild
Gentoo

Contents of /dev-lang/scala/scala-2.9.2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations) (download)
Mon Aug 20 03:00:19 2012 UTC (8 months, 4 weeks ago) by ottxor
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +5 -5 lines
added prefix keywords

(Portage version: 2.2.0_alpha121/cvs/Linux i686)

1 ali_bush 1.1 # Copyright 1999-2012 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 ottxor 1.2 # $Header: /var/cvsroot/gentoo-x86/dev-lang/scala/scala-2.9.2.ebuild,v 1.1 2012/06/21 12:23:30 ali_bush Exp $
4 ali_bush 1.1
5     EAPI="3"
6     JAVA_PKG_IUSE="doc examples source"
7     WANT_ANT_TASKS="ant-nodeps"
8     inherit eutils check-reqs java-pkg-2 java-ant-2 versionator
9    
10     MY_P="${PN}-sources-${PV}"
11    
12     # creating the binary:
13     # JAVA_PKG_FORCE_VM="$available-1.6" USE="doc examples source" ebuild scala-*.ebuild compile
14     # cd $WORDKIR
15     # fix dist/latest link.
16     # tar -cjf $DISTDIR/scala-$PN-gentoo-binary.tar.bz2 ${MY_P}/dists ${MY_P}/docs/TODO
17    
18     DESCRIPTION="The Scala Programming Language"
19     HOMEPAGE="http://www.scala-lang.org/"
20     SRC_URI="!binary? ( ${HOMEPAGE}downloads/distrib/files/${MY_P}.tgz -> ${P}.tar.gz )
21     binary? ( http://dev.gentoo.org/~ali_bush/distfiles/${P}-gentoo-binary.tar.bz2 )"
22     LICENSE="BSD"
23     SLOT="0"
24 ottxor 1.2 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x86-macos"
25 ali_bush 1.1 IUSE="binary emacs"
26     # one fails with 1.7, two with 1.4 (blackdown)
27     #RESTRICT="test"
28    
29     DEPEND="virtual/jdk:1.6
30     java-virtuals/jdk-with-com-sun
31     !binary? (
32     dev-java/ant-contrib:0
33     )
34     app-arch/xz-utils"
35     RDEPEND=">=virtual/jre-1.6
36     !dev-java/scala-bin"
37    
38     PDEPEND="emacs? ( app-emacs/scala-mode )"
39    
40     S="${WORKDIR}/${P}-sources"
41    
42     pkg_setup() {
43     java-pkg-2_pkg_setup
44    
45     if ! use binary; then
46     debug-print "Checking for sufficient physical RAM"
47    
48     ewarn "This package can fail to build with memory allocation errors in some cases."
49     ewarn "If you are unable to build from sources, please try USE=binary"
50     ewarn "for this package. See bug #181390 for more information."
51    
52     CHECKREQS_MEMORY="1532M"
53    
54     check-reqs_pkg_setup
55     fi
56     }
57    
58     java_prepare() {
59     if ! use binary; then
60     pushd lib &> /dev/null
61     # other jars are needed for bootstrap
62     #rm -v jline.jar ant/ant-contrib.jar #cldcapi10.jar midpapi10.jar msil.jar *.dll || die
63     rm -v ant/ant-contrib.jar || die
64     java-pkg_jar-from --into ant --build-only ant-contrib
65     popd &> /dev/null
66     fi
67     }
68    
69     src_compile() {
70     if ! use binary; then
71     #unset ANT_OPTS as this is set in the build.xml
72     #sets -X type variables which might come back to bite me
73     unset ANT_OPTS
74    
75     # reported in bugzilla that multiple launches use less resources
76     # https://bugs.gentoo.org/show_bug.cgi?id=282023
77     eant all.clean
78     eant -Djavac.args="-encoding UTF-8" -Djava6.home=${JAVA_HOME} \
79     newlibs newforkjoin build-opt
80     eant dist.done
81     else
82     einfo "Skipping compilation, USE=binary is set."
83     fi
84     }
85    
86     src_test() {
87     eant test.suite || die "Some tests aren't passed"
88     }
89    
90     #scala_launcher() {
91 ottxor 1.2 # local SCALADIR="${EPREFIX}/usr/share/${PN}"
92     # local bcp="${EPREFIX}${SCALADIR}/lib/scala-library.jar"
93 ali_bush 1.1 # java-pkg_dolauncher "${1}" --main "${2}" \
94     # --java_args "-Xmx256M -Xms32M -Dscala.home=${SCALADIR} -Denv.emacs=${EMACS}"
95     #}
96    
97     src_install() {
98     cd dists/latest || die
99    
100     local SCALADIR="/usr/share/${PN}/"
101    
102     exeinto "${SCALADIR}/bin"
103     doexe $(find bin/ -type f ! -iname '*.bat')
104    
105     #sources are .scala so no use for java-pkg_dosrc
106     if use source; then
107     dodir "${SCALADIR}/src"
108     insinto "${SCALADIR}/src"
109     doins src/*-src.jar
110     fi
111    
112     java-pkg_dojar lib/*.jar
113    
114     doman man/man1/*.1 || die
115    
116     #docs and examples are not contained in the binary tgz anymore
117     if ! use binary; then
118     local docdir="doc/${PN}-devel-docs"
119     dodoc doc/README ../../docs/TODO || die
120     if use doc; then
121     java-pkg_dojavadoc "${docdir}/api"
122     dohtml -r "${docdir}/tools" || die
123     fi
124    
125     use examples && java-pkg_doexamples "${docdir}/examples"
126     fi
127    
128     dodir /usr/bin
129     for b in $(find bin/ -type f ! -iname '*.bat'); do
130 ottxor 1.2 #pushd "${ED}/usr/bin" &>/dev/null
131 ali_bush 1.1 local _name=$(basename "${b}")
132     dosym "/usr/share/${JAVA_PKG_NAME}/bin/${_name}" "/usr/bin/${_name}"
133     #popd &>/dev/null
134     done
135     #scala_launcher fsc scala.tools.nsc.CompileClient
136     #scala_launcher scala scala.tools.nsc.MainGenericRunner
137     #scala_launcher scalac scala.tools.nsc.Main
138     #scala_launcher scaladoc scala.tools.nsc.ScalaDoc
139     #scala_launcher scalap scala.tools.scalap.Main
140     }

  ViewVC Help
Powered by ViewVC 1.1.13