about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/opencl-clang
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-06-22 15:01:47 +0000
committerAlyssa Ross <hi@alyssa.is>2021-06-22 16:57:59 +0000
commit633cab0ecb07627706c6b523e219490f019eaab5 (patch)
tree4fb472bdfe2723037dad53dc1b8a87c939015f5e /nixpkgs/pkgs/development/libraries/opencl-clang
parentffb691c199e7e0cbc4e45e5310779c9e3f7c2a73 (diff)
parent432fc2d9a67f92e05438dff5fdc2b39d33f77997 (diff)
downloadnixlib-633cab0ecb07627706c6b523e219490f019eaab5.tar
nixlib-633cab0ecb07627706c6b523e219490f019eaab5.tar.gz
nixlib-633cab0ecb07627706c6b523e219490f019eaab5.tar.bz2
nixlib-633cab0ecb07627706c6b523e219490f019eaab5.tar.lz
nixlib-633cab0ecb07627706c6b523e219490f019eaab5.tar.xz
nixlib-633cab0ecb07627706c6b523e219490f019eaab5.tar.zst
nixlib-633cab0ecb07627706c6b523e219490f019eaab5.zip
Merge commit '432fc2d9a67f92e05438dff5fdc2b39d33f77997'
# Conflicts:
#	nixpkgs/pkgs/applications/editors/emacs/elisp-packages/elpa-generated.nix
#	nixpkgs/pkgs/applications/networking/mailreaders/thunderbird/default.nix
#	nixpkgs/pkgs/applications/window-managers/sway/default.nix
#	nixpkgs/pkgs/build-support/rust/default.nix
#	nixpkgs/pkgs/development/go-modules/generic/default.nix
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/opencl-clang')
-rw-r--r--nixpkgs/pkgs/development/libraries/opencl-clang/default.nix19
1 files changed, 14 insertions, 5 deletions
diff --git a/nixpkgs/pkgs/development/libraries/opencl-clang/default.nix b/nixpkgs/pkgs/development/libraries/opencl-clang/default.nix
index 8bbde9796d9a..48c681973d16 100644
--- a/nixpkgs/pkgs/development/libraries/opencl-clang/default.nix
+++ b/nixpkgs/pkgs/development/libraries/opencl-clang/default.nix
@@ -32,7 +32,9 @@ let
 
   passthru = rec {
 
-    clang-unwrapped = addPatches "clang" llvmPkgs.clang-unwrapped;
+    libclang = addPatches "clang" llvmPkgs.libclang;
+
+    clang-unwrapped = libclang.out;
 
     clang = llvmPkgs.clang.override {
       cc = clang-unwrapped;
@@ -53,7 +55,7 @@ let
 
   library = let
     inherit (llvmPkgs) llvm;
-    inherit (if buildWithPatches then passthru else llvmPkgs) clang-unwrapped spirv-llvm-translator;
+    inherit (if buildWithPatches then passthru else llvmPkgs) libclang spirv-llvm-translator;
   in
     stdenv.mkDerivation rec {
       pname = "opencl-clang";
@@ -74,13 +76,20 @@ let
         ./opencl-headers-dir.patch
       ];
 
-      nativeBuildInputs = [ cmake git ];
+      # Uses linker flags that are not supported on Darwin.
+      postPatch = lib.optionalString stdenv.isDarwin ''
+        sed -i -e '/SET_LINUX_EXPORTS_FILE/d' CMakeLists.txt
+        substituteInPlace CMakeLists.txt \
+          --replace '-Wl,--no-undefined' ""
+      '';
+
+      nativeBuildInputs = [ cmake git llvm.dev ];
 
-      buildInputs = [ clang-unwrapped llvm spirv-llvm-translator ];
+      buildInputs = [ libclang llvm spirv-llvm-translator ];
 
       cmakeFlags = [
         "-DPREFERRED_LLVM_VERSION=${getVersion llvm}"
-        "-DOPENCL_HEADERS_DIR=${clang-unwrapped}/lib/clang/${getVersion clang-unwrapped}/include/"
+        "-DOPENCL_HEADERS_DIR=${libclang.lib}/lib/clang/${getVersion libclang}/include/"
 
         "-DLLVMSPIRV_INCLUDED_IN_LLVM=OFF"
         "-DSPIRV_TRANSLATOR_DIR=${spirv-llvm-translator}"