diff options
Diffstat (limited to 'meta/recipes-sato/puzzles')
-rw-r--r-- | meta/recipes-sato/puzzles/files/makedist_hack.patch | 17 | ||||
-rw-r--r-- | meta/recipes-sato/puzzles/files/oh-puzzles-owl-menu.patch | 198 | ||||
-rw-r--r-- | meta/recipes-sato/puzzles/oh-puzzles_svn.bb | 69 | ||||
-rw-r--r-- | meta/recipes-sato/puzzles/puzzles_r7593.bb | 53 |
4 files changed, 337 insertions, 0 deletions
diff --git a/meta/recipes-sato/puzzles/files/makedist_hack.patch b/meta/recipes-sato/puzzles/files/makedist_hack.patch new file mode 100644 index 0000000000..d07e066026 --- /dev/null +++ b/meta/recipes-sato/puzzles/files/makedist_hack.patch | |||
@@ -0,0 +1,17 @@ | |||
1 | --- | ||
2 | makedist.sh | 2 ++ | ||
3 | 1 file changed, 2 insertions(+) | ||
4 | |||
5 | Index: puzzles/makedist.sh | ||
6 | =================================================================== | ||
7 | --- puzzles.orig/makedist.sh 2007-05-17 11:49:59.000000000 +0100 | ||
8 | +++ puzzles/makedist.sh 2007-05-17 12:07:39.000000000 +0100 | ||
9 | @@ -30,6 +30,8 @@ fi | ||
10 | |||
11 | perl mkfiles.pl | ||
12 | |||
13 | +exit 0 | ||
14 | + | ||
15 | mkdir tmp.$$ | ||
16 | mkdir tmp.$$/puzzles$arcsuffix | ||
17 | |||
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..61da9191a8 --- /dev/null +++ b/meta/recipes-sato/puzzles/files/oh-puzzles-owl-menu.patch | |||
@@ -0,0 +1,198 @@ | |||
1 | Index: src/gtk.c | ||
2 | =================================================================== | ||
3 | --- src/gtk.c (revision 22) | ||
4 | +++ src/gtk.c (working copy) | ||
5 | @@ -28,6 +28,8 @@ | ||
6 | #include <gdk/gdkx.h> | ||
7 | #include <gdk-pixbuf/gdk-pixbuf.h> | ||
8 | |||
9 | +#include <libowl/owlwindowmenu.h> | ||
10 | + | ||
11 | #include <librsvg/rsvg.h> | ||
12 | |||
13 | #include <X11/Xlib.h> | ||
14 | @@ -1237,6 +1239,7 @@ | ||
15 | } | ||
16 | } | ||
17 | |||
18 | +#if 0 | ||
19 | static void | ||
20 | add_widget (GtkUIManager *merge, | ||
21 | GtkWidget *widget, | ||
22 | @@ -1247,10 +1250,11 @@ | ||
23 | gtk_box_pack_start (box, widget, FALSE, FALSE, 0); | ||
24 | |||
25 | toplevel = gtk_widget_get_toplevel (GTK_WIDGET (box)); | ||
26 | - gtk_widget_show_all (toplevel); | ||
27 | } | ||
28 | +#endif | ||
29 | |||
30 | static GtkActionEntry toplevel_actions[] = { | ||
31 | + { "Top", NULL, "" }, | ||
32 | { "Game", NULL, N_("Game") }, | ||
33 | { "Settings", NULL, N_("Settings") }, | ||
34 | { "Help", NULL, N_("Help") }, | ||
35 | @@ -1303,11 +1307,13 @@ | ||
36 | frontend *fe) | ||
37 | { | ||
38 | GString *xml; | ||
39 | + GError *error = NULL; | ||
40 | gboolean presets = FALSE; | ||
41 | GSList *radio_group = NULL; | ||
42 | int i; | ||
43 | |||
44 | - xml = g_string_new ("<ui><menubar><placeholder name=\"TypePlaceholder\">" | ||
45 | + xml = g_string_new ("<ui><menubar><menu name=\"TopMenu\" action=\"Top\">" | ||
46 | + "<placeholder name=\"TypePlaceholder\">" | ||
47 | "<menu name=\"SettingsMenu\" action=\"Settings\">"); | ||
48 | |||
49 | for (i = 0; i < midend_num_presets(fe->me); i++) { | ||
50 | @@ -1359,8 +1365,14 @@ | ||
51 | "<menuitem name=\"CustomMenu\" action=\"Custom\"/>"); | ||
52 | } | ||
53 | |||
54 | - g_string_append (xml, "</menu></placeholder></menubar></ui>"); | ||
55 | - gtk_ui_manager_add_ui_from_string (merge, xml->str, -1, NULL); | ||
56 | + g_string_append (xml, "</menu></placeholder></menu></menubar></ui>"); | ||
57 | + | ||
58 | + gtk_ui_manager_add_ui_from_string (merge, xml->str, -1, &error); | ||
59 | + if (error != NULL) { | ||
60 | + g_warning ("Error adding custom: %s", error->message); | ||
61 | + g_error_free (error); | ||
62 | + } | ||
63 | + | ||
64 | g_string_free (xml, TRUE); | ||
65 | } | ||
66 | |||
67 | @@ -1434,6 +1446,7 @@ | ||
68 | new_window(char *arg, char **error) | ||
69 | { | ||
70 | frontend *fe; | ||
71 | + GError *err = NULL; | ||
72 | GtkBox *vbox; | ||
73 | GtkUIManager *merge; | ||
74 | GtkActionGroup *actions; | ||
75 | @@ -1496,8 +1509,6 @@ | ||
76 | gtk_window_add_accel_group(GTK_WINDOW(fe->window), fe->accelgroup); | ||
77 | |||
78 | merge = gtk_ui_manager_new (); | ||
79 | - g_signal_connect (G_OBJECT (merge), "add_widget", | ||
80 | - G_CALLBACK (add_widget), vbox); | ||
81 | |||
82 | actions = gtk_action_group_new ("PuzzleActions"); | ||
83 | gtk_action_group_add_actions (actions, toplevel_actions, | ||
84 | @@ -1509,22 +1520,39 @@ | ||
85 | |||
86 | gtk_ui_manager_insert_action_group (merge, actions, 0); | ||
87 | |||
88 | - gtk_ui_manager_add_ui_from_file (merge, DATADIR "/oh-puzzles/ui/menu.xml", NULL); | ||
89 | + gtk_ui_manager_add_ui_from_file (merge, DATADIR "/oh-puzzles/ui/menu.xml", | ||
90 | + &err); | ||
91 | + if (err != NULL) { | ||
92 | + g_warning ("Error making UI: %s", err->message); | ||
93 | + g_error_free (err); | ||
94 | + err = NULL; | ||
95 | + } | ||
96 | |||
97 | if (thegame.can_solve) { | ||
98 | - char *str = "<ui><menubar><menu name=\"GameMenu\" action=\"Game\">" | ||
99 | + char *str = "<ui><menubar><menu name=\"TopMenu\" action=\"Top\">" | ||
100 | + "<menu name=\"GameMenu\" action=\"Game\">" | ||
101 | "<placeholder name=\"SolvePlaceholder\">" | ||
102 | "<separator name=\"SolveSep\"/>" | ||
103 | "<menuitem name=\"SolveMenu\" action=\"Solve\"/>" | ||
104 | - "</placeholder></menu></menubar></ui>"; | ||
105 | + "</placeholder></menu></menu></menubar></ui>"; | ||
106 | |||
107 | - gtk_ui_manager_add_ui_from_string (merge, str, -1, NULL); | ||
108 | + gtk_ui_manager_add_ui_from_string (merge, str, -1, &err); | ||
109 | + if (err != NULL) { | ||
110 | + g_warning ("Error adding solve. %s", err->message); | ||
111 | + g_error_free (err); | ||
112 | + } | ||
113 | } | ||
114 | |||
115 | if ((n = midend_num_presets(fe->me)) > 0 || thegame.can_configure) { | ||
116 | generate_settings_menu (merge, actions, fe); | ||
117 | } | ||
118 | |||
119 | + /* Do this so that the menu is packed now instead of in the idle loop */ | ||
120 | + gtk_ui_manager_ensure_update (merge); | ||
121 | + | ||
122 | + owl_set_window_menu_item (GTK_WINDOW (fe->window), | ||
123 | + GTK_MENU_ITEM (gtk_ui_manager_get_widget (merge, "/menubar/TopMenu"))); | ||
124 | + | ||
125 | setup_colours (fe); | ||
126 | setup_pixbufs (fe); | ||
127 | |||
128 | @@ -1572,7 +1600,7 @@ | ||
129 | GDK_BUTTON_RELEASE_MASK | | ||
130 | GDK_BUTTON_MOTION_MASK); | ||
131 | |||
132 | - /* The window is shown once the menubar has been added */ | ||
133 | + gtk_widget_show_all (fe->window); | ||
134 | return fe; | ||
135 | } | ||
136 | |||
137 | Index: src/menu.xml | ||
138 | =================================================================== | ||
139 | --- src/menu.xml (revision 22) | ||
140 | +++ src/menu.xml (working copy) | ||
141 | @@ -1,26 +1,25 @@ | ||
142 | <ui> | ||
143 | <menubar> | ||
144 | -<menu name="GameMenu" action="Game"> | ||
145 | - <menuitem name="NewMenu" action="New"/> | ||
146 | - <menuitem name="RestartMenu" action="Restart"/> | ||
147 | -<!-- <menuitem name="SpecificMenu" action="Specific"/> --> | ||
148 | - <menuitem name="RandomMenu" action="Random"/> | ||
149 | - <separator name="GameSep1"/> | ||
150 | - <menuitem name="LoadMenu" action="Load"/> | ||
151 | - <menuitem name="SaveMenu" action="Save"/> | ||
152 | - <separator name="GameSep2"/> | ||
153 | - <menuitem name="UndoMenu" action="Undo"/> | ||
154 | - <menuitem name="RedoMenu" action="Redo"/> | ||
155 | - <placeholder name="CopyPlaceholder"/> | ||
156 | - <placeholder name="SolvePlaceholder"/> | ||
157 | - <separator name="GameSep3"/> | ||
158 | - <menuitem name="QuitMenu" action="Quit"/> | ||
159 | -</menu> | ||
160 | +<menu name="TopMenu" action="Top"> | ||
161 | + <menu name="GameMenu" action="Game"> | ||
162 | + <menuitem name="NewMenu" action="New"/> | ||
163 | + <menuitem name="RestartMenu" action="Restart"/> | ||
164 | + <!-- <menuitem name="SpecificMenu" action="Specific"/> --> | ||
165 | + <menuitem name="RandomMenu" action="Random"/> | ||
166 | + <separator name="GameSep1"/> | ||
167 | + <menuitem name="LoadMenu" action="Load"/> | ||
168 | + <menuitem name="SaveMenu" action="Save"/> | ||
169 | + <separator name="GameSep2"/> | ||
170 | + <menuitem name="UndoMenu" action="Undo"/> | ||
171 | + <menuitem name="RedoMenu" action="Redo"/> | ||
172 | + <placeholder name="CopyPlaceholder"/> | ||
173 | + <placeholder name="SolvePlaceholder"/> | ||
174 | + </menu> | ||
175 | |||
176 | -<placeholder name="TypePlaceholder"/> | ||
177 | - | ||
178 | -<menu name="HelpMenu" action="Help"> | ||
179 | + <placeholder name="TypePlaceholder"/> | ||
180 | <menuitem name="AboutMenu" action="About"/> | ||
181 | + <menuitem name="QuitMenu" action="Quit"/> | ||
182 | + | ||
183 | </menu> | ||
184 | </menubar> | ||
185 | </ui> | ||
186 | Index: src/Makefile.am | ||
187 | =================================================================== | ||
188 | --- src/Makefile.am (revision 22) | ||
189 | +++ src/Makefile.am (working copy) | ||
190 | @@ -10,7 +10,7 @@ | ||
191 | lightup loopy map mines net netslide pattern pegs rect samegame \ | ||
192 | sixteen slant solo tents twiddle untangle | ||
193 | |||
194 | -libpuzzles_la_LIBADD = $(PUZZLES_LIBS) | ||
195 | +libpuzzles_la_LIBADD = $(PUZZLES_LIBS) -lowl | ||
196 | libpuzzles_la_SOURCES = combi.c \ | ||
197 | configuration.c \ | ||
198 | drawing.c \ | ||
diff --git a/meta/recipes-sato/puzzles/oh-puzzles_svn.bb b/meta/recipes-sato/puzzles/oh-puzzles_svn.bb new file mode 100644 index 0000000000..5fcea24b37 --- /dev/null +++ b/meta/recipes-sato/puzzles/oh-puzzles_svn.bb | |||
@@ -0,0 +1,69 @@ | |||
1 | DESCRIPTION = "Portable Puzzle Collection" | ||
2 | HOMEPAGE = "http://o-hand.com/" | ||
3 | BUGTRACKER = "http://bugzilla.openedhand.com/" | ||
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 | PV = "0.1+svnr${SRCREV}" | ||
15 | PR = "r10" | ||
16 | |||
17 | bindir = "/usr/games" | ||
18 | |||
19 | inherit autotools pkgconfig | ||
20 | |||
21 | SRC_URI = "svn://svn.o-hand.com/repos/;module=oh-puzzles;proto=http" | ||
22 | SRC_URI_append_poky = " file://oh-puzzles-owl-menu.patch;patch=1;pnum=0 " | ||
23 | |||
24 | S = "${WORKDIR}/${PN}" | ||
25 | |||
26 | EXTRA_OEMAKE += "GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1" | ||
27 | |||
28 | do_install_append () { | ||
29 | install -d ${D}/${datadir}/applications/ | ||
30 | |||
31 | cd ${D}/${prefix}/games | ||
32 | for prog in *; do | ||
33 | if [ -x $prog ]; then | ||
34 | # Convert prog to Title Case | ||
35 | title=$(echo $prog | sed 's/\(^\| \)./\U&/g') | ||
36 | echo "making ${D}/${datadir}/applications/$prog.desktop" | ||
37 | cat <<STOP > ${D}/${datadir}/applications/$prog.desktop | ||
38 | [Desktop Entry] | ||
39 | Name=$title | ||
40 | Exec=${prefix}/games/$prog | ||
41 | Icon=applications-games | ||
42 | Terminal=false | ||
43 | Type=Application | ||
44 | Categories=Game; | ||
45 | StartupNotify=true | ||
46 | X-MB-SingleInstance=true | ||
47 | Comment=Play $title. | ||
48 | STOP | ||
49 | fi | ||
50 | done | ||
51 | } | ||
52 | |||
53 | PACKAGES += ${PN}-extra | ||
54 | RDEPENDS_${PN}-extra += "oh-puzzles" | ||
55 | |||
56 | FILES_${PN} = "/usr/share/pixmaps /usr/share/oh-puzzles/" | ||
57 | FILES_${PN}-dbg += "/usr/games/.debug/*" | ||
58 | FILES_${PN}-extra = "/usr/games/ /usr/share/applications /etc/gconf/schemas" | ||
59 | |||
60 | python __anonymous () { | ||
61 | import bb | ||
62 | var = bb.data.expand("FILES_${PN}", d, 1) | ||
63 | data = bb.data.getVar(var, d, 1) | ||
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 | bb.data.setVar(var, data, d) | ||
69 | } | ||
diff --git a/meta/recipes-sato/puzzles/puzzles_r7593.bb b/meta/recipes-sato/puzzles/puzzles_r7593.bb new file mode 100644 index 0000000000..eb1e009353 --- /dev/null +++ b/meta/recipes-sato/puzzles/puzzles_r7593.bb | |||
@@ -0,0 +1,53 @@ | |||
1 | |||
2 | DEPENDS = "gtk+ libxt" | ||
3 | PR = "r8" | ||
4 | MOD_PV = "${@bb.data.getVar('PV',d,1)[1:]}" | ||
5 | |||
6 | #SRC_URI = "http://www.chiark.greenend.org.uk/~sgtatham/puzzles/puzzles-${PV}.tar.gz" | ||
7 | SRC_URI = "svn://ixion.tartarus.org/main;module=puzzles;rev=${MOD_PV} \ | ||
8 | file://makedist_hack.patch;patch=1" | ||
9 | |||
10 | S = "${WORKDIR}/${PN}" | ||
11 | |||
12 | do_configure () { | ||
13 | ./makedist.sh ${MOD_PV} | ||
14 | } | ||
15 | |||
16 | do_compile_prepend = " \ | ||
17 | export XLDFLAGS='${LDFLAGS} `${STAGING_BINDIR_NATIVE}/pkg-config gtk+-2.0 --libs`'; \ | ||
18 | export CFLAGS='${CFLAGS} -I./ `${STAGING_BINDIR_NATIVE}/pkg-config gtk+-2.0 --cflags`'; " | ||
19 | |||
20 | FILES_${PN} = "${prefix}/games/* ${datadir}/applications/*" | ||
21 | FILES_${PN}-dbg += "${prefix}/games/.debug" | ||
22 | |||
23 | do_install () { | ||
24 | rm -rf ${D}/* | ||
25 | export prefix=${D} | ||
26 | export DESTDIR=${D} | ||
27 | install -d ${D}/${prefix}/ | ||
28 | install -d ${D}/${prefix}/games/ | ||
29 | oe_runmake install | ||
30 | |||
31 | install -d ${D}/${datadir}/ | ||
32 | install -d ${D}/${datadir}/applications/ | ||
33 | |||
34 | cd ${D}/${prefix}/games | ||
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] | ||
42 | Name=$title | ||
43 | Exec=${prefix}/games/$prog | ||
44 | Icon=applications-games | ||
45 | Terminal=false | ||
46 | Type=Application | ||
47 | Categories=Game; | ||
48 | StartupNotify=true | ||
49 | X-MB-SingleInstance=true | ||
50 | STOP | ||
51 | fi | ||
52 | done | ||
53 | } | ||