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.

128 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:=1
  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 ../../lang/python/python3-package.mk
  24. define Package/newt/Default
  25. TITLE:=Newt
  26. URL:=https://pagure.io/newt
  27. endef
  28. define Package/newt/Default/description
  29. Newt is a programming library for color text mode, widget based user
  30. interfaces. Newt can be used to add stacked windows, entry widgets,
  31. checkboxes, radio buttons, labels, plain text fields, scrollbars, etc.,
  32. to text mode user interfaces. Newt is based on the slang library.
  33. endef
  34. define Package/libnewt
  35. $(call Package/newt/Default)
  36. SECTION:=libs
  37. CATEGORY:=Libraries
  38. TITLE+= library
  39. DEPENDS:=+libslang2
  40. endef
  41. define Package/libnewt/description
  42. $(call Package/newt/Default/description)
  43. endef
  44. define Package/whiptail
  45. $(call Package/newt/Default)
  46. SECTION:=utils
  47. CATEGORY:=Utilities
  48. TITLE:=Display dialog boxes from shell scripts
  49. DEPENDS:=+libnewt +libpopt +libslang2
  50. endef
  51. define Package/whiptail/description
  52. A lightweight replacement for the dialog command (dialog boxes from shell
  53. scripts), based on libnewt.
  54. endef
  55. define Package/python3-newt
  56. $(call Package/newt/Default)
  57. SECTION:=lang
  58. CATEGORY:=Languages
  59. SUBMENU:=Python
  60. TITLE+= module for Python
  61. DEPENDS:=+libnewt +python3-light
  62. VARIANT:=python3
  63. endef
  64. define Package/python3-newt/description
  65. $(call Package/newt/Default/description)
  66. This is the Newt module for Python 3.
  67. endef
  68. TARGET_CFLAGS+= $(FPIC)
  69. CONFIGURE_ARGS+= \
  70. --enable-largefile \
  71. --with-python \
  72. --without-tcl \
  73. --without-gpm-support \
  74. --with-colorsfile=/etc/newt/palette
  75. CONFIGURE_VARS+= PYTHONVERS="python$(PYTHON3_VERSION)"
  76. MAKE_VARS+= PYTHON_CONFIG_PATH="$(STAGING_DIR)/usr/bin"
  77. Build/Compile=$(call Build/Compile/Default,)
  78. define Build/InstallDev
  79. $(INSTALL_DIR) $(1)/usr/include
  80. $(CP) $(PKG_INSTALL_DIR)/usr/include/newt.h $(1)/usr/include/
  81. $(INSTALL_DIR) $(1)/usr/lib
  82. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnewt.{a,so*} $(1)/usr/lib/
  83. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  84. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libnewt.pc $(1)/usr/lib/pkgconfig/
  85. endef
  86. define Package/libnewt/install
  87. $(INSTALL_DIR) $(1)/usr/lib
  88. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnewt.so* $(1)/usr/lib/
  89. endef
  90. define Package/whiptail/install
  91. $(INSTALL_DIR) $(1)/usr/bin
  92. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/whiptail $(1)/usr/bin/
  93. endef
  94. # Don't install files from usr/bin
  95. Py3Package/python3-newt/install:=:
  96. $(eval $(call BuildPackage,libnewt))
  97. $(eval $(call BuildPackage,whiptail))
  98. $(eval $(call Py3Package,python3-newt))
  99. $(eval $(call BuildPackage,python3-newt))
  100. $(eval $(call BuildPackage,python3-newt-src))