]> git.pld-linux.org Git - packages/beagle.git/blob - beagle-mono28.patch
- drop obsolete and outdated manual inclusion of rpm macros
[packages/beagle.git] / beagle-mono28.patch
1 Patch to enable compilation against mono-2.8
2
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.
9
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
13 @@ -59,11 +59,20 @@
14         AC_MSG_ERROR([You need to install the Mono gmcs compiler])
15  fi
16  
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])
27 +  else
28 +    AC_MSG_RESULT([found])
29 +    mono_pc=mono
30 +  fi
31  else
32    AC_MSG_RESULT([found])
33 +  mono_pc=mono-2
34  fi
35  
36  BEAGLE_DEFINES=""
37 @@ -71,10 +80,10 @@
38  # check that we have the require version of mono
39  
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) 
47  else
48         AC_MSG_RESULT([found mono >= 1.9])
49         BEAGLE_DEFINES="$BEAGLE_DEFINES -define:MONO_1_9"
50 @@ -84,7 +93,7 @@
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])
57    else
58      AC_MSG_RESULT([found])
59 @@ -195,7 +204,7 @@
60  if test "x$enable_google" = "xyes"; then
61    i="System.Security"
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])
66    else
67      AC_MSG_RESULT([found])
68 @@ -560,7 +569,7 @@
69  if test "x$enable_qt" != "xno" -a "x$has_qyoto" = "xno"; then
70         i="qt-dotnet"
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])
75         else
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
81 @@ -141,7 +141,7 @@
82                         Resource rights_anon = null;
83                         Resource title_anon = null;
84  
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;
90 @@ -163,7 +163,7 @@
91                                 }
92                         }
93                         
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
102 @@ -8,6 +8,7 @@
103  //
104  
105  using System;
106 +using System.Collections;
107  using System.IO;
108  using System.Diagnostics;
109  
110 @@ -220,7 +221,7 @@
111                         Resource rights_anon = null;
112                         Resource title_anon = null;
113  
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;
119 @@ -239,7 +240,7 @@
120                                 }
121                         }
122                         
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
131 @@ -79,18 +79,18 @@
132          type = mono_class_get_type (klass);
133  
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);
138  
139          while ((field = mono_class_get_fields (klass, &iter)) != NULL) {
140                  MonoType *ftype = mono_field_get_type (field);
141                  gpointer value;
142  
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)
145                          continue;
146  
147                  /* FIXME: There are probably other types we need to drill down into */
148 -                switch (ftype->type) {
149 +                switch (mono_type_get_type (ftype)) {
150  
151                  case MONO_TYPE_CLASS:
152                  case MONO_TYPE_OBJECT:
This page took 0.098791 seconds and 3 git commands to generate.