PATCH devel/libplist. Wrong order of include dirs.

2013-04-23 Thread Juan Francisco Cantero Hurtado
The file plist.c requires the header plist/plist.h from
WRKSRC/include. The port has LOCALBASE/include in CFLAGS, so gcc picks
plist/plist.h from /usr/local.

The patch bellow fixes the order of the include dirs.


[ 18%] Building C object src/CMakeFiles/plist.dir/plist.c.o
cd /usr/ports/pobj/libplist-1.10/build-amd64/src  /usr/bin/cc
-Dplist_EXPORTS -O2 -pipe -g -I/usr/local/include -pthread
-DPLIST_BYTE_ORDER=0 -fPIC
-I/usr/ports/pobj/libplist-1.10/libplist-1.10/include
-I/usr/local/include/libxml2
-I/usr/ports/pobj/libplist-1.10/libplist-1.10/libcnary/include-o
CMakeFiles/plist.dir/plist.c.o   -c
/usr/ports/pobj/libplist-1.10/libplist-1.10/src/plist.c
/usr/ports/pobj/libplist-1.10/libplist-1.10/src/plist.c: In function
'plist_new_uid':
/usr/ports/pobj/libplist-1.10/libplist-1.10/src/plist.c:144: error:
'PLIST_UID' undeclared (first use in this function)
/usr/ports/pobj/libplist-1.10/libplist-1.10/src/plist.c:144: error:
(Each undeclared identifier is reported only once
/usr/ports/pobj/libplist-1.10/libplist-1.10/src/plist.c:144: error: for
each function it appears in.)
/usr/ports/pobj/libplist-1.10/libplist-1.10/src/plist.c: In function
'plist_get_type_and_value':
/usr/ports/pobj/libplist-1.10/libplist-1.10/src/plist.c:502: error:
'PLIST_UID' undeclared (first use in this function)
/usr/ports/pobj/libplist-1.10/libplist-1.10/src/plist.c: In function
'plist_get_uid_val':
/usr/ports/pobj/libplist-1.10/libplist-1.10/src/plist.c:584: error:
'PLIST_UID' undeclared (first use in this function)
/usr/ports/pobj/libplist-1.10/libplist-1.10/src/plist.c: In function
'plist_data_compare':
/usr/ports/pobj/libplist-1.10/libplist-1.10/src/plist.c:639: error:
'PLIST_UID' undeclared (first use in this function)
/usr/ports/pobj/libplist-1.10/libplist-1.10/src/plist.c: In function
'plist_set_element_val':
/usr/ports/pobj/libplist-1.10/libplist-1.10/src/plist.c:715: error:
'PLIST_UID' undeclared (first use in this function)
/usr/ports/pobj/libplist-1.10/libplist-1.10/src/plist.c: In function
'plist_set_type':
/usr/ports/pobj/libplist-1.10/libplist-1.10/src/plist.c:754: error:
'PLIST_UID' undeclared (first use in this function)
/usr/ports/pobj/libplist-1.10/libplist-1.10/src/plist.c: In function
'plist_set_uid_val':
/usr/ports/pobj/libplist-1.10/libplist-1.10/src/plist.c:792: error:
'PLIST_UID' undeclared (first use in this function)
*** Error 1 in . (src/CMakeFiles/plist.dir/build.make:59
'src/CMakeFiles/plist.dir/plist.c.o')
*** Error 1 in . (CMakeFiles/Makefile2:163
'src/CMakeFiles/plist.dir/all')
*** Error 1 in /usr/ports/pobj/libplist-1.10/build-amd64 (Makefile:147
'all')
*** Error 1 in . (/usr/ports/infrastructure/mk/bsd.port.mk:2670
'/usr/ports/pobj/libplist-1.10/build-amd64/.build_done')
*** Error 1 in . (/usr/ports/infrastructure/mk/bsd.port.mk:1863
'/usr/ports/packages/amd64/all/libplist-1.10.tgz')
*** Error 1 in . (/usr/ports/infrastructure/mk/bsd.port.mk:2409
'_internal-package')
*** Error 1 in /usr/ports/devel/libplist
(/usr/ports/infrastructure/mk/bsd.port.mk:2389 'package')


Index: Makefile
===
RCS file: /cvs/ports/devel/libplist/Makefile,v
retrieving revision 1.6
diff -u -p -r1.6 Makefile
--- Makefile12 Apr 2013 17:12:55 -  1.6
+++ Makefile23 Apr 2013 16:14:21 -
@@ -8,6 +8,7 @@ SHARED_ONLY =   Yes
 VERSION =  1.10
 SUBST_VARS +=  VERSION
 DISTNAME = libplist-${VERSION}
+REVISION = 0
 PKGNAME-main = ${DISTNAME}
 PKGNAME-python =   py-plist-${VERSION}
 
@@ -39,6 +40,6 @@ WANTLIB +=glib-2.0 m stdc++ xml2
 WANTLIB-main +=${WANTLIB} c pthread
 WANTLIB-python +=  ${WANTLIB} plist plist++ python${MODPY_VERSION}
 
-CONFIGURE_ARGS =   -DCMAKE_C_FLAGS=${CFLAGS} -I${LOCALBASE}/include 
-pthread
+CONFIGURE_ARGS =   -DCMAKE_C_FLAGS=${CFLAGS} -pthread
 
 .include bsd.port.mk
Index: patches/patch-CMakeLists_txt
===
RCS file: patches/patch-CMakeLists_txt
diff -N patches/patch-CMakeLists_txt
--- /dev/null   1 Jan 1970 00:00:00 -
+++ patches/patch-CMakeLists_txt23 Apr 2013 16:14:21 -
@@ -0,0 +1,13 @@
+$OpenBSD$
+--- CMakeLists.txt.origTue Apr 23 17:41:59 2013
 CMakeLists.txt Tue Apr 23 17:42:40 2013
+@@ -34,7 +34,8 @@ IF(ENABLE_SWIG OR ENABLE_CYTHON)
+ ENDIF(ENABLE_SWIG OR ENABLE_CYTHON)
+ 
+ INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/include
+-   ${CMAKE_INCLUDE_PATH})
++   ${CMAKE_INCLUDE_PATH}
++   /usr/local/include)
+ 
+ ENABLE_TESTING()
+ 



Re: PATCH devel/libplist. Wrong order of include dirs.

2013-04-23 Thread Stuart Henderson
On 2013/04/23 18:23, Juan Francisco Cantero Hurtado wrote:
 The file plist.c requires the header plist/plist.h from
 WRKSRC/include. The port has LOCALBASE/include in CFLAGS, so gcc picks
 plist/plist.h from /usr/local.
 
 The patch bellow fixes the order of the include dirs.

Don't hardcode /usr/local, use ${LOCALBASE} or ${PREFIX} as appropriate
(in this case, localbase, because it refers to already installed packages
rather than where this package will be installed)

  DISTNAME =   libplist-${VERSION}
 +REVISION =   0

probably not strictly necessary, but doesn't hurt.

 -CONFIGURE_ARGS = -DCMAKE_C_FLAGS=${CFLAGS} -I${LOCALBASE}/include 
 -pthread
 +CONFIGURE_ARGS = -DCMAKE_C_FLAGS=${CFLAGS} -pthread

mid update so can't check now, but can you just use this instead?

CONFIGURE_ARGS =-DCMAKE_C_FLAGS=${CFLAGS} -I. -I${LOCALBASE}/include 
-pthread



Re: PATCH devel/libplist. Wrong order of include dirs.

2013-04-23 Thread Juan Francisco Cantero Hurtado
On Tue, Apr 23, 2013 at 05:32:55PM +0100, Stuart Henderson wrote:
 On 2013/04/23 18:23, Juan Francisco Cantero Hurtado wrote:
  The file plist.c requires the header plist/plist.h from
  WRKSRC/include. The port has LOCALBASE/include in CFLAGS, so gcc picks
  plist/plist.h from /usr/local.
  
  The patch bellow fixes the order of the include dirs.
 
 Don't hardcode /usr/local, use ${LOCALBASE} or ${PREFIX} as appropriate
 (in this case, localbase, because it refers to already installed packages
 rather than where this package will be installed)

I know. It didn't work. I only see the new flag -I/include in the
output of the compilation.

 
   DISTNAME = libplist-${VERSION}
  +REVISION = 0
 
 probably not strictly necessary, but doesn't hurt.
 
  -CONFIGURE_ARGS =   -DCMAKE_C_FLAGS=${CFLAGS} -I${LOCALBASE}/include 
  -pthread
  +CONFIGURE_ARGS =   -DCMAKE_C_FLAGS=${CFLAGS} -pthread
 
 mid update so can't check now, but can you just use this instead?
 
 CONFIGURE_ARGS =  -DCMAKE_C_FLAGS=${CFLAGS} -I. -I${LOCALBASE}/include 
 -pthread
 

Yep. New patch.

Index: Makefile
===
RCS file: /cvs/ports/devel/libplist/Makefile,v
retrieving revision 1.6
diff -u -p -r1.6 Makefile
--- Makefile12 Apr 2013 17:12:55 -  1.6
+++ Makefile23 Apr 2013 17:22:58 -
@@ -39,6 +39,6 @@ WANTLIB +=glib-2.0 m stdc++ xml2
 WANTLIB-main +=${WANTLIB} c pthread
 WANTLIB-python +=  ${WANTLIB} plist plist++ python${MODPY_VERSION}
 
-CONFIGURE_ARGS =   -DCMAKE_C_FLAGS=${CFLAGS} -I${LOCALBASE}/include 
-pthread
+CONFIGURE_ARGS =   -DCMAKE_C_FLAGS=${CFLAGS} -I. -I${LOCALBASE}/include 
-pthread
 
 .include bsd.port.mk

-- 
Juan Francisco Cantero Hurtado http://juanfra.info