Skip to content

Commit 9df7d38

Browse files
puneetsharma21Shafi-Hussain
authored andcommitted
install from EPEL and symlink into /usr/local/pandoc/bin
1 parent d0d95a1 commit 9df7d38

File tree

1 file changed

+4
-42
lines changed

1 file changed

+4
-42
lines changed

jupyter/utils/install_pandoc.sh

Lines changed: 4 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -13,49 +13,11 @@ ARCH="${UNAME_TO_GOARCH[$(uname -m)]}"
1313
if [[ "$ARCH" == "ppc64le" ]]; then
1414
# Install Pandoc from source
1515
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
16-
dnf install -y cabal-install ghc gmp-devel gcc-toolset-13 git jq
17-
18-
source /opt/rh/gcc-toolset-13/enable
19-
20-
# ghc-8.10 has specific path for gcc in settings
21-
sed -i.bak 's|/usr/bin/gcc|gcc|g' /usr/lib64/ghc-8.10.7/settings
22-
23-
cabal user-config init
24-
25-
sed -i -e 's/http/https/g' -e 's/-- secure: True/secure: True/g' $HOME/.cabal/config
26-
27-
cabal update
28-
cabal install cabal-install --verbose
29-
30-
# use latest cabal
31-
export PATH=/root/.cabal/bin:$PATH
32-
33-
PANDOC_VERSION=$(curl -s "https://api.github.com/repos/jgm/pandoc/releases/latest" | jq -r '.tag_name')
34-
35-
cd /tmp
36-
git clone --recurse-submodules https://github.com/jgm/pandoc.git
37-
cd pandoc
38-
git checkout ${PANDOC_VERSION}
39-
git submodule update --init --recursive
40-
41-
# Modify config
42-
sed -i -e 's/http/https/g' -e 's/-- secure: True/secure: True/g' $HOME/.cabal/config
43-
44-
cabal update -v
45-
cd pandoc-cli
46-
cabal build -j"$(nproc)" --verbose
16+
dnf install -y pandoc
4717
mkdir -p /usr/local/pandoc/bin
48-
cabal install \
49-
--installdir=/usr/local/pandoc/bin \
50-
--overwrite-policy=always \
51-
--install-method=copy
52-
53-
# Clean up Haskell build system
54-
rm -rf ~/.cabal ~/.ghc /tmp/pandoc
55-
dnf remove -y cabal-install ghc gmp-devel
56-
dnf clean all && rm -rf /var/cache/dnf
57-
58-
/usr/local/pandoc/bin/pandoc --version
18+
ln -s /usr/bin/pandoc /usr/local/pandoc/bin/pandoc
19+
export PATH="/usr/local/pandoc/bin:$PATH"
20+
pandoc --version
5921

6022
elif [[ "$ARCH" == "amd64" ]]; then
6123
# pandoc installation

0 commit comments

Comments
 (0)