Merge lp:~hasselmm/appmenu-gtk/gtk3 into lp:appmenu-gtk/0.4

Proposed by Mathias Hasselmann
Status: Merged
Approved by: Michael Terry
Approved revision: 140
Merged at revision: 135
Proposed branch: lp:~hasselmm/appmenu-gtk/gtk3
Merge into: lp:appmenu-gtk/0.4
Diff against target: 154 lines (+43/-17)
5 files modified
80appmenu.in (+1/-1)
Makefile.am (+5/-5)
configure.ac (+27/-6)
src/Makefile.am (+4/-5)
src/bridge.c (+6/-0)
To merge this branch: bzr merge lp:~hasselmm/appmenu-gtk/gtk3
Reviewer Review Type Date Requested Status
Michael Terry Approve
Mathias Hasselmann (community) Needs Resubmitting
Review via email: mp+60326@code.launchpad.net

This proposal supersedes a proposal from 2011-05-08.

Description of the change

This permits building of a gtk3 version of appmenu-gtk.

To post a comment you must log in.
lp:~hasselmm/appmenu-gtk/gtk3 updated
137. By Mathias Hasselmann

Generate proper X session script for both gtk flavors

Revision history for this message
Mathias Hasselmann (hasselmm) wrote :
Revision history for this message
Mathias Hasselmann (hasselmm) wrote :
Revision history for this message
Michael Terry (mterry) wrote :

Looks great. I have two comments:

1) Do we really need --with-gtk3? Seems like --with-gtk2 is enough.

2) You need to add the following in src/bridge.c:

+#if GTK_CHECK_VERSION(3, 0, 0)
+#include <libdbusmenu-gtk3/menuitem.h>
+#include <libdbusmenu-gtk3/parser.h>
+#else
 #include <libdbusmenu-gtk/menuitem.h>
 #include <libdbusmenu-gtk/parser.h>
+#endif

Unfortunately (and this is my fault), the headers use different directories for gtk2/gtk3.

review: Needs Fixing
lp:~hasselmm/appmenu-gtk/gtk3 updated
138. By Mathias Hasselmann

Include proper appmenu-gtk headers.

139. By Mathias Hasselmann

Drop somewhat redundant --with-gtk3 switch.

140. By Mathias Hasselmann

Bump package version

Revision history for this message
Mathias Hasselmann (hasselmm) wrote :

> 1) Do we really need --with-gtk3? Seems like --with-gtk2 is enough.

Dropped.

> 2) You need to add the following in src/bridge.c:

Fixed.

> Unfortunately (and this is my fault), the headers use different directories
> for gtk2/gtk3.

Maybe still can be fixed somehow? The files in that folders seem to be identical.

Revision history for this message
Mathias Hasselmann (hasselmm) :
review: Needs Resubmitting
Revision history for this message
Michael Terry (mterry) wrote :

Looks great! Thanks!

> Maybe still can be fixed somehow? The files in that folders seem to be identical.

A) Can't guarantee that there will never be differences in gtk2/gtk3 versions, though seems more on the 0.1% chance side.

B) We need both libdbusmenu-gtk3-dev and libdbusmenu-gtk-dev to ship the headers so that a package can depend on either one and not get both. So we have to ship two copies of them anyway (or split the headers into some -dev-common package).

C) The normal way of dealing with it is like so:

#include <libdbusmenu-gtk/header.h>
/usr/include/dbusmenu/libdbusmenu-gtk/header.h
/usr/include/dbusmenu3/libdbusmenu-gtk/header.h
And have the .pc file specify which directory to -I

But with libdbusmenu, it sticks libdbusmenu-glib in the same directory with libdbusmenu-gtk, so we either had to duplicate the -glib headers or stick gtk3 headers in the same directory too. I went with the latter, but I'm not convinced it was optimal. :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '80appmenu.in'
--- 80appmenu.in 2011-02-14 15:02:09 +0000
+++ 80appmenu.in 2011-05-11 19:06:46 +0000
@@ -1,4 +1,4 @@
1if [ -f @libdir@/gtk-2.0/2.10.0/menuproxies/libappmenu.so ]1if [ -f @moduledir@/menuproxies/libappmenu.so ]
2then2then
3 export UBUNTU_MENUPROXY="libappmenu.so"3 export UBUNTU_MENUPROXY="libappmenu.so"
4fi4fi
55
=== modified file 'Makefile.am'
--- Makefile.am 2011-02-16 22:06:10 +0000
+++ Makefile.am 2011-05-11 19:06:46 +0000
@@ -8,17 +8,17 @@
8 build \8 build \
9 src9 src
1010
1180appmenu: 80appmenu.in11$(sessionfile): 80appmenu.in
12 sed -e "s|\@libdir\@|$(libdir)|" $< > $@12 sed -e "s|\@moduledir\@|$(moduledir)|" $< > $@
1313
14xsessiondir = $(sysconfdir)/X11/Xsession.d14xsessiondir = $(sysconfdir)/X11/Xsession.d
1515
16nodist_xsession_DATA = 80appmenu16nodist_xsession_DATA = $(sessionfile)
1717
18EXTRA_DIST = $(xsession_DATA) \18EXTRA_DIST = $(xsession_DATA) \
19 configure.ac \19 configure.ac \
20 Makefile.am \20 Makefile.am \
21 autogen.sh \21 autogen.sh \
22 80appmenu.in22 80appmenu.in
2323
24DISTCLEANFILES = 80appmenu24DISTCLEANFILES = $(sessionfile)
2525
=== modified file 'configure.ac'
--- configure.ac 2011-04-14 20:57:14 +0000
+++ configure.ac 2011-05-11 19:06:46 +0000
@@ -1,6 +1,6 @@
1AC_PREREQ(2.59)1AC_PREREQ(2.59)
22
3AC_INIT([appmenu-gtk], [0.2.1], [crussell@canonical.com])3AC_INIT([appmenu-gtk], [0.3.0], [crussell@canonical.com])
4AC_COPYRIGHT([Copyright 2010 Canonical])4AC_COPYRIGHT([Copyright 2010 Canonical])
5AC_CONFIG_SRCDIR([src/bridge.c])5AC_CONFIG_SRCDIR([src/bridge.c])
6AC_CONFIG_MACRO_DIR([build/autotools])6AC_CONFIG_MACRO_DIR([build/autotools])
@@ -15,24 +15,44 @@
15AM_PROG_CC_C_O15AM_PROG_CC_C_O
16AC_STDC_HEADERS16AC_STDC_HEADERS
17AC_PROG_LIBTOOL17AC_PROG_LIBTOOL
18PKG_PROG_PKG_CONFIG
1819
19AC_SUBST(VERSION)20AC_SUBST(VERSION)
2021
21m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])22m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
2223
23###########################24###########################
24# Dependencies - GLib25# Dependencies - Gtk
25###########################26###########################
2627
27GTK_REQUIRED_VERSION=2.1828gtk_api=3.0
29
30GTK2_REQUIRED_VERSION=2.18
31GTK3_REQUIRED_VERSION=3.0
28DBUSMENU_REQUIRED_VERSION=0.3.10132DBUSMENU_REQUIRED_VERSION=0.3.101
2933
30PKG_CHECK_MODULES(APPMENU, gtk+-2.0 >= $GTK_REQUIRED_VERSION34AC_ARG_WITH(gtk2, [AS_HELP_STRING([--with-gtk2],[use 2.0 API of GTK+])],[gtk_api=2.0])
31 dbusmenu-gtk-0.4 >= $DBUSMENU_REQUIRED_VERSION)35
36if test x$gtk_api = x2.0; then
37 PKG_CHECK_MODULES(APPMENU, gtk+-2.0 >= $GTK2_REQUIRED_VERSION
38 dbusmenu-gtk-0.4 >= $DBUSMENU_REQUIRED_VERSION)
39 moduledir='$(libdir)/gtk-2.0/2.10.0/menuproxies'
40 sessionfile=80appmenu-gtk
41elif test x$gtk_api = x3.0; then
42 PKG_CHECK_MODULES(APPMENU, gtk+-3.0 >= $GTK3_REQUIRED_VERSION
43 dbusmenu-gtk3-0.4 >= $DBUSMENU_REQUIRED_VERSION)
44 moduledir='$(libdir)/gtk-3.0/3.0.0/menuproxies'
45 sessionfile=80appmenu-gtk3
46else
47 AC_MSG_ERROR([unknown GTK+ API: $gtk_api])
48fi
3249
33AC_SUBST(APPMENU_CFLAGS)50AC_SUBST(APPMENU_CFLAGS)
34AC_SUBST(APPMENU_LIBS)51AC_SUBST(APPMENU_LIBS)
3552
53AC_SUBST(moduledir)
54AC_SUBST(sessionfile)
55
36###########################56###########################
37# Files57# Files
38###########################58###########################
@@ -58,6 +78,7 @@
5878
59appmenu-gtk configuration:79appmenu-gtk configuration:
6080
61 Prefix: $prefix81 Prefix: $prefix
82 GTK+ API: $gtk_api
62])83])
6384
6485
=== modified file 'src/Makefile.am'
--- src/Makefile.am 2011-01-04 22:54:15 +0000
+++ src/Makefile.am 2011-05-11 19:06:46 +0000
@@ -3,7 +3,6 @@
3BUILT_SOURCES =3BUILT_SOURCES =
4EXTRA_DIST=4EXTRA_DIST=
55
6moduledir = $(libdir)/gtk-2.0/2.10.0/menuproxies
7module_LTLIBRARIES = libappmenu.la6module_LTLIBRARIES = libappmenu.la
87
9libappmenu_la_SOURCES = \8libappmenu_la_SOURCES = \
@@ -37,13 +36,13 @@
37 $(GCC_FLAGS) \36 $(GCC_FLAGS) \
38 $(MAINTAINER_CFLAGS)37 $(MAINTAINER_CFLAGS)
3938
40gen-%.xml.h: %.xml39gen-%.xml.h: $(srcdir)/%.xml
41 @echo "Building $@ from $<"40 @echo "Building $@ from $<"
42 @echo "extern const char * _$(subst -,_,$(subst .,_,$(basename $<)));" > $@41 @echo "extern const char * _$(subst -,_,$(subst .,_,$(basename $(notdir $<))));" > $@
4342
44gen-%.xml.c: %.xml43gen-%.xml.c: $(srcdir)/%.xml
45 @echo "Building $@ from $<"44 @echo "Building $@ from $<"
46 @echo "const char * _$(subst -,_,$(subst .,_,$(basename $<))) = " > $@45 @echo "const char * _$(subst -,_,$(subst .,_,$(basename $(notdir $<)))) = " > $@
47 @sed -e "s:\":\\\\\":g" -e s:^:\": -e s:\$$:\\\\n\": $< >> $@46 @sed -e "s:\":\\\\\":g" -e s:^:\": -e s:\$$:\\\\n\": $< >> $@
48 @echo ";" >> $@47 @echo ";" >> $@
4948
5049
=== modified file 'src/bridge.c'
--- src/bridge.c 2011-04-20 19:18:42 +0000
+++ src/bridge.c 2011-05-11 19:06:46 +0000
@@ -27,8 +27,14 @@
27#include <gdk/gdkx.h>27#include <gdk/gdkx.h>
28#include <gio/gio.h>28#include <gio/gio.h>
2929
30#if GTK_CHECK_VERSION(3, 0, 0)
31#include <libdbusmenu-gtk3/menuitem.h>
32#include <libdbusmenu-gtk3/parser.h>
33#else
30#include <libdbusmenu-gtk/menuitem.h>34#include <libdbusmenu-gtk/menuitem.h>
31#include <libdbusmenu-gtk/parser.h>35#include <libdbusmenu-gtk/parser.h>
36#endif
37
32#include <libdbusmenu-glib/menuitem.h>38#include <libdbusmenu-glib/menuitem.h>
33#include <libdbusmenu-glib/server.h>39#include <libdbusmenu-glib/server.h>
3440

Subscribers

People subscribed via source and target branches