[sagemath] 02/02: Rearrange some patches

Ximin Luo infinity0 at debian.org
Tue Dec 20 17:51:41 UTC 2016


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

infinity0 pushed a commit to branch _wip_sagemath_paths
in repository sagemath.

commit 5b707b70ae0165e00d50d9324f1294fb874d03a3
Author: Ximin Luo <infinity0 at debian.org>
Date:   Tue Dec 20 18:50:49 2016 +0100

    Rearrange some patches
    
    - Make scripts-dir.patch more upstreamable
    - Fix up some paths in the documentation as well
---
 debian/patches/d1-install-paths.patch              |   4 +-
 debian/patches/d1-sage-env.patch                   | 113 +++++++++++++++++++++
 debian/patches/series                              |   2 +-
 .../{d1-scripts-dir.patch => u2-scripts-dir.patch} |  70 ++++++-------
 4 files changed, 148 insertions(+), 41 deletions(-)

diff --git a/debian/patches/d1-install-paths.patch b/debian/patches/d1-install-paths.patch
index 957be05..abb4de2 100644
--- a/debian/patches/d1-install-paths.patch
+++ b/debian/patches/d1-install-paths.patch
@@ -66,7 +66,7 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
  # Resolve all symbolic links in a filename.  This more or less behaves
 --- a/sage/src/sage/env.py
 +++ b/sage/src/sage/env.py
-@@ -102,9 +102,9 @@
+@@ -103,9 +103,9 @@
  except AttributeError:  # in case of use inside virtualenv
      sitepackages_dirs = [os.path.join(os.path.dirname(site.__file__),
                                       'site-packages')]
@@ -78,7 +78,7 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
  
  _add_variable_or_fallback('SAGE_CYTHONIZED', opj('$SAGE_ROOT', 'src', 'build', 'cythonized'))
  
-@@ -193,8 +193,8 @@
+@@ -194,8 +194,8 @@
          ['.../include',
          '.../include/python...',
          '.../python.../numpy/core/include',
diff --git a/debian/patches/d1-sage-env.patch b/debian/patches/d1-sage-env.patch
index 15d0a7e..bbf2405 100644
--- a/debian/patches/d1-sage-env.patch
+++ b/debian/patches/d1-sage-env.patch
@@ -5,6 +5,22 @@ Description: Patch sage-env
  The LD_LIBRARY_PATH can probably be forwarded upstream, either way is fine.
 Author: Tobias Hansen <thansen at debian.org>, Ximin Luo <infinity0 at debian.org>
 
+--- a/sage/src/bin/sage
++++ b/sage/src/bin/sage
+@@ -197,7 +197,12 @@
+ # append -env to that). We redirect stdout to stderr, which is safer
+ # for scripts.
+ #####################################################################
+-. "$0-env" >&2
++if [ "\"$0\"" = "\"/usr/bin/sage\"" ]; then
++    . "/usr/share/sagemath/bin/sage-env" >&2
++else
++    . "$0-env" >&2
++fi
++
+ if [ $? -ne 0 ]; then
+     echo >&2 "Error setting environment variables by sourcing '$0-env';"
+     echo >&2 "possibly contact sage-devel (see http://groups.google.com/group/sage-devel)."
 --- a/sage/src/bin/sage-env
 +++ b/sage/src/bin/sage-env
 @@ -264,12 +264,12 @@
@@ -92,3 +108,100 @@ Author: Tobias Hansen <thansen at debian.org>, Ximin Luo <infinity0 at debian.org>
  SAGE_SPKG_INST="$SAGE_ROOT/local/var/lib/sage/installed"
  
  #---------------------------------------------------------
+--- a/sage/README.md
++++ b/sage/README.md
+@@ -212,7 +212,7 @@
+ __7.__ The HTML version of the documentation is built during the compilation  
+    process of Sage and resides in the directory:
+ 
+-         $SAGE_ROOT/local/share/doc/sage/html/
++         $SAGE_LOCAL/share/doc/sagemath/html/
+ 
+    >* __Optional__: If you want to build the PDF version (requires LaTeX)  
+    of the documentation, run:  
+--- a/sage/build/make/deps
++++ b/sage/build/make/deps
+@@ -221,7 +221,7 @@
+ 	cd "$(SAGE_SRC)/doc" && $(MAKE) clean
+ 
+ doc-output-clean:
+-	rm -rf "$(SAGE_SHARE)/doc/sage"
++	rm -rf "$(SAGE_SHARE)/doc/sagemath"
+ 
+ 
+ ###############################################################################
+--- a/sage/src/doc/en/developer/sage_manuals.rst
++++ b/sage/src/doc/en/developer/sage_manuals.rst
+@@ -52,7 +52,7 @@
+ 
+     sage --docbuild tutorial html
+ 
+-You can now open ``SAGE_ROOT/local/share/doc/sage/html/en/tutorial/index.html`` in
++You can now open ``SAGE_LOCAL/share/doc/sagemath/html/en/tutorial/index.html`` in
+ your web browser.
+ 
+ - Do you want to **add a new file** to the documentation? :ref:`Click here
+--- a/sage/src/doc/en/faq/faq-general.rst
++++ b/sage/src/doc/en/faq/faq-general.rst
+@@ -312,7 +312,7 @@
+ documentation that makes up the Sage standard documentation. If you
+ have downloaded a binary Sage release, the HTML version of the
+ corresponding documentation comes pre-built and can be found under the
+-directory ``SAGE_ROOT/local/share/doc/sage/html/``.
++directory ``SAGE_LOCAL/share/doc/sagemath/html/``.
+ During the compilation of Sage from source, the HTML version of the
+ documentation is also built in the process. To build the HTML version
+ of the documentation, issue the following command from ``SAGE_ROOT``::
+--- a/sage/src/doc/en/installation/source.rst
++++ b/sage/src/doc/en/installation/source.rst
+@@ -801,7 +801,7 @@
+   primarily intended for use when producing certain binary
+   distributions of Sage, to lower the size of the distribution. As of
+   this writing (December 2014, Sage 6.5), there are only a few such
+-  plots, adding about 4M to the :file:`local/share/doc/sage/` directory.
++  plots, adding about 4M to the :file:`/usr/share/doc/sagemath/` directory.
+   In the future, this may grow, of course. Note: after using this, if you
+   want to build the documentation and include the pictures, you should
+   run ``make doc-clean``, because the presence, or lack, of pictures
+--- a/sage/src/sage/misc/cython.py
++++ b/sage/src/sage/misc/cython.py
+@@ -178,7 +178,7 @@
+         '.../include/python...',
+         '.../python.../numpy/core/include',
+         ...
+-        '.../sage/ext',
++        '.../sagemath/ext',
+         ...
+         '.../cysignals'...],
+         'c',
+@@ -206,7 +206,7 @@
+         '.../include/python...',
+         '.../python.../numpy/core/include',
+         ...
+-        '.../sage/ext',
++        '.../sagemath/ext',
+         ...
+         '.../cysignals'...]
+ 
+--- a/sage/src/sage/structure/sage_object.pyx
++++ b/sage/src/sage/structure/sage_object.pyx
+@@ -1478,7 +1478,7 @@
+ 
+     When run with no arguments :meth:`unpickle_all` tests that all of the
+     "standard" pickles stored in the pickle_jar at
+-    ``SAGE_SHARE/sage/ext/pickle_jar/pickle_jar.tar.bz2`` can be unpickled.
++    ``SAGE_EXTCODE/pickle_jar/pickle_jar.tar.bz2`` can be unpickled.
+ 
+     ::
+ 
+--- a/sage/src/sage_setup/docbuild/__init__.py
++++ b/sage/src/sage_setup/docbuild/__init__.py
+@@ -383,7 +383,7 @@
+             document_name = document.split('/')[1]
+ 
+             # the sage directory within a subdocument, for example
+-            # local/share/doc/sage/html/en/reference/algebras/sage
++            # $SAGE_LOCAL/share/doc/sagemath/html/en/reference/algebras/sage
+             sage_directory = os.path.join(path, document, 'sage')
+ 
+             # Walk through all of the files in the sage_directory
diff --git a/debian/patches/series b/debian/patches/series
index e7d93bc..5000f7a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -27,6 +27,7 @@ u2-allow-override-sage-local.patch
 u2-fix-trivial-test-cases.patch
 u2-fix-less-trivial-test-cases.patch
 u2-fix-sympow-cachedir.patch
+u2-scripts-dir.patch
 
 # Patch Sage to work with dependency Debian packages
 # These won't change even if Debian and Sage use the same version
@@ -50,7 +51,6 @@ d0-paths.patch
 d1-install-paths.patch # many things in here could be split into an upstreamable patch
 d1-sage-cli.patch
 d1-sage-env.patch
-d1-scripts-dir.patch
 d1-fakeroot.patch
 d1-test-optional.patch
 d1-doc-docs.patch
diff --git a/debian/patches/d1-scripts-dir.patch b/debian/patches/u2-scripts-dir.patch
similarity index 80%
rename from debian/patches/d1-scripts-dir.patch
rename to debian/patches/u2-scripts-dir.patch
index fa125ec..a97f570 100644
--- a/debian/patches/d1-scripts-dir.patch
+++ b/debian/patches/u2-scripts-dir.patch
@@ -1,25 +1,21 @@
-Description: Find scripts when installed to /usr/share/sagemath/bin.
- Most of these scripts are intended to be used via the sage script,
- so we install only sage to /usr/bin.
+Description: Define and use SAGE_SCRIPTS_DIR in more places
+ So distros can install them somewhere other than /usr/bin
 Author: Tobias Hansen <thansen at debian.org>
+Forwarded: TODO
 
+--- a/sage/src/sage/env.py
++++ b/sage/src/sage/env.py
+@@ -92,6 +92,7 @@
+ _add_variable_or_fallback('SAGE_ROOT',       None)
+ _add_variable_or_fallback('SAGE_LOCAL',      None)
+ _add_variable_or_fallback('SAGE_ETC',        opj('$SAGE_LOCAL', 'etc'))
++_add_variable_or_fallback('SAGE_SCRIPTS_DIR',opj('$SAGE_LOCAL', 'bin'))
+ _add_variable_or_fallback('SAGE_INC',        opj('$SAGE_LOCAL', 'include'))
+ _add_variable_or_fallback('SAGE_SHARE',      opj('$SAGE_LOCAL', 'share'))
+ 
 --- a/sage/src/bin/sage
 +++ b/sage/src/bin/sage
-@@ -197,7 +197,12 @@
- # append -env to that). We redirect stdout to stderr, which is safer
- # for scripts.
- #####################################################################
--. "$0-env" >&2
-+if [ "\"$0\"" = "\"/usr/bin/sage\"" ]; then
-+    . "/usr/share/sagemath/bin/sage-env" >&2
-+else
-+    . "$0-env" >&2
-+fi
-+
- if [ $? -ne 0 ]; then
-     echo >&2 "Error setting environment variables by sourcing '$0-env';"
-     echo >&2 "possibly contact sage-devel (see http://groups.google.com/group/sage-devel)."
-@@ -252,13 +257,13 @@
+@@ -425,13 +425,13 @@
  #####################################################################
  
  if [ "$1" = '-dumpversion' -o "$1" = '--dumpversion' ]; then
@@ -35,7 +31,7 @@ Author: Tobias Hansen <thansen at debian.org>
  	echo "SageMath version ${SAGE_VERSION}, Release Date: ${SAGE_RELEASE_DATE}"
  	exit 0
  fi
-@@ -570,12 +575,12 @@
+@@ -936,12 +936,12 @@
      shift
      sage_setup
      if [ "$SAGE_DEBUG" = "no" ]; then
@@ -63,16 +59,7 @@ Author: Tobias Hansen <thansen at debian.org>
      fi
  }
  
-@@ -198,6 +198,8 @@
-         SAGE_SCRIPTS_DIR="$SAGE_LOCAL/bin"
-     elif [ -f "$SAGE_ROOT/src/bin/sage-env" ]; then
-         SAGE_SCRIPTS_DIR="$SAGE_ROOT/src/bin"
-+    elif [ -f "/usr/share/sagemath/bin/sage-env" ]; then
-+        SAGE_SCRIPTS_DIR="/usr/share/sagemath/bin"
-     else
-         echo >&2 "Error: You must set the SAGE_SCRIPTS_DIR environment variable to run this"
-         return 1
-@@ -275,7 +277,7 @@
+@@ -275,7 +275,7 @@
      SAGE_ORIG_PATH=$PATH && export SAGE_ORIG_PATH 
      SAGE_ORIG_PATH_SET=True && export SAGE_ORIG_PATH_SET 
  fi 
@@ -132,17 +119,24 @@ Author: Tobias Hansen <thansen at debian.org>
  if [ ! -d "$DOT_SAGE/valgrind" ]; then
 --- a/sage/src/sage/interfaces/maxima.py
 +++ b/sage/src/sage/interfaces/maxima.py
-@@ -536,7 +536,9 @@
-         SAGE_MAXIMA_DIR = os.path.join(DOT_SAGE,"maxima")
+@@ -473,7 +473,7 @@
+ 
+ from random import randrange
+ 
+-from sage.env import DOT_SAGE, SAGE_LOCAL
++from sage.env import DOT_SAGE, SAGE_SCRIPTS_DIR
+ 
+ ##import sage.rings.all
  
-         if not os.path.exists(STARTUP):
--            raise RuntimeError('You must get the file local/bin/sage-maxima.lisp')
-+            STARTUP = '/usr/share/sagemath/bin/sage-maxima.lisp'
-+            if not os.path.exists(STARTUP):
-+                raise RuntimeError('You must get the file local/bin/sage-maxima.lisp')
+@@ -524,7 +524,7 @@
+         # setting inchar and outchar..
+         eval_using_file_cutoff = 256
+         self.__eval_using_file_cutoff = eval_using_file_cutoff
+-        STARTUP = os.path.join(SAGE_LOCAL,'bin','sage-maxima.lisp')
++        STARTUP = os.path.join(SAGE_SCRIPTS_DIR,'sage-maxima.lisp')
  
-         #self.__init_code = init_code
-         if init_code is None:
+         # We set maxima's configuration directory to $DOT_SAGE/maxima
+         # This avoids that sage's maxima inadvertently loads
 --- a/sage/src/sage/doctest/control.py
 +++ b/sage/src/sage/doctest/control.py
 @@ -44,7 +44,7 @@

-- 
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