aboutsummaryrefslogtreecommitdiffstats
path: root/devel
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2012-07-29 17:56:03 +0800
committerBaptiste Daroussin <bapt@FreeBSD.org>2012-07-29 17:56:03 +0800
commitc75a54293871fc84978f2c6755f4b06253c6982b (patch)
treeeac5faa0904fe0a4d1145748aa10c582267d3f91 /devel
parentb4bdcc7a484d39b23ecfbf20a5de56c4bcce9189 (diff)
downloadfreebsd-ports-gnome-c75a54293871fc84978f2c6755f4b06253c6982b.tar.gz
freebsd-ports-gnome-c75a54293871fc84978f2c6755f4b06253c6982b.tar.zst
freebsd-ports-gnome-c75a54293871fc84978f2c6755f4b06253c6982b.zip
- import patches from upstream
- changes: * add support for --list-all * --version now shows pkg-config compatibility version (no need to modify anymore buggy configures that do check for --version instead of --modversion pkg-conf) * new --about to show the version of pkgconf Obtained from: pkgconf git repository
Diffstat (limited to 'devel')
-rw-r--r--devel/pkgconf/Makefile1
-rw-r--r--devel/pkgconf/files/patch-main.c132
-rw-r--r--devel/pkgconf/files/patch-pkg.c101
-rw-r--r--devel/pkgconf/files/patch-pkg.h17
-rw-r--r--devel/pkgconf/files/patch-stdinc.h13
5 files changed, 264 insertions, 0 deletions
diff --git a/devel/pkgconf/Makefile b/devel/pkgconf/Makefile
index 5e5f00c275a7..725989c974a0 100644
--- a/devel/pkgconf/Makefile
+++ b/devel/pkgconf/Makefile
@@ -7,6 +7,7 @@
PORTNAME= pkgconf
PORTVERSION= 0.8.3
+PORTREVISION= 1
CATEGORIES= devel
MASTER_SITES= http://nenolod.net/~nenolod/distfiles/
diff --git a/devel/pkgconf/files/patch-main.c b/devel/pkgconf/files/patch-main.c
new file mode 100644
index 000000000000..4af892b25486
--- /dev/null
+++ b/devel/pkgconf/files/patch-main.c
@@ -0,0 +1,132 @@
+--- ./main.c.orig 2012-07-26 04:13:43.000000000 +0200
++++ ./main.c 2012-07-29 11:31:53.000000000 +0200
+@@ -26,28 +26,18 @@
+
+ static unsigned int global_traverse_flags = PKGF_NONE;
+
+-static int want_help = 0;
+-static int want_version = 0;
+ static int want_cflags = 0;
+ static int want_libs = 0;
+ static int want_modversion = 0;
+-static int want_static = 0;
+ static int want_requires = 0;
+ static int want_requires_private = 0;
+ static int want_variables = 0;
+ static int want_digraph = 0;
+-static int want_env_only = 0;
+ static int want_uninstalled = 0;
+-static int want_no_uninstalled = 0;
+ static int want_keep_system_cflags = 0;
+ static int want_keep_system_libs = 0;
+-static int want_ignore_conflicts = 0;
+ static int maximum_traverse_depth = -1;
+
+-static char *required_pkgconfig_version = NULL;
+-static char *required_exact_module_version = NULL;
+-static char *required_max_module_version = NULL;
+-static char *required_module_version = NULL;
+ static char *want_variable = NULL;
+ static char *sysroot_dir = NULL;
+
+@@ -101,6 +91,15 @@
+ }
+
+ static void
++print_list_entry(const pkg_t *entry)
++{
++ if (entry->uninstalled)
++ return;
++
++ printf("%-30s %s - %s\n", entry->id, entry->realname, entry->description);
++}
++
++static void
+ print_cflags(pkg_fragment_t *list)
+ {
+ pkg_fragment_t *frag;
+@@ -414,6 +413,12 @@
+ static void
+ version(void)
+ {
++ printf("%s\n", PKG_PKGCONFIG_VERSION_EQUIV);
++}
++
++static void
++about(void)
++{
+ printf("%s %s%s\n", PACKAGE_NAME, PACKAGE_VERSION, HAVE_STRICT_MODE ? " [strict]" : " [pkg-config compatible]");
+ printf("Copyright (c) 2011 - 2012 pkgconf authors (see AUTHORS in documentation directory).\n\n");
+ printf("Permission to use, copy, modify, and/or distribute this software for any\n");
+@@ -438,6 +443,7 @@
+ printf(" with a specified pkg-config version\n");
+ printf(" --errors-to-stdout print all errors on stdout instead of stderr\n");
+ printf(" --silence-errors explicitly be silent about errors\n");
++ printf(" --list-all list all known packages\n");
+
+ printf("\nchecking specific pkg-config database entries:\n\n");
+
+@@ -482,6 +488,11 @@
+ pkg_queue_t *pkgq = NULL;
+ pkg_queue_t *pkgq_head = NULL;
+ char *builddir;
++ char *required_pkgconfig_version = NULL;
++ char *required_exact_module_version = NULL;
++ char *required_max_module_version = NULL;
++ char *required_module_version = NULL;
++ int want_env_only = 0;
+ int want_errors_on_stdout = 0;
+ int want_silence_errors = 0;
+ int want_libs_L = 0;
+@@ -489,9 +500,17 @@
+ int want_libs_other = 0;
+ int want_cflags_I = 0;
+ int want_cflags_other = 0;
++ int want_list = 0;
++ int want_about = 0;
++ int want_help = 0;
++ int want_version = 0;
++ int want_ignore_conflicts = 0;
++ int want_static = 0;
++ int want_no_uninstalled = 0;
+
+ struct pkg_option options[] = {
+ { "version", no_argument, &want_version, 1, },
++ { "about", no_argument, &want_about, 1, },
+ { "atleast-version", required_argument, NULL, 2, },
+ { "atleast-pkgconfig-version", required_argument, NULL, 3, },
+ { "libs", no_argument, &want_libs, 4, },
+@@ -524,6 +543,7 @@
+ { "ignore-conflicts", no_argument, &want_ignore_conflicts, 30, },
+ { "errors-to-stdout", no_argument, &want_errors_on_stdout, 31, },
+ { "silence-errors", no_argument, &want_silence_errors, 32, },
++ { "list-all", no_argument, &want_list, 33, },
+ { NULL, 0, NULL, 0 }
+ };
+
+@@ -573,6 +593,12 @@
+ else if (want_cflags_other)
+ want_cflags = want_cflags_other;
+
++ if (want_about)
++ {
++ about();
++ return EXIT_SUCCESS;
++ }
++
+ if (want_version)
+ {
+ version();
+@@ -627,6 +653,12 @@
+ return EXIT_FAILURE;
+ }
+
++ if (want_list)
++ {
++ pkg_scan_all(print_list_entry);
++ return EXIT_SUCCESS;
++ }
++
+ if (required_module_version != NULL)
+ {
+ pkg_t *pkg;
diff --git a/devel/pkgconf/files/patch-pkg.c b/devel/pkgconf/files/patch-pkg.c
new file mode 100644
index 000000000000..128a5ef69123
--- /dev/null
+++ b/devel/pkgconf/files/patch-pkg.c
@@ -0,0 +1,101 @@
+--- ./pkg.c.orig 2012-07-29 11:35:32.856917000 +0200
++++ ./pkg.c 2012-07-29 11:31:53.000000000 +0200
+@@ -142,11 +142,18 @@
+ {
+ pkg_t *pkg;
+ char readbuf[PKG_BUFSIZE];
++ char *idptr;
+
+ pkg = calloc(sizeof(pkg_t), 1);
+ pkg->filename = strdup(filename);
+ pkg->vars = pkg_tuple_add(pkg->vars, "pcfiledir", pkg_get_parent_dir(pkg));
+
++ /* make module id */
++ pkg->id = strdup(basename(pkg->filename));
++ idptr = strrchr(pkg->id, '.');
++ if (idptr)
++ *idptr = '\0';
++
+ while (pkg_fgetline(readbuf, PKG_BUFSIZE, f) != NULL)
+ {
+ char op, *p, *key = NULL, *value = NULL;
+@@ -274,6 +281,79 @@
+ return pkg;
+ }
+
++static void
++pkg_scan_dir(const char *path, pkg_iteration_func_t func)
++{
++ DIR *dir;
++ struct dirent *dirent;
++
++ dir = opendir(path);
++ if (dir == NULL)
++ return;
++
++ for (dirent = readdir(dir); dirent != NULL; dirent = readdir(dir))
++ {
++ static char filebuf[PKG_BUFSIZE];
++ pkg_t *pkg;
++ FILE *f;
++ struct stat st;
++
++ strlcpy(filebuf, path, sizeof filebuf);
++ strlcat(filebuf, "/", sizeof filebuf);
++ strlcat(filebuf, dirent->d_name, sizeof filebuf);
++
++ stat(filebuf, &st);
++ if (!(S_ISREG(st.st_mode)))
++ continue;
++
++ f = fopen(filebuf, "r");
++ if (f == NULL)
++ continue;
++
++ pkg = pkg_new_from_file(filebuf, f);
++ if (pkg != NULL)
++ {
++ func(pkg);
++ pkg_free(pkg);
++ }
++ }
++
++ closedir(dir);
++}
++
++void
++pkg_scan(const char *search_path, pkg_iteration_func_t func)
++{
++ char **path = NULL;
++ size_t count = 0, iter = 0;
++
++ /* PKG_CONFIG_PATH has to take precedence */
++ if (search_path == NULL)
++ return;
++
++ count = path_split(search_path, &path);
++
++ for (iter = 0; iter < count; iter++)
++ pkg_scan_dir(path[iter], func);
++
++ path_free(path, count);
++}
++
++void
++pkg_scan_all(pkg_iteration_func_t func)
++{
++ char *path;
++
++ path = getenv("PKG_CONFIG_PATH");
++ if (path)
++ {
++ pkg_scan(path, func);
++ return;
++ }
++
++ pkg_scan(get_pkgconfig_path(), func);
++}
++
+ #ifdef _WIN32
+ pkg_t *
+ pkg_find_in_registry_key(HKEY hkey, const char *name, unsigned int flags)
diff --git a/devel/pkgconf/files/patch-pkg.h b/devel/pkgconf/files/patch-pkg.h
new file mode 100644
index 000000000000..1c89073eaf86
--- /dev/null
+++ b/devel/pkgconf/files/patch-pkg.h
@@ -0,0 +1,17 @@
+--- ./pkg.h.orig 2012-07-26 04:13:43.000000000 +0200
++++ ./pkg.h 2012-07-29 11:31:53.000000000 +0200
+@@ -114,11 +114,14 @@
+ #define PKG_ERRF_PACKAGE_VER_MISMATCH 0x2
+ #define PKG_ERRF_PACKAGE_CONFLICT 0x4
+
++typedef void (*pkg_iteration_func_t)(const pkg_t *pkg);
+ typedef void (*pkg_traverse_func_t)(pkg_t *pkg, void *data, unsigned int flags);
+
+ /* pkg.c */
+ void pkg_free(pkg_t *pkg);
+ pkg_t *pkg_find(const char *name, unsigned int flags);
++void pkg_scan(const char *search_path, pkg_iteration_func_t func);
++void pkg_scan_all(pkg_iteration_func_t func);
+ unsigned int pkg_traverse(pkg_t *root, pkg_traverse_func_t func, void *data, int maxdepth, unsigned int flags);
+ unsigned int pkg_verify_graph(pkg_t *root, int depth, unsigned int flags);
+ int pkg_compare_version(const char *a, const char *b);
diff --git a/devel/pkgconf/files/patch-stdinc.h b/devel/pkgconf/files/patch-stdinc.h
new file mode 100644
index 000000000000..8829d456d93c
--- /dev/null
+++ b/devel/pkgconf/files/patch-stdinc.h
@@ -0,0 +1,13 @@
+--- ./stdinc.h.orig 2012-07-26 04:13:43.000000000 +0200
++++ ./stdinc.h 2012-07-29 11:31:53.000000000 +0200
+@@ -23,6 +23,10 @@
+ #include <stdbool.h>
+ #include <string.h>
+ #include <libgen.h>
++#include <dirent.h>
++#include <sys/types.h>
++#include <sys/stat.h>
++#include <unistd.h>
+
+ #ifdef _WIN32
+ # define WIN32_LEAN_AND_MEAN