~kaction/config

ref: milestone/1 config/nix/tup-0.7.8.nix -rw-r--r-- 1.6 KiB
8f4e28c9 — Dmitry Bogatov vim: drop custom implementation of snippets 2 years ago
                                                                                
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
# Version in Nixpkgs (0.7.5) is too old. It generates script that does
# not create output directories; given nature of project, it is
# unacceptable.

pkgs: with pkgs; stdenv.mkDerivation rec {
  name = "tup-${version}";
  version = "0.7.8";

  src = fetchFromGitHub {
    owner = "gittup";
    repo = "tup";
    rev = "v${version}";
    sha256 = "07dmz712zbs5kayf98kywp7blssgh0y2gc1623jbsynmqwi77mcb";
  };

  nativeBuildInputs = [ pkgconfig ];
  buildInputs = [ fuse pcre ];

  configurePhase = ''
    sed -i 's/`git describe`/v${version}/g' src/tup/link.sh
    sed -i 's/pcre-confg/pkg-config pcre/g' Tupfile Tuprules.tup
  '';

  # Regular tup builds require fusermount to have suid, which nix cannot
  # currently provide in a build environment, so we bootstrap and use 'tup
  # generate' instead
  buildPhase = ''
    ./build.sh
    ./build/tup init
    ./build/tup generate script.sh
    ./script.sh
  '';

  installPhase = ''
    mkdir -p $out/bin
    cp tup $out/bin/

    mkdir -p $out/share/man/man1
    cp tup.1 $out/share/man/man1/
  '';

  meta = with stdenv.lib; {
    description = "A fast, file-based build system";
    longDescription = ''
      Tup is a file-based build system for Linux, OSX, and Windows. It inputs a list
      of file changes and a directed acyclic graph (DAG), then processes the DAG to
      execute the appropriate commands required to update dependent files. Updates are
      performed with very little overhead since tup implements powerful build
      algorithms to avoid doing unnecessary work. This means you can stay focused on
      your project rather than on your build system.
    '';
  };
  homepage = http://gittup.org/tup/;
}