[94991] trunk/dports/textproc/libplist

jmr at macports.org jmr at macports.org
Tue Jul 3 07:45:35 PDT 2012


Revision: 94991
          https://trac.macports.org/changeset/94991
Author:   jmr at macports.org
Date:     2012-07-03 07:45:35 -0700 (Tue, 03 Jul 2012)
Log Message:
-----------
libplist:
 * don't install module into system python, add python variants (#27094)
 * fix incorrect code with upstream patches instead of not using clang

Modified Paths:
--------------
    trunk/dports/textproc/libplist/Portfile

Added Paths:
-----------
    trunk/dports/textproc/libplist/files/
    trunk/dports/textproc/libplist/files/33b8dfb90ecc5b4b2559c1fb43d7b743b72bf425.patch
    trunk/dports/textproc/libplist/files/83fa6982dfddaed93195402e2e0b7435bc707e06.patch
    trunk/dports/textproc/libplist/files/c5173d46a16220a743593e28359770c54adcc65b.patch

Modified: trunk/dports/textproc/libplist/Portfile
===================================================================
--- trunk/dports/textproc/libplist/Portfile	2012-07-03 14:34:36 UTC (rev 94990)
+++ trunk/dports/textproc/libplist/Portfile	2012-07-03 14:45:35 UTC (rev 94991)
@@ -6,6 +6,7 @@
 
 name                libplist
 version             1.8
+revision            1
 categories          textproc multimedia
 maintainers         rmstonecipher openmaintainer
 description         Library for working with Apple Binary and XML Property Lists
@@ -21,13 +22,35 @@
                     sha1    dea18ac31cc497dba959bdb459a2a49fb41664c3 \
                     rmd160  b8da55db4bec34e4c8b9126da0ea46e79f36ccf1
 
-# error: non-void function '...' should return a value [-Wreturn-type]
-if {${configure.compiler} == "clang"} {
-    configure.compiler llvm-gcc-4.2
-}
+patchfiles          83fa6982dfddaed93195402e2e0b7435bc707e06.patch \
+                    33b8dfb90ecc5b4b2559c1fb43d7b743b72bf425.patch \
+                    c5173d46a16220a743593e28359770c54adcc65b.patch
+patch.pre_args      -p1
 
+configure.args-append   -DENABLE_CYTHON=OFF
+
 use_parallel_build  no
 
+variant python26 description {Use Python 2.6} {
+    depends_lib-append  port:python26
+    configure.args-append -DPYTHON_EXECUTABLE=${prefix}/bin/python2.6 \
+                          -DPYTHON_INCLUDE_DIR=${frameworks_dir}/Python.framework/Versions/2.6/include/python2.6 \
+                          -DPYTHON_LIBRARY=${frameworks_dir}/Python.framework/Versions/2.6/Python
+}
+variant python27 description {Use Python 2.7} {
+    depends_lib-append  port:python27
+    configure.args-append -DPYTHON_EXECUTABLE=${prefix}/bin/python2.7 \
+                          -DPYTHON_INCLUDE_DIR=${frameworks_dir}/Python.framework/Versions/2.7/include/python2.7 \
+                          -DPYTHON_LIBRARY=${frameworks_dir}/Python.framework/Versions/2.7/Python
+}
+if {![variant_isset python26]} {
+    default_variants    +python27
+}
+if {![variant_isset python26] && ![variant_isset python27]} {
+    depends_lib-delete port:swig-python
+    configure.args-append -DENABLE_SWIG=OFF
+}
+
 livecheck.type      regex
 livecheck.url       ${homepage}
 livecheck.regex     "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"

Added: trunk/dports/textproc/libplist/files/33b8dfb90ecc5b4b2559c1fb43d7b743b72bf425.patch
===================================================================
--- trunk/dports/textproc/libplist/files/33b8dfb90ecc5b4b2559c1fb43d7b743b72bf425.patch	                        (rev 0)
+++ trunk/dports/textproc/libplist/files/33b8dfb90ecc5b4b2559c1fb43d7b743b72bf425.patch	2012-07-03 14:45:35 UTC (rev 94991)
@@ -0,0 +1,91 @@
+From 33b8dfb90ecc5b4b2559c1fb43d7b743b72bf425 Mon Sep 17 00:00:00 2001
+From: Nikias Bassen
+Date: Wed, 11 Jan 2012 23:30:01 +0000
+Subject: fix compiler warnings
+
+---
+diff --git a/src/base64.c b/src/base64.c
+index 65c6061..e558d9e 100644
+--- a/src/base64.c
++++ b/src/base64.c
+@@ -104,9 +104,9 @@ static int base64decode_block(unsigned char *target, const char *data, size_t da
+ 
+ unsigned char *base64decode(const char *buf, size_t *size)
+ {
+-	if (!buf) return;
++	if (!buf) return NULL;
+ 	size_t len = strlen(buf);
+-	if (len <= 0) return;
++	if (len <= 0) return NULL;
+ 	unsigned char *outbuf = (unsigned char*)malloc((len/4)*3+3);
+ 
+ 	unsigned char *line;
+@@ -114,7 +114,7 @@ unsigned char *base64decode(const char *buf, size_t *size)
+ 
+ 	line = (unsigned char*)strtok((char*)buf, "\r\n\t ");
+ 	while (line) {
+-		p+=base64decode_block(outbuf+p, line, strlen((char*)line));
++		p+=base64decode_block(outbuf+p, (const char*)line, strlen((char*)line));
+ 
+ 		// get next line of base64 encoded block
+ 		line = (unsigned char*)strtok(NULL, "\r\n\t ");
+diff --git a/src/bplist.c b/src/bplist.c
+index d03dc2b..43354be 100644
+--- a/src/bplist.c
++++ b/src/bplist.c
+@@ -740,12 +740,6 @@ static void serialize_plist(node_t* node, void* data)
+     return;
+ }
+ 
+-static int free_index(void* key, void* value, void* user_data)
+-{
+-    free((uint64_t *) value);
+-    return TRUE;
+-}
+-
+ #define Log2(x) (x == 8 ? 3 : (x == 4 ? 2 : (x == 2 ? 1 : 0)))
+ 
+ static void write_int(bytearray_t * bplist, uint64_t val)
+@@ -998,7 +992,6 @@ void plist_to_bin(plist_t plist, char **plist_bin, uint32_t * length)
+     uint8_t trailer[BPLIST_TRL_SIZE];
+     //for string
+     long len = 0;
+-    int type = 0;
+     long items_read = 0;
+     long items_written = 0;
+     uint16_t *unicodestr = NULL;
+@@ -1087,7 +1080,6 @@ void plist_to_bin(plist_t plist, char **plist_bin, uint32_t * length)
+     }
+ 
+     //free intermediate objects
+-    //hash_table_foreach_remove(ref_table, free_index, NULL);
+     ptr_array_free(objects);
+     hash_table_destroy(ref_table);
+ 
+diff --git a/src/hashtable.c b/src/hashtable.c
+index 9716c25..08ff934 100644
+--- a/src/hashtable.c
++++ b/src/hashtable.c
+@@ -55,7 +55,6 @@ void hash_table_destroy(hashtable_t *ht)
+ void hash_table_insert(hashtable_t* ht, void *key, void *value)
+ {
+ 	if (!ht || !key) return;
+-	int i;
+ 
+ 	unsigned int hash = ht->hash_func(key);
+ 
+diff --git a/src/xplist.c b/src/xplist.c
+index edce2f9..ba312a1 100644
+--- a/src/xplist.c
++++ b/src/xplist.c
+@@ -342,7 +342,7 @@ static void xml_to_node(xmlNodePtr xml_node, plist_t * plist_node)
+         {
+             xmlChar *strval = xmlNodeGetContent(node);
+             time_t time = 0;
+-            if (strlen(strval) >= 11) {
++            if (strlen((const char*)strval) >= 11) {
+                 struct tm btime;
+                 parse_date((const char*)strval, &btime);
+                 time = mktime(&btime);
+--
+cgit v0.8.3.1-34-gbf3d

Added: trunk/dports/textproc/libplist/files/83fa6982dfddaed93195402e2e0b7435bc707e06.patch
===================================================================
--- trunk/dports/textproc/libplist/files/83fa6982dfddaed93195402e2e0b7435bc707e06.patch	                        (rev 0)
+++ trunk/dports/textproc/libplist/files/83fa6982dfddaed93195402e2e0b7435bc707e06.patch	2012-07-03 14:45:35 UTC (rev 94991)
@@ -0,0 +1,30 @@
+From 83fa6982dfddaed93195402e2e0b7435bc707e06 Mon Sep 17 00:00:00 2001
+From: Nikias Bassen
+Date: Wed, 11 Jan 2012 23:29:22 +0000
+Subject: libcnary: fix missing return value and missing variable initialization
+
+---
+diff --git a/libcnary/node.c b/libcnary/node.c
+index 1f9f669..264c78e 100644
+--- a/libcnary/node.c
++++ b/libcnary/node.c
+@@ -104,7 +104,7 @@ int node_detach(node_t* parent, node_t* child) {
+ 
+ int node_insert(node_t* parent, unsigned int index, node_t* child)
+ {
+-	if (!parent || !child) return;
++	if (!parent || !child) return -1;
+ 	child->isLeaf = TRUE;
+ 	child->isRoot = FALSE;
+ 	child->parent = parent;
+@@ -209,7 +209,7 @@ int node_child_position(struct node_t* parent, node_t* child)
+ node_t* node_copy_deep(node_t* node, copy_func_t copy_func)
+ {
+ 	if (!node) return NULL;
+-	void *data;
++	void *data = NULL;
+ 	if (copy_func) {
+ 		data = copy_func(node->data);
+ 	}
+--
+cgit v0.8.3.1-34-gbf3d

Added: trunk/dports/textproc/libplist/files/c5173d46a16220a743593e28359770c54adcc65b.patch
===================================================================
--- trunk/dports/textproc/libplist/files/c5173d46a16220a743593e28359770c54adcc65b.patch	                        (rev 0)
+++ trunk/dports/textproc/libplist/files/c5173d46a16220a743593e28359770c54adcc65b.patch	2012-07-03 14:45:35 UTC (rev 94991)
@@ -0,0 +1,29 @@
+From c5173d46a16220a743593e28359770c54adcc65b Mon Sep 17 00:00:00 2001
+From: Nikias Bassen
+Date: Sat, 11 Feb 2012 22:51:31 +0000
+Subject: bplist: fix invalid memory access in copy_plist_data
+
+---
+diff --git a/src/bplist.c b/src/bplist.c
+index 43354be..eff44fc 100644
+--- a/src/bplist.c
++++ b/src/bplist.c
+@@ -521,12 +521,12 @@ static void* copy_plist_data(const void* src)
+         break;
+     case PLIST_DATA:
+     case PLIST_ARRAY:
+-        dstdata->buff = (uint8_t *) malloc(sizeof(uint8_t *) * srcdata->length);
+-        memcpy(dstdata->buff, srcdata->buff, sizeof(uint8_t *) * srcdata->length);
++        dstdata->buff = (uint8_t*) malloc(sizeof(uint8_t) * srcdata->length);
++        memcpy(dstdata->buff, srcdata->buff, sizeof(uint8_t) * srcdata->length);
+         break;
+     case PLIST_DICT:
+-        dstdata->buff = (uint8_t *) malloc(sizeof(uint8_t *) * srcdata->length * 2);
+-        memcpy(dstdata->buff, srcdata->buff, sizeof(uint8_t *) * srcdata->length * 2);
++        dstdata->buff = (uint8_t*) malloc(sizeof(uint8_t) * srcdata->length * 2);
++        memcpy(dstdata->buff, srcdata->buff, sizeof(uint8_t) * srcdata->length * 2);
+         break;
+     default:
+         break;
+--
+cgit v0.8.3.1-34-gbf3d
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120703/e5d11842/attachment-0001.html>


More information about the macports-changes mailing list