nixpkgs/pkgs/by-name/be/besu/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

51 lines
1.7 KiB
Nix

{ lib, stdenv, fetchurl, makeWrapper, jemalloc, jre, runCommand, testers }:
stdenv.mkDerivation (finalAttrs: rec {
pname = "besu";
version = "24.1.2";
src = fetchurl {
url = "https://hyperledger.jfrog.io/artifactory/${pname}-binaries/${pname}/${version}/${pname}-${version}.tar.gz";
sha256 = "sha256-CC24z0+2dSeqDddX5dJUs7SX9QJ8Iyh/nAp0pqdDvwg=";
};
buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ jemalloc ];
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
mkdir -p $out/bin
cp -r bin $out/
mkdir -p $out/lib
cp -r lib $out/
wrapProgram $out/bin/${pname} \
--set JAVA_HOME "${jre}" \
--suffix ${if stdenv.hostPlatform.isDarwin then "DYLD_LIBRARY_PATH" else "LD_LIBRARY_PATH"} : ${lib.makeLibraryPath buildInputs}
'';
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
'';
};
meta = with lib; {
description = "Enterprise-grade Java-based, Apache 2.0 licensed Ethereum client";
homepage = "https://www.hyperledger.org/projects/besu";
changelog = "https://github.com/hyperledger/besu/blob/${finalAttrs.version}/CHANGELOG.md";
license = licenses.asl20;
sourceProvenance = with sourceTypes; [ binaryBytecode ];
platforms = platforms.all;
maintainers = with maintainers; [ mmahut ];
};
})