!ayCRiZriCVtuCUpeLp:nixos.org

Nix Cross Compiling

398 Members
92 Servers

Load older messages


SenderMessageTime
27 Sep 2024
@k900:0upti.meK900Uhhhhh20:22:06
@k900:0upti.meK900It's going to be kind of a mess20:22:11
@k900:0upti.meK900Probably20:22:13
@k900:0upti.meK900Because our GCC bootstrap is kind of a mess20:22:19
@yehowshua:matrix.orgyehowshuaI can do :mess:20:23:03
@yehowshua:matrix.orgyehowshua * I can do "mess"20:23:08
@yehowshua:matrix.orgyehowshuaHow messy are we talking about?20:23:13
@k900:0upti.meK900https://github.com/NixOS/nixpkgs/tree/master/pkgs/development/compilers/gcc/common20:24:30
@yehowshua:matrix.orgyehowshua Ideally, I create some new derivation where I modify some attributes in pkgs.pkgsCross.riscv32.gcc { } 20:24:33
@artturin:matrix.orgArtturinhttps://github.com/nix-community/naersk/blob/3fb418eaf352498f6b6c30592e3beb63df42ef11/examples/multi-target/flake.nix#L10120:26:29
@artturin:matrix.orgArtturinhttps://github.com/NixOS/nixpkgs/blob/3913c72204235cebbc151a875250b96df485ea60/pkgs/top-level/all-packages.nix#L1606320:28:27
@yehowshua:matrix.orgyehowshuaLol - seems configure flags aren't enabled as arguyments: https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/compilers/gcc/default.nix#L1-L3920:28:29
@artturin:matrix.orgArtturinDon't need to20:29:01
@yehowshua:matrix.orgyehowshuaenabled -> exposed20:29:54
@artturin:matrix.orgArtturin
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:matrix.orgyehowshuastarting a thread20:30:23
@yehowshua:matrix.orgyehowshuaso convo no get out of control20:30:31
@artturin:matrix.orgArtturin
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:matrix.orgArtturinoverrideAttrs works better20:30:48
@yehowshua:matrix.orgyehowshuaI've had past pain with overrideAttrs for some odd reason20:31:13
@artturin:matrix.orgArtturin
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:matrix.orgyehowshuaI need to get out some more elbow grease20:31:21
@yehowshua:matrix.orgyehowshuaTBF - I don't think I was using it overrideAttrs correctly20:31:34
@yehowshua:matrix.orgyehowshua 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:matrix.orgyehowshua * 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:matrix.orgyehowshua * 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:matrix.orgyehowshuaJust fixed type ^20:33:22
@yehowshua:matrix.orgyehowshua * Just fixed typo ^ 20:33:25
@yehowshua:matrix.orgyehowshua

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:matrix.orgyehowshuajust a hypothetical example of how I would imagine to use overrideAttrs20:36:49

Show newer messages


Back to Room ListRoom Version: 6