summary refs log tree commit diff
path: root/pkgs/development/tools/build-managers/goredo/default.nix
blob: e1c2b402df69dfb205fe6a56a0bf5d3f16c40c26 (plain) (blame)
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
49
50
51
52
53
54
55
56
57
58
59
{ buildGoModule
, fetchurl
, lib
, zstd
, sharness
, python3
, perl
}:

buildGoModule rec {
  pname = "goredo";
  version = "1.31.0";

  src = fetchurl {
    url = "http://www.goredo.cypherpunks.ru/download/${pname}-${version}.tar.zst";
    hash = "sha256-z7u71VFMoq4VwHohMnYx/ahBSkRZHoI8MZet9gO+XVw=";
  };

  patches = [ ./fix-tests.diff ];

  nativeBuildInputs = [ zstd ];

  nativeCheckInputs = lib.optionals doCheck [ python3 perl ];

  inherit (sharness) SHARNESS_TEST_SRCDIR;

  vendorHash = null;

  modRoot = "./src";
  subPackages = [ "." ];

  postBuild = ''
    ( cd $GOPATH/bin; ./goredo -symlinks )
    cd ..
  '';

  doCheck = true;
  checkPhase = ''
    runHook preCheck
    export PATH=$GOPATH/bin:$PATH
    (cd t; prove -f .)
    runHook postCheck
  '';

  postInstall = ''
    mkdir -p "$out/share/info"
    cp goredo.info "$out/share/info"
  '';

  outputs = [ "out" "info" ];

  meta = with lib; {
    outputsToInstall = [ "out" ];
    description = "djb's redo, a system for building files from source files. Written in Go";
    homepage = "https://www.goredo.cypherpunks.ru";
    license = licenses.gpl3;
    maintainers = [ maintainers.spacefrogg ];
  };
}