Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/extra/rust/PKGBUILD
blob: ae5356c6712b445a325805bc9d98b9778879ba1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# enable i686-unknown-linux-gnu target
# and replace pentium4 (SSE2) with pentium3 (no SSE2) in the compiler spec file
#
# Also trying to reduce memory usage by building with
# -debuginfo-level-std=1
# see https://github.com/rust-lang/rust/issues/60294

source+=(config.toml.patch)
b2sums+=('27922f26ca7fadf6b35a9a94f988f7985c752149043424c62d9e5a908dd5779c73f775d04c3ef92a0daabf2f681e5e2ce6c1c173594613b91f6b1b79c7a8f16c')

eval "$(
  declare -f prepare | \
    sed '
      $ i patch -p1 -i "$srcdir/config.toml.patch"
    '
)"

# stop insanity of nproc (see FS#62952)
#eval "$(
#  declare -f build | \
#    sed '
#      s/-j "$(nproc)"/-j1/
#    '
#)"

if [ "${CARCH}" != 'pentium4' ]; then
  eval "$(
    declare -f prepare | \
      sed '
        $ i sed -i "s/pentium4/pentium3/g" "$srcdir/rustc-$pkgver-src/compiler/rustc_target/src/spec/i686_unknown_linux_gnu.rs"
      '
  )"
fi

# 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)
# move rust-musl though, also patch architecture for musl accordingly
eval "$(
  declare -f build | \
    sed '
      /mkdir.*usr\/lib32/d
      /ln.*x86_64.*/d
      /ln.*i686-unknown-linux-gnu.*/d
      /_pick.*dest-i686.*/d
      s/x86_64-unknown-linux-musl/i686-unknown-linux-musl/
    '
)"

eval "$(
  declare -f package_rust | \
    sed '
      /ln /s/x86_64-unknown-linux-gnu/i686-unknown-linux-gnu/g
    '
)"

eval "$(
  declare -f package_rust-musl | \
    sed '
      s/x86_64-unknown-linux-musl/i686-unknown-linux-musl/
    '
)"

# remove 32-bit stuff (shouldn't that be removed automatically?)
pkgname=(
  $(
    printf '%s\n' "${pkgname[@]}" | \
      grep -v '^lib32-rust-libs'
  )
)
makedepends=(${makedepends[@]//lib32-gcc-libs/})

# Enable on demand, if your previous rust is broken use previous version
# from build-support (this is preferable to using rust-bin below, but
# requires all intermediate versions of rust to be built
#makedepends=(${makedepends[@]//rust/})
#makedepends+=('rust162')

# Enable on demand, if your previous rust is broken use previous version
# from build-support
makedepends=(${makedepends[@]//rust/})
makedepends+=('rust168-bin')

# rust 1.63 is built against llvm13.0 anbd OpenSSL 1.1, so force that
# in as a make dependency
#makedepends+=('openssl-1.1')
#makedepends+=('llvm14-libs')