Issue #4053: Add "*default_bin" support on Windows and enable it

Almost every program have a non-versioned .exe on Windows. MSYS2 does this too.
This commit is contained in:
Bruno 2024-06-05 09:40:30 -03:00
parent 29bb5b3608
commit fb5474ae4d
No known key found for this signature in database
7 changed files with 47 additions and 28 deletions

View file

@ -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')
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

View file

@ -229,15 +229,25 @@ gimpmain_exe = executable(gimpmain_exe_name,
install: true,
)
if enable_default_bin and meson.version().version_compare('>=0.61.0')
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

View file

@ -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}"

View file

@ -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'

View file

@ -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 == ''

View file

@ -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')

View file

@ -30,7 +30,8 @@ gimp_test_clipboard = executable('gimp-test-clipboard' + exec_ver,
install: true,
)
if enable_default_bin and meson.version().version_compare('>=0.61.0')
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')
@ -39,6 +40,12 @@ if enable_default_bin and meson.version().version_compare('>=0.61.0')
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',