From 77a29f09f99ba4f0e6f628404bf03876602e27ce Mon Sep 17 00:00:00 2001
From: Geoffrey Oxberry <goxberry@gmail.com>
Date: Wed, 10 Jan 2018 07:44:35 -0800
Subject: [PATCH] emacs: on darwin, do not build Cocoa app (#6882)

Building emacs on darwin throws an error when trying to build an Emacs
app in the nextstep/Emacs.app path of the build tree. For now, disable
building this app.

It's possible to enable building the app also; Homebrew offers options
to this effect, and also adds Mac-specific options for starting the
emacs daemon. However, for the sake of simplicity and getting a
workable up-to-date emacs installation on my machine as quickly as
possible, this commit focuses on a minimal viable modification.
---
 var/spack/repos/builtin/packages/emacs/package.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/var/spack/repos/builtin/packages/emacs/package.py b/var/spack/repos/builtin/packages/emacs/package.py
index 21b6b1b17b..e654e9c9c7 100644
--- a/var/spack/repos/builtin/packages/emacs/package.py
+++ b/var/spack/repos/builtin/packages/emacs/package.py
@@ -24,6 +24,8 @@
 ##############################################################################
 from spack import *
 
+import sys
+
 
 class Emacs(AutotoolsPackage):
     """The Emacs programmable text editor."""
@@ -72,4 +74,9 @@ def configure_args(self):
         else:
             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':
+            args.append('--without-ns')
+
         return args
-- 
GitLab