summaryrefslogtreecommitdiff
path: root/libre/ndiswrapper-module/PKGBUILD
blob: 0678ece28b6732a7da33dd342e88ae9160ee44ab (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
# Maintainer (Arch): Felix Yan <felixonmars@archlinux.org>
# Contributor (Arch): maz-1 <loveayawaka@gmail.com>
# Contributor: Andreas Grapentin <andreas@grapentin.org>

_basekernel=5.4.12-1

pkgname=ndiswrapper-module
pkgver=1.62
pkgrel=24
pkgrel+=.parabola1.basekernel${_basekernel%-*}
pkgdesc="Module for NDIS (Windows Network Drivers) drivers supplied by vendors, kernel module for Linux kernel"
pkgdesc+=' (built for the linux-libre kernel package)'
arch=('x86_64')
arch+=('i686')
url="https://sourceforge.net/projects/ndiswrapper/"
license=('GPL')
makedepends=(linux-libre-headers=${_basekernel%-*} git libelf)
conflicts=('ndiswrapper-arch')
provides=('NDISWRAPPER-MODULE')
replaces=('ndiswrapper-arch')
source=("https://sourceforge.net/projects/ndiswrapper/files/stable/ndiswrapper-$pkgver.tar.gz"
        'kernel-5.3.patch' 'kernel-5.4.patch' 'kernel-5.5.patch')
sha512sums=('a6e111bc699572642e44d6d31cc2f06374648a01b8dd7dd4e74d6ad5e187e39f99faee38f792c83a94d4618ae4d8866914fb3f60b1d80e838a753285ea7cf783'
            'c404f35280534b172235c5c578657d7a30ac2253c7c2abedd65a183d09390e95e7c3030cb409accb4d198ff0411482f8029f8664418c99d5672f92e9c733801d'
            '36450042db79ed4545030276bff9db1bc9895259f38c1c0bf4dc238ad76ec61c2e08d437997dafd327f2a8fd1694d61e418941555e92144e3ec86c8066561429'
            'ed543cbfb236de0a20e1f164c22c83cd19aec416b5f50a58cee731857231c667d166c36814047174bddda36261af71e92ecdb2944e5b818a603085af279fbd89')

prepare() {
  cd ndiswrapper-$pkgver
  patch --no-backup-if-mismatch -p2 -i "$srcdir"/kernel-5.3.patch
  patch --no-backup-if-mismatch -p1 -i "$srcdir"/kernel-5.4.patch
  patch --no-backup-if-mismatch -p1 -i "$srcdir"/kernel-5.5.patch
}

build() {
  _kernver="$(</usr/src/linux-libre/version)"

  cd ndiswrapper-$pkgver
  make -C driver KVERS_UNAME="$_kernver"
}

package() {
  depends=(linux-libre=${_basekernel%-*})

  _extradir="/usr/lib/modules/$(</usr/src/linux-libre/version)/extramodules"
  cd ndiswrapper-$pkgver
  install -Dt "$pkgdir$_extradir" -m644 driver/*.ko
  find "$pkgdir" -name '*.ko' -exec xz {} +
}