Skip to content

Commit 0a5587f

Browse files
committed
Rust 1.82.0
1 parent fe20557 commit 0a5587f

File tree

5 files changed

+115
-1
lines changed

5 files changed

+115
-1
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
1-
# solaris-rust
1+
This project builds latest stable Rust version for Solaris 11.4 CBE release (currently 11.4.42).
2+
3+
Note that to build Rust version X you need to have version X or X-1 versoin.
4+
5+
Usage example:
6+
7+
RUST_BOOTSTRAP=~/rustc-1.81.0/bin ./build.sh
8+
9+
Ultimately Rust should install in standard manner (rustup). But we are not there yet..

build.sh

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#!/bin/bash
2+
#
3+
# Build script for Rust on Solaris.
4+
#
5+
set -xe
6+
7+
VERSION=1.82.0
8+
9+
PATH=$RUST_BOOTSTRAP:/usr/gnu/bin:/usr/bin
10+
11+
CONFIGURE_OPTIONS+=" --default-linker=gcc"
12+
CONFIGURE_OPTIONS+=" --enable-local-rust"
13+
CONFIGURE_OPTIONS+=" --release-channel=stable"
14+
15+
WS="`pwd`"
16+
BUILD_DIR="$WS/build_dir"
17+
18+
SRC_DIR=rustc-${VERSION}-src
19+
SRC_ARCHIVE=${SRC_DIR}.tar.xz
20+
21+
BUILD_HOME="$BUILD_DIR"/rustc-${VERSION}-home
22+
PROTO_DIR="$BUILD_DIR"/rustc-${VERSION}-proto
23+
24+
GCC=/usr/gcc/11/bin/gcc
25+
GXX=/usr/gcc/11/bin/g++
26+
27+
mkdir -p "$BUILD_DIR"
28+
29+
# Clean build directory
30+
( cd "$BUILD_DIR"; rm -rf $SRC_DIR $SRC_ARCHIVE $BUILD_HOME $PROTO_DIR )
31+
32+
mkdir -p $BUILD_HOME $PROTO_DIR
33+
34+
# Download source archive
35+
( cd "$BUILD_DIR"; wget -q https://static.rust-lang.org/dist/${SRC_ARCHIVE} )
36+
37+
# Unpack source archive
38+
( cd "$BUILD_DIR" ; gtar xf ${SRC_ARCHIVE} )
39+
40+
# Patch sources
41+
( cd "$BUILD_DIR"/${SRC_DIR};
42+
cat "$WS/patches-$VERSION/series" | while read patch args; do
43+
echo $patch | grep ^\# > /dev/null && continue
44+
gpatch --batch --forward --strip=1 $args -i "$WS/patches-$VERSION/$patch"
45+
done )
46+
47+
# Force cargo to use vendored sources
48+
( cd "$BUILD_HOME"
49+
mkdir -p .cargo
50+
echo "[source.crates-io]" > .cargo/config.toml
51+
echo "replace-with = \"vendored-sources\"" >> .cargo/config.toml
52+
echo "[source.vendored-sources]" >> .cargo/config.toml
53+
echo "directory = \""$BUILD_DIR"/${SRC_DIR}/vendor\"" >> .cargo/config.toml )
54+
55+
cd "$BUILD_DIR"/$SRC_DIR
56+
57+
# Configuration
58+
PATH="$PATH" CC=$GCC CXX=$GXX bash ./configure ${CONFIGURE_OPTIONS}
59+
60+
# Build Rust
61+
PATH=$PATH PKG_CONFIG_PATH=/usr/lib/64/pkgconfig HOME=$BUILD_HOME gmake install DESTDIR=$PROTO_DIR
62+
63+
# Create Rust distribution archive
64+
( cd $PROTO_DIR/usr && mv local rustc-${VERSION} && gtar cfJ $BUILD_DIR/rust-${VERSION}-Solaris-11.4.42-CBE-`mach`.tar.xz rustc-${VERSION} )

patches-1.81.0/cargo-install.patch

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Build and install also Cargo.
2+
3+
Part of Solaris distribution configuration.
4+
5+
--- a/config.example.toml
6+
+++ b/config.example.toml
7+
@@ -299,7 +299,7 @@
8+
# which tools should be built if `extended = true`.
9+
#
10+
# This is disabled by default.
11+
-#extended = false
12+
+extended = true
13+
14+
# Set of tools to be included in the installation.
15+
#
16+
@@ -319,6 +319,7 @@
17+
# "src",
18+
# "rust-demangler", # if profiler = true
19+
#]
20+
+tools = ["cargo", "rustfmt"]
21+
22+
# Verbosity level: 0 == not verbose, 1 == verbose, 2 == very verbose, 3 == print environment variables on each rustc invocation
23+
#verbose = 0

patches-1.81.0/onig_sys.patch

Lines changed: 17 additions & 0 deletions
Large diffs are not rendered by default.

patches-1.81.0/series

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
cargo-install.patch
2+
onig_sys.patch

0 commit comments

Comments
 (0)