Gentoo Archives: gentoo-commits

From: Sebastien Fabbro <bicatali@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/R/, dev-lang/R/files/
Date: Thu, 06 Jul 2017 21:31:33
Message-Id: 1499376672.af2dc7c4efa9e3b453c745c0fb86e0c1e5be1421.bicatali@gentoo
1 commit: af2dc7c4efa9e3b453c745c0fb86e0c1e5be1421
2 Author: Sébastien Fabbro <bicatali <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jul 6 15:33:41 2017 +0000
4 Commit: Sebastien Fabbro <bicatali <AT> gentoo <DOT> org>
5 CommitDate: Thu Jul 6 21:31:12 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=af2dc7c4
7
8 dev-lang/R: version bump
9
10 Package-Manager: Portage-2.3.6, Repoman-2.3.2
11
12 dev-lang/R/Manifest | 2 +
13 dev-lang/R/R-3.4.1.ebuild | 204 ++++++++++++++++++++++++++++
14 dev-lang/R/files/R-3.4.1-parallel.patch | 11 ++
15 dev-lang/R/files/R-3.4.1-rmath-shared.patch | 21 +++
16 4 files changed, 238 insertions(+)
17
18 diff --git a/dev-lang/R/Manifest b/dev-lang/R/Manifest
19 index 9ee4c158c3b..9403f0b02c9 100644
20 --- a/dev-lang/R/Manifest
21 +++ b/dev-lang/R/Manifest
22 @@ -2,3 +2,5 @@ DIST R-20130129.bash_completion.bz2 4209 SHA256 487e969b94563fec98ec58de7e6142e9
23 DIST R-3.2.2.tar.gz 29772864 SHA256 9c9152e74134b68b0f3a1c7083764adc1cb56fd8336bec003fd0ca550cd2461d SHA512 71ba470875262b9f00fb6970f209788df4dad30e0a28373b824b60d8bc6401afb7786e65387663c6490c7ddcd2bfd7f808a270a3e63238f3d7565d5f93607138 WHIRLPOOL fea59929ada1d67dafc6ad89409d18ad173af7990384033f490a00e0f794d9919aecf7cd37089d105fe03b9cf64d079e5d148622571cec3eb924c1c5bd00081e
24 DIST R-3.3.1.tar.gz 29848329 SHA256 3dc59ae5831f5380f83c169bac2103ad052efe0ecec4ffa74bde4d85a0fda9e2 SHA512 d0ff85e99b9ec9cac672aa30d7d1a854778c6a610bcc5336e8c60c8c74f20856f2bfeae085af793fad646ff45cb4677d9d6dcbaa18212591f72f00a02339f4cd WHIRLPOOL 6e2edb60173a54c8b25d16201c24176b3ea837287e6d306c9d2e2c4578764b0d469d9c17228b6be67dda646a4272f30b331dbbc6238a6e851eb5320f04c7f151
25 DIST R-3.3.2.tar.gz 29440670 SHA256 d294ad21e9f574fb4828ebb3a94b8cb34f4f304a41687a994be00dd41a4e514c SHA512 06a98687c0b180cb0bfd57440ea26088212d9f48948d503136475bf54b42d72cfec5bea7e333c0cedd60733bd614dd0f8c2eced7e24478b6c89f48e8d0c43482 WHIRLPOOL a68112df87552cc6ca8cd6b78b99dda2a22b8f4cfcd87a4512d541d25ef21358ede1ba71b4d7e9f274bf4e4340de18355a777d9af2ed41c0a498fa11d91cf0d8
26 +DIST R-3.4.1.tar.gz 30200109 SHA256 02b1135d15ea969a3582caeb95594a05e830a6debcdb5b85ed2d5836a6a3fc78 SHA512 19bd50c87dc001ef947c15c1760f27ac8986ff6b43c6d90d3093ae184e42963027ef06faf31ec57ac9e519af7a35a2f53f8ea23ef75d800ebbd02945cedc4651 WHIRLPOOL 1396303a7ef7a0e8920af867e6b68e171152578231c9a7ad5020b494124922aae634c1ce6d0f2b2f8441481736b93c3abffe142f2af78dbb0dbc754c4faec3f1
27 +DIST R-78d6830e28ea90a046da79a9b4f70c39594bb6d6.bash_completion 13596 SHA256 7e452a23e0bd96b1076280448d130adab229b8ea37cd4531db77391868a31e97 SHA512 9ccd19bb1b0c18a2f13035ccd6809447429e197e298fb4d1df808ef345d723b42f75a1b91c349f6dbb46e4a82e59ef33e11300c495d79b63d670d0c0f2b16a06 WHIRLPOOL 49fd55e6a52d55f0aa15d3a117394793b6fba6f1b69a26911a2b2d7c40a65c8ec2246851edc3abb52849930c48e817ee62319ae8bc1db0a9b802c95fcb1554e0
28
29 diff --git a/dev-lang/R/R-3.4.1.ebuild b/dev-lang/R/R-3.4.1.ebuild
30 new file mode 100644
31 index 00000000000..85556b03670
32 --- /dev/null
33 +++ b/dev-lang/R/R-3.4.1.ebuild
34 @@ -0,0 +1,204 @@
35 +# Copyright 1999-2017 Gentoo Foundation
36 +# Distributed under the terms of the GNU General Public License v2
37 +
38 +EAPI=6
39 +
40 +inherit bash-completion-r1 autotools eutils flag-o-matic fortran-2 multilib versionator toolchain-funcs
41 +
42 +# latest git commit for R bash completion: https://github.com/deepayan/rcompletion
43 +BCPV=78d6830e28ea90a046da79a9b4f70c39594bb6d6
44 +
45 +DESCRIPTION="Language and environment for statistical computing and graphics"
46 +HOMEPAGE="http://www.r-project.org/"
47 +SRC_URI="
48 + mirror://cran/src/base/R-3/${P}.tar.gz
49 + https://raw.githubusercontent.com/deepayan/rcompletion/${BCPV}/bash_completion/R -> ${PN}-${BCPV}.bash_completion"
50 +
51 +LICENSE="|| ( GPL-2 GPL-3 ) LGPL-2.1"
52 +SLOT="0"
53 +KEYWORDS="~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~x64-macos"
54 +IUSE="cairo doc icu java jpeg lapack minimal nls openmp perl png prefix profile readline static-libs tiff tk X"
55 +REQUIRED_USE="png? ( || ( cairo X ) ) jpeg? ( || ( cairo X ) ) tiff? ( || ( cairo X ) )"
56 +
57 +CDEPEND="
58 + app-arch/bzip2:0=
59 + app-arch/xz-utils:0=
60 + app-text/ghostscript-gpl
61 + >=dev-libs/libpcre-8.35:3=
62 + net-misc/curl
63 + virtual/blas:0
64 + || ( >=sys-apps/coreutils-8.15 sys-freebsd/freebsd-bin app-misc/realpath )
65 + cairo? ( x11-libs/cairo:0=[X] x11-libs/pango:0= )
66 + icu? ( dev-libs/icu:= )
67 + jpeg? ( virtual/jpeg:0 )
68 + lapack? ( virtual/lapack:0 )
69 + perl? ( dev-lang/perl )
70 + png? ( media-libs/libpng:0= )
71 + readline? ( sys-libs/readline:0= )
72 + tiff? ( media-libs/tiff:0= )
73 + tk? ( dev-lang/tk:0= )
74 + X? ( x11-libs/libXmu:0= x11-misc/xdg-utils )"
75 +
76 +DEPEND="${CDEPEND}
77 + virtual/pkgconfig
78 + doc? (
79 + virtual/latex-base
80 + dev-texlive/texlive-fontsrecommended
81 + )"
82 +
83 +RDEPEND="${CDEPEND}
84 + >=sys-libs/zlib-1.2.5.1-r2:0[minizip]
85 + java? ( >=virtual/jre-1.5 )"
86 +
87 +RESTRICT="minimal? ( test )"
88 +
89 +PATCHES=(
90 + "${FILESDIR}"/${PN}-3.4.1-parallel.patch
91 + "${FILESDIR}"/${PN}-3.4.1-rmath-shared.patch
92 +)
93 +
94 +pkg_pretend() {
95 + [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
96 +}
97 +
98 +pkg_setup() {
99 + if [[ ${MERGE_TYPE} != binary ]] && use openmp; then
100 + if ! tc-check-openmp; then
101 + ewarn "OpenMP is not available in your current selected compiler"
102 + die "need openmp capable compiler"
103 + fi
104 + FORTRAN_NEED_OPENMP=1
105 + fi
106 + fortran-2_pkg_setup
107 + filter-ldflags -Wl,-Bdirect -Bdirect
108 + # avoid using existing R installation
109 + unset R_HOME
110 + # Temporary fix for bug #419761
111 + if [[ ($(tc-getCC) == *gcc) && ($(gcc-version) == 4.7) ]]; then
112 + append-flags -fno-ipa-cp-clone
113 + fi
114 +}
115 +
116 +src_prepare() {
117 + default
118 +
119 + # fix packages.html for doc (gentoo bug #205103)
120 + sed -e "s:../../../library:../../../../$(get_libdir)/R/library:g" \
121 + -i src/library/tools/R/Rd.R || die
122 +
123 + # fix Rscript path when installed (gentoo bug #221061)
124 + sed -e "s:-DR_HOME='\"\$(rhome)\"':-DR_HOME='\"${EROOT%/}/usr/$(get_libdir)/${PN}\"':" \
125 + -i src/unix/Makefile.in || die "sed unix Makefile failed"
126 +
127 + # fix HTML links to manual (gentoo bug #273957)
128 + sed -e 's:\.\./manual/:manual/:g' \
129 + -i $(grep -Flr ../manual/ doc) || die "sed for HTML links failed"
130 +
131 + use lapack && \
132 + export LAPACK_LIBS="$($(tc-getPKG_CONFIG) --libs lapack)"
133 +
134 + if use X; then
135 + export R_BROWSER="$(type -p xdg-open)"
136 + export R_PDFVIEWER="$(type -p xdg-open)"
137 + fi
138 + use perl && \
139 + export PERL5LIB="${S}/share/perl:${PERL5LIB:+:}${PERL5LIB}"
140 +
141 + # don't search /usr/local
142 + sed -i -e '/FLAGS=.*\/local\//c\: # removed by ebuild' configure.ac || die
143 + # Fix for Darwin (OS X)
144 + if use prefix; then
145 + if [[ ${CHOST} == *-darwin* ]] ; then
146 + sed -e 's:-install_name libR.dylib:-install_name ${libdir}/R/lib/libR.dylib:' \
147 + -e 's:-install_name libRlapack.dylib:-install_name ${libdir}/R/lib/libRlapack.dylib:' \
148 + -e 's:-install_name libRblas.dylib:-install_name ${libdir}/R/lib/libRblas.dylib:' \
149 + -e "/SHLIB_EXT/s/\.so/.dylib/" \
150 + -i configure.ac || die
151 + # sort of "undo" 2.14.1-rmath-shared.patch
152 + sed -e "s:-Wl,-soname=libRmath.so:-install_name ${EROOT%/}/usr/$(get_libdir)/libRmath.dylib:" \
153 + -i src/nmath/standalone/Makefile.in || die
154 + else
155 + append-ldflags -Wl,-rpath="${EROOT%/}/usr/$(get_libdir)/R/lib"
156 + fi
157 + fi
158 + AT_M4DIR=m4 eaclocal
159 + eautoconf
160 +}
161 +
162 +src_configure() {
163 + # --with-system-tre \
164 + # tre is patched from upstream
165 + econf \
166 + --enable-byte-compiled-packages \
167 + --enable-R-shlib \
168 + --disable-R-framework \
169 + --with-blas="$($(tc-getPKG_CONFIG) --libs blas)" \
170 + --docdir="${EPREFIX}/usr/share/doc/${PF}" \
171 + rdocdir="${EPREFIX}/usr/share/doc/${PF}" \
172 + $(use_enable java) \
173 + $(use_enable nls) \
174 + $(use_enable openmp) \
175 + $(use_enable profile R-profiling) \
176 + $(use_enable profile memory-profiling) \
177 + $(use_enable static-libs static) \
178 + $(use_enable static-libs R-static-lib) \
179 + $(use_with cairo) \
180 + $(use_with icu ICU) \
181 + $(use_with jpeg jpeglib) \
182 + $(use_with lapack) \
183 + $(use_with !minimal recommended-packages) \
184 + $(use_with png libpng) \
185 + $(use_with readline) \
186 + $(use_with tiff libtiff) \
187 + $(use_with tk tcltk) \
188 + $(use_with tk tk-config "${EPREFIX}"/usr/$(get_libdir)/tkConfig.sh) \
189 + $(use_with tk tcl-config "${EPREFIX}"/usr/$(get_libdir)/tclConfig.sh) \
190 + $(use_with X x)
191 +}
192 +
193 +src_compile() {
194 + export VARTEXFONTS="${T}/fonts"
195 + emake AR="$(tc-getAR)"
196 + emake -C src/nmath/standalone \
197 + shared $(use static-libs && echo static) AR="$(tc-getAR)"
198 + use doc && emake info pdf
199 +}
200 +
201 +src_install() {
202 + default
203 + emake -j1 -C src/nmath/standalone DESTDIR="${D}" install
204 +
205 + if use doc; then
206 + emake DESTDIR="${D}" install-info install-pdf
207 + dosym ../manual /usr/share/doc/${PF}/html/manual
208 + fi
209 +
210 + cat > 99R <<-EOF
211 + LDPATH=${EROOT%/}/usr/$(get_libdir)/${PN}/lib
212 + R_HOME=${EROOT%/}/usr/$(get_libdir)/${PN}
213 + EOF
214 + doenvd 99R
215 + newbashcomp "${DISTDIR}"/${PN}-${BCPV}.bash_completion ${PN}
216 + # The buildsystem has a different understanding of install_names than
217 + # we require. Since it builds modules like shared objects (wrong), many
218 + # objects (all modules) get an incorrect install_name. Fixing the build
219 + # system here is not really trivial.
220 + if [[ ${CHOST} == *-darwin* ]] ; then
221 + local mod
222 + pushd "${ED}"/usr/$(get_libdir)/R > /dev/null
223 + for mod in $(find . -name "*.dylib") ; do
224 + mod=${mod#./}
225 + install_name_tool -id "${EPREFIX}/usr/$(get_libdir)/R/${mod}" \
226 + "${mod}"
227 + done
228 + popd > /dev/null
229 + fi
230 + docompress -x /usr/share/doc/${PF}/{BioC_mirrors.csv,CRAN_mirrors.csv,KEYWORDS.db,NEWS.rds}
231 +}
232 +
233 +pkg_postinst() {
234 + if use java; then
235 + einfo "Re-initializing java paths for ${P}"
236 + R CMD javareconf
237 + fi
238 +}
239
240 diff --git a/dev-lang/R/files/R-3.4.1-parallel.patch b/dev-lang/R/files/R-3.4.1-parallel.patch
241 new file mode 100644
242 index 00000000000..6fac15b9ffb
243 --- /dev/null
244 +++ b/dev-lang/R/files/R-3.4.1-parallel.patch
245 @@ -0,0 +1,11 @@
246 +--- a/src/include/Makefile.in 2017-07-05 23:09:09.682703655 +0000
247 ++++ b/src/include/Makefile.in 2017-07-05 23:06:56.533612308 +0000
248 +@@ -81,7 +81,7 @@
249 + Rmath.h0: $(srcdir)/Rmath.h0.in $(top_builddir)/config.status
250 + @cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
251 +
252 +-install: installdirs install-intl-@USE_INCLUDED_LIBINTL@
253 ++install: $(OBJ_HEADERS) installdirs install-intl-@USE_INCLUDED_LIBINTL@
254 + @for d in $(SUBDIRS); do \
255 + (cd $${d} && $(MAKE) $@) || exit 1; \
256 + done
257
258 diff --git a/dev-lang/R/files/R-3.4.1-rmath-shared.patch b/dev-lang/R/files/R-3.4.1-rmath-shared.patch
259 new file mode 100644
260 index 00000000000..8bc6233de6d
261 --- /dev/null
262 +++ b/dev-lang/R/files/R-3.4.1-rmath-shared.patch
263 @@ -0,0 +1,21 @@
264 +--- a/src/nmath/standalone/Makefile.in 2017-07-05 23:20:26.098087600 +0000
265 ++++ b/src/nmath/standalone/Makefile.in 2017-07-05 23:21:55.087480310 +0000
266 +@@ -64,7 +64,8 @@
267 + Rexeclibdir_LTLIBRARIES = $(libRmath_la)
268 + libRmath_la_SOURCES = $(SOURCES)
269 + libRmath_la_OBJECTS = $(OBJECTS:.o=.lo)
270 +-libRmath_la_LDFLAGS =
271 ++libRmath_la_LDFLAGS = -Wl,-soname=libRmath.so
272 ++libRmath_la_LIBADD = $(LIBM)
273 +
274 + CLEANFILES = Makedeps *.d *.o *.lo test check.log $(SOURCES)
275 + DISTCLEANFILES = Makefile $(Rexeclibdir_LIBRARIES) $(Rexeclibdir_LTLIBRARIES)
276 +@@ -127,7 +128,7 @@
277 +
278 + ## under peculiar circumstances, $(LIBM) here helps.
279 + $(libRmath_la): $(libRmath_la_OBJECTS)
280 +- $(DYLIB_LINK) -o $@ $(libRmath_la_LDFLAGS) $(libRmath_la_OBJECTS) $(LIBM)
281 ++ $(DYLIB_LINK) $(libRmath_la_LDFLAGS) $(libRmath_la_OBJECTS) $(libRmath_la_LIBADD) -o $@
282 +
283 + test: $(srcdir)/test.c
284 + $(CC) -o $@ $(ALL_CPPFLAGS) $(ALL_CFLAGS) $(srcdir)/test.c \