2024-06-05 15:53:02 +00:00
|
|
|
{ lib, stdenv, fetchurl, makeWrapper, jemalloc, jre, runCommand, testers }:
|
2022-02-10 20:34:41 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: rec {
|
2022-02-10 20:34:41 +00:00
|
|
|
pname = "besu";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "24.1.2";
|
2022-02-10 20:34:41 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://hyperledger.jfrog.io/artifactory/${pname}-binaries/${pname}/${version}/${pname}-${version}.tar.gz";
|
2024-04-21 15:54:59 +00:00
|
|
|
sha256 = "sha256-CC24z0+2dSeqDddX5dJUs7SX9QJ8Iyh/nAp0pqdDvwg=";
|
2022-02-10 20:34:41 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isLinux [ jemalloc ];
|
2022-02-10 20:34:41 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp -r bin $out/
|
|
|
|
mkdir -p $out/lib
|
|
|
|
cp -r lib $out/
|
2024-06-05 15:53:02 +00:00
|
|
|
wrapProgram $out/bin/${pname} \
|
|
|
|
--set JAVA_HOME "${jre}" \
|
|
|
|
--suffix ${if stdenv.isDarwin then "DYLD_LIBRARY_PATH" else "LD_LIBRARY_PATH"} : ${lib.makeLibraryPath buildInputs}
|
2022-02-10 20:34:41 +00:00
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
passthru.tests = {
|
|
|
|
version = testers.testVersion {
|
|
|
|
package = finalAttrs.finalPackage;
|
|
|
|
version = "v${version}";
|
|
|
|
};
|
|
|
|
jemalloc = runCommand "${pname}-test-jemalloc"
|
|
|
|
{
|
|
|
|
nativeBuildInputs = [ finalAttrs.finalPackage ];
|
|
|
|
meta.platforms = with lib.platforms; linux;
|
|
|
|
} ''
|
|
|
|
# Expect to find this string in the output, ignore other failures.
|
|
|
|
(besu 2>&1 || true) | grep -q "# jemalloc: ${jemalloc.version}"
|
|
|
|
mkdir $out
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "An enterprise-grade Java-based, Apache 2.0 licensed Ethereum client";
|
|
|
|
homepage = "https://www.hyperledger.org/projects/besu";
|
|
|
|
license = licenses.asl20;
|
2022-07-14 12:49:19 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryBytecode ];
|
2022-02-10 20:34:41 +00:00
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [ mmahut ];
|
|
|
|
};
|
2024-06-05 15:53:02 +00:00
|
|
|
})
|