home/emacs_build.sh
2023-10-12 22:51:18 +02:00

18 lines
604 B
Bash
Executable File

PATH="/usr/bin:/bin"
set -e
mkdir -p "${out}/Applications"
appOut="${out}/Applications/${appName}.app"
osacompile -o "${appOut}" <<EOF
do shell script "env -i XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR} ${emacs}/bin/emacsclient -n --create-frame -e '(x-focus-frame (selected-frame))' --alternate-editor=''"
EOF
cp "${icon}" "${appOut}/Contents/Resources/EmacsClient.icns"
chmod 644 "${appOut}/Contents/Resources/EmacsClient.icns"
plutil -replace CFBundleIconFile -json '"EmacsClient"' "${appOut}/Contents/Info.plist"
plutil -replace CFBundleDisplayName -json '"EmacsClient"' "${appOut}/Contents/Info.plist"