[sagemath] 01/02: Install scripts to /usr/share/sage/bin.

Tobias Hansen thansen at moszumanska.debian.org
Sat Dec 3 20:20:59 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 f308193b1295bc413c633a3a680ebdd526a269bb
Author: Tobias Hansen <thansen at broeselmaschine.fc.up.pt>
Date:   Sat Dec 3 12:21:49 2016 +0000

    Install scripts to /usr/share/sage/bin.
---
 debian/patches/debian-scripts-dir.patch            | 194 +++++++++++++++++++++
 debian/patches/debian-skip-check.patch             |   2 +-
 debian/patches/series                              |   1 +
 .../version-temp-singular-4-extra-fixes.patch      |   2 +-
 debian/sagemath-common.install                     |  33 +---
 5 files changed, 198 insertions(+), 34 deletions(-)

diff --git a/debian/patches/debian-scripts-dir.patch b/debian/patches/debian-scripts-dir.patch
new file mode 100644
index 0000000..bfcea06
--- /dev/null
+++ b/debian/patches/debian-scripts-dir.patch
@@ -0,0 +1,194 @@
+Description: Find scripts when installed to /usr/share/sage/bin.
+ Most of these scripts are intended to be used via the sage script,
+ so we install only sage to /usr/bin.
+Author: Tobias Hansen <thansen at debian.org>
+
+--- a/sage/src/bin/sage
++++ b/sage/src/bin/sage
+@@ -336,7 +336,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/sage/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)."
+@@ -425,13 +430,13 @@
+ #####################################################################
+ 
+ if [ "$1" = '-dumpversion' -o "$1" = '--dumpversion' ]; then
+-	. "$SAGE_LOCAL"/bin/sage-version.sh
++	. "$SAGE_SCRIPTS_DIR/sage-version.sh
+ 	echo ${SAGE_VERSION}
+ 	exit 0
+ fi
+ 
+ if [ "$1" = '-v' -o "$1" = '-version' -o "$1" = '--version' ]; then
+-	. "$SAGE_LOCAL"/bin/sage-version.sh
++	. "$SAGE_SCRIPTS_DIR/sage-version.sh
+ 	echo "SageMath version ${SAGE_VERSION}, Release Date: ${SAGE_RELEASE_DATE}"
+ 	exit 0
+ fi
+@@ -936,12 +941,12 @@
+     shift
+     sage_setup
+     if [ "$SAGE_DEBUG" = "no" ]; then
+-        gdb -x "$SAGE_LOCAL/bin/sage-gdb-commands" \
+-            -args python "$SAGE_LOCAL/bin/sage-ipython" "$@" -i
++        gdb -x "$SAGE_SCRIPTS_DIR/sage-gdb-commands" \
++            -args python "$SAGE_SCRIPTS_DIR/sage-ipython" "$@" -i
+     else
+         cygdb "$SAGE_SRC/build" "$SAGE_SRC/sage" \
+-            -- -x "$SAGE_LOCAL/bin/sage-gdb-commands" \
+-            -args python "$SAGE_LOCAL/bin/sage-ipython" "$@" -i
++            -- -x "$SAGE_SCRIPTS_DIR/sage-gdb-commands" \
++            -args python "$SAGE_SCRIPTS_DIR/sage-ipython" "$@" -i
+     fi
+     exit $?
+ fi
+--- a/sage/src/bin/sage-env
++++ b/sage/src/bin/sage-env
+@@ -142,7 +142,7 @@
+     elif [ "$SAGE_BANNER" != "no" ]; then
+         # This file sage-banner is not yet available during the build
+         # of Sage, so we ignore errors from cat.
+-        cat "$SAGE_LOCAL/bin/sage-banner" 2>/dev/null
++        cat "$SAGE_SCRIPTS_DIR/sage-banner" 2>/dev/null
+     fi
+ }
+ 
+@@ -187,6 +187,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/sage/bin/sage-env" ]; then
++        SAGE_SCRIPTS_DIR="/usr/share/sage/bin"
+     else
+         echo >&2 "Error: You must set the SAGE_SCRIPTS_DIR environment variable to run this"
+         return 1
+@@ -268,7 +270,7 @@
+     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 PATH="$SAGE_ROOT/build/bin:$SAGE_SRC/bin:$SAGE_LOCAL/bin:$SAGE_SCRIPTS_DIR:$PATH"
+ 
+ # 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.
+--- a/sage/src/bin/sage-massif
++++ b/sage/src/bin/sage-massif
+@@ -1,7 +1,7 @@
+ #!/usr/bin/env bash
+ 
+ # We reuse the gdb pythonstartup script.
+-PYTHONSTARTUP=$SAGE_LOCAL/bin/sage-ipython
++PYTHONSTARTUP=$SAGE_SCRIPTS_DIR/sage-ipython
+ export PYTHONSTARTUP
+ echo $PYTHONSTARTUP
+ if [ ! -d "$DOT_SAGE/valgrind" ]; then
+--- a/sage/src/bin/sage-valgrind
++++ b/sage/src/bin/sage-valgrind
+@@ -19,4 +19,4 @@
+     echo "Using default flags: $MEMCHECK_FLAGS"
+ fi
+ 
+-valgrind --tool=memcheck $MEMCHECK_FLAGS python "$SAGE_LOCAL/bin/sage-ipython" "$@" -i
++valgrind --tool=memcheck $MEMCHECK_FLAGS python "$SAGE_SCRIPTS_DIR/sage-ipython" "$@" -i
+--- a/sage/src/bin/sage-cachegrind
++++ b/sage/src/bin/sage-cachegrind
+@@ -1,7 +1,7 @@
+ #!/usr/bin/env bash
+ 
+ # We reuse the gdb pythonstartup script.
+-PYTHONSTARTUP=$SAGE_LOCAL/bin/sage-ipython
++PYTHONSTARTUP=$SAGE_SCRIPTS_DIR/sage-ipython
+ export PYTHONSTARTUP
+ echo $PYTHONSTARTUP
+ if [ ! -d "$DOT_SAGE/valgrind" ]; then
+--- a/sage/src/bin/sage-callgrind
++++ b/sage/src/bin/sage-callgrind
+@@ -13,4 +13,4 @@
+     echo "Using default flags: $CALLGRIND_FLAGS"
+ fi
+ 
+-valgrind --tool=callgrind $CALLGRIND_FLAGS python "$SAGE_LOCAL/bin/sage-ipython" "$@" -i
++valgrind --tool=callgrind $CALLGRIND_FLAGS python "$SAGE_SCRIPTS_DIR/sage-ipython" "$@" -i
+--- a/sage/src/bin/sage-omega
++++ b/sage/src/bin/sage-omega
+@@ -1,7 +1,7 @@
+ #!/usr/bin/env bash
+ 
+ # We reuse the gdb pythonstartup script.
+-PYTHONSTARTUP=$SAGE_LOCAL/bin/sage-ipython
++PYTHONSTARTUP=$SAGE_SCRIPTS_DIR/sage-ipython
+ export PYTHONSTARTUP
+ echo $PYTHONSTARTUP
+ 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")
+ 
+         if not os.path.exists(STARTUP):
+-            raise RuntimeError('You must get the file local/bin/sage-maxima.lisp')
++            STARTUP = '/usr/share/sage/bin/sage-maxima.lisp'
++            if not os.path.exists(STARTUP):
++                raise RuntimeError('You must get the file local/bin/sage-maxima.lisp')
+ 
+         #self.__init_code = init_code
+         if init_code is None:
+--- a/sage/src/sage/doctest/control.py
++++ b/sage/src/sage/doctest/control.py
+@@ -44,7 +44,7 @@
+     This class is used for doctesting the Sage doctest module.
+ 
+     It fills in attributes to be the same as the defaults defined in
+-    ``SAGE_LOCAL/bin/sage-runtests``, expect for a few places,
++    ``SAGE_SCRIPTS_DIR/sage-runtests``, expect for a few places,
+     which is mostly to make doctesting more predictable.
+ 
+     EXAMPLES::
+@@ -252,7 +252,7 @@
+ 
+         INPUT:
+ 
+-        - options -- either options generated from the command line by SAGE_LOCAL/bin/sage-runtests
++        - options -- either options generated from the command line by SAGE_SCRIPTS_DIR/sage-runtests
+                      or a DocTestDefaults object (possibly with some entries modified)
+         - args -- a list of filenames to doctest
+ 
+@@ -935,9 +935,9 @@
+             sage: from sage.doctest.control import DocTestDefaults, DocTestController
+             sage: DC = DocTestController(DocTestDefaults(timeout=123), ["hello_world.py"])
+             sage: print(DC._assemble_cmd())
+-            python "$SAGE_LOCAL/bin/sage-runtests" --serial --timeout=123 hello_world.py
++            python "$SAGE_SCRIPTS_DIR/sage-runtests" --serial --timeout=123 hello_world.py
+         """
+-        cmd = '''python "%s" --serial '''%(os.path.join("$SAGE_LOCAL","bin","sage-runtests"))
++        cmd = '''python "%s" --serial '''%(os.path.join("$SAGE_SCRIPTS_DIR","sage-runtests"))
+         opt = dict_difference(self.options.__dict__, DocTestDefaults().__dict__)
+         for o in ("all", "sagenb"):
+             if o in opt:
+@@ -971,14 +971,14 @@
+             sage: DD = DocTestDefaults(gdb=True)
+             sage: DC = DocTestController(DD, ["hello_world.py"])
+             sage: DC.run_val_gdb(testing=True)
+-            exec gdb -x "$SAGE_LOCAL/bin/sage-gdb-commands" --args python "$SAGE_LOCAL/bin/sage-runtests" --serial --timeout=0 hello_world.py
++            exec gdb -x "$SAGE_LOCAL/bin/sage-gdb-commands" --args python "$SAGE_SCRIPTS_DIR/sage-runtests" --serial --timeout=0 hello_world.py
+ 
+         ::
+ 
+             sage: DD = DocTestDefaults(valgrind=True, optional="all", timeout=172800)
+             sage: DC = DocTestController(DD, ["hello_world.py"])
+             sage: DC.run_val_gdb(testing=True)
+-            exec valgrind --tool=memcheck --leak-resolution=high --leak-check=full --num-callers=25 --suppressions="$SAGE_LOCAL/lib/valgrind/sage.supp"  --log-file=".../valgrind/sage-memcheck.%p" python "$SAGE_LOCAL/bin/sage-runtests" --serial --timeout=172800 --optional=all hello_world.py
++            exec valgrind --tool=memcheck --leak-resolution=high --leak-check=full --num-callers=25 --suppressions="$SAGE_LOCAL/lib/valgrind/sage.supp"  --log-file=".../valgrind/sage-memcheck.%p" python "$SAGE_SCRIPTS_DIR/sage-runtests" --serial --timeout=172800 --optional=all hello_world.py
+         """
+         try:
+             sage_cmd = self._assemble_cmd()
diff --git a/debian/patches/debian-skip-check.patch b/debian/patches/debian-skip-check.patch
index 56361b8..dba8f2e 100644
--- a/debian/patches/debian-skip-check.patch
+++ b/debian/patches/debian-skip-check.patch
@@ -5,7 +5,7 @@ Forwarded: not-needed
 
 --- a/sage/src/bin/sage
 +++ b/sage/src/bin/sage
-@@ -355,18 +355,6 @@
+@@ -360,18 +360,6 @@
  
  # Prepare for running Sage, either interactively or non-interactively.
  sage_setup() {
diff --git a/debian/patches/series b/debian/patches/series
index 7a7a7bc..de9b671 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -52,6 +52,7 @@ debian-install-paths.patch
 
 # temporary patches for whatever reason
 # they will eventually be gotten rid of
+debian-scripts-dir.patch
 debian-skip-check.patch
 temp-disable-parallel-sphinx.patch
 temp-cython-include-source.patch
diff --git a/debian/patches/version-temp-singular-4-extra-fixes.patch b/debian/patches/version-temp-singular-4-extra-fixes.patch
index 4002a44..0295923 100644
--- a/debian/patches/version-temp-singular-4-extra-fixes.patch
+++ b/debian/patches/version-temp-singular-4-extra-fixes.patch
@@ -8,7 +8,7 @@ Forwarded: TODO, to Sage
 This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
 --- a/sage/src/bin/sage
 +++ b/sage/src/bin/sage
-@@ -460,7 +460,7 @@
+@@ -465,7 +465,7 @@
  
  if [ "$1" = '-singular' -o "$1" = '--singular' ]; then
      shift
diff --git a/debian/sagemath-common.install b/debian/sagemath-common.install
index 2471c87..81f75f8 100644
--- a/debian/sagemath-common.install
+++ b/debian/sagemath-common.install
@@ -1,36 +1,5 @@
 usr/bin/sage
-usr/bin/sage-arch-env
-usr/bin/sage-banner
-usr/bin/sage-cachegrind
-usr/bin/sage-callgrind
-usr/bin/sage-cleaner
-usr/bin/sage-coverage
-usr/bin/sage-coverageall
-usr/bin/sage-cython
-usr/bin/sage-env
-usr/bin/sage-eval
-usr/bin/sage-grep
-usr/bin/sage-grepdoc
-usr/bin/sage-inline-fortran
-usr/bin/sage-ipython
-usr/bin/sage-massif
-usr/bin/sage-maxima.lisp
-usr/bin/sage-native-execute
-usr/bin/sage-notebook
-usr/bin/sage-num-threads.py
-usr/bin/sage-omega
-usr/bin/sage-open
-usr/bin/sage-preparse
-usr/bin/sage-python
-usr/bin/sage-rst2sws
-usr/bin/sage-rst2txt
-usr/bin/sage-run
-usr/bin/sage-run-cython
-usr/bin/sage-runtests
-usr/bin/sage-startuptime.py
-usr/bin/sage-sws2rst
-usr/bin/sage-valgrind
-usr/bin/sage-version.sh
+debian/tmp/usr/bin/sage-* usr/share/sage/bin
 usr/share/sage/ext
 usr/share/jupyter/*
 usr/lib/python2.7/dist-packages/sage*

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