1
1
#! /bin/bash
2
2
set -euxo pipefail
3
3
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)]} "
5
12
6
13
if [[ " $ARCH " == " ppc64le" ]]; then
7
14
echo " Installing TeX Live from source for $ARCH ..."
@@ -12,7 +19,8 @@ if [[ "$ARCH" == "ppc64le" ]]; then
12
19
gd-devel libtool wget tar xz bison flex libXaw-devel
13
20
14
21
# 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
16
24
tar -xf texlive-20250308-source.tar.xz
17
25
cd texlive-20250308-source
18
26
@@ -27,9 +35,8 @@ if [[ "$ARCH" == "ppc64le" ]]; then
27
35
make install
28
36
29
37
# 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
+
33
40
# Cleanup sources to reduce image size
34
41
rm -rf /texlive-20250308-source /texlive-build
35
42
52
59
53
60
./install-tl --profile=texlive.profile --custom-bin=$TEXLIVE_INSTALL_PREFIX /bin/powerpc64le-unknown-linux-gnu
54
61
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
+
55
69
# Set up environment
56
- export PATH=" $TEXLIVE_INSTALL_PREFIX /bin/powerpc64le-unknown- linux-gnu :$PATH "
70
+ export PATH=" $TEXLIVE_INSTALL_PREFIX /bin/linux:$PATH "
57
71
pdflatex --version
58
72
tlmgr --version
59
73
60
- elif [[ " $ARCH " == " x86_64 " ]]; then
74
+ elif [[ " $ARCH " == " amd64 " ]]; then
61
75
# 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
64
78
zcat < install-tl-unx.tar.gz | tar xf -
65
79
cd install-tl-2*
66
80
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
68
83
./tlmgr install tcolorbox pdfcol adjustbox titling enumitem soul ucs collection-fontsrecommended
69
84
70
85
else
0 commit comments