/[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.7 - (show annotations) (download)
Fri Jun 22 15:50:57 2012 UTC (2 years, 2 months ago) by calchan
Branch: MAIN
Changes since 1.6: +1 -2 lines
Removed debugging code which stayed behind by mistake. Many thanks to Gabriel Marcano in bug #419761.

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

  ViewVC Help
Powered by ViewVC 1.1.20