diff --git a/lib/spack/spack/build_systems/lua.py b/lib/spack/spack/build_systems/lua.py index d862604e90..9b19e1ef26 100644 --- a/lib/spack/spack/build_systems/lua.py +++ b/lib/spack/spack/build_systems/lua.py @@ -29,15 +29,12 @@ class LuaPackage(spack.package_base.PackageBase): with when("build_system=lua"): depends_on("lua-lang") - extends("lua", when="^lua") - with when("^lua-luajit"): - extends("lua-luajit") - depends_on("luajit") - depends_on("lua-luajit+lualinks") - with when("^lua-luajit-openresty"): - extends("lua-luajit-openresty") - depends_on("luajit") - depends_on("lua-luajit-openresty+lualinks") + with when("^[virtuals=lua-lang] lua"): + extends("lua") + with when("^[virtuals=lua-lang] lua-luajit"): + extends("lua-luajit+lualinks") + with when("^[virtuals=lua-lang] lua-luajit-openresty"): + extends("lua-luajit-openresty+lualinks") @property def lua(self):