11#! /bin/bash
22set -euxo pipefail
33
4- ARCH=$( uname -m)
4+ # Mapping of `uname -m` values to equivalent GOARCH values
5+ declare -A UNAME_TO_GOARCH
6+ UNAME_TO_GOARCH[" x86_64" ]=" amd64"
7+ UNAME_TO_GOARCH[" aarch64" ]=" arm64"
8+ UNAME_TO_GOARCH[" ppc64le" ]=" ppc64le"
9+ UNAME_TO_GOARCH[" s390x" ]=" s390x"
10+
11+ ARCH=" ${UNAME_TO_GOARCH[$(uname -m)]} "
512
613if [[ " $ARCH " == " ppc64le" ]]; then
714 echo " Installing TeX Live from source for $ARCH ..."
@@ -12,7 +19,8 @@ if [[ "$ARCH" == "ppc64le" ]]; then
1219 gd-devel libtool wget tar xz bison flex libXaw-devel
1320
1421 # Step 1: Download and extract the TeX Live source
15- wget https://ftp.math.utah.edu/pub/tex/historic/systems/texlive/2025/texlive-20250308-source.tar.xz
22+ # wget https://ftp.math.utah.edu/pub/tex/historic/systems/texlive/2025/texlive-20250308-source.tar.xz
23+ wget --no-check-certificate https://ftp.math.utah.edu/pub/tex/historic/systems/texlive/2025/texlive-20250308-source.tar.xz
1624 tar -xf texlive-20250308-source.tar.xz
1725 cd texlive-20250308-source
1826
@@ -27,9 +35,8 @@ if [[ "$ARCH" == "ppc64le" ]]; then
2735 make install
2836
2937 # Symlink for pdflatex
30- cd /usr/local/texlive/bin/powerpc64le-unknown-linux-gnu
31- ln -sf pdftex pdflatex
32-
38+ ln -sf pdftex /usr/local/texlive/bin/powerpc64le-unknown-linux-gnu/pdflatex
39+
3340 # Cleanup sources to reduce image size
3441 rm -rf /texlive-20250308-source /texlive-build
3542
5259
5360 ./install-tl --profile=texlive.profile --custom-bin=$TEXLIVE_INSTALL_PREFIX /bin/powerpc64le-unknown-linux-gnu
5461
62+ # TeX Live binary directory
63+ TEX_BIN_DIR=" /usr/local/texlive/bin/powerpc64le-unknown-linux-gnu"
64+
65+ # Create standard symlink 'linux' → arch-specific folder
66+ ln -sf " $TEX_BIN_DIR " /usr/local/texlive/bin/linux
67+
68+
5569 # Set up environment
56- export PATH=" $TEXLIVE_INSTALL_PREFIX /bin/powerpc64le-unknown- linux-gnu :$PATH "
70+ export PATH=" $TEXLIVE_INSTALL_PREFIX /bin/linux:$PATH "
5771 pdflatex --version
5872 tlmgr --version
5973
60- elif [[ " $ARCH " == " x86_64 " ]]; then
74+ elif [[ " $ARCH " == " amd64 " ]]; then
6175 # tex live installation
62- echo " Installing TexLive to allow PDf export from Notebooks"
63- curl -L https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz -o install-tl-unx.tar.gz
76+ echo " Installing TexLive to allow PDf export from Notebooks"
77+ curl -fL https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz -o install-tl-unx.tar.gz
6478 zcat < install-tl-unx.tar.gz | tar xf -
6579 cd install-tl-2*
6680 perl ./install-tl --no-interaction --scheme=scheme-small --texdir=/usr/local/texlive
67- cd /usr/local/texlive/bin/x86_64-linux
81+ mv /usr/local/texlive/bin/" $( uname -m) -linux" /usr/local/texlive/bin/linux
82+ cd /usr/local/texlive/bin/linux
6883 ./tlmgr install tcolorbox pdfcol adjustbox titling enumitem soul ucs collection-fontsrecommended
6984
7085else
0 commit comments