]> git.ipfire.org Git - thirdparty/git.git/commitdiff
meson: allow customize perl installation path
authorĐoàn Trần Công Danh <congdanhqx@gmail.com>
Thu, 8 May 2025 08:24:40 +0000 (15:24 +0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 8 May 2025 14:29:37 +0000 (07:29 -0700)
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>
meson.build
meson_options.txt
perl/FromCPAN/Mail/meson.build
perl/FromCPAN/meson.build
perl/Git/LoadCPAN/Mail/meson.build
perl/Git/LoadCPAN/meson.build
perl/Git/SVN/Memoize/meson.build
perl/Git/SVN/meson.build
perl/Git/meson.build
perl/meson.build

index c47cb79af0815a9bdd5acb0ae036c41dff2647fa..568da996f1d0022a42d19f8da5bd7ecf8c18644b 100644 (file)
@@ -1871,14 +1871,19 @@ if perl_features_enabled
     perl_header_template = 'perl/header_templates/runtime_prefix.template.pl'
   endif
 
+  perllibdir = get_option('perllibdir')
+  if perllibdir == ''
+    perllibdir = get_option('datadir') / 'perl5'
+  endif
+
   perl_header = configure_file(
     input: perl_header_template,
     output: 'GIT-PERL-HEADER',
     configuration: {
       'GITEXECDIR_REL': get_option('libexecdir') / 'git-core',
-      'PERLLIBDIR_REL': get_option('datadir') / 'perl5',
+      'PERLLIBDIR_REL': perllibdir,
       'LOCALEDIR_REL': get_option('datadir') / 'locale',
-      'INSTLIBDIR': get_option('datadir') / 'perl5',
+      'INSTLIBDIR': perllibdir,
       'PATHSEP': pathsep,
     },
   )
index 78d172a74019a45f7ca4b535bc06b7fa0e112ebf..cc19918a7ccfa484c03c8e9536d609b25271c4f0 100644 (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.
 option('default_pager', type: 'string', value: 'less',
   description: 'Fall-back pager.')
index b4ff2fc0b24c95490bee5fd57f6aa65e1dba3539..467507c5e690ef4ead871fb87daded88e3d95955 100644 (file)
@@ -3,6 +3,6 @@ test_dependencies += custom_target(
   output: 'Address.pm',
   command: generate_perl_command,
   install: true,
-  install_dir: get_option('datadir') / 'perl5/FromCPAN/Mail',
+  install_dir: perllibdir / 'FromCPAN/Mail',
   depends: [git_version_file],
 )
index 1f9ea6ce8e8442f656d2fd632ad6c76f5eb797df..720c60283d89b8f3da316e5259a5e63e1d542dde 100644 (file)
@@ -3,7 +3,7 @@ test_dependencies += custom_target(
   output: 'Error.pm',
   command: generate_perl_command,
   install: true,
-  install_dir: get_option('datadir') / 'perl5/FromCPAN',
+  install_dir: perllibdir / 'FromCPAN',
   depends: [git_version_file],
 )
 
index 89cde56be84912e01fde974bfc499b1faa6b3bc7..05a5770560d3d1d3aa2a9b78b56d8af2b19e193e 100644 (file)
@@ -3,6 +3,6 @@ test_dependencies += custom_target(
   output: 'Address.pm',
   command: generate_perl_command,
   install: true,
-  install_dir: get_option('datadir') / 'perl5/Git/LoadCPAN/Mail',
+  install_dir: perllibdir / 'Git/LoadCPAN/Mail',
   depends: [git_version_file],
 )
index 1ee915c650517d91521d2e2f982ce8fa07ca385e..b975d4972631d423bc3f69934f1a221331e5e304 100644 (file)
@@ -3,7 +3,7 @@ test_dependencies += custom_target(
   output: 'Error.pm',
   command: generate_perl_command,
   install: true,
-  install_dir: get_option('datadir') / 'perl5/Git/LoadCPAN',
+  install_dir: perllibdir / 'Git/LoadCPAN',
   depends: [git_version_file],
 )
 
index 233ec670d7de9182ab1e32ac5f33a60aa5aa0e9a..4c589b30c387a7abcdc445689f07d8848a49b6ff 100644 (file)
@@ -3,6 +3,6 @@ test_dependencies += custom_target(
   output: 'YAML.pm',
   command: generate_perl_command,
   install: true,
-  install_dir: get_option('datadir') / 'perl5/Git/SVN',
+  install_dir: perllibdir / 'Git/SVN',
   depends: [git_version_file],
 )
index 44abaf42b7cea36fe937ddc70cebcf9bcf06734d..8858985fe8660e80464550812bc91fb868c31e6d 100644 (file)
@@ -13,7 +13,7 @@ foreach source : [
     output: source,
     command: generate_perl_command,
     install: true,
-    install_dir: get_option('datadir') / 'perl5/Git/SVN',
+    install_dir: perllibdir / 'Git/SVN',
     depends: [git_version_file],
   )
 endforeach
index b21fa5591e7e7908bc2965baf37d378e6ce1aba3..a61b7b1f4abf25f98f1c7c21b2888843e34e32ef 100644 (file)
@@ -10,7 +10,7 @@ foreach source : [
     output: source,
     command: generate_perl_command,
     install: true,
-    install_dir: get_option('datadir') / 'perl5/Git',
+    install_dir: perllibdir / 'Git',
     depends: [git_version_file],
   )
 endforeach
index 2d4ab1c4a986f71d44f77275b8126d1d671e538e..3c66b007eaad9ed466b55f9bf4d2a49bf8ae1733 100644 (file)
@@ -3,7 +3,7 @@ test_dependencies += custom_target(
   output: 'Git.pm',
   command: generate_perl_command,
   install: true,
-  install_dir: get_option('datadir') / 'perl5',
+  install_dir: perllibdir,
   depends: [git_version_file],
 )