summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2026-03-27 08:04:39 +0100
committerRemi Collet <remi@php.net>2026-03-27 08:04:39 +0100
commitcc4c0d77cc6da3e5318403bd073c5ff5206c7f66 (patch)
tree4ca611d456bd33ee0f012423b585517ef0c7d744
parente26c78f0cbe8e415203d8bb543f1a20bfcf9db4d (diff)
improved pkg-config patch (merged upstream)HEADmaster
-rw-r--r--0001-Added-support-for-pkg-config-345.patch59
-rw-r--r--0002-Fix-346-always-generates-lexbor.pc-347.patch44
-rw-r--r--lexbor.spec11
3 files changed, 112 insertions, 2 deletions
diff --git a/0001-Added-support-for-pkg-config-345.patch b/0001-Added-support-for-pkg-config-345.patch
new file mode 100644
index 0000000..b98139b
--- /dev/null
+++ b/0001-Added-support-for-pkg-config-345.patch
@@ -0,0 +1,59 @@
+From 25c9adfa74a80066f193df3b9689d39fec4d656c Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@famillecollet.com>
+Date: Tue, 24 Mar 2026 19:11:05 +0100
+Subject: [PATCH 1/2] Added support for pkg-config (#345)
+
+---
+ CMakeLists.txt | 16 ++++++++++++++++
+ lexbor.pc.in | 12 ++++++++++++
+ 2 files changed, 28 insertions(+)
+ create mode 100644 lexbor.pc.in
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 15f6571..eb3dcff 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -377,6 +377,22 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake"
+ "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake"
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}/")
+
++################
++## pkg-config configuration
++#########################
++find_package(PkgConfig)
++if (PKG_CONFIG_FOUND)
++ configure_file(
++ "${PROJECT_SOURCE_DIR}/lexbor.pc.in"
++ "${PROJECT_BINARY_DIR}/lexbor.pc"
++ @ONLY
++ )
++ install(
++ FILES "${PROJECT_BINARY_DIR}/lexbor.pc"
++ DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig"
++ )
++endif()
++
+ ################
+ ## Build an RPM.
+ #########################
+diff --git a/lexbor.pc.in b/lexbor.pc.in
+new file mode 100644
+index 0000000..c28b7a1
+--- /dev/null
++++ b/lexbor.pc.in
+@@ -0,0 +1,12 @@
++prefix=@CMAKE_INSTALL_PREFIX@
++exec_prefix=${prefix}
++libdir=@CMAKE_INSTALL_FULL_LIBDIR@
++includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
++
++Name: @PROJECT_NAME@
++Description: HTML Renderer library
++Version: @PROJECT_VERSION@
++
++Libs: -L${libdir} -l@PROJECT_NAME@
++Cflags: -I${includedir}
++
+--
+2.53.0
+
diff --git a/0002-Fix-346-always-generates-lexbor.pc-347.patch b/0002-Fix-346-always-generates-lexbor.pc-347.patch
new file mode 100644
index 0000000..feb2dc1
--- /dev/null
+++ b/0002-Fix-346-always-generates-lexbor.pc-347.patch
@@ -0,0 +1,44 @@
+From b8498c2c23a30772acb580da4d9cf3c793859516 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Thu, 26 Mar 2026 19:03:03 +0100
+Subject: [PATCH 2/2] Fix #346 always generates lexbor.pc (#347)
+
+---
+ CMakeLists.txt | 21 +++++++++------------
+ 1 file changed, 9 insertions(+), 12 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index eb3dcff..f794557 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -380,18 +380,15 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake"
+ ################
+ ## pkg-config configuration
+ #########################
+-find_package(PkgConfig)
+-if (PKG_CONFIG_FOUND)
+- configure_file(
+- "${PROJECT_SOURCE_DIR}/lexbor.pc.in"
+- "${PROJECT_BINARY_DIR}/lexbor.pc"
+- @ONLY
+- )
+- install(
+- FILES "${PROJECT_BINARY_DIR}/lexbor.pc"
+- DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig"
+- )
+-endif()
++configure_file(
++ "${PROJECT_SOURCE_DIR}/lexbor.pc.in"
++ "${PROJECT_BINARY_DIR}/lexbor.pc"
++ @ONLY
++)
++install(
++ FILES "${PROJECT_BINARY_DIR}/lexbor.pc"
++ DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig"
++)
+
+ ################
+ ## Build an RPM.
+--
+2.53.0
+
diff --git a/lexbor.spec b/lexbor.spec
index 3b71025..6af18e4 100644
--- a/lexbor.spec
+++ b/lexbor.spec
@@ -24,7 +24,7 @@ Name: lexbor
Summary: HTML Renderer library
License: Apache-2.0
Version: 2.7.0
-Release: 1%{?dist}
+Release: 2%{?dist}
%forgemeta
URL: %{forgeurl}
Source0: %{forgesource}
@@ -32,6 +32,7 @@ Source0: %{forgesource}
Source3: %{name}-files-by-license.txt
Patch0: 0001-add-support-for-pkg-config.patch
+Patch1: 0002-Fix-346-always-generates-lexbor.pc-347.patch
ExcludeArch: %{ix86}
@@ -63,7 +64,8 @@ for %{name}.
%prep
%forgesetup
-%patch -P0 -p1 -b .pkgconfig
+%patch -P0 -p1 -b .pkgconfig1
+%patch -P1 -p1 -b .pkgconfig2
%if %{with licensecheck}
LST=$(mktemp)
@@ -117,5 +119,10 @@ rm $LST
%changelog
+* Fri Mar 27 2026 Remi Collet <remi@remirepo.net> - 2.7.0-2
+- improved pkg-config patch (merged upstream)
+
* Tue Mar 24 2026 Remi Collet <remi@remirepo.net> - 2.7.0-1
- initial package
+- open https://github.com/lexbor/lexbor/pull/345
+ add support for pkg-config