diff options
| author | Rebecca Turner <rbt@sent.as> | 2023-04-14 15:23:21 -0700 |
|---|---|---|
| committer | sternenseemann <sternenseemann@systemli.org> | 2023-06-08 20:11:52 +0200 |
| commit | 17d63282b27555fada48909a471c8b000e1c8f01 (patch) | |
| tree | a68df399ab4d2c1f08077d92a5a1d7a9282c8361 /pkgs/development/python-modules/termplotlib/gnuplot-subprocess.patch | |
| parent | b940b2455eadfde7b2f5e4ebbace18dda4e6f7ff (diff) | |
haskell.compiler: allow overriding source with hadrian
Hadrian (the GHC build tool) is built separately from GHC. This means
that if `haskell.compiler.ghc961` is overridden to add patches, those
patches will _only_ be applied to the GHC portion of the build, and not
the Hadrian build. For example, backporting this patch to GHC 9.6.1
failed because the changes to `hadrian/` files were not reflected in the
Nix build:
https://gitlab.haskell.org/ghc/ghc/-/commit/5ed77deb1b49bff7bae9660487ee4a40a496476d
By lifting `src` and `hadrian` from variables defined in the function
body to parameters with default values, the `hadrian/` files can be
overridden using the `haskell.compiler.ghc961.override` function. For
example:
self.haskell.compiler.ghc961.override {
# The GHC 9.6 builder in nixpkgs first builds hadrian with the
# source tree provided here and then uses the built hadrian to
# build the rest of GHC. We need to make sure our patches get
# included in this `src`, then, rather than modifying the tree in
# the `patchPhase` or `postPatch` of the outer builder.
src = self.applyPatches {
src = let
version = "9.6.1";
in
self.fetchurl {
url = "https://downloads.haskell.org/ghc/${version}/ghc-${version}-src.tar.xz";
sha256 = "fe5ac909cb8bb087e235de97fa63aff47a8ae650efaa37a2140f4780e21f34cb";
};
patches = [
# Enable response files for linker if supported
(self.fetchpatch {
url = "https://gitlab.haskell.org/ghc/ghc/-/commit/5ed77deb1b49bff7bae9660487ee4a40a496476d.patch";
hash = "sha256-dvenK+EPTZJYXnyfKPdkvLp+zeUmsY9YrWpcGCzYStM=";
})
];
};
}
Note that we do have to re-declare the `src` we want, but I'm not sure
of a good way to avoid this while also sharing one set of patches
between the GHC and Hadrian builds.
Diffstat (limited to 'pkgs/development/python-modules/termplotlib/gnuplot-subprocess.patch')
0 files changed, 0 insertions, 0 deletions
