Skip to content

Commit 5112706

Browse files
committed
Align the latex and pandoc installing scripts
the PR being merged split the install_pdf_deps.sh into two scripts, install_texlive.sh and install_pandoc.sh this will need to be revisited later and consolidated
1 parent fdcf82a commit 5112706

File tree

3 files changed

+39
-12
lines changed

3 files changed

+39
-12
lines changed

jupyter/utils/install_pandoc.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,16 @@ UNAME_TO_GOARCH["ppc64le"]="ppc64le"
99
UNAME_TO_GOARCH["s390x"]="s390x"
1010

1111
ARCH="${UNAME_TO_GOARCH[$(uname -m)]}"
12+
if [[ -z "${ARCH:-}" ]]; then
13+
echo "Unsupported architecture: $(uname -m)" >&2
14+
exit 1
15+
fi
16+
17+
# Skip PDF export installation for s390x architecture
18+
if [[ "$(uname -m)" == "s390x" ]]; then
19+
echo "PDF export functionality is not supported on s390x architecture. Skipping installation."
20+
exit 0
21+
fi
1222

1323
if [[ "$ARCH" == "ppc64le" ]]; then
1424
# Install Pandoc from source
@@ -25,7 +35,13 @@ if [[ "$ARCH" == "ppc64le" ]]; then
2535
git submodule update --init --recursive
2636

2737
cabal update
38+
39+
# Build the CLI tool (not the top-level library package)
2840
cd pandoc-cli
41+
42+
# Clean previous builds
43+
cabal clean
44+
2945
cabal build -j"$(nproc)"
3046
mkdir -p /usr/local/pandoc/bin
3147
cabal install \
@@ -38,6 +54,7 @@ if [[ "$ARCH" == "ppc64le" ]]; then
3854
dnf remove -y cabal-install ghc gmp-devel
3955
dnf clean all && rm -rf /var/cache/dnf
4056

57+
# Verify installation
4158
/usr/local/pandoc/bin/pandoc --version
4259

4360
elif [[ "$ARCH" == "amd64" ]]; then

jupyter/utils/install_pdf_deps.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ if [[ "$(uname -m)" == "s390x" ]]; then
2323
exit 0
2424
fi
2525

26-
ARCH=$(uname -m)
27-
2826
if [[ "$ARCH" == "ppc64le" ]]; then
2927
echo "Installing TeX Live from source for $ARCH"
3028

@@ -65,11 +63,13 @@ if [[ "$ARCH" == "ppc64le" ]]; then
6563

6664
# Set version
6765
PANDOC_VERSION=3.7.0.2
66+
6867
cd /tmp
6968
git clone --recurse-submodules https://github.com/jgm/pandoc.git
7069
cd pandoc
7170
git checkout ${PANDOC_VERSION}
7271
git submodule update --init --recursive
72+
7373
cabal update
7474

7575
# Build the CLI tool (not the top-level library package)
@@ -85,20 +85,21 @@ if [[ "$ARCH" == "ppc64le" ]]; then
8585
rm -rf ~/.cabal ~/.ghc /tmp/pandoc
8686
dnf remove -y cabal-install ghc gmp-devel
8787
dnf clean all && rm -rf /var/cache/dnf
88+
8889
# Verify installation
8990
/usr/local/bin/pandoc --version
9091

9192
fi
9293

93-
if [[ "$ARCH" == "x86_64" ]]; then
94+
if [[ "$ARCH" == "amd64" ]]; then
9495
# tex live installation
9596
echo "Installing TexLive to allow PDf export from Notebooks"
9697
curl -fL https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz -o install-tl-unx.tar.gz
9798
zcat < install-tl-unx.tar.gz | tar xf -
9899
cd install-tl-2*
99100
perl ./install-tl --no-interaction --scheme=scheme-small --texdir=/usr/local/texlive
100101
mv /usr/local/texlive/bin/"$(uname -m)-linux" /usr/local/texlive/bin/linux
101-
cd /usr/local/texlive/bin/linux
102+
cd /usr/local/texlive/bin/linux
102103
./tlmgr install tcolorbox pdfcol adjustbox titling enumitem soul ucs collection-fontsrecommended
103104

104105
# pandoc installation
@@ -108,4 +109,3 @@ cd /usr/local/texlive/bin/linux
108109
rm -f /tmp/pandoc.tar.gz
109110

110111
fi
111-

jupyter/utils/install_texlive.sh

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,16 @@ UNAME_TO_GOARCH["ppc64le"]="ppc64le"
99
UNAME_TO_GOARCH["s390x"]="s390x"
1010

1111
ARCH="${UNAME_TO_GOARCH[$(uname -m)]}"
12+
if [[ -z "${ARCH:-}" ]]; then
13+
echo "Unsupported architecture: $(uname -m)" >&2
14+
exit 1
15+
fi
16+
17+
# Skip PDF export installation for s390x architecture
18+
if [[ "$(uname -m)" == "s390x" ]]; then
19+
echo "PDF export functionality is not supported on s390x architecture. Skipping installation."
20+
exit 0
21+
fi
1222

1323
if [[ "$ARCH" == "ppc64le" ]]; then
1424
echo "Installing TeX Live from source for $ARCH..."
@@ -29,13 +39,15 @@ if [[ "$ARCH" == "ppc64le" ]]; then
2939
# Create build directory and build
3040
mkdir ../texlive-build
3141
cd ../texlive-build
42+
43+
# Configure, build, install
3244
../texlive-20250308-source/configure --prefix=/usr/local/texlive
3345
make -j"$(nproc)"
3446
make install
3547

3648
# Symlink for pdflatex
3749
ln -sf pdftex /usr/local/texlive/bin/powerpc64le-unknown-linux-gnu/pdflatex
38-
50+
3951
# Cleanup sources to reduce image size
4052
rm -rf /texlive-20250308-source /texlive-build
4153

@@ -58,12 +70,11 @@ EOF
5870

5971
./install-tl --profile=texlive.profile --custom-bin=$TEXLIVE_INSTALL_PREFIX/bin/powerpc64le-unknown-linux-gnu
6072

61-
# TeX Live binary directory
62-
TEX_BIN_DIR="/usr/local/texlive/bin/powerpc64le-unknown-linux-gnu"
63-
64-
# Create standard symlink 'linux' → arch-specific folder
65-
ln -sf "$TEX_BIN_DIR" /usr/local/texlive/bin/linux
73+
# TeX Live binary directory
74+
TEX_BIN_DIR="/usr/local/texlive/bin/powerpc64le-unknown-linux-gnu"
6675

76+
# Create standard symlink 'linux' → arch-specific folder
77+
ln -sf "$TEX_BIN_DIR" /usr/local/texlive/bin/linux
6778

6879
# Set up environment
6980
export PATH="$TEXLIVE_INSTALL_PREFIX/bin/linux:$PATH"
@@ -86,4 +97,3 @@ else
8697
exit 1
8798

8899
fi
89-

0 commit comments

Comments
 (0)