Repository: spack/spack

Issue:
veclibfort gets spec'd on linux
### Steps to reproduce

```console
spack spec vasp@6.4.2%gcc@11.3.0+fftlib
==> Concretized vasp@6.4.2%gcc@11.3.0+fftlib
 -   m6s27wf  vasp@6.4.2%gcc@11.3.0~cuda+fftlib+openmp~scalapack+shmem~vaspsol build_system=makefile arch=linux-ubuntu22.04-zen2
 -   shyutzm      ^amdfftw@4.1%gcc@11.3.0+amd-dynamic-dispatcher~amd-fast-planner~amd-mpi-vader-limit~debug+mpi+openmp+shared~static~threads build_system=autotools precision=double,float arch=linux-ubuntu22.04-zen2
[+]  3tgeftl          ^texinfo@7.0.3%gcc@11.3.0 build_system=autotools arch=linux-ubuntu22.04-zen2
[+]  6eklunq              ^gettext@0.22.4%gcc@11.3.0+bzip2+curses+git~libunistring+libxml2+pic+shared+tar+xz build_system=autotools arch=linux-ubuntu22.04-zen2
[+]  typk47v                  ^tar@1.34%gcc@11.3.0 build_system=autotools zip=pigz arch=linux-ubuntu22.04-zen2
[+]  qiavs3e                      ^pigz@2.8%gcc@11.3.0 build_system=makefile arch=linux-ubuntu22.04-zen2
[+]  zn7p52t              ^ncurses@6.4%gcc@11.3.0~symlinks+termlib abi=none build_system=autotools arch=linux-ubuntu22.04-zen2
 -   nakfy6z      ^amdlibflame@4.1%gcc@11.3.0~debug~ilp64+lapack2flame+shared+static build_system=autotools patches=4e9ea3f threads=none arch=linux-ubuntu22.04-zen2
 -   a7azap6          ^aocl-utils@4.1%gcc@11.3.0~doc~examples~ipo~tests build_system=cmake build_type=Release generator=make arch=linux-ubuntu22.04-zen2
 -   ybb3zzn              ^cmake@3.27.9%gcc@11.3.0~doc+ncurses+ownlibs build_system=generic build_type=Release arch=linux-ubuntu22.04-zen2
 -   vzgwhse                  ^curl@8.6.0%gcc@11.3.0~gssapi~ldap~libidn2~librtmp~libssh~libssh2+nghttp2 build_system=autotools libs=shared,static tls=openssl arch=linux-ubuntu22.04-zen2
 -   7undrde                      ^nghttp2@1.57.0%gcc@11.3.0 build_system=autotools arch=linux-ubuntu22.04-zen2
 -   gdipql4          ^python@3.11.7%gcc@11.3.0+bz2+crypt+ctypes+dbm~debug+libxml2+lzma~nis~optimizations+pic+pyexpat+pythoncmd+readline+shared+sqlite3+ssl~tkinter+uuid+zlib build_system=generic patches=13fa8bf,b0615b2,ebdca64,f2fd060 arch=linux-ubuntu22.04-zen2
[+]  nim7seh              ^bzip2@1.0.8%gcc@11.3.0~debug~pic+shared build_system=generic arch=linux-ubuntu22.04-zen2
[+]  ulrgww6                  ^diffutils@3.9%gcc@11.3.0 build_system=autotools arch=linux-ubuntu22.04-zen2
 -   fuahgh2              ^expat@2.5.0%gcc@11.3.0+libbsd build_system=autotools arch=linux-ubuntu22.04-zen2
 -   tthsonr                  ^libbsd@0.11.7%gcc@11.3.0 build_system=autotools arch=linux-ubuntu22.04-zen2
 -   6v3t635                      ^libmd@1.0.4%gcc@11.3.0 build_system=autotools arch=linux-ubuntu22.04-zen2
[+]  4e3ajxh              ^gdbm@1.23%gcc@11.3.0 build_system=autotools arch=linux-ubuntu22.04-zen2
 -   r5ri5eq              ^libffi@3.4.4%gcc@11.3.0 build_system=autotools patches=070b1f3 arch=linux-ubuntu22.04-zen2
[+]  2uuvawe              ^libxcrypt@4.4.35%gcc@11.3.0~obsolete_api build_system=autotools patches=4885da3 arch=linux-ubuntu22.04-zen2
[+]  6nxulvu              ^readline@8.2%gcc@11.3.0 build_system=autotools patches=bbf97f1 arch=linux-ubuntu22.04-zen2
 -   j3addih              ^sqlite@3.43.2%gcc@11.3.0+column_metadata+dynamic_extensions+fts~functions+rtree build_system=autotools arch=linux-ubuntu22.04-zen2
 -   ujugl6y              ^util-linux-uuid@2.38.1%gcc@11.3.0 build_system=autotools arch=linux-ubuntu22.04-zen2
[+]  o4vspzo              ^xz@5.4.6%gcc@11.3.0~pic build_system=autotools libs=shared,static arch=linux-ubuntu22.04-zen2
[+]  liasjjz      ^gcc-runtime@11.3.0%gcc@11.3.0 build_system=generic arch=linux-ubuntu22.04-zen2
[+]  7bdiqof      ^gmake@4.4.1%gcc@11.3.0~guile build_system=generic arch=linux-ubuntu22.04-zen2
[+]  qmpl6o3      ^openmpi@5.0.2%gcc@11.3.0~atomics~cuda~gpfs~internal-hwloc~internal-libevent~internal-pmix~java~legacylaunchers~lustre~memchecker~openshmem~orterunprefix~romio+rsh~static+vt+wrapper-rpath build_system=autotools fabrics=none schedulers=none arch=linux-ubuntu22.04-zen2
[+]  34g4oea          ^autoconf@2.72%gcc@11.3.0 build_system=autotools arch=linux-ubuntu22.04-zen2
[+]  kkvhga6              ^m4@1.4.19%gcc@11.3.0+sigsegv build_system=autotools patches=9dc5fbd,bfdffa7 arch=linux-ubuntu22.04-zen2
[+]  kuor5r4                  ^libsigsegv@2.14%gcc@11.3.0 build_system=autotools arch=linux-ubuntu22.04-zen2
[+]  lpepuf6          ^automake@1.16.5%gcc@11.3.0 build_system=autotools arch=linux-ubuntu22.04-zen2
[+]  n27ecc7          ^hwloc@2.9.1%gcc@11.3.0~cairo~cuda~gl~libudev+libxml2~netloc~nvml~oneapi-level-zero~opencl+pci~rocm build_system=autotools libs=shared,static arch=linux-ubuntu22.04-zen2
[+]  ciikppr              ^libpciaccess@0.17%gcc@11.3.0 build_system=autotools arch=linux-ubuntu22.04-zen2
[+]  2zs247a                  ^util-macros@1.19.3%gcc@11.3.0 build_system=autotools arch=linux-ubuntu22.04-zen2
[+]  7qgkmka              ^libxml2@2.10.3%gcc@11.3.0+pic~python+shared build_system=autotools arch=linux-ubuntu22.04-zen2
[+]  fruar3h          ^libevent@2.1.12%gcc@11.3.0+openssl build_system=autotools arch=linux-ubuntu22.04-zen2
[+]  j4zayxu          ^libtool@2.4.7%gcc@11.3.0 build_system=autotools arch=linux-ubuntu22.04-zen2
[+]  mj7iq4u              ^findutils@4.9.0%gcc@11.3.0 build_system=autotools patches=440b954 arch=linux-ubuntu22.04-zen2
[+]  okhldhh          ^numactl@2.0.14%gcc@11.3.0 build_system=autotools patches=4e1d78c,62fc8a8,ff37630 arch=linux-ubuntu22.04-zen2
[+]  6ffaxvm          ^openssh@9.5p1%gcc@11.3.0+gssapi build_system=autotools arch=linux-ubuntu22.04-zen2
[+]  2pnlomp              ^krb5@1.20.1%gcc@11.3.0+shared build_system=autotools arch=linux-ubuntu22.04-zen2
[+]  q2tnp56                  ^bison@3.8.2%gcc@11.3.0 build_system=autotools arch=linux-ubuntu22.04-zen2
[+]  zpbcycm              ^libedit@3.1-20210216%gcc@11.3.0 build_system=autotools arch=linux-ubuntu22.04-zen2
[+]  jxfj2i2          ^perl@5.38.0%gcc@11.3.0+cpanm+opcode+open+shared+threads build_system=generic patches=714e4d1 arch=linux-ubuntu22.04-zen2
[+]  z3mragq              ^berkeley-db@18.1.40%gcc@11.3.0+cxx~docs+stl build_system=autotools patches=26090f4,b231fcc arch=linux-ubuntu22.04-zen2
[+]  g2y24xy          ^pkgconf@1.9.5%gcc@11.3.0 build_system=autotools arch=linux-ubuntu22.04-zen2
[+]  gzhwlf3          ^pmix@5.0.1%gcc@11.3.0~docs+pmi_backwards_compatibility~python~restful build_system=autotools arch=linux-ubuntu22.04-zen2
[+]  npdjsvi          ^zlib-ng@2.1.5%gcc@11.3.0+compat+opt build_system=autotools arch=linux-ubuntu22.04-zen2
[+]  oddbepw      ^rsync@3.2.7%gcc@11.3.0 build_system=autotools arch=linux-ubuntu22.04-zen2
[+]  k6xwszx          ^lz4@1.9.4%gcc@11.3.0+pic build_system=makefile libs=shared,static arch=linux-ubuntu22.04-zen2
[+]  3x3k45f          ^openssl@3.2.1%gcc@11.3.0~docs+shared build_system=generic certs=mozilla arch=linux-ubuntu22.04-zen2
[+]  wyvt7ly              ^ca-certificates-mozilla@2023-05-30%gcc@11.3.0 build_system=generic arch=linux-ubuntu22.04-zen2
[+]  g4lkejd          ^popt@1.16%gcc@11.3.0 build_system=autotools arch=linux-ubuntu22.04-zen2
[+]  v3xs553              ^libiconv@1.17%gcc@11.3.0 build_system=autotools libs=shared,static arch=linux-ubuntu22.04-zen2
[+]  s2ctnoi          ^xxhash@0.8.1%gcc@11.3.0 build_system=makefile arch=linux-ubuntu22.04-zen2
[+]  om6yhpk          ^zstd@1.5.5%gcc@11.3.0+programs build_system=makefile compression=none libs=shared,static arch=linux-ubuntu22.04-zen2
 -   rvamc3c      ^veclibfort@0.4.3%gcc@11.3.0+shared build_system=generic arch=linux-ubuntu22.04-zen2
```

### Error message

```
==> Error: InstallError: vecLibFort can be installed on macOS only

/ssd/hjaeger/spack/var/spack/repos/builtin/packages/veclibfort/package.py:46, in install:
         44    def install(self, spec, prefix):
         45        if sys.platform != "darwin":
  >>     46            raise InstallError("vecLibFort can be installed on macOS only")
         47
         48        filter_file(r"^PREFIX=.*", "", "Makefile")
         49
```

### Information on your system

* **Spack:** 0.22.0.dev0 (59f56327fe75dce39665a28afc065e85a948b474)
* **Python:** 3.10.12
* **Platform:** linux-ubuntu22.04-zen2
* **Concretizer:** clingo

### General information

- [X] I have run `spack debug report` and reported the version of Spack/Python/Platform
- [X] I have searched the issues of this repo and believe this is not a duplicate
- [X] I have run the failing commands in debug mode and reported the output


Discussion:

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/veclibfort/package.py b/var/spack/repos/builtin/packages/veclibfort/package.py
--- a/var/spack/repos/builtin/packages/veclibfort/package.py
+++ b/var/spack/repos/builtin/packages/veclibfort/package.py
@@ -30,6 +30,8 @@ class Veclibfort(Package):
     # https://github.com/scipy/scipy/wiki/Dropping-support-for-Accelerate
     provides("lapack@3.2.1")
 
+    requires("platform=darwin", msg="vecLibFort can be installed on macOS only")
+
     @property
     def libs(self):
         shared = True if "+shared" in self.spec else False


Test patch: