From e6cfc620633e2fc8344d842aa00bc8c089ea41fb Mon Sep 17 00:00:00 2001 From: Joe Hermaszewski Date: Sat, 2 Apr 2016 20:34:50 +0100 Subject: [PATCH] glslang: init at 20160727 --- .../development/compilers/glslang/default.nix | 22 ++++++++++++++++ .../compilers/glslang/install-headers.patch | 26 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 3 files changed, 50 insertions(+) create mode 100644 pkgs/development/compilers/glslang/default.nix create mode 100644 pkgs/development/compilers/glslang/install-headers.patch diff --git a/pkgs/development/compilers/glslang/default.nix b/pkgs/development/compilers/glslang/default.nix new file mode 100644 index 000000000000..3d0785f702cc --- /dev/null +++ b/pkgs/development/compilers/glslang/default.nix @@ -0,0 +1,22 @@ +{ stdenv, fetchFromGitHub, cmake, bison }: + +stdenv.mkDerivation rec { + name = "glslang-${version}"; + version = "2016-07-27"; + + src = fetchFromGitHub { + owner = "KhronosGroup"; + repo = "glslang"; + rev = "8c8505c60454549181d78301933f3f108e2f55e6"; + sha256 = "1219sq86pz6k8nzg9sqm34b0rdv6kkjirg54y6b2r5ak568r4kwx"; + }; + + patches = [ ./install-headers.patch ]; + + buildInputs = [ cmake bison ]; + + meta = with stdenv.lib; { + inherit (src.meta) homepage; + description = "Khronos reference front-end for GLSL and ESSL"; + }; +} diff --git a/pkgs/development/compilers/glslang/install-headers.patch b/pkgs/development/compilers/glslang/install-headers.patch new file mode 100644 index 000000000000..73b31ae3a67c --- /dev/null +++ b/pkgs/development/compilers/glslang/install-headers.patch @@ -0,0 +1,26 @@ +diff --git a/SPIRV/CMakeLists.txt b/SPIRV/CMakeLists.txt +index 50cda68..d4ba381 100755 +--- a/SPIRV/CMakeLists.txt ++++ b/SPIRV/CMakeLists.txt +@@ -26,3 +26,8 @@ endif(WIN32) + + install(TARGETS SPIRV + ARCHIVE DESTINATION lib) ++ ++foreach(file ${HEADERS}) ++ get_filename_component(dir ${file} DIRECTORY) ++ install(FILES ${file} DESTINATION include/SPIRV/${dir}) ++endforeach() +diff --git a/glslang/CMakeLists.txt b/glslang/CMakeLists.txt +index 28f4742..5a25cbb 100644 +--- a/glslang/CMakeLists.txt ++++ b/glslang/CMakeLists.txt +@@ -87,3 +87,8 @@ endif(WIN32) + + install(TARGETS glslang + ARCHIVE DESTINATION lib) ++ ++foreach(file ${HEADERS}) ++ get_filename_component(dir ${file} DIRECTORY) ++ install(FILES ${file} DESTINATION include/glslang/${dir}) ++endforeach() diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index de8216c27f4d..313c07772114 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4844,6 +4844,8 @@ in dotnetPackages = recurseIntoAttrs (callPackage ./dotnet-packages.nix {}); + glslang = callPackage ../development/compilers/glslang { }; + go_bootstrap = callPackage ../development/compilers/go/1.4.nix { inherit (darwin.apple_sdk.frameworks) Security; };