Gentoo Archives: gentoo-commits

From: Michael Orlitzky <mjo@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/R/
Date: Mon, 12 Jul 2021 14:11:51
Message-Id: 1626099100.6b3b5b20fe9c71906a674908c8dd08d38706804b.mjo@gentoo
1 commit: 6b3b5b20fe9c71906a674908c8dd08d38706804b
2 Author: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jul 12 14:07:28 2021 +0000
4 Commit: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
5 CommitDate: Mon Jul 12 14:11:40 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6b3b5b20
7
8 dev-lang/R: new version 4.1.0.
9
10 New upstream version with a few other ebuild improvements:
11
12 * Use https in HOMEPAGE.
13 * Remove workaround for upstream bug 17836.
14 * Add support (USE=lto) for link-time optimization.
15 * Remove an old gcc-4.x workaround.
16
17 Closes: https://bugs.gentoo.org/792426
18 Package-Manager: Portage-3.0.20, Repoman-3.0.2
19 Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>
20
21 dev-lang/R/Manifest | 1 +
22 dev-lang/R/R-4.1.0.ebuild | 235 ++++++++++++++++++++++++++++++++++++++++++++++
23 dev-lang/R/metadata.xml | 5 +
24 3 files changed, 241 insertions(+)
25
26 diff --git a/dev-lang/R/Manifest b/dev-lang/R/Manifest
27 index 72da37844ea..e217fbc0125 100644
28 --- a/dev-lang/R/Manifest
29 +++ b/dev-lang/R/Manifest
30 @@ -1,3 +1,4 @@
31 DIST R-4.0.4.tar.gz 33687611 BLAKE2B 40cdfd98fe6c9193deb729d151631c2b0f935accf5ea6251704b633d2688278af1a5a67317152be023fb4a10315c64e473f58276bb0c3fadb1141c35391ad22e SHA512 811c4407a083eb776f92c3cbacb1dc7eada8890a8c27678c6c82bef9db52b1afaefeb408fbe11e46922740adee498f32e7ddf7451b3ab89cf60773737e47f8be
32 DIST R-4.0.5.tar.gz 32466444 BLAKE2B 5dbbd289f4fd6347b4109eecaf65b50b5793a83edddd2cb391c20473607f136d91a8e9f4ab9e453f6927d2ca9145762920424e3a1dcea89309afde56efd5d32c SHA512 6ff5b0f9cb6b17f66cde1f5585d1b33659dbae8919d34c2e593f68a0bff4d0425aa9704d99284d103702a9cd42f613311f3a87af6b939b1af65dcec80bf2ca8c
33 +DIST R-4.1.0.tar.gz 33714683 BLAKE2B 22ba966b5a29f153f3ce6cbc467e815c397e7c6aade0db62c7d2ae044056d9227da4dcb8fbf33e661548f4f434c328415e297c6b07b3932ef3f47358c2543f42 SHA512 41519bf06a1ebc2bb582e9a7c35d0e82e213312dec8147861a7f9b28ee750cd40dfbf02737602d05698641fcea6182b0da8131e83edacc358e98eca0a393b729
34 DIST R-78d6830e28ea90a046da79a9b4f70c39594bb6d6.bash_completion 13596 BLAKE2B 53338e4a1c4f68beb69247216e553dbcac47f660fbf032bfebf7a660e32d2cff5b11ed35411c52de7e1fd6e00bbf5b5ea19369a325fa0a38bd93d63dc3288cbd SHA512 9ccd19bb1b0c18a2f13035ccd6809447429e197e298fb4d1df808ef345d723b42f75a1b91c349f6dbb46e4a82e59ef33e11300c495d79b63d670d0c0f2b16a06
35
36 diff --git a/dev-lang/R/R-4.1.0.ebuild b/dev-lang/R/R-4.1.0.ebuild
37 new file mode 100644
38 index 00000000000..775e4cb5b02
39 --- /dev/null
40 +++ b/dev-lang/R/R-4.1.0.ebuild
41 @@ -0,0 +1,235 @@
42 +# Copyright 1999-2021 Gentoo Authors
43 +# Distributed under the terms of the GNU General Public License v2
44 +
45 +EAPI=7
46 +
47 +inherit bash-completion-r1 autotools flag-o-matic fortran-2 toolchain-funcs
48 +
49 +# latest git commit for R bash completion: https://github.com/deepayan/rcompletion
50 +BCPV=78d6830e28ea90a046da79a9b4f70c39594bb6d6
51 +
52 +DESCRIPTION="Language and environment for statistical computing and graphics"
53 +HOMEPAGE="https://www.r-project.org/"
54 +SRC_URI="
55 + mirror://cran/src/base/R-4/${P}.tar.gz
56 + https://raw.githubusercontent.com/deepayan/rcompletion/${BCPV}/bash_completion/R -> ${PN}-${BCPV}.bash_completion"
57 +
58 +LICENSE="|| ( GPL-2 GPL-3 ) LGPL-2.1"
59 +SLOT="0"
60 +KEYWORDS="~amd64 ~arm64 ~hppa ~ia64 ~sparc ~x86 ~amd64-linux ~x86-linux"
61 +IUSE="cairo doc icu java jpeg lapack lto minimal nls openmp perl png prefix profile readline static-libs test tiff tk X"
62 +
63 +REQUIRED_USE="png? ( || ( cairo X ) )
64 + jpeg? ( || ( cairo X ) )
65 + tiff? ( || ( cairo X ) )
66 +"
67 +
68 +# At least one package installation in the test suite requires TeX,
69 +# and will fail without it (bug #718056).
70 +BDEPEND="virtual/pkgconfig
71 + doc? (
72 + virtual/latex-base
73 + dev-texlive/texlive-fontsrecommended
74 + )
75 + test? ( virtual/latex-base )"
76 +DEPEND="
77 + app-arch/bzip2:0=
78 + app-arch/xz-utils:0=
79 + app-text/ghostscript-gpl
80 + dev-libs/libpcre2:=
81 + net-libs/libtirpc
82 + net-misc/curl
83 + virtual/blas:0
84 + || ( sys-apps/coreutils app-misc/realpath )
85 + cairo? ( x11-libs/cairo:0=[X=] x11-libs/pango:0= )
86 + icu? ( dev-libs/icu:= )
87 + jpeg? ( virtual/jpeg:0 )
88 + lapack? ( virtual/lapack:0 )
89 + perl? ( dev-lang/perl )
90 + png? ( media-libs/libpng:0= )
91 + readline? ( sys-libs/readline:0= )
92 + tiff? ( media-libs/tiff:0= )
93 + tk? ( dev-lang/tk:0= )
94 + X? ( x11-libs/libXmu:0= x11-misc/xdg-utils )"
95 +
96 +RDEPEND="${DEPEND}
97 + sys-libs/zlib:0[minizip]
98 + java? ( >=virtual/jre-1.8:* )"
99 +
100 +RESTRICT="minimal? ( test )
101 + !test? ( test )"
102 +
103 +PATCHES=(
104 + "${FILESDIR}"/${PN}-3.4.1-parallel.patch
105 + "${FILESDIR}"/${PN}-3.4.1-rmath-shared.patch
106 + "${FILESDIR}"/${PN}-3.6.2-no-LDFLAGS-in-libR-pkg-config.patch
107 + "${FILESDIR}"/${PN}-3.6.2-no-gzip-doc.patch
108 +)
109 +
110 +pkg_pretend() {
111 + [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
112 +}
113 +
114 +pkg_setup() {
115 + if [[ ${MERGE_TYPE} != binary ]] && use openmp; then
116 + FORTRAN_NEED_OPENMP=1
117 + fi
118 + fortran-2_pkg_setup
119 + filter-ldflags -Wl,-Bdirect -Bdirect
120 + # avoid using existing R installation
121 + unset R_HOME
122 +}
123 +
124 +src_prepare() {
125 + default
126 +
127 + # fix packages.html for doc (gentoo bug #205103)
128 + sed -e "s:../../../library:../../../../$(get_libdir)/R/library:g" \
129 + -i src/library/tools/R/Rd.R || die
130 +
131 + # fix Rscript path when installed (gentoo bug #221061)
132 + sed -e "s:-DR_HOME='\"\$(rhome)\"':-DR_HOME='\"${EROOT}/usr/$(get_libdir)/${PN}\"':" \
133 + -i src/unix/Makefile.in || die "sed unix Makefile failed"
134 +
135 + # fix HTML links to manual (gentoo bug #273957)
136 + sed -e 's:\.\./manual/:manual/:g' \
137 + -i $(grep -Flr ../manual/ doc) || die "sed for HTML links failed"
138 +
139 + use lapack && \
140 + export LAPACK_LIBS="$($(tc-getPKG_CONFIG) --libs lapack)"
141 +
142 + if use X; then
143 + export R_BROWSER="$(type -p xdg-open)"
144 + export R_PDFVIEWER="$(type -p xdg-open)"
145 + fi
146 + use perl && \
147 + export PERL5LIB="${S}/share/perl:${PERL5LIB:+:}${PERL5LIB}"
148 +
149 + # don't search /usr/local
150 + sed -i -e '/FLAGS=.*\/local\//c\: # removed by ebuild' configure.ac || die
151 + # Fix for Darwin (OS X)
152 + if use prefix; then
153 + if [[ ${CHOST} == *-darwin* ]] ; then
154 + sed -e 's:-install_name libR.dylib:-install_name ${libdir}/R/lib/libR.dylib:' \
155 + -e 's:-install_name libRlapack.dylib:-install_name ${libdir}/R/lib/libRlapack.dylib:' \
156 + -e 's:-install_name libRblas.dylib:-install_name ${libdir}/R/lib/libRblas.dylib:' \
157 + -e "/SHLIB_EXT/s/\.so/.dylib/" \
158 + -i configure.ac || die
159 + # sort of "undo" 2.14.1-rmath-shared.patch
160 + sed -e "s:-Wl,-soname=libRmath.so:-install_name ${EROOT}/usr/$(get_libdir)/libRmath.dylib:" \
161 + -i src/nmath/standalone/Makefile.in || die
162 + else
163 + append-ldflags -Wl,-rpath="${EROOT}/usr/$(get_libdir)/R/lib"
164 + fi
165 + fi
166 + AT_M4DIR=m4
167 + eautoreconf
168 +}
169 +
170 +src_configure() {
171 + # --with-system-tre \
172 + # tre is patched from upstream
173 + econf \
174 + --enable-byte-compiled-packages \
175 + --enable-R-shlib \
176 + --disable-R-framework \
177 + --with-blas="$($(tc-getPKG_CONFIG) --libs blas)" \
178 + rdocdir="${EPREFIX}/usr/share/doc/${PF}" \
179 + $(use_enable java) \
180 + $(use_enable lto lto R)
181 + $(use_enable nls) \
182 + $(use_enable openmp) \
183 + $(use_enable profile R-profiling) \
184 + $(use_enable profile memory-profiling) \
185 + $(use_enable static-libs static) \
186 + $(use_enable static-libs R-static-lib) \
187 + $(use_with cairo) \
188 + $(use_with icu ICU) \
189 + $(use_with jpeg jpeglib) \
190 + $(use_with lapack) \
191 + $(use_with !minimal recommended-packages) \
192 + $(use_with png libpng) \
193 + $(use_with readline) \
194 + $(use_with tiff libtiff) \
195 + $(use_with tk tcltk) \
196 + $(use_with tk tk-config "${EPREFIX}"/usr/$(get_libdir)/tkConfig.sh) \
197 + $(use_with tk tcl-config "${EPREFIX}"/usr/$(get_libdir)/tclConfig.sh) \
198 + $(use_with X x)
199 +}
200 +
201 +src_compile() {
202 + export VARTEXFONTS="${T}/fonts"
203 + emake AR="$(tc-getAR)"
204 + emake -C src/nmath/standalone \
205 + shared $(use static-libs && echo static) AR="$(tc-getAR)"
206 + use doc && emake info pdf
207 +}
208 +
209 +src_install() {
210 + default
211 + emake -j1 -C src/nmath/standalone DESTDIR="${D}" install
212 +
213 + if use doc; then
214 + emake DESTDIR="${D}" install-info install-pdf
215 + dosym ../manual /usr/share/doc/${PF}/html/manual
216 + fi
217 +
218 + cat > 99R <<-EOF
219 + LDPATH=${EROOT}/usr/$(get_libdir)/${PN}/lib
220 + R_HOME=${EROOT}/usr/$(get_libdir)/${PN}
221 + EOF
222 + doenvd 99R
223 + newbashcomp "${DISTDIR}"/${PN}-${BCPV}.bash_completion ${PN}
224 + # The buildsystem has a different understanding of install_names than
225 + # we require. Since it builds modules like shared objects (wrong), many
226 + # objects (all modules) get an incorrect install_name. Fixing the build
227 + # system here is not really trivial.
228 + if [[ ${CHOST} == *-darwin* ]] ; then
229 + local mod
230 + pushd "${ED}"/usr/$(get_libdir)/R > /dev/null
231 + for mod in $(find . -name "*.dylib") ; do
232 + mod=${mod#./}
233 + install_name_tool -id "${EPREFIX}/usr/$(get_libdir)/R/${mod}" \
234 + "${mod}"
235 + done
236 + popd > /dev/null
237 + fi
238 +
239 + # Users are encouraged to access some of the the R documentation
240 + # interactively, through functions like "contributors()" that
241 + # tries to open the "AUTHORS" file. Other files can be accessed
242 + # by name with RShowDoc(), and the documentation for e.g. license()
243 + # and RShowDoc() suggests a few of these names. Here we try to
244 + # collect as many names as possible that a user might actually
245 + # try to view through R, because if we don't decompress them,
246 + # then R doesn't know what to do with 'em. Bug #556706.
247 + INTERACTIVE_DOCS=(
248 + AUTHORS
249 + COPYING
250 + FAQ
251 + NEWS
252 + THANKS
253 + )
254 +
255 + # Other data sources that are shipped as "documentation," but which
256 + # need to be accessible via their original unmolested filenames.
257 + INTERACTIVE_DATA=(
258 + BioC_mirrors.csv
259 + CRAN_mirrors.csv
260 + KEYWORDS.db
261 + NEWS.rds
262 + )
263 +
264 + NOCOMPRESS_DOCS=( "${INTERACTIVE_DOCS[@]}" "${INTERACTIVE_DATA[@]}" )
265 +
266 + for f in "${NOCOMPRESS_DOCS[@]}"; do
267 + docompress -x "/usr/share/doc/${PF}/${f}"
268 + done
269 +}
270 +
271 +pkg_postinst() {
272 + if use java; then
273 + einfo "Re-initializing java paths for ${P}"
274 + R CMD javareconf
275 + fi
276 +}
277
278 diff --git a/dev-lang/R/metadata.xml b/dev-lang/R/metadata.xml
279 index 8972d9ed88c..e9bebc0e016 100644
280 --- a/dev-lang/R/metadata.xml
281 +++ b/dev-lang/R/metadata.xml
282 @@ -5,6 +5,11 @@
283 <email>sci-mathematics@g.o</email>
284 <name>Gentoo Mathematics Project</name>
285 </maintainer>
286 + <use>
287 + <flag name="lto">
288 + Use link-time optimization for R and its recommended packages.
289 + </flag>
290 + </use>
291 <longdescription lang="en">
292 R is GNU S, a system for statistical computation and graphics. It
293 consists of a language plus a run-time environment with graphics, a