summaryrefslogtreecommitdiff
path: root/ncurses/ncurses_5.4.oe
blob: 7cfd0ed12f0e55e30505beb7218523dd98cbec0b (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
66
67
68
69
70
71
72
73
74
75
76
77
PR = "r2"
DESCRIPTION = "Ncurses library"
SECTION = "libs"
DEPENDS = "ncurses-native"
PACKAGES_append = " ncurses-terminfo"
FILES_ncurses_append = " ${datadir}/tabset"
FILES_ncurses-terminfo = "${datadir}/terminfo"
RSUGGESTS_${PN} = "ncurses-terminfo"

SRC_URI = "${GNU_MIRROR}/ncurses/ncurses-${PV}.tar.gz"
S = "${WORKDIR}/ncurses-${PV}"

inherit autotools

EXTRA_OECONF = "--with-shared \
	        --without-profile \
	        --without-debug \
	        --disable-rpath \
	        --enable-echo \
	        --enable-const \
	        --without-ada \
	        --enable-termcap \
	        --without-cxx-binding \
	        --with-terminfo-dirs=${sysconfdir}/terminfo:${datadir}/terminfo \
	        --enable-overwrite"
export BUILD_CCFLAGS = "-I${S}/ncurses -I${S}/include ${BUILD_CFLAGS}"
export BUILD_LDFLAGS = ""
export EXTRA_OEMAKE = '"BUILD_LDFLAGS=" "BUILD_CCFLAGS=${BUILD_CCFLAGS}"'

do_configure_prepend () {
	if [ -e aclocal.m4 -a ! -e acinclude.m4 ]; then
		cat aclocal.m4 > acinclude.m4
	fi
}

do_configure () {
# override this function to avoid the autoconf/automake/aclocal/autoheader
# calls for now
	gnu-configize
	oe_runconf
}

do_stage () {
	for i in libncurses libpanel libform libmenu; do
		oe_libinstall -so -C lib $i ${STAGING_LIBDIR}
	done
	for h in ncurses_*.h curses.h eti.h form.h menu.h panel.h \
		termcap.h term.h unctrl.h; do
		       install -m 0644 include/$h ${STAGING_INCDIR}/
	done
	ln -sf curses.h ${STAGING_INCDIR}/ncurses.h
}

do_install() {
	autotools_do_install

	# include some basic terminfo files
	# stolen ;) from gentoo and modified a bit
	for x in ansi console dumb linux rxvt screen sun vt{52,100,102,200,220} xterm-color xterm-xfree86
        do
                local termfile="$(find "${D}/usr/share/terminfo/" -name "${x}" 2>/dev/null)"
                local basedir="$(basename $(dirname "${termfile}"))"

                if [ -n "${termfile}" ]
                then
                        install -d ${D}/etc/terminfo/${basedir}
                        mv ${termfile} ${D}/etc/terminfo/${basedir}/
                        ln -s /etc/terminfo/${basedir}/${x} \
                                ${D}/usr/share/terminfo/${basedir}/${x}
                fi
        done
	# i think we can use xterm-color as default xterm
	if [ -e ${D}/etc/terminfo/x/xterm ]
	then
		ln -sf xterm-color ${D}/etc/terminfo/x/xterm
	fi
}