diff options
author | Andrew Clemons <andrew.clemons@gmail.com> | 2017-01-19 12:35:03 +0000 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2017-01-21 07:04:32 +0700 |
commit | 6eb36ac506615cd1b5ae8f13cc99b529157f6be5 (patch) | |
tree | 02bd7726174188778198286fa2f5f5b1163eda4c /system/vtcol/vtcol.SlackBuild | |
parent | b5c9a9b72ff9a744a34666406493434eb2f8711d (diff) | |
download | slackbuilds-6eb36ac506615cd1b5ae8f13cc99b529157f6be5.tar.gz |
system/vtcol: Updated to work in offline mode.
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
Diffstat (limited to 'system/vtcol/vtcol.SlackBuild')
-rw-r--r-- | system/vtcol/vtcol.SlackBuild | 43 |
1 files changed, 32 insertions, 11 deletions
diff --git a/system/vtcol/vtcol.SlackBuild b/system/vtcol/vtcol.SlackBuild index 60c3f15321..fa1ba66b20 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 \ |