libdrm: fix one error, mark another conflict (#24309)

* libdrm: fix one configure error and require libpciaccess

Failure with `LIBS`: the linker can't find `-lrt` so configure fails on
darwin-bigsur %apple-clang@12.0.5
```
  >> 22    configure: error: in `/private/var/folders/gy/mrg1ffts2h945qj9k29s1l1dvvmbqb/T/s3j/spack-s
           tage/spack-stage-libdrm-2.4.100-ofhk6m25n2pi427ihnxmvjkfmgyzlrqc/spack-src':
  >> 23    configure: error: C compiler cannot create executables
     24    See `config.log' for more details

See build log for details:
  /var/folders/gy/mrg1ffts2h945qj9k29s1l1dvvmbqb/T/s3j/spack-stage/spack-stage-libdrm-2.4.100-ofhk6m25n2pi427ihnxmvjkfmgyzlrqc/spack-build-out.txt
```

* libpciaccess: Mark conflict with darwin

```
make[2]: *** [common_init.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
common_interface.c:75:10: fatal error: 'sys/endian.h' file not found
         ^~~~~~~~~~~~~~
```
and
```
common_init.c:73:3: error: "Unsupported OS"
```
and others
This commit is contained in:
Seth R. Johnson 2021-06-15 14:13:28 -04:00 committed by GitHub
parent d7263b5da0
commit 1bf84d170f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View file

@ -4,7 +4,6 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import sys
class Libdrm(AutotoolsPackage):
@ -22,13 +21,16 @@ class Libdrm(AutotoolsPackage):
version('2.4.33', sha256='bd2a8fecf28616f2157ca33ede691c139cc294ed2d0c4244b62ca7d22e98e5a4')
depends_on('pkgconfig', type='build')
depends_on('libpciaccess@0.10:', when=(sys.platform != 'darwin'))
depends_on('libpciaccess@0.10:')
depends_on('libpthread-stubs')
def configure_args(self):
args = []
args.append('--enable-static')
args.append('LIBS=-lrt') # This fixes a bug with `make check`
if self.version <= Version('2.4.70'):
# Needed to fix build for spack/spack#1740, but breaks newer
# builds/compilers
args.append('LIBS=-lrt')
if self.spec.satisfies('%gcc@10.0.0:'):
args.append('CFLAGS=-fcommon')
return args

View file

@ -31,6 +31,8 @@ class Libpciaccess(AutotoolsPackage, XorgPackage):
# libpciaccess built by gcc should be usable by PGI builds.
conflicts('%pgi')
conflicts('platform=darwin')
def configure_args(self):
config_args = []