aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Ferguson <thoughtmonster@gmail.com>2010-10-30 21:42:28 +0300
committerKristoffer Ericson <kristoffer.ericson@gmail.com>2010-11-03 16:51:16 +0100
commit6c8af6f29e173a62e881be442b8dc4f2b1efde17 (patch)
treeec799dfedf6bbfc27b6f3e54f65caa6dc827e92c
parent20a3853a49d2fdba7421841b5f22b8800fdb37ca (diff)
downloadopenembedded-6c8af6f29e173a62e881be442b8dc4f2b1efde17.zip
openembedded-6c8af6f29e173a62e881be442b8dc4f2b1efde17.tar.gz
openembedded-6c8af6f29e173a62e881be442b8dc4f2b1efde17.tar.bz2
gmu: Add recipe for gmu-0.7.1, a music player based on SDL.
* Added Makefile, which adds an install hook and adds the INCS and LIBS variables, due to the way OE handles CFLAGS and LDFLAGS. * Added unknown.mk, the generic mk file, which replaces the version shipped with gmu and fixes compilation in OE. * Added gmu.desktop, which uses the generic audio-player icon. * Added two additional files, nanonote.keymap and nanonote.mk which are specific to ben-nanonote. * Added nanonote-lcd-blank.patch which fixes LCD blanking under the 2.6.36 kernel version for the ben-nanonote target. * Added set-base-dir.patch which sets proper systemwide directories for configuration files and libraries (decoders and frontends). gmu normally looks under pwd to find such files, which is extremely error-prone. Signed-off-by: Alex Ferguson <thoughtmonster@gmail.com> Signed-off-by: Kristoffer Ericson <kristoffer.ericson@gmail.com>
-rw-r--r--recipes/gmu/files/Makefile134
-rw-r--r--recipes/gmu/files/ben-nanonote/nanonote.keymap68
-rw-r--r--recipes/gmu/files/ben-nanonote/nanonote.mk12
-rw-r--r--recipes/gmu/files/gmu.desktop10
-rw-r--r--recipes/gmu/files/unknown.mk12
-rw-r--r--recipes/gmu/gmu-0.7.1/nanonote-lcd-blank.patch21
-rw-r--r--recipes/gmu/gmu-0.7.1/set-base-dir.patch16
-rw-r--r--recipes/gmu/gmu_0.7.1.bb50
8 files changed, 323 insertions, 0 deletions
diff --git a/recipes/gmu/files/Makefile b/recipes/gmu/files/Makefile
new file mode 100644
index 0000000..7dc507b
--- /dev/null
+++ b/recipes/gmu/files/Makefile
@@ -0,0 +1,134 @@
+#
+# Gmu Music Player
+#
+# Copyright (c) 2006-2010 Johannes Heimansberg (wejp.k.vu)
+#
+# File: Makefile Created: 060904
+#
+# Description: Gmu's main Makefile
+#
+# 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; version 2 of
+# the License. See the file COPYING in the Gmu's main directory
+# for details.
+#
+
+ifeq ($(TARGET),)
+TARGET=unknown
+endif
+include $(TARGET).mk
+
+INCS+=$(COPTS) -Wall
+
+OBJECTFILES=core.o ringbuffer.o util.o dir.o trackinfo.o playlist.o wejpconfig.o m3u.o audio.o charset.o fileplayer.o decloader.o feloader.o eventqueue.o oss_mixer.o hw_$(TARGET).o
+ALLFILES=src/ Makefile *.mk gmu.png themes README.txt BUILD.txt COPYING gmu.conf.example *.keymap *.gpu *.dge *.nn gmuinput.*.conf gmu.*.conf
+BINARY=gmu
+
+all: $(BINARY) decoders frontends
+ @$(STRIP) decoders/*.so
+ @echo -e "All done for target \033[1m$(TARGET)\033[0m. \033[1m$(BINARY)\033[0m binary, \033[1mfrontends\033[0m and \033[1mdecoders\033[0m ready."
+
+decoders: $(DECODERS_TO_BUILD)
+ @echo -e "All \033[1mdecoders\033[0m have been built."
+
+frontends: $(FRONTENDS_TO_BUILD)
+ @echo -e "All \033[1mfrontends\033[0m have been built."
+
+$(BINARY): $(OBJECTFILES)
+ @echo -e "Linking \033[1m$(BINARY)\033[0m"
+ @$(CC) $(OBJECTFILES) $(LIBS) -o $(BINARY)
+
+projname=gmu-$(shell awk '/define VERSION_NUMBER/ { print $$3 }' src/core.h )
+
+%.o: src/%.c
+ @echo -e "Compiling \033[1m$<\033[0m"
+ @$(CC) -fPIC $(INCS) -c -o $@ $<
+
+%.o: src/frontends/sdl/%.c
+ @echo -e "Compiling \033[1m$<\033[0m"
+ @$(CC) -fPIC $(INCS) -Isrc/ -c -o $@ $<
+
+dist: $(ALLFILES)
+ @echo -e "Creating \033[1m$(projname).tar.gz\033[0m"
+ @-rm -rf $(projname)
+ @mkdir $(projname)
+ @mkdir $(projname)/frontends
+ @mkdir $(projname)/decoders
+ @cp -rl --parents $(ALLFILES) $(projname)
+ @tar chfz $(projname).tar.gz $(projname)
+ @-rm -rf $(projname)
+
+distbin: $(DISTFILES)
+ @echo -e "Creating \033[1m$(projname)-$(DEVICE).zip\033[0m"
+ @-rm -rf $(projname)-$(DEVICE)
+ @-rm -rf $(projname)-$(DEVICE).zip
+ @mkdir $(projname)-$(DEVICE)
+ @cp -rl --parents $(DISTFILES) $(projname)-$(DEVICE)
+ @-cp gmu.$(TARGET).conf $(projname)-$(DEVICE)/gmu.$(TARGET).conf
+ @-cp $(TARGET).keymap $(projname)-$(DEVICE)/$(TARGET).keymap
+ @$(STRIP) $(projname)-$(DEVICE)/gmu
+ @zip -r $(projname)-$(DEVICE).zip $(projname)-$(DEVICE)
+ @-rm -rf $(projname)-$(DEVICE)
+
+install:
+ @install -d $(DESTDIR)/usr/bin
+ @install -d $(DESTDIR)/usr/lib/gmu
+ @install -d $(DESTDIR)/etc/gmu
+ @install -m 0755 gmu $(DESTDIR)/usr/bin
+ @install -m 0644 gmu.conf $(DESTDIR)/etc/gmu
+ @install -m 0644 gmuinput.conf $(DESTDIR)/etc/gmu
+ @install -m 0644 default.keymap $(DESTDIR)/etc/gmu
+ @cp -R decoders frontends themes $(DESTDIR)/usr/lib/gmu
+
+clean:
+ @-rm -rf *.o $(BINARY) decoders/*.so frontends/*.so
+ @echo -e "\033[1mAll clean.\033[0m"
+
+decoders/musepack.so: src/decoders/musepack.c id3.o charset.o trackinfo.o
+ @echo -e "Compiling \033[1m$<\033[0m"
+ @$(CC) $(INCS) $(LIBS) -shared -fpic -o decoders/musepack.so src/decoders/musepack.c id3.o charset.o trackinfo.o -lmpcdec
+
+decoders/vorbis.so: src/decoders/vorbis.c
+ @echo -e "Compiling \033[1m$<\033[0m"
+ @$(CC) $(INCS) $(LIBS) -shared -fpic -o decoders/vorbis.so src/decoders/vorbis.c src/util.c -lvorbisidec
+
+decoders/splay.so: src/decoders/splay.cc util.o id3.o charset.o trackinfo.o
+ @echo -e "Compiling \033[1m$<\033[0m"
+ @$(CXX) -Wall -O2 -shared -fPIC -o decoders/splay.so src/decoders/splay.cc -g util.o id3.o charset.o trackinfo.o splay/libmpegsound.a -pg -g
+
+decoders/flac.so: src/decoders/flac.c util.o
+ @echo -e "Compiling \033[1m$<\033[0m"
+ @$(CC) $(INCS) $(LIBS) -shared -fpic -o decoders/flac.so src/decoders/flac.c util.o -lFLAC
+
+decoders/mpg123.so: src/decoders/mpg123.c util.o id3.o charset.o trackinfo.o
+ @echo -e "Compiling \033[1m$<\033[0m"
+ @$(CC) $(INCS) $(LIBS) -shared -fpic -o decoders/mpg123.so src/decoders/mpg123.c util.o id3.o -lmpg123
+
+decoders/wavpack.so: src/decoders/wavpack.c util.o
+ @echo -e "Compiling \033[1m$<\033[0m"
+ @$(CC) $(INCS) $(LIBS) -shared -fpic -o decoders/wavpack.so src/decoders/wavpack.c util.o src/decoders/wavpack/*.c
+
+decoders/mikmod.so: src/decoders/mikmod.c util.o
+ @echo -e "Compiling \033[1m$<\033[0m"
+ @$(CC) $(INCS) $(LIBS) -shared -fpic -o decoders/mikmod.so src/decoders/mikmod.c util.o -lmikmod
+
+frontends/httpserv.so: src/frontends/httpserv.c util.o
+ @echo -e "Compiling \033[1m$<\033[0m"
+ @$(CC) -Wall -pedantic -shared -O2 -fpic -o frontends/httpserv.so src/frontends/httpserv.c util.o
+
+frontends/sdl.so: src/frontends/sdl/sdl.c util.o kam.o skin.o textrenderer.o question.o filebrowser.o plbrowser.o about.o textbrowser.o coverimg.o coverviewer.o plmanager.o playerdisplay.o gmuwidget.o png.o jpeg.o bmp.o inputconfig.o help.o
+ @echo -e "Compiling \033[1m$<\033[0m"
+ @$(CC) $(INCS) $(LIBS) -Isrc/ -shared -fpic -o frontends/sdl.so src/frontends/sdl/sdl.c kam.o skin.o textrenderer.o question.o filebrowser.o plbrowser.o about.o textbrowser.o coverimg.o coverviewer.o plmanager.o playerdisplay.o gmuwidget.o png.o jpeg.o bmp.o inputconfig.o help.o
+
+frontends/fltkfe.so: src/frontends/fltk/fltkfe.cxx
+ @echo -e "Compiling \033[1m$<\033[0m"
+ @$(CXX) -Wall -pedantic -shared -O2 -fpic -o frontends/fltkfe.so src/frontends/fltk/fltkfe.cxx -L/usr/lib/fltk/ -lfltk2 -lXext -lXinerama -lXft -lX11 -lXi -lm
+
+frontends/log.so: src/frontends/log.c util.o
+ @echo -e "Compiling \033[1m$<\033[0m"
+ @$(CC) $(INCS) -shared -fpic -o frontends/log.so src/frontends/log.c util.o -lpthread
+
+frontends/lirc.so: src/frontends/lirc.c
+ @echo -e "Compiling \033[1m$<\033[0m"
+ @$(CC) $(INCS) -shared -fpic -o frontends/lirc.so src/frontends/lirc.c -lpthread -llirc_client
diff --git a/recipes/gmu/files/ben-nanonote/nanonote.keymap b/recipes/gmu/files/ben-nanonote/nanonote.keymap
new file mode 100644
index 0000000..d0b3476
--- /dev/null
+++ b/recipes/gmu/files/ben-nanonote/nanonote.keymap
@@ -0,0 +1,68 @@
+# Gmu key mappings
+# Required keys: Modifier, Up,
+# Down, Pause, ProgramInfo, Exit,
+# PlaylistPlayItem, PlaylistClear,
+# FileBrowserAddFileToPlaylistOrChDir
+# Buttons names are defined in gmuinput.conf.
+
+Modifier=Alt
+# Global mappings:
+Left=Left
+Right=Right
+Up=Up
+Down=Down
+IncreaseVolume=Vol+
+DecreaseVolume=Vol-
+ToggleTime=T
+Pause=P
+Stop=Mod+X
+ToggleView=Tab
+PreviousTrack=N
+NextTrack=M
+SeekForward=Mod+M
+SeekBackward=Mod+N
+Lock=F5
+Unlock=F5
+Exit=F8
+ShutdownTimer=Mod+T
+Help=F1
+
+# Program info mappings:
+ProgramInfo=Mod+A
+ProgramInfoOkay=Enter
+# File browser mappings:
+#FileBrowserDirUp=LEFT
+#FileBrowserChDir=RIGHT
+
+FileBrowserPlayFile=A
+FileBrowserAddFileToPlaylistOrChDir=Enter
+FileBrowserAddDirToPlaylist=Y
+FileBrowserInsertFileIntoPlaylist=Mod+Enter
+FileBrowserNewPlFromDir=Mod+Y
+#FileBrowserDeleteFile=Mod+X
+# Playlist mappings:
+PlaylistPlayItem=Enter
+PlaylistToggleRandomMode=R
+PlaylistRemoveItem=Y
+PlaylistClear=Mod+Y
+PlaylistSave=S
+# Playlist save dialog:
+PlaylistSaveSelect=Enter
+PlaylistSaveCancel=A
+PlaylistSaveLoadList=Y
+PlaylistSaveAppendList=Mod+Y
+#PlaylistDeleteFile=Mod+X
+PlaylistQueue=Q
+# Track info mappings:
+TrackInfoToggleCover=A
+TrackInfoToggleText=B
+# Question dialog mappings:
+QuestionYes=Enter
+QuestionNo=ESC
+# Setup mappings:
+SetupSelect=B
+SetupSaveAndExit=X
+SetupSaveAndRunGmu=Y
+SetupFileBrowserSelect=B
+SetupFileBrowserChDir=A
+SetupFileBrowserCancel=X
diff --git a/recipes/gmu/files/ben-nanonote/nanonote.mk b/recipes/gmu/files/ben-nanonote/nanonote.mk
new file mode 100644
index 0000000..5e96bdd
--- /dev/null
+++ b/recipes/gmu/files/ben-nanonote/nanonote.mk
@@ -0,0 +1,12 @@
+DECODERS_TO_BUILD=decoders/vorbis.so decoders/flac.so decoders/mpg123.so
+FRONTENDS_TO_BUILD=frontends/sdl.so frontends/log.so
+CC=$(CC)
+CXX=$(CPP)
+STRIP=$(STRIP)
+DEVICE=NANONOTE
+
+SDL_LIB=$(shell sdl-config --libs)
+SDL_CFLAGS=$(shell sdl-config --cflags)
+
+INCS=$(CFLAGS) $(SDL_CFLAGS) -D_GNU_SOURCE=1 -D_REENTRANT -D_$(DEVICE)
+LIBS=$(LDFLAGS) $(SDL_LIB) -lSDL_image -lSDL_gfx -ldl -Wl,-export-dynamic
diff --git a/recipes/gmu/files/gmu.desktop b/recipes/gmu/files/gmu.desktop
new file mode 100644
index 0000000..137ad87
--- /dev/null
+++ b/recipes/gmu/files/gmu.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Version=1.0
+Type=Application
+Name=GMU
+GenericName=Music Player
+Icon=audio-player
+Categories=AudioVideo;Audio;Player;GTK;
+Exec=gmu
+Terminal=false
+MimeType=application/x-ogg;audio/mp3;audio/mpeg;audio/ogg;audio/x-flac;audio/x-mp3;audio/x-mpeg;application/ogg;audio/x-vorbis+ogg;
diff --git a/recipes/gmu/files/unknown.mk b/recipes/gmu/files/unknown.mk
new file mode 100644
index 0000000..ce3a5c4
--- /dev/null
+++ b/recipes/gmu/files/unknown.mk
@@ -0,0 +1,12 @@
+DECODERS_TO_BUILD=decoders/vorbis.so decoders/flac.so decoders/mpg123.so
+FRONTENDS_TO_BUILD=frontends/sdl.so frontends/log.so
+CC=$(CC)
+CXX=$(CPP)
+STRIP=$(STRIP)
+DEVICE=UNKNOWN_SYSTEM
+
+SDL_LIB=$(shell sdl-config --libs)
+SDL_CFLAGS=$(shell sdl-config --cflags)
+
+INCS=$(CFLAGS) $(SDL_CFLAGS) -fsigned-char -D_REENTRANT -DUSE_MEMORY_H -D_$(DEVICE)
+LIBS=$(LDFLAGS) $(SDL_LIB) -lSDL_image -lSDL_gfx -ldl -Wl,-export-dynamic
diff --git a/recipes/gmu/gmu-0.7.1/nanonote-lcd-blank.patch b/recipes/gmu/gmu-0.7.1/nanonote-lcd-blank.patch
new file mode 100644
index 0000000..80918da
--- /dev/null
+++ b/recipes/gmu/gmu-0.7.1/nanonote-lcd-blank.patch
@@ -0,0 +1,21 @@
+diff -ru gmu-0.7.1.orig/src/hw_nanonote.c gmu-0.7.1/src/hw_nanonote.c
+--- gmu-0.7.1.orig/src/hw_nanonote.c 2010-03-28 19:44:15.000000000 +0300
++++ gmu-0.7.1/src/hw_nanonote.c 2010-10-24 23:51:16.761573283 +0300
+@@ -46,7 +46,7 @@
+ FILE *f;
+
+ printf("hw_nanonote: Display off requested.\n");
+- if ((f = fopen("/sys/class/lcd/gpm940b0-lcd/lcd_power", "w"))) {
++ if ((f = fopen("/sys/class/lcd/ili8960-lcd/lcd_power", "w"))) {
+ fprintf(f, "4\n");
+ fclose(f);
+ }
+@@ -57,7 +57,7 @@
+ FILE *f;
+
+ printf("hw_nanonote: Display on requested.\n");
+- if ((f = fopen("/sys/class/lcd/gpm940b0-lcd/lcd_power", "w"))) {
++ if ((f = fopen("/sys/class/lcd/ili8960-lcd/lcd_power", "w"))) {
+ fprintf(f, "0\n");
+ fclose(f);
+ }
diff --git a/recipes/gmu/gmu-0.7.1/set-base-dir.patch b/recipes/gmu/gmu-0.7.1/set-base-dir.patch
new file mode 100644
index 0000000..d85e677
--- /dev/null
+++ b/recipes/gmu/gmu-0.7.1/set-base-dir.patch
@@ -0,0 +1,16 @@
+diff -ru gmu-0.7.1.orig/src/core.c gmu-0.7.1/src/core.c
+--- gmu-0.7.1.orig/src/core.c 2010-07-01 10:49:43.000000000 +0300
++++ gmu-0.7.1/src/core.c 2010-10-03 21:18:03.458979081 +0300
+@@ -556,9 +556,9 @@
+ hw_detect_device_model();
+ printf("gmu: Detected device: %s\n", hw_get_device_model_name());
+
+- if (!getcwd(base_dir, 255)) snprintf(base_dir, 255, ".");
+- sys_config_dir = base_dir;
+- config_dir = base_dir;
++ strcpy(base_dir, "/usr/lib/gmu");
++ sys_config_dir = "/etc/gmu";
++ config_dir = "/etc/gmu";
+
+ for (i = 1; argv[i]; i++) {
+ if (argv[i][0] == '-') {
diff --git a/recipes/gmu/gmu_0.7.1.bb b/recipes/gmu/gmu_0.7.1.bb
new file mode 100644
index 0000000..a70a5a6
--- /dev/null
+++ b/recipes/gmu/gmu_0.7.1.bb
@@ -0,0 +1,50 @@
+DESCRIPTION = "Gmu is a music player for portable handheld consoles."
+HOMEPAGE = "http://wejp.k.vu/projects/gmu/"
+LICENSE = "GPLv2"
+PR = "r0"
+
+DEPENDS = "virtual/libsdl libsdl-image libsdl-gfx"
+RDEPENDS = "tremor flac mpg123"
+
+SRC_URI = "http://wejp.k.vu/files/gmu-${PV}.tar.gz \
+ file://nanonote-lcd-blank.patch \
+ file://set-base-dir.patch \
+ file://gmu.desktop \
+ file://unknown.mk \
+ file://Makefile"
+
+SRC_URI_append_ben-nanonote = " file://nanonote.mk file://nanonote.keymap "
+
+FILES_${PN}-dbg += " /usr/lib/gmu/frontends/.debug/ "
+CONFFILES_${PN} = "/etc/gmu/gmu.conf /etc/gmu/gmuinput.conf /etc/gmu/default.keymap"
+
+do_configure() {
+ mv ${WORKDIR}/Makefile ${S}/Makefile
+ mv ${WORKDIR}/unknown.mk ${S}/unknown.mk
+ mv ${S}/gmu.unknown.conf ${S}/gmu.conf
+ mv ${S}/gmuinput.unknown.conf ${S}/gmuinput.conf
+ sed -i 's/gmuinput.unknown.conf/gmuinput.conf/g' ${S}/gmu.conf
+}
+
+do_configure_ben-nanonote() {
+ mv ${WORKDIR}/Makefile ${S}/Makefile
+ mv ${WORKDIR}/nanonote.mk ${S}/nanonote.mk
+ mv ${WORKDIR}/nanonote.keymap ${S}/default.keymap
+ mv ${S}/gmu.nanonote.conf ${S}/gmu.conf
+ mv ${S}/gmuinput.nanonote.conf ${S}/gmuinput.conf
+ sed -i 's/gmuinput.nanonote.conf/gmuinput.conf/g' ${S}/gmu.conf
+ sed -i 's/nanonote.keymap/default.keymap/g' ${S}/gmu.conf
+}
+
+do_compile_prepend_ben-nanonote() {
+ export TARGET=nanonote
+}
+
+do_install() {
+ oe_runmake install DESTDIR=${D}
+ install -d ${D}${datadir}/applications
+ install -m 0755 ${WORKDIR}/gmu.desktop ${D}${datadir}/applications
+}
+
+SRC_URI[md5sum] = "62653037d2046d992626eaf6d0a365e3"
+SRC_URI[sha256sum] = "9b075a191a8d7fb09164d14ffa489af883b1fae51f579bec95c9c8d8d4758545"