5b31d593f1b028a759412456c6532dfa44f4434f
[openwrt/staging/blogic.git] / package / libs / ncurses / Makefile
1 #
2 # Copyright (C) 2006-2015 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=ncurses
11 PKG_VERSION:=6.0
12 PKG_RELEASE:=1
13
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_HASH:=f551c24b30ce8bfb6e96d9f59b42fbea30fa3a6123384172f9e7284bcf647260
18
19 PKG_LICENSE:=MIT
20 PKG_LICENSE_FILES:=README
21
22 PKG_INSTALL:=1
23 PKG_BUILD_PARALLEL:=1
24
25 PKG_BUILD_DEPENDS:=ncurses/host
26
27 include $(INCLUDE_DIR)/package.mk
28 include $(INCLUDE_DIR)/host-build.mk
29
30 define Package/terminfo
31 SECTION:=libs
32 CATEGORY:=Libraries
33 TITLE:=Terminal Info Database (ncurses)
34 URL:=http://www.gnu.org/software/ncurses/
35 endef
36
37 define Package/libncursesw
38 SECTION:=libs
39 CATEGORY:=Libraries
40 TITLE:=Terminal handling library (Unicode)
41 URL:=http://www.gnu.org/software/ncurses/
42 PROVIDES:=libncurses
43 DEPENDS:= +terminfo
44 endef
45
46 TARGET_CFLAGS += $(FPIC)
47
48 CONFIGURE_ARGS += \
49 --enable-echo \
50 --enable-const \
51 --enable-overwrite \
52 --enable-pc-files \
53 --disable-rpath \
54 --without-ada \
55 --without-debug \
56 --without-manpages \
57 --without-profile \
58 --without-progs \
59 --without-tests \
60 --disable-big-core \
61 --disable-home-terminfo \
62 --with-normal \
63 --with-shared \
64 --with-terminfo-dirs=/usr/share/terminfo \
65 --with-default-terminfo-dir=/usr/share/terminfo \
66 --with-pkg-config-libdir=/usr/lib/pkgconfig \
67 --enable-widec \
68 --with-build-cppflags=-D_GNU_SOURCE
69
70 HOST_CONFIGURE_ARGS += \
71 --without-cxx \
72 --without-cxx-binding \
73 --without-ada \
74 --without-debug \
75 --without-manpages \
76 --without-profile \
77 --without-tests \
78 --without-curses-h
79
80
81 ifeq ($(HOST_OS),FreeBSD)
82 CONFIGURE_ARGS +=
83 --with-terminfo=/usr/share/terminfo.db
84 endif
85
86 MAKE_FLAGS += \
87 BUILD_CC="$(HOSTCC)" \
88 HOSTCC="$(HOSTCC)" \
89 HOSTCCFLAGS="" \
90 PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig \
91 libs
92
93 define Build/Install/Default
94 $(MAKE_VARS) \
95 $(MAKE) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
96 $(MAKE_INSTALL_FLAGS) \
97 $(1) install.libs install.data;
98 endef
99
100 define Package/terminfo/install
101 echo ""
102 ifneq ($(HOST_OS),FreeBSD)
103 $(INSTALL_DIR) $(1)/usr/share/terminfo
104 (cd $(PKG_INSTALL_DIR)/usr/share/terminfo; \
105 for dir in ??; do \
106 [ -d "$$$$dir" ] || continue; \
107 mv $$$$dir $$$$(echo -ne "\x$$$$dir"); \
108 done \
109 )
110 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 \
111 $(INSTALL_DIR) $(1)/usr/share/terminfo/`dirname $$$$file`; \
112 $(CP) $(PKG_INSTALL_DIR)/usr/share/terminfo/$$$$file \
113 $(1)/usr/share/terminfo/$$$$file; \
114 done
115 endif
116 endef
117
118 define Package/libncursesw/install
119 $(INSTALL_DIR) $(1)/usr/lib
120 for lib in ncurses panel menu form; do \
121 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib$$$${lib}w.so* $(1)/usr/lib/; \
122 ln -s lib$$$${lib}w.so $(1)/usr/lib/lib$$$${lib}.so; \
123 done
124 endef
125
126 define Build/InstallDev
127 $(CP) $(PKG_INSTALL_DIR)/* $(1)
128 for lib in ncurses panel menu form; do \
129 ln -s lib$$$${lib}w.so $(1)/usr/lib/lib$$$${lib}.so; \
130 done
131 ln -s . $(1)/usr/include/ncursesw
132 $(TARGET_CROSS)ar rc $(1)/usr/lib/libtinfo.a
133 $(INSTALL_DIR) $(2)/bin
134 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ncursesw6-config $(2)/bin/
135 $(SED) 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' -e 's/$$$$INCS //g' \
136 $(2)/bin/ncursesw6-config
137 ln -sf $(STAGING_DIR)/host/bin/ncursesw6-config $(1)/usr/bin/ncursesw6-config
138 endef
139
140 define Host/Compile
141 $(MAKE) -C $(HOST_BUILD_DIR) libs
142 $(MAKE) -C $(HOST_BUILD_DIR)/progs tic
143 endef
144
145 define Host/Install
146 $(INSTALL_BIN) $(HOST_BUILD_DIR)/progs/tic $(STAGING_DIR_HOST)/bin/tic
147 endef
148
149 $(eval $(call HostBuild))
150 $(eval $(call BuildPackage,terminfo))
151 $(eval $(call BuildPackage,libncursesw))