Skip Menu |

This queue is for tickets about the File-HomeDir CPAN distribution.

Report information
The Basics
Id: 61578
Status: resolved
Priority: 0/
Queue: File-HomeDir

People
Owner: Nobody in particular
Requestors: wyant [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.93
Fixed in: (no value)



Subject: Installation fails on old versions of Mac OS X
Thank you for File::HomeDir, and for your latest changes to track Apple's peripatetic APIs. Unfortunately, File::HomeDir 0.93 fails to install on Mac OS 10.3 (Panther), and presumably earlier versions, apparently because the API used by Mac::SystemDirectory is not present. File::HomeDir version 0.91 and earlier were no problem under Mac OS 10.3 with a default Perl, apparently because the Makefile.PL logic selected the Carbon interface for 32 bit Perls. Carbon is deprecated I believe, so I applaud the fact that Mac::File is no longer used on modern versions of Mac OS X. But the upgrade to 0.93 seems to have cut off older versions of Mac OS X while maintaining support for Mac OS 9 and below. I am preparing a patch, and will update this as soon as I have it ready (famous last words!) I have assigned no severity, because it's not clear to me how critical failure to install on a 5-year-old version of the OS is.
The threatened patch was committed as SVN revision 13096. For what it's worth, the svn diff to Makefile.PL is attached. The change adds back the Carbon interface _provided_ we are not a 64-bit Perl and the most significant part of the uname OS version is less than 8 (this is the Darwin version corresponding to Mac OS 10.4 (Tiger)). The patch has been tried on 32-bit Perls under Mac OS 10.3, 10.4, and 10.5. It will specify requirements that fail to build under a 64-bit Perl under Mac OS 10.3 and below, but so do the unpatched File::HomeDir 0.93 and File::HomeDir 0.91. You are urged to sanity-check the patch with any Mac OS X gurus you have on tap.
Subject: Makefile.patch
Index: Makefile.PL =================================================================== --- Makefile.PL (revision 13095) +++ Makefile.PL (working copy) @@ -12,8 +12,9 @@ # Dependencies for specific platforms ### Use variable twice to avoid a warning -if ( $MacPerl::Version and $MacPerl::Version ) { - # Old Mac OS 9 +if ( $MacPerl::Version and $MacPerl::Version + or $^O eq 'darwin' and _check_old_mac_os_x() ) { + # Old Mac OS 9, or Mac OS X before Mac::SystemDirectory is supported. requires 'Mac::Files' => 0; } elsif ( $^O eq 'darwin' ) { @@ -25,3 +26,14 @@ } WriteAll; + +sub _check_old_mac_os_x { + local $@; + $Config{ptrsize} == 8 and return; + return eval { + require POSIX; + my $release = ( POSIX::uname() )[2]; + my ( $major ) = split qr{ [.] }smx, $release; + $major < 8; # 'old' means before darwin 8 = Mac OS 10.4 = Tiger + }; +}
Is already applied but never closed :/