Makefile 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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.0
  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/ncurses
  14. PKG_HASH:=f551c24b30ce8bfb6e96d9f59b42fbea30fa3a6123384172f9e7284bcf647260
  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. TARGET_CFLAGS += $(FPIC)
  38. CONFIGURE_ARGS += \
  39. --enable-echo \
  40. --enable-const \
  41. --enable-overwrite \
  42. --enable-pc-files \
  43. --disable-rpath \
  44. --without-ada \
  45. --without-debug \
  46. --without-manpages \
  47. --without-profile \
  48. --without-progs \
  49. --without-tests \
  50. --disable-big-core \
  51. --disable-home-terminfo \
  52. --with-normal \
  53. --with-shared \
  54. --with-terminfo-dirs=/usr/share/terminfo \
  55. --with-default-terminfo-dir=/usr/share/terminfo \
  56. --with-pkg-config-libdir=/usr/lib/pkgconfig \
  57. --enable-widec \
  58. --with-build-cppflags=-D_GNU_SOURCE
  59. HOST_CONFIGURE_ARGS += \
  60. --without-cxx \
  61. --without-cxx-binding \
  62. --without-ada \
  63. --without-debug \
  64. --without-manpages \
  65. --without-profile \
  66. --without-tests \
  67. --without-curses-h
  68. ifeq ($(HOST_OS),FreeBSD)
  69. CONFIGURE_ARGS +=
  70. --with-terminfo=/usr/share/terminfo.db
  71. endif
  72. MAKE_FLAGS += \
  73. BUILD_CC="$(HOSTCC)" \
  74. HOSTCC="$(HOSTCC)" \
  75. HOSTCCFLAGS="" \
  76. PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig \
  77. libs
  78. define Build/Install/Default
  79. $(MAKE_VARS) \
  80. $(MAKE) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
  81. $(MAKE_INSTALL_FLAGS) \
  82. $(1) install.libs install.data;
  83. endef
  84. define Package/terminfo/install
  85. echo ""
  86. ifneq ($(HOST_OS),FreeBSD)
  87. $(INSTALL_DIR) $(1)/usr/share/terminfo
  88. (cd $(PKG_INSTALL_DIR)/usr/share/terminfo; \
  89. for dir in ??; do \
  90. [ -d "$$$$dir" ] || continue; \
  91. mv $$$$dir $$$$(echo -ne "\x$$$$dir"); \
  92. done \
  93. )
  94. 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 \
  95. $(INSTALL_DIR) $(1)/usr/share/terminfo/`dirname $$$$file`; \
  96. $(CP) $(PKG_INSTALL_DIR)/usr/share/terminfo/$$$$file \
  97. $(1)/usr/share/terminfo/$$$$file; \
  98. done
  99. endif
  100. endef
  101. define Package/libncurses/install
  102. $(INSTALL_DIR) $(1)/usr/lib
  103. for lib in ncurses panel menu form; do \
  104. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib$$$${lib}w.so* $(1)/usr/lib/; \
  105. ln -s lib$$$${lib}w.so $(1)/usr/lib/lib$$$${lib}.so; \
  106. done
  107. endef
  108. define Build/InstallDev
  109. $(CP) $(PKG_INSTALL_DIR)/* $(1)
  110. for lib in ncurses panel menu form; do \
  111. ln -s lib$$$${lib}w.so $(1)/usr/lib/lib$$$${lib}.so; \
  112. done
  113. ln -s . $(1)/usr/include/ncursesw
  114. $(TARGET_CROSS)ar rc $(1)/usr/lib/libtinfo.a
  115. $(INSTALL_DIR) $(2)/bin
  116. $(CP) $(PKG_INSTALL_DIR)/usr/bin/ncursesw6-config $(2)/bin/
  117. $(SED) 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' -e 's/$$$$INCS //g' \
  118. $(2)/bin/ncursesw6-config
  119. ln -sf $(STAGING_DIR_HOSTPKG)/bin/ncursesw6-config $(1)/usr/bin/ncursesw6-config
  120. endef
  121. define Host/Compile
  122. $(MAKE) -C $(HOST_BUILD_DIR) libs
  123. $(MAKE) -C $(HOST_BUILD_DIR)/progs tic
  124. endef
  125. define Host/Install
  126. $(INSTALL_BIN) $(HOST_BUILD_DIR)/progs/tic $(STAGING_DIR_HOST)/bin/tic
  127. endef
  128. $(eval $(call HostBuild))
  129. $(eval $(call BuildPackage,terminfo))
  130. $(eval $(call BuildPackage,libncurses))