depot/third_party/nixpkgs/pkgs/by-name/ti/tigerbeetle/package.nix

63 lines
1.5 KiB
Nix

{
lib,
stdenvNoCC,
fetchzip,
testers,
tigerbeetle,
nix-update-script,
}:
let
platform =
if stdenvNoCC.hostPlatform.isDarwin then "universal-macos" else stdenvNoCC.hostPlatform.system;
hash = builtins.getAttr platform {
"universal-macos" = "sha256-E+CXxqa7RCJ+c4KMPPbaNm/z6IrjSlOg9rkcHtVXkew=";
"x86_64-linux" = "sha256-tqx52qO3HuSa9dQD+BlpqE+k4TP4Db9OUloLkL5uR7M=";
"aarch64-linux" = "sha256-rgaN1y0NPdYdn132ey1PjJqwkqC1Z736u7nshw1n1gE=";
};
in
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "tigerbeetle";
version = "0.16.30";
src = fetchzip {
url = "https://github.com/tigerbeetle/tigerbeetle/releases/download/${finalAttrs.version}/tigerbeetle-${platform}.zip";
inherit hash;
};
dontUnpack = true;
dontConfigure = true;
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp $src/tigerbeetle $out/bin/tigerbeetle
runHook postInstall
'';
passthru = {
tests.version = testers.testVersion {
package = tigerbeetle;
command = "tigerbeetle version";
};
updateScript = ./update.sh;
};
meta = {
homepage = "https://tigerbeetle.com/";
description = "Financial accounting database designed to be distributed and fast";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [
danielsidhion
nwjsmith
];
platforms = [
"x86_64-linux"
"aarch64-linux"
] ++ lib.platforms.darwin;
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
mainProgram = "tigerbeetle";
};
})