SUMMARY="A command-line benchmarking tool"
DESCRIPTION="Features:
* Statistical analysis across multiple runs.
* Support for arbitrary shell commands.
* Constant feedback about the benchmark progress and current estimates.
* Warmup runs can be executed before the actual benchmark.
* Cache-clearing commands can be set up before each timing run.
* Statistical outlier detection to detect interference from other programs and caching effects.
* Export results to various formats: CSV, JSON, Markdown, AsciiDoc.
* Parameterized benchmarks (e.g. vary the number of threads).
* Cross-platform"
HOMEPAGE="https://github.com/sharkdp/hyperfine"
COPYRIGHT="2018-2019 hyperfine contributors"
LICENSE="Apache v2
	MIT"
REVISION="1"
SOURCE_URI="$HOMEPAGE/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="14de63b44eb4c2c5d6a6f9354acbcff350c9a2ba50b2397de5798c152cc2a029"
SOURCE_FILENAME="hyperfine-$portVersion.tar.gz"

SOURCE_URI_2="https://static.crates.io/crates/ansi_term/ansi_term-0.11.0.crate"
CHECKSUM_SHA256_2="ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"

SOURCE_URI_3="https://static.crates.io/crates/approx/approx-0.1.1.crate"
CHECKSUM_SHA256_3="08abcc3b4e9339e33a3d0a5ed15d84a687350c05689d825e0f6655eef9e76a94"

SOURCE_URI_4="https://static.crates.io/crates/approx/approx-0.3.2.crate"
CHECKSUM_SHA256_4="f0e60b75072ecd4168020818c0107f2857bb6c4e64252d8d3983f6263b40a5c3"

SOURCE_URI_5="https://static.crates.io/crates/atty/atty-0.2.13.crate"
CHECKSUM_SHA256_5="1803c647a3ec87095e7ae7acfca019e98de5ec9a7d01343f611cf3152ed71a90"

SOURCE_URI_6="https://static.crates.io/crates/autocfg/autocfg-0.1.6.crate"
CHECKSUM_SHA256_6="b671c8fb71b457dd4ae18c4ba1e59aa81793daacc361d82fcd410cef0d491875"

SOURCE_URI_7="https://static.crates.io/crates/bitflags/bitflags-1.2.0.crate"
CHECKSUM_SHA256_7="8a606a02debe2813760609f57a64a2ffd27d9fdf5b2f133eaca0b248dd92cdd2"

SOURCE_URI_8="https://static.crates.io/crates/bstr/bstr-0.2.8.crate"
CHECKSUM_SHA256_8="8d6c2c5b58ab920a4f5aeaaca34b4488074e8cc7596af94e6f8c6ff247c60245"

SOURCE_URI_9="https://static.crates.io/crates/byteorder/byteorder-1.3.2.crate"
CHECKSUM_SHA256_9="a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5"

SOURCE_URI_10="https://static.crates.io/crates/cfg-if/cfg-if-0.1.10.crate"
CHECKSUM_SHA256_10="4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"

SOURCE_URI_11="https://static.crates.io/crates/cgmath/cgmath-0.16.1.crate"
CHECKSUM_SHA256_11="64a4b57c8f4e3a2e9ac07e0f6abc9c24b6fc9e1b54c3478cfb598f3d0023e51c"

SOURCE_URI_12="https://static.crates.io/crates/clap/clap-2.33.0.crate"
CHECKSUM_SHA256_12="5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9"

SOURCE_URI_13="https://static.crates.io/crates/clicolors-control/clicolors-control-1.0.1.crate"
CHECKSUM_SHA256_13="90082ee5dcdd64dc4e9e0d37fbf3ee325419e39c0092191e0393df65518f741e"

SOURCE_URI_14="https://static.crates.io/crates/cloudabi/cloudabi-0.0.3.crate"
CHECKSUM_SHA256_14="ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f"

SOURCE_URI_15="https://static.crates.io/crates/colored/colored-1.8.0.crate"
CHECKSUM_SHA256_15="6cdb90b60f2927f8d76139c72dbde7e10c3a2bc47c8594c9c7a66529f2687c03"

SOURCE_URI_16="https://static.crates.io/crates/console/console-0.9.0.crate"
CHECKSUM_SHA256_16="62828f51cfa18f8c31d3d55a43c6ce6af3f87f754cba9fbba7ff38089b9f5612"

SOURCE_URI_17="https://static.crates.io/crates/csv/csv-1.1.1.crate"
CHECKSUM_SHA256_17="37519ccdfd73a75821cac9319d4fce15a81b9fcf75f951df5b9988aa3a0af87d"

SOURCE_URI_18="https://static.crates.io/crates/csv-core/csv-core-0.1.6.crate"
CHECKSUM_SHA256_18="9b5cadb6b25c77aeff80ba701712494213f4a8418fcda2ee11b6560c3ad0bf4c"

SOURCE_URI_19="https://static.crates.io/crates/encode_unicode/encode_unicode-0.3.6.crate"
CHECKSUM_SHA256_19="a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f"

SOURCE_URI_20="https://static.crates.io/crates/fuchsia-cprng/fuchsia-cprng-0.1.1.crate"
CHECKSUM_SHA256_20="a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba"

SOURCE_URI_21="https://static.crates.io/crates/indicatif/indicatif-0.12.0.crate"
CHECKSUM_SHA256_21="a8d596a9576eaa1446996092642d72bfef35cf47243129b7ab883baf5faec31e"

SOURCE_URI_22="https://static.crates.io/crates/itoa/itoa-0.4.4.crate"
CHECKSUM_SHA256_22="501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f"

SOURCE_URI_23="https://static.crates.io/crates/kernel32-sys/kernel32-sys-0.2.2.crate"
CHECKSUM_SHA256_23="7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"

SOURCE_URI_24="https://static.crates.io/crates/lazy_static/lazy_static-1.4.0.crate"
CHECKSUM_SHA256_24="e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"

SOURCE_URI_25="https://static.crates.io/crates/libc/libc-0.2.62.crate"
CHECKSUM_SHA256_25="34fcd2c08d2f832f376f4173a231990fa5aef4e99fb569867318a227ef4c06ba"

SOURCE_URI_26="https://static.crates.io/crates/memchr/memchr-2.2.1.crate"
CHECKSUM_SHA256_26="88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e"

SOURCE_URI_27="https://static.crates.io/crates/num/num-0.2.0.crate"
CHECKSUM_SHA256_27="cf4825417e1e1406b3782a8ce92f4d53f26ec055e3622e1881ca8e9f5f9e08db"

SOURCE_URI_28="https://static.crates.io/crates/num-bigint/num-bigint-0.2.3.crate"
CHECKSUM_SHA256_28="f9c3f34cdd24f334cb265d9bf8bfa8a241920d026916785747a92f0e55541a1a"

SOURCE_URI_29="https://static.crates.io/crates/num-complex/num-complex-0.2.3.crate"
CHECKSUM_SHA256_29="fcb0cf31fb3ff77e6d2a6ebd6800df7fdcd106f2ad89113c9130bcd07f93dffc"

SOURCE_URI_30="https://static.crates.io/crates/num-integer/num-integer-0.1.41.crate"
CHECKSUM_SHA256_30="b85e541ef8255f6cf42bbfe4ef361305c6c135d10919ecc26126c4e5ae94bc09"

SOURCE_URI_31="https://static.crates.io/crates/num-iter/num-iter-0.1.39.crate"
CHECKSUM_SHA256_31="76bd5272412d173d6bf9afdf98db8612bbabc9a7a830b7bfc9c188911716132e"

SOURCE_URI_32="https://static.crates.io/crates/num-rational/num-rational-0.2.2.crate"
CHECKSUM_SHA256_32="f2885278d5fe2adc2f75ced642d52d879bffaceb5a2e0b1d4309ffdfb239b454"

SOURCE_URI_33="https://static.crates.io/crates/num-traits/num-traits-0.1.43.crate"
CHECKSUM_SHA256_33="92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31"

SOURCE_URI_34="https://static.crates.io/crates/num-traits/num-traits-0.2.8.crate"
CHECKSUM_SHA256_34="6ba9a427cfca2be13aa6f6403b0b7e7368fe982bfa16fccc450ce74c46cd9b32"

SOURCE_URI_35="https://static.crates.io/crates/number_prefix/number_prefix-0.3.0.crate"
CHECKSUM_SHA256_35="17b02fc0ff9a9e4b35b3342880f48e896ebf69f2967921fe8646bf5b7125956a"

SOURCE_URI_36="https://static.crates.io/crates/proc-macro2/proc-macro2-1.0.5.crate"
CHECKSUM_SHA256_36="90cf5f418035b98e655e9cdb225047638296b862b42411c4e45bb88d700f7fc0"

SOURCE_URI_37="https://static.crates.io/crates/quote/quote-1.0.2.crate"
CHECKSUM_SHA256_37="053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe"

SOURCE_URI_38="https://static.crates.io/crates/rand/rand-0.4.6.crate"
CHECKSUM_SHA256_38="552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293"

SOURCE_URI_39="https://static.crates.io/crates/rand/rand-0.6.5.crate"
CHECKSUM_SHA256_39="6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca"

SOURCE_URI_40="https://static.crates.io/crates/rand_chacha/rand_chacha-0.1.1.crate"
CHECKSUM_SHA256_40="556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef"

SOURCE_URI_41="https://static.crates.io/crates/rand_core/rand_core-0.3.1.crate"
CHECKSUM_SHA256_41="7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b"

SOURCE_URI_42="https://static.crates.io/crates/rand_core/rand_core-0.4.2.crate"
CHECKSUM_SHA256_42="9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc"

SOURCE_URI_43="https://static.crates.io/crates/rand_hc/rand_hc-0.1.0.crate"
CHECKSUM_SHA256_43="7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4"

SOURCE_URI_44="https://static.crates.io/crates/rand_isaac/rand_isaac-0.1.1.crate"
CHECKSUM_SHA256_44="ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08"

SOURCE_URI_45="https://static.crates.io/crates/rand_jitter/rand_jitter-0.1.4.crate"
CHECKSUM_SHA256_45="1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b"

SOURCE_URI_46="https://static.crates.io/crates/rand_os/rand_os-0.1.3.crate"
CHECKSUM_SHA256_46="7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071"

SOURCE_URI_47="https://static.crates.io/crates/rand_pcg/rand_pcg-0.1.2.crate"
CHECKSUM_SHA256_47="abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44"

SOURCE_URI_48="https://static.crates.io/crates/rand_xorshift/rand_xorshift-0.1.1.crate"
CHECKSUM_SHA256_48="cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c"

SOURCE_URI_49="https://static.crates.io/crates/rdrand/rdrand-0.4.0.crate"
CHECKSUM_SHA256_49="678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2"

SOURCE_URI_50="https://static.crates.io/crates/regex/regex-1.3.1.crate"
CHECKSUM_SHA256_50="dc220bd33bdce8f093101afe22a037b8eb0e5af33592e6a9caafff0d4cb81cbd"

SOURCE_URI_51="https://static.crates.io/crates/regex-automata/regex-automata-0.1.8.crate"
CHECKSUM_SHA256_51="92b73c2a1770c255c240eaa4ee600df1704a38dc3feaa6e949e7fcd4f8dc09f9"

SOURCE_URI_52="https://static.crates.io/crates/regex-syntax/regex-syntax-0.6.12.crate"
CHECKSUM_SHA256_52="11a7e20d1cce64ef2fed88b66d347f88bd9babb82845b2b858f3edbf59a4f716"

SOURCE_URI_53="https://static.crates.io/crates/rgb/rgb-0.8.14.crate"
CHECKSUM_SHA256_53="2089e4031214d129e201f8c3c8c2fe97cd7322478a0d1cdf78e7029b0042efdb"

SOURCE_URI_54="https://static.crates.io/crates/rust_decimal/rust_decimal-1.0.3.crate"
CHECKSUM_SHA256_54="f7a28ded8f10361cefb69a8d8e1d195acf59344150534c165c401d6611cf013d"

SOURCE_URI_55="https://static.crates.io/crates/ryu/ryu-1.0.1.crate"
CHECKSUM_SHA256_55="19d2271fa48eaf61e53cc88b4ad9adcbafa2d512c531e7fadb6dc11a4d3656c5"

SOURCE_URI_56="https://static.crates.io/crates/serde/serde-1.0.101.crate"
CHECKSUM_SHA256_56="9796c9b7ba2ffe7a9ce53c2287dfc48080f4b2b362fcc245a259b3a7201119dd"

SOURCE_URI_57="https://static.crates.io/crates/serde_derive/serde_derive-1.0.101.crate"
CHECKSUM_SHA256_57="4b133a43a1ecd55d4086bd5b4dc6c1751c68b1bfbeba7a5040442022c7e7c02e"

SOURCE_URI_58="https://static.crates.io/crates/serde_json/serde_json-1.0.41.crate"
CHECKSUM_SHA256_58="2f72eb2a68a7dc3f9a691bfda9305a1c017a6215e5a4545c258500d2099a37c2"

SOURCE_URI_59="https://static.crates.io/crates/statistical/statistical-1.0.0.crate"
CHECKSUM_SHA256_59="49d57902bb128e5e38b5218d3681215ae3e322d99f65d5420e9849730d2ea372"

SOURCE_URI_60="https://static.crates.io/crates/strsim/strsim-0.8.0.crate"
CHECKSUM_SHA256_60="8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"

SOURCE_URI_61="https://static.crates.io/crates/syn/syn-1.0.5.crate"
CHECKSUM_SHA256_61="66850e97125af79138385e9b88339cbcd037e3f28ceab8c5ad98e64f0f1f80bf"

SOURCE_URI_62="https://static.crates.io/crates/term_size/term_size-0.3.1.crate"
CHECKSUM_SHA256_62="9e5b9a66db815dcfd2da92db471106457082577c3c278d4138ab3e3b4e189327"

SOURCE_URI_63="https://static.crates.io/crates/termios/termios-0.3.1.crate"
CHECKSUM_SHA256_63="72b620c5ea021d75a735c943269bb07d30c9b77d6ac6b236bc8b5c496ef05625"
PATCHES_63="termios-0.3.1.patchset"

SOURCE_URI_64="https://static.crates.io/crates/textwrap/textwrap-0.11.0.crate"
CHECKSUM_SHA256_64="d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060"

SOURCE_URI_65="https://static.crates.io/crates/unicode-width/unicode-width-0.1.6.crate"
CHECKSUM_SHA256_65="7007dbd421b92cc6e28410fe7362e2e0a2503394908f417b68ec8d1c364c4e20"

SOURCE_URI_66="https://static.crates.io/crates/unicode-xid/unicode-xid-0.2.0.crate"
CHECKSUM_SHA256_66="826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c"

SOURCE_URI_67="https://static.crates.io/crates/winapi/winapi-0.2.8.crate"
CHECKSUM_SHA256_67="167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"

SOURCE_URI_68="https://static.crates.io/crates/winapi/winapi-0.3.8.crate"
CHECKSUM_SHA256_68="8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6"

SOURCE_URI_69="https://static.crates.io/crates/winapi-build/winapi-build-0.1.1.crate"
CHECKSUM_SHA256_69="2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"

SOURCE_URI_70="https://static.crates.io/crates/winapi-i686-pc-windows-gnu/winapi-i686-pc-windows-gnu-0.4.0.crate"
CHECKSUM_SHA256_70="ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"

SOURCE_URI_71="https://static.crates.io/crates/winapi-x86_64-pc-windows-gnu/winapi-x86_64-pc-windows-gnu-0.4.0.crate"
CHECKSUM_SHA256_71="712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"

SOURCE_URI_72="https://static.crates.io/crates/winconsole/winconsole-0.10.0.crate"
CHECKSUM_SHA256_72="3ef84b96d10db72dd980056666d7f1e7663ce93d82fa33b63e71c966f4cf5032"

ARCHITECTURES="all !x86_gcc2 ?x86"
commandBinDir=$binDir
if [ "$targetArchitecture" = x86_gcc2 ]; then
SECONDARY_ARCHITECTURES="x86"
commandBinDir=$prefix/bin
fi

PROVIDES="
	hyperfine$secondaryArchSuffix = $portVersion
	cmd:hyperfine
	"
REQUIRES="
	haiku$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	"
BUILD_PREREQUIRES="
	cmd:cargo$secondaryArchSuffix
	cmd:gcc$secondaryArchSuffix
	"

defineDebugInfoPackage hyperfine$secondaryArchSuffix \
	"$commandBinDir"/hyperfine

BUILD()
{
	export CARGO_HOME=$sourceDir/../cargo
	vendor=$CARGO_HOME/haiku
	mkdir -p "$vendor"
	for i in $(seq 2 72); do
		eval "srcDir=\$sourceDir$i"
		eval "sha256sum=\$CHECKSUM_SHA256_$i"
		set -- "$srcDir"/*
		ln -sf "$1" "$vendor"
		cat <<-EOF >"$vendor/${1##*/}/.cargo-checksum.json"
		{
		  "package": "$sha256sum",
		  "files": {}
		}
		EOF
	done

	cat <<-EOF >"$CARGO_HOME"/config
	[source.haiku]
	directory = "$vendor"

	[source.crates-io]
	replace-with = "haiku"
	EOF

	cargo build --release --frozen
}

INSTALL()
{
	install -m 755 -d "$commandBinDir" "$docDir"
	install -m 755 target/release/hyperfine "$commandBinDir"
	install -m 644 README.md "$docDir"
}

TEST()
{
	export CARGO_HOME=$sourceDir/../cargo
	cargo test --release --frozen
}
