/[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.5 - (hide annotations) (download)
Tue Jun 19 19:16:55 2012 UTC (2 years, 2 months ago) by bicatali
Branch: MAIN
Changes since 1.4: +28 -10 lines
commented patches with upstream reports

(Portage version: 2.1.10.65/cvs/Linux x86_64)

1 calchan 1.1 # Copyright 1999-2012 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 bicatali 1.5 # $Header: /var/cvsroot/gentoo-x86/dev-lang/R/R-2.15.0.ebuild,v 1.4 2012/06/19 16:55:00 bicatali Exp $
4 calchan 1.1
5     EAPI=4
6    
7 zmedico 1.3 inherit bash-completion-r1 autotools eutils flag-o-matic fortran-2 multilib versionator
8 calchan 1.1
9 bicatali 1.4 BCP=${PN}-20120306.bash_completion
10 calchan 1.1 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 bicatali 1.4 bash-completion? ( http://dev.gentoo.org/~bicatali/distfiles/${BCP}.bz2 )"
14 calchan 1.1
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 jdhore 1.2 virtual/pkgconfig
38 calchan 1.1 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     }
62    
63     src_prepare() {
64 bicatali 1.5 # gentoo bug #322965 (not applied upstream)
65     # https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=14505
66     epatch "${FILESDIR}"/${PN}-2.11.1-parallel.patch
67    
68     # respect ldflags (not applied upstream)
69     # https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=14506
70     epatch "${FILESDIR}"/${PN}-2.12.1-ldflags.patch
71    
72     # gentoo bug #383431
73     # https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=14951
74     epatch "${FILESDIR}"/${PN}-2.13.1-zlib_header_fix.patch
75    
76     # tiff automagic
77     # https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=14952
78     epatch "${FILESDIR}"/${PN}-2.14.1-tiff.patch
79    
80     # https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=14953
81     epatch "${FILESDIR}"/${PN}-2.14.1-rmath-shared.patch
82    
83     # too many warning crash, bug #405463
84     # https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=14954
85     epatch "${FILESDIR}"/${PN}-2.14.1-warnings-buffer-overflow.patch
86    
87     # applied upstream for next R
88 calchan 1.1 epatch \
89     "${FILESDIR}"/${PN}-2.14.2-library-writability.patch \
90     "${FILESDIR}"/${PN}-2.14.2-prune-package-update.patch
91    
92 bicatali 1.5 # fix packages.html for doc (gentoo bug #205103)
93 calchan 1.1 sed -i \
94     -e "s:../../../library:../../../../$(get_libdir)/R/library:g" \
95     src/library/tools/R/Rd.R || die
96    
97 bicatali 1.5 # fix Rscript path when installed (gentoo bug #221061)
98 calchan 1.1 sed -i \
99     -e "s:-DR_HOME='\"\$(rhome)\"':-DR_HOME='\"${R_DIR}\"':" \
100     src/unix/Makefile.in || die "sed unix Makefile failed"
101    
102 bicatali 1.5 # fix HTML links to manual (gentoo bug #273957)
103 calchan 1.1 sed -i \
104     -e 's:\.\./manual/:manual/:g' \
105     $(grep -Flr ../manual/ doc) || die "sed for HTML links failed"
106    
107     use lapack && \
108     export LAPACK_LIBS="$(pkg-config --libs lapack)"
109    
110     if use X; then
111     export R_BROWSER="$(type -p xdg-open)"
112     export R_PDFVIEWER="$(type -p xdg-open)"
113     fi
114     use perl && \
115     export PERL5LIB="${S}/share/perl:${PERL5LIB:+:}${PERL5LIB}"
116     AT_M4DIR=m4 eaclocal
117     eautoconf
118     }
119    
120     src_configure() {
121     econf \
122     --enable-byte-compiled-packages \
123     --enable-R-shlib \
124     --with-system-zlib \
125     --with-system-bzlib \
126     --with-system-pcre \
127     --with-system-xz \
128     --with-blas="$(pkg-config --libs blas)" \
129     --docdir="${EPREFIX}/usr/share/doc/${PF}" \
130     rdocdir="${EPREFIX}/usr/share/doc/${PF}" \
131     $(use_enable nls) \
132     $(use_enable openmp) \
133     $(use_enable profile R-profiling) \
134     $(use_enable profile memory-profiling) \
135     $(use_enable static-libs static) \
136     $(use_enable static-libs R-static-lib) \
137     $(use_with cairo) \
138     $(use_with icu ICU) \
139     $(use_with jpeg jpeglib) \
140     $(use_with lapack) \
141     $(use_with !minimal recommended-packages) \
142     $(use_with png libpng) \
143     $(use_with readline) \
144     $(use_with tiff libtiff) \
145     $(use_with tk tcltk) \
146     $(use_with X x)
147     }
148    
149     src_compile(){
150     export VARTEXFONTS="${T}/fonts"
151     emake
152     emake -C src/nmath/standalone shared $(use static-libs && echo static)
153     use doc && emake info pdf
154     }
155    
156     src_install() {
157     default
158     emake -C src/nmath/standalone DESTDIR="${D}" install
159    
160     if use doc; then
161     emake DESTDIR="${D}" install-info install-pdf
162     dosym ../manual /usr/share/doc/${PF}/html/manual
163     fi
164    
165     cat > 99R <<-EOF
166     LDPATH=${R_DIR}/lib
167     R_HOME=${R_DIR}
168     EOF
169     doenvd 99R
170 bicatali 1.4 use bash-completion && newbashcomp "${WORKDIR}"/${BCP} ${PN}
171 calchan 1.1 }
172    
173     pkg_postinst() {
174     if use java; then
175     einfo "Re-initializing java paths for ${P}"
176     R CMD javareconf
177     fi
178     }

  ViewVC Help
Powered by ViewVC 1.1.20