summaryrefslogtreecommitdiff
path: root/pkgs/development/idris-modules/idris-wrapper.nix
blob: 5dee53a894fed6f0bf74c22576f569e9a96f8746 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{
  stdenv,
  lib,
  symlinkJoin,
  makeWrapper,
  idris-no-deps,
  gmp,
}:

symlinkJoin {
  inherit (idris-no-deps)
    pname
    version
    src
    meta
    ;
  paths = [ idris-no-deps ];
  nativeBuildInputs = [ makeWrapper ];
  postBuild = ''
    wrapProgram $out/bin/idris \
      --run 'export IDRIS_CC=''${IDRIS_CC:-${stdenv.cc}/bin/cc}' \
      --set 'NIX_CC_WRAPPER_TARGET_HOST_${stdenv.cc.suffixSalt}' 1 \
      --prefix NIX_CFLAGS_COMPILE " " "-I${lib.getDev gmp}/include" \
      --prefix NIX_CFLAGS_LINK " " "-L${lib.getLib gmp}/lib"
  '';
}