Merge pull request #169343 from thiagokokada/fix-cc

lvm2: fix static compilation;  mesa: disable withValgrind if valgrind-light is marked as broken
This commit is contained in:
Thiago Kenji Okada 2022-04-24 00:01:53 +01:00 committed by GitHub
commit 69def51962
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 8 deletions

View File

@ -9,7 +9,7 @@
, vulkanDrivers ? ["auto"] , vulkanDrivers ? ["auto"]
, eglPlatforms ? [ "x11" ] ++ lib.optionals stdenv.isLinux [ "wayland" ] , eglPlatforms ? [ "x11" ] ++ lib.optionals stdenv.isLinux [ "wayland" ]
, OpenGL, Xplugin , OpenGL, Xplugin
, withValgrind ? !stdenv.isDarwin && lib.meta.availableOn stdenv.hostPlatform valgrind-light, valgrind-light , withValgrind ? lib.meta.availableOn stdenv.hostPlatform valgrind-light && !valgrind-light.meta.broken, valgrind-light
, enableGalliumNine ? stdenv.isLinux , enableGalliumNine ? stdenv.isLinux
, enableOSMesa ? stdenv.isLinux , enableOSMesa ? stdenv.isLinux
, enableOpenCL ? stdenv.isLinux && stdenv.isx86_64 , enableOpenCL ? stdenv.isLinux && stdenv.isx86_64

View File

@ -4,18 +4,19 @@
, fetchpatch , fetchpatch
, fetchurl , fetchurl
, pkg-config , pkg-config
, util-linux
, coreutils , coreutils
, libuuid , libuuid
, libaio , libaio
, substituteAll , substituteAll
, enableCmdlib ? false , enableCmdlib ? false
, enableDmeventd ? false , enableDmeventd ? false
, udevSupport ? !stdenv.hostPlatform.isStatic, udev ? null , udevSupport ? !stdenv.hostPlatform.isStatic, udev
, onlyLib ? stdenv.hostPlatform.isStatic , onlyLib ? stdenv.hostPlatform.isStatic
, enableVDO ? false, vdo ? null # Otherwise we have a infinity recursion during static compilation
, enableMdadm ? false, mdadm ? null , enableUtilLinux ? !stdenv.hostPlatform.isStatic, util-linux
, enableMultipath ? false, multipath-tools ? null , enableVDO ? false, vdo
, enableMdadm ? false, mdadm
, enableMultipath ? false, multipath-tools
, nixosTests , nixosTests
}: }:
@ -95,14 +96,15 @@ stdenv.mkDerivation rec {
sed -i 's|^#define LVM_CONFIGURE_LINE.*$|#define LVM_CONFIGURE_LINE "<removed>"|g' ./include/configure.h sed -i 's|^#define LVM_CONFIGURE_LINE.*$|#define LVM_CONFIGURE_LINE "<removed>"|g' ./include/configure.h
''; '';
patches = [ patches = lib.optionals (lib.versionAtLeast version "2.03.15") [
# fixes paths to and checks for tools # fixes paths to and checks for tools
# TODO: needs backport to LVM 2.02 used by static/musl
(substituteAll (let (substituteAll (let
optionalTool = cond: pkg: if cond then pkg else "/run/current-system/sw"; optionalTool = cond: pkg: if cond then pkg else "/run/current-system/sw";
in { in {
src = ./fix-blkdeactivate.patch; src = ./fix-blkdeactivate.patch;
inherit coreutils; inherit coreutils;
util_linux = util-linux; util_linux = optionalTool enableUtilLinux util-linux;
mdadm = optionalTool enableMdadm mdadm; mdadm = optionalTool enableMdadm mdadm;
multipath_tools = optionalTool enableMultipath multipath-tools; multipath_tools = optionalTool enableMultipath multipath-tools;
vdo = optionalTool enableVDO vdo; vdo = optionalTool enableVDO vdo;