about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/blockchains/stellar-core/default.nix
blob: 53b0de40cbb44d99c76908b7a730ffdd0811d0f7 (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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
{ autoconf
, automake
, bison
, fetchFromGitHub
, flex
, git
, lib
, libtool
, libunwind
, pkg-config
, postgresql
, ripgrep
, stdenv
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "stellar-core";
  version = "19.13.0";

  src = fetchFromGitHub {
    owner = "stellar";
    repo = "stellar-core";
    rev = "v${finalAttrs.version}";
    hash = "sha256-C775tL+x1IX4kfCM/7gOg/V8xunq/rkhIfdkwkhLENk=";
    fetchSubmodules = true;
  };

  nativeBuildInputs = [
    automake
    autoconf
    git
    libtool
    pkg-config
    ripgrep
  ];

  buildInputs = [
    libunwind
  ];

  propagatedBuildInputs = [
    bison
    flex
    postgresql
  ];

  enableParallelBuilding = true;

  preConfigure = ''
    # Due to https://github.com/NixOS/nixpkgs/issues/8567 we cannot rely on
    # having the .git directory present, so directly provide the version
    substituteInPlace src/Makefile.am --replace '$$vers' 'stellar-core ${finalAttrs.version}';

    # Everything needs to be staged in git because the build uses
    # `git ls-files` to search for source files to compile.
    git init
    git add .

    ./autogen.sh
  '';

  meta = {
    description = "Implements the Stellar Consensus Protocol, a federated consensus protocol";
    homepage = "https://www.stellar.org/";
    license = lib.licenses.asl20;
    longDescription = ''
      Stellar-core is the backbone of the Stellar network. It maintains a
      local copy of the ledger, communicating and staying in sync with other
      instances of stellar-core on the network. Optionally, stellar-core can
      store historical records of the ledger and participate in consensus.
    '';
    maintainers = [ ];
    platforms = lib.platforms.linux;
  };
})