I’m trying to use wrapCC and overrideCC to use a custom clang;
everytime I try to do anything a CC in nixpkgs; I hit some obscure wall that is very difficult to make sense of ( would appreciate and love any edification here)
{pkgs ? import (fetchTarball "https://github.com/nixos/nixpkgs/archive/4e96537f163fad24ed9eb317798a79afc85b51b7.tar.gz") {}}: let
patchedClang = pkgs.llvmPackages.clang-unwrapped.overrideAttrs (oldAttrs: {
patches = (oldAttrs.patches or []) ++ [./custom_patch.patch];
});
wrappedPatchClang = pkgs.wrapCC patchedClang;
patchedClangStdenv = pkgs.overrideCC pkgs.clangStdenv wrappedPatchClang;
in {
example = pkgs.stdenv.mkDerivation {
name = "example";
src = ./.;
buildPhase = ''
make
'';
installPhase = ''
mkdir -p $out/lib
cp *.so $out/lib
'';
};
};
}
This is unfortunately failing to find #include <stddef.h>
in the most basic case.
Any advice here appreciated;
The goal is to build other packages in nixpkgs with my patched clang in stdenv.
i.e.
{
patchedPostgres = pkgs.postgresql.override {
stdenv = patchedClangStdenv;
};
}