t7415: drop v2.20.x-specific work-around
[git.git] / perl / header_templates / runtime_prefix.template.pl
blob9d28b3d8636c6c6d48ea287a5fef0f7833f6c08c
1 # BEGIN RUNTIME_PREFIX generated code.
3 # This finds our Git::* libraries relative to the script's runtime path.
4 sub __git_system_path {
5 my ($relpath) = @_;
6 my $gitexecdir_relative = '@@GITEXECDIR_REL@@';
8 # GIT_EXEC_PATH is supplied by `git` or the test suite.
9 my $exec_path;
10 if (exists $ENV{GIT_EXEC_PATH}) {
11 $exec_path = $ENV{GIT_EXEC_PATH};
12 } else {
13 # This can happen if this script is being directly invoked instead of run
14 # by "git".
15 require FindBin;
16 $exec_path = $FindBin::Bin;
19 # Trim off the relative gitexecdir path to get the system path.
20 (my $prefix = $exec_path) =~ s/\Q$gitexecdir_relative\E$//;
22 require File::Spec;
23 return File::Spec->catdir($prefix, $relpath);
26 BEGIN {
27 use lib split /@@PATHSEP@@/,
29 $ENV{GITPERLLIB} ||
30 do {
31 my $perllibdir = __git_system_path('@@PERLLIBDIR_REL@@');
32 (-e $perllibdir) || die("Invalid system path ($relpath): $path");
33 $perllibdir;
37 # Export the system locale directory to the I18N module. The locale directory
38 # is only installed if NO_GETTEXT is set.
39 $Git::I18N::TEXTDOMAINDIR = __git_system_path('@@LOCALEDIR_REL@@');
42 # END RUNTIME_PREFIX generated code.