gwaterpas: first recipe for this app in its 0.3 version
authorSylvain Paré <sylvain.pare@gmail.com>
Wed, 15 Dec 2010 21:28:06 +0000 (21:28 +0000)
committerMartin Jansa <Martin.Jansa@gmail.com>
Thu, 16 Dec 2010 08:54:45 +0000 (09:54 +0100)
* see http://wiki.openmoko.org/wiki/Gwaterpas
* thanks to playya for his help!

Signed-off-by: Sylvain Paré <sylvain.pare@gmail.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
recipes/gwaterpas/gwaterpas-0.3/desktop_fix.patch [new file with mode: 0644]
recipes/gwaterpas/gwaterpas-0.3/remove_buildflags.patch [new file with mode: 0644]
recipes/gwaterpas/gwaterpas-0.3/sensors_fix.patch [new file with mode: 0644]
recipes/gwaterpas/gwaterpas_0.3.bb [new file with mode: 0755]

diff --git a/recipes/gwaterpas/gwaterpas-0.3/desktop_fix.patch b/recipes/gwaterpas/gwaterpas-0.3/desktop_fix.patch
new file mode 100644 (file)
index 0000000..413feac
--- /dev/null
@@ -0,0 +1,16 @@
+--- a/desktop~ 2010-12-15 19:40:04.776645571 +0100
++++ b/desktop  2010-12-15 19:40:04.796645571 +0100
+@@ -1,11 +1,9 @@
+ [Desktop Entry]
+-Encoding=UTF-8
+ Name=Waterpas
+ Comment=3D sensor
+ Exec=gwaterpas
+ Icon=/usr/share/gwaterpas/icon.png
+ Terminal=false
+ Type=Application
+-Categories=Utilities;Utility;
+-SingleInstance=true
+-StartupNotify=true
++Categories=Utility;
++
diff --git a/recipes/gwaterpas/gwaterpas-0.3/remove_buildflags.patch b/recipes/gwaterpas/gwaterpas-0.3/remove_buildflags.patch
new file mode 100644 (file)
index 0000000..a4438e5
--- /dev/null
@@ -0,0 +1,53 @@
+--- a/Makefile 2009-01-31 17:28:42.000000000 +0100
++++ b/Makefile 2010-12-15 18:41:59.280095000 +0100
+@@ -1,24 +1,11 @@
+-WITH_SVN=openmoko
+-
+ PROG=gwaterpas
+ default:$(PROG)
+-CPPFLAGS      =
+-CFLAGS        = -Wall -Os -g3
+-CXXFLAGS      = -Wall -Os -g3 -fexceptions
+-LDFLAGS       = 
+-CC=gcc
+-CXX=g++
+-LD=$(CXX)
+-
+ LDLIBS = -lfltk
+-#LDLIBS +=-lXft -lX11
+ include make/include
+-DESTDIR=/usr/local
+-
+-$(PROG)-dbg : main.o Fl_Level.o
++gwaterpas:Fl_Level.o main.o
+ install:default desktop icon.png
+       @install -D -p $(PROG) $(DESTDIR)/usr/bin/$(PROG)
+--- a/make/include     2008-12-07 16:55:24.000000000 +0100
++++ b/make/include     2010-12-15 18:39:03.700095000 +0100
+@@ -103,20 +103,7 @@
+ % : %.cc
+ % : %.o
+-ifdef WITH_SVN
+-SVNVERSION := $(shell svnversion .)
+-#SVNPATH    := $(shell echo $(WITH_SVN) | sed -e "s/^[^\/]*\///g")
+-SVNPATH    := $(shell svn info | grep URL | sed -e "s/^.*\/$(WITH_SVN)\/\(.*\)/\1/g")
+-%.ov :
+-      @echo " SVN  $* $(SVNVERSION), $(SVNPATH)"
+-      @echo "const char * argp_program_version = \"$* r$(SVNVERSION), $(SVNPATH)\";"  \
+-              |$(CROSS)$(CC) -x c - -c -o $@ $(CPPFLAGS) $(CFLAGS)
+-%-dbg : %.ov
+-      @echo " LD  " $* $(LDLIBS) $(LDLIBS_$*)
+-      @$(CROSS)$(LD) -o $@ $(LDFLAGS) $^ $(LDLIBS) $(LDLIBS_$*)
+-else
+-%-dbg :
++% :
+       @echo " LD  " $* $(LDLIBS) $(LDLIBS_$*)
+-      @$(CROSS)$(LD) -o $@ $(LDFLAGS) $^ $(LDLIBS)
+-endif
++      @$(CROSS)$(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS)
diff --git a/recipes/gwaterpas/gwaterpas-0.3/sensors_fix.patch b/recipes/gwaterpas/gwaterpas-0.3/sensors_fix.patch
new file mode 100644 (file)
index 0000000..93b68ae
--- /dev/null
@@ -0,0 +1,22 @@
+--- a/main.cc~ 2010-12-15 15:10:04.196645570 +0100
++++ b/main.cc  2010-12-15 15:10:04.216645570 +0100
+@@ -41,8 +41,8 @@
+ #include "Fl_Level.H"
+-static const char dev0 [] = "/dev/input/event2";
+-static const char dev1 [] = "/dev/input/event3";
++static const char dev0 [] = "/dev/input/event3";
++static const char dev1 [] = "/dev/input/event4";
+ struct _3d {
+    double x, y, z;
+@@ -252,7 +252,7 @@
+       switch (lp->type) {
+       case EV_SYN:
+          break;
+-      case EV_REL:
++      case EV_ABS:
+          switch (lp->code) {
+          case REL_X:
+             s->raw.x = lp->value /-1e3;
diff --git a/recipes/gwaterpas/gwaterpas_0.3.bb b/recipes/gwaterpas/gwaterpas_0.3.bb
new file mode 100755 (executable)
index 0000000..fac81fc
--- /dev/null
@@ -0,0 +1,25 @@
+DESCRIPTION = "Gwaterpas"
+AUTHOR   = "Kurt Van Dijck"
+SECTION = "Utility"
+PRIORITY = "optional"
+HOMEPAGE = "http://wiki.openmoko.org/wiki/Gwaterpas"
+LICENSE = "GPL"
+DEPENDS = "fltk"
+
+SRC_URI = "http://www.ecirc.net/openmoko/${P}.tgz \
+          file://sensors_fix.patch;apply=yes \
+           file://remove_buildflags.patch;apply=yes \
+          file://desktop_fix.patch;apply=yes \
+"
+
+SRC_URI[md5sum] = "b3be847e3f89dbbcdca3e0184686bcef"
+SRC_URI[sha256sum] = "23d56f10089722a33cde507cd398c82871dd14b80be1bc3f4cd2daee2cfcf641"
+
+do_install() {
+    install -d ${D}${bindir}
+    install -m 0755 ${S}/gwaterpas ${D}${bindir}
+    install -d ${D}/${datadir}/applications
+    install -m 0644 ${S}/desktop ${D}/${datadir}/applications/gwaterpas.desktop
+    install -d ${D}/${datadir}/gwaterpas
+    install -m 0644 ${S}/icon.png ${D}/${datadir}/gwaterpas/icon.png
+}