# frozen_string_literal: true cask 'emacs-app-good' do name 'Emacs' desc 'GNU Emacs text editor (known good nightly build)' homepage 'https://github.com/jimeh/emacs-builds' version '2023-12-01.eec1142.master' on_arm do sha256 '3a7477dd38ee34562b36bbfe41a533d30cc4b85a7f22c8c9a45c4ff1b71b39d6' url 'https://github.com/jimeh/emacs-builds/releases/download/Emacs.2023-12-01.eec1142.master/Emacs.2023-12-01.eec1142.master.macOS-13.arm64.dmg' depends_on macos: '>= :ventura' end on_intel do sha256 '09bbb4e29f6b81a553b2b2dcad74a2be2db4049c36de5409c5436066c37deecd' url 'https://github.com/jimeh/emacs-builds/releases/download/Emacs.2023-12-01.eec1142.master/Emacs.2023-12-01.eec1142.master.macOS-12.x86_64.dmg' depends_on macos: '>= :monterey' end livecheck do url 'https://github.com/jimeh/emacs-builds/issues/7' strategy :page_match do |page| page.scan(%r{href=.*?https://github\.com/jimeh/emacs-builds/releases/tag/Emacs\.(\d{4}-\d{2}-\d{2}\.\w+\.master)}i) .map { |match| match&.first } end end conflicts_with( cask: %w[ emacs-app emacs-app-monthly emacs-app-nightly emacs-app-nightly-28 emacs-app-nightly-29 emacs-app-pretest emacs emacs-nightly emacs-pretest emacs-mac emacs-mac-spacemacs-icon ], formula: %w[ emacs emacs-mac ] ) app 'Emacs.app' binary "#{appdir}/Emacs.app/Contents/MacOS/bin/ebrowse" binary "#{appdir}/Emacs.app/Contents/MacOS/bin/emacs" binary "#{appdir}/Emacs.app/Contents/MacOS/bin/emacsclient" binary "#{appdir}/Emacs.app/Contents/MacOS/bin/etags" binary "#{appdir}/Emacs.app/Contents/Resources/include/emacs-module.h", target: "#{HOMEBREW_PREFIX}/include/emacs-module.h" binary "#{appdir}/Emacs.app/Contents/Resources/site-lisp/subdirs.el", target: "#{HOMEBREW_PREFIX}/share/emacs/site-lisp/subdirs.el" manpage "#{appdir}/Emacs.app/Contents/Resources/man/man1/ebrowse.1.gz" manpage "#{appdir}/Emacs.app/Contents/Resources/man/man1/emacs.1.gz" manpage "#{appdir}/Emacs.app/Contents/Resources/man/man1/emacsclient.1.gz" manpage "#{appdir}/Emacs.app/Contents/Resources/man/man1/etags.1.gz" zap trash: [ '~/Library/Caches/org.gnu.Emacs', '~/Library/Preferences/org.gnu.Emacs.plist', '~/Library/Saved Application State/org.gnu.Emacs.savedState' ] end