djanatyn / ssbm-nix

Nix expressions for Super Smash Bros. Melee players.
31 stars 17 forks source link

Build powerpc-eabi-* from source #30

Open r-burns opened 1 year ago

r-burns commented 1 year ago

Instead of pulling devkitppc binaries, it's easy to build these from source using native nixpkgs infra + devkitpro's patchset. When I need powerpc-eabi-as for gamecube targets, I use this:

{
  devkitppc = pkgs.pkgsCross.ppc-embedded.buildPackages.binutils.bintools.overrideAttrs (oa: {
    patches = oa.patches ++ [ (pkgs.fetchpatch {
      url = "https://raw.githubusercontent.com/devkitPro/buildscripts/devkitPPC_r41/dkppc/patches/binutils-2.37.patch";
      excludes = [ "libiberty/rust-demangle.c" ];
      sha256 = "04whdk0m01rcqcxx0ia9k5w85l90jqlmamg9xfxcxmf7yx0d4w4s";
    }) ];
    configureFlags = oa.configureFlags ++ [
      "--program-prefix=powerpc-eabi-"
    ];  
  });
}

This has the benefit of providing other useful tools such as powerpc-eabi-objdump, powerpc-eabi-readelf, etc.

djanatyn commented 1 year ago

Thanks! Yeah, this looks like a better approach, I'll try to get this merged in soon. If I take too long, feel free to submit a PR. I appreciate the info - I'll add you as co-author on any commits.