aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md12
-rw-r--r--fheroes2/Makefile103
-rw-r--r--fheroes2/files/fheroes2.cfg90
-rw-r--r--fheroes2/patches/001-crosscompile.patch20
-rw-r--r--freeciv/Makefile53
-rw-r--r--freeciv/files/kbdmouse.h21
-rw-r--r--freeciv/files/keyboard.c94
-rw-r--r--freeciv/patches/100-small-screen-defaults.patch47
-rw-r--r--freeciv/patches/200-kbdmouse.patch171
-rw-r--r--gnash/Makefile64
-rw-r--r--gnash/patches/100-no-libintl_h.patch11
-rw-r--r--hubbub/Makefile61
-rw-r--r--hubbub/patches/010-flags.patch11
-rw-r--r--keymouse/Makefile32
-rw-r--r--keymouse/patches/001-no-x11-include.patch10
-rw-r--r--libcss/Makefile62
-rw-r--r--libcss/patches/010-flags.patch11
-rw-r--r--libcss/patches/020-no-cast-align-warn.patch11
-rw-r--r--libnsfb/Makefile67
-rw-r--r--libnsfb/files/kbdmouse.h24
-rw-r--r--libnsfb/files/keyboard.c94
-rw-r--r--libnsfb/patches/010-flags.patch11
-rw-r--r--libnsfb/patches/020-no-cast-align-warn.patch11
-rw-r--r--libnsfb/patches/030-remove-unused-frontends.patch18
-rw-r--r--libnsfb/patches/200-sdl-kbdmouse.patch163
-rw-r--r--libnsgif/Makefile60
-rw-r--r--libnsgif/patches/010-flags.patch11
-rw-r--r--libparserutils/Makefile68
-rw-r--r--libparserutils/patches/010-flags.patch11
-rw-r--r--libwapcaplet/Makefile60
-rw-r--r--libwapcaplet/patches/010-flags.patch11
-rw-r--r--mpg123/Makefile80
-rw-r--r--mplayer/Makefile57
-rw-r--r--netsurf/Makefile66
-rw-r--r--netsurf/files/DejaVuSans.ttfbin0 -> 622020 bytes
-rw-r--r--netsurf/files/Makefile.config114
-rw-r--r--netsurf/patches/010-flags.patch11
-rw-r--r--netsurf/patches/100-default-options.patch48
-rw-r--r--videoteco/Makefile33
-rw-r--r--videoteco/patches/0001-flags.patch22
40 files changed, 1924 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..a18e9ff
--- /dev/null
+++ b/README.md
@@ -0,0 +1,12 @@
+# Ben NanoNote Ports
+
+This is an [OpenWrt](http://openwrt.org/) feed with ports for the [Ben NanoNote](http://en.qi-hardware.com/wiki/Ben_NanoNote) pocket computer (i.e. to be used with its official OpenWrt fork).
+Most packages should have lengthy descriptions.
+
+## Issues
+
+* The [Gnash](http://www.gnu.org/software/gnash/) port _compiles_ but still has _basic_ runtime problems. The NanoNote is probably too slow for it anyways.
+* The [KeyMouse](http://keymouse.berlios.de/) port is largely untested. I don't really need it anyways. It's much easier to simply patch keyboard-mouse emulation into the application.
+* Most packages need source archives which are not publicly available (latest SVN revisions) as downloads. I should either provide these archives or adapt the packages to export SVN repositories automatically. Or fork the projects...
+* I also fixed/extended some packages from the OpenWrt/nanonote feeds. I should fork them to have this public.
+* Most of the patches should go mainstream, shouldn't they? Well except for the kind of hairy keyboard-mouse support in the [NetSurf](http://www.netsurf-browser.org/) port.
diff --git a/fheroes2/Makefile b/fheroes2/Makefile
new file mode 100644
index 0000000..820fcaa
--- /dev/null
+++ b/fheroes2/Makefile
@@ -0,0 +1,103 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=fheroes2
+PKG_VERSION:=r1954
+PKG_RELEASE:=1
+
+PKG_SOURCE:=fheroes2-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@SF/fheroes2
+PKG_MD5SUM:=612a4fe2d18b748bc4367ffddff734b5
+
+PKG_BUILD_DIR=$(BUILD_DIR)/fheroes2-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/fheroes2
+ SECTION:=games
+ CATEGORY:=Games
+ DEPENDS:=+libsdl +libsdl-image +libpng +zlib
+ TITLE:=Free Heroes 2 Engine
+ URL:=http://sourceforge.net/projects/fheroes2/
+ MENU:=1
+endef
+
+define Package/fheroes2/config
+ menu "Configuration"
+ depends on PACKAGE_fheroes2
+
+ config FHEROES2_WITH_UNICODE
+ prompt "Unicode, internationalization and TTF support"
+ bool
+ select PACKAGE_libsdl-ttf
+ select PACKAGE_libintl
+
+ config FHEROES2_WITH_MUSIC
+ prompt "MIDI/OGG Music support"
+ bool
+ select PACKAGE_libsdl-mixer
+ endmenu
+endef
+
+define Package/fheroes2/description
+Free implementation of Heroes of the Might and Magic II engine.
+
+Note that SDL-mixer has built-in Timidity MIDI support (that also
+requires GUS patches of course) but apparently won't work with
+the HOMM2 game data since it uses XMI. So either compile without
+music support or get/render OGG versions of the music and place them
+under /usr/share/fheroes2/files/music and adapt fheroes2.cfg
+accordingly. Also make sure SDL-mixer is compiled with OGG music
+support. fheroes2 also supports external programs to play music
+when SDL-mixer support is disabled, so there may be other
+possibilities...
+endef
+
+MAKE_VARS := \
+ WITHOUT_AUDIOCD=y \
+ WITHOUT_NETWORK=y \
+ WITHOUT_EDITOR=y
+
+ifeq ($(CONFIG_FHEROES2_WITH_UNICODE),)
+
+MAKE_VARS += WITHOUT_UNICODE=y
+
+else
+
+EXTRA_CPPFLAGS += -I$(STAGING_DIR)/usr/lib/libintl/include
+EXTRA_LDFLAGS += -L$(STAGING_DIR)/usr/lib/libintl/lib -lintl
+
+# SDL_ttf depends on libfreetype but somehow the lib cannot be found automatically
+EXTRA_LDFLAGS += $(shell $(STAGING_DIR)/host/bin/freetype-config --libs)
+
+endif
+
+ifeq ($(CONFIG_FHEROES2_WITH_MUSIC),)
+MAKE_VARS += WITHOUT_MIXER=y
+endif
+
+# SDL depends on DirectFB but somehow the libs are not not found automatically
+EXTRA_LDFLAGS += $(shell $(STAGING_DIR)/root-xburst/usr/bin/directfb-config --libs --prefix=$(STAGING_DIR)/usr)
+
+EXTRA_CPPFLAGS += \
+ -D'CONFIGURE_FHEROES2_DATA=\"/usr/share/fheroes2\"' \
+ -DWITH_KEYMAPPING -DWITHOUT_MOUSE
+
+define Build/Configure
+endef
+
+define Build/Compile
+ $(CONFIGURE_VARS) \
+ $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_VARS)
+endef
+
+define Package/fheroes2/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/fheroes2 $(1)/usr/bin/
+ $(INSTALL_DIR) $(1)/usr/share/fheroes2
+ $(INSTALL_DATA) $(SOURCE)/files/fheroes2.cfg $(1)/usr/share/fheroes2/
+ $(INSTALL_DIR) $(1)/usr/share/fheroes2/data
+ $(INSTALL_DIR) $(1)/usr/share/fheroes2/maps
+ $(CP) -r $(PKG_BUILD_DIR)/files $(1)/usr/share/fheroes2/
+endef
+
+$(eval $(call BuildPackage,fheroes2))
diff --git a/fheroes2/files/fheroes2.cfg b/fheroes2/files/fheroes2.cfg
new file mode 100644
index 0000000..155da24
--- /dev/null
+++ b/fheroes2/files/fheroes2.cfg
@@ -0,0 +1,90 @@
+# Default config fheroes2.cfg options:
+#
+# path to directory data
+# data = /usr/share/fheroes2/data
+#
+# path to directory maps, you can set few maps
+# maps = maps
+# maps = /usr/share/fheroes2/maps
+#
+# use alternative resource
+# alt resource = off
+#
+# sound: on off
+sound = on
+#
+# music: on,midi,cd,ext,off
+music = on
+#
+# sound volume: 0 - 10
+# sound volume = 6
+#
+# music volume: 0 - 10
+# music volume = 6
+#
+# external play music command:
+# playmus command = ""
+#
+# video mode (640x480, 800x576, 1024x768, 1280x1024 or other divisible 32)
+videomode = 320x240
+#
+# current animation speed: 0 - 10
+animation = 10
+#
+# fullscreen: on off (F4 switch)
+fullscreen = on
+#
+# debug
+debug = off
+#
+# use ttf fonts
+unicode = on
+#
+# force lang
+# lang = en
+#
+# font name (only with unicode = on)
+# fonts normal = dejavusans.ttf
+# fonts small = dejavusans.ttf
+# fonts normal size = 15
+# fonts small size = 10
+#
+# fonts render engine: (blended/solid) (only with unicode = on)
+fonts render = blended
+#
+# network port:
+# port = 5154
+#
+# pocket pc emulation (set auto on for videomode < 640x480)
+pocket pc = on
+#
+# pocket pc options:
+# tap delay = 1050
+# pointer offset x = 0
+# pointer offset y = 0
+#
+# virtual key mapping:
+# key_273 = '.'
+# key_275 = '/'
+
+# see http://en.qi-hardware.com/wiki/Key_codes
+
+key_98 = ';'
+key_46 = '/'
+#key_33 = ','
+key_47 = '.'
+
+key_282 = '1'
+key_283 = '3'
+key_284 = '5'
+key_285 = '7'
+key_286 = '9'
+
+emulate mouse = on
+emulate mouse step = 5
+emulate mouse up = 273
+emulate mouse down = 274
+emulate mouse right = 275
+emulate mouse left = 276
+emulate press left = 292
+emulate press right = 293
diff --git a/fheroes2/patches/001-crosscompile.patch b/fheroes2/patches/001-crosscompile.patch
new file mode 100644
index 0000000..ad1f5c2
--- /dev/null
+++ b/fheroes2/patches/001-crosscompile.patch
@@ -0,0 +1,20 @@
+--- a/src/Makefile 2010-10-02 21:43:52.099078234 +0200
++++ b/src/Makefile 2010-10-02 23:46:44.197838553 +0200
+@@ -6,8 +6,8 @@
+ SDL_LIBS := $(shell sdl-config --libs)
+ SDL_FLAGS := $(shell sdl-config --cflags)
+
+-CFLAGS := $(CFLAGS) -Wall -fsigned-char -DWITH_KEYMAPPING
+-LDFLAGS :=
++CFLAGS := $(CFLAGS) $(CPPFLAGS) -Wall -fsigned-char -DWITH_KEYMAPPING
++LDFLAGS := $(LDFLAGS)
+ LIBS :=
+
+ ifdef DEBUG
+--- a/src/Makefile.unix 2010-10-02 21:43:38.669081686 +0200
++++ b/src/Makefile.unix 2010-10-02 21:43:47.457845197 +0200
+@@ -1,2 +1,2 @@
+-AR := ar
+-CXX := g++
++AR ?= ar
++CXX ?= g++
diff --git a/freeciv/Makefile b/freeciv/Makefile
new file mode 100644
index 0000000..236e9e0
--- /dev/null
+++ b/freeciv/Makefile
@@ -0,0 +1,53 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=freeciv
+PKG_VERSION:=2.2.3
+PKG_RELEASE:=1
+
+PKG_SOURCE:=freeciv-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=@SF/freeciv
+PKG_MD5SUM:=b324e3c59f029d0566482f584181a4b2
+
+PKG_BUILD_DIR=$(BUILD_DIR)/freeciv-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/freeciv
+ SECTION:=games
+ CATEGORY:=Games
+ DEPENDS:=+libsdl +libsdl-image +libsdl-mixer +libfreetype +libiconv
+ TITLE:=Freeciv
+ URL:=http://freeciv.wikia.com/
+endef
+
+define Package/freeciv/description
+Open Source Civilization-like game (SDL client)
+endef
+
+# SDL depends on DirectFB but somehow the libs are not not found automatically
+EXTRA_LDFLAGS += $(shell $(STAGING_DIR)/root-xburst/usr/bin/directfb-config --libs --prefix=$(STAGING_DIR)/usr)
+
+EXTRA_CPPFLAGS += \
+ -DALWAYS_ROOT -DSMALL_SCREEN \
+ -DKBDMOUSE='\"$(SOURCE)/files/kbdmouse.h\"'
+
+CONFIGURE_ARGS += \
+ --enable-ipv6=no \
+ --enable-client=sdl \
+ --disable-nls \
+ --with-sdl-prefix=$(STAGING_DIR)/usr \
+ --with-libiconv-prefix=$(STAGING_DIR)/usr/lib/libiconv
+
+define Build/Compile
+ $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" \
+ install
+endef
+
+define Package/freeciv/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/{civmanual,freeciv-server,freeciv-sdl} $(1)/usr/bin/
+ $(INSTALL_DIR) $(1)/usr/share
+ $(CP) -r $(PKG_INSTALL_DIR)/usr/share/freeciv $(1)/usr/share/
+endef
+
+$(eval $(call BuildPackage,freeciv))
diff --git a/freeciv/files/kbdmouse.h b/freeciv/files/kbdmouse.h
new file mode 100644
index 0000000..a99ba10
--- /dev/null
+++ b/freeciv/files/kbdmouse.h
@@ -0,0 +1,21 @@
+/*
+ *
+ * Keyboard Mouse Emulation Config
+ *
+ */
+
+#include "keyboard.c"
+
+#define KBDMOUSE_LEFT_CLICK NNKEY_QI
+#define KBDMOUSE_MIDDLE_CLICK NNKEY_VOLUMEDOWN
+#define KBDMOUSE_RIGHT_CLICK NNKEY_VOLUMEUP
+
+#define KBDMOUSE_UP NNKEY_UP
+#define KBDMOUSE_DOWN NNKEY_DOWN
+#define KBDMOUSE_LEFT NNKEY_LEFT
+#define KBDMOUSE_RIGHT NNKEY_RIGHT
+
+#define KBDMOUSE_STEP 5
+
+#define KBDMOUSE_REPEAT_DELAY SDL_DEFAULT_REPEAT_DELAY
+#define KBDMOUSE_REPEAT_INTERVAL (SDL_DEFAULT_REPEAT_INTERVAL/2)
diff --git a/freeciv/files/keyboard.c b/freeciv/files/keyboard.c
new file mode 100644
index 0000000..cde8c0d
--- /dev/null
+++ b/freeciv/files/keyboard.c
@@ -0,0 +1,94 @@
+/*
+ keyboard.c
+
+ Contains defines for every
+ key on the Ben NanoNote.
+
+ Data collected and compiled
+ by xdpirate of #qi-hardware
+ on irc.freenode.net
+*/
+
+/* Function keys */
+#define NNKEY_F1 282
+#define NNKEY_F2 283
+#define NNKEY_F3 284
+#define NNKEY_F4 285
+#define NNKEY_F5 286
+#define NNKEY_F6 287
+#define NNKEY_F7 288
+#define NNKEY_F8 289
+
+/* First (top) keyboard row */
+#define NNKEY_Q 113
+#define NNKEY_W 119
+#define NNKEY_E 101
+#define NNKEY_R 114
+#define NNKEY_T 116
+#define NNKEY_Y 121
+#define NNKEY_U 117
+#define NNKEY_I 105
+#define NNKEY_O 111
+#define NNKEY_P 112
+
+/* Second keyboard row */
+#define NNKEY_A 97
+#define NNKEY_S 115
+#define NNKEY_D 100
+#define NNKEY_F 102
+#define NNKEY_G 103
+#define NNKEY_H 104
+#define NNKEY_J 106
+#define NNKEY_K 107
+#define NNKEY_L 108
+#define NNKEY_BACKSPACE 8
+
+/* Third keyboard row */
+#define NNKEY_ESCAPE 27
+#define NNKEY_Z 122
+#define NNKEY_X 120
+#define NNKEY_C 99
+#define NNKEY_V 118
+#define NNKEY_B 98
+#define NNKEY_N 110
+#define NNKEY_M 109
+#define NNKEY_EQUALS 61
+#define NNKEY_ENTER 13 // Enter and Return are very often used interchangeably, so since there's
+#define NNKEY_RETURN 13 // only one Enter key on the NN, they're both defined to the same key
+
+/* Fourth keyboard row, not including arrows/volume */
+#define NNKEY_TAB 9
+#define NNKEY_CAPSLOCK 301 // Same key, two constants
+#define NNKEY_CAPS 301 // for simplicity
+#define NNKEY_BACKSLASH 92
+#define NNKEY_APOSTROPHE 180
+#define NNKEY_COMMA 44
+#define NNKEY_PERIOD 46
+#define NNKEY_SLASH 47
+
+/* Fifth (bottom) keyboard row, not including arrows/volume */
+#define NNKEY_SHIFT 304
+#define NNKEY_ALT 308
+#define NNKEY_FUNCTION 306 // Same
+#define NNKEY_FN 306 // key
+#define NNKEY_RED 307 // Same
+#define NNKEY_ALTGR 307 // key
+#define NNKEY_SPACE 32
+#define NNKEY_QI 0 // Yes, the Qi-button actually returns 0!
+#define NNKEY_CTRL 305 // Same
+#define NNKEY_CONTROL 305 // key
+
+/* Arrow keys and Volume keys */
+#define NNKEY_UP 273
+#define NNKEY_DOWN 274
+#define NNKEY_LEFT 276
+#define NNKEY_RIGHT 275
+#define NNKEY_VOLUP 292
+#define NNKEY_VOLUMEUP 292
+#define NNKEY_VOLDOWN 293
+#define NNKEY_VOLUMEDOWN 293
+
+#define NNKEY_POWER 0 // NOTE: This key is only here for completeness' sake,
+ // the NanoNote will automatically turn off after
+ // pressing this key. It shares a key code with the
+ // Qi-button (Line 77).
diff --git a/freeciv/patches/100-small-screen-defaults.patch b/freeciv/patches/100-small-screen-defaults.patch
new file mode 100644
index 0000000..cd89f90
--- /dev/null
+++ b/freeciv/patches/100-small-screen-defaults.patch
@@ -0,0 +1,47 @@
+--- a/client/options.c 2010-10-05 02:21:47.218844129 +0200
++++ b/client/options.c 2010-10-05 02:27:49.427604885 +0200
+@@ -413,9 +413,15 @@
+
+ /* gui-sdl client specific options. */
+ char gui_sdl_default_theme_name[512] = FC_SDL_DEFAULT_THEME_NAME;
++#ifdef SMALL_SCREEN
++bool gui_sdl_fullscreen = TRUE;
++int gui_sdl_screen_width = 320;
++int gui_sdl_screen_height = 240;
++#else
+ bool gui_sdl_fullscreen = FALSE;
+ int gui_sdl_screen_width = 640;
+ int gui_sdl_screen_height = 480;
++#endif
+
+ /* gui-win32 client specific options. */
+ bool gui_win32_better_fog = TRUE;
+@@ -996,6 +1002,20 @@
+ "Serif 10", NULL),
+
+ /* gui-sdl client specific options. */
++#ifdef SMALL_SCREEN
++ GEN_BOOL_OPTION(gui_sdl_fullscreen, N_("Full Screen"),
++ N_("If this option is set the client will use the "
++ "whole screen area for drawing"),
++ COC_INTERFACE, GUI_SDL, TRUE, NULL),
++ GEN_INT_OPTION(gui_sdl_screen_width, N_("Screen width"),
++ N_("This option saves the width of the selected screen "
++ "resolution"),
++ COC_INTERFACE, GUI_SDL, 320, 320, 3200, NULL),
++ GEN_INT_OPTION(gui_sdl_screen_height, N_("Screen height"),
++ N_("This option saves the height of the selected screen "
++ "resolution"),
++ COC_INTERFACE, GUI_SDL, 240, 240, 2400, NULL),
++#else
+ GEN_BOOL_OPTION(gui_sdl_fullscreen, N_("Full Screen"),
+ N_("If this option is set the client will use the "
+ "whole screen area for drawing"),
+@@ -1008,6 +1028,7 @@
+ N_("This option saves the height of the selected screen "
+ "resolution"),
+ COC_INTERFACE, GUI_SDL, 480, 240, 2400, NULL),
++#endif
+
+ /* gui-win32 client specific options. */
+ GEN_BOOL_OPTION(gui_win32_better_fog,
diff --git a/freeciv/patches/200-kbdmouse.patch b/freeciv/patches/200-kbdmouse.patch
new file mode 100644
index 0000000..57865f6
--- /dev/null
+++ b/freeciv/patches/200-kbdmouse.patch
@@ -0,0 +1,171 @@
+--- a/client/gui-sdl/gui_main.c 2010-10-05 02:45:33.008848029 +0200
++++ b/client/gui-sdl/gui_main.c 2010-10-07 13:17:01.548258233 +0200
+@@ -78,6 +78,10 @@
+
+ #include "gui_main.h"
+
++#ifdef KBDMOUSE
++#include KBDMOUSE
++#endif
++
+ #define UNITS_TIMER_INTERVAL 128 /* milliseconds */
+ #define MAP_SCROLL_TIMER_INTERVAL 500
+
+@@ -496,6 +500,108 @@
+ return(1);
+ }
+
++#ifdef KBDMOUSE
++
++int keyboard_mouse(SDL_Event *event)
++{
++ SDL_Event new;
++ int x, y;
++
++ switch (event->type) {
++ case SDL_KEYDOWN:
++ switch ((int)event->key.keysym.sym) {
++ case KBDMOUSE_LEFT_CLICK:
++ case KBDMOUSE_MIDDLE_CLICK:
++ case KBDMOUSE_RIGHT_CLICK:
++ SDL_GetMouseState(&x, &y);
++
++ new = (SDL_Event) {
++ .type = SDL_MOUSEBUTTONDOWN,
++ .button = {
++ .type = SDL_MOUSEBUTTONDOWN,
++ .which = 0,
++ .state = SDL_PRESSED,
++ .x = (Uint16)x,
++ .y = (Uint16)y
++ }
++ };
++ switch ((int)event->key.keysym.sym) {
++ case KBDMOUSE_LEFT_CLICK: new.button.button = SDL_BUTTON_LEFT; break;
++ case KBDMOUSE_MIDDLE_CLICK: new.button.button = SDL_BUTTON_MIDDLE; break;
++ case KBDMOUSE_RIGHT_CLICK: new.button.button = SDL_BUTTON_RIGHT; break;
++ }
++
++ SDL_PushEvent(&new);
++ return 0;
++
++ case KBDMOUSE_UP:
++ case KBDMOUSE_DOWN:
++ case KBDMOUSE_LEFT:
++ case KBDMOUSE_RIGHT:
++ SDL_GetMouseState(&x, &y);
++
++ switch ((int)event->key.keysym.sym) {
++ case KBDMOUSE_UP: y -= KBDMOUSE_STEP; break;
++ case KBDMOUSE_DOWN: y += KBDMOUSE_STEP; break;
++ case KBDMOUSE_RIGHT: x += KBDMOUSE_STEP; break;
++ case KBDMOUSE_LEFT: x -= KBDMOUSE_STEP; break;
++ }
++
++ SDL_WarpMouse((Uint16)x, (Uint16)y);
++ return 0;
++ }
++ break;
++
++ case SDL_KEYUP:
++ switch ((int)event->key.keysym.sym) {
++ case KBDMOUSE_LEFT_CLICK:
++ case KBDMOUSE_MIDDLE_CLICK:
++ case KBDMOUSE_RIGHT_CLICK:
++ SDL_GetMouseState(&x, &y);
++
++ new = (SDL_Event) {
++ .type = SDL_MOUSEBUTTONUP,
++ .button = {
++ .type = SDL_MOUSEBUTTONUP,
++ .which = 0,
++ .state = SDL_RELEASED,
++ .x = (Uint16)x,
++ .y = (Uint16)y
++ }
++ };
++ switch ((int)event->key.keysym.sym) {
++ case KBDMOUSE_LEFT_CLICK: new.button.button = SDL_BUTTON_LEFT; break;
++ case KBDMOUSE_MIDDLE_CLICK: new.button.button = SDL_BUTTON_MIDDLE; break;
++ case KBDMOUSE_RIGHT_CLICK: new.button.button = SDL_BUTTON_RIGHT; break;
++ }
++
++ SDL_PushEvent(&new);
++ return 0;
++
++ case KBDMOUSE_UP:
++ case KBDMOUSE_DOWN:
++ case KBDMOUSE_LEFT:
++ case KBDMOUSE_RIGHT:
++ return 0;
++ }
++ break;
++
++ default:
++ break;
++ }
++
++ return -1;
++}
++
++#else
++
++int keyboard_mouse(SDL_Event *event __attribute__((unused)))
++{
++ return -1;
++}
++
++#endif
++
+ /**************************************************************************
+ ...
+ **************************************************************************/
+@@ -596,6 +702,9 @@
+
+ while (SDL_PollEvent(&Main.event) == 1) {
+
++ if (!keyboard_mouse(&Main.event))
++ continue;
++
+ switch (Main.event.type) {
+
+ case SDL_QUIT:
+@@ -763,6 +872,10 @@
+ putenv((char *)"SDL_VIDEO_CENTERED=yes");
+
+ init_sdl(iSDL_Flags);
++
++#ifdef KBDMOUSE
++ SDL_EnableKeyRepeat(KBDMOUSE_REPEAT_DELAY, KBDMOUSE_REPEAT_INTERVAL);
++#endif
+
+ freelog(LOG_NORMAL, _("Using Video Output: %s"),
+ SDL_VideoDriverName(device, sizeof(device)));
+--- a/client/gui-sdl/widget_edit.c 2010-10-05 04:29:20.907598799 +0200
++++ b/client/gui-sdl/widget_edit.c 2010-10-05 04:41:51.888846695 +0200
+@@ -30,6 +30,10 @@
+ #include "widget.h"
+ #include "widget_p.h"
+
++#ifdef KBDMOUSE
++#include KBDMOUSE
++#endif
++
+ struct UniChar {
+ struct UniChar *next;
+ struct UniChar *prev;
+@@ -730,9 +734,13 @@
+ del_chain(pEdt.pBeginTextChain);
+
+ FREESURFACE(pEdt.pBg);
+-
++
++#ifdef KBDMOUSE
++ SDL_EnableKeyRepeat(KBDMOUSE_REPEAT_DELAY, KBDMOUSE_REPEAT_INTERVAL);
++#else
+ /* disable repeate key */
+ SDL_EnableKeyRepeat(0, SDL_DEFAULT_REPEAT_INTERVAL);
++#endif
+
+ /* disable Unicode */
+ SDL_EnableUNICODE(0);
diff --git a/gnash/Makefile b/gnash/Makefile
new file mode 100644
index 0000000..145c487
--- /dev/null
+++ b/gnash/Makefile
@@ -0,0 +1,64 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=gnash
+PKG_VERSION:=0.8.8
+PKG_RELEASE:=1
+
+PKG_SOURCE:=gnash-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://ftp.gnu.org/pub/gnu/gnash/$(PKG_VERSION)/$(PKG_SOURCE)
+PKG_MD5SUM:=aec414ee3bebb8901054818fae735214
+
+PKG_BUILD_DIR=$(BUILD_DIR)/gnash-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/gnash
+ SECTION:=multimedia
+ CATEGORY:=Multimedia
+ DEPENDS:=+libsdl +libffmpeg +cairo +libjpeg +libpng +giflib +libfreetype +fontconfig \
+ +boost-thread +boost-date_time +libcurl
+ TITLE:=GNU Flash Player
+ URL:=http://www.gnu.org/software/gnash/
+endef
+
+define Package/gnash/description
+GNU Flash Player
+endef
+
+CONFIGURE_ARGS += \
+ --enable-renderer=cairo \
+ --enable-media=ffmpeg \
+ --enable-gui=sdl \
+ --disable-plugins \
+ --with-boost-lib="$(STAGING_DIR)/usr/lib" \
+ --with-ffmpeg-lib="$(STAGING_DIR)/usr/lib" \
+ --with-fontconfig-lib="$(STAGING_DIR)/usr/lib" \
+ --with-freetype-incl="$(STAGING_DIR)/usr/include/freetype2" \
+ --with-freetype-lib="$(STAGING_DIR)/usr/lib" \
+ --with-cairo-incl="$(STAGING_DIR)/usr/include/cairo" \
+ --with-curl-lib="$(STAGING_DIR)/usr/lib"
+
+EXTRA_CPPFLAGS += $(shell $(STAGING_DIR)/host/bin/sdl-config --cflags --prefix=$(STAGING_DIR)/usr)
+EXTRA_LDFLAGS += $(shell $(STAGING_DIR)/host/bin/sdl-config --libs --prefix=$(STAGING_DIR)/usr)
+
+EXTRA_CPPFLAGS += $(shell $(STAGING_DIR)/usr/bin/curl-config --cflags)
+EXTRA_LDFLAGS += $(shell $(STAGING_DIR)/usr/bin/curl-config --libs)
+
+# cairo dependencies (not returned by pkg-config!?):
+EXTRA_LDFLAGS += -lpixman-1 -lfreetype -lfontconfig -lexpat -ldirectfb -lfusion -ldirect -lpng12 -lz
+
+define Build/Compile
+ $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" \
+ install
+endef
+
+define Package/gnash/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/{gnash,sdl-gnash} $(1)/usr/bin/
+ $(INSTALL_DIR) $(1)/usr/lib/gnash
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/gnash/*.so* $(1)/usr/lib/gnash/
+ $(INSTALL_DIR) $(1)/etc
+ $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/gnashrc $(1)/etc/
+endef
+
+$(eval $(call BuildPackage,gnash))
diff --git a/gnash/patches/100-no-libintl_h.patch b/gnash/patches/100-no-libintl_h.patch
new file mode 100644
index 0000000..6d06630
--- /dev/null
+++ b/gnash/patches/100-no-libintl_h.patch
@@ -0,0 +1,11 @@
+--- a/libbase/gettext.h 2010-09-28 04:49:35.105403121 +0200
++++ b/libbase/gettext.h 2010-09-28 04:50:42.844171463 +0200
+@@ -43,7 +43,7 @@
+ #if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3)
+ # include <cstdlib>
+ # if (__GLIBC__ >= 2) || _GLIBCXX_HAVE_LIBINTL_H
+-# include <libintl.h>
++//# include <libintl.h>
+ # endif
+ #endif
+
diff --git a/hubbub/Makefile b/hubbub/Makefile
new file mode 100644
index 0000000..7b8008c
--- /dev/null
+++ b/hubbub/Makefile
@@ -0,0 +1,61 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=hubbub
+PKG_VERSION:=r10879
+PKG_RELEASE:=1
+
+PKG_SOURCE:=hubbub-$(PKG_VERSION).tar.gz
+#PKG_SOURCE_URL:=
+PKG_MD5SUM:=0791d7b2ff8d37f601469c8b9e4ecad3
+
+PKG_BUILD_DIR=$(BUILD_DIR)/hubbub-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/hubbub
+ SECTION:=net
+ CATEGORY:=Network
+ SUBMENU:=Web
+ DEPENDS:=+libiconv +libparserutils
+ TITLE:=HTML5 Compliant Parsing Library (NetSurf)
+ URL:=http://www.netsurf-browser.org/projects/hubbub/
+endef
+
+define Package/hubbub/description
+Hubbub is an HTML5 compliant parsing library, written in C.
+It was developed as part of the NetSurf project and is available for use by
+other software under the MIT licence.
+endef
+
+MAKE_VARS := \
+ TARGET=linux \
+ PREFIX=/usr \
+ COMPONENT_TYPE=lib-shared
+
+define Build/Configure
+endef
+
+define Build/Compile
+ $(CONFIGURE_VARS) \
+ $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" \
+ $(MAKE_VARS) install
+endef
+
+define Build/InstallDev
+ $(INSTALL_DIR) $(1)/usr/include/hubbub
+ $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/hubbub/{errors,functypes,hubbub,parser,tree,types}.h \
+ $(1)/usr/include/hubbub
+
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libhubbub.so* $(1)/usr/lib
+
+ $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+ $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libhubbub.pc $(1)/usr/lib/pkgconfig
+endef
+
+define Package/hubbub/install
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libhubbub.so* $(1)/usr/lib
+endef
+
+$(eval $(call BuildPackage,hubbub))
diff --git a/hubbub/patches/010-flags.patch b/hubbub/patches/010-flags.patch
new file mode 100644
index 0000000..fb1c484
--- /dev/null
+++ b/hubbub/patches/010-flags.patch
@@ -0,0 +1,11 @@
+--- a/Makefile 2010-10-10 18:15:05.069139402 +0200
++++ b/Makefile 2010-10-10 18:15:25.739134475 +0200
+@@ -18,7 +18,7 @@
+ WARNFLAGS := $(WARNFLAGS) -Werror
+ endif
+ CFLAGS := -D_BSD_SOURCE -I$(CURDIR)/include/ \
+- -I$(CURDIR)/src $(WARNFLAGS) $(CFLAGS)
++ -I$(CURDIR)/src $(WARNFLAGS) $(CFLAGS) $(CPPFLAGS)
+ ifneq ($(GCCVER),2)
+ CFLAGS := $(CFLAGS) -std=c99
+ else
diff --git a/keymouse/Makefile b/keymouse/Makefile
new file mode 100644
index 0000000..541f6e5
--- /dev/null
+++ b/keymouse/Makefile
@@ -0,0 +1,32 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=keymouse
+PKG_VERSION:=0.1
+PKG_RELEASE:=1
+
+PKG_SOURCE:=keymouse-$(PKG_VERSION).tar.gz
+#PKG_SOURCE_URL:=
+PKG_MD5SUM:=931d3125584f5abf1d8323bf1fec95e0
+
+PKG_BUILD_DIR=$(BUILD_DIR)/keymouse-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/keymouse
+ SECTION:=utils
+ CATEGORY:=Utilities
+ DEPENDS:=
+ TITLE:=Keyboard mouse emulator
+ URL:=http://keymouse.berlios.de/
+endef
+
+define Package/keymouse/description
+Keyboard mouse emulator
+endef
+
+define Package/keymouse/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/keymouse $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,keymouse))
diff --git a/keymouse/patches/001-no-x11-include.patch b/keymouse/patches/001-no-x11-include.patch
new file mode 100644
index 0000000..33f0ebf
--- /dev/null
+++ b/keymouse/patches/001-no-x11-include.patch
@@ -0,0 +1,10 @@
+--- a/src/shortcut.h 2010-09-25 20:29:03.237575472 +0200
++++ b/src/shortcut.h 2010-09-25 20:29:20.167570555 +0200
+@@ -26,7 +26,6 @@
+ #define SHORTCUT_H
+
+ #include <string>
+-#include <X11/Xlib.h>
+ #include "device.h"
+
+ /*! \brief Valid actions for config file
diff --git a/libcss/Makefile b/libcss/Makefile
new file mode 100644
index 0000000..7cbd859
--- /dev/null
+++ b/libcss/Makefile
@@ -0,0 +1,62 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libcss
+PKG_VERSION:=r10879
+PKG_RELEASE:=1
+
+PKG_SOURCE:=libcss-$(PKG_VERSION).tar.gz
+#PKG_SOURCE_URL:=
+PKG_MD5SUM:=3cf4fbcf5e0fe2059dfc872a098b1dd7
+
+PKG_BUILD_DIR=$(BUILD_DIR)/libcss-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libcss
+ SECTION:=net
+ CATEGORY:=Network
+ SUBMENU:=Web
+ DEPENDS:=+libparserutils +libwapcaplet
+ TITLE:=CSS Parser and Selection Engine (NetSurf)
+ URL:=http://www.netsurf-browser.org/projects/libcss/
+endef
+
+define Package/libcss/description
+LibCSS is a CSS parser and selection engine, written in C.
+It aims to parse the forward compatible CSS grammar.
+It was developed as part of the NetSurf project and is available for use by
+other software under the MIT licence.
+endef
+
+MAKE_VARS := \
+ TARGET=linux \
+ PREFIX=/usr \
+ COMPONENT_TYPE=lib-shared
+
+define Build/Configure
+endef
+
+define Build/Compile
+ $(CONFIGURE_VARS) \
+ $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" \
+ $(MAKE_VARS) install
+endef
+
+define Build/InstallDev
+ $(INSTALL_DIR) $(1)/usr/include/libcss
+ $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/libcss/{computed,errors,fpmath,functypes,hint,libcss,properties,select,stylesheet,types}.h \
+ $(1)/usr/include/libcss
+
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcss.so* $(1)/usr/lib
+
+ $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+ $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libcss.pc $(1)/usr/lib/pkgconfig
+endef
+
+define Package/libcss/install
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcss.so* $(1)/usr/lib
+endef
+
+$(eval $(call BuildPackage,libcss))
diff --git a/libcss/patches/010-flags.patch b/libcss/patches/010-flags.patch
new file mode 100644
index 0000000..2f7f02f
--- /dev/null
+++ b/libcss/patches/010-flags.patch
@@ -0,0 +1,11 @@
+--- a/Makefile 2010-10-10 17:55:57.487885012 +0200
++++ b/Makefile 2010-10-10 17:58:02.067884565 +0200
+@@ -20,7 +20,7 @@
+ endif
+ endif
+ CFLAGS := -D_BSD_SOURCE -I$(CURDIR)/include/ \
+- -I$(CURDIR)/src $(WARNFLAGS) $(CFLAGS)
++ -I$(CURDIR)/src $(WARNFLAGS) $(CFLAGS) $(CPPFLAGS)
+ ifneq ($(GCCVER),2)
+ CFLAGS := $(CFLAGS) -std=c99
+ else
diff --git a/libcss/patches/020-no-cast-align-warn.patch b/libcss/patches/020-no-cast-align-warn.patch
new file mode 100644
index 0000000..905176d
--- /dev/null
+++ b/libcss/patches/020-no-cast-align-warn.patch
@@ -0,0 +1,11 @@
+--- a/Makefile 2010-10-10 18:18:37.237899682 +0200
++++ b/Makefile 2010-10-10 18:18:46.477895474 +0200
+@@ -10,7 +10,7 @@
+ TESTRUNNER := $(PERL) build/testtools/testrunner.pl
+
+ # Toolchain flags
+-WARNFLAGS := -Wall -W -Wundef -Wpointer-arith -Wcast-align \
++WARNFLAGS := -Wall -W -Wundef -Wpointer-arith \
+ -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \
+ -Wmissing-declarations -Wnested-externs -pedantic
+ # BeOS/Haiku/AmigaOS4 standard library headers create warnings
diff --git a/libnsfb/Makefile b/libnsfb/Makefile
new file mode 100644
index 0000000..f78cae2
--- /dev/null
+++ b/libnsfb/Makefile
@@ -0,0 +1,67 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libnsfb
+PKG_VERSION:=r10875
+PKG_RELEASE:=1
+
+PKG_SOURCE:=libnsfb-$(PKG_VERSION).tar.gz
+#PKG_SOURCE_URL:=
+PKG_MD5SUM:=9ca6a6dde2501ad77b0e3d1e88a199fc
+
+PKG_BUILD_DIR=$(BUILD_DIR)/libnsfb-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libnsfb
+ SECTION:=net
+ CATEGORY:=Network
+ SUBMENU:=Web
+ DEPENDS:=+libsdl
+ TITLE:=NetSurf Framebuffer Abstraction Library
+ URL:=http://www.netsurf-browser.org/projects/libnsfb/
+endef
+
+define Package/libnsfb/description
+LibNSFB is a framebuffer abstraction library, written in C.
+It is currently in development for use with NetSurf and is intended
+to be suitable for use in other projects too.
+
+This package will build support for the Linux framebuffer and
+SDL providers.
+endef
+
+EXTRA_CPPFLAGS += \
+ -DKBDMOUSE='\"$(SOURCE)/files/kbdmouse.h\"'
+
+MAKE_VARS := \
+ TARGET=linux \
+ PREFIX=/usr \
+ COMPONENT_TYPE=lib-shared
+
+define Build/Configure
+endef
+
+define Build/Compile
+ $(CONFIGURE_VARS) \
+ $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" \
+ $(MAKE_VARS) install
+endef
+
+define Build/InstallDev
+ $(INSTALL_DIR) $(1)/usr/include
+ $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/libnsfb.h $(1)/usr/include
+ $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/libnsfb_{plot,plot_util,event,cursor}.h $(1)/usr/include
+
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnsfb.so* $(1)/usr/lib
+
+ $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+ $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libnsfb.pc $(1)/usr/lib/pkgconfig
+endef
+
+define Package/libnsfb/install
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnsfb.so* $(1)/usr/lib
+endef
+
+$(eval $(call BuildPackage,libnsfb))
diff --git a/libnsfb/files/kbdmouse.h b/libnsfb/files/kbdmouse.h
new file mode 100644
index 0000000..408f82a
--- /dev/null
+++ b/libnsfb/files/kbdmouse.h
@@ -0,0 +1,24 @@
+/*
+ *
+ * Keyboard Mouse Emulation Config
+ *
+ */
+
+#include "keyboard.c"
+
+#define KBDMOUSE_TOGGLE NNKEY_QI
+
+#define KBDMOUSE_LEFT_CLICK NNKEY_VOLUMEDOWN
+#define KBDMOUSE_RIGHT_CLICK NNKEY_VOLUMEUP
+
+#define KBDMOUSE_UP NNKEY_UP
+#define KBDMOUSE_DOWN NNKEY_DOWN
+#define KBDMOUSE_LEFT NNKEY_LEFT
+#define KBDMOUSE_RIGHT NNKEY_RIGHT
+
+#define KBDMOUSE_QUIT_HACK NNKEY_ESCAPE
+
+#define KBDMOUSE_STEP 5
+
+#define KBDMOUSE_REPEAT_DELAY SDL_DEFAULT_REPEAT_DELAY
+#define KBDMOUSE_REPEAT_INTERVAL (SDL_DEFAULT_REPEAT_INTERVAL/2)
diff --git a/libnsfb/files/keyboard.c b/libnsfb/files/keyboard.c
new file mode 100644
index 0000000..cde8c0d
--- /dev/null
+++ b/libnsfb/files/keyboard.c
@@ -0,0 +1,94 @@
+/*
+ keyboard.c
+
+ Contains defines for every
+ key on the Ben NanoNote.
+
+ Data collected and compiled
+ by xdpirate of #qi-hardware
+ on irc.freenode.net
+*/
+
+/* Function keys */
+#define NNKEY_F1 282
+#define NNKEY_F2 283
+#define NNKEY_F3 284
+#define NNKEY_F4 285
+#define NNKEY_F5 286
+#define NNKEY_F6 287
+#define NNKEY_F7 288
+#define NNKEY_F8 289
+
+/* First (top) keyboard row */
+#define NNKEY_Q 113
+#define NNKEY_W 119
+#define NNKEY_E 101
+#define NNKEY_R 114
+#define NNKEY_T 116
+#define NNKEY_Y 121
+#define NNKEY_U 117
+#define NNKEY_I 105
+#define NNKEY_O 111
+#define NNKEY_P 112
+
+/* Second keyboard row */
+#define NNKEY_A 97
+#define NNKEY_S 115
+#define NNKEY_D 100
+#define NNKEY_F 102
+#define NNKEY_G 103
+#define NNKEY_H 104
+#define NNKEY_J 106
+#define NNKEY_K 107
+#define NNKEY_L 108
+#define NNKEY_BACKSPACE 8
+
+/* Third keyboard row */
+#define NNKEY_ESCAPE 27
+#define NNKEY_Z 122
+#define NNKEY_X 120
+#define NNKEY_C 99
+#define NNKEY_V 118
+#define NNKEY_B 98
+#define NNKEY_N 110
+#define NNKEY_M 109
+#define NNKEY_EQUALS 61
+#define NNKEY_ENTER 13 // Enter and Return are very often used interchangeably, so since there's
+#define NNKEY_RETURN 13 // only one Enter key on the NN, they're both defined to the same key
+
+/* Fourth keyboard row, not including arrows/volume */
+#define NNKEY_TAB 9
+#define NNKEY_CAPSLOCK 301 // Same key, two constants
+#define NNKEY_CAPS 301 // for simplicity
+#define NNKEY_BACKSLASH 92
+#define NNKEY_APOSTROPHE 180
+#define NNKEY_COMMA 44
+#define NNKEY_PERIOD 46
+#define NNKEY_SLASH 47
+
+/* Fifth (bottom) keyboard row, not including arrows/volume */
+#define NNKEY_SHIFT 304
+#define NNKEY_ALT 308
+#define NNKEY_FUNCTION 306 // Same
+#define NNKEY_FN 306 // key
+#define NNKEY_RED 307 // Same
+#define NNKEY_ALTGR 307 // key
+#define NNKEY_SPACE 32
+#define NNKEY_QI 0 // Yes, the Qi-button actually returns 0!
+#define NNKEY_CTRL 305 // Same
+#define NNKEY_CONTROL 305 // key
+
+/* Arrow keys and Volume keys */
+#define NNKEY_UP 273
+#define NNKEY_DOWN 274
+#define NNKEY_LEFT 276
+#define NNKEY_RIGHT 275
+#define NNKEY_VOLUP 292
+#define NNKEY_VOLUMEUP 292
+#define NNKEY_VOLDOWN 293
+#define NNKEY_VOLUMEDOWN 293
+
+#define NNKEY_POWER 0 // NOTE: This key is only here for completeness' sake,
+ // the NanoNote will automatically turn off after
+ // pressing this key. It shares a key code with the
+ // Qi-button (Line 77).
diff --git a/libnsfb/patches/010-flags.patch b/libnsfb/patches/010-flags.patch
new file mode 100644
index 0000000..6dad1ac
--- /dev/null
+++ b/libnsfb/patches/010-flags.patch
@@ -0,0 +1,11 @@
+--- a/Makefile 2010-10-10 05:26:39.439706253 +0200
++++ b/Makefile 2010-10-10 05:27:16.699713741 +0200
+@@ -16,7 +16,7 @@
+ -Wmissing-declarations -Wnested-externs -Werror -pedantic \
+ -Wno-overlength-strings # For nsglobe.c
+ CFLAGS := -g -std=c99 -D_BSD_SOURCE -I$(CURDIR)/include/ \
+- -I$(CURDIR)/src $(WARNFLAGS) $(CFLAGS)
++ -I$(CURDIR)/src $(WARNFLAGS) $(CFLAGS) $(CPPFLAGS)
+
+ # TODO: probably want to retrieve SDL from pkg-config
+ TESTLDFLAGS = -Wl,--whole-archive -l$(COMPONENT) -Wl,--no-whole-archive -lSDL -lxcb-icccm -lxcb -lxcb-image -lxcb-keysyms
diff --git a/libnsfb/patches/020-no-cast-align-warn.patch b/libnsfb/patches/020-no-cast-align-warn.patch
new file mode 100644
index 0000000..1ecaecd
--- /dev/null
+++ b/libnsfb/patches/020-no-cast-align-warn.patch
@@ -0,0 +1,11 @@
+--- a/Makefile 2010-10-10 05:53:28.609713613 +0200
++++ b/Makefile 2010-10-10 05:53:42.499719955 +0200
+@@ -11,7 +11,7 @@
+ TESTRUNNER = test/runtest.sh $(BUILDDIR) $(EXEEXT)
+
+ # Toolchain flags
+-WARNFLAGS := -Wall -Wextra -Wundef -Wpointer-arith -Wcast-align \
++WARNFLAGS := -Wall -Wextra -Wundef -Wpointer-arith \
+ -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \
+ -Wmissing-declarations -Wnested-externs -Werror -pedantic \
+ -Wno-overlength-strings # For nsglobe.c
diff --git a/libnsfb/patches/030-remove-unused-frontends.patch b/libnsfb/patches/030-remove-unused-frontends.patch
new file mode 100644
index 0000000..7bf811d
--- /dev/null
+++ b/libnsfb/patches/030-remove-unused-frontends.patch
@@ -0,0 +1,18 @@
+--- a/src/surface/Makefile 2010-10-10 06:21:54.469717609 +0200
++++ b/src/surface/Makefile 2010-10-10 06:22:20.259716132 +0200
+@@ -1,4 +1,4 @@
+ # Sources
+-DIR_SOURCES := surface.c sdl.c vnc.c able.c ram.c linux.c x.c
++DIR_SOURCES := surface.c sdl.c ram.c linux.c
+
+ include build/makefiles/Makefile.subdir
+--- a/libnsfb.pc.in 2010-10-10 19:08:10.649146014 +0200
++++ b/libnsfb.pc.in 2010-10-10 19:08:22.077902040 +0200
+@@ -6,6 +6,6 @@
+ Name: libnsfb
+ Description: Provides framebuffer access for netsurf.
+ Version: VERSION
+-Requires: sdl xcb xcb-icccm xcb-image xcb-keysyms
++Requires: sdl
+ Libs: -L${libdir} -lnsfb
+ Cflags: -I${includedir}
diff --git a/libnsfb/patches/200-sdl-kbdmouse.patch b/libnsfb/patches/200-sdl-kbdmouse.patch
new file mode 100644
index 0000000..660e220
--- /dev/null
+++ b/libnsfb/patches/200-sdl-kbdmouse.patch
@@ -0,0 +1,163 @@
+--- a/src/surface/sdl.c 2010-04-29 01:26:13.521908000 +0200
++++ b/src/surface/sdl.c 2010-10-13 03:06:18.945784735 +0200
+@@ -6,6 +6,10 @@
+ * http://www.opensource.org/licenses/mit-license.php
+ */
+
++#define _POSIX_SOURCE
++#include <sys/types.h>
++#include <unistd.h>
++#include <signal.h>
+ #include <stdbool.h>
+ #include <stdlib.h>
+ #include <SDL/SDL.h>
+@@ -20,6 +24,10 @@
+ #include "plot.h"
+ #include "cursor.h"
+
++#ifdef KBDMOUSE
++#include KBDMOUSE
++#endif
++
+ enum nsfb_key_code_e sdl_nsfb_map[] = {
+ NSFB_KEY_UNKNOWN,
+ NSFB_KEY_UNKNOWN,
+@@ -470,7 +478,11 @@
+ nsfb->linelen = sdl_screen->pitch;
+
+ SDL_ShowCursor(SDL_DISABLE);
++#ifdef KBDMOUSE
++ SDL_EnableKeyRepeat(KBDMOUSE_REPEAT_DELAY, KBDMOUSE_REPEAT_INTERVAL);
++#else
+ SDL_EnableKeyRepeat(300, 50);
++#endif
+
+ return 0;
+ }
+@@ -497,6 +509,116 @@
+ return 0;
+ }
+
++#ifdef KBDMOUSE
++
++static int keyboard_mouse(SDL_Event *event)
++{
++ static int enabled = 1;
++
++ SDL_Event new;
++ int x, y;
++
++ if ((int)event->key.keysym.sym == KBDMOUSE_TOGGLE) {
++ if (event->type == SDL_KEYUP)
++ enabled = !enabled;
++ return 0;
++ }
++
++ if (!enabled)
++ return -1;
++
++ switch (event->type) {
++ case SDL_KEYDOWN:
++ switch ((int)event->key.keysym.sym) {
++ case KBDMOUSE_LEFT_CLICK:
++ case KBDMOUSE_RIGHT_CLICK:
++ SDL_GetMouseState(&x, &y);
++
++ new.type = SDL_MOUSEBUTTONDOWN;
++ new.button.type = SDL_MOUSEBUTTONDOWN;
++ new.button.which = 0;
++ new.button.state = SDL_PRESSED;
++ new.button.x = (Uint16)x;
++ new.button.y = (Uint16)y;
++
++ switch ((int)event->key.keysym.sym) {
++ case KBDMOUSE_LEFT_CLICK: new.button.button = SDL_BUTTON_LEFT; break;
++ case KBDMOUSE_RIGHT_CLICK: new.button.button = SDL_BUTTON_RIGHT; break;
++ }
++
++ SDL_PushEvent(&new);
++ return 0;
++
++ case KBDMOUSE_UP:
++ case KBDMOUSE_DOWN:
++ case KBDMOUSE_LEFT:
++ case KBDMOUSE_RIGHT:
++ SDL_GetMouseState(&x, &y);
++
++ switch ((int)event->key.keysym.sym) {
++ case KBDMOUSE_UP: y -= KBDMOUSE_STEP; break;
++ case KBDMOUSE_DOWN: y += KBDMOUSE_STEP; break;
++ case KBDMOUSE_RIGHT: x += KBDMOUSE_STEP; break;
++ case KBDMOUSE_LEFT: x -= KBDMOUSE_STEP; break;
++ }
++
++ SDL_WarpMouse((Uint16)x, (Uint16)y);
++ return 0;
++
++ case KBDMOUSE_QUIT_HACK:
++ return 0;
++ }
++ break;
++
++ case SDL_KEYUP:
++ switch ((int)event->key.keysym.sym) {
++ case KBDMOUSE_LEFT_CLICK:
++ case KBDMOUSE_RIGHT_CLICK:
++ SDL_GetMouseState(&x, &y);
++
++ new.type = SDL_MOUSEBUTTONUP;
++ new.button.type = SDL_MOUSEBUTTONUP;
++ new.button.which = 0;
++ new.button.state = SDL_RELEASED;
++ new.button.x = (Uint16)x;
++ new.button.y = (Uint16)y;
++
++ switch ((int)event->key.keysym.sym) {
++ case KBDMOUSE_LEFT_CLICK: new.button.button = SDL_BUTTON_LEFT; break;
++ case KBDMOUSE_RIGHT_CLICK: new.button.button = SDL_BUTTON_RIGHT; break;
++ }
++
++ SDL_PushEvent(&new);
++ return 0;
++
++ case KBDMOUSE_UP:
++ case KBDMOUSE_DOWN:
++ case KBDMOUSE_LEFT:
++ case KBDMOUSE_RIGHT:
++ return 0;
++
++ case KBDMOUSE_QUIT_HACK:
++ kill(getpid(), SIGTERM);
++ return 0;
++ }
++ break;
++
++ default:
++ break;
++ }
++
++ return -1;
++}
++
++#else
++
++static int keyboard_mouse(SDL_Event *event __attribute__((unused)))
++{
++ return -1;
++}
++
++#endif
++
+ static bool sdl_input(nsfb_t *nsfb, nsfb_event_t *event, int timeout)
+ {
+ int got_event;
+@@ -526,6 +648,9 @@
+ if (got_event == 0)
+ return false;
+
++ if (!keyboard_mouse(&sdlevent))
++ return false;
++
+ event->type = NSFB_EVENT_NONE;
+
+ switch (sdlevent.type) {
diff --git a/libnsgif/Makefile b/libnsgif/Makefile
new file mode 100644
index 0000000..e711073
--- /dev/null
+++ b/libnsgif/Makefile
@@ -0,0 +1,60 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libnsgif
+PKG_VERSION:=r10879
+PKG_RELEASE:=1
+
+PKG_SOURCE:=libnsgif-$(PKG_VERSION).tar.gz
+#PKG_SOURCE_URL:=
+PKG_MD5SUM:=8a841624911aa233639d0e9df36f4dea
+
+PKG_BUILD_DIR=$(BUILD_DIR)/libnsgif-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libnsgif
+ SECTION:=net
+ CATEGORY:=Network
+ SUBMENU:=Web
+ DEPENDS:=
+ TITLE:=NetSurf GIF Decoding Library
+ URL:=http://www.netsurf-browser.org/projects/libnsgif/
+endef
+
+define Package/libnsgif/description
+Libnsgif is a decoding library for the GIF image file format, written in C.
+It was developed as part of the NetSurf project and is available for use by
+other software under the MIT licence.
+endef
+
+MAKE_VARS := \
+ TARGET=linux \
+ PREFIX=/usr \
+ COMPONENT_TYPE=lib-shared
+
+define Build/Configure
+endef
+
+define Build/Compile
+ $(CONFIGURE_VARS) \
+ $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" \
+ $(MAKE_VARS) install
+endef
+
+define Build/InstallDev
+ $(INSTALL_DIR) $(1)/usr/include
+ $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/libnsgif.h $(1)/usr/include
+
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnsgif.so* $(1)/usr/lib
+
+ $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+ $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libnsgif.pc $(1)/usr/lib/pkgconfig
+endef
+
+define Package/libnsgif/install
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnsgif.so* $(1)/usr/lib
+endef
+
+$(eval $(call BuildPackage,libnsgif))
diff --git a/libnsgif/patches/010-flags.patch b/libnsgif/patches/010-flags.patch
new file mode 100644
index 0000000..e6ebf8a
--- /dev/null
+++ b/libnsgif/patches/010-flags.patch
@@ -0,0 +1,11 @@
+--- a/Makefile 2010-10-10 16:46:07.209141629 +0200
++++ b/Makefile 2010-10-10 16:46:25.549139374 +0200
+@@ -16,7 +16,7 @@
+ WARNFLAGS := $(WARNFLAGS) -Werror
+ endif
+ CFLAGS := -D_BSD_SOURCE -I$(CURDIR)/include/ \
+- -I$(CURDIR)/src $(WARNFLAGS) $(CFLAGS)
++ -I$(CURDIR)/src $(WARNFLAGS) $(CFLAGS) $(CPPFLAGS)
+ ifneq ($(GCCVER),2)
+ CFLAGS := $(CFLAGS) -std=c99
+ else
diff --git a/libparserutils/Makefile b/libparserutils/Makefile
new file mode 100644
index 0000000..43e4aed
--- /dev/null
+++ b/libparserutils/Makefile
@@ -0,0 +1,68 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libparserutils
+PKG_VERSION:=r10879
+PKG_RELEASE:=1
+
+PKG_SOURCE:=libparserutils-$(PKG_VERSION).tar.gz
+#PKG_SOURCE_URL:=
+PKG_MD5SUM:=9d7aa15559600dd68dd8c083b632a476
+
+PKG_BUILD_DIR=$(BUILD_DIR)/libparserutils-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libparserutils
+ SECTION:=net
+ CATEGORY:=Network
+ SUBMENU:=Web
+ DEPENDS:=
+ TITLE:=Efficient Parser Building Library (NetSurf)
+ URL:=http://www.netsurf-browser.org/projects/libparserutils/
+endef
+
+define Package/libparserutils/description
+LibParserUtils is a library for building efficient parsers, written in C.
+It was developed as part of the NetSurf project and is available for use by
+other software under the MIT licence.
+endef
+
+MAKE_VARS := \
+ TARGET=linux \
+ PREFIX=/usr \
+ COMPONENT_TYPE=lib-shared
+
+# EXTRA_CPPFLAGS += -DWITH_ICONV_FILTER
+
+define Build/Configure
+endef
+
+define Build/Compile
+ $(CONFIGURE_VARS) \
+ $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" \
+ $(MAKE_VARS) install
+endef
+
+define Build/InstallDev
+ $(INSTALL_DIR) $(1)/usr/include/parserutils \
+ $(1)/usr/include/parserutils/charset \
+ $(1)/usr/include/parserutils/input \
+ $(1)/usr/include/parserutils/utils
+ $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/parserutils/{errors,functypes,parserutils,types}.h $(1)/usr/include/parserutils
+ $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/parserutils/charset/{codec,mibenum,utf16,utf8}.h $(1)/usr/include/parserutils/charset
+ $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/parserutils/input/inputstream.h $(1)/usr/include/parserutils/input
+ $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/parserutils/utils/{buffer,stack,vector}.h $(1)/usr/include/parserutils/utils
+
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libparserutils.so* $(1)/usr/lib
+
+ $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+ $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libparserutils.pc $(1)/usr/lib/pkgconfig
+endef
+
+define Package/libparserutils/install
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libparserutils.so* $(1)/usr/lib
+endef
+
+$(eval $(call BuildPackage,libparserutils))
diff --git a/libparserutils/patches/010-flags.patch b/libparserutils/patches/010-flags.patch
new file mode 100644
index 0000000..79bb066
--- /dev/null
+++ b/libparserutils/patches/010-flags.patch
@@ -0,0 +1,11 @@
+--- a/Makefile 2010-10-10 17:16:16.289144951 +0200
++++ b/Makefile 2010-10-10 17:16:32.057909483 +0200
+@@ -19,7 +19,7 @@
+ endif
+
+ CFLAGS := -D_BSD_SOURCE -I$(CURDIR)/include/ \
+- -I$(CURDIR)/src $(WARNFLAGS) $(CFLAGS)
++ -I$(CURDIR)/src $(WARNFLAGS) $(CFLAGS) $(CPPFLAGS)
+ ifneq ($(GCCVER),2)
+ CFLAGS := $(CFLAGS) -std=c99
+ else
diff --git a/libwapcaplet/Makefile b/libwapcaplet/Makefile
new file mode 100644
index 0000000..03b20b7
--- /dev/null
+++ b/libwapcaplet/Makefile
@@ -0,0 +1,60 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libwapcaplet
+PKG_VERSION:=r10879
+PKG_RELEASE:=1
+
+PKG_SOURCE:=libwapcaplet-$(PKG_VERSION).tar.gz
+#PKG_SOURCE_URL:=
+PKG_MD5SUM:=476f4d6b0f1be97c6496c34d13591869
+
+PKG_BUILD_DIR=$(BUILD_DIR)/libwapcaplet-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libwapcaplet
+ SECTION:=net
+ CATEGORY:=Network
+ SUBMENU:=Web
+ DEPENDS:=
+ TITLE:=String Internment Library (NetSurf)
+ URL:=http://www.netsurf-browser.org/projects/libwapcaplet/
+endef
+
+define Package/libwapcaplet/description
+LibWapcaplet is a string internment library, written in C.
+It provides reference counted string interment and rapid string comparison functionality.
+It was developed as part of the NetSurf project and is available for use by other software under the MIT licence.
+endef
+
+MAKE_VARS := \
+ TARGET=linux \
+ PREFIX=/usr \
+ COMPONENT_TYPE=lib-shared
+
+define Build/Configure
+endef
+
+define Build/Compile
+ $(CONFIGURE_VARS) \
+ $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" \
+ $(MAKE_VARS) install
+endef
+
+define Build/InstallDev
+ $(INSTALL_DIR) $(1)/usr/include/libwapcaplet
+ $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/libwapcaplet/libwapcaplet.h $(1)/usr/include/libwapcaplet
+
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libwapcaplet.so* $(1)/usr/lib
+
+ $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+ $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libwapcaplet.pc $(1)/usr/lib/pkgconfig
+endef
+
+define Package/libwapcaplet/install
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libwapcaplet.so* $(1)/usr/lib
+endef
+
+$(eval $(call BuildPackage,libwapcaplet))
diff --git a/libwapcaplet/patches/010-flags.patch b/libwapcaplet/patches/010-flags.patch
new file mode 100644
index 0000000..607b195
--- /dev/null
+++ b/libwapcaplet/patches/010-flags.patch
@@ -0,0 +1,11 @@
+--- a/Makefile 2010-10-10 17:41:56.469136747 +0200
++++ b/Makefile 2010-10-10 17:42:11.929143955 +0200
+@@ -19,7 +19,7 @@
+ WARNFLAGS := $(WARNFLAGS) -Werror
+ endif
+ CFLAGS := -D_BSD_SOURCE -I$(CURDIR)/include/ \
+- -I$(CURDIR)/src $(WARNFLAGS) $(CFLAGS)
++ -I$(CURDIR)/src $(WARNFLAGS) $(CFLAGS) $(CPPFLAGS)
+ ifneq ($(GCCVER),2)
+ CFLAGS := $(CFLAGS) -std=c99
+ else
diff --git a/mpg123/Makefile b/mpg123/Makefile
new file mode 100644
index 0000000..9115615
--- /dev/null
+++ b/mpg123/Makefile
@@ -0,0 +1,80 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=mpg123
+PKG_VERSION:=1.12.5
+PKG_RELEASE:=1
+
+PKG_SOURCE:=mpg123-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=@SF/mpg123
+PKG_MD5SUM:=01fa64533cade452c2b22a3ce14a2fcd
+
+PKG_BUILD_DIR=$(BUILD_DIR)/mpg123-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/mpg123/Default
+ SECTION:=multimedia
+ CATEGORY:=Multimedia
+ DEPENDS:=
+ TITLE:=MPEG Player
+ URL:=http://www.mpg123.de/
+endef
+
+define Package/mpg123/Default/description
+MPEG I/II/III Audio Player
+endef
+
+define Package/mpg123
+ $(call Package/mpg123/Default)
+ DEPENDS+= +libmpg123 +libltdl
+ TITLE+= (program)
+endef
+
+define Package/mpg123/description
+$(call Package/mpg123/Default/description)
+endef
+
+define Package/libmpg123
+ $(call Package/mpg123/Default)
+ TITLE+= (library)
+endef
+
+define Package/libmpg123/description
+$(call Package/mpg123/Default/description)
+endef
+
+CONFIGURE_ARGS += \
+ --with-cpu=generic_nofpu \
+ --with-audio=alsa
+
+define Build/Compile
+ $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" \
+ install
+endef
+
+define Build/InstallDev
+ $(INSTALL_DIR) $(1)/usr/include
+ $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/mpg123.h $(1)/usr/include
+
+ $(INSTALL_DIR) $(1)/usr/lib $(1)/usr/lib/mpg123
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmpg123.so* $(1)/usr/lib
+
+ $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+ $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libmpg123.pc $(1)/usr/lib/pkgconfig
+endef
+
+define Package/mpg123/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mpg123 $(1)/usr/bin/
+
+ $(INSTALL_DIR) $(1)/usr/lib/mpg123
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/mpg123/output_{alsa,dummy}.{la,so} $(1)/usr/lib/mpg123
+endef
+
+define Package/libmpg123/install
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmpg123.so* $(1)/usr/lib
+endef
+
+$(eval $(call BuildPackage,mpg123))
+$(eval $(call BuildPackage,libmpg123))
diff --git a/mplayer/Makefile b/mplayer/Makefile
new file mode 100644
index 0000000..ae658ea
--- /dev/null
+++ b/mplayer/Makefile
@@ -0,0 +1,57 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=mplayer
+PKG_VERSION:=1.0rc2-20090218
+PKG_RELEASE:=1
+
+PKG_SOURCE:=mplayer-export-snapshot.tar.bz2
+PKG_SOURCE_URL:=ftp://ftp.ingenic.cn/3sw/01linux/05apps/mplayer/$(PKG_SOURCE)
+PKG_MD5SUM:=fbeaf3af7e3d5de3f35d94dc4148b8d6
+
+#PKG_BUILD_DIR=$(BUILD_DIR)/mplayer-$(PKG_VERSION)
+PKG_BUILD_DIR=$(BUILD_DIR)/mplayer-export-2010-09-26
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/mplayer
+ SECTION:=multimedia
+ CATEGORY:=Multimedia
+ DEPENDS:=
+ TITLE:=Movie Player
+ URL:=http://www.mplayerhq.hu/
+endef
+
+define Package/mplayer/description
+Cross-platform movie player.
+This build is using an optimized source package by Ingenic: http://www.ingenic.cn/eng/productServ/kfyd/Linux/pfCustomPage.aspx
+endef
+
+CONFIGURE_ARGS = \
+ --target=mips-linux \
+ --prefix=$(CONFIGURE_PREFIX) \
+ --bindir=$(CONFIGURE_PREFIX)/bin \
+ --mandir=$(CONFIGURE_PREFIX)/man \
+ $(DISABLE_LARGEFILE)
+
+# mplayer-specific:
+CONFIGURE_ARGS += \
+ --extra-cflags="-O3" \
+ --enable-cross-compile \
+ --host-cc=gcc \
+ --disable-mencoder \
+ --disable-unrarexec \
+ --disable-x11
+# --disable-sdl
+# --disable-fbdev
+
+EXTRA_LDFLAGS += $(shell $(STAGING_DIR)/root-xburst/usr/bin/directfb-config --libs --prefix=$(STAGING_DIR)/usr)
+EXTRA_CPPFLAGS += $(shell $(STAGING_DIR)/root-xburst/usr/bin/directfb-config --cflags --prefix=$(STAGING_DIR)/usr)
+
+EXTRA_CFLAGS += -mplt
+
+define Package/mplayer/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/mplayer $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,mplayer))
diff --git a/netsurf/Makefile b/netsurf/Makefile
new file mode 100644
index 0000000..75ec8e4
--- /dev/null
+++ b/netsurf/Makefile
@@ -0,0 +1,66 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=netsurf
+PKG_VERSION:=r10879
+PKG_RELEASE:=1
+
+PKG_SOURCE:=netsurf-$(PKG_VERSION).tar.gz
+#PKG_SOURCE_URL:=
+PKG_MD5SUM:=6edade4588c6183376d9bb4f1b172385
+
+PKG_BUILD_DIR=$(BUILD_DIR)/netsurf-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/netsurf
+ SECTION:=net
+ CATEGORY:=Network
+ SUBMENU:=Web
+ DEPENDS:=+libparserutils +libwapcaplet +hubbub +libcss +libnsgif +libnsfb \
+ +libjpeg +libpng +libfreetype +libcurl +libxml2 +libiconv
+ TITLE:=NetSurf Web Browser (Framebuffer)
+ URL:=http://www.netsurf-browser.org/
+endef
+
+define Package/netsurf/description
+NetSurf is a free, open source web browser.
+It is written in C and released under the GNU Public Licence version 2.
+NetSurf has its own layout and rendering engine entirely written from scratch.
+It is small and capable of handling many of the web standards in use today.
+endef
+
+# SDL depends on DirectFB but somehow the libs are not not found automatically
+EXTRA_LDFLAGS += $(shell $(STAGING_DIR)/root-xburst/usr/bin/directfb-config --libs --prefix=$(STAGING_DIR)/usr)
+
+EXTRA_CPPFLAGS += -I$(STAGING_DIR)/usr/lib/libiconv/include
+EXTRA_LDFLAGS += -L$(STAGING_DIR)/usr/lib/libiconv/lib -liconv
+
+# for libcurl
+# EXTRA_LDFLAGS += -lgnutls
+
+MAKE_VARS := \
+ TARGET=framebuffer \
+ PREFIX=/usr
+
+define Build/Configure
+ $(CP) $(SOURCE)/files/Makefile.config $(PKG_BUILD_DIR)
+endef
+
+define Build/Compile
+ $(CONFIGURE_VARS) \
+ $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" \
+ $(MAKE_VARS) install
+endef
+
+define Package/netsurf/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/netsurf $(1)/usr/bin/
+
+ $(INSTALL_DIR) $(1)/usr/share
+ $(CP) -r $(PKG_INSTALL_DIR)/usr/share/netsurf $(1)/usr/share
+
+ # provide at least one font, so netsurf will still start up even when no fonts are installed
+ $(INSTALL_DATA) $(SOURCE)/files/DejaVuSans.ttf $(1)/usr/share/netsurf/sans_serif.ttf
+endef
+
+$(eval $(call BuildPackage,netsurf))
diff --git a/netsurf/files/DejaVuSans.ttf b/netsurf/files/DejaVuSans.ttf
new file mode 100644
index 0000000..569a6e2
--- /dev/null
+++ b/netsurf/files/DejaVuSans.ttf
Binary files differ
diff --git a/netsurf/files/Makefile.config b/netsurf/files/Makefile.config
new file mode 100644
index 0000000..2a4ac74
--- /dev/null
+++ b/netsurf/files/Makefile.config
@@ -0,0 +1,114 @@
+#
+# NetSurf Nanonote build setup
+# based on Makefile.defaults
+#
+
+# ----------------------------------------------------------------------------
+# Options relating to all versions of NetSurf
+# ----------------------------------------------------------------------------
+
+# Enable NetSurf's use of libnsbmp for displaying BMPs and ICOs
+# Valid options: YES, NO
+NETSURF_USE_BMP := NO
+
+# Enable NetSurf's use of libnsgif for displaying GIFs
+# Valid options: YES, NO (highly recommended)
+NETSURF_USE_GIF := YES
+
+# Enable NetSurf's use of libjpeg for displaying JPEGs
+# Valid options: YES, NO (highly recommended)
+NETSURF_USE_JPEG := YES
+
+# Enable NetSurf's use of libpng for displaying PNGs. If MNG and PNG
+# are both enabled then NetSurf will choose libpng for PNGs, leaving
+# MNGs and JNGs to libmng.
+# Valid options: YES, NO (at least one of PNG/MNG highly recommended)
+NETSURF_USE_PNG := YES
+
+# Enable NetSurf's use of libmng for displaying MNGs, JNGs and PNGs
+# Valid options: YES, NO (at least one of PNG/MNG highly recommended)
+NETSURF_USE_MNG := NO
+
+# Enable NetSurf's use of libwebp/libvpx for displaying WebPs
+# Valid options: YES, NO
+NETSURF_USE_WEBP := NO
+
+# Enable NetSurf's use of libharu for PDF export and GTK printing support.
+# There is no auto-detection available for this, as it does not have a
+# pkg-config file.
+# Valid options: YES, NO
+NETSURF_USE_HARU_PDF := NO
+
+# Enable stripping the NetSurf binary
+# Valid options: YES, NO
+# (OpenWRT toolchain does that...)
+NETSURF_STRIP_BINARY := NO
+
+# Template used for constructing the User Agent: string. The first two
+# replacements are major/minor version, second two are OS and architecture.
+# Please don't be tempted to mention Mozilla here! Let's let that lie die.
+NETSURF_UA_FORMAT_STRING := "NetSurf/%d.%d (%s; %s)"
+
+# Default home page, if one is not defined by the user. Note that this
+# option does not apply to the RISC OS version, as it has its own local
+# home page, and it can be changed by editing the end of gui_init2() in
+# riscos/gui.c
+NETSURF_HOMEPAGE := "http://www.netsurf-browser.org/welcome/"
+
+# Force using glibc internal iconv implementation instead of external libiconv
+# Valid options: YES, NO
+NETSURF_USE_LIBICONV_PLUG := NO
+
+# Initial CFLAGS. Optimisation level etc. tend to be target specific.
+# (you would like to overwrite what's passed from the environment, wouldn't you?)
+CFLAGS ?=
+
+# Default installation/execution prefix
+PREFIX ?= /usr
+
+# ----------------------------------------------------------------------------
+# Framebuffer-target-specific options
+# ----------------------------------------------------------------------------
+ifeq ($(TARGET),framebuffer)
+ # Optimisation levels
+ CFLAGS += -O2 -Wuninitialized
+
+ # Framebuffer default surface provider.
+ # Valid values are: x, sdl, linux, vnc, able,
+ NETSURF_FB_FRONTEND := sdl
+
+ # Use libharu to enable PDF export and GTK printing support.
+ # Valid options: YES, NO
+ NETSURF_USE_HARU_PDF := NO
+
+ # Enable NetSurf's use of librosprite for displaying RISC OS Sprites
+ # Valid options: YES, NO, AUTO
+ NETSURF_USE_ROSPRITE := NO
+
+ # Library to use for font plotting
+ # Valid options: internal, freetype
+ NETSURF_FB_FONTLIB := freetype
+
+ # freetype compiled in font locations
+ NETSURF_FB_FONT_SANS_SERIF := /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf
+ NETSURF_FB_FONT_SANS_SERIF_BOLD := /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf
+ NETSURF_FB_FONT_SANS_SERIF_ITALIC := /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Oblique.ttf
+ NETSURF_FB_FONT_SANS_SERIF_ITALIC_BOLD := /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-BoldOblique.ttf
+ NETSURF_FB_FONT_SERIF := /usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf
+ NETSURF_FB_FONT_SERIF_BOLD := /usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif-Bold.ttf
+ NETSURF_FB_FONT_MONOSPACE := /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono.ttf
+ NETSURF_FB_FONT_MONOSPACE_BOLD := /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono-Bold.ttf
+ NETSURF_FB_FONT_CURSIVE := /usr/share/fonts/truetype/msttcorefonts/Comic_Sans_MS.ttf
+ NETSURF_FB_FONT_FANTASY := /usr/share/fonts/truetype/msttcorefonts/Impact.ttf
+
+ # Framebuffer frontends may have differing root paths for resources
+ # As such, these specify the resource path and config path.
+ NETSURF_FB_RESPATH_linux := $(PREFIX)/share/netsurf/
+ NETSURF_FB_RESPATH_dummy := ./
+ NETSURF_FB_RESPATH_sdl := $(PREFIX)/share/netsurf/
+
+ NETSURF_FRAMEBUFFER_RESOURCES = $(NETSURF_FB_RESPATH_$(NETSURF_FB_FRONTEND))
+ NETSURF_FRAMEBUFFER_BIN := $(PREFIX)/bin/
+
+endif
+
diff --git a/netsurf/patches/010-flags.patch b/netsurf/patches/010-flags.patch
new file mode 100644
index 0000000..d28552f
--- /dev/null
+++ b/netsurf/patches/010-flags.patch
@@ -0,0 +1,11 @@
+--- a/Makefile.defaults 2010-10-10 18:49:57.849134975 +0200
++++ b/Makefile.defaults 2010-10-10 18:50:32.767910968 +0200
+@@ -83,7 +83,7 @@
+ NETSURF_USE_LIBICONV_PLUG := YES
+
+ # Initial CFLAGS. Optimisation level etc. tend to be target specific.
+-CFLAGS :=
++CFLAGS += $(CPPFLAGS)
+
+ # Default installation/execution prefix
+ PREFIX ?= /usr/local
diff --git a/netsurf/patches/100-default-options.patch b/netsurf/patches/100-default-options.patch
new file mode 100644
index 0000000..f8036e2
--- /dev/null
+++ b/netsurf/patches/100-default-options.patch
@@ -0,0 +1,48 @@
+--- a/framebuffer/options.h 2010-10-10 19:41:15.917891618 +0200
++++ b/framebuffer/options.h 2010-10-10 19:43:03.217893158 +0200
+@@ -59,13 +59,13 @@
+
+
+ #define EXTRA_OPTION_DEFINE \
+- int option_fb_depth = 32; \
++ int option_fb_depth = 24; \
+ int option_fb_refresh = 70; \
+ char *option_fb_device = 0; \
+ char *option_fb_input_devpath = 0; \
+ char *option_fb_input_glob = 0; \
+- int option_fb_furniture_size = 18; \
+- int option_fb_toolbar_size = 30; \
++ int option_fb_furniture_size = 10; \
++ int option_fb_toolbar_size = 15; \
+ char *option_fb_toolbar_layout; \
+ bool option_fb_osk = false; \
+ bool option_fb_font_monochrome = false; \
+--- a/framebuffer/gui.c 2010-10-10 19:34:23.097901020 +0200
++++ b/framebuffer/gui.c 2010-10-10 19:48:12.397888727 +0200
+@@ -59,7 +59,7 @@
+ #include "desktop/history_core.h"
+ #include "content/fetch.h"
+
+-#define NSFB_TOOLBAR_DEFAULT_LAYOUT "blfsrut"
++#define NSFB_TOOLBAR_DEFAULT_LAYOUT "bfsrut"
+
+ char *default_stylesheet_url;
+ char *quirks_stylesheet_url;
+@@ -389,14 +389,14 @@
+ LOG(("argc %d, argv %p", argc, argv));
+
+ fename = "sdl";
+- febpp = 32;
++ febpp = 24;
+
+ if ((option_window_width != 0) && (option_window_height != 0)) {
+ fewidth = option_window_width;
+ feheight = option_window_height;
+ } else {
+- fewidth = 800;
+- feheight = 600;
++ fewidth = 320;
++ feheight = 240;
+ }
+
+ if (option_homepage_url != NULL && option_homepage_url[0] != '\0')
diff --git a/videoteco/Makefile b/videoteco/Makefile
new file mode 100644
index 0000000..ece668d
--- /dev/null
+++ b/videoteco/Makefile
@@ -0,0 +1,33 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=videoteco
+PKG_VERSION:=r1.4
+PKG_RELEASE:=1
+
+PKG_SOURCE:=videoteco-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@SF/videoteco
+PKG_MD5SUM:=224d50c0805a392026477d3a3f256158
+
+PKG_BUILD_DIR=$(BUILD_DIR)/videoteco-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/VideoTECO
+ SECTION:=utils
+ CATEGORY:=Utilities
+ DEPENDS:=+libncurses
+ TITLE:=Screen based TECO editor
+ URL:=http://sourceforge.net/projects/videoteco/
+ SUBMENU:=Editors
+endef
+
+define Package/VideoTECO/description
+Advanced screen based version of the TECO editor.
+endef
+
+define Package/VideoTECO/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/teco $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,VideoTECO))
diff --git a/videoteco/patches/0001-flags.patch b/videoteco/patches/0001-flags.patch
new file mode 100644
index 0000000..4635d0c
--- /dev/null
+++ b/videoteco/patches/0001-flags.patch
@@ -0,0 +1,22 @@
+--- a/makefile.in 2010-09-23 13:00:42.992049806 +0200
++++ b/makefile.in 2010-09-23 13:03:31.060802259 +0200
+@@ -1,8 +1,8 @@
+ # @configure_input@
+
+ CC = @CC@
+-CFLAGS = @CFLAGS@
+-CPPFLAGS = @CPPFLAGS@
++CFLAGS = @CFLAGS@ @CPPFLAGS@
++LDFLAGS = @LDFLAGS@
+ LIBS = @LIBS@
+
+ ifeq (@GCC@,yes)
+@@ -17,7 +17,7 @@
+ LIBFLAGS = -ltermcap
+
+ teco: $(OBJS)
+- $(CC) -o teco $(OBJS) $(LIBS)
++ $(CC) $(LDFLAGS) -o teco $(OBJS) $(LIBS)
+
+ tecbuf.o: tecbuf.c $(HEADERS)
+ $(CC) $(CFLAGS) -c tecbuf.c