public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/libcmis] f43: Backport PR #68 and followups to fix build with Boost 1.90
@ 2026-08-03 20:29 Adam Williamson
  0 siblings, 0 replies; only message in thread
From: Adam Williamson @ 2026-08-03 20:29 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/libcmis
            Branch : f43
            Commit : ad5f83cb8b4c2f1d4220a6bfecf7ed0b8630f47a
            Author : Adam Williamson <awilliam@redhat.com>
            Date   : 2026-01-14T11:20:32-08:00
            Stats  : +188/-0 in 5 file(s)
            URL    : https://src.fedoraproject.org/rpms/libcmis/c/ad5f83cb8b4c2f1d4220a6bfecf7ed0b8630f47a?branch=f43

            Log:
            Backport PR #68 and followups to fix build with Boost 1.90

Signed-off-by: Adam Williamson <awilliam@redhat.com>

---
diff --git a/0001-Fix-boost-1.86-breakage.patch b/0001-Fix-boost-1.86-breakage.patch
new file mode 100644
index 0000000..f8f40a0
--- /dev/null
+++ b/0001-Fix-boost-1.86-breakage.patch
@@ -0,0 +1,47 @@
+From dfcb642a491f7ec2ae52e3e83d31bb6cdf3670c2 Mon Sep 17 00:00:00 2001
+From: David Seifert <soap@gentoo.org>
+Date: Sat, 31 Aug 2024 12:39:39 +0200
+Subject: [PATCH 1/4] Fix boost 1.86 breakage
+
+The fix does not break building against <1.86 since we're now accessing the
+object representation of the return value.
+
+Fixes #67
+---
+ src/libcmis/xml-utils.cxx | 14 ++++++++++----
+ 1 file changed, 10 insertions(+), 4 deletions(-)
+
+diff --git a/src/libcmis/xml-utils.cxx b/src/libcmis/xml-utils.cxx
+index e487d17..cdf088f 100644
+--- a/src/libcmis/xml-utils.cxx
++++ b/src/libcmis/xml-utils.cxx
+@@ -531,16 +531,22 @@ namespace libcmis
+         boost::uuids::detail::sha1 sha1;
+         sha1.process_bytes( str.c_str(), str.size() );
+ 
+-        unsigned int digest[5];
++        // on boost <  1.86.0, digest_type is typedef'd as unsigned int[5]
++        // on boost >= 1.86.0, digest_type is typedef'd as unsigned char[20]
++        boost::uuids::detail::sha1::digest_type digest;
+         sha1.get_digest( digest );
+ 
++        // by using a pointer to unsigned char, we can read the
++        // object representation of either typedef.
++        const unsigned char* ptr = reinterpret_cast<const unsigned char*>( digest );
++
+         stringstream out;
+-        // Setup writing mode. Every number must produce eight
++        // Setup writing mode. Every number must produce two
+         // hexadecimal digits, including possible leading 0s, or we get
+         // less than 40 digits as result.
+         out << hex << setfill('0') << right;
+-        for ( int i = 0; i < 5; ++i )
+-            out << setw(8) << digest[i];
++        for ( int i = 0; i < sizeof( digest ); ++ptr, ++i )
++            out << setw(2) << static_cast<int>( *ptr );
+         return out.str();
+     }
+ 
+-- 
+2.52.0
+

diff --git a/0002-sha1-test-fails-with-older-boost.patch b/0002-sha1-test-fails-with-older-boost.patch
new file mode 100644
index 0000000..2d15f9a
--- /dev/null
+++ b/0002-sha1-test-fails-with-older-boost.patch
@@ -0,0 +1,45 @@
+From 0753091be57edae28655e43a9bae9e4c4e414117 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolan.mcnamara@collabora.com>
+Date: Fri, 13 Sep 2024 16:02:13 +0100
+Subject: [PATCH 2/4] sha1 test fails with older boost
+
+<fridrich> 1) test: XmlTest::sha1Test (F) line: 588 test-xmlutils.cxx
+<fridrich> equality assertion failed
+<fridrich> - Expected: f7ff9e8b7bb2e09b70935a5d785e0cc5d9d0abf0
+<fridrich> - Actual  : 8b9efff79be0b27b5d5a9370c50c5e78f0abd0d9
+---
+ src/libcmis/xml-utils.cxx | 12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+diff --git a/src/libcmis/xml-utils.cxx b/src/libcmis/xml-utils.cxx
+index cdf088f..3568ec6 100644
+--- a/src/libcmis/xml-utils.cxx
++++ b/src/libcmis/xml-utils.cxx
+@@ -536,17 +536,19 @@ namespace libcmis
+         boost::uuids::detail::sha1::digest_type digest;
+         sha1.get_digest( digest );
+ 
+-        // by using a pointer to unsigned char, we can read the
+-        // object representation of either typedef.
+-        const unsigned char* ptr = reinterpret_cast<const unsigned char*>( digest );
+-
+         stringstream out;
+         // Setup writing mode. Every number must produce two
+         // hexadecimal digits, including possible leading 0s, or we get
+         // less than 40 digits as result.
+         out << hex << setfill('0') << right;
+-        for ( int i = 0; i < sizeof( digest ); ++ptr, ++i )
++#if BOOST_VERSION < 108600
++        for ( int i = 0; i < 5; ++i )
++            out << setw(8) << digest[i];
++#else
++        const unsigned char* ptr = reinterpret_cast<const unsigned char*>( digest );
++        for ( size_t i = 0; i < sizeof( digest ); ++ptr, ++i )
+             out << setw(2) << static_cast<int>( *ptr );
++#endif
+         return out.str();
+     }
+ 
+-- 
+2.52.0
+

diff --git a/0003-Fix-build-with-boost-1.66-and-simplify-a-bit.patch b/0003-Fix-build-with-boost-1.66-and-simplify-a-bit.patch
new file mode 100644
index 0000000..b3110dd
--- /dev/null
+++ b/0003-Fix-build-with-boost-1.66-and-simplify-a-bit.patch
@@ -0,0 +1,49 @@
+From 8cf58e67c8a77a81bb8392886468e12c0f96d9ef Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Fridrich=20=C5=A0trba?= <fridrich.strba@bluewin.ch>
+Date: Mon, 16 Sep 2024 10:21:42 +0200
+Subject: [PATCH 3/4] Fix build with boost < 1.66 and simplify a bit
+
+---
+ src/libcmis/xml-utils.cxx | 17 ++++++++---------
+ 1 file changed, 8 insertions(+), 9 deletions(-)
+
+diff --git a/src/libcmis/xml-utils.cxx b/src/libcmis/xml-utils.cxx
+index 3568ec6..20c671e 100644
+--- a/src/libcmis/xml-utils.cxx
++++ b/src/libcmis/xml-utils.cxx
+@@ -531,9 +531,14 @@ namespace libcmis
+         boost::uuids::detail::sha1 sha1;
+         sha1.process_bytes( str.c_str(), str.size() );
+ 
+-        // on boost <  1.86.0, digest_type is typedef'd as unsigned int[5]
++        // on boost <  1.66.0, digest_type is typedef'd as reference to unsigned int[5]
++        // on boost >= 1.66.0 and < 1.86.0, digest_type is typedef'd as unsigned int[5]
+         // on boost >= 1.86.0, digest_type is typedef'd as unsigned char[20]
++#if BOOST_VERSION < 106600
++        unsigned int digest[5];
++#else
+         boost::uuids::detail::sha1::digest_type digest;
++#endif
+         sha1.get_digest( digest );
+ 
+         stringstream out;
+@@ -541,14 +546,8 @@ namespace libcmis
+         // hexadecimal digits, including possible leading 0s, or we get
+         // less than 40 digits as result.
+         out << hex << setfill('0') << right;
+-#if BOOST_VERSION < 108600
+-        for ( int i = 0; i < 5; ++i )
+-            out << setw(8) << digest[i];
+-#else
+-        const unsigned char* ptr = reinterpret_cast<const unsigned char*>( digest );
+-        for ( size_t i = 0; i < sizeof( digest ); ++ptr, ++i )
+-            out << setw(2) << static_cast<int>( *ptr );
+-#endif
++        for ( size_t i = 0; i < sizeof( digest ) / sizeof( digest[0] ); ++i )
++            out << setw(2 * sizeof( digest[0] )) << static_cast<int>( digest[i] );
+         return out.str();
+     }
+ 
+-- 
+2.52.0
+

diff --git a/0004-Fix-comment-and-sync-the-if-BOOST_VERSION.patch b/0004-Fix-comment-and-sync-the-if-BOOST_VERSION.patch
new file mode 100644
index 0000000..daefdd0
--- /dev/null
+++ b/0004-Fix-comment-and-sync-the-if-BOOST_VERSION.patch
@@ -0,0 +1,40 @@
+From 34e02902beec2d985dd66ee25c37b0b1bd1498a4 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Fridrich=20=C5=A0trba?= <fridrich.strba@bluewin.ch>
+Date: Mon, 16 Sep 2024 10:59:19 +0200
+Subject: [PATCH 4/4] Fix comment and sync the #if BOOST_VERSION to avoid
+ including a redirecting header
+
+---
+ src/libcmis/xml-utils.cxx | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/libcmis/xml-utils.cxx b/src/libcmis/xml-utils.cxx
+index 20c671e..38e01ec 100644
+--- a/src/libcmis/xml-utils.cxx
++++ b/src/libcmis/xml-utils.cxx
+@@ -36,10 +36,10 @@
+ #include <boost/algorithm/string.hpp>
+ #include <boost/version.hpp>
+ 
+-#if BOOST_VERSION >= 106800
+-#include <boost/uuid/detail/sha1.hpp>
+-#else
++#if BOOST_VERSION < 106600
+ #include <boost/uuid/sha1.hpp>
++#else
++#include <boost/uuid/detail/sha1.hpp>
+ #endif
+ #include <curl/curl.h>
+ 
+@@ -542,7 +542,7 @@ namespace libcmis
+         sha1.get_digest( digest );
+ 
+         stringstream out;
+-        // Setup writing mode. Every number must produce two
++        // Setup writing mode. Every byte must produce two
+         // hexadecimal digits, including possible leading 0s, or we get
+         // less than 40 digits as result.
+         out << hex << setfill('0') << right;
+-- 
+2.52.0
+

diff --git a/libcmis.spec b/libcmis.spec
index aaf88c7..2eabdbe 100644
--- a/libcmis.spec
+++ b/libcmis.spec
@@ -10,6 +10,13 @@ URL: https://github.com/tdf/libcmis
 Source: https://github.com/tdf/libcmis/releases/download/v%{version}/%{name}-%{version}.tar.xz
 # https://github.com/tdf/libcmis/issues/51
 Patch:  libxmis-0.6.2-libxml2-2.12.0-includes.patch
+# https://github.com/tdf/libcmis/pull/68 and followups
+# Fixes build with boost 1.86+, followups address some issues
+Patch:  0001-Fix-boost-1.86-breakage.patch
+Patch:  0002-sha1-test-fails-with-older-boost.patch
+Patch:  0003-Fix-build-with-boost-1.66-and-simplify-a-bit.patch
+Patch:  0004-Fix-comment-and-sync-the-if-BOOST_VERSION.patch
+
 
 BuildRequires: boost-devel
 BuildRequires: gcc-c++

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-03 20:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-03 20:29 [rpms/libcmis] f43: Backport PR #68 and followups to fix build with Boost 1.90 Adam Williamson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox