diff --git a/clientscr/Mac_Saver_ModuleView.h b/clientscr/Mac_Saver_ModuleView.h index ab28fee24f..e2a634c618 100644 --- a/clientscr/Mac_Saver_ModuleView.h +++ b/clientscr/Mac_Saver_ModuleView.h @@ -1,6 +1,6 @@ // This file is part of BOINC. // http://boinc.berkeley.edu -// Copyright (C) 2008 University of California +// Copyright (C) 2017 University of California // // BOINC is free software; you can redistribute it and/or modify it // under the terms of the GNU Lesser General Public License @@ -36,12 +36,8 @@ NSString *mDefaultPeriodString; NSString *mSciencePeriodString; NSString *mChangePeriodString; - - NSArray *NIBTopLevel; } -@property (strong) NSArray *NIBTopLevel; - - (IBAction)closeSheetSave:(id) sender; - (IBAction)closeSheetCancel:(id) sender; diff --git a/clientscr/Mac_Saver_ModuleView.m b/clientscr/Mac_Saver_ModuleView.m index 35380fb3fa..50e36e742e 100644 --- a/clientscr/Mac_Saver_ModuleView.m +++ b/clientscr/Mac_Saver_ModuleView.m @@ -1,6 +1,6 @@ // This file is part of BOINC. // http://boinc.berkeley.edu -// Copyright (C) 2008 University of California +// Copyright (C) 2017 University of California // // BOINC is free software; you can redistribute it and/or modify it // under the terms of the GNU Lesser General Public License @@ -99,8 +99,6 @@ int signof(float x) { @implementation BOINC_Saver_ModuleView -@synthesize NIBTopLevel; - - (id)initWithFrame:(NSRect)frame isPreview:(BOOL)isPreview { self = [ super initWithFrame:frame isPreview:isPreview ]; return self; @@ -523,10 +521,11 @@ int signof(float x) { // if we haven't loaded our configure sheet, load the nib named MyScreenSaver.nib if (!mConfigureSheet) { if ([[ NSBundle bundleForClass:[ self class ]] respondsToSelector: @selector(loadNibNamed: owner: topLevelObjects:)]) { + #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wobjc-method-access" // [NSBundle loadNibNamed: owner: topLevelObjects:] is not available before OS 10.8 - [ [ NSBundle bundleForClass:[ self class ]] loadNibNamed:@"BOINCSaver" owner:self topLevelObjects:&NIBTopLevel ]; + [ [ NSBundle bundleForClass:[ self class ]] loadNibNamed:@"BOINCSaver" owner:self topLevelObjects:NULL ]; #pragma clang diagnostic pop } #if __MAC_OS_X_VERSION_MIN_REQUIRED < 1080 diff --git a/mac_build/boinc.xcodeproj/project.pbxproj b/mac_build/boinc.xcodeproj/project.pbxproj index a2d6752076..f86717b279 100644 --- a/mac_build/boinc.xcodeproj/project.pbxproj +++ b/mac_build/boinc.xcodeproj/project.pbxproj @@ -3796,8 +3796,7 @@ isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD)"; - CLANG_ENABLE_OBJC_ARC = NO; - GCC_ENABLE_OBJC_GC = supported; + CLANG_ENABLE_OBJC_ARC = YES; HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = "ScreenSaver-Info.plist"; OTHER_LDFLAGS = ( @@ -3968,8 +3967,7 @@ isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD)"; - CLANG_ENABLE_OBJC_ARC = NO; - GCC_ENABLE_OBJC_GC = supported; + CLANG_ENABLE_OBJC_ARC = YES; HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = "ScreenSaver-Info.plist"; OTHER_LDFLAGS = ( diff --git a/mac_installer/PostInstall.cpp b/mac_installer/PostInstall.cpp index e5fff63323..1c2c46a4f5 100644 --- a/mac_installer/PostInstall.cpp +++ b/mac_installer/PostInstall.cpp @@ -298,7 +298,30 @@ int main(int argc, char *argv[]) sleep (2); - // Install all_projects_list.xml file, but only if one doesn't + // OS 10.6 and OS10.7 require screensavers built with Garbage Collection, but + // Xcode 5.0.2 was the last version of Xcode which supported building with + // Garbage Collection, so we have saved the screensaver executable with GC as + // a binary. The installer build script added it to the screen saver, which + // now contains both the code with Garbage Collection and the code with + // Automatic Reference Counting. Determine the correct one to use for this + // version of OS X and remove the other one. + if (compareOSVersionTo(10, 8) < 0) { + // "rm -rf \"/Library/Screen Savers/GridRepublic.saver/Contents/MacOS/BOINCSaver\"" + sprintf(s, "rm -f \"/Library/Screen Savers/%s.saver/Contents/MacOS/%s\"", saverName[brandID], saverName[brandID]); + err = callPosixSpawn (s); + REPORT_ERROR(err); + sprintf(s, "mv -f \"/Library/Screen Savers/%s.saver/Contents/MacOS/BOINCSaver_MacOS10_6_7\" \"/Library/Screen Savers/%s.saver/Contents/MacOS/%s\"", + saverName[brandID], saverName[brandID], saverName[brandID]); + err = callPosixSpawn (s); + REPORT_ERROR(err); + } else { + // "rm -rf \"/Library/Screen Savers/GridRepublic.saver/Contents/MacOS/BOINCSaver_MacOS10_6_7\"" + sprintf(s, "rm -f \"/Library/Screen Savers/%s.saver/Contents/MacOS/BOINCSaver_MacOS10_6_7\"", saverName[brandID]); + err = callPosixSpawn (s); + REPORT_ERROR(err); + } + + // Install all_projects_list.xml file, but only if one doesn't // already exist, since a pre-existing one is probably newer. f = fopen("/Library/Application Support/BOINC Data/all_projects_list.xml", "r"); if (f) { @@ -738,7 +761,7 @@ void CheckUserAndGroupConflicts() } if ((boinc_project_gid < 501) || (entryCount > 1)) { - err = callPosixSpawn ("dscl . -delete /groups/boinc_project"); + err = callPosixSpawn ("dscl . -delete /groups/boinc_project"); if (err) { fprintf(stdout, "dscl . -delete /groups/boinc_project returned %d\n", err); fflush(stdout); diff --git a/mac_installer/release_boinc.sh b/mac_installer/release_boinc.sh index e4f7eb7a0c..44a6b2c90b 100644 --- a/mac_installer/release_boinc.sh +++ b/mac_installer/release_boinc.sh @@ -2,7 +2,7 @@ # This file is part of BOINC. # http://boinc.berkeley.edu -# Copyright (C) 2015 University of California +# Copyright (C) 2017 University of California # # BOINC is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License @@ -44,6 +44,7 @@ ## updated 12/17/14 by Charlie Fenton to fix typo in build of BOINC+VBox installer ## updated 4/7/15 by Charlie Fenton to comment on problem with BOINC+VBox installer ## updated 7/1/15 by Charlie Fenton for compatibility with OS 10.11 +## updated 6/4/17 by Charlie Fenton for compatibility with Xcode versions > 5.0.2 ## ## NOTE: This script requires Mac OS 10.6 or later, and uses XCode developer ## tools. So you must have installed XCode Developer Tools on the Mac @@ -54,7 +55,7 @@ ## NOTE: To build the executables under Lion and XCode 4, select from XCode's ## menu: "Product/Buildfor/Build for Archiving", NOT "Product/Archive" -## Under Mavericks and Xcode 5, select "Product/Buildfor/Build for Profiling" +## Under Mavericks and Xcode 5, select "Product/Build For/Profiling" ## To have this script build the combined BOINC+VirtualBox installer: ## * Create a directory named "VirtualBox Installer" in the same @@ -222,7 +223,15 @@ cp -fpRL $BUILDPATH/boincscr ../BOINC_Installer/Pkg_Root/Library/Application\ Su cp -fpRL $BUILDPATH/BOINCManager.app ../BOINC_Installer/Pkg_Root/Applications/ +## OS 10.6 and OS10.7 require screensavers built with Garbage Collection, but Xcode 5.0.2 +## was the last version of Xcode which supported building with Garbage Collection, so we +## have saved the screensaver executable with GC as a binary. Add it to the screen saver +## passed to the BOINC installer. At install time, he BOINC installer will select the +## correct binary for the version of OS X and delete the other one. This scripy assumes +## that $BUILDPATH/BOINCSaver.saver was built to use Automatic Reference Counting (ARC) +## and not built to use GC. cp -fpRL $BUILDPATH/BOINCSaver.saver ../BOINC_Installer/Pkg_Root/Library/Screen\ Savers/ +ditto -xk ./clientscr/BOINCSaver_MacOS10_6_7.zip ../BOINC_Installer/Pkg_Root/Library/Screen\ Savers/BOINCSaver.saver/Contents/MacOS ## Copy the localization files into the installer tree ## Old way copies CVS and *.po files which are not needed