diff options
author | Andrew Clemons <andrew.clemons@gmail.com> | 2017-11-12 19:38:45 +0000 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2017-11-18 12:40:20 +0700 |
commit | 9253cb1573fe64460d7cfe969b151f4c0c25a0d6 (patch) | |
tree | 95a5cd826889993a4fe07958343635f82c1bbdae /system | |
parent | b9101226d8f4c39466bbaf6f895d2e3f01728bb5 (diff) |
system/fd: Added (simple, fast, user-friendly alternative to find).
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
Diffstat (limited to 'system')
-rw-r--r-- | system/fd/README | 1 | ||||
-rw-r--r-- | system/fd/fd.SlackBuild | 189 | ||||
-rw-r--r-- | system/fd/fd.info | 94 | ||||
-rw-r--r-- | system/fd/slack-desc | 19 |
4 files changed, 303 insertions, 0 deletions
diff --git a/system/fd/README b/system/fd/README new file mode 100644 index 0000000000000..4b82444c6cff8 --- /dev/null +++ b/system/fd/README @@ -0,0 +1 @@ +fd - A simple, fast and user-friendly alternative to find. diff --git a/system/fd/fd.SlackBuild b/system/fd/fd.SlackBuild new file mode 100644 index 0000000000000..d4fa57132d3ad --- /dev/null +++ b/system/fd/fd.SlackBuild @@ -0,0 +1,189 @@ +#!/bin/sh + +# Slackware build script for fd + +# Copyright 2017 Andrew Clemons, Wellington New Zealand +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PRGNAM=fd +VERSION=${VERSION:-5.0.0} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" + CARGOTARGET="--target i586-unknown-linux-gnu" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" + CARGOTARGET="--target i686-unknown-linux-gnu" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" + CARGOTARGET="--target x86_64-unknown-linux-gnu" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" + CARGOTARGET="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$VERSION + +# build offline +# configuration tells cargo to use the configured directory +# for dependencies intead of downloading from crates.io +mkdir .cargo +cat << EOF >> .cargo/config +[source.crates-io] +registry = 'https://github.com/rust-lang/crates.io-index' +replace-with = 'vendored-sources' + +[source.vendored-sources] +directory = '$(pwd)/vendor' +EOF + +# deps and versions come from Cargo.lock +mkdir vendor +( + cd vendor + + for dependency in aho-corasick=0.6.3 \ + ansi_term=0.9.0 \ + atty=0.2.3 \ + bitflags=0.7.0 \ + bitflags=0.9.1 \ + clap=2.26.2 \ + conv=0.3.3 \ + crossbeam=0.2.10 \ + custom_derive=0.1.7 \ + diff=0.1.10 \ + fnv=1.0.5 \ + globset=0.2.0 \ + ignore=0.2.2 \ + kernel32-sys=0.2.2 \ + lazy_static=0.2.9 \ + libc=0.2.31 \ + log=0.3.8 \ + magenta=0.1.1 \ + magenta-sys=0.1.1 \ + memchr=1.0.1 \ + num_cpus=1.7.0 \ + rand=0.3.16 \ + redox_syscall=0.1.31 \ + redox_termios=0.1.1 \ + regex=0.2.2 \ + regex-syntax=0.4.1 \ + same-file=0.1.3 \ + shell-escape=0.1.3 \ + strsim=0.6.0 \ + tempdir=0.3.5 \ + term_size=0.3.0 \ + termion=1.5.1 \ + textwrap=0.8.0 \ + thread_local=0.3.4 \ + unicode-width=0.1.4 \ + unreachable=1.0.0 \ + utf8-ranges=1.0.0 \ + vec_map=0.8.0 \ + void=1.0.2 \ + walkdir=1.0.7 \ + winapi=0.2.8 \ + winapi-build=0.1.1; do + dep="$(echo "$dependency" | cut -d= -f1)" + ver="$(echo "$dependency" | cut -d= -f2)" + + tar xvf $CWD/$dep-$ver.crate + + touch $dep-$ver/.cargo-ok + + # generate checksum + { + printf "{\n" + printf ' "files": {\n' + + ( + cd $dep-$ver + find . -type f -print0 | xargs -0 sha256sum | sed -n '/\.cargo-checksum\.json/!p' | sed 's/\.\///;s/^\([^ ]*\)[[:space:]][[:space:]]*\(.*\)$/"\2":"\1",/' + ) | sed '$ s/,$//' + + printf " },\n" + printf ' "package": "' + + sha256sum "$CWD/$dep-$ver.crate" | cut -f1 -d' ' | sed 's/$/"/' + + printf "}\n" + } | python -c "import sys, json; data = sys.stdin.read(); print json.dumps(json.loads(data), sort_keys=True, indent=4, separators=(',', ' : '))" > $dep-$ver/.cargo-checksum.json + done +) + +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +cargo build --release $CARGOTARGET + +mkdir -p $PKG/usr/bin/ + +find target -name fd -exec install -m 755 {} $PKG/usr/bin/fd \; + +mkdir -p $PKG/usr/man/man1 +install -m644 doc/fd.1 $PKG/usr/man/man1/fd.1 + +find $PKG/usr/man -type f -exec gzip -9 {} \; +for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done + +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a CONTRIBUTING.md LICENSE-APACHE LICENSE-MIT README.md $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/system/fd/fd.info b/system/fd/fd.info new file mode 100644 index 0000000000000..e8a480a97a2a3 --- /dev/null +++ b/system/fd/fd.info @@ -0,0 +1,94 @@ +PRGNAM="fd" +VERSION="5.0.0" +HOMEPAGE="https://github.com/sharkdp/fd" +DOWNLOAD="https://github.com/sharkdp/fd/archive/v5.0.0/fd-5.0.0.tar.gz \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/aho-corasick/aho-corasick-0.6.3.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/ansi_term/ansi_term-0.9.0.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/atty/atty-0.2.3.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/bitflags/bitflags-0.7.0.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/bitflags/bitflags-0.9.1.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/clap/clap-2.26.2.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/conv/conv-0.3.3.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/crossbeam/crossbeam-0.2.10.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/custom_derive/custom_derive-0.1.7.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/diff/diff-0.1.10.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/fnv/fnv-1.0.5.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/globset/globset-0.2.0.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/ignore/ignore-0.2.2.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/kernel32-sys/kernel32-sys-0.2.2.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/lazy_static/lazy_static-0.2.9.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/libc/libc-0.2.31.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/log/log-0.3.8.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/magenta/magenta-0.1.1.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/magenta-sys/magenta-sys-0.1.1.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/memchr/memchr-1.0.1.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/num_cpus/num_cpus-1.7.0.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/rand/rand-0.3.16.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/redox_syscall/redox_syscall-0.1.31.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/redox_termios/redox_termios-0.1.1.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/regex/regex-0.2.2.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/regex-syntax/regex-syntax-0.4.1.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/same-file/same-file-0.1.3.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/shell-escape/shell-escape-0.1.3.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/strsim/strsim-0.6.0.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/tempdir/tempdir-0.3.5.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/term_size/term_size-0.3.0.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/termion/termion-1.5.1.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/textwrap/textwrap-0.8.0.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/thread_local/thread_local-0.3.4.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/unicode-width/unicode-width-0.1.4.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/unreachable/unreachable-1.0.0.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/utf8-ranges/utf8-ranges-1.0.0.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/vec_map/vec_map-0.8.0.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/void/void-1.0.2.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/walkdir/walkdir-1.0.7.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/winapi/winapi-0.2.8.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/winapi-build/winapi-build-0.1.1.crate" +MD5SUM="e336d1bbf187be896c0597fdbe116e4b \ + f2904b4b227389e7453f14b769bdbe5b \ + 1af8116948ced56c372f1ca6c6a8d07d \ + 0b26df9351a4633f260082c5740822f2 \ + 1dd9b755c91f0f7bb401e393a9ed69f2 \ + 8db34042da9ec719905b996a5b7182e1 \ + 075bb24183f541472a2ad7ff6d82aef9 \ + ac23d9df03916ff7e761b79e1feeec5f \ + 034ef44a3d9e776f8762e617a3eff775 \ + 3d131226cd630fef6336573ce993201e \ + eb3ce72fc6042bf2ab606ef88bc4e96d \ + e7ddc209eea405ae99b2635bb8dfac2c \ + 3ea8f65d5870f4441f4b1cc4d474eb7f \ + 0fb30559341e3dccea222bea2d0b3154 \ + 9d033cc2daa6924420a4a89e6705773f \ + af7c749e99da281486547a7645453b0c \ + 14e4a1211da3352de4c12819d9f6868f \ + 3aeec0abc69e407a94677199cd6a0b4b \ + 7e7b2ff445a36905d01b174e1ab41595 \ + bada89bf3a09a21b2872cc3d66a1204e \ + 046c7f6cbfec17e33a7868d2743f91a6 \ + e6c4f8f86d014406de073e059c557f80 \ + d7242280434f2bd498a585fe937e2284 \ + e08cdbd749dde894cf8ed5fe8cf54ab8 \ + 01cb5402c0fd99cebac702b76f2f2669 \ + 5604a7f31b772bfb8b1d92eb82ce1c73 \ + bc864dd8474a0c6dac7d492b7dec392b \ + 072d3fe97570a02bac3c62844a6ee593 \ + df9819556d2a466ab078ecf3904a24ed \ + 681ab621ae3c59e5f8e9c49ceac6ee5a \ + 0c21c70abe84abccff40fb0770325282 \ + ef6c6bda7a4b8de56b53329783b7976c \ + de04800c89d374b8a843f91d26fa05ad \ + c10e4c4b4b04120097a9bcf65ac4a284 \ + 8d3fbc736a60102fa220dcae70bc6102 \ + 4576769468adf019f6500d3a84b7f68c \ + b390278bbea483da591b1bc026be5fa2 \ + 7293a4349a42c9b7ef8866cca981ed83 \ + 8b65613d99e7251fb8ff5ccafdf70cc3 \ + 689203efc084fc0f1d1f74f5d354ae75 \ + ce2dc8c8b14cc6cc93cf872a0df02aaf \ + b44489eb4799c4fabac3fceb48de54f7 \ + c900e7dbce808ff8ced375077b17a163" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="rust" +MAINTAINER="Andrew Clemons" +EMAIL="andrew.clemons@gmail.com" diff --git a/system/fd/slack-desc b/system/fd/slack-desc new file mode 100644 index 0000000000000..bfe68dee4db9a --- /dev/null +++ b/system/fd/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +fd: fd (a simple, fast and user-friendly alternative to find) +fd: +fd: https://github.com/sharkdp/fd +fd: +fd: +fd: +fd: +fd: +fd: +fd: +fd: |