2021-01-30 21:58:39 +00:00
|
|
|
# Based on Abyss OS phase1/devel/rust APKBUILD:
|
|
|
|
#
|
|
|
|
# Copyright (c) 2019 by the Abyss Authors
|
|
|
|
#
|
|
|
|
# Permission to use, copy, modify, and/or distribute this software for any
|
|
|
|
# purpose with or without fee is hereby granted, provided that the above
|
|
|
|
# copyright notice and this permission notice appear in all copies.
|
|
|
|
#
|
|
|
|
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
|
|
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
|
|
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
|
|
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
|
|
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
|
|
|
|
pkgname=rust
|
2021-04-19 09:12:13 +00:00
|
|
|
pkgver=beta
|
2021-01-30 21:58:39 +00:00
|
|
|
|
|
|
|
_clear_vendor_checksums() {
|
|
|
|
sed -i 's/\("files":{\)[^}]*/\1/' vendor/$1/.cargo-checksum.json
|
|
|
|
}
|
|
|
|
|
2021-09-11 08:24:20 +00:00
|
|
|
# export RUSTROOT="/usr"
|
|
|
|
export RUSTROOT="/usr/src/rust-bootstrap/build/rust-root"
|
2021-07-31 11:32:52 +00:00
|
|
|
|
2021-01-30 21:58:39 +00:00
|
|
|
fetch() {
|
|
|
|
curl "https://static.rust-lang.org/dist/rustc-$pkgver-src.tar.gz" -o $pkgname-$pkgver.tar.xz
|
|
|
|
tar -xf $pkgname-$pkgver.tar.xz
|
|
|
|
|
|
|
|
mv rustc-$pkgver-src $pkgname-$pkgver
|
2021-04-19 09:12:13 +00:00
|
|
|
|
|
|
|
|
2021-01-30 21:58:39 +00:00
|
|
|
cp ../*.patch .
|
|
|
|
cd $pkgname-$pkgver
|
|
|
|
patch -p1 < ../alpine-move-py.patch
|
|
|
|
patch -p1 < ../abyss-install-template-shebang.patch
|
|
|
|
patch -p1 < ../alpine-crt.patch
|
2021-03-13 22:00:56 +00:00
|
|
|
patch -p1 < ../libexec.patch
|
|
|
|
patch -p1 < ../llvm_crt.patch
|
2021-04-30 14:42:21 +00:00
|
|
|
patch -p1 < ../unfreeze.patch
|
2021-07-31 11:32:52 +00:00
|
|
|
patch -p1 < ../libresslssl.patch
|
2021-01-30 21:58:39 +00:00
|
|
|
|
|
|
|
sed -i /LD_LIBRARY_PATH/d src/bootstrap/bootstrap.py
|
|
|
|
_clear_vendor_checksums libc
|
|
|
|
_clear_vendor_checksums openssl-sys
|
|
|
|
_clear_vendor_checksums openssl-src
|
2021-04-19 09:12:13 +00:00
|
|
|
_clear_vendor_checksums openssl
|
2021-04-30 14:42:21 +00:00
|
|
|
|
2021-02-04 12:02:44 +00:00
|
|
|
cd ..
|
2021-01-30 21:58:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
|
|
|
cd $pkgname-$pkgver
|
2021-04-30 14:42:21 +00:00
|
|
|
|
2021-01-30 21:58:39 +00:00
|
|
|
OPENSSL_LIB_DIR=/usr/lib/ ./configure \
|
2021-07-31 11:32:52 +00:00
|
|
|
--build="$TRIPLE" \
|
|
|
|
--host="$TRIPLE" \
|
|
|
|
--target="$TRIPLE" \
|
2021-01-30 21:58:39 +00:00
|
|
|
--prefix="/usr" \
|
2021-07-31 11:32:52 +00:00
|
|
|
--musl-root="/usr" \
|
2021-04-19 09:12:13 +00:00
|
|
|
--release-channel="beta" \
|
2021-01-30 21:58:39 +00:00
|
|
|
--enable-local-rust \
|
2021-07-31 11:32:52 +00:00
|
|
|
--local-rust-root=$RUSTROOT \
|
2021-01-30 21:58:39 +00:00
|
|
|
--disable-docs \
|
|
|
|
--enable-extended \
|
2021-04-19 09:12:13 +00:00
|
|
|
--tools="cargo,rls,rustfmt,src" \
|
2021-01-30 21:58:39 +00:00
|
|
|
--enable-vendor \
|
2021-04-30 14:42:21 +00:00
|
|
|
--disable-locked-deps \
|
2021-01-30 21:58:39 +00:00
|
|
|
--enable-option-checking \
|
|
|
|
--python="python" \
|
2021-04-30 14:42:21 +00:00
|
|
|
--llvm-root="/usr" \
|
2021-07-31 11:32:52 +00:00
|
|
|
--llvm-libunwind="system" \
|
2021-04-30 14:42:21 +00:00
|
|
|
--enable-llvm-link-shared \
|
2021-07-31 11:32:52 +00:00
|
|
|
--set="target.$TRIPLE.llvm-config=/usr/bin/llvm-config" \
|
2021-04-30 14:42:21 +00:00
|
|
|
--set="rust.musl-root=/usr" \
|
2021-07-31 11:32:52 +00:00
|
|
|
--set="target.$TRIPLE.musl-root=/usr" \
|
|
|
|
--set="target.$TRIPLE.crt-static=false" \
|
|
|
|
--set="target.$TRIPLE.cc=cc" \
|
|
|
|
--set="target.$TRIPLE.cxx=c++" \
|
|
|
|
--set="target.$TRIPLE.ar=ar" \
|
|
|
|
--set="target.$TRIPLE.linker=cc" \
|
|
|
|
--set="target.$TRIPLE.crt-static=false" \
|
|
|
|
--set="target.$TRIPLE.cc=cc" \
|
|
|
|
--set="target.$TRIPLE.cxx=c++" \
|
|
|
|
--set="target.$TRIPLE.ar=ar" \
|
|
|
|
--set="target.$TRIPLE.linker=cc"
|
2021-01-30 21:58:39 +00:00
|
|
|
|
|
|
|
sed 's/#deny-warnings = .*/deny-warnings = false/' -i config.toml
|
2021-07-31 11:32:52 +00:00
|
|
|
# sed 's|deny(warnings,|deny(|' -i src/bootstrap/lib.rs
|
2021-01-30 21:58:39 +00:00
|
|
|
|
2021-07-31 11:32:52 +00:00
|
|
|
./x.py build
|
2021-01-30 21:58:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
|
|
|
cd $pkgname-$pkgver
|
|
|
|
DESTDIR="$pkgdir" ./x.py install
|
|
|
|
}
|
|
|
|
|
|
|
|
license() {
|
|
|
|
cd $pkgname-$pkgver
|
2021-02-04 22:30:41 +00:00
|
|
|
cat LICENSE-MIT
|
2021-01-30 21:58:39 +00:00
|
|
|
# cat COPYING
|
|
|
|
}
|