aboutsummaryrefslogtreecommitdiff
path: root/system/vtcol/vtcol.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'system/vtcol/vtcol.SlackBuild')
-rw-r--r--system/vtcol/vtcol.SlackBuild43
1 files changed, 32 insertions, 11 deletions
diff --git a/system/vtcol/vtcol.SlackBuild b/system/vtcol/vtcol.SlackBuild
index 60c3f1532177b..fa1ba66b20186 100644
--- a/system/vtcol/vtcol.SlackBuild
+++ b/system/vtcol/vtcol.SlackBuild
@@ -24,7 +24,9 @@
PRGNAM=vtcol
GITREV=${GITREV:-3592d70fd18686ca984db32204e6dcccd05731eb}
-VERSION=${VERSION:-git3592d70}
+VERSION=${VERSION:-git$(echo "$GITREV" | sed 's/^\(.\{7\}\).*$/\1/')}
+VERSION_GETOPTS=${VERSION_GETOPTS:-0.2.14}
+VERSION_LIBC=${VERSION_LIBC:-0.2.19}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
@@ -41,16 +43,6 @@ TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
-if [ "$ARCH" = "i586" ]; then
- LIBDIRSUFFIX=""
-elif [ "$ARCH" = "i686" ]; then
- LIBDIRSUFFIX=""
-elif [ "$ARCH" = "x86_64" ]; then
- LIBDIRSUFFIX="64"
-else
- LIBDIRSUFFIX=""
-fi
-
set -e
rm -rf $PKG
@@ -68,6 +60,35 @@ find -L . \
zcat $CWD/0001-Fix-building-against-current-rust-versions.patch.gz | patch -p1
+# build offline
+# configuration tells cargo to use the configured directory
+# for dependencies intead of downloading from crates.io
+mkdir .cargo
+cat << EOF >> .cargo/config
+[source.crates-io]
+registry = 'https://github.com/rust-lang/crates.io-index'
+replace-with = 'vendored-sources'
+
+[source.vendored-sources]
+directory = '$(pwd)/vendor'
+EOF
+
+mkdir vendor
+(
+ cd vendor
+ tar -xf $CWD/getopts-$VERSION_GETOPTS.crate
+ tar -xf $CWD/libc-$VERSION_LIBC.crate
+
+ mv getopts-$VERSION_GETOPTS getopts
+ mv libc-$VERSION_LIBC libc
+
+ touch getopts/.cargo-ok
+ touch libc/.cargo-ok
+
+ zcat $CWD/getopts-cargo-checksum.json.gz > getopts/.cargo-checksum.json
+ zcat $CWD/libc-cargo-checksum.json.gz > libc/.cargo-checksum.json
+)
+
cargo build --release
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \