NOTES ON BUILDING TLPERL 2021 BUILD PLATFORM 64-bits Windows 10 2009 GETTING THE PERL SOURCE I downloaded the latest stable Perl source 5.32.1 from CPAN. THE COMPILER The file README.win32 in the root of the distribution contains compilation instructions and lists various supported MinGW distributions. I went with the 32-bits compiler from http://strawberryperl.com/package/kmx/32_gcctoolchain/ version 8.3.0 BUILDING PERL I went to the win32 subdirectory of the Perl source. In GNUmakefile I adjusted relevant settings to my build environment. A diff for this GNUmakefile is included. I prepended the mingw bin directory to the searchpath and compiled with gmake gmake test There were some test failures: Test Summary Report ------------------- ../dist/Net-Ping/t/450_service.t (Wstat: 256 Tests: 26 Failed: 1) Failed test: 9 Non-zero exit status: 1 ../ext/IPC-Open3/t/IPC-Open3.t (Wstat: 0 Tests: 45 Failed: 0) TODO passed: 25 Files=2678, Tests=1148438, 2551 wallclock secs (132.50 usr + 15.19 sys = 147.69 CPU) Result: FAIL gmake: *** [GNUmakefile:1930: test] Error 1 but I hope that these will not impact us. Installation with: gmake 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 also parameterized the location of the mingw compiler. Config_heavy.pl got a similar treatment, in particular the single-quoted here-documents with markers !END! (very long) and EOVIRTUAL. The original versions are still present in the lib directory under the names Config.pm.orig and Config_heavy.pl.orig. 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 && gmake && gmake test && gmake install All modules for which tests were defined got a pass. They are, in order of processing: Math::Int64 0.54 IO::String 1.08 File::Which 1.23 Digest::SHA 6.02 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) LWP and dependencies, in order of compilation/installation: Socket 2.031 Date::Parse 2.33 (file TimeDate-2.33.tar.gz) HTTP::Date 6.05 File::Listing 6.14 IO::HTML 1.004 Try::Tiny 0.30 Test::Fatal 0.016 Test::Needs 0.002006 LWP::MediaTypes 6.04 URI 5.07 HTTP::Message 6.27 HTML::Tagset 3.20 HTML::Parser 3.75 WWW::RobotRules 6.02 HTTP::Negotiate 6.01 Net::HTTP 6.20 Mozilla::CA 20200520 HTTP::Daemon 6.12 HTTP::Cookies 6.10 Test::RequiresInternet 0.05 LWP 6.52 (file libwww-perl-6.52.tar.gz) JSON support Cpanel::JSON::XS 4.25 JSON::MaybeXS 1.004003 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 mingw. - The lib/pods directory has been removed, to save some space. - The bin subdirectory now only contains exe- and dll files; batch files and Perl scripts have been removed. - Copied from mingw32/bin to tlperl/bin: libgcc_s_dw2-1.dll, libstdc++-6.dll and libwinpthread-1.dll TESTING WITH TEXLIVE For testing the new Perl with the installer, I unpacked the net installer and replaced its tlperl with the new one. For testing the new Perl with tlshell.exe from the installed TeX Live, I copied it into the fresh installation. Both tests were done with 32-bits Windows 7 Home Premium as regular user and 64-bits Windows 10 Professional as admin user. tlshell, with its tlmgr Perl backend, appeared to work as intended. I also successfully ran the uninstaller. Siep Kroonenberg March 2021