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

lib_type=so

function prepare() {
    tar xf ${name}-${version}.tar.gz
    cd ${name}-${version}
    if [[ $(uname -s) == Darwin ]]; then
        lib_type=dylib
    fi
}

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
      ln -s lib${lib}w.${lib_type} "${_pkgdir}${_prefix}/lib/lib${lib}.${lib_type}"
      ln -s lib${lib}w.a "${_pkgdir}${_prefix}/lib/lib${lib}.a"
      ln -s ${lib}w.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.${lib_type} "${_pkgdir}${_prefix}/lib/libcurses.${lib_type}"

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

}