0
0
Fork 0
haikuports/dev-lang/rust_bin/rust_bin-1.27.0.recipe

99 lines
3.2 KiB
Bash

SUMMARY="Modern and safe systems programming language"
DESCRIPTION="Rust is a systems programming language that runs blazingly fast, \
prevents almost all crashes*, and eliminates data races."
HOMEPAGE="https://www.rust-lang.org/"
COPYRIGHT="2018 The Rust Project Developers"
LICENSE="MIT"
REVISION="1"
case "$effectiveTargetArchitecture" in
x86)
SOURCE_URI="http://dl.rust-on-haiku.com/dist/$portVersion/rust-$portVersion-i686-unknown-haiku.tar.xz"
CHECKSUM_SHA256="8b754ce40663987bb9152039d24c472be069bf7f5b7452ed5e89b4677d82ef73"
SOURCE_DIR="rust-$portVersion-i686-unknown-haiku"
;;
x86_64)
SOURCE_URI="http://dl.rust-on-haiku.com/dist/$portVersion/rust-$portVersion-x86_64-unknown-haiku.tar.xz"
CHECKSUM_SHA256="1e360ab4d7a64dc7cf26a8dbb6431de720107395a762915b9011982de9f8d937"
SOURCE_DIR="rust-$portVersion-x86_64-unknown-haiku"
;;
*)
SOURCE_URI="http://dl.rust-on-haiku.com/dist/$portVersion/rustc-$portVersion-src.tar.xz"
CHECKSUM_SHA256="ebbac0c1ddb1f9c0fbeaf7b225bdad8048acc33d84e97a80f597e1a420bcc586"
SOURCE_DIR="rustc-$portVersion-src"
;;
esac
ARCHITECTURES="all !x86_gcc2 ?x86"
SECONDARY_ARCHITECTURES="x86"
DISABLE_SOURCE_PACKAGE=yes
cargoVersion="0.28.0"
rlsVersion="0.127.0"
rustfmtVersion="0.6.1"
PROVIDES="
rust_bin$secondaryArchSuffix = $portVersion
cmd:rustc = $portVersion
cmd:rustdoc = $portVersion
cmd:rust_gdb = $portVersion
cmd:rust_lldb = $portVersion
cmd:cargo$secondaryArchSuffix = $cargoVersion
cmd:cargo_fmt = $cargoVersion
cmd:rls = $rlsVersion
cmd:rustfmt = $rustfmtVersion
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libcrypto$secondaryArchSuffix
lib:libcurl$secondaryArchSuffix
lib:libssl$secondaryArchSuffix
lib:libssh2$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
CONFLICTS="
rust$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
"
INSTALL()
{
./install.sh \
--prefix=$prefix \
--docdir=$developDocDir \
--libdir=$libDir \
--mandir=$manDir \
--sysconfdir=$dataDir \
--disable-ldconfig
# move the cargo and binaries (in case of a secondary arch)
if [ -n "$secondaryArchSuffix" ]; then
mkdir -p $binDir
mv $prefix/bin/cargo $binDir/cargo
fi
# remove zsh data, it is not used on Haiku anyway
rm -rf $prefix/share
# move the `rustlib` folder to the developLibDirs (as it is a framework of sorts)
# do create a link in $prefix/lib as that is where rustc expects things to live
# Note; this actually seems to be a bug in the Rust build system. The path
# to rustlib is hardcoded in the rustc binary, but it does allow it to be
# set to libdir_relative (see config.rs in the bootstrap tool). This variable
# is only set when the configure script is used to generate the config, not
# with config.toml
mkdir -p $developLibDir
mv $libDir/rustlib $developLibDir
ln -r -s $developLibDir/rustlib $prefix/lib/rustlib
# clean out unneccesary files created by the rust installer
rm $developLibDir/rustlib/components
rm $developLibDir/rustlib/install.log
rm $developLibDir/rustlib/manifest-*
rm $developLibDir/rustlib/rust-installer-version
rm $developLibDir/rustlib/uninstall.sh
}