Re: cmake and java (Was Re: cmake-2.8.6 3rd revision)

2011-10-14 Thread Paul Irofti
 The patch below should fix it.

Yes it does, both Java and JNI. Thanks!



Re: cmake-2.8.6 3rd revision

2011-10-13 Thread Paul Irofti
On Tue, Oct 11, 2011 at 07:15:19AM -0600, David Coppa wrote:
 Hi again,
 
 this one fixes another bug (into FindJNI.cmake) found by Vadim.

Is this tested with jdk-1.7.0?
Because the current cmake port has a bug in its regex as well.

 
 ciao,
 David
 
 Index: Makefile
 ===
 RCS file: /cvs/ports/devel/cmake/Makefile,v
 retrieving revision 1.45
 diff -u -p -r1.45 Makefile
 --- Makefile  8 Oct 2011 18:55:36 -   1.45
 +++ Makefile  11 Oct 2011 12:35:46 -
 @@ -5,7 +5,7 @@ VMEM_WARNING =Yes
  HOMEPAGE =   http://www.cmake.org/
  CATEGORIES = devel
  COMMENT =portable build system
 -DISTNAME =   cmake-2.8.5
 +DISTNAME =   cmake-2.8.6
  MASTER_SITES =   ${HOMEPAGE}files/v2.8/
  
  MAINTAINER = David Coppa dco...@openbsd.org
 @@ -44,9 +44,9 @@ pre-configure:
   ${WRKSRC}/Modules/FindQt.cmake \
   ${WRKSRC}/Modules/FindQt3.cmake \
   ${WRKSRC}/Modules/FindSDL.cmake \
 - ${WRKSRC}/Modules/FindwxWindows.cmake
 + ${WRKSRC}/Modules/FindwxWindows.cmake \
 + ${WRKSRC}/Modules/UseJava.cmake
  
 -# Remove spurious post-build files
  post-install:
   @rm ${WRKINST}/${LOCALBASE}/share/cmake/Modules/*.{beforesubst,orig}
   @rm ${WRKINST}/${LOCALBASE}/share/cmake/Modules/Compiler/*.orig
 Index: distinfo
 ===
 RCS file: /cvs/ports/devel/cmake/distinfo,v
 retrieving revision 1.12
 diff -u -p -r1.12 distinfo
 --- distinfo  20 Sep 2011 11:32:36 -  1.12
 +++ distinfo  11 Oct 2011 12:35:46 -
 @@ -1,5 +1,5 @@
 -MD5 (cmake-2.8.5.tar.gz) = PF0yzsD0wtxF9MLoT0ogxQ==
 -RMD160 (cmake-2.8.5.tar.gz) = 5HZ9wOo+U9o6sUzGr11C3RkO2nY=
 -SHA1 (cmake-2.8.5.tar.gz) = jdTDHLzPGil4KaR2oO950WFMo2g=
 -SHA256 (cmake-2.8.5.tar.gz) = Xhi/918BZWxk9VNBKokFUn4bhe+vMWPG+4HqWqztC5E=
 -SIZE (cmake-2.8.5.tar.gz) = 5517977
 +MD5 (cmake-2.8.6.tar.gz) = IUfaRS/ZISu5tFQqnu6dWw==
 +RMD160 (cmake-2.8.6.tar.gz) = wwlaR3Y2dJb4lbgHX9o3NWjwGHg=
 +SHA1 (cmake-2.8.6.tar.gz) = fCy9QtJ+JlgM1JI4khl7hLKpBnU=
 +SHA256 (cmake-2.8.6.tar.gz) = 5pmbgaw2fYX/sPabbEoO+W+V3BVO/TWS+c/rrN91co4=
 +SIZE (cmake-2.8.6.tar.gz) = 5583905
 Index: files/MacroPushRequiredVars.cmake
 ===
 RCS file: files/MacroPushRequiredVars.cmake
 diff -N files/MacroPushRequiredVars.cmake
 --- files/MacroPushRequiredVars.cmake 31 May 2010 06:29:27 -  1.1
 +++ /dev/null 1 Jan 1970 00:00:00 -
 @@ -1,47 +0,0 @@
 -# this module defines two macros:
 -# MACRO_PUSH_REQUIRED_VARS()
 -# and
 -# MACRO_POP_REQUIRED_VARS()
 -# use these if you call cmake macros which use
 -# any of the CMAKE_REQUIRED_XXX variables
 -#
 -# Usage:
 -# MACRO_PUSH_REQUIRED_VARS()
 -# SET(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} 
 -DSOME_MORE_DEF)
 -# CHECK_FUNCTION_EXISTS(...)
 -# MACRO_POP_REQUIRED_VARS()
 -
 -# Copyright (c) 2006, Alexander Neundorf, neund...@kde.org
 -#
 -# Redistribution and use is allowed according to the terms of the BSD 
 license.
 -# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
 -
 -MACRO(MACRO_PUSH_REQUIRED_VARS)
 -
 -   IF(NOT DEFINED _PUSH_REQUIRED_VARS_COUNTER)
 -  SET(_PUSH_REQUIRED_VARS_COUNTER 0)
 -   ENDIF(NOT DEFINED _PUSH_REQUIRED_VARS_COUNTER)
 -
 -   MATH(EXPR _PUSH_REQUIRED_VARS_COUNTER ${_PUSH_REQUIRED_VARS_COUNTER}+1)
 -
 -   SET(_CMAKE_REQUIRED_INCLUDES_SAVE_${_PUSH_REQUIRED_VARS_COUNTER}
 ${CMAKE_REQUIRED_INCLUDES})
 -   SET(_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_PUSH_REQUIRED_VARS_COUNTER} 
 ${CMAKE_REQUIRED_DEFINITIONS})
 -   SET(_CMAKE_REQUIRED_LIBRARIES_SAVE_${_PUSH_REQUIRED_VARS_COUNTER}   
 ${CMAKE_REQUIRED_LIBRARIES})
 -   SET(_CMAKE_REQUIRED_FLAGS_SAVE_${_PUSH_REQUIRED_VARS_COUNTER}   
 ${CMAKE_REQUIRED_FLAGS})
 -ENDMACRO(MACRO_PUSH_REQUIRED_VARS)
 -
 -MACRO(MACRO_POP_REQUIRED_VARS)
 -
 -# don't pop more than we pushed
 -   IF(${_PUSH_REQUIRED_VARS_COUNTER} GREATER 0)
 -
 -  SET(CMAKE_REQUIRED_INCLUDES
 ${_CMAKE_REQUIRED_INCLUDES_SAVE_${_PUSH_REQUIRED_VARS_COUNTER}})
 -  SET(CMAKE_REQUIRED_DEFINITIONS 
 ${_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_PUSH_REQUIRED_VARS_COUNTER}})
 -  SET(CMAKE_REQUIRED_LIBRARIES   
 ${_CMAKE_REQUIRED_LIBRARIES_SAVE_${_PUSH_REQUIRED_VARS_COUNTER}})
 -  SET(CMAKE_REQUIRED_FLAGS   
 ${_CMAKE_REQUIRED_FLAGS_SAVE_${_PUSH_REQUIRED_VARS_COUNTER}})
 -
 -  MATH(EXPR _PUSH_REQUIRED_VARS_COUNTER 
 ${_PUSH_REQUIRED_VARS_COUNTER}-1)
 -   ENDIF(${_PUSH_REQUIRED_VARS_COUNTER} GREATER 0)
 -
 -ENDMACRO(MACRO_POP_REQUIRED_VARS)
 -
 Index: patches/patch-CMakeLists_txt
 ===
 RCS file: /cvs/ports/devel/cmake/patches/patch-CMakeLists_txt,v
 retrieving revision 1.7
 diff -u -p -r1.7 patch-CMakeLists_txt
 --- patches/patch-CMakeLists_txt  20 Sep 2011 11:32:36 -  1.7
 +++ patches/patch-CMakeLists_txt  11 Oct 2011 12:35:46 -
 @@ 

Re: cmake-2.8.6 3rd revision

2011-10-13 Thread David Coppa
On Thu, Oct 13, 2011 at 9:36 AM, Paul Irofti p...@irofti.net wrote:
 On Tue, Oct 11, 2011 at 07:15:19AM -0600, David Coppa wrote:
 Hi again,

 this one fixes another bug (into FindJNI.cmake) found by Vadim.

 Is this tested with jdk-1.7.0?
 Because the current cmake port has a bug in its regex as well.

Where?

ciao,
David



Re: cmake-2.8.6 3rd revision

2011-10-13 Thread Paul Irofti
On Thu, Oct 13, 2011 at 09:41:41AM +0200, David Coppa wrote:
 On Thu, Oct 13, 2011 at 9:36 AM, Paul Irofti p...@irofti.net wrote:
  On Tue, Oct 11, 2011 at 07:15:19AM -0600, David Coppa wrote:
  Hi again,
 
  this one fixes another bug (into FindJNI.cmake) found by Vadim.
 
  Is this tested with jdk-1.7.0?
  Because the current cmake port has a bug in its regex as well.
 
 Where?

/usr/local/share/cmake/Modules/FindJava.cmake:129 and 131 as well.



Re: cmake-2.8.6 3rd revision

2011-10-13 Thread David Coppa
On Thu, 13 Oct 2011, Paul Irofti wrote:

 On Thu, Oct 13, 2011 at 09:41:41AM +0200, David Coppa wrote:
  On Thu, Oct 13, 2011 at 9:36 AM, Paul Irofti p...@irofti.net wrote:
   On Tue, Oct 11, 2011 at 07:15:19AM -0600, David Coppa wrote:
   Hi again,
  
   this one fixes another bug (into FindJNI.cmake) found by Vadim.
  
   Is this tested with jdk-1.7.0?
   Because the current cmake port has a bug in its regex as well.
  
  Where?
 
 /usr/local/share/cmake/Modules/FindJava.cmake:129 and 131 as well.

Ha, good catch. This is a consequence of the latest jdk update.

Ok for you to change it to:

 openjdk version \[0-9]+\\.[0-9]+\\.[0-9]\

??

ciao,
David



Re: cmake-2.8.6 3rd revision

2011-10-13 Thread Paul Irofti
On Thu, Oct 13, 2011 at 12:17:45PM +0300, Paul Irofti wrote:
 On Thu, Oct 13, 2011 at 09:41:41AM +0200, David Coppa wrote:
  On Thu, Oct 13, 2011 at 9:36 AM, Paul Irofti p...@irofti.net wrote:
   On Tue, Oct 11, 2011 at 07:15:19AM -0600, David Coppa wrote:
   Hi again,
  
   this one fixes another bug (into FindJNI.cmake) found by Vadim.
  
   Is this tested with jdk-1.7.0?
   Because the current cmake port has a bug in its regex as well.
  
  Where?
 
 /usr/local/share/cmake/Modules/FindJava.cmake:129 and 131 as well.

Oh and FindJNI.cmake is broken as well.

CMake Error: The following variables are used in this project, but they
are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the
CMake files:
JAVA_AWT_INCLUDE_PATH (ADVANCED)
[-path to where I did FIND_PACKAGE(JNI)-]
JAVA_INCLUDE_PATH (ADVANCED)
[-path to where I did FIND_PACKAGE(JNI)-]
JAVA_INCLUDE_PATH2 (ADVANCED)
[-path to where I did FIND_PACKAGE(JNI)-]



Re: cmake-2.8.6 3rd revision

2011-10-13 Thread David Coppa
On Thu, Oct 13, 2011 at 12:31 PM, Paul Irofti p...@irofti.net wrote:
 On Thu, Oct 13, 2011 at 12:17:45PM +0300, Paul Irofti wrote:
 On Thu, Oct 13, 2011 at 09:41:41AM +0200, David Coppa wrote:
  On Thu, Oct 13, 2011 at 9:36 AM, Paul Irofti p...@irofti.net wrote:
   On Tue, Oct 11, 2011 at 07:15:19AM -0600, David Coppa wrote:
   Hi again,
  
   this one fixes another bug (into FindJNI.cmake) found by Vadim.
  
   Is this tested with jdk-1.7.0?
   Because the current cmake port has a bug in its regex as well.
 
  Where?

 /usr/local/share/cmake/Modules/FindJava.cmake:129 and 131 as well.

 Oh and FindJNI.cmake is broken as well.

 CMake Error: The following variables are used in this project, but they
 are set to NOTFOUND.
 Please set them or make sure they are set and tested correctly in the
 CMake files:
 JAVA_AWT_INCLUDE_PATH (ADVANCED)
 [-path to where I did FIND_PACKAGE(JNI)-]
 JAVA_INCLUDE_PATH (ADVANCED)
 [-path to where I did FIND_PACKAGE(JNI)-]
 JAVA_INCLUDE_PATH2 (ADVANCED)
 [-path to where I did FIND_PACKAGE(JNI)-]

Paul, please tell me how you're testing this, so I can properly fix
cmake java modules.
What software is this? iirc, we have no cmake based java ports in our tree...

ciao,
David



Re: cmake-2.8.6 3rd revision

2011-10-13 Thread Paul Irofti
On Thu, Oct 13, 2011 at 12:35:03PM +0200, David Coppa wrote:
 On Thu, Oct 13, 2011 at 12:31 PM, Paul Irofti p...@irofti.net wrote:
  On Thu, Oct 13, 2011 at 12:17:45PM +0300, Paul Irofti wrote:
  On Thu, Oct 13, 2011 at 09:41:41AM +0200, David Coppa wrote:
   On Thu, Oct 13, 2011 at 9:36 AM, Paul Irofti p...@irofti.net wrote:
On Tue, Oct 11, 2011 at 07:15:19AM -0600, David Coppa wrote:
Hi again,
   
this one fixes another bug (into FindJNI.cmake) found by Vadim.
   
Is this tested with jdk-1.7.0?
Because the current cmake port has a bug in its regex as well.
  
   Where?
 
  /usr/local/share/cmake/Modules/FindJava.cmake:129 and 131 as well.
 
  Oh and FindJNI.cmake is broken as well.
 
  CMake Error: The following variables are used in this project, but they
  are set to NOTFOUND.
  Please set them or make sure they are set and tested correctly in the
  CMake files:
  JAVA_AWT_INCLUDE_PATH (ADVANCED)
  [-path to where I did FIND_PACKAGE(JNI)-]
  JAVA_INCLUDE_PATH (ADVANCED)
  [-path to where I did FIND_PACKAGE(JNI)-]
  JAVA_INCLUDE_PATH2 (ADVANCED)
  [-path to where I did FIND_PACKAGE(JNI)-]
 
 Paul, please tell me how you're testing this, so I can properly fix
 cmake java modules.

I'm using:
FIND_PACKAGE(JNI 1.6)

But:
FIND_PACKAGE(JAVA 1.6)
also fails.

 What software is this? iirc, we have no cmake based java ports in our tree...

Its work so you can't test this. But those are the only lines that I
tried to use in regards to the cmake modules. And they both fail on
OpenBSD. Linux, Darwin, Windows are fine.

In the Java case I looked it up and it was the regex. I gave up on the
JNI case.



cmake-2.8.6 3rd revision

2011-10-11 Thread David Coppa
Hi again,

this one fixes another bug (into FindJNI.cmake) found by Vadim.

ciao,
David

Index: Makefile
===
RCS file: /cvs/ports/devel/cmake/Makefile,v
retrieving revision 1.45
diff -u -p -r1.45 Makefile
--- Makefile8 Oct 2011 18:55:36 -   1.45
+++ Makefile11 Oct 2011 12:35:46 -
@@ -5,7 +5,7 @@ VMEM_WARNING =  Yes
 HOMEPAGE = http://www.cmake.org/
 CATEGORIES =   devel
 COMMENT =  portable build system
-DISTNAME = cmake-2.8.5
+DISTNAME = cmake-2.8.6
 MASTER_SITES = ${HOMEPAGE}files/v2.8/
 
 MAINTAINER =   David Coppa dco...@openbsd.org
@@ -44,9 +44,9 @@ pre-configure:
${WRKSRC}/Modules/FindQt.cmake \
${WRKSRC}/Modules/FindQt3.cmake \
${WRKSRC}/Modules/FindSDL.cmake \
-   ${WRKSRC}/Modules/FindwxWindows.cmake
+   ${WRKSRC}/Modules/FindwxWindows.cmake \
+   ${WRKSRC}/Modules/UseJava.cmake
 
-# Remove spurious post-build files
 post-install:
@rm ${WRKINST}/${LOCALBASE}/share/cmake/Modules/*.{beforesubst,orig}
@rm ${WRKINST}/${LOCALBASE}/share/cmake/Modules/Compiler/*.orig
Index: distinfo
===
RCS file: /cvs/ports/devel/cmake/distinfo,v
retrieving revision 1.12
diff -u -p -r1.12 distinfo
--- distinfo20 Sep 2011 11:32:36 -  1.12
+++ distinfo11 Oct 2011 12:35:46 -
@@ -1,5 +1,5 @@
-MD5 (cmake-2.8.5.tar.gz) = PF0yzsD0wtxF9MLoT0ogxQ==
-RMD160 (cmake-2.8.5.tar.gz) = 5HZ9wOo+U9o6sUzGr11C3RkO2nY=
-SHA1 (cmake-2.8.5.tar.gz) = jdTDHLzPGil4KaR2oO950WFMo2g=
-SHA256 (cmake-2.8.5.tar.gz) = Xhi/918BZWxk9VNBKokFUn4bhe+vMWPG+4HqWqztC5E=
-SIZE (cmake-2.8.5.tar.gz) = 5517977
+MD5 (cmake-2.8.6.tar.gz) = IUfaRS/ZISu5tFQqnu6dWw==
+RMD160 (cmake-2.8.6.tar.gz) = wwlaR3Y2dJb4lbgHX9o3NWjwGHg=
+SHA1 (cmake-2.8.6.tar.gz) = fCy9QtJ+JlgM1JI4khl7hLKpBnU=
+SHA256 (cmake-2.8.6.tar.gz) = 5pmbgaw2fYX/sPabbEoO+W+V3BVO/TWS+c/rrN91co4=
+SIZE (cmake-2.8.6.tar.gz) = 5583905
Index: files/MacroPushRequiredVars.cmake
===
RCS file: files/MacroPushRequiredVars.cmake
diff -N files/MacroPushRequiredVars.cmake
--- files/MacroPushRequiredVars.cmake   31 May 2010 06:29:27 -  1.1
+++ /dev/null   1 Jan 1970 00:00:00 -
@@ -1,47 +0,0 @@
-# this module defines two macros:
-# MACRO_PUSH_REQUIRED_VARS()
-# and
-# MACRO_POP_REQUIRED_VARS()
-# use these if you call cmake macros which use
-# any of the CMAKE_REQUIRED_XXX variables
-#
-# Usage:
-# MACRO_PUSH_REQUIRED_VARS()
-# SET(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -DSOME_MORE_DEF)
-# CHECK_FUNCTION_EXISTS(...)
-# MACRO_POP_REQUIRED_VARS()
-
-# Copyright (c) 2006, Alexander Neundorf, neund...@kde.org
-#
-# Redistribution and use is allowed according to the terms of the BSD license.
-# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
-
-MACRO(MACRO_PUSH_REQUIRED_VARS)
-
-   IF(NOT DEFINED _PUSH_REQUIRED_VARS_COUNTER)
-  SET(_PUSH_REQUIRED_VARS_COUNTER 0)
-   ENDIF(NOT DEFINED _PUSH_REQUIRED_VARS_COUNTER)
-
-   MATH(EXPR _PUSH_REQUIRED_VARS_COUNTER ${_PUSH_REQUIRED_VARS_COUNTER}+1)
-
-   SET(_CMAKE_REQUIRED_INCLUDES_SAVE_${_PUSH_REQUIRED_VARS_COUNTER}
${CMAKE_REQUIRED_INCLUDES})
-   SET(_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_PUSH_REQUIRED_VARS_COUNTER} 
${CMAKE_REQUIRED_DEFINITIONS})
-   SET(_CMAKE_REQUIRED_LIBRARIES_SAVE_${_PUSH_REQUIRED_VARS_COUNTER}   
${CMAKE_REQUIRED_LIBRARIES})
-   SET(_CMAKE_REQUIRED_FLAGS_SAVE_${_PUSH_REQUIRED_VARS_COUNTER}   
${CMAKE_REQUIRED_FLAGS})
-ENDMACRO(MACRO_PUSH_REQUIRED_VARS)
-
-MACRO(MACRO_POP_REQUIRED_VARS)
-
-# don't pop more than we pushed
-   IF(${_PUSH_REQUIRED_VARS_COUNTER} GREATER 0)
-
-  SET(CMAKE_REQUIRED_INCLUDES
${_CMAKE_REQUIRED_INCLUDES_SAVE_${_PUSH_REQUIRED_VARS_COUNTER}})
-  SET(CMAKE_REQUIRED_DEFINITIONS 
${_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_PUSH_REQUIRED_VARS_COUNTER}})
-  SET(CMAKE_REQUIRED_LIBRARIES   
${_CMAKE_REQUIRED_LIBRARIES_SAVE_${_PUSH_REQUIRED_VARS_COUNTER}})
-  SET(CMAKE_REQUIRED_FLAGS   
${_CMAKE_REQUIRED_FLAGS_SAVE_${_PUSH_REQUIRED_VARS_COUNTER}})
-
-  MATH(EXPR _PUSH_REQUIRED_VARS_COUNTER ${_PUSH_REQUIRED_VARS_COUNTER}-1)
-   ENDIF(${_PUSH_REQUIRED_VARS_COUNTER} GREATER 0)
-
-ENDMACRO(MACRO_POP_REQUIRED_VARS)
-
Index: patches/patch-CMakeLists_txt
===
RCS file: /cvs/ports/devel/cmake/patches/patch-CMakeLists_txt,v
retrieving revision 1.7
diff -u -p -r1.7 patch-CMakeLists_txt
--- patches/patch-CMakeLists_txt20 Sep 2011 11:32:36 -  1.7
+++ patches/patch-CMakeLists_txt11 Oct 2011 12:35:46 -
@@ -1,7 +1,7 @@
 $OpenBSD: patch-CMakeLists_txt,v 1.7 2011/09/20 11:32:36 dcoppa Exp $
 CMakeLists.txt.origFri Jul  8 14:21:43 2011
-+++ CMakeLists.txt Fri Sep  9 09:49:49 2011
-@@ -250,6 +250,15 @@ MACRO (CMAKE_BUILD_UTILITIES)
+---