renderdoc: use lib.cmakeBool and lib.cmakeFeature (#342954)

This commit is contained in:
Nick Cao 2024-09-19 12:51:40 -04:00 committed by GitHub
commit 8b00e029fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -28,7 +28,6 @@ let
rev = "renderdoc-modified-7";
sha256 = "15r2m5kcs0id64pa2fsw58qll3jyh71jzc04wy20pgsh2326zis6";
};
cmakeBool = b: if b then "ON" else "OFF";
in
mkDerivation rec {
pname = "renderdoc";
@ -57,12 +56,12 @@ mkDerivation rec {
'';
cmakeFlags = [
"-DBUILD_VERSION_HASH=${src.rev}"
"-DBUILD_VERSION_DIST_NAME=NixOS"
"-DBUILD_VERSION_DIST_VER=${version}"
"-DBUILD_VERSION_DIST_CONTACT=https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/graphics/renderdoc"
"-DBUILD_VERSION_STABLE=ON"
"-DENABLE_WAYLAND=${cmakeBool waylandSupport}"
(lib.cmakeFeature "BUILD_VERSION_HASH" src.rev)
(lib.cmakeFeature "BUILD_VERSION_DIST_NAME" "NixOS")
(lib.cmakeFeature "BUILD_VERSION_DIST_VER" version)
(lib.cmakeFeature "BUILD_VERSION_DIST_CONTACT" "https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/graphics/renderdoc")
(lib.cmakeBool "BUILD_VERSION_STABLE" true)
(lib.cmakeBool "ENABLE_WAYLAND" waylandSupport)
];
# TODO: define these in the above array via placeholders, once those are widely supported