From f9f12c53c4d7b95350abb78f206dc2a98c4b4d1c Mon Sep 17 00:00:00 2001 From: John Titor <50095635+JohnRTitor@users.noreply.github.com> Date: Sat, 11 Oct 2025 16:09:32 +0530 Subject: [PATCH] pocl: use lib.mapAttrsToList in cmakeFlags --- pkgs/by-name/po/pocl/package.nix | 39 +++++++++++++++++--------------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/pkgs/by-name/po/pocl/package.nix b/pkgs/by-name/po/pocl/package.nix index 02757f7d4557..db4feefae1b2 100644 --- a/pkgs/by-name/po/pocl/package.nix +++ b/pkgs/by-name/po/pocl/package.nix @@ -56,24 +56,27 @@ stdenv.mkDerivation (finalAttrs: { "static_cast(Dev.getInfo())" ''; - cmakeFlags = [ - # avoid the runtime linker pulling in a different llvm e.g. from graphics drivers - (lib.cmakeBool "STATIC_LLVM" true) - (lib.cmakeBool "ENABLE_POCL_BUILDING" false) - (lib.cmakeBool "POCL_ICD_ABSOLUTE_PATH" true) - (lib.cmakeBool "ENABLE_ICD" true) - (lib.cmakeBool "ENABLE_REMOTE_CLIENT" true) - (lib.cmakeBool "ENABLE_REMOTE_SERVER" true) - (lib.cmakeFeature "CLANG" "${clangWrapped}/bin/clang") - (lib.cmakeFeature "CLANGXX" "${clangWrapped}/bin/clang++") - ] - # Only x86_64 supports "distro" which allows runtime detection of SSE/AVX - ++ lib.optionals stdenv.hostPlatform.isx86_64 [ - (lib.cmakeFeature "KERNELLIB_HOST_CPU_VARIANTS" "distro") - ] - ++ lib.optionals (!stdenv.hostPlatform.isx86_64) [ - (lib.cmakeFeature "LLC_HOST_CPU" "generic") - ]; + cmakeFlags = + (lib.mapAttrsToList lib.cmakeBool { + # avoid the runtime linker pulling in a different llvm e.g. from graphics drivers + "STATIC_LLVM" = true; + "ENABLE_POCL_BUILDING" = false; + "POCL_ICD_ABSOLUTE_PATH" = true; + "ENABLE_ICD" = true; + "ENABLE_REMOTE_CLIENT" = true; + "ENABLE_REMOTE_SERVER" = true; + }) + ++ (lib.mapAttrsToList lib.cmakeFeature { + "CLANG" = "${clangWrapped}/bin/clang"; + "CLANGXX" = "${clangWrapped}/bin/clang++"; + }) + # Only x86_64 supports "distro" which allows runtime detection of SSE/AVX + ++ lib.optionals stdenv.hostPlatform.isx86_64 [ + (lib.cmakeFeature "KERNELLIB_HOST_CPU_VARIANTS" "distro") + ] + ++ lib.optionals (!stdenv.hostPlatform.isx86_64) [ + (lib.cmakeFeature "LLC_HOST_CPU" "generic") + ]; nativeBuildInputs = [ cmake