summaryrefslogtreecommitdiff
path: root/ncurses/build.sh
blob: d96717f0513337cd9ed1933d426516a45544b9e7 (plain) (blame)
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
#!/bin/bash
name=ncurses
version=6.1
revision=0
sources=(
    "http://mirror.rit.edu/gnu/${name}/${name}-${version}.tar.gz"
)
build_depends=(
    "automake"
    "autoconf"
)
depends=()


function prepare() {
    tar xf ${name}-${version}.tar.gz
    cd ${name}-${version}
}

function build() {
    ./configure --prefix=${_prefix} \
        --without-static \
        --with-shared \
        --with-normal \
        --without-debug \
        --without-ada \
        --enable-widec \
        --enable-pc-files \
        --with-cxx-bindings \
        --with-cxx-shared \
        --with-manpage-format=normal \
        --with-pkg-config-libdir="${_prefix}/lib/pkgconfig"
    make -j${_maxjobs}
}

function package() {
    make install DESTDIR="${_pkgdir}"

    # Arch linux maintainers have the right idea here...

    # 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}/${_prefix}/lib/lib${lib}.so"
      ln -s ${lib}w.pc "${_pkgdir}/${_prefix}/lib/pkgconfig/${lib}.pc"
    done

    for lib in tic tinfo; do
      echo "INPUT(libncursesw.so.${version:0:1})" > "${_pkgdir}/${_prefix}/lib/lib${lib}.so"
      ln -s libncursesw.so.${version:0:1} "${_pkgdir}/${_prefix}/lib/lib${lib}.so.${version:0:1}"
      ln -s ncursesw.pc "${_pkgdir}${_prefix}/lib/pkgconfig/${lib}.pc"
    done

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

    # some packages include from ncurses/
    ln -s ncursesw "${_pkgdir}/${_prefix}/include/ncurses"

}