summaryrefslogtreecommitdiffstats
path: root/pkgs/build-support/fetchgx/default.nix
blob: 49211c44949ccc075d1399d65a41866510eb94d6 (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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{
  lib,
  stdenvNoCC,
  gx,
  gx-go,
  go,
  cacert,
}:

lib.fetchers.withNormalizedHash { } (
  {
    name,
    src,
    outputHash,
    outputHashAlgo,
  }:

  stdenvNoCC.mkDerivation {
    name = "${name}-gxdeps";
    inherit src;

    nativeBuildInputs = [
      cacert
      go
      gx
      gx-go
    ];

    inherit outputHash outputHashAlgo;
    outputHashMode = "recursive";

    dontConfigure = true;
    doCheck = false;
    doInstallCheck = false;

    buildPhase = ''
      export GOPATH=$(pwd)/vendor
      mkdir -p vendor
      gx install
    '';

    installPhase = ''
      mv vendor $out
    '';

    preferLocalBuild = true;
  }
)