Wed Mar 9 21:32:41 2016 UTC ()
Update qore to build with open/libressl versions that miss evp_SHA.
Bump PKGREVISION.


(nros)
diff -r1.5 -r1.6 pkgsrc/lang/qore/Makefile
diff -r1.3 -r1.4 pkgsrc/lang/qore/distinfo
diff -r1.1 -r0 pkgsrc/lang/qore/patches/patch-configure
diff -r0 -r1.1 pkgsrc/lang/qore/patches/patch-configure.ac
diff -r0 -r1.1 pkgsrc/lang/qore/patches/patch-include_qore_QoreLib.h
diff -r0 -r1.1 pkgsrc/lang/qore/patches/patch-lib_QoreLib.cpp
diff -r0 -r1.1 pkgsrc/lang/qore/patches/patch-lib_qc__option.qpp
diff -r0 -r1.1 pkgsrc/lang/qore/patches/patch-lib_ql__crypto.qpp
diff -r1.1 -r1.2 pkgsrc/lang/qore/patches/patch-lib_QoreTimeZoneManager.cpp

cvs diff -r1.5 -r1.6 pkgsrc/lang/qore/Makefile (expand / switch to unified diff)

--- pkgsrc/lang/qore/Makefile 2016/03/05 11:27:50 1.5
+++ pkgsrc/lang/qore/Makefile 2016/03/09 21:32:41 1.6
@@ -1,40 +1,40 @@ @@ -1,40 +1,40 @@
1# $NetBSD: Makefile,v 1.5 2016/03/05 11:27:50 jperkin Exp $ 1# $NetBSD: Makefile,v 1.6 2016/03/09 21:32:41 nros Exp $
2 2
3DISTNAME= qore-0.8.11 3DISTNAME= qore-0.8.11
4PKGREVISION= 3 4PKGREVISION= 4
5CATEGORIES= lang 5CATEGORIES= lang
6MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=qore/} 6MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=qore/}
7EXTRACT_SUFX= .tar.bz2 7EXTRACT_SUFX= .tar.bz2
8 8
9MAINTAINER= nros@users.sourceforge.net 9MAINTAINER= nros@users.sourceforge.net
10COMMENT= Qore programming language 10COMMENT= Qore programming language
11HOMEPAGE= http://www.qore.org/ 11HOMEPAGE= http://www.qore.org/
12LICENSE= gnu-gpl-v2 OR gnu-lgpl-v2.1 OR mit 12LICENSE= gnu-gpl-v2 OR gnu-lgpl-v2.1 OR mit
13 13
14GNU_CONFIGURE= yes 14GNU_CONFIGURE= yes
15USE_LIBTOOL= yes 15USE_LIBTOOL= yes
16USE_TOOLS+= bison flex gmake pax 16USE_TOOLS+= autoconf bison flex gmake pax
17USE_LANGUAGES= c c++ 17USE_LANGUAGES= c c++
18PTHREAD_OPTS+= native 18PTHREAD_OPTS+= native
19FLEX_REQD= 2.5.31 19FLEX_REQD= 2.5.31
20 20
21# make AC_CHECK_FUNC find gethost* etc on smartos 
22# http://sourceforge.net/p/qore/code/6980 
23LIBS.SunOS+= -lnsl 
24 
25PKGCONFIG_OVERRIDE+= qore.pc.in 21PKGCONFIG_OVERRIDE+= qore.pc.in
26REPLACE_QORE= doxygen/qdx 22REPLACE_QORE= doxygen/qdx
27 23
 24pre-configure:
 25 set -e; cd ${WRKSRC}; \
 26 autoheader; autoconf
 27
28#This is needed in order to comply the with MIT license and binary distribution 28#This is needed in order to comply the with MIT license and binary distribution
29#Install docs 29#Install docs
30licensedir= share/doc/qore/license 30licensedir= share/doc/qore/license
31INSTALLATION_DIRS+= ${licensedir} 31INSTALLATION_DIRS+= ${licensedir}
32post-install: 32post-install:
33 ${INSTALL_DATA} ${WRKSRC}/COPYING.GPL ${DESTDIR}${PREFIX}/${licensedir} 33 ${INSTALL_DATA} ${WRKSRC}/COPYING.GPL ${DESTDIR}${PREFIX}/${licensedir}
34 ${INSTALL_DATA} ${WRKSRC}/COPYING.LGPL ${DESTDIR}${PREFIX}/${licensedir} 34 ${INSTALL_DATA} ${WRKSRC}/COPYING.LGPL ${DESTDIR}${PREFIX}/${licensedir}
35 ${INSTALL_DATA} ${WRKSRC}/COPYING.MIT ${DESTDIR}${PREFIX}/${licensedir} 35 ${INSTALL_DATA} ${WRKSRC}/COPYING.MIT ${DESTDIR}${PREFIX}/${licensedir}
36 ${INSTALL_DATA} ${WRKSRC}/README-LICENSE ${DESTDIR}${PREFIX}/${licensedir} 36 ${INSTALL_DATA} ${WRKSRC}/README-LICENSE ${DESTDIR}${PREFIX}/${licensedir}
37 cd ${WRKSRC}/docs/ && ${PAX} -wr * ${DESTDIR}${PREFIX}/share/doc/qore 37 cd ${WRKSRC}/docs/ && ${PAX} -wr * ${DESTDIR}${PREFIX}/share/doc/qore
38 ${CHOWN} -R ${SHAREOWN}:${SHAREGRP} ${DESTDIR}${PREFIX}/share/doc/qore 38 ${CHOWN} -R ${SHAREOWN}:${SHAREGRP} ${DESTDIR}${PREFIX}/share/doc/qore
39 39
40.include "application.mk" 40.include "application.mk"

cvs diff -r1.3 -r1.4 pkgsrc/lang/qore/distinfo (expand / switch to unified diff)

--- pkgsrc/lang/qore/distinfo 2015/11/03 22:50:42 1.3
+++ pkgsrc/lang/qore/distinfo 2016/03/09 21:32:41 1.4
@@ -1,9 +1,13 @@ @@ -1,9 +1,13 @@
1$NetBSD: distinfo,v 1.3 2015/11/03 22:50:42 agc Exp $ 1$NetBSD: distinfo,v 1.4 2016/03/09 21:32:41 nros Exp $
2 2
3SHA1 (qore-0.8.11.tar.bz2) = 16699762ce22e333b1d5eb782a0077f7e7dc7b15 3SHA1 (qore-0.8.11.tar.bz2) = 16699762ce22e333b1d5eb782a0077f7e7dc7b15
4RMD160 (qore-0.8.11.tar.bz2) = 1dcae042c51daaff81485bbb70459a104076a67a 4RMD160 (qore-0.8.11.tar.bz2) = 1dcae042c51daaff81485bbb70459a104076a67a
5SHA512 (qore-0.8.11.tar.bz2) = 83dfd293f8d0ced52eeca8e0023f8a943cbf3be6426e0091032ef67769ac1103e04b4b9017c4443d94695407a5f727edf06b6ba3c3bb71a95b5c0bb0da5f8ce9 5SHA512 (qore-0.8.11.tar.bz2) = 83dfd293f8d0ced52eeca8e0023f8a943cbf3be6426e0091032ef67769ac1103e04b4b9017c4443d94695407a5f727edf06b6ba3c3bb71a95b5c0bb0da5f8ce9
6Size (qore-0.8.11.tar.bz2) = 20074057 bytes 6Size (qore-0.8.11.tar.bz2) = 20074057 bytes
7SHA1 (patch-configure) = adf260106c141c38176527ae0e338e420d3cde67 7SHA1 (patch-configure.ac) = 4d14a82f96828a4958279f6e3f2126482e52bad7
8SHA1 (patch-include_qore_QoreFile.h) = 878b81d936bc51f19ae3dac76e25e865bbd0d55d 8SHA1 (patch-include_qore_QoreFile.h) = 878b81d936bc51f19ae3dac76e25e865bbd0d55d
9SHA1 (patch-lib_QoreTimeZoneManager.cpp) = fcb17746e0f90b871fae71ed77054f3b8f5d11db 9SHA1 (patch-include_qore_QoreLib.h) = a13da003160e5069817312a7587262a0cf7e51a1
 10SHA1 (patch-lib_QoreLib.cpp) = 476aeb3f42f0a48fdff4a9335d64f59fec326618
 11SHA1 (patch-lib_QoreTimeZoneManager.cpp) = d74e69c25ffddfa7bb1582cab7cba97abca3240e
 12SHA1 (patch-lib_qc__option.qpp) = f5b3d05a7975eb77ced74839f1efa36b9cafd75b
 13SHA1 (patch-lib_ql__crypto.qpp) = 4211e7df7d3c27bd22df63552b4457e9fb79099a

File Deleted: pkgsrc/lang/qore/patches/Attic/patch-configure

File Added: pkgsrc/lang/qore/patches/Attic/patch-configure.ac
$NetBSD: patch-configure.ac,v 1.1 2016/03/09 21:32:41 nros Exp $
* pkgsrc doesn't use lib64 or targetdir so don't set it.
  fixes build on linux.
  http://sf.net/p/qore/code/6817/
* Fix build with open/libressl releases without evp_SHA
  https://github.com/qorelanguage/qore/commit/fc181070ad1afbf49af2e8fc968b97328d690a86
* make AC_CHECK_FUNC find gethost* etc on smartos
  http://sourceforge.net/p/qore/code/6980
--- configure.ac.orig	2016-03-09 20:19:21.000000000 +0000
+++ configure.ac
@@ -295,14 +295,6 @@ if test "$enable_64bit" = "yes"; then
       *linux*)	if test "$GXX" = "yes"; then
 		   CXXFLAGS="$CXXFLAGS -m64"
 		fi
-		# only set LIBSUFFIX=64 if /usr/lib64 exists
-		if test -d /usr/lib64; then
-		   LIBSUFFIX=64
-                fi
-		target="${host_cpu}-${host_os}"
-		if test -d /usr/lib/$target; then
-		   LIBSUFFIX=/$target
-                fi
 		AC_SUBST(LIBSUFFIX)
 		;;
       *hpux*)	if test "$host_cpu" = "ia64"; then
@@ -1071,6 +1063,15 @@ else
     CPPFLAGS="$CPPFLAGS $QORE_LIB_CPPFLAGS $OPENSSL_CPPFLAGS"
     LIBS="$LIBS $QORE_LIB_LDFLAGS $OPENSSL_LDFLAGS"
 
+    # check for SHA-0 algorithm
+    AC_MSG_CHECKING([for SHA0 in openssl])
+    AC_LINK_IFELSE([AC_LANG_PROGRAM(
+    [[#include <openssl/evp.h>]],
+    [[const EVP_MD *evp = EVP_sha();]])],
+       [AC_MSG_RESULT([found])
+        AC_DEFINE([HAVE_OPENSSL_SHA], 1, [define if the sha0 algorithm is available in openssl])],
+       [AC_MSG_RESULT([not found])])
+
     # check for SHA512 algorithm
     AC_MSG_CHECKING([for SHA224, SHA256, SHA384, SHA512 in openssl])
     AC_LINK_IFELSE([AC_LANG_PROGRAM(
@@ -1377,6 +1378,9 @@ fi
 # see if the socket library is required
 AC_SEARCH_LIBS(setsockopt, socket)
 
+# see if the nsl library is required
+AC_SEARCH_LIBS(gethostbyname, nsl)
+
 # look for librt (needed by clock_gettime() on some platforms)
 AC_SEARCH_LIBS(clock_gettime, rt)
 

File Added: pkgsrc/lang/qore/patches/Attic/patch-include_qore_QoreLib.h
$NetBSD: patch-include_qore_QoreLib.h,v 1.1 2016/03/09 21:32:41 nros Exp $
* Fix build with open/libressl releases without evp_SHA
  https://github.com/qorelanguage/qore/commit/fc181070ad1afbf49af2e8fc968b97328d690a86
--- include/qore/QoreLib.h.orig	2016-03-09 20:32:22.000000000 +0000
+++ include/qore/QoreLib.h
@@ -372,6 +372,8 @@ DLLEXPORT const char* tz_get_region_name
 #define QORE_OPT_RUNTIME_STACK_TRACE     "runtime stack tracing"
 //! option: library debugging
 #define QORE_OPT_LIBRARY_DEBUGGING       "library debugging"
+//! option: ssh0 algorithm supported (depends on openssl used to compile qore)
+#define QORE_OPT_SHA                     "openssl sha"
 //! option: ssh224 algorithm supported (depends on openssl used to compile qore)
 #define QORE_OPT_SHA224                  "openssl sha224"
 //! option: ssh256 algorithm supported (depends on openssl used to compile qore) 

File Added: pkgsrc/lang/qore/patches/Attic/patch-lib_QoreLib.cpp
$NetBSD: patch-lib_QoreLib.cpp,v 1.1 2016/03/09 21:32:41 nros Exp $
* Fix build with open/libressl releases without evp_SHA
  https://github.com/qorelanguage/qore/commit/fc181070ad1afbf49af2e8fc968b97328d690a86
--- lib/QoreLib.cpp.orig	2016-03-09 20:30:24.000000000 +0000
+++ lib/QoreLib.cpp
@@ -185,6 +185,15 @@ const qore_option_s qore_option_list_l[]
      false
 #endif
    },
+   { QORE_OPT_SHA,
+     "HAVE_SHA",
+     QO_ALGORITHM,
+#ifdef HAVE_OPENSSL_SHA
+     true
+#else
+     false
+#endif
+   },
    { QORE_OPT_SHA224,
      "HAVE_SSH224",
      QO_ALGORITHM,

File Added: pkgsrc/lang/qore/patches/Attic/patch-lib_qc__option.qpp
$NetBSD: patch-lib_qc__option.qpp,v 1.1 2016/03/09 21:32:41 nros Exp $
* Fix build with open/libressl releases without evp_SHA
  https://github.com/qorelanguage/qore/commit/fc181070ad1afbf49af2e8fc968b97328d690a86
--- lib/qc_option.qpp.orig	2016-03-09 20:34:02.000000000 +0000
+++ lib/qc_option.qpp
@@ -139,6 +139,12 @@
 #define QORE_CONST_HAVE_STRUCT_FLOCK 0
 #endif
 
+#ifdef HAVE_OPENSSL_SHA
+#define QORE_CONST_HAVE_SHA 1
+#else
+#define QORE_CONST_HAVE_SHA 0
+#endif
+
 #if !defined(OPENSSL_NO_SHA256) && defined(HAVE_OPENSSL_SHA512)
 #define QORE_CONST_HAVE_SHA256 1
 #else
@@ -282,6 +288,9 @@ const HAVE_UNIX_FILEMGT = bool(QORE_CONS
  */
 const HAVE_FILE_LOCKING = bool(QORE_CONST_HAVE_STRUCT_FLOCK);
 
+//! Indicates if the openssl library used to build the qore library supported the SHA0 algorithm and therefore if the SHA() and SHA_bin() functions are available
+const HAVE_SHA = bool(QORE_CONST_HAVE_SHA);
+
 //! Indicates if the openssl library used to build the qore library supported the SHA224 algorithm and therefore if the SHA224() and SHA224_bin() functions are available
 const HAVE_SHA224 = bool(QORE_CONST_HAVE_SHA256);
 

File Added: pkgsrc/lang/qore/patches/Attic/patch-lib_ql__crypto.qpp
$NetBSD: patch-lib_ql__crypto.qpp,v 1.1 2016/03/09 21:32:41 nros Exp $
* Fix build with open/libressl releases without evp_SHA
  https://github.com/qorelanguage/qore/commit/fc181070ad1afbf49af2e8fc968b97328d690a86
--- lib/ql_crypto.qpp.orig	2016-03-09 20:39:25.000000000 +0000
+++ lib/ql_crypto.qpp
@@ -1130,11 +1130,16 @@ my string $str = SHA("hello"); returns "
     @see SHA_bin()
  */
 string SHA(data[doc] data) [flags=RET_VALUE_ONLY] {
+#ifdef HAVE_OPENSSL_SHA
    DigestHelper dh(args);
    if (dh.doDigest(SHA_ERR, EVP_sha(), xsink))
       return 0;
 
    return dh.getString();
+#else
+   missing_openssl_feature("SHA", xsink);
+   return 0;
+#endif
 }
 
 //! Returns the <a href="http://en.wikipedia.org/wiki/SHA-1">SHA1</a> message digest of the supplied argument as a hex string
@@ -1492,11 +1497,16 @@ my binary $bin = SHA_bin("hello");
     @see SHA()
  */
 binary SHA_bin(data[doc] data) [flags=RET_VALUE_ONLY] {
+#ifdef HAVE_OPENSSL_SHA
    DigestHelper dh(args);
    if (dh.doDigest(SHA_ERR, EVP_sha(), xsink))
       return 0;
    
    return dh.getBinary();
+#else
+   missing_openssl_feature("SHA", xsink);
+   return 0;
+#endif
 }
 
 //! Returns the <a href="http://en.wikipedia.org/wiki/SHA-1">SHA1</a> message digest of the supplied argument as a binary object
@@ -1874,11 +1884,17 @@ my string $str = SHA_hmac("Hello There T
     @throw SHA-HMAC-ERROR error calculating digest (should not normally happen)
  */
 string SHA_hmac(data[doc] data, string key) {
+#ifdef HAVE_OPENSSL_SHA
    HMACHelper dh(args);
    if (dh.doHMAC("SHA-HMAC-ERROR", EVP_sha(), key, xsink))
       return 0;
 
    return dh.getString();
+#else
+   (void)key;
+   missing_openssl_feature("SHA", xsink);
+   return 0;
+#endif
 }
 
 //! Returns the <a href="http://en.wikipedia.org/wiki/Secure_Hash_Algorithm">SHA1</a> based HMAC of the supplied argument as a hex string

cvs diff -r1.1 -r1.2 pkgsrc/lang/qore/patches/Attic/patch-lib_QoreTimeZoneManager.cpp (expand / switch to unified diff)

--- pkgsrc/lang/qore/patches/Attic/patch-lib_QoreTimeZoneManager.cpp 2015/05/02 10:36:29 1.1
+++ pkgsrc/lang/qore/patches/Attic/patch-lib_QoreTimeZoneManager.cpp 2016/03/09 21:32:41 1.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1$NetBSD: patch-lib_QoreTimeZoneManager.cpp,v 1.1 2015/05/02 10:36:29 nros Exp $ 1$NetBSD: patch-lib_QoreTimeZoneManager.cpp,v 1.2 2016/03/09 21:32:41 nros Exp $
2* Fix build on OpenBSD. 2* Fix build on OpenBSD.
3 Committed upstream: 3 Committed upstream:
4 http://sourceforge.net/p/qore/code/7208/ 4 http://sourceforge.net/p/qore/code/7208/
5--- lib/QoreTimeZoneManager.cpp.orig 2015-05-02 12:21:24.000000000 +0000 5--- lib/QoreTimeZoneManager.cpp.orig 2014-06-07 08:17:39.000000000 +0000
6+++ lib/QoreTimeZoneManager.cpp 6+++ lib/QoreTimeZoneManager.cpp
7@@ -27,7 +27,6 @@ 7@@ -27,7 +27,6 @@
8  8
9 #include <stdio.h> 9 #include <stdio.h>
10 #include <time.h> 10 #include <time.h>
11-#include <sys/timeb.h> 11-#include <sys/timeb.h>
12  12
13 #ifdef HAVE_GLOB_H 13 #ifdef HAVE_GLOB_H
14 #include <glob.h> 14 #include <glob.h>