new package: add package 'xwiimote'

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2011-08-03 10:10:08 +02:00
parent 8157b4d9c5
commit 9f48ea8b3c
5 changed files with 194 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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"

View File

@ -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

43
tools/mkpkg/mkpkg_xwiimote Executable file
View File

@ -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