From a6a20a7c40f86b5586286aaa614e6b64a5987d82 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Sequoia Date: Sun, 19 Jun 2022 23:06:40 -0700 Subject: [PATCH] meson: Provide options to set CFBundleVersion and CFBundleVersionString in XQuartz Signed-off-by: Jeremy Huddleston Sequoia (cherry picked from commit 4f5999826aa478ba5f138e74cfccdf3b854c8e54) --- hw/xquartz/meson.build | 15 +++++++++++++-- meson_options.txt | 4 ++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/hw/xquartz/meson.build b/hw/xquartz/meson.build index eb38c1fb5..b0c7a386e 100644 --- a/hw/xquartz/meson.build +++ b/hw/xquartz/meson.build @@ -6,8 +6,19 @@ bundle_id_prefix = get_option('bundle-id-prefix') xquartz_sparkle_feed_url = get_option('sparkle-feed-url') xquartz_sparkle_public_edkey = get_option('sparkle-public-edkey') -bundle_version_string = meson.project_version() # CFBundleShortVersionString -bundle_version = release # CFBundleVersion +bundle_version_string = get_option('bundle-version-string') # CFBundleShortVersionString +if bundle_version_string == 'auto' + bundle_version_string = meson.project_version() +endif + +bundle_version = get_option('bundle-version') # CFBundleVersion +if bundle_version == 'auto' + version_arr = bundle_version_string.split('.') + version_major = version_arr[0].to_int() + version_minor = version_arr[1].to_int() + version_tiny = version_arr[2].to_int() + bundle_version = '@0@.@1@.@2@'.format(version_major, version_minor, version_tiny) +endif bundle_id_def = '-DBUNDLE_ID_PREFIX="@0@"'.format(bundle_id_prefix) diff --git a/meson_options.txt b/meson_options.txt index f35048da0..b12d521ba 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -116,6 +116,10 @@ option('apple-application-name', type: 'string', value: 'X11', description: 'Application name') option('bundle-id-prefix', type: 'string', value: 'org.x', description: 'RDNS prefix for bundle identifier') +option('bundle-version', type: 'string', value: 'auto', + description: 'The CFBundleVersion for the application bundle') +option('bundle-version-string', type: 'string', value: 'auto', + description: 'The CFBundleShortVersionString for the application bundle') option('sparkle-feed-url', type: 'string', description: 'Feed URL for autoupdating with the Sparkle Framework (default: disabled)') option('sparkle-public-edkey', type: 'string',