Skip to content

Commit 2860382

Browse files
puneetsharma21jiridanek
authored andcommitted
Fix TeX Live PATH for multi-arch support (x86_64, ppc64le)
Signed-off-by: puneetsharma21 <[email protected]>
1 parent 7037298 commit 2860382

File tree

2 files changed

+35
-13
lines changed

2 files changed

+35
-13
lines changed

jupyter/utils/install_pandoc.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
#!/bin/bash
22
set -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

613
if [[ "$ARCH" == "ppc64le" ]]; then
714
# Install Pandoc from source
@@ -33,9 +40,9 @@ if [[ "$ARCH" == "ppc64le" ]]; then
3340

3441
/usr/local/pandoc/bin/pandoc --version
3542

36-
elif [[ "$ARCH" == "x86_64" ]]; then
43+
elif [[ "$ARCH" == "amd64" ]]; then
3744
# pandoc installation
38-
curl -L https://github.com/jgm/pandoc/releases/download/3.7.0.2/pandoc-3.7.0.2-linux-amd64.tar.gz -o /tmp/pandoc.tar.gz
45+
curl -fL "https://github.com/jgm/pandoc/releases/download/3.7.0.2/pandoc-3.7.0.2-linux-${ARCH}.tar.gz" -o /tmp/pandoc.tar.gz
3946
mkdir -p /usr/local/pandoc
4047
tar xvzf /tmp/pandoc.tar.gz --strip-components 1 -C /usr/local/pandoc/
4148
rm -f /tmp/pandoc.tar.gz

jupyter/utils/install_texlive.sh

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
#!/bin/bash
22
set -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

613
if [[ "$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

@@ -52,19 +59,27 @@ EOF
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

7085
else

0 commit comments

Comments
 (0)