summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Rawlinson2022-10-28 12:14:41 +1300
committerGeorge Rawlinson2022-10-28 12:14:41 +1300
commit193ad5c1adec470a60e688cc0544047a942bc591 (patch)
tree5fbd8510079dbff6af8377b57b0bd48d6b57c304
downloadaur-193ad5c1adec470a60e688cc0544047a942bc591.tar.gz
addpkg: motu r19-1
-rw-r--r--.SRCINFO23
-rw-r--r--Makefile9
-rw-r--r--PKGBUILD58
-rw-r--r--dkms.conf7
4 files changed, 97 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..3574a33f0b66
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,23 @@
+pkgbase = motu
+ pkgdesc = Kernel module for MOTU MIDI devices
+ pkgver = r19.g516da18
+ pkgrel = 1
+ url = https://github.com/vampirefrog/motu
+ arch = x86_64
+ license = GPL3
+ makedepends = git
+ makedepends = linux-headers
+ source = motu::git+https://github.com/vampirefrog/motu#commit=516da186c9e2112cae84b3cf0d5979e23c52d62b
+ source = Makefile
+ source = dkms.conf
+ b2sums = SKIP
+ b2sums = 4e8d84050bd1622e7463ac8ea821161ea441cc3aa3d80c1c9bddfe55ac642fa606d3d740aba1af94726a04f8d42d9c3f4062f368d4a4162958633f42ee9fc04e
+ b2sums = ede461a5f32df0919186e0afe66e5d19511cbf527ff1eb31fedc414e4d6de1fb887a9cea288442fab0e7e0b6fe52d8eef1f6fc7c6a8c0b1262f8d681fa28f360
+
+pkgname = motu
+ depends = linux
+
+pkgname = motu-dkms
+ depends = dkms
+ provides = motu
+ conflicts = motu
diff --git a/Makefile b/Makefile
new file mode 100644
index 000000000000..1cbc84e18ed3
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,9 @@
+# https://www.kernel.org/doc/Documentation/kbuild/modules.txt
+
+obj-m := motu.o
+
+UNAME_R ?= $(shell uname -r)
+KDIR ?= /lib/modules/$(UNAME_R)/build
+
+all:
+ $(MAKE) -C $(KDIR) M=$(shell pwd)
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..7508c689c790
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,58 @@
+# Maintainer: George Rawlinson <grawlinson@archlinux.org>
+
+pkgbase=motu
+pkgname=('motu' 'motu-dkms')
+pkgver=r19.g516da18
+pkgrel=1
+pkgdesc='Kernel module for MOTU MIDI devices'
+arch=('x86_64')
+url='https://github.com/vampirefrog/motu'
+license=('GPL3')
+makedepends=('git' 'linux-headers')
+_commit='516da186c9e2112cae84b3cf0d5979e23c52d62b'
+source=(
+ "$pkgbase::git+$url#commit=$_commit"
+ 'Makefile'
+ 'dkms.conf'
+)
+b2sums=('SKIP'
+ '4e8d84050bd1622e7463ac8ea821161ea441cc3aa3d80c1c9bddfe55ac642fa606d3d740aba1af94726a04f8d42d9c3f4062f368d4a4162958633f42ee9fc04e'
+ 'ede461a5f32df0919186e0afe66e5d19511cbf527ff1eb31fedc414e4d6de1fb887a9cea288442fab0e7e0b6fe52d8eef1f6fc7c6a8c0b1262f8d681fa28f360')
+
+pkgver() {
+ cd "$pkgbase"
+
+ printf 'r%s.g%s' "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+}
+
+build() {
+ cd "$pkgbase"
+
+ make -C /usr/src/linux M="$PWD" modules
+}
+
+package_motu() {
+ depends=('linux')
+
+ cd "$pkgbase"
+
+ local _extradir="/usr/lib/modules/$(</usr/src/linux/version)/extramodules"
+ install -Dt "${pkgdir}${_extradir}" -m644 *.ko
+ find "${pkgdir}" -name '*.ko' -exec strip --strip-debug {} +
+ find "${pkgdir}" -name '*.ko' -exec zstd --rm {} +
+}
+
+package_motu-dkms(){
+ depends=('dkms')
+ conflicts=('motu')
+ provides=('motu')
+
+ install -vDm644 \
+ -t "$pkgdir/usr/src/$pkgbase-$pkgver" \
+ "$pkgbase/motu.c" Makefile dkms.conf
+
+ # Set name and version for DKMS template
+ sed -e "s/@PKGBASE@/$pkgbase/" \
+ -e "s/@PKGVER@/$pkgver/" \
+ -i "$pkgdir/usr/src/$pkgbase-$pkgver/dkms.conf"
+}
diff --git a/dkms.conf b/dkms.conf
new file mode 100644
index 000000000000..ef8d8e57f9c5
--- /dev/null
+++ b/dkms.conf
@@ -0,0 +1,7 @@
+PACKAGE_NAME="@PKGBASE@"
+PACKAGE_VERSION="@PKGVER@"
+MAKE[0]="make UNAME_R=$kernelver"
+CLEAN="make clean"
+BUILT_MODULE_NAME[0]="@PKGBASE@"
+DEST_MODULE_LOCATION[0]="/kernel/drivers/misc"
+AUTOINSTALL="yes"