<commit_before>{ stdenv, fetchFromGitHub, buildGoPackage, git, which }:

buildGoPackage rec {
  pname = "quorum";
  version = "2.5.0";

  goPackagePath = "github.com/jpmorganchase/quorum";

  src = fetchFromGitHub {
    owner = "jpmorganchase";
    repo = pname;
    rev = "v${version}";
    sha256 = "0xfdaqp9bj5dkw12gy19lxj73zh7w80j051xclsvnd41sfah86ll";
  };

  buildInputs = [ git which ];

  buildPhase = ''
    cd "go/src/$goPackagePath"
    make geth bootnode swarm
  '';

  installPhase = ''
    mkdir -pv $out/bin
    cp -v build/bin/geth build/bin/bootnode build/bin/swarm $out/bin
  '';

  meta = with stdenv.lib; {
    description = "A permissioned implementation of Ethereum supporting data privacy";
    homepage = "https://www.goquorum.com/";
    license = licenses.lgpl3;
    maintainers = with maintainers; [ mmahut ];
    platforms = subtractLists ["aarch64-linux"] platforms.linux;
  };
}<commit_msg>quorum: workaround trimpath build failure<commit_after>{ stdenv, fetchFromGitHub, buildGoPackage, git, which, removeReferencesTo, go }:

buildGoPackage rec {
  pname = "quorum";
  version = "2.5.0";

  goPackagePath = "github.com/jpmorganchase/quorum";

  src = fetchFromGitHub {
    owner = "jpmorganchase";
    repo = pname;
    rev = "v${version}";
    sha256 = "0xfdaqp9bj5dkw12gy19lxj73zh7w80j051xclsvnd41sfah86ll";
  };

  buildInputs = [ git which ];

  buildPhase = ''
    cd "go/src/$goPackagePath"
    make geth bootnode swarm
  '';

  installPhase = ''
    mkdir -pv $out/bin
    cp -v build/bin/geth build/bin/bootnode build/bin/swarm $out/bin
  '';

  # fails with `GOFLAGS=-trimpath`
  allowGoReference = true;
  preFixup = ''
    find $out -type f -exec ${removeReferencesTo}/bin/remove-references-to -t ${go} '{}' +
  '';

  meta = with stdenv.lib; {
    description = "A permissioned implementation of Ethereum supporting data privacy";
    homepage = "https://www.goquorum.com/";
    license = licenses.lgpl3;
    maintainers = with maintainers; [ mmahut ];
    platforms = subtractLists ["aarch64-linux"] platforms.linux;
  };
}
{'fraction_non_alphanumeric': 0.13213939980638917, 'fraction_numerical': 0.027105517909002903, 'mean_word_length': 3.445161290322581, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '355529', 'n_tokens_mistral': 782, 'n_tokens_neox': 731, 'n_words': 156}