From 35f9c2bdbf03fe567cf1a57ecfe3585e28db2c2e Mon Sep 17 00:00:00 2001 From: Ashley Ruglys Date: Tue, 20 Feb 2024 16:06:52 +1300 Subject: [PATCH] ocl-icd: build for windows --- pkgs/development/libraries/ocl-icd/default.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/ocl-icd/default.nix b/pkgs/development/libraries/ocl-icd/default.nix index dfacf433b77f..1b7caf2b9c84 100644 --- a/pkgs/development/libraries/ocl-icd/default.nix +++ b/pkgs/development/libraries/ocl-icd/default.nix @@ -5,6 +5,7 @@ , opencl-headers , addOpenGLRunpath , autoreconfHook +, windows }: stdenv.mkDerivation rec { @@ -23,17 +24,21 @@ stdenv.mkDerivation rec { ruby ]; - buildInputs = [ opencl-headers ]; + buildInputs = [ opencl-headers ] + ++ lib.optionals stdenv.hostPlatform.isWindows [ windows.dlfcn ]; configureFlags = [ "--enable-custom-vendordir=/run/opengl-driver/etc/OpenCL/vendors" ]; + # fixes: can't build x86_64-w64-mingw32 shared library unless -no-undefined is specified + makeFlags = lib.optionals stdenv.hostPlatform.isWindows [ "LDFLAGS=-no-undefined" ]; + meta = with lib; { description = "OpenCL ICD Loader for ${opencl-headers.name}"; homepage = "https://github.com/OCL-dev/ocl-icd"; license = licenses.bsd2; - platforms = platforms.unix; + platforms = platforms.unix ++ platforms.windows; maintainers = with maintainers; [ r-burns ]; }; }