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