public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/libebml] rawhide: fix build with utf8cpp 4.x
@ 2026-07-23 16:04 Dominik 'Rathann' Mierzejewski
  0 siblings, 0 replies; only message in thread
From: Dominik 'Rathann' Mierzejewski @ 2026-07-23 16:04 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/libebml
Branch : rawhide
Commit : 72051ab5d32e8c75616c1db5e03363880373d6dc
Author : Dominik 'Rathann' Mierzejewski <dominik@greysector.net>
Date   : 2026-07-23T17:35:55+02:00
Stats  : +67/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/libebml/c/72051ab5d32e8c75616c1db5e03363880373d6dc?branch=rawhide

Log:
fix build with utf8cpp 4.x

---
diff --git a/libebml-utf8cpp-4.patch b/libebml-utf8cpp-4.patch
new file mode 100644
index 0000000..8528fad
--- /dev/null
+++ b/libebml-utf8cpp-4.patch
@@ -0,0 +1,63 @@
+From 7cf88e1b6caba995d284fe6dbd74b6cb0115ed5d Mon Sep 17 00:00:00 2001
+From: Moritz Bunkus <mo@bunkus.online>
+Date: Tue, 21 Jul 2026 19:32:11 +0200
+Subject: [PATCH] fix detecting & using utf8c++ 4.0.0 or newer
+
+`find_package` with version constraint `3.2.0` does not consider 4.x.y
+to be compatible. Therefore also look for 4.x.y in a secondary
+`find_package` call.
+
+The fallback for cloning from git if neither version is found via
+`cmake` remains in place.
+
+Furthermore, linking against a distro-packaged 4.x.y doesn't seem to
+work with the existing `target_link_libraries(ebml PRIVATE
+$<BUILD_INTERFACE:utf8cpp>)` & requires `PRIVATE
+utf8cpp::utf8cpp`. However, that doesn't work with a git-cloned copy
+nor with distro-packaged 3.2.x as those still requires `PRIVATE
+$<BUILD_INTERFACE:utf8cpp>`.
+
+Therefore make the argument depend on availability of the
+`utf8cpp::utf8cpp` target: it is available only for distro-packaged
+4.x.y. For the other two cases (distro-packaged < 4.x.y & cloned from
+git) we stay with `$<BUILD_INTERFACE:utf8cpp>`.
+
+fixes #344 ; see #345
+---
+ CMakeLists.txt | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index f2469cf5..7ba184fd 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -48,7 +48,7 @@ function(add_cxx_flag_if_supported)
+   endforeach()
+ endfunction()
+ 
+-find_package(utf8cpp 3.2.0)
++find_package(utf8cpp)
+ if(NOT utf8cpp_FOUND)
+   include(FetchContent REQUIRED)
+   FetchContent_Declare(
+@@ -61,6 +61,11 @@ if(NOT utf8cpp_FOUND)
+     )
+     FetchContent_MakeAvailable(utf8cpp)
+ endif()
++if(TARGET utf8cpp::utf8cpp)
++  set(libebml_utf8cpp_link_libraries utf8cpp::utf8cpp)
++else()
++  set(libebml_utf8cpp_link_libraries $<BUILD_INTERFACE:utf8cpp>)
++endif()
+ 
+ if(DEV_MODE)
+   message(STATUS "Using developer mode for ${CMAKE_CXX_COMPILER_ID}")
+@@ -157,7 +162,7 @@ if(MSVC)
+   target_compile_definitions(ebml PRIVATE _CRT_SECURE_NO_WARNINGS)
+ endif()
+ 
+-target_link_libraries(ebml PRIVATE $<BUILD_INTERFACE:utf8cpp>)
++target_link_libraries(ebml PRIVATE ${libebml_utf8cpp_link_libraries})
+ 
+ include(GenerateExportHeader)
+ generate_export_header(ebml EXPORT_MACRO_NAME EBML_DLL_API)

diff --git a/libebml.spec b/libebml.spec
index 6852cd2..333a4b4 100644
--- a/libebml.spec
+++ b/libebml.spec
@@ -5,6 +5,8 @@ Release:    1%{?dist}
 License:    LGPL-2.1-or-later
 URL:        https://www.matroska.org/
 Source:     https://dl.matroska.org/downloads/%{name}/%{name}-%{version}.tar.xz
+# https://github.com/Matroska-Org/libebml/pull/346
+Patch:      https://github.com/Matroska-Org/libebml/commit/7cf88e1b6caba995d284fe6dbd74b6cb0115ed5d.patch#/libebml-utf8cpp-4.patch
 BuildRequires: cmake
 BuildRequires: gcc-c++
 BuildRequires: utf8cpp-devel
@@ -31,7 +33,7 @@ will use the Extensible Binary Meta Language library.
 
 
 %prep
-%setup -q
+%autosetup -p1
 
 
 %build
@@ -63,6 +65,7 @@ will use the Extensible Binary Meta Language library.
 * Thu Jul 23 2026 Dominik Mierzejewski <dominik@greysector.net> - 1.4.6-1
 - update to 1.4.6 (resolves rhbz#2502270)
 - drop merged patches
+- fix build with utf8cpp 4.x
 
 * Thu Jul 16 2026 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.5-7
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild

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

only message in thread, other threads:[~2026-07-23 16:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-23 16:04 [rpms/libebml] rawhide: fix build with utf8cpp 4.x Dominik 'Rathann' Mierzejewski

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