Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 31 additions & 33 deletions jupyter/utils/install_pdf_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,35 @@

set -euxo pipefail

# Mapping of `uname -m` values to equivalent GOARCH values
declare -A UNAME_TO_GOARCH
UNAME_TO_GOARCH["x86_64"]="amd64"
UNAME_TO_GOARCH["aarch64"]="arm64"
UNAME_TO_GOARCH["ppc64le"]="ppc64le"
UNAME_TO_GOARCH["s390x"]="s390x"
dnf install -y \
pandoc \
texlive-adjustbox \
texlive-bibtex \
texlive-charter \
texlive-ec \
texlive-euro \
texlive-eurosym \
texlive-fpl \
texlive-jknapltx \
texlive-knuth-local \
texlive-lm-math \
texlive-marvosym \
texlive-mathpazo \
texlive-mflogo-font \
texlive-parskip \
texlive-plain \
texlive-pxfonts \
texlive-rsfs \
texlive-tcolorbox \
texlive-times \
texlive-titling \
texlive-txfonts \
texlive-ulem \
texlive-upquote \
texlive-utopia \

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 For better readability and easier maintenance, consider sorting the packages alphabetically.

texlive-wasy \
texlive-wasy-type1 \
texlive-wasysym \
texlive-xetex

ARCH="${UNAME_TO_GOARCH[$(uname -m)]}"
if [[ -z "${ARCH:-}" ]]; then
echo "Unsupported architecture: $(uname -m)" >&2
exit 1
fi

# Skip PDF export installation for s390x architecture
if [[ "$(uname -m)" == "s390x" ]]; then
echo "PDF export functionality is not supported on s390x architecture. Skipping installation."
exit 0
fi

# tex live installation
echo "Installing TexLive to allow PDf export from Notebooks"
curl -fL https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz -o install-tl-unx.tar.gz
zcat < install-tl-unx.tar.gz | tar xf -
cd install-tl-2*
perl ./install-tl --no-interaction --scheme=scheme-small --texdir=/usr/local/texlive
mv /usr/local/texlive/bin/"$(uname -m)-linux" /usr/local/texlive/bin/linux
cd /usr/local/texlive/bin/linux
./tlmgr install tcolorbox pdfcol adjustbox titling enumitem soul ucs collection-fontsrecommended

# pandoc installation
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
mkdir -p /usr/local/pandoc
tar xvzf /tmp/pandoc.tar.gz --strip-components 1 -C /usr/local/pandoc/
rm -f /tmp/pandoc.tar.gz
dnf clean all
Loading