2 # Copyright (C) 2006-2015 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR)/rules.mk
14 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=@GNU/ncurses
17 PKG_MD5SUM:=8cb9c412e5f2d96bc6f459aa8c6282a1
20 PKG_LICENSE_FILES:=README
25 PKG_BUILD_DEPENDS:=ncurses/host
27 include $(INCLUDE_DIR)/package.mk
28 include $(INCLUDE_DIR)/host-build.mk
30 define Package/terminfo
33 TITLE:=Terminal Info Database (ncurses)
34 URL:=http://www.gnu.org/software/ncurses/
37 define Package/libncursesw
40 TITLE:=Terminal handling library (Unicode)
41 URL:=http://www.gnu.org/software/ncurses/
46 TARGET_CFLAGS += $(FPIC)
60 --disable-home-terminfo \
63 --with-terminfo-dirs=/usr/share/terminfo \
64 --with-default-terminfo-dir=/usr/share/terminfo \
66 --with-build-cppflags=-D_GNU_SOURCE
68 HOST_CONFIGURE_ARGS += \
70 --without-cxx-binding \
79 ifeq ($(HOST_OS),FreeBSD)
81 --with-terminfo=/usr/share/terminfo.db
85 BUILD_CC="$(HOSTCC)" \
90 define Build/Install/Default
92 $(MAKE) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
93 $(MAKE_INSTALL_FLAGS) \
94 $(1) install.libs install.data;
97 define Package/terminfo/install
99 ifneq ($(HOST_OS),FreeBSD)
100 $(INSTALL_DIR) $(1)/usr/share/terminfo
101 (cd $(PKG_INSTALL_DIR)/usr/share/terminfo; \
103 [ -d "$$$$dir" ] || continue; \
104 mv $$$$dir $$$$(echo -ne "\x$$$$dir"); \
107 for file in a/ansi d/dumb l/linux r/rxvt r/rxvt-unicode s/screen v/vt100 v/vt102 x/xterm x/xterm-color x/xterm-256color; do \
108 $(INSTALL_DIR) $(1)/usr/share/terminfo/`dirname $$$$file`; \
109 $(CP) $(PKG_INSTALL_DIR)/usr/share/terminfo/$$$$file \
110 $(1)/usr/share/terminfo/$$$$file; \
115 define Package/libncursesw/install
116 $(INSTALL_DIR) $(1)/usr/lib
117 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{ncurses,panel,menu,form}w.so* $(1)/usr/lib/
120 define Build/InstallDev
121 $(INSTALL_DIR) $(1)/usr/include
122 $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
124 $(INSTALL_DIR) $(1)/usr/lib
125 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{ncurses,panel,menu,form}w.{a,so*} $(1)/usr/lib/
127 $(INSTALL_DIR) $(1)/usr/bin $(2)/bin
128 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ncursesw5-config $(2)/bin/
129 $(SED) 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' -e 's/$$$$INCS //g' \
130 $(2)/bin/ncursesw5-config
131 ln -sf $(STAGING_DIR)/host/bin/ncursesw5-config $(1)/usr/bin/ncursesw5-config
135 $(MAKE) -C $(HOST_BUILD_DIR) libs
136 $(MAKE) -C $(HOST_BUILD_DIR)/progs tic
140 $(INSTALL_BIN) $(HOST_BUILD_DIR)/progs/tic $(STAGING_DIR_HOST)/bin/tic
143 $(eval $(call HostBuild))
144 $(eval $(call BuildPackage,terminfo))
145 $(eval $(call BuildPackage,libncursesw))