1 Patch to enable compilation against mono-2.8
3 * Mono-2.8 uses mono-2.pc instead of mono.pc for setting cflags and libs.
4 * Mono-2.8 disables direct access to struct MonoType fields; use accessors
5 instead (mono_type_get_type and mono_field_get_flags have been present in
6 the API since at least mono-1.2, so we do not need any version ifdefs).
7 * Cast FSpot.MetadataStore to IEnumerable in foreach() to prevent CS1640
8 errors (non-unique enumeration of the type) with mono-2.8's gmcs.
10 diff -ru beagle-0.3.9-orig/configure.in beagle-0.3.9/configure.in
11 --- beagle-0.3.9-orig/configure.in 2010-10-16 01:30:03.807825004 -0400
12 +++ beagle-0.3.9/configure.in 2010-10-16 01:30:10.385825003 -0400
14 AC_MSG_ERROR([You need to install the Mono gmcs compiler])
17 -AC_MSG_CHECKING([for mono.pc])
18 -if test -z `$PKG_CONFIG --variable=prefix mono`; then
19 - AC_MSG_ERROR([missing the mono.pc file, usually found in the mono-devel package])
20 +# mono-2.8 and higher uses mono-2.pc instead of mono.pc for cflags and libs
21 +AC_MSG_CHECKING([for mono-2.pc])
22 +if test -z `$PKG_CONFIG --variable=prefix mono-2`; then
23 + AC_MSG_RESULT([not found])
24 + AC_MSG_CHECKING([for mono.pc])
25 + if test -z `$PKG_CONFIG --variable=prefix mono`; then
26 + AC_MSG_ERROR([missing the mono.pc file, usually found in the mono-devel package])
28 + AC_MSG_RESULT([found])
32 AC_MSG_RESULT([found])
38 # check that we have the require version of mono
40 # Temporary: check for mono-1.9
41 -PKG_CHECK_MODULES(MONO, mono >= 1.9, mono_1_9=yes, mono_1_9=no)
42 +PKG_CHECK_MODULES(MONO, $mono_pc >= 1.9, mono_1_9=yes, mono_1_9=no)
43 if test "x$mono_1_9" = "xno"; then
44 AC_MSG_RESULT([missing mono >= 1.9. Searching for mono >= 1.2.4])
45 - PKG_CHECK_MODULES(MONO, mono >= $MONO_REQUIRED)
46 + PKG_CHECK_MODULES(MONO, $mono_pc >= $MONO_REQUIRED)
48 AC_MSG_RESULT([found mono >= 1.9])
49 BEAGLE_DEFINES="$BEAGLE_DEFINES -define:MONO_1_9"
51 needed_dlls="Mono.Data.Sqlite Mono.Posix System.Data System.Web ICSharpCode.SharpZipLib"
52 for i in $needed_dlls; do
53 AC_MSG_CHECKING([for $i.dll])
54 - if test ! -e `$PKG_CONFIG --variable=prefix mono`/lib/mono/2.0/$i.dll; then
55 + if test ! -e `$PKG_CONFIG --variable=prefix $mono_pc`/lib/mono/2.0/$i.dll; then
56 AC_MSG_ERROR([missing required mono DLL: $i.dll])
58 AC_MSG_RESULT([found])
60 if test "x$enable_google" = "xyes"; then
62 AC_MSG_CHECKING([for $i.dll (needed by Google backends)])
63 - if test ! -e `$PKG_CONFIG --variable=prefix mono`/lib/mono/2.0/$i.dll; then
64 + if test ! -e `$PKG_CONFIG --variable=prefix $mono_pc`/lib/mono/2.0/$i.dll; then
65 AC_MSG_ERROR([missing required mono DLL: $i.dll])
67 AC_MSG_RESULT([found])
69 if test "x$enable_qt" != "xno" -a "x$has_qyoto" = "xno"; then
71 AC_MSG_CHECKING([for $i.dll])
72 - if test ! -e `$PKG_CONFIG --variable=prefix mono`/lib/mono/2.0/$i.dll; then
73 + if test ! -e `$PKG_CONFIG --variable=prefix $mono_pc`/lib/mono/2.0/$i.dll; then
74 AC_MSG_ERROR([missing required mono DLL: $i.dll])
76 AC_MSG_RESULT([found])
77 Only in beagle-0.3.9: configure.in.orig
78 diff -ru beagle-0.3.9-orig/Filters/FilterImage.cs beagle-0.3.9/Filters/FilterImage.cs
79 --- beagle-0.3.9-orig/Filters/FilterImage.cs 2008-04-13 15:24:13.000000000 -0400
80 +++ beagle-0.3.9/Filters/FilterImage.cs 2010-10-16 02:08:10.755825005 -0400
82 Resource rights_anon = null;
83 Resource title_anon = null;
85 - foreach (Statement stmt in xmp.Store) {
86 + foreach (Statement stmt in (IEnumerable)xmp.Store) {
87 if (stmt.Predicate == MetadataStore.Namespaces.Resolve ("dc:subject")) {
88 //Console.WriteLine ("found subject");
89 subject_anon = stmt.Object;
94 - foreach (Statement stmt in xmp.Store) {
95 + foreach (Statement stmt in (IEnumerable)xmp.Store) {
96 if (stmt.Subject == subject_anon &&
97 stmt.Predicate != MetadataStore.Namespaces.Resolve ("rdf:type")) {
98 AddProperty (Beagle.Property.New ("dc:subject", ((Literal)stmt.Object).Value));
99 diff -ru beagle-0.3.9-orig/Filters/FilterPdf.cs beagle-0.3.9/Filters/FilterPdf.cs
100 --- beagle-0.3.9-orig/Filters/FilterPdf.cs 2008-04-13 15:31:18.000000000 -0400
101 +++ beagle-0.3.9/Filters/FilterPdf.cs 2010-10-16 02:22:09.528825003 -0400
106 +using System.Collections;
108 using System.Diagnostics;
111 Resource rights_anon = null;
112 Resource title_anon = null;
114 - foreach (Statement stmt in xmp.Store) {
115 + foreach (Statement stmt in (IEnumerable)xmp.Store) {
116 if (stmt.Predicate == MetadataStore.Namespaces.Resolve ("dc:subject")) {
117 //Console.WriteLine ("found subject");
118 subject_anon = stmt.Object;
123 - foreach (Statement stmt in xmp.Store) {
124 + foreach (Statement stmt in (IEnumerable)xmp.Store) {
125 if (stmt.Subject == subject_anon &&
126 stmt.Predicate != MetadataStore.Namespaces.Resolve ("rdf:type")) {
127 AddProperty (Beagle.Property.New ("dc:subject", ((Literal)stmt.Object).Value));
128 diff -ru beagle-0.3.9-orig/glue/mono-glue.c beagle-0.3.9/glue/mono-glue.c
129 --- beagle-0.3.9-orig/glue/mono-glue.c 2007-11-26 20:50:05.000000000 -0500
130 +++ beagle-0.3.9/glue/mono-glue.c 2010-10-16 01:04:19.839825010 -0400
132 type = mono_class_get_type (klass);
134 /* This is an array, so drill down into it */
135 - if (type->type == MONO_TYPE_SZARRAY)
136 + if (mono_type_get_type (type) == MONO_TYPE_SZARRAY)
137 total += memory_usage_array ((MonoArray *) obj, visited);
139 while ((field = mono_class_get_fields (klass, &iter)) != NULL) {
140 MonoType *ftype = mono_field_get_type (field);
143 - if ((ftype->attrs & (FIELD_ATTRIBUTE_STATIC | FIELD_ATTRIBUTE_HAS_FIELD_RVA)) != 0)
144 + if ((mono_field_get_flags (field) & (FIELD_ATTRIBUTE_STATIC | FIELD_ATTRIBUTE_HAS_FIELD_RVA)) != 0)
147 /* FIXME: There are probably other types we need to drill down into */
148 - switch (ftype->type) {
149 + switch (mono_type_get_type (ftype)) {
151 case MONO_TYPE_CLASS:
152 case MONO_TYPE_OBJECT: