From 9f48ea8b3c8796c63c1436b29926724f940661d8 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Wed, 3 Aug 2011 10:10:08 +0200 Subject: [PATCH] new package: add package 'xwiimote' Signed-off-by: Stephan Raue --- packages/sysutils/remote/xwiimote/build | 27 ++++++++++ packages/sysutils/remote/xwiimote/install | 36 +++++++++++++ packages/sysutils/remote/xwiimote/meta | 36 +++++++++++++ .../patches/xwiimote-7341491-makefile.patch | 52 +++++++++++++++++++ tools/mkpkg/mkpkg_xwiimote | 43 +++++++++++++++ 5 files changed, 194 insertions(+) create mode 100755 packages/sysutils/remote/xwiimote/build create mode 100755 packages/sysutils/remote/xwiimote/install create mode 100644 packages/sysutils/remote/xwiimote/meta create mode 100644 packages/sysutils/remote/xwiimote/patches/xwiimote-7341491-makefile.patch create mode 100755 tools/mkpkg/mkpkg_xwiimote diff --git a/packages/sysutils/remote/xwiimote/build b/packages/sysutils/remote/xwiimote/build new file mode 100755 index 0000000000..b6ac9b1bb9 --- /dev/null +++ b/packages/sysutils/remote/xwiimote/build @@ -0,0 +1,27 @@ +#!/bin/sh + +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2011 Stephan Raue (stephan@openelec.tv) +# +# This Program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This Program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with OpenELEC.tv; see the file COPYING. If not, write to +# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +# http://www.gnu.org/copyleft/gpl.html +################################################################################ + +. config/options $1 + +cd $PKG_BUILD + +make -C tools diff --git a/packages/sysutils/remote/xwiimote/install b/packages/sysutils/remote/xwiimote/install new file mode 100755 index 0000000000..369a0b7509 --- /dev/null +++ b/packages/sysutils/remote/xwiimote/install @@ -0,0 +1,36 @@ +#!/bin/sh + +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2011 Stephan Raue (stephan@openelec.tv) +# +# This Program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This Program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with OpenELEC.tv; see the file COPYING. If not, write to +# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +# http://www.gnu.org/copyleft/gpl.html +################################################################################ + +. config/options $1 + +mkdir -p $INSTALL/usr/bin + cp $PKG_BUILD/tools/xwii $INSTALL/usr/bin + cp $PKG_BUILD/tools/xwiiconn $INSTALL/usr/bin + cp $PKG_BUILD/tools/xwiidump $INSTALL/usr/bin + cp $PKG_BUILD/tools/xwiishow $INSTALL/usr/bin + +mkdir -p $INSTALL/usr/lib + cp $PKG_BUILD/libxwiimote.so* $INSTALL/usr/lib + +mkdir -p $INSTALL/usr/share/X11/xorg.conf.d + cp $PKG_BUILD/res/50-xorg-disable-wiimote.conf $INSTALL/usr/share/X11/xorg.conf.d + diff --git a/packages/sysutils/remote/xwiimote/meta b/packages/sysutils/remote/xwiimote/meta new file mode 100644 index 0000000000..aefbd5e13d --- /dev/null +++ b/packages/sysutils/remote/xwiimote/meta @@ -0,0 +1,36 @@ +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2011 Stephan Raue (stephan@openelec.tv) +# +# This Program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This Program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with OpenELEC.tv; see the file COPYING. If not, write to +# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +# http://www.gnu.org/copyleft/gpl.html +################################################################################ + +PKG_NAME="xwiimote" +PKG_VERSION="7341491" +PKG_REV="1" +PKG_ARCH="any" +PKG_LICENSE="GPL" +PKG_SITE="https://github.com/dvdhrm/xwiimote" +PKG_URL="$OPENELEC_SRC/$PKG_NAME-$PKG_VERSION.tar.xz" +PKG_DEPENDS="dbus-glib udev bluez" +PKG_BUILD_DEPENDS="toolchain dbus-glib udev bluez" +PKG_PRIORITY="optional" +PKG_SECTION="sysutils/remote" +PKG_SHORTDESC="xwiimote: Nintendo Wii Remote Linux Device Driver Tools" +PKG_LONGDESC="xwiimote contains tools and libraries related to the open source Nintendo Wii Remote linux device driver" +PKG_IS_ADDON="no" + +PKG_AUTORECONF="no" diff --git a/packages/sysutils/remote/xwiimote/patches/xwiimote-7341491-makefile.patch b/packages/sysutils/remote/xwiimote/patches/xwiimote-7341491-makefile.patch new file mode 100644 index 0000000000..485887a9f7 --- /dev/null +++ b/packages/sysutils/remote/xwiimote/patches/xwiimote-7341491-makefile.patch @@ -0,0 +1,52 @@ +diff -Naur xwiimote-7341491-old/makefile xwiimote-7341491-new/makefile +--- xwiimote-7341491-old/makefile 2011-08-02 10:16:15.000000000 -0700 ++++ xwiimote-7341491-new/makefile 2011-08-02 10:20:01.000000000 -0700 +@@ -4,12 +4,14 @@ + # Dedicated to the Public Domain + # + ++CC ?= gcc ++ + .PHONY: build clean + + build: libxwiimote.so + + libxwiimote.so: lib/*.c +- gcc -shared -o libxwiimote.so lib/*.c -fPIC -Wall -O2 -ludev ++ $(CC) -shared -o libxwiimote.so lib/*.c -fPIC -Wall -O2 -ludev $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) + + clean: + @rm -fv libxwiimote.so +diff -Naur xwiimote-7341491-old/tools/makefile xwiimote-7341491-new/tools/makefile +--- xwiimote-7341491-old/tools/makefile 2011-08-02 10:16:15.000000000 -0700 ++++ xwiimote-7341491-new/tools/makefile 2011-08-02 10:21:44.000000000 -0700 +@@ -4,6 +4,8 @@ + # Dedicated to the Public Domain + # + ++CC ?= gcc ++ + .PHONY: all clean + + all: xwiiconn xwii xwiishow xwiidump +@@ -12,16 +14,16 @@ + @rm -fv xwiiconn xwii xwiishow xwiidump + + xwiiconn: xwiiconn.c +- gcc -o xwiiconn xwiiconn.c -Wall -O0 -g -lbluetooth `pkg-config --libs --cflags dbus-glib-1 glib-2.0` ++ $(CC) -o xwiiconn xwiiconn.c -Wall -O0 -g -lbluetooth `pkg-config --libs --cflags dbus-glib-1 glib-2.0` $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) + + xwii: xwii.c ../libxwiimote.so +- gcc -o xwii xwii.c -Wall -O0 -g ../libxwiimote.so -I../lib ++ $(CC) -o xwii xwii.c -Wall -O0 -g -L../ -lxwiimote -I../lib $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) + + xwiishow: xwiishow.c ../libxwiimote.so +- gcc -o xwiishow xwiishow.c -Wall -O0 -g ../libxwiimote.so -I../lib ++ $(CC) -o xwiishow xwiishow.c -Wall -O0 -g -L../ -lxwiimote -I../lib $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) + + xwiidump: xwiidump.c +- gcc -o xwiidump xwiidump.c -Wall -O0 -g ++ $(CC) -o xwiidump xwiidump.c -Wall -O0 -g $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) + + ../libxwiimote.so: + @echo Making library diff --git a/tools/mkpkg/mkpkg_xwiimote b/tools/mkpkg/mkpkg_xwiimote new file mode 100755 index 0000000000..5f780506e5 --- /dev/null +++ b/tools/mkpkg/mkpkg_xwiimote @@ -0,0 +1,43 @@ +#!/bin/sh +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2011 Stephan Raue (stephan@openelec.tv) +# +# This Program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This Program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with OpenELEC.tv; see the file COPYING. If not, write to +# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +# http://www.gnu.org/copyleft/gpl.html +################################################################################ + +echo "getting sources..." + if [ ! -d xwiimote.git ]; then + git clone git://github.com/dvdhrm/xwiimote.git xwiimote.git + fi + + cd xwiimote.git + git pull + GIT_REV=`git log -n1 --format=%h` + cd .. + +echo "copying sources..." + rm -rf xwiimote-$GIT_REV + cp -R xwiimote.git xwiimote-$GIT_REV + +echo "cleaning sources..." + rm -rf xwiimote-$GIT_REV/.git + +echo "packing sources..." + tar cvJf xwiimote-$GIT_REV.tar.xz xwiimote-$GIT_REV + +echo "remove temporary sourcedir..." + rm -rf xwiimote-$GIT_REV