Gentoo Archives: gentoo-commits

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