summary refs log tree commit diff
path: root/pkgs/development/idris-modules
diff options
context:
space:
mode:
authorSilvan Mosberger <infinisil@icloud.com>2018-07-02 01:51:03 +0200
committerSilvan Mosberger <infinisil@icloud.com>2018-07-02 02:34:31 +0200
commitb6cfa372f09b908866878df006e2a65c5a865280 (patch)
tree007a575da6b7eb20b8acfe82c4bbc760becadc2e /pkgs/development/idris-modules
parentd74419ee3ef7bbc077028f89ac1aff727a37553f (diff)
downloadnixpkgs-b6cfa372f09b908866878df006e2a65c5a865280.tar
nixpkgs-b6cfa372f09b908866878df006e2a65c5a865280.tar.gz
nixpkgs-b6cfa372f09b908866878df006e2a65c5a865280.tar.bz2
nixpkgs-b6cfa372f09b908866878df006e2a65c5a865280.tar.lz
nixpkgs-b6cfa372f09b908866878df006e2a65c5a865280.tar.xz
nixpkgs-b6cfa372f09b908866878df006e2a65c5a865280.tar.zst
nixpkgs-b6cfa372f09b908866878df006e2a65c5a865280.zip
idris: Wrap with IDRIS_CC
Previously idris used the C compiler from PATH for the C backend, which
means that the results and whether it even succeeds can vary between
systems (e.g. if a Nix-built Idris was used on a super old Linux system,
the cc installed there might not even work for Idris' C).

To make this more predictable, this commit sets the IDRIS_CC env var,
which Idris will prefer over searching in PATH, to a Nix-provided gcc
executable, given that it is not already set, so it's still possible to
override.
Diffstat (limited to 'pkgs/development/idris-modules')
-rw-r--r--pkgs/development/idris-modules/idris-wrapper.nix3
1 files changed, 2 insertions, 1 deletions
diff --git a/pkgs/development/idris-modules/idris-wrapper.nix b/pkgs/development/idris-modules/idris-wrapper.nix
index fcd02c4da24..5699f8b61b6 100644
--- a/pkgs/development/idris-modules/idris-wrapper.nix
+++ b/pkgs/development/idris-modules/idris-wrapper.nix
@@ -1,4 +1,4 @@
-{ symlinkJoin, makeWrapper, stdenv }: idris: { path, lib }:
+{ symlinkJoin, makeWrapper, stdenv, gcc }: idris: { path, lib }:
 
 symlinkJoin {
   name = idris.name;
@@ -8,6 +8,7 @@ symlinkJoin {
   meta.platforms = idris.meta.platforms;
   postBuild = ''
     wrapProgram $out/bin/idris \
+      --run 'export IDRIS_CC=''${IDRIS_CC:-${stdenv.lib.getBin gcc}/bin/gcc}' \
       --suffix PATH : ${ stdenv.lib.makeBinPath path } \
       --suffix LIBRARY_PATH : ${stdenv.lib.makeLibraryPath lib}
       '';