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
11 PKG_CPE_ID
:=cpe
:/a
:gnu
:ncurses
15 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
16 PKG_SOURCE_URL
:=@GNU
/$(PKG_NAME
)
17 PKG_HASH
:=6931283d9ac87c5073f30b6290c4c75f21632bb4fc3603ac8100812bed248159
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
/libncurses
40 TITLE
:=Terminal handling library
(Unicode
)
41 URL
:=http
://www.gnu.org
/software
/ncurses
/
47 define Package
/libncurses-dev
52 TITLE
:=Development files for the ncurses library
55 TARGET_CFLAGS
+= $(FPIC
)
70 --disable-home-terminfo \
73 --with-terminfo-dirs
=/usr
/share
/terminfo \
74 --with-default-terminfo-dir
=/usr
/share
/terminfo \
75 --with-pkg-config-libdir
=/usr
/lib
/pkgconfig \
77 --with-build-cppflags
=-D_GNU_SOURCE
82 HOST_CFLAGS
+= $(HOST_FPIC
)
84 HOST_CONFIGURE_ARGS
+= \
86 --without-cxx-binding \
95 ifeq ($(HOST_OS
),FreeBSD
)
97 --with-terminfo
=/usr
/share
/terminfo.db
101 BUILD_CC
="$(HOSTCC)" \
104 PKG_CONFIG_LIBDIR
=/usr
/lib
/pkgconfig \
107 define Build
/Install
/Default
109 $(MAKE
) -C
$(PKG_BUILD_DIR
)/$(MAKE_PATH
) \
110 $(MAKE_INSTALL_FLAGS
) \
111 $(1) install.libs
install.data
;
114 define Package
/terminfo
/install
116 ifneq ($(HOST_OS
),FreeBSD
)
117 $(INSTALL_DIR
) $(1)/usr
/share
/terminfo
118 (cd
$(PKG_INSTALL_DIR
)/usr
/share
/terminfo
; \
120 [ -d
"$$$$dir" ] || continue
; \
121 mv
$$$$dir $$$$(echo
-ne
"\x$$$$dir"); \
138 x
/xterm-256color
; do \
139 $(INSTALL_DIR
) $(1)/usr
/share
/terminfo
/`dirname $$$$file`; \
140 $(CP
) $(PKG_INSTALL_DIR
)/usr
/share
/terminfo
/$$$$file \
141 $(1)/usr
/share
/terminfo
/$$$$file; \
146 define Package
/libncurses
/install
147 $(INSTALL_DIR
) $(1)/usr
/lib
148 for lib in ncurses panel menu form
; do \
149 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
$$$${lib}w.so.
* $(1)/usr
/lib
/; \
150 for so in
$(1)/usr
/lib
/lib
$$$${lib}w.so.
*; do \
151 ln
-s
$$$${so
##*/} $$$${so%w.so*}.so$$$${so##*w.so}; \
156 define Package
/libncurses-dev
/install
157 $(INSTALL_DIR
) $(1)/usr
/bin
158 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/* $(1)/usr
/bin
/
159 $(INSTALL_DIR
) $(1)/usr
/include
160 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/*.h
$(1)/usr
/include/
161 $(INSTALL_DIR
) $(1)/usr
/lib
162 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/*.a
$(1)/usr
/lib
/
163 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
164 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/*.
pc $(1)/usr
/lib
/pkgconfig
/
167 define Build
/InstallDev
168 $(CP
) $(PKG_INSTALL_DIR
)/* $(1)
169 for lib in ncurses panel menu form
; do \
170 for so in
$(1)/usr
/lib
/lib
$$$${lib}w.so
*; do \
171 ln
-s
$$$${so
##*/} $$$${so%w.so*}.so$$$${so##*w.so}; \
174 ln
-s .
$(1)/usr
/include/ncursesw
175 $(TARGET_CROSS
)ar rc
$(1)/usr
/lib
/libtinfo.a
176 $(INSTALL_DIR
) $(2)/bin
177 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/ncursesw6-config
$(2)/bin
/
178 $(SED
) 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' -e
's/$$$$INCS //g' \
179 $(2)/bin
/ncursesw6-config
180 ln
-sf
$(STAGING_DIR
)/host
/bin
/ncursesw6-config
$(1)/usr
/bin
/ncursesw6-config
184 $(MAKE
) -C
$(HOST_BUILD_DIR
) libs
185 $(MAKE
) -C
$(HOST_BUILD_DIR
)/progs tic
188 $(eval
$(call HostBuild
))
189 $(eval
$(call BuildPackage
,terminfo
))
190 $(eval
$(call BuildPackage
,libncurses
))
191 $(eval
$(call BuildPackage
,libncurses-dev
))