summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--system/vtcol/9dda18921a25f64e0a0da06e3417ce99f8bf9b41.patch24
-rw-r--r--system/vtcol/checksums/getopts-cargo-checksum.json.gzbin649 -> 0 bytes
-rw-r--r--system/vtcol/checksums/libc-cargo-checksum.json.gzbin4465 -> 0 bytes
-rw-r--r--system/vtcol/vtcol-mkvendortarball.sh34
-rw-r--r--system/vtcol/vtcol.SlackBuild77
5 files changed, 79 insertions, 56 deletions
diff --git a/system/vtcol/9dda18921a25f64e0a0da06e3417ce99f8bf9b41.patch b/system/vtcol/9dda18921a25f64e0a0da06e3417ce99f8bf9b41.patch
new file mode 100644
index 0000000000..ef76ea2ef7
--- /dev/null
+++ b/system/vtcol/9dda18921a25f64e0a0da06e3417ce99f8bf9b41.patch
@@ -0,0 +1,24 @@
+From 9dda18921a25f64e0a0da06e3417ce99f8bf9b41 Mon Sep 17 00:00:00 2001
+From: Andrew Clemons <andrew.clemons@gmail.com>
+Date: Wed, 25 Oct 2017 21:35:14 +1300
+Subject: [PATCH] Silence warning for missing path for `vtcol` binary
+
+vtcol.rs should probably be main.rs, but explicitly setting the
+non-standard path also silences the warning. (src/bin would also work)
+---
+ Cargo.lock | 2 +-
+ Cargo.toml | 1 +
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/Cargo.toml b/Cargo.toml
+index 16590af..0833d44 100644
+--- a/Cargo.toml
++++ b/Cargo.toml
+@@ -14,6 +14,7 @@ license = "GPL-3.0"
+
+ [[bin]]
+ name = "vtcol"
++path = "src/vtcol.rs"
+ test = false
+ doc = false
+
diff --git a/system/vtcol/checksums/getopts-cargo-checksum.json.gz b/system/vtcol/checksums/getopts-cargo-checksum.json.gz
deleted file mode 100644
index 44185f3167..0000000000
--- a/system/vtcol/checksums/getopts-cargo-checksum.json.gz
+++ /dev/null
Binary files differ
diff --git a/system/vtcol/checksums/libc-cargo-checksum.json.gz b/system/vtcol/checksums/libc-cargo-checksum.json.gz
deleted file mode 100644
index a2958219a6..0000000000
--- a/system/vtcol/checksums/libc-cargo-checksum.json.gz
+++ /dev/null
Binary files differ
diff --git a/system/vtcol/vtcol-mkvendortarball.sh b/system/vtcol/vtcol-mkvendortarball.sh
deleted file mode 100644
index 50197894f3..0000000000
--- a/system/vtcol/vtcol-mkvendortarball.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/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
diff --git a/system/vtcol/vtcol.SlackBuild b/system/vtcol/vtcol.SlackBuild
index caaa3fed6a..3363476630 100644
--- a/system/vtcol/vtcol.SlackBuild
+++ b/system/vtcol/vtcol.SlackBuild
@@ -24,7 +24,7 @@
PRGNAM=vtcol
VERSION=${VERSION:-0.42.2}
-BUILD=${BUILD:-2}
+BUILD=${BUILD:-3}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
@@ -40,6 +40,24 @@ 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
@@ -55,6 +73,8 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+patch -p1 < $CWD/9dda18921a25f64e0a0da06e3417ce99f8bf9b41.patch
+
# build offline
# configuration tells cargo to use the configured directory
# for dependencies intead of downloading from crates.io
@@ -68,35 +88,48 @@ replace-with = 'vendored-sources'
directory = '$(pwd)/vendor'
EOF
-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
+# deps and versions come from Cargo.lock
+# cargo vender can be used to generate the checksums
+mkdir vendor
+(
+ cd vendor
- for dependency in getopts=0.2.14 \
- libc=0.2.19 ; do
- dep="$(echo "$dependency" | cut -d= -f1)"
- ver="$(echo "$dependency" | cut -d= -f2)"
+ for dependency in getopts=0.2.14 \
+ libc=0.2.19; do
+ dep="$(echo "$dependency" | cut -d= -f1)"
+ ver="$(echo "$dependency" | cut -d= -f2)"
- tar xvf $CWD/$dep-$ver.crate
+ tar xvf $CWD/$dep-$ver.crate
- mv $dep-$ver $dep
+ touch $dep-$ver/.cargo-ok
- touch $dep/.cargo-ok
- zcat $CWD/checksums/$dep-cargo-checksum.json.gz > $dep/.cargo-checksum.json
- done
- )
-fi
+ # 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
+)
-cargo build --release
+CFLAGS="$SLKCFLAGS" \
+CXXFLAGS="$SLKCFLAGS" \
+cargo build --release $CARGOTARGET
mkdir -p $PKG/usr/bin/
-install -m 755 target/release/vtcol $PKG/usr/bin
+find target -name vtcol -exec install -m 755 {} $PKG/usr/bin/vtcol \;
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