summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikołaj "D1SoveR" Banasik2021-06-24 17:43:15 +0100
committerMikołaj "D1SoveR" Banasik2021-06-24 17:43:15 +0100
commite1c895619b7746b9290ae1dc5ac3698c5248caca (patch)
treebe50793f53e9ab9cf8db2f48a4f572732b731573
parentcd5f7800244896522ef3c600e618799f2781aef3 (diff)
downloadaur-kinect-audio-setup.tar.gz
Moved retrieval of firmware file from post-install script to PKGBUILD.
-rw-r--r--.SRCINFO14
-rw-r--r--55-kinect-audio.rules3
-rw-r--r--PKGBUILD30
-rw-r--r--improved-fetch.patch40
-rw-r--r--kinect-audio-setup.install9
-rw-r--r--updated-hash.patch17
6 files changed, 19 insertions, 94 deletions
diff --git a/.SRCINFO b/.SRCINFO
index a790c31d72f..9488e0963b3 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,26 +1,20 @@
pkgbase = kinect-audio-setup
pkgdesc = Tools to download and apply USB Audio Class firmware for Kinect and use it as microphone
pkgver = 0.5
- pkgrel = 2
+ pkgrel = 3
url = https://git.ao2.it/kinect-audio-setup.git
- install = kinect-audio-setup.install
arch = x86_64
arch = i686
license = WTFPL
license = BSD
makedepends = make
makedepends = gcc
- depends = wget
- depends = p7zip>=9.20
+ makedepends = p7zip>=9.20
source = git+https://git.ao2.it/kinect-audio-setup.git#tag=v0.5
- source = improved-fetch.patch
- source = updated-hash.patch
- source = 55-kinect-audio.rules
+ source = http://download.microsoft.com/download/F/9/9/F99791F2-D5BE-478A-B77A-830AD14950C3/KinectSDK-v1.0-beta2-x86.msi
source = LICENSE
sha256sums = SKIP
- sha256sums = a27b9e1cffd9c5f062fd15c494e12fdf8bc73e5ae590329bf40eabe16f731c79
- sha256sums = b94f922466b5796e09bc22457654b53fffa138c21c5f6045a13b67824a94e4c9
- sha256sums = 8f9f343eeed07c59c65940f4a03814da5e2018cdbc331664bfacc2c98cd7d549
+ sha256sums = 817764591cff7acc3d678c5bc65dc8724b3d243611c1010dab2c18d0dedd4221
sha256sums = d23efd383bc03aa8cdeac33be24a9c915f05ad92d20f4070e7160bdcff7f4a8c
pkgname = kinect-audio-setup
diff --git a/55-kinect-audio.rules b/55-kinect-audio.rules
deleted file mode 100644
index ced99037144..00000000000
--- a/55-kinect-audio.rules
+++ /dev/null
@@ -1,3 +0,0 @@
-# Rule to load the Kinect UAC firmware on the "generic" USB device
-# (this will allow using Kinect microphone as any standard USB audio device)
-ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="045e", ATTRS{idProduct}=="02ad", RUN+="/usr/bin/kinect_upload_fw /usr/lib/firmware/kinect/UACFirmware"
diff --git a/PKGBUILD b/PKGBUILD
index 103f8a5144b..361e575c858 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,30 +1,29 @@
# Maintainer: Mikołaj "D1SoveR" Banasik <d1sover@gmail.com>
pkgname='kinect-audio-setup'
pkgver=0.5
-pkgrel=2
+pkgrel=3
pkgdesc='Tools to download and apply USB Audio Class firmware for Kinect and use it as microphone'
arch=('x86_64' 'i686')
url='https://git.ao2.it/kinect-audio-setup.git'
license=('WTFPL' 'BSD')
-depends=('wget' 'p7zip>=9.20')
-makedepends=('make' 'gcc')
-install="${pkgname}.install"
+makedepends=('make' 'gcc' 'p7zip>=9.20')
source=("git+${url}#tag=v${pkgver}"
- 'improved-fetch.patch'
- 'updated-hash.patch'
- '55-kinect-audio.rules'
+ 'http://download.microsoft.com/download/F/9/9/F99791F2-D5BE-478A-B77A-830AD14950C3/KinectSDK-v1.0-beta2-x86.msi'
'LICENSE')
sha256sums=('SKIP'
- 'a27b9e1cffd9c5f062fd15c494e12fdf8bc73e5ae590329bf40eabe16f731c79'
- 'b94f922466b5796e09bc22457654b53fffa138c21c5f6045a13b67824a94e4c9'
- '8f9f343eeed07c59c65940f4a03814da5e2018cdbc331664bfacc2c98cd7d549'
+ '817764591cff7acc3d678c5bc65dc8724b3d243611c1010dab2c18d0dedd4221'
'd23efd383bc03aa8cdeac33be24a9c915f05ad92d20f4070e7160bdcff7f4a8c')
+UPLOADER_PATH='/usr/bin/kinect_upload_fw'
+FIRMWARE_PATH='/usr/lib/firmware/kinect_uac_firmware.bin'
+
prepare() {
- cd "$pkgname"
- patch -Np1 -i "${srcdir}/improved-fetch.patch"
- patch -Np1 -i "${srcdir}/updated-hash.patch"
+ msg2 "$(gettext "Extracting the firmware out of Kinect SDK...")"
+ 7z e -y -r "KinectSDK-v1.0-beta2-x86.msi" "UACFirmware.*" > /dev/null
+ msg2 "$(gettext "Generating the udev rules file...")"
+ cp "${srcdir}/${pkgname}/contrib/55-kinect_audio.rules.in" "${srcdir}/55-kinect-audio.rules"
+ "${srcdir}/${pkgname}/kinect_patch_udev_rules" "$FIRMWARE_PATH" "$UPLOADER_PATH" "${srcdir}/55-kinect-audio.rules"
}
build() {
@@ -33,8 +32,9 @@ build() {
}
package() {
- install -Dm755 "${srcdir}/${pkgname}/kinect_upload_fw/kinect_upload_fw" "${pkgdir}/usr/bin/kinect_upload_fw"
- install -Dm755 "${srcdir}/${pkgname}/kinect_fetch_fw" "${pkgdir}/usr/bin/kinect_fetch_fw"
+ FW_FILE=$(ls "${srcdir}"/UACFirmware.* | cut -d ' ' -f 1)
+ install -Dm644 "$FW_FILE" "${pkgdir}${FIRMWARE_PATH}"
+ install -Dm755 "${srcdir}/${pkgname}/kinect_upload_fw/kinect_upload_fw" "${pkgdir}${UPLOADER_PATH}"
install -Dm644 "${srcdir}/55-kinect-audio.rules" "${pkgdir}/usr/lib/udev/rules.d/55-kinect-audio.rules"
install -Dm644 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
diff --git a/improved-fetch.patch b/improved-fetch.patch
deleted file mode 100644
index 9d09213e3ba..00000000000
--- a/improved-fetch.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-This patch removes mention of Debian package manager and binary checks,
-as those will be handled by pacman itself. Additionally, wget is made to use
-form of progress reporting that plays bit better with terminals.
-
-diff --git a/kinect_fetch_fw b/kinect_fetch_fw
-index 3459dca..91b1289 100755
---- a/kinect_fetch_fw
-+++ b/kinect_fetch_fw
-@@ -9,12 +9,6 @@
- # and/or modify it under the terms of the Do What The Fuck You Want
- # To Public License, Version 2, as published by Sam Hocevar. See
- # http://sam.zoy.org/wtfpl/COPYING for more details.
--#
--# wget and 7z from p7zip-full are needed, they can be installed with
--# sudo aptitude install wget p7zip-full
--#
--# NOTE: p7zip-full >= 9.20 is required in order to extract .msi files
--# correctly
-
- set -e
-
-@@ -24,9 +18,6 @@ SDK_MD5="40764fe9e00911bda5095e5be777e311"
- [ $# -lt 1 ] && { echo "usage: $(basename "$0") <firmware destdir>" 1>&2; exit 1; }
- FW_DESTDIR=$(readlink -m $1)
-
--command -v wget >/dev/null 2>&1 || { echo "$(basename "$0"): command 'wget' is needed." 1>&2 ; exit 1; }
--command -v 7z >/dev/null 2>&1 || { echo "$(basename "$0"): command '7z' is needed." 1>&2; exit 1; }
--
- TEMPDIR=$(mktemp -d)
- trap 'rm -rf "$TEMPDIR" >/dev/null 2>&1' 0
- trap "exit 2" 1 2 3 15
-@@ -44,7 +35,7 @@ EOM
-
- cd "$TEMPDIR"
- ARCHIVE_NAME=$(basename "$SDK_URL")
--rm -f "$ARCHIVE_NAME" && wget "$SDK_URL" -O "$ARCHIVE_NAME"
-+rm -f "$ARCHIVE_NAME" && wget --progress=dot:mega "$SDK_URL" -O "$ARCHIVE_NAME"
-
- ARCHIVE_MD5=$(md5sum "$ARCHIVE_NAME" | grep --only-matching -m 1 '^[0-9a-f]*')
- if [ "$ARCHIVE_MD5" != "$SDK_MD5" ];
diff --git a/kinect-audio-setup.install b/kinect-audio-setup.install
deleted file mode 100644
index d9a641ed2a8..00000000000
--- a/kinect-audio-setup.install
+++ /dev/null
@@ -1,9 +0,0 @@
-post_install() {
- mkdir -p usr/lib/firmware/kinect
- /usr/sbin/kinect_fetch_fw usr/lib/firmware/kinect
-}
-
-pre_remove() {
- rm -f usr/lib/firmware/kinect/UACFirmware
- rmdir usr/lib/firmware/kinect 2> /dev/null || echo "/usr/lib/firmware/kinect directory is not empty"
-}
diff --git a/updated-hash.patch b/updated-hash.patch
deleted file mode 100644
index da813386afb..00000000000
--- a/updated-hash.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-It appears that Microsoft has modified the MSI file some time before 11th of June 2021, and it now has a different hash.
-I've compared the files from old and new version of the MSI file and none of its contents are different (most importantly,
-the firmware we utilise is the exact same), so the simplest fix is just to update the hash.
-
-diff --git a/kinect_fetch_fw b/kinect_fetch_fw
-index 91b1289..d058b70 100755
---- a/kinect_fetch_fw
-+++ b/kinect_fetch_fw
-@@ -13,7 +13,7 @@
- set -e
-
- SDK_URL=${SDK_URL:-"http://download.microsoft.com/download/F/9/9/F99791F2-D5BE-478A-B77A-830AD14950C3/KinectSDK-v1.0-beta2-x86.msi"}
--SDK_MD5="40764fe9e00911bda5095e5be777e311"
-+SDK_MD5="945806927702b2c47c32125ab9a80344"
-
- [ $# -lt 1 ] && { echo "usage: $(basename "$0") <firmware destdir>" 1>&2; exit 1; }
- FW_DESTDIR=$(readlink -m $1)