From 8fa0fa352b6f91d510da7aa144acc643ca0874e2 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sat, 27 Feb 2021 21:11:56 -0500 Subject: [PATCH] meson: generate osx-bundle.sed --- .gitignore | 1 - packages/meson.build | 2 -- tools/version.sh | 14 +++++++++++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index f05385c6e..1b60e3f20 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,6 @@ src/libresrc/default_config_platform.json tests/*.json tests/run tools/osx-bundle-restart-helper -tools/osx-bundle.sed tools/repack-thes-dict tools/repack-thes-dict.dSYM diff --git a/packages/meson.build b/packages/meson.build index 4a7d79a65..41a0ab5cf 100644 --- a/packages/meson.build +++ b/packages/meson.build @@ -5,8 +5,6 @@ if host_machine.system() == 'windows' run_target('win-installer', command: [installer_setup, meson.project_build_root(), meson.project_source_root()]) elif host_machine.system() == 'darwin' - # temporary hack until version.sh generates this properly - run_command('cp', meson.project_source_root() / 'tools' / 'osx-bundle.sed', meson.project_build_root()) fontconfig_conf = run_command('pkg-config', '--variable=confdir', 'fontconfig').stdout().strip() run_target('osx-bundle', command: ['../tools/osx-bundle.sh', meson.project_source_root(), meson.project_build_root(), 'wx-config', fontconfig_conf, '', diff --git a/tools/version.sh b/tools/version.sh index 485f45113..8df33e175 100755 --- a/tools/version.sh +++ b/tools/version.sh @@ -20,6 +20,7 @@ if ! test -d "${srcdir}/.git"; then exit 2 fi fi +osx_bundle_sed_path="${builddir}/osx-bundle.sed" last_svn_revision=6962 last_svn_hash="16cd907fe7482cb54a7374cd28b8501f138116be" @@ -44,6 +45,7 @@ else tagged_release=0 fi +build_date="$(date "+%Y-%m-%d %H:%M %Z")" new_version_h="\ #define BUILD_GIT_VERSION_NUMBER ${git_revision} @@ -52,11 +54,21 @@ new_version_h="\ #define INSTALLER_VERSION \"${installer_version}\" #define RESOURCE_BASE_VERSION ${resource_version}" +osx_bundle_sed="\ +s/@PLIST_VERSION@/${git_version_str}/g +s/@PLIST_BUILD_DATE@/${build_date}/g +/ *@LOCALIZATIONS@/ { + r languages + d +}" # Write it only if it's changed to avoid spurious rebuilds # This bizzare comparison method is due to that newlines in shell variables are very exciting case "$(cat ${version_h_path} 2> /dev/null)" in "${new_version_h}");; - *) echo "${new_version_h}" > "${version_h_path}" + *) + echo "${new_version_h}" > "${version_h_path}" + echo "${osx_bundle_sed}" > "${osx_bundle_sed_path}" + ;; esac