--- R-2.0.1.ebuild 2005-03-05 18:14:22.000000000 +0900 +++ R-2.0.1.ebuild 2005-03-05 18:07:44.000000000 +0900 @@ -4,9 +4,17 @@ inherit 64-bit fortran -IUSE="blas X tcltk gnome zlib bzlib pcre" +IUSE="blas X tcltk gnome zlib bzlib pcre cjk" DESCRIPTION="R is GNU S - A language and environment for statistical computing and graphics." -SRC_URI="http://cran.r-project.org/src/base/R-2/${P}.tar.gz" +SRC_URI="http://cran.r-project.org/src/base/R-2/${P}.tar.gz + cjk? ( + http://r.nakama.ne.jp/${P}/patchs/${P}.i18n.gnome.20041116.patch + http://r.nakama.ne.jp/${P}/patchs/${P}.i18n.main.20041116.patch + http://r.nakama.ne.jp/${P}/patchs/${P}.i18n.regex.20041116.patch + http://r.nakama.ne.jp/${P}/patchs/${P}.i18n.tcltk.20041116.patch + http://r.nakama.ne.jp/${P}/patchs/${P}.i18n.x11_mb.20041125.patch + http://r.nakama.ne.jp/${P}/patchs/${P}.l10n.pstex.20041116.patch + )" #There are daily release patches, don't know how to utilize these #"ftp://ftp.stat.math.ethz.ch/Software/${PN}/${PN}-release.diff.gz" HOMEPAGE="http://www.r-project.org/" @@ -33,22 +41,31 @@ SLOT="0" LICENSE="GPL-2 LGPL-2.1" KEYWORDS="~x86 ~sparc ~ppc ppc64 ~amd64" -64-bit || FORTRAN="g77" # No f2c on 64-bit archs anymore. src_unpack() { unpack ${A} cd ${S} #sed -e 's/^#define NeedFunctionPrototypes 0/#define NeedFunctionPrototypes 1/' \ #-i src/modules/X11/dataentry.c || die "sed failed" + + if use cjk; then + epatch ${DISTDIR}/${P}.i18n.gnome.20041116.patch + epatch ${DISTDIR}/${P}.i18n.main.20041116.patch + epatch ${DISTDIR}/${P}.i18n.regex.20041116.patch + epatch ${DISTDIR}/${P}.i18n.tcltk.20041116.patch + epatch ${DISTDIR}/${P}.i18n.x11_mb.20041125.patch + epatch ${DISTDIR}/${P}.l10n.pstex.20041116.patch + rm -f src/main/gram.c + fi } src_compile() { #addwrite "/var/cache/fonts" local myconf="--enable-static --enable-R-profiling --enable-R-shlib --with-readline" - use zlib || myconf="${myconf} --with-zlib" #default disabled - use bzlib || myconf="${myconf} --with-bzlib" #default disabled - use pcre || myconf="${myconf} --with-pcre" #default disabled + use zlib && myconf="${myconf} --with-zlib" #default disabled + use bzlib && myconf="${myconf} --with-bzlib" #default disabled + use pcre && myconf="${myconf} --with-pcre" #default disabled # Using the blas USE flag now instead atlas, as atlas now # has been broken into blas-atlas and lapack-atlas. @@ -65,6 +82,21 @@ myconf="${myconf} --without-tcltk" fi + need_fortran g77 ifc f2c + + if [ "${FORTRANC}" = "f2c" ]; then + if 64-bit; then + eerror "GNU fortran 77 compiler not found on the system." + eerror "Please add fortran to your USE flags and reemerge gcc." + die + fi + F2C="${FORTRANC}" + else + F77="${FORTRANC}" + fi + + use cjk && myconf="${myconf} X_CFLAGS=\"-DI18N_MB\" MAIN_CFLAGS=\"-DL10N_JP\"" #default disabled + use gnome && myconf="${myconf} --with-gnome" #default disabled econf \ @@ -88,7 +120,7 @@ #fix the R wrapper script to have the correct R_HOME_DIR #sed regexp borrowed from included debian rules sed \ - -e '/^R_HOME_DIR=.*/s::R_HOME_DIR=/usr/lib/R:' \ + -e "/^R_HOME_DIR=.*/s::R_HOME_DIR=/usr/$(get_libdir)/R:" \ -i ${D}/usr/$(get_libdir)/R/bin/R \ || die "sed failed"