2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, python3, spirv-headers }:
|
2016-08-31 10:19:14 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "spirv-tools";
|
2022-10-25 18:26:58 +00:00
|
|
|
version = "1.3.231.0";
|
2016-08-31 10:19:14 +00:00
|
|
|
|
2022-08-08 14:31:53 +00:00
|
|
|
src = (assert version == spirv-headers.version;
|
|
|
|
fetchFromGitHub {
|
|
|
|
owner = "KhronosGroup";
|
|
|
|
repo = "SPIRV-Tools";
|
|
|
|
rev = "sdk-${version}";
|
2022-10-25 18:26:58 +00:00
|
|
|
hash = "sha256-sqjQoz9v9alSPc0ujEcWZxDAWh2S6oAPP1+JZmNCpA0=";
|
2022-08-08 14:31:53 +00:00
|
|
|
}
|
|
|
|
);
|
2016-08-31 10:19:14 +00:00
|
|
|
|
2019-11-02 18:41:47 +00:00
|
|
|
nativeBuildInputs = [ cmake python3 ];
|
2016-08-31 10:19:14 +00:00
|
|
|
|
2022-11-01 22:59:31 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DSPIRV-Headers_SOURCE_DIR=${spirv-headers.src}"
|
|
|
|
# Avoid blanket -Werror to evade build failures on less
|
|
|
|
# tested compilers.
|
|
|
|
"-DSPIRV_WERROR=OFF"
|
|
|
|
];
|
2016-09-18 05:19:40 +00:00
|
|
|
|
2022-05-09 04:48:49 +00:00
|
|
|
# https://github.com/KhronosGroup/SPIRV-Tools/issues/3905
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace CMakeLists.txt \
|
|
|
|
--replace '-P ''${CMAKE_CURRENT_SOURCE_DIR}/cmake/write_pkg_config.cmake' \
|
|
|
|
'-DCMAKE_INSTALL_FULL_LIBDIR=''${CMAKE_INSTALL_FULL_LIBDIR}
|
|
|
|
-DCMAKE_INSTALL_FULL_INCLUDEDIR=''${CMAKE_INSTALL_FULL_INCLUDEDIR}
|
|
|
|
-P ''${CMAKE_CURRENT_SOURCE_DIR}/cmake/write_pkg_config.cmake'
|
|
|
|
substituteInPlace cmake/SPIRV-Tools.pc.in \
|
|
|
|
--replace '$'{prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \
|
|
|
|
--replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@
|
|
|
|
substituteInPlace cmake/SPIRV-Tools-shared.pc.in \
|
|
|
|
--replace '$'{prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \
|
|
|
|
--replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2017-01-04 09:56:26 +00:00
|
|
|
description = "The SPIR-V Tools project provides an API and commands for processing SPIR-V modules";
|
2022-11-28 04:37:56 +00:00
|
|
|
homepage = "https://github.com/KhronosGroup/SPIRV-Tools";
|
2017-01-04 09:56:26 +00:00
|
|
|
license = licenses.asl20;
|
2022-02-09 22:49:03 +00:00
|
|
|
platforms = platforms.unix;
|
2017-04-01 19:28:59 +00:00
|
|
|
maintainers = [ maintainers.ralith ];
|
2016-08-31 10:19:14 +00:00
|
|
|
};
|
|
|
|
}
|