ripgrep: new recipe (#3251)

This commit is contained in:
Crestwave
2018-12-17 19:25:17 +00:00
committed by waddlesplash
parent 2b3fb985b9
commit a765738d34
2 changed files with 347 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <http://unlicense.org/>

View File

@@ -0,0 +1,323 @@
SUMMARY="Search tool that combines the usability of ag with the speed of grep"
DESCRIPTION="\
ripgrep (rg) recursively searches your current directory for a regex pattern.
By default, ripgrep will respect your .gitignore and automatically skip hidden
files/directories and binary files."
HOMEPAGE="https://github.com/BurntSushi/ripgrep"
COPYRIGHT="2015 Andrew Gallant"
LICENSE="Unlicense
MIT"
REVISION="1"
SOURCE_URI="$HOMEPAGE/archive/$portVersion.tar.gz"
CHECKSUM_SHA256="a2a6eb7d33d75e64613c158e1ae450899b437e37f1bfbd54f713b011cd8cc31e"
SOURCE_FILENAME="ripgrep-$portVersion.tar.gz"
SOURCE_URI_2="https://static.crates.io/crates/aho-corasick/aho-corasick-0.6.8.crate"
CHECKSUM_SHA256_2="68f56c7353e5a9547cbd76ed90f7bb5ffc3ba09d4ea9bd1d8c06c8b1142eeb5a"
SOURCE_URI_3="https://static.crates.io/crates/arrayvec/arrayvec-0.4.7.crate"
CHECKSUM_SHA256_3="a1e964f9e24d588183fcb43503abda40d288c8657dfc27311516ce2f05675aef"
SOURCE_URI_4="https://static.crates.io/crates/atty/atty-0.2.11.crate"
CHECKSUM_SHA256_4="9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652"
SOURCE_URI_5="https://static.crates.io/crates/base64/base64-0.9.2.crate"
CHECKSUM_SHA256_5="85415d2594767338a74a30c1d370b2f3262ec1b4ed2d7bba5b3faf4de40467d9"
SOURCE_URI_6="https://static.crates.io/crates/bitflags/bitflags-1.0.4.crate"
CHECKSUM_SHA256_6="228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12"
SOURCE_URI_7="https://static.crates.io/crates/bytecount/bytecount-0.3.2.crate"
CHECKSUM_SHA256_7="f861d9ce359f56dbcb6e0c2a1cb84e52ad732cadb57b806adeb3c7668caccbd8"
SOURCE_URI_8="https://static.crates.io/crates/byteorder/byteorder-1.2.6.crate"
CHECKSUM_SHA256_8="90492c5858dd7d2e78691cfb89f90d273a2800fc11d98f60786e5d87e2f83781"
SOURCE_URI_9="https://static.crates.io/crates/cc/cc-1.0.24.crate"
CHECKSUM_SHA256_9="70f2a88c2e69ceee91c209d8ef25b81fc1a65f42c7f14dfd59d1fed189e514d1"
SOURCE_URI_10="https://static.crates.io/crates/cfg-if/cfg-if-0.1.5.crate"
CHECKSUM_SHA256_10="0c4e7bb64a8ebb0d856483e1e682ea3422f883c5f5615a90d51a2c82fe87fdd3"
SOURCE_URI_11="https://static.crates.io/crates/clap/clap-2.32.0.crate"
CHECKSUM_SHA256_11="b957d88f4b6a63b9d70d5f454ac8011819c6efa7727858f458ab71c756ce2d3e"
SOURCE_URI_12="https://static.crates.io/crates/cloudabi/cloudabi-0.0.3.crate"
CHECKSUM_SHA256_12="ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f"
SOURCE_URI_13="https://static.crates.io/crates/crossbeam-channel/crossbeam-channel-0.2.4.crate"
CHECKSUM_SHA256_13="6c0a94250b0278d7fc5a894c3d276b11ea164edc8bf8feb10ca1ea517b44a649"
SOURCE_URI_14="https://static.crates.io/crates/crossbeam-epoch/crossbeam-epoch-0.5.2.crate"
CHECKSUM_SHA256_14="30fecfcac6abfef8771151f8be4abc9e4edc112c2bcb233314cafde2680536e9"
SOURCE_URI_15="https://static.crates.io/crates/crossbeam-utils/crossbeam-utils-0.5.0.crate"
CHECKSUM_SHA256_15="677d453a17e8bd2b913fa38e8b9cf04bcdbb5be790aa294f2389661d72036015"
SOURCE_URI_16="https://static.crates.io/crates/encoding_rs/encoding_rs-0.8.6.crate"
CHECKSUM_SHA256_16="2a91912d6f37c6a8fef8a2316a862542d036f13c923ad518b5aca7bcaac7544c"
SOURCE_URI_17="https://static.crates.io/crates/encoding_rs_io/encoding_rs_io-0.1.2.crate"
CHECKSUM_SHA256_17="f222ff554d6e172f3569a2d7d0fd8061d54215984ef67b24ce031c1fcbf2c9b3"
SOURCE_URI_18="https://static.crates.io/crates/fnv/fnv-1.0.6.crate"
CHECKSUM_SHA256_18="2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3"
SOURCE_URI_19="https://static.crates.io/crates/fuchsia-zircon/fuchsia-zircon-0.3.3.crate"
CHECKSUM_SHA256_19="2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82"
SOURCE_URI_20="https://static.crates.io/crates/fuchsia-zircon-sys/fuchsia-zircon-sys-0.3.3.crate"
CHECKSUM_SHA256_20="3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7"
SOURCE_URI_21="https://static.crates.io/crates/glob/glob-0.2.11.crate"
CHECKSUM_SHA256_21="8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb"
SOURCE_URI_22="https://static.crates.io/crates/itoa/itoa-0.4.2.crate"
CHECKSUM_SHA256_22="5adb58558dcd1d786b5f0bd15f3226ee23486e24b7b58304b60f64dc68e62606"
SOURCE_URI_23="https://static.crates.io/crates/lazy_static/lazy_static-1.1.0.crate"
CHECKSUM_SHA256_23="ca488b89a5657b0a2ecd45b95609b3e848cf1755da332a0da46e2b2b1cb371a7"
SOURCE_URI_24="https://static.crates.io/crates/libc/libc-0.2.43.crate"
CHECKSUM_SHA256_24="76e3a3ef172f1a0b9a9ff0dd1491ae5e6c948b94479a3021819ba7d860c8645d"
SOURCE_URI_25="https://static.crates.io/crates/lock_api/lock_api-0.1.3.crate"
CHECKSUM_SHA256_25="949826a5ccf18c1b3a7c3d57692778d21768b79e46eb9dd07bfc4c2160036c54"
SOURCE_URI_26="https://static.crates.io/crates/log/log-0.4.5.crate"
CHECKSUM_SHA256_26="d4fcce5fa49cc693c312001daf1d13411c4a5283796bac1084299ea3e567113f"
SOURCE_URI_27="https://static.crates.io/crates/memchr/memchr-2.0.2.crate"
CHECKSUM_SHA256_27="a3b4142ab8738a78c51896f704f83c11df047ff1bda9a92a661aa6361552d93d"
SOURCE_URI_28="https://static.crates.io/crates/memmap/memmap-0.6.2.crate"
CHECKSUM_SHA256_28="e2ffa2c986de11a9df78620c01eeaaf27d94d3ff02bf81bfcca953102dd0c6ff"
SOURCE_URI_29="https://static.crates.io/crates/memoffset/memoffset-0.2.1.crate"
CHECKSUM_SHA256_29="0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3"
SOURCE_URI_30="https://static.crates.io/crates/nodrop/nodrop-0.1.12.crate"
CHECKSUM_SHA256_30="9a2228dca57108069a5262f2ed8bd2e82496d2e074a06d1ccc7ce1687b6ae0a2"
SOURCE_URI_31="https://static.crates.io/crates/num_cpus/num_cpus-1.8.0.crate"
CHECKSUM_SHA256_31="c51a3322e4bca9d212ad9a158a02abc6934d005490c054a2778df73a70aa0a30"
SOURCE_URI_32="https://static.crates.io/crates/owning_ref/owning_ref-0.3.3.crate"
CHECKSUM_SHA256_32="cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37"
SOURCE_URI_33="https://static.crates.io/crates/parking_lot/parking_lot-0.6.4.crate"
CHECKSUM_SHA256_33="f0802bff09003b291ba756dc7e79313e51cc31667e94afbe847def490424cde5"
SOURCE_URI_34="https://static.crates.io/crates/parking_lot_core/parking_lot_core-0.3.0.crate"
CHECKSUM_SHA256_34="06a2b6aae052309c2fd2161ef58f5067bc17bb758377a0de9d4b279d603fdd8a"
SOURCE_URI_35="https://static.crates.io/crates/pcre2/pcre2-0.1.0.crate"
CHECKSUM_SHA256_35="0c16ec0e30c17f938a2da8ff970ad9a4100166d0538898dcc035b55c393cab54"
SOURCE_URI_36="https://static.crates.io/crates/pcre2-sys/pcre2-sys-0.1.1.crate"
CHECKSUM_SHA256_36="a9027f9474e4e13d3b965538aafcaebe48c803488ad76b3c97ef061a8324695f"
SOURCE_URI_37="https://static.crates.io/crates/pkg-config/pkg-config-0.3.14.crate"
CHECKSUM_SHA256_37="676e8eb2b1b4c9043511a9b7bea0915320d7e502b0a079fb03f9635a5252b18c"
SOURCE_URI_38="https://static.crates.io/crates/proc-macro2/proc-macro2-0.4.18.crate"
CHECKSUM_SHA256_38="afa4d377067cc02eb5e0b491d3f7cfbe145ad4da778535bfb13c444413dd35b9"
SOURCE_URI_39="https://static.crates.io/crates/quote/quote-0.6.8.crate"
CHECKSUM_SHA256_39="dd636425967c33af890042c483632d33fa7a18f19ad1d7ea72e8998c6ef8dea5"
SOURCE_URI_40="https://static.crates.io/crates/rand/rand-0.4.3.crate"
CHECKSUM_SHA256_40="8356f47b32624fef5b3301c1be97e5944ecdd595409cc5da11d05f211db6cfbd"
SOURCE_URI_41="https://static.crates.io/crates/rand/rand-0.5.5.crate"
CHECKSUM_SHA256_41="e464cd887e869cddcae8792a4ee31d23c7edd516700695608f5b98c67ee0131c"
SOURCE_URI_42="https://static.crates.io/crates/rand_core/rand_core-0.2.1.crate"
CHECKSUM_SHA256_42="edecf0f94da5551fc9b492093e30b041a891657db7940ee221f9d2f66e82eef2"
SOURCE_URI_43="https://static.crates.io/crates/redox_syscall/redox_syscall-0.1.40.crate"
CHECKSUM_SHA256_43="c214e91d3ecf43e9a4e41e578973adeb14b474f2bee858742d127af75a0112b1"
SOURCE_URI_44="https://static.crates.io/crates/redox_termios/redox_termios-0.1.1.crate"
CHECKSUM_SHA256_44="7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76"
SOURCE_URI_45="https://static.crates.io/crates/regex/regex-1.0.5.crate"
CHECKSUM_SHA256_45="2069749032ea3ec200ca51e4a31df41759190a88edca0d2d86ee8bedf7073341"
SOURCE_URI_46="https://static.crates.io/crates/regex-syntax/regex-syntax-0.6.2.crate"
CHECKSUM_SHA256_46="747ba3b235651f6e2f67dfa8bcdcd073ddb7c243cb21c442fc12395dfcac212d"
SOURCE_URI_47="https://static.crates.io/crates/remove_dir_all/remove_dir_all-0.5.1.crate"
CHECKSUM_SHA256_47="3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5"
SOURCE_URI_48="https://static.crates.io/crates/ryu/ryu-0.2.6.crate"
CHECKSUM_SHA256_48="7153dd96dade874ab973e098cb62fcdbb89a03682e46b144fd09550998d4a4a7"
SOURCE_URI_49="https://static.crates.io/crates/safemem/safemem-0.2.0.crate"
CHECKSUM_SHA256_49="e27a8b19b835f7aea908818e871f5cc3a5a186550c30773be987e155e8163d8f"
SOURCE_URI_50="https://static.crates.io/crates/same-file/same-file-1.0.3.crate"
CHECKSUM_SHA256_50="10f7794e2fda7f594866840e95f5c5962e886e228e68b6505885811a94dd728c"
SOURCE_URI_51="https://static.crates.io/crates/scopeguard/scopeguard-0.3.3.crate"
CHECKSUM_SHA256_51="94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27"
SOURCE_URI_52="https://static.crates.io/crates/serde/serde-1.0.77.crate"
CHECKSUM_SHA256_52="c6e67977d7523ce4d9284ed58918af99392de8edb6192c44afefcf634654ab7f"
SOURCE_URI_53="https://static.crates.io/crates/serde_derive/serde_derive-1.0.77.crate"
CHECKSUM_SHA256_53="5569c52faae3e21b9abae2cc5cfbb56ed008bfcac480ad62bc241b828f0b0aee"
SOURCE_URI_54="https://static.crates.io/crates/serde_json/serde_json-1.0.27.crate"
CHECKSUM_SHA256_54="59790990c5115d16027f00913e2e66de23a51f70422e549d2ad68c8c5f268f1c"
SOURCE_URI_55="https://static.crates.io/crates/simd/simd-0.2.2.crate"
CHECKSUM_SHA256_55="ed3686dd9418ebcc3a26a0c0ae56deab0681e53fe899af91f5bbcee667ebffb1"
SOURCE_URI_56="https://static.crates.io/crates/smallvec/smallvec-0.6.5.crate"
CHECKSUM_SHA256_56="153ffa32fd170e9944f7e0838edf824a754ec4c1fc64746fcc9fe1f8fa602e5d"
SOURCE_URI_57="https://static.crates.io/crates/stable_deref_trait/stable_deref_trait-1.1.1.crate"
CHECKSUM_SHA256_57="dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8"
SOURCE_URI_58="https://static.crates.io/crates/strsim/strsim-0.7.0.crate"
CHECKSUM_SHA256_58="bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550"
SOURCE_URI_59="https://static.crates.io/crates/syn/syn-0.15.1.crate"
CHECKSUM_SHA256_59="85fb2f7f9b7a4c8df2c913a852de570efdb40f0d2edd39c8245ad573f5c7fbcc"
SOURCE_URI_60="https://static.crates.io/crates/tempdir/tempdir-0.3.7.crate"
CHECKSUM_SHA256_60="15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8"
SOURCE_URI_61="https://static.crates.io/crates/termcolor/termcolor-1.0.3.crate"
CHECKSUM_SHA256_61="ff3bac0e465b59f194e7037ed404b0326e56ff234d767edc4c5cc9cd49e7a2c7"
SOURCE_URI_62="https://static.crates.io/crates/termion/termion-1.5.1.crate"
CHECKSUM_SHA256_62="689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096"
SOURCE_URI_63="https://static.crates.io/crates/textwrap/textwrap-0.10.0.crate"
CHECKSUM_SHA256_63="307686869c93e71f94da64286f9a9524c0f308a9e1c87a583de8e9c9039ad3f6"
SOURCE_URI_64="https://static.crates.io/crates/thread_local/thread_local-0.3.6.crate"
CHECKSUM_SHA256_64="c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b"
SOURCE_URI_65="https://static.crates.io/crates/ucd-util/ucd-util-0.1.1.crate"
CHECKSUM_SHA256_65="fd2be2d6639d0f8fe6cdda291ad456e23629558d466e2789d2c3e9892bda285d"
SOURCE_URI_66="https://static.crates.io/crates/unicode-width/unicode-width-0.1.5.crate"
CHECKSUM_SHA256_66="882386231c45df4700b275c7ff55b6f3698780a650026380e72dabe76fa46526"
SOURCE_URI_67="https://static.crates.io/crates/unicode-xid/unicode-xid-0.1.0.crate"
CHECKSUM_SHA256_67="fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc"
SOURCE_URI_68="https://static.crates.io/crates/unreachable/unreachable-1.0.0.crate"
CHECKSUM_SHA256_68="382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56"
SOURCE_URI_69="https://static.crates.io/crates/utf8-ranges/utf8-ranges-1.0.1.crate"
CHECKSUM_SHA256_69="fd70f467df6810094968e2fce0ee1bd0e87157aceb026a8c083bcf5e25b9efe4"
SOURCE_URI_70="https://static.crates.io/crates/version_check/version_check-0.1.4.crate"
CHECKSUM_SHA256_70="7716c242968ee87e5542f8021178248f267f295a5c4803beae8b8b7fd9bc6051"
SOURCE_URI_71="https://static.crates.io/crates/void/void-1.0.2.crate"
CHECKSUM_SHA256_71="6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
SOURCE_URI_72="https://static.crates.io/crates/walkdir/walkdir-2.2.5.crate"
CHECKSUM_SHA256_72="af464bc7be7b785c7ac72e266a6b67c4c9070155606f51655a650a6686204e35"
SOURCE_URI_73="https://static.crates.io/crates/winapi/winapi-0.3.5.crate"
CHECKSUM_SHA256_73="773ef9dcc5f24b7d850d0ff101e542ff24c3b090a9768e03ff889fdef41f00fd"
SOURCE_URI_74="https://static.crates.io/crates/winapi-i686-pc-windows-gnu/winapi-i686-pc-windows-gnu-0.4.0.crate"
CHECKSUM_SHA256_74="ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
SOURCE_URI_75="https://static.crates.io/crates/winapi-util/winapi-util-0.1.1.crate"
CHECKSUM_SHA256_75="afc5508759c5bf4285e61feb862b6083c8480aec864fa17a81fdec6f69b461ab"
SOURCE_URI_76="https://static.crates.io/crates/winapi-x86_64-pc-windows-gnu/winapi-x86_64-pc-windows-gnu-0.4.0.crate"
CHECKSUM_SHA256_76="712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
SOURCE_URI_77="https://static.crates.io/crates/wincolor/wincolor-1.0.1.crate"
CHECKSUM_SHA256_77="561ed901ae465d6185fa7864d63fbd5720d0ef718366c9a4dc83cf6170d7e9ba"
ARCHITECTURES="!x86_gcc2 !x86 !x86_64"
commandBinDir=$binDir
if [ "$targetArchitecture" = x86_gcc2 ]; then
SECONDARY_ARCHITECTURES="!x86"
commandBinDir=$prefix/bin
fi
defineDebugInfoPackage ripgrep$secondaryArchSuffix \
$binDir/rg
PROVIDES="
ripgrep$secondaryArchSuffix = $portVersion
cmd:rg
"
REQUIRES="
haiku$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
lib:libxslt$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:a2x
cmd:cargo$secondaryArchSuffix
cmd:gcc$secondaryArchSuffix
"
TEST_REQUIRES="
devel:libpcre2_posix$secondaryArchSuffix
"
defineDebugInfoPackage ripgrep$secondaryArchSuffix \
$commandBinDir/rg
BUILD()
{
export CARGO_HOME=$sourceDir/../cargo
CARGO_VENDOR=$CARGO_HOME/haiku
mkdir -p $CARGO_VENDOR
for i in {2..77}; do
eval temp=\$sourceDir$i
eval shasum=\$CHECKSUM_SHA256_$i
pkg=$(basename $temp/*)
cp -r $temp/$pkg $CARGO_VENDOR
cat <<- EOF > $CARGO_VENDOR/$pkg/.cargo-checksum.json
{
"package": "$shasum",
"files": {}
}
EOF
done
cat <<- EOF > $CARGO_HOME/config
[source.haiku]
directory = "$CARGO_VENDOR"
[source.crates-io]
replace-with = "haiku"
EOF
cargo build --release
}
INSTALL()
{
install -D -m755 target/release/rg $binDir/rg
install -D -m644 target/release/build/ripgrep-*/out/rg.bash \
$dataDir/bash-completion/completions/rg
install -D -m644 complete/_rg $dataDir/zsh/site-functions/_rg
install -D -m644 -t $manDir/man1 target/release/build/ripgrep-*/out/rg.1
install -D -m644 -t $docDir *.md
}
TEST()
{
export CARGO_HOME=$sourceDir/../cargo
cargo test --release
}