meson: allow customize perl installation path
Some distros, notably Fedora, want to install non-core Perl libraries into specific directory, namely /usr/share/perl5/vendor_perl. The Makefile build system allows this by overriding perllibdir variable, let's make meson works on par with our Makefile. Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
a2955b34f4
commit
5463c1d4f6
@@ -1871,14 +1871,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,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -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.')
|
||||||
|
|||||||
@@ -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],
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -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],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -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],
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -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],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -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],
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user