File tree Expand file tree Collapse file tree 3 files changed +38
-4
lines changed Expand file tree Collapse file tree 3 files changed +38
-4
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,18 @@ UNAME_TO_GOARCH["ppc64le"]="ppc64le"
99UNAME_TO_GOARCH[" s390x" ]=" s390x"
1010
1111ARCH=" ${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
22+
23+ ARCH=$( uname -m)
1224
1325if [[ " $ARCH " == " ppc64le" ]]; then
1426 # Install Pandoc from source
@@ -25,7 +37,13 @@ if [[ "$ARCH" == "ppc64le" ]]; then
2537 git submodule update --init --recursive
2638
2739 cabal update
40+
41+ # Build the CLI tool (not the top-level library package)
2842 cd pandoc-cli
43+
44+ # Clean previous builds
45+ cabal clean
46+
2947 cabal build -j" $( nproc) "
3048 mkdir -p /usr/local/pandoc/bin
3149 cabal install \
@@ -38,6 +56,7 @@ if [[ "$ARCH" == "ppc64le" ]]; then
3856 dnf remove -y cabal-install ghc gmp-devel
3957 dnf clean all && rm -rf /var/cache/dnf
4058
59+ # Verify installation
4160 /usr/local/pandoc/bin/pandoc --version
4261
4362elif [[ " $ARCH " == " amd64" ]]; then
Original file line number Diff line number Diff line change @@ -65,11 +65,13 @@ if [[ "$ARCH" == "ppc64le" ]]; then
6565
6666 # Set version
6767 PANDOC_VERSION=3.7.0.2
68+
6869 cd /tmp
6970 git clone --recurse-submodules https://github.com/jgm/pandoc.git
7071 cd pandoc
7172 git checkout ${PANDOC_VERSION}
7273 git submodule update --init --recursive
74+
7375 cabal update
7476
7577 # Build the CLI tool (not the top-level library package)
@@ -85,6 +87,7 @@ if [[ "$ARCH" == "ppc64le" ]]; then
8587 rm -rf ~ /.cabal ~ /.ghc /tmp/pandoc
8688 dnf remove -y cabal-install ghc gmp-devel
8789 dnf clean all && rm -rf /var/cache/dnf
90+
8891 # Verify installation
8992 /usr/local/bin/pandoc --version
9093
@@ -98,7 +101,7 @@ if [[ "$ARCH" == "x86_64" ]]; then
98101 cd install-tl-2*
99102 perl ./install-tl --no-interaction --scheme=scheme-small --texdir=/usr/local/texlive
100103 mv /usr/local/texlive/bin/" $( uname -m) -linux" /usr/local/texlive/bin/linux
101- cd /usr/local/texlive/bin/linux
104+ cd /usr/local/texlive/bin/linux
102105 ./tlmgr install tcolorbox pdfcol adjustbox titling enumitem soul ucs collection-fontsrecommended
103106
104107 # pandoc installation
@@ -108,4 +111,3 @@ cd /usr/local/texlive/bin/linux
108111 rm -f /tmp/pandoc.tar.gz
109112
110113fi
111-
Original file line number Diff line number Diff line change @@ -9,6 +9,18 @@ UNAME_TO_GOARCH["ppc64le"]="ppc64le"
99UNAME_TO_GOARCH[" s390x" ]=" s390x"
1010
1111ARCH=" ${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
22+
23+ ARCH=$( uname -m)
1224
1325if [[ " $ARCH " == " ppc64le" ]]; then
1426 echo " Installing TeX Live from source for $ARCH ..."
@@ -29,13 +41,15 @@ if [[ "$ARCH" == "ppc64le" ]]; then
2941 # Create build directory and build
3042 mkdir ../texlive-build
3143 cd ../texlive-build
44+
45+ # Configure, build, install
3246 ../texlive-20250308-source/configure --prefix=/usr/local/texlive
3347 make -j" $( nproc) "
3448 make install
3549
3650 # Symlink for pdflatex
3751 ln -sf pdftex /usr/local/texlive/bin/powerpc64le-unknown-linux-gnu/pdflatex
38-
52+
3953 # Cleanup sources to reduce image size
4054 rm -rf /texlive-20250308-source /texlive-build
4155
86100 exit 1
87101
88102fi
89-
You can’t perform that action at this time.
0 commit comments