commit:     01f1d29787bd1ba2900f7aa00e5424ebc45a1e05
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 12 13:43:42 2017 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Tue Sep 12 13:43:42 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=01f1d297

net-wireless/ndiswrapper: Use readme.gentoo eclass and support kernel 4.13 
(#630570 by Toralf Forster)

Package-Manager: Portage-2.3.8, Repoman-2.3.3

 .../files/ndiswrapper-1.61-kernel-4.13.patch       | 27 +++++++++++++++++
 net-wireless/ndiswrapper/ndiswrapper-1.61.ebuild   | 34 +++++++++-------------
 2 files changed, 41 insertions(+), 20 deletions(-)

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
index 00000000000..052c4d9b9bf
--- /dev/null
+++ b/net-wireless/ndiswrapper/files/ndiswrapper-1.61-kernel-4.13.patch
@@ -0,0 +1,27 @@
+commit eeac7ab831b3097005dadc64dd323f54ade30323
+Author: Felix Yan <[email protected]>
+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)               \

diff --git a/net-wireless/ndiswrapper/ndiswrapper-1.61.ebuild 
b/net-wireless/ndiswrapper/ndiswrapper-1.61.ebuild
index 945cacb519c..bcb493f1a55 100644
--- a/net-wireless/ndiswrapper/ndiswrapper-1.61.ebuild
+++ b/net-wireless/ndiswrapper/ndiswrapper-1.61.ebuild
@@ -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"

Reply via email to