summaryrefslogtreecommitdiffstats
path: root/development/racer/racer.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'development/racer/racer.SlackBuild')
-rw-r--r--development/racer/racer.SlackBuild46
1 files changed, 24 insertions, 22 deletions
diff --git a/development/racer/racer.SlackBuild b/development/racer/racer.SlackBuild
index 2c15161b86..f4901fce37 100644
--- a/development/racer/racer.SlackBuild
+++ b/development/racer/racer.SlackBuild
@@ -3,6 +3,7 @@
# Slackware build script for racer
# Copyright 2017-2018,2020-2021 Andrew Clemons, Wellington New Zealand
+# Copyright 2022 Andrew Clemons, Tokyo Japan
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -25,7 +26,7 @@
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=racer
-VERSION=${VERSION:-2.2.0}
+VERSION=${VERSION:-2.2.2}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -44,9 +45,6 @@ if [ -z "$ARCH" ]; then
fi
fi
-# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
-# the name of the created package would be, and then exit. This information
-# could be useful to other scripts.
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
@@ -59,15 +57,15 @@ OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
- CARGOTARGET="--target i586-unknown-linux-gnu"
+ CARGOTARGET="--target $ARCH-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
+ CARGOTARGET="--target $ARCH-unknown-linux-gnu"
+elif [ "$ARCH" = "x86_64" ] || [ "$ARCH" = "aarch64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
- CARGOTARGET="--target x86_64-unknown-linux-gnu"
+ CARGOTARGET="--target $ARCH-unknown-linux-gnu"
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
@@ -80,7 +78,7 @@ rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
-tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
+tar xvf $CWD/$PRGNAM-$VERSION.crate
cd $PRGNAM-$VERSION
# build offline
@@ -133,6 +131,20 @@ mkdir vendor
done
)
+# racer needs a specific nightly version of rust
+tar -xf $CWD/rust-nightly-$ARCH*-unknown-linux-gnu*.tar.gz
+tar -xf $CWD/rustc-dev-nightly-$ARCH*-unknown-linux-gnu*.tar.gz
+(
+ cd rust-nightly-$ARCH*-unknown-linux-gnu*
+ ./install.sh --destdir=../.rust --prefix="" --without=rust-docs --disable-ldconfig
+)
+(
+ cd rustc-dev-nightly-$ARCH*-unknown-linux-gnu*
+ ./install.sh --destdir=../.rust --prefix="" --disable-ldconfig
+)
+rm -rf rust-nightly-$ARCH*-unknown-linux-gnu*
+rm -rf rustc-dev-nightly-$ARCH*-unknown-linux-gnu*
+
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
@@ -140,23 +152,13 @@ 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 {} \;
-(
- mkdir rustup-bin
- cd rustup-bin
- ln -s /usr/bin/rustup rustc
-)
-
-RUST_NIGHTLY=${RUST_NIGHTLY:-nightly-2022-01-14}
-
-if ! rustup toolchain list | grep "$RUST_NIGHTLY" > /dev/null 2>&1 ; then
- rustup toolchain install --component rustc-dev --profile default "$RUST_NIGHTLY"
-fi
-PATH="$(pwd)/rustup-bin:$PATH" \
+PATH="$(pwd)/.rust/bin/:$PATH" \
+LD_LIBRARY_PATH="$(pwd)/.rust/lib:$LD_LIBRARY_PATH" \
CARGO_HOME=.cargo \
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
-rustup run "$RUST_NIGHTLY" cargo build --release $CARGOTARGET
+cargo build --release $CARGOTARGET
mkdir -p $PKG/usr/bin/