Makefile 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=ncurses
  9. PKG_VERSION:=5.9
  10. PKG_RELEASE:=3
  11. PKG_BUILD_DIR:=$(BUILD_DIR)/$(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/terminfo
  23. SECTION:=libs
  24. CATEGORY:=Libraries
  25. TITLE:=Terminal Info Database (ncurses)
  26. URL:=http://www.gnu.org/software/ncurses/
  27. endef
  28. define Package/libncursesw
  29. SECTION:=libs
  30. CATEGORY:=Libraries
  31. TITLE:=Terminal handling library (Unicode)
  32. URL:=http://www.gnu.org/software/ncurses/
  33. PROVIDES:=libncurses
  34. DEPENDS:= +terminfo
  35. endef
  36. TARGET_CFLAGS += $(FPIC)
  37. CONFIGURE_ARGS += \
  38. --enable-echo \
  39. --enable-const \
  40. --enable-overwrite \
  41. --enable-pc-files \
  42. --disable-rpath \
  43. --without-ada \
  44. --without-debug \
  45. --without-manpages \
  46. --without-profile \
  47. --without-progs \
  48. --without-tests \
  49. --disable-big-core \
  50. --disable-home-terminfo \
  51. --with-normal \
  52. --with-shared \
  53. --with-terminfo-dirs=/usr/share/terminfo \
  54. --with-default-terminfo-dir=/usr/share/terminfo \
  55. --enable-widec \
  56. --with-build-cppflags=-D_GNU_SOURCE
  57. HOST_CONFIGURE_ARGS += \
  58. --without-cxx \
  59. --without-cxx-binding \
  60. --without-ada \
  61. --without-debug \
  62. --without-manpages \
  63. --without-profile \
  64. --without-tests \
  65. --without-curses-h
  66. ifeq ($(HOST_OS),FreeBSD)
  67. CONFIGURE_ARGS +=
  68. --with-terminfo=/usr/share/terminfo.db
  69. endif
  70. MAKE_FLAGS += \
  71. BUILD_CC="$(HOSTCC)" \
  72. HOSTCC="$(HOSTCC)" \
  73. HOSTCCFLAGS="" \
  74. PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig \
  75. libs
  76. define Build/Install/Default
  77. $(MAKE_VARS) \
  78. $(MAKE) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
  79. $(MAKE_INSTALL_FLAGS) \
  80. $(1) install.libs install.data;
  81. endef
  82. define Package/terminfo/install
  83. echo ""
  84. ifneq ($(HOST_OS),FreeBSD)
  85. $(INSTALL_DIR) $(1)/usr/share/terminfo
  86. (cd $(PKG_INSTALL_DIR)/usr/share/terminfo; \
  87. for dir in ??; do \
  88. [ -d "$$$$dir" ] || continue; \
  89. mv $$$$dir $$$$(echo -ne "\x$$$$dir"); \
  90. done \
  91. )
  92. 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 \
  93. $(INSTALL_DIR) $(1)/usr/share/terminfo/`dirname $$$$file`; \
  94. $(CP) $(PKG_INSTALL_DIR)/usr/share/terminfo/$$$$file \
  95. $(1)/usr/share/terminfo/$$$$file; \
  96. done
  97. endif
  98. endef
  99. define Package/libncursesw/install
  100. $(INSTALL_DIR) $(1)/usr/lib
  101. for lib in ncurses panel menu form; do \
  102. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib$$$${lib}w.so* $(1)/usr/lib/; \
  103. ln -s lib$$$${lib}w.so $(1)/usr/lib/lib$$$${lib}.so; \
  104. done
  105. endef
  106. define Build/InstallDev
  107. $(CP) $(PKG_INSTALL_DIR)/* $(1)
  108. for lib in ncurses panel menu form; do \
  109. ln -s lib$$$${lib}w.so $(1)/usr/lib/lib$$$${lib}.so; \
  110. done
  111. $(TARGET_CROSS)ar rc $(1)/usr/lib/libtinfo.a
  112. $(INSTALL_DIR) $(2)/bin
  113. $(CP) $(PKG_INSTALL_DIR)/usr/bin/ncursesw5-config $(2)/bin/
  114. $(SED) 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' -e 's/$$$$INCS //g' \
  115. $(2)/bin/ncursesw5-config
  116. ln -sf $(STAGING_DIR)/host/bin/ncursesw5-config $(1)/usr/bin/ncursesw5-config
  117. endef
  118. define Host/Compile
  119. $(MAKE) -C $(HOST_BUILD_DIR) libs
  120. $(MAKE) -C $(HOST_BUILD_DIR)/progs tic
  121. endef
  122. define Host/Install
  123. $(INSTALL_BIN) $(HOST_BUILD_DIR)/progs/tic $(STAGING_DIR_HOST)/bin/tic
  124. endef
  125. $(eval $(call HostBuild))
  126. $(eval $(call BuildPackage,terminfo))
  127. $(eval $(call BuildPackage,libncursesw))