From cb11fd9cf76a368d8672925d02272c8a24992017 Mon Sep 17 00:00:00 2001 From: Ailin Nemui Date: Fri, 3 Sep 2021 16:18:21 +0200 Subject: [PATCH] add a PACKAGE_VERSION override for meson --- meson.build | 10 ++++++++-- meson_options.txt | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index fe5aa99f..bd192a92 100644 --- a/meson.build +++ b/meson.build @@ -53,6 +53,8 @@ require_glib_internal = get_option('install-glib') == 'force' want_static_dependency = get_option('static-dependency') == 'yes' +package_version = get_option('PACKAGE_VERSION') != '' ? get_option('PACKAGE_VERSION') : meson.project_version() + chat_modules = ['irc'] run_command('mkdir', meson.current_build_dir() / incdir) @@ -540,7 +542,7 @@ foreach h : headers endforeach conf.set('HAVE_LIBUTF8PROC', have_libutf8proc) -conf.set_quoted('PACKAGE_VERSION', meson.project_version()) +conf.set_quoted('PACKAGE_VERSION', package_version) conf.set_quoted('PACKAGE_TARNAME', meson.project_name()) configure_file(output : 'irssi-config.h', @@ -581,7 +583,11 @@ pc_requires = [] if not glib_internal pc_requires += glib_dep endif -pc.generate(filebase : 'irssi-1', name : 'Irssi', description : 'Irssi chat client', requires : pc_requires) +pc.generate(filebase : 'irssi-1', + name : 'Irssi', + description : 'Irssi chat client', + version : package_version, + requires : pc_requires) ########### # irssi.1 # diff --git a/meson_options.txt b/meson_options.txt index 5dc9c514..1013166d 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -15,3 +15,4 @@ option('static-dependency', type : 'combo', description : 'Request static depen option('install-glib', type : 'combo', description : 'Download and install GLib for you', choices : ['no', 'yes', 'force']) option('docdir', type : 'string', description : 'Documentation directory') option('fhs-prefix', type : 'string', description : 'System prefix for Termux') +option('PACKAGE_VERSION', type : 'string', description : 'Override PACKAGE_VERSION in tarballs')