diff options
| author | zorz <zorz@opentux.org> | 2026-03-30 15:14:49 +0300 |
|---|---|---|
| committer | zorz <zorz@opentux.org> | 2026-03-30 15:14:49 +0300 |
| commit | fee55ccfd2f733c1c53615d16a389489970825fd (patch) | |
| tree | c7eefd85e225cac084818860b0c7a7ce796b54cd /rust/MAKEPKG | |
| parent | c1acac9dda5766718fefe4c9f0271eae9926ff22 (diff) | |
| download | bootstrap-fee55ccfd2f733c1c53615d16a389489970825fd.tar.gz bootstrap-fee55ccfd2f733c1c53615d16a389489970825fd.tar.xz | |
.main
Diffstat (limited to 'rust/MAKEPKG')
| -rw-r--r-- | rust/MAKEPKG | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/rust/MAKEPKG b/rust/MAKEPKG new file mode 100644 index 0000000..7fbb403 --- /dev/null +++ b/rust/MAKEPKG | |||
| @@ -0,0 +1,93 @@ | |||
| 1 | #!/bin/mkpkg | ||
| 2 | # description: Rust programming language | ||
| 3 | # url: https://www.rust-lang.org/ | ||
| 4 | |||
| 5 | name=rust | ||
| 6 | version=1.94.1 | ||
| 7 | _bootstrap=1.93.0 | ||
| 8 | _date=2026-01-22 | ||
| 9 | release=1 | ||
| 10 | depends=(llvm) | ||
| 11 | makedeps=(cmake ninja python3 gcc-compat) | ||
| 12 | source=( | ||
| 13 | https://static.rust-lang.org/dist/rustc-$version-src.tar.xz | ||
| 14 | https://static.rust-lang.org/dist/$_date/rust-std-$_bootstrap-x86_64-unknown-linux-musl.tar.xz | ||
| 15 | https://static.rust-lang.org/dist/$_date/rustc-$_bootstrap-x86_64-unknown-linux-musl.tar.xz | ||
| 16 | https://static.rust-lang.org/dist/$_date/cargo-$_bootstrap-x86_64-unknown-linux-musl.tar.xz | ||
| 17 | system.diff | ||
| 18 | musl-no-crt-static.patch | ||
| 19 | ) | ||
| 20 | sha256sums=( | ||
| 21 | "174fce10ce012317ca995810296d8af199318838180b03d68a853e0f02d4b571" | ||
| 22 | "874658d2ced1ed2b9bf66c148b78a2e10cad475d0a4db32e68a08900905b89b8" | ||
| 23 | "24a59e5c6807b07202d4c8021f505d46aa6504897d0c8e7ecba2b5f0f221afd8" | ||
| 24 | "1eee0f6752a31430dc7cf16718de55ef7ad45882cc4c05fa97f1ef280af61135" | ||
| 25 | "fdfd2b449aacd417921359db8bb3eb66944313485c72fde0a942230f2b19f55e" | ||
| 26 | "8b7d3beb08cc22a4477b238eff22d91b249ea4c5344911f6fc3c279342538e35" | ||
| 27 | ) | ||
| 28 | extract() { | ||
| 29 | cp system.diff $SRC/ | ||
| 30 | cp musl-no-crt-static.patch $SRC/ | ||
| 31 | tar -xf $PKGMK_SOURCE_DIR/rustc-$version-src.tar.xz -C $SRC | ||
| 32 | |||
| 33 | mkdir -p $SRC/rustc-$version-src/build/cache/$_date | ||
| 34 | cp rust-std-$_bootstrap-x86_64-unknown-linux-musl.tar.xz $SRC/rustc-$version-src/build/cache/$_date/ | ||
| 35 | cp rustc-$_bootstrap-x86_64-unknown-linux-musl.tar.xz $SRC/rustc-$version-src/build/cache/$_date/ | ||
| 36 | cp cargo-$_bootstrap-x86_64-unknown-linux-musl.tar.xz $SRC/rustc-$version-src/build/cache/$_date/ | ||
| 37 | } | ||
| 38 | build() { | ||
| 39 | cd rustc-$version-src | ||
| 40 | |||
| 41 | # Remove musl self-contained CRT handling and musl-root requirement | ||
| 42 | # (adapted from arachsys: use system CRT objects directly) | ||
| 43 | patch -p1 -i $SRC/system.diff | ||
| 44 | patch -p1 -i $SRC/musl-no-crt-static.patch | ||
| 45 | |||
| 46 | cat > bootstrap.toml <<EOF | ||
| 47 | change-id = 148795 | ||
| 48 | [llvm] | ||
| 49 | link-shared = true | ||
| 50 | use-libcxx = true | ||
| 51 | static-libstdcpp = false | ||
| 52 | [build] | ||
| 53 | build = "x86_64-unknown-linux-musl" | ||
| 54 | host = ["x86_64-unknown-linux-musl"] | ||
| 55 | target = ["x86_64-unknown-linux-musl"] | ||
| 56 | docs = false | ||
| 57 | extended = true | ||
| 58 | tools = ["cargo", "rustfmt", "clippy", "rust-analyzer"] | ||
| 59 | vendor = true | ||
| 60 | [install] | ||
| 61 | prefix = "/usr" | ||
| 62 | [rust] | ||
| 63 | channel = "stable" | ||
| 64 | codegen-units = 1 | ||
| 65 | lto = "thin" | ||
| 66 | llvm-libunwind = "system" | ||
| 67 | [target.x86_64-unknown-linux-musl] | ||
| 68 | llvm-config = "/usr/bin/llvm-config" | ||
| 69 | crt-static = false | ||
| 70 | cc = "clang" | ||
| 71 | cxx = "clang++" | ||
| 72 | ar = "llvm-ar" | ||
| 73 | ranlib = "llvm-ranlib" | ||
| 74 | linker = "clang" | ||
| 75 | rustflags = ["-C", "link-arg=-lunwind"] | ||
| 76 | EOF | ||
| 77 | python3 x.py build | ||
| 78 | DESTDIR=$PKG python3 x.py install | ||
| 79 | |||
| 80 | rm -rf $PKG/usr/share/doc | ||
| 81 | rm -f $PKG/usr/lib/rustlib/install.log | ||
| 82 | rm -f $PKG/usr/lib/rustlib/uninstall.sh | ||
| 83 | rm -f $PKG/usr/lib/rustlib/manifest-* | ||
| 84 | rm -f $PKG/usr/lib/rustlib/components | ||
| 85 | rm -f $PKG/usr/lib/rustlib/rust-installer-version | ||
| 86 | } | ||
| 87 | |||
| 88 | signify() { | ||
| 89 | untrusted comment: public key | ||
| 90 | RWTZ9IduCSQ/mL8337TEUinPwT92xFEUpD92hkS7IxcOnzTt9QdpohT3 | ||
| 91 | } | ||
| 92 | |||
| 93 | # vim: filetype=sh | ||