summaryrefslogtreecommitdiff
path: root/Master/source/tlperl/tlperl.README
blob: 3a0416b29ffa757925e470a3e0c3cff58801c743 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
NOTES ON BUILDING TLPERL 2024

Compiler choice

This time around, I resorted to the Microsoft compiler, component
'Visual Studio Build Tools 2022', since the previously used
Strawberry Perl mingw64-based compiler is rather out of date, and I
had no luck with other mingw64/msys2-based compilers.

License comment on the download page:

  Use of this tool requires a valid Visual Studio license, unless you
  are building open-source dependencies for your project.

Since perl is an open source dependency for TL on windows, we should
be covered.

BUILD PLATFORM

Windows 11 Pro, build 22631.3085

GETTING THE PERL SOURCE

I downloaded the latest stable Perl source 5.38.2 from CPAN.

The file README.win32 in the root of the distribution contains
compilation instructions and lists various supported compilers. As
stated above, I went with Microsoft's Visual Studio 2022.

BUILDING PERL

I went to the win32 subdirectory of the Perl source. In Makefile
I adjusted relevant settings to my build environment. A diff for
this Makefile is included.

I did the compilation from a command prompt 'x64 Native Tools
Command Prompt for VS 2022'. From the w32 sudirectory, I compiled
with

  nmake
  nmake test

There were no test failures.

Installation with:

  nmake installbare

`installbare' omits the generation of html.

MAKING PERL PORTABLE

There were hard-coded paths in lib/Config.pm and
lib/Config_heavy.pl, which might cause problems.

I edited lib/Config.pm and lib/Config_heavy.pl to compute Perl's
location dynamically. To both I add the code

  my $rootdir = __FILE__;
  $rootdir =~ s![\\/][^\\/]*[\\/][^\\/]*$!!;
  $rootdir =~ s!/!\\!g;

and used this in Config.pm for the definition of %Config, taking
care to replace single-quoted strings with double-quoted ones and
escaping backslashes and other characters where necessary. I did not
parameterize the location of the Visual C compiler.

Config_heavy.pl got a similar treatment, in particular some
single-quoted here-documents, some of which were very long.

I tested correctness of the modifications with comparing invocations
of Config::config_sh() with the original and patched versions
(script configtest.pl).

The original versions are still present in the lib directory under
the names Config.orig.pm and Config_heavy.orig.pl.

INSTALLING MODULES

When adding modules, I prepended the new Perl bin directory to the
searchpath. I downloaded needed modules from metacpan.org and added
them with

  perl Makefile.PL && nmake && nmake test && nmake install

All modules for which tests were defined got a pass. They are (names
and versions), mostly in order of processing:

Math::Int64 0.57
IO::String 1.08
File::Which 1.27
Digest::SHA 6.04
Encode::compat 0.07
Encode::Locale 1.05

Windows-specific:

Win32::API 0.84
Win32::WinError 0.04 (just copying WinError.pm to site/lib/Win32/)
Win32API::Registry 0.33
Win32::Console 0.10 (no tests)
Win32::TieRegistry 0.30
Win32::Shortcut 0.08 (no tests)

Cpanel::JSON::XS 4.37
JSON::MaybeXS 1.004003 (not the latest version)

LWP and dependencies, in order of compilation/installation:

Socket 2.037
Date::Parse 2.33 (file TimeDate-2.33.tar.gz)
HTTP::Date 6.06
File::Listing 6.16
IO::HTML 1.004
Try::Tiny 0.31
Test::Fatal 0.017
Test::Needs 0.002010
LWP::MediaTypes 6.04
Test::Warnings 0.033
URI 5.27
Test::Harness 3.48 (maybe not needed after all)
HTTP::Message 6.36 (not the latest version)
HTML::Tagset 3.20
HTML::Parser 3.81
WWW::RobotRules 6.02
HTTP::Negotiate 6.01
Net::HTTP 6.23
Mozilla::CA 20231213
HTTP::Daemon 6.16
ExtUtils-Config 0.008
ExtUtils-Helpers 0.026
ExtUtils-InstallPaths 0.012
Module::Build::Tiny 0.047
  installed with perl Build.PL && Build && Build test && Build install
HTTP::Cookies 6.11
Test::RequiresInternet 0.05
LWP 6.76 (file libwww-perl-6.76.tar.gz)

MODIFICATIONS FOR TEXLIVE

- As explained above: our versions of lib/Config.pm and lib/Config_heavy.pl
  compute the location of tlperl dynamically. These files still
  contain a hard-coded path for the compiler. The original versions have been
  renamed to Config.orig.pm and Config_heave.orig.pl.
- The lib/pods directory has been removed, to save some space.
- The bin subdirectory now only contains exe- and dll files;
  batch files, Perl scripts and .pdb files have been removed.
- Copied from elsewhere: vcruntime140.dll and vcruntime140_1.dll
  (vc redistributables).

Siep Kroonenberg

March 2024