From 6c8ea9efb93584f89745afb601992c54be7c7f53 Mon Sep 17 00:00:00 2001 From: Matt Robinson Date: Fri, 28 Jun 2024 11:22:37 -0400 Subject: [PATCH] fix: revert to libreoffice7 for amd64 --- scripts/docker-dl-wolfi-packages.sh | 1 + scripts/initialize-libreoffice.sh | 2 ++ scripts/install-wolfi-libreoffice.sh | 23 +++++++++++++++++------ 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/scripts/docker-dl-wolfi-packages.sh b/scripts/docker-dl-wolfi-packages.sh index 154c582..09feb1a 100755 --- a/scripts/docker-dl-wolfi-packages.sh +++ b/scripts/docker-dl-wolfi-packages.sh @@ -10,6 +10,7 @@ else files=( "poppler-23.09.0-r0.apk" "pandoc-3.1.8-r0.apk" + "libreoffice-7.6.5-r0.apk" "nltk_data.tgz" ) fi diff --git a/scripts/initialize-libreoffice.sh b/scripts/initialize-libreoffice.sh index 6bb0a2e..b621d27 100755 --- a/scripts/initialize-libreoffice.sh +++ b/scripts/initialize-libreoffice.sh @@ -1,3 +1,5 @@ #!/bin/bash +ARCH=$(uname -m) + /usr/bin/soffice --headless || [ $? -eq 81 ] || exit 1 diff --git a/scripts/install-wolfi-libreoffice.sh b/scripts/install-wolfi-libreoffice.sh index 437eb82..0e81e32 100755 --- a/scripts/install-wolfi-libreoffice.sh +++ b/scripts/install-wolfi-libreoffice.sh @@ -1,8 +1,19 @@ #!/bin/bash -apk add libreoffice -ln -s /usr/lib/libreoffice/program/soffice.bin /usr/bin/libreoffice -ln -s /usr/lib/libreoffice/program/soffice.bin /usr/bin/soffice -chmod +x /usr/lib/libreoffice/program/soffice.bin -chmod +x /usr/bin/libreoffice -chmod +x /usr/bin/soffice +RCH=$(uname -m) + +if [[ "$ARCH" == "x86_64" ]] || [[ "$ARCH" == "amd64" ]]; then + apk add --allow-untrusted packages/libreoffice-7.6.5-r0.apk + ln -s /usr/local/lib/libreoffice/program/soffice.bin /usr/bin/libreoffice + ln -s /usr/local/lib/libreoffice/program/soffice.bin /usr/bin/soffice + chmod +x /usr/local/lib/libreoffice/program/soffice.bin + chmod +x /usr/bin/libreoffice + chmod +x /usr/bin/soffice +else + apk add libreoffice + ln -s /usr/lib/libreoffice/program/soffice.bin /usr/bin/libreoffice + ln -s /usr/lib/libreoffice/program/soffice.bin /usr/bin/soffice + chmod +x /usr/lib/libreoffice/program/soffice.bin + chmod +x /usr/bin/libreoffice + chmod +x /usr/bin/soffice +fi