summaryrefslogtreecommitdiff
path: root/patchelf.nix
blob: 6e8e59d3515a5151f16fbd358a5e5fef8676b342 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{ stdenv, buildPackages, autoreconfHook, version, src, overrideCC }:
let
  # on windows we use win32 threads to get a fully static binary
  gcc = buildPackages.wrapCC (buildPackages.gcc-unwrapped.override ({
    threadsCross = {
      model = "win32";
      package = null;
    };
  }));

  stdenv' = if (stdenv.cc.isGNU && stdenv.targetPlatform.isWindows) then
    overrideCC stdenv gcc
  else
    stdenv;
in
stdenv'.mkDerivation {
  pname = "patchelf";
  inherit version src;
  nativeBuildInputs = [ autoreconfHook ];
  doCheck = true;
}