Better Emacs build on Mac OS (#37294)
* [emacs] When installing on Mac OS, build and install the native Emacs.app along with the standard executables. * [emacs] Make the GUI build on Mac optional by adding "gui" variant * Apply reviewer suggestion Co-authored-by: Alec Scott <hi@alecbcs.com> * Add emacs version 29.3 --------- Co-authored-by: Alec Scott <hi@alecbcs.com>
This commit is contained in:
parent
b61bae7640
commit
35ad6f52c1
@ -43,6 +43,7 @@ class Emacs(AutotoolsPackage, GNUMirrorPackage):
|
|||||||
values=("gtk", "athena"),
|
values=("gtk", "athena"),
|
||||||
description="Select an X toolkit (gtk, athena)",
|
description="Select an X toolkit (gtk, athena)",
|
||||||
)
|
)
|
||||||
|
variant("gui", default=False, description="Enable GUI build on Mac")
|
||||||
variant("tls", default=True, description="Build Emacs with gnutls")
|
variant("tls", default=True, description="Build Emacs with gnutls")
|
||||||
variant("native", default=False, when="@28:", description="enable native compilation of elisp")
|
variant("native", default=False, when="@28:", description="enable native compilation of elisp")
|
||||||
variant("treesitter", default=False, when="@29:", description="Build with tree-sitter support")
|
variant("treesitter", default=False, when="@29:", description="Build with tree-sitter support")
|
||||||
@ -91,9 +92,12 @@ def configure_args(self):
|
|||||||
else:
|
else:
|
||||||
args = ["--without-x"]
|
args = ["--without-x"]
|
||||||
|
|
||||||
# On OS X/macOS, do not build "nextstep/Emacs.app", because
|
|
||||||
# doing so throws an error at build-time
|
|
||||||
if sys.platform == "darwin":
|
if sys.platform == "darwin":
|
||||||
|
if spec.satisfies("+gui"):
|
||||||
|
# Do not build the self-contained "nextstep/Emacs.app"
|
||||||
|
args.append("--disable-ns-self-contained")
|
||||||
|
else:
|
||||||
|
# Do not build "nextstep/Emacs.app" at all
|
||||||
args.append("--without-ns")
|
args.append("--without-ns")
|
||||||
|
|
||||||
args += self.with_or_without("native-compilation", variant="native")
|
args += self.with_or_without("native-compilation", variant="native")
|
||||||
@ -103,6 +107,15 @@ def configure_args(self):
|
|||||||
|
|
||||||
return args
|
return args
|
||||||
|
|
||||||
|
@run_after("install")
|
||||||
|
def move_macos_app(self):
|
||||||
|
"""Move the Emacs.app build on MacOS to <prefix>/Applications.
|
||||||
|
From there users can move it or link it in ~/Applications."""
|
||||||
|
if sys.platform == "darwin" and "+gui" in self.spec:
|
||||||
|
apps_dir = join_path(self.prefix, "Applications")
|
||||||
|
mkdir(apps_dir)
|
||||||
|
move("nextstep/Emacs.app", apps_dir)
|
||||||
|
|
||||||
def run_version_check(self, bin):
|
def run_version_check(self, bin):
|
||||||
"""Runs and checks output of the installed binary."""
|
"""Runs and checks output of the installed binary."""
|
||||||
exe_path = join_path(self.prefix.bin, bin)
|
exe_path = join_path(self.prefix.bin, bin)
|
||||||
|
Loading…
Reference in New Issue
Block a user