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.

129 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.20
  12. PKG_RELEASE:=2
  13. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  14. PKG_SOURCE_URL:=https://releases.pagure.org/newt
  15. PKG_HASH:=8d66ba6beffc3f786d4ccfee9d2b43d93484680ef8db9397a4fb70b5adbb6dbc
  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. TARGET_CFLAGS+= $(FPIC)
  70. CONFIGURE_ARGS+= \
  71. --enable-largefile \
  72. --with-python \
  73. --without-tcl \
  74. --without-gpm-support \
  75. --with-colorsfile=/etc/newt/palette
  76. CONFIGURE_VARS+= PYTHONVERS="python$(PYTHON3_VERSION)"
  77. MAKE_VARS+= PYTHON_CONFIG_PATH="$(STAGING_DIR)/usr/bin"
  78. Build/Compile=$(call Build/Compile/Default,)
  79. define Build/InstallDev
  80. $(INSTALL_DIR) $(1)/usr/include
  81. $(CP) $(PKG_INSTALL_DIR)/usr/include/newt.h $(1)/usr/include/
  82. $(INSTALL_DIR) $(1)/usr/lib
  83. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnewt.{a,so*} $(1)/usr/lib/
  84. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  85. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libnewt.pc $(1)/usr/lib/pkgconfig/
  86. endef
  87. define Package/libnewt/install
  88. $(INSTALL_DIR) $(1)/usr/lib
  89. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnewt.so* $(1)/usr/lib/
  90. endef
  91. define Package/whiptail/install
  92. $(INSTALL_DIR) $(1)/usr/bin
  93. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/whiptail $(1)/usr/bin/
  94. endef
  95. # Don't install files from usr/bin
  96. Py3Package/python3-newt/install:=:
  97. $(eval $(call BuildPackage,libnewt))
  98. $(eval $(call BuildPackage,whiptail))
  99. $(eval $(call Py3Package,python3-newt))
  100. $(eval $(call BuildPackage,python3-newt))
  101. $(eval $(call BuildPackage,python3-newt-src))