diff --git a/app-tools/meson.build b/app-tools/meson.build index bd6fb7aadd..bab227ad27 100644 --- a/app-tools/meson.build +++ b/app-tools/meson.build @@ -23,9 +23,14 @@ gimp_debug_tool = executable('gimp-debug-tool' + exec_ver, install_dir: gimp_debug_tool_dir ) -if enable_default_bin and meson.version().version_compare('>=0.61.0') - 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 - ) +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 + ) + 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'))) + endif endif diff --git a/app/meson.build b/app/meson.build index 045ab4e775..0785b79443 100644 --- a/app/meson.build +++ b/app/meson.build @@ -229,15 +229,25 @@ gimpmain_exe = executable(gimpmain_exe_name, install: true, ) -if enable_default_bin and meson.version().version_compare('>=0.61.0') - install_symlink(fs.name(gimpmain_exe.full_path()).replace(exec_ver, ''), - pointing_to: fs.name(gimpmain_exe.full_path()), - install_dir: get_option('bindir') - ) - if enable_console_bin - install_symlink(fs.name(gimpconsole_exe.full_path()).replace(exec_ver, ''), - pointing_to: fs.name(gimpconsole_exe.full_path()), +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') ) + 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'))) + 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') + ) + 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'))) + endif endif endif diff --git a/build/windows/gitlab-ci/2_build-gimp-msys2.sh b/build/windows/gitlab-ci/2_build-gimp-msys2.sh index 1138a5e75d..9159fbdf81 100644 --- a/build/windows/gitlab-ci/2_build-gimp-msys2.sh +++ b/build/windows/gitlab-ci/2_build-gimp-msys2.sh @@ -53,6 +53,7 @@ if [ ! -f "_build${ARTIFACTS_SUFFIX}/build.ninja" ]; then -Ddirectx-sdk-dir="${MSYSTEM_PREFIX}" \ -Dwindows-installer=true \ -Dms-store=true \ + -Denable-default-bin=enabled \ -Dbuild-id=org.gimp.GIMP_official $MESON_OPTIONS else cd "_build${ARTIFACTS_SUFFIX}" diff --git a/docs/meson.build b/docs/meson.build index d9d3fabfdc..2388be2238 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -40,7 +40,7 @@ man_files += configure_file( install_man(man_files) -if enable_default_bin and meson.version().version_compare('>=0.61.0') +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' diff --git a/meson.build b/meson.build index f9bc58f5fe..a6214f9f61 100644 --- a/meson.build +++ b/meson.build @@ -1306,10 +1306,6 @@ endif enable_console_bin = get_option('enable-console-bin') -if enable_default_bin and meson.version().version_compare('<0.61.0') - error('"enable-default-bin" build option requires meson 0.61 or later. Please disable the option or update meson.') -endif - # Possibly change default gimpdir from $XDG_CONFIG_HOME/GIMP/gimp_user_version gimpdir = get_option('gimpdir') if gimpdir == '' diff --git a/meson_options.txt b/meson_options.txt index 93ca46534d..eb6b6c9abd 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -32,7 +32,7 @@ option('libbacktrace', type: 'boolean', value: true, description: 'Build wi # Features -option('enable-default-bin',type: 'feature', value: 'auto', description: 'Install unversioned symlinks pointing to versioned executables') +option('enable-default-bin',type: 'feature', value: 'auto', description: 'Install unversioned symlinks pointing to versioned executables (on UNIX) or unversioned duplicates (on Windows)') option('aa', type: 'feature', value: 'auto', description: 'AA plugin') option('alsa', type: 'feature', value: 'auto', description: 'Alsa support in midi input controller') option('appdata-test', type: 'feature', value: 'auto', description: 'Validate the appdata file') diff --git a/tools/meson.build b/tools/meson.build index 5755cc9ca9..9551177a10 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -30,15 +30,22 @@ gimp_test_clipboard = executable('gimp-test-clipboard' + exec_ver, install: true, ) -if enable_default_bin and meson.version().version_compare('>=0.61.0') - install_symlink(fs.name(gimptool.full_path()).replace(exec_ver, ''), - 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') - ) +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') + ) + 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') + ) + 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'))) + 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'))) + endif endif executable('kernelgen',