summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 96e8669445d3162474d5f76447c16a4e1e6c7c34 (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
# Maintainer: Beini <bane at iki dot fi>
pkgname=arm-compiler-rt-git
pkgver=r20.0fcfe9a
pkgrel=1
pkgdesc="Compiler-rt builtins for bare metal ARM targets"
arch=('i686' 'x86_64')
url="https://github.com/ReservedField/arm-compiler-rt"
license=('custom:University of Illinois/NCSA Open Source License')
makedepends=('git'
             'arm-none-eabi-binutils'
             'arm-none-eabi-gcc'
             'arm-none-eabi-newlib')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
options=(!strip)
source=('git://github.com/ReservedField/arm-compiler-rt.git'
        'git://github.com/llvm-mirror/compiler-rt.git#branch=release_39')
md5sums=('SKIP' 'SKIP')

pkgver() {
  cd "$srcdir/${pkgname%-git}"

  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  cd "$srcdir/${pkgname%-git}"

  git submodule init
  git config submodule.compiler-rt.url $srcdir/compiler-rt
  git submodule update
}

build() {
  cd "$srcdir/${pkgname%-git}"
  CC=arm-none-eabi-gcc make
}

package() {
  cd "$srcdir/${pkgname%-git}"

  install -d "$pkgdir/usr/arm-none-eabi/"
  cp -a "lib" "$pkgdir/usr/arm-none-eabi/"

  install -Dm644 "$srcdir/compiler-rt/LICENSE.TXT" \
    "$pkgdir/usr/share/licenses/${pkgname}/LICENSE"
}