Ticket #9668: trac_9668-r.v2.patch

File trac_9668-r.v2.patch, 3.9 KB (added by John Palmieri, 10 years ago)

patch for R spkg; for review only

  • SPKG.txt

    # HG changeset patch
    # User J. H. Palmieri <palmieri@math.washington.edu>
    # Date 1359684469 28800
    # Node ID 49520aab31dcc836eda3994308ccc72468bd5487
    # Parent  ca5b1e495fa0a6f100c922447b0dfc255d08f9b3
    #9668: don't hardcode absolute paths in various components of R.
    So configure with prefix='\$SAGE_LOCAL' instead of "$SAGE_LOCAL",
    and modify src/scripts/Makefile.in.
    
    diff --git a/SPKG.txt b/SPKG.txt
    a b much code written for S runs unaltered u 
    3838   - R.sh.in: Set R_HOME_DIR to "${SAGE_LOCAL}/lib/R/" when running R.
    3939   - install_parallel.patch: fix parallel installation, see
    4040     https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=15041
     41   - Makefile.in.patch: set R_HOME_DIR to $SAGE_LOCAL/bin/R:
     42     $SAGE_LOCAL remains unevaluated. This should make R behave better
     43     after relocating the Sage installation. Also don't put in
     44     hard-coded paths for R_SHARE_DIR, etc.: just use
     45     $R_HOME_DIR/share.
    4146
    4247== Changelog ==
    4348
     49=== r-2.14.0.p7 (John H. Palmieri, 31 January 2013) ===
     50 * #9668: don't hardcode absolute paths in various components
     51   of R. So configure with prefix='\$SAGE_LOCAL' instead of
     52   "$SAGE_LOCAL", and modify src/scripts/Makefile.in.
     53
    4454=== r-2.14.0.p6 (Jeroen Demeyer, 10 September 2012) ===
    4555 * #13443: some clean up of spkg-install.
    4656 * Compile R with optimization (at -O2 level).
  • new file patches/Makefile.in.patch

    diff --git a/patches/Makefile.in.patch b/patches/Makefile.in.patch
    new file mode 100644
    - +  
     1--- src/src/scripts/Makefile.in 2011-03-15 16:02:42.000000000 -0700
     2+++ src.new/src/scripts/Makefile.in     2013-01-31 14:21:16.000000000 -0800
     3@@ -73,8 +73,7 @@
     4          dat=`sed -e 1d -e 's/^Last Changed Date: //' $(top_builddir)/SVN-REVISION`; \
     5          v="$${v} ($${dat})"; \
     6          y=`$(ECHO) $${dat} | cut -d- -f1`; \
     7-         d=`$(ECHO) "$(abs_top_builddir)" | sed 's,/,\\\/,g'`; \
     8-         sed "1,/R_HOME_DIR/s/\\(R_HOME_DIR=\\).*/\\1\"$${d}\"/; \
     9+         sed "1,/R_HOME_DIR/s/\\(R_HOME_DIR=\\).*/\\1\"\$$SAGE_LOCAL\/bin\/R\"/; \
     10               s@REPLACE_BY_VERSION@$${v}@; \
     11               s@REPLACE_BY_YEAR@$${y}@" < R.sh > $@)
     12        @chmod +x $@
     13@@ -85,8 +84,7 @@
     14 
     15 install: installdirs install-cmds
     16        @rm -f $(DESTDIR)$(bindir)/R
     17-       @(d=`$(ECHO) '$(rhome)' | sed 's,/,\\\/,g';`; \
     18-         sed -e "1,/R_HOME_DIR=/s/\\(R_HOME_DIR=\\).*/\\1$${d}/;" -e "s+\\(R_SHARE_DIR=\\).*+\\1$(rsharedir)+;" -e  "s+\\(R_INCLUDE_DIR=\\).*+\\1$(rincludedir)+;" -e "s+\\(R_DOC_DIR=\\).*+\\1$(rdocdir)+;"\
     19+       @(sed -e "1,/R_HOME_DIR=/s/\\(R_HOME_DIR=\\).*/\\1\\$SAGE_LOCAL/lib/R/;"\
     20          < R.fe > "$(DESTDIR)$(Rexecbindir)/R")
     21        @$(INSTALL_SCRIPT)  "$(DESTDIR)$(Rexecbindir)/R" "$(DESTDIR)$(bindir)/R"
     22        @chmod 755 "$(DESTDIR)$(bindir)/R" "$(DESTDIR)$(Rexecbindir)/R"
  • spkg-install

    diff --git a/spkg-install b/spkg-install
    a b export SAGE_BUILDING_R=yes 
    105105
    106106if [ "$UNAME" = "Darwin" ]; then
    107107    echo "Configuring R without ATLAS for OS X"
    108     ./configure --prefix="$SAGE_LOCAL" --libdir="$SAGE_LOCAL/lib" $R_CONFIGURE \
    109         --with-readline="$SAGE_LOCAL"
     108    ./configure --prefix="\$SAGE_LOCAL" --libdir="$SAGE_LOCAL/lib" $R_CONFIGURE \
     109        --with-readline="\$SAGE_LOCAL"
    110110else
    111111    echo "Configuring R with ATLAS"
    112     ./configure --prefix="$SAGE_LOCAL" --libdir="$SAGE_LOCAL/lib" $R_CONFIGURE \
     112    ./configure --prefix="\$SAGE_LOCAL" --libdir="$SAGE_LOCAL/lib" $R_CONFIGURE \
    113113        --with-readline="$SAGE_LOCAL" \
    114114        --with-blas="-L$SAGE_LOCAL/lib -lf77blas -latlas" \
    115115        --with-lapack="-L$SAGE_LOCAL/lib -llapack -lcblas"
    fi 
    118118if [ $? -ne 0 ]; then
    119119    echo "Configuring R with fallback options"
    120120    R_CONFIGURE=`echo "$R_CONFIGURE" | sed 's/--with-x=yes/--with-x=no/' `
    121     ./configure --prefix="$SAGE_LOCAL" --libdir="$SAGE_LOCAL/lib" $R_CONFIGURE \
     121    ./configure --prefix="\$SAGE_LOCAL" --libdir="$SAGE_LOCAL/lib" $R_CONFIGURE \
    122122        --with-readline="$SAGE_LOCAL"
    123123fi
    124124