Skip to content

Commit d9b4382

Browse files
puneetsharma21jiridanek
authored andcommitted
Improve TeX Live and Pandoc setup to compile pandoc from sources
1 parent 86214aa commit d9b4382

File tree

1 file changed

+46
-15
lines changed

1 file changed

+46
-15
lines changed

jupyter/utils/install_pdf_deps.sh

Lines changed: 46 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,44 +34,75 @@ if [[ "$ARCH" == "ppc64le" ]]; then
3434
cd texlive-20250308-source
3535

3636
# Install build dependencies
37-
dnf install -y gcc gcc-c++ perl make libX11-devel libXt-devel \
37+
dnf install -y gcc-toolset-13 perl make libX11-devel libXt-devel \
3838
zlib-devel freetype-devel libpng-devel ncurses-devel \
3939
gd-devel libtool wget tar xz bison flex libXaw-devel
4040

41+
source /opt/rh/gcc-toolset-13/enable
42+
4143
# Create build directory
4244
mkdir ../texlive-build
4345
cd ../texlive-build
4446

4547
# Configure, build, install
46-
../texlive-20250308-source/configure --prefix=/opt/texlive/2025
48+
../texlive-20250308-source/configure --prefix=/usr/local/texlive
4749
make -j$(nproc)
4850
make install
4951

5052
# Symlink for pdflatex
51-
cd /opt/texlive/2025/bin/powerpc64le-unknown-linux-gnu
53+
cd /usr/local/texlive/bin/powerpc64le-unknown-linux-gnu
5254
ln -s pdftex pdflatex
53-
export PATH="/opt/texlive/2025/bin/powerpc64le-unknown-linux-gnu:$PATH"
55+
export PATH="/usr/local/texlive/bin/powerpc64le-unknown-linux-gnu:$PATH"
5456
pdflatex --version
5557

56-
# Install pandoc
58+
# Install dependencies
5759
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
58-
dnf install -y pandoc
60+
dnf install -y cabal-install ghc gmp-devel
61+
# Set version
62+
PANDOC_VERSION=3.7.0.2
63+
64+
# Clone repo
65+
cd /tmp
66+
git clone --recurse-submodules https://github.com/jgm/pandoc.git
67+
cd pandoc
68+
git checkout ${PANDOC_VERSION}
69+
git submodule update --init --recursive
70+
71+
# Update Cabal
72+
cabal update
73+
74+
# Build the CLI tool (not the top-level library package)
75+
cd pandoc-cli
76+
77+
# Clean previous builds
78+
cabal clean
79+
80+
# Configure and build
81+
cabal build -j
5982

60-
else
61-
echo "Installing TeX Live from installer for $ARCH"
83+
# Install the CLI executable
84+
cabal install --installdir=/usr/local/bin --overwrite-policy=always
6285

63-
# Download and install from official installer
86+
# Verify installation
87+
/usr/local/bin/pandoc --version
88+
89+
fi
90+
91+
if [[ "$ARCH" == "x86_64" ]]; then
92+
# tex live installation
93+
echo "Installing TexLive to allow PDf export from Notebooks"
6494
curl -fL https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz -o install-tl-unx.tar.gz
6595
zcat < install-tl-unx.tar.gz | tar xf -
6696
cd install-tl-2*
6797
perl ./install-tl --no-interaction --scheme=scheme-small --texdir=/usr/local/texlive
6898
mv /usr/local/texlive/bin/"$(uname -m)-linux" /usr/local/texlive/bin/linux
6999
cd /usr/local/texlive/bin/linux
70100
./tlmgr install tcolorbox pdfcol adjustbox titling enumitem soul ucs collection-fontsrecommended
71-
fi
72101

73-
# pandoc installation
74-
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
75-
mkdir -p /usr/local/pandoc
76-
tar xvzf /tmp/pandoc.tar.gz --strip-components 1 -C /usr/local/pandoc/
77-
rm -f /tmp/pandoc.tar.gz
102+
# pandoc installation
103+
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
104+
mkdir -p /usr/local/pandoc
105+
tar xvzf /tmp/pandoc.tar.gz --strip-components 1 -C /usr/local/pandoc/
106+
rm -f /tmp/pandoc.tar.gz
107+
108+
fi

0 commit comments

Comments
 (0)