perl-tk
perl-tk copied to clipboard
Cannot find perl.h when installing Tk on macOS Catalina 10.15.5
I am trying to install Tk using the system perl (version 5.18.4) on macOS Catalina 10.15.5:
$ perl Makefile.PL
Cannot find '/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE/perl.h' have you installed perl?
Compilation failed in require at Makefile.PL line 37.
BEGIN failed--compilation aborted at Makefile.PL line 39.
I believe this is because Apple removed the Perl system headers from archlibexp in macOS 10.14, see this issue for more information. I get the following:
$ perl -MConfig -E'say $Config{archlibexp}'
/System/Library/Perl/5.18/darwin-thread-multi-2level
$ ls /System/Library/Perl/5.18/darwin-thread-multi-2level/CORE
libperl.dylib
So there is no perl.h there, but on the other hand Apple has moved the header to this place:
$ ls /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE
EXTERN.h dosish.h handy.h malloc_ctl.h op_reg_common.h perldtrace.h proto.h time64.h warnings.h
INTERN.h embed.h hv.h metaconfig.h opcode.h perlio.h reentr.h time64_config.h
XSUB.h embedvar.h hv_func.h mg.h opnames.h perliol.h regcharclass.h uconfig.h
av.h fakesdio.h inline.h mg_data.h overload.h perlsdio.h regcomp.h unicode_constants.h
bitcount.h fakethr.h intrpvar.h mg_raw.h pad.h perlsfio.h regexp.h unixish.h
charclass_invlists.h feature.h iperlsys.h mg_vtable.h parser.h perlvars.h regnodes.h utf8.h
config.h form.h keywords.h mydtrace.h patchlevel.h perly.h scope.h utfebcdic.h
cop.h git_version.h l1_char_class_tab.h nostdio.h perl.h pp.h sv.h util.h
cv.h gv.h libperl.tbd op.h perlapi.h pp_proto.h thread.h uudmap.h
See also this question on stackoverflow.com
can this be solved in any way? how would I tell the installer to look in the right place for the header-file?
Stumbled into this same issue, mac OS 15.3.1 on ARM, couldn't find any workaround anywhere.