Gentoo Archives: gentoo-commits

From: Mark Wright <gienah@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/R/
Date: Sun, 24 May 2020 05:04:15
Message-Id: 1590296404.c50d7c8594743247a9df75e21ad0dd6dc3747911.gienah@gentoo
1 commit: c50d7c8594743247a9df75e21ad0dd6dc3747911
2 Author: Mark Wright <gienah <AT> gentoo <DOT> org>
3 AuthorDate: Sun May 24 05:00:04 2020 +0000
4 Commit: Mark Wright <gienah <AT> gentoo <DOT> org>
5 CommitDate: Sun May 24 05:00:04 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c50d7c85
7
8 dev-lang/R: Thanks to Neil for help with bump to 4.0.0
9
10 Closes: https://bugs.gentoo.org/719210
11 Package-Manager: Portage-2.3.99, Repoman-2.3.22
12 Signed-off-by: Mark Wright <gienah <AT> gentoo.org>
13
14 dev-lang/R/Manifest | 1 +
15 dev-lang/R/R-4.0.0.ebuild | 234 ++++++++++++++++++++++++++++++++++++++++++++++
16 2 files changed, 235 insertions(+)
17
18 diff --git a/dev-lang/R/Manifest b/dev-lang/R/Manifest
19 index 7fd12a8b015..18eb82e449d 100644
20 --- a/dev-lang/R/Manifest
21 +++ b/dev-lang/R/Manifest
22 @@ -1,3 +1,4 @@
23 DIST R-3.4.1.tar.gz 30200109 BLAKE2B 03602e9a48759caee8ce047fa6273df7a54af089de4489e21953c0e3fc7bfdf720d924f1e0167d3dbf65f63ed42ac10dea8b45289b921cda1c0e6d25a0063ebb SHA512 19bd50c87dc001ef947c15c1760f27ac8986ff6b43c6d90d3093ae184e42963027ef06faf31ec57ac9e519af7a35a2f53f8ea23ef75d800ebbd02945cedc4651
24 DIST R-3.6.3.tar.gz 33308185 BLAKE2B f82751e21d3b502132f8f27d4fc47a921fb085a50c3da3b45e08fbbdd1ab3d42e89b4fa6653a570c21176d79f492277b1d0b86c3c9f4da1386d8b6e4771d4d2c SHA512 9b1dc78922e431bd1af81e6e560b10ad04d121718f680fed32db735d561fd40ea6028759976722db11559f1a78fe684119b766f0567128cb2ee5003aa87a0931
25 +DIST R-4.0.0.tar.gz 33173947 BLAKE2B 6b67ba5b008f1fd3d5fa3c92805c1e206ece64e821124e3b2d6f72a550ed8084699916b88d41dcc1985b57a286518dcf63d240503aeb2ae7fe31e66c0d30396d SHA512 fa8b684fd0c8a1c9784b8e0e749b34141e513a83d4f3b6792cdf97826264191e7484f6705014974c9268570e717e1a1d39f6a88225fc751189b6f51e1a303163
26 DIST R-78d6830e28ea90a046da79a9b4f70c39594bb6d6.bash_completion 13596 BLAKE2B 53338e4a1c4f68beb69247216e553dbcac47f660fbf032bfebf7a660e32d2cff5b11ed35411c52de7e1fd6e00bbf5b5ea19369a325fa0a38bd93d63dc3288cbd SHA512 9ccd19bb1b0c18a2f13035ccd6809447429e197e298fb4d1df808ef345d723b42f75a1b91c349f6dbb46e4a82e59ef33e11300c495d79b63d670d0c0f2b16a06
27
28 diff --git a/dev-lang/R/R-4.0.0.ebuild b/dev-lang/R/R-4.0.0.ebuild
29 new file mode 100644
30 index 00000000000..64a0a4e0b49
31 --- /dev/null
32 +++ b/dev-lang/R/R-4.0.0.ebuild
33 @@ -0,0 +1,234 @@
34 +# Copyright 1999-2020 Gentoo Authors
35 +# Distributed under the terms of the GNU General Public License v2
36 +
37 +EAPI=7
38 +
39 +inherit bash-completion-r1 autotools eutils flag-o-matic fortran-2 multilib 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="http://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 ~x64-macos"
53 +IUSE="cairo doc icu java jpeg lapack minimal nls openmp perl png prefix profile readline static-libs test tiff tk X"
54 +REQUIRED_USE="png? ( || ( cairo X ) ) jpeg? ( || ( cairo X ) ) tiff? ( || ( cairo X ) )"
55 +
56 +# At least one package installation in the test suite requires TeX,
57 +# and will fail without it (bug #718056).
58 +BDEPEND="virtual/pkgconfig
59 + doc? (
60 + virtual/latex-base
61 + dev-texlive/texlive-fontsrecommended
62 + )
63 + test? ( virtual/latex-base )"
64 +DEPEND="
65 + app-arch/bzip2:0=
66 + app-arch/xz-utils:0=
67 + app-text/ghostscript-gpl
68 + dev-libs/libpcre:3=
69 + net-libs/libtirpc
70 + net-misc/curl
71 + virtual/blas:0
72 + || ( sys-apps/coreutils app-misc/realpath )
73 + cairo? ( x11-libs/cairo:0=[X=] x11-libs/pango:0= )
74 + icu? ( dev-libs/icu:= )
75 + jpeg? ( virtual/jpeg:0 )
76 + lapack? ( virtual/lapack:0 )
77 + perl? ( dev-lang/perl )
78 + png? ( media-libs/libpng:0= )
79 + readline? ( sys-libs/readline:0= )
80 + tiff? ( media-libs/tiff:0= )
81 + tk? ( dev-lang/tk:0= )
82 + X? ( x11-libs/libXmu:0= x11-misc/xdg-utils )"
83 +
84 +RDEPEND="${DEPEND}
85 + sys-libs/zlib:0[minizip]
86 + java? ( >=virtual/jre-1.5 )"
87 +
88 +RESTRICT="minimal? ( test )
89 + !test? ( test )"
90 +
91 +PATCHES=(
92 + "${FILESDIR}"/${PN}-3.4.1-parallel.patch
93 + "${FILESDIR}"/${PN}-3.4.1-rmath-shared.patch
94 + "${FILESDIR}"/${PN}-3.6.2-no-LDFLAGS-in-libR-pkg-config.patch
95 + "${FILESDIR}"/${PN}-3.6.2-no-gzip-doc.patch
96 +)
97 +
98 +pkg_pretend() {
99 + [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
100 +}
101 +
102 +pkg_setup() {
103 + if [[ ${MERGE_TYPE} != binary ]] && use openmp; then
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
159 + eautoreconf
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 + rdocdir="${EPREFIX}/usr/share/doc/${PF}" \
171 + $(use_enable java) \
172 + $(use_enable nls) \
173 + $(use_enable openmp) \
174 + $(use_enable profile R-profiling) \
175 + $(use_enable profile memory-profiling) \
176 + $(use_enable static-libs static) \
177 + $(use_enable static-libs R-static-lib) \
178 + $(use_with cairo) \
179 + $(use_with icu ICU) \
180 + $(use_with jpeg jpeglib) \
181 + $(use_with lapack) \
182 + $(use_with !minimal recommended-packages) \
183 + $(use_with png libpng) \
184 + $(use_with readline) \
185 + $(use_with tiff libtiff) \
186 + $(use_with tk tcltk) \
187 + $(use_with tk tk-config "${EPREFIX}"/usr/$(get_libdir)/tkConfig.sh) \
188 + $(use_with tk tcl-config "${EPREFIX}"/usr/$(get_libdir)/tclConfig.sh) \
189 + $(use_with X x)
190 +}
191 +
192 +src_compile() {
193 + export VARTEXFONTS="${T}/fonts"
194 + emake AR="$(tc-getAR)"
195 + emake -C src/nmath/standalone \
196 + shared $(use static-libs && echo static) AR="$(tc-getAR)"
197 + use doc && emake info pdf
198 +}
199 +
200 +src_install() {
201 + default
202 + emake -j1 -C src/nmath/standalone DESTDIR="${D}" install
203 +
204 + if use doc; then
205 + emake DESTDIR="${D}" install-info install-pdf
206 + dosym ../manual /usr/share/doc/${PF}/html/manual
207 + fi
208 +
209 + cat > 99R <<-EOF
210 + LDPATH=${EROOT}/usr/$(get_libdir)/${PN}/lib
211 + R_HOME=${EROOT}/usr/$(get_libdir)/${PN}
212 + EOF
213 + doenvd 99R
214 + newbashcomp "${DISTDIR}"/${PN}-${BCPV}.bash_completion ${PN}
215 + # The buildsystem has a different understanding of install_names than
216 + # we require. Since it builds modules like shared objects (wrong), many
217 + # objects (all modules) get an incorrect install_name. Fixing the build
218 + # system here is not really trivial.
219 + if [[ ${CHOST} == *-darwin* ]] ; then
220 + local mod
221 + pushd "${ED}"/usr/$(get_libdir)/R > /dev/null
222 + for mod in $(find . -name "*.dylib") ; do
223 + mod=${mod#./}
224 + install_name_tool -id "${EPREFIX}/usr/$(get_libdir)/R/${mod}" \
225 + "${mod}"
226 + done
227 + popd > /dev/null
228 + fi
229 +
230 + # Users are encouraged to access some of the the R documentation
231 + # interactively, through functions like "contributors()" that
232 + # tries to open the "AUTHORS" file. Other files can be accessed
233 + # by name with RShowDoc(), and the documentation for e.g. license()
234 + # and RShowDoc() suggests a few of these names. Here we try to
235 + # collect as many names as possible that a user might actually
236 + # try to view through R, because if we don't decompress them,
237 + # then R doesn't know what to do with 'em. Bug #556706.
238 + INTERACTIVE_DOCS=(
239 + AUTHORS
240 + COPYING
241 + FAQ
242 + NEWS
243 + THANKS
244 + )
245 +
246 + # Other data sources that are shipped as "documentation," but which
247 + # need to be accessible via their original unmolested filenames.
248 + INTERACTIVE_DATA=(
249 + BioC_mirrors.csv
250 + CRAN_mirrors.csv
251 + KEYWORDS.db
252 + NEWS.rds
253 + )
254 +
255 + NOCOMPRESS_DOCS=( "${INTERACTIVE_DOCS[@]}" "${INTERACTIVE_DATA[@]}" )
256 +
257 + for f in "${NOCOMPRESS_DOCS[@]}"; do
258 + docompress -x "/usr/share/doc/${PF}/${f}"
259 + done
260 +}
261 +
262 +pkg_postinst() {
263 + if use java; then
264 + einfo "Re-initializing java paths for ${P}"
265 + R CMD javareconf
266 + fi
267 +}