From d1e0f3f1cec359f050c326c829b8858e19cf6be9 Mon Sep 17 00:00:00 2001 From: Crestwave <35413013+Crestwave@users.noreply.github.com> Date: Sat, 23 Nov 2019 07:18:44 +0800 Subject: [PATCH] hyperfine: new recipe (#4302) --- .../hyperfine/hyperfine-1.8.0.recipe | 301 ++++++++++++++++++ .../hyperfine/patches/termios-0.3.1.patchset | 298 +++++++++++++++++ 2 files changed, 599 insertions(+) create mode 100644 app-benchmarks/hyperfine/hyperfine-1.8.0.recipe create mode 100644 app-benchmarks/hyperfine/patches/termios-0.3.1.patchset diff --git a/app-benchmarks/hyperfine/hyperfine-1.8.0.recipe b/app-benchmarks/hyperfine/hyperfine-1.8.0.recipe new file mode 100644 index 000000000..a40280696 --- /dev/null +++ b/app-benchmarks/hyperfine/hyperfine-1.8.0.recipe @@ -0,0 +1,301 @@ +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="!x86_gcc2 ?x86 x86_64" +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 +} diff --git a/app-benchmarks/hyperfine/patches/termios-0.3.1.patchset b/app-benchmarks/hyperfine/patches/termios-0.3.1.patchset new file mode 100644 index 000000000..4b05462ef --- /dev/null +++ b/app-benchmarks/hyperfine/patches/termios-0.3.1.patchset @@ -0,0 +1,298 @@ +From 94cf66b9fbca3fee55a7dfa31fc2201b761ac6cb Mon Sep 17 00:00:00 2001 +From: Nikolay Korotkiy +Date: Thu, 20 Jun 2019 12:10:22 +0300 +Subject: Add Haiku support + + +diff --git a/termios-0.3.1/src/os/haiku.rs b/termios-0.3.1/src/os/haiku.rs +new file mode 100644 +index 0000000..12dbcc8 +--- /dev/null ++++ b/termios-0.3.1/src/os/haiku.rs +@@ -0,0 +1,157 @@ ++#![allow(non_camel_case_types)] ++ ++use libc::{c_int,c_uint,c_uchar}; ++ ++pub type cc_t = c_uchar; ++pub type speed_t = c_uchar; ++pub type tcflag_t = c_uint; ++ ++#[derive(Debug,Copy,Clone,Eq,PartialEq)] ++#[repr(C)] ++pub struct termios { ++ pub c_iflag: tcflag_t, ++ pub c_oflag: tcflag_t, ++ pub c_cflag: tcflag_t, ++ pub c_lflag: tcflag_t, ++ c_line: cc_t, ++ c_ispeed: speed_t, ++ c_ospeed: speed_t, ++ pub c_cc: [cc_t; NCCS] ++} ++ ++pub const NCCS: usize = 11; ++ ++// c_cc characters ++pub const VINTR: usize = 0; ++pub const VQUIT: usize = 1; ++pub const VERASE: usize = 2; ++pub const VKILL: usize = 3; ++pub const VEOF: usize = 4; ++pub const VEOL: usize = 5; ++pub const VMIN: usize = 4; ++pub const VTIME: usize = 5; ++pub const VEOL2: usize = 6; ++pub const VSWTCH: usize = 7; ++pub const VSTART: usize = 8; ++pub const VSTOP: usize = 9; ++pub const VSUSP: usize = 10; ++ ++// c_iflag bits ++pub const IGNBRK: tcflag_t = 0x01; ++pub const BRKINT: tcflag_t = 0x02; ++pub const IGNPAR: tcflag_t = 0x04; ++pub const PARMRK: tcflag_t = 0x08; ++pub const INPCK: tcflag_t = 0x10; ++pub const ISTRIP: tcflag_t = 0x20; ++pub const INLCR: tcflag_t = 0x40; ++pub const IGNCR: tcflag_t = 0x80; ++pub const ICRNL: tcflag_t = 0x100; ++pub const IUCLC: tcflag_t = 0x200; ++pub const IXON: tcflag_t = 0x400; ++pub const IXANY: tcflag_t = 0x800; ++pub const IXOFF: tcflag_t = 0x1000; ++ ++// c_oflag bits ++pub const OPOST: tcflag_t = 0x01; ++pub const OLCUC: tcflag_t = 0x02; ++pub const ONLCR: tcflag_t = 0x04; ++pub const OCRNL: tcflag_t = 0x08; ++pub const ONOCR: tcflag_t = 0x10; ++pub const ONLRET: tcflag_t = 0x20; ++pub const OFILL: tcflag_t = 0x40; ++pub const OFDEL: tcflag_t = 0x80; ++pub const NLDLY: tcflag_t = 0x100; ++pub const NL0: tcflag_t = 0x000; ++pub const NL1: tcflag_t = 0x100; ++pub const CRDLY: tcflag_t = 0x600; ++pub const CR0: tcflag_t = 0x000; ++pub const CR1: tcflag_t = 0x200; ++pub const CR2: tcflag_t = 0x400; ++pub const CR3: tcflag_t = 0x600; ++pub const TABDLY: tcflag_t = 0x1800; ++pub const TAB0: tcflag_t = 0x0000; ++pub const TAB1: tcflag_t = 0x0800; ++pub const TAB2: tcflag_t = 0x1000; ++pub const TAB3: tcflag_t = 0x1800; ++pub const BSDLY: tcflag_t = 0x2000; ++pub const BS0: tcflag_t = 0x0000; ++pub const BS1: tcflag_t = 0x2000; ++pub const VTDLY: tcflag_t = 0x4000; ++pub const VT0: tcflag_t = 0x0000; ++pub const VT1: tcflag_t = 0x4000; ++pub const FFDLY: tcflag_t = 0x8000; ++pub const FF0: tcflag_t = 0x0000; ++pub const FF1: tcflag_t = 0x8000; ++ ++// c_cflag bits ++pub const CBAUD: tcflag_t = 0x1F; ++pub const CSIZE: tcflag_t = 0x20; ++pub const CS5: tcflag_t = 0x00; ++pub const CS6: tcflag_t = 0x00; ++pub const CS7: tcflag_t = 0x00; ++pub const CS8: tcflag_t = 0x20; ++pub const CSTOPB: tcflag_t = 0x40; ++pub const CREAD: tcflag_t = 0x80; ++pub const PARENB: tcflag_t = 0x100; ++pub const PARODD: tcflag_t = 0x200; ++pub const HUPCL: tcflag_t = 0x400; ++pub const CLOCAL: tcflag_t = 0x800; ++pub const XLOBLK: tcflag_t = 0x1000; ++pub const CTSFLOW: tcflag_t = 0x2000; ++pub const RTSFLOW: tcflag_t = 0x4000; ++pub const CRTSCTS: tcflag_t = 0x6000; ++ ++// c_lflag bits ++pub const ISIG: tcflag_t = 0x01; ++pub const ICANON: tcflag_t = 0x02; ++pub const XCASE: tcflag_t = 0x04; ++pub const ECHO: tcflag_t = 0x08; ++pub const ECHOE: tcflag_t = 0x10; ++pub const ECHOK: tcflag_t = 0x20; ++pub const ECHONL: tcflag_t = 0x40; ++pub const NOFLSH: tcflag_t = 0x80; ++pub const TOSTOP: tcflag_t = 0x100; ++pub const IEXTEN: tcflag_t = 0x200; ++pub const ECHOCTL: tcflag_t = 0x400; ++pub const ECHOPRT: tcflag_t = 0x800; ++pub const ECHOKE: tcflag_t = 0x1000; ++pub const FLUSHO: tcflag_t = 0x2000; ++pub const PENDIN: tcflag_t = 0x4000; ++ ++// baud rates ++pub const B0: speed_t = 0x00; ++pub const B50: speed_t = 0x01; ++pub const B75: speed_t = 0x02; ++pub const B110: speed_t = 0x03; ++pub const B134: speed_t = 0x04; ++pub const B150: speed_t = 0x05; ++pub const B200: speed_t = 0x06; ++pub const B300: speed_t = 0x07; ++pub const B600: speed_t = 0x08; ++pub const B1200: speed_t = 0x09; ++pub const B1800: speed_t = 0x0A; ++pub const B2400: speed_t = 0x0B; ++pub const B4800: speed_t = 0x0C; ++pub const B9600: speed_t = 0x0D; ++pub const B19200: speed_t = 0x0E; ++pub const B38400: speed_t = 0x0F; ++pub const B57600: speed_t = 0x10; ++pub const B115200: speed_t = 0x11; ++pub const B230400: speed_t = 0x12; ++pub const B31250: speed_t = 0x13; ++ ++// tcsetattr() ++pub const TCSANOW: c_int = 0x01; ++pub const TCSADRAIN: c_int = 0x02; ++pub const TCSAFLUSH: c_int = 0x04; ++ ++// tcflow() ++pub const TCOOFF: c_int = 0x01; ++pub const TCOON: c_int = 0x02; ++pub const TCIOFF: c_int = 0x04; ++pub const TCION: c_int = 0x08; ++ ++// tcflush() ++pub const TCIFLUSH: c_int = 0x01; ++pub const TCOFLUSH: c_int = 0x02; ++pub const TCIOFLUSH: c_int = 0x03; +diff --git a/termios-0.3.1/src/os/mod.rs b/termios-0.3.1/src/os/mod.rs +index 519723c..af8f5be 100644 +--- a/termios-0.3.1/src/os/mod.rs ++++ b/termios-0.3.1/src/os/mod.rs +@@ -6,6 +6,7 @@ + #[cfg(target_os = "freebsd")] pub use self::freebsd as target; + #[cfg(target_os = "openbsd")] pub use self::openbsd as target; + #[cfg(target_os = "dragonfly")] pub use self::dragonfly as target; ++#[cfg(target_os = "haiku")] pub use self::haiku as target; + + #[cfg(target_os = "linux")] pub mod linux; + #[cfg(target_os = "android")] pub mod android; +@@ -13,3 +14,4 @@ + #[cfg(target_os = "freebsd")] pub mod freebsd; + #[cfg(target_os = "openbsd")] pub mod openbsd; + #[cfg(target_os = "dragonfly")] pub mod dragonfly; ++#[cfg(target_os = "haiku")] pub mod haiku; +-- +2.21.0 + +From 66ac406b463a239019cbdf1abc8c50fd5e61db2d Mon Sep 17 00:00:00 2001 +From: Crestwave +Date: Tue, 1 Oct 2019 08:44:17 +0000 +Subject: Fix Haiku build + + +diff --git a/termios-0.3.1/src/ffi.rs b/termios-0.3.1/src/ffi.rs +index 89e2084..faf59d2 100644 +--- a/termios-0.3.1/src/ffi.rs ++++ b/termios-0.3.1/src/ffi.rs +@@ -2,7 +2,7 @@ + + use libc::{c_int,pid_t}; + +-#[link(name = "c")] ++#[cfg_attr(not(target_os = "haiku"), link(name = "c"))] + extern "C" { + pub fn tcgetattr(fd: c_int, termios_p: *mut ::os::target::termios) -> c_int; + pub fn tcsetattr(fd: c_int, optional_actions: c_int, termios_p: *const ::os::target::termios) -> c_int; +-- +2.23.0 + +From 5bf7c2c51d9461ea0667e46e2210ca36fcd01a8b Mon Sep 17 00:00:00 2001 +From: Crestwave +Date: Mon, 7 Oct 2019 01:22:57 +0000 +Subject: Fix tests on Haiku + + +diff --git a/termios-0.3.1/src/ffi.rs b/termios-0.3.1/src/ffi.rs +index faf59d2..7bd15ad 100644 +--- a/termios-0.3.1/src/ffi.rs ++++ b/termios-0.3.1/src/ffi.rs +@@ -1,6 +1,8 @@ + //! Unsafe FFI bindings. + +-use libc::{c_int,pid_t}; ++use libc::c_int; ++#[cfg(not(target_os = "haiku"))] ++use libc::pid_t; + + #[cfg_attr(not(target_os = "haiku"), link(name = "c"))] + extern "C" { +@@ -15,6 +17,8 @@ extern "C" { + pub fn cfgetospeed(termios_p: *const ::os::target::termios) -> ::os::target::speed_t; + pub fn cfsetispeed(termios_p: *mut ::os::target::termios, speed: ::os::target::speed_t) -> c_int; + pub fn cfsetospeed(termios_p: *mut ::os::target::termios, speed: ::os::target::speed_t) -> c_int; ++ #[cfg(not(target_os = "haiku"))] + pub fn cfsetspeed(termios_p: *mut ::os::target::termios, speed: ::os::target::speed_t) -> c_int; ++ #[cfg(not(target_os = "haiku"))] + pub fn tcgetsid(fd: c_int) -> pid_t; + } +diff --git a/termios-0.3.1/src/lib.rs b/termios-0.3.1/src/lib.rs +index d229427..4870118 100644 +--- a/termios-0.3.1/src/lib.rs ++++ b/termios-0.3.1/src/lib.rs +@@ -76,6 +76,7 @@ + //! example of a portable function that sets the maximum speed on a `Termios` struct. + //! + //! ```no_run ++//! # #[cfg(not(target_os = "haiku"))] { + //! use std::io; + //! use termios::{Termios,cfsetspeed}; + //! +@@ -107,6 +108,7 @@ + //! # let fd = 1; + //! let mut termios = Termios::from_fd(fd).unwrap(); + //! set_fastest_speed(&mut termios).unwrap(); ++//! # } + //! ``` + + extern crate libc; +@@ -116,7 +118,9 @@ use std::mem; + use std::ops::{Deref,DerefMut}; + use std::os::unix::io::RawFd; + +-use libc::{c_int,pid_t}; ++use libc::c_int; ++#[cfg(not(target_os = "haiku"))] ++use libc::pid_t; + + pub use ::os::target::{cc_t,speed_t,tcflag_t}; // types + pub use ::os::target::{VEOF,VEOL,VERASE,VINTR,VKILL,VMIN,VQUIT,VSTART,VSTOP,VSUSP,VTIME}; // c_cc subscripts +@@ -161,6 +165,7 @@ pub mod os; + /// termios.c_cc[VMIN] = 0; + /// termios.c_cc[VTIME] = 0; + /// ++/// #[cfg(not(target_os = "haiku"))] + /// try!(cfsetspeed(&mut termios, B9600)); + /// try!(tcsetattr(fd, TCSANOW, &mut termios)); + /// +@@ -366,6 +371,7 @@ pub fn cfsetospeed(termios: &mut Termios, speed: speed_t) -> io::Result<()> { + /// + /// This function is not part of the IEEE Std 1003.1 ("POSIX.1") specification, but it is available + /// on Linux, BSD, and OS X. ++#[cfg(not(target_os = "haiku"))] + pub fn cfsetspeed(termios: &mut Termios, speed: speed_t) -> io::Result<()> { + io_result(unsafe { ffi::cfsetspeed(termios.inner_mut(), speed) }) + } +@@ -474,6 +480,7 @@ pub fn tcsetattr(fd: RawFd, action: c_int, termios: &Termios) -> io::Result<()> + /// # Parameters + /// + /// * `fd` should be an open file descriptor associated with a controlling terminal. ++#[cfg(not(target_os = "haiku"))] + pub fn tcgetsid(fd: RawFd) -> pid_t { + unsafe { ffi::tcgetsid(fd) } + } +-- +2.23.0 +