From b3cd655913e5af31258136f0613eec96b3f3f06d Mon Sep 17 00:00:00 2001 From: EnumDev Date: Mon, 9 Sep 2024 11:28:28 +0000 Subject: [PATCH] Initial Commit --- pkg.info | 8 ++++++++ source-files/config.toml | 28 ++++++++++++++++++++++++++++ source.sh | 26 ++++++++++++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 pkg.info create mode 100644 source-files/config.toml create mode 100644 source.sh diff --git a/pkg.info b/pkg.info new file mode 100644 index 0000000..34bf114 --- /dev/null +++ b/pkg.info @@ -0,0 +1,8 @@ +name: rustc +description: The rust programming language compiler +version: 1.76.0 +url: https://www.rust-lang.org/ +license: Apache-2.0 or MIT +architecture: any +depends: ["cmake","curl","llvm"] +type: source diff --git a/source-files/config.toml b/source-files/config.toml new file mode 100644 index 0000000..6a0a136 --- /dev/null +++ b/source-files/config.toml @@ -0,0 +1,28 @@ +change-id = 118703 + +[llvm] +targets = "X86" +link-shared = true + +[build] +docs = false +extended = true +locked-deps = true +tools = ["cargo", "clippy", "rustdoc", "rustfmt"] +vendor = true + +[install] +prefix = "/usr" +docdir = "share/doc/rustc" + +[rust] +channel = "stable" +description = "for Tide Linux" +lto = "thin" +codegen-units = 1 + +[target.x86_64-unknown-linux-gnu] +llvm-config = "/usr/bin/llvm-config" + +[target.i686-unknown-linux-gnu] +llvm-config = "/usr/bin/llvm-config" diff --git a/source.sh b/source.sh new file mode 100644 index 0000000..2d637e9 --- /dev/null +++ b/source.sh @@ -0,0 +1,26 @@ +# This is the source.sh script. It is executed by BPM in a temporary directory when compiling a source package +# BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE +# BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT + +DOWNLOAD="https://static.rust-lang.org/dist/rustc-${BPM_PKG_VERSION}-src.tar.xz" +FILENAME="${DOWNLOAD##*/}" + +# The prepare function is executed in the root of the temp directory +# This function is used for downloading files and putting them into the correct location +prepare() { + wget "$DOWNLOAD" + tar -xvf "$FILENAME" --strip-components=1 -C "$BPM_SOURCE" + cp config.toml "$BPM_SOURCE" +} + +# The build function is executed in the source directory +# This function is used to compile the source code +build() { + python3 x.py build +} + +# The package function is executed in the source directory +# This function is used to move the compiled files into the output directory +package() { + DESTDIR="$BPM_OUTPUT" python3 x.py install +}