summaryrefslogtreecommitdiff
path: root/Master/source/tlperl/tlperl.README
blob: a56c80b5a42bbb25d099aa07f0dc84f5951f1c96 (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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
NOTES ON BUILDING TLPERL 2015

BUILD PLATFORM

32-bits Windows 7 SP1 running under VirtualBox on
Linux.

GETTING THE PERL SOURCE

I downloaded the latest stable Perl source 5.20.2 from CPAN.

THE COMPILER

The file README.win32 in the root of the distribution contains
compilation instructions, which lists various supported MinGW
distributions, including a trimmed-down version of MinGW64 offered
by the Strawberry Perl project. I unzipped
mingw64-w32-gcc4.8.3_20140727.zip from
http://strawberryperl.com/package/kmx/32_gcctoolchain/ and
32bit_dmake-4.12.2-bin_20140810.zip from
http://strawberryperl.com/package/kmx/32_tools/

This MinGW compiler does not require installation; it is sufficient
to prepend <root>\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. As in the
previous release, I turned off optimization in the hope to avoid
some intractable failures:

*** makefile.mk.orig	2015-01-28 22:08:46.000000000 +0100
--- makefile.mk	2015-04-24 14:02:38.037487500 +0200
***************
*** 27,33 ****
  # newly built perl.
  #
  INST_DRV	*= c:
! INST_TOP	*= $(INST_DRV)\perl
  
  #
  # Uncomment if you want to build a 32-bit Perl using a 32-bit compiler
--- 27,33 ----
  # newly built perl.
  #
  INST_DRV	*= c:
! INST_TOP	*= $(INST_DRV)\tlperl
  
  #
  # Uncomment if you want to build a 32-bit Perl using a 32-bit compiler
***************
*** 144,150 ****
  # If you are using GCC, 4.3 or later by default we add the -fwrapv option.
  # See https://rt.perl.org/Ticket/Display.html?id=121505
  #
! #GCCWRAPV       *= define
  
  #
  # If you are using Intel C++ Compiler uncomment this
--- 144,150 ----
  # If you are using GCC, 4.3 or later by default we add the -fwrapv option.
  # See https://rt.perl.org/Ticket/Display.html?id=121505
  #
! GCCWRAPV       *= define
  
  #
  # If you are using Intel C++ Compiler uncomment this
***************
*** 209,215 ****
  # not be quoted)
  #
  .IF "$(CCTYPE)" == "GCC"
! CCHOME		*= C:\MinGW
  .ELSE
  CCHOME		*= $(MSVCDIR)
  .ENDIF
--- 209,215 ----
  # not be quoted)
  #
  .IF "$(CCTYPE)" == "GCC"
! CCHOME		*= X:\mingw
  .ELSE
  CCHOME		*= $(MSVCDIR)
  .ENDIF
***************
*** 465,474 ****
  		  -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32
  
  .IF  "$(CFG)" == "Debug"
! OPTIMIZE	= -g -O2 -DDEBUGGING
  LINK_DBG	= -g
  .ELSE
! OPTIMIZE	= -s -O2
  LINK_DBG	= -s
  .ENDIF
  
--- 465,474 ----
  		  -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32
  
  .IF  "$(CFG)" == "Debug"
! OPTIMIZE	= -g -O0 -DDEBUGGING
  LINK_DBG	= -g
  .ELSE
! OPTIMIZE	= -s -O0
  LINK_DBG	= -s
  .ENDIF

[end of patch]

I compiled with

  dmake

and installed with

  dmake installbare

`installbare' omits the generation of html.

INSTALLING MODULES

When adding modules, I added the new Perl bin directory to the
searchpath. I downloaded all the modules from CPAN and added them with

  perl Makefile.PL && dmake && dmake test && dmake install

They are, in order of processing:

Math::Int64 0.52
IO::String 1.08
Digest::SHA1 2.13
File::Which 1.16
Encode::compat 0.07
Encode::Locale 1.04

Windows-specific:

Win32::API 0.80
Win32::WinError 0.04 (just copying WinError.pm to lib/Win32)
Win32API::Registry 0.33
Win32::Console 0.10
Win32::TieRegistry 0.29 (errors in testing, as always)
Win32::Shortcut 0.08
Win32::OLE 0.1712 - warnings

LWP and dependencies, in order of compilation/installation:

Socket 2.018
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
URI 1.67
HTTP::Message 6.06
HTML::Tagset 3.20
HTML::Parser 3.71
WWW::RobotRules 6.02
HTTP::Negotiate 6.01
Net::HTTP 6.07
Mozilla::CA 20141217
HTTP::Daemon 6.01
HTTP::Cookies 6.01
LWP 6.13 (file libwww-perl-6.13.tar.gz)

Perl/Tk:

Tk 804.033

This module did not compile rightaway.

1. In Tk-804.033/PNG/zlib/win32/zlib.def I had to remove the LIBRARY
line at the start. I also removed - maybe unnecessarily - the lines
starting with `;'.

2. An entry '-limm32' somehow did not make it into LDLOADLIBS in the
generated makefile. After manually adding this at the end of the
LDLOADLIBS definition, the module compiled.

Tk-DirSelect 1.12

MAKING PERL PORTABLE

There were hard-coded paths in lib/Config.pm and
lib/Config_heavy.pl, which were likely to 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 under the names Config.pm.orig
and Config_heavy.pl.orig.

MODIFICATIONS FOR TEXLIVE

- as explained above: our versions of lib/Config.pm and lib/Config_heavy.pl
  compute the location of tlperl dynamically.
- The site/lib subdirectory is folded into lib.
- The lib/pods directory has been removed.
- The bin subdirectory now only contains exe- and dll files;
  batch files and Perl scripts have been removed.
- Copied from mingw/bin to tlperl/bin:
  libgcc_s_sjlj_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 8 Professional as admin user.

tlmgr-gui appeared to work as intended.  I also successfully ran the
uninstaller. However, later there turned out to be a transient
problem with updating tlperl, whose update coincided with a tlmgr
update.

Siep Kroonenberg

Last revision: May 5 2015