forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
caja-extensions-1.8.0-sendto-options.patch
316 lines (295 loc) · 12.3 KB
/
caja-extensions-1.8.0-sendto-options.patch
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
diff --git a/configure.ac b/configure.ac
index fcf02d6..c38061f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -102,19 +102,173 @@ if test "x$enable_sendto" = "xyes"; then
GUPNP_REQUIRED=0.13
PKG_CHECK_MODULES(SENDTO,
glib-2.0 >= $GLIB_REQUIRED
- gio-2.0 >= $GLIB_REQUIRED
gthread-2.0 >= $GTHREAD_REQUIRED
gmodule-2.0 >= $GLIB_REQUIRED
gobject-2.0 >= $GLIB_REQUIRED
- gtk+-$GTK_API_VERSION >= $GTK_REQUIRED
- dbus-1 >= $DBUS_REQUIRED
- dbus-glib-1 >= $DBUS_GLIB_REQUIRED
- gupnp-1.0 >= $GUPNP_REQUIRED)
+ gtk+-$GTK_API_VERSION >= $GTK_REQUIRED)
AC_SUBST(SENDTO_CFLAGS)
AC_SUBST(SENDTO_LIBS)
- AC_DEFINE_UNQUOTED(GAJIM_SHARE_DIR, "$prefix/share/gajim", [path to gajim share dir])
-fi
+ # The full list of plugins
+ allowed_sendto_plugins="emailclient gajim caja-burn pidgin removable-devices upnp"
+
+ sendto_plugin_error_or_ignore()
+ {
+ if test "${error_on_bad_sendto_plugin}" = "1" ; then
+ AC_MSG_ERROR([$1])
+ else
+ AC_MSG_WARN([$1 (disabling sendto plugin)])
+ fi
+ }
+
+ AC_ARG_WITH([sendto-plugins],
+ [AS_HELP_STRING([--with-sendto-plugins],[Which caja-sendto plugins to compile (default: auto; "all", "autodetect" are valid)])],
+ [], [with_sendto_plugins=autodetect])
+
+ used_sendto_plugins=""
+ used_sendto_plugins2=""
+
+ if test "x${with_sendto_plugins}" = "xautodetect" ; then
+ # Default to all plugins and just ignore them if they won't compile
+ with_sendto_plugins="all"
+ error_on_bad_sendto_plugin="0"
+ else
+ # Clean up the plugin list and error if a plugin won't compile
+ with_sendto_plugins=`echo ,"${with_sendto_plugins}", | sed -e 's/[[ ,]][[ ,]]*/ /g' -e 's/,$//'`
+ error_on_bad_sendto_plugin="1"
+ fi
+
+ # Iterate through the wanted plugins and weed out bad ones (or error)
+ for wanted_sendto_plugin in ${with_sendto_plugins}; do
+ for allowed_sendto_plugin in ${allowed_sendto_plugins}; do
+ case ${wanted_sendto_plugin} in
+ all)
+ # List all plugins as being used
+ used_sendto_plugins=${allowed_sendto_plugins}
+ ;;
+ autodetect)
+ # List all plugins as being used
+ used_sendto_plugins=${allowed_sendto_plugins}
+ ;;
+ ${allowed_sendto_plugin}) used_sendto_plugins="${used_sendto_plugins} ${wanted_sendto_plugin}";; # List the plugin
+ *) ;;
+ esac
+ done
+ done
+
+ # Check for plugin-specific requirements and error if necessary
+ for sendto_plugin in ${used_sendto_plugins}; do
+ add_sendto_plugin="1"
+
+ case ${sendto_plugin} in
+ emailclient)
+ PKG_CHECK_MODULES(EMAILCLIENT, gio-2.0,
+ enable_emailclient=yes, enable_emailclient=no)
+ if test "${enable_emailclient}" != "yes" ; then
+ sendto_plugin_error_or_ignore "you need gio-2.0 to build the emailclient plugin"
+ add_sendto_plugin="0"
+ fi
+ ;;
+ gajim)
+ AC_ARG_WITH(sendto_gajim,
+ [AS_HELP_STRING(--with-sendto-gajim,[Path to Gajim install prefix])],
+ [GAJIM_PATH="$withval"],[GAJIM_PATH="$prefix"])
+
+ GAJIM_SHARE_DIR="$GAJIM_PATH"/share/gajim
+
+ PKG_CHECK_MODULES(DBUS, dbus-1 >= $DBUS_REQUIRED dbus-glib-1 >= $DBUS_GLIB_REQUIRED,
+ [AC_SUBST(DBUS_CFLAGS)
+ AC_SUBST(DBUS_LIBS)
+ enable_sendto_gajim=yes
+ AC_DEFINE_UNQUOTED(GAJIM_SHARE_DIR, "$GAJIM_SHARE_DIR", [path to gajim share dir])],
+ [enable_gajim=no])
+
+ if test "${enable_gajim}" != "yes" ; then
+ sendto_plugin_error_or_ignore "you need gajim and dbus-glib installed for the gajim plugin"
+ add_sendto_plugin="0"
+ fi
+ ;;
+ caja-burn)
+ PKG_CHECK_MODULES(GIO, gio-2.0,
+ enable_burn=yes, enable_burn=no)
+ if test "${enable_burn}" != "yes" ; then
+ sendto_plugin_error_or_ignore "you need gio installed for the caja-burn plugin"
+ add_sendto_plugin="0"
+ fi
+ ;;
+ pidgin)
+ PKG_CHECK_MODULES(PIDGIN, dbus-glib-1 >= $DBUS_GLIB_REQUIRED,
+ enable_pidgin=yes, enable_pidgin=no)
+ if test "${enable_pidgin}" != "yes" ; then
+ sendto_plugin_error_or_ignore "you need dbus-glib to build the pidgin plugin"
+ add_sendto_plugin="0"
+ fi
+ ;;
+ removable-devices)
+ PKG_CHECK_MODULES(GIO, gio-2.0,
+ enable_removable=yes, enable_removable=no)
+ if test "${enable_removable}" != "yes" ; then
+ sendto_plugin_error_or_ignore "you need gio-2.0 to build the removable-devices plugin"
+ add_sendto_plugin="0"
+ fi
+ ;;
+ upnp)
+ PKG_CHECK_MODULES(UPNP, gupnp-1.0 >= $GUPNP_REQUIRED,
+ enable_upnp=yes, enable_upnp=no)
+ if test "${enable_upnp}" != "yes" ; then
+ sendto_plugin_error_or_ignore "you need gupnp installed for the upnp plugin"
+ add_sendto_plugin="0"
+ fi
+ ;;
+ esac
+
+ # Add the specified plugin
+ if test "${add_sendto_plugin}" = "1" ; then
+ used_sendto_plugins2="${used_sendto_plugins2} ${sendto_plugin}"
+ fi
+ done
+
+ ALL_SENDTO_PLUGINS=$allowed_sendto_plugins
+ SENDTO_PLUGINS=$used_sendto_plugins2
+
+ dnl Error out if no plugins will be built
+ if test -z "${SENDTO_PLUGINS}" ; then
+ AC_MSG_ERROR([No sendto plugins will be built, and caja-sendto requires at least one])
+ fi
+
+ AC_MSG_CHECKING([which sendto plugins to compile])
+ AC_MSG_RESULT([$SENDTO_PLUGINS])
+
+ AC_SUBST([ALL_SENDTO_PLUGINS])
+ AC_SUBST([SENDTO_PLUGINS])
+
+ dnl For the pidgin sendto plugin
+ AM_CONDITIONAL(HAVE_SENDTO_PIDGIN, test "x$enable_pidgin" = "xyes")
+
+ dnl For the GIO based plugins
+ enable_nst_common=no
+ if test "x$enable_burn" = "xyes" -o "x$enable_removable" = "xyes"; then
+ enable_nst_common=yes
+ fi
+ AM_CONDITIONAL(HAVE_GIO, test "x$enable_nst_common" = "xyes")
+
+ if test "x${SENDTO_PLUGINS}" != "x" ; then
+ for allowed_sendto_plugin in ${ALL_SENDTO_PLUGINS}; do
+ for sendto_plugin in ${SENDTO_PLUGINS}; do
+ case ${allowed_sendto_plugin} in
+ ${sendto_plugin})
+ AC_MSG_NOTICE([** ${allowed_sendto_plugin} sendto plugin enabled])
+ continue 2
+ ;;
+ *);;
+ esac
+ done
+ AC_MSG_NOTICE([ ${allowed_sendto_plugin} sendto plugin disabled])
+ done
+ else
+ AC_MSG_NOTICE([ No caja-sendto plugins enabled])
+ fi
+fi
AM_CONDITIONAL(ENABLE_SENDTO, test x"$enable_sendto" = "xyes")
# share extension
diff --git a/sendto/plugins/Makefile.am b/sendto/plugins/Makefile.am
index 10097e8..6d17c98 100644
--- a/sendto/plugins/Makefile.am
+++ b/sendto/plugins/Makefile.am
@@ -1,16 +1,13 @@
-SUBDIRS = . \
- caja-burn \
- emailclient \
- gajim \
- pidgin \
- removable-devices \
- upnp
+SUBDIRS = . $(SENDTO_PLUGINS)
+DIST_SUBDIRS = $(ALL_SENDTO_PLUGINS)
NST_COMMON_SOURCES = nst-common.c nst-common.h
+if HAVE_GIO
noinst_LTLIBRARIES = libnstcommon.la
libnstcommon_la_SOURCES = $(NST_COMMON_SOURCES)
libnstcommon_la_CFLAGS = $(SENDTO_CFLAGS)
libnstcommon_la_LIBADD = $(SENDTO_LIBS)
+endif
EXTRA_DIST = $(NST_COMMON_SOURCES)
diff --git a/sendto/plugins/caja-burn/Makefile.am b/sendto/plugins/caja-burn/Makefile.am
index 50c309b..00f95c2 100644
--- a/sendto/plugins/caja-burn/Makefile.am
+++ b/sendto/plugins/caja-burn/Makefile.am
@@ -9,11 +9,12 @@ AM_CPPFLAGS = \
-I$(srcdir)/../ \
$(SENDTO_CFLAGS) \
$(WARN_CFLAGS) \
- $(DISABLE_DEPRECATED)
+ $(DISABLE_DEPRECATED) \
+ $(GIO_CFLAGS)
plugin_LTLIBRARIES = libnstburn.la
libnstburn_la_SOURCES = caja-burn.c
libnstburn_la_LDFLAGS = -module -avoid-version
-libnstburn_la_LIBADD = $(SENDTO_LIBS) $(builddir)/../libnstcommon.la
+libnstburn_la_LIBADD = $(GIO_LIBS) $(SENDTO_LIBS) $(builddir)/../libnstcommon.la
diff --git a/sendto/plugins/emailclient/Makefile.am b/sendto/plugins/emailclient/Makefile.am
index 31ba40e..c4af752 100644
--- a/sendto/plugins/emailclient/Makefile.am
+++ b/sendto/plugins/emailclient/Makefile.am
@@ -7,6 +7,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/sendto \
-I$(top_builddir) \
$(SENDTO_CFLAGS) \
+ $(EMAILCLIENT_CFLAGS) \
$(DISABLE_DEPRECATED) \
$(WARN_CFLAGS)
@@ -14,4 +15,4 @@ plugin_LTLIBRARIES = libnstemailclient.la
libnstemailclient_la_SOURCES = emailclient.c
libnstemailclient_la_LDFLAGS = -module -avoid-version
-libnstemailclient_la_LIBADD = $(SENDTO_LIBS)
+libnstemailclient_la_LIBADD = $(SENDTO_LIBS) $(EMAILCLIENT_LIBS)
diff --git a/sendto/plugins/gajim/Makefile.am b/sendto/plugins/gajim/Makefile.am
index 5acd5b0..c39a3c0 100644
--- a/sendto/plugins/gajim/Makefile.am
+++ b/sendto/plugins/gajim/Makefile.am
@@ -7,6 +7,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/sendto \
-I$(top_builddir) \
$(SENDTO_CFLAGS) \
+ $(DBUS_CFLAGS) \
$(DISABLE_DEPRECATED) \
$(WARN_CFLAGS)
@@ -14,5 +15,5 @@ plugin_LTLIBRARIES = libnstgajim.la
libnstgajim_la_SOURCES = gajim.c
libnstgajim_la_LDFLAGS = -module -avoid-version
-libnstgajim_la_LIBADD = $(SENDTO_LIBS)
+libnstgajim_la_LIBADD = $(DBUS_LIBS) $(SENDTO_LIBS)
diff --git a/sendto/plugins/pidgin/Makefile.am b/sendto/plugins/pidgin/Makefile.am
index b7f650a..bcfe1d3 100644
--- a/sendto/plugins/pidgin/Makefile.am
+++ b/sendto/plugins/pidgin/Makefile.am
@@ -7,6 +7,8 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/sendto \
-I$(top_builddir) \
$(SENDTO_CFLAGS) \
+ $(NST_EBOOK_CFLAGS) \
+ $(PIDGIN_CFLAGS) \
$(DISABLE_DEPRECATED) \
$(WARN_CFLAGS)
@@ -14,5 +16,5 @@ plugin_LTLIBRARIES = libnstpidgin.la
libnstpidgin_la_SOURCES = pidgin.c
libnstpidgin_la_LDFLAGS = -module -avoid-version
-libnstpidgin_la_LIBADD = $(SENDTO_LIBS)
+libnstpidgin_la_LIBADD = $(PIDGIN_LIBS) $(SENDTO_LIBS)
diff --git a/sendto/plugins/removable-devices/Makefile.am b/sendto/plugins/removable-devices/Makefile.am
index 294ca90..797353b 100644
--- a/sendto/plugins/removable-devices/Makefile.am
+++ b/sendto/plugins/removable-devices/Makefile.am
@@ -15,5 +15,5 @@ plugin_LTLIBRARIES = libnstremovable_devices.la
libnstremovable_devices_la_SOURCES = removable-devices.c
libnstremovable_devices_la_LDFLAGS = -module -avoid-version
-libnstremovable_devices_la_LIBADD = $(SENDTO_LIBS) $(builddir)/../libnstcommon.la
+libnstremovable_devices_la_LIBADD = $(GIO_LIBS) $(SENDTO_LIBS) $(builddir)/../libnstcommon.la
diff --git a/sendto/plugins/upnp/Makefile.am b/sendto/plugins/upnp/Makefile.am
index 4127abd..31a8bd6 100644
--- a/sendto/plugins/upnp/Makefile.am
+++ b/sendto/plugins/upnp/Makefile.am
@@ -7,6 +7,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/sendto \
-I$(top_builddir) \
$(SENDTO_CFLAGS) \
+ $(UPNP_CFLAGS) \
$(DISABLE_DEPRECATED) \
$(WARN_CFLAGS)
@@ -14,5 +15,5 @@ plugin_LTLIBRARIES = libnstupnp.la
libnstupnp_la_SOURCES = upnp.c
libnstupnp_la_LDFLAGS = -module -avoid-version
-libnstupnp_la_LIBADD = $(SENDTO_LIBS)
+libnstupnp_la_LIBADD = $(UPNP_LIBS) $(SENDTO_LIBS)