diff options
author | Tudor Florea <tudor.florea@enea.com> | 2015-10-09 22:59:03 +0200 |
---|---|---|
committer | Tudor Florea <tudor.florea@enea.com> | 2015-10-09 22:59:03 +0200 |
commit | 972dcfcdbfe75dcfeb777150c136576cf1a71e99 (patch) | |
tree | 97a61cd7e293d7ae9d56ef7ed0f81253365bb026 /meta/recipes-sato/puzzles | |
download | poky-972dcfcdbfe75dcfeb777150c136576cf1a71e99.tar.gz |
initial commit for Enea Linux 5.0 arm
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta/recipes-sato/puzzles')
4 files changed, 379 insertions, 0 deletions
diff --git a/meta/recipes-sato/puzzles/files/fix-compiling-failure-with-option-g-O.patch b/meta/recipes-sato/puzzles/files/fix-compiling-failure-with-option-g-O.patch new file mode 100644 index 0000000000..d246feeb09 --- /dev/null +++ b/meta/recipes-sato/puzzles/files/fix-compiling-failure-with-option-g-O.patch | |||
@@ -0,0 +1,52 @@ | |||
1 | gtk.c: fix compiling failure with option -g -O | ||
2 | |||
3 | There were compiling failure with option -g -O | ||
4 | ... | ||
5 | ././gtk.c: In function 'configure_area': | ||
6 | ././gtk.c:397:2: error: 'cr' may be used uninitialized in this function [-Werror=maybe-uninitialized] | ||
7 | cairo_set_source_rgb(cr, | ||
8 | ^ | ||
9 | ././gtk.c:384:14: note: 'cr' was declared here | ||
10 | cairo_t *cr; | ||
11 | ^ | ||
12 | ././gtk.c: In function 'main': | ||
13 | ././gtk.c:2911:6: error: 'error' may be used uninitialized in this function [-Werror=maybe-uninitialized] | ||
14 | fprintf(stderr, "%s: %s\n", pname, error); | ||
15 | ^ | ||
16 | cc1: all warnings being treated as errors | ||
17 | ... | ||
18 | |||
19 | Initialized pointer 'cr' and 'error' with NULL | ||
20 | |||
21 | Upstream-Status: Pending | ||
22 | |||
23 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
24 | --- | ||
25 | gtk.c | 4 ++-- | ||
26 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
27 | |||
28 | diff --git a/gtk.c b/gtk.c | ||
29 | index a2eba2c..c54bf63 100644 | ||
30 | --- a/gtk.c | ||
31 | +++ b/gtk.c | ||
32 | @@ -381,7 +381,7 @@ static void clear_backing_store(frontend *fe) | ||
33 | |||
34 | static void setup_backing_store(frontend *fe) | ||
35 | { | ||
36 | - cairo_t *cr; | ||
37 | + cairo_t *cr = NULL; | ||
38 | int i; | ||
39 | |||
40 | fe->pixmap = gdk_pixmap_new(fe->area->window, fe->pw, fe->ph, -1); | ||
41 | @@ -2481,7 +2481,7 @@ char *fgetline(FILE *fp) | ||
42 | int main(int argc, char **argv) | ||
43 | { | ||
44 | char *pname = argv[0]; | ||
45 | - char *error; | ||
46 | + char *error = NULL; | ||
47 | int ngenerate = 0, print = FALSE, px = 1, py = 1; | ||
48 | int time_generation = FALSE, test_solve = FALSE, list_presets = FALSE; | ||
49 | int soln = FALSE, colour = FALSE; | ||
50 | -- | ||
51 | 1.9.1 | ||
52 | |||
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 @@ | |||
1 | This patch enable owl menu, which is hidden in the title bar to save space on | ||
2 | small screen. It has not been used for a long time, rebase needed. | ||
3 | |||
4 | Upstream-Status: Inappropriate [enable feature] | ||
5 | |||
6 | Index: 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 | |||
142 | Index: 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> | ||
191 | Index: 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 @@ | |||
1 | SUMMARY = "Portable Puzzle Collection" | ||
2 | HOMEPAGE = "http://o-hand.com/" | ||
3 | BUGTRACKER = "http://bugzilla.yoctoproject.org/" | ||
4 | |||
5 | LICENSE = "MIT" | ||
6 | LIC_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 | |||
10 | SECTION = "x11" | ||
11 | DEPENDS = "gtk+ gconf intltool-native librsvg" | ||
12 | DEPENDS_append_poky = " libowl" | ||
13 | |||
14 | SRCREV = "92f1a20e4b72eed7a35b00984d9793b51dc2fb3b" | ||
15 | PV = "0.2+git${SRCPV}" | ||
16 | PR = "r10" | ||
17 | |||
18 | SRC_URI = "git://git.yoctoproject.org/${BPN}" | ||
19 | SRC_URI_append_poky = " file://oh-puzzles-owl-menu.patch;striplevel=0 " | ||
20 | |||
21 | S = "${WORKDIR}/git" | ||
22 | |||
23 | inherit autotools pkgconfig | ||
24 | |||
25 | bindir = "/usr/games" | ||
26 | |||
27 | EXTRA_OEMAKE += "GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1" | ||
28 | |||
29 | do_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] | ||
40 | Name=$title | ||
41 | Exec=${prefix}/games/$prog | ||
42 | Icon=applications-games | ||
43 | Terminal=false | ||
44 | Type=Application | ||
45 | Categories=Game; | ||
46 | StartupNotify=true | ||
47 | X-MB-SingleInstance=true | ||
48 | Comment=Play $title. | ||
49 | STOP | ||
50 | fi | ||
51 | done | ||
52 | } | ||
53 | |||
54 | PACKAGES += "${PN}-extra" | ||
55 | RDEPENDS_${PN}-extra += "oh-puzzles" | ||
56 | |||
57 | FILES_${PN} = "/usr/share/pixmaps /usr/share/oh-puzzles/" | ||
58 | FILES_${PN}-dbg += "/usr/games/.debug/*" | ||
59 | FILES_${PN}-extra = "/usr/games/ /usr/share/applications /etc/gconf/schemas" | ||
60 | |||
61 | python __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..6ee4d962b2 --- /dev/null +++ b/meta/recipes-sato/puzzles/puzzles_r10116.bb | |||
@@ -0,0 +1,55 @@ | |||
1 | SUMMARY = "Simon Tatham's Portable Puzzle Collection" | ||
2 | HOMEPAGE = "http://www.chiark.greenend.org.uk/~sgtatham/puzzles/" | ||
3 | |||
4 | DEPENDS = "gtk+ libxt" | ||
5 | MOD_PV = "${@d.getVar('PV',1)[1:]}" | ||
6 | |||
7 | LICENSE = "MIT" | ||
8 | LIC_FILES_CHKSUM = "file://LICENCE;md5=33bcd4bce8f3c197f2aefbdbd2d299bc" | ||
9 | |||
10 | SRC_URI = "svn://svn.tartarus.org/sgt;module=puzzles;rev=${MOD_PV} \ | ||
11 | file://fix-compiling-failure-with-option-g-O.patch \ | ||
12 | " | ||
13 | |||
14 | S = "${WORKDIR}/${BPN}" | ||
15 | |||
16 | inherit autotools-brokensep | ||
17 | |||
18 | do_configure_prepend () { | ||
19 | ./mkfiles.pl | ||
20 | } | ||
21 | |||
22 | FILES_${PN} = "${prefix}/bin/* ${datadir}/applications/*" | ||
23 | FILES_${PN}-dbg += "${prefix}/bin/.debug" | ||
24 | |||
25 | do_install () { | ||
26 | rm -rf ${D}/* | ||
27 | export prefix=${D} | ||
28 | export DESTDIR=${D} | ||
29 | install -d ${D}/${prefix}/bin/ | ||
30 | oe_runmake install | ||
31 | |||
32 | |||
33 | install -d ${D}/${datadir}/applications/ | ||
34 | |||
35 | # Create desktop shortcuts | ||
36 | cd ${D}/${prefix}/bin | ||
37 | for prog in *; do | ||
38 | if [ -x $prog ]; then | ||
39 | # Convert prog to Title Case | ||
40 | title=$(echo $prog | sed 's/\(^\| \)./\U&/g') | ||
41 | echo "making ${D}/${datadir}/applications/$prog.desktop" | ||
42 | cat <<STOP > ${D}/${datadir}/applications/$prog.desktop | ||
43 | [Desktop Entry] | ||
44 | Name=$title | ||
45 | Exec=${prefix}/bin/$prog | ||
46 | Icon=applications-games | ||
47 | Terminal=false | ||
48 | Type=Application | ||
49 | Categories=Game; | ||
50 | StartupNotify=true | ||
51 | X-MB-SingleInstance=true | ||
52 | STOP | ||
53 | fi | ||
54 | done | ||
55 | } | ||