* Revert to pkg-config 0.22, even with the patch it changes the

Requires.private interpretation and I don't actually have a reason
  to update to 0.23 anyway.

svn path=/nixpkgs/branches/stdenv-updates/; revision=11015
This commit is contained in:
Eelco Dolstra 2008-03-07 15:40:07 +00:00
parent 2d6940061e
commit 4bd753eaeb
2 changed files with 11 additions and 184 deletions

View file

@ -1,25 +1,29 @@
{stdenv, fetchurl}:
stdenv.mkDerivation {
name = "pkg-config-0.23";
name = "pkg-config-0.22";
setupHook = ./setup-hook.sh;
src = fetchurl {
url = http://pkgconfig.freedesktop.org/releases/pkg-config-0.23.tar.gz;
sha256 = "0lrvk17724mc2nzpaa0vwybarrl50r7qdnr4h6jijm50srrf1808";
url = http://pkgconfig.freedesktop.org/releases/pkg-config-0.22.tar.gz;
sha256 = "1rpb5wygmp0f8nal7y3ga4556i7hkjdslv3wdq04fj30gns621vy";
};
patches = [
# Process Requires.private properly, see
# http://bugs.freedesktop.org/show_bug.cgi?id=4738.
./private.patch
(fetchurl {
name = "pkgconfig-8494.patch";
url = http://bugs.freedesktop.org/attachment.cgi?id=8494;
sha256 = "1pcrdbb7dypg2biy0yqc7bdxak5zii8agqljdvk7j4wbyghpqzws";
})
];
patchFlags = "-p0";
meta = {
description = "A tool that allows packages to find out information about other packages";
homepage = http://pkg-config.freedesktop.org/wiki/;
};
};
}

View file

@ -1,177 +0,0 @@
=== 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;