From 9c226d5e771ee06cf20aed77339dfc2cbfd3f87e Mon Sep 17 00:00:00 2001 From: Jehan Date: Sun, 3 Nov 2024 22:47:21 +0100 Subject: [PATCH] app*, docs, tools: -Denable-default-bin=enabled will also install a gimp-major binary. On Windows, it will basically be a copy of the main binaries. On other OSes, it will be symlinks. This will help for Windows installers where we want to use major version only in registry and we need a binary named appropriately for this apparently. As for the "major" version, I will in fact use the next major when minor is 99 (also called API major version), not that it will matter much very soon! --- app-tools/meson.build | 14 ++++++++++---- app/meson.build | 28 ++++++++++++++++++++-------- docs/meson.build | 35 +++++++++++++++++++++++------------ tools/meson.build | 29 +++++++++++++++++++++-------- 4 files changed, 74 insertions(+), 32 deletions(-) diff --git a/app-tools/meson.build b/app-tools/meson.build index bab227ad27..ba41375e9c 100644 --- a/app-tools/meson.build +++ b/app-tools/meson.build @@ -26,11 +26,17 @@ gimp_debug_tool = executable('gimp-debug-tool' + exec_ver, if enable_default_bin if not platform_windows install_symlink(fs.name(gimp_debug_tool.full_path()).replace(exec_ver, ''), - pointing_to: fs.name(gimp_debug_tool.full_path()), - install_dir: gimp_debug_tool_dir - ) + pointing_to: fs.name(gimp_debug_tool.full_path()), + install_dir: gimp_debug_tool_dir) + install_symlink(fs.name(gimp_debug_tool.full_path()).replace(exec_ver, '-@0@'.format(api_version_major)), + pointing_to: fs.name(gimp_debug_tool.full_path()), + install_dir: gimp_debug_tool_dir) else meson.add_install_script('sh', '-c', - 'cp -f "@0@" "$MESON_INSTALL_DESTDIR_PREFIX/bin/@1@"'.format((gimp_debug_tool.full_path()), fs.name(gimp_debug_tool.name()).replace(exec_ver, '.exe'))) + 'cp -f "@0@" "$MESON_INSTALL_DESTDIR_PREFIX/bin/@1@"'.format(gimp_debug_tool.full_path(), + fs.name(gimp_debug_tool.name()).replace(exec_ver, '.exe'))) + meson.add_install_script('sh', '-c', + 'cp -f "@0@" "$MESON_INSTALL_DESTDIR_PREFIX/bin/@1@"'.format(gimp_debug_tool.full_path(), + fs.name(gimp_debug_tool.name()).replace(exec_ver, '-@0@.exe'.format(api_version_major)))) endif endif diff --git a/app/meson.build b/app/meson.build index 0785b79443..24496a14e6 100644 --- a/app/meson.build +++ b/app/meson.build @@ -232,22 +232,34 @@ gimpmain_exe = executable(gimpmain_exe_name, if enable_default_bin if not platform_windows install_symlink(fs.name(gimpmain_exe.full_path()).replace(exec_ver, ''), - pointing_to: fs.name(gimpmain_exe.full_path()), - install_dir: get_option('bindir') - ) + pointing_to: fs.name(gimpmain_exe.full_path()), + install_dir: get_option('bindir')) + install_symlink(fs.name(gimpmain_exe.full_path()).replace(exec_ver, '-@0@'.format(api_version_major)), + pointing_to: fs.name(gimpmain_exe.full_path()), + install_dir: get_option('bindir')) else meson.add_install_script('sh', '-c', - 'cp -f "@0@" "$MESON_INSTALL_DESTDIR_PREFIX/bin/@1@"'.format((gimpmain_exe.full_path()), fs.name(gimpmain_exe.name()).replace(exec_ver, '.exe'))) + 'cp -f "@0@" "$MESON_INSTALL_DESTDIR_PREFIX/bin/@1@"'.format(gimpmain_exe.full_path(), + fs.name(gimpmain_exe.name()).replace(exec_ver, '.exe'))) + meson.add_install_script('sh', '-c', + 'cp -f "@0@" "$MESON_INSTALL_DESTDIR_PREFIX/bin/@1@"'.format(gimpmain_exe.full_path(), + fs.name(gimpmain_exe.name()).replace(exec_ver, '-@0@.exe'.format(api_version_major)))) endif if enable_console_bin if not platform_windows install_symlink(fs.name(gimpconsole_exe.full_path()).replace(exec_ver, ''), - pointing_to: fs.name(gimpconsole_exe.full_path()), - install_dir: get_option('bindir') - ) + pointing_to: fs.name(gimpconsole_exe.full_path()), + install_dir: get_option('bindir')) + install_symlink(fs.name(gimpconsole_exe.full_path()).replace(exec_ver, '-@0@'.format(api_version_major)), + pointing_to: fs.name(gimpconsole_exe.full_path()), + install_dir: get_option('bindir')) else meson.add_install_script('sh', '-c', - 'cp -f "@0@" "$MESON_INSTALL_DESTDIR_PREFIX/bin/@1@"'.format((gimpconsole_exe.full_path()), fs.name(gimpconsole_exe.name()).replace(exec_ver, '.exe'))) + 'cp -f "@0@" "$MESON_INSTALL_DESTDIR_PREFIX/bin/@1@"'.format(gimpconsole_exe.full_path(), + fs.name(gimpconsole_exe.name()).replace(exec_ver, '.exe'))) + meson.add_install_script('sh', '-c', + 'cp -f "@0@" "$MESON_INSTALL_DESTDIR_PREFIX/bin/@1@"'.format(gimpconsole_exe.full_path(), + fs.name(gimpconsole_exe.name()).replace(exec_ver, '-@0@.exe'.format(api_version_major)))) endif endif endif diff --git a/docs/meson.build b/docs/meson.build index 2388be2238..1f8a37f706 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -42,21 +42,32 @@ install_man(man_files) if enable_default_bin and not platform_windows install_symlink('gimptool.1', - pointing_to: 'gimptool-' + gimp_app_version + '.1', - install_dir: get_option('mandir') + '/man1' - ) + pointing_to: 'gimptool-' + gimp_app_version + '.1', + install_dir: get_option('mandir') + '/man1') + install_symlink('gimptool-@0@.1'.format(api_version_major), + pointing_to: 'gimptool-' + gimp_app_version + '.1', + install_dir: get_option('mandir') + '/man1') + install_symlink('gimprc.5', - pointing_to: 'gimprc-' + gimp_app_version + '.5', - install_dir: get_option('mandir') + '/man5' - ) + pointing_to: 'gimprc-' + gimp_app_version + '.5', + install_dir: get_option('mandir') + '/man5') + install_symlink('gimprc-@0@.5'.format(api_version_major), + pointing_to: 'gimprc-' + gimp_app_version + '.5', + install_dir: get_option('mandir') + '/man5') + if enable_console_bin install_symlink('gimp-console.1', - pointing_to: 'gimp-console-' + gimp_app_version + '.1', - install_dir: get_option('mandir') + '/man1' - ) + pointing_to: 'gimp-console-' + gimp_app_version + '.1', + install_dir: get_option('mandir') + '/man1') + install_symlink('gimp-console-@0@.1'.format(api_version_major), + pointing_to: 'gimp-console-' + gimp_app_version + '.1', + install_dir: get_option('mandir') + '/man1') endif + install_symlink('gimp.1', - pointing_to: 'gimp-' + gimp_app_version + '.1', - install_dir: get_option('mandir') + '/man1' - ) + pointing_to: 'gimp-' + gimp_app_version + '.1', + install_dir: get_option('mandir') + '/man1') + install_symlink('gimp-@0@.1'.format(api_version_major), + pointing_to: 'gimp-' + gimp_app_version + '.1', + install_dir: get_option('mandir') + '/man1') endif diff --git a/tools/meson.build b/tools/meson.build index 799e6f785a..feb7fc7f49 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -48,18 +48,31 @@ endif if enable_default_bin if not platform_windows install_symlink(fs.name(gimptool.full_path()).replace(exec_ver, ''), - pointing_to: fs.name(gimptool.full_path()), - install_dir: get_option('bindir') - ) + pointing_to: fs.name(gimptool.full_path()), + install_dir: get_option('bindir')) + install_symlink(fs.name(gimptool.full_path()).replace(exec_ver, '-@0@'.format(api_version_major)), + pointing_to: fs.name(gimptool.full_path()), + install_dir: get_option('bindir')) + install_symlink(fs.name(gimp_test_clipboard.full_path()).replace(exec_ver, ''), - pointing_to: fs.name(gimp_test_clipboard.full_path()), - install_dir: get_option('bindir') - ) + pointing_to: fs.name(gimp_test_clipboard.full_path()), + install_dir: get_option('bindir')) + install_symlink(fs.name(gimp_test_clipboard.full_path()).replace(exec_ver, '-@0@'.format(api_version_major)), + pointing_to: fs.name(gimp_test_clipboard.full_path()), + install_dir: get_option('bindir')) else meson.add_install_script('sh', '-c', - 'cp -f "@0@" "$MESON_INSTALL_DESTDIR_PREFIX/bin/@1@"'.format((gimptool.full_path()), fs.name(gimptool.name()).replace(exec_ver, '.exe'))) + 'cp -f "@0@" "$MESON_INSTALL_DESTDIR_PREFIX/bin/@1@"'.format(gimptool.full_path(), + fs.name(gimptool.name()).replace(exec_ver, '.exe'))) meson.add_install_script('sh', '-c', - 'cp -f "@0@" "$MESON_INSTALL_DESTDIR_PREFIX/bin/@1@"'.format((gimp_test_clipboard.full_path()), fs.name(gimp_test_clipboard.name()).replace(exec_ver, '.exe'))) + 'cp -f "@0@" "$MESON_INSTALL_DESTDIR_PREFIX/bin/@1@"'.format(gimptool.full_path(), + fs.name(gimptool.name()).replace(exec_ver, '-@0@.exe'.format(api_version_major)))) + meson.add_install_script('sh', '-c', + 'cp -f "@0@" "$MESON_INSTALL_DESTDIR_PREFIX/bin/@1@"'.format(gimp_test_clipboard.full_path(), + fs.name(gimp_test_clipboard.name()).replace(exec_ver, '.exe'))) + meson.add_install_script('sh', '-c', + 'cp -f "@0@" "$MESON_INSTALL_DESTDIR_PREFIX/bin/@1@"'.format(gimp_test_clipboard.full_path(), + fs.name(gimp_test_clipboard.name()).replace(exec_ver, '-@0@.exe'.format(api_version_major)))) endif endif