NOTES ON BUILDING TLPERL 2018 BUILD PLATFORM 64-bits Windows 10 FCU running under VirtualBox on Linux. GETTING THE PERL SOURCE I downloaded the latest stable Perl source 5.26.1 from CPAN. THE COMPILER The file README.win32 in the root of the distribution contains compilation instructions, which lists various supported MinGW distributions. I went with MSYS2 from https://sourceforge.net/projects/msys2/, which is a minimal Cygwin-like environment to run autotools, which I expect to need at a later date. It includes the package manager Pacman from Arch Linux, with which I first updated everything and then installed mingw-w64-i686-gcc and mingw-w64-i686-dmake. The web page https://stackoverflow.com/questions/30069830/how-to-install-mingw-w64-and-msys2 made the process much clearer. The compiler can be used outside the MSYS2 environment simply by prepending /mingw32/bin to the searchpath before use. BUILDING PERL I went to the win32 subdirectory of the Perl source. In makefile.mk I adjusted relevant settings to my build environment. A diff for this makefile.mk is included. I compiled with dmake dmake test (Result: PASS) I installed with dmake 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 added the new Perl bin directory to the searchpath. I downloaded needed modules from CPAN and added them with perl Makefile.PL && dmake && dmake test && dmake install All modules for which tests were defined got a pass, except for Tk, where dmake test would not even run. They are, in order of processing: Math::Int64 0.54 IO::String 1.08 Digest::SHA1 2.13 File::Which 1.22 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) Win32::OLE 0.1712 (added later). For errors, see below: Test Summary Report ------------------- t/2_variant.t (Wstat: 0 Tests: 38 Failed: 1) Failed test: 27 Files=7, Tests=40, 2 wallclock secs ( 0.16 usr + 0.08 sys = 0.23 CPU) Result: FAIL Failed 1/7 test programs. 1/40 subtests failed. dmake: Error code 255, while making 'test_dynamic' # skipped, probably not needed #Win32::Process 0.16 LWP and dependencies, in order of compilation/installation: Socket 2.027 Date::Parse 2.30 (file TimeDate-2.30.tar.gz) HTTP::Date 6.02 File::Listing 6.04 IO::HTML 1.001 LWP::MediaTypes 6.02 Test::Needs 0.002005 URI 1.73 Try::Tiny 0.30 HTTP::Message 6.14 HTML::Tagset 3.20 HTML::Parser 3.72 WWW::RobotRules 6.02 HTTP::Negotiate 6.01 Net::HTTP 6.17 Mozilla::CA 20160104 HTTP::Daemon 6.01 HTTP::Cookies 6.04 Test::Fatal 0.014 Test::RequiresInternet 0.05 LWP 6.31 (file libwww-perl-6.31.tar.gz) Perl/Tk: Tk 804.034 Based on prior experience: 1. Before running 'perl Makefile.PL', I commented out the LIBRARY line at the start of in Tk-804.033/PNG/zlib/win32/zlib.def. 2. Before running dmake, I added an entry '-limm32' at the end of the LDLOADLIBS line in the generated Makefile in the Tk source root directory. dmake itself succeeded, running dmake test failed due to problems with the makefile. I installed the module anyway. Tk-DirSelect 1.12 JSON support Cpanel::JSON::XS 4.01 JSON::MaybeXS 1.003010 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 tlmgr-gui.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 7 Professional as admin user. tlmgr-gui appeared to work as intended. I also successfully ran the uninstaller. Siep Kroonenberg Last revision: February 2018