about summary refs log tree commit diff
path: root/pkgs/development/compilers/halide
diff options
context:
space:
mode:
authorTom Westerhout <14264576+twesterhout@users.noreply.github.com>2023-08-21 22:36:44 +0200
committerTom Westerhout <14264576+twesterhout@users.noreply.github.com>2023-08-21 22:36:44 +0200
commitb55f063caf98b12852f33d159d8fbb6b3dfc6646 (patch)
treea4aea007085b9b174ad4e87bed2fddbe967e6bfe /pkgs/development/compilers/halide
parented6e240d32e6359be3947bdd8c852876e4464e4f (diff)
halide: patch to remove dependency on Apple SDK
Diffstat (limited to 'pkgs/development/compilers/halide')
-rw-r--r--pkgs/development/compilers/halide/default.nix21
1 files changed, 21 insertions, 0 deletions
diff --git a/pkgs/development/compilers/halide/default.nix b/pkgs/development/compilers/halide/default.nix
index b508433bf94b9..9e04c5a2424ba 100644
--- a/pkgs/development/compilers/halide/default.nix
+++ b/pkgs/development/compilers/halide/default.nix
@@ -34,6 +34,18 @@ stdenv.mkDerivation rec {
     #define HALIDE_CPP_COMPILER_HAS_FLOAT16' \
                 '#if defined(__x86_64__) || defined(__i386__)
     #define HALIDE_CPP_COMPILER_HAS_FLOAT16'
+
+    # AvailabilityVersions.h is part of Apple SDK, and we do not want to depend on it
+    substituteInPlace 'src/runtime/HalideBuffer.h' \
+      --replace '#ifdef __APPLE__
+    #include <AvailabilityVersions.h>
+    #include <TargetConditionals.h>
+    #endif' \
+                ' ' \
+      --replace 'TARGET_OS_OSX && (__MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_15)' \
+                '0' \
+      --replace 'TARGET_OS_IPHONE && (__IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_14_0)' \
+                '0'
   '';
 
   cmakeFlags = [
@@ -46,6 +58,15 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
+  # Note: disable mullapudi2016_fibonacci because it requires too much
+  # parallelism for remote builders
+  ctestArgs = "--output-on-failure -E 'mullapudi2016_fibonacci'";
+  checkPhase = ''
+    runHook preCheck
+    ctest ${ctestArgs}
+    runHook postCheck
+  '';
+
   # Note: only openblas and not atlas part of this Nix expression
   # see pkgs/development/libraries/science/math/liblapack/3.5.0.nix
   # to get a hint howto setup atlas instead of openblas