Skip to content

Commit

Permalink
Make the package install sagetex.sty
Browse files Browse the repository at this point in the history
  • Loading branch information
culler committed Sep 28, 2021
1 parent dbf85db commit 0f2a59b
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 16 deletions.
19 changes: 15 additions & 4 deletions package/Distribution
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,25 @@
<choices-outline>
<line choice="org.computop.SageMath-9-4.bin"/>
<line choice="org.computop.SageMath-9-4.share"/>
<line choice="org.computop.SageMath-9-4.texlive"/>
</choices-outline>
<choice id="default"/>
<choice id="org.computop.SageMath-9-4.bin" title="Sage Script" description="Creates /usr/local/bin/sage">
<choice id="org.computop.SageMath-9-4.bin" title="Sage Script"
description="Creates /usr/local/bin/sage">
<pkg-ref id="org.computop.SageMath-9-4.bin"/>
</choice>
<choice id="org.computop.SageMath-9-4.share" title="Jupyter" description="Creates /usr/local/share/jupyter/">
<choice id="org.computop.SageMath-9-4.share" title="Jupyter"
description="Creates /usr/local/share/jupyter/">
<pkg-ref id="org.computop.SageMath-9-4.share"/>
</choice>
<pkg-ref id="org.computop.SageMath-9-4.bin" version="9.4" auth="Root" onConclusion="none" installKBytes="0">#SageMath_bin.pkg</pkg-ref>
<pkg-ref id="org.computop.SageMath-9-4.share" version="9.4" auth="Root" onConclusion="none" installKBytes="0">#SageMath_share.pkg</pkg-ref>
<choice id="org.computop.SageMath-9-4.texlive" title="SageTeX"
description="Creates /usr/local/texlive/texmf-local/tex/latex/local/sagetex.sty">
<pkg-ref id="org.computop.SageMath-9-4.texlive"/>
</choice>
<pkg-ref id="org.computop.SageMath-9-4.bin" version="9.4"
auth="Root" onConclusion="none" installKBytes="0">#SageMath_bin.pkg</pkg-ref>
<pkg-ref id="org.computop.SageMath-9-4.share" version="9.4"
auth="Root" onConclusion="none" installKBytes="0">#SageMath_share.pkg</pkg-ref>
<pkg-ref id="org.computop.SageMath-9-4.texlive" version="9.4"
auth="Root" onConclusion="none" installKBytes="0">#SageMath_texlive.pkg</pkg-ref>
</installer-gui-script>
3 changes: 3 additions & 0 deletions package/build_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ productsign --sign $DEV_ID bin.pkg packages/SageMath_bin.pkg
pkgbuild --root local_share --identifier org.computop.SageMath.$PKG_ID.share --version $VERSION --install-location /usr/local/share share.pkg
productsign --sign $DEV_ID share.pkg packages/SageMath_share.pkg

pkgbuild --root local_texlive --identifier org.computop.SageMath.$PKG_ID.texlive --version $VERSION --install-location /usr/local/texlive texlive.pkg
productsign --sign $DEV_ID texlive.pkg packages/SageMath_texlive.pkg

productbuild --distribution Distribution --package-path packages --resources resources recommended.pkg

productsign --sign $DEV_ID recommended.pkg Recommended_$PKG_ID.pkg
Expand Down
17 changes: 13 additions & 4 deletions package/local_bin/scripts/preinstall
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
#!/bin/bash
ANSWER=Yes

if [ -e /usr/local/bin/sage ]; then
ANSWER=`osascript \
-e 'button returned of (display dialog "May we overwrite your current /usr/local/bin/sage file?" buttons {"No", "Yes"})' \
`
if [ $ANSWER == "Yes" ]; then
exit 0
else
osascript -e 'display dialog "Please rerun the installer, but press \"Customize\" and uncheck \"Sage Script\"" buttons {"OK"}'
if [ $ANSWER == "No" ]; then
osascript -e 'display dialog "Please rerun the installer, but press \"Customize\" and uncheck \"Sage Script\"." buttons {"OK"}'
exit 1
fi
fi

if [ -e /usr/local/texlive/texmf-local/tex/latex/local/sagetex.sty ]; then
ANSWER=`osascript \
-e 'button returned of (display dialog "May we overwrite your current sagetex.sty file?" buttons {"No", "Yes"})' \
`
if [ $ANSWER != "Yes" ]; then
osascript -e 'display dialog "Please rerun the installer, but press \"Customize\" and uncheck \"SageTeX\"." buttons {"OK"}'
exit 1
fi
fi
26 changes: 18 additions & 8 deletions package/resources/Welcome.rtf
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{\rtf1\ansi\ansicpg1252\cocoartf2577
{\rtf1\ansi\ansicpg1252\cocoartf2580
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica-Bold;\f1\fswiss\fcharset0 Helvetica;\f2\fnil\fcharset0 Menlo-Regular;
\f3\fswiss\fcharset0 Helvetica-Oblique;}
{\colortbl;\red255\green255\blue255;\red0\green0\blue0;}
{\*\expandedcolortbl;;\cssrgb\c0\c0\c0;}
{\colortbl;\red255\green255\blue255;\red0\green0\blue0;\red0\green0\blue0;}
{\*\expandedcolortbl;;\cssrgb\c0\c0\c0;\csgray\c0;}
{\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid1\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid1}
{\list\listtemplateid2\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid101\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid2}}
{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}{\listoverride\listid2\listoverridecount0\ls2}}
\margl1440\margr1440\vieww11520\viewh8400\viewkind0
{\list\listtemplateid2\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid101\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid2}
{\list\listtemplateid3\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid201\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid3}}
{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}{\listoverride\listid2\listoverridecount0\ls2}{\listoverride\listid3\listoverridecount0\ls3}}
\margl1440\margr1440\vieww20020\viewh10940\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0

\f0\b\fs36 \cf0 The SageMath-9.4 App
Expand All @@ -17,7 +18,7 @@
\fs28 \
\
\f1\b0 This installer adds two optional additional features to your SageMath-9.4 app.\
\f1\b0 This installer adds three optional additional features to your SageMath-9.4 app.\
\
\pard\tx220\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\sl288\slmult1\pardirnatural\partightenfactor0
\ls1\ilvl0\cf0 {\listtext \uc0\u8226 }A script
Expand All @@ -31,8 +32,17 @@
\ls2\ilvl0\cf0 {\listtext \uc0\u8226 }A directory
\f2\fs24 \cf2 /usr/local/share/jupyter/
\f1\fs28 \cf0 which enables JupyterLab to detect the SageMath kernel.\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\sl288\slmult1\pardirnatural\partightenfactor0
\cf0 \
\pard\tx220\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\sl288\slmult1\pardirnatural\partightenfactor0
\ls3\ilvl0\cf0 {\listtext \uc0\u8226 }A symbolic link
\f2\fs24 \cf3 \CocoaLigature0 /usr/local/texlive/texmf-local/tex/latex/local/sagetex.sty
\f1 which makes the sagetex.sty file distributed with this app available to texlive. You must run
\f2 sudo mktexlsr
\f1 after installing SageMath to complete the installation of sagetex.sty.
\fs28 \cf0 \CocoaLigature1 \
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\cf0 \
To disable installation of either feature, press \'93Customize\'94 on the
To disable installation of any of these features, press \'93Customize\'94 on the
\f3\i Installation Type
\f1\i0 screen.}

0 comments on commit 0f2a59b

Please sign in to comment.