1{2 lib,3 craneLib,4 makeWrapper,5 withNightlyFeatures ? false,6 withExperimentalFeatures ? false,7 forBenchmarks ? false,8}:9with lib;10 craneLib.buildPackage {11 src = lib.cleanSourceWith {12 src = ../.;13 filter = path: type:14 (lib.hasSuffix "\.jsonnet" path)15 || (craneLib.filterCargoSources path type);16 };17 pname = "jrsonnet";18 version = "current${optionalString withNightlyFeatures "-nightly"}${optionalString withExperimentalFeatures "-experimental"}";1920 cargoExtraArgs = "--locked --features=mimalloc,legacy-this-file${optionalString withNightlyFeatures ",nightly"}${optionalString withExperimentalFeatures ",experimental"}";2122 nativeBuildInputs = [makeWrapper];2324 25 postInstall = optionalString forBenchmarks ''26 wrapProgram $out/bin/jrsonnet --add-flags "--max-stack=200000 --os-stack=200000"27 '';28 }