Commit ad0b48fe authored by Felix Paul Kühne's avatar Felix Paul Kühne

contrib/sparkle: use version 1.6.1 since this is the last to support OS X 10.6

Additionally, patch the sources slightly to support Xcode 4.2

(cherry picked from commit 2e2ffef83be499a1920c179080d0fc8508def85d)
parent 5178b240
# sparkle # sparkle
#SPARKLE_VERSION := 1.5b6 SPARKLE_VERSION := 1.6.1
#SPARKLE_URL := http://sparkle.andymatuschak.org/files/Sparkle%20$(SPARKLE_VERSION).zip SPARKLE_URL := https://github.com/sparkle-project/Sparkle/archive/$(SPARKLE_VERSION).zip
SPARKLE_GITURL := git://github.com/andymatuschak/Sparkle.git
ifdef HAVE_MACOSX ifdef HAVE_MACOSX
PKGS += sparkle PKGS += sparkle
endif endif
$(TARBALLS)/sparkle-git.tar.xz: $(TARBALLS)/Sparkle-$(SPARKLE_VERSION).zip:
$(call download_git,$(SPARKLE_GITURL),,HEAD) $(call download,$(SPARKLE_URL))
.sum-sparkle: sparkle-git.tar.xz .sum-sparkle: Sparkle-$(SPARKLE_VERSION).zip
$(warning $@ not implemented) $(warning $@ not implemented)
touch $@ touch $@
sparkle: sparkle-git.tar.xz .sum-sparkle sparkle: Sparkle-$(SPARKLE_VERSION).zip .sum-sparkle
$(UNPACK) $(UNPACK)
$(APPLY) $(SRC)/sparkle/sparkle-fix-compilation-on-snowleopard.patch $(APPLY) $(SRC)/sparkle/sparkle-fix-compilation-on-snowleopard.patch
$(MOVE) $(MOVE)
......
diff -ru sparkle/Sparkle/SUAppcast.m sparkle-fixed/Sparkle/SUAppcast.m diff -ru sparkle/SUAppcast.h sparkle-fixed/SUAppcast.h
--- sparkle/Sparkle/SUAppcast.m 2013-12-09 15:23:42.000000000 +0100 --- sparkle/SUAppcast.h 2014-04-26 00:22:59.000000000 +0200
+++ sparkle-fixed/Sparkle/SUAppcast.m 2014-01-31 13:23:11.000000000 +0100 +++ sparkle-fixed/SUAppcast.h 2014-08-18 20:18:30.000000000 +0200
@@ -15,6 +15,12 @@ @@ -12,7 +12,7 @@
#import "SUConstants.h" @protocol SUAppcastDelegate;
#import "SULog.h"
@class SUAppcastItem;
+#ifndef MAC_OS_X_VERSION_10_7 -@interface SUAppcast : NSObject<NSURLDownloadDelegate>
+enum { +@interface SUAppcast : NSObject
+ NSXMLNodeLoadExternalEntitiesSameOriginOnly = 1UL << 15 {
+}; @private
+#endif NSArray *items;
+ diff -ru sparkle/SUAppcast.m sparkle-fixed/SUAppcast.m
@interface NSXMLElement (SUAppcastExtensions) --- sparkle/SUAppcast.m 2014-04-26 00:22:59.000000000 +0200
@property (readonly, copy) NSDictionary *attributesAsDictionary; +++ sparkle-fixed/SUAppcast.m 2014-08-18 20:18:36.000000000 +0200
@end @@ -32,7 +32,7 @@
@@ -32,7 +38,7 @@
} }
@end @end
-@interface SUAppcast () <NSURLDownloadDelegate> -@interface SUAppcast () <NSURLDownloadDelegate>
+@interface SUAppcast () // implicit NSURLDownloadDelegate +@interface SUAppcast ()
@property (copy) NSString *downloadFilename; @property (copy) NSString *downloadFilename;
@property (strong) NSURLDownload *download; @property (retain) NSURLDownload *download;
@property (copy) NSArray *items; @property (copy) NSArray *items;
diff -ru sparkle/Sparkle/SUDiskImageUnarchiver.m sparkle-fixed/Sparkle/SUDiskImageUnarchiver.m @@ -92,14 +92,7 @@
--- sparkle/Sparkle/SUDiskImageUnarchiver.m 2013-12-09 15:23:42.000000000 +0100
+++ sparkle-fixed/Sparkle/SUDiskImageUnarchiver.m 2014-01-31 13:25:58.000000000 +0100 if (downloadFilename)
@@ -12,6 +12,13 @@ {
#import "SULog.h" - NSUInteger options = 0;
#import <CoreServices/CoreServices.h> - if (NSAppKitVersionNumber < NSAppKitVersionNumber10_7) {
- // In order to avoid including external entities when parsing the appcast (a potential security vulnerability; see https://github.com/andymatuschak/Sparkle/issues/169), we ask NSXMLDocument to "tidy" the XML first. This happens to remove these external entities; it wouldn't be a future-proof approach, but it worked in these historical versions of OS X, and we have a more rigorous approach for 10.7+.
+@interface SUDiskImageUnarchiver () - options = NSXMLDocumentTidyXML;
+- (void)extractDMGWithPassword:(NSString *)password; - } else {
+- (BOOL)isEncrypted:(NSData*)resultData; - // In 10.7 and later, there's a real option for the behavior we desire.
+- (void)continueWithPassword:(NSString *)password; - options = NSXMLNodeLoadExternalEntitiesSameOriginOnly;
+- (void)requestPasswordFromDelegate; - }
+@end + NSUInteger options = NSXMLDocumentTidyXML;
+ document = [[[NSXMLDocument alloc] initWithContentsOfURL:[NSURL fileURLWithPath:downloadFilename] options:options error:&error] autorelease];
@implementation SUDiskImageUnarchiver
[[NSFileManager defaultManager] removeItemAtPath:downloadFilename error:nil];
+ (BOOL)canUnarchivePath:(NSString *)path diff -ru sparkle/SUAppcastItem.h sparkle-fixed/SUAppcastItem.h
--- sparkle/SUAppcastItem.h 2014-04-26 00:22:59.000000000 +0200
+++ sparkle-fixed/SUAppcastItem.h 2014-08-18 20:14:01.000000000 +0200
@@ -46,8 +46,8 @@
@property (retain, readonly) NSURL *infoURL;
// Initializes with data from a dictionary provided by the RSS class.
-- (instancetype)initWithDictionary:(NSDictionary *)dict;
-- (instancetype)initWithDictionary:(NSDictionary *)dict failureReason:(NSString**)error;
+- (id)initWithDictionary:(NSDictionary *)dict;
+- (id)initWithDictionary:(NSDictionary *)dict failureReason:(NSString**)error;
- (BOOL)isDeltaUpdate;
- (BOOL)isCriticalUpdate;
diff -ru sparkle/SUBasicUpdateDriver.h sparkle-fixed/SUBasicUpdateDriver.h
--- sparkle/SUBasicUpdateDriver.h 2014-04-26 00:22:59.000000000 +0200
+++ sparkle-fixed/SUBasicUpdateDriver.h 2014-08-18 20:18:41.000000000 +0200
@@ -15,7 +15,7 @@
#import "SUAppcast.h"
@class SUAppcastItem, SUHost;
-@interface SUBasicUpdateDriver : SUUpdateDriver<NSURLDownloadDelegate, SUUnarchiverDelegate, SUAppcastDelegate> {
+@interface SUBasicUpdateDriver : SUUpdateDriver<SUUnarchiverDelegate, SUAppcastDelegate> {
SUAppcastItem *updateItem;
SUAppcastItem *nonDeltaUpdateItem;
diff -ru sparkle/SUBasicUpdateDriver.m sparkle-fixed/SUBasicUpdateDriver.m
--- sparkle/SUBasicUpdateDriver.m 2014-04-26 00:22:59.000000000 +0200
+++ sparkle-fixed/SUBasicUpdateDriver.m 2014-08-18 20:16:53.000000000 +0200
@@ -106,7 +106,7 @@
if ([[updater delegate] respondsToSelector:@selector(updater:didFinishLoadingAppcast:)])
[[updater delegate] updater:updater didFinishLoadingAppcast:ac];
- NSDictionary *userInfo = (ac != nil) ? @{SUUpdaterAppcastNotificationKey : ac} : nil;
+ NSDictionary *userInfo = (ac != nil) ? [NSDictionary dictionaryWithObject:SUUpdaterAppcastNotificationKey forKey:ac] : nil;
[[NSNotificationCenter defaultCenter] postNotificationName:SUUpdaterDidFinishLoadingAppCastNotification object:updater userInfo:userInfo];
SUAppcastItem *item = nil;
@@ -153,7 +153,7 @@
{
if ([[updater delegate] respondsToSelector:@selector(updater:didFindValidUpdate:)])
[[updater delegate] updater:updater didFindValidUpdate:updateItem];
- NSDictionary *userInfo = (updateItem != nil) ? @{SUUpdaterAppcastItemNotificationKey : updateItem} : nil;
+ NSDictionary *userInfo = (updateItem != nil) ? [NSDictionary dictionaryWithObject:SUUpdaterAppcastItemNotificationKey forKey:updateItem] : nil;
[[NSNotificationCenter defaultCenter] postNotificationName:SUUpdaterDidFinishLoadingAppCastNotification object:updater userInfo:userInfo];
[self downloadUpdate];
}
diff -ru sparkle/SUProbingUpdateDriver.m sparkle-fixed/SUProbingUpdateDriver.m
--- sparkle/SUProbingUpdateDriver.m 2014-04-26 00:22:59.000000000 +0200
+++ sparkle-fixed/SUProbingUpdateDriver.m 2014-08-18 20:17:38.000000000 +0200
@@ -17,7 +17,7 @@
{
if ([[updater delegate] respondsToSelector:@selector(updater:didFindValidUpdate:)])
[[updater delegate] updater:updater didFindValidUpdate:updateItem];
- NSDictionary *userInfo = (updateItem != nil) ? @{SUUpdaterAppcastItemNotificationKey : updateItem} : nil;
+ NSDictionary *userInfo = (updateItem != nil) ? [NSDictionary dictionaryWithObject:SUUpdaterAppcastItemNotificationKey forKey:updateItem] : nil;
[[NSNotificationCenter defaultCenter] postNotificationName:SUUpdaterDidFindValidUpdateNotification object:updater userInfo:userInfo];
[self abortUpdate];
}
diff -ru sparkle/SUUpdateDriver.h sparkle-fixed/SUUpdateDriver.h
--- sparkle/SUUpdateDriver.h 2014-04-26 00:22:59.000000000 +0200
+++ sparkle-fixed/SUUpdateDriver.h 2014-08-18 20:15:46.000000000 +0200
@@ -14,7 +14,7 @@
extern NSString * const SUUpdateDriverFinishedNotification;
@class SUHost, SUUpdater;
-@interface SUUpdateDriver : NSObject<NSURLDownloadDelegate>
+@interface SUUpdateDriver : NSObject
{
SUHost *host;
SUUpdater *updater;
diff -ru sparkle/SUUpdater.h sparkle-fixed/SUUpdater.h
--- sparkle/SUUpdater.h 2014-04-26 00:22:59.000000000 +0200
+++ sparkle-fixed/SUUpdater.h 2014-08-18 20:14:31.000000000 +0200
@@ -28,7 +28,7 @@
+ (SUUpdater *)sharedUpdater;
+ (SUUpdater *)updaterForBundle:(NSBundle *)bundle;
-- (instancetype)initForBundle:(NSBundle *)bundle;
+- (id)initForBundle:(NSBundle *)bundle;
- (NSBundle *)hostBundle;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment