meson: improve/fix previous commit from MR !725.

- Setting an exec_dir variable is an error. As meson docs says, if
  relative, it is installed relatively to prefix anyway: "If this is a
  relative path, it is assumed to be relative to the prefix."
  On the other hand, it would make problems if someone tried to set an
  absolute bindir.
  Moreover it is a lot clearer now. When we want to install in the
  binary directory unconditionally, then get_option('bindir') is the
  meson way, hence the way to go.
- On the other hand, the `gimp-debug-tool` is installed either in bindir
  for Windows or macOS and libexecdir for all other platforms, at least
  that's how it's set in the autotools build. So let's keep both builds
  consistent.
- Make a hopefully clearer description for enable-default-bin option.
  Let's clarify this is just about creating unversionning links pointing
  to versionned files.
- Adding an item in the "Optional Features" part of the summary listing
  during meson configure, for better discovery.

For the ".exe" extension on Windows, I wished we had an $(EXEEXT)
equivalent on meson rather than trying to set it ourselves (are there
other platforms where we must set a different extension?). But I could
not find any.
This commit is contained in:
Jehan 2022-08-29 12:39:49 +02:00
parent 879f7b48de
commit 9ce27be989
6 changed files with 15 additions and 9 deletions

View File

@ -1,3 +1,9 @@
if platform_windows or platform_osx
gimp_debug_tool_dir = get_option('bindir')
else
gimp_debug_tool_dir = get_option('libexecdir')
endif
gimp_debug_tool = executable('gimp-debug-tool-' + gimp_app_version,
'gimp-debug-tool.c',
@ -14,12 +20,12 @@ gimp_debug_tool = executable('gimp-debug-tool-' + gimp_app_version,
libgimpbase,
],
install: true,
install_dir: exec_dir
install_dir: gimp_debug_tool_dir
)
if enable_default_bin and meson.version().version_compare('>=0.61.0')
install_symlink('gimp-debug-tool' + exec_ext,
pointing_to: 'gimp-debug-tool-' + gimp_app_version + exec_ext,
install_dir: exec_dir
install_dir: gimp_debug_tool_dir
)
endif

View File

@ -221,12 +221,12 @@ gimpmain_exe = executable('gimp-'+gimp_app_version,
if enable_default_bin and meson.version().version_compare('>=0.61.0')
install_symlink('gimp' + exec_ext,
pointing_to: 'gimp-' + gimp_app_version + exec_ext,
install_dir: exec_dir
install_dir: get_option('bindir')
)
if enable_console_bin
install_symlink('gimp-console' + exec_ext,
pointing_to: 'gimp-console-' + gimp_app_version + exec_ext,
install_dir: exec_dir
install_dir: get_option('bindir')
)
endif
endif

View File

@ -92,7 +92,6 @@ cc = meson.get_compiler('c')
cxx = meson.get_compiler('cpp')
prefix = get_option('prefix')
buildtype = get_option('buildtype')
exec_dir = prefix + '/' + get_option('bindir')
exec_ext = ''
compiler_args = []
@ -1807,6 +1806,7 @@ final_message = [
''' Default ICC directory: @0@'''.format(icc_directory),
''' 32-bit DLL folder (Win32): @0@'''.format(get_option('win32-32bits-dll-folder')),
''' Detailed backtraces: @0@'''.format(detailed_backtraces),
''' Binary symlinks: @0@'''.format(enable_default_bin),
'',
'''Optional Plug-Ins:''',
''' Ascii Art: @0@'''.format(libaa.found()),

View File

@ -2,7 +2,7 @@
option('ansi', type: 'boolean', value: false, description: 'Turn on strict ansi')
option('enable-console-bin',type: 'boolean', value: true, description: 'Build a console-only binary which does not link GTK')
option('win32-debug-console',type:'boolean', value: true, description: 'Open a console when starting the program')
option('enable-default-bin',type: 'boolean', value: true, description: 'Install default app links pointing to the executables')
option('enable-default-bin',type: 'boolean', value: true, description: 'Install unversioned symlinks pointing to versioned executables')
option('enable-multiproc', type: 'boolean', value: true, description: 'Support for multiple processors')
option('profiling', type: 'boolean', value: false, description: 'Enable profiling')
option('windows-installer', type: 'boolean', value: false, description: 'Generate files needed for the Windows installer')

View File

@ -44,6 +44,6 @@ executable(executable_name,
if enable_default_bin and meson.version().version_compare('>=0.61.0')
install_symlink('gimp-script-fu-interpreter' + exec_ext,
pointing_to: executable_name + exec_ext,
install_dir: exec_dir
install_dir: get_option('bindir')
)
endif

View File

@ -33,11 +33,11 @@ executable('gimp-test-clipboard-' + gimp_app_version,
if enable_default_bin and meson.version().version_compare('>=0.61.0')
install_symlink('gimptool' + exec_ext,
pointing_to: 'gimptool-' + gimp_app_version + exec_ext,
install_dir: exec_dir
install_dir: get_option('bindir')
)
install_symlink('gimp-test-clipboard' + exec_ext,
pointing_to: 'gimp-test-clipboard-' + gimp_app_version + exec_ext,
install_dir: exec_dir
install_dir: get_option('bindir')
)
endif