nixpkgs/pkgs/applications/blockchains/stellar-core/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

95 lines
2.4 KiB
Nix
Raw Normal View History

2023-08-11 20:40:17 +00:00
{ autoconf
, automake
, bison
, fetchFromGitHub
, fetchpatch
2023-08-11 20:40:17 +00:00
, flex
, git
, lib
, libtool
, libunwind
, pkg-config
, postgresql
, ripgrep
, stdenv
}:
2017-01-03 06:41:23 +00:00
2023-08-11 20:40:17 +00:00
stdenv.mkDerivation (finalAttrs: {
2017-01-03 06:41:23 +00:00
pname = "stellar-core";
2023-10-05 04:10:49 +00:00
version = "19.14.0";
2017-01-03 06:41:23 +00:00
src = fetchFromGitHub {
owner = "stellar";
2023-08-11 20:40:17 +00:00
repo = "stellar-core";
rev = "v${finalAttrs.version}";
2023-10-05 04:10:49 +00:00
hash = "sha256-lxBn/T01Tsa7tid3mRJUigUwv9d3BAPZhV9Mp1lywBU=";
2017-01-03 06:41:23 +00:00
fetchSubmodules = true;
};
patches = [
# Fix gcc-13 build failure due to missing <stdexcept> include
# https://github.com/stellar/medida/pull/34
(fetchpatch {
name = "gcc-13-p1.patch";
url = "https://github.com/stellar/medida/commit/f91354b0055de939779d392999975d611b1b1ad5.patch";
stripLen = 1;
extraPrefix = "lib/libmedida/";
hash = "sha256-iVeSUY5Rcy62apIKJdbcHGgxAxpQCkygf85oSjbTTXU=";
})
(fetchpatch {
name = "gcc-13-p2.patch";
url = "https://github.com/stellar/stellar-core/commit/477b3135281b629554cabaeacfcdbcdc170aa335.patch";
hash = "sha256-UVRcAIA5LEaCn16lWfhg19UU7b/apigzTsfPROLZtYg=";
})
];
2023-08-11 20:40:17 +00:00
nativeBuildInputs = [
automake
autoconf
git
libtool
pkg-config
ripgrep
];
2022-04-08 08:18:54 +00:00
2023-08-11 20:40:17 +00:00
buildInputs = [
libunwind
];
2017-01-03 06:41:23 +00:00
2023-08-11 20:40:17 +00:00
propagatedBuildInputs = [
bison
flex
postgresql
];
2017-01-03 06:41:23 +00:00
enableParallelBuilding = true;
2017-01-03 06:41:23 +00:00
preConfigure = ''
# Due to https://github.com/NixOS/nixpkgs/issues/8567 we cannot rely on
# having the .git directory present, so directly provide the version
2023-08-11 20:40:17 +00:00
substituteInPlace src/Makefile.am --replace '$$vers' 'stellar-core ${finalAttrs.version}';
2017-01-03 06:41:23 +00:00
# Everything needs to be staged in git because the build uses
# `git ls-files` to search for source files to compile.
git init
2017-01-03 06:41:23 +00:00
git add .
./autogen.sh
'';
2023-08-11 20:40:17 +00:00
meta = {
2017-01-03 06:41:23 +00:00
description = "Implements the Stellar Consensus Protocol, a federated consensus protocol";
2023-08-11 20:40:17 +00:00
homepage = "https://www.stellar.org/";
license = lib.licenses.asl20;
2017-01-03 06:41:23 +00:00
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.
'';
2023-08-11 20:40:17 +00:00
maintainers = [ ];
platforms = lib.platforms.linux;
2023-11-27 01:17:53 +00:00
mainProgram = "stellar-core";
2017-01-03 06:41:23 +00:00
};
2023-08-11 20:40:17 +00:00
})