1{ lib
2, stdenv
3, fetchFromGitHub
4, cmake
5, vulkan-headers
6, glfw
7, catch2
8}:
9
10stdenv.mkDerivation rec {
11 pname = "vk-bootstrap";
12 version = "0.7";
13 outputs = [ "out" "dev" ];
14
15 src = fetchFromGitHub {
16 owner = "charles-lunarg";
17 repo = "vk-bootstrap";
18 rev = "v${version}";
19 hash = "sha256-X3ANqfplrCF1R494+H5/plcwMH7rbW6zpLA4MZrYaoE=";
20 };
21
22 postPatch = ''
23 # Upstream uses cmake FetchContent to resolve glfw and catch2
24 # needed for examples and tests
25 sed -iE 's=add_subdirectory(ext)==g' CMakeLists.txt
26 sed -iE 's=Catch2==g' tests/CMakeLists.txt
27 '';
28
29 nativeBuildInputs = [ cmake ];
30 buildInputs = [ vulkan-headers glfw catch2 ];
31
32 cmakeFlags = [
33 "-DVK_BOOTSTRAP_VULKAN_HEADER_DIR=${vulkan-headers}/include"
34 ];
35
36 meta = with lib; {
37 description = "Vulkan Bootstrapping Library";
38 license = licenses.mit;
39 homepage = "https://github.com/charles-lunarg/vk-bootstrap";
40 maintainers = with maintainers; [ shamilton ];
41 platforms = platforms.all;
42 };
43}