From 7fef3d6d4c029b970f26677ab67a8f66ad04d9fc Mon Sep 17 00:00:00 2001 From: aliriza Date: Thu, 6 Jul 2023 09:33:05 +0000 Subject: [PATCH] rust init --- dev/lang/rust/config.toml | 55 +++++++++++++++++++++++++++++++++++++++ dev/lang/rust/ympbuild | 35 +++++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 dev/lang/rust/config.toml create mode 100644 dev/lang/rust/ympbuild diff --git a/dev/lang/rust/config.toml b/dev/lang/rust/config.toml new file mode 100644 index 00000000..7ea71d33 --- /dev/null +++ b/dev/lang/rust/config.toml @@ -0,0 +1,55 @@ +# see config.toml.example for more possible options +# See the 8.4 book for an old example using shipped LLVM +# e.g. if not installing clang, or using a version before 13.0 + +# tell x.py to not keep printing an annoying warning +changelog-seen = 2 + +[llvm] +# by default, rust will build for a myriad of architectures +targets = "X86" + +# When using system llvm prefer shared libraries +link-shared = true + +[build] +# omit docs to save time and space (default is to build them) +docs = false + +# install extended tools: cargo, clippy, etc +extended = true + +# Do not query new versions of dependencies online. +locked-deps = true + +# Specify which extended tools (those from the default install). +tools = ["cargo", "clippy", "rustdoc", "rustfmt"] + +# Use the source code shipped in the tarball for the dependencies. +# The combination of this and the "locked-deps" entry avoids downloading +# many crates from Internet, and makes the Rustc build more stable. +vendor = true + +[install] +prefix = "/usr" +docdir = "share/doc/rustc-1.70.0" + +[rust] +channel = "stable" +description = "" + +# BLFS used to not install the FileCheck executable from llvm, +# so disabled codegen tests. The assembly tests rely on FileCheck +# and cannot easily be disabled, so those will anyway fail if +# FileCheck has not been installed. +#codegen-tests = false + +[target.x86_64-unknown-linux-gnu] +# NB the output of llvm-config (i.e. help options) may be +# dumped to the screen when config.toml is parsed. +llvm-config = "/usr/bin/llvm-config" + +[target.i686-unknown-linux-gnu] +# NB the output of llvm-config (i.e. help options) may be +# dumped to the screen when config.toml is parsed. +llvm-config = "/usr/bin/llvm-config" diff --git a/dev/lang/rust/ympbuild b/dev/lang/rust/ympbuild new file mode 100644 index 00000000..eb36cde1 --- /dev/null +++ b/dev/lang/rust/ympbuild @@ -0,0 +1,35 @@ +#!/usr/bin/env bash +name='rust' +release='1' +version='1.70.0' +url='https://www.rust-lang.org' +description='Systems programming language from Mozilla' +email='aliriza.keskin@pardus.org.tr' +maintainer='aliriza' +license=('GPLv3') +source=("https://static.rust-lang.org/dist/rustc-$version-src.tar.gz" + 'config.toml') +depends=(curl gcc libssh llvm) +makedepends=(cmake ninja perl python) +md5sums=('b98fdbee83d080287daf3157628b291f' + 'SKIP') +group=(dev.lang) +uses=() +arch=('x86_64') +# disable strip +dontstrip=1 + +cd rustc-$version-src + +setup () { + install ../config.toml ./config.toml +} + +build () { + python3 ./x.py build -j `nproc` +} + +package () { + python3 ./x.py install -j `nproc` +} +