summaryrefslogtreecommitdiff
path: root/devel/pkg-config/patches/patch-ah
blob: 15e0e76d4580f4d3776419172b2ce00124519a55 (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
$NetBSD: patch-ah,v 1.3 2008/03/04 09:22:27 wiz Exp $

Don't call gnome-config, it has been dead for ages and the warnings
just confuse users.

--- parse.c.orig	2008-01-16 20:42:49.000000000 +0000
+++ parse.c
@@ -1418,102 +1418,8 @@ get_compat_package (const char *name)
     }
   else
     {
-      /* Check for the module in gnome-config */
-      char *output;
-      char *p;
-      char *command;
-
-      debug_spew ("Calling gnome-config\n");
-      
-      /* Annoyingly, --modversion doesn't return a failure
-       * code if the lib is unknown, so we have to use --libs
-       * for that.
-       */
-      
-      command = g_strdup_printf ("gnome-config --libs %s",
-                                 name);
-      
-      if (!try_command (command))
-        {
-          g_free (command);
-          g_free (pkg);
-          return NULL;
-        }
-      else
-        g_free (command);
-      
-      command = g_strdup_printf ("gnome-config --modversion %s",
-                                 name);
-      
-      output = backticks (command);
-      g_free (command);
-      if (output == NULL)
-        {
-          g_free (pkg);
-          return NULL;
-        }
-      
-      /* Unknown modules give "Unknown library `foo'" from gnome-config
-       * (but on stderr so this is useless, nevermind)
-       */
-      if (strstr (output, "Unknown") || *output == '\0')
-        {
-          g_free (output);
-          g_free (pkg);
-          return NULL;
-        }
-
-      /* gnome-config --modversion gnomeui outputs e.g. "gnome-libs-1.2.4"
-       * or libglade-0.12
-       */
-      p = output;
-
-      while (*p && isspace ((guchar)*p))
-        ++p;
-
-      if (*p == '\0')
-        {
-          /* empty output */
-          g_free (output);
-          g_free (pkg);
-          return NULL;
-        }
-
-      /* only heuristic; find a number or . */
-      while (*p && ! (isdigit ((guchar)*p) || *p == '.'))
-        ++p;      
-
-      pkg->version = g_strdup (p);
-
-      g_free (output);
-      
-      /* Strip newline */
-      p = pkg->version;
-      while (*p)
-        {
-          if (*p == '\n')
-            *p = '\0';
-
-          ++p;
-        }
-      
-      pkg->name = g_strdup (name);
-      pkg->key = g_strdup (name);
-      pkg->description = g_strdup ("No description");
-
-      command = g_strdup_printf ("gnome-config --libs %s", name);
-      output = backticks (command);
-      g_free (command);
-      parse_libs (pkg, output, "gnome-config");
-      g_free (output);
-
-      command = g_strdup_printf ("gnome-config --cflags %s", name);
-      output = backticks (command);
-      g_free (command);
-      parse_cflags (pkg, output, "gnome-config");
-      g_free (output);
-
-      return pkg;
+      g_free (pkg);
+      return NULL;
     }
 #endif
 }