# 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 |
38 | 38 | - R.sh.in: Set R_HOME_DIR to "${SAGE_LOCAL}/lib/R/" when running R. |
39 | 39 | - install_parallel.patch: fix parallel installation, see |
40 | 40 | 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. |
41 | 46 | |
42 | 47 | == Changelog == |
43 | 48 | |
| 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 | |
44 | 54 | === r-2.14.0.p6 (Jeroen Demeyer, 10 September 2012) === |
45 | 55 | * #13443: some clean up of spkg-install. |
46 | 56 | * Compile R with optimization (at -O2 level). |
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" |
diff --git a/spkg-install b/spkg-install
a
|
b
|
export SAGE_BUILDING_R=yes |
105 | 105 | |
106 | 106 | if [ "$UNAME" = "Darwin" ]; then |
107 | 107 | 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" |
110 | 110 | else |
111 | 111 | 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 \ |
113 | 113 | --with-readline="$SAGE_LOCAL" \ |
114 | 114 | --with-blas="-L$SAGE_LOCAL/lib -lf77blas -latlas" \ |
115 | 115 | --with-lapack="-L$SAGE_LOCAL/lib -llapack -lcblas" |
… |
… |
fi |
118 | 118 | if [ $? -ne 0 ]; then |
119 | 119 | echo "Configuring R with fallback options" |
120 | 120 | 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 \ |
122 | 122 | --with-readline="$SAGE_LOCAL" |
123 | 123 | fi |
124 | 124 | |