cask "libreoffice-still" do arch arm: "aarch64", intel: "x86-64" folder = on_arch_conditional arm: "aarch64", intel: "x86_64" version "24.8.7" sha256 arm: "c528ee4b6c9c0f8d08c8c52aa22f915d2c8779090db0b822cc483f6fe085d5d7", intel: "584788bdbb40cec7c1afea591fa18c6bd54bc7bc5aed5f506b494032e8511111" url "https://download.documentfoundation.org/libreoffice/stable/#{version}/mac/#{folder}/LibreOffice_#{version}_MacOS_#{arch}.dmg", verified: "download.documentfoundation.org/libreoffice/stable/" name "LibreOffice Still" desc "Free cross-platform office suite, stable version recommended for enterprises" homepage "https://www.libreoffice.org/" # This checks the same source of version information as the `libreoffice` # cask, so we need to make sure that the former always checks a page that # provides the latest versions for both Fresh and Still. livecheck do url "https://wiki.documentfoundation.org/Main_Page" regex(/>\s*Download\s+LibreOffice\s+v?(\d+(?:\.\d+)+)\s*= :catalina" app "LibreOffice.app" binary "#{appdir}/LibreOffice.app/Contents/MacOS/gengal" binary "#{appdir}/LibreOffice.app/Contents/MacOS/regview" binary "#{appdir}/LibreOffice.app/Contents/MacOS/senddoc" binary "#{appdir}/LibreOffice.app/Contents/MacOS/uno" binary "#{appdir}/LibreOffice.app/Contents/MacOS/unoinfo" binary "#{appdir}/LibreOffice.app/Contents/MacOS/unopkg" binary "#{appdir}/LibreOffice.app/Contents/MacOS/uri-encode" binary "#{appdir}/LibreOffice.app/Contents/MacOS/xpdfimport" # shim script (https://github.com/Homebrew/homebrew-cask/issues/18809) shimscript = "#{staged_path}/soffice.wrapper.sh" binary shimscript, target: "soffice" preflight do File.write shimscript, <<~EOS #!/bin/sh '#{appdir}/LibreOffice.app/Contents/MacOS/soffice' "$@" EOS end zap trash: [ "~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/org.libreoffice.script.sfl*", "~/Library/Application Support/LibreOffice", "~/Library/Preferences/org.libreoffice.script.plist", "~/Library/Saved Application State/org.libreoffice.script.savedState", ] end