summaryrefslogtreecommitdiff
path: root/libre/sagemath/env.patch
blob: e4a1be32921f185a2d814cba60e9db17c8f29ea9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
--- src/bin/sage-env.orig	2015-01-06 10:46:04.469687605 +0100
+++ src/bin/sage-env	2015-01-06 10:49:59.547762019 +0100
@@ -110,41 +110,7 @@
 }
 
 
-# New value for SAGE_ROOT: either SAGE_ROOT (if given)
-# or a guessed value based on pwd.
-if [ -n "$SAGE_ROOT" ]; then
-    NEW_SAGE_ROOT="$SAGE_ROOT"
-elif [ -f sage -a -d build ]; then
-    NEW_SAGE_ROOT="."
-elif [ -f ../../sage -a -d ../../build ]; then
-    NEW_SAGE_ROOT="../.."
-else
-    # No idea what SAGE_ROOT should be...
-    echo >&2 "Error: You must set the SAGE_ROOT environment variable or run this"
-    echo >&2 "script from the SAGE_ROOT or SAGE_ROOT/local/bin/ directory."
-    return 1
-fi
-
-# Make NEW_SAGE_ROOT absolute
-NEW_SAGE_ROOT=`cd "$NEW_SAGE_ROOT" && pwd -P`
-
-# Sanity check NEW_SAGE_ROOT
-if [ -f "$NEW_SAGE_ROOT/sage" -a -d "$NEW_SAGE_ROOT/build" ]; then
-    :
-else
-    echo >&2 "Error: SAGE_ROOT is set to a bad value:"
-    echo >&2 "SAGE_ROOT=$SAGE_ROOT"
-    echo >&2 "You must correct it or erase it and run this script from the SAGE_ROOT"
-    echo >&2 "or SAGE_ROOT/local/bin/ directory."
-    return 1
-fi
-
-# Warn if NEW_SAGE_ROOT does not equal the old SAGE_ROOT
-if [ "$SAGE_ROOT" != "$NEW_SAGE_ROOT" -a -n "$SAGE_ROOT" ]; then
-    echo >&2 "Warning: overwriting SAGE_ROOT environment variable:"
-    echo >&2 "Old SAGE_ROOT=$SAGE_ROOT"
-    echo >&2 "New SAGE_ROOT=$NEW_SAGE_ROOT"
-fi
+NEW_SAGE_ROOT="/usr"
 
 # Don't execute the commands more than once for the same version of
 # sage-env.  Check this after checking the validity of SAGE_ROOT, but
@@ -245,20 +211,12 @@
 fi
 
 # Setting Sage-related location environment variables.
-export SAGE_LOCAL="$SAGE_ROOT/local"
-export SAGE_ETC="$SAGE_LOCAL/etc"
-export SAGE_SHARE="$SAGE_LOCAL/share"
-export SAGE_EXTCODE="$SAGE_SHARE/sage/ext"
-export SAGE_SPKG_INST="$SAGE_LOCAL/var/lib/sage/installed"
-export SAGE_LOGS="$SAGE_ROOT/logs/pkgs"
-export SAGE_SRC="$SAGE_ROOT/src"
-export SAGE_DOC="$SAGE_SRC/doc"
-
-if [ -z "${SAGE_ORIG_PATH_SET}" ]; then 
-    SAGE_ORIG_PATH=$PATH && export SAGE_ORIG_PATH 
-    SAGE_ORIG_PATH_SET=True && export SAGE_ORIG_PATH_SET 
-fi 
-export PATH="$SAGE_ROOT/build/bin:$SAGE_SRC/bin:$SAGE_LOCAL/bin:$PATH"
+export SAGE_LOCAL="$SAGE_ROOT"
+export SAGE_ETC="/etc/sage"
+export SAGE_SHARE="$SAGE_LOCAL/share/sage"
+export SAGE_EXTCODE="$SAGE_SHARE/ext"
+export SAGE_SRC="$SAGE_SHARE/source"
+export SAGE_DOC="/usr/share/doc/sage"
 
 # We offer a toolchain option, so if $SAGE_LOCAL/toolchain/toolchain-env exists source it.
 # Since the user might do something crazy we do not do any checks, but hope for the best.
@@ -309,9 +267,6 @@
 GIT_TEMPLATE_DIR="$SAGE_LOCAL"/share/git-core/templates && export GIT_TEMPLATE_DIR
 GIT_EXEC_PATH="$SAGE_LOCAL"/libexec/git-core && export GIT_EXEC_PATH
 
-SINGULARPATH="$SAGE_LOCAL/share/singular" && export SINGULARPATH
-SINGULAR_EXECUTABLE="$SAGE_LOCAL/bin/Singular" && export SINGULAR_EXECUTABLE
-
 if [ -z "$SAGE_REPO_ANONYMOUS" ]; then
     SAGE_REPO_ANONYMOUS="git://trac.sagemath.org/sage.git"
     export SAGE_REPO_ANONYMOUS
@@ -363,30 +318,17 @@
     export SAGE_STARTUP_FILE
 fi
 
-IPYTHONDIR=`find "$SAGE_SPKG_INST" -name "ipython*"`
-if [ -n "$IPYTHONDIR" ]; then
-    export IPYTHONDIR="$DOT_SAGE/${IPYTHONDIR##*/}"
-fi
+export IPYTHONDIR="$DOT_SAGE/ipython"
 
 if [ "$PYTHON_EGG_CACHE" = "" ]; then
     PYTHON_EGG_CACHE="$DOT_SAGE/.python-eggs"
     export PYTHON_EGG_CACHE
 fi
 
-if [ -d "$SAGE_LOCAL/lib/python" ]; then
-    PYTHONPATH="$SAGE_LOCAL/lib/python:$SAGE_LOCAL/lib/python/site_packages"
-    if [ -n "$SAGE_PATH" ]; then
-        PYTHONPATH="$SAGE_PATH:$PYTHONPATH"
-    fi
-    PYTHONHOME="$SAGE_LOCAL"
-    # Set PYTHONNOUSERSITE to avoid picking up non-Sage versions of
-    # Matplotlib, numpy, etc. See http://trac.sagemath.org/ticket/14243
-    # and http://trac.sagemath.org/ticket/18955.
-    PYTHONNOUSERSITE=yes
-    export PYTHONPATH
-    export PYTHONHOME
-    export PYTHONNOUSERSITE
-fi
+PYTHONPATH="/usr/lib/sage/site-packages:$PYTHONPATH"
+PYTHONHOME="$SAGE_ROOT"
+export PYTHONPATH
+export PYTHONHOME
 
 if [ -z "${SAGE_ORIG_LD_LIBRARY_PATH_SET}" ]; then
     SAGE_ORIG_LD_LIBRARY_PATH=$LD_LIBRARY_PATH && export SAGE_ORIG_LD_LIBRARY_PATH
@@ -431,8 +378,6 @@
         fi
     fi
 fi
-MAXIMA_PREFIX="$SAGE_ROOT/local" && export MAXIMA_PREFIX
-
 ############ architecture flags
 
 # Support flags to change the build architecture.  Currently, this is
@@ -602,9 +547,6 @@
     LD_LIBRARY_PATH="$SAGE_LOCAL/bin:$LD_LIBRARY_PATH" && export LD_LIBRARY_PATH
 fi
 
-# See trac 7186 -- this is needed if ecl is moved
-ECLDIR="$SAGE_LOCAL/lib/ecl/" && export ECLDIR
-
 # Handle parallel building/testing/...
 # See Trac Ticket #12016
 # First, figure out the right values for SAGE_NUM_THREADS (default