]> git.friedersdorff.com Git - max/gentoo-overlay.git/blob - net-wireless/rtl8812au/rtl8812au-9999.ebuild
www-client/qutebrowser: Allow qutebrowser to depend on PyQtWebengine
[max/gentoo-overlay.git] / net-wireless / rtl8812au / rtl8812au-9999.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 MODULES_OPTIONAL_USE="module"
7 inherit linux-mod bash-completion-r1
8
9 DESCRIPTION="Driver module for Realtek 8811, 8812, 8814 and 8821 chipsets. From aircrack-ng"
10 HOMEPAGE="https://github.com/aircrack-ng/rtl8812au.git"
11
12 if [[ ${PV} == 9999 ]]; then
13         inherit git-r3
14         EGIT_REPO_URI="https://github.com/aircrack-ng/rtl8812au"
15         KEYWORDS=""
16 else
17         die "Only support building directly from git for now"
18 fi
19
20 LICENSE="GPL-2"
21 SLOT="0"
22 IUSE="+module module-src"
23
24 MODULE_NAMES="88XXau(kernel/drivers/net/wireless)"
25 BUILD_TARGETS="modules"
26 CONFIG_CHECK=""
27
28 pkg_setup() {
29         if use module; then
30                 linux-mod_pkg_setup
31                 kernel_is -lt 3 10 0 && die "This version of ${PN} requires Linux >= 3.10"
32         fi
33 }
34
35 src_compile() {
36         BUILD_PARAMS="KERNELDIR=${KERNEL_DIR}"
37         use module && linux-mod_src_compile
38 }
39
40 src_install() {
41         use module && linux-mod_src_install
42         use module-src && dodir /usr/src && cp -r "${S}" "${ED}/usr/src/${PN}"
43 }
44
45 pkg_postinst() {
46         if use module-src && ! use module; then
47                 einfo
48                 einfo "You have enabled the module-src USE flag without the module USE"
49                 einfo "flag. This means that sources are installed to"
50                 einfo "${ROOT}usr/src/88XXau instead of having the"
51                 einfo "kernel module compiled. You will need to compile the module"
52                 einfo "yourself. Most likely, you don't want this USE flag, and should"
53                 einfo "rather use USE=module"
54                 einfo
55         fi
56         use module && linux-mod_pkg_postinst
57
58         if use module; then
59                 local old new
60                 if [[ $(uname -r) != "${KV_FULL}" ]]; then
61                         ewarn
62                         ewarn "You have just built the rtl8812AU driver for kernel ${KV_FULL}, yet the currently running"
63                         ewarn "kernel is $(uname -r). If you intend to use this driver module on the currently"
64                         ewarn "running machine, you will first need to reboot it into the kernel ${KV_FULL}, for"
65                         ewarn "which this module was built."
66                         ewarn
67                 elif [[ -f /sys/module/88XXau/version ]] && \
68                      old="$(< /sys/module/88XXau/version)" && \
69                      new="$(modinfo -F version "${ROOT}/lib/modules/${KV_FULL}/net/wireless/88XXau.ko" 2>/dev/null)" && \
70                      [[ $old != "$new" ]]; then
71                         ewarn
72                         ewarn "You appear to have just upgraded rtl8812AU from version v$old to v$new."
73                         ewarn "However, the old version is still running on your system. In order to use the"
74                         ewarn "new version, you will need to remove the old module and load the new one. As"
75                         ewarn "root, you can accomplish this with the following commands:"
76                         ewarn
77                         ewarn "    # rmmod 88XXau"
78                         ewarn "    # modprobe 88XXau"
79                         ewarn
80                 fi
81         fi
82 }