packages/linux-lava: fix clang build issues after nixpkgs changes

This commit is contained in:
LavaDesu 2025-03-14 20:41:19 +11:00
parent 80be3da7fc
commit 24aa8d0174
Signed by: cilly
GPG key ID: 6500251E087653C9
3 changed files with 26 additions and 13 deletions

View file

@ -2,6 +2,7 @@ builtins.map (path: import path) [
./android-studio.nix
./ccache.nix
./eww.nix
./linux-lava.nix
./material-icons.nix
./rofi.nix
./steam.nix

23
overlays/linux-lava.nix Normal file
View file

@ -0,0 +1,23 @@
self: super: let
llvmPackages = super.llvmPackages_19;
clangVersion = super.lib.versions.major llvmPackages.libclang.version;
cc = llvmPackages.stdenv.cc.override {
# :sob: see https://github.com/NixOS/nixpkgs/issues/142901
bintools = llvmPackages.bintools;
extraBuildCommands = ''
substituteInPlace "$out/nix-support/cc-cflags" --replace " -nostdlibinc" ""
substituteInPlace "$out/nix-support/add-local-cc-cflags-before.sh" --replace 'echo "Warning: supplying the --target argument to a nix-wrapped compiler may not work correctly - cc-wrapper is currently not designed with multi-target compilers in mind. You may want to use an un-wrapped compiler instead." >&2' ""
echo " -resource-dir=${llvmPackages.libclang.lib}/lib/clang/${clangVersion}" >> $out/nix-support/cc-cflags
'';
};
stdenv = super.ccacheStdenv.override {
stdenv = super.overrideCC llvmPackages.stdenv cc;
};
in {
linuxLavaEnv = {
inherit llvmPackages clangVersion cc stdenv;
};
rust-bindgen-unwrapped = super.rust-bindgen-unwrapped.override {
clang = cc;
};
}