summary refs log tree commit diff
path: root/pkgs/development/idris-modules
diff options
context:
space:
mode:
authorSilvan Mosberger <infinisil@icloud.com>2019-03-26 03:49:57 +0100
committerSilvan Mosberger <infinisil@icloud.com>2019-03-26 04:16:14 +0100
commitcfd2e6731abf7adb361cb01141e77681e498c253 (patch)
tree298305c17ec824a74f00e4c1df3236dcbd8eec0d /pkgs/development/idris-modules
parent7be93a4ca75076e4b9b15b0dea9c0c508af0b7ec (diff)
downloadnixpkgs-cfd2e6731abf7adb361cb01141e77681e498c253.tar
nixpkgs-cfd2e6731abf7adb361cb01141e77681e498c253.tar.gz
nixpkgs-cfd2e6731abf7adb361cb01141e77681e498c253.tar.bz2
nixpkgs-cfd2e6731abf7adb361cb01141e77681e498c253.tar.lz
nixpkgs-cfd2e6731abf7adb361cb01141e77681e498c253.tar.xz
nixpkgs-cfd2e6731abf7adb361cb01141e77681e498c253.tar.zst
nixpkgs-cfd2e6731abf7adb361cb01141e77681e498c253.zip
idrisPackages.idris-wrapper: Fix linking to gmp library
This has been broken since 5d18129ce8af9a69312818ea0a5a0029a04a2255,
which updated idris from 1.3.0 to 1.3.1, which included
https://github.com/idris-lang/Idris-dev/pull/4472 as the cause of the
error. I'm still not entirely sure why this broke it though.

This now way should be rather future proof, it uses NIX_CFLAGS to pass
gpm link flags to our CC wrapper directly. The
`NIX_CC_WRAPPER_${stdenv.cc.infixSalt}_TARGET_HOST` part I'm pretty sure
is needed for the CC wrapper to know that those CFLAGS are meant for the
cc running on the HOST.
Diffstat (limited to 'pkgs/development/idris-modules')
-rw-r--r--pkgs/development/idris-modules/idris-wrapper.nix6
1 files changed, 4 insertions, 2 deletions
diff --git a/pkgs/development/idris-modules/idris-wrapper.nix b/pkgs/development/idris-modules/idris-wrapper.nix
index f395bcd95d7..67f5a61eb13 100644
--- a/pkgs/development/idris-modules/idris-wrapper.nix
+++ b/pkgs/development/idris-modules/idris-wrapper.nix
@@ -1,4 +1,4 @@
-{ lib, symlinkJoin, makeWrapper, idris-no-deps, gcc, gmp }:
+{ stdenv, lib, symlinkJoin, makeWrapper, idris-no-deps, gcc, gmp }:
 
 symlinkJoin {
   inherit (idris-no-deps) name src meta;
@@ -7,6 +7,8 @@ symlinkJoin {
   postBuild = ''
     wrapProgram $out/bin/idris \
       --run 'export IDRIS_CC=''${IDRIS_CC:-${lib.getBin gcc}/bin/gcc}' \
-      --suffix LIBRARY_PATH : ${lib.makeLibraryPath [ gmp ]}
+      --set NIX_CC_WRAPPER_${stdenv.cc.infixSalt}_TARGET_HOST 1 \
+      --prefix NIX_CFLAGS_COMPILE " " "-I${lib.getDev gmp}/include" \
+      --prefix NIX_CFLAGS_LINK " " "-L${lib.getLib gmp}/lib"
   '';
 }