From 01c59025afdf394f13ddb108da8bd237ec99c7c6 Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Sat, 14 Nov 2015 10:14:45 +0000 Subject: [PATCH] rust: added recipe for version 1.2.0. * based on work of Niels Reedijk. * produces a stable release compiler, which doesn't provide dev features. --- dev-lang/rust/patches/rust-1.2.0.patchset | 20 ++++ dev-lang/rust/rust-1.2.0.recipe | 138 ++++++++++++++++++++++ 2 files changed, 158 insertions(+) create mode 100644 dev-lang/rust/patches/rust-1.2.0.patchset create mode 100644 dev-lang/rust/rust-1.2.0.recipe diff --git a/dev-lang/rust/patches/rust-1.2.0.patchset b/dev-lang/rust/patches/rust-1.2.0.patchset new file mode 100644 index 000000000..3744b6e4a --- /dev/null +++ b/dev-lang/rust/patches/rust-1.2.0.patchset @@ -0,0 +1,20 @@ +From 1a8c2d6b712cd60d195cccf229b59707ccdd0989 Mon Sep 17 00:00:00 2001 +From: Jerome Duval +Date: Fri, 13 Nov 2015 20:34:38 +0000 +Subject: Haiku: add a snapshot for x86_64. + + +diff --git a/src/snapshots.txt b/src/snapshots.txt +index c1c040e..0f57164 100644 +--- a/src/snapshots.txt ++++ b/src/snapshots.txt +@@ -1,3 +1,6 @@ ++S 2015-11-13 c386da0 ++ haiku-x86_64 d09b23db0ef31209a1ebc42e54177449db0985ef ++ + S 2015-08-13 8c5c388 + haiku-i386 716818c2428eeb1ba418b7d6db1b7956bd38cdf8 + +-- +2.2.2 + diff --git a/dev-lang/rust/rust-1.2.0.recipe b/dev-lang/rust/rust-1.2.0.recipe new file mode 100644 index 000000000..a62e7cc68 --- /dev/null +++ b/dev-lang/rust/rust-1.2.0.recipe @@ -0,0 +1,138 @@ +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="http://www.rust-lang.org/" +LICENSE="MIT" +COPYRIGHT="2015, The Rust Project Developers" +srcGitRev="cc3dc6313b9098cc97b0aab889b407ea2ee61674" +srcGitRev2="50aaf12f610fd14c40fe8c17d85e27dacc091e84" +srcGitRev3="70b8783064398a74c64c65e7216000dabb695bf9" +srcGitRev4="7911d8666bab5bb3456f15431450e719ef2cb2c9" +srcGitRev5="238c4d57cce10d33b05cf52a91fc62a09f31ffbb" +SOURCE_URI="https://github.com/nielx/rust/archive/$srcGitRev.tar.gz" +SOURCE_URI_2="https://github.com/nielx/compiler-rt/archive/$srcGitRev2.tar.gz" +SOURCE_URI_3="https://github.com/nielx/llvm/archive/$srcGitRev3.tar.gz" +SOURCE_URI_4="https://github.com/nielx/rust-installer/archive/$srcGitRev4.tar.gz" +SOURCE_URI_5="https://github.com/rust-lang/hoedown/archive/$srcGitRev5.tar.gz" +if [ $effectiveTargetArchitecture = x86_64 ]; then + SOURCE_URI_6="http://rust-on-haiku.com/downloads/33#noarchive" + SOURCE_FILENAME_6="rust-stage0-2015-11-13-c386da0-haiku-x86_64-d09b23db0ef31209a1ebc42e54177449db0985ef.tar.bz2" + CHECKSUM_SHA256_6="6156c67e3b4d61e330290e86ed11f645c266b7e1512737dff1da7cd7ff6dee35" +else + SOURCE_URI_6="http://rust-on-haiku.com/downloads/22#noarchive" + SOURCE_FILENAME_6="rust-stage0-2015-08-13-8c5c388-haiku-i386-716818c2428eeb1ba418b7d6db1b7956bd38cdf8.tar.bz2" + CHECKSUM_SHA256_6="87d3f40436f5e82b095e53b884e34e47567ead5a076a0b49c29f6370d20d3643" +fi +SOURCE_FILENAME="rust-$srcGitRev.tar.gz" +CHECKSUM_SHA256="8b029f873b8a4eed794b3eecb1cd589859eef11e6f0f54f587761390fc648ec0" +CHECKSUM_SHA256_2="adabe5ccb750361199db684ea12c25de32106e477eb186d9645787959cc6b7c2" +CHECKSUM_SHA256_3="f13a30c575be1f4c6ea2787a6435ea20e2a874ed28af8db96ed274ca8bdc0045" +CHECKSUM_SHA256_4="0946d54f64b0dedf43ecafe463bc0370d0e1273621d187b384fc112b6de1304f" +CHECKSUM_SHA256_5="0b48589221adc4748b4a8f79c374006defdaadb1ecc363f395232cfad5b23b5c" +SOURCE_DIR="rust-$srcGitRev" +REVISION="1" +ARCHITECTURES="!x86_gcc2 x86 x86_64" +SECONDARY_ARCHITECTURES="x86" + +PATCHES="rust-$portVersion.patchset" + +PROVIDES=" + rust$secondaryArchSuffix = $portVersion compat >= 1.2 + cmd:rustc = $portVersion + cmd:rustdoc = $portVersion + cmd:rust_gdb = $portVersion + " +REQUIRES=" + haiku$secondaryArchSuffix + rust_runtime$secondaryArchSuffix == $portVersion base + " +PROVIDES_runtime=" + rust_runtime$secondaryArchSuffix = $portVersion + " +REQUIRES_runtime=" + haiku$secondaryArchSuffix + " +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + " +BUILD_PREREQUIRES=" + cmd:find + cmd:gcc$secondaryArchSuffix + cmd:ld$secondaryArchSuffix + cmd:make + cmd:python + cmd:sed + cmd:find + cmd:grep + cmd:file + cmd:git + cmd:tar + cmd:which + " + +BUILD() +{ + rm -rf src/compiler-rt src/llvm src/rust-installer + ln -sf /sources-2/compiler-rt-$srcGitRev2 src/compiler-rt + ln -sf /sources-3/llvm-$srcGitRev3 src/llvm + ln -sf /sources-4/rust-installer-$srcGitRev4 src/rust-installer + ln -sf /sources-5/hoedown-$srcGitRev5 src/rt/hoedown + # 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 --release-channel=stable + + # download the stage 0 compiler, and put it in the proper place + if [ $effectiveTargetArchitecture = x86_64 ]; then + ln -sf /sources-6/rust-stage0-2015-11-13-c386da0-haiku-x86_64-d09b23db0ef31209a1ebc42e54177449db0985ef.tar.bz2 dl/rust-stage0-2015-11-13-c386da0-haiku-x86_64-d09b23db0ef31209a1ebc42e54177449db0985ef.tar.bz2 + else + ln -sf /sources-6/rust-stage0-2015-08-13-8c5c388-haiku-i386-716818c2428eeb1ba418b7d6db1b7956bd38cdf8.tar.bz2 dl/rust-stage0-2015-08-13-8c5c388-haiku-i386-716818c2428eeb1ba418b7d6db1b7956bd38cdf8.tar.bz2 + fi + 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-rustc + rm $developLibDir/rustlib/rust-installer-version + rm $developLibDir/rustlib/uninstall.sh + + # set up the runtime package + packageEntries runtime \ + $libDir/libarena-*.so \ + $libDir/libflate-*.so \ + $libDir/libgetopts-*.so \ + $libDir/libgraphviz-*.so \ + $libDir/liblog-*.so \ + $libDir/libstd-*.so \ + $libDir/libterm-*.so \ + $libDir/libtest-*.so +} + +TEST() +{ + make check +}