From 22c600d2eb325b01e428f0d73e7ff866bbde36f2 Mon Sep 17 00:00:00 2001
From: Sergey Fedorov <fygrave@gmail.com>
Date: Sun, 16 Aug 2026 10:43:19 +0000
Subject: [PATCH 7/7] meta: Bump version to 2.52.0 and add the rsvg_*_version
 globals

Everything before this commit is unreachable without it.  Applications
gate on the librsvg version, not on symbol availability: render_document()
is guarded by 2.46 and get_intrinsic_size_in_pixels() by 2.52, so a
pkg-config version of 2.40.x makes their configure checks fail no matter
what this library exports.  rsvg_handle_set_stylesheet() has been in this
branch since 2.40.23 and is still invisible to anything testing for 2.48.

2.52.0 is the lowest version that covers every function implemented here,
and no higher, so the version does not promise API that is absent.

The soname stays librsvg-2.so.2, so nothing needs relinking; under
autotools the library filename tracks the version as usual.

librsvg 2.52 renamed the version globals from librsvg_* to rsvg_*.  Export
both, since claiming that version implies the new spelling exists.
---
 configure.ac          |  4 ++--
 librsvg-features.c    |  6 ++++++
 librsvg-features.h.in | 30 ++++++++++++++++++++++++++++++
 meson.build           |  2 +-
 rsvg.symbols          |  5 +++++
 5 files changed, 44 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index e8abf07c1..218600fda 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
 m4_define([rsvg_major_version],[2])
-m4_define([rsvg_minor_version],[40])
-m4_define([rsvg_micro_version],[23])
+m4_define([rsvg_minor_version],[52])
+m4_define([rsvg_micro_version],[0])
 m4_define([rsvg_extra_version],[])
 m4_define([rsvg_version],[rsvg_major_version.rsvg_minor_version.rsvg_micro_version()rsvg_extra_version])
 m4_define([rsvg_lt_version_info],m4_eval(rsvg_major_version + rsvg_minor_version):rsvg_micro_version:rsvg_minor_version)
diff --git a/librsvg-features.c b/librsvg-features.c
index 5e083c26e..41174681f 100644
--- a/librsvg-features.c
+++ b/librsvg-features.c
@@ -5,3 +5,9 @@ const guint librsvg_major_version = LIBRSVG_MAJOR_VERSION;
 const guint librsvg_minor_version = LIBRSVG_MINOR_VERSION;
 const guint librsvg_micro_version = LIBRSVG_MICRO_VERSION;
 const char librsvg_version[] = LIBRSVG_VERSION;
+
+/* Spelling introduced in librsvg 2.52; the librsvg_* names above are kept for
+ * existing callers. */
+const guint rsvg_major_version = LIBRSVG_MAJOR_VERSION;
+const guint rsvg_minor_version = LIBRSVG_MINOR_VERSION;
+const guint rsvg_micro_version = LIBRSVG_MICRO_VERSION;
diff --git a/librsvg-features.h.in b/librsvg-features.h.in
index 8950ed607..04b737393 100644
--- a/librsvg-features.h.in
+++ b/librsvg-features.h.in
@@ -47,4 +47,34 @@ RSVG_VAR const guint librsvg_minor_version;
 RSVG_VAR const guint librsvg_micro_version;
 RSVG_VAR const char librsvg_version[];
 
+/**
+ * rsvg_major_version:
+ *
+ * Major version of the library.  For example, for version 2.3.4, the major
+ * version will be 2.
+ *
+ * Since: 2.52
+ */
+RSVG_VAR const guint rsvg_major_version;
+
+/**
+ * rsvg_minor_version:
+ *
+ * Minor version of the library.  For example, for version 2.3.4, the minor
+ * version will be 3.
+ *
+ * Since: 2.52
+ */
+RSVG_VAR const guint rsvg_minor_version;
+
+/**
+ * rsvg_micro_version:
+ *
+ * Micro version of the library.  For example, for version 2.3.4, the micro
+ * version will be 4.
+ *
+ * Since: 2.52
+ */
+RSVG_VAR const guint rsvg_micro_version;
+
 #endif
diff --git a/meson.build b/meson.build
index 9666b692b..c4aecd415 100644
--- a/meson.build
+++ b/meson.build
@@ -1,5 +1,5 @@
 project('librsvg', 'c',
-        version: '2.40.23',
+        version: '2.52.0',
         meson_version: '>= 1.1',
         default_options: [
           'c_std=gnu11', 'warning_level=1', 'werror=false'
diff --git a/rsvg.symbols b/rsvg.symbols
index b54607235..2e4f3c968 100644
--- a/rsvg.symbols
+++ b/rsvg.symbols
@@ -38,6 +38,11 @@ rsvg_handle_render_element
 rsvg_handle_get_geometry_for_layer
 rsvg_handle_get_geometry_for_element
 
+/* librsvg-features.h */
+rsvg_major_version
+rsvg_minor_version
+rsvg_micro_version
+
 /* rsvg-css.h---semi-public for rsvg-convert */
 rsvg_css_parse_color
 
-- 
2.43.0

