PKGBUILD 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # Maintainer: Freemor <freemor@freemor.ca>
  2. # Maintainer (arch): Kyle Keen <keenerd@gmail.com>
  3. # Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
  4. # Contributor: Jose Negron <josenj.arch@mailnull.net>
  5. # Rationale for Libre:
  6. # Remove non-free PIC Headers etc.
  7. pkgname=sdcc
  8. pkgver=3.8.0
  9. pkgrel=2
  10. pkgrel+=.parabola1
  11. pkgdesc="Retargettable ANSI C compiler (Intel 8051, Maxim 80DS390, Zilog Z80 and the Motorola 68HC08) without non-free PIC"
  12. arch=('x86_64' 'i686' 'armv7h')
  13. license=('GPL')
  14. depends=('bash' 'gcc-libs' 'boost-libs')
  15. makedepends=('gputils' 'flex' 'bison' 'patch' 'boost')
  16. optdepends=('python')
  17. url="http://sdcc.sourceforge.net/"
  18. options=(!strip staticlibs)
  19. source=(https://downloads.sourceforge.net/sourceforge/sdcc/$pkgname-src-${pkgver//_/-}.tar.bz2)
  20. md5sums=('31d0d3db8a157018e3df530c50a3974e')
  21. # namcap claims boost-libs isn't needed, investigate this
  22. prepare() {
  23. cd "$srcdir/$pkgname-$pkgver"
  24. sed -i 's|CC -E|CC -O2 -E|g' support/sdbinutils/libiberty/configure
  25. }
  26. # Add --disable-pic14-port and --disable-pic16-port to prevent the non-free PIC stuff from building.
  27. build() {
  28. cd "$srcdir/$pkgname-$pkgver"
  29. ./configure \
  30. --prefix=/usr \
  31. --includedir=/usr/include/sdcc \
  32. --libdir=/usr/lib/sdcc \
  33. --disable-werror \
  34. --disable-pic14-port \
  35. --disable-pic16-port
  36. make
  37. }
  38. package() {
  39. cd "$srcdir/$pkgname-$pkgver"
  40. make install DESTDIR="$pkgdir"
  41. if [ -d "$pkgdir/usr/lib/lib" ]; then
  42. mv "$pkgdir/usr/lib/lib/"* "$pkgdir/usr/lib/sdcc/"
  43. rm -rf "$pkgdir/usr/lib/lib"
  44. fi
  45. sed -i 's|#!/usr/bin/env python|#!/usr/bin/env python3|' "$pkgdir/usr/bin/as2gbmap"
  46. }