From f7c59ea08cbda5bad1c3222db7c1662f2596cf6f Mon Sep 17 00:00:00 2001 From: figsoda Date: Fri, 19 May 2023 11:29:52 -0400 Subject: [PATCH] arrayfire: fix build on darwin --- .../libraries/arrayfire/default.nix | 58 ++++++++++++++----- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 45 insertions(+), 15 deletions(-) diff --git a/pkgs/development/libraries/arrayfire/default.nix b/pkgs/development/libraries/arrayfire/default.nix index bc0da2ddea20..8692aa3017f7 100644 --- a/pkgs/development/libraries/arrayfire/default.nix +++ b/pkgs/development/libraries/arrayfire/default.nix @@ -1,9 +1,27 @@ -{ lib, stdenv, fetchFromGitHub, cmake, pkg-config -, opencl-clhpp, ocl-icd, fftw, fftwFloat -, blas, lapack, boost, mesa, libGLU, libGL -, freeimage, python3, clfft, clblas -, doxygen, buildDocs ? false -, cudaSupport ? false, cudatoolkit +{ lib +, stdenv +, fetchFromGitHub +, cmake +, pkg-config +, opencl-clhpp +, ocl-icd +, fftw +, fftwFloat +, blas +, lapack +, boost +, mesa +, libGLU +, libGL +, freeimage +, python3 +, clfft +, clblas +, doxygen +, buildDocs ? false +, cudaSupport ? false +, cudatoolkit +, darwin }: stdenv.mkDerivation rec { @@ -48,14 +66,26 @@ stdenv.mkDerivation rec { strictDeps = true; buildInputs = [ - opencl-clhpp fftw fftwFloat - blas lapack - libGLU libGL - mesa freeimage - boost.out boost.dev - ] ++ (lib.optional stdenv.isLinux ocl-icd) - ++ (lib.optional cudaSupport cudatoolkit) - ++ (lib.optional buildDocs doxygen); + opencl-clhpp + fftw + fftwFloat + blas + lapack + libGLU + libGL + mesa + freeimage + boost.out + boost.dev + ] ++ lib.optionals stdenv.isLinux [ + ocl-icd + ] ++ lib.optionals cudaSupport [ + cudatoolkit + ] ++ lib.optionals buildDocs [ + doxygen + ] ++ lib.optionals stdenv.isDarwin [ + darwin.apple_sdk_11_0.frameworks.Accelerate + ]; meta = with lib; { description = "A general-purpose library for parallel and massively-parallel computations"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6b03392cf33e..e1bf4acd6f13 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -19577,7 +19577,7 @@ with pkgs; armadillo = callPackage ../development/libraries/armadillo { }; - arrayfire = callPackage ../development/libraries/arrayfire { }; + arrayfire = darwin.apple_sdk_11_0.callPackage ../development/libraries/arrayfire { }; arrow-cpp = callPackage ../development/libraries/arrow-cpp { };