1 |
|
# Copyright 1999-2022 Gentoo Authors
|
|
1 |
# Copyright 1999-2023 Gentoo Authors
|
2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
3 |
3 |
|
4 |
4 |
EAPI=8
|
... | ... | |
13 |
13 |
inherit git-r3
|
14 |
14 |
EGIT_REPO_URI="https://w1.fi/hostap.git"
|
15 |
15 |
else
|
16 |
|
KEYWORDS="~alpha amd64 arm arm64 ~ia64 ~loong ~mips ppc ppc64 ~riscv ~sparc x86"
|
|
16 |
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86"
|
17 |
17 |
SRC_URI="https://w1.fi/releases/${P}.tar.gz"
|
18 |
18 |
fi
|
19 |
19 |
|
20 |
20 |
SLOT="0"
|
21 |
|
IUSE="ap +crda 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 qt5 readline selinux smartcard tdls tkip uncommon-eap-types wep wimax wps"
|
22 |
22 |
|
23 |
23 |
# CONFIG_PRIVSEP=y does not have sufficient support for the new driver
|
24 |
24 |
# interface functions used for MACsec, so this combination cannot be used
|
... | ... | |
52 |
52 |
selinux? ( sec-policy/selinux-networkmanager )
|
53 |
53 |
kernel_linux? (
|
54 |
54 |
net-wireless/wireless-regdb
|
55 |
|
crda? ( net-wireless/crda )
|
56 |
55 |
)
|
57 |
56 |
"
|
58 |
57 |
BDEPEND="virtual/pkgconfig"
|
... | ... | |
77 |
76 |
#first remove any leading "# " if $2 is not n
|
78 |
77 |
sed -i "/^# *$CONFIG_PARAM=/s/^# *//" .config || echo "Kconfig_style_config error uncommenting $CONFIG_PARAM"
|
79 |
78 |
#set item = $setting (defaulting to y)
|
80 |
|
sed -i "/^$CONFIG_PARAM\>/s/=.*/=$setting/" .config || echo "Kconfig_style_config error setting $CONFIG_PARAM=$setting"
|
|
79 |
if ! sed -i "/^$CONFIG_PARAM\>/s/=.*/=$setting/" .config; then
|
|
80 |
echo "Kconfig_style_config error setting $CONFIG_PARAM=$setting"
|
|
81 |
fi
|
81 |
82 |
if [ -z "$( grep ^$CONFIG_PARAM= .config )" ] ; then
|
82 |
83 |
echo "$CONFIG_PARAM=$setting" >>.config
|
83 |
84 |
fi
|
84 |
85 |
else
|
85 |
86 |
#ensure item commented out
|
86 |
|
sed -i "/^$CONFIG_PARAM\>/s/$CONFIG_PARAM/# $CONFIG_PARAM/" .config || echo "Kconfig_style_config error commenting $CONFIG_PARAM"
|
87 |
|
fi
|
88 |
|
}
|
89 |
|
|
90 |
|
pkg_pretend() {
|
91 |
|
CONFIG_CHECK=""
|
92 |
|
|
93 |
|
if use crda ; then
|
94 |
|
CONFIG_CHECK="${CONFIG_CHECK} ~CFG80211_CRDA_SUPPORT"
|
95 |
|
WARNING_CFG80211_CRDA_SUPPORT="REGULATORY DOMAIN PROBLEM: please enable CFG80211_CRDA_SUPPORT for proper regulatory domain support"
|
96 |
|
fi
|
97 |
|
|
98 |
|
check_extra_config
|
99 |
|
|
100 |
|
if ! use crda ; then
|
101 |
|
if linux_config_exists && linux_chkconfig_builtin CFG80211 &&
|
102 |
|
[[ $(linux_chkconfig_string EXTRA_FIRMWARE) != *regulatory.db* ]]
|
103 |
|
then
|
104 |
|
ewarn "REGULATORY DOMAIN PROBLEM:"
|
105 |
|
ewarn "With CONFIG_CFG80211=y (built-in), the driver won't be able to load regulatory.db from"
|
106 |
|
ewarn " /lib/firmware, resulting in broken regulatory domain support. Please set CONFIG_CFG80211=m"
|
107 |
|
ewarn " or add regulatory.db and regulatory.db.p7s to CONFIG_EXTRA_FIRMWARE."
|
|
87 |
if ! sed -i "/^$CONFIG_PARAM\>/s/$CONFIG_PARAM/# $CONFIG_PARAM/" .config; then
|
|
88 |
echo "Kconfig_style_config error commenting $CONFIG_PARAM"
|
|
89 |
fi
|
108 |
90 |
fi
|
109 |
|
fi
|
110 |
91 |
}
|
111 |
92 |
|
112 |
93 |
src_prepare() {
|
... | ... | |
117 |
98 |
-e "s:\(#include <pcap\.h>\):#include <net/bpf.h>\n\1:" \
|
118 |
99 |
../src/l2_packet/l2_packet_freebsd.c || die
|
119 |
100 |
|
120 |
|
# People seem to take the example configuration file too literally (bug #102361)
|
121 |
|
sed -i \
|
122 |
|
-e "s:^\(opensc_engine_path\):#\1:" \
|
123 |
|
-e "s:^\(pkcs11_engine_path\):#\1:" \
|
124 |
|
-e "s:^\(pkcs11_module_path\):#\1:" \
|
125 |
|
wpa_supplicant.conf || die
|
126 |
|
|
127 |
101 |
# Change configuration to match Gentoo locations (bug #143750)
|
128 |
102 |
sed -i \
|
129 |
103 |
-e "s:/usr/lib/opensc:/usr/$(get_libdir):" \
|