mirror of
				https://gitlab.gnome.org/GNOME/glib.git
				synced 2025-11-04 01:58:54 +01:00 
			
		
		
		
	Check the completiondir from bash-completion package config file.
With bash completion version lesser than 2.10, only prefix is defined while for greater version it is datadir. Closes #1054 Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
This commit is contained in:
		@@ -769,6 +769,17 @@ if host_system == 'windows'
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
if have_bash
 | 
			
		||||
  bash_comp_inst_dir = ''
 | 
			
		||||
  if bash_comp_dep.found()
 | 
			
		||||
    bash_comp_dir_override = bash_comp_dep.version().version_compare('>= 2.10') ? ['datadir', get_option('datadir')] : ['prefix', get_option('prefix')]
 | 
			
		||||
    bash_comp_inst_dir = bash_comp_dep.get_pkgconfig_variable('completionsdir', define_variable: bash_comp_dir_override)
 | 
			
		||||
  endif
 | 
			
		||||
 | 
			
		||||
  if bash_comp_inst_dir == ''
 | 
			
		||||
    message('Found bash-completion but the .pc file did not set \'completionsdir\', fallback to a predefined path')
 | 
			
		||||
    bash_comp_inst_dir = join_paths(get_option('datadir'), 'bash-completion/completions')
 | 
			
		||||
  endif
 | 
			
		||||
 | 
			
		||||
  install_data([
 | 
			
		||||
    'completion/gapplication',
 | 
			
		||||
    'completion/gdbus',
 | 
			
		||||
@@ -776,7 +787,7 @@ if have_bash
 | 
			
		||||
    'completion/gsettings',
 | 
			
		||||
    'completion/gresource'
 | 
			
		||||
  ],
 | 
			
		||||
  install_dir: join_paths(get_option('datadir'), 'bash-completion/completions'))
 | 
			
		||||
  install_dir: bash_comp_inst_dir)
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
if enable_dtrace
 | 
			
		||||
 
 | 
			
		||||
@@ -2219,6 +2219,7 @@ endif
 | 
			
		||||
 | 
			
		||||
# Determine which user environment-dependent files that we want to install
 | 
			
		||||
have_bash = find_program('bash', required : false).found() # For completion scripts
 | 
			
		||||
bash_comp_dep = dependency('bash-completion', version: '>=2.0', required: false)
 | 
			
		||||
have_sh = find_program('sh', required : false).found() # For glib-gettextize
 | 
			
		||||
 | 
			
		||||
# Some installed tests require a custom environment
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user