Ticket #9668: trac_9668-r.patch

File trac_9668-r.patch, 1.5 KB (added by jhpalmieri, 9 years ago)

patch for R spkg; for review only

  • SPKG.txt

    # HG changeset patch
    # User J. H. Palmieri <palmieri@math.washington.edu>
    # Date 1351285561 25200
    # Node ID 46935f1ecd7687bea94d0b8362479c0fc6600aab
    # Parent  0c1731b225dc33e6ced60a82740f3ad36e30beb6
    #9668: make R relocatable by using $SAGE_ROOT instead of hard-coded path.
    
    diff --git a/SPKG.txt b/SPKG.txt
    a b much code written for S runs unaltered u 
    4141
    4242== Changelog ==
    4343
     44=== r-2.14.0.p7 (John Palmieri, 25 October 2012) ===
     45 * #9668: make R relocatable by using $SAGE_ROOT instead of hard-coded path.
     46
    4447=== r-2.14.0.p6 (Jeroen Demeyer, 10 September 2012) ===
    4548 * #13443: some clean up of spkg-install.
    4649 * Compile R with optimization (at -O2 level).
  • spkg-install

    diff --git a/spkg-install b/spkg-install
    a b if [ $? -ne 0 ]; then 
    146146    exit 1
    147147fi
    148148
     149# Make R relocatable by using "$SAGE_ROOT" instead of the hardcoded path.
     150for f in "$SAGE_LOCAL/bin/R" "$SAGE_LOCAL/lib/R/bin/R" \
     151    "$SAGE_LOCAL/lib/R/bin/libtool" "$SAGE_LOCAL/lib/R/etc/Makeconf" \
     152    "$SAGE_LOCAL/lib/R/etc/Renviron"
     153do
     154    # Add quotes in lines like 'blah=$SAGE_ROOT/...'
     155    # and replace any remaining occurrences of SAGE_ROOT.
     156    sed -e "s|=$SAGE_ROOT|=\"\$SAGE_ROOT\"|g" -e "s|$SAGE_ROOT|\$SAGE_ROOT|g" "$f" > "$f.tmp"
     157    mv "$f.tmp" "$f"
     158done
     159
     160# Make scripts executable.
     161chmod a+x "$SAGE_LOCAL/bin/R" "$SAGE_LOCAL/lib/R/bin/R" "$SAGE_LOCAL/lib/R/bin/libtool"
     162
    149163if [ "$UNAME" = "Darwin" ]; then
    150164    echo "Removing fake java and javac compiler"
    151165    rm -f "$SAGE_LOCAL"/bin/java