about summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
authorTilCreator J <tilcreator@tc-j.de>2021-07-20 17:25:02 +0200
committerGitHub <noreply@github.com>2021-07-20 17:25:02 +0200
commit8c9748cd5e1ba4a0536523532903b4ad4192fbdd (patch)
treef9ae08cf1207cf41d9c71b6b05ad9e49c92a020e /pkgs/development
parent792e8ee8cd8927ff2ab6cb5916270c5f63d7f022 (diff)
llvmPackages_11.libclc: 2019-06-09 -> 11.0.1 (#111065)
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/libraries/libclc/default.nix35
1 files changed, 16 insertions, 19 deletions
diff --git a/pkgs/development/libraries/libclc/default.nix b/pkgs/development/libraries/libclc/default.nix
index 7be5f8b4000f7..fdcc2ae0081b5 100644
--- a/pkgs/development/libraries/libclc/default.nix
+++ b/pkgs/development/libraries/libclc/default.nix
@@ -1,35 +1,32 @@
-{ lib, stdenv, fetchFromGitHub, python3, llvmPackages }:
+{ lib, stdenv, fetchFromGitHub, ninja, cmake, python3, llvmPackages }:
 
 let
   llvm = llvmPackages.llvm;
-  clang = llvmPackages.clang;
   clang-unwrapped = llvmPackages.clang-unwrapped;
 in
 
-stdenv.mkDerivation {
-  name = "libclc-2019-06-09";
+stdenv.mkDerivation rec {
+  pname = "libclc";
+  version = "11.0.1";
 
   src = fetchFromGitHub {
-    owner = "llvm-mirror";
-    repo = "libclc";
-    rev = "9f6204ec04a8cadb6bef57caa71e3161c4f398f2";
-    sha256 = "03l9frx3iw3qdsb9rrscgzdwm6872gv6mkssvn027ndf9y321xk7";
+    owner = "llvm";
+    repo = "llvm-project";
+    rev = "llvmorg-${version}";
+    sha256 = "0bxh43hp1vl4axl3s9n2nb2ii8x1cbq98xz9c996f8rl5jy84ags";
   };
+  sourceRoot = "source/libclc";
 
-  nativeBuildInputs = [ python3 llvm ];
-
-  strictDeps = true;
-
+  # cmake expects all required binaries to be in the same place, so it will not be able to find clang without the patch
   postPatch = ''
-    sed -i 's,llvm_clang =.*,llvm_clang = "${clang-unwrapped}/bin/clang",' configure.py
-    sed -i 's,cxx_compiler =.*,cxx_compiler = "${clang}/bin/clang++",' configure.py
+    substituteInPlace CMakeLists.txt \
+      --replace 'find_program( LLVM_CLANG clang PATHS ''${LLVM_BINDIR} NO_DEFAULT_PATH )' \
+                'find_program( LLVM_CLANG clang PATHS "${clang-unwrapped}/bin" NO_DEFAULT_PATH )'
   '';
 
-  configurePhase = ''
-    ${python3.interpreter} ./configure.py --prefix=$out
-  '';
-
-  enableParallelBuilding = true;
+  nativeBuildInputs = [ cmake ninja python3 ];
+  buildInputs = [ llvm clang-unwrapped ];
+  strictDeps = true;
 
   meta = with lib; {
     homepage = "http://libclc.llvm.org/";