updated on Tue Jan 17 20:03:13 UTC 2012
[aur-mirror.git] / simavr-git / PKGBUILD
blob2acae40198b2a83ff4397ced2d6af73770a04969
1 # Maintainer: Peter Hatina <phatina@gmail.com>
3 pkgname=simavr-git
4 pkgver=20120117
5 pkgrel=1
6 pkgdesc="A new AVR simulator for linux, or any platform that uses avr-gcc"
7 arch=('i686' 'x86_64')
8 url="http://gitorious.org/simavr"
9 license=('GPL3')
10 depends=('gcc-avr' 'binutils-avr')
11 makedepends=('git' 'patch' 'make' 'gcc' 'elfutils' 'avr-libc' 'gcc-avr' 'binutils-avr')
12 source=('makefile.patch' 'avrgpp.patch')
13 md5sums=('5c1bcfa867a90bf03dcae1df4260018a'
14          'cee65ff88740cb75669b83b46a85846e')
15 options=(!strip)
17 _gitroot="git://gitorious.org/simavr/simavr.git"
18 _gitname="simavr"
20 build() {
21   cd "$srcdir"
22   msg "Connecting to GIT server...."
24   if [ -d $_gitname ] ; then
25     cd $_gitname && git pull origin
26     msg "The local files are updated."
27   else
28     git clone $_gitroot $_gitname
29   fi
31   msg "GIT checkout done or server timeout"
32   msg "Starting make..."
34   rm -rf "$srcdir/$_gitname-build"
35   git clone "$srcdir/$_gitname" "$srcdir/$_gitname-build"
36   cd "$srcdir/$_gitname-build"
38   # patching the makefile to find arch's avr root
39   patch -p1 -i $startdir/makefile.patch
40   patch -p1 -i $startdir/avrgpp.patch
41   unset LDFLAGS
42   make
45 package() {
46   # installing simavr binary
47   install -m755 -D $srcdir/$_gitname-build/simavr/run_avr $pkgdir/usr/bin/simavr
48   # installing tests
49   install -m755 -d -D $srcdir/$_gitname-build/tests $pkgdir/usr/share/simavr/tests
50   # install includes
51   install -m755 -d -D $srcdir/$_gitname-build/include $pkgdir/usr/avr/include/simavr
52   cp -a $srcdir/$_gitname-build/include/* $pkgdir/usr/avr/include/simavr
53   # since the package doesn't provide a make install...
54   cp -a $srcdir/$_gitname-build/tests/* $pkgdir/usr/share/simavr/tests
55   # installing examples
56   install -m755 -d -D $srcdir/$_gitname-build/examples $pkgdir/usr/share/simavr/examples
57   # ugly, but works
58   cp -a $srcdir/$_gitname-build/examples/* $pkgdir/usr/share/simavr/examples