Skip to content

Commit ad5ae92

Browse files
committed
Add rust bat utility.
1 parent a098e4d commit ad5ae92

File tree

4 files changed

+93
-0
lines changed

4 files changed

+93
-0
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 --precise=0.2.44
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: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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,7 @@
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" }
10+
+libc = { git = "https://github.com/papertigers/libc", branch = "mz-illumos-nix" }

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

0 commit comments

Comments
 (0)