Skip to content

Commit 5463c1d

Browse files
sgngitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a2955b3 commit 5463c1d

File tree

10 files changed

+19
-10
lines changed

10 files changed

+19
-10
lines changed

meson.build

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1871,14 +1871,19 @@ if perl_features_enabled
18711871
perl_header_template = 'perl/header_templates/runtime_prefix.template.pl'
18721872
endif
18731873

1874+
perllibdir = get_option('perllibdir')
1875+
if perllibdir == ''
1876+
perllibdir = get_option('datadir') / 'perl5'
1877+
endif
1878+
18741879
perl_header = configure_file(
18751880
input: perl_header_template,
18761881
output: 'GIT-PERL-HEADER',
18771882
configuration: {
18781883
'GITEXECDIR_REL': get_option('libexecdir') / 'git-core',
1879-
'PERLLIBDIR_REL': get_option('datadir') / 'perl5',
1884+
'PERLLIBDIR_REL': perllibdir,
18801885
'LOCALEDIR_REL': get_option('datadir') / 'locale',
1881-
'INSTLIBDIR': get_option('datadir') / 'perl5',
1886+
'INSTLIBDIR': perllibdir,
18821887
'PATHSEP': pathsep,
18831888
},
18841889
)

meson_options.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Configuration for Git installation
2+
option('perllibdir', type: 'string', value: '',
3+
description: 'Directory to install perl lib to. Defaults to <datadir>/perl5')
4+
15
# Configuration for how Git behaves at runtime.
26
option('default_pager', type: 'string', value: 'less',
37
description: 'Fall-back pager.')

perl/FromCPAN/Mail/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ test_dependencies += custom_target(
33
output: 'Address.pm',
44
command: generate_perl_command,
55
install: true,
6-
install_dir: get_option('datadir') / 'perl5/FromCPAN/Mail',
6+
install_dir: perllibdir / 'FromCPAN/Mail',
77
depends: [git_version_file],
88
)

perl/FromCPAN/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ test_dependencies += custom_target(
33
output: 'Error.pm',
44
command: generate_perl_command,
55
install: true,
6-
install_dir: get_option('datadir') / 'perl5/FromCPAN',
6+
install_dir: perllibdir / 'FromCPAN',
77
depends: [git_version_file],
88
)
99

perl/Git/LoadCPAN/Mail/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ test_dependencies += custom_target(
33
output: 'Address.pm',
44
command: generate_perl_command,
55
install: true,
6-
install_dir: get_option('datadir') / 'perl5/Git/LoadCPAN/Mail',
6+
install_dir: perllibdir / 'Git/LoadCPAN/Mail',
77
depends: [git_version_file],
88
)

perl/Git/LoadCPAN/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ test_dependencies += custom_target(
33
output: 'Error.pm',
44
command: generate_perl_command,
55
install: true,
6-
install_dir: get_option('datadir') / 'perl5/Git/LoadCPAN',
6+
install_dir: perllibdir / 'Git/LoadCPAN',
77
depends: [git_version_file],
88
)
99

perl/Git/SVN/Memoize/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ test_dependencies += custom_target(
33
output: 'YAML.pm',
44
command: generate_perl_command,
55
install: true,
6-
install_dir: get_option('datadir') / 'perl5/Git/SVN',
6+
install_dir: perllibdir / 'Git/SVN',
77
depends: [git_version_file],
88
)

perl/Git/SVN/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ foreach source : [
1313
output: source,
1414
command: generate_perl_command,
1515
install: true,
16-
install_dir: get_option('datadir') / 'perl5/Git/SVN',
16+
install_dir: perllibdir / 'Git/SVN',
1717
depends: [git_version_file],
1818
)
1919
endforeach

perl/Git/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ foreach source : [
1010
output: source,
1111
command: generate_perl_command,
1212
install: true,
13-
install_dir: get_option('datadir') / 'perl5/Git',
13+
install_dir: perllibdir / 'Git',
1414
depends: [git_version_file],
1515
)
1616
endforeach

perl/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ test_dependencies += custom_target(
33
output: 'Git.pm',
44
command: generate_perl_command,
55
install: true,
6-
install_dir: get_option('datadir') / 'perl5',
6+
install_dir: perllibdir,
77
depends: [git_version_file],
88
)
99

0 commit comments

Comments
 (0)