svn commit: r302969 - in head/devel/pkgconf: . files
Baptiste Daroussin
bapt at FreeBSD.org
Wed Aug 22 21:59:55 UTC 2012
Author: bapt
Date: Wed Aug 22 21:59:54 2012
New Revision: 302969
URL: http://svn.freebsd.org/changeset/ports/302969
Log:
- fix compatibility with pkg-config when the .pc files have an empty or non
existent Libs or Cflags entry
Reported by: avg, mezz, Luca Pizzamiglio <luca.pizzamiglio at gmail.com>
Tested by: avg, mezz, Luca Pizzamiglio <luca.pizzamiglio at gmail.com>
Obtain from: pkgconf git
Added:
head/devel/pkgconf/files/
head/devel/pkgconf/files/patch-fix-empy-libs-and-cflags (contents, props changed)
Modified:
head/devel/pkgconf/Makefile
Modified: head/devel/pkgconf/Makefile
==============================================================================
--- head/devel/pkgconf/Makefile Wed Aug 22 21:55:54 2012 (r302968)
+++ head/devel/pkgconf/Makefile Wed Aug 22 21:59:54 2012 (r302969)
@@ -7,6 +7,7 @@
PORTNAME= pkgconf
PORTVERSION= 0.8.7
+PORTREVISION= 1
CATEGORIES= devel
MASTER_SITES= http://tortois.es/~nenolod/distfiles/ \
http://files.etoilebsd.net/pkgconf/
Added: head/devel/pkgconf/files/patch-fix-empy-libs-and-cflags
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/devel/pkgconf/files/patch-fix-empy-libs-and-cflags Wed Aug 22 21:59:54 2012 (r302969)
@@ -0,0 +1,125 @@
+diff --git main.c main.c
+index dcde276..d807bf3 100644
+--- main.c
++++ main.c
+@@ -306,15 +306,19 @@ static bool
+ apply_cflags(pkg_t *world, void *list_head, int maxdepth, unsigned int flags)
+ {
+ pkg_fragment_t **head = list_head;
+- pkg_fragment_t *list;
++ int eflag;
+
+- list = pkg_cflags(world, head, maxdepth, flags | PKGF_SEARCH_PRIVATE);
+- if (list == NULL)
++ eflag = pkg_cflags(world, head, maxdepth, flags | PKGF_SEARCH_PRIVATE);
++ if (eflag != PKG_ERRF_OK)
+ return false;
+
+- print_cflags(list);
++ if (*head == NULL)
++ return true;
++
++ print_cflags(*head);
++
++ pkg_fragment_free(*head);
+
+- pkg_fragment_free(list);
+ return true;
+ }
+
+@@ -322,14 +326,18 @@ static bool
+ apply_libs(pkg_t *world, void *list_head, int maxdepth, unsigned int flags)
+ {
+ pkg_fragment_t **head = list_head;
+- pkg_fragment_t *list;
++ int eflag;
+
+- list = pkg_libs(world, head, maxdepth, flags);
+- if (list == NULL)
++ eflag = pkg_libs(world, head, maxdepth, flags);
++ if (eflag != PKG_ERRF_OK)
+ return false;
+- print_libs(list);
+
+- pkg_fragment_free(list);
++ if (*head == NULL)
++ return true;
++
++ print_libs(*head);
++
++ pkg_fragment_free(*head);
+ return true;
+ }
+
+diff --git pkg.c pkg.c
+index 8f0688d..c1667c3 100644
+--- pkg.c
++++ pkg.c
+@@ -853,7 +853,7 @@ pkg_cflags_collect(pkg_t *pkg, void *data, unsigned int flags)
+ *list = pkg_fragment_copy(*list, frag);
+ }
+
+-pkg_fragment_t *
++int
+ pkg_cflags(pkg_t *root, pkg_fragment_t **list, int maxdepth, unsigned int flags)
+ {
+ int eflag;
+@@ -863,10 +863,10 @@ pkg_cflags(pkg_t *root, pkg_fragment_t **list, int maxdepth, unsigned int flags)
+ if (eflag != PKG_ERRF_OK)
+ {
+ pkg_fragment_free(*list);
+- return NULL;
++ *list = NULL;
+ }
+
+- return *list;
++ return eflag;
+ }
+
+ static void
+@@ -891,7 +891,7 @@ pkg_libs_private_collect(pkg_t *pkg, void *data, unsigned int flags)
+ *list = pkg_fragment_copy(*list, frag);
+ }
+
+-pkg_fragment_t *
++int
+ pkg_libs(pkg_t *root, pkg_fragment_t **list, int maxdepth, unsigned int flags)
+ {
+ int eflag;
+@@ -901,7 +901,8 @@ pkg_libs(pkg_t *root, pkg_fragment_t **list, int maxdepth, unsigned int flags)
+ if (eflag != PKG_ERRF_OK)
+ {
+ pkg_fragment_free(*list);
+- return NULL;
++ *list = NULL;
++ return eflag;
+ }
+
+ if (flags & PKGF_MERGE_PRIVATE_FRAGMENTS)
+@@ -910,9 +911,9 @@ pkg_libs(pkg_t *root, pkg_fragment_t **list, int maxdepth, unsigned int flags)
+ if (eflag != PKG_ERRF_OK)
+ {
+ pkg_fragment_free(*list);
+- return NULL;
++ *list = NULL;
+ }
+ }
+
+- return *list;
++ return eflag;
+ }
+diff --git pkg.h pkg.h
+index 3ddb2d1..1a3bf37 100644
+--- pkg.h
++++ pkg.h
+@@ -134,8 +134,8 @@ unsigned int pkg_verify_graph(pkg_t *root, int depth, unsigned int flags);
+ int pkg_compare_version(const char *a, const char *b);
+ pkg_t *pkg_verify_dependency(pkg_dependency_t *pkgdep, unsigned int flags, unsigned int *eflags);
+ const char *pkg_get_comparator(pkg_dependency_t *pkgdep);
+-pkg_fragment_t *pkg_cflags(pkg_t *root, pkg_fragment_t **list, int maxdepth, unsigned int flags);
+-pkg_fragment_t *pkg_libs(pkg_t *root, pkg_fragment_t **list, int maxdepth, unsigned int flags);
++int pkg_cflags(pkg_t *root, pkg_fragment_t **list, int maxdepth, unsigned int flags);
++int pkg_libs(pkg_t *root, pkg_fragment_t **list, int maxdepth, unsigned int flags);
+
+ /* parse.c */
+ pkg_t *pkg_new_from_file(const char *path, FILE *f);
More information about the svn-ports-head
mailing list