summary refs log tree commit diff
path: root/pkgs/applications/version-management/bitkeeper/default.nix
blob: c185a4fb759b5c63a4c59d7c919700c8f8c02aa1 (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
{ lib, stdenv, fetchurl, perl, gperf, bison, groff
, pkg-config, libXft, pcre
, libtomcrypt, libtommath, lz4 }:

stdenv.mkDerivation rec {
  pname = "bitkeeper";
  version = "7.3.1ce";

  src = fetchurl {
    url = "https://www.bitkeeper.org/downloads/${version}/bk-${version}.src.tar.gz";
    sha256 = "0l6jwvcg4s1q00vb01hdv58jgv03l8x5mhjl73cwgfiff80zx147";
  };

  hardeningDisable = [ "fortify" ];

  enableParallelBuilding = true;

  nativeBuildInputs = [ pkg-config ];
  buildInputs = [
    perl gperf bison groff libXft
    pcre libtomcrypt libtommath lz4
  ];

  postPatch = ''
        substituteInPlace port/unix_platform.sh \
                --replace /bin/rm rm
        substituteInPlace ./undo.c \
                --replace /bin/cat cat
  '';

  sourceRoot = "bk-${version}/src";
  buildPhase = ''
    make -j6 V=1 p
    make image
  '';

  installPhase = ''
    ./utils/bk-* $out/bitkeeper
    mkdir -p $out/bin
    $out/bitkeeper/bk links $out/bin
    chmod g-w $out
  '';

  meta = {
    description     = "A distributed version control system";
    longDescription = ''
      BitKeeper is a fast, enterprise-ready, distributed SCM that
      scales up to very large projects and down to tiny ones.
    '';
    homepage    = "https://www.bitkeeper.org/";
    license     = lib.licenses.asl20;
    platforms   = lib.platforms.linux;
    maintainers = with lib.maintainers; [ wscott thoughtpolice ];
    broken      = true; # seems to fail on recent glibc versions
  };
}