summaryrefslogtreecommitdiff
blob: 79471e659a08610bd36bdaca0753476e530cf978 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI="8"

inherit linux-mod-r1 udev unpacker

DESCRIPTION="aic8800 driver for AICSemi AIC8800/8801/8800DC/8800DW/8800FC Wifi/Bluetooth"
HOMEPAGE="https://www.aicsemi.com/ https://linux.brostrend.com/troubleshooting/source-code/"

SRC_URI="https://linux.brostrend.com/${PN}-dkms.deb -> ${P}.deb"

LICENSE="GPL-2+ firmware? ( freedist )"
SLOT="0"
KEYWORDS="~amd64"

IUSE="+firmware udev"

CONFIG_CHECK="~MAC80211 ~BT_HCIBTUSB"

BDEPEND+="
	$(unpacker_src_uri_depends)"

S="${WORKDIR}/usr/src/${P}"

src_compile() {
	MODULES_MAKEARGS+=(
		KDIR="${KV_OUT_DIR}"
	)
	emake "${MODULES_MAKEARGS[@]}"
}

src_install() {
	linux_moduleinto kernel/drivers/net/wireless/${PN}
	linux_domodule aic8800_fdrv/aic8800_fdrv.ko aic_load_fw/aic_load_fw.ko
	modules_post_process
	if use firmware; then
		insinto /lib/firmware
		doins -r "${WORKDIR}/lib/firmware/aic8800DC"
	fi
	if use udev; then
		# install udev rules for USB mode switching
		udev_newrules "${WORKDIR}/lib/udev/rules.d/aic.rules" 99-aic-modeswitch.rules
	fi
}

pkg_postinst() {
	if use udev; then
		udev_reload
	fi
	linux-mod-r1_pkg_postinst
}

pkg_postrm() {
	if use udev; then
		udev_reload
	fi
}