diff options
author | Mikołaj "D1SoveR" Banasik | 2020-04-16 01:08:01 +0100 |
---|---|---|
committer | Mikołaj "D1SoveR" Banasik | 2020-04-16 01:08:01 +0100 |
commit | dd1ac35d613f4f3b91298394c7861910b4372140 (patch) | |
tree | 2e56860e0be0c0ce1c0195b9b0d4347ddf122601 | |
download | aur-dd1ac35d613f4f3b91298394c7861910b4372140.tar.gz |
Initial commit of PKGBUILD for the package.
-rw-r--r-- | .SRCINFO | 25 | ||||
-rw-r--r-- | 55-kinect-audio.rules | 3 | ||||
-rw-r--r-- | LICENSE | 42 | ||||
-rw-r--r-- | PKGBUILD | 37 | ||||
-rw-r--r-- | improved-fetch.patch | 40 | ||||
-rw-r--r-- | kinect-audio-setup.install | 9 |
6 files changed, 156 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..2adf9bd7369e --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,25 @@ +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 = 1 + 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 + source = git+https://git.ao2.it/kinect-audio-setup.git#tag=v0.5 + source = improved-fetch.patch + source = 55-kinect-audio.rules + source = LICENSE + sha256sums = SKIP + sha256sums = a27b9e1cffd9c5f062fd15c494e12fdf8bc73e5ae590329bf40eabe16f731c79 + sha256sums = 8f9f343eeed07c59c65940f4a03814da5e2018cdbc331664bfacc2c98cd7d549 + sha256sums = d23efd383bc03aa8cdeac33be24a9c915f05ad92d20f4070e7160bdcff7f4a8c + +pkgname = kinect-audio-setup + diff --git a/55-kinect-audio.rules b/55-kinect-audio.rules new file mode 100644 index 000000000000..ced99037144b --- /dev/null +++ b/55-kinect-audio.rules @@ -0,0 +1,3 @@ +# 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/LICENSE b/LICENSE new file mode 100644 index 000000000000..508827d83919 --- /dev/null +++ b/LICENSE @@ -0,0 +1,42 @@ +kinect_upload_fw +---------------- + +Copyright 2011 Drew Fisher <drew.m.fisher@gmail.com>. All rights reserved. +Copyright (C) 2016 Antonio Ospite <ao2@ao2.it> +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ''AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL DREW FISHER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +The views and conclusions contained in the software and documentation are +those of the authors and should not be interpreted as representing official +policies, either expressed or implied, of Drew Fisher. + +kinect_fetch_fw, udev rules +--------------------------- + +Copyright (C) 2011-2016 Antonio Ospite <ao2@ao2.it> + +This program is free software. It comes without any warranty, to +the extent permitted by applicable law. You can redistribute it +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. diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..eeb05caa7e0f --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,37 @@ +# Maintainer: Mikołaj "D1SoveR" Banasik <d1sover@gmail.com> +pkgname='kinect-audio-setup' +pkgver=0.5 +pkgrel=1 +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" + +source=("git+${url}#tag=v${pkgver}" + 'improved-fetch.patch' + '55-kinect-audio.rules' + 'LICENSE') +sha256sums=('SKIP' + 'a27b9e1cffd9c5f062fd15c494e12fdf8bc73e5ae590329bf40eabe16f731c79' + '8f9f343eeed07c59c65940f4a03814da5e2018cdbc331664bfacc2c98cd7d549' + 'd23efd383bc03aa8cdeac33be24a9c915f05ad92d20f4070e7160bdcff7f4a8c') + +prepare() { + cd "$pkgname" + patch -Np1 -i "${srcdir}/improved-fetch.patch" +} + +build() { + cd "${pkgname}/kinect_upload_fw" + make kinect_upload_fw +} + +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" + 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 new file mode 100644 index 000000000000..9d09213e3baa --- /dev/null +++ b/improved-fetch.patch @@ -0,0 +1,40 @@ +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 new file mode 100644 index 000000000000..d9a641ed2a8f --- /dev/null +++ b/kinect-audio-setup.install @@ -0,0 +1,9 @@ +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" +} |