Skip to content

Commit 74b4759

Browse files
committed
emacs-30: provide Emacs Client.app
1 parent 3810821 commit 74b4759

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

Formula/emacs-plus@30.rb

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,38 @@ def install
202202
end
203203
end
204204

205+
# Emacs Client.app
206+
client_contents_dir = buildpath/"nextstep/Emacs Client.app/Contents"
207+
system "mkdir", "-p", client_contents_dir
208+
system "mkdir", "-p", client_contents_dir/"MacOS"
209+
system "mkdir", "-p", client_contents_dir/"Resources"
210+
(client_contents_dir/"MacOS"/"Emacs Client").write <<~EOS
211+
#!/bin/sh
212+
#{prefix}/bin/emacsclient -c "$@"
213+
EOS
214+
system "chmod", "+x", client_contents_dir/"MacOS"/"Emacs Client"
215+
system "cp", icons_dir/"Emacs.icns", client_contents_dir/"Resources"/"Emacs Client.icns"
216+
(client_contents_dir/"Info.plist").write <<~EOS
217+
<?xml version="1.0" encoding="UTF-8" standalone="no"?><plist version="1.0">
218+
<dict>
219+
<key>CFBundleExecutable</key>
220+
<string>Emacs Client</string>
221+
<key>CFBundleGetInfoString</key>
222+
<string>Emacs Client 30.1</string>
223+
<key>CFBundleVersion</key>
224+
<string>30.1</string>
225+
<key>CFBundleShortVersionString</key>
226+
<string>30.1</string>
227+
<key>CFBundleIconFile</key>
228+
<string>Emacs Client</string>
229+
</dict>
230+
</plist>
231+
EOS
232+
205233
# (prefix/"share/emacs/#{version}").install "lisp"
206234
prefix.install "nextstep/Emacs.app"
207235
(prefix/"Emacs.app/Contents").install "native-lisp"
236+
prefix.install "nextstep/Emacs Client.app"
208237

209238
# inject PATH to Info.plist
210239
inject_path
@@ -271,11 +300,12 @@ def post_install
271300

272301
def caveats
273302
<<~EOS
274-
Emacs.app was installed to:
303+
Emacs.app and Emacs Client.app were installed to:
275304
#{prefix}
276305
277306
To link the application to default Homebrew App location:
278307
osascript -e 'tell application "Finder" to make alias file to posix file "#{prefix}/Emacs.app" at posix file "/Applications" with properties {name:"Emacs.app"}'
308+
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"}'
279309
280310
Your PATH value was injected into Emacs.app via a wrapper script.
281311
This solves the issue with macOS Sequoia ignoring LSEnvironment in Info.plist.

0 commit comments

Comments
 (0)