about summary refs log tree commit diff
path: root/pkgs/applications/blockchains/quorum
diff options
context:
space:
mode:
authorAaron Jheng <wentworth@outlook.com>2023-09-29 05:09:23 +0000
committerAaron Jheng <wentworth@outlook.com>2023-09-29 08:15:13 +0000
commitebfac7d56693adc64c30de4c4f41ceabc2bce062 (patch)
tree0cb788e6ab441e1b0531f6b875642452859ceb05 /pkgs/applications/blockchains/quorum
parent43bad2a81976d09c22f605a91512e208ba82164c (diff)
quorum: 2.5.0 -> 23.4.0
Diffstat (limited to 'pkgs/applications/blockchains/quorum')
-rw-r--r--pkgs/applications/blockchains/quorum/default.nix40
-rw-r--r--pkgs/applications/blockchains/quorum/go.mod.patch12
2 files changed, 29 insertions, 23 deletions
diff --git a/pkgs/applications/blockchains/quorum/default.nix b/pkgs/applications/blockchains/quorum/default.nix
index 1424ddc9516f8..b50d91a07e895 100644
--- a/pkgs/applications/blockchains/quorum/default.nix
+++ b/pkgs/applications/blockchains/quorum/default.nix
@@ -1,41 +1,35 @@
-{ lib, fetchFromGitHub, buildGoPackage, git, which, removeReferencesTo, go }:
+{ lib, fetchFromGitHub, buildGoModule }:
 
-buildGoPackage rec {
+buildGoModule rec {
   pname = "quorum";
-  version = "2.5.0";
-
-  goPackagePath = "github.com/jpmorganchase/quorum";
+  version = "23.4.0";
 
   src = fetchFromGitHub {
-    owner = "jpmorganchase";
+    owner = "Consensys";
     repo = pname;
     rev = "v${version}";
-    sha256 = "0xfdaqp9bj5dkw12gy19lxj73zh7w80j051xclsvnd41sfah86ll";
+    hash = "sha256-N8MlDHo6LQ/m9xFUeOCm6bqDtjnCc86i/s4ebFLjUT0=";
   };
 
-  buildInputs = [ git which ];
+  vendorHash = "sha256-dTYKGFqVaAnspvKhfBU10bpSzhtQHGTm6KxnNKUVAIg=";
 
-  buildPhase = ''
-    cd "go/src/$goPackagePath"
-    make geth bootnode swarm
-  '';
+  patches = [
+    # Add missing requirements
+    ./go.mod.patch
+  ];
 
-  installPhase = ''
-    mkdir -pv $out/bin
-    cp -v build/bin/geth build/bin/bootnode build/bin/swarm $out/bin
-  '';
+  subPackages = [
+    "cmd/geth"
+    "cmd/bootnode"
+  ];
 
-  # fails with `GOFLAGS=-trimpath`
-  allowGoReference = true;
-  preFixup = ''
-    find $out -type f -exec ${removeReferencesTo}/bin/remove-references-to -t ${go} '{}' +
-  '';
+  ldflags = [ "-s" "-w" ];
 
   meta = with lib; {
     description = "A permissioned implementation of Ethereum supporting data privacy";
-    homepage = "https://www.goquorum.com/";
+    homepage = "https://consensys.net/quorum/";
     license = licenses.lgpl3;
     maintainers = with maintainers; [ mmahut ];
-    platforms = subtractLists ["aarch64-linux"] platforms.linux;
+    platforms = [ "x86_64-linux" "x86_64-darwin" ];
   };
 }
diff --git a/pkgs/applications/blockchains/quorum/go.mod.patch b/pkgs/applications/blockchains/quorum/go.mod.patch
new file mode 100644
index 0000000000000..7161371ac60c3
--- /dev/null
+++ b/pkgs/applications/blockchains/quorum/go.mod.patch
@@ -0,0 +1,12 @@
+diff --git a/go.mod b/go.mod
+index ace412f41..3336c1e08 100644
+--- a/go.mod
++++ b/go.mod
+@@ -89,6 +89,7 @@ require (
+ 	golang.org/x/text v0.3.7
+ 	golang.org/x/time v0.0.0-20201208040808-7e3f01d25324
+ 	google.golang.org/grpc v1.46.0
++	google.golang.org/protobuf v1.28.0
+ 	gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c
+ 	gopkg.in/karalabe/cookiejar.v2 v2.0.0-20150724131613-8dcd6a7f4951
+ 	gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce