From e9211c2189973c9cba87cb1beaa7a307680f52c4 Mon Sep 17 00:00:00 2001 From: Tristan Ross Date: Mon, 5 Aug 2024 21:27:08 -0700 Subject: [PATCH] glibcLocales: fix building with llvm --- pkgs/development/libraries/glibc/locales.nix | 6 +++++- pkgs/top-level/all-packages.nix | 17 +++++++++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/pkgs/development/libraries/glibc/locales.nix b/pkgs/development/libraries/glibc/locales.nix index eddeb5e3ec4b..6edbb6837b58 100644 --- a/pkgs/development/libraries/glibc/locales.nix +++ b/pkgs/development/libraries/glibc/locales.nix @@ -8,11 +8,15 @@ { lib, stdenv, buildPackages, callPackage, writeText, glibc , allLocales ? true, locales ? [ "en_US.UTF-8/UTF-8" ] +, linuxHeaders, withLinuxHeaders ? !stdenv.cc.isGNU }: -(callPackage ./common.nix { inherit stdenv; } { +(callPackage ./common.nix ({ inherit stdenv; } // lib.optionalAttrs withLinuxHeaders { + inherit linuxHeaders; +}) { pname = "glibc-locales"; extraNativeBuildInputs = [ glibc ]; + inherit withLinuxHeaders; }).overrideAttrs(finalAttrs: previousAttrs: { builder = ./locales-builder.sh; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index fb1895c6e749..81c3c996caae 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -20511,12 +20511,21 @@ with pkgs; # Only supported on Linux and only on glibc glibcLocales = if stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isGnu - then callPackage ../development/libraries/glibc/locales.nix { } - else null; + then callPackage ../development/libraries/glibc/locales.nix { + stdenv = if (!stdenv.cc.isGNU) then + gccStdenv + else stdenv; + withLinuxHeaders = !stdenv.cc.isGNU; + } else null; glibcLocalesUtf8 = if stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isGnu - then callPackage ../development/libraries/glibc/locales.nix { allLocales = false; } - else null; + then callPackage ../development/libraries/glibc/locales.nix { + stdenv = if (!stdenv.cc.isGNU) then + gccStdenv + else stdenv; + withLinuxHeaders = !stdenv.cc.isGNU; + allLocales = false; + } else null; glibcInfo = callPackage ../development/libraries/glibc/info.nix { };