2023-08-22 20:05:09 +00:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "cel-go";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "0.18.1";
|
2023-08-22 20:05:09 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "google";
|
|
|
|
repo = "cel-go";
|
|
|
|
rev = "v${version}";
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-eXltZkg5QjdCrL9sk2ngVtirSnjBBqk+OdNLY4QtVx4=";
|
2023-08-22 20:05:09 +00:00
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
modRoot = "repl";
|
2023-08-22 20:05:09 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
vendorHash = "sha256-kalTHpyMYrKZHayxNKLc8vtogiDKyyQLExOQhqp1MUY=";
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
# repl/go.mod and repl/go.sum are outdated
|
|
|
|
# ran `go mod tidy` in the repl directory
|
|
|
|
./go-mod-tidy.patch
|
|
|
|
];
|
2023-08-22 20:05:09 +00:00
|
|
|
|
|
|
|
subPackages = [
|
|
|
|
"main"
|
|
|
|
];
|
|
|
|
|
|
|
|
ldflags = [ "-s" "-w" ];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mv $out/bin/{main,cel-go}
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Fast, portable, non-Turing complete expression evaluation with gradual typing";
|
|
|
|
homepage = "https://github.com/google/cel-go";
|
|
|
|
changelog = "https://github.com/google/cel-go/releases/tag/${src.rev}";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ figsoda ];
|
|
|
|
};
|
|
|
|
}
|