summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9b0a355870bf5c39ce7ea95806a27137b294d5d9 (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
64
65
# Maintainer: Andreas Marschall <andreas.marschall [at] unitybox.d>
# Contributor: Allan McRae <allan@archlinux.org>
# Contributor: judd <jvinet@zeroflux.org>

pkgname=lib32-ncurses-git
pkgver=6.4.20231209.r0.gb5a2b7c7
pkgrel=1
pkgdesc="System V Release 4.0 curses emulation library (32-bit)"
arch=('x86_64')
url="https://www.gnu.org/software/ncurses/"
license=('MIT')
depends=('lib32-glibc' 'ncurses')
provides=(lib32-ncurses)
conflicts=(lib32-ncurses)
source=(git+https://github.com/ThomasDickey/ncurses-snapshots.git)
sha512sums=('SKIP')

pkgver() {
  cd "ncurses-snapshots"

  git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g;s/_/./g'
}

build() {
  cd ncurses-snapshots

  export CC="gcc -m32"
  export CXX="g++ -m32"

  ./configure --prefix=/usr --mandir=/usr/share/man \
     --with-pkg-config-libdir=/usr/lib32/pkgconfig \
     --with-shared --with-normal --without-debug --without-ada \
     --enable-widec --libdir=/usr/lib32 --with-manpage-format=normal
  make
}

package() {
  cd ncurses-snapshots
  make DESTDIR="${pkgdir}" install

  # fool packages looking to link to non-wide-character ncurses libraries
  for lib in curses ncurses form panel menu; do
    echo "INPUT(-l${lib}w)" >"${pkgdir}"/usr/lib32/lib${lib}.so
    ln -sf lib${lib}w.a "${pkgdir}"/usr/lib32/lib${lib}.a
  done
  ln -sf libncurses++w.a "${pkgdir}"/usr/lib32/libncurses++.a

  for lib in tic tinfo; do
    echo "INPUT(libncursesw.so.${pkgver:0:1})" > "${pkgdir}/usr/lib32/lib${lib}.so"
    ln -s libncursesw.so.${pkgver:0:1} "${pkgdir}/usr/lib32/lib${lib}.so.${pkgver:0:1}"
  done

  # some packages look for -lcurses during build
  rm -f "${pkgdir}"/usr/lib32/libcursesw.so
  echo "INPUT(-lncursesw)" >"${pkgdir}"/usr/lib32/libcursesw.so
  ln -sf libncurses.so "${pkgdir}"/usr/lib32/libcurses.so
  ln -sf libncursesw.a "${pkgdir}"/usr/lib32/libcursesw.a
  ln -sf libncurses.a "${pkgdir}"/usr/lib32/libcurses.a

  rm -rf "${pkgdir}"/usr/{include,share,bin}
  mkdir -p "${pkgdir}/usr/share/licenses"
  ln -s lib32-ncurses "${pkgdir}/usr/share/licenses/${pkgname}"
}

# vim: set et ts=2 sw=2: