# Maintainer: PktSurf app=rust version=1.90.0 build=1sml homepage="https://rust-lang.org" download="https://static.rust-lang.org/dist/rustc-$version-src.tar.xz" desc="A safe, concurrent, practical language" requires="gcc-libs bash llvm clang gdb" # We don't want .rlib files to be removed preservestaticlibs=1 prepbuilddir() { arch="$HOSTTYPE" export arch mkandenterbuilddir rm -rf rustc-$version-src tar xf $srcdir/rustc-$version-src.tar.?z* cd rustc-$version-src fixbuilddirpermissions # If a rust toolchain does not already exist, extract and install one of the provided ready-to-use toolchains if [ ! -x /usr/bin/rustc ] ; then # Create a temporary directory that will house a prebuilt architecture-specific rust toolchain provided by rust developers for bootstrapping mkdir -p temp-toolchain cd temp-toolchain # Extract the toolchain into it tar xf $srcdir/$app-$version-$arch-unknown-linux-musl.tar.?z cd $app-$version-$arch-unknown-linux-musl # Now install the toolchain ./install.sh --prefix=/usr || true # Go back to the temporary build directory cd ../../ fi applypatch $srcdir/do-not-install-libunwind-source.patch applypatch $srcdir/gcc-eh-libunwind.patch applypatch $srcdir/need-ssp_nonshared.patch applypatch $srcdir/no-export-ld-library-path.patch cp $srcdir/config.toml . } build() { export RUST_BACKTRACE=1 export RUSTC_WRAPPER="/bin/sccache" export OPENSSL_NO_VENDOR=1 export JOBS="${MAKEFLAGS/-j/}" python3 ./x.py dist -v --jobs $JOBS DESTDIR="$pkg" python3 ./x.py install cp LICENSES/* LICENSE-* COPYRIGHT $srcdir/config.toml $pkgdocs/ find $pkg/usr/lib -name "*.so" -exec chmod 755 "{}" \+ if [[ -x /usr/bin/rustc ]] && [[ -d temp-toolchain ]]; then # Remove the temporary toolchain cd temp-toolchain/$app-$version-$arch-unknown-linux-musl ./install.sh --uninstall --prefix=/usr fi mkfinalpkg } sha512sums=" fffdfd588b20aa518f361f6e4f6c32844d377356d520f8bd1b9f8a7e062be5c2db5e736a2b93619b2d0f182f49eeeaa22075e4692c7683c0ecb4a231522d4cbd rust-1.90.0-x86_64-unknown-linux-musl.tar.xz fb0798b4c7450754db2fcbb641202909d209c6db2d9181d7df7282217b8320dc52f5e9853de9d7bdb79177f1f920389450cab07674dea5fb5501eaab5816662a rustc-1.90.0-src.tar.xz 0d9e5ee4ebf647d3c44dc59b8991d330f2eb0cfa788768c5c9c5f5b57327c3a46b26e93641753a32335d0e3e76a0ab95bb6ad8279913b0c76c752624b139c5c1 do-not-install-libunwind-source.patch ed434a60a1d1e4c73718d44f81b871da7daaeef484a23061bb3f5d1d302cb9aaf641451584b8b24b71e7b379c332880ee646b53b5ac74d20df2d2c214144ce92 gcc-eh-libunwind.patch ed79be7188505f6706d868ae9dfbf97b61d9fd014a97db1664a85dc4538684bdfe252060d4b71d834fc43672b4f1e0d6406a121a40df8425ac7e074d32bd62ca need-ssp_nonshared.patch 946cf1978a7dd225ad0468d96912c5e585ae6cb7bcc2fb2ee228965517d6581afc303dafce80c06a62250823f37fd5c8d2dbc5927bfac650a4da16bf90415dc2 no-export-ld-library-path.patch "