Changeset 44111 in webkit


Ignore:
Timestamp:
May 23, 2009 10:14:44 PM (15 years ago)
Author:
mrowe@apple.com
Message:

Land the updated version of WebKitLauncher that the nightly builds have been using.

Reviewed by Oliver Hunt.

Changes include:
1) Support for self-updating via Sparkle.
2) Now respects the "Open using Rosetta" preference.
3) Passes environment variables through to the spawned Safari process.
4) Logs a list of extensions that are detected to the system console.
5) Disables extensions that are known to cause crashes too early in the

launch process to be detected by the extension-detection code.

  • WebKitLauncher/Configurations/Base.xcconfig: Added.
  • WebKitLauncher/Configurations/WebKitLauncher.xcconfig: Added.
  • WebKitLauncher/Configurations/WebKitNightlyEnabler.xcconfig: Added.
  • WebKitLauncher/Info.plist:
  • WebKitLauncher/WebKitLauncher.xcodeproj/project.pbxproj:
  • WebKitLauncher/WebKitNightlyEnabler.h: Added.
  • WebKitLauncher/WebKitNightlyEnabler.m:

(myBundleDidLoad):
(myApplicationWillFinishLaunching):
(poseAsWebKitApp):
(webKitLauncherBundle):
(enableWebKitNightlyBehaviour):

  • WebKitLauncher/WebKitNightlyEnablerSparkle.h: Added.
  • WebKitLauncher/WebKitNightlyEnablerSparkle.m: Added.

(initializeSparkle):
(updatePermissionPromptDescription):
(skipSignatureVerificationInDownloadDidFinish):
(updateAlertPanel):
(updateAlertInitForAlertPanel):
(-[NSAlert webKitHandleButtonPress:]):
(setMethodImplementation):

  • WebKitLauncher/main.m:

(displayErrorAndQuit):
(getLastVersionShown):
(saveLastVersionShown):
(getPathForStartPage):
(getCurrentVersion):
(getShowStartPageVersion):
(startPageDisabled):
(addStartPageToArgumentsIfNeeded):
(preferredArchitecture):
(myExecve):
(locateSafariBundle):
(currentMacOSXVersion):
(checkFrameworkPath):
(main):

Location:
trunk/WebKitTools
Files:
7 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r44105 r44111  
     12009-05-23  Mark Rowe  <mrowe@apple.com>
     2
     3        Reviewed by Oliver Hunt.
     4
     5        Land the updated version of WebKitLauncher that the nightly builds have been using.
     6
     7        Changes include:
     8        1) Support for self-updating via Sparkle.
     9        2) Now respects the "Open using Rosetta" preference.
     10        3) Passes environment variables through to the spawned Safari process.
     11        4) Logs a list of extensions that are detected to the system console.
     12        5) Disables extensions that are known to cause crashes too early in the
     13           launch process to be detected by the extension-detection code.
     14
     15        * WebKitLauncher/Configurations/Base.xcconfig: Added.
     16        * WebKitLauncher/Configurations/WebKitLauncher.xcconfig: Added.
     17        * WebKitLauncher/Configurations/WebKitNightlyEnabler.xcconfig: Added.
     18        * WebKitLauncher/Info.plist:
     19        * WebKitLauncher/WebKitLauncher.xcodeproj/project.pbxproj:
     20        * WebKitLauncher/WebKitNightlyEnabler.h: Added.
     21        * WebKitLauncher/WebKitNightlyEnabler.m:
     22        (myBundleDidLoad):
     23        (myApplicationWillFinishLaunching):
     24        (poseAsWebKitApp):
     25        (webKitLauncherBundle):
     26        (enableWebKitNightlyBehaviour):
     27        * WebKitLauncher/WebKitNightlyEnablerSparkle.h: Added.
     28        * WebKitLauncher/WebKitNightlyEnablerSparkle.m: Added.
     29        (initializeSparkle):
     30        (updatePermissionPromptDescription):
     31        (skipSignatureVerificationInDownloadDidFinish):
     32        (updateAlertPanel):
     33        (updateAlertInitForAlertPanel):
     34        (-[NSAlert webKitHandleButtonPress:]):
     35        (setMethodImplementation):
     36        * WebKitLauncher/main.m:
     37        (displayErrorAndQuit):
     38        (getLastVersionShown):
     39        (saveLastVersionShown):
     40        (getPathForStartPage):
     41        (getCurrentVersion):
     42        (getShowStartPageVersion):
     43        (startPageDisabled):
     44        (addStartPageToArgumentsIfNeeded):
     45        (preferredArchitecture):
     46        (myExecve):
     47        (locateSafariBundle):
     48        (currentMacOSXVersion):
     49        (checkFrameworkPath):
     50        (main):
     51
    1522009-05-23  Jan Michael Alonzo  <jmalonzo@webkit.org>
    253
  • trunk/WebKitTools/WebKitLauncher/Info.plist

    r39892 r44111  
    11<?xml version="1.0" encoding="UTF-8"?>
    2 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
     2<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    33<plist version="1.0">
    44<dict>
     
    425425        <key>CFBundleShortVersionString</key>
    426426        <string>rVERSION</string>
     427        <key>LSArchitecturePriority</key>
     428        <array>
     429                <string>x86_64</string>
     430                <string>i386</string>
     431                <string>ppc</string>
     432        </array>
     433        <key>LSMinimumSystemVersionByArchitecture</key>
     434        <dict>
     435                <key>x86_64</key>
     436                <string>10.6</string>
     437        </dict>
     438        <key>SUFeedURL</key>
     439        <string>http://nightly.webkit.org/builds/trunk/mac/rss</string>
     440        <key>SUShowReleaseNotes</key>
     441        <false/>
     442        <key>SUAllowsAutomaticUpdates</key>
     443        <false/>
    427444        <key>NSPrincipalClass</key>
    428445        <string>BrowserApplication</string>
    429        
    430446        <key>CFBundleHelpBookFolder</key>
    431447        <string>SafariHelp</string>
     
    472488                </dict>
    473489        </array>
    474 
    475490</dict>
    476491</plist>
  • trunk/WebKitTools/WebKitLauncher/WebKitLauncher.xcodeproj/project.pbxproj

    r39109 r44111  
    44        classes = {
    55        };
    6         objectVersion = 42;
     6        objectVersion = 45;
    77        objects = {
     8
     9/* Begin PBXAggregateTarget section */
     10                5DE79BC30F1C62450067BE08 /* Extract Sparkle */ = {
     11                        isa = PBXAggregateTarget;
     12                        buildConfigurationList = 5DE79BD80F1C629B0067BE08 /* Build configuration list for PBXAggregateTarget "Extract Sparkle" */;
     13                        buildPhases = (
     14                                5DE79BC20F1C62450067BE08 /* ShellScript */,
     15                        );
     16                        dependencies = (
     17                        );
     18                        name = "Extract Sparkle";
     19                        productName = "Extract Sparkle";
     20                };
     21/* End PBXAggregateTarget section */
    822
    923/* Begin PBXBuildFile section */
     
    1327                5D650F3A09DB8B410075E9A8 /* WebKitNightlyEnabler.dylib in Resources */ = {isa = PBXBuildFile; fileRef = 5D650F3409DB8B280075E9A8 /* WebKitNightlyEnabler.dylib */; };
    1428                5D877FCD0A5795F200D0C67B /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
     29                5DA88F6D0FC8136000AB2F62 /* WebKitNightlyEnablerSparkle.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DA88F6B0FC8136000AB2F62 /* WebKitNightlyEnablerSparkle.h */; };
     30                5DA88F6E0FC8136000AB2F62 /* WebKitNightlyEnablerSparkle.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DA88F6C0FC8136000AB2F62 /* WebKitNightlyEnablerSparkle.m */; };
     31                5DA88F7A0FC813EB00AB2F62 /* WebKitNightlyEnabler.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DA88F790FC813EB00AB2F62 /* WebKitNightlyEnabler.h */; };
    1532                5DB70525097B94CD009875EC /* webkit.icns in Resources */ = {isa = PBXBuildFile; fileRef = 5DB70524097B94CD009875EC /* webkit.icns */; };
    1633                8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
     
    2643                        remoteInfo = WebKitNightlyEnabler;
    2744                };
     45                5DE79BC90F1C62850067BE08 /* PBXContainerItemProxy */ = {
     46                        isa = PBXContainerItemProxy;
     47                        containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;
     48                        proxyType = 1;
     49                        remoteGlobalIDString = 5DE79BC30F1C62450067BE08;
     50                        remoteInfo = "Extract Sparkle";
     51                };
     52                5DE79BCB0F1C62890067BE08 /* PBXContainerItemProxy */ = {
     53                        isa = PBXContainerItemProxy;
     54                        containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;
     55                        proxyType = 1;
     56                        remoteGlobalIDString = 5DE79BC30F1C62450067BE08;
     57                        remoteInfo = "Extract Sparkle";
     58                };
    2859/* End PBXContainerItemProxy section */
    2960
    3061/* Begin PBXFileReference section */
    3162                1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
    32                 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
    3363                29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
    34                 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
    35                 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
    3664                5D41141B0A50A9DE00C84CF0 /* VERSION */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VERSION; sourceTree = "<group>"; };
    3765                5D4DF981097F89FB0083D5E5 /* start.html */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.html; path = start.html; sourceTree = "<group>"; };
    3866                5D650F3409DB8B280075E9A8 /* WebKitNightlyEnabler.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = WebKitNightlyEnabler.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
    39                 5D650F3509DB8B370075E9A8 /* WebKitNightlyEnabler.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = WebKitNightlyEnabler.m; sourceTree = "<group>"; };
    40                 5D650F7509DB8CB40075E9A8 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = "<absolute>"; };
     67                5D650F3509DB8B370075E9A8 /* WebKitNightlyEnabler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebKitNightlyEnabler.m; sourceTree = "<group>"; };
     68                5DA88F6B0FC8136000AB2F62 /* WebKitNightlyEnablerSparkle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitNightlyEnablerSparkle.h; sourceTree = "<group>"; };
     69                5DA88F6C0FC8136000AB2F62 /* WebKitNightlyEnablerSparkle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebKitNightlyEnablerSparkle.m; sourceTree = "<group>"; };
     70                5DA88F790FC813EB00AB2F62 /* WebKitNightlyEnabler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitNightlyEnabler.h; sourceTree = "<group>"; };
     71                5DA88F7E0FC8176100AB2F62 /* Base.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Base.xcconfig; sourceTree = "<group>"; };
     72                5DA88F7F0FC8176100AB2F62 /* WebKitLauncher.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = WebKitLauncher.xcconfig; sourceTree = "<group>"; };
     73                5DA88F800FC8176100AB2F62 /* WebKitNightlyEnabler.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = WebKitNightlyEnabler.xcconfig; sourceTree = "<group>"; };
    4174                5DB70524097B94CD009875EC /* webkit.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = webkit.icns; sourceTree = "<group>"; };
     75                5DE79BEB0F1C63CC0067BE08 /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Sparkle.framework; sourceTree = BUILT_PRODUCTS_DIR; };
    4276                8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
    4377                8D1107320486CEB800E47090 /* WebKit.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WebKit.app; sourceTree = BUILT_PRODUCTS_DIR; };
     
    6498
    6599/* Begin PBXGroup section */
    66                 080E96DDFE201D6D7F000001 /* Classes */ = {
    67                         isa = PBXGroup;
    68                         children = (
    69                         );
    70                         name = Classes;
    71                         sourceTree = "<group>";
    72                 };
    73100                1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
    74101                        isa = PBXGroup;
     
    79106                        sourceTree = "<group>";
    80107                };
    81                 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = {
    82                         isa = PBXGroup;
    83                         children = (
    84                                 29B97324FDCFA39411CA2CEA /* AppKit.framework */,
    85                                 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */,
    86                                 5D650F7509DB8CB40075E9A8 /* CoreFoundation.framework */,
    87                                 29B97325FDCFA39411CA2CEA /* Foundation.framework */,
    88                         );
    89                         name = "Other Frameworks";
    90                         sourceTree = "<group>";
    91                 };
    92108                19C28FACFE9D520D11CA2CBB /* Products */ = {
    93109                        isa = PBXGroup;
    94110                        children = (
     111                                5DE79BEB0F1C63CC0067BE08 /* Sparkle.framework */,
    95112                                8D1107320486CEB800E47090 /* WebKit.app */,
    96113                                5D650F3409DB8B280075E9A8 /* WebKitNightlyEnabler.dylib */,
     
    102119                        isa = PBXGroup;
    103120                        children = (
    104                                 080E96DDFE201D6D7F000001 /* Classes */,
    105                                 29B97315FDCFA39411CA2CEA /* Other Sources */,
     121                                29B97315FDCFA39411CA2CEA /* Source */,
     122                                5DA88F7D0FC8174E00AB2F62 /* Configurations */,
    106123                                29B97317FDCFA39411CA2CEA /* Resources */,
    107124                                29B97323FDCFA39411CA2CEA /* Frameworks */,
     
    111128                        sourceTree = "<group>";
    112129                };
    113                 29B97315FDCFA39411CA2CEA /* Other Sources */ = {
    114                         isa = PBXGroup;
    115                         children = (
     130                29B97315FDCFA39411CA2CEA /* Source */ = {
     131                        isa = PBXGroup;
     132                        children = (
     133                                5DA88F790FC813EB00AB2F62 /* WebKitNightlyEnabler.h */,
    116134                                5D650F3509DB8B370075E9A8 /* WebKitNightlyEnabler.m */,
     135                                5DA88F6B0FC8136000AB2F62 /* WebKitNightlyEnablerSparkle.h */,
     136                                5DA88F6C0FC8136000AB2F62 /* WebKitNightlyEnablerSparkle.m */,
    117137                                29B97316FDCFA39411CA2CEA /* main.m */,
    118138                        );
    119                         name = "Other Sources";
     139                        name = Source;
    120140                        sourceTree = "<group>";
    121141                };
     
    135155                        children = (
    136156                                1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
    137                                 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
    138157                        );
    139158                        name = Frameworks;
     159                        sourceTree = "<group>";
     160                };
     161                5DA88F7D0FC8174E00AB2F62 /* Configurations */ = {
     162                        isa = PBXGroup;
     163                        children = (
     164                                5DA88F7E0FC8176100AB2F62 /* Base.xcconfig */,
     165                                5DA88F7F0FC8176100AB2F62 /* WebKitLauncher.xcconfig */,
     166                                5DA88F800FC8176100AB2F62 /* WebKitNightlyEnabler.xcconfig */,
     167                        );
     168                        path = Configurations;
    140169                        sourceTree = "<group>";
    141170                };
     
    147176                        buildActionMask = 2147483647;
    148177                        files = (
     178                                5DA88F6D0FC8136000AB2F62 /* WebKitNightlyEnablerSparkle.h in Headers */,
     179                                5DA88F7A0FC813EB00AB2F62 /* WebKitNightlyEnabler.h in Headers */,
    149180                        );
    150181                        runOnlyForDeploymentPostprocessing = 0;
     
    164195                        );
    165196                        dependencies = (
     197                                5DE79BCC0F1C62890067BE08 /* PBXTargetDependency */,
    166198                        );
    167199                        name = WebKitNightlyEnabler;
     
    177209                                8D11072C0486CEB800E47090 /* Sources */,
    178210                                8D11072E0486CEB800E47090 /* Frameworks */,
     211                                5DA892AC0FC8E3A100AB2F62 /* Copy Sparkle in to Frameworks */,
    179212                        );
    180213                        buildRules = (
     
    182215                        dependencies = (
    183216                                5D650F4509DB8B830075E9A8 /* PBXTargetDependency */,
     217                                5DE79BCA0F1C62850067BE08 /* PBXTargetDependency */,
    184218                        );
    185219                        name = WebKit;
     
    195229                        isa = PBXProject;
    196230                        buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "WebKitLauncher" */;
    197                         compatibilityVersion = "Xcode 2.4";
     231                        compatibilityVersion = "Xcode 3.1";
    198232                        hasScannedForEncodings = 1;
    199233                        mainGroup = 29B97314FDCFA39411CA2CEA /* WebKit */;
     
    203237                                8D1107260486CEB800E47090 /* WebKit */,
    204238                                5D650F3309DB8B280075E9A8 /* WebKitNightlyEnabler */,
     239                                5DE79BC30F1C62450067BE08 /* Extract Sparkle */,
    205240                        );
    206241                };
     
    221256/* End PBXResourcesBuildPhase section */
    222257
     258/* Begin PBXShellScriptBuildPhase section */
     259                5DA892AC0FC8E3A100AB2F62 /* Copy Sparkle in to Frameworks */ = {
     260                        isa = PBXShellScriptBuildPhase;
     261                        buildActionMask = 2147483647;
     262                        files = (
     263                        );
     264                        inputPaths = (
     265                        );
     266                        name = "Copy Sparkle in to Frameworks";
     267                        outputPaths = (
     268                        );
     269                        runOnlyForDeploymentPostprocessing = 0;
     270                        shellPath = /bin/sh;
     271                        shellScript = "if [[ \"${ENABLE_SPARKLE}\" == \"1\" ]]\nthen\n    ditto \"${CONFIGURATION_BUILD_DIR}/Sparkle.framework\" \"${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Sparkle.framework\"\n    cd \"${CONFIGURATION_BUILD_DIR}/Sparkle.framework/Resources\"\n    find . -name '*lproj' -not -name 'en.lproj' -print0 | xargs -0 rm -rf\nelse\n    rm -rf \"${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Sparkle.framework\"\nfi\n";
     272                };
     273                5DE79BC20F1C62450067BE08 /* ShellScript */ = {
     274                        isa = PBXShellScriptBuildPhase;
     275                        buildActionMask = 2147483647;
     276                        files = (
     277                        );
     278                        inputPaths = (
     279                                "$(SRCROOT)/Sparkle.framework.tar.gz",
     280                        );
     281                        outputPaths = (
     282                                "$(CONFIGURATION_BUILD_DIR)/Sparkle.framework",
     283                        );
     284                        runOnlyForDeploymentPostprocessing = 0;
     285                        shellPath = /bin/sh;
     286                        shellScript = "if [[ \"${ENABLE_SPARKLE}\" == \"1\" ]]\nthen\n    tar -C \"${CONFIGURATION_BUILD_DIR}\" -xvzf \"${SRCROOT}/Sparkle.framework.tar.gz\"\n    cd \"${CONFIGURATION_BUILD_DIR}/Sparkle.framework/Resources\"\n    find . -name '*lproj' -not -name 'en.lproj' -print0 | xargs -0 rm -rf\nelse\n    rm -rf \"${CONFIGURATION_BUILD_DIR}/Sparkle.framework\"\nfi\n";
     287                };
     288/* End PBXShellScriptBuildPhase section */
     289
    223290/* Begin PBXSourcesBuildPhase section */
    224291                5D650F3109DB8B280075E9A8 /* Sources */ = {
     
    227294                        files = (
    228295                                5D650F3609DB8B370075E9A8 /* WebKitNightlyEnabler.m in Sources */,
     296                                5DA88F6E0FC8136000AB2F62 /* WebKitNightlyEnablerSparkle.m in Sources */,
    229297                        );
    230298                        runOnlyForDeploymentPostprocessing = 0;
     
    246314                        targetProxy = 5D650F4409DB8B830075E9A8 /* PBXContainerItemProxy */;
    247315                };
     316                5DE79BCA0F1C62850067BE08 /* PBXTargetDependency */ = {
     317                        isa = PBXTargetDependency;
     318                        target = 5DE79BC30F1C62450067BE08 /* Extract Sparkle */;
     319                        targetProxy = 5DE79BC90F1C62850067BE08 /* PBXContainerItemProxy */;
     320                };
     321                5DE79BCC0F1C62890067BE08 /* PBXTargetDependency */ = {
     322                        isa = PBXTargetDependency;
     323                        target = 5DE79BC30F1C62450067BE08 /* Extract Sparkle */;
     324                        targetProxy = 5DE79BCB0F1C62890067BE08 /* PBXContainerItemProxy */;
     325                };
    248326/* End PBXTargetDependency section */
    249327
     
    251329                5D650F3809DB8B370075E9A8 /* Debug */ = {
    252330                        isa = XCBuildConfiguration;
    253                         buildSettings = {
    254                                 MACOSX_DEPLOYMENT_TARGET_ppc = 10.4;
    255                                 PRODUCT_NAME = WebKitNightlyEnabler;
    256                                 SDKROOT_ppc = /Developer/SDKs/MacOSX10.4u.sdk;
     331                        baseConfigurationReference = 5DA88F800FC8176100AB2F62 /* WebKitNightlyEnabler.xcconfig */;
     332                        buildSettings = {
    257333                        };
    258334                        name = Debug;
     
    260336                5D650F3909DB8B370075E9A8 /* Release */ = {
    261337                        isa = XCBuildConfiguration;
    262                         buildSettings = {
    263                                 MACOSX_DEPLOYMENT_TARGET_ppc = 10.4;
    264                                 PRODUCT_NAME = WebKitNightlyEnabler;
    265                                 SDKROOT_ppc = /Developer/SDKs/MacOSX10.4u.sdk;
     338                        baseConfigurationReference = 5DA88F800FC8176100AB2F62 /* WebKitNightlyEnabler.xcconfig */;
     339                        buildSettings = {
    266340                        };
    267341                        name = Release;
    268342                };
     343                5DE79BC40F1C62450067BE08 /* Debug */ = {
     344                        isa = XCBuildConfiguration;
     345                        buildSettings = {
     346                                PRODUCT_NAME = "Extract Sparkle";
     347                        };
     348                        name = Debug;
     349                };
     350                5DE79BC50F1C62450067BE08 /* Release */ = {
     351                        isa = XCBuildConfiguration;
     352                        buildSettings = {
     353                                PRODUCT_NAME = "Extract Sparkle";
     354                        };
     355                        name = Release;
     356                };
    269357                C01FCF4B08A954540054247B /* Debug */ = {
    270358                        isa = XCBuildConfiguration;
    271                         buildSettings = {
    272                                 COPY_PHASE_STRIP = NO;
    273                                 GCC_DEBUGGING_SYMBOLS = full;
    274                                 GCC_DYNAMIC_NO_PIC = NO;
    275                                 GCC_ENABLE_FIX_AND_CONTINUE = YES;
    276                                 GCC_MODEL_TUNING = G5;
     359                        baseConfigurationReference = 5DA88F7F0FC8176100AB2F62 /* WebKitLauncher.xcconfig */;
     360                        buildSettings = {
     361                        };
     362                        name = Debug;
     363                };
     364                C01FCF4C08A954540054247B /* Release */ = {
     365                        isa = XCBuildConfiguration;
     366                        baseConfigurationReference = 5DA88F7F0FC8176100AB2F62 /* WebKitLauncher.xcconfig */;
     367                        buildSettings = {
     368                        };
     369                        name = Release;
     370                };
     371                C01FCF4F08A954540054247B /* Debug */ = {
     372                        isa = XCBuildConfiguration;
     373                        baseConfigurationReference = 5DA88F7E0FC8176100AB2F62 /* Base.xcconfig */;
     374                        buildSettings = {
    277375                                GCC_OPTIMIZATION_LEVEL = 0;
    278                                 INFOPLIST_FILE = Info.plist;
    279                                 INSTALL_PATH = "$(HOME)/Applications";
    280                                 PRODUCT_NAME = WebKit;
    281                                 WRAPPER_EXTENSION = app;
     376                                ONLY_ACTIVE_ARCH = YES;
    282377                        };
    283378                        name = Debug;
    284379                };
    285                 C01FCF4C08A954540054247B /* Release */ = {
    286                         isa = XCBuildConfiguration;
    287                         buildSettings = {
    288                                 DEAD_CODE_STRIPPING = YES;
    289                                 DEPLOYMENT_POSTPROCESSING = YES;
    290                                 GCC_DEBUGGING_SYMBOLS = full;
    291                                 GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
    292                                 INFOPLIST_FILE = Info.plist;
    293                                 PRODUCT_NAME = WebKit;
    294                                 WRAPPER_EXTENSION = app;
    295                         };
    296                         name = Release;
    297                 };
    298                 C01FCF4F08A954540054247B /* Debug */ = {
    299                         isa = XCBuildConfiguration;
    300                         buildSettings = {
    301                                 DEBUG_INFORMATION_FORMAT = dwarf;
    302                                 GCC_WARN_ABOUT_RETURN_TYPE = YES;
    303                                 GCC_WARN_UNUSED_VARIABLE = YES;
    304                                 MACOSX_DEPLOYMENT_TARGET = 10.2;
    305                                 MACOSX_DEPLOYMENT_TARGET_i386 = 10.4;
    306                                 MACOSX_DEPLOYMENT_TARGET_ppc = 10.2;
    307                                 PREBINDING = NO;
    308                                 SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
    309                         };
    310                         name = Debug;
    311                 };
    312380                C01FCF5008A954540054247B /* Release */ = {
    313381                        isa = XCBuildConfiguration;
    314                         buildSettings = {
    315                                 DEBUG_INFORMATION_FORMAT = dwarf;
    316                                 GCC_WARN_ABOUT_RETURN_TYPE = YES;
    317                                 GCC_WARN_UNUSED_VARIABLE = YES;
    318                                 MACOSX_DEPLOYMENT_TARGET_i386 = 10.4;
    319                                 MACOSX_DEPLOYMENT_TARGET_ppc = 10.2;
    320                                 PREBINDING = NO;
    321                                 SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
     382                        baseConfigurationReference = 5DA88F7E0FC8176100AB2F62 /* Base.xcconfig */;
     383                        buildSettings = {
    322384                        };
    323385                        name = Release;
     
    335397                        defaultConfigurationName = Release;
    336398                };
     399                5DE79BD80F1C629B0067BE08 /* Build configuration list for PBXAggregateTarget "Extract Sparkle" */ = {
     400                        isa = XCConfigurationList;
     401                        buildConfigurations = (
     402                                5DE79BC40F1C62450067BE08 /* Debug */,
     403                                5DE79BC50F1C62450067BE08 /* Release */,
     404                        );
     405                        defaultConfigurationIsVisible = 0;
     406                        defaultConfigurationName = Release;
     407                };
    337408                C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "WebKit" */ = {
    338409                        isa = XCConfigurationList;
  • trunk/WebKitTools/WebKitLauncher/WebKitNightlyEnabler.m

    r29663 r44111  
    11/*
    2  * Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
     2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc.  All rights reserved.
    33 * Copyright (C) 2006 Graham Dennis.  All rights reserved.
    44 *
     
    1212 *     notice, this list of conditions and the following disclaimer in the
    1313 *     documentation and/or other materials provided with the distribution.
    14  * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
     14 * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
    1515 *     its contributors may be used to endorse or promote products derived
    1616 *     from this software without specific prior written permission.
     
    2929
    3030#import <Cocoa/Cocoa.h>
     31#import "WebKitNightlyEnablerSparkle.h"
    3132
    3233static void enableWebKitNightlyBehaviour() __attribute__ ((constructor));
     
    4142} WKNERunStates;
    4243
     44static char *webKitAppPath;
    4345static bool extensionBundlesWereLoaded = NO;
    4446static NSSet *extensionPaths = nil;
     
    4648static void myBundleDidLoad(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo)
    4749{
    48     // Break out early if we have already detected an extension
    49     if (extensionBundlesWereLoaded)
    50         return;
    51 
    5250    NSBundle *bundle = (NSBundle *)object;
    5351    NSString *bundlePath = [[bundle bundlePath] stringByAbbreviatingWithTildeInPath];
     
    6361    NSEnumerator *e = [extensionPaths objectEnumerator];
    6462    NSString *path = nil;
    65     while (path = [e nextObject]) {
     63    while ((path = [e nextObject])) {
    6664        if ([bundlePath length] < [path length])
    6765            continue;
    6866
    6967        if ([[bundlePath substringToIndex:[path length]] isEqualToString:path]) {
     68            NSLog(@"Extension detected: %@", bundlePath);
    7069            extensionBundlesWereLoaded = YES;
    7170            break;
     
    8988                                     @"Safari extensions were detected on your system.  Extensions are incompatible with nightly builds of WebKit, and may cause crashes or incorrect behavior.  Please disable them if you experience such behavior.", @"Continue",
    9089                                     nil, nil);
     90
     91    initializeSparkle();
    9192}
    9293
     
    102103static void poseAsWebKitApp()
    103104{
    104     char *webKitAppPath = getenv("WebKitAppPath");
     105    webKitAppPath = strdup(getenv("WebKitAppPath"));
    105106    if (!webKitAppPath || !_CFGetProcessPath)
    106107        return;
     
    120121}
    121122
     123NSBundle *webKitLauncherBundle()
     124{
     125    NSString *executablePath = [NSString stringWithUTF8String:webKitAppPath];
     126    NSRange appLocation = [executablePath rangeOfString:@".app/" options:NSBackwardsSearch];
     127    NSString *appPath = [executablePath substringToIndex:appLocation.location + appLocation.length];
     128    return [NSBundle bundleWithPath:appPath];
     129}
     130
    122131static void enableWebKitNightlyBehaviour()
    123132{
     
    125134    poseAsWebKitApp();
    126135
     136    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    127137    extensionPaths = [[NSSet alloc] initWithObjects:@"~/Library/InputManagers/", @"/Library/InputManagers/",
    128138                                                    @"~/Library/Application Support/SIMBL/Plugins/", @"/Library/Application Support/SIMBL/Plugins/",
     
    130140                                                    nil];
    131141
    132     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
     142    // As of 2008-11 attempting to load Saft would cause a crash on launch, so prevent it from being loaded.
     143    NSArray *disabledInputManagers = [NSArray arrayWithObjects:@"Saft", nil];
     144
    133145    NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
    134146    NSDictionary *defaultPrefs = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:RunStateShutDown], WKNERunState,
    135                                                                             [NSNumber numberWithBool:YES], WKNEShouldMonitorShutdowns, nil];
     147                                                                            [NSNumber numberWithBool:YES], WKNEShouldMonitorShutdowns,
     148                                                                            disabledInputManagers, @"NSDisabledInputManagers", nil];
    136149    [userDefaults registerDefaults:defaultPrefs];
    137150    if ([userDefaults boolForKey:WKNEShouldMonitorShutdowns]) {
     
    162175                                    myApplicationWillTerminate, (CFStringRef) NSApplicationWillTerminateNotification,
    163176                                    NULL, CFNotificationSuspensionBehaviorDeliverImmediately);
     177
     178    NSLog(@"WebKit %@ initialized.", [webKitLauncherBundle() objectForInfoDictionaryKey:@"CFBundleShortVersionString"]);
     179
    164180    [pool release];
    165181}
  • trunk/WebKitTools/WebKitLauncher/main.m

    r29663 r44111  
    11/*
    2  * Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
     2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc.  All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    1111 *     notice, this list of conditions and the following disclaimer in the
    1212 *     documentation and/or other materials provided with the distribution.
    13  * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
     13 * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
    1414 *     its contributors may be used to endorse or promote products derived
    1515 *     from this software without specific prior written permission.
     
    3030#import <CoreFoundation/CoreFoundation.h>
    3131
    32 void displayErrorAndQuit(NSString *title, NSString *message)
     32// We need to weak-import posix_spawn and friends as they're not available on Tiger.
     33// The BSD-level system headers do not have availability macros, so we redeclare the
     34// functions ourselves with the "weak" attribute.
     35
     36#define WEAK_IMPORT __attribute__((weak))
     37
     38#define POSIX_SPAWN_SETEXEC 0x0040
     39typedef void *posix_spawnattr_t;
     40typedef void *posix_spawn_file_actions_t;
     41int posix_spawnattr_init(posix_spawnattr_t *) WEAK_IMPORT;
     42int posix_spawn(pid_t * __restrict, const char * __restrict, const posix_spawn_file_actions_t *, const posix_spawnattr_t * __restrict, char *const __argv[ __restrict], char *const __envp[ __restrict]) WEAK_IMPORT;
     43int posix_spawnattr_setbinpref_np(posix_spawnattr_t * __restrict, size_t, cpu_type_t *__restrict, size_t *__restrict) WEAK_IMPORT;
     44int posix_spawnattr_setflags(posix_spawnattr_t *, short) WEAK_IMPORT;
     45
     46
     47static void displayErrorAndQuit(NSString *title, NSString *message)
    3348{
    3449    NSApplicationLoad();
     
    3752}
    3853
    39 void checkMacOSXVersion()
    40 {
    41     long versionNumber = 0;
    42     OSErr error = Gestalt(gestaltSystemVersion, &versionNumber);
    43     if (error != noErr || versionNumber < 0x1040)
    44         displayErrorAndQuit(@"Mac OS X 10.4 is Required", @"Nightly builds of WebKit require Mac OS X 10.4 or newer.");
    45 }
    46 
    47 int getLastVersionShown()
     54static int getLastVersionShown()
    4855{
    4956    [[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWithObject:@"-1" forKey:@"StartPageShownInVersion"]];
     
    5158}
    5259
    53 void saveLastVersionShown(int lastVersion)
     60static void saveLastVersionShown(int lastVersion)
    5461{
    5562    [[NSUserDefaults standardUserDefaults] setInteger:lastVersion forKey:@"StartPageShownInVersion"];
     
    5764}
    5865
    59 NSString *getPathForStartPage()
     66static NSString *getPathForStartPage()
    6067{
    6168    return [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"start.html"];
    6269}
    6370
    64 int getShowStartPageVersion()
     71static int getCurrentVersion()
     72{
     73    return [[[[NSBundle mainBundle] infoDictionary] valueForKey:(NSString *)kCFBundleVersionKey] intValue];
     74}
     75
     76static int getShowStartPageVersion()
    6577{
    6678    return getCurrentVersion() + 1;
    6779}
    6880
    69 int getCurrentVersion()
    70 {
    71     return [[[[NSBundle mainBundle] infoDictionary] valueForKey:(NSString *)kCFBundleVersionKey] intValue];
    72 }
    73 
    74 BOOL startPageDisabled()
     81static BOOL startPageDisabled()
    7582{
    7683    return [[NSUserDefaults standardUserDefaults] boolForKey:@"StartPageDisabled"];
    7784}
    7885
    79 void addStartPageToArgumentsIfNeeded(NSMutableArray *arguments)
     86static void addStartPageToArgumentsIfNeeded(NSMutableArray *arguments)
    8087{
    8188    if (startPageDisabled())
     
    9097}
    9198
     99static cpu_type_t preferredArchitecture()
     100{
     101#if defined(__ppc__)
     102    return CPU_TYPE_POWERPC;
     103#elif defined(__LP64__)
     104    return CPU_TYPE_X86_64;
     105#else
     106    return CPU_TYPE_X86;
     107#endif
     108}
     109
    92110static void myExecve(NSString *executable, NSArray *args, NSDictionary *environment)
    93111{
    94112    char **argv = (char **)calloc(sizeof(char *), [args count] + 1);
    95113    char **env = (char **)calloc(sizeof(char *), [environment count] + 1);
    96    
     114
    97115    NSEnumerator *e = [args objectEnumerator];
    98116    NSString *s;
    99117    int i = 0;
    100     while (s = [e nextObject])
     118    while ((s = [e nextObject]))
    101119        argv[i++] = (char *) [s UTF8String];
    102    
     120
    103121    e = [environment keyEnumerator];
    104122    i = 0;
    105     while (s = [e nextObject])
     123    while ((s = [e nextObject]))
    106124        env[i++] = (char *) [[NSString stringWithFormat:@"%@=%@", s, [environment objectForKey:s]] UTF8String];
    107    
    108     execve([executable fileSystemRepresentation], argv, env);
    109 }
    110 
    111 NSBundle *locateSafariBundle()
     125
     126    if (posix_spawnattr_init && posix_spawn && posix_spawnattr_setbinpref_np && posix_spawnattr_setflags) {
     127        posix_spawnattr_t attr;
     128        posix_spawnattr_init(&attr);
     129        cpu_type_t architecturePreference[] = { preferredArchitecture(), CPU_TYPE_X86 };
     130        posix_spawnattr_setbinpref_np(&attr, 2, architecturePreference, 0);
     131        short flags = POSIX_SPAWN_SETEXEC;
     132        posix_spawnattr_setflags(&attr, flags);
     133        posix_spawn(NULL, [executable fileSystemRepresentation], NULL, &attr, argv, env);
     134    } else
     135        execve([executable fileSystemRepresentation], argv, env);
     136}
     137
     138static NSBundle *locateSafariBundle()
    112139{
    113140    NSArray *applicationDirectories = NSSearchPathForDirectoriesInDomains(NSApplicationDirectory, NSAllDomainsMask, YES);
    114141    NSEnumerator *e = [applicationDirectories objectEnumerator];
    115142    NSString *applicationDirectory;
    116     while (applicationDirectory = [e nextObject]) {
     143    while ((applicationDirectory = [e nextObject])) {
    117144        NSString *possibleSafariPath = [applicationDirectory stringByAppendingPathComponent:@"Safari.app"];
    118145        NSBundle *possibleSafariBundle = [NSBundle bundleWithPath:possibleSafariPath];
     
    131158}
    132159
     160static NSString *currentMacOSXVersion()
     161{
     162    SInt32 version;
     163    if (Gestalt(gestaltSystemVersion, &version) != noErr)
     164        return @"10.4";
     165
     166    return [NSString stringWithFormat:@"%x.%x", (version & 0xFF00) >> 8, (version & 0x00F0) >> 4];
     167}
     168
     169static BOOL checkFrameworkPath(NSString *frameworkPath)
     170{
     171    BOOL isDirectory = NO;
     172    return [[NSFileManager defaultManager] fileExistsAtPath:frameworkPath isDirectory:&isDirectory] && isDirectory;
     173}
     174
    133175int main(int argc, char *argv[])
    134176{
    135177    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    136     checkMacOSXVersion();
    137 
     178
     179    NSString *systemVersion = currentMacOSXVersion();
    138180    NSBundle *safariBundle = locateSafariBundle();
    139181    NSString *executablePath = [safariBundle executablePath];
    140     NSString *frameworkPath = [[NSBundle mainBundle] resourcePath];
     182    NSString *frameworkPath = [[[NSBundle mainBundle] privateFrameworksPath] stringByAppendingPathComponent:systemVersion];
    141183    NSString *pathToEnablerLib = [[NSBundle mainBundle] pathForResource:@"WebKitNightlyEnabler" ofType:@"dylib"];
     184
     185    if (!checkFrameworkPath(frameworkPath))
     186        displayErrorAndQuit([NSString stringWithFormat:@"Mac OS X %@ is Not Supported", systemVersion],
     187                            [NSString stringWithFormat:@"Nightly builds of WebKit are not supported on Mac OS X %@ at this time.", systemVersion]);
    142188
    143189    if ([frameworkPath rangeOfString:@":"].location != NSNotFound ||
     
    145191        displayErrorAndQuit(@"Unable to launch Safari",
    146192                            @"WebKit is located at a path containing an unsupported character.  Please move WebKit to a different location and try again.");
    147    
    148     NSMutableArray *arguments = [NSMutableArray arrayWithObjects:executablePath, @"-WebKitDeveloperExtras", @"YES", @"-WebKitScriptDebuggerEnabled", @"YES", nil];
    149     NSMutableDictionary *environment = [NSDictionary dictionaryWithObjectsAndKeys:frameworkPath, @"DYLD_FRAMEWORK_PATH", @"YES", @"WEBKIT_UNSET_DYLD_FRAMEWORK_PATH",
    150                                                                                   pathToEnablerLib, @"DYLD_INSERT_LIBRARIES", [[NSBundle mainBundle] executablePath], @"WebKitAppPath", nil];
     193
     194    NSMutableArray *arguments = [NSMutableArray arrayWithObject:executablePath];
     195    NSMutableDictionary *environment = [[[NSDictionary dictionaryWithObjectsAndKeys:frameworkPath, @"DYLD_FRAMEWORK_PATH", @"YES", @"WEBKIT_UNSET_DYLD_FRAMEWORK_PATH",
     196                                                                                    pathToEnablerLib, @"DYLD_INSERT_LIBRARIES", [[NSBundle mainBundle] executablePath], @"WebKitAppPath", nil] mutableCopy] autorelease];
     197    [environment addEntriesFromDictionary:[[NSProcessInfo processInfo] environment]];
    151198    addStartPageToArgumentsIfNeeded(arguments);
    152199
Note: See TracChangeset for help on using the changeset viewer.