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