mirror of
https://github.com/ilyakooo0/haskell.nix.git
synced 2024-09-20 03:18:00 +03:00
Source dist logic
This commit is contained in:
parent
828a04f607
commit
bb39ebbadf
40
compiler/ghc/source-dist.nix
Normal file
40
compiler/ghc/source-dist.nix
Normal file
@ -0,0 +1,40 @@
|
||||
{ src, stdenv, pkgs, version, ghc, alex, happy, hscolour }:
|
||||
stdenv.mkDerivation {
|
||||
|
||||
inherit version;
|
||||
|
||||
name = "ghc-source-dist";
|
||||
|
||||
buildInputs = [ ghc alex happy hscolour ] ++ (with pkgs; [ automake bash git cacert python3 autoconf xorg.lndir ]);
|
||||
|
||||
inherit src;
|
||||
|
||||
phases = [ "unpackPhase" "buildPhase" "installPhase" ];
|
||||
|
||||
buildPhase = ''
|
||||
# Happy and Alex are confused about their data dirs. See
|
||||
# https://github.com/haskell/cabal/issues/5862 for details.
|
||||
#
|
||||
# This is fixed in more recent builds. We can't rely on
|
||||
# custom built tools as computing the source-dist is pretty
|
||||
# much in the bootstrap lane.
|
||||
|
||||
export alex_datadir=$(find ${alex}/share -name "alex-*" -type d -and -not -path "*doc*")
|
||||
export happy_datadir=$(find ${happy}/share -name "happy-*" -type d -and -not -path "*doc*")
|
||||
|
||||
# We need to --skip-url-rewrites, ghc is a bit too strict here.
|
||||
python3 ./boot --skip-url-rewrites
|
||||
# let's not flood the screen with garbage.
|
||||
./configure --silent
|
||||
|
||||
# this folder ends up being needed for the windows dists; just mock it.
|
||||
mkdir ghc-tarballs
|
||||
make sdist --silent
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
install -Dm644 sdistprep/ghc-$(cat VERSION)-src.tar.xz $out/src.tar.xz
|
||||
install -Dm644 sdistprep/ghc-$(cat VERSION)-testsuite.tar.xz $out/testsuite.tar.xz
|
||||
'';
|
||||
}
|
Loading…
Reference in New Issue
Block a user