[sagemath] 01/01: Move most of the patches for sage-env and sage to separate files.

Tobias Hansen thansen at moszumanska.debian.org
Tue Dec 6 21:02:36 UTC 2016


This is an automated email from the git hooks/post-receive script.

thansen pushed a commit to branch master
in repository sagemath.

commit 916ae0b357bcb67bfae7fb30114782cc184fc19b
Author: Tobias Hansen <thansen at broeselmaschine.fc.up.pt>
Date:   Tue Dec 6 15:06:18 2016 +0000

    Move most of the patches for sage-env and sage to separate files.
---
 .../{debian-skip-check.patch => debian-exec.patch} | 18 ++--
 debian/patches/debian-install-paths.patch          | 74 ----------------
 debian/patches/debian-maxima.patch                 | 11 ---
 debian/patches/debian-paths.patch                  | 38 ---------
 debian/patches/debian-sage-env.patch               | 99 ++++++++++++++++++++++
 debian/patches/series                              |  3 +-
 6 files changed, 112 insertions(+), 131 deletions(-)

diff --git a/debian/patches/debian-skip-check.patch b/debian/patches/debian-exec.patch
similarity index 76%
rename from debian/patches/debian-skip-check.patch
rename to debian/patches/debian-exec.patch
index dba8f2e..24a844e 100644
--- a/debian/patches/debian-skip-check.patch
+++ b/debian/patches/debian-exec.patch
@@ -1,16 +1,11 @@
-Description: Do not check if we are in a sage source directory
- This is useful for example to run the test suite with the installed sage.
-Author: Tobias Hansen <thansen at debian.org>
-Forwarded: not-needed
-
 --- a/sage/src/bin/sage
 +++ b/sage/src/bin/sage
-@@ -360,18 +360,6 @@
+@@ -355,18 +355,6 @@
  
  # Prepare for running Sage, either interactively or non-interactively.
  sage_setup() {
 -    # Check that we're not in a source tarball which hasn't been built yet (#13561).
--    if [ ! -d "$SAGE_LOCAL/lib/python2.7/dist-packages/sage" ]; then
+-    if [ ! -d "$SAGE_LOCAL/lib/python/site-packages/sage" ]; then
 -        echo >&2 '************************************************************************'
 -        echo >&2 'It seems that you are attempting to run Sage from an unpacked source'
 -        echo >&2 'tarball, but you have not compiled it yet (or maybe the build has not'
@@ -24,3 +19,12 @@ Forwarded: not-needed
      # Display the startup banner (unless SAGE_BANNER is explictly "no")
      sage_banner
  
+@@ -512,7 +500,7 @@
+ 
+ if [ "$1" = '-maxima' -o "$1" = '--maxima' ]; then
+     shift
+-    exec maxima "$@"
++    exec maxima-sage "$@"
+ fi
+ 
+ if [ "$1" = '-mwrank' -o "$1" = '--mwrank' ]; then
diff --git a/debian/patches/debian-install-paths.patch b/debian/patches/debian-install-paths.patch
index 796189b..e33b44d 100644
--- a/debian/patches/debian-install-paths.patch
+++ b/debian/patches/debian-install-paths.patch
@@ -12,69 +12,6 @@ Author: Ximin Luo <infinity0 at debian.org>
 Forwarded: not-needed
 ---
 This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
---- a/sage/src/bin/sage-env
-+++ b/sage/src/bin/sage-env
-@@ -114,10 +114,10 @@
- # 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="../.."
-+elif [ "$(which "$(basename "$0")")" = "$0" ]; then
-+    export SAGE_LOCAL="${SAGE_LOCAL:-$(dirname $(dirname "$0"))}"
-+    SAGE_ROOT="$SAGE_LOCAL"
-+    NEW_SAGE_ROOT="$SAGE_ROOT"
- else
-     # No idea what SAGE_ROOT should be...
-     echo >&2 "Error: You must set the SAGE_ROOT environment variable or run this"
-@@ -128,17 +128,6 @@
- # 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:"
-@@ -265,9 +254,13 @@
- export SAGE_ETC="$SAGE_LOCAL/etc"
- export SAGE_SHARE="$SAGE_LOCAL/share"
- export SAGE_EXTCODE="$SAGE_SHARE/sage/ext"
--export SAGE_SPKG_INST="$SAGE_ROOT/local/var/lib/sage/installed"
-+if [ -z "$SAGE_SPKG_INST" ]; then
-+    export SAGE_SPKG_INST="/usr/share/sage/installed"
-+fi
- export SAGE_LOGS="$SAGE_ROOT/logs/pkgs"
--export SAGE_SRC="$SAGE_ROOT/src"
-+if [ -z "$SAGE_SRC" ]; then
-+    export SAGE_SRC="$SAGE_ROOT/src"
-+fi
- export SAGE_DOC_SRC="$SAGE_SRC/doc"
- export SAGE_DOC="$SAGE_SHARE/doc/sage"
- 
-@@ -420,8 +413,10 @@
-     export PYTHONHOME
- fi
- 
--LDFLAGS="-L$SAGE_LOCAL/lib -Wl,-rpath,$SAGE_LOCAL/lib $LDFLAGS"
-+LDFLAGS="-L$SAGE_LOCAL/lib $LDFLAGS"
- export LDFLAGS
-+LD_LIBRARY_PATH="$SAGE_LOCAL/lib:$LD_LIBRARY_PATH"
-+export LD_LIBRARY_PATH
- 
- # Use a matplotlib config directory specific to Sage and specific to
- # the version number of matplotlib, by setting the environment
 --- a/sage/src/sage_setup/clean.py
 +++ b/sage/src/sage_setup/clean.py
 @@ -85,7 +85,7 @@
@@ -200,17 +137,6 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
              '--python',
              '-m', 'sage.repl.ipython_kernel',
              '-f', '{connection_file}',
---- a/sage/src/bin/sage
-+++ b/sage/src/bin/sage
-@@ -356,7 +356,7 @@
- # Prepare for running Sage, either interactively or non-interactively.
- sage_setup() {
-     # Check that we're not in a source tarball which hasn't been built yet (#13561).
--    if [ ! -d "$SAGE_LOCAL/lib/python/site-packages/sage" ]; then
-+    if [ ! -d "$SAGE_LOCAL/lib/python2.7/dist-packages/sage" ]; then
-         echo >&2 '************************************************************************'
-         echo >&2 'It seems that you are attempting to run Sage from an unpacked source'
-         echo >&2 'tarball, but you have not compiled it yet (or maybe the build has not'
 --- a/sage/src/sage_setup/find.py
 +++ b/sage/src/sage_setup/find.py
 @@ -150,19 +150,18 @@
diff --git a/debian/patches/debian-maxima.patch b/debian/patches/debian-maxima.patch
index fe5fc6b..c4f9cc2 100644
--- a/debian/patches/debian-maxima.patch
+++ b/debian/patches/debian-maxima.patch
@@ -71,17 +71,6 @@ Author: Tobias Hansen <thansen at debian.org>
          raise RuntimeError('Can use the console only in the terminal. Try %%maxima magics instead.')
 -    os.system('maxima')
 +    os.system('maxima-sage')
---- a/sage/src/bin/sage
-+++ b/sage/src/bin/sage
-@@ -512,7 +512,7 @@
- 
- if [ "$1" = '-maxima' -o "$1" = '--maxima' ]; then
-     shift
--    exec maxima "$@"
-+    exec maxima-sage "$@"
- fi
- 
- if [ "$1" = '-mwrank' -o "$1" = '--mwrank' ]; then
 --- a/sage/src/sage/interfaces/expect.py
 +++ b/sage/src/sage/interfaces/expect.py
 @@ -563,7 +563,7 @@
diff --git a/debian/patches/debian-paths.patch b/debian/patches/debian-paths.patch
index 8442077..335e791 100644
--- a/debian/patches/debian-paths.patch
+++ b/debian/patches/debian-paths.patch
@@ -18,44 +18,6 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
              sage: (pr, pw) = os.pipe()
              sage: r, w, x, t = PSelecter().pselect([f,g,pr,pw], [pw], [pr,pw])
              sage: len(r), len(w), len(x), t
---- a/sage/src/bin/sage-env
-+++ b/sage/src/bin/sage-env
-@@ -325,12 +325,12 @@
- fi
- 
- # For PARI/GP
--GP_DATA_DIR="$SAGE_LOCAL/share/pari" && export GP_DATA_DIR
--GPHELP="$SAGE_LOCAL/bin/gphelp" && export GPHELP
--GPDOCDIR="$SAGE_LOCAL/share/pari/doc" && export GPDOCDIR
-+GP_DATA_DIR="/usr/share/pari" && export GP_DATA_DIR
-+GPHELP="/usr/bin/gphelp" && export GPHELP
-+GPDOCDIR="/usr/share/pari/doc" && export GPDOCDIR
- 
--SINGULARPATH="$SAGE_LOCAL/share/singular" && export SINGULARPATH
--SINGULAR_EXECUTABLE="$SAGE_LOCAL/bin/Singular" && export SINGULAR_EXECUTABLE
-+SINGULARPATH="/usr/share/singular" && export SINGULARPATH
-+SINGULAR_EXECUTABLE="/usr/bin/Singular" && export SINGULAR_EXECUTABLE
- 
- if [ -z "$SAGE_REPO_ANONYMOUS" ]; then
-     SAGE_REPO_ANONYMOUS="git://trac.sagemath.org/sage.git"
-@@ -468,7 +468,6 @@
- 	fi
-     fi
- fi
--export MAXIMA_PREFIX="$SAGE_LOCAL"
- 
- PERL5LIB="$SAGE_LOCAL/lib/perl5:$PERL5LIB" && export PERL5LIB
- 
-@@ -642,9 +641,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
 --- a/sage/src/sage/interfaces/gap.py
 +++ b/sage/src/sage/interfaces/gap.py
 @@ -194,7 +194,7 @@
diff --git a/debian/patches/debian-sage-env.patch b/debian/patches/debian-sage-env.patch
new file mode 100644
index 0000000..34721c4
--- /dev/null
+++ b/debian/patches/debian-sage-env.patch
@@ -0,0 +1,99 @@
+--- a/sage/src/bin/sage-env
++++ b/sage/src/bin/sage-env
+@@ -114,10 +114,10 @@
+ # 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="../.."
++elif [ "$(which "$(basename "$0")")" = "$0" ]; then
++    export SAGE_LOCAL="${SAGE_LOCAL:-$(dirname $(dirname "$0"))}"
++    SAGE_ROOT="$SAGE_LOCAL"
++    NEW_SAGE_ROOT="$SAGE_ROOT"
+ else
+     # No idea what SAGE_ROOT should be...
+     echo >&2 "Error: You must set the SAGE_ROOT environment variable or run this"
+@@ -128,17 +128,6 @@
+ # 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:"
+@@ -265,9 +254,13 @@
+ export SAGE_ETC="$SAGE_LOCAL/etc"
+ export SAGE_SHARE="$SAGE_LOCAL/share"
+ export SAGE_EXTCODE="$SAGE_SHARE/sage/ext"
+-export SAGE_SPKG_INST="$SAGE_ROOT/local/var/lib/sage/installed"
++if [ -z "$SAGE_SPKG_INST" ]; then
++    export SAGE_SPKG_INST="/usr/share/sage/installed"
++fi
+ export SAGE_LOGS="$SAGE_ROOT/logs/pkgs"
+-export SAGE_SRC="$SAGE_ROOT/src"
++if [ -z "$SAGE_SRC" ]; then
++    export SAGE_SRC="$SAGE_ROOT/src"
++fi
+ export SAGE_DOC_SRC="$SAGE_SRC/doc"
+ export SAGE_DOC="$SAGE_SHARE/doc/sage"
+ 
+@@ -325,12 +318,12 @@
+ fi
+ 
+ # For PARI/GP
+-GP_DATA_DIR="$SAGE_LOCAL/share/pari" && export GP_DATA_DIR
+-GPHELP="$SAGE_LOCAL/bin/gphelp" && export GPHELP
+-GPDOCDIR="$SAGE_LOCAL/share/pari/doc" && export GPDOCDIR
++GP_DATA_DIR="/usr/share/pari" && export GP_DATA_DIR
++GPHELP="/usr/bin/gphelp" && export GPHELP
++GPDOCDIR="/usr/share/pari/doc" && export GPDOCDIR
+ 
+-SINGULARPATH="$SAGE_LOCAL/share/singular" && export SINGULARPATH
+-SINGULAR_EXECUTABLE="$SAGE_LOCAL/bin/Singular" && export SINGULAR_EXECUTABLE
++SINGULARPATH="/usr/share/singular" && export SINGULARPATH
++SINGULAR_EXECUTABLE="/usr/bin/Singular" && export SINGULAR_EXECUTABLE
+ 
+ if [ -z "$SAGE_REPO_ANONYMOUS" ]; then
+     SAGE_REPO_ANONYMOUS="git://trac.sagemath.org/sage.git"
+@@ -420,8 +413,10 @@
+     export PYTHONHOME
+ fi
+ 
+-LDFLAGS="-L$SAGE_LOCAL/lib -Wl,-rpath,$SAGE_LOCAL/lib $LDFLAGS"
++LDFLAGS="-L$SAGE_LOCAL/lib $LDFLAGS"
+ export LDFLAGS
++LD_LIBRARY_PATH="$SAGE_LOCAL/lib:$LD_LIBRARY_PATH"
++export LD_LIBRARY_PATH
+ 
+ # Use a matplotlib config directory specific to Sage and specific to
+ # the version number of matplotlib, by setting the environment
+@@ -468,7 +463,6 @@
+ 	fi
+     fi
+ fi
+-export MAXIMA_PREFIX="$SAGE_LOCAL"
+ 
+ PERL5LIB="$SAGE_LOCAL/lib/perl5:$PERL5LIB" && export PERL5LIB
+ 
+@@ -642,9 +636,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
diff --git a/debian/patches/series b/debian/patches/series
index 97f1d62..7a521e2 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -31,6 +31,8 @@ version-planarity-3.patch
 debian-fakeroot.patch
 debian-paths.patch
 debian-disable-jsmol.patch
+debian-sage-env.patch
+debian-exec.patch
 debian-maxima.patch
 debian-singular.patch
 debian-libgap-sage.patch
@@ -47,7 +49,6 @@ debian-test-optional.patch
 debian-fix-trivial-test-cases.patch
 debian-install-paths.patch
 debian-scripts-dir.patch
-debian-skip-check.patch
 
 # temporary patches for whatever reason
 # they will eventually be gotten rid of

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/sagemath.git



More information about the debian-science-commits mailing list