rust: picked up port

This commit is contained in:
Danny Rawlins 2018-12-26 19:59:18 +11:00
parent df83078326
commit c76a57db62
3 changed files with 3105 additions and 0 deletions

3020
rust/.footprint Normal file

File diff suppressed because it is too large Load Diff

8
rust/.signature Normal file
View File

@ -0,0 +1,8 @@
untrusted comment: verify with /etc/ports/opt.pub
RWSE3ohX2g5d/ScqYoeV58MEef43uC9oatN+/vi8JwWGK8gBxHybQAfDNwQZUD2Q3T+0728pYalbFzkw0JYSdUtRKsw8UPOwWww=
SHA256 (Pkgfile) = 884d5c169217ca2075e415c0585abaadc2e4935b7508fecfdbb77033e8cbe7e0
SHA256 (.footprint) = 62df3071896fe2aca063e5d71769b71e4b110b371fd4154584a632dd84d06eec
SHA256 (rustc-1.29.2-src.tar.gz) = 5088e796aa2e47478cdf41e7243fc5443fafab0a7c70a11423e57c80c04167c9
SHA256 (rust-std-1.28.0-x86_64-unknown-linux-gnu.tar.gz) = c5aed4c7ef362b5754526d26acaccdc9300942fd12e5cc67cc56fc89576a9dab
SHA256 (rustc-1.28.0-x86_64-unknown-linux-gnu.tar.gz) = 008bb3d714544bc991594b29a98a154441914c4771007130361bbadfb54143d0
SHA256 (cargo-0.29.0-x86_64-unknown-linux-gnu.tar.gz) = a5e7749767c47669ed9b6e32c6fb8eda6b0fe1c63ac73a6d4666b5c1352bad24

77
rust/Pkgfile Normal file
View File

@ -0,0 +1,77 @@
# Description: The Rust language with Cargo included.
# URL: http://www.rust-lang.org/
# Maintainer: Danny Rawlins, crux at romster dot me
# Depends on: llvm python3
# Optional: sccache
name=rust
version=1.29.2
##cat src/stage0.txt
_date=2018-08-02
_rustc=1.28.0
_cargo=0.29.0
##
release=1
source=(
https://static.rust-lang.org/dist/${name}c-$version-src.tar.gz
https://static.rust-lang.org/dist/$_date/rust-std-$_rustc-x86_64-unknown-linux-gnu.tar.gz
https://static.rust-lang.org/dist/$_date/rustc-$_rustc-x86_64-unknown-linux-gnu.tar.gz
https://static.rust-lang.org/dist/$_date/cargo-$_cargo-x86_64-unknown-linux-gnu.tar.gz
)
build() {
cd "${name}c-$version-src"
mkdir -p build/cache/$_date
cp $PKGMK_SOURCE_DIR/rust-std-$_rustc-x86_64-unknown-linux-gnu.tar.gz build/cache/$_date/
cp $PKGMK_SOURCE_DIR/rustc-$_rustc-x86_64-unknown-linux-gnu.tar.gz build/cache/$_date/
cp $PKGMK_SOURCE_DIR/cargo-$_cargo-x86_64-unknown-linux-gnu.tar.gz build/cache/$_date/
if [ -n "$(pkginfo -i | grep '^sccache ')" ]; then
export RUSTC_WRAPPER=/usr/bin/sccache
fi
cat <<- EOF > $SRC/config.toml
[llvm]
targets = "X86"
link-shared = true
[install]
prefix = "/usr"
[rust]
channel = "stable"
rpath = false
codegen-tests = false
[target.x86_64-unknown-linux-gnu]
llvm-config = "/usr/bin/llvm-config"
[build]
extended = true
python = "python3"
EOF
if [ -e '/usr/bin/rustc' ]; then
cat <<- EOF >> $SRC/config.toml
cargo = "/usr/bin/cargo"
rustc = "/usr/bin/rustc"
#local-rebuild = true
EOF
fi
cat $SRC/config.toml
export CARGO_HOME="$PKGMK_SOURCE_DIR"
export RUSTFLAGS="$RUSTFLAGS -C link-args=-lffi"
/usr/bin/python3 ./x.py build --config="${SRC}"/config.toml -j ${JOBS-1}
DESTDIR=$PKG /usr/bin/python3 ./x.py --config="${SRC}"/config.toml install
#cleanup
rm -r $PKG/usr/share/doc
rm -r $PKG/usr/share/zsh
rm -r $PKG/etc
rm $PKG/usr/lib/rustlib/{components,manifest-rustc,rust-installer-version,uninstall.sh}
}