forked from mirrors/nixpkgs
Nim: resurrect bootstrap compiler
Building the bootstrap and the unwrapped compiler in seperate derivations is still worthwhile because if we patch the compiler only need to rebuild the second of the two.
This commit is contained in:
parent
6c492a6936
commit
88c9a92624
|
@ -71,6 +71,17 @@ let
|
||||||
|
|
||||||
nimHost = parsePlatform stdenv.hostPlatform;
|
nimHost = parsePlatform stdenv.hostPlatform;
|
||||||
nimTarget = parsePlatform stdenv.targetPlatform;
|
nimTarget = parsePlatform stdenv.targetPlatform;
|
||||||
|
|
||||||
|
bootstrapCompiler = stdenv.mkDerivation {
|
||||||
|
pname = "nim-bootstrap";
|
||||||
|
inherit (nim-unwrapped) version src;
|
||||||
|
enableParallelBuilding = true;
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
install -Dt $out/bin bin/nim
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
};
|
||||||
in {
|
in {
|
||||||
|
|
||||||
nim-unwrapped = stdenv.mkDerivation rec {
|
nim-unwrapped = stdenv.mkDerivation rec {
|
||||||
|
@ -95,6 +106,7 @@ in {
|
||||||
|
|
||||||
configurePhase = ''
|
configurePhase = ''
|
||||||
runHook preConfigure
|
runHook preConfigure
|
||||||
|
cp ${bootstrapCompiler}/bin/nim bin/
|
||||||
echo 'define:nixbuild' >> config/nim.cfg
|
echo 'define:nixbuild' >> config/nim.cfg
|
||||||
runHook postConfigure
|
runHook postConfigure
|
||||||
'';
|
'';
|
||||||
|
@ -112,7 +124,6 @@ in {
|
||||||
'' + lib.optionalString (stdenv.isDarwin && stdenv.isAarch64) ''
|
'' + lib.optionalString (stdenv.isDarwin && stdenv.isAarch64) ''
|
||||||
sed -i "s/aarch64/arm64/g" makefile
|
sed -i "s/aarch64/arm64/g" makefile
|
||||||
'' + ''
|
'' + ''
|
||||||
make -j$NIX_BUILD_CORES
|
|
||||||
./bin/nim c --parallelBuild:$NIX_BUILD_CORES koch
|
./bin/nim c --parallelBuild:$NIX_BUILD_CORES koch
|
||||||
./koch boot $kochArgs --parallelBuild:$NIX_BUILD_CORES
|
./koch boot $kochArgs --parallelBuild:$NIX_BUILD_CORES
|
||||||
./koch toolsNoExternal $kochArgs --parallelBuild:$NIX_BUILD_CORES
|
./koch toolsNoExternal $kochArgs --parallelBuild:$NIX_BUILD_CORES
|
||||||
|
|
Loading…
Reference in a new issue