2024-01-02 11:29:13 +00:00
{ lib
, stdenv
, fetchFromGitHub
, zig_0_11
, testers
, tigerbeetle
, nix-update-script
} :
2024-01-25 14:12:00 +00:00
let
# Read [these comments](pkgs/development/compilers/zig/hook.nix#L12-L30) on the default Zig flags, and the associated links. tigerbeetle stopped exposing the `-Doptimize` build flag, so we can't use the default Nixpkgs zig hook as-is. tigerbeetle only exposes a boolean `-Drelease` flag which we'll add in the tigerbeetle derivation in this file.
custom_zig_hook = zig_0_11 . hook . overrideAttrs ( previousAttrs : {
zig_default_flags = builtins . filter ( flag : builtins . match " - D o p t i m i z e . * " flag == null ) previousAttrs . zig_default_flags ;
} ) ;
in
2024-01-02 11:29:13 +00:00
stdenv . mkDerivation ( finalAttrs : {
pname = " t i g e r b e e t l e " ;
2024-02-07 01:22:34 +00:00
version = " 0 . 1 4 . 1 7 7 " ;
2024-01-02 11:29:13 +00:00
src = fetchFromGitHub {
owner = " t i g e r b e e t l e " ;
repo = " t i g e r b e e t l e " ;
rev = " r e f s / t a g s / ${ finalAttrs . version } " ;
2024-02-07 01:22:34 +00:00
hash = " s h a 2 5 6 - o M s D H z / y O W t S 1 X h J c X R 7 4 p A 3 Y v P z A N U d R A y 7 t j N O 5 l c = " ;
2024-01-02 11:29:13 +00:00
} ;
2024-01-25 14:12:00 +00:00
nativeBuildInputs = [ custom_zig_hook ] ;
2024-01-02 11:29:13 +00:00
zigBuildFlags = [
2024-01-25 14:12:00 +00:00
" - D r e l e a s e "
2024-01-02 11:29:13 +00:00
" - D g i t - c o m m i t = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 "
" - D v e r s i o n = ${ finalAttrs . version } "
] ;
passthru = {
tests . version = testers . testVersion {
package = tigerbeetle ;
command = " t i g e r b e e t l e v e r s i o n " ;
} ;
updateScript = nix-update-script { } ;
} ;
meta = {
homepage = " h t t p s : / / t i g e r b e e t l e . c o m / " ;
description = " A f i n a n c i a l a c c o u n t i n g d a t a b a s e d e s i g n e d t o b e d i s t r i b u t e d a n d f a s t " ;
license = lib . licenses . asl20 ;
maintainers = with lib . maintainers ; [ danielsidhion ] ;
2024-01-25 14:12:00 +00:00
platforms = lib . platforms . linux ;
2024-01-02 11:29:13 +00:00
mainProgram = " t i g e r b e e t l e " ;
} ;
} )