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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Mon Sep 1 16:42:31 2014 UTC (3 years, 5 months ago) by mgorny
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +2 -2 lines
Remove := subslot operator from || () block since it is meaningless and broken.

(Portage version: 2.2.11_p178/cvs/Linux x86_64, signed Manifest commit with key EFB4464E!)

1 # Copyright 1999-2014 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.3.ebuild,v 1.4 2014/04/16 16:01:44 bicatali 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:0=
24 app-arch/xz-utils:0=
25 app-text/ghostscript-gpl
26 dev-libs/libpcre:3=
27 virtual/blas:0
28 || ( >=sys-apps/coreutils-8.15 sys-freebsd/freebsd-bin app-misc/realpath )
29 cairo? ( x11-libs/cairo[X] x11-libs/pango )
30 icu? ( dev-libs/icu:= )
31 jpeg? ( virtual/jpeg:0 )
32 lapack? ( virtual/lapack:0 )
33 perl? ( dev-lang/perl )
34 png? ( media-libs/libpng:0= )
35 readline? ( sys-libs/readline:0= )
36 tiff? ( media-libs/tiff:0= )
37 tk? ( dev-lang/tk:0= )
38 X? ( x11-libs/libXmu:0= x11-misc/xdg-utils )"
39
40 DEPEND="${CDEPEND}
41 virtual/pkgconfig
42 doc? (
43 virtual/latex-base
44 dev-texlive/texlive-fontsrecommended
45 )"
46
47 RDEPEND="${CDEPEND}
48 ( || ( <sys-libs/zlib-1.2.5.1-r1:0 >=sys-libs/zlib-1.2.5.1-r2:0[minizip] ) )
49 java? ( >=virtual/jre-1.5 )"
50
51 RESTRICT="minimal? ( test )"
52
53 R_DIR="${EROOT%/}/usr/$(get_libdir)/${PN}"
54
55 pkg_setup() {
56 if use openmp; then
57 if [[ $(tc-getCC) == *gcc ]] && ! tc-has-openmp; then
58 ewarn "OpenMP is not available in your current selected gcc"
59 die "need openmp capable gcc"
60 fi
61 FORTRAN_NEED_OPENMP=1
62 fi
63 fortran-2_pkg_setup
64 filter-ldflags -Wl,-Bdirect -Bdirect
65 # avoid using existing R installation
66 unset R_HOME
67 # Temporary fix for bug #419761
68 if [[ ($(tc-getCC) == *gcc) && ($(gcc-version) == 4.7) ]]; then
69 append-flags -fno-ipa-cp-clone
70 fi
71 }
72
73 src_prepare() {
74 epatch \
75 "${FILESDIR}"/${PN}-2.11.1-parallel.patch \
76 "${FILESDIR}"/${PN}-2.13.1-zlib_header_fix.patch \
77 "${FILESDIR}"/${PN}-3.0.0-rmath-shared.patch
78
79 # fix packages.html for doc (gentoo bug #205103)
80 sed -i \
81 -e "s:../../../library:../../../../$(get_libdir)/R/library:g" \
82 src/library/tools/R/Rd.R || die
83
84 # fix Rscript path when installed (gentoo bug #221061)
85 sed -i \
86 -e "s:-DR_HOME='\"\$(rhome)\"':-DR_HOME='\"${R_DIR}\"':" \
87 src/unix/Makefile.in || die "sed unix Makefile failed"
88
89 # fix HTML links to manual (gentoo bug #273957)
90 sed -i \
91 -e 's:\.\./manual/:manual/:g' \
92 $(grep -Flr ../manual/ doc) || die "sed for HTML links failed"
93
94 use lapack && \
95 export LAPACK_LIBS="$($(tc-getPKG_CONFIG) --libs lapack)"
96
97 if use X; then
98 export R_BROWSER="$(type -p xdg-open)"
99 export R_PDFVIEWER="$(type -p xdg-open)"
100 fi
101 use perl && \
102 export PERL5LIB="${S}/share/perl:${PERL5LIB:+:}${PERL5LIB}"
103
104 # don't search /usr/local
105 sed -i -e '/FLAGS=.*\/local\//c\: # removed by ebuild' configure.ac || die
106 # Fix for Darwin (OS X)
107 if use prefix; then
108 if [[ ${CHOST} == *-darwin* ]] ; then
109 sed -i \
110 -e 's:-install_name libR.dylib:-install_name ${libdir}/R/lib/libR.dylib:' \
111 -e 's:-install_name libRlapack.dylib:-install_name ${libdir}/R/lib/libRlapack.dylib:' \
112 -e 's:-install_name libRblas.dylib:-install_name ${libdir}/R/lib/libRblas.dylib:' \
113 -e "/SHLIB_EXT/s/\.so/.dylib/" \
114 configure.ac || die
115 # sort of "undo" 2.14.1-rmath-shared.patch
116 sed -i \
117 -e "s:-Wl,-soname=libRmath.so:-install_name ${EROOT%/}/usr/$(get_libdir)/libRmath.dylib:" \
118 src/nmath/standalone/Makefile.in || die
119 else
120 append-ldflags -Wl,-rpath="${EROOT%/}/usr/$(get_libdir)/R/lib"
121 fi
122 fi
123 AT_M4DIR=m4 eaclocal
124 eautoconf
125 }
126
127 src_configure() {
128 econf \
129 --enable-byte-compiled-packages \
130 --enable-R-shlib \
131 --disable-R-framework \
132 --with-system-zlib \
133 --with-system-bzlib \
134 --with-system-pcre \
135 --with-system-xz \
136 --with-blas="$($(tc-getPKG_CONFIG) --libs blas)" \
137 --docdir="${EPREFIX}/usr/share/doc/${PF}" \
138 rdocdir="${EPREFIX}/usr/share/doc/${PF}" \
139 $(use_enable nls) \
140 $(use_enable openmp) \
141 $(use_enable profile R-profiling) \
142 $(use_enable profile memory-profiling) \
143 $(use_enable static-libs static) \
144 $(use_enable static-libs R-static-lib) \
145 $(use_with cairo) \
146 $(use_with icu ICU) \
147 $(use_with jpeg jpeglib) \
148 $(use_with lapack) \
149 $(use_with !minimal recommended-packages) \
150 $(use_with png libpng) \
151 $(use_with readline) \
152 $(use_with tiff libtiff) \
153 $(use_with tk tcltk) \
154 $(use_with tk tk-config "${EPREFIX}"/usr/lib/tkConfig.sh) \
155 $(use_with tk tcl-config "${EPREFIX}"/usr/lib/tclConfig.sh) \
156 $(use_with X x)
157 }
158
159 src_compile() {
160 export VARTEXFONTS="${T}/fonts"
161 emake AR="$(tc-getAR)"
162 emake -C src/nmath/standalone shared $(use static-libs && echo static) AR="$(tc-getAR)"
163 use doc && emake info pdf
164 }
165
166 src_install() {
167 default
168 emake -j1 -C src/nmath/standalone DESTDIR="${D}" install
169
170 if use doc; then
171 emake DESTDIR="${D}" install-info install-pdf
172 dosym ../manual /usr/share/doc/${PF}/html/manual
173 fi
174
175 cat > 99R <<-EOF
176 LDPATH=${R_DIR}/lib
177 R_HOME=${R_DIR}
178 EOF
179 doenvd 99R
180 use bash-completion && newbashcomp "${WORKDIR}"/${BCP} ${PN}
181 # The buildsystem has a different understanding of install_names than what
182 # we require. Since it builds modules like shared objects (wrong), many
183 # objects (all modules) get an incorrect install_name. Fixing the build
184 # system here is not really trivial.
185 if [[ ${CHOST} == *-darwin* ]] ; then
186 local mod
187 pushd "${ED}"/usr/lib/R > /dev/null
188 for mod in $(find . -name "*.dylib") ; do
189 mod=${mod#./}
190 install_name_tool -id "${EPREFIX}/usr/lib/R/${mod}" \
191 "${mod}"
192 done
193 popd > /dev/null
194 fi
195 docompress -x /usr/share/doc/${PF}/NEWS.rds
196 }
197
198 pkg_postinst() {
199 if use java; then
200 einfo "Re-initializing java paths for ${P}"
201 R CMD javareconf
202 fi
203 }

  ViewVC Help
Powered by ViewVC 1.1.20