[package] ncurses: Split terminfo database into a separate package because S-Lang...
[openwrt.git] / package / ncurses / Makefile
1 #
2 # Copyright (C) 2006-2010 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:=5.7
12 PKG_RELEASE:=4
13
14 PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=@GNU/ncurses
17 PKG_MD5SUM:=cce05daf61a64501ef6cd8da1f727ec6
18
19 PKG_INSTALL:=1
20 PKG_BUILD_PARALLEL:=1
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/libncurses
25 SECTION:=libs
26 CATEGORY:=Libraries
27 TITLE:=Terminal handling library
28 URL:=http://www.gnu.org/software/ncurses/
29 DEPENDS:= +terminfo
30 VARIANT:=libncurses
31 endef
32
33 define Package/terminfo
34 SECTION:=libs
35 CATEGORY:=Libraries
36 TITLE:=Terminal Info Database (ncurses)
37 URL:=http://www.gnu.org/software/ncurses/
38 VARIANT:=libncurses
39 endef
40
41 define Package/libncursesw
42 SECTION:=libs
43 CATEGORY:=Libraries
44 TITLE:=Terminal handling library (Unicode)
45 URL:=http://www.gnu.org/software/ncurses/
46 DEPENDS:=libncurses
47 VARIANT:=libncursesw
48 endef
49
50 TARGET_CFLAGS += $(FPIC)
51
52 CONFIGURE_ARGS += \
53 --enable-echo \
54 --enable-const \
55 --enable-overwrite \
56 --disable-rpath \
57 --without-ada \
58 --without-cxx \
59 --without-cxx-binding \
60 --without-debug \
61 --without-profile \
62 --without-progs \
63 --disable-big-core \
64 --disable-home-terminfo \
65 --with-normal \
66 --with-shared \
67 --with-terminfo-dirs=/usr/share/terminfo \
68 --with-default-terminfo-dir=/usr/share/terminfo
69
70 ifeq ($(HOST_OS),FreeBSD)
71 CONFIGURE_ARGS +=
72 --with-terminfo=/usr/share/terminfo.db
73 endif
74
75 ifeq ($(BUILD_VARIANT),libncursesw)
76 CONFIGURE_ARGS += \
77 --enable-widec \
78 --with-build-cppflags=-D_GNU_SOURCE
79 endif
80
81 MAKE_FLAGS += \
82 BUILD_CC="$(HOSTCC)" \
83 HOSTCC="$(HOSTCC)" \
84 HOSTCCFLAGS="" \
85 libs
86
87 define Build/Install/Default
88 $(MAKE_VARS) \
89 $(MAKE) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
90 $(MAKE_INSTALL_FLAGS) \
91 $(1) install.libs install.data;
92 endef
93
94 define Package/terminfo/install
95 echo ""
96 ifneq ($(HOST_OS),FreeBSD)
97 $(INSTALL_DIR) $(1)/usr/share/terminfo
98 (cd $(PKG_INSTALL_DIR)/usr/share/terminfo; \
99 for dir in ??; do \
100 [ -d "$$$$dir" ] || continue; \
101 mv $$$$dir $$$$(echo -ne "\x$$$$dir"); \
102 done \
103 )
104 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; do \
105 $(INSTALL_DIR) $(1)/usr/share/terminfo/`dirname $$$$file`; \
106 $(CP) $(PKG_INSTALL_DIR)/usr/share/terminfo/$$$$file \
107 $(1)/usr/share/terminfo/$$$$file; \
108 done
109 endif
110 endef
111
112 define Package/libncurses/install
113 $(INSTALL_DIR) $(1)/usr/lib
114 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{curses,ncurses,panel,menu,form}.so* $(1)/usr/lib/
115 endef
116
117 define Package/libncursesw/install
118 $(INSTALL_DIR) $(1)/usr/lib
119 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{ncurses,panel,menu,form}w.so* $(1)/usr/lib/
120 endef
121
122 ifeq ($(BUILD_VARIANT),libncursesw)
123 define Build/InstallDev
124 $(INSTALL_DIR) $(1)/usr/include/ncursesw/
125 $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/ncursesw/
126
127 $(INSTALL_DIR) $(1)/usr/lib
128 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{ncurses,panel,menu,form}w.{a,so*} $(1)/usr/lib/
129 endef
130 else
131 define Build/InstallDev
132 $(INSTALL_DIR) $(1)/usr/include
133 $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
134
135 $(INSTALL_DIR) $(1)/usr/lib
136 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{curses,ncurses,panel,menu,form}.{a,so*} $(1)/usr/lib/
137 endef
138 endif
139
140 $(eval $(call BuildPackage,terminfo))
141 $(eval $(call BuildPackage,libncurses))
142 $(eval $(call BuildPackage,libncursesw))
This page took 0.05395 seconds and 5 git commands to generate.