system/vtcol: Updated for version 0.42.2.

Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
This commit is contained in:
Andrew Clemons 2017-03-30 13:23:17 +01:00 committed by Willy Sudiarto Raharjo
parent c49fb776fa
commit e099cddbf0
No known key found for this signature in database
GPG key ID: 887B8374D7333381
7 changed files with 74 additions and 23 deletions

View file

@ -4,3 +4,11 @@ Change the colour scheme of the virtual Linux console.
Note:
rust is a dependency at build-time, not a runtime dep.
By default, the slackbuild requires all crate dependencies to be downloaded
individually. Optionally, iff you have cargo-vendor installed, you can create
a "vendored" tarball which contains all the crate dependencies exploded into a
single directory and then compressed together as a tarball.
The script vtcol-mkvendortarball.sh will generate this for you. The slackbuild
will automatically use this tarball if found in the current directory.

View file

@ -2,13 +2,16 @@ vtcol can be used in /etc/rc.d/rc.local to set the colour scheme at boot:
vtcol --scheme solarized_light
It is also possible to add it to your initrd to have the colour scheme set early in the boot process.
It is also possible to add it to your initrd to have the colour scheme set
early in the boot process.
Example:
kernel=4.4.38
mkinitrd -c -k "$kernel" -f ext4 -r /dev/disk/by-uuid/<some uuid> -m ext4:<more modules> -u -o /boot/initrd-"$kernel".gz -s
/tmp/initrd-tree-"$kernel"
mkinitrd -c -k "$kernel" -f ext4 -r /dev/disk/by-uuid/<some uuid> \
-m ext4:<more modules> -u -o /boot/initrd-"$kernel".gz \
-s /tmp/initrd-tree-"$kernel"
install -m 755 /usr/bin/vtcol "/tmp/initrd-tree-$kernel/bin/vtcol"
sed -i '159i \/bin\/vtcol --scheme solarized_light' /tmp/initrd-tree-"$kernel"/init
mkinitrd -k "$kernel" -f ext4 -r /dev/disk/by-uuid/<some uuid> -u -o /boot/initrd-"$kernel".gz -s /tmp/initrd-tree-"$kernel"
mkinitrd -k "$kernel" -f ext4 -r /dev/disk/by-uuid/<some uuid> -u \
-o /boot/initrd-"$kernel".gz -s /tmp/initrd-tree-"$kernel"

View file

@ -0,0 +1,34 @@
#!/bin/sh
# Script to build a vendored tarball for vtcol
# 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.
set -e
PRGNAM=vtcol
VERSION=${VERSION:-0.42.2}
rm -rf "$PRGNAM-$VERSION" "$PRGNAM-$VERSION-vendor.tar.gz"
tar xvf "$PRGNAM-$VERSION.tar.gz"
cd "$PRGNAM-$VERSION"
cargo vendor
tar cvfz ../"$PRGNAM-$VERSION-vendor.tar.gz" vendor

View file

@ -24,9 +24,7 @@
PRGNAM=vtcol
VERSION=${VERSION:-0.42.2}
VERSION_GETOPTS=${VERSION_GETOPTS:-0.2.14}
VERSION_LIBC=${VERSION_LIBC:-0.2.19}
BUILD=${BUILD:-1}
BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
@ -70,31 +68,39 @@ replace-with = 'vendored-sources'
directory = '$(pwd)/vendor'
EOF
mkdir vendor
(
cd vendor
tar -xf $CWD/getopts-$VERSION_GETOPTS.crate
tar -xf $CWD/libc-$VERSION_LIBC.crate
if [ -e $CWD/$PRGNAM-$VERSION-vendor.tar.gz ] ; then
tar xvf $CWD/$PRGNAM-$VERSION-vendor.tar.gz
else
# deps and versions come from Cargo.lock
# cargo vender can be used to generate the checksums
mkdir vendor
(
cd vendor
mv getopts-$VERSION_GETOPTS getopts
mv libc-$VERSION_LIBC libc
for dependency in getopts=0.2.14 \
libc=0.2.19 ; do
dep="$(echo "$dependency" | cut -d= -f1)"
ver="$(echo "$dependency" | cut -d= -f2)"
touch getopts/.cargo-ok
touch libc/.cargo-ok
tar xvf $CWD/$dep-$ver.crate
zcat $CWD/getopts-cargo-checksum.json.gz > getopts/.cargo-checksum.json
zcat $CWD/libc-cargo-checksum.json.gz > libc/.cargo-checksum.json
)
mv $dep-$ver $dep
touch $dep/.cargo-ok
zcat $CWD/checksums/$dep-cargo-checksum.json.gz > $dep/.cargo-checksum.json
done
)
fi
cargo build --release
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/bin/
install -m 755 target/release/vtcol $PKG/usr/bin
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 COPYING doc $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

View file

@ -9,6 +9,6 @@ MD5SUM="80091d0507aff4fe8bfb8d82e70a020c \
604a2edfd52c6e87d8903ef2795da387"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES="rust"
REQUIRES="cargo"
MAINTAINER="Andrew Clemons"
EMAIL="andrew.clemons@gmail.com"