Skip to content

Commit c9f785e

Browse files
authored
Merge pull request #294 from citrus-it/rustfd
Add rust 'fd' and 'bat' utilities.
2 parents 440f0ae + 89c43a3 commit c9f785e

File tree

10 files changed

+187
-1
lines changed

10 files changed

+187
-1
lines changed

build/bat/build.sh

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#!/usr/bin/bash
2+
#
3+
# {{{ CDDL HEADER
4+
#
5+
# This file and its contents are supplied under the terms of the
6+
# Common Development and Distribution License ("CDDL"), version 1.0.
7+
# You may only use this file in accordance with the terms of version
8+
# 1.0 of the CDDL.
9+
#
10+
# A full copy of the text of the CDDL should have accompanied this
11+
# source. A copy of the CDDL is also available via the Internet at
12+
# http://www.illumos.org/license/CDDL.
13+
# }}}
14+
15+
# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
16+
17+
. ../../lib/functions.sh
18+
19+
PROG=bat
20+
VER=0.10.0
21+
PKG=ooce/util/bat
22+
SUMMARY="cat alternative"
23+
DESC="A cat(1) clone with wings"
24+
25+
if [ $RELVER -lt 151028 ]; then
26+
logmsg "--- $PKG is not built for r$RELVER"
27+
exit 0
28+
fi
29+
30+
BUILD_DEPENDS_IPS=ooce/developer/[email protected]
31+
32+
set_arch 64
33+
34+
build() {
35+
logmsg "Building 64-bit"
36+
pushd $TMPDIR/$BUILDDIR >/dev/null
37+
logcmd cargo update -p libc
38+
args="--release"
39+
logcmd cargo build $args || logerr "build failed"
40+
popd >/dev/null
41+
}
42+
43+
install() {
44+
logmsg "Installing"
45+
pushd $TMPDIR/$BUILDDIR >/dev/null
46+
47+
logcmd mkdir -p $DESTDIR/$PREFIX/bin
48+
logcmd cp target/release/bat $DESTDIR/$PREFIX/bin/bat || logerr "cp failed"
49+
50+
logcmd mkdir -p $DESTDIR/$PREFIX/share/man/man1
51+
logcmd cp doc/bat.1 $DESTDIR/$PREFIX/share/man/man1/ || logerr "cp failed"
52+
53+
popd >/dev/null
54+
}
55+
56+
init
57+
download_source $PROG v$VER ""
58+
patch_source
59+
prep_build
60+
build
61+
install
62+
make_package
63+
clean_up
64+
65+
# Vim hints
66+
# vim:ts=4:sw=4:et:fdm=marker

build/bat/local.mog

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# {{{ CDDL HEADER
2+
#
3+
# This file and its contents are supplied under the terms of the
4+
# Common Development and Distribution License ("CDDL"), version 1.0.
5+
# You may only use this file in accordance with the terms of version
6+
# 1.0 of the CDDL.
7+
#
8+
# A full copy of the text of the CDDL should have accompanied this
9+
# source. A copy of the CDDL is also available via the Internet at
10+
# http://www.illumos.org/license/CDDL.
11+
# }}}
12+
13+
# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
14+
15+
license LICENSE-MIT license=MIT
16+

build/bat/patches/Cargo.toml.patch

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
--- a/Cargo.toml~ 2019-04-12 08:07:55.123222742 +0000
2+
+++ a/Cargo.toml 2019-04-12 08:08:12.759243154 +0000
3+
@@ -53,3 +53,6 @@
4+
5+
[build-dependencies]
6+
clap = "2.32"
7+
+
8+
+[patch.crates-io]
9+
+termios = { git = "https://github.com/papertigers/termios-rs", branch = "mz-illumos" }

build/bat/patches/series

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Cargo.toml.patch

build/fd/build.sh

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#!/usr/bin/bash
2+
#
3+
# {{{ CDDL HEADER
4+
#
5+
# This file and its contents are supplied under the terms of the
6+
# Common Development and Distribution License ("CDDL"), version 1.0.
7+
# You may only use this file in accordance with the terms of version
8+
# 1.0 of the CDDL.
9+
#
10+
# A full copy of the text of the CDDL should have accompanied this
11+
# source. A copy of the CDDL is also available via the Internet at
12+
# http://www.illumos.org/license/CDDL.
13+
# }}}
14+
15+
# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
16+
17+
. ../../lib/functions.sh
18+
19+
PROG=fd
20+
VER=7.3.0
21+
PKG=ooce/util/fd
22+
SUMMARY="find utility"
23+
DESC="fd is a simple, fast and user-friendly alternative to find"
24+
25+
if [ $RELVER -lt 151028 ]; then
26+
logmsg "--- $PKG is not built for r$RELVER"
27+
exit 0
28+
fi
29+
30+
BUILD_DEPENDS_IPS=ooce/developer/[email protected]
31+
32+
set_arch 64
33+
34+
build() {
35+
logmsg "Building 64-bit"
36+
pushd $TMPDIR/$BUILDDIR >/dev/null
37+
args="--release"
38+
logcmd cargo build $args || logerr "build failed"
39+
popd >/dev/null
40+
}
41+
42+
install() {
43+
logmsg "Installing"
44+
pushd $TMPDIR/$BUILDDIR >/dev/null
45+
46+
logcmd mkdir -p $DESTDIR/$PREFIX/bin
47+
logcmd cp target/release/fd $DESTDIR/$PREFIX/bin/fd || logerr "cp failed"
48+
49+
logcmd mkdir -p $DESTDIR/$PREFIX/share/man/man1
50+
logcmd cp doc/fd.1 $DESTDIR/$PREFIX/share/man/man1/ || logerr "cp failed"
51+
52+
popd >/dev/null
53+
}
54+
55+
init
56+
download_source rust$PROG rust$PROG $VER
57+
patch_source
58+
prep_build
59+
build
60+
install
61+
make_package
62+
clean_up
63+
64+
# Vim hints
65+
# vim:ts=4:sw=4:et:fdm=marker

build/fd/local.mog

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# {{{ CDDL HEADER
2+
#
3+
# This file and its contents are supplied under the terms of the
4+
# Common Development and Distribution License ("CDDL"), version 1.0.
5+
# You may only use this file in accordance with the terms of version
6+
# 1.0 of the CDDL.
7+
#
8+
# A full copy of the text of the CDDL should have accompanied this
9+
# source. A copy of the CDDL is also available via the Internet at
10+
# http://www.illumos.org/license/CDDL.
11+
# }}}
12+
13+
# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
14+
15+
license LICENSE-MIT license=MIT
16+

build/fd/patches/Cargo.toml.patch

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
--- fd-7.3.0/Cargo.toml~ 2019-04-12 07:18:01.887587486 +0000
2+
+++ fd-7.3.0/Cargo.toml 2019-04-12 07:18:30.152119232 +0000
3+
@@ -59,3 +59,7 @@
4+
[profile.release]
5+
lto = true
6+
codegen-units = 1
7+
+
8+
+[patch.crates-io]
9+
+nix = { git = "https://github.com/papertigers/nix", branch = "mz-illumos" }
10+
+ctrlc = { git = "https://github.com/papertigers/rust-ctrlc", branch = "mz-illumos" }

build/fd/patches/series

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Cargo.toml.patch

doc/licences

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ OSCL OPEN SOURCE CODE LICENSE.*\n.*Version 1
1616
#
1717
GCC runtime license GCC RUNTIME LIBRARY EXCEPTION
1818
#
19-
MIT Permission is hereby granted, free of charge(?s:.)*The above copyright notice and this permission notice shall be(?s).*included.*in.all.copies.or.(?-s)substantial portions of the Software.$(?s:.)*THE SOFTWARE IS PROVIDED .AS IS., WITHOUT WARRANTY OF ANY KIND,( EXPRESS( OR)?)?
19+
MIT Permission is hereby granted, free of charge(?s:.)*The above copyright notice and this permission notice(?s).*shall be.*included.*in.all.copies.or.substantial.portions.of.the.Software.(?-s)$(?s:.)*THE SOFTWARE IS PROVIDED .AS IS., WITHOUT WARRANTY OF(?s:.)*ANY KIND,( EXPRESS( OR)?)?
2020
#
2121
# The original 4-clause BSD licence
2222
BSD Redistribution and use in source and binary forms, with or without(?s).*modification,.*are(?-s) permitted provided that the following(?s).*conditions.*are.*met:.*(?-s)[1\*#]\.? Redistributions of source code must retain(?s:.)*[2\*#]\.? Redistributions in binary form must reproduce(?s:.)*[3\*#]\.? All advertising materials mentioning features(?s:.)*[4\*#]\.? Neither the name of the(?s:.)*prior written permission\.\n\n.*THIS SOFTWARE

doc/packages.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,6 @@
6868
| ooce/system/top | 3.7 | https://sourceforge.net/projects/unixtop/files/unixtop/ | [omniosorg](https://github.com/omniosorg)
6969
| ooce/text/asciidoc | 8.6.9 | https://sourceforge.net/projects/asciidoc/files/asciidoc/ | [omniosorg](https://github.com/omniosorg)
7070
| ooce/text/ripgrep | 0.10.0 | https://github.com/BurntSushi/ripgrep/releases | [omniosorg](https://github.com/omniosorg)
71+
| ooce/util/bat | 0.10.0 | https://github.com/sharkdp/bat/releases | [omniosorg](https://github.com/omniosorg)
72+
| ooce/util/fd | 7.3.0 | https://github.com/sharkdp/fd/releases/ | [omniosorg](https://github.com/omniosorg)
7173
| ooce/virtualization/virtualbox | 5.2.26 | https://www.virtualbox.org/wiki/Download_Old_Builds_5_2 | [omniosorg](https://github.com/omniosorg)

0 commit comments

Comments
 (0)