From 7d6231b38a04d7c7028d08f5ba2073f50ab85c3e Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Fri, 27 Sep 2024 02:48:08 -0600 Subject: aspell: various fixes and updates (#46383) SimpleFilesystemView was producing an error due to looking for a /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 --- lib/spack/spack/build_systems/aspell_dict.py | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'lib') 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") -- cgit v1.2.3-70-g09d2