ncurses.mk 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. ################################################################################
  2. #
  3. # ncurses
  4. #
  5. ################################################################################
  6. # When there is no snapshost yet for a new version, set it to the empty string
  7. NCURSES_VERSION_MAJOR = 6.4
  8. NCURSES_SNAPSHOT_DATE = 20230603
  9. NCURSES_VERSION = $(NCURSES_VERSION_MAJOR)$(if $(NCURSES_SNAPSHOT_DATE),-$(NCURSES_SNAPSHOT_DATE))
  10. NCURSES_VERSION_GIT = $(subst .,_,$(subst -,_,$(NCURSES_VERSION)))
  11. NCURSES_SITE = $(call github,ThomasDickey,ncurses-snapshots,v$(NCURSES_VERSION_GIT))
  12. NCURSES_INSTALL_STAGING = YES
  13. NCURSES_DEPENDENCIES = host-ncurses
  14. NCURSES_LICENSE = MIT with advertising clause
  15. NCURSES_LICENSE_FILES = COPYING
  16. NCURSES_CPE_ID_VENDOR = gnu
  17. NCURSES_CPE_ID_VERSION = $(NCURSES_VERSION_MAJOR)$(if $(NCURSES_SNAPSHOT_DATE),.$(NCURSES_SNAPSHOT_DATE))
  18. NCURSES_CONFIG_SCRIPTS = ncurses$(NCURSES_LIB_SUFFIX)6-config
  19. NCURSES_CONF_OPTS = \
  20. --without-cxx \
  21. --without-cxx-binding \
  22. --without-ada \
  23. --without-tests \
  24. --disable-big-core \
  25. --without-profile \
  26. --disable-rpath \
  27. --disable-rpath-hack \
  28. --enable-echo \
  29. --enable-const \
  30. --enable-overwrite \
  31. --enable-pc-files \
  32. --disable-stripping \
  33. --with-pkg-config-libdir="/usr/lib/pkgconfig" \
  34. $(if $(BR2_PACKAGE_NCURSES_TARGET_PROGS),,--without-progs) \
  35. --without-manpages
  36. ifeq ($(BR2_STATIC_LIBS),y)
  37. NCURSES_CONF_OPTS += --without-shared --with-normal
  38. else ifeq ($(BR2_SHARED_LIBS),y)
  39. NCURSES_CONF_OPTS += --with-shared --without-normal
  40. else ifeq ($(BR2_SHARED_STATIC_LIBS),y)
  41. NCURSES_CONF_OPTS += --with-shared --with-normal
  42. endif
  43. # configure can't find the soname for libgpm when cross compiling
  44. ifeq ($(BR2_PACKAGE_GPM),y)
  45. NCURSES_CONF_OPTS += --with-gpm=libgpm.so.2
  46. NCURSES_DEPENDENCIES += gpm
  47. else
  48. NCURSES_CONF_OPTS += --without-gpm
  49. endif
  50. NCURSES_TERMINFO_FILES = \
  51. a/ansi \
  52. d/dumb \
  53. l/linux \
  54. p/putty \
  55. p/putty-256color \
  56. p/putty-vt100 \
  57. s/screen \
  58. s/screen-256color \
  59. v/vt100 \
  60. v/vt100-putty \
  61. v/vt102 \
  62. v/vt200 \
  63. v/vt220 \
  64. x/xterm \
  65. x/xterm+256color \
  66. x/xterm-256color \
  67. x/xterm-color \
  68. x/xterm-xfree86 \
  69. $(call qstrip,$(BR2_PACKAGE_NCURSES_ADDITIONAL_TERMINFO))
  70. ifeq ($(BR2_PACKAGE_FOOT),y)
  71. NCURSES_TERMINFO_FILES += \
  72. f/foot \
  73. f/foot+base \
  74. f/foot-direct
  75. endif
  76. ifeq ($(BR2_PACKAGE_NCURSES_WCHAR),y)
  77. NCURSES_CONF_OPTS += --enable-widec
  78. NCURSES_LIB_SUFFIX = w
  79. NCURSES_LIBS = ncurses menu panel form
  80. define NCURSES_LINK_LIBS_STATIC
  81. $(foreach lib,$(NCURSES_LIBS:%=lib%), \
  82. ln -sf $(lib)$(NCURSES_LIB_SUFFIX).a $(STAGING_DIR)/usr/lib/$(lib).a
  83. )
  84. ln -sf libncurses$(NCURSES_LIB_SUFFIX).a \
  85. $(STAGING_DIR)/usr/lib/libcurses.a
  86. endef
  87. define NCURSES_LINK_LIBS_SHARED
  88. $(foreach lib,$(NCURSES_LIBS:%=lib%), \
  89. ln -sf $(lib)$(NCURSES_LIB_SUFFIX).so $(STAGING_DIR)/usr/lib/$(lib).so
  90. )
  91. ln -sf libncurses$(NCURSES_LIB_SUFFIX).so \
  92. $(STAGING_DIR)/usr/lib/libcurses.so
  93. endef
  94. define NCURSES_LINK_PC
  95. $(foreach pc,$(NCURSES_LIBS), \
  96. ln -sf $(pc)$(NCURSES_LIB_SUFFIX).pc \
  97. $(STAGING_DIR)/usr/lib/pkgconfig/$(pc).pc
  98. )
  99. endef
  100. NCURSES_LINK_STAGING_LIBS = \
  101. $(if $(BR2_STATIC_LIBS)$(BR2_SHARED_STATIC_LIBS),$(call NCURSES_LINK_LIBS_STATIC);) \
  102. $(if $(BR2_SHARED_LIBS)$(BR2_SHARED_STATIC_LIBS),$(call NCURSES_LINK_LIBS_SHARED))
  103. NCURSES_LINK_STAGING_PC = $(call NCURSES_LINK_PC)
  104. NCURSES_CONF_OPTS += --enable-ext-colors
  105. NCURSES_POST_INSTALL_STAGING_HOOKS += NCURSES_LINK_STAGING_LIBS
  106. NCURSES_POST_INSTALL_STAGING_HOOKS += NCURSES_LINK_STAGING_PC
  107. endif # BR2_PACKAGE_NCURSES_WCHAR
  108. ifneq ($(BR2_ENABLE_DEBUG),y)
  109. NCURSES_CONF_OPTS += --without-debug
  110. endif
  111. # ncurses breaks with parallel build, but takes quite a while to
  112. # build single threaded. Work around it similar to how Gentoo does
  113. define NCURSES_BUILD_CMDS
  114. $(TARGET_MAKE_ENV) $(MAKE1) -C $(@D) DESTDIR=$(STAGING_DIR) sources
  115. rm -rf $(@D)/misc/pc-files
  116. $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(STAGING_DIR)
  117. endef
  118. ifeq ($(BR2_PACKAGE_NCURSES_TARGET_PROGS),y)
  119. define NCURSES_TARGET_SYMLINK_RESET
  120. ln -sf tset $(TARGET_DIR)/usr/bin/reset
  121. endef
  122. NCURSES_POST_INSTALL_TARGET_HOOKS += NCURSES_TARGET_SYMLINK_RESET
  123. endif
  124. define NCURSES_TARGET_CLEANUP_TERMINFO
  125. $(RM) -rf $(TARGET_DIR)/usr/share/terminfo $(TARGET_DIR)/usr/share/tabset
  126. $(foreach t,$(NCURSES_TERMINFO_FILES), \
  127. $(INSTALL) -D -m 0644 $(STAGING_DIR)/usr/share/terminfo/$(t) \
  128. $(TARGET_DIR)/usr/share/terminfo/$(t)
  129. )
  130. endef
  131. NCURSES_POST_INSTALL_TARGET_HOOKS += NCURSES_TARGET_CLEANUP_TERMINFO
  132. HOST_NCURSES_CONF_ENV = \
  133. ac_cv_path_LDCONFIG=""
  134. HOST_NCURSES_CONF_OPTS = \
  135. --with-shared \
  136. --without-gpm \
  137. --without-manpages \
  138. --without-cxx \
  139. --without-cxx-binding \
  140. --without-ada \
  141. --with-default-terminfo-dir=/usr/share/terminfo \
  142. --disable-db-install \
  143. --without-normal
  144. $(eval $(autotools-package))
  145. $(eval $(host-autotools-package))