1

我正在尝试构建https://github.com/SaschaWillems/Vulkan。我写了一个小default.nix文件:

{ stdenv, libxcb, pkgconfig, cmake, vulkan-loader, assimp }:

stdenv.mkDerivation rec {
  name = "VulkanExamples";
  buildDepends = [ cmake libxcb.dev pkgconfig vulkan-loader assimp ];
}

我打电话给

nix-shell -E 'with import <nixpkgs> {}; callPackage ./default.nix {}'

但是当我打电话时,cmake .我得到

-- Could NOT find PkgConfig (missing:  PKG_CONFIG_EXECUTABLE)
-- Could NOT find xcb (missing:  XCB_INCLUDE_DIR XCB_LIBRARY

我需要指定什么以便 cmake 脚本可以找到正确的头文件?

4

1 回答 1

1

我终于让它工作了,看来我必须使用 buildInputs

{ stdenv, libxcb, pkgconfig, cmake, vulkan-loader, assimp }:

with import <nixpkgs> {}; {
  vulkanEnv = stdenv.mkDerivation {
    name = "vulkan";
    buildInputs = [ stdenv cmake libxcb pkgconfig vulkan-loader assimp ];
  };
}
于 2017-04-25T21:17:20.313 回答