summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Brady <ptb@lanl.gov>2023-01-02 08:17:04 -0700
committerGitHub <noreply@github.com>2023-01-02 07:17:04 -0800
commit9cbbe64cf79fcf53f6897effeb5dd77757e5b28a (patch)
tree112a548517da1a4b5f3fda94954d748937abfe58
parent2b006bb6ecaad2375394cde047e0c0037dbe344c (diff)
downloadspack-9cbbe64cf79fcf53f6897effeb5dd77757e5b28a.tar.gz
spack-9cbbe64cf79fcf53f6897effeb5dd77757e5b28a.tar.bz2
spack-9cbbe64cf79fcf53f6897effeb5dd77757e5b28a.tar.xz
spack-9cbbe64cf79fcf53f6897effeb5dd77757e5b28a.zip
emacs: json variant & cleanup (#34665)
Co-authored-by: Harmen Stoppels <me@harmenstoppels.nl>
-rw-r--r--var/spack/repos/builtin/packages/emacs/package.py23
1 files changed, 9 insertions, 14 deletions
diff --git a/var/spack/repos/builtin/packages/emacs/package.py b/var/spack/repos/builtin/packages/emacs/package.py
index 7874100485..a04f015fd2 100644
--- a/var/spack/repos/builtin/packages/emacs/package.py
+++ b/var/spack/repos/builtin/packages/emacs/package.py
@@ -36,10 +36,12 @@ class Emacs(AutotoolsPackage, GNUMirrorPackage):
description="Select an X toolkit (gtk, athena)",
)
variant("tls", default=False, description="Build Emacs with gnutls")
- variant("native", default=False, description="enable native compilation of elisp")
- variant("treesitter", default=False, description="Build with tree-sitter support")
+ 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("json", default=False, when="@27:", description="Build with json support")
depends_on("pkgconfig", type="build")
+ depends_on("gzip", type="build")
depends_on("ncurses")
depends_on("pcre")
@@ -61,10 +63,9 @@ class Emacs(AutotoolsPackage, GNUMirrorPackage):
depends_on("libtool", type="build", when="@master:")
depends_on("texinfo", type="build", when="@master:")
depends_on("gcc@11: +strip languages=jit", when="+native")
+ depends_on("jansson@2.7:", when="+json")
conflicts("@:26.3", when="platform=darwin os=catalina")
- conflicts("+native", when="@:27", msg="native compilation require @master")
- conflicts("+treesitter", when="@:28", msg="tree-sitter support requires version 29")
@when("platform=darwin")
def setup_build_environment(self, env):
@@ -87,16 +88,10 @@ class Emacs(AutotoolsPackage, GNUMirrorPackage):
if sys.platform == "darwin":
args.append("--without-ns")
- if "+native" in spec:
- args.append("--with-native-compilation")
-
- if "+tls" in spec:
- args.append("--with-gnutls")
- else:
- args.append("--without-gnutls")
-
- if "+treesitter" in spec:
- args.append("--with-tree-sitter")
+ args += self.with_or_without("native-compilation", variant="native")
+ args += self.with_or_without("gnutls", variant="tls")
+ args += self.with_or_without("tree-sitter", variant="treesitter")
+ args += self.with_or_without("json")
return args