X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=OSX%2Fupdate-info-plist.pl;h=06624e9435bce831eb76da2a79ef8becde222b0f;hb=d5186197bc394e10a4402f7f6d23fbb14103bc50;hp=8fe8b71d3054a3e763eb439eec50ace0c900b3c8;hpb=8afc01a67be4fbf3f1cc0fce9adf01b5289a21c6;p=xscreensaver diff --git a/OSX/update-info-plist.pl b/OSX/update-info-plist.pl index 8fe8b71d..06624e94 100755 --- a/OSX/update-info-plist.pl +++ b/OSX/update-info-plist.pl @@ -27,7 +27,7 @@ use IO::Compress::Gzip qw(gzip $GzipError); my ($exec_dir, $progname) = ($0 =~ m@^(.*?)/([^/]+)$@); -my ($version) = ('$Revision: 1.30 $' =~ m/\s(\d[.\d]+)\s/s); +my ($version) = ('$Revision: 1.35 $' =~ m/\s(\d[.\d]+)\s/s); $ENV{PATH} = "/usr/local/bin:$ENV{PATH}"; # for seticon @@ -330,6 +330,37 @@ sub enable_gc($) { } +sub fix_coretext($) { + my ($app_dir) = @_; + + # In MacOS 10.8, they moved CoreText.framework from + # /System/Library/Frameworks/ApplicationServices.framework/Frameworks/ + # to /System/Library/Frameworks/ which means that executables compiled + # on 10.8 and newer won't run on 10.7 and older because they can't find + # the library. Fortunately, 10.8 and later leave a symlink behind, so + # the old location still works. So we need our executables to contain + # an LC_LOAD_DYLIB pointing at the old directory instead of the new + # one. + # + return if ($app_dir =~ m@-iphone@s); + my ($dir, $name) = ($app_dir =~ m@^(.*)/([^/]+)\.(app|saver)$@s); + error ("unparsable: $app_dir") unless $name; + my $exe = "$app_dir/Contents/MacOS/$name"; + + my $new = ("/System/Library/Frameworks/CoreText.framework/" . + "Versions/A/CoreText"); + my $old = ("/System/Library/Frameworks/ApplicationServices.framework/" . + "Frameworks/CoreText.framework/Versions/A/CoreText"); + my @cmd = ("install_name_tool", "-change", $new, $old, $exe); + + print STDERR "$progname: exec: " . join(' ', @cmd) . "\n" + if ($verbose > 1); + system (@cmd); + my $exit = $? >> 8; + exit ($exit) if $exit; +} + + sub update($) { my ($app_dir) = @_; @@ -391,7 +422,8 @@ sub update($) { set_icon ($app_dir); set_thumb ($app_dir); - enable_gc ($app_dir); +# enable_gc ($app_dir); + fix_coretext ($app_dir) }