nixpkgs/pkgs/development/compilers/spirv-llvm-translator/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

54 lines
1.2 KiB
Nix
Raw Normal View History

{ lib, stdenv
2019-07-27 11:48:07 +00:00
, fetchFromGitHub
, cmake
2021-05-08 23:08:50 +00:00
, pkg-config
2019-07-27 11:48:07 +00:00
, lit
, llvm_11
, spirv-headers
, spirv-tools
2019-07-27 11:48:07 +00:00
}:
stdenv.mkDerivation rec {
pname = "SPIRV-LLVM-Translator";
version = "unstable-2022-05-04";
2019-07-27 11:48:07 +00:00
src = fetchFromGitHub {
owner = "KhronosGroup";
repo = "SPIRV-LLVM-Translator";
rev = "99420daab98998a7e36858befac9c5ed109d4920";
sha256 = "sha256-/vUyL6Wh8hykoGz1QmT1F7lfGDEmG4U3iqmqrJxizOg=";
2019-07-27 11:48:07 +00:00
};
nativeBuildInputs = [ pkg-config cmake llvm_11.dev ];
2019-07-27 11:48:07 +00:00
buildInputs = [ spirv-headers spirv-tools llvm_11 ];
2019-07-27 11:48:07 +00:00
checkInputs = [ lit ];
makeFlags = [ "llvm-spirv" ];
cmakeFlags = [
"-DLLVM_INCLUDE_TESTS=ON"
"-DLLVM_DIR=${llvm_11.dev}"
"-DBUILD_SHARED_LIBS=YES"
"-DLLVM_SPIRV_BUILD_EXTERNAL=YES"
];
2019-07-27 11:48:07 +00:00
prePatch = ''
substituteInPlace ./test/CMakeLists.txt \
--replace 'SPIRV-Tools' 'SPIRV-Tools-shared'
'';
2019-07-27 11:48:07 +00:00
# FIXME: CMake tries to run "/llvm-lit" which of course doesn't exist
doCheck = false;
meta = with lib; {
homepage = "https://github.com/KhronosGroup/SPIRV-LLVM-Translator";
2019-07-27 11:48:07 +00:00
description = "A tool and a library for bi-directional translation between SPIR-V and LLVM IR";
license = licenses.ncsa;
platforms = platforms.all;
maintainers = with maintainers; [ gloaming ];
};
}