python-dataproperty: bump version to 0.17.0
[buildroot-gz.git] / package / ncurses / ncurses.mk
blob9d1b75d6417f21672187c57eb764f056814653b7
1 ################################################################################
3 # ncurses
5 ################################################################################
7 NCURSES_VERSION = 5.9
8 NCURSES_SITE = $(BR2_GNU_MIRROR)/ncurses
9 NCURSES_INSTALL_STAGING = YES
10 NCURSES_DEPENDENCIES = host-ncurses
11 NCURSES_LICENSE = MIT with advertising clause
12 NCURSES_LICENSE_FILES = README
13 NCURSES_CONFIG_SCRIPTS = ncurses$(NCURSES_LIB_SUFFIX)$(NCURSES_ABI_VERSION)-config
15 NCURSES_CONF_OPTS = \
16 --without-cxx \
17 --without-cxx-binding \
18 --without-ada \
19 --without-tests \
20 --disable-big-core \
21 --without-profile \
22 --disable-rpath \
23 --disable-rpath-hack \
24 --enable-echo \
25 --enable-const \
26 --enable-overwrite \
27 --enable-pc-files \
28 $(if $(BR2_PACKAGE_NCURSES_TARGET_PROGS),,--without-progs) \
29 --without-manpages
31 # Install after busybox for the full-blown versions
32 ifeq ($(BR2_PACKAGE_BUSYBOX),y)
33 NCURSES_DEPENDENCIES += busybox
34 endif
36 ifeq ($(BR2_STATIC_LIBS),y)
37 NCURSES_CONF_OPTS += --without-shared --with-normal
38 else ifeq ($(BR2_SHARED_LIBS),y)
39 NCURSES_CONF_OPTS += --with-shared --without-normal
40 else ifeq ($(BR2_SHARED_STATIC_LIBS),y)
41 NCURSES_CONF_OPTS += --with-shared --with-normal
42 endif
44 # configure can't find the soname for libgpm when cross compiling
45 ifeq ($(BR2_PACKAGE_GPM),y)
46 NCURSES_CONF_OPTS += --with-gpm=libgpm.so.2
47 NCURSES_DEPENDENCIES += gpm
48 else
49 NCURSES_CONF_OPTS += --without-gpm
50 endif
52 NCURSES_TERMINFO_FILES = \
53 a/ansi \
54 l/linux \
55 p/putty \
56 p/putty-vt100 \
57 s/screen \
58 v/vt100 \
59 v/vt100-putty \
60 v/vt102 \
61 v/vt200 \
62 v/vt220 \
63 x/xterm \
64 x/xterm-color \
65 x/xterm-xfree86 \
67 ifeq ($(BR2_PACKAGE_NCURSES_WCHAR),y)
68 NCURSES_CONF_OPTS += --enable-widec
69 NCURSES_LIB_SUFFIX = w
70 NCURSES_LIBS = ncurses menu panel form
72 define NCURSES_LINK_LIBS_STATIC
73 $(foreach lib,$(NCURSES_LIBS:%=lib%), \
74 ln -sf $(lib)$(NCURSES_LIB_SUFFIX).a $(STAGING_DIR)/usr/lib/$(lib).a
76 ln -sf libncurses$(NCURSES_LIB_SUFFIX).a \
77 $(STAGING_DIR)/usr/lib/libcurses.a
78 endef
80 define NCURSES_LINK_LIBS_SHARED
81 $(foreach lib,$(NCURSES_LIBS:%=lib%), \
82 ln -sf $(lib)$(NCURSES_LIB_SUFFIX).so $(STAGING_DIR)/usr/lib/$(lib).so
84 ln -sf libncurses$(NCURSES_LIB_SUFFIX).so \
85 $(STAGING_DIR)/usr/lib/libcurses.so
86 endef
88 define NCURSES_LINK_PC
89 $(foreach pc,$(NCURSES_LIBS), \
90 ln -sf $(pc)$(NCURSES_LIB_SUFFIX).pc \
91 $(STAGING_DIR)/usr/lib/pkgconfig/$(pc).pc
93 endef
95 NCURSES_LINK_STAGING_LIBS = \
96 $(if $(BR2_STATIC_LIBS)$(BR2_SHARED_STATIC_LIBS),$(call NCURSES_LINK_LIBS_STATIC);) \
97 $(if $(BR2_SHARED_LIBS)$(BR2_SHARED_STATIC_LIBS),$(call NCURSES_LINK_LIBS_SHARED))
99 NCURSES_LINK_STAGING_PC = $(call NCURSES_LINK_PC)
101 NCURSES_CONF_OPTS += --enable-ext-colors
102 NCURSES_ABI_VERSION = 6
103 NCURSES_TERMINFO_FILES += \
104 p/putty-256color \
105 x/xterm+256color \
106 x/xterm-256color
108 NCURSES_POST_INSTALL_STAGING_HOOKS += NCURSES_LINK_STAGING_LIBS
109 NCURSES_POST_INSTALL_STAGING_HOOKS += NCURSES_LINK_STAGING_PC
111 else # BR2_PACKAGE_NCURSES_WCHAR
112 NCURSES_ABI_VERSION = 5
113 endif # BR2_PACKAGE_NCURSES_WCHAR
115 ifneq ($(BR2_ENABLE_DEBUG),y)
116 NCURSES_CONF_OPTS += --without-debug
117 endif
119 # ncurses breaks with parallel build, but takes quite a while to
120 # build single threaded. Work around it similar to how Gentoo does
121 define NCURSES_BUILD_CMDS
122 $(TARGET_MAKE_ENV) $(MAKE1) -C $(@D) DESTDIR=$(STAGING_DIR) sources
123 rm -rf $(@D)/misc/pc-files
124 $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(STAGING_DIR)
125 endef
127 ifeq ($(BR2_PACKAGE_NCURSES_TARGET_PROGS),y)
128 define NCURSES_TARGET_SYMLINK_RESET
129 ln -sf tset $(TARGET_DIR)/usr/bin/reset
130 endef
131 NCURSES_POST_INSTALL_TARGET_HOOKS += NCURSES_TARGET_SYMLINK_RESET
132 endif
134 define NCURSES_TARGET_CLEANUP_TERMINFO
135 $(RM) -rf $(TARGET_DIR)/usr/share/terminfo $(TARGET_DIR)/usr/share/tabset
136 $(foreach t,$(NCURSES_TERMINFO_FILES), \
137 $(INSTALL) -D -m 0644 $(STAGING_DIR)/usr/share/terminfo/$(t) \
138 $(TARGET_DIR)/usr/share/terminfo/$(t)
140 endef
141 NCURSES_POST_INSTALL_TARGET_HOOKS += NCURSES_TARGET_CLEANUP_TERMINFO
144 # On systems with an older version of tic, the installation of ncurses hangs
145 # forever. To resolve the problem, build a static version of tic on host
146 # ourselves, and use that during installation.
148 define HOST_NCURSES_BUILD_CMDS
149 $(HOST_MAKE_ENV) $(MAKE1) -C $(@D) sources
150 $(HOST_MAKE_ENV) $(MAKE) -C $(@D)/progs tic
151 endef
153 HOST_NCURSES_CONF_OPTS = \
154 --with-shared \
155 --without-gpm \
156 --without-manpages \
157 --without-cxx \
158 --without-cxx-binding \
159 --without-ada \
160 --without-normal
162 $(eval $(autotools-package))
163 $(eval $(host-autotools-package))