Makefile 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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:=1
  11. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  13. PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
  14. PKG_HASH:=aa057eeeb4a14d470101eff4597d5833dcef5965331be3528c08d99cebaa0d17
  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/libncurses
  29. SECTION:=libs
  30. CATEGORY:=Libraries
  31. TITLE:=Terminal handling library (Unicode)
  32. URL:=http://www.gnu.org/software/ncurses/
  33. PROVIDES:=libncursesw
  34. DEPENDS:= +terminfo
  35. ABI_VERSION:=$(PKG_VERSION)
  36. endef
  37. define Package/libncurses-dev
  38. SECTION:=devel
  39. CATEGORY:=Development
  40. SUBMENU:=Libraries
  41. DEPENDS:=zlib
  42. TITLE:=Development files for the ncurses library
  43. endef
  44. TARGET_CFLAGS += $(FPIC)
  45. CONFIGURE_ARGS += \
  46. --enable-echo \
  47. --enable-const \
  48. --enable-overwrite \
  49. --enable-pc-files \
  50. --disable-rpath \
  51. --without-ada \
  52. --without-debug \
  53. --without-manpages \
  54. --without-profile \
  55. --without-progs \
  56. --without-tests \
  57. --disable-big-core \
  58. --disable-home-terminfo \
  59. --with-normal \
  60. --with-shared \
  61. --with-terminfo-dirs=/usr/share/terminfo \
  62. --with-default-terminfo-dir=/usr/share/terminfo \
  63. --with-pkg-config-libdir=/usr/lib/pkgconfig \
  64. --enable-widec \
  65. --with-build-cppflags=-D_GNU_SOURCE
  66. HOST_CONFIGURE_ARGS += \
  67. --without-cxx \
  68. --without-cxx-binding \
  69. --without-ada \
  70. --without-debug \
  71. --without-manpages \
  72. --without-profile \
  73. --without-tests \
  74. --without-curses-h
  75. ifeq ($(HOST_OS),FreeBSD)
  76. CONFIGURE_ARGS +=
  77. --with-terminfo=/usr/share/terminfo.db
  78. endif
  79. MAKE_FLAGS += \
  80. BUILD_CC="$(HOSTCC)" \
  81. HOSTCC="$(HOSTCC)" \
  82. HOSTCCFLAGS="" \
  83. PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig \
  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. for lib in ncurses panel menu form; do \
  111. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib$$$${lib}w.so* $(1)/usr/lib/; \
  112. ln -s lib$$$${lib}w.so $(1)/usr/lib/lib$$$${lib}.so; \
  113. done
  114. endef
  115. define Package/libncurses-dev/install
  116. $(INSTALL_DIR) $(1)/usr/bin
  117. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
  118. $(INSTALL_DIR) $(1)/usr/include
  119. $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
  120. $(INSTALL_DIR) $(1)/usr/lib
  121. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.a $(1)/usr/lib/
  122. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  123. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig/
  124. endef
  125. define Build/InstallDev
  126. $(CP) $(PKG_INSTALL_DIR)/* $(1)
  127. for lib in ncurses panel menu form; do \
  128. ln -s lib$$$${lib}w.so $(1)/usr/lib/lib$$$${lib}.so; \
  129. done
  130. ln -s . $(1)/usr/include/ncursesw
  131. $(TARGET_CROSS)ar rc $(1)/usr/lib/libtinfo.a
  132. $(INSTALL_DIR) $(2)/bin
  133. $(CP) $(PKG_INSTALL_DIR)/usr/bin/ncursesw6-config $(2)/bin/
  134. $(SED) 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' -e 's/$$$$INCS //g' \
  135. $(2)/bin/ncursesw6-config
  136. ln -sf $(STAGING_DIR)/host/bin/ncursesw6-config $(1)/usr/bin/ncursesw6-config
  137. endef
  138. define Host/Compile
  139. $(MAKE) -C $(HOST_BUILD_DIR) libs
  140. $(MAKE) -C $(HOST_BUILD_DIR)/progs tic
  141. endef
  142. $(eval $(call HostBuild))
  143. $(eval $(call BuildPackage,terminfo))
  144. $(eval $(call BuildPackage,libncurses))
  145. $(eval $(call BuildPackage,libncurses-dev))