mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-22 03:30:05 +02:00
The previous binary build depended on an older libcurl which was built against a binary-incompatible openssl version. It did not run on recent Haiku builds. This build has been tested on recent builds that are close to Haiku R1 beta 2.
102 lines
3.3 KiB
Bash
102 lines
3.3 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="2020 The Rust Project Developers"
|
|
LICENSE="MIT"
|
|
REVISION="2"
|
|
|
|
case "$effectiveTargetArchitecture" in
|
|
x86)
|
|
SOURCE_URI="http://dl.rust-on-haiku.com/dist/$portVersion/rust-$portVersion-i686-unknown-haiku.tar.xz"
|
|
CHECKSUM_SHA256="41ef609e16ea8a237de2a1b6face5d336f20484aba4fb94a386b535c2342fe0c"
|
|
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="224a5073a03f9408aa5f9eb02058252b73d8f4c9c04d18bd17f1480fc9b8a32e"
|
|
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="a4d15e63d2c72599089e3212f5961653f5c2a8fc2de34de31e221273d2c2fe88"
|
|
SOURCE_DIR="rustc-$portVersion-src"
|
|
;;
|
|
esac
|
|
|
|
ARCHITECTURES="!x86_gcc2 ?x86 x86_64"
|
|
SECONDARY_ARCHITECTURES="x86"
|
|
DISABLE_SOURCE_PACKAGE=yes
|
|
|
|
cargoVersion="0.44.0"
|
|
rlsVersion="1.41.0"
|
|
rustfmtVersion="1.4.12"
|
|
clippyVersion="0.0.212"
|
|
miriVersion="0.1.0"
|
|
|
|
PROVIDES="
|
|
rust_bin$secondaryArchSuffix = $portVersion
|
|
cmd:rustc$secondaryArchSuffix = $portVersion
|
|
cmd:rustdoc$secondaryArchSuffix = $portVersion
|
|
cmd:rustfmt$secondaryArchSuffix = $portVersion
|
|
cmd:rust_gdb$secondaryArchSuffix = $portVersion
|
|
cmd:rust_lldb$secondaryArchSuffix = $portVersion
|
|
cmd:cargo$secondaryArchSuffix = $cargoVersion
|
|
cmd:cargo_clippy$secondaryArchSuffix = $clippyVersion
|
|
cmd:cargo_fmt$secondaryArchSuffix = $cargoVersion
|
|
cmd:cargo_miri$secondaryArchSuffix = $miriVersion
|
|
cmd:clippy_driver$secondaryArchSuffix = $clippyVersion
|
|
cmd:miri$secondaryArchSuffix = $miriVersion
|
|
cmd:rls$secondaryArchSuffix = $rlsVersion
|
|
cmd:rustfmt = $rustfmtVersion
|
|
"
|
|
REQUIRES="
|
|
haiku$secondaryArchSuffix
|
|
lib:libcrypto$secondaryArchSuffix
|
|
lib:libcurl$secondaryArchSuffix
|
|
lib:libssl$secondaryArchSuffix
|
|
lib:libz$secondaryArchSuffix
|
|
"
|
|
CONFLICTS="
|
|
rust$secondaryArchSuffix
|
|
"
|
|
|
|
BUILD_REQUIRES="
|
|
haiku${secondaryArchSuffix}_devel
|
|
"
|
|
|
|
relativeInstallDir="develop/tools$secondaryArchSubDir/rust"
|
|
installDir="$prefix/$relativeInstallDir"
|
|
|
|
INSTALL()
|
|
{
|
|
./install.sh \
|
|
--prefix=$installDir \
|
|
--docdir=$developDocDir \
|
|
--mandir=$manDir \
|
|
--sysconfdir=$dataDir \
|
|
--disable-ldconfig
|
|
|
|
# move zsh data to the datadir
|
|
mv $installDir/share/zsh $dataDir
|
|
rm -rf $installDir/share
|
|
|
|
# clean out unneccesary files created by the rust installer
|
|
rm $installDir/lib/rustlib/components
|
|
rm $installDir/lib/rustlib/install.log
|
|
rm $installDir/lib/rustlib/manifest-*
|
|
rm $installDir/lib/rustlib/rust-installer-version
|
|
rm $installDir/lib/rustlib/uninstall.sh
|
|
|
|
# link the binaries in $binDir
|
|
mkdir -p $binDir
|
|
for f in cargo cargo-clippy cargo-fmt clippy-driver rls rust-gdb \
|
|
rust-lldb rustc rustdoc rustfmt miri cargo-miri; do
|
|
symlinkRelative -sfn $installDir/bin/$f $binDir
|
|
done
|
|
|
|
# make sure runtime_loader can find the libraries in the lib dir relative
|
|
# to the binaries
|
|
symlinkRelative -sfn $installDir/lib $installDir/bin/lib
|
|
}
|