/[gentoo-x86]/dev-lang/R/R-3.0.1.ebuild
Gentoo

Contents of /dev-lang/R/R-3.0.1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.14 - (show annotations) (download)
Tue Apr 7 09:10:10 2015 UTC (3 years, 1 month ago) by jlec
Branch: MAIN
CVS Tags: HEAD
Changes since 1.13: +4 -4 lines
Fix Slot operators

(Portage version: 2.2.18/cvs/Linux x86_64, signed Manifest commit with key B9D4F231BD1558AB!)

1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-lang/R/R-3.0.1.ebuild,v 1.13 2015/02/07 11:05:26 dilfridge Exp $
4
5 EAPI=5
6
7 inherit bash-completion-r1 autotools eutils flag-o-matic fortran-2 multilib versionator toolchain-funcs
8
9 BCP=${PN}-20130129.bash_completion
10 DESCRIPTION="Language and environment for statistical computing and graphics"
11 HOMEPAGE="http://www.r-project.org/"
12 SRC_URI="
13 mirror://cran/src/base/R-3/${P}.tar.gz
14 bash-completion? ( http://dev.gentoo.org/~bicatali/distfiles/${BCP}.bz2 )"
15
16 LICENSE="|| ( GPL-2 GPL-3 ) LGPL-2.1"
17 SLOT="0"
18 KEYWORDS="amd64 hppa ia64 ppc ppc64 sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux ~x64-macos"
19 IUSE="bash-completion cairo doc icu java jpeg lapack minimal nls openmp perl png prefix profile readline static-libs tiff tk X"
20 REQUIRED_USE="png? ( || ( cairo X ) ) jpeg? ( || ( cairo X ) ) tiff? ( || ( cairo X ) )"
21
22 CDEPEND="
23 app-arch/bzip2
24 app-text/ghostscript-gpl
25 dev-libs/libpcre
26 virtual/blas
27 cairo? ( x11-libs/cairo[X] x11-libs/pango )
28 icu? ( dev-libs/icu:= )
29 jpeg? ( virtual/jpeg:0 )
30 lapack? ( virtual/lapack )
31 perl? ( dev-lang/perl )
32 png? ( media-libs/libpng:0= )
33 readline? ( sys-libs/readline:0= )
34 tk? ( dev-lang/tk:0= )
35 X? ( x11-libs/libXmu x11-misc/xdg-utils )"
36
37 DEPEND="${CDEPEND}
38 virtual/pkgconfig
39 doc? (
40 virtual/latex-base
41 dev-texlive/texlive-fontsrecommended
42 )"
43
44 RDEPEND="${CDEPEND}
45 ( || ( <sys-libs/zlib-1.2.5.1-r1 >=sys-libs/zlib-1.2.5.1-r2[minizip] ) )
46 app-arch/xz-utils
47 java? ( >=virtual/jre-1.5 )"
48
49 RESTRICT="minimal? ( test )"
50
51 R_DIR="${EROOT%/}/usr/$(get_libdir)/${PN}"
52
53 pkg_setup() {
54 if use openmp; then
55 FORTRAN_NEED_OPENMP=1
56 tc-has-openmp || die "Please enable openmp support in your compiler"
57 fi
58 fortran-2_pkg_setup
59 filter-ldflags -Wl,-Bdirect -Bdirect
60 # avoid using existing R installation
61 unset R_HOME
62 # Temporary fix for bug #419761
63 if [[ ($(tc-getCC) == *gcc) && ($(gcc-version) == 4.7) ]]; then
64 append-flags -fno-ipa-cp-clone
65 fi
66 }
67
68 src_prepare() {
69 # gentoo bug #322965 (not applied upstream)
70 # https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=14505
71 epatch "${FILESDIR}"/${PN}-2.11.1-parallel.patch
72
73 # respect ldflags (not applied upstream)
74 # https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=14506
75 epatch "${FILESDIR}"/${PN}-2.12.1-ldflags.patch
76
77 # gentoo bug #383431
78 # https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=14951
79 epatch "${FILESDIR}"/${PN}-2.13.1-zlib_header_fix.patch
80
81 # https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=14953
82 epatch "${FILESDIR}"/${PN}-3.0.0-rmath-shared.patch
83
84 # fix packages.html for doc (gentoo bug #205103)
85 sed -i \
86 -e "s:../../../library:../../../../$(get_libdir)/R/library:g" \
87 src/library/tools/R/Rd.R || die
88
89 # fix Rscript path when installed (gentoo bug #221061)
90 sed -i \
91 -e "s:-DR_HOME='\"\$(rhome)\"':-DR_HOME='\"${R_DIR}\"':" \
92 src/unix/Makefile.in || die "sed unix Makefile failed"
93
94 # fix HTML links to manual (gentoo bug #273957)
95 sed -i \
96 -e 's:\.\./manual/:manual/:g' \
97 $(grep -Flr ../manual/ doc) || die "sed for HTML links failed"
98
99 use lapack && \
100 export LAPACK_LIBS="$($(tc-getPKG_CONFIG) --libs lapack)"
101
102 if use X; then
103 export R_BROWSER="$(type -p xdg-open)"
104 export R_PDFVIEWER="$(type -p xdg-open)"
105 fi
106 use perl && \
107 export PERL5LIB="${S}/share/perl:${PERL5LIB:+:}${PERL5LIB}"
108
109 # don't search /usr/local
110 sed -i -e '/FLAGS=.*\/local\//c\: # removed by ebuild' configure.ac || die
111 # Fix for Darwin (OS X)
112 if use prefix; then
113 if [[ ${CHOST} == *-darwin* ]] ; then
114 sed -i \
115 -e 's:-install_name libR.dylib:-install_name ${libdir}/R/lib/libR.dylib:' \
116 -e 's:-install_name libRlapack.dylib:-install_name ${libdir}/R/lib/libRlapack.dylib:' \
117 -e 's:-install_name libRblas.dylib:-install_name ${libdir}/R/lib/libRblas.dylib:' \
118 -e "/SHLIB_EXT/s/\.so/.dylib/" \
119 configure.ac || die
120 # sort of "undo" 2.14.1-rmath-shared.patch
121 sed -i \
122 -e "s:-Wl,-soname=libRmath.so:-install_name ${EROOT%/}/usr/$(get_libdir)/libRmath.dylib:" \
123 src/nmath/standalone/Makefile.in || die
124 else
125 append-ldflags -Wl,-rpath="${EROOT%/}/usr/$(get_libdir)/R/lib"
126 fi
127 fi
128 AT_M4DIR=m4 eaclocal
129 eautoconf
130 }
131
132 src_configure() {
133 econf \
134 --enable-byte-compiled-packages \
135 --enable-R-shlib \
136 --disable-R-framework \
137 --with-system-zlib \
138 --with-system-bzlib \
139 --with-system-pcre \
140 --with-system-xz \
141 --without-blas \
142 --docdir="${EPREFIX}/usr/share/doc/${PF}" \
143 rdocdir="${EPREFIX}/usr/share/doc/${PF}" \
144 $(use_enable nls) \
145 $(use_enable openmp) \
146 $(use_enable profile R-profiling) \
147 $(use_enable profile memory-profiling) \
148 $(use_enable static-libs static) \
149 $(use_enable static-libs R-static-lib) \
150 $(use_with cairo) \
151 $(use_with icu ICU) \
152 $(use_with jpeg jpeglib) \
153 $(use_with lapack) \
154 $(use_with !minimal recommended-packages) \
155 $(use_with png libpng) \
156 $(use_with readline) \
157 $(use_with tiff libtiff) \
158 $(use_with tk tcltk) \
159 $(use_with X x)
160 }
161
162 src_compile() {
163 export VARTEXFONTS="${T}/fonts"
164 emake AR="$(tc-getAR)"
165 emake -C src/nmath/standalone shared $(use static-libs && echo static) AR="$(tc-getAR)"
166 use doc && emake info pdf
167 }
168
169 src_install() {
170 default
171 emake -j1 -C src/nmath/standalone DESTDIR="${D}" install
172
173 if use doc; then
174 emake DESTDIR="${D}" install-info install-pdf
175 dosym ../manual /usr/share/doc/${PF}/html/manual
176 fi
177
178 cat > 99R <<-EOF
179 LDPATH=${R_DIR}/lib
180 R_HOME=${R_DIR}
181 EOF
182 doenvd 99R
183 use bash-completion && newbashcomp "${WORKDIR}"/${BCP} ${PN}
184 # The buildsystem has a different understanding of install_names than what
185 # we require. Since it builds modules like shared objects (wrong), many
186 # objects (all modules) get an incorrect install_name. Fixing the build
187 # system here is not really trivial.
188 if [[ ${CHOST} == *-darwin* ]] ; then
189 local mod
190 pushd "${ED}"/usr/lib/R > /dev/null
191 for mod in $(find . -name "*.dylib") ; do
192 mod=${mod#./}
193 install_name_tool -id "${EPREFIX}/usr/lib/R/${mod}" \
194 "${mod}"
195 done
196 popd > /dev/null
197 fi
198 docompress -x /usr/share/doc/${PF}/NEWS.rds
199 }
200
201 pkg_postinst() {
202 if use java; then
203 einfo "Re-initializing java paths for ${P}"
204 R CMD javareconf
205 fi
206 }

  ViewVC Help
Powered by ViewVC 1.1.20