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="2c6933acc05c61e041be764cb1331f6281993f3f" SOURCE_URI="https://github.com/rust-lang/rust/archive/$srcGitRev.tar.gz" CHECKSUM_SHA256="b17dce437b064a7c7954e4e40a3f1351d3cc33db8efeedbaeeb39e842b77fc8f" SOURCE_FILENAME="rust-$srcGitRev.tar.gz" SOURCE_DIR="rust-$srcGitRev" srcGitRev_2="ecd2b1f6d689d5afbf5debe8afb3739337323852" SOURCE_URI_2="https://github.com/rust-lang/compiler-rt/archive/$srcGitRev_2.tar.gz" CHECKSUM_SHA256_2="f9814fd94717dec7ec2c09ecc17fe6ef25c8b2e95ad16ced020e864b3ad763f5" 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="ebeab042e6bb14a447627b57ed9a493e2cc0e095" SOURCE_URI_5="https://github.com/rust-lang/libc/archive/$srcGitRev_5.tar.gz" CHECKSUM_SHA256_5="b0896666125315cdcd8cdef98c51529047f59a656de78503fa69782d5376beb7" srcGitRev_6="ac1c94226e9fa17005ce7e2dd52dd6d1875f3137" SOURCE_URI_6="https://github.com/rust-lang/llvm/archive/$srcGitRev_6.tar.gz" CHECKSUM_SHA256_6="57638407e7713018e5cd4c0de29b52e976ddb248db122c13d6ded89f5f3243ce" 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.12.1 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 }