summaryrefslogtreecommitdiff
path: root/dev-libs/libdbusmenu/files/libdbusmenu-0.4.90-optional-gtk.patch
blob: 5a2a35baece167ac64c495a9823f619414359931 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
diff --git a/Makefile.am b/Makefile.am
index c2c0980..2fb4c84 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3,9 +3,13 @@ EXTRA_DIST = \
 	COPYING-GPL3 \
 	m4/introspection.m4
 
+if WANT_LIBDBUSMENUGTK
+LIBDBUSMENUGTK_SUBDIR = libdbusmenu-gtk
+endif
+
 SUBDIRS = \
 	libdbusmenu-glib \
-	libdbusmenu-gtk \
+	$(LIBDBUSMENUGTK_SUBDIR) \
 	tools \
 	tests \
 	docs \
diff --git a/configure.ac b/configure.ac
index 465d8bf..47ea915 100644
--- a/configure.ac
+++ b/configure.ac
@@ -58,27 +58,37 @@ AC_SUBST(DBUSMENUGLIB_LIBS)
 GTK_REQUIRED_VERSION=2.16
 GTK3_REQUIRED_VERSION=2.91
 
+AC_ARG_ENABLE([gtk],
+	AC_HELP_STRING([--disable-gtk], [Disable libdbusmenu-gtk library]),
+	[enable_gtk=$enableval], [enable_gtk=auto])
+AM_CONDITIONAL([WANT_LIBDBUSMENUGTK], [test "x$enable_gtk" != "xno"])
+
 AC_ARG_WITH([gtk],
   [AS_HELP_STRING([--with-gtk],
     [Which version of gtk to use @<:@default=2@:>@])],
   [],
   [with_gtk=3])
+AM_CONDITIONAL([USE_GTK3], [test "x$with_gtk" = "x3"])
+
+AS_IF([test "x$enable_gtk" != "xno"],[
 AS_IF([test "x$with_gtk" = x3],
         [PKG_CHECK_MODULES(DBUSMENUGTK,  gtk+-3.0 >= $GTK3_REQUIRED_VERSION
-                                         glib-2.0 >= $GLIB_REQUIRED_VERSION)
-         AC_SUBST(DBUSMENUGTK_CFLAGS)
-         AC_SUBST(DBUSMENUGTK_LIBS)
+                                         glib-2.0 >= $GLIB_REQUIRED_VERSION,
+                                         [have_gtk=yes]
+)
          AC_DEFINE(HAVE_GTK3, 1, [whether gtk3 is available])
         ],
       [test "x$with_gtk" = x2],
         [PKG_CHECK_MODULES(DBUSMENUGTK,  gtk+-2.0 >= $GTK_REQUIRED_VERSION
-                                         glib-2.0 >= $GLIB_REQUIRED_VERSION)
-         AC_SUBST(DBUSMENUGTK_CFLAGS)
-         AC_SUBST(DBUSMENUGTK_LIBS)
+                                         glib-2.0 >= $GLIB_REQUIRED_VERSION,
+                                         [have_gtk=yes]
+)
         ],
       [AC_MSG_FAILURE([Value for --with-gtk was neither 2 nor 3])]
 )
-AM_CONDITIONAL(USE_GTK3, [test "x$with_gtk" = x3])
+])
+AC_SUBST(DBUSMENUGTK_CFLAGS)
+AC_SUBST(DBUSMENUGTK_LIBS)
 
 ###########################
 # Dependencies - dumper
@@ -199,3 +209,8 @@ libdbusmenu Configuration:
 	GTK+ Version:           $with_gtk
 ])
 
+AS_IF([test "x$enable_gtk" = "xyes"],
+	AC_MSG_NOTICE([	Gtk:                    yes (gtk$with_gtk)]),
+	AC_MSG_NOTICE([	Gtk:                    no])
+)
+
diff --git a/tests/Makefile.am b/tests/Makefile.am
index a4763da..e6882af 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -13,13 +13,17 @@ TESTS = \
 	test-glib-proxy \
 	test-glib-simple-items \
 	test-glib-submenu \
-	test-json \
+	test-json
+
+if WANT_LIBDBUSMENUGTK
+TESTS += \
 	test-gtk-objects-test \
 	test-gtk-label \
 	test-gtk-shortcut \
 	test-gtk-reorder \
 	test-gtk-submenu \
 	test-gtk-parser-test
+endif
 
 XFAIL_TESTS = \
 	test-glib-proxy
@@ -44,20 +48,24 @@ check_PROGRAMS = \
 	test-glib-proxy-client \
 	test-glib-proxy-server \
 	test-glib-proxy-proxy \
-	test-gtk-objects \
 	test-glib-submenu-client \
 	test-glib-submenu-server \
+	test-glib-simple-items \
+	test-json-client \
+	test-json-server
+
+if WANT_LIBDBUSMENUGTK
+check_PROGRAMS += \
+	test-gtk-objects \
 	test-gtk-label-client \
 	test-gtk-label-server \
 	test-gtk-shortcut-client \
 	test-gtk-shortcut-server \
-	test-glib-simple-items \
 	test-gtk-reorder-server \
-	test-json-client \
-	test-json-server \
 	test-gtk-submenu-server \
 	test-gtk-submenu-client \
 	test-gtk-parser
+endif
 
 XVFB_RUN=". $(srcdir)/run-xvfb.sh"