pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/geography/R-s2 geography/R-s2: import fix for "not old...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/ae7822248964
branches:  trunk
changeset: 386436:ae7822248964
user:      he <he%pkgsrc.org@localhost>
date:      Sat Oct 08 20:02:06 2022 +0000

description:
geography/R-s2: import fix for "not old" openssl on 32-bit hosts.

Ref.
https://github.com/r-spatial/s2/commit/3e791194ceb348a81d6317438e2bfe9e4a2ff1e3

diffstat:

 geography/R-s2/Makefile                                                |   4 +-
 geography/R-s2/distinfo                                                |   3 +-
 geography/R-s2/patches/patch-src_s2_util_math_exactfloat_exactfloat.cc |  48 ++++++++++
 3 files changed, 53 insertions(+), 2 deletions(-)

diffs (82 lines):

diff -r fa087520fa29 -r ae7822248964 geography/R-s2/Makefile
--- a/geography/R-s2/Makefile   Sat Oct 08 19:53:33 2022 +0000
+++ b/geography/R-s2/Makefile   Sat Oct 08 20:02:06 2022 +0000
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.2 2022/08/22 22:21:53 tnn Exp $
+# $NetBSD: Makefile,v 1.3 2022/10/08 20:02:06 he Exp $
 
 R_PKGNAME=     s2
 R_PKGVER=      1.0.6
+PKGREVISION=   1
 CATEGORIES=    geography
 
 MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
@@ -14,4 +15,5 @@
 .include "../../devel/R-Rcpp/buildlink3.mk"
 .include "../../geography/R-wk/buildlink3.mk"
 .include "../../security/openssl/buildlink3.mk"
+.include "../../mk/atomic64.mk"
 .include "../../mk/bsd.pkg.mk"
diff -r fa087520fa29 -r ae7822248964 geography/R-s2/distinfo
--- a/geography/R-s2/distinfo   Sat Oct 08 19:53:33 2022 +0000
+++ b/geography/R-s2/distinfo   Sat Oct 08 20:02:06 2022 +0000
@@ -1,5 +1,6 @@
-$NetBSD: distinfo,v 1.3 2021/10/26 10:45:07 nia Exp $
+$NetBSD: distinfo,v 1.4 2022/10/08 20:02:06 he Exp $
 
 BLAKE2s (R/s2_1.0.6.tar.gz) = abef7cb812ef604615cf4741c66cc4062796708c3ae8191b91d236303c436fda
 SHA512 (R/s2_1.0.6.tar.gz) = 4529179020f7503217cdfe1d139135a79c622bc38472627d4a1f86181ba825e5dc5f833a9ffb9be6cb272647fb61765bd6b5db89b6f46015ebcf0e996b93b623
 Size (R/s2_1.0.6.tar.gz) = 1605788 bytes
+SHA1 (patch-src_s2_util_math_exactfloat_exactfloat.cc) = 7dda8c6095ac4f07f2bdc0e9801bb055acf808e7
diff -r fa087520fa29 -r ae7822248964 geography/R-s2/patches/patch-src_s2_util_math_exactfloat_exactfloat.cc
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/geography/R-s2/patches/patch-src_s2_util_math_exactfloat_exactfloat.cc    Sat Oct 08 20:02:06 2022 +0000
@@ -0,0 +1,48 @@
+$NetBSD: patch-src_s2_util_math_exactfloat_exactfloat.cc,v 1.1 2022/10/08 20:02:06 he Exp $
+
+Import fix from upstream for newer openssl on 32-bit hosts, ref.
+
+https://github.com/r-spatial/s2/commit/3e791194ceb348a81d6317438e2bfe9e4a2ff1e3
+
+--- src/s2/util/math/exactfloat/exactfloat.cc.orig     2021-01-04 12:00:17.000000000 +0000
++++ src/s2/util/math/exactfloat/exactfloat.cc
+@@ -93,6 +93,7 @@ inline static void BN_ext_set_uint64(BIG
+ #endif
+ }
+ 
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ // Return the absolute value of a BIGNUM as a 64-bit unsigned integer.
+ // Requires that BIGNUM fits into 64 bits.
+ inline static uint64 BN_ext_get_uint64(const BIGNUM* bn) {
+@@ -108,8 +109,6 @@ inline static uint64 BN_ext_get_uint64(c
+ #endif
+ }
+ 
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+-
+ // Count the number of low-order zero bits in the given BIGNUM (ignoring its
+ // sign).  Returns 0 if the argument is zero.
+ static int BN_ext_count_low_zero_bits(const BIGNUM* bn) {
+@@ -130,6 +129,22 @@ static int BN_ext_count_low_zero_bits(co
+ 
+ #else  // OPENSSL_VERSION_NUMBER >= 0x10100000L
+ 
++// Return the absolute value of a BIGNUM as a 64-bit unsigned integer.
++// Requires that BIGNUM fits into 64 bits.
++inline static uint64 BN_ext_get_uint64(const BIGNUM* bn) {
++  uint64 r;
++#ifdef IS_LITTLE_ENDIAN
++  S2_CHECK_EQ(BN_bn2lebinpad(bn, reinterpret_cast<unsigned char*>(&r),
++                             sizeof(r)), sizeof(r));
++#elif IS_BIG_ENDIAN
++  S2_CHECK_EQ(BN_bn2binpad(bn, reinterpret_cast<unsigned char*>(&r),
++                           sizeof(r)), sizeof(r));
++#else
++#error one of IS_LITTLE_ENDIAN or IS_BIG_ENDIAN should be defined!
++#endif
++  return r;
++}
++
+ static int BN_ext_count_low_zero_bits(const BIGNUM* bn) {
+   // In OpenSSL >= 1.1, BIGNUM is an opaque type, so d and top
+   // cannot be accessed.  The bytes must be copied out at a ~25%



Home | Main Index | Thread Index | Old Index