From 1bf84d170fe92c7295fe2129bcce19d1ec081f5e Mon Sep 17 00:00:00 2001 From: "Seth R. Johnson" Date: Tue, 15 Jun 2021 14:13:28 -0400 Subject: 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 --- var/spack/repos/builtin/packages/libdrm/package.py | 8 +++++--- var/spack/repos/builtin/packages/libpciaccess/package.py | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/var/spack/repos/builtin/packages/libdrm/package.py b/var/spack/repos/builtin/packages/libdrm/package.py index c798a457ca..aafb9b2338 100644 --- a/var/spack/repos/builtin/packages/libdrm/package.py +++ b/var/spack/repos/builtin/packages/libdrm/package.py @@ -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 diff --git a/var/spack/repos/builtin/packages/libpciaccess/package.py b/var/spack/repos/builtin/packages/libpciaccess/package.py index 319da38371..b132ec079e 100644 --- a/var/spack/repos/builtin/packages/libpciaccess/package.py +++ b/var/spack/repos/builtin/packages/libpciaccess/package.py @@ -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 = [] -- cgit v1.2.3-70-g09d2