Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emacs-30: provide Emacs Client.app #783

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion Formula/[email protected]
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
Loading