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

Contents of /dev-lang/R/R-2.13.1-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Mon Jan 2 19:47:54 2012 UTC (2 years, 11 months ago) by bicatali
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +1 -1 lines
FILE REMOVED
Version bump. Fixed automagic dependencies on icu and tiff. Added required dependency on pango when cairo is set. Fixed as-needed on standalone math library. Added required use flags for graphics capabilities (bug #373649). Removed glibc hacks, applied on glibc package. Commented patches for another attempt to submit them upstream. Removed older unstable versions, fixing bugs #353545, bug #357077, bug #382687, bug #384493, bug #384723.

(Portage version: 2.1.10.41/cvs/Linux x86_64)

1 # Copyright 1999-2011 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.13.1-r1.ebuild,v 1.3 2011/11/21 16:22:52 jlec Exp $
4
5 EAPI=4
6
7 inherit bash-completion-r1 eutils flag-o-matic fortran-2 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 GPL-3 ) 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 openmp perl png profile readline static-libs tk X"
20
21 # common depends
22 CDEPEND="
23 app-arch/bzip2
24 app-text/ghostscript-gpl
25 dev-libs/libpcre
26 || ( >=net-libs/libtirpc-0.2.2-r1 <sys-libs/glibc-2.14 sys-freebsd/freebsd-lib )
27 virtual/blas
28 cairo? ( x11-libs/cairo[X] )
29 jpeg? ( virtual/jpeg )
30 lapack? ( virtual/lapack )
31 perl? ( dev-lang/perl )
32 png? ( media-libs/libpng )
33 readline? ( sys-libs/readline )
34 tk? ( dev-lang/tk )
35 X? ( x11-libs/libXmu x11-misc/xdg-utils )"
36
37 DEPEND="${CDEPEND}
38 dev-util/pkgconfig
39 doc? (
40 virtual/latex-base
41 dev-texlive/texlive-fontsrecommended
42 )"
43
44 RDEPEND="${CDEPEND}
45 ( || ( <sys-libs/zlib-1.2.5.1-r1 >=sys-libs/zlib-1.2.5.1-r2[minizip] ) )
46 app-arch/xz-utils
47 java? ( >=virtual/jre-1.5 )"
48
49 RESTRICT="minimal? ( test )"
50
51 R_DIR="${EPREFIX}/usr/$(get_libdir)/${PN}"
52
53 pkg_setup() {
54 if use openmp; then
55 FORTRAN_NEED_OPENMP=1
56 tc-has-openmp || die "Please enable openmp support in your compiler"
57 fi
58 fortran-2_pkg_setup
59 filter-ldflags -Wl,-Bdirect -Bdirect
60 # avoid using existing R installation
61 unset R_HOME
62 }
63
64 src_prepare() {
65 # fix ocasional failure with parallel install (bug #322965)
66 # upstream in R-2.13?
67 # https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=14505
68 epatch "${FILESDIR}"/${PN}-2.11.1-parallel.patch
69 # respect ldflags on rscript
70 # upstream does not want it, no reasons given
71 # https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=14506
72 epatch "${FILESDIR}"/${PN}-2.12.1-ldflags.patch
73 # update for zlib header changes (see bug #383431)
74 epatch "${FILESDIR}"/${P}-zlib_header_fix.patch
75
76 # glibc 2.14 removed rpc
77 if has_version '>=net-libs/libtirpc-0.2.2-r1'; then
78 append-cppflags $($(tc-getPKG_CONFIG) libtirpc --cflags)
79 export LIBS+=" $($(tc-getPKG_CONFIG) libtirpc --libs)"
80 # patching configure.ac would cause way too much work
81 # ugly hack on configure and let upstream do the job
82 sed -i -e "s/'' nsl;/'' tirpc;/" configure || die
83 fi
84
85 # fix packages.html for doc (bug #205103)
86 # check in later versions if fixed
87 sed -i \
88 -e "s:../../library:../../../../$(get_libdir)/R/library:g" \
89 src/library/tools/R/Rd.R \
90 || die "sed failed"
91
92 # fix Rscript
93 sed \
94 -e "s:-DR_HOME='\"\$(rhome)\"':-DR_HOME='\"${R_DIR}\"':" \
95 -i src/unix/Makefile.in || die "sed unix Makefile failed"
96
97 # fix HTML links to manual (bug #273957)
98 sed \
99 -e 's:\.\./manual/:manual/:g' \
100 -i $(grep -Flr ../manual/ doc) \
101 || die "sed for HTML links to manual failed"
102
103 use lapack && \
104 export LAPACK_LIBS="$(pkg-config --libs lapack)"
105
106 if use X; then
107 export R_BROWSER="$(type -p xdg-open)"
108 export R_PDFVIEWER="$(type -p xdg-open)"
109 fi
110 use perl && \
111 export PERL5LIB="${S}/share/perl:${PERL5LIB:+:}${PERL5LIB}"
112 }
113
114 src_configure() {
115 econf \
116 --enable-byte-compiled-packages \
117 --enable-R-shlib \
118 --with-system-zlib \
119 --with-system-bzlib \
120 --with-system-pcre \
121 --with-system-xz \
122 --with-blas="$(pkg-config --libs blas)" \
123 --docdir="${EPREFIX}/usr/share/doc/${PF}" \
124 rdocdir="${EPREFIX}/usr/share/doc/${PF}" \
125 $(use_enable openmp) \
126 $(use_enable nls) \
127 $(use_enable profile R-profiling) \
128 $(use_enable profile memory-profiling) \
129 $(use_enable static-libs static) \
130 $(use_enable static-libs R-static-lib) \
131 $(use_with lapack) \
132 $(use_with tk tcltk) \
133 $(use_with jpeg jpeglib) \
134 $(use_with !minimal recommended-packages) \
135 $(use_with png libpng) \
136 $(use_with readline) \
137 $(use_with cairo) \
138 $(use_with X x)
139 }
140
141 src_compile(){
142 export VARTEXFONTS="${T}/fonts"
143 emake
144 RMATH_V=0.0.0
145 emake -C src/nmath/standalone \
146 libRmath_la_LDFLAGS="-Wl,-soname,libRmath.so.${RMATH_V}" \
147 libRmath_la_LIBADD="\$(LIBM)" \
148 shared $(use static-libs && echo static)
149 use doc && emake info pdf
150 }
151
152 src_install() {
153 default
154 if use doc; then
155 emake DESTDIR="${D}" install-info install-pdf
156 dosym ../manual /usr/share/doc/${PF}/html/manual
157 fi
158
159 # standalone math lib install (-j1 basically harmless)
160 emake \
161 -C src/nmath/standalone \
162 DESTDIR="${D}" install
163
164 local mv=$(get_major_version ${RMATH_V})
165 mv "${ED}"/usr/$(get_libdir)/libRmath.so \
166 "${ED}"/usr/$(get_libdir)/libRmath.so.${RMATH_V}
167 dosym libRmath.so.${RMATH_V} /usr/$(get_libdir)/libRmath.so.${mv}
168 dosym libRmath.so.${mv} /usr/$(get_libdir)/libRmath.so
169
170 # env file
171 cat > 99R <<-EOF
172 LDPATH=${R_DIR}/lib
173 R_HOME=${R_DIR}
174 EOF
175 doenvd 99R
176 use bash-completion && dobashcomp "${WORKDIR}"/R.bash_completion
177 }
178
179 pkg_postinst() {
180 if use java; then
181 einfo "Re-initializing java paths for ${P}"
182 R CMD javareconf
183 fi
184 bash-completion-r1_pkg_postinst
185 }

  ViewVC Help
Powered by ViewVC 1.1.20