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

Contents of /dev-lang/R/R-2.15.2-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Tue Jan 29 18:27:44 2013 UTC (2 years ago) by bicatali
Branch: MAIN
Changes since 1.1: +4 -3 lines
Fixed bash completion spaces (bug #417951, thanks Marco Poletti) and parallel build (bug #395403)

(Portage version: 2.2.01.21688-prefix/cvs/Linux x86_64, signed Manifest commit with key 0x13CB1360)

1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-lang/R/R-2.15.2-r1.ebuild,v 1.1 2013/01/28 22:49:47 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="mirror://cran/src/base/R-2/${P}.tar.gz
13 SRC_URI="http://dev.gentoo.org/~bicatali/distfiles/${P}.tar.bz2
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="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-fbsd ~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 )
30 lapack? ( virtual/lapack )
31 perl? ( dev-lang/perl )
32 png? ( media-libs/libpng )
33 readline? ( sys-libs/readline )
34 tk? ( dev-lang/tk )
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}-2.14.1-rmath-shared.patch
83
84 # fix cairo plots (gentoo bug #453048)
85 epatch "${FILESDIR}"/${PN}-2.15.2-cairo.patch
86
87 # fix packages.html for doc (gentoo bug #205103)
88 sed -i \
89 -e "s:../../../library:../../../../$(get_libdir)/R/library:g" \
90 src/library/tools/R/Rd.R || die
91
92 # fix Rscript path when installed (gentoo bug #221061)
93 sed -i \
94 -e "s:-DR_HOME='\"\$(rhome)\"':-DR_HOME='\"${R_DIR}\"':" \
95 src/unix/Makefile.in || die "sed unix Makefile failed"
96
97 # fix HTML links to manual (gentoo bug #273957)
98 sed -i \
99 -e 's:\.\./manual/:manual/:g' \
100 $(grep -Flr ../manual/ doc) || die "sed for HTML links failed"
101
102 use lapack && \
103 export LAPACK_LIBS="$($(tc-getPKG_CONFIG) --libs lapack)"
104
105 if use X; then
106 export R_BROWSER="$(type -p xdg-open)"
107 export R_PDFVIEWER="$(type -p xdg-open)"
108 fi
109 use perl && \
110 export PERL5LIB="${S}/share/perl:${PERL5LIB:+:}${PERL5LIB}"
111
112 # don't search /usr/local
113 sed -i -e '/FLAGS=.*\/local\//c\: # removed by ebuild' configure.ac || die
114 # Fix for Darwin (OS X)
115 if use prefix; then
116 if [[ ${CHOST} == *-darwin* ]] ; then
117 sed -i \
118 -e 's:-install_name libR.dylib:-install_name ${libdir}/R/lib/libR.dylib:' \
119 -e 's:-install_name libRlapack.dylib:-install_name ${libdir}/R/lib/libRlapack.dylib:' \
120 -e 's:-install_name libRblas.dylib:-install_name ${libdir}/R/lib/libRblas.dylib:' \
121 -e "/SHLIB_EXT/s/\.so/.dylib/" \
122 configure.ac || die
123 # sort of "undo" 2.14.1-rmath-shared.patch
124 sed -i \
125 -e "s:-Wl,-soname=libRmath.so:-install_name ${EROOT}/usr/$(get_libdir)/libRmath.dylib:" \
126 src/nmath/standalone/Makefile.in || die
127 else
128 append-ldflags -Wl,-rpath="${EROOT}/usr/$(get_libdir)/R/lib"
129 fi
130 fi
131 AT_M4DIR=m4 eaclocal
132 eautoconf
133 }
134
135 src_configure() {
136 econf \
137 --enable-byte-compiled-packages \
138 --enable-R-shlib \
139 --disable-R-framework \
140 --with-system-zlib \
141 --with-system-bzlib \
142 --with-system-pcre \
143 --with-system-xz \
144 --with-blas="$($(tc-getPKG_CONFIG) --libs blas)" \
145 --docdir="${EPREFIX}/usr/share/doc/${PF}" \
146 rdocdir="${EPREFIX}/usr/share/doc/${PF}" \
147 $(use_enable nls) \
148 $(use_enable openmp) \
149 $(use_enable profile R-profiling) \
150 $(use_enable profile memory-profiling) \
151 $(use_enable static-libs static) \
152 $(use_enable static-libs R-static-lib) \
153 $(use_with cairo) \
154 $(use_with icu ICU) \
155 $(use_with jpeg jpeglib) \
156 $(use_with lapack) \
157 $(use_with !minimal recommended-packages) \
158 $(use_with png libpng) \
159 $(use_with readline) \
160 $(use_with tiff libtiff) \
161 $(use_with tk tcltk) \
162 $(use_with X x)
163 }
164
165 src_compile() {
166 export VARTEXFONTS="${T}/fonts"
167 emake
168 emake -C src/nmath/standalone shared $(use static-libs && echo static)
169 use doc && emake info pdf
170 }
171
172 src_install() {
173 default
174 emake -C src/nmath/standalone DESTDIR="${D}" install
175
176 if use doc; then
177 emake DESTDIR="${D}" install-info install-pdf
178 dosym ../manual /usr/share/doc/${PF}/html/manual
179 fi
180
181 cat > 99R <<-EOF
182 LDPATH=${R_DIR}/lib
183 R_HOME=${R_DIR}
184 EOF
185 doenvd 99R
186 use bash-completion && newbashcomp "${WORKDIR}"/${BCP} ${PN}
187 # The buildsystem has a different understanding of install_names than what
188 # we require. Since it builds modules like shared objects (wrong), many
189 # objects (all modules) get an incorrect install_name. Fixing the build
190 # system here is not really trivial.
191 if [[ ${CHOST} == *-darwin* ]] ; then
192 local mod
193 pushd "${ED}"/usr/lib/R > /dev/null
194 for mod in $(find . -name "*.dylib") ; do
195 mod=${mod#./}
196 install_name_tool -id "${EPREFIX}/usr/lib/R/${mod}" \
197 "${mod}"
198 done
199 popd > /dev/null
200 fi
201 }
202
203 pkg_postinst() {
204 if use java; then
205 einfo "Re-initializing java paths for ${P}"
206 R CMD javareconf
207 fi
208 }

  ViewVC Help
Powered by ViewVC 1.1.20