46 lines
1.9 KiB
Ruby
46 lines
1.9 KiB
Ruby
cask 'libreoffice' do
|
|
version '6.1.2'
|
|
sha256 'e22460b1500b8b44c3bb477792f4537b9480cc969ed56202cff767423282148d'
|
|
|
|
# documentfoundation.org was verified as official when first introduced to the cask
|
|
url "https://download.documentfoundation.org/libreoffice/stable/#{version}/mac/x86_64/LibreOffice_#{version}_MacOS_x86-64.dmg"
|
|
appcast 'https://download.documentfoundation.org/libreoffice/stable/'
|
|
name 'LibreOffice'
|
|
homepage 'https://www.libreoffice.org/'
|
|
|
|
conflicts_with cask: [
|
|
'libreoffice-rc',
|
|
'libreoffice-still',
|
|
]
|
|
depends_on macos: '>= :mavericks'
|
|
|
|
app 'LibreOffice.app'
|
|
binary "#{appdir}/LibreOffice.app/Contents/MacOS/gengal"
|
|
binary "#{appdir}/LibreOffice.app/Contents/MacOS/regmerge"
|
|
binary "#{appdir}/LibreOffice.app/Contents/MacOS/regview"
|
|
binary "#{appdir}/LibreOffice.app/Contents/MacOS/senddoc"
|
|
binary "#{appdir}/LibreOffice.app/Contents/MacOS/ui-previewer"
|
|
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
|
|
IO.write shimscript, <<~EOS
|
|
#!/bin/sh
|
|
'#{appdir}/LibreOffice.app/Contents/MacOS/soffice' "$@"
|
|
EOS
|
|
end
|
|
|
|
zap trash: [
|
|
'~/Library/Application Support/LibreOffice',
|
|
'~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/org.libreoffice.script.sfl*',
|
|
'~/Library/Preferences/org.libreoffice.script.plist',
|
|
'~/Library/Saved Application State/org.libreoffice.script.savedState',
|
|
]
|
|
end
|