@@ -1,31 +1,30 @@
1−{ lib, stdenv, fetchgit, autoconf, libtool, automake, pkg-config, git
2−, bison, flex, postgresql }:
1+{ lib, stdenv, fetchFromGitHub, autoconf, libtool, automake, pkg-config, git
2+, bison, flex, postgresql, ripgrep }:
33
4−let
4+stdenv.mkDerivation rec {
55 pname = "stellar-core";
6− version = "0.5.1";
6+ version = "17.0.0";
77
8−in stdenv.mkDerivation {
9− name = "${pname}-${version}";
10−
11− src = fetchgit {
12− url = "https://github.com/stellar/stellar-core.git";
13− rev = "refs/tags/v${version}";
14− sha256 = "0ldw3qr0sajgam38z2w2iym0214ial6iahbzx3b965cw92n8n88z";
8+ src = fetchFromGitHub {
9+ owner = "stellar";
10+ repo = pname;
11+ rev = "v${version}";
12+ sha256 = "1ngl8yjqb8xzhdwzlxzzxf14q2hgwy2ysb17sn5380rrn0jswin1";
1513 fetchSubmodules = true;
16− leaveDotGit = true;
1714 };
1815
19− nativeBuildInputs = [ pkg-config ];
20− buildInputs = [ autoconf automake libtool git ];
16+ nativeBuildInputs = [ automake autoconf git libtool pkg-config ripgrep ];
2117
2218 propagatedBuildInputs = [ bison flex postgresql ];
2319
24− patches = [ ./stellar-core-dirty-version.patch ];
25−
2620 preConfigure = ''
21+ # Due to https://github.com/NixOS/nixpkgs/issues/8567 we cannot rely on
22+ # having the .git directory present, so directly provide the version
23+ substituteInPlace src/Makefile.am --replace '$$vers' '${pname} ${version}';
24+
2725 # Everything needs to be staged in git because the build uses
2826 # `git ls-files` to search for source files to compile.
27+ git init
2928 git add .
3029
3130 ./autogen.sh