Makefile 4.5 KB

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