Skip to content

Commit 6d62623

Browse files
committed
emacs-30: provide Emacs Client.app
1 parent 9e44ce1 commit 6d62623

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
@@ -210,9 +210,38 @@ def install
210210
end
211211
end
212212

213+
# Emacs Client.app
214+
client_contents_dir = buildpath/"nextstep/Emacs Client.app/Contents"
215+
system "mkdir", "-p", client_contents_dir
216+
system "mkdir", "-p", client_contents_dir/"MacOS"
217+
system "mkdir", "-p", client_contents_dir/"Resources"
218+
(client_contents_dir/"MacOS"/"Emacs Client").write <<~EOS
219+
#!/bin/sh
220+
#{prefix}/bin/emacsclient -c "$@"
221+
EOS
222+
system "chmod", "+x", client_contents_dir/"MacOS"/"Emacs Client"
223+
system "cp", icons_dir/"Emacs.icns", client_contents_dir/"Resources"/"Emacs Client.icns"
224+
(client_contents_dir/"Info.plist").write <<~EOS
225+
<?xml version="1.0" encoding="UTF-8" standalone="no"?><plist version="1.0">
226+
<dict>
227+
<key>CFBundleExecutable</key>
228+
<string>Emacs Client</string>
229+
<key>CFBundleGetInfoString</key>
230+
<string>Emacs Client 30.1</string>
231+
<key>CFBundleVersion</key>
232+
<string>30.1</string>
233+
<key>CFBundleShortVersionString</key>
234+
<string>30.1</string>
235+
<key>CFBundleIconFile</key>
236+
<string>Emacs Client</string>
237+
</dict>
238+
</plist>
239+
EOS
240+
213241
# (prefix/"share/emacs/#{version}").install "lisp"
214242
prefix.install "nextstep/Emacs.app"
215243
(prefix/"Emacs.app/Contents").install "native-lisp" if build.with? "native-comp"
244+
prefix.install "nextstep/Emacs Client.app"
216245

217246
# inject PATH to Info.plist
218247
inject_path
@@ -279,11 +308,12 @@ def post_install
279308

280309
def caveats
281310
<<~EOS
282-
Emacs.app was installed to:
311+
Emacs.app and Emacs Client.app were installed to:
283312
#{prefix}
284313
285314
To link the application to default Homebrew App location:
286315
osascript -e 'tell application "Finder" to make alias file to posix file "#{prefix}/Emacs.app" at posix file "/Applications" with properties {name:"Emacs.app"}'
316+
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"}'
287317
288318
Your PATH value was injected into Emacs.app/Contents/Info.plist
289319

0 commit comments

Comments
 (0)