Repository: spack/spack

Issue:
Installation issue: Neovim @(stable, git)
### Steps to reproduce the issue

```console
$ spack spec -I neovim@stable%gcc@12.2.0

--------------------------------
 -   neovim@stable%gcc@12.2.0

Concretized
--------------------------------
 -   neovim@stable%gcc@12.2.0~ipo~no_luajit build_type=RelWithDebInfo arch=linux-rhel7-x86_64_v3
[+]      ^cmake@3.24.2%gcc@12.2.0~doc+ncurses+ownlibs~qt build_type=Release arch=linux-rhel7-x86_64_v3
[+]          ^ncurses@6.3%gcc@12.2.0~symlinks+termlib abi=none arch=linux-rhel7-x86_64_v3
[+]              ^pkgconf@1.8.0%gcc@12.2.0 arch=linux-rhel7-x86_64_v3
[+]          ^openssl@1.1.1q%gcc@12.2.0~docs~shared certs=mozilla patches=3fdcf2d arch=linux-rhel7-x86_64_v3
[+]              ^ca-certificates-mozilla@2022-07-19%gcc@12.2.0 arch=linux-rhel7-x86_64_v3
[+]              ^perl@5.34.1%gcc@12.2.0+cpanm+shared+threads arch=linux-rhel7-x86_64_v3
[+]                  ^berkeley-db@18.1.40%gcc@12.2.0+cxx~docs+stl patches=26090f4,b231fcc arch=linux-rhel7-x86_64_v3
[+]                  ^bzip2@1.0.8%gcc@12.2.0~debug~pic+shared arch=linux-rhel7-x86_64_v3
[+]                      ^diffutils@3.8%gcc@12.2.0 arch=linux-rhel7-x86_64_v3
[+]                          ^libiconv@1.16%gcc@12.2.0 libs=shared,static arch=linux-rhel7-x86_64_v3
[+]                  ^gdbm@1.19%gcc@12.2.0 arch=linux-rhel7-x86_64_v3
[+]                      ^readline@8.1.2%gcc@12.2.0 arch=linux-rhel7-x86_64_v3
[+]                  ^zlib@1.2.12%gcc@12.2.0+optimize+pic+shared patches=0d38234 arch=linux-rhel7-x86_64_v3
[+]      ^gettext@0.21%gcc@12.2.0+bzip2+curses+git~libunistring+libxml2+tar+xz arch=linux-rhel7-x86_64_v3
[+]          ^libxml2@2.10.1%gcc@12.2.0~python arch=linux-rhel7-x86_64_v3
[+]              ^xz@5.2.5%gcc@12.2.0~pic libs=shared,static arch=linux-rhel7-x86_64_v3
[+]          ^tar@1.34%gcc@12.2.0 zip=pigz arch=linux-rhel7-x86_64_v3
[+]              ^pigz@2.7%gcc@12.2.0 arch=linux-rhel7-x86_64_v3
[+]              ^zstd@1.5.2%gcc@12.2.0+programs compression=none libs=shared,static arch=linux-rhel7-x86_64_v3
[+]      ^gperf@3.1%gcc@12.2.0 arch=linux-rhel7-x86_64_v3
[+]      ^jemalloc@5.2.1%gcc@12.2.0~debug~documentation+fill~prof~stats jemalloc_prefix=none libs=shared,static arch=linux-rhel7-x86_64_v3
[+]      ^libluv@1.43.0-0%gcc@12.2.0~ipo build_type=RelWithDebInfo arch=linux-rhel7-x86_64_v3
[+]          ^libuv@1.44.1%gcc@12.2.0 arch=linux-rhel7-x86_64_v3
[+]          ^lua-luajit-openresty@2.1-20220111%gcc@12.2.0+lualinks fetcher=curl arch=linux-rhel7-x86_64_v3
[+]              ^curl@7.85.0%gcc@12.2.0~gssapi~ldap~libidn2~librtmp~libssh~libssh2~nghttp2 libs=shared,static tls=openssl arch=linux-rhel7-x86_64_v3
[+]              ^unzip@6.0%gcc@12.2.0 arch=linux-rhel7-x86_64_v3
[+]      ^libtermkey@0.22%gcc@12.2.0 arch=linux-rhel7-x86_64_v3
[+]          ^libtool@2.4.7%gcc@12.2.0 arch=linux-rhel7-x86_64_v3
[+]              ^m4@1.4.19%gcc@12.2.0+sigsegv patches=9dc5fbd,bfdffa7 arch=linux-rhel7-x86_64_v3
[+]                  ^libsigsegv@2.13%gcc@12.2.0 arch=linux-rhel7-x86_64_v3
[+]          ^unibilium@2.0.0%gcc@12.2.0 arch=linux-rhel7-x86_64_v3
[+]      ^libvterm@0.1.4%gcc@12.2.0 arch=linux-rhel7-x86_64_v3
[+]      ^lua-lpeg@1.0.2-1%gcc@12.2.0 arch=linux-rhel7-x86_64_v3
[+]      ^lua-mpack@1.0.9%gcc@12.2.0 arch=linux-rhel7-x86_64_v3
[+]          ^msgpack-c@3.1.1%gcc@12.2.0~ipo build_type=RelWithDebInfo arch=linux-rhel7-x86_64_v3
[+]      ^tree-sitter@0.20.6%gcc@12.2.0 arch=linux-rhel7-x86_64_v3

...
spack install neovim@stable%gcc@12.2.0
```


### Error message

<details><summary>Error message</summary><pre>
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found LibUV: /spack-bin/gcc-12.2.0/libuv-1.44.1-6h3763f/lib/libuv.so (Required is at least version "1.28.0")
-- Found Msgpack: /spack-bin/gcc-12.2.0/msgpack-c-3.1.1-vcz4x2l/lib/libmsgpackc.so (found suitable version "3.1.1", minimum required is "1.0.0")
-- Found LibLUV: /spack-bin/gcc-12.2.0/libluv-1.43.0-0-ye3qmbw/lib/libluv_a.a (Required is at least version "1.43.0")
-- Found TreeSitter 0.6.3
-- Performing Test TS_HAS_SET_MATCH_LIMIT
-- Performing Test TS_HAS_SET_MATCH_LIMIT - Success
-- Performing Test TS_HAS_SET_ALLOCATOR
-- Performing Test TS_HAS_SET_ALLOCATOR - Success
-- Found LuaJit: /spack-bin/gcc-12.2.0/lua-luajit-openresty-2.1-20220111-tylemxj/lib/libluajit-5.1.so
-- Performing Test MSGPACK_HAS_FLOAT32
-- Performing Test MSGPACK_HAS_FLOAT32 - Success
-- Found UNIBILIUM 2.0.0
-- Performing Test UNIBI_HAS_VAR_FROM
-- Performing Test UNIBI_HAS_VAR_FROM - Success
-- Found LibTermkey: /spack-bin/gcc-12.2.0/libtermkey-0.22-ekg2czr/lib/libtermkey.so (Required is at least version "0.22")
CMake Error at cmake/LibFindMacros.cmake:263 (message):
  REQUIRED PACKAGE NOT FOUND

  LIBVTERM 0.1.4 was found but version 0.3 is the minimum requirement.  This
  package is REQUIRED and you need to install it or adjust CMake
  configuration in order to continue building nvim.

  Relevant CMake configuration variables:

    LIBVTERM_INCLUDE_DIR=/spack-bin/gcc-12.2.0/libvterm-0.1.4-j2d2jpv/include
    LIBVTERM_LIBRARY=/spack-bin/gcc-12.2.0/libvterm-0.1.4-j2d2jpv/lib/libvterm.so

  You may use CMake GUI, cmake -D or ccmake to modify the values.  Delete
  CMakeCache.txt to discard all values and force full re-detection if
  necessary.

Call Stack (most recent call first):
  cmake/FindLIBVTERM.cmake:10 (libfind_process)
  CMakeLists.txt:505 (find_package)

</pre></details>


### Information on your system

* **Spack:** 0.19.0.dev0 (8e3c088a7ad587b2f028a1fabea67a331ef96847)
* **Python:** 3.6.8
* **Platform:** linux-rhel7-x86_64_v3
* **Concretizer:** clingo

### Additional information

[spack-build-env.txt](https://github.com/spack/spack/files/9759239/spack-build-env.txt)
[spack-build-env-mods.txt](https://github.com/spack/spack/files/9759241/spack-build-env-mods.txt)
[spack-build-out.txt](https://github.com/spack/spack/files/9759242/spack-build-out.txt)
[spack-build-01-cmake-out.txt](https://github.com/spack/spack/files/9759243/spack-build-01-cmake-out.txt)

@albestro  
@trws

### General information

- [X] I have run `spack debug report` and reported the version of Spack/Python/Platform
- [X] I have run `spack maintainers <name-of-the-package>` and **@mentioned** any maintainers
- [X] I have uploaded the build log and environment files
- [X] I have searched the issues of this repo and believe this is not a duplicate


Discussion:
I've just quickly looked into this, and it should be just a metter of updating the dependencies.

For what concerns `LIBVTERM` I've found that it has been updated for `neovim@0.8.0` in https://github.com/neovim/neovim/commit/6917a2e569e9f7306a9858f1aeeb32dd1c3ece4e, but I will try to understand if also something else is required.

I'm going to open a PR in the next hours 😉 

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/libvterm/package.py b/var/spack/repos/builtin/packages/libvterm/package.py
--- a/var/spack/repos/builtin/packages/libvterm/package.py
+++ b/var/spack/repos/builtin/packages/libvterm/package.py
@@ -13,6 +13,8 @@ class Libvterm(Package):
     homepage = "http://www.leonerd.org.uk/code/libvterm/"
     url = "http://www.leonerd.org.uk/code/libvterm/libvterm-0.1.3.tar.gz"
 
+    version("0.3", sha256="61eb0d6628c52bdf02900dfd4468aa86a1a7125228bab8a67328981887483358")
+    version("0.2", sha256="4c5150655438cfb8c57e7bd133041140857eb04defd0e544521c0e469258e105")
     version("0.1.4", sha256="bc70349e95559c667672fc8c55b9527d9db9ada0fb80a3beda533418d782d3dd")
     version("0.1.3", sha256="e41724466a4658e0f095e8fc5aeae26026c0726dce98ee71d6920d06f7d78e2b")
     version(
diff --git a/var/spack/repos/builtin/packages/neovim/package.py b/var/spack/repos/builtin/packages/neovim/package.py
--- a/var/spack/repos/builtin/packages/neovim/package.py
+++ b/var/spack/repos/builtin/packages/neovim/package.py
@@ -17,6 +17,7 @@ class Neovim(CMakePackage):
 
     version("master", branch="master")
     version("stable", tag="stable")
+    version("0.8.0", sha256="505e3dfb71e2f73495c737c034a416911c260c0ba9fd2092c6be296655be4d18")
     version("0.7.2", sha256="ccab8ca02a0c292de9ea14b39f84f90b635a69282de38a6b4ccc8565bc65d096")
     version("0.7.0", sha256="792a9c55d5d5f4a5148d475847267df309d65fb20f05523f21c1319ea8a6c7df")
     version(
@@ -117,7 +118,7 @@ class Neovim(CMakePackage):
         depends_on("libvterm@0.1:")
         depends_on("unibilium@2.0:")
         depends_on("msgpack-c@1.0.0:")
-    with when("@0.5:,stable,master"):
+    with when("@0.5:"):
         depends_on("libuv@1.42:")
         depends_on("tree-sitter")
     with when("@0.6:"):
@@ -127,11 +128,13 @@ class Neovim(CMakePackage):
         depends_on("libtermkey@0.22:")
         depends_on("libvterm@0.1.4:")
         depends_on("msgpack-c@3.0.0:")
-    with when("@0.6:,master"):
+    with when("@0.7:"):
         depends_on("gettext@0.20.1:")
         depends_on("libluv@1.43.0:")
         depends_on("libuv@1.44.1:")
         depends_on("tree-sitter@0.20.6:")
+    with when("@0.8:"):
+        depends_on("libvterm@0.3:")
 
     @when("^lua")
     def cmake_args(self):


Test patch: