Gentoo Archives: gentoo-commits

From: Denis Dupeyron <calchan@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/R/
Date: Mon, 04 Jan 2016 18:25:05
Message-Id: 1451931881.702ba2aaa8e9bff70c76a39c0e28c5934f63adcb.calchan@gentoo
1 commit: 702ba2aaa8e9bff70c76a39c0e28c5934f63adcb
2 Author: Denis Dupeyron <calchan <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jan 4 18:23:36 2016 +0000
4 Commit: Denis Dupeyron <calchan <AT> gentoo <DOT> org>
5 CommitDate: Mon Jan 4 18:24:41 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=702ba2aa
7
8 dev-lang/R: bump to 3.2.3
9
10 dev-lang/R/Manifest | 1 +
11 dev-lang/R/R-3.2.3.ebuild | 206 ++++++++++++++++++++++++++++++++++++++++++++++
12 2 files changed, 207 insertions(+)
13
14 diff --git a/dev-lang/R/Manifest b/dev-lang/R/Manifest
15 index a60e55e..95f848f 100644
16 --- a/dev-lang/R/Manifest
17 +++ b/dev-lang/R/Manifest
18 @@ -1,2 +1,3 @@
19 DIST R-20130129.bash_completion.bz2 4209 SHA256 487e969b94563fec98ec58de7e6142e9361d4219088add0fca282b482a9e01b1 SHA512 910b26e16cfebe677f438abfa5f2652e582db143d91dbf0e7d4b1ea33462c7e5c89c3a3619c63ae98bba26b11a5adb16eda9d344f8cdbe4f0feabc546993c1a5 WHIRLPOOL 2368efaed37fcb6e010f6a234864631f68549bd8e3f733561170cc5b28f5557e546d8561246fb265a481a47991a262fec3acf6abc1dc3929a9357405e0d3c6fc
20 DIST R-3.2.2.tar.gz 29772864 SHA256 9c9152e74134b68b0f3a1c7083764adc1cb56fd8336bec003fd0ca550cd2461d SHA512 71ba470875262b9f00fb6970f209788df4dad30e0a28373b824b60d8bc6401afb7786e65387663c6490c7ddcd2bfd7f808a270a3e63238f3d7565d5f93607138 WHIRLPOOL fea59929ada1d67dafc6ad89409d18ad173af7990384033f490a00e0f794d9919aecf7cd37089d105fe03b9cf64d079e5d148622571cec3eb924c1c5bd00081e
21 +DIST R-3.2.3.tar.gz 29816176 SHA256 b93b7d878138279234160f007cb9b7f81b8a72c012a15566e9ec5395cfd9b6c1 SHA512 9d7294af860204f4d84e25eb503111c9607beedbc42f01de073c915945a6342c3e24e25a9cc038a2e58442036bee931975d93dc327081ed02afe5ffa365170ea WHIRLPOOL 31ecbaa5c4340e02551eefe17f7f2e9ae075778e7b568a2c477b9f31f1b9598380edb8cb53c713df6643d2cba62ea97c6f225490ade2fc8a9e2b4d88426c7883
22
23 diff --git a/dev-lang/R/R-3.2.3.ebuild b/dev-lang/R/R-3.2.3.ebuild
24 new file mode 100644
25 index 0000000..c8227c9
26 --- /dev/null
27 +++ b/dev-lang/R/R-3.2.3.ebuild
28 @@ -0,0 +1,206 @@
29 +# Copyright 1999-2016 Gentoo Foundation
30 +# Distributed under the terms of the GNU General Public License v2
31 +# $Id$
32 +
33 +EAPI=5
34 +
35 +inherit bash-completion-r1 autotools eutils flag-o-matic fortran-2 multilib versionator toolchain-funcs
36 +
37 +BCP=${PN}-20130129.bash_completion
38 +DESCRIPTION="Language and environment for statistical computing and graphics"
39 +HOMEPAGE="http://www.r-project.org/"
40 +SRC_URI="
41 + mirror://cran/src/base/R-3/${P}.tar.gz
42 + https://dev.gentoo.org/~bicatali/distfiles/${BCP}.bz2"
43 +
44 +LICENSE="|| ( GPL-2 GPL-3 ) LGPL-2.1"
45 +SLOT="0"
46 +KEYWORDS="~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~x64-macos"
47 +IUSE="cairo doc icu java jpeg lapack minimal nls openmp perl png prefix profile readline static-libs tiff tk X"
48 +REQUIRED_USE="png? ( || ( cairo X ) ) jpeg? ( || ( cairo X ) ) tiff? ( || ( cairo X ) )"
49 +
50 +CDEPEND="
51 + app-arch/bzip2:0=
52 + app-arch/xz-utils:0=
53 + app-text/ghostscript-gpl
54 + >=dev-libs/libpcre-8.35:3=
55 + virtual/blas:0
56 + || ( >=sys-apps/coreutils-8.15 sys-freebsd/freebsd-bin app-misc/realpath )
57 + cairo? ( x11-libs/cairo:0=[X] x11-libs/pango:0= )
58 + icu? ( dev-libs/icu:= )
59 + jpeg? ( virtual/jpeg:0 )
60 + lapack? ( virtual/lapack:0 )
61 + perl? ( dev-lang/perl )
62 + png? ( media-libs/libpng:0= )
63 + readline? ( sys-libs/readline:0= )
64 + tiff? ( media-libs/tiff:0= )
65 + tk? ( dev-lang/tk:0= )
66 + X? ( x11-libs/libXmu:0= x11-misc/xdg-utils )"
67 +
68 +DEPEND="${CDEPEND}
69 + virtual/pkgconfig
70 + doc? (
71 + virtual/latex-base
72 + dev-texlive/texlive-fontsrecommended
73 + )"
74 +
75 +RDEPEND="${CDEPEND}
76 + >=sys-libs/zlib-1.2.5.1-r2:0[minizip]
77 + java? ( >=virtual/jre-1.5 )"
78 +
79 +RESTRICT="minimal? ( test )"
80 +
81 +R_DIR="${EROOT%/}/usr/$(get_libdir)/${PN}"
82 +
83 +pkg_setup() {
84 + if use openmp; then
85 + if [[ $(tc-getCC) == *gcc ]] && ! tc-has-openmp; then
86 + ewarn "OpenMP is not available in your current selected gcc"
87 + die "need openmp capable gcc"
88 + fi
89 + FORTRAN_NEED_OPENMP=1
90 + fi
91 + fortran-2_pkg_setup
92 + filter-ldflags -Wl,-Bdirect -Bdirect
93 + # avoid using existing R installation
94 + unset R_HOME
95 + # Temporary fix for bug #419761
96 + if [[ ($(tc-getCC) == *gcc) && ($(gcc-version) == 4.7) ]]; then
97 + append-flags -fno-ipa-cp-clone
98 + fi
99 +}
100 +
101 +src_prepare() {
102 + epatch \
103 + "${FILESDIR}"/${PN}-2.11.1-parallel.patch \
104 + "${FILESDIR}"/${PN}-2.13.1-zlib_header_fix.patch \
105 + "${FILESDIR}"/${PN}-3.0.0-rmath-shared.patch
106 +
107 + # fix packages.html for doc (gentoo bug #205103)
108 + sed -i \
109 + -e "s:../../../library:../../../../$(get_libdir)/R/library:g" \
110 + src/library/tools/R/Rd.R || die
111 +
112 + # fix Rscript path when installed (gentoo bug #221061)
113 + sed -i \
114 + -e "s:-DR_HOME='\"\$(rhome)\"':-DR_HOME='\"${R_DIR}\"':" \
115 + src/unix/Makefile.in || die "sed unix Makefile failed"
116 +
117 + # fix HTML links to manual (gentoo bug #273957)
118 + sed -i \
119 + -e 's:\.\./manual/:manual/:g' \
120 + $(grep -Flr ../manual/ doc) || die "sed for HTML links failed"
121 +
122 + use lapack && \
123 + export LAPACK_LIBS="$($(tc-getPKG_CONFIG) --libs lapack)"
124 +
125 + if use X; then
126 + export R_BROWSER="$(type -p xdg-open)"
127 + export R_PDFVIEWER="$(type -p xdg-open)"
128 + fi
129 + use perl && \
130 + export PERL5LIB="${S}/share/perl:${PERL5LIB:+:}${PERL5LIB}"
131 +
132 + # don't search /usr/local
133 + sed -i -e '/FLAGS=.*\/local\//c\: # removed by ebuild' configure.ac || die
134 + # Fix for Darwin (OS X)
135 + if use prefix; then
136 + if [[ ${CHOST} == *-darwin* ]] ; then
137 + sed -i \
138 + -e 's:-install_name libR.dylib:-install_name ${libdir}/R/lib/libR.dylib:' \
139 + -e 's:-install_name libRlapack.dylib:-install_name ${libdir}/R/lib/libRlapack.dylib:' \
140 + -e 's:-install_name libRblas.dylib:-install_name ${libdir}/R/lib/libRblas.dylib:' \
141 + -e "/SHLIB_EXT/s/\.so/.dylib/" \
142 + configure.ac || die
143 + # sort of "undo" 2.14.1-rmath-shared.patch
144 + sed -i \
145 + -e "s:-Wl,-soname=libRmath.so:-install_name ${EROOT%/}/usr/$(get_libdir)/libRmath.dylib:" \
146 + src/nmath/standalone/Makefile.in || die
147 + else
148 + append-ldflags -Wl,-rpath="${EROOT%/}/usr/$(get_libdir)/R/lib"
149 + fi
150 + fi
151 + AT_M4DIR=m4 eaclocal
152 + eautoconf
153 +}
154 +
155 +src_configure() {
156 + # --with-system-tre \
157 + # tre is patched from upstream
158 + econf \
159 + --enable-byte-compiled-packages \
160 + --enable-R-shlib \
161 + --disable-R-framework \
162 + --with-system-zlib \
163 + --with-system-bzlib \
164 + --with-system-pcre \
165 + --with-system-xz \
166 + --with-blas="$($(tc-getPKG_CONFIG) --libs blas)" \
167 + --docdir="${EPREFIX}/usr/share/doc/${PF}" \
168 + rdocdir="${EPREFIX}/usr/share/doc/${PF}" \
169 + $(use_enable nls) \
170 + $(use_enable openmp) \
171 + $(use_enable profile R-profiling) \
172 + $(use_enable profile memory-profiling) \
173 + $(use_enable static-libs static) \
174 + $(use_enable static-libs R-static-lib) \
175 + $(use_with cairo) \
176 + $(use_with icu ICU) \
177 + $(use_with jpeg jpeglib) \
178 + $(use_with lapack) \
179 + $(use_with !minimal recommended-packages) \
180 + $(use_with png libpng) \
181 + $(use_with readline) \
182 + $(use_with tiff libtiff) \
183 + $(use_with tk tcltk) \
184 + $(use_with tk tk-config "${EPREFIX}"/usr/lib/tkConfig.sh) \
185 + $(use_with tk tcl-config "${EPREFIX}"/usr/lib/tclConfig.sh) \
186 + $(use_with X x)
187 +}
188 +
189 +src_compile() {
190 + export VARTEXFONTS="${T}/fonts"
191 + emake AR="$(tc-getAR)"
192 + emake -C src/nmath/standalone \
193 + shared $(use static-libs && echo static) AR="$(tc-getAR)"
194 + use doc && emake info pdf
195 +}
196 +
197 +src_install() {
198 + default
199 + emake -j1 -C src/nmath/standalone DESTDIR="${D}" install
200 +
201 + if use doc; then
202 + emake DESTDIR="${D}" install-info install-pdf
203 + dosym ../manual /usr/share/doc/${PF}/html/manual
204 + fi
205 +
206 + cat > 99R <<-EOF
207 + LDPATH=${R_DIR}/lib
208 + R_HOME=${R_DIR}
209 + EOF
210 + doenvd 99R
211 + newbashcomp "${WORKDIR}"/${BCP} ${PN}
212 + # The buildsystem has a different understanding of install_names than
213 + # we require. Since it builds modules like shared objects (wrong), many
214 + # objects (all modules) get an incorrect install_name. Fixing the build
215 + # system here is not really trivial.
216 + if [[ ${CHOST} == *-darwin* ]] ; then
217 + local mod
218 + pushd "${ED}"/usr/lib/R > /dev/null
219 + for mod in $(find . -name "*.dylib") ; do
220 + mod=${mod#./}
221 + install_name_tool -id "${EPREFIX}/usr/lib/R/${mod}" \
222 + "${mod}"
223 + done
224 + popd > /dev/null
225 + fi
226 + docompress -x /usr/share/doc/${PF}/NEWS.rds
227 +}
228 +
229 +pkg_postinst() {
230 + if use java; then
231 + einfo "Re-initializing java paths for ${P}"
232 + R CMD javareconf
233 + fi
234 +}