public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Yaakov Selkowitz <yselkowi@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/coolreader] rawhide: Vendor libunibreak 7.0
Date: Fri, 20 Nov 2026 13:46:59 GMT	[thread overview]
Message-ID: <179518241961.1.1989241820237568038.rpms-coolreader-5dfd2270993e@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/coolreader
            Branch : rawhide
            Commit : 5dfd2270993e18b15f7150e3ca3b80a28c2f3cc8
            Author : Yaakov Selkowitz <yselkowi@redhat.com>
            Date   : 2026-11-19T22:37:27-05:00
            Stats  : +168/-1 in 5 file(s)
            URL    : https://src.fedoraproject.org/rpms/coolreader/c/5dfd2270993e18b15f7150e3ca3b80a28c2f3cc8?branch=rawhide

            Log:
            Vendor libunibreak 7.0

https://github.com/buggins/coolreader/issues/384

---
diff --git a/.gitignore b/.gitignore
index 2cb72d6..bdeb93f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,3 +10,4 @@
 /coolreader-cr3.2.53.tar.gz
 /coolreader-cr3.2.54.tar.gz
 /coolreader-cr3.2.59.tar.gz
+/libunibreak-7.0.tar.gz

diff --git a/0001-Set-CMake-policy-version-lower-bound-to-3.5.patch b/0001-Set-CMake-policy-version-lower-bound-to-3.5.patch
index 92e25a4..6f29f5f 100644
--- a/0001-Set-CMake-policy-version-lower-bound-to-3.5.patch
+++ b/0001-Set-CMake-policy-version-lower-bound-to-3.5.patch
@@ -75,3 +75,16 @@ index 29157ca61..1e35279a5 100644
  
  include_directories(${CMAKE_BINARY_DIR})
  
+diff --git a/thirdparty_repo/patches/libunibreak/02-cmake-static.patch b/thirdparty_repo/patches/libunibreak/02-cmake-static.patch
+index 5b011e2..35a4865 100644
+--- a/thirdparty_repo/patches/libunibreak/02-cmake-static.patch
++++ b/thirdparty_repo/patches/libunibreak/02-cmake-static.patch
+@@ -6,7 +6,7 @@ diff -urBbN libunibreak-4.3-orig/CMakeLists.txt libunibreak-4.3/CMakeLists.txt
+ +
+ +project(libunibreak C)
+ +
+-+cmake_minimum_required(VERSION 3.4)
+++cmake_minimum_required(VERSION 3.5..4.0)
+ +
+ +include (CheckTypeSize)
+ +include (CheckIncludeFile)

diff --git a/0002-upgrade-local-unibreak-to-7.0.patch b/0002-upgrade-local-unibreak-to-7.0.patch
new file mode 100644
index 0000000..13ade7b
--- /dev/null
+++ b/0002-upgrade-local-unibreak-to-7.0.patch
@@ -0,0 +1,141 @@
+From df15e6dac9d3a95fd6ef02d48f4292484c1ec578 Mon Sep 17 00:00:00 2001
+From: Vadim Lopatin <coolreader.org@gmail.com>
+Date: Mon, 20 Jul 2026 10:13:53 +0100
+Subject: [PATCH] upgrade local libunibreak to 7.0
+
+---
+ android/app/CMakeLists.txt                    |  2 +-
+ thirdparty_repo/libunibreak.meta.sh           |  9 +++---
+ .../01-add_lb_get_char_class.patch            | 28 -------------------
+ .../patches/libunibreak/02-cmake-static.patch |  8 +++++-
+ thirdparty_repo/repo_srcdirs.cmake            |  2 +-
+ thirdparty_repo/repo_srcdirs.mk               |  2 +-
+ 6 files changed, 14 insertions(+), 37 deletions(-)
+ delete mode 100644 thirdparty_repo/patches/libunibreak/01-add_lb_get_char_class.patch
+
+diff --git a/android/app/CMakeLists.txt b/android/app/CMakeLists.txt
+index 92acae16fd..96733eaf0c 100644
+--- a/android/app/CMakeLists.txt
++++ b/android/app/CMakeLists.txt
+@@ -39,7 +39,7 @@ add_definitions(-DLVLONG_FILE_SUPPORT=1)
+ add_definitions(-DMAX_IMAGE_SCALE_MUL=2)
+ add_definitions(-DUSE_NANOSVG=1)
+ add_definitions(-DBUNDLED_FRIBIDI=1)
+-add_definitions(-DKO_LIBUNIBREAK_PATCH=1)       # libunibreak patched with "add_lb_get_char_class.patch" file from koreader
++add_definitions(-DKO_LIBUNIBREAK_PATCH=1)       # lb_get_char_class is provided by bundled libunibreak 7.0
+ add_definitions(-DUSE_UTF8PROC=1)
+ 
+ #set(LOCAL_CFLAGS "-Wno-psabi -Wno-unused-variable -Wno-sign-compare -Wno-write-strings -Wno-main -Wno-unused-but-set-variable -Wno-unused-function -Wall")
+diff --git a/thirdparty_repo/libunibreak.meta.sh b/thirdparty_repo/libunibreak.meta.sh
+index 5cd55be94a..cfb4344bb5 100644
+--- a/thirdparty_repo/libunibreak.meta.sh
++++ b/thirdparty_repo/libunibreak.meta.sh
+@@ -2,16 +2,15 @@
+ # Metadata for deploy script
+ 
+ PN="libunibreak"
+-PV="4.3"
++PV="7.0"
+ # package revision: when patchset is changed (but not version), increase it
+ # when version changed, reset to "1".
+-REV="1"
++REV="4"
+ SRCFILE="${PN}-${PV}.tar.gz"
+-SHA512="4b53fd169912033403b6ca09047b7b928211fab3607ef26070ab731054138b9a291f7d138d3a479f9cde8edb0fabf8da114da68aee32e60cddf45cc3baae1170"
++SHA512="2dec8aa5788486dcbe1f676d31a103f7a3f253a2bf4af7772b3f3019667b352aa04aae369e0838ce6d554b207a2d555738f3510bb1cfec65adcc8c4164aeb00b"
+ 
+ URL="https://github.com/adah1972/libunibreak/releases/download/libunibreak_${PV/./_}/${SRCFILE}"
+ 
+ SOURCESDIR="${PN}-${PV}"
+ 
+-PATCHES="01-add_lb_get_char_class.patch
+-		02-cmake-static.patch"
++PATCHES="02-cmake-static.patch"
+diff --git a/thirdparty_repo/patches/libunibreak/01-add_lb_get_char_class.patch b/thirdparty_repo/patches/libunibreak/01-add_lb_get_char_class.patch
+deleted file mode 100644
+index 66bdd66d3b..0000000000
+--- a/thirdparty_repo/patches/libunibreak/01-add_lb_get_char_class.patch
++++ /dev/null
+@@ -1,28 +0,0 @@
+-diff --git a/src/linebreak.c b/src/linebreak.c
+-index c2ccdda..45afba2 100644
+---- a/src/linebreak.c
+-+++ b/src/linebreak.c
+-@@ -751,6 +751,12 @@ int lb_process_next_char(
+-
+-     return brk;
+- }
+-+enum LineBreakClass lb_get_char_class(
+-+        struct LineBreakContext *lbpCtx,
+-+        utf32_t ch)
+-+{
+-+    return get_char_lb_class_lang(ch, lbpCtx->lbpLang);
+-+}
+-
+- /**
+-  * Sets the line breaking information for a generic input string.
+-diff --git a/src/linebreakdef.h b/src/linebreakdef.h
+-index 5bb8838..8db80a6 100644
+---- a/src/linebreakdef.h
+-+++ b/src/linebreakdef.h
+-@@ -169,3 +169,6 @@ void set_linebreaks(
+-         const char *lang,
+-         char *brks,
+-         get_next_char_t get_next_char);
+-+enum LineBreakClass lb_get_char_class(
+-+        struct LineBreakContext *lbpCtx,
+-+        utf32_t ch);
+diff --git a/thirdparty_repo/patches/libunibreak/02-cmake-static.patch b/thirdparty_repo/patches/libunibreak/02-cmake-static.patch
+index 7641e8c7a0..5b011e202b 100644
+--- a/thirdparty_repo/patches/libunibreak/02-cmake-static.patch
++++ b/thirdparty_repo/patches/libunibreak/02-cmake-static.patch
+@@ -1,7 +1,7 @@
+ diff -urBbN libunibreak-4.3-orig/CMakeLists.txt libunibreak-4.3/CMakeLists.txt
+ --- libunibreak-4.3-orig/CMakeLists.txt	1970-01-01 04:00:00.000000000 +0400
+ +++ libunibreak-4.3/CMakeLists.txt	2021-01-24 18:54:37.740977000 +0400
+-@@ -0,0 +1,32 @@
++@@ -0,0 +1,38 @@
+ +# Custom lightweight cmake project to compile libunibreak as static library
+ +
+ +project(libunibreak C)
+@@ -29,8 +29,14 @@ diff -urBbN libunibreak-4.3-orig/CMakeLists.txt libunibreak-4.3/CMakeLists.txt
+ +	src/linebreakdata.c
+ +	src/linebreakdef.c
+ +	src/emojidef.c
+++	src/emojidata.c
+++	src/eastasianwidthdef.c
+++	src/eastasianwidthdata.c
+ +	src/graphemebreak.c
+++	src/graphemebreakdata.c
+++	src/indicconjunctbreakdata.c
+ +	src/wordbreak.c
+++	src/wordbreakdata.c
+ +)
+ +
+ +add_library(unibreak STATIC ${LIBUNIBREAK_SOURCE})
+diff --git a/thirdparty_repo/repo_srcdirs.cmake b/thirdparty_repo/repo_srcdirs.cmake
+index 8f46266db8..db638807e7 100644
+--- a/thirdparty_repo/repo_srcdirs.cmake
++++ b/thirdparty_repo/repo_srcdirs.cmake
+@@ -8,7 +8,7 @@ set(REPO_FRIBIDI_SRCDIR "fribidi-1.0.16")
+ set(REPO_HARFBUZZ_SRCDIR "harfbuzz-2.8.2")
+ set(REPO_LIBJPEG_SRCDIR "jpeg-9d")
+ set(REPO_LIBPNG_SRCDIR "libpng-1.6.37")
+-set(REPO_LIBUNIBREAK_SRCDIR "libunibreak-4.3")
++set(REPO_LIBUNIBREAK_SRCDIR "libunibreak-7.0")
+ set(REPO_ZLIB_SRCDIR "zlib-1.2.11")
+ set(REPO_ZSTD_SRCDIR "zstd-1.5.0")
+ set(REPO_UTF8PROC_SRCDIR "utf8proc-2.6.1")
+diff --git a/thirdparty_repo/repo_srcdirs.mk b/thirdparty_repo/repo_srcdirs.mk
+index 217a87084c..0aa2eebbc1 100644
+--- a/thirdparty_repo/repo_srcdirs.mk
++++ b/thirdparty_repo/repo_srcdirs.mk
+@@ -7,7 +7,7 @@ REPO_FRIBIDI_SRCDIR := fribidi-1.0.16
+ REPO_HARFBUZZ_SRCDIR := harfbuzz-2.8.2
+ REPO_LIBJPEG_SRCDIR := jpeg-9d
+ REPO_LIBPNG_SRCDIR := libpng-1.6.37
+-REPO_LIBUNIBREAK_SRCDIR := libunibreak-4.3
++REPO_LIBUNIBREAK_SRCDIR := libunibreak-7.0
+ REPO_ZLIB_SRCDIR := zlib-1.2.11
+ REPO_ZSTD_SRCDIR := zstd-1.5.0
+ REPO_UTF8PROC_SRCDIR := utf8proc-2.6.1

diff --git a/coolreader.spec b/coolreader.spec
index e9c10b2..f883c6d 100644
--- a/coolreader.spec
+++ b/coolreader.spec
@@ -6,8 +6,13 @@ License:        GPL-2.0-or-later
 URL:            https://github.com/buggins/coolreader
 Source0:        %{url}/archive/cr%{version}/%{name}-cr%{version}.tar.gz
 Source1:        cr3.appdata.xml
+# Fails to build with external libunibreak 8.0+
+# https://github.com/buggins/coolreader/issues/384
+Source2:        https://github.com/adah1972/libunibreak/releases/download/libunibreak_7_0/libunibreak-7.0.tar.gz
 # https://github.com/buggins/coolreader/pull/365
 Patch:          0001-Set-CMake-policy-version-lower-bound-to-3.5.patch
+# https://github.com/buggins/coolreader/pull/375 (merged)
+Patch:          0002-upgrade-local-unibreak-to-7.0.patch
 
 # libunibreak dropped i686
 # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval
@@ -24,7 +29,7 @@ BuildRequires:  pkgconfig(fribidi)
 BuildRequires:  pkgconfig(harfbuzz)
 BuildRequires:  pkgconfig(libjpeg)
 BuildRequires:  pkgconfig(libpng)
-BuildRequires:  pkgconfig(libunibreak)
+#BuildRequires:  pkgconfig(libunibreak)
 BuildRequires:  pkgconfig(libutf8proc)
 BuildRequires:  pkgconfig(libzstd)
 BuildRequires:  pkgconfig(zlib)
@@ -34,6 +39,7 @@ BuildRequires:  libappstream-glib
 # Bundled software has been modified for use by coolreader
 Provides:       bundled(antiword) = 0.37
 Provides:       bundled(chmlib) = 0.38
+Provides:       bundled(libunibreak) = 7.0
 Provides:       bundled(qt5-qtbase-private)
 
 %description
@@ -48,6 +54,11 @@ HTML, EPUB, CHM, PDB, MOBI.
 # use 48x48 icon
 cp -f cr3qt/src/icons/cr3.png cr3qt/src/desktop/cr3.png
 
+tar -xf %{SOURCE2} -C thirdparty/
+pushd thirdparty/libunibreak-7.0
+patch -p1 < ../../thirdparty_repo/patches/libunibreak/02-cmake-static.patch
+popd
+
 
 %build
 %cmake \

diff --git a/sources b/sources
index 74747c7..b83be53 100644
--- a/sources
+++ b/sources
@@ -1 +1,2 @@
 SHA512 (coolreader-cr3.2.59.tar.gz) = 72fc05814ca4f6da5310f7b47fd7939bc1567e5dd7e7e75bc29e2b1436dc4901498622a770e89323581c3f0b3b9ec305050ca5917eceba4df4a07cff3e1748d6
+SHA512 (libunibreak-7.0.tar.gz) = 2dec8aa5788486dcbe1f676d31a103f7a3f253a2bf4af7772b3f3019667b352aa04aae369e0838ce6d554b207a2d555738f3510bb1cfec65adcc8c4164aeb00b

                 reply	other threads:[~2026-11-20 13:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179518241961.1.1989241820237568038.rpms-coolreader-5dfd2270993e@fedoraproject.org \
    --to=yselkowi@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox