summary refs log tree commit diff
diff options
context:
space:
mode:
authorPol Dellaiera <pol.dellaiera@protonmail.com>2023-08-11 22:40:17 +0200
committerPol Dellaiera <pol.dellaiera@protonmail.com>2023-08-11 22:40:17 +0200
commit999d52eb20c4fd7e549ed4d4d123d02d699a3d5e (patch)
treea4b620278cc41bf580977d5285308ca615731967
parentde6f81f3f2fd391dc3edae1e87d1ef49fa4af702 (diff)
downloadnixpkgs-999d52eb20c4fd7e549ed4d4d123d02d699a3d5e.tar
nixpkgs-999d52eb20c4fd7e549ed4d4d123d02d699a3d5e.tar.gz
nixpkgs-999d52eb20c4fd7e549ed4d4d123d02d699a3d5e.tar.bz2
nixpkgs-999d52eb20c4fd7e549ed4d4d123d02d699a3d5e.tar.lz
nixpkgs-999d52eb20c4fd7e549ed4d4d123d02d699a3d5e.tar.xz
nixpkgs-999d52eb20c4fd7e549ed4d4d123d02d699a3d5e.tar.zst
nixpkgs-999d52eb20c4fd7e549ed4d4d123d02d699a3d5e.zip
stellar-core: use `finalAttrs` pattern
-rw-r--r--pkgs/applications/blockchains/stellar-core/default.nix57
1 files changed, 41 insertions, 16 deletions
diff --git a/pkgs/applications/blockchains/stellar-core/default.nix b/pkgs/applications/blockchains/stellar-core/default.nix
index 10a2f1139d2..53b0de40cbb 100644
--- a/pkgs/applications/blockchains/stellar-core/default.nix
+++ b/pkgs/applications/blockchains/stellar-core/default.nix
@@ -1,30 +1,55 @@
-{ lib, stdenv, fetchFromGitHub, autoconf, libtool, automake, pkg-config, git
-, bison, flex, postgresql, ripgrep, libunwind }:
+{ autoconf
+, automake
+, bison
+, fetchFromGitHub
+, flex
+, git
+, lib
+, libtool
+, libunwind
+, pkg-config
+, postgresql
+, ripgrep
+, stdenv
+}:
 
-stdenv.mkDerivation rec {
+stdenv.mkDerivation (finalAttrs: {
   pname = "stellar-core";
   version = "19.13.0";
 
   src = fetchFromGitHub {
     owner = "stellar";
-    repo = pname;
-    rev = "v${version}";
-    sha256 = "sha256-C775tL+x1IX4kfCM/7gOg/V8xunq/rkhIfdkwkhLENk=";
+    repo = "stellar-core";
+    rev = "v${finalAttrs.version}";
+    hash = "sha256-C775tL+x1IX4kfCM/7gOg/V8xunq/rkhIfdkwkhLENk=";
     fetchSubmodules = true;
   };
 
-  nativeBuildInputs = [ automake autoconf git libtool pkg-config ripgrep ];
+  nativeBuildInputs = [
+    automake
+    autoconf
+    git
+    libtool
+    pkg-config
+    ripgrep
+  ];
 
-  buildInputs = [ libunwind ];
+  buildInputs = [
+    libunwind
+  ];
 
-  propagatedBuildInputs = [ bison flex postgresql ];
+  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' '${pname} ${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.
@@ -34,17 +59,17 @@ stdenv.mkDerivation rec {
     ./autogen.sh
   '';
 
-  meta = with lib; {
+  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.
     '';
-    homepage = "https://www.stellar.org/";
-    platforms = platforms.linux;
-    maintainers = with maintainers; [ ];
-    license = licenses.asl20;
+    maintainers = [ ];
+    platforms = lib.platforms.linux;
   };
-}
+})