nixpkgs/pkgs/tools/graphics/vulkan-caps-viewer/default.nix
Artturin e0464e4788 treewide: replace stdenv.is with stdenv.hostPlatform.is
In preparation for the deprecation of `stdenv.isX`.

These shorthands are not conducive to cross-compilation because they
hide the platforms.

Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way

One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059

There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.

```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```
2024-09-25 00:04:37 +03:00

64 lines
1.7 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, qmake
, vulkan-loader
, wayland
, wrapQtAppsHook
, x11Support ? true
, qtx11extras
}:
stdenv.mkDerivation rec {
pname = "vulkan-caps-viewer";
version = "3.42";
src = fetchFromGitHub {
owner = "SaschaWillems";
repo = "VulkanCapsViewer";
rev = version;
hash = "sha256-gGP+A8CfmXaAf5WEKYCU6ud93pzjeh9tU37SP0/TIzw=";
# Note: this derivation strictly requires vulkan-header to be the same it was developed against.
# To help us, they've put it in a git-submodule.
# The result will work with any vulkan-loader version.
fetchSubmodules = true;
};
nativeBuildInputs = [
qmake
wrapQtAppsHook
];
buildInputs = [
vulkan-loader
wayland
] ++ lib.lists.optionals x11Support [ qtx11extras ];
patchPhase = ''
substituteInPlace vulkanCapsViewer.pro \
--replace '/usr/' "/"
'';
qmakeFlags = [
"CONFIG+=release"
];
installFlags = [ "INSTALL_ROOT=$(out)" ];
meta = with lib; {
mainProgram = "vulkanCapsViewer";
description = "Vulkan hardware capability viewer";
longDescription = ''
Client application to display hardware implementation details for GPUs supporting the Vulkan API by Khronos.
The hardware reports can be submitted to a public online database that allows comparing different devices, browsing available features, extensions, formats, etc.
'';
homepage = "https://vulkan.gpuinfo.org/";
platforms = platforms.unix;
license = licenses.gpl2Only;
maintainers = with maintainers; [ pedrohlc ];
changelog = "https://github.com/SaschaWillems/VulkanCapsViewer/releases/tag/${version}";
# never built on aarch64-darwin, x86_64-darwin since first introduction in nixpkgs
broken = stdenv.hostPlatform.isDarwin;
};
}