You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

125 lines
3.2 KiB

  1. #
  2. # Copyright (C) 2006-2011 OpenWrt.org
  3. # Copyright (C) 2011 SMBPhone Inc.
  4. # Copyright (C) 2019 Jeffery To
  5. #
  6. # This is free software, licensed under the GNU General Public License v2.
  7. # See /LICENSE for more information.
  8. #
  9. include $(TOPDIR)/rules.mk
  10. PKG_NAME:=newt
  11. PKG_VERSION:=0.52.21
  12. PKG_RELEASE:=4
  13. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  14. PKG_SOURCE_URL:=https://releases.pagure.org/newt
  15. PKG_HASH:=265eb46b55d7eaeb887fca7a1d51fe115658882dfe148164b6c49fccac5abb31
  16. PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
  17. PKG_LICENSE:=LGPL-2.0-only
  18. PKG_LICENSE_FILES:=COPYING
  19. PKG_CPE_ID:=cpe:/a:fedorahosted:newt
  20. PKG_BUILD_PARALLEL:=1
  21. PKG_INSTALL:=1
  22. PYTHON3_PKG_BUILD:=0
  23. include $(INCLUDE_DIR)/package.mk
  24. include $(INCLUDE_DIR)/nls.mk
  25. include ../../lang/python/python3-package.mk
  26. define Package/newt/Default
  27. TITLE:=Newt
  28. URL:=https://pagure.io/newt
  29. endef
  30. define Package/newt/Default/description
  31. Newt is a programming library for color text mode, widget based user
  32. interfaces. Newt can be used to add stacked windows, entry widgets,
  33. checkboxes, radio buttons, labels, plain text fields, scrollbars, etc.,
  34. to text mode user interfaces. Newt is based on the slang library.
  35. endef
  36. define Package/libnewt
  37. $(call Package/newt/Default)
  38. SECTION:=libs
  39. CATEGORY:=Libraries
  40. TITLE+= library
  41. DEPENDS:=+libslang2 $(INTL_DEPENDS)
  42. endef
  43. define Package/libnewt/description
  44. $(call Package/newt/Default/description)
  45. endef
  46. define Package/whiptail
  47. $(call Package/newt/Default)
  48. SECTION:=utils
  49. CATEGORY:=Utilities
  50. TITLE:=Display dialog boxes from shell scripts
  51. DEPENDS:=+libnewt +libpopt +libslang2
  52. endef
  53. define Package/whiptail/description
  54. A lightweight replacement for the dialog command (dialog boxes from shell
  55. scripts), based on libnewt.
  56. endef
  57. define Package/python3-newt
  58. $(call Package/newt/Default)
  59. SECTION:=lang
  60. CATEGORY:=Languages
  61. SUBMENU:=Python
  62. TITLE+= module for Python
  63. DEPENDS:=+libnewt +python3-light
  64. endef
  65. define Package/python3-newt/description
  66. $(call Package/newt/Default/description)
  67. This is the Newt module for Python 3.
  68. endef
  69. CONFIGURE_ARGS+= \
  70. --enable-largefile \
  71. --with-python=python$(PYTHON3_VERSION) \
  72. --without-tcl \
  73. --without-gpm-support \
  74. --with-colorsfile=/etc/newt/palette
  75. CONFIGURE_VARS += $(if $(CONFIG_BUILD_NLS),ac_cv_lib_c_gettext=no)
  76. MAKE_VARS+= PYTHON_CONFIG_PATH="$(STAGING_DIR)/host/bin"
  77. define Build/InstallDev
  78. $(INSTALL_DIR) $(1)/usr/include
  79. $(CP) $(PKG_INSTALL_DIR)/usr/include/newt.h $(1)/usr/include/
  80. $(INSTALL_DIR) $(1)/usr/lib
  81. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnewt.{a,so*} $(1)/usr/lib/
  82. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  83. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libnewt.pc $(1)/usr/lib/pkgconfig/
  84. endef
  85. define Package/libnewt/install
  86. $(INSTALL_DIR) $(1)/usr/lib
  87. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnewt.so* $(1)/usr/lib/
  88. endef
  89. define Package/whiptail/install
  90. $(INSTALL_DIR) $(1)/usr/bin
  91. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/whiptail $(1)/usr/bin/
  92. endef
  93. # Don't install files from usr/bin
  94. Py3Package/python3-newt/install:=:
  95. $(eval $(call BuildPackage,libnewt))
  96. $(eval $(call BuildPackage,whiptail))
  97. $(eval $(call Py3Package,python3-newt))
  98. $(eval $(call BuildPackage,python3-newt))
  99. $(eval $(call BuildPackage,python3-newt-src))