summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Berger <richard.berger@outlook.com>2024-09-27 02:48:08 -0600
committerGitHub <noreply@github.com>2024-09-27 10:48:08 +0200
commit7d6231b38a04d7c7028d08f5ba2073f50ab85c3e (patch)
tree114ce2629f1fe33cf725dda40168d85d7e7ce258
parent653556e881f029fa1788d9cac49323c95d16dbf4 (diff)
downloadspack-7d6231b38a04d7c7028d08f5ba2073f50ab85c3e.tar.gz
spack-7d6231b38a04d7c7028d08f5ba2073f50ab85c3e.tar.bz2
spack-7d6231b38a04d7c7028d08f5ba2073f50ab85c3e.tar.xz
spack-7d6231b38a04d7c7028d08f5ba2073f50ab85c3e.zip
aspell: various fixes and updates (#46383)
SimpleFilesystemView was producing an error due to looking for a <prefix>/lib/.spack folder. Also, view_destination had no effect and wasn't called. Changed this by instead patching in the correct installation prefix for dictionaries. Since aspell is using the resolved path of the executable prefix, the runtime environment variable ASPELL_CONF is set to correct the prefix when in a view. With this change aspell can now find installed dictionaries. Verified with: aspell dump config aspell dump dicts
-rw-r--r--lib/spack/spack/build_systems/aspell_dict.py22
-rw-r--r--var/spack/repos/builtin/packages/aspell/package.py9
-rw-r--r--var/spack/repos/builtin/packages/aspell6-de/package.py4
-rw-r--r--var/spack/repos/builtin/packages/aspell6-en/package.py3
4 files changed, 25 insertions, 13 deletions
diff --git a/lib/spack/spack/build_systems/aspell_dict.py b/lib/spack/spack/build_systems/aspell_dict.py
index e9fc4e1497..3dac3480db 100644
--- a/lib/spack/spack/build_systems/aspell_dict.py
+++ b/lib/spack/spack/build_systems/aspell_dict.py
@@ -2,6 +2,8 @@
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+import os
+
import llnl.util.filesystem as fs
import spack.directives
@@ -46,18 +48,12 @@ class AspellDictPackage(AutotoolsPackage):
#: Override the default autotools builder
AutotoolsBuilder = AspellBuilder
- def view_destination(self, view):
+ def patch(self):
aspell_spec = self.spec["aspell"]
- if view.get_projection_for_spec(aspell_spec) != aspell_spec.prefix:
- raise spack.package_base.ExtensionError(
- "aspell does not support non-global extensions"
- )
aspell = aspell_spec.command
- return aspell("dump", "config", "dict-dir", output=str).strip()
-
- def view_source(self):
- return self.prefix.lib
-
- def patch(self):
- fs.filter_file(r"^dictdir=.*$", "dictdir=/lib", "configure")
- fs.filter_file(r"^datadir=.*$", "datadir=/lib", "configure")
+ dictdir = aspell("dump", "config", "dict-dir", output=str).strip()
+ datadir = aspell("dump", "config", "data-dir", output=str).strip()
+ dictdir = os.path.relpath(dictdir, aspell_spec.prefix)
+ datadir = os.path.relpath(datadir, aspell_spec.prefix)
+ fs.filter_file(r"^dictdir=.*$", f"dictdir=/{dictdir}", "configure")
+ fs.filter_file(r"^datadir=.*$", f"datadir=/{datadir}", "configure")
diff --git a/var/spack/repos/builtin/packages/aspell/package.py b/var/spack/repos/builtin/packages/aspell/package.py
index 84a90c9bdf..75f1b2aef5 100644
--- a/var/spack/repos/builtin/packages/aspell/package.py
+++ b/var/spack/repos/builtin/packages/aspell/package.py
@@ -27,3 +27,12 @@ class Aspell(AutotoolsPackage, GNUMirrorPackage):
patch("fix_cpp.patch")
patch("issue-519.patch", when="@:0.60.6.1")
+
+ # workaround due to https://github.com/GNUAspell/aspell/issues/591
+ @run_after("configure", when="@0.60.8:")
+ def make_missing_files(self):
+ make("gen/dirs.h")
+ make("gen/static_filters.src.cpp")
+
+ def setup_run_environment(self, env):
+ env.set("ASPELL_CONF", f"prefix {self.prefix}")
diff --git a/var/spack/repos/builtin/packages/aspell6-de/package.py b/var/spack/repos/builtin/packages/aspell6-de/package.py
index 4bb759b519..3714c69653 100644
--- a/var/spack/repos/builtin/packages/aspell6-de/package.py
+++ b/var/spack/repos/builtin/packages/aspell6-de/package.py
@@ -15,6 +15,10 @@ class Aspell6De(AspellDictPackage, GNUMirrorPackage):
license("GPL-2.0-or-later")
version(
+ "6-de-20161207-7-0",
+ sha256="c2125d1fafb1d4effbe6c88d4e9127db59da9ed92639c7cbaeae1b7337655571",
+ )
+ version(
"6-de-20030222-1",
sha256="ba6c94e11bc2e0e6e43ce0f7822c5bba5ca5ac77129ef90c190b33632416e906",
)
diff --git a/var/spack/repos/builtin/packages/aspell6-en/package.py b/var/spack/repos/builtin/packages/aspell6-en/package.py
index afd3bdbfb6..34b018b776 100644
--- a/var/spack/repos/builtin/packages/aspell6-en/package.py
+++ b/var/spack/repos/builtin/packages/aspell6-en/package.py
@@ -13,5 +13,8 @@ class Aspell6En(AspellDictPackage, GNUMirrorPackage):
gnu_mirror_path = "aspell/dict/en/aspell6-en-2017.01.22-0.tar.bz2"
version(
+ "2020.12.07-0", sha256="4c8f734a28a088b88bb6481fcf972d0b2c3dc8da944f7673283ce487eac49fb3"
+ )
+ version(
"2017.01.22-0", sha256="93c73fae3eab5ea3ca6db3cea8770715a820f1b7d6ea2b932dd66a17f8fd55e1"
)