about summary refs log tree commit diff
path: root/pkgs/development/tools/misc/pkgconfig/private.patch
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/tools/misc/pkgconfig/private.patch')
-rw-r--r--pkgs/development/tools/misc/pkgconfig/private.patch177
1 files changed, 177 insertions, 0 deletions
diff --git a/pkgs/development/tools/misc/pkgconfig/private.patch b/pkgs/development/tools/misc/pkgconfig/private.patch
new file mode 100644
index 000000000000..4eb6555b4c98
--- /dev/null
+++ b/pkgs/development/tools/misc/pkgconfig/private.patch
@@ -0,0 +1,177 @@
+=== modified file 'main.c'
+--- main.c	2006-08-16 17:57:14 +0000
++++ main.c	2007-12-18 23:40:46 +0000
+@@ -420,6 +420,27 @@
+   else
+     disable_private_libs();
+ 
++  /* Only process Requires field if cflags or libs wanted */
++  if (want_libs ||
++      want_cflags ||
++      want_l_libs ||
++      want_L_libs ||
++      want_other_libs ||
++      want_I_cflags ||
++      want_other_cflags)
++    enable_requires();
++  else
++    disable_requires();
++
++  /* Only process Requires.private if cflags or static libs wanted */
++  if (want_cflags ||
++      want_I_cflags ||
++      want_other_cflags ||
++      want_static_lib_list)
++    enable_requires_private();
++  else
++    disable_requires_private();
++
+   if (want_my_version)
+     {
+       printf ("%s\n", VERSION);
+
+=== modified file 'parse.c'
+--- parse.c	2007-05-30 11:24:42 +0000
++++ parse.c	2007-12-18 23:40:46 +0000
+@@ -913,7 +913,9 @@
+ #endif
+ 
+ static void
+-parse_line (Package *pkg, const char *untrimmed, const char *path, gboolean ignore_requires, gboolean ignore_private_libs)
++parse_line (Package *pkg, const char *untrimmed, const char *path,
++            gboolean ignore_requires, gboolean ignore_requires_private,
++            gboolean ignore_private_libs)
+ {
+   char *str;
+   char *p;
+@@ -956,15 +958,12 @@
+         parse_description (pkg, p, path);
+       else if (strcmp (tag, "Version") == 0)
+         parse_version (pkg, p, path);
+-      else if (strcmp (tag, "Requires.private") == 0)
+-	parse_requires_private (pkg, p, path);
+-      else if (strcmp (tag, "Requires") == 0)
+-	{
+-          if (ignore_requires == FALSE)
+-	    parse_requires (pkg, p, path);
+-          else
+-	    goto cleanup;
+-        }
++      else if ((strcmp (tag, "Requires.private") == 0) &&
++               ignore_requires_private == FALSE)
++        parse_requires_private (pkg, p, path);
++      else if ((strcmp (tag, "Requires") == 0) &&
++               ignore_requires == FALSE)
++        parse_requires (pkg, p, path);
+       else if ((strcmp (tag, "Libs.private") == 0) && 
+                ignore_private_libs == FALSE)
+         parse_libs_private (pkg, p, path);
+@@ -1067,7 +1066,9 @@
+ }
+ 
+ Package*
+-parse_package_file (const char *path, gboolean ignore_requires, gboolean ignore_private_libs)
++parse_package_file (const char *path, gboolean ignore_requires,
++                    gboolean ignore_requires_private,
++                    gboolean ignore_private_libs)
+ {
+   FILE *f;
+   Package *pkg;
+@@ -1104,7 +1105,8 @@
+     {
+       one_line = TRUE;
+       
+-      parse_line (pkg, str->str, path, ignore_requires, ignore_private_libs);
++      parse_line (pkg, str->str, path, ignore_requires,
++                  ignore_requires_private, ignore_private_libs);
+ 
+       g_string_truncate (str, 0);
+     }
+
+=== modified file 'parse.h'
+--- parse.h	2005-07-14 13:07:18 +0000
++++ parse.h	2007-12-18 23:40:46 +0000
+@@ -23,6 +23,7 @@
+ #include "pkg.h"
+ 
+ Package *parse_package_file (const char *path, gboolean ignore_requires,
++                             gboolean ignore_requires_private,
+                              gboolean ignore_private_libs);
+ 
+ Package *get_compat_package (const char *name);
+
+=== modified file 'pkg.c'
+--- pkg.c	2007-06-18 21:19:27 +0000
++++ pkg.c	2007-12-18 23:40:46 +0000
+@@ -55,6 +55,7 @@
+ 
+ gboolean disable_uninstalled = FALSE;
+ gboolean ignore_requires = FALSE;
++gboolean ignore_requires_private = FALSE;
+ gboolean ignore_private_libs = TRUE;
+ 
+ static Package pkg_config_package = {
+@@ -349,7 +350,8 @@
+     }
+ 
+   debug_spew ("Reading '%s' from file '%s'\n", name, location);
+-  pkg = parse_package_file (location, ignore_requires, ignore_private_libs);
++  pkg = parse_package_file (location, ignore_requires, ignore_requires_private,
++                            ignore_private_libs);
+   
+   if (pkg == NULL)
+     {
+@@ -1503,6 +1505,7 @@
+   int mlen = 0;
+   
+   ignore_requires = TRUE;
++  ignore_requires_private = TRUE;
+ 
+   g_hash_table_foreach (locations, max_len_foreach, &mlen);
+   g_hash_table_foreach (locations, packages_foreach, GINT_TO_POINTER (mlen + 1));
+@@ -1519,3 +1522,27 @@
+ {
+   ignore_private_libs = TRUE;
+ }
++
++void
++enable_requires(void)
++{
++  ignore_requires = FALSE;
++}
++
++void
++disable_requires(void)
++{
++  ignore_requires = TRUE;
++}
++
++void
++enable_requires_private(void)
++{
++  ignore_requires_private = FALSE;
++}
++
++void
++disable_requires_private(void)
++{
++  ignore_requires_private = TRUE;
++}
+
+=== modified file 'pkg.h'
+--- pkg.h	2005-10-16 17:31:41 +0000
++++ pkg.h	2007-12-18 23:40:46 +0000
+@@ -120,6 +120,12 @@
+ void enable_private_libs(void);
+ void disable_private_libs(void);
+ 
++void enable_requires(void);
++void disable_requires(void);
++
++void enable_requires_private(void);
++void disable_requires_private(void);
++
+ /* If TRUE, do not automatically prefer uninstalled versions */
+ extern gboolean disable_uninstalled;
+ 
+