C: Difference between revisions

imported>Milahu
+ pkg-config package names
imported>Mic92
override binutils example
Line 286: Line 286:
   };
   };
in (overrideCC stdenv gcc_nolibc).mkDerivation {
in (overrideCC stdenv gcc_nolibc).mkDerivation {
  name = "env";
}
</syntaxHighlight>
== Override binutils ==
This example shows how to apply changes to the binutils package and than use the override binutils
package to compose a new stdenv.
<syntaxHighlight lang=nix>
with import <nixpkgs> {};
let
  binutils-unwrapped' = binutils-unwrapped.overrideAttrs (old: {
    name = "binutils-2.37";
    src = pkgs.fetchurl {
      url = "https://ftp.gnu.org/gnu/binutils/binutils-2.37.tar.xz";
      sha256 = "sha256-gg2XJPAgo+acszeJOgtjwtsWHa3LDgb8Edwp6x6Eoyw=";
    };
    patches = [];
  });
  cc = wrapCCWith rec {
    cc = gcc-unwrapped;
    bintools = wrapBintoolsWith {
      bintools = binutils-unwrapped';
      libc = glibc;
    };
  };
in
(overrideCC stdenv cc).mkDerivation {
   name = "env";
   name = "env";
}
}