# HG changeset patch
# Node ID 44d15a0bd58a9600fe632f30bc844b50113df2e8
# Parent  f0edc907e01842fc59d52965971b2c7329db94ad
diff --git a/libpurple/meson.build b/libpurple/meson.build
--- a/libpurple/meson.build
+++ b/libpurple/meson.build
@@ -211,7 +211,7 @@
 	c_name : 'purple')
 purple_builtsources += purple_resource
 
-purple_filebase = f'purple-@purple_major_version@'
+purple_filebase = f'purple-@purple_api_major_version@'
 purple_include_base = purple_filebase / 'libpurple'
 
 if IS_WIN32
@@ -332,7 +332,7 @@
 	    symbol_prefix : 'purple',
 	    identifier_prefix : 'Purple',
 	    export_packages : purple_filebase,
-	    nsversion : f'@purple_major_version@.@purple_minor_version@',
+	    nsversion : f'@purple_api_major_version@.@purple_minor_version@',
 	    dependencies: [birb_dep, gplugin_dep],
 	    install : true,
 	    extra_args : ['-DPURPLE_COMPILATION', '--quiet'])
diff --git a/libpurple/purpleversion.h b/libpurple/purpleversion.h
--- a/libpurple/purpleversion.h
+++ b/libpurple/purpleversion.h
@@ -74,8 +74,11 @@
  *
  * Since: 3.0
  */
-#define PURPLE_VERSION_CUR_STABLE \
-	(G_ENCODE_VERSION(PURPLE_MAJOR_VERSION, PURPLE_MINOR_VERSION))
+#if (PURPLE_MINOR_VERSION >= 90)
+# define PURPLE_VERSION_CUR_STABLE (G_ENCODE_VERSION(PURPLE_MAJOR_VERSION + 1, 0))
+#else
+# define PURPLE_VERSION_CUR_STABLE (G_ENCODE_VERSION(PURPLE_MAJOR_VERSION, PURPLE_MINOR_VERSION))
+#endif
 
 /**
  * PURPLE_VERSION_MIN_REQUIRED:
diff --git a/meson.build b/meson.build
--- a/meson.build
+++ b/meson.build
@@ -21,7 +21,7 @@
 #   For production releases:    ''
 #
 project('pidgin', 'c',
-    version : '3.0.0-devel',
+    version : '2.90.0-devel',
     meson_version : '>=1.0.0',
     default_options : ['c_std=c17', 'warning_level=2'])
 purple_soversion = 0
@@ -38,6 +38,13 @@
 purple_minor_version = parts[1]
 purple_micro_version = parts[2]
 
+# purple_api_major_version should generally match purple_major_version.
+# However, when working towards a new major version, this number should be set
+# to that new major version while the meson project version should be something
+# like 2.90.0. This allows us to get the versioning sane, while changing the
+# major version.
+purple_api_major_version = '3'
+
 GETTEXT_PACKAGE='pidgin3'
 find_program('gettext')
 find_program('xgettext')
@@ -62,6 +69,7 @@
 conf.set_quoted('PURPLE_BUILD_BUILDTYPE', get_option('buildtype'))
 conf.set('PURPLE_DEBUG', get_option('debug'))
 
+version_conf.set('PURPLE_API_MAJOR_VERSION', purple_api_major_version)
 version_conf.set('PURPLE_MAJOR_VERSION', purple_major_version)
 version_conf.set('PURPLE_MINOR_VERSION', purple_minor_version)
 version_conf.set('PURPLE_MICRO_VERSION', purple_micro_version)
@@ -131,9 +139,9 @@
 	endforeach
 
 	conf.set('PURPLE_LIBDIR',
-		 f'wpurple_lib_dir("purple-@purple_major_version@")')
+		 f'wpurple_lib_dir("purple-@purple_api_major_version@")')
 	conf.set('PIDGIN_LIBDIR',
-		 f'wpurple_lib_dir("pidgin-@purple_major_version@")')
+		 f'wpurple_lib_dir("pidgin-@purple_api_major_version@")')
 
 	conf.set('PURPLE_DATADIR', 'wpurple_data_dir()')
 	conf.set('PURPLE_SYSCONFDIR', 'wpurple_sysconf_dir()')
@@ -146,15 +154,15 @@
 
 	common_libdir = get_option('prefix') / get_option('libdir')
 	conf.set_quoted('PURPLE_LIBDIR',
-	                common_libdir / f'purple-@purple_major_version@')
+	                common_libdir / f'purple-@purple_api_major_version@')
 	conf.set_quoted('PIDGIN_LIBDIR',
-	                common_libdir / f'pidgin-@purple_major_version@')
+	                common_libdir / f'pidgin-@purple_api_major_version@')
 endif
 
 abslibdir = get_option('prefix') / get_option('libdir')
-PURPLE_PLUGINDIR = abslibdir / f'purple-@purple_major_version@'
+PURPLE_PLUGINDIR = abslibdir / f'purple-@purple_api_major_version@'
 conf.set_quoted('PURPLE_PLUGINDIR', PURPLE_PLUGINDIR)
-PIDGIN_PLUGINDIR = abslibdir / f'pidgin-@purple_major_version@'
+PIDGIN_PLUGINDIR = abslibdir / f'pidgin-@purple_api_major_version@'
 conf.set_quoted('PIDGIN_PLUGINDIR', PIDGIN_PLUGINDIR)
 
 # Windows and Haiku do not use libm for the math functions, they are part
diff --git a/pidgin/meson.build b/pidgin/meson.build
--- a/pidgin/meson.build
+++ b/pidgin/meson.build
@@ -222,7 +222,7 @@
     filebase : pidgin_filebase,
     subdirs : pidgin_filebase,
     libraries : [gtk, libadwaita, libpurple_dep, gplugin_gtk_dep],
-    variables : [f'plugindir=${libdir}/pidgin-@purple_major_version@'])
+    variables : [f'plugindir=${libdir}/pidgin-@purple_api_major_version@'])
 
 if enable_introspection
 	introspection_sources = libpidgin_SOURCES + libpidgin_headers + libpidgin_prefs_headers
@@ -234,8 +234,8 @@
 		namespace : 'Pidgin',
 		symbol_prefix : 'pidgin',
 		identifier_prefix : 'Pidgin',
-		export_packages : f'pidgin-@purple_major_version@',
-		nsversion : f'@purple_major_version@.@purple_minor_version@',
+		export_packages : f'pidgin-@purple_api_major_version@',
+		nsversion : f'@purple_api_major_version@.@purple_minor_version@',
 		dependencies : [gplugin_dep, gplugin_gtk_dep, libpurple_dep],
 		install : true,
 		extra_args : ['-DPIDGIN_COMPILATION', '--quiet'])
diff --git a/pidgin/pidginversion.h b/pidgin/pidginversion.h
--- a/pidgin/pidginversion.h
+++ b/pidgin/pidginversion.h
@@ -94,8 +94,11 @@
  *
  * Since: 3.0
  */
-#define PIDGIN_VERSION_CUR_STABLE \
-	(G_ENCODE_VERSION(PIDGIN_MAJOR_VERSION, PIDGIN_MINOR_VERSION))
+#if (PIDGIN_MINOR_VERSION >= 90)
+# define PIDGIN_VERSION_CUR_STABLE (G_ENCODE_VERSION(PIDGIN_MAJOR_VERSION + 1, 0))
+#else
+# define PIDGIN_VERSION_CUR_STABLE (G_ENCODE_VERSION(PIDGIN_MAJOR_VERSION, PIDGIN_MINOR_VERSION))
+#endif
 
 /* If the package sets PIDGIN_VERSION_MIN_REQUIRED to some future
  * PIDGIN_VERSION_X_Y value that we don't know about, it will compare as 0 in
diff --git a/protocols/ircv3/meson.build b/protocols/ircv3/meson.build
--- a/protocols/ircv3/meson.build
+++ b/protocols/ircv3/meson.build
@@ -22,7 +22,8 @@
 
 ibis_dep = dependency('ibis', version : '>= 0.8.2')
 
-ircv3_filebase = f'purple-@purple_major_version@-ircv3'
+ircv3_filebase = f'purple-@purple_api_major_version@-ircv3'
+ircv3_filebase = f'purple-@purple_api_major_version@-ircv3'
 
 ircv3_includes = include_directories('.')
 ircv3_include_base = purple_include_base / 'protocols/ircv3'
diff --git a/protocols/ircv3/purpleircv3version.h b/protocols/ircv3/purpleircv3version.h
--- a/protocols/ircv3/purpleircv3version.h
+++ b/protocols/ircv3/purpleircv3version.h
@@ -73,8 +73,11 @@
  *
  * Since: 3.0
  */
-#define PURPLE_IRCV3_VERSION_CUR_STABLE \
-	(G_ENCODE_VERSION(PURPLE_MAJOR_VERSION, PURPLE_MINOR_VERSION))
+#if (PURPLE_MINOR_VERSION >= 90)
+# define PURPLE_IRCV3_VERSION_CUR_STABLE (G_ENCODE_VERSION(PURPLE_MAJOR_VERSION + 1, 0))
+#else
+#define PURPLE_IRCV3_VERSION_CUR_STABLE (G_ENCODE_VERSION(PURPLE_MAJOR_VERSION, PURPLE_MINOR_VERSION))
+#endif
 
 /* If the package sets PURPLE_IRCV3_VERSION_MIN_REQUIRED to some future
  * PURPLE_IRCV3_VERSION_X_Y value that we don't know about, it will compare as 0 in
