diff options
author | Graham Christensen <graham@grahamc.com> | 2019-12-19 19:11:58 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-19 19:11:58 -0500 |
commit | b0a78e25bfe391a5483ed34dcacd6d32cf05a452 (patch) | |
tree | ce54b2855f87bb98bb112b677f9318433978de94 /pkgs | |
parent | 83bfedb38bbc270854d957fa2f6d3cfd95f4b9d0 (diff) | |
parent | 42cc7428bc15618e518fa1fe9ba9542aeaea0eaa (diff) | |
download | nixpkgs-b0a78e25bfe391a5483ed34dcacd6d32cf05a452.tar nixpkgs-b0a78e25bfe391a5483ed34dcacd6d32cf05a452.tar.gz nixpkgs-b0a78e25bfe391a5483ed34dcacd6d32cf05a452.tar.bz2 nixpkgs-b0a78e25bfe391a5483ed34dcacd6d32cf05a452.tar.lz nixpkgs-b0a78e25bfe391a5483ed34dcacd6d32cf05a452.tar.xz nixpkgs-b0a78e25bfe391a5483ed34dcacd6d32cf05a452.tar.zst nixpkgs-b0a78e25bfe391a5483ed34dcacd6d32cf05a452.zip |
Merge pull request #75719 from manveru/crystal-compiled-closure-size
crystal: reduce closure size of compiled exes by splitting outputs
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/development/compilers/crystal/default.nix | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/pkgs/development/compilers/crystal/default.nix b/pkgs/development/compilers/crystal/default.nix index 095f94143e3..03a914695a0 100644 --- a/pkgs/development/compilers/crystal/default.nix +++ b/pkgs/development/compilers/crystal/default.nix @@ -56,6 +56,8 @@ let inherit sha256; }; + outputs = [ "out" "lib" "bin" ]; + # we are almost able to run the full test suite now postPatch = '' substituteInPlace src/crystal/system/unix/time.cr \ @@ -97,22 +99,22 @@ let # This makes sure we don't keep depending on the previous version of # crystal used to build this one. - CRYSTAL_LIBRARY_PATH = "${placeholder "out"}/lib/crystal"; + CRYSTAL_LIBRARY_PATH = "${placeholder "lib"}/crystal"; # We *have* to add `which` to the PATH or crystal is unable to build stuff # later if which is not available. installPhase = '' runHook preInstall - install -Dm755 .build/crystal $out/bin/crystal - wrapProgram $out/bin/crystal \ + install -Dm755 .build/crystal $bin/bin/crystal + wrapProgram $bin/bin/crystal \ --suffix PATH : ${lib.makeBinPath [ pkgconfig clang which ]} \ - --suffix CRYSTAL_PATH : lib:$out/lib/crystal \ + --suffix CRYSTAL_PATH : lib:$lib/crystal \ --suffix CRYSTAL_LIBRARY_PATH : ${ lib.makeLibraryPath (commonBuildInputs extraBuildInputs) } - install -dm755 $out/lib/crystal - cp -r src/* $out/lib/crystal/ + install -dm755 $lib/crystal + cp -r src/* $lib/crystal/ install -dm755 $out/share/doc/crystal/api cp -r docs/* $out/share/doc/crystal/api/ @@ -125,6 +127,10 @@ let install -Dm644 -t $out/share/licenses/crystal LICENSE README.md + mkdir -p $out + ln -s $bin/bin $out/bin + ln -s $lib $out/lib + runHook postInstall ''; |