net-wireless/ndiswrapper: Use readme.gentoo eclass and support kernel 4.13 (#630570...
authorPacho Ramos <pacho@gentoo.org>
Tue, 12 Sep 2017 13:43:42 +0000 (15:43 +0200)
committerPacho Ramos <pacho@gentoo.org>
Tue, 12 Sep 2017 13:43:42 +0000 (15:43 +0200)
Package-Manager: Portage-2.3.8, Repoman-2.3.3

net-wireless/ndiswrapper/files/ndiswrapper-1.61-kernel-4.13.patch [new file with mode: 0644]
net-wireless/ndiswrapper/ndiswrapper-1.61.ebuild

diff --git a/net-wireless/ndiswrapper/files/ndiswrapper-1.61-kernel-4.13.patch b/net-wireless/ndiswrapper/files/ndiswrapper-1.61-kernel-4.13.patch
new file mode 100644 (file)
index 0000000..052c4d9
--- /dev/null
@@ -0,0 +1,27 @@
+commit eeac7ab831b3097005dadc64dd323f54ade30323
+Author: Felix Yan <felixonmars@archlinux.org>
+Date:   Mon Sep 11 12:52:36 2017 +0800
+
+    Add support for linux 4.13+
+
+diff --git a/ndiswrapper/driver/ntoskernel.h b/ndiswrapper/driver/ntoskernel.h
+index f1c52e51..1422bd4d 100644
+--- a/driver/ntoskernel.h
++++ b/driver/ntoskernel.h
+@@ -119,9 +119,16 @@ static cpumask_t cpumasks[NR_CPUS];
+  */
+ #include <asm/dma-mapping.h>
+ 
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0)
+ #define PCI_DMA_ALLOC_COHERENT(pci_dev,size,dma_handle)                       \
+       dma_alloc_coherent(&pci_dev->dev,size,dma_handle,               \
+                          GFP_KERNEL | __GFP_REPEAT)
++#else
++#define PCI_DMA_ALLOC_COHERENT(pci_dev,size,dma_handle)                       \
++      dma_alloc_coherent(&pci_dev->dev,size,dma_handle,               \
++                         GFP_KERNEL | __GFP_RETRY_MAYFAIL)
++#endif
++
+ #define PCI_DMA_FREE_COHERENT(pci_dev,size,cpu_addr,dma_handle)               \
+       dma_free_coherent(&pci_dev->dev,size,cpu_addr,dma_handle)
+ #define PCI_DMA_MAP_SINGLE(pci_dev,addr,size,direction)               \
index 945cacb519c09e73d5ddb7a66da9bba8c1d345fc..bcb493f1a556ed5c34752d1a589c8e4fec375942 100644 (file)
@@ -2,7 +2,7 @@
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
-inherit linux-mod toolchain-funcs
+inherit linux-mod readme.gentoo-r1 toolchain-funcs
 
 DESCRIPTION="Wrapper for using Windows drivers for some wireless cards"
 HOMEPAGE="http://ndiswrapper.sourceforge.net/"
@@ -17,9 +17,19 @@ RDEPEND="${DEPEND}
        net-wireless/wireless-tools
 "
 
+DOC_CONTENTS="
+       NDISwrapper requires .inf and .sys files from a Windows(tm) driver
+       to function. Download these to /root for example, then
+       run 'ndiswrapper -i /root/foo.inf'. After that you can delete them.
+       They will be copied to /etc/ndiswrapper/. Once done, please run 'update-modules'.
+       Please look at http://ndiswrapper.sourceforge.net/for the FAQ, HowTos, tips,
+       configuration, and installation information.
+"
+
 PATCHES=(
        "${FILESDIR}"/${PN}-1.59-cflags.patch
        "${FILESDIR}"/${PN}-1.61-kernel-4.11.patch
+       "${FILESDIR}"/${PN}-1.61-kernel-4.13.patch
 )
 
 MODULE_NAMES="ndiswrapper(misc:${S}/driver)"
@@ -53,7 +63,7 @@ src_compile() {
 }
 
 src_install() {
-       dodoc AUTHORS ChangeLog INSTALL README
+       einstalldocs
        doman ndiswrapper.8
 
        keepdir /etc/ndiswrapper
@@ -62,23 +72,13 @@ src_install() {
 
        cd utils
        emake DESTDIR="${D}" install
+       readme.gentoo_create_doc
 }
 
 pkg_postinst() {
        linux-mod_pkg_postinst
 
-       echo
-       elog "NDISwrapper requires .inf and .sys files from a Windows(tm) driver"
-       elog "to function. Download these to /root for example, then"
-       elog "run 'ndiswrapper -i /root/foo.inf'. After that you can delete them."
-       elog "They will be copied to /etc/ndiswrapper/."
-       elog "Once done, please run 'update-modules'."
-       echo
-
-       elog "Please look at ${HOMEPAGE}"
-       elog "for the FAQ, HowTos, tips, configuration, and installation"
-       elog "information."
-       echo
+       readme.gentoo_print_elog
 
        for i in $(lspci -n | egrep '(0280|0200):' |  cut -d' ' -f1)
        do
@@ -88,12 +88,6 @@ pkg_postinst() {
                fi
        done
 
-       echo
-       elog "NDISwrapper devs need support (_hardware_, cash)."
-       elog "Don't hesitate if you can help."
-       elog "See ${HOMEPAGE} for details."
-       echo
-
        if [[ ${ROOT} == "/" ]]; then
 
                einfo "Attempting to automatically reinstall any Windows drivers"