Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 948052
Collapse All | Expand All

(-)a/net-wireless/wpa_supplicant/files/wpa_supplicant-2.10-use-qt6.patch (+311 lines)
Line 0 Link Here
1
From 0ead8bb4889977af735f4d0b578497830ee6d6f7 Mon Sep 17 00:00:00 2001
2
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
3
Date: Fri, 10 Jan 2025 03:43:23 +0100
4
Subject: [PATCH] wpa_gui: Port to Qt6
5
6
This appears to be working. Fairly straight forward. Lightly tested.
7
Distros are getting ready to remove Qt5, so this is somewhat important
8
to do.
9
10
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
11
---
12
 wpa_supplicant/wpa_gui-qt4/eventhistory.h    |  2 +-
13
 wpa_supplicant/wpa_gui-qt4/main.cpp          |  8 ++++----
14
 wpa_supplicant/wpa_gui-qt4/networkconfig.cpp |  8 ++++----
15
 wpa_supplicant/wpa_gui-qt4/networkconfig.h   |  2 +-
16
 wpa_supplicant/wpa_gui-qt4/peers.cpp         | 10 +++++-----
17
 wpa_supplicant/wpa_gui-qt4/peers.h           |  2 +-
18
 wpa_supplicant/wpa_gui-qt4/scanresults.cpp   |  2 +-
19
 wpa_supplicant/wpa_gui-qt4/scanresults.h     |  2 +-
20
 wpa_supplicant/wpa_gui-qt4/userdatarequest.h |  2 +-
21
 wpa_supplicant/wpa_gui-qt4/wpagui.cpp        | 16 ++++++++--------
22
 wpa_supplicant/wpa_gui-qt4/wpagui.h          |  2 +-
23
 wpa_supplicant/wpa_gui-qt4/wpamsg.h          |  4 ++--
24
 12 files changed, 30 insertions(+), 30 deletions(-)
25
26
diff --git a/wpa_supplicant/wpa_gui-qt4/eventhistory.h b/wpa_supplicant/wpa_gui-qt4/eventhistory.h
27
index afd7b6346..2122ab45a 100644
28
--- a/wpa_supplicant/wpa_gui-qt4/eventhistory.h
29
+++ b/wpa_supplicant/wpa_gui-qt4/eventhistory.h
30
@@ -40,7 +40,7 @@ class EventHistory : public QDialog, public Ui::EventHistory
31
 
32
 public:
33
 	EventHistory(QWidget *parent = 0, const char *name = 0,
34
-		     bool modal = false, Qt::WindowFlags fl = 0);
35
+		     bool modal = false, Qt::WindowFlags fl = Qt::Widget);
36
 	~EventHistory();
37
 
38
 public slots:
39
diff --git a/wpa_supplicant/wpa_gui-qt4/main.cpp b/wpa_supplicant/wpa_gui-qt4/main.cpp
40
index bbd45c6e1..d395aa135 100644
41
--- a/wpa_supplicant/wpa_gui-qt4/main.cpp
42
+++ b/wpa_supplicant/wpa_gui-qt4/main.cpp
43
@@ -40,10 +40,10 @@ int main(int argc, char *argv[])
44
 	int ret;
45
 
46
 	locale = QLocale::system().name();
47
-	resourceDir = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
48
-	if (!translator.load("wpa_gui_" + locale, resourceDir))
49
-		translator.load("wpa_gui_" + locale, "lang");
50
-	app.installTranslator(&translator);
51
+	resourceDir = QLibraryInfo::path(QLibraryInfo::TranslationsPath);
52
+	if (translator.load("wpa_gui_" + locale, resourceDir) ||
53
+	    translator.load("wpa_gui_" + locale, "lang"))
54
+		app.installTranslator(&translator);
55
 
56
 	WpaGui w(&app);
57
 
58
diff --git a/wpa_supplicant/wpa_gui-qt4/networkconfig.cpp b/wpa_supplicant/wpa_gui-qt4/networkconfig.cpp
59
index 2727318bc..59af84504 100644
60
--- a/wpa_supplicant/wpa_gui-qt4/networkconfig.cpp
61
+++ b/wpa_supplicant/wpa_gui-qt4/networkconfig.cpp
62
@@ -37,7 +37,7 @@ NetworkConfig::NetworkConfig(QWidget *parent, const char *, bool,
63
 		SLOT(authChanged(int)));
64
 	connect(cancelButton, SIGNAL(clicked()), this, SLOT(close()));
65
 	connect(addButton, SIGNAL(clicked()), this, SLOT(addNetwork()));
66
-	connect(encrSelect, SIGNAL(activated(const QString &)), this,
67
+	connect(encrSelect, SIGNAL(textActivated(const QString &)), this,
68
 		SLOT(encrChanged(const QString &)));
69
 	connect(removeButton, SIGNAL(clicked()), this, SLOT(removeNetwork()));
70
 	connect(eapSelect, SIGNAL(activated(int)), this,
71
@@ -204,8 +204,8 @@ void NetworkConfig::addNetwork()
72
 	}
73
 
74
 	if (idstrEdit->isEnabled() && !idstrEdit->text().isEmpty()) {
75
-		QRegExp rx("^(\\w|-)+$");
76
-		if (rx.indexIn(idstrEdit->text()) < 0) {
77
+		QRegularExpression rx("^(\\w|-)+$");
78
+		if (!rx.match(idstrEdit->text()).hasMatch()) {
79
 			QMessageBox::warning(
80
 				this, tr("Network ID Error"),
81
 				tr("Network ID String contains non-word "
82
@@ -797,7 +797,7 @@ void NetworkConfig::removeNetwork()
83
 		    tr("This will permanently remove the network\n"
84
 		       "from the configuration. Do you really want\n"
85
 		       "to remove this network?"),
86
-		    tr("Yes"), tr("No")) != 0)
87
+		    QMessageBox::Yes, QMessageBox::No) != 0)
88
 		return;
89
 
90
 	snprintf(cmd, sizeof(cmd), "REMOVE_NETWORK %d", edit_network_id);
91
diff --git a/wpa_supplicant/wpa_gui-qt4/networkconfig.h b/wpa_supplicant/wpa_gui-qt4/networkconfig.h
92
index fd09dec54..a3a7d9792 100644
93
--- a/wpa_supplicant/wpa_gui-qt4/networkconfig.h
94
+++ b/wpa_supplicant/wpa_gui-qt4/networkconfig.h
95
@@ -20,7 +20,7 @@ class NetworkConfig : public QDialog, public Ui::NetworkConfig
96
 
97
 public:
98
 	NetworkConfig(QWidget *parent = 0, const char *name = 0,
99
-		      bool modal = false, Qt::WindowFlags fl = 0);
100
+		      bool modal = false, Qt::WindowFlags fl = Qt::Widget);
101
 	~NetworkConfig();
102
 
103
 	virtual void paramsFromScanResults(QTreeWidgetItem *sel);
104
diff --git a/wpa_supplicant/wpa_gui-qt4/peers.cpp b/wpa_supplicant/wpa_gui-qt4/peers.cpp
105
index 0a0b3ffcb..268aba8b3 100644
106
--- a/wpa_supplicant/wpa_gui-qt4/peers.cpp
107
+++ b/wpa_supplicant/wpa_gui-qt4/peers.cpp
108
@@ -403,7 +403,7 @@ void Peers::ctx_p2p_start_group()
109
 
110
 void Peers::add_station(QString info)
111
 {
112
-	QStringList lines = info.split(QRegExp("\\n"));
113
+	QStringList lines = info.split(QRegularExpression("\\n"));
114
 	QString name;
115
 
116
 	for (QStringList::Iterator it = lines.begin();
117
@@ -518,7 +518,7 @@ void Peers::add_p2p_group_client(QStandardItem * /*parent*/, QString params)
118
 	 */
119
 
120
 	QStringList items =
121
-		params.split(QRegExp(" (?=[^']*('[^']*'[^']*)*$)"));
122
+		params.split(QRegularExpression(" (?=[^']*('[^']*'[^']*)*$)"));
123
 	QString addr = "";
124
 	QString name = "";
125
 	int config_methods = 0;
126
@@ -591,7 +591,7 @@ bool Peers::add_bss(const char *cmd)
127
 	QString ssid, bssid, flags, wps_name, pri_dev_type;
128
 	int id = -1;
129
 
130
-	QStringList lines = bss.split(QRegExp("\\n"));
131
+	QStringList lines = bss.split(QRegularExpression("\\n"));
132
 	for (QStringList::Iterator it = lines.begin();
133
 	     it != lines.end(); it++) {
134
 		int pos = (*it).indexOf('=') + 1;
135
@@ -643,7 +643,7 @@ bool Peers::add_bss(const char *cmd)
136
 			item->setData(ssid, peer_role_ssid);
137
 		model.appendRow(item);
138
 
139
-		lines = bss.split(QRegExp("\\n"));
140
+		lines = bss.split(QRegularExpression("\\n"));
141
 		for (QStringList::Iterator it = lines.begin();
142
 		     it != lines.end(); it++) {
143
 			if ((*it).startsWith("p2p_group_client:"))
144
@@ -903,7 +903,7 @@ void Peers::event_notify(WpaMsg msg)
145
 		 * group_capab=0x0
146
 		 */
147
 		QStringList items =
148
-			text.split(QRegExp(" (?=[^']*('[^']*'[^']*)*$)"));
149
+			text.split(QRegularExpression(" (?=[^']*('[^']*'[^']*)*$)"));
150
 		QString addr = items[1];
151
 		QString name = "";
152
 		QString pri_dev_type;
153
diff --git a/wpa_supplicant/wpa_gui-qt4/peers.h b/wpa_supplicant/wpa_gui-qt4/peers.h
154
index bb7373749..c44bba99a 100644
155
--- a/wpa_supplicant/wpa_gui-qt4/peers.h
156
+++ b/wpa_supplicant/wpa_gui-qt4/peers.h
157
@@ -22,7 +22,7 @@ class Peers : public QDialog, public Ui::Peers
158
 
159
 public:
160
 	Peers(QWidget *parent = 0, const char *name = 0,
161
-		    bool modal = false, Qt::WindowFlags fl = 0);
162
+		    bool modal = false, Qt::WindowFlags fl = Qt::Widget);
163
 	~Peers();
164
 	void setWpaGui(WpaGui *_wpagui);
165
 	void event_notify(WpaMsg msg);
166
diff --git a/wpa_supplicant/wpa_gui-qt4/scanresults.cpp b/wpa_supplicant/wpa_gui-qt4/scanresults.cpp
167
index a2e3072fb..ba04b4f38 100644
168
--- a/wpa_supplicant/wpa_gui-qt4/scanresults.cpp
169
+++ b/wpa_supplicant/wpa_gui-qt4/scanresults.cpp
170
@@ -77,7 +77,7 @@ void ScanResults::updateResults()
171
 
172
 		QString ssid, bssid, freq, signal, flags;
173
 
174
-		QStringList lines = bss.split(QRegExp("\\n"));
175
+		QStringList lines = bss.split(QRegularExpression("\\n"));
176
 		for (QStringList::Iterator it = lines.begin();
177
 		     it != lines.end(); it++) {
178
 			int pos = (*it).indexOf('=') + 1;
179
diff --git a/wpa_supplicant/wpa_gui-qt4/scanresults.h b/wpa_supplicant/wpa_gui-qt4/scanresults.h
180
index 2cddd133f..39bba90ce 100644
181
--- a/wpa_supplicant/wpa_gui-qt4/scanresults.h
182
+++ b/wpa_supplicant/wpa_gui-qt4/scanresults.h
183
@@ -20,7 +20,7 @@ class ScanResults : public QDialog, public Ui::ScanResults
184
 
185
 public:
186
 	ScanResults(QWidget *parent = 0, const char *name = 0,
187
-		    bool modal = false, Qt::WindowFlags fl = 0);
188
+		    bool modal = false, Qt::WindowFlags fl = Qt::Widget);
189
 	~ScanResults();
190
 
191
 public slots:
192
diff --git a/wpa_supplicant/wpa_gui-qt4/userdatarequest.h b/wpa_supplicant/wpa_gui-qt4/userdatarequest.h
193
index b6d1ad2f4..3f7dccb28 100644
194
--- a/wpa_supplicant/wpa_gui-qt4/userdatarequest.h
195
+++ b/wpa_supplicant/wpa_gui-qt4/userdatarequest.h
196
@@ -20,7 +20,7 @@ class UserDataRequest : public QDialog, public Ui::UserDataRequest
197
 
198
 public:
199
 	UserDataRequest(QWidget *parent = 0, const char *name = 0,
200
-			bool modal = false, Qt::WindowFlags fl = 0);
201
+			bool modal = false, Qt::WindowFlags fl = Qt::Widget);
202
 	~UserDataRequest();
203
 
204
 	int setParams(WpaGui *_wpagui, const char *reqMsg);
205
diff --git a/wpa_supplicant/wpa_gui-qt4/wpagui.cpp b/wpa_supplicant/wpa_gui-qt4/wpagui.cpp
206
index 9404ab424..0c125d90f 100644
207
--- a/wpa_supplicant/wpa_gui-qt4/wpagui.cpp
208
+++ b/wpa_supplicant/wpa_gui-qt4/wpagui.cpp
209
@@ -99,9 +99,9 @@ WpaGui::WpaGui(QApplication *_app, QWidget *parent, const char *,
210
 	connect(disconnectButton, SIGNAL(clicked()), this, SLOT(disconnect()));
211
 	connect(scanButton, SIGNAL(clicked()), this, SLOT(scan()));
212
 	connect(connectButton, SIGNAL(clicked()), this, SLOT(connectB()));
213
-	connect(adapterSelect, SIGNAL(activated(const QString&)), this,
214
+	connect(adapterSelect, SIGNAL(textActivated(const QString&)), this,
215
 		SLOT(selectAdapter(const QString&)));
216
-	connect(networkSelect, SIGNAL(activated(const QString&)), this,
217
+	connect(networkSelect, SIGNAL(textActivated(const QString&)), this,
218
 		SLOT(selectNetwork(const QString&)));
219
 	connect(addNetworkButton, SIGNAL(clicked()), this, SLOT(addNetwork()));
220
 	connect(editNetworkButton, SIGNAL(clicked()), this,
221
@@ -1078,7 +1078,7 @@ void WpaGui::selectNetwork( const QString &sel )
222
 	char reply[10];
223
 	size_t reply_len = sizeof(reply);
224
 
225
-	if (cmd.contains(QRegExp("^\\d+:")))
226
+	if (cmd.contains(QRegularExpression("^\\d+:")))
227
 		cmd.truncate(cmd.indexOf(':'));
228
 	else
229
 		cmd = "any";
230
@@ -1095,7 +1095,7 @@ void WpaGui::enableNetwork(const QString &sel)
231
 	char reply[10];
232
 	size_t reply_len = sizeof(reply);
233
 
234
-	if (cmd.contains(QRegExp("^\\d+:")))
235
+	if (cmd.contains(QRegularExpression("^\\d+:")))
236
 		cmd.truncate(cmd.indexOf(':'));
237
 	else if (!cmd.startsWith("all")) {
238
 		debug("Invalid editNetwork '%s'",
239
@@ -1114,7 +1114,7 @@ void WpaGui::disableNetwork(const QString &sel)
240
 	char reply[10];
241
 	size_t reply_len = sizeof(reply);
242
 
243
-	if (cmd.contains(QRegExp("^\\d+:")))
244
+	if (cmd.contains(QRegularExpression("^\\d+:")))
245
 		cmd.truncate(cmd.indexOf(':'));
246
 	else if (!cmd.startsWith("all")) {
247
 		debug("Invalid editNetwork '%s'",
248
@@ -1132,7 +1132,7 @@ void WpaGui::editNetwork(const QString &sel)
249
 	QString cmd(sel);
250
 	int id = -1;
251
 
252
-	if (cmd.contains(QRegExp("^\\d+:"))) {
253
+	if (cmd.contains(QRegularExpression("^\\d+:"))) {
254
 		cmd.truncate(cmd.indexOf(':'));
255
 		id = cmd.toInt();
256
 	}
257
@@ -1204,7 +1204,7 @@ void WpaGui::removeNetwork(const QString &sel)
258
 	char reply[10];
259
 	size_t reply_len = sizeof(reply);
260
 
261
-	if (cmd.contains(QRegExp("^\\d+:")))
262
+	if (cmd.contains(QRegularExpression("^\\d+:")))
263
 		cmd.truncate(cmd.indexOf(':'));
264
 	else if (!cmd.startsWith("all")) {
265
 		debug("Invalid editNetwork '%s'",
266
@@ -1476,7 +1476,7 @@ void WpaGui::showTrayStatus()
267
 
268
 	QString msg, status(buf);
269
 
270
-	QStringList lines = status.split(QRegExp("\\n"));
271
+	QStringList lines = status.split(QRegularExpression("\\n"));
272
 	for (QStringList::Iterator it = lines.begin();
273
 	     it != lines.end(); it++) {
274
 		int pos = (*it).indexOf('=') + 1;
275
diff --git a/wpa_supplicant/wpa_gui-qt4/wpagui.h b/wpa_supplicant/wpa_gui-qt4/wpagui.h
276
index f0a34c97e..898722bd9 100644
277
--- a/wpa_supplicant/wpa_gui-qt4/wpagui.h
278
+++ b/wpa_supplicant/wpa_gui-qt4/wpagui.h
279
@@ -49,7 +49,7 @@ public:
280
 	};
281
 
282
 	WpaGui(QApplication *app, QWidget *parent = 0, const char *name = 0,
283
-	       Qt::WindowFlags fl = 0);
284
+	       Qt::WindowFlags fl = Qt::Widget);
285
 	~WpaGui();
286
 
287
 	virtual int ctrlRequest(const char *cmd, char *buf, size_t *buflen);
288
diff --git a/wpa_supplicant/wpa_gui-qt4/wpamsg.h b/wpa_supplicant/wpa_gui-qt4/wpamsg.h
289
index 8f2fcdc41..fe36e2044 100644
290
--- a/wpa_supplicant/wpa_gui-qt4/wpamsg.h
291
+++ b/wpa_supplicant/wpa_gui-qt4/wpamsg.h
292
@@ -10,7 +10,7 @@
293
 #define WPAMSG_H
294
 
295
 #include <QDateTime>
296
-#include <QLinkedList>
297
+#include <QList>
298
 
299
 class WpaMsg {
300
 public:
301
@@ -30,6 +30,6 @@ private:
302
 	QDateTime timestamp;
303
 };
304
 
305
-typedef QLinkedList<WpaMsg> WpaMsgList;
306
+typedef QList<WpaMsg> WpaMsgList;
307
 
308
 #endif /* WPAMSG_H */
309
-- 
310
2.48.0
311
(-)a/net-wireless/wpa_supplicant/wpa_supplicant-2.10-r6.ebuild (+478 lines)
Line 0 Link Here
1
# Copyright 1999-2025 Gentoo Authors
2
# Distributed under the terms of the GNU General Public License v2
3
4
EAPI=8
5
6
inherit desktop linux-info qmake-utils readme.gentoo-r1 systemd toolchain-funcs
7
8
DESCRIPTION="IEEE 802.1X/WPA supplicant for secure wireless transfers"
9
HOMEPAGE="https://w1.fi/wpa_supplicant/"
10
LICENSE="|| ( GPL-2 BSD )"
11
12
if [ "${PV}" = "9999" ]; then
13
	inherit git-r3
14
	EGIT_REPO_URI="https://w1.fi/hostap.git"
15
else
16
	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86"
17
	SRC_URI="https://w1.fi/releases/${P}.tar.gz"
18
fi
19
20
SLOT="0"
21
IUSE="ap broadcom-sta dbus eap-sim eapol-test fasteap +fils +hs2-0 macsec +mbo +mesh p2p privsep ps3 qt6 readline selinux smartcard tdls tkip uncommon-eap-types wep wimax wps"
22
23
# CONFIG_PRIVSEP=y does not have sufficient support for the new driver
24
# interface functions used for MACsec, so this combination cannot be used
25
# at least for now. bug #684442
26
REQUIRED_USE="
27
	macsec? ( !privsep )
28
	privsep? ( !macsec )
29
	broadcom-sta? ( !fils !mesh !mbo )
30
"
31
32
DEPEND="
33
	>=dev-libs/openssl-1.0.2k:=
34
	dbus? ( sys-apps/dbus )
35
	kernel_linux? (
36
		>=dev-libs/libnl-3.2:3
37
		eap-sim? ( sys-apps/pcsc-lite )
38
	)
39
	!kernel_linux? ( net-libs/libpcap )
40
	qt6? (
41
		dev-qt/qtbase:6[gui,widgets]
42
		dev-qt/qtsvg:6
43
	)
44
	readline? (
45
		sys-libs/ncurses:0=
46
		sys-libs/readline:0=
47
	)
48
"
49
RDEPEND="${DEPEND}
50
	selinux? ( sec-policy/selinux-networkmanager )
51
	kernel_linux? (
52
		net-wireless/wireless-regdb
53
	)
54
"
55
BDEPEND="virtual/pkgconfig"
56
57
DOC_CONTENTS="
58
	If this is a clean installation of wpa_supplicant, you
59
	have to create a configuration file named
60
	/etc/wpa_supplicant/wpa_supplicant.conf
61
	An example configuration file is available for reference in
62
	/usr/share/doc/${PF}/
63
"
64
65
S="${WORKDIR}/${P}/${PN}"
66
67
Kconfig_style_config() {
68
		#param 1 is CONFIG_* item
69
		#param 2 is what to set it = to, defaulting in y
70
		CONFIG_PARAM="${CONFIG_HEADER:-CONFIG_}$1"
71
		setting="${2:-y}"
72
73
		if [ ! $setting = n ]; then
74
			#first remove any leading "# " if $2 is not n
75
			sed -i "/^# *$CONFIG_PARAM=/s/^# *//" .config || echo "Kconfig_style_config error uncommenting $CONFIG_PARAM"
76
			#set item = $setting (defaulting to y)
77
			if ! sed -i "/^$CONFIG_PARAM\>/s/=.*/=$setting/" .config; then
78
				echo "Kconfig_style_config error setting $CONFIG_PARAM=$setting"
79
			fi
80
			if [ -z "$( grep ^$CONFIG_PARAM= .config )" ] ; then
81
				echo "$CONFIG_PARAM=$setting" >>.config
82
			fi
83
		else
84
			#ensure item commented out
85
			if ! sed -i "/^$CONFIG_PARAM\>/s/$CONFIG_PARAM/# $CONFIG_PARAM/" .config; then
86
				echo "Kconfig_style_config error commenting $CONFIG_PARAM"
87
			fi
88
		fi
89
}
90
91
src_prepare() {
92
	default
93
94
	# net/bpf.h needed for net-libs/libpcap on Gentoo/FreeBSD
95
	sed -i \
96
		-e "s:\(#include <pcap\.h>\):#include <net/bpf.h>\n\1:" \
97
		../src/l2_packet/l2_packet_freebsd.c || die
98
99
	# Change configuration to match Gentoo locations (bug #143750)
100
	sed -i \
101
		-e "s:/usr/lib/opensc:/usr/$(get_libdir):" \
102
		-e "s:/usr/lib/pkcs11:/usr/$(get_libdir):" \
103
		wpa_supplicant.conf || die
104
105
	# systemd entries to D-Bus service files (bug #372877)
106
	echo 'SystemdService=wpa_supplicant.service' \
107
		| tee -a dbus/*.service >/dev/null || die
108
109
	cd "${WORKDIR}/${P}" || die
110
111
	if use wimax; then
112
		# generate-libeap-peer.patch comes before
113
		# fix-undefined-reference-to-random_get_bytes.patch
114
		eapply "${FILESDIR}/${P}-generate-libeap-peer.patch"
115
116
		# multilib-strict fix (bug #373685)
117
		sed -e "s/\/usr\/lib/\/usr\/$(get_libdir)/" -i src/eap_peer/Makefile || die
118
	fi
119
120
	# bug (320097)
121
	eapply "${FILESDIR}/${PN}-2.6-do-not-call-dbus-functions-with-NULL-path.patch"
122
123
	# bug (912315)
124
	eapply "${FILESDIR}/${PN}-2.10-allow-legacy-renegotiation.patch"
125
	eapply "${FILESDIR}/${PN}-2.10-Drop-security-level-to-0-with-OpenSSL-3.0-wh.patch"
126
127
	# bug (948052)
128
	eapply "${FILESDIR}/${PN}-2.10-use-qt6.patch"
129
130
	# bug (640492)
131
	sed -i 's#-Werror ##' wpa_supplicant/Makefile || die
132
}
133
134
src_configure() {
135
	# Toolchain setup
136
	tc-export CC PKG_CONFIG
137
138
	cp defconfig .config || die
139
140
	# Basic setup
141
	Kconfig_style_config CTRL_IFACE
142
	Kconfig_style_config MATCH_IFACE
143
	Kconfig_style_config BACKEND file
144
	Kconfig_style_config IBSS_RSN
145
	Kconfig_style_config IEEE80211W
146
	Kconfig_style_config IEEE80211R
147
	Kconfig_style_config HT_OVERRIDES
148
	Kconfig_style_config VHT_OVERRIDES
149
	Kconfig_style_config OCV
150
	Kconfig_style_config TLSV11
151
	Kconfig_style_config TLSV12
152
	Kconfig_style_config GETRANDOM
153
154
	# Basic authentication methods
155
	# NOTE: we don't set GPSK or SAKE as they conflict
156
	# with the below options
157
	Kconfig_style_config EAP_GTC
158
	Kconfig_style_config EAP_MD5
159
	Kconfig_style_config EAP_OTP
160
	Kconfig_style_config EAP_PAX
161
	Kconfig_style_config EAP_PSK
162
	Kconfig_style_config EAP_TLV
163
	Kconfig_style_config EAP_EXE
164
	Kconfig_style_config IEEE8021X_EAPOL
165
	Kconfig_style_config PKCS12
166
	Kconfig_style_config PEERKEY
167
	Kconfig_style_config EAP_LEAP
168
	Kconfig_style_config EAP_MSCHAPV2
169
	Kconfig_style_config EAP_PEAP
170
	Kconfig_style_config EAP_TEAP
171
	Kconfig_style_config EAP_TLS
172
	Kconfig_style_config EAP_TTLS
173
174
	# Enabling background scanning.
175
	Kconfig_style_config BGSCAN_SIMPLE
176
	Kconfig_style_config BGSCAN_LEARN
177
178
	if use dbus ; then
179
		Kconfig_style_config CTRL_IFACE_DBUS
180
		Kconfig_style_config CTRL_IFACE_DBUS_NEW
181
		Kconfig_style_config CTRL_IFACE_DBUS_INTRO
182
	else
183
		Kconfig_style_config CTRL_IFACE_DBUS n
184
		Kconfig_style_config CTRL_IFACE_DBUS_NEW n
185
		Kconfig_style_config CTRL_IFACE_DBUS_INTRO n
186
	fi
187
188
	if use eapol-test ; then
189
		Kconfig_style_config EAPOL_TEST
190
	fi
191
192
	# Enable support for writing debug info to a log file and syslog.
193
	Kconfig_style_config DEBUG_FILE
194
	Kconfig_style_config DEBUG_SYSLOG
195
196
	if use hs2-0 ; then
197
		Kconfig_style_config INTERWORKING
198
		Kconfig_style_config HS20
199
	fi
200
201
	if use mbo ; then
202
		Kconfig_style_config MBO
203
	else
204
		Kconfig_style_config MBO n
205
	fi
206
207
	if use uncommon-eap-types; then
208
		Kconfig_style_config EAP_GPSK
209
		Kconfig_style_config EAP_SAKE
210
		Kconfig_style_config EAP_GPSK_SHA256
211
		Kconfig_style_config EAP_IKEV2
212
		Kconfig_style_config EAP_EKE
213
	fi
214
215
	if use eap-sim ; then
216
		# Smart card authentication
217
		Kconfig_style_config EAP_SIM
218
		Kconfig_style_config EAP_AKA
219
		Kconfig_style_config EAP_AKA_PRIME
220
		Kconfig_style_config PCSC
221
	fi
222
223
	if use fasteap ; then
224
		Kconfig_style_config EAP_FAST
225
	fi
226
227
	if use readline ; then
228
		# readline/history support for wpa_cli
229
		Kconfig_style_config READLINE
230
	else
231
		#internal line edit mode for wpa_cli
232
		Kconfig_style_config WPA_CLI_EDIT
233
	fi
234
235
	Kconfig_style_config TLS openssl
236
	Kconfig_style_config FST
237
238
	Kconfig_style_config EAP_PWD
239
	if use fils; then
240
		Kconfig_style_config FILS
241
		Kconfig_style_config FILS_SK_PFS
242
	fi
243
	if use mesh; then
244
		Kconfig_style_config MESH
245
	else
246
		Kconfig_style_config MESH n
247
	fi
248
	# WPA3
249
	Kconfig_style_config OWE
250
	Kconfig_style_config SAE
251
	Kconfig_style_config DPP
252
	Kconfig_style_config DPP2
253
	Kconfig_style_config SUITEB192
254
	Kconfig_style_config SUITEB
255
256
	if use wep ; then
257
		Kconfig_style_config WEP
258
	else
259
		Kconfig_style_config WEP n
260
	fi
261
262
	# Watch out, reversed logic
263
	if use tkip ; then
264
		Kconfig_style_config NO_TKIP n
265
	else
266
		Kconfig_style_config NO_TKIP
267
	fi
268
269
	if use smartcard ; then
270
		Kconfig_style_config SMARTCARD
271
	else
272
		Kconfig_style_config SMARTCARD n
273
	fi
274
275
	if use tdls ; then
276
		Kconfig_style_config TDLS
277
	fi
278
279
	if use kernel_linux ; then
280
		# Linux specific drivers
281
		Kconfig_style_config DRIVER_ATMEL
282
		Kconfig_style_config DRIVER_HOSTAP
283
		Kconfig_style_config DRIVER_IPW
284
		Kconfig_style_config DRIVER_NL80211
285
		Kconfig_style_config DRIVER_RALINK
286
		Kconfig_style_config DRIVER_WEXT
287
		Kconfig_style_config DRIVER_WIRED
288
289
		if use macsec ; then
290
			#requires something, no idea what
291
			#Kconfig_style_config DRIVER_MACSEC_QCA
292
			Kconfig_style_config DRIVER_MACSEC_LINUX
293
			Kconfig_style_config MACSEC
294
		else
295
			# bug #831369 and bug #684442
296
			Kconfig_style_config DRIVER_MACSEC_LINUX n
297
			Kconfig_style_config MACSEC n
298
		fi
299
300
		if use ps3 ; then
301
			Kconfig_style_config DRIVER_PS3
302
		fi
303
	fi
304
305
	# Wi-Fi Protected Setup (WPS)
306
	if use wps ; then
307
		Kconfig_style_config WPS
308
		Kconfig_style_config WPS2
309
		# USB Flash Drive
310
		Kconfig_style_config WPS_UFD
311
		# External Registrar
312
		Kconfig_style_config WPS_ER
313
		# Universal Plug'n'Play
314
		Kconfig_style_config WPS_UPNP
315
		# Near Field Communication
316
		Kconfig_style_config WPS_NFC
317
	else
318
		Kconfig_style_config WPS n
319
		Kconfig_style_config WPS2 n
320
		Kconfig_style_config WPS_UFD n
321
		Kconfig_style_config WPS_ER n
322
		Kconfig_style_config WPS_UPNP n
323
		Kconfig_style_config WPS_NFC n
324
	fi
325
326
	# Wi-Fi Direct (WiDi)
327
	if use p2p ; then
328
		Kconfig_style_config P2P
329
		Kconfig_style_config WIFI_DISPLAY
330
	else
331
		Kconfig_style_config P2P n
332
		Kconfig_style_config WIFI_DISPLAY n
333
	fi
334
335
	# Access Point Mode
336
	if use ap ; then
337
		Kconfig_style_config AP
338
	else
339
		Kconfig_style_config AP n
340
	fi
341
342
	# Enable essentials for AP/P2P
343
	if use ap || use p2p ; then
344
		# Enabling HT support (802.11n)
345
		Kconfig_style_config IEEE80211N
346
347
		# Enabling VHT support (802.11ac)
348
		Kconfig_style_config IEEE80211AC
349
	fi
350
351
	# Enable mitigation against certain attacks against TKIP
352
	Kconfig_style_config DELAYED_MIC_ERROR_REPORT
353
354
	if use privsep ; then
355
		Kconfig_style_config PRIVSEP
356
	fi
357
358
	if use kernel_linux ; then
359
		Kconfig_style_config LIBNL32
360
	fi
361
362
	if use qt6 ; then
363
		pushd "${S}"/wpa_gui-qt4 > /dev/null || die
364
		eqmake6 wpa_gui.pro
365
		popd > /dev/null || die
366
	fi
367
}
368
369
src_compile() {
370
	einfo "Building wpa_supplicant"
371
	emake V=1 BINDIR=/usr/sbin
372
373
	if use wimax; then
374
		emake -C ../src/eap_peer clean
375
		emake -C ../src/eap_peer
376
	fi
377
378
	if use qt6; then
379
		einfo "Building wpa_gui"
380
		emake -C "${S}"/wpa_gui-qt4
381
	fi
382
383
	if use eapol-test ; then
384
		emake eapol_test
385
	fi
386
}
387
388
src_install() {
389
	dosbin wpa_supplicant
390
	use privsep && dosbin wpa_priv
391
	dobin wpa_cli wpa_passphrase
392
393
	newinitd "${FILESDIR}/${PN}-init.d" wpa_supplicant
394
	newconfd "${FILESDIR}/${PN}-conf.d" wpa_supplicant
395
396
	exeinto /etc/wpa_supplicant/
397
	newexe "${FILESDIR}/wpa_cli-r1.sh" wpa_cli.sh
398
399
	readme.gentoo_create_doc
400
	dodoc ChangeLog {eap_testing,todo}.txt README{,-WPS} \
401
		wpa_supplicant.conf
402
403
	newdoc .config build-config
404
405
	if [ "${PV}" != "9999" ]; then
406
		doman doc/docbook/*.{5,8}
407
	fi
408
409
	if use qt6 ; then
410
		into /usr
411
		dobin wpa_gui-qt4/wpa_gui
412
		doicon wpa_gui-qt4/icons/wpa_gui.svg
413
		domenu wpa_gui-qt4/wpa_gui.desktop
414
	else
415
		rm "${ED}"/usr/share/man/man8/wpa_gui.8
416
	fi
417
418
	use wimax && emake DESTDIR="${D}" -C ../src/eap_peer install
419
420
	if use dbus ; then
421
		pushd "${S}"/dbus > /dev/null || die
422
		insinto /etc/dbus-1/system.d
423
		newins dbus-wpa_supplicant.conf wpa_supplicant.conf
424
		insinto /usr/share/dbus-1/system-services
425
		doins fi.w1.wpa_supplicant1.service
426
		popd > /dev/null || die
427
428
		# This unit relies on dbus support, bug 538600.
429
		systemd_dounit systemd/wpa_supplicant.service
430
	fi
431
432
	if use eapol-test ; then
433
		dobin eapol_test
434
	fi
435
436
	systemd_dounit "systemd/wpa_supplicant@.service"
437
	systemd_dounit "systemd/wpa_supplicant-nl80211@.service"
438
	systemd_dounit "systemd/wpa_supplicant-wired@.service"
439
}
440
441
pkg_postinst() {
442
	readme.gentoo_print_elog
443
444
	if [[ -e "${EROOT}"/etc/wpa_supplicant.conf ]] ; then
445
		echo
446
		ewarn "WARNING: your old configuration file ${EROOT}/etc/wpa_supplicant.conf"
447
		ewarn "needs to be moved to ${EROOT}/etc/wpa_supplicant/wpa_supplicant.conf"
448
	fi
449
	if ! use wep; then
450
		einfo "WARNING: You are building with WEP support disabled, which is recommended since"
451
		einfo "this protocol is deprecated and insecure.  If you still need to connect to"
452
		einfo "WEP-enabled networks, you may turn this flag back on.  With this flag off,"
453
		einfo "WEP-enabled networks will not even show up as available."
454
		einfo "If your network is missing you may wish to USE=wep"
455
	fi
456
	if ! use tkip; then
457
		ewarn "WARNING: You are building with TKIP support disabled, which is recommended since"
458
		ewarn "this protocol is deprecated and insecure.  If you still need to connect to"
459
		ewarn "TKIP-enabled networks, you may turn this flag back on.  With this flag off,"
460
		ewarn "TKIP-enabled networks, including mixed mode TKIP/AES-CCMP will not even show up"
461
		ewarn "as available.  If your network is missing you may wish to USE=tkip"
462
	fi
463
464
	# Mea culpa, feel free to remove that after some time --mgorny.
465
	local fn
466
	for fn in wpa_supplicant{,@wlan0}.service; do
467
		if [[ -e "${EROOT}"/etc/systemd/system/network.target.wants/${fn} ]]
468
		then
469
			ebegin "Moving ${fn} to multi-user.target"
470
			mv "${EROOT}"/etc/systemd/system/network.target.wants/${fn} \
471
				"${EROOT}"/etc/systemd/system/multi-user.target.wants/ || die
472
			eend ${?} \
473
				"Please try to re-enable ${fn}"
474
		fi
475
	done
476
477
	systemd_reenable wpa_supplicant.service
478
}
(-)a/net-wireless/wpa_supplicant/wpa_supplicant-9999.ebuild (-12 / +12 lines)
Lines 1-4 Link Here
1
# Copyright 1999-2024 Gentoo Authors
1
# Copyright 1999-2025 Gentoo Authors
2
# Distributed under the terms of the GNU General Public License v2
2
# Distributed under the terms of the GNU General Public License v2
3
3
4
EAPI=8
4
EAPI=8
Lines 18-24 else Link Here
18
fi
18
fi
19
19
20
SLOT="0"
20
SLOT="0"
21
IUSE="ap broadcom-sta dbus eap-sim eapol-test fasteap +fils +hs2-0 macsec +mbo +mesh p2p privsep ps3 qt5 readline selinux smartcard tdls tkip uncommon-eap-types wep wimax wps"
21
IUSE="ap broadcom-sta dbus eap-sim eapol-test fasteap +fils +hs2-0 macsec +mbo +mesh p2p privsep ps3 qt6 readline selinux smartcard tdls tkip uncommon-eap-types wep wimax wps"
22
22
23
# CONFIG_PRIVSEP=y does not have sufficient support for the new driver
23
# CONFIG_PRIVSEP=y does not have sufficient support for the new driver
24
# interface functions used for MACsec, so this combination cannot be used
24
# interface functions used for MACsec, so this combination cannot be used
Lines 37-47 DEPEND=" Link Here
37
		eap-sim? ( sys-apps/pcsc-lite )
37
		eap-sim? ( sys-apps/pcsc-lite )
38
	)
38
	)
39
	!kernel_linux? ( net-libs/libpcap )
39
	!kernel_linux? ( net-libs/libpcap )
40
	qt5? (
40
	qt6? (
41
		dev-qt/qtcore:5
41
		dev-qt/qtbase:6[gui,widgets]
42
		dev-qt/qtgui:5
42
		dev-qt/qtsvg:6
43
		dev-qt/qtsvg:5
44
		dev-qt/qtwidgets:5
45
	)
43
	)
46
	readline? (
44
	readline? (
47
		sys-libs/ncurses:0=
45
		sys-libs/ncurses:0=
Lines 125-130 src_prepare() { Link Here
125
	# bug (912315)
123
	# bug (912315)
126
	eapply "${FILESDIR}/${PN}-2.10-allow-legacy-renegotiation.patch"
124
	eapply "${FILESDIR}/${PN}-2.10-allow-legacy-renegotiation.patch"
127
125
126
	# bug (948052)
127
	eapply "${FILESDIR}/${PN}-2.10-use-qt6.patch"
128
128
	# bug (640492)
129
	# bug (640492)
129
	sed -i 's#-Werror ##' wpa_supplicant/Makefile || die
130
	sed -i 's#-Werror ##' wpa_supplicant/Makefile || die
130
}
131
}
Lines 357-365 src_configure() { Link Here
357
		Kconfig_style_config LIBNL32
358
		Kconfig_style_config LIBNL32
358
	fi
359
	fi
359
360
360
	if use qt5 ; then
361
	if use qt6 ; then
361
		pushd "${S}"/wpa_gui-qt4 > /dev/null || die
362
		pushd "${S}"/wpa_gui-qt4 > /dev/null || die
362
		eqmake5 wpa_gui.pro
363
		eqmake6 wpa_gui.pro
363
		popd > /dev/null || die
364
		popd > /dev/null || die
364
	fi
365
	fi
365
}
366
}
Lines 373-379 src_compile() { Link Here
373
		emake -C ../src/eap_peer
374
		emake -C ../src/eap_peer
374
	fi
375
	fi
375
376
376
	if use qt5; then
377
	if use qt6; then
377
		einfo "Building wpa_gui"
378
		einfo "Building wpa_gui"
378
		emake -C "${S}"/wpa_gui-qt4
379
		emake -C "${S}"/wpa_gui-qt4
379
	fi
380
	fi
Lines 404-410 src_install() { Link Here
404
		doman doc/docbook/*.{5,8}
405
		doman doc/docbook/*.{5,8}
405
	fi
406
	fi
406
407
407
	if use qt5 ; then
408
	if use qt6 ; then
408
		into /usr
409
		into /usr
409
		dobin wpa_gui-qt4/wpa_gui
410
		dobin wpa_gui-qt4/wpa_gui
410
		doicon wpa_gui-qt4/icons/wpa_gui.svg
411
		doicon wpa_gui-qt4/icons/wpa_gui.svg
411
- 

Return to bug 948052