summaryrefslogtreecommitdiffstats
path: root/meta/recipes-sato/puzzles
diff options
context:
space:
mode:
authorAdrian Dudau <adrian.dudau@enea.com>2014-06-26 14:36:22 +0200
committerAdrian Dudau <adrian.dudau@enea.com>2014-06-26 15:32:53 +0200
commitf4cf9fe05bb3f32fabea4e54dd92d368967a80da (patch)
tree487180fa9866985ea7b28e625651765d86f515c3 /meta/recipes-sato/puzzles
downloadpoky-f4cf9fe05bb3f32fabea4e54dd92d368967a80da.tar.gz
initial commit for Enea Linux 4.0
Migrated from the internal git server on the daisy-enea branch Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
Diffstat (limited to 'meta/recipes-sato/puzzles')
-rw-r--r--meta/recipes-sato/puzzles/files/oh-puzzles-owl-menu.patch203
-rw-r--r--meta/recipes-sato/puzzles/oh-puzzles_git.bb69
-rw-r--r--meta/recipes-sato/puzzles/puzzles_r10116.bb53
3 files changed, 325 insertions, 0 deletions
diff --git a/meta/recipes-sato/puzzles/files/oh-puzzles-owl-menu.patch b/meta/recipes-sato/puzzles/files/oh-puzzles-owl-menu.patch
new file mode 100644
index 0000000000..7e2c3ab75d
--- /dev/null
+++ b/meta/recipes-sato/puzzles/files/oh-puzzles-owl-menu.patch
@@ -0,0 +1,203 @@
1This patch enable owl menu, which is hidden in the title bar to save space on
2small screen. It has not been used for a long time, rebase needed.
3
4Upstream-Status: Inappropriate [enable feature]
5
6Index: src/gtk.c
7===================================================================
8--- src/gtk.c (revision 22)
9+++ src/gtk.c (working copy)
10@@ -28,6 +28,8 @@
11 #include <gdk/gdkx.h>
12 #include <gdk-pixbuf/gdk-pixbuf.h>
13
14+#include <libowl/owlwindowmenu.h>
15+
16 #include <librsvg/rsvg.h>
17
18 #include <X11/Xlib.h>
19@@ -1237,6 +1239,7 @@
20 }
21 }
22
23+#if 0
24 static void
25 add_widget (GtkUIManager *merge,
26 GtkWidget *widget,
27@@ -1247,10 +1250,11 @@
28 gtk_box_pack_start (box, widget, FALSE, FALSE, 0);
29
30 toplevel = gtk_widget_get_toplevel (GTK_WIDGET (box));
31- gtk_widget_show_all (toplevel);
32 }
33+#endif
34
35 static GtkActionEntry toplevel_actions[] = {
36+ { "Top", NULL, "" },
37 { "Game", NULL, N_("Game") },
38 { "Settings", NULL, N_("Settings") },
39 { "Help", NULL, N_("Help") },
40@@ -1303,11 +1307,13 @@
41 frontend *fe)
42 {
43 GString *xml;
44+ GError *error = NULL;
45 gboolean presets = FALSE;
46 GSList *radio_group = NULL;
47 int i;
48
49- xml = g_string_new ("<ui><menubar><placeholder name=\"TypePlaceholder\">"
50+ xml = g_string_new ("<ui><menubar><menu name=\"TopMenu\" action=\"Top\">"
51+ "<placeholder name=\"TypePlaceholder\">"
52 "<menu name=\"SettingsMenu\" action=\"Settings\">");
53
54 for (i = 0; i < midend_num_presets(fe->me); i++) {
55@@ -1359,8 +1365,14 @@
56 "<menuitem name=\"CustomMenu\" action=\"Custom\"/>");
57 }
58
59- g_string_append (xml, "</menu></placeholder></menubar></ui>");
60- gtk_ui_manager_add_ui_from_string (merge, xml->str, -1, NULL);
61+ g_string_append (xml, "</menu></placeholder></menu></menubar></ui>");
62+
63+ gtk_ui_manager_add_ui_from_string (merge, xml->str, -1, &error);
64+ if (error != NULL) {
65+ g_warning ("Error adding custom: %s", error->message);
66+ g_error_free (error);
67+ }
68+
69 g_string_free (xml, TRUE);
70 }
71
72@@ -1434,6 +1446,7 @@
73 new_window(char *arg, char **error)
74 {
75 frontend *fe;
76+ GError *err = NULL;
77 GtkBox *vbox;
78 GtkUIManager *merge;
79 GtkActionGroup *actions;
80@@ -1496,8 +1509,6 @@
81 gtk_window_add_accel_group(GTK_WINDOW(fe->window), fe->accelgroup);
82
83 merge = gtk_ui_manager_new ();
84- g_signal_connect (G_OBJECT (merge), "add_widget",
85- G_CALLBACK (add_widget), vbox);
86
87 actions = gtk_action_group_new ("PuzzleActions");
88 gtk_action_group_add_actions (actions, toplevel_actions,
89@@ -1509,22 +1520,39 @@
90
91 gtk_ui_manager_insert_action_group (merge, actions, 0);
92
93- gtk_ui_manager_add_ui_from_file (merge, DATADIR "/oh-puzzles/ui/menu.xml", NULL);
94+ gtk_ui_manager_add_ui_from_file (merge, DATADIR "/oh-puzzles/ui/menu.xml",
95+ &err);
96+ if (err != NULL) {
97+ g_warning ("Error making UI: %s", err->message);
98+ g_error_free (err);
99+ err = NULL;
100+ }
101
102 if (thegame.can_solve) {
103- char *str = "<ui><menubar><menu name=\"GameMenu\" action=\"Game\">"
104+ char *str = "<ui><menubar><menu name=\"TopMenu\" action=\"Top\">"
105+ "<menu name=\"GameMenu\" action=\"Game\">"
106 "<placeholder name=\"SolvePlaceholder\">"
107 "<separator name=\"SolveSep\"/>"
108 "<menuitem name=\"SolveMenu\" action=\"Solve\"/>"
109- "</placeholder></menu></menubar></ui>";
110+ "</placeholder></menu></menu></menubar></ui>";
111
112- gtk_ui_manager_add_ui_from_string (merge, str, -1, NULL);
113+ gtk_ui_manager_add_ui_from_string (merge, str, -1, &err);
114+ if (err != NULL) {
115+ g_warning ("Error adding solve. %s", err->message);
116+ g_error_free (err);
117+ }
118 }
119
120 if ((n = midend_num_presets(fe->me)) > 0 || thegame.can_configure) {
121 generate_settings_menu (merge, actions, fe);
122 }
123
124+ /* Do this so that the menu is packed now instead of in the idle loop */
125+ gtk_ui_manager_ensure_update (merge);
126+
127+ owl_set_window_menu_item (GTK_WINDOW (fe->window),
128+ GTK_MENU_ITEM (gtk_ui_manager_get_widget (merge, "/menubar/TopMenu")));
129+
130 setup_colours (fe);
131 setup_pixbufs (fe);
132
133@@ -1572,7 +1600,7 @@
134 GDK_BUTTON_RELEASE_MASK |
135 GDK_BUTTON_MOTION_MASK);
136
137- /* The window is shown once the menubar has been added */
138+ gtk_widget_show_all (fe->window);
139 return fe;
140 }
141
142Index: src/menu.xml
143===================================================================
144--- src/menu.xml (revision 22)
145+++ src/menu.xml (working copy)
146@@ -1,26 +1,25 @@
147 <ui>
148 <menubar>
149-<menu name="GameMenu" action="Game">
150- <menuitem name="NewMenu" action="New"/>
151- <menuitem name="RestartMenu" action="Restart"/>
152-<!-- <menuitem name="SpecificMenu" action="Specific"/> -->
153- <menuitem name="RandomMenu" action="Random"/>
154- <separator name="GameSep1"/>
155- <menuitem name="LoadMenu" action="Load"/>
156- <menuitem name="SaveMenu" action="Save"/>
157- <separator name="GameSep2"/>
158- <menuitem name="UndoMenu" action="Undo"/>
159- <menuitem name="RedoMenu" action="Redo"/>
160- <placeholder name="CopyPlaceholder"/>
161- <placeholder name="SolvePlaceholder"/>
162- <separator name="GameSep3"/>
163- <menuitem name="QuitMenu" action="Quit"/>
164-</menu>
165+<menu name="TopMenu" action="Top">
166+ <menu name="GameMenu" action="Game">
167+ <menuitem name="NewMenu" action="New"/>
168+ <menuitem name="RestartMenu" action="Restart"/>
169+ <!-- <menuitem name="SpecificMenu" action="Specific"/> -->
170+ <menuitem name="RandomMenu" action="Random"/>
171+ <separator name="GameSep1"/>
172+ <menuitem name="LoadMenu" action="Load"/>
173+ <menuitem name="SaveMenu" action="Save"/>
174+ <separator name="GameSep2"/>
175+ <menuitem name="UndoMenu" action="Undo"/>
176+ <menuitem name="RedoMenu" action="Redo"/>
177+ <placeholder name="CopyPlaceholder"/>
178+ <placeholder name="SolvePlaceholder"/>
179+ </menu>
180
181-<placeholder name="TypePlaceholder"/>
182-
183-<menu name="HelpMenu" action="Help">
184+ <placeholder name="TypePlaceholder"/>
185 <menuitem name="AboutMenu" action="About"/>
186+ <menuitem name="QuitMenu" action="Quit"/>
187+
188 </menu>
189 </menubar>
190 </ui>
191Index: src/Makefile.am
192===================================================================
193--- src/Makefile.am (revision 22)
194+++ src/Makefile.am (working copy)
195@@ -10,7 +10,7 @@
196 lightup loopy map mines net netslide pattern pegs rect samegame \
197 sixteen slant solo tents twiddle untangle
198
199-libpuzzles_la_LIBADD = $(PUZZLES_LIBS)
200+libpuzzles_la_LIBADD = $(PUZZLES_LIBS) -lowl
201 libpuzzles_la_SOURCES = combi.c \
202 configuration.c \
203 drawing.c \
diff --git a/meta/recipes-sato/puzzles/oh-puzzles_git.bb b/meta/recipes-sato/puzzles/oh-puzzles_git.bb
new file mode 100644
index 0000000000..bd762e9315
--- /dev/null
+++ b/meta/recipes-sato/puzzles/oh-puzzles_git.bb
@@ -0,0 +1,69 @@
1SUMMARY = "Portable Puzzle Collection"
2HOMEPAGE = "http://o-hand.com/"
3BUGTRACKER = "http://bugzilla.yoctoproject.org/"
4
5LICENSE = "MIT"
6LIC_FILES_CHKSUM = "file://LICENCE;md5=f56ec6772dd1c7c367067bbea8ea1675 \
7 file://src/tree234.h;endline=28;md5=a188e6d250430ca094a54a82f48472a7 \
8 file://src/tree234.c;endline=28;md5=b4feb1976feebf8f1379093ed52f2945"
9
10SECTION = "x11"
11DEPENDS = "gtk+ gconf intltool-native librsvg"
12DEPENDS_append_poky = " libowl"
13
14SRCREV = "92f1a20e4b72eed7a35b00984d9793b51dc2fb3b"
15PV = "0.2+git${SRCPV}"
16PR = "r10"
17
18SRC_URI = "git://git.yoctoproject.org/${BPN}"
19SRC_URI_append_poky = " file://oh-puzzles-owl-menu.patch;striplevel=0 "
20
21S = "${WORKDIR}/git"
22
23inherit autotools pkgconfig
24
25bindir = "/usr/games"
26
27EXTRA_OEMAKE += "GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1"
28
29do_install_append () {
30 install -d ${D}/${datadir}/applications/
31
32 cd ${D}/${prefix}/games
33 for prog in *; do
34 if [ -x $prog ]; then
35 # Convert prog to Title Case
36 title=$(echo $prog | sed 's/\(^\| \)./\U&/g')
37 echo "making ${D}/${datadir}/applications/$prog.desktop"
38 cat <<STOP > ${D}/${datadir}/applications/$prog.desktop
39[Desktop Entry]
40Name=$title
41Exec=${prefix}/games/$prog
42Icon=applications-games
43Terminal=false
44Type=Application
45Categories=Game;
46StartupNotify=true
47X-MB-SingleInstance=true
48Comment=Play $title.
49STOP
50 fi
51 done
52}
53
54PACKAGES += "${PN}-extra"
55RDEPENDS_${PN}-extra += "oh-puzzles"
56
57FILES_${PN} = "/usr/share/pixmaps /usr/share/oh-puzzles/"
58FILES_${PN}-dbg += "/usr/games/.debug/*"
59FILES_${PN}-extra = "/usr/games/ /usr/share/applications /etc/gconf/schemas"
60
61python __anonymous () {
62 var = bb.data.expand("FILES_${PN}", d, 1)
63 data = d.getVar(var, True)
64 for name in ("bridges", "fifteen", "inertia", "map", "samegame", "slant"):
65 data = data + " /usr/games/%s" % name
66 data = data + " /usr/share/applications/%s.desktop" % name
67 data = data + " /etc/gconf/schemas/%s.schemas" % name
68 d.setVar(var, data)
69}
diff --git a/meta/recipes-sato/puzzles/puzzles_r10116.bb b/meta/recipes-sato/puzzles/puzzles_r10116.bb
new file mode 100644
index 0000000000..ef5392b68f
--- /dev/null
+++ b/meta/recipes-sato/puzzles/puzzles_r10116.bb
@@ -0,0 +1,53 @@
1SUMMARY = "Simon Tatham's Portable Puzzle Collection"
2HOMEPAGE = "http://www.chiark.greenend.org.uk/~sgtatham/puzzles/"
3
4DEPENDS = "gtk+ libxt"
5MOD_PV = "${@d.getVar('PV',1)[1:]}"
6
7LICENSE = "MIT"
8LIC_FILES_CHKSUM = "file://LICENCE;md5=33bcd4bce8f3c197f2aefbdbd2d299bc"
9
10SRC_URI = "svn://svn.tartarus.org/sgt;module=puzzles;rev=${MOD_PV}"
11
12S = "${WORKDIR}/${BPN}"
13
14inherit autotools-brokensep
15
16do_configure_prepend () {
17 ./mkfiles.pl
18}
19
20FILES_${PN} = "${prefix}/bin/* ${datadir}/applications/*"
21FILES_${PN}-dbg += "${prefix}/bin/.debug"
22
23do_install () {
24 rm -rf ${D}/*
25 export prefix=${D}
26 export DESTDIR=${D}
27 install -d ${D}/${prefix}/bin/
28 oe_runmake install
29
30
31 install -d ${D}/${datadir}/applications/
32
33 # Create desktop shortcuts
34 cd ${D}/${prefix}/bin
35 for prog in *; do
36 if [ -x $prog ]; then
37 # Convert prog to Title Case
38 title=$(echo $prog | sed 's/\(^\| \)./\U&/g')
39 echo "making ${D}/${datadir}/applications/$prog.desktop"
40 cat <<STOP > ${D}/${datadir}/applications/$prog.desktop
41[Desktop Entry]
42Name=$title
43Exec=${prefix}/bin/$prog
44Icon=applications-games
45Terminal=false
46Type=Application
47Categories=Game;
48StartupNotify=true
49X-MB-SingleInstance=true
50STOP
51 fi
52 done
53}