/[gentoo-x86]/dev-lang/R/R-2.10.1.ebuild
Gentoo

Contents of /dev-lang/R/R-2.10.1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.18 - (show annotations) (download)
Sun Oct 7 13:35:21 2012 UTC (2 years, 2 months ago) by jlec
Branch: MAIN
Changes since 1.17: +1 -2 lines
dev-lang/R: virtual/fortran is now in *DEPEND of fortran-2.eclass

(Portage version: 2.2.0_alpha135/cvs/Linux x86_64)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-lang/R/R-2.10.1.ebuild,v 1.17 2012/06/06 02:50:20 zmedico Exp $
4
5 EAPI=2
6
7 inherit bash-completion-r1 eutils flag-o-matic fortran-2 multilib versionator
8
9 DESCRIPTION="Language and environment for statistical computing and graphics"
10 HOMEPAGE="http://www.r-project.org/"
11 SRC_URI="
12 mirror://cran/src/base/R-2/${P}.tar.gz
13 bash-completion? ( mirror://gentoo/R.bash_completion.bz2 )"
14
15 LICENSE="GPL-2 LGPL-2.1"
16 SLOT="0"
17 KEYWORDS="alpha amd64 hppa ia64 ppc ppc64 sparc x86 ~x86-fbsd"
18
19 IUSE="bash-completion cairo doc java jpeg lapack minimal nls perl png readline threads tk X"
20
21 # common depends
22 CDEPEND="
23 app-arch/bzip2
24 app-text/ghostscript-gpl
25 dev-libs/libpcre
26 virtual/blas
27 cairo? (
28 x11-libs/cairo[X]
29 >=x11-libs/pango-1.20[X] )
30 jpeg? ( virtual/jpeg )
31 lapack? ( virtual/lapack )
32 perl? ( dev-lang/perl )
33 png? ( media-libs/libpng )
34 readline? ( sys-libs/readline )
35 tk? ( dev-lang/tk )
36 X? ( x11-libs/libXmu x11-misc/xdg-utils )"
37
38 DEPEND="${CDEPEND}
39 virtual/pkgconfig
40 doc? (
41 virtual/latex-base
42 dev-texlive/texlive-fontsrecommended
43 )"
44
45 RDEPEND="${CDEPEND}
46 app-arch/unzip
47 app-arch/zip
48 java? ( >=virtual/jre-1.5 )"
49
50 RESTRICT="minimal? ( test )"
51
52 R_DIR=/usr/$(get_libdir)/${PN}
53
54 pkg_setup() {
55 fortran-2_pkg_setup
56 filter-ldflags -Wl,-Bdirect -Bdirect
57 # avoid using existing R installation
58 unset R_HOME
59 }
60
61 src_prepare() {
62 # fix packages.html for doc (bug #205103)
63 # check in later versions if fixed
64 sed -i \
65 -e "s:../../library:../../../../$(get_libdir)/R/library:g" \
66 src/library/tools/R/packageshtml.R \
67 || die "sed failed"
68
69 # fix Rscript
70 sed \
71 -e "s:-DR_HOME='\"\$(rhome)\"':-DR_HOME='\"${R_DIR}\"':" \
72 -i src/unix/Makefile.in || die "sed unix Makefile failed"
73
74 # fix HTML links to manual (bug #273957)
75 sed \
76 -e 's:\.\./manual/:manual/:g' \
77 -i $(grep -Flr ../manual/ doc) \
78 || die "sed for HTML links to manual failed"
79
80 # Fix compability with zlib-1.2.5.1-r1 OF change
81 has_version ">=sys-libs/zlib-1.2.5.1-r1" && \
82 sed -i -e '1i#define OF(x) x' src/main/unzip.h
83
84 # Missing include that was implicit before
85 sed -i -e '1i#include <zlib.h>' src/main/dounzip.c || die
86
87 # Don't try to access libpng internal structure
88 sed -i -e 's:png_ptr->jmpbuf:png_jmpbuf(png_ptr):' src/modules/X11/rbitmap.c || die
89
90 use lapack && \
91 export LAPACK_LIBS="$(pkg-config --libs lapack)"
92
93 if use X; then
94 export R_BROWSER="$(type -p xdg-open)"
95 export R_PDFVIEWER="$(type -p xdg-open)"
96 fi
97 use perl && \
98 export PERL5LIB="${S}/share/perl:${PERL5LIB:+:}${PERL5LIB}"
99 }
100
101 src_configure() {
102 econf \
103 --disable-rpath \
104 --enable-R-profiling \
105 --enable-memory-profiling \
106 --enable-R-shlib \
107 --enable-linux-lfs \
108 --with-system-zlib \
109 --with-system-bzlib \
110 --with-system-pcre \
111 --with-blas="$(pkg-config --libs blas)" \
112 --docdir=/usr/share/doc/${PF} \
113 rdocdir=/usr/share/doc/${PF} \
114 $(use_enable nls) \
115 $(use_enable threads) \
116 $(use_with lapack) \
117 $(use_with tk tcltk) \
118 $(use_with jpeg jpeglib) \
119 $(use_with !minimal recommended-packages) \
120 $(use_with png libpng) \
121 $(use_with readline) \
122 $(use_with cairo) \
123 $(use_with X x)
124 }
125
126 src_compile(){
127 emake || die "emake failed"
128 RMATH_V=0.0.0
129 emake -j1 -C src/nmath/standalone \
130 libRmath_la_LDFLAGS=-Wl,-soname,libRmath.so.${RMATH_V} \
131 || die "emake math library failed"
132 if use doc; then
133 export VARTEXFONTS="${T}/fonts"
134 emake info pdf || die "emake docs failed"
135 fi
136 }
137
138 src_install() {
139 emake DESTDIR="${D}" install || die "emake install failed"
140
141 if use doc; then
142 emake DESTDIR="${D}" \
143 install-info install-pdf || die "emake install docs failed"
144 dosym /usr/share/doc/${PF}/manual /usr/share/doc/${PF}/html/manual
145 fi
146
147 # standalone math lib install (-j1 basically harmless)
148 emake -j1 \
149 -C src/nmath/standalone \
150 DESTDIR="${D}" install \
151 || die "emake install math library failed"
152
153 local mv=$(get_major_version ${RMATH_V})
154 mv "${D}"/usr/$(get_libdir)/libRmath.so \
155 "${D}"/usr/$(get_libdir)/libRmath.so.${RMATH_V}
156 dosym libRmath.so.${RMATH_V} /usr/$(get_libdir)/libRmath.so.${mv}
157 dosym libRmath.so.${mv} /usr/$(get_libdir)/libRmath.so
158
159 # env file
160 cat > 99R <<-EOF
161 LDPATH=${R_DIR}/lib
162 R_HOME=${R_DIR}
163 EOF
164 doenvd 99R || die "doenvd failed"
165 use bash-completion && dobashcomp "${WORKDIR}"/R.bash_completion
166 }
167
168 pkg_config() {
169 if use java; then
170 einfo "Re-initializing java paths for ${P}"
171 R CMD javareconf
172 fi
173 }

  ViewVC Help
Powered by ViewVC 1.1.20