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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Wed Jun 6 02:50:20 2012 UTC (11 months, 1 week ago) by zmedico
Branch: MAIN
Changes since 1.2: +2 -2 lines
inherit multilib for get_libdir

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

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.15.0.ebuild,v 1.2 2012/05/03 02:41:39 jdhore Exp $
4
5 EAPI=4
6
7 inherit bash-completion-r1 autotools 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="mirror://cran/src/base/R-2/${P}.tar.gz
12 bash-completion? ( mirror://gentoo/R.bash_completion.bz2 )"
13
14 LICENSE="|| ( GPL-2 GPL-3 ) LGPL-2.1"
15 SLOT="0"
16 KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
17 IUSE="bash-completion cairo doc icu java jpeg lapack minimal nls openmp perl png profile readline static-libs tiff tk X"
18 REQUIRED_USE="png? ( || ( cairo X ) ) jpeg? ( || ( cairo X ) ) tiff? ( || ( cairo X ) )"
19
20 CDEPEND="app-arch/bzip2
21 app-text/ghostscript-gpl
22 dev-libs/libpcre
23 virtual/blas
24 virtual/fortran
25 cairo? ( x11-libs/cairo[X] x11-libs/pango )
26 icu? ( dev-libs/icu )
27 jpeg? ( virtual/jpeg )
28 lapack? ( virtual/lapack )
29 perl? ( dev-lang/perl )
30 png? ( media-libs/libpng )
31 readline? ( sys-libs/readline )
32 tk? ( dev-lang/tk )
33 X? ( x11-libs/libXmu x11-misc/xdg-utils )"
34
35 DEPEND="${CDEPEND}
36 virtual/pkgconfig
37 doc? (
38 virtual/latex-base
39 dev-texlive/texlive-fontsrecommended
40 )"
41
42 RDEPEND="${CDEPEND}
43 ( || ( <sys-libs/zlib-1.2.5.1-r1 >=sys-libs/zlib-1.2.5.1-r2[minizip] ) )
44 app-arch/xz-utils
45 java? ( >=virtual/jre-1.5 )"
46
47 RESTRICT="minimal? ( test )"
48
49 R_DIR="${EPREFIX}/usr/$(get_libdir)/${PN}"
50
51 pkg_setup() {
52 if use openmp; then
53 FORTRAN_NEED_OPENMP=1
54 tc-has-openmp || die "Please enable openmp support in your compiler"
55 fi
56 fortran-2_pkg_setup
57 filter-ldflags -Wl,-Bdirect -Bdirect
58 # avoid using existing R installation
59 unset R_HOME
60 }
61
62 src_prepare() {
63 epatch \
64 "${FILESDIR}"/${PN}-2.11.1-parallel.patch \
65 "${FILESDIR}"/${PN}-2.12.1-ldflags.patch \
66 "${FILESDIR}"/${PN}-2.13.1-zlib_header_fix.patch \
67 "${FILESDIR}"/${PN}-2.14.1-tiff.patch \
68 "${FILESDIR}"/${PN}-2.14.1-rmath-shared.patch \
69 "${FILESDIR}"/${PN}-2.14.1-warnings-buffer-overflow.patch \
70 "${FILESDIR}"/${PN}-2.14.2-library-writability.patch \
71 "${FILESDIR}"/${PN}-2.14.2-prune-package-update.patch
72
73 # fix packages.html for doc (bug #205103)
74 sed -i \
75 -e "s:../../../library:../../../../$(get_libdir)/R/library:g" \
76 src/library/tools/R/Rd.R || die
77
78 # fix Rscript path when installed (bug #221061)
79 sed -i \
80 -e "s:-DR_HOME='\"\$(rhome)\"':-DR_HOME='\"${R_DIR}\"':" \
81 src/unix/Makefile.in || die "sed unix Makefile failed"
82
83 # fix HTML links to manual (bug #273957)
84 sed -i \
85 -e 's:\.\./manual/:manual/:g' \
86 $(grep -Flr ../manual/ doc) || die "sed for HTML links failed"
87
88 use lapack && \
89 export LAPACK_LIBS="$(pkg-config --libs lapack)"
90
91 if use X; then
92 export R_BROWSER="$(type -p xdg-open)"
93 export R_PDFVIEWER="$(type -p xdg-open)"
94 fi
95 use perl && \
96 export PERL5LIB="${S}/share/perl:${PERL5LIB:+:}${PERL5LIB}"
97 AT_M4DIR=m4 eaclocal
98 eautoconf
99 }
100
101 src_configure() {
102 econf \
103 --enable-byte-compiled-packages \
104 --enable-R-shlib \
105 --with-system-zlib \
106 --with-system-bzlib \
107 --with-system-pcre \
108 --with-system-xz \
109 --with-blas="$(pkg-config --libs blas)" \
110 --docdir="${EPREFIX}/usr/share/doc/${PF}" \
111 rdocdir="${EPREFIX}/usr/share/doc/${PF}" \
112 $(use_enable nls) \
113 $(use_enable openmp) \
114 $(use_enable profile R-profiling) \
115 $(use_enable profile memory-profiling) \
116 $(use_enable static-libs static) \
117 $(use_enable static-libs R-static-lib) \
118 $(use_with cairo) \
119 $(use_with icu ICU) \
120 $(use_with jpeg jpeglib) \
121 $(use_with lapack) \
122 $(use_with !minimal recommended-packages) \
123 $(use_with png libpng) \
124 $(use_with readline) \
125 $(use_with tiff libtiff) \
126 $(use_with tk tcltk) \
127 $(use_with X x)
128 }
129
130 src_compile(){
131 export VARTEXFONTS="${T}/fonts"
132 emake
133 emake -C src/nmath/standalone shared $(use static-libs && echo static)
134 use doc && emake info pdf
135 }
136
137 src_install() {
138 default
139 emake -C src/nmath/standalone DESTDIR="${D}" install
140
141 if use doc; then
142 emake DESTDIR="${D}" install-info install-pdf
143 dosym ../manual /usr/share/doc/${PF}/html/manual
144 fi
145
146 cat > 99R <<-EOF
147 LDPATH=${R_DIR}/lib
148 R_HOME=${R_DIR}
149 EOF
150 doenvd 99R
151 use bash-completion && dobashcomp "${WORKDIR}"/R.bash_completion
152 }
153
154 pkg_postinst() {
155 if use java; then
156 einfo "Re-initializing java paths for ${P}"
157 R CMD javareconf
158 fi
159 }

  ViewVC Help
Powered by ViewVC 1.1.13