OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

153 lines
4.3 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../pkgconfig/pkg-config-0.25-sysroot.patch
  5. # Copyright (C) 2010 The OpenSDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This patch file is dual-licensed. It is available under the license the
  10. # patched project is licensed under, as long as it is an OpenSource license
  11. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  12. # of the GNU General Public License as published by the Free Software
  13. # Foundation; either version 2 of the License, or (at your option) any later
  14. # version.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. Description:
  17. pkg-config is not taking care if PKG_CONFIG_SYSROOT_DIR environment variable
  18. was set, always prefering its defaults
  19. Bug-URL: http://bugs.freedesktop.org/show_bug.cgi?id=28264
  20. This patch was directly taken from the freedesktop bug-tracker:
  21. see comment: http://bugs.freedesktop.org/show_bug.cgi?id=28264#c2
  22. http://bugs.freedesktop.org/attachment.cgi?id=36074
  23. diff -ru a/pkg.c b/pkg.c
  24. --- a/pkg.c 2010-05-08 21:14:17.000000000 +0100
  25. +++ b/pkg.c 2010-06-05 12:32:08.006581822 +0100
  26. @@ -751,13 +751,9 @@
  27. {
  28. GSList *requires = NULL;
  29. GSList *conflicts = NULL;
  30. - GSList *system_directories = NULL;
  31. GSList *iter;
  32. GSList *requires_iter;
  33. GSList *conflicts_iter;
  34. - GSList *system_dir_iter = NULL;
  35. - int count;
  36. - const gchar *c_include_path;
  37. /* Be sure we have the required fields */
  38. @@ -865,107 +861,6 @@
  39. }
  40. g_slist_free (requires);
  41. -
  42. - /* We make a list of system directories that gcc expects so we can remove
  43. - * them.
  44. - */
  45. -#ifndef G_OS_WIN32
  46. - system_directories = g_slist_append (NULL, g_strdup ("/usr/include"));
  47. -#endif
  48. -
  49. - c_include_path = g_getenv ("C_INCLUDE_PATH");
  50. - if (c_include_path != NULL)
  51. - {
  52. - system_directories = add_env_variable_to_list (system_directories, c_include_path);
  53. - }
  54. -
  55. - c_include_path = g_getenv ("CPLUS_INCLUDE_PATH");
  56. - if (c_include_path != NULL)
  57. - {
  58. - system_directories = add_env_variable_to_list (system_directories, c_include_path);
  59. - }
  60. -
  61. - count = 0;
  62. - iter = pkg->I_cflags;
  63. - while (iter != NULL)
  64. - {
  65. - gint offset = 0;
  66. - /* we put things in canonical -I/usr/include (vs. -I /usr/include) format,
  67. - * but if someone changes it later we may as well be robust
  68. - */
  69. - if (((strncmp (iter->data, "-I", 2) == 0) && (offset = 2))||
  70. - ((strncmp (iter->data, "-I ", 3) == 0) && (offset = 3)))
  71. - {
  72. - if (offset == 0)
  73. - {
  74. - iter = iter->next;
  75. - continue;
  76. - }
  77. -
  78. - system_dir_iter = system_directories;
  79. - while (system_dir_iter != NULL)
  80. - {
  81. - if (strcmp (system_dir_iter->data,
  82. - ((char*)iter->data) + offset) == 0)
  83. - {
  84. - debug_spew ("Package %s has %s in Cflags\n",
  85. - pkg->name, (gchar *)iter->data);
  86. - if (g_getenv ("PKG_CONFIG_ALLOW_SYSTEM_CFLAGS") == NULL)
  87. - {
  88. - debug_spew ("Removing %s from cflags for %s\n", iter->data, pkg->key);
  89. - ++count;
  90. - iter->data = NULL;
  91. -
  92. - break;
  93. - }
  94. - }
  95. - system_dir_iter = system_dir_iter->next;
  96. - }
  97. - }
  98. -
  99. - iter = iter->next;
  100. - }
  101. -
  102. - while (count)
  103. - {
  104. - pkg->I_cflags = g_slist_remove (pkg->I_cflags, NULL);
  105. - --count;
  106. - }
  107. -
  108. - g_slist_foreach (system_directories, (GFunc) g_free, NULL);
  109. - g_slist_free (system_directories);
  110. -
  111. -#ifdef PREFER_LIB64
  112. -#define SYSTEM_LIBDIR "/usr/lib64"
  113. -#else
  114. -#define SYSTEM_LIBDIR "/usr/lib"
  115. -#endif
  116. - count = 0;
  117. - iter = pkg->L_libs;
  118. - while (iter != NULL)
  119. - {
  120. - if (strcmp (iter->data, "-L" SYSTEM_LIBDIR) == 0 ||
  121. - strcmp (iter->data, "-L " SYSTEM_LIBDIR) == 0)
  122. - {
  123. - debug_spew ("Package %s has -L" SYSTEM_LIBDIR " in Libs\n",
  124. - pkg->name);
  125. - if (g_getenv ("PKG_CONFIG_ALLOW_SYSTEM_LIBS") == NULL)
  126. - {
  127. - iter->data = NULL;
  128. - ++count;
  129. - debug_spew ("Removing -L" SYSTEM_LIBDIR " from libs for %s\n", pkg->key);
  130. - }
  131. - }
  132. -
  133. - iter = iter->next;
  134. - }
  135. -#undef SYSTEM_LIBDIR
  136. -
  137. - while (count)
  138. - {
  139. - pkg->L_libs = g_slist_remove (pkg->L_libs, NULL);
  140. - --count;
  141. - }
  142. }
  143. static char*