From e4003eb1b41c346ff504d80dfbcc9217f4b3c8e4 Mon Sep 17 00:00:00 2001 From: pcpa Date: Fri, 6 Sep 2019 17:36:22 -0300 Subject: [PATCH] Make available a sage-env script This script is used by the cantor sagemath backend. Other issues with the cantor sagemath backend were reported at https://bugs.kde.org/show_bug.cgi?id=411645 [Make sagemath backend compatible with sagemath built with python3] https://bugs.kde.org/show_bug.cgi?id=411646 [Please consider adding a configuration to use local sagemath documentation] --- sagemath.spec | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/sagemath.spec b/sagemath.spec index 30204f4..18ca078 100644 --- a/sagemath.spec +++ b/sagemath.spec @@ -1314,9 +1314,7 @@ popd %endif #------------------------------------------------------------------------ -cat > %{buildroot}%{_bindir}/sage << EOF -#!/bin/bash -i - +cat > %{buildroot}%{SAGE_LOCAL}/bin/sage-env << EOF export CUR=\$PWD ##export DOT_SAGE="\$HOME/.sage" mkdir -p \$DOT_SAGE/{maxima,sympow,tmp} @@ -1345,6 +1343,11 @@ export SYMPOW_DIR="\$DOT_SAGE/sympow" # Required for sage -gdb : \${SAGE_DEBUG:=no} export SAGE_DEBUG +EOF +cat > %{buildroot}%{_bindir}/sage << EOF +#!/bin/bash -i + +source $SAGE_LOCAL/bin/sage-env exec $SAGE_LOCAL/bin/sage "\$@" EOF #------------------------------------------------------------------------ @@ -1438,7 +1441,9 @@ perl -pi -e 's|%{buildroot}||g;' \ %endif # Script was used to build documentation -perl -pi -e 's|%{buildroot}||g;s|^##||g;' %{buildroot}%{_bindir}/sage +perl -pi -e 's|%{buildroot}||g;s|^##||g;' \ + %{buildroot}%{_bindir}/sage \ + %{buildroot}%{SAGE_LOCAL}/bin/sage-env #------------------------------------------------------------------------ # Fix links