summaryrefslogtreecommitdiff
path: root/extra/rust
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2019-10-23 20:45:46 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2019-10-23 20:45:46 +0200
commit90d82c3cd02434e00b76ecf719fdf11b06e7b6be (patch)
tree6e44fa3a5377ede14927655e473e7883d78ee609 /extra/rust
parent4c670fccfd3099fde997d07a2e3d9860dcefb281 (diff)
downloadpackages-90d82c3cd02434e00b76ecf719fdf11b06e7b6be.tar.xz
extra/rust: first try to build 1.38 with 1.38 from bootstrapping repos
Diffstat (limited to 'extra/rust')
-rw-r--r--extra/rust/PKGBUILD35
-rw-r--r--extra/rust/config.toml.patch18
-rwxr-xr-xextra/rust/watcher.sh25
3 files changed, 62 insertions, 16 deletions
diff --git a/extra/rust/PKGBUILD b/extra/rust/PKGBUILD
index 1871ee85..ac7f0b37 100644
--- a/extra/rust/PKGBUILD
+++ b/extra/rust/PKGBUILD
@@ -6,7 +6,7 @@
# see https://github.com/rust-lang/rust/issues/60294
source+=(config.toml.patch)
-sha256sums+=('fcd8125f57295537a4f775c5b1966e548d9ac453fce513061d39957a1d0cfa45')
+sha256sums+=('42e861ba90335d0e2e666e10b12d9ff85ea1bdb711176fb3c09e92375e193660')
eval "$(
declare -f prepare | \
@@ -17,7 +17,7 @@ eval "$(
# stop insanity of nproc (see FS#62952)
eval "$(
- declare -f build | \
+ declare -f package_rust | \
sed '
s/-j"$(nproc)"/-j1/
'
@@ -29,12 +29,33 @@ if [ "${CARCH}" != 'pentium4' ]; then
sed '
$ i sed -i "s/pentium4/pentium3/g" "$srcdir/rustc-$pkgver-src/vendor/rustc-ap-rustc_target/spec/i686_unknown_linux_gnu.rs"
$ i sed -i "s/pentium4/pentium3/g" "$srcdir/rustc-$pkgver-src/src/librustc_target/spec/i686_unknown_linux_gnu.rs"
- $ i sed -i "s/254a116e0cfbce81d1d38ddd59e1086228332746ae8916647b990dd8226079d3/30594a90c83b496630d0b8d80ce2f93671ab6afedadcdc79afd832f4dfe499fd/g" "$srcdir/rustc-$pkgver-src/vendor/rustc-ap-rustc_target/.cargo-checksum.json"
+ $ i sed -i "s/a75a6025d7e3424edf9baf3039056c0f8eea157631a175d00ac5a218aa54b510/484bf8be15015b330fa9a97b6dabb8c7627e59d5cddb2dd0e83478749f8aabad/g" "$srcdir/rustc-$pkgver-src/vendor/rustc-ap-rustc_target/.cargo-checksum.json"
'
)"
fi
-# use binary rust-bin instead of rust (till we can bootstrap rust on IA-32)
-# rust is ok on pentium4 but broken on i686 in bootstrap!
-makedepends=(${makedepends[@]//rust/})
-makedepends+=('rust-bin')
+# Don't move lib32 support into rust32-lib, we are on 32-bit in the end
+# and don't draw a symlink to 64-bit libraries (but to 32-bit instead)
+eval "$(
+ declare -f package_rust | \
+ sed '
+ /mv.*i686-unknown-linux-gnu.*/d
+ /ln /s/x86_64-unknown-linux-gnu/i686-unknown-linux-gnu/g
+ '
+)"
+
+# watch for files changing which need patching during the x.py craziness!
+# currently this is duplicate U1024 and P1024 types (this is currently needed
+# for i686 and 1.38.0)
+source+=('watcher.sh')
+sha256sums+=('a37ef742e079c7f7e80297bdb97115808b48f77fd92571468853de5cbd7ee800')
+
+# Enable on demand, if your previous rust is broken, see also build-support and AUR
+# for rust-bin.
+#makedepends=(${makedepends[@]//rust/})
+#makedepends+=('rust-bin')
+
+# links run away in upstream rust, we take extra and not trunk, is fixed in trunk upstream
+source[2]="http://releases.llvm.org/$_llvm_ver/compiler-rt-$_llvm_ver.src.tar.xz"
+source[3]="http://releases.llvm.org/$_llvm_ver/compiler-rt-$_llvm_ver.src.tar.xz.sig"
+sha256sums[2]="56e4cd96dd1d8c346b07b4d6b255f976570c6f2389697347a6c3dcb9e820d10e"
diff --git a/extra/rust/config.toml.patch b/extra/rust/config.toml.patch
index 6488342b..8d0762cd 100644
--- a/extra/rust/config.toml.patch
+++ b/extra/rust/config.toml.patch
@@ -1,21 +1,21 @@
diff -rauN a/config.toml b/config.toml
---- a/config.toml 2019-09-09 08:53:02.796809788 +0200
-+++ b/config.toml 2019-09-09 08:53:42.249120606 +0200
+--- a/config.toml 2019-10-20 16:44:31.647900892 +0200
++++ b/config.toml 2019-10-20 16:44:39.637875348 +0200
@@ -2,7 +2,7 @@
link-shared = true
[build]
--target = ["x86_64-unknown-linux-gnu"] # defaults to just the build triple
-+target = ["i686-unknown-linux-gnu"] # defaults to just the build triple
+-target = ["x86_64-unknown-linux-gnu", "i686-unknown-linux-gnu"]
++target = ["i686-unknown-linux-gnu"]
cargo = "/usr/bin/cargo"
rustc = "/usr/bin/rustc"
- python = "python"
-@@ -19,11 +19,11 @@
- # https://github.com/rust-lang/rust/issues/47745
- codegen-units = 1
+ python = "/usr/bin/python"
+@@ -21,11 +21,11 @@
+ # https://github.com/rust-lang/rust/issues/54872
+ codegen-units-std = 1
-debuginfo-level = 2
-+debuginfo-level = 1
++debuginfo-level = 0
channel = "stable"
diff --git a/extra/rust/watcher.sh b/extra/rust/watcher.sh
new file mode 100755
index 00000000..544c3712
--- /dev/null
+++ b/extra/rust/watcher.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+term() {
+ echo "--> Got SIGTERM"
+ echo "--> killing inotifywait with PID $inotifywait"
+ kill -TERM "$inotifywait"
+}
+
+srcdir="$1"
+
+trap term SIGTERM
+
+inotifywait -mr -e close_write --format %w%f $srcdir | while read -r FILE; do
+ case "$FILE" in
+ *consts.rs)
+ echo "--> patching $FILE"
+ sed -i '/pub type U1024/d;/pub type P1024/d' $FILE
+ echo "--> finished patching $FILE"
+ ;;
+ esac
+done &
+inotifywait=$(ps -ef | grep inotifywait | grep -v grep | tr -s ' ' | cut -d ' ' -f2)
+echo "--> waiting for inotifywait $inotifywait"
+wait "$inotifywait"
+echo "--> watcher terminated"