Date: Sun, 29 Jul 2012 09:56:03 +0000 (UTC) From: Baptiste Daroussin <bapt@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r301681 - in head/devel/pkgconf: . files Message-ID: <201207290956.q6T9u3jE034093@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bapt Date: Sun Jul 29 09:56:03 2012 New Revision: 301681 URL: http://svn.freebsd.org/changeset/ports/301681 Log: - 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 Added: head/devel/pkgconf/files/ head/devel/pkgconf/files/patch-main.c (contents, props changed) head/devel/pkgconf/files/patch-pkg.c (contents, props changed) head/devel/pkgconf/files/patch-pkg.h (contents, props changed) head/devel/pkgconf/files/patch-stdinc.h (contents, props changed) Modified: head/devel/pkgconf/Makefile Modified: head/devel/pkgconf/Makefile ============================================================================== --- head/devel/pkgconf/Makefile Sun Jul 29 08:48:53 2012 (r301680) +++ head/devel/pkgconf/Makefile Sun Jul 29 09:56:03 2012 (r301681) @@ -7,6 +7,7 @@ PORTNAME= pkgconf PORTVERSION= 0.8.3 +PORTREVISION= 1 CATEGORIES= devel MASTER_SITES= http://nenolod.net/~nenolod/distfiles/ Added: head/devel/pkgconf/files/patch-main.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/pkgconf/files/patch-main.c Sun Jul 29 09:56:03 2012 (r301681) @@ -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; Added: head/devel/pkgconf/files/patch-pkg.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/pkgconf/files/patch-pkg.c Sun Jul 29 09:56:03 2012 (r301681) @@ -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) Added: head/devel/pkgconf/files/patch-pkg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/pkgconf/files/patch-pkg.h Sun Jul 29 09:56:03 2012 (r301681) @@ -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); Added: head/devel/pkgconf/files/patch-stdinc.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/pkgconf/files/patch-stdinc.h Sun Jul 29 09:56:03 2012 (r301681) @@ -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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201207290956.q6T9u3jE034093>