Merge branch 'dd/meson-perl-custom-path'

Meson-based build framework update.

* dd/meson-perl-custom-path:
  meson: allow customize perl installation path
This commit is contained in:
Junio C Hamano
2025-05-15 17:24:56 -07:00
10 changed files with 19 additions and 10 deletions

View File

@@ -1904,14 +1904,19 @@ if perl_features_enabled
perl_header_template = 'perl/header_templates/runtime_prefix.template.pl' perl_header_template = 'perl/header_templates/runtime_prefix.template.pl'
endif endif
perllibdir = get_option('perllibdir')
if perllibdir == ''
perllibdir = get_option('datadir') / 'perl5'
endif
perl_header = configure_file( perl_header = configure_file(
input: perl_header_template, input: perl_header_template,
output: 'GIT-PERL-HEADER', output: 'GIT-PERL-HEADER',
configuration: { configuration: {
'GITEXECDIR_REL': get_option('libexecdir') / 'git-core', 'GITEXECDIR_REL': get_option('libexecdir') / 'git-core',
'PERLLIBDIR_REL': get_option('datadir') / 'perl5', 'PERLLIBDIR_REL': perllibdir,
'LOCALEDIR_REL': get_option('datadir') / 'locale', 'LOCALEDIR_REL': get_option('datadir') / 'locale',
'INSTLIBDIR': get_option('datadir') / 'perl5', 'INSTLIBDIR': perllibdir,
'PATHSEP': pathsep, 'PATHSEP': pathsep,
}, },
) )

View File

@@ -1,3 +1,7 @@
# Configuration for Git installation
option('perllibdir', type: 'string', value: '',
description: 'Directory to install perl lib to. Defaults to <datadir>/perl5')
# Configuration for how Git behaves at runtime. # Configuration for how Git behaves at runtime.
option('default_pager', type: 'string', value: 'less', option('default_pager', type: 'string', value: 'less',
description: 'Fall-back pager.') description: 'Fall-back pager.')

View File

@@ -3,6 +3,6 @@ test_dependencies += custom_target(
output: 'Address.pm', output: 'Address.pm',
command: generate_perl_command, command: generate_perl_command,
install: true, install: true,
install_dir: get_option('datadir') / 'perl5/FromCPAN/Mail', install_dir: perllibdir / 'FromCPAN/Mail',
depends: [git_version_file], depends: [git_version_file],
) )

View File

@@ -3,7 +3,7 @@ test_dependencies += custom_target(
output: 'Error.pm', output: 'Error.pm',
command: generate_perl_command, command: generate_perl_command,
install: true, install: true,
install_dir: get_option('datadir') / 'perl5/FromCPAN', install_dir: perllibdir / 'FromCPAN',
depends: [git_version_file], depends: [git_version_file],
) )

View File

@@ -3,6 +3,6 @@ test_dependencies += custom_target(
output: 'Address.pm', output: 'Address.pm',
command: generate_perl_command, command: generate_perl_command,
install: true, install: true,
install_dir: get_option('datadir') / 'perl5/Git/LoadCPAN/Mail', install_dir: perllibdir / 'Git/LoadCPAN/Mail',
depends: [git_version_file], depends: [git_version_file],
) )

View File

@@ -3,7 +3,7 @@ test_dependencies += custom_target(
output: 'Error.pm', output: 'Error.pm',
command: generate_perl_command, command: generate_perl_command,
install: true, install: true,
install_dir: get_option('datadir') / 'perl5/Git/LoadCPAN', install_dir: perllibdir / 'Git/LoadCPAN',
depends: [git_version_file], depends: [git_version_file],
) )

View File

@@ -3,6 +3,6 @@ test_dependencies += custom_target(
output: 'YAML.pm', output: 'YAML.pm',
command: generate_perl_command, command: generate_perl_command,
install: true, install: true,
install_dir: get_option('datadir') / 'perl5/Git/SVN', install_dir: perllibdir / 'Git/SVN',
depends: [git_version_file], depends: [git_version_file],
) )

View File

@@ -13,7 +13,7 @@ foreach source : [
output: source, output: source,
command: generate_perl_command, command: generate_perl_command,
install: true, install: true,
install_dir: get_option('datadir') / 'perl5/Git/SVN', install_dir: perllibdir / 'Git/SVN',
depends: [git_version_file], depends: [git_version_file],
) )
endforeach endforeach

View File

@@ -10,7 +10,7 @@ foreach source : [
output: source, output: source,
command: generate_perl_command, command: generate_perl_command,
install: true, install: true,
install_dir: get_option('datadir') / 'perl5/Git', install_dir: perllibdir / 'Git',
depends: [git_version_file], depends: [git_version_file],
) )
endforeach endforeach

View File

@@ -3,7 +3,7 @@ test_dependencies += custom_target(
output: 'Git.pm', output: 'Git.pm',
command: generate_perl_command, command: generate_perl_command,
install: true, install: true,
install_dir: get_option('datadir') / 'perl5', install_dir: perllibdir,
depends: [git_version_file], depends: [git_version_file],
) )