[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r35843 - in gnunet-gtk: . src/fs src/identity src/include
From: |
gnunet |
Subject: |
[GNUnet-SVN] r35843 - in gnunet-gtk: . src/fs src/identity src/include |
Date: |
Sat, 30 May 2015 20:35:07 +0200 |
Author: grothoff
Date: 2015-05-30 20:35:07 +0200 (Sat, 30 May 2015)
New Revision: 35843
Modified:
gnunet-gtk/configure.ac
gnunet-gtk/src/fs/gnunet-fs-gtk.h
gnunet-gtk/src/fs/gnunet-fs-gtk_common.c
gnunet-gtk/src/fs/gnunet-fs-gtk_common.h
gnunet-gtk/src/fs/gnunet-fs-gtk_event-handler.c
gnunet-gtk/src/fs/gnunet-fs-gtk_publish-edit-dialog.c
gnunet-gtk/src/fs/metatypes.c
gnunet-gtk/src/identity/gnunet-identity-gtk_advertise.c
gnunet-gtk/src/include/gnunet_gtk.h
Log:
make libextractor actually optional, both for GNUnet and GNUnet-taler builds
Modified: gnunet-gtk/configure.ac
===================================================================
--- gnunet-gtk/configure.ac 2015-05-30 18:35:02 UTC (rev 35842)
+++ gnunet-gtk/configure.ac 2015-05-30 18:35:07 UTC (rev 35843)
@@ -164,29 +164,45 @@
])
AC_SUBST(GNUNET_CONVERSATION_APP)
+
# test for libextractor
extractor=0
AC_MSG_CHECKING(for libextractor)
AC_ARG_WITH(extractor,
- [ --with-extractor=PFX Base of libextractor installation],
+ [ --with-extractor=PFX base of libextractor installation],
[AC_MSG_RESULT([$with_extractor])
case $with_extractor in
no)
;;
yes)
- AC_CHECK_HEADERS(extractor.h,extractor=1)
+ AC_CHECK_HEADERS(extractor.h,
+ AC_CHECK_LIB([extractor], [EXTRACTOR_plugin_add_defaults],
+ extractor=1))
;;
*)
+ LDFLAGS="-L$with_extractor/lib $LDFLAGS"
CPPFLAGS="-I$with_extractor/include $CPPFLAGS"
- AC_CHECK_HEADERS(extractor.h,extractor=1)
+ AC_CHECK_HEADERS(extractor.h,
+ AC_CHECK_LIB([extractor], [EXTRACTOR_plugin_add_defaults],
+ EXT_LIB_PATH="-L$with_extractor/lib $EXT_LIB_PATH"
+ extractor=1))
;;
esac
],
[AC_MSG_RESULT([--with-extractor not specified])
- AC_CHECK_HEADERS(extractor.h,extractor=1)])
+ AC_CHECK_HEADERS(extractor.h,
+ AC_CHECK_LIB([extractor], [EXTRACTOR_plugin_add_defaults],
+ extractor=1))])
+# restore LIBS
+LIBS=$SAVE_LIBS
+
if test "$extractor" != 1
then
- AC_MSG_ERROR([gnunet-gtk requires libextractor headers])
+ AM_CONDITIONAL(HAVE_LIBEXTRACTOR, false)
+ AC_DEFINE([HAVE_LIBEXTRACTOR],[0],[Lacking libextractor])
+else
+ AM_CONDITIONAL(HAVE_LIBEXTRACTOR, true)
+ AC_DEFINE([HAVE_LIBEXTRACTOR],[1],[Have libextractor])
fi
Modified: gnunet-gtk/src/fs/gnunet-fs-gtk.h
===================================================================
--- gnunet-gtk/src/fs/gnunet-fs-gtk.h 2015-05-30 18:35:02 UTC (rev 35842)
+++ gnunet-gtk/src/fs/gnunet-fs-gtk.h 2015-05-30 18:35:07 UTC (rev 35843)
@@ -31,7 +31,9 @@
#include <gnunet/gnunet_gns_service.h>
#include <gnunet/gnunet_identity_service.h>
#include <gnunet/gnunet_namestore_service.h>
+#if HAVE_EXTRACTOR_H
#include <extractor.h>
+#endif
/**
Modified: gnunet-gtk/src/fs/gnunet-fs-gtk_common.c
===================================================================
--- gnunet-gtk/src/fs/gnunet-fs-gtk_common.c 2015-05-30 18:35:02 UTC (rev
35842)
+++ gnunet-gtk/src/fs/gnunet-fs-gtk_common.c 2015-05-30 18:35:07 UTC (rev
35843)
@@ -112,8 +112,10 @@
type,
GNUNET_GTK_FS_MAIN_WINDOW_META_DATA_MC_META_FORMAT,
format,
+#if HAVE_EXTRACTOR
GNUNET_GTK_FS_MAIN_WINDOW_META_DATA_MC_META_TYPE_STRING,
EXTRACTOR_metatype_to_string (type),
+#endif
GNUNET_GTK_FS_MAIN_WINDOW_META_DATA_MC_META_VALUE,
data_to_insert,
-1);
@@ -237,7 +239,6 @@
EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME,
EXTRACTOR_METATYPE_FILENAME,
EXTRACTOR_METATYPE_DESCRIPTION,
-
EXTRACTOR_METATYPE_SUMMARY,
EXTRACTOR_METATYPE_ALBUM,
EXTRACTOR_METATYPE_COMMENT,
EXTRACTOR_METATYPE_SUBJECT,
Modified: gnunet-gtk/src/fs/gnunet-fs-gtk_common.h
===================================================================
--- gnunet-gtk/src/fs/gnunet-fs-gtk_common.h 2015-05-30 18:35:02 UTC (rev
35842)
+++ gnunet-gtk/src/fs/gnunet-fs-gtk_common.h 2015-05-30 18:35:07 UTC (rev
35843)
@@ -28,7 +28,9 @@
#include "gnunet_gtk.h"
#include <gnunet/gnunet_fs_service.h>
+#if HAVE_EXTRACTOR_H
#include <extractor.h>
+#endif
/**
Modified: gnunet-gtk/src/fs/gnunet-fs-gtk_event-handler.c
===================================================================
--- gnunet-gtk/src/fs/gnunet-fs-gtk_event-handler.c 2015-05-30 18:35:02 UTC
(rev 35842)
+++ gnunet-gtk/src/fs/gnunet-fs-gtk_event-handler.c 2015-05-30 18:35:07 UTC
(rev 35843)
@@ -2096,7 +2096,9 @@
{
return GNUNET_CONTAINER_meta_data_get_first_by_types (meta,
EXTRACTOR_METATYPE_MIMETYPE,
+#if HAVE_EXTRACTOR_H
EXTRACTOR_METATYPE_FORMAT,
+#endif
-1);
}
Modified: gnunet-gtk/src/fs/gnunet-fs-gtk_publish-edit-dialog.c
===================================================================
--- gnunet-gtk/src/fs/gnunet-fs-gtk_publish-edit-dialog.c 2015-05-30
18:35:02 UTC (rev 35842)
+++ gnunet-gtk/src/fs/gnunet-fs-gtk_publish-edit-dialog.c 2015-05-30
18:35:07 UTC (rev 35843)
@@ -293,9 +293,11 @@
change_metatypes (struct EditPublicationDialogContext *ctx, gint code)
{
gint pubtype_count;
+#if HAVE_EXTRACTOR
gint max_type;
gint i;
GtkTreeIter iter;
+#endif
/* double-check that 'code' is valid */
for (pubtype_count = 0; NULL != types[pubtype_count]; pubtype_count++) ;
@@ -303,6 +305,7 @@
/* clear existing selection of metatypes */
gtk_list_store_clear (ctx->metatypes_liststore);
+#if HAVE_EXTRACTOR
max_type = EXTRACTOR_metatype_get_max ();
/* add new types based on selection */
for (i = 0; types[code][i] != EXTRACTOR_METATYPE_RESERVED; i++)
@@ -320,6 +323,7 @@
EXTRACTOR_metatype_to_description
(types[code][i]),
-1);
+#endif
}
@@ -403,10 +407,12 @@
gtk_list_store_set (ctx->meta_liststore, &iter,
PUBLISH_METADATA_MC_TYPE, type_id,
PUBLISH_METADATA_MC_FORMAT, EXTRACTOR_METAFORMAT_UTF8,
+#if HAVE_EXTRACTOR
PUBLISH_METADATA_MC_TYPE_NAME,
EXTRACTOR_metatype_to_string (type_id),
PUBLISH_METADATA_MC_DESCRIPTION,
EXTRACTOR_metatype_to_description (type_id),
+#endif
-1);
}
@@ -920,16 +926,26 @@
get_mime_type (const void *data,
gsize data_size)
{
+#if HAVE_EXTRACTOR
char *ret;
struct EXTRACTOR_PluginList *pl;
- pl = EXTRACTOR_plugin_add (NULL, "mime", NULL,
EXTRACTOR_OPTION_DEFAULT_POLICY);
+ pl = EXTRACTOR_plugin_add (NULL,
+ "mime",
+ NULL,
+ EXTRACTOR_OPTION_DEFAULT_POLICY);
if (NULL == pl)
return NULL;
ret = NULL;
- EXTRACTOR_extract (pl, NULL, data, data_size, &le_callback, &ret);
+ EXTRACTOR_extract (pl,
+ NULL,
+ data, data_size,
+ &le_callback, &ret);
EXTRACTOR_plugin_remove_all (pl);
return ret;
+#else
+ return NULL;
+#endif
}
@@ -945,7 +961,7 @@
* @param bo block options (can be modified)
* @param do_index should we index (can be modified)
* @param client_info pointer to client context set upon creation (can be
modified)
- * @return GNUNET_SYSERR (aborts after first call)
+ * @return #GNUNET_SYSERR (aborts after first call)
*/
static int
file_information_update (void *cls, struct GNUNET_FS_FileInformation *fi,
Modified: gnunet-gtk/src/fs/metatypes.c
===================================================================
--- gnunet-gtk/src/fs/metatypes.c 2015-05-30 18:35:02 UTC (rev 35842)
+++ gnunet-gtk/src/fs/metatypes.c 2015-05-30 18:35:07 UTC (rev 35843)
@@ -8,10 +8,12 @@
EXTRACTOR_METATYPE_SUBJECT,
EXTRACTOR_METATYPE_DESCRIPTION,
EXTRACTOR_METATYPE_COMMENT,
+#if HAVE_EXTRACTOR_H
EXTRACTOR_METATYPE_COPYRIGHT,
EXTRACTOR_METATYPE_URI,
EXTRACTOR_METATYPE_CREATOR,
EXTRACTOR_METATYPE_CREATION_DATE,
+#endif
EXTRACTOR_METATYPE_RESERVED
};
@@ -22,6 +24,7 @@
EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME,
EXTRACTOR_METATYPE_TITLE,
EXTRACTOR_METATYPE_KEYWORDS,
+#if HAVE_EXTRACTOR_H
EXTRACTOR_METATYPE_ABSTRACT,
EXTRACTOR_METATYPE_SUMMARY,
EXTRACTOR_METATYPE_SUBJECT,
@@ -58,6 +61,7 @@
EXTRACTOR_METATYPE_TEMPLATE,
EXTRACTOR_METATYPE_REVISION_HISTORY,
EXTRACTOR_METATYPE_REVISION_NUMBER,
+#endif
EXTRACTOR_METATYPE_RESERVED
};
@@ -68,6 +72,7 @@
EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME,
EXTRACTOR_METATYPE_TITLE,
EXTRACTOR_METATYPE_ARTIST,
+#if HAVE_EXTRACTOR_H
EXTRACTOR_METATYPE_COMPOSER,
EXTRACTOR_METATYPE_CONDUCTOR,
EXTRACTOR_METATYPE_ALBUM,
@@ -101,6 +106,7 @@
EXTRACTOR_METATYPE_ORIGINAL_PERFORMER,
EXTRACTOR_METATYPE_MUSICIAN_CREDITS_LIST,
EXTRACTOR_METATYPE_SUBTITLE,
+#endif
EXTRACTOR_METATYPE_RESERVED
};
@@ -110,6 +116,7 @@
EXTRACTOR_METATYPE_MIMETYPE,
EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME,
EXTRACTOR_METATYPE_TITLE,
+#if HAVE_EXTRACTOR_H
EXTRACTOR_METATYPE_GENRE,
EXTRACTOR_METATYPE_KEYWORDS,
EXTRACTOR_METATYPE_SUMMARY,
@@ -133,6 +140,7 @@
EXTRACTOR_METATYPE_LOCATION_COUNTRY_CODE,
EXTRACTOR_METATYPE_CREATION_DATE,
EXTRACTOR_METATYPE_PERFORMER,
+#endif
EXTRACTOR_METATYPE_RESERVED
};
@@ -144,6 +152,7 @@
EXTRACTOR_METATYPE_TITLE,
EXTRACTOR_METATYPE_KEYWORDS,
EXTRACTOR_METATYPE_DESCRIPTION,
+#if HAVE_EXTRACTOR_H
EXTRACTOR_METATYPE_IMAGE_DIMENSIONS,
EXTRACTOR_METATYPE_IMAGE_RESOLUTION,
EXTRACTOR_METATYPE_COMMENT,
@@ -156,6 +165,7 @@
EXTRACTOR_METATYPE_LOCATION_COUNTRY,
EXTRACTOR_METATYPE_LOCATION_COUNTRY_CODE,
EXTRACTOR_METATYPE_ORGANIZATION,
+#endif
EXTRACTOR_METATYPE_RESERVED
};
@@ -167,6 +177,7 @@
EXTRACTOR_METATYPE_COMMENT,
EXTRACTOR_METATYPE_TITLE,
EXTRACTOR_METATYPE_DESCRIPTION,
+#if HAVE_EXTRACTOR_H
EXTRACTOR_METATYPE_COPYRIGHT,
EXTRACTOR_METATYPE_RIGHTS,
EXTRACTOR_METATYPE_KEYWORDS,
@@ -179,6 +190,7 @@
EXTRACTOR_METATYPE_RIPPER,
EXTRACTOR_METATYPE_PRODUCER,
EXTRACTOR_METATYPE_GROUP,
+#endif
EXTRACTOR_METATYPE_RESERVED
};
@@ -188,6 +200,7 @@
EXTRACTOR_METATYPE_MIMETYPE,
EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME,
EXTRACTOR_METATYPE_PACKAGE_NAME,
+#if HAVE_EXTRACTOR_H
EXTRACTOR_METATYPE_PACKAGE_VERSION,
EXTRACTOR_METATYPE_TARGET_ARCHITECTURE,
EXTRACTOR_METATYPE_LICENSE,
@@ -214,6 +227,7 @@
EXTRACTOR_METATYPE_LIBRARY_SEARCH_PATH,
EXTRACTOR_METATYPE_LIBRARY_DEPENDENCY,
EXTRACTOR_METATYPE_UPLOAD_PRIORITY,
+#endif
EXTRACTOR_METATYPE_RESERVED
};
Modified: gnunet-gtk/src/identity/gnunet-identity-gtk_advertise.c
===================================================================
--- gnunet-gtk/src/identity/gnunet-identity-gtk_advertise.c 2015-05-30
18:35:02 UTC (rev 35842)
+++ gnunet-gtk/src/identity/gnunet-identity-gtk_advertise.c 2015-05-30
18:35:07 UTC (rev 35843)
@@ -26,8 +26,10 @@
#include "gnunet-identity-gtk_advertise.h"
#include "gnunet-identity-gtk.h"
#include <gnunet/gnunet_fs_service.h>
+#if HAVE_EXTRACTOR_H
+#include <extractor.h>
+#endif
-
#define NEW_KEYWORD_TEXT "<add>"
@@ -41,10 +43,12 @@
EXTRACTOR_METATYPE_SUBJECT,
EXTRACTOR_METATYPE_DESCRIPTION,
EXTRACTOR_METATYPE_COMMENT,
+ EXTRACTOR_METATYPE_URI,
+#if HAVE_EXTRACTOR_H
EXTRACTOR_METATYPE_COPYRIGHT,
- EXTRACTOR_METATYPE_URI,
EXTRACTOR_METATYPE_CREATOR,
EXTRACTOR_METATYPE_CREATION_DATE,
+#endif
EXTRACTOR_METATYPE_RESERVED
};
@@ -588,7 +592,6 @@
struct AdvertiseContext *ac = user_data;
GtkTreeIter iter;
guint type;
- const char *type_as_string;
const char *value;
GtkEntry *value_entry;
GtkComboBox *type_box;
@@ -605,7 +608,6 @@
&iter,
METATYPES_MC_TYPE_AS_ENUM, &type,
-1);
- type_as_string = EXTRACTOR_metatype_to_string (type);
value_entry = GTK_ENTRY (gtk_builder_get_object (ac->builder,
"GNUNET_GTK_identity_advertise_metadata_value_entry"));
value = gtk_entry_get_text (value_entry);
@@ -618,7 +620,9 @@
gtk_list_store_insert_with_values (ac->metadata,
&iter, 0,
METADATA_MC_TYPE_AS_ENUM, type,
- METADATA_MC_TYPE_AS_STRING,
type_as_string,
+#if HAVE_EXTRACTOR
+ METADATA_MC_TYPE_AS_STRING,
EXTRACTOR_metatype_to_string (type),
+#endif
METADATA_MC_VALUE, value,
-1);
gtk_entry_set_text (value_entry, "");
@@ -661,10 +665,10 @@
{
gtk_list_store_insert_with_values (ac->meta_types,
&iter, G_MAXINT,
- METATYPES_MC_TYPE_AS_STRING,
- EXTRACTOR_metatype_to_string (types[i]),
- METATYPES_MC_TYPE_AS_ENUM,
- types[i],
+#if HAVE_EXTRACTOR
+ METATYPES_MC_TYPE_AS_STRING,
EXTRACTOR_metatype_to_string (types[i]),
+#endif
+ METATYPES_MC_TYPE_AS_ENUM, types[i],
-1);
if (0 == i)
gtk_combo_box_set_active_iter (GTK_COMBO_BOX
Modified: gnunet-gtk/src/include/gnunet_gtk.h
===================================================================
--- gnunet-gtk/src/include/gnunet_gtk.h 2015-05-30 18:35:02 UTC (rev 35842)
+++ gnunet-gtk/src/include/gnunet_gtk.h 2015-05-30 18:35:07 UTC (rev 35843)
@@ -36,7 +36,6 @@
#include <gnunet/platform.h>
#include <gnunet/gnunet_util_lib.h>
#include <gnunet/gnunet_fs_service.h>
-#include <extractor.h>
#include <gtk/gtk.h>
#include <gladeui/glade.h>
#include <gdk/gdkkeysyms.h>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r35843 - in gnunet-gtk: . src/fs src/identity src/include,
gnunet <=