2016-08-31 12:19:14 +02:00
|
|
|
{ stdenv, fetchFromGitHub, cmake, python }:
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
spirv_sources = {
|
2016-09-18 07:19:40 +02:00
|
|
|
# `vulkan-loader` requires a specific version of `spirv-tools` and `spirv-headers` as specified in
|
|
|
|
# `<vulkan-loader-repo>/spirv-tools_revision`.
|
2016-08-31 12:19:14 +02:00
|
|
|
tools = fetchFromGitHub {
|
|
|
|
owner = "KhronosGroup";
|
|
|
|
repo = "SPIRV-Tools";
|
2016-09-18 07:19:40 +02:00
|
|
|
rev = "923a4596b44831a07060df45caacb522613730c9";
|
|
|
|
sha256 = "0hmgng2sv34amfsag3ya09prnv1w535djwlzfn8h2vh430vgawxa";
|
2016-08-31 12:19:14 +02:00
|
|
|
};
|
|
|
|
headers = fetchFromGitHub {
|
|
|
|
owner = "KhronosGroup";
|
|
|
|
repo = "SPIRV-Headers";
|
2016-09-18 07:19:40 +02:00
|
|
|
rev = "33d41376d378761ed3a4c791fc4b647761897f26";
|
|
|
|
sha256 = "1s103bpi3g6hhq453qa4jbabfkyxxpf9vn213j8k4vm26lsi8hs2";
|
2016-08-31 12:19:14 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "spirv-tools-${version}";
|
|
|
|
version = "2016-07-18";
|
|
|
|
|
|
|
|
src = spirv_sources.tools;
|
|
|
|
patchPhase = ''ln -sv ${spirv_sources.headers} external/spirv-headers'';
|
2016-09-18 07:19:40 +02:00
|
|
|
enableParallelBuilding = true;
|
2016-08-31 12:19:14 +02:00
|
|
|
|
|
|
|
buildInputs = [ cmake python ];
|
|
|
|
|
2016-09-18 07:19:40 +02:00
|
|
|
passthru = {
|
|
|
|
headers = spirv_sources.headers;
|
|
|
|
};
|
|
|
|
|
2016-08-31 12:19:14 +02:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
inherit (src.meta) homepage;
|
2017-01-04 10:56:26 +01:00
|
|
|
description = "The SPIR-V Tools project provides an API and commands for processing SPIR-V modules";
|
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = platforms.linux;
|
2016-08-31 12:19:14 +02:00
|
|
|
};
|
|
|
|
}
|