blob: 303eff830c902f57ed097b4e85eb68620c26c01e (
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
|
# Maintainer: Gilbert Gilb's <gilbsgilbert@gmail.com>
pkgname=riscv64-gnu-toolchain-elf-llvm-bin
pkgver=2024.12.16
pkgrel=1
pkgdesc="GNU toolchain for riscv64 ELF, including GCC and clang."
arch=('x86_64')
url="https://github.com/riscv-collab/riscv-gnu-toolchain"
license=('GPL2')
provides=(
'riscv64-gnu-toolchain-elf-bin'
)
conflicts=(
'riscv64-gnu-toolchain-elf-bin'
)
optdepends=()
makedepends=()
options=(!strip)
source=(
"https://github.com/riscv-collab/riscv-gnu-toolchain/releases/download/2024.12.16/riscv64-elf-ubuntu-24.04-llvm-nightly-2024.12.16-nightly.tar.xz"
)
sha512sums=(
"98b418dab50ba6ab21ce27412b0873e9262fcaa81c70985d70658c38a2406902a69474c7f0e5f91141d65a9a793415237f96ad2219238ec6d26ed05a929731cb"
)
package() {
install -dm755 "${pkgdir}"/opt/riscv64-gnu-toolchain-elf-llvm-bin "${pkgdir}"/usr/bin "${pkgdir}"/usr/lib/gcc
cp -pR "${srcdir}"/riscv/* "${pkgdir}"/opt/riscv64-gnu-toolchain-elf-llvm-bin
# Install sysroot
if test -d "${pkgdir}"/opt/riscv64-gnu-toolchain-elf-llvm-bin/sysroot; then
sysroot=/opt/riscv64-gnu-toolchain-elf-llvm-bin/sysroot
else
sysroot=/opt/riscv64-gnu-toolchain-elf-llvm-bin/riscv64-unknown-elf
fi
ln -s "${sysroot}" "${pkgdir}"/usr/riscv64-unknown-elf
# Install cross libgcc
ln -s /opt/riscv64-gnu-toolchain-elf-llvm-bin/lib/gcc/riscv64-unknown-elf "${pkgdir}"/usr/lib/gcc
# Install binaries
for f in "${srcdir}"/riscv/bin/riscv64-unknown-elf-*; do
f="$(basename "${f}")"
ln -s /opt/riscv64-gnu-toolchain-elf-llvm-bin/bin/"${f}" "${pkgdir}"/usr/bin
done
# Also provide target quadruplet to prevent confusing clang
ln -s riscv64-unknown-elf "${pkgdir}"/usr/riscv64-unknown-unknown-elf
ln -s riscv64-unknown-elf "${pkgdir}"/usr/lib/gcc/riscv64-unknown-unknown-elf
find \
"${pkgdir}" \
-name riscv64-unknown-elf \
-type d \
-exec /bin/sh -c 'ln -s riscv64-unknown-elf "$(dirname "$0")"/riscv64-unknown-unknown-elf' {} \;
# Strip
find \
"${pkgdir}"/opt/riscv64-gnu-toolchain-elf-llvm-bin/bin \
"${pkgdir}"/opt/riscv64-gnu-toolchain-elf-llvm-bin/lib \
"${pkgdir}"/opt/riscv64-gnu-toolchain-elf-llvm-bin/libexec \
-type f \
-exec /bin/sh -c 'if file --no-sandbox "$0" | grep -qE "ELF.*(executable|shared object)"; then strip "$0"; fi' {} \;
}
|