<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">Motivated by Siep Kroonenberg's remark in the "Texdoctk Maintainer" thread at <<a href="https://tug.org/pipermail/tex-live/2021-June/047049.html" class="">https://tug.org/pipermail/tex-live/2021-June/047049.html</a>><div class=""><br class=""></div><div class=""><blockquote type="cite" class="">Also, Perl/Tk is not readily available for MacOS or Windows.</blockquote><br class=""></div><div class="">I had a go at compiling Perl/Tk on macOS (Big Sur, 11.x). By this I mean using only the built-in Perl and XQuartz, not using a package management system like Homebrew, MacPorts or Fink.</div><div class=""><br class=""></div><div class="">Up to two or three versions of macOS ago, the straightforward "perl Makefile.PL && make && sudo make install" just worked. Now, no more.</div><div class=""><br class=""></div><div class="">The problem is the way Perl is installed in recent versions of macOS:</div><div class=""><br class=""></div><div class="">- Runtime Perl is at /System/Library/Perl (a non-writable location, protected by System Integrity Protection).</div><div class=""><br class=""></div><div class="">- Local additions go to /Library/Perl.</div><div class=""><br class=""></div><div class="">Neither location includes headers. These are installed with the optional developer tools, which come in two flavours:</div><div class=""><br class=""></div><div class="">- The command-line tools package installs Perl at</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">     </span>/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Perl</div><div class=""><br class=""></div><div class="">- The full Xcode IDE installs Perl at</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">      </span>/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Perl</div><div class=""><br class=""></div><div class="">Given that, here's how to compile Perl/Tk 804.036 from <<a href="https://metacpan.org/dist/Tk" class="">https://metacpan.org/dist/Tk</a>> with the full Xcode IDE installed. Useful tips came from</div><div class=""><br class=""></div><div class=""><a href="https://stackoverflow.com/questions/63403427/problem-installing-tk-module-perl-in-macos-catalina" class="">https://stackoverflow.com/questions/63403427/problem-installing-tk-module-perl-in-macos-catalina</a></div><div class=""><a href="https://stackoverflow.com/questions/52682304/fatal-error-extern-h-file-not-found-while-installing-perl-modules" class="">https://stackoverflow.com/questions/52682304/fatal-error-extern-h-file-not-found-while-installing-perl-modules</a></div><div class=""><br class=""></div><div class="">First, once inside the Tk-804.036 directory, edit lines 3-5 of myConfig</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>my $path = "$Config{'archlibexp'}/CORE/perl.h";<br class=""><span class="Apple-tab-span" style="white-space:pre">      </span>die "Cannot find '$path' have you installed $^X?\n" unless (-r $path);<br class=""><span class="Apple-tab-span" style="white-space:pre">       </span>print "$^X is installed in $Config{'archlibexp'} okay\n";</div><div class=""><br class=""></div><div class="">to reflect the actual location of the headers, here</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">    </span>my $path = "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Perl/5.30/darwin-thread-multi-2level/CORE/perl.h";<br class=""><span class="Apple-tab-span" style="white-space:pre">    </span>die "Cannot find '$path' have you installed $^X?\n" unless (-r $path);<br class=""><span class="Apple-tab-span" style="white-space:pre">       </span>print "$^X is installed in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Perl/5.30/darwin-thread-multi-2level okay\n";</div><div class=""><br class=""></div><div class="">Second, in Terminal, run</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">     </span>export CPATH="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Perl/5.30/darwin-thread-multi-2level/CORE"</div><div class=""><br class=""></div><div class="">After that, the usual</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>perl Makefile.PL</div><div class=""><span class="Apple-tab-span" style="white-space:pre">  </span>make</div><div class=""><span class="Apple-tab-span" style="white-space:pre">      </span>sudo make install</div><div class=""><br class=""></div><div class="">just works.</div><div class=""><br class=""></div><div class="">There are probably better ways to proceed, constructing the location of the Perl headers with something like $(PERL_SYSROOT)$(PERL_INCDEP)$(DFSEP), but the above seems to work.</div><div class=""><br class=""></div><div class="">Attached are two screenshots of what tlmgr --gui and texdoctk look like on the Mac after that.</div><div class=""><br class=""></div><div class="">Bruno Voisin<br class=""><br class=""></div><div class=""><img apple-inline="yes" id="BB4EDF04-74E6-4C2A-A09C-6CB3B2B1AD58" width="871" height="642" src="cid:9E940173-BFF7-459E-BF4D-D1CE39A095AE" class=""></div><div class=""><br class=""></div><div class=""><img apple-inline="yes" id="6276C9F5-0B95-4D57-A9AB-A2AA3372C325" width="847" height="380" src="cid:85A67334-37DA-4FB1-90F0-FDE447E9CACF" class=""></div></body></html>