Skip to content

Add rust 'fd' and 'bat' utilities. #294

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions build/bat/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#!/usr/bin/bash
#
# {{{ CDDL HEADER
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
# }}}

# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.

. ../../lib/functions.sh

PROG=bat
VER=0.10.0
PKG=ooce/util/bat
SUMMARY="cat alternative"
DESC="A cat(1) clone with wings"

if [ $RELVER -lt 151028 ]; then
logmsg "--- $PKG is not built for r$RELVER"
exit 0
fi

BUILD_DEPENDS_IPS=ooce/developer/[email protected]

set_arch 64

build() {
logmsg "Building 64-bit"
pushd $TMPDIR/$BUILDDIR >/dev/null
logcmd cargo update -p libc
args="--release"
logcmd cargo build $args || logerr "build failed"
popd >/dev/null
}

install() {
logmsg "Installing"
pushd $TMPDIR/$BUILDDIR >/dev/null

logcmd mkdir -p $DESTDIR/$PREFIX/bin
logcmd cp target/release/bat $DESTDIR/$PREFIX/bin/bat || logerr "cp failed"

logcmd mkdir -p $DESTDIR/$PREFIX/share/man/man1
logcmd cp doc/bat.1 $DESTDIR/$PREFIX/share/man/man1/ || logerr "cp failed"

popd >/dev/null
}

init
download_source $PROG v$VER ""
patch_source
prep_build
build
install
make_package
clean_up

# Vim hints
# vim:ts=4:sw=4:et:fdm=marker
16 changes: 16 additions & 0 deletions build/bat/local.mog
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# {{{ CDDL HEADER
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
# }}}

# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.

license LICENSE-MIT license=MIT

9 changes: 9 additions & 0 deletions build/bat/patches/Cargo.toml.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
--- a/Cargo.toml~ 2019-04-12 08:07:55.123222742 +0000
+++ a/Cargo.toml 2019-04-12 08:08:12.759243154 +0000
@@ -53,3 +53,6 @@

[build-dependencies]
clap = "2.32"
+
+[patch.crates-io]
+termios = { git = "https://github.com/papertigers/termios-rs", branch = "mz-illumos" }
1 change: 1 addition & 0 deletions build/bat/patches/series
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Cargo.toml.patch
65 changes: 65 additions & 0 deletions build/fd/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/usr/bin/bash
#
# {{{ CDDL HEADER
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
# }}}

# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.

. ../../lib/functions.sh

PROG=fd
VER=7.3.0
PKG=ooce/util/fd
SUMMARY="find utility"
DESC="fd is a simple, fast and user-friendly alternative to find"

if [ $RELVER -lt 151028 ]; then
logmsg "--- $PKG is not built for r$RELVER"
exit 0
fi

BUILD_DEPENDS_IPS=ooce/developer/[email protected]

set_arch 64

build() {
logmsg "Building 64-bit"
pushd $TMPDIR/$BUILDDIR >/dev/null
args="--release"
logcmd cargo build $args || logerr "build failed"
popd >/dev/null
}

install() {
logmsg "Installing"
pushd $TMPDIR/$BUILDDIR >/dev/null

logcmd mkdir -p $DESTDIR/$PREFIX/bin
logcmd cp target/release/fd $DESTDIR/$PREFIX/bin/fd || logerr "cp failed"

logcmd mkdir -p $DESTDIR/$PREFIX/share/man/man1
logcmd cp doc/fd.1 $DESTDIR/$PREFIX/share/man/man1/ || logerr "cp failed"

popd >/dev/null
}

init
download_source rust$PROG rust$PROG $VER
patch_source
prep_build
build
install
make_package
clean_up

# Vim hints
# vim:ts=4:sw=4:et:fdm=marker
16 changes: 16 additions & 0 deletions build/fd/local.mog
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# {{{ CDDL HEADER
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
# }}}

# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.

license LICENSE-MIT license=MIT

10 changes: 10 additions & 0 deletions build/fd/patches/Cargo.toml.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- fd-7.3.0/Cargo.toml~ 2019-04-12 07:18:01.887587486 +0000
+++ fd-7.3.0/Cargo.toml 2019-04-12 07:18:30.152119232 +0000
@@ -59,3 +59,7 @@
[profile.release]
lto = true
codegen-units = 1
+
+[patch.crates-io]
+nix = { git = "https://github.com/papertigers/nix", branch = "mz-illumos" }
+ctrlc = { git = "https://github.com/papertigers/rust-ctrlc", branch = "mz-illumos" }
1 change: 1 addition & 0 deletions build/fd/patches/series
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Cargo.toml.patch
2 changes: 1 addition & 1 deletion doc/licences
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ OSCL OPEN SOURCE CODE LICENSE.*\n.*Version 1
#
GCC runtime license GCC RUNTIME LIBRARY EXCEPTION
#
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)?)?
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)?)?
#
# The original 4-clause BSD licence
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
Expand Down
2 changes: 2 additions & 0 deletions doc/packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,6 @@
| ooce/system/top | 3.7 | https://sourceforge.net/projects/unixtop/files/unixtop/ | [omniosorg](https://github.com/omniosorg)
| ooce/text/asciidoc | 8.6.9 | https://sourceforge.net/projects/asciidoc/files/asciidoc/ | [omniosorg](https://github.com/omniosorg)
| ooce/text/ripgrep | 0.10.0 | https://github.com/BurntSushi/ripgrep/releases | [omniosorg](https://github.com/omniosorg)
| ooce/util/bat | 0.10.0 | https://github.com/sharkdp/bat/releases | [omniosorg](https://github.com/omniosorg)
| ooce/util/fd | 7.3.0 | https://github.com/sharkdp/fd/releases/ | [omniosorg](https://github.com/omniosorg)
| ooce/virtualization/virtualbox | 5.2.26 | https://www.virtualbox.org/wiki/Download_Old_Builds_5_2 | [omniosorg](https://github.com/omniosorg)