1{
2 lib,
3 stdenvNoCC,
4 fetchFromGitHub,
5 cmake,
6 nix-update-script,
7}:
8
9stdenvNoCC.mkDerivation (finalAttrs: {
10 pname = "vulkan-memory-allocator";
11 version = "3.3.0";
12
13 src = fetchFromGitHub {
14 owner = "GPUOpen-LibrariesAndSDKs";
15 repo = "VulkanMemoryAllocator";
16 tag = "v${finalAttrs.version}";
17 hash = "sha256-TPEqV8uHbnyphLG0A+b2tgLDQ6K7a2dOuDHlaFPzTeE=";
18 };
19
20 # A compiler is only required for the samples. This lets us use stdenvNoCC.
21 postPatch = ''
22 substituteInPlace CMakeLists.txt \
23 --replace-warn 'LANGUAGES CXX' 'LANGUAGES NONE'
24 '';
25
26 nativeBuildInputs = [
27 cmake
28 ];
29
30 strictDeps = true;
31
32 passthru.updateScript = nix-update-script { };
33
34 meta = {
35 description = "Easy to integrate Vulkan memory allocation library";
36 homepage = "https://gpuopen.com/vulkan-memory-allocator/";
37 changelog = "https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/blob/v${finalAttrs.version}/CHANGELOG.md";
38 license = lib.licenses.mit;
39 maintainers = with lib.maintainers; [ fgaz ];
40 mainProgram = "vulkan-memory-allocator";
41 platforms = lib.platforms.unix ++ lib.platforms.windows;
42 };
43})