27 Sep 2024 |
K900 | Uhhhhh | 20:22:06 |
K900 | It's going to be kind of a mess | 20:22:11 |
K900 | Probably | 20:22:13 |
K900 | Because our GCC bootstrap is kind of a mess | 20:22:19 |
yehowshua | I can do :mess: | 20:23:03 |
yehowshua | * I can do "mess" | 20:23:08 |
yehowshua | How messy are we talking about? | 20:23:13 |
K900 | https://github.com/NixOS/nixpkgs/tree/master/pkgs/development/compilers/gcc/common | 20:24:30 |
yehowshua | Ideally, I create some new derivation where I modify some attributes in pkgs.pkgsCross.riscv32.gcc { } | 20:24:33 |
Artturin | https://github.com/nix-community/naersk/blob/3fb418eaf352498f6b6c30592e3beb63df42ef11/examples/multi-target/flake.nix#L101 | 20:26:29 |
Artturin | https://github.com/NixOS/nixpkgs/blob/3913c72204235cebbc151a875250b96df485ea60/pkgs/top-level/all-packages.nix#L16063 | 20:28:27 |
yehowshua | Lol - seems configure flags aren't enabled as arguyments: https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/compilers/gcc/default.nix#L1-L39 | 20:28:29 |
Artturin | Don't need to | 20:29:01 |
yehowshua | enabled -> exposed | 20:29:54 |
Artturin | In reply to @k900:0upti.me Because our GCC bootstrap is kind of a mess Bootstrap yes but no bootstrap necessary here | 20:29:58 |
yehowshua | starting a thread | 20:30:23 |
yehowshua | so convo no get out of control | 20:30:31 |
Artturin | In reply to @yehowshua:matrix.org enabled -> exposed It would have to be extraConfigureFlags and that would just be unnecessary args | 20:30:36 |
Artturin | overrideAttrs works better | 20:30:48 |
yehowshua | I've had past pain with overrideAttrs for some odd reason | 20:31:13 |
Artturin | In reply to @yehowshua:matrix.org enabled -> exposed * It would have to be extraConfigureFlags and that would just be unnecessary args with no way to change default flags | 20:31:17 |
yehowshua | I need to get out some more elbow grease | 20:31:21 |
yehowshua | TBF - I don't think I was using it overrideAttrs correctly | 20:31:34 |
yehowshua | I'm thinking that the way to go about this would be gccCustom = nixpkgs/pkgs/development/compilers/gcc and then overrideAttrs | 20:32:59 |
yehowshua | * I'm thinking that the way to go about this would be gccCustom = import nixpkgs/pkgs/development/compilers/gcc and then overrideAttrs | 20:33:04 |
yehowshua | * I'm thinking that the way to go about this would be gccCustom = import nixpkgs/pkgs/development/compilers/gcc/default.nix and then overrideAttrs | 20:33:15 |
yehowshua | Just fixed type ^ | 20:33:22 |
yehowshua | * Just fixed typo ^ | 20:33:25 |
yehowshua | Something like this?
{ pkgs }:
let
customGcc = pkgs.gcc.overrideAttrs (oldAttrs: {
# You can modify or override the existing attributes here
patches = oldAttrs.patches ++ [ ./my-custom-patch.patch ];
# For example, you could also modify the `configureFlags`
configureFlags = oldAttrs.configureFlags ++ [ "--enable-languages=c,c++,fortran" ];
# Or add custom post-installation steps
postInstall = ''
echo "Running custom post-install"
# custom installation commands here
'';
});
in
customGcc
| 20:35:44 |
yehowshua | just a hypothetical example of how I would imagine to use overrideAttrs | 20:36:49 |