mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-10 06:55:10 +00:00
571c71e6f7
We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
62 lines
2.0 KiB
Nix
62 lines
2.0 KiB
Nix
{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, pkg-config, libX11, libxcb
|
|
, libXrandr, wayland, moltenvk, vulkan-headers, addDriverRunpath
|
|
, testers }:
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "vulkan-loader";
|
|
version = "1.3.296.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "KhronosGroup";
|
|
repo = "Vulkan-Loader";
|
|
rev = "vulkan-sdk-${finalAttrs.version}";
|
|
hash = "sha256-6GHZUiYL3gDWN61SaLiD/3xXSoQb1rx6U5eu1cl8ZwM=";
|
|
};
|
|
|
|
patches = [ ./fix-pkgconfig.patch ]
|
|
++ lib.optionals stdenv.hostPlatform.is32bit [
|
|
# Backport patch to support 64-bit inodes on 32-bit systems
|
|
# FIXME: remove in next update
|
|
(fetchpatch {
|
|
url = "https://github.com/KhronosGroup/Vulkan-Loader/commit/ecd88b5c6b1e4c072c55c8652d76513d74c5ad4e.patch";
|
|
hash = "sha256-Ea+v+RfmVl8fRbkr2ETM3/7R4vp+jw7hvTq2hnw4V/0=";
|
|
})
|
|
];
|
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
|
buildInputs = [ vulkan-headers ]
|
|
++ lib.optionals stdenv.hostPlatform.isLinux [ libX11 libxcb libXrandr wayland ];
|
|
|
|
cmakeFlags = [ "-DCMAKE_INSTALL_INCLUDEDIR=${vulkan-headers}/include" ]
|
|
++ lib.optional stdenv.hostPlatform.isDarwin "-DSYSCONFDIR=${moltenvk}/share"
|
|
++ lib.optional stdenv.hostPlatform.isLinux "-DSYSCONFDIR=${addDriverRunpath.driverLink}/share"
|
|
++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) "-DUSE_GAS=OFF";
|
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
|
grep -q "${vulkan-headers}/include" $dev/lib/pkgconfig/vulkan.pc || {
|
|
echo vulkan-headers include directory not found in pkg-config file
|
|
exit 1
|
|
}
|
|
'';
|
|
|
|
passthru = {
|
|
tests.pkg-config = testers.hasPkgConfigModules {
|
|
package = finalAttrs.finalPackage;
|
|
};
|
|
};
|
|
|
|
meta = with lib; {
|
|
description = "LunarG Vulkan loader";
|
|
homepage = "https://www.lunarg.com";
|
|
platforms = platforms.unix ++ platforms.windows;
|
|
license = licenses.asl20;
|
|
maintainers = [ maintainers.ralith ];
|
|
broken = finalAttrs.version != vulkan-headers.version;
|
|
pkgConfigModules = [ "vulkan" ];
|
|
};
|
|
})
|