mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-12 14:50:08 +02:00
x86_64 is used as a baseline: the "x86_64" entry, whatever status it has, is transformed into "all", and then the other entries in ARCHITECTURES either dropped or rearranged appropriately.
118 lines
4.1 KiB
Bash
118 lines
4.1 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="2016, The Rust Project Developers"
|
|
LICENSE="MIT"
|
|
REVISION="1"
|
|
srcGitRev="1.14.0"
|
|
SOURCE_URI="https://github.com/rust-lang/rust/archive/$srcGitRev.tar.gz"
|
|
CHECKSUM_SHA256="3517ed84d1d407e3ee819298970d153e9922618295716bcc3ecaec35a8716ddf"
|
|
SOURCE_FILENAME="rust-$srcGitRev.tar.gz"
|
|
SOURCE_DIR="rust-$srcGitRev"
|
|
srcGitRev_2="3bc0272cab9fdcfc2ef4df9625ec3c9d5909db79"
|
|
SOURCE_URI_2="https://github.com/rust-lang/compiler-rt/archive/$srcGitRev_2.tar.gz"
|
|
CHECKSUM_SHA256_2="92eecb8920cadb1b87aec923a262bbc5825ec2d7d71a83659a949efc76d5c00d"
|
|
srcGitRev_3="4f994850808a572e2cc8d43f968893c8e942e9bf"
|
|
SOURCE_URI_3="https://github.com/rust-lang/rust-installer/archive/$srcGitRev_3.tar.gz"
|
|
CHECKSUM_SHA256_3="dc7240d60a869fa24a68c8734fb7c810c27cca0a6dad52df6279865e4e8e7fae"
|
|
srcGitRev_4="a3736a0a1907cbc8bf619708738815a5fd789c80"
|
|
SOURCE_URI_4="https://github.com/rust-lang/hoedown/archive/$srcGitRev_4.tar.gz"
|
|
CHECKSUM_SHA256_4="29da85607df523a165c1b01a378f929a0b37b75969119b6ec373d95576978b13"
|
|
srcGitRev_5="7d9b71f0971f8fa196d864d7071f216a59036d6e"
|
|
SOURCE_URI_5="https://github.com/rust-lang/libc/archive/$srcGitRev_5.tar.gz"
|
|
CHECKSUM_SHA256_5="51d3ee20ca090493f900ef8be6b3df930848a35f1a79553c61c4c7431da90e4b"
|
|
srcGitRev_6="c1d962263bf76a10bea0c761621fcd98d6214b2e"
|
|
SOURCE_URI_6="https://github.com/rust-lang/llvm/archive/$srcGitRev_6.tar.gz"
|
|
CHECKSUM_SHA256_6="8f35394fcb4be0cf9cba18288b6ac7d496c7829f5a6ce2212794019805df8030"
|
|
PATCHES="rust-$portVersion.patchset"
|
|
PATCHES_3="rust-installer-$portVersion.patchset"
|
|
|
|
ARCHITECTURES="?all !x86_gcc2"
|
|
SECONDARY_ARCHITECTURES="x86"
|
|
|
|
PROVIDES="
|
|
rust$secondaryArchSuffix = $portVersion
|
|
cmd:rust_gdb = $portVersion
|
|
cmd:rustc = $portVersion
|
|
cmd:rustdoc = $portVersion
|
|
"
|
|
REQUIRES="
|
|
haiku$secondaryArchSuffix
|
|
"
|
|
|
|
BUILD_REQUIRES="
|
|
haiku${secondaryArchSuffix}_devel
|
|
binutils${secondaryArchSuffix} == 2.26.1_2016_07_22 # version 2.28.1 will crash when building llvm
|
|
"
|
|
BUILD_PREREQUIRES="
|
|
cmd:cmake
|
|
cmd:file
|
|
cmd:find
|
|
cmd:find
|
|
cmd:gcc$secondaryArchSuffix
|
|
cmd:git
|
|
cmd:grep
|
|
cmd:ld$secondaryArchSuffix
|
|
cmd:make
|
|
cmd:python
|
|
cmd:rustc == 1.13.0
|
|
cmd:sed
|
|
cmd:tar
|
|
cmd:which
|
|
"
|
|
|
|
BUILD()
|
|
{
|
|
rm -rf src/compiler-rt src/llvm src/rust-installer src/liblibc src/rt/hoedown
|
|
ln -sf /sources-2/compiler-rt-$srcGitRev_2 src/compiler-rt
|
|
ln -sf /sources-3/rust-installer-$srcGitRev_3 src/rust-installer
|
|
ln -sf /sources-4/hoedown-$srcGitRev_4 src/rt/hoedown
|
|
ln -sf /sources-5/libc-$srcGitRev_5 src/liblibc
|
|
ln -sf /sources-6/llvm-$srcGitRev_6 src/llvm
|
|
# Do not use runConfigure: it generates too much noise, and it creates a totally impossible directory structure
|
|
#runConfigure --omit-dirs "docDir libExecDir dataRootDir includeDir sharedStateDir sbinDir binDir oldIncludeDir" ./configure --disable-jemalloc --build=i686-unknown-haiku --host=i686-unknown-haiku --target=i686-unknown-haiku
|
|
|
|
./configure --prefix=$prefix --mandir=$manDir --disable-jemalloc \
|
|
--enable-local-rust --local-rust-root=/boot/system/ \
|
|
--release-channel=stable
|
|
|
|
make
|
|
}
|
|
|
|
INSTALL()
|
|
{
|
|
make install
|
|
|
|
# move documentation to the proper place
|
|
mkdir -p $developDocDir
|
|
mv $prefix/share/doc/rust/* $developDocDir
|
|
rm -rf $prefix/share
|
|
|
|
if [ -n "$secondaryArchSuffix" ]; then
|
|
# move the libs to the x86 subdir
|
|
mkdir -p $libDir
|
|
mv $prefix/lib/*.so $libDir
|
|
fi
|
|
|
|
# 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
|
|
mkdir -p $developLibDir
|
|
mv $prefix/lib/rustlib $developLibDir
|
|
cd $prefix/lib
|
|
ln -s ../$relativeDevelopLibDir/rustlib rustlib
|
|
|
|
# clean out unneccesary files created by the rust installer
|
|
rm $developLibDir/rustlib/components
|
|
rm $developLibDir/rustlib/install.log
|
|
rm $developLibDir/rustlib/manifest-rust-docs
|
|
rm $developLibDir/rustlib/manifest-rust-std-*-haiku
|
|
rm $developLibDir/rustlib/manifest-rustc
|
|
rm $developLibDir/rustlib/rust-installer-version
|
|
rm $developLibDir/rustlib/uninstall.sh
|
|
}
|
|
|
|
TEST()
|
|
{
|
|
make check
|
|
}
|