summaryrefslogtreecommitdiff
path: root/extra/beagle/mono-2.8.patch
blob: 5032434449f5bc5943ae935a227c2f3906362039 (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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
Patch to enable compilation against mono-2.8

* Mono-2.8 uses mono-2.pc instead of mono.pc for setting cflags and libs.
* Mono-2.8 disables direct access to struct MonoType fields; use accessors
instead (mono_type_get_type and mono_field_get_flags have been present in
the API since at least mono-1.2, so we do not need any version ifdefs).
* Cast FSpot.MetadataStore to IEnumerable in foreach() to prevent CS1640
errors (non-unique enumeration of the type) with mono-2.8's gmcs.

diff -ru beagle-0.3.9-orig/configure.in beagle-0.3.9/configure.in
--- beagle-0.3.9-orig/configure.in	2010-10-16 01:30:03.807825004 -0400
+++ beagle-0.3.9/configure.in	2010-10-16 01:30:10.385825003 -0400
@@ -59,11 +59,20 @@
 	AC_MSG_ERROR([You need to install the Mono gmcs compiler])
 fi
 
-AC_MSG_CHECKING([for mono.pc])
-if test -z `$PKG_CONFIG --variable=prefix mono`; then
-  AC_MSG_ERROR([missing the mono.pc file, usually found in the mono-devel package])
+# mono-2.8 and higher uses mono-2.pc instead of mono.pc for cflags and libs
+AC_MSG_CHECKING([for mono-2.pc])
+if test -z `$PKG_CONFIG --variable=prefix mono-2`; then
+  AC_MSG_RESULT([not found])
+  AC_MSG_CHECKING([for mono.pc])
+  if test -z `$PKG_CONFIG --variable=prefix mono`; then
+    AC_MSG_ERROR([missing the mono.pc file, usually found in the mono-devel package])
+  else
+    AC_MSG_RESULT([found])
+    mono_pc=mono
+  fi
 else
   AC_MSG_RESULT([found])
+  mono_pc=mono-2
 fi
 
 BEAGLE_DEFINES=""
@@ -71,10 +80,10 @@
 # check that we have the require version of mono
 
 # Temporary: check for mono-1.9
-PKG_CHECK_MODULES(MONO, mono >= 1.9, mono_1_9=yes, mono_1_9=no) 
+PKG_CHECK_MODULES(MONO, $mono_pc >= 1.9, mono_1_9=yes, mono_1_9=no) 
 if test "x$mono_1_9" = "xno"; then
 	AC_MSG_RESULT([missing mono >= 1.9. Searching for mono >= 1.2.4])
-	PKG_CHECK_MODULES(MONO, mono >= $MONO_REQUIRED) 
+	PKG_CHECK_MODULES(MONO, $mono_pc >= $MONO_REQUIRED) 
 else
 	AC_MSG_RESULT([found mono >= 1.9])
 	BEAGLE_DEFINES="$BEAGLE_DEFINES -define:MONO_1_9"
@@ -84,7 +93,7 @@
 needed_dlls="Mono.Data.Sqlite Mono.Posix System.Data System.Web ICSharpCode.SharpZipLib"
 for i in $needed_dlls; do
   AC_MSG_CHECKING([for $i.dll])
-  if test ! -e `$PKG_CONFIG --variable=prefix mono`/lib/mono/2.0/$i.dll; then
+  if test ! -e `$PKG_CONFIG --variable=prefix $mono_pc`/lib/mono/2.0/$i.dll; then
     AC_MSG_ERROR([missing required mono DLL: $i.dll])
   else
     AC_MSG_RESULT([found])
@@ -195,7 +204,7 @@
 if test "x$enable_google" = "xyes"; then
   i="System.Security"
   AC_MSG_CHECKING([for $i.dll (needed by Google backends)])
-  if test ! -e `$PKG_CONFIG --variable=prefix mono`/lib/mono/2.0/$i.dll; then
+  if test ! -e `$PKG_CONFIG --variable=prefix $mono_pc`/lib/mono/2.0/$i.dll; then
     AC_MSG_ERROR([missing required mono DLL: $i.dll])
   else
     AC_MSG_RESULT([found])
@@ -560,7 +569,7 @@
 if test "x$enable_qt" != "xno" -a "x$has_qyoto" = "xno"; then
 	i="qt-dotnet"
 	AC_MSG_CHECKING([for $i.dll])
-	if test ! -e `$PKG_CONFIG --variable=prefix mono`/lib/mono/2.0/$i.dll; then
+	if test ! -e `$PKG_CONFIG --variable=prefix $mono_pc`/lib/mono/2.0/$i.dll; then
 		AC_MSG_ERROR([missing required mono DLL: $i.dll])
 	else
 		AC_MSG_RESULT([found])
Only in beagle-0.3.9: configure.in.orig
diff -ru beagle-0.3.9-orig/Filters/FilterImage.cs beagle-0.3.9/Filters/FilterImage.cs
--- beagle-0.3.9-orig/Filters/FilterImage.cs	2008-04-13 15:24:13.000000000 -0400
+++ beagle-0.3.9/Filters/FilterImage.cs	2010-10-16 02:08:10.755825005 -0400
@@ -141,7 +141,7 @@
 			Resource rights_anon = null;
 			Resource title_anon = null;
 
-			foreach (Statement stmt in xmp.Store) {
+			foreach (Statement stmt in (IEnumerable)xmp.Store) {
 				if (stmt.Predicate == MetadataStore.Namespaces.Resolve ("dc:subject")) {
 					//Console.WriteLine ("found subject");
 					subject_anon = stmt.Object;
@@ -163,7 +163,7 @@
 				}
 			}
 			
-			foreach (Statement stmt in xmp.Store) {
+			foreach (Statement stmt in (IEnumerable)xmp.Store) {
 				if (stmt.Subject == subject_anon && 
 				    stmt.Predicate != MetadataStore.Namespaces.Resolve ("rdf:type")) {
 					AddProperty (Beagle.Property.New ("dc:subject", ((Literal)stmt.Object).Value));
diff -ru beagle-0.3.9-orig/Filters/FilterPdf.cs beagle-0.3.9/Filters/FilterPdf.cs
--- beagle-0.3.9-orig/Filters/FilterPdf.cs	2008-04-13 15:31:18.000000000 -0400
+++ beagle-0.3.9/Filters/FilterPdf.cs	2010-10-16 02:22:09.528825003 -0400
@@ -8,6 +8,7 @@
 //
 
 using System;
+using System.Collections;
 using System.IO;
 using System.Diagnostics;
 
@@ -220,7 +221,7 @@
 			Resource rights_anon = null;
 			Resource title_anon = null;
 
-			foreach (Statement stmt in xmp.Store) {
+			foreach (Statement stmt in (IEnumerable)xmp.Store) {
 				if (stmt.Predicate == MetadataStore.Namespaces.Resolve ("dc:subject")) {
 					//Console.WriteLine ("found subject");
 					subject_anon = stmt.Object;
@@ -239,7 +240,7 @@
 				}
 			}
 			
-			foreach (Statement stmt in xmp.Store) {
+			foreach (Statement stmt in (IEnumerable)xmp.Store) {
 				if (stmt.Subject == subject_anon && 
 				    stmt.Predicate != MetadataStore.Namespaces.Resolve ("rdf:type")) {
 					AddProperty (Beagle.Property.New ("dc:subject", ((Literal)stmt.Object).Value));
diff -ru beagle-0.3.9-orig/glue/mono-glue.c beagle-0.3.9/glue/mono-glue.c
--- beagle-0.3.9-orig/glue/mono-glue.c	2007-11-26 20:50:05.000000000 -0500
+++ beagle-0.3.9/glue/mono-glue.c	2010-10-16 01:04:19.839825010 -0400
@@ -79,18 +79,18 @@
         type = mono_class_get_type (klass);
 
         /* This is an array, so drill down into it */
-        if (type->type == MONO_TYPE_SZARRAY)
+        if (mono_type_get_type (type) == MONO_TYPE_SZARRAY)
                 total += memory_usage_array ((MonoArray *) obj, visited);
 
         while ((field = mono_class_get_fields (klass, &iter)) != NULL) {
                 MonoType *ftype = mono_field_get_type (field);
                 gpointer value;
 
-                if ((ftype->attrs & (FIELD_ATTRIBUTE_STATIC | FIELD_ATTRIBUTE_HAS_FIELD_RVA)) != 0)
+                if ((mono_field_get_flags (field) & (FIELD_ATTRIBUTE_STATIC | FIELD_ATTRIBUTE_HAS_FIELD_RVA)) != 0)
                         continue;
 
                 /* FIXME: There are probably other types we need to drill down into */
-                switch (ftype->type) {
+                switch (mono_type_get_type (ftype)) {
 
                 case MONO_TYPE_CLASS:
                 case MONO_TYPE_OBJECT: