diff options
Diffstat (limited to 'qtsixa')
-rwxr-xr-x | qtsixa/PKGBUILD | 12 | ||||
-rw-r--r-- | qtsixa/qtsixa-dbus.patch | 65 | ||||
-rw-r--r-- | qtsixa/qtsixa-gksudo.patch | 71 |
3 files changed, 145 insertions, 3 deletions
diff --git a/qtsixa/PKGBUILD b/qtsixa/PKGBUILD index fbbbeb6..df9b92d 100755 --- a/qtsixa/PKGBUILD +++ b/qtsixa/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Mattias Andrée <maandree@operamail.com> pkgname=qtsixa pkgver=1.5.1 -pkgrel=8 +pkgrel=9 pkgdesc="An utility to configure and use sixaxis controller via bluetooth." url="http://sourceforge.net/projects/qtsixa/" arch=('i686' 'x86_64' 'ppc') @@ -14,18 +14,24 @@ source=(http://downloads.sourceforge.net/qtsixa/QtSixA-"$pkgver"-src.tar.gz sixad-init.patch sixad-bin.patch sixad-shared-h.patch - sixad.service) + sixad.service + qtsixad-dbus.patch + qtsixad-gksudo.path) md5sums=('d61bef5d737367aeddd57a6bc11da52a' 'a8c7585f628ac5b2eafeb735e3eab28b' '0496d5e8c16b4519042bd024ad07b32d' 'f7ed53be82bc4148b9a35cd565eb6ebe' - '7d885a478cdf4dca1c1b724a91bcfdaf') + '7d885a478cdf4dca1c1b724a91bcfdaf' + '55effc1afd592c3805412d430256f855' + '876019839232047a72a11c9fc3fca514') build() { # patch for sixad daemon echo "Patching sixad..." patch -p0 < $srcdir/sixad-init.patch patch -p0 < $srcdir/sixad-bin.patch patch -p0 < $srcdir/sixad-shared-h.patch + patch -p0 < $srcdir/qtsixad-dbus.patch + patch -p0 < $srcdir/qtsixad-gksudo.path cd $srcdir/QtSixA-$pkgver/qtsixa/gui/ echo "Fixed python version..." diff --git a/qtsixa/qtsixa-dbus.patch b/qtsixa/qtsixa-dbus.patch new file mode 100644 index 0000000..85376ea --- /dev/null +++ b/qtsixa/qtsixa-dbus.patch @@ -0,0 +1,65 @@ +diff -urp QtSixA-1.5.1.orig/qtsixa/gui/qtsixa_main.py QtSixA-1.5.1/qtsixa/gui/qtsixa_main.py +--- QtSixA-1.5.1.orig/qtsixa/gui/qtsixa_main.py 2012-12-06 22:59:03.103868725 -0800 ++++ QtSixA-1.5.1/qtsixa/gui/qtsixa_main.py 2012-12-06 22:59:55.033596582 -0800 +@@ -307,6 +307,8 @@ class MainW(QMainWindow, ui_qtsixa_mainw + def func_DBusDisconnect(self, mode, name, mac): + bus = dbus.SystemBus() + try: ++ if (getoutput("qtsixa "+"--check-bluetoothd") == "0"): ++ raise + bluez_bus = bus.get_object('org.bluez', '/') + bluez_id = bluez_bus.DefaultAdapter(dbus_interface='org.bluez.Manager') + adapter_bus = bus.get_object('org.bluez', bluez_id) +diff -urp QtSixA-1.5.1.orig/qtsixa/qtsixa QtSixA-1.5.1/qtsixa/qtsixa +--- QtSixA-1.5.1.orig/qtsixa/qtsixa 2012-12-06 22:59:03.107202042 -0800 ++++ QtSixA-1.5.1/qtsixa/qtsixa 2012-12-06 22:59:17.417127047 -0800 +@@ -68,6 +68,10 @@ fi + echo "$ROOT" + ;; + ++ check-bluetoothd|-check-bluetoothd|--check-bluetoothd) ++ps -e | grep bluetoothd > /dev/null && echo "1" || echo "0" ++ ;; ++ + *) + if [ -f ./gui/main.py ]; then + exec python2 ./gui/main.py "$@" +diff -urp QtSixA-1.5.1.orig/sixad/Makefile QtSixA-1.5.1/sixad/Makefile +--- QtSixA-1.5.1.orig/sixad/Makefile 2012-12-06 22:59:03.100535408 -0800 ++++ QtSixA-1.5.1/sixad/Makefile 2012-12-06 22:59:17.417127047 -0800 +@@ -34,7 +34,6 @@ install: + install -m 755 bins/sixad-remote $(DESTDIR)/usr/sbin/ + install -m 755 bins/sixad-3in1 $(DESTDIR)/usr/sbin/ + install -m 755 bins/sixad-raw $(DESTDIR)/usr/sbin/ +- install -m 755 sixad-dbus-blocker $(DESTDIR)/usr/sbin/ + @chmod 777 -R $(DESTDIR)/var/lib/sixad/ + @echo "Installation is Complete!" + +@@ -47,5 +46,4 @@ uninstall: + rm -f $(DESTDIR)/usr/sbin/sixad-sixaxis + rm -f $(DESTDIR)/usr/sbin/sixad-remote + rm -f $(DESTDIR)/usr/sbin/sixad-raw +- rm -f $(DESTDIR)/usr/sbin/sixad-dbus-blocker + rm -rf $(DESTDIR)/var/lib/sixad/ +diff -urp QtSixA-1.5.1.orig/sixad/sixad QtSixA-1.5.1/sixad/sixad +--- QtSixA-1.5.1.orig/sixad/sixad 2012-12-06 22:59:03.100535408 -0800 ++++ QtSixA-1.5.1/sixad/sixad 2012-12-06 22:59:17.417127047 -0800 +@@ -48,9 +48,6 @@ $SUDO /sbin/modprobe uinput + } + + bt_start () { +-$SUDO rm -f /tmp/.sixad-dbus-blocker.pid +-env sleep 1 +- + if [ -f /lib/udev/rules.d/97-bluetooth.rules ]; then + $SUDO /usr/sbin/bluetoothd --udev + elif [ -f /etc/rc.d/bluetooth ]; then +@@ -64,8 +61,6 @@ bt_stop() { + if (bluetoothd_running_check); then + $SUDO pkill -KILL bluetoothd + fi +- +-$SUDO /usr/sbin/sixad-dbus-blocker & + } + + case $1 in diff --git a/qtsixa/qtsixa-gksudo.patch b/qtsixa/qtsixa-gksudo.patch new file mode 100644 index 0000000..be48f50 --- /dev/null +++ b/qtsixa/qtsixa-gksudo.patch @@ -0,0 +1,71 @@ +diff -urpN QtSixA-1.5.1.orig/qtsixa/qtsixa QtSixA-1.5.1/qtsixa/qtsixa +--- QtSixA-1.5.1.orig/qtsixa/qtsixa 2012-12-06 22:04:55.574316391 -0800 ++++ QtSixA-1.5.1/qtsixa/qtsixa 2012-12-06 22:33:20.185320845 -0800 +@@ -10,44 +10,53 @@ case $1 in + KDESU='kdesu -- ' + KDESUDO='kdesudo -i /usr/share/qtsixa/icons/qtsixa.png -- ' + GKSU='gksu --description /usr/share/applications/qtsixa.desktop -- ' ++GKSUDO='gksudo --description /usr/share/applications/qtsixa.desktop --' + + #taken from winetricks (modified): + if [ x"$KDE_FULL_SESSION" = x"true" ]; then + { #KDE + if [ -f /usr/bin/kdesudo ]; then ROOT="$KDESUDO"; else + if [ -f /usr/bin/kdesu ]; then ROOT="$KDESU"; else +- if [ -f /usr/bin/gksu ]; then ROOT="$GKSU"; else +- ROOT='sudo' ++ if [ -f /usr/bin/gksudo ]; then ROOT="$GKSUDO"; else ++ if [ -f /usr/bin/gksu ]; then ROOT="$GKSU"; else ++ ROOT='sudo' ++ fi + fi + fi + fi + } #KDE (End) + else if [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then + { #Gnome +- if [ -f /usr/bin/gksu ]; then ROOT="$GKSU"; else +- if [ -f /usr/bin/kdesudo ]; then ROOT="$KDESUDO"; else +- if [ -f /usr/bin/kdesu ]; then ROOT="$KDESU"; else +- ROOT='sudo' ++ if [ -f /usr/bin/gksudo ]; then ROOT="$GKSUDO"; else ++ if [ -f /usr/bin/gksu ]; then ROOT="$GKSU"; else ++ if [ -f /usr/bin/kdesudo ]; then ROOT="$KDESUDO"; else ++ if [ -f /usr/bin/kdesu ]; then ROOT="$KDESU"; else ++ ROOT='sudo' ++ fi + fi + fi + fi + } #Gnome (End) + else if [ x"$DISPLAY" != x"" ]; then + { #Other X +- if [ -f /usr/bin/gksu ]; then ROOT="$GKSU"; else +- if [ -f /usr/bin/kdesudo ]; then ROOT="$KDESUDO"; else +- if [ -f /usr/bin/kdesu ]; then ROOT="$KDESU"; else +- ROOT='sudo' ++ if [ -f /usr/bin/gksudo ]; then ROOT="$GKSUDO"; else ++ if [ -f /usr/bin/gksu ]; then ROOT="$GKSU"; else ++ if [ -f /usr/bin/kdesudo ]; then ROOT="$KDESUDO"; else ++ if [ -f /usr/bin/kdesu ]; then ROOT="$KDESU"; else ++ ROOT='sudo' ++ fi + fi + fi + fi + } #Other X (End) + else + { #No known session +- if [ -f /usr/bin/gksu ]; then ROOT="$GKSU"; else +- if [ -f /usr/bin/kdesudo ]; then ROOT="$KDESUDO"; else +- if [ -f /usr/bin/kdesu ]; then ROOT="$KDESU"; else +- ROOT='sudo' ++ if [ -f /usr/bin/gksudo ]; then ROOT="$GKSUDO"; else ++ if [ -f /usr/bin/gksu ]; then ROOT="$GKSU"; else ++ if [ -f /usr/bin/kdesudo ]; then ROOT="$KDESUDO"; else ++ if [ -f /usr/bin/kdesu ]; then ROOT="$KDESU"; else ++ ROOT='sudo' ++ fi + fi + fi + fi |