summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 806a487828abc5f887ce64e4aff61829b66c7bf8 (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
# Maintainer: Martin Zeller <mz DOT bremerhaven AT gmail DOT com>

_target="arm-linux-gnueabihf"
_pkgname=ncurses
pkgname=${_target}-${_pkgname}
pkgver=6.0
pkgrel=2
_gccver=6.1.1
pkgdesc="System V Release 4.0 curses emulation library (${_target})"
arch=('i686' 'x86_64')
url='http://invisible-island.net/ncurses/ncurses.html'
license=('MIT')
depends=('arm-linux-gnueabihf-glibc')
makedepends=("${_target}-gcc" 'glibc' 'gcc-libs')
source=(ftp://invisible-island.net/ncurses/ncurses-${pkgver/_/-}.tar.gz{,.asc})
options=('!strip')
md5sums=('ee13d052e1ead260d7c28071f46eefb1'
         'SKIP')
validpgpkeys=('C52048C0C0748FEE227D47A2702353E0F7E48EDB')  # Thomas Dickey
_sysroot="/usr/lib/gcc/${_target}/${_gccver}"

build() {
  cd ${_pkgname}-${pkgver/_/-}

  export CFLAGS="-O2 -pipe -fstack-protector-strong"
  export CXXFLAGS=${CFLAGS}
  #export TARGET=${_target}
  export BUILD_CC='gcc'
  export CC="${_target}-gcc"
  export LD="${_target}-ld"
  export AS="${_target}-as"

  ./configure --prefix=${_sysroot} --target=${_target} --host=${_target} \
     --with-shared --with-normal --without-debug \
	 --without-ada --enable-widec --enable-pc-files --with-cxx-binding \
	 --with-cxx-shared --enable-ext-colors --enable-ext-mouse --enable-overwrite
  make
}

package() {
  export CFLAGS="-O2 -pipe -fstack-protector-strong"
  export CXXFLAGS=${CFLAGS}
  
  cd ${_pkgname}-${pkgver/_/-}
  make DESTDIR="$pkgdir" install

  # I have no idea why it ends up in /usr/share...
  mv "$pkgdir/usr/share/pkgconfig" "$pkgdir${_sysroot}/lib"

  # fool packages looking to link to non-wide-character ncurses libraries
  for lib in ncurses ncurses++ form panel menu; do
    echo "INPUT(-l${lib}w)" > "$pkgdir${_sysroot}"/lib${lib}.so
    ln -s ${lib}w.pc "$pkgdir${_sysroot}"/lib/pkgconfig/${lib}.pc
  done

  # some packages look for -lcurses during build
  echo "INPUT(-lncursesw)" > "$pkgdir${_sysroot}"/lib/libcursesw.so
  ln -s libncurses.so "$pkgdir${_sysroot}"/lib/libcurses.so

  # install license, rip it from the readme
  install -d "$pkgdir"/usr/share/licenses/$pkgname
  grep -B 100 '$Id' README > "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}