Skip to content

Commit

Permalink
emacs-30: provide Emacs Client.app
Browse files Browse the repository at this point in the history
  • Loading branch information
d12frosted committed Feb 24, 2025
1 parent 9e44ce1 commit 6d62623
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion Formula/emacs-plus@30.rb
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,38 @@ def install
end
end

# Emacs Client.app
client_contents_dir = buildpath/"nextstep/Emacs Client.app/Contents"
system "mkdir", "-p", client_contents_dir
system "mkdir", "-p", client_contents_dir/"MacOS"
system "mkdir", "-p", client_contents_dir/"Resources"
(client_contents_dir/"MacOS"/"Emacs Client").write <<~EOS
#!/bin/sh
#{prefix}/bin/emacsclient -c "$@"
EOS
system "chmod", "+x", client_contents_dir/"MacOS"/"Emacs Client"
system "cp", icons_dir/"Emacs.icns", client_contents_dir/"Resources"/"Emacs Client.icns"
(client_contents_dir/"Info.plist").write <<~EOS
<?xml version="1.0" encoding="UTF-8" standalone="no"?><plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>Emacs Client</string>
<key>CFBundleGetInfoString</key>
<string>Emacs Client 30.1</string>
<key>CFBundleVersion</key>
<string>30.1</string>
<key>CFBundleShortVersionString</key>
<string>30.1</string>
<key>CFBundleIconFile</key>
<string>Emacs Client</string>
</dict>
</plist>
EOS

# (prefix/"share/emacs/#{version}").install "lisp"
prefix.install "nextstep/Emacs.app"
(prefix/"Emacs.app/Contents").install "native-lisp" if build.with? "native-comp"
prefix.install "nextstep/Emacs Client.app"

# inject PATH to Info.plist
inject_path
Expand Down Expand Up @@ -279,11 +308,12 @@ def post_install

def caveats
<<~EOS
Emacs.app was installed to:
Emacs.app and Emacs Client.app were installed to:
#{prefix}
To link the application to default Homebrew App location:
osascript -e 'tell application "Finder" to make alias file to posix file "#{prefix}/Emacs.app" at posix file "/Applications" with properties {name:"Emacs.app"}'
osascript -e 'tell application "Finder" to make alias file to posix file "#{prefix}/Emacs Client.app" at posix file "/Applications" with properties {name:"Emacs Client.app"}'
Your PATH value was injected into Emacs.app/Contents/Info.plist
Expand Down

0 comments on commit 6d62623

Please sign in to comment.