mokoeightball: new recipe and patch
authorBenjamin Schieder <blindcoder@scavenger.homeip.net>
Mon, 30 Nov 2009 15:37:07 +0000 (15:37 +0000)
committerMartin Jansa <Martin.Jansa@gmail.com>
Wed, 2 Dec 2009 22:07:49 +0000 (23:07 +0100)
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
recipes/mokoeightball/files/fixpath.patch [new file with mode: 0644]
recipes/mokoeightball/mokoeightball_svn.bb [new file with mode: 0644]

diff --git a/recipes/mokoeightball/files/fixpath.patch b/recipes/mokoeightball/files/fixpath.patch
new file mode 100644 (file)
index 0000000..8fd82cf
--- /dev/null
@@ -0,0 +1,63 @@
+Index: ./python/src/eightball.py
+===================================================================
+--- ./python/src/eightball.py  (revision 45)
++++ ./python/src/eightball.py  (working copy)
+@@ -47,12 +47,6 @@
+       shakeTimer = None
+       def __init__( self, size ):
+-              # Check if we can use accelerated rendering
+-              if ecore.evas.engine_type_supported_get("software_x11_16"):
+-                      self.engine = ecore.evas.SoftwareX11_16
+-              else:
+-                      print "warning: x11-16 is not supported, fallback to x11"
+-                      self.engine = ecore.evas.SoftwareX11
+               self.size = size
+               
+@@ -63,7 +57,12 @@
+               self.accel.addListener( "shake", self.onShake )         
+               # Initialize the renderer and set all initial properties
+-              self.ee = self.engine( w = size[0], h = size[1] )
++              try:
++                      self.engine = ecore.evas.SoftwareX11_16
++                      self.ee = self.engine( w = size[0], h = size[1] )
++              except e:
++                      self.engine = ecore.evas.SoftwareX11
++                      self.ee = self.engine( w = size[0], h = size[1] )
+               self.ee.title = "Moko Eightball"
+               self.ee.name_class = ( "MOKO_EIGHTBALL", "MOKO_EIGHTBALL" )
+ #             self.ee.fullscreen = True
+Index: ./python/src/Accelerometer/__init__.py
+===================================================================
+--- ./python/src/Accelerometer/__init__.py     (revision 45)
++++ ./python/src/Accelerometer/__init__.py     (working copy)
+@@ -30,7 +30,7 @@
+ class EventManager(object):
+       movementTolerance = 30
+-      shakeTolerance    = 2100
++      shakeTolerance    = 100
+       listeners = dict( 
+               shake = [],
+@@ -82,15 +82,15 @@
+                                       # Inform all listeners
+                                       self.informListeners()
+                                       break
+-                              if ( type == 2 and code == 0 ):
++                              if ( type == 3 and code == 0 ):
+                                       # Update x
+                                       x = value
+                                       continue
+-                              if ( type == 2 and code == 1 ):
++                              if ( type == 3 and code == 1 ):
+                                       # Update y
+                                       y = value
+                                       continue
+-                              if ( type == 2 and code == 2 ):
++                              if ( type == 3 and code == 2 ):
+                                       # Update z
+                                       z = value
+                                       continue                                        
diff --git a/recipes/mokoeightball/mokoeightball_svn.bb b/recipes/mokoeightball/mokoeightball_svn.bb
new file mode 100644 (file)
index 0000000..dde59cb
--- /dev/null
@@ -0,0 +1,34 @@
+DESCRIPTION = "Magic 8 Ball"
+HOMEPAGE = "http://www.opkg.org/package_35.html"
+AUTHOR = "Jakob Westhoff"
+LICENSE = "GPLv2"
+SECTION = "x11/game"
+SRCREV = "45"
+PV = "0.2+svnr${SRCPV}"
+PR = "r0"
+S = "${WORKDIR}/"
+FILES_${PN} += /usr/share/moko_eightball/Accelerometer/__init__.py
+FILES_${PN} += /usr/share/moko_eightball/themes/eightball.edj
+
+SRC_URI = "svn://svn.pureenergy.cc/moko_eightball;module=.;proto=svn \
+          file://files/fixpath.patch;patch=1"
+
+do_compile() {
+       cd python/src/data/themes
+       ./maketheme.sh
+}
+
+do_install() {
+       cd python
+       install -d 0755 ${D}/usr/share/moko_eightball
+       install -d 0755 ${D}/usr/share/moko_eightball/Accelerometer
+       install -d 0755 ${D}/usr/share/moko_eightball/themes
+       install -d 0755 ${D}/usr/share/applications
+       install -d 0755 ${D}/usr/share/pixmaps
+       install -d 0755 ${D}/usr/bin
+       install -m 0755 src/eightball.py ${D}/usr/bin/eightball
+       install -m 0644 src/Accelerometer/__init__.py ${D}/usr/share/moko_eightball/Accelerometer/
+       install -m 0644 src/data/themes/eightball.edj ${D}/usr/share/moko_eightball/themes/eightball.edj
+       install -m 0644 ipk/usr/share/applications/eightball.desktop ${D}/usr/share/applications/eightball.desktop
+       install -m 0644 ipk/usr/share/pixmaps/eightball.png ${D}/usr/share/pixmaps/eightball.png
+}