summaryrefslogtreecommitdiff
path: root/community/sdcc/PKGBUILD
blob: 5b8a12c0b668eb569ee3f53447f3c719a7e90501 (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
# $Id: PKGBUILD 109379 2014-04-14 09:42:49Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Maintainer: Jose Negron <josenj.arch@mailnull.net>

pkgname=sdcc
pkgver=3.4.0
pkgrel=1
pkgdesc="Retargettable ANSI C compiler (Intel 8051, Maxim 80DS390, Zilog Z80 and the Motorola 68HC08)"
arch=('i686' 'x86_64')
license=('GPL')
depends=('bash' 'gcc-libs' 'boost-libs')
makedepends=('gputils' 'flex' 'bison' 'patch' 'boost')
optdepends=('python')
url="http://sdcc.sourceforge.net/"
options=(!strip  staticlibs)
source=(http://downloads.sourceforge.net/sourceforge/sdcc/$pkgname-src-$pkgver.tar.bz2)
md5sums=('92db2ea2526f6cef412547bb1e759a48')

prepare() {
  cd $srcdir/$pkgname-$pkgver
  sed -i 's|CC -E|CC -O2 -E|g' support/sdbinutils/libiberty/configure
}

build() {
  cd $srcdir/$pkgname-$pkgver
  ./configure \
	--prefix=/usr \
	--includedir=/usr/include/sdcc \
	--libdir=/usr/lib/sdcc
  make
}

package() {
  cd $srcdir/$pkgname-$pkgver

  make install DESTDIR=$pkgdir

  if [ -d $pkgdir/usr/lib/lib ]; then
    mv $pkgdir/usr/lib/lib/* $pkgdir/usr/lib/sdcc/
    rm -rf $pkgdir/usr/lib/lib
  fi

  sed -i 's|#!/usr/bin/env python|#!/usr/bin/env python3|' $pkgdir/usr/bin/as2gbmap
}