git.delta.rocks / jrsonnet / refs/commits / 3c251da01a10

difftreelog

source

nix/jrsonnet.nix1.0 KiBsourcehistory
1{2  lib,3  craneLib,4  makeWrapper,5  withExperimentalFeatures ? false,6  forBenchmarks ? false,78  cpp-jsonnet-for-tests,9  go-jsonnet-for-tests,10}:11let12  inherit (lib) optionalString;13in14craneLib.buildPackage {15  src = lib.cleanSourceWith {16    src = ../.;17    filter =18      path: type:19      (lib.hasSuffix "\.jsonnet" path)20      || (lib.hasSuffix "\.ungram" path)21      || (lib.hasSuffix "\.golden" path)22      || (lib.hasSuffix "\.snap" path)23      || (craneLib.filterCargoSources path type);24  };25  pname = "jrsonnet";26  version = "current${optionalString withExperimentalFeatures "-experimental"}";2728  cargoExtraArgs = "--locked --features=mimalloc${optionalString withExperimentalFeatures ",experimental"}";29  cargoTestExtraArgs = "--workspace";3031  CPP_JSONNET_FOR_TESTS = cpp-jsonnet-for-tests;32  GO_JSONNET_FOR_TESTS = go-jsonnet-for-tests;3334  nativeBuildInputs = [ makeWrapper ];3536  # To clean-up hyperfine output37  postInstall = optionalString forBenchmarks ''38    wrapProgram $out/bin/jrsonnet --add-flags "--max-stack=200000"39  '';40}