summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: dc2b422a9c4b1aa0b75c5ef9decf6919541de06e (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
# Maintainer: Felix Singer <felixsinger@posteo.net>

# _target="i386 x64 arm aarch64 riscv ppc64 nds32le"
_targets="i386"
_commit='f4c97ea131944c7be940b35361407e4b63a14faf'

pkgbase='coreboot-toolchain'
pkgname=()
pkgver=4.18
pkgrel=1
pkgdesc='coreboot toolchain for target architecture '
url='https://www.coreboot.org'
license=(BSD2 BSD3 GPL2 LGPL2Plus GPL3Plus)
arch=(x86_64 aarch64 riscv)
depends=() # TODO
provides=()
makedepends=() # TODO
options=('buildflags')
source=("git+https://review.coreboot.org/coreboot#commit=${_commit}")
sha256sums=('SKIP')


for target_arch in ${_targets}; do
  pkgname+=("${target_arch}")
  provides+=("${pkgbase}-${target_arch}")
done


build() {
  cd coreboot
  #export CFLAGS="$CFLAGS -Wno-error -Wno-format-security -Wno-error=format-security"
  #export CXXFLAGS="$CXXFLAGS -Wno-error -Wno-format-security -Wno-error=format-security"
  export CFLAGS=${CFLAGS/-Werror=format-security/}
  export CXXFLAGS=${CXXFLAGS/-Werror=format-security/}

  for target_arch in ${_targets}; do
    make crossgcc-${target_arch} CPUS=$(nproc) DEST="${srcdir}/${target_arch}"
  done
}

do_package() {
  target_arch="${pkgname}"
  pkgname="${pkgbase}-${target_arch}"
  pkgdesc+="${target_arch}"
  
  toolchain_dir="usr/${target_arch}-coreboot-gnu"
  dest_path="${pkgdir}/${toolchain_dir}"
  mkdir -p ${dest_path}
  mv ${srcdir}/${target_arch}/* "${dest_path}"
}

package_i386() {
  do_package
}

package_x64() {
  do_package
}

package_arm() {
  do_package
}

package_aarch64() {
  do_package
}

package_riscv() {
  do_package
}

package_ppc64() {
  do_package
}

package_nds32le() {
  do_package
}