Repository: spack/spack

Issue:
Installation issue: startup-notification fails due to missing libxcb
### Steps to reproduce the issue

```console
$ spack spec -I <spec>
Input spec
--------------------------------
 -   startup-notification

Concretized
--------------------------------
 -   startup-notification@0.12%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-zen2
[+]      ^gcc-runtime@9.4.0%gcc@9.4.0 build_system=generic arch=linux-ubuntu20.04-zen2
[e]      ^glibc@2.31%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-zen2
[+]      ^gmake@4.4.1%gcc@9.4.0~guile build_system=generic arch=linux-ubuntu20.04-zen2
[+]      ^libx11@1.8.7%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-zen2
[+]          ^inputproto@2.3.2%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-zen2
[+]          ^kbproto@1.0.7%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-zen2
[+]          ^perl@5.38.2%gcc@9.4.0+cpanm+opcode+open+shared+threads build_system=generic patches=714e4d1 arch=linux-ubuntu20.04-zen2
[+]              ^berkeley-db@18.1.40%gcc@9.4.0+cxx~docs+stl build_system=autotools patches=26090f4,b231fcc arch=linux-ubuntu20.04-zen2
[+]              ^bzip2@1.0.8%gcc@9.4.0~debug~pic+shared build_system=generic arch=linux-ubuntu20.04-zen2
[+]                  ^diffutils@3.10%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-zen2
[+]              ^gdbm@1.23%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-zen2
[+]              ^zlib-ng@2.1.6%gcc@9.4.0+compat+new_strategies+opt+pic+shared build_system=autotools arch=linux-ubuntu20.04-zen2
[+]          ^pkgconf@2.2.0%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-zen2
[+]          ^util-macros@1.20.1%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-zen2
[+]          ^xextproto@7.3.0%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-zen2
[+]          ^xproto@7.0.31%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-zen2
[+]          ^xtrans@1.5.0%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-zen2
[+]      ^libxcb@1.17.0%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-zen2
[+]          ^libpthread-stubs@0.5%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-zen2
[+]          ^libxau@1.0.11%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-zen2
[+]          ^libxdmcp@1.1.4%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-zen2
[+]              ^libbsd@0.12.2%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-zen2
[+]                  ^libmd@1.0.4%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-zen2
[+]          ^python@3.11.9%gcc@9.4.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-ubuntu20.04-zen2
[+]              ^expat@2.6.2%gcc@9.4.0+libbsd build_system=autotools arch=linux-ubuntu20.04-zen2
[+]              ^gettext@0.22.5%gcc@9.4.0+bzip2+curses+git~libunistring+libxml2+pic+shared+tar+xz build_system=autotools arch=linux-ubuntu20.04-zen2
[+]                  ^libiconv@1.17%gcc@9.4.0 build_system=autotools libs=shared,static arch=linux-ubuntu20.04-zen2
[+]                  ^libxml2@2.10.3%gcc@9.4.0+pic~python+shared build_system=autotools arch=linux-ubuntu20.04-zen2
[+]                  ^tar@1.34%gcc@9.4.0 build_system=autotools zip=pigz arch=linux-ubuntu20.04-zen2
[+]                      ^pigz@2.8%gcc@9.4.0 build_system=makefile arch=linux-ubuntu20.04-zen2
[+]                      ^zstd@1.5.6%gcc@9.4.0+programs build_system=makefile compression=none libs=shared,static arch=linux-ubuntu20.04-zen2
[+]              ^libffi@3.3%gcc@9.4.0 build_system=autotools patches=26f26c6 arch=linux-ubuntu20.04-zen2
[+]              ^libxcrypt@4.4.35%gcc@9.4.0~obsolete_api build_system=autotools patches=4885da3 arch=linux-ubuntu20.04-zen2
[+]              ^ncurses@6.5%gcc@9.4.0~symlinks+termlib abi=none build_system=autotools patches=7a351bc arch=linux-ubuntu20.04-zen2
[+]              ^openssl@3.3.0%gcc@9.4.0~docs+shared build_system=generic certs=mozilla arch=linux-ubuntu20.04-zen2
[+]                  ^ca-certificates-mozilla@2023-05-30%gcc@9.4.0 build_system=generic arch=linux-ubuntu20.04-zen2
[+]              ^readline@8.2%gcc@9.4.0 build_system=autotools patches=bbf97f1 arch=linux-ubuntu20.04-zen2
[+]              ^sqlite@3.43.2%gcc@9.4.0+column_metadata+dynamic_extensions+fts~functions+rtree build_system=autotools arch=linux-ubuntu20.04-zen2
[+]              ^util-linux-uuid@2.40.1%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-zen2
[+]              ^xz@5.4.6%gcc@9.4.0~pic build_system=autotools libs=shared,static arch=linux-ubuntu20.04-zen2
[+]          ^xcb-proto@1.17.0%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-zen2
[+]              ^python-venv@1.0%gcc@9.4.0 build_system=generic arch=linux-ubuntu20.04-zen2
[+]      ^xcb-util@0.4.1%gcc@9.4.0 build_system=autotools arch=linux-ubuntu20.04-zen2
```


### Error message

<details><summary>Error message</summary>

<pre>
checking for backtrace... yes
checking for pkg-config... no
checking for xcb... no
configure: error: Cannot find xcb
==> Error: ProcessError: Command exited with status 1:
    '/tmp/root/spack-stage/spack-stage-startup-notification-0.12-jmsk6c5nrkglnb35mnkkwpmzgkwpx7wa/spack-src/configure' '--prefix=/opt/spack/opt/spack/linux-ubuntu20.04-zen2/gcc-9.4.0/startup-notification-0.12-jmsk6c5nrkglnb35mnkkwpmzgkwpx7wa'

1 error found in build log:
     93    checking execinfo.h usability... yes
     94    checking execinfo.h presence... yes
     95    checking for execinfo.h... yes
     96    checking for backtrace... yes
     97    checking for pkg-config... no
     98    checking for xcb... no
  >> 99    configure: error: Cannot find xcb

See build log for details:
  /tmp/root/spack-stage/spack-stage-startup-notification-0.12-jmsk6c5nrkglnb35mnkkwpmzgkwpx7wa/spack-build-out.txt
</pre></details>


### Information on your system

```
* **Spack:** 0.23.0.dev0 (74210c7f469cf7d6ea72625b04817619c4cf657e)
* **Python:** 3.8.10
* **Platform:** linux-ubuntu20.04-zen3
* **Concretizer:** clingo
```

### Additional information

Done using an updated version of the Focal Spack docker image. Fix appears to be adding `depends_on("pkgconfig", type="build")`

[spack-build-env.txt](https://github.com/user-attachments/files/15829142/spack-build-env.txt)
[spack-build-out.txt](https://github.com/user-attachments/files/15829143/spack-build-out.txt)


### 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:

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/startup-notification/package.py b/var/spack/repos/builtin/packages/startup-notification/package.py
--- a/var/spack/repos/builtin/packages/startup-notification/package.py
+++ b/var/spack/repos/builtin/packages/startup-notification/package.py
@@ -20,3 +20,4 @@ class StartupNotification(AutotoolsPackage):
     depends_on("libx11")
     depends_on("libxcb")
     depends_on("xcb-util")
+    depends_on("pkgconfig", type="build")


Test patch: