1
0

Makefile 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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:=6.1
  10. PKG_RELEASE:=5
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
  13. PKG_HASH:=aa057eeeb4a14d470101eff4597d5833dcef5965331be3528c08d99cebaa0d17
  14. PKG_LICENSE:=MIT
  15. PKG_LICENSE_FILES:=README
  16. PKG_INSTALL:=1
  17. PKG_BUILD_PARALLEL:=1
  18. PKG_BUILD_DEPENDS:=ncurses/host
  19. include $(INCLUDE_DIR)/package.mk
  20. include $(INCLUDE_DIR)/host-build.mk
  21. define Package/terminfo
  22. SECTION:=libs
  23. CATEGORY:=Libraries
  24. TITLE:=Terminal Info Database (ncurses)
  25. URL:=http://www.gnu.org/software/ncurses/
  26. endef
  27. define Package/libncurses
  28. SECTION:=libs
  29. CATEGORY:=Libraries
  30. TITLE:=Terminal handling library (Unicode)
  31. URL:=http://www.gnu.org/software/ncurses/
  32. PROVIDES:=libncursesw
  33. DEPENDS:= +terminfo
  34. ABI_VERSION:=6
  35. endef
  36. define Package/libncurses-dev
  37. SECTION:=devel
  38. CATEGORY:=Development
  39. SUBMENU:=Libraries
  40. DEPENDS:=zlib
  41. TITLE:=Development files for the ncurses library
  42. endef
  43. TARGET_CFLAGS += $(FPIC)
  44. CONFIGURE_ARGS += \
  45. --enable-echo \
  46. --enable-const \
  47. --enable-overwrite \
  48. --enable-pc-files \
  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. --with-pkg-config-libdir=/usr/lib/pkgconfig \
  63. --enable-widec \
  64. --with-build-cppflags=-D_GNU_SOURCE
  65. CONFIGURE_VARS += \
  66. cf_try_fPIC=no
  67. HOST_CFLAGS += $(HOST_FPIC)
  68. HOST_CONFIGURE_ARGS += \
  69. --without-cxx \
  70. --without-cxx-binding \
  71. --without-ada \
  72. --without-debug \
  73. --without-manpages \
  74. --without-profile \
  75. --without-tests \
  76. --without-curses-h
  77. ifeq ($(HOST_OS),FreeBSD)
  78. CONFIGURE_ARGS +=
  79. --with-terminfo=/usr/share/terminfo.db
  80. endif
  81. MAKE_FLAGS += \
  82. BUILD_CC="$(HOSTCC)" \
  83. HOSTCC="$(HOSTCC)" \
  84. HOSTCCFLAGS="" \
  85. PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig \
  86. libs
  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. define Package/terminfo/install
  94. echo ""
  95. ifneq ($(HOST_OS),FreeBSD)
  96. $(INSTALL_DIR) $(1)/usr/share/terminfo
  97. (cd $(PKG_INSTALL_DIR)/usr/share/terminfo; \
  98. for dir in ??; do \
  99. [ -d "$$$$dir" ] || continue; \
  100. mv $$$$dir $$$$(echo -ne "\x$$$$dir"); \
  101. done \
  102. )
  103. 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 \
  104. $(INSTALL_DIR) $(1)/usr/share/terminfo/`dirname $$$$file`; \
  105. $(CP) $(PKG_INSTALL_DIR)/usr/share/terminfo/$$$$file \
  106. $(1)/usr/share/terminfo/$$$$file; \
  107. done
  108. endif
  109. endef
  110. define Package/libncurses/install
  111. $(INSTALL_DIR) $(1)/usr/lib
  112. for lib in ncurses panel menu form; do \
  113. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib$$$${lib}w.so.* $(1)/usr/lib/; \
  114. for so in $(1)/usr/lib/lib$$$${lib}w.so.*; do \
  115. ln -s $$$${so##*/} $$$${so%w.so*}.so$$$${so##*w.so}; \
  116. done; \
  117. done
  118. endef
  119. define Package/libncurses-dev/install
  120. $(INSTALL_DIR) $(1)/usr/bin
  121. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
  122. $(INSTALL_DIR) $(1)/usr/include
  123. $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
  124. $(INSTALL_DIR) $(1)/usr/lib
  125. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.a $(1)/usr/lib/
  126. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  127. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig/
  128. endef
  129. define Build/InstallDev
  130. $(CP) $(PKG_INSTALL_DIR)/* $(1)
  131. for lib in ncurses panel menu form; do \
  132. for so in $(1)/usr/lib/lib$$$${lib}w.so*; do \
  133. ln -s $$$${so##*/} $$$${so%w.so*}.so$$$${so##*w.so}; \
  134. done; \
  135. done
  136. ln -s . $(1)/usr/include/ncursesw
  137. $(TARGET_CROSS)ar rc $(1)/usr/lib/libtinfo.a
  138. $(INSTALL_DIR) $(2)/bin
  139. $(CP) $(PKG_INSTALL_DIR)/usr/bin/ncursesw6-config $(2)/bin/
  140. $(SED) 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' -e 's/$$$$INCS //g' \
  141. $(2)/bin/ncursesw6-config
  142. ln -sf $(STAGING_DIR)/host/bin/ncursesw6-config $(1)/usr/bin/ncursesw6-config
  143. endef
  144. define Host/Compile
  145. $(MAKE) -C $(HOST_BUILD_DIR) libs
  146. $(MAKE) -C $(HOST_BUILD_DIR)/progs tic
  147. endef
  148. $(eval $(call HostBuild))
  149. $(eval $(call BuildPackage,terminfo))
  150. $(eval $(call BuildPackage,libncurses))
  151. $(eval $(call BuildPackage,libncurses-dev))