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.1 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:=1
  13. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  14. PKG_SOURCE_URL:=https://releases.pagure.org/newt
  15. PKG_HASH:=265eb46b55d7eaeb887fca7a1d51fe115658882dfe148164b6c49fccac5abb31
  16. PKG_LICENSE:=LGPL-2.0
  17. PKG_LICENSE_FILES:=COPYING
  18. PKG_CPE_ID:=cpe:/a:fedorahosted:newt
  19. PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
  20. PKG_BUILD_PARALLEL:=1
  21. PKG_INSTALL:=1
  22. include $(INCLUDE_DIR)/package.mk
  23. include $(INCLUDE_DIR)/nls.mk
  24. include ../../lang/python/python3-package.mk
  25. define Package/newt/Default
  26. TITLE:=Newt
  27. URL:=https://pagure.io/newt
  28. endef
  29. define Package/newt/Default/description
  30. Newt is a programming library for color text mode, widget based user
  31. interfaces. Newt can be used to add stacked windows, entry widgets,
  32. checkboxes, radio buttons, labels, plain text fields, scrollbars, etc.,
  33. to text mode user interfaces. Newt is based on the slang library.
  34. endef
  35. define Package/libnewt
  36. $(call Package/newt/Default)
  37. SECTION:=libs
  38. CATEGORY:=Libraries
  39. TITLE+= library
  40. DEPENDS:=+libslang2 $(INTL_DEPENDS)
  41. endef
  42. define Package/libnewt/description
  43. $(call Package/newt/Default/description)
  44. endef
  45. define Package/whiptail
  46. $(call Package/newt/Default)
  47. SECTION:=utils
  48. CATEGORY:=Utilities
  49. TITLE:=Display dialog boxes from shell scripts
  50. DEPENDS:=+libnewt +libpopt +libslang2
  51. endef
  52. define Package/whiptail/description
  53. A lightweight replacement for the dialog command (dialog boxes from shell
  54. scripts), based on libnewt.
  55. endef
  56. define Package/python3-newt
  57. $(call Package/newt/Default)
  58. SECTION:=lang
  59. CATEGORY:=Languages
  60. SUBMENU:=Python
  61. TITLE+= module for Python
  62. DEPENDS:=+libnewt +python3-light
  63. VARIANT:=python3
  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. MAKE_VARS+= PYTHON_CONFIG_PATH="$(STAGING_DIR)/host/bin"
  76. Build/Compile=$(call Build/Compile/Default,)
  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))