Skip to content

Commit 287194d

Browse files
puneetsharma21jiridanek
authored andcommitted
Add cleanup for the pandoc build directory and tweak TeX Live & Pandoc install
1 parent d9b4382 commit 287194d

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

jupyter/utils/install_pdf_deps.sh

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,23 +52,24 @@ if [[ "$ARCH" == "ppc64le" ]]; then
5252
# Symlink for pdflatex
5353
cd /usr/local/texlive/bin/powerpc64le-unknown-linux-gnu
5454
ln -s pdftex pdflatex
55+
56+
# Cleanup TeX source to reduce image size
57+
rm -rf /texlive-20250308-source /texlive-build
58+
5559
export PATH="/usr/local/texlive/bin/powerpc64le-unknown-linux-gnu:$PATH"
5660
pdflatex --version
5761

58-
# Install dependencies
62+
# Install Pandoc from source
5963
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
6064
dnf install -y cabal-install ghc gmp-devel
65+
6166
# Set version
6267
PANDOC_VERSION=3.7.0.2
63-
64-
# Clone repo
6568
cd /tmp
6669
git clone --recurse-submodules https://github.com/jgm/pandoc.git
6770
cd pandoc
6871
git checkout ${PANDOC_VERSION}
6972
git submodule update --init --recursive
70-
71-
# Update Cabal
7273
cabal update
7374

7475
# Build the CLI tool (not the top-level library package)
@@ -77,12 +78,13 @@ if [[ "$ARCH" == "ppc64le" ]]; then
7778
# Clean previous builds
7879
cabal clean
7980

80-
# Configure and build
81-
cabal build -j
82-
83-
# Install the CLI executable
84-
cabal install --installdir=/usr/local/bin --overwrite-policy=always
81+
cabal build -j$(nproc)
82+
cabal install --installdir=/usr/local/bin --overwrite-policy=always --install-method=copy
8583

84+
# Clean up Haskell build system
85+
rm -rf ~/.cabal ~/.ghc /tmp/pandoc
86+
dnf remove -y cabal-install ghc gmp-devel
87+
dnf clean all && rm -rf /var/cache/dnf
8688
# Verify installation
8789
/usr/local/bin/pandoc --version
8890

@@ -106,3 +108,4 @@ cd /usr/local/texlive/bin/linux
106108
rm -f /tmp/pandoc.tar.gz
107109

108110
fi
111+

0 commit comments

Comments
 (0)