[vlc-commits] macosx: add own configure switch to disable the sparkle update framework

David Fuhrmann git at videolan.org
Thu Jun 11 19:21:21 CEST 2015


vlc | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Thu Jun  4 12:59:39 2015 +0200| [2a584bfba8e8b7eb5c9d5fded49c68810e9bd685] | committer: David Fuhrmann

macosx: add own configure switch to disable the sparkle update framework

--enable-update-check enables update support in core, which is not needed
for the mac platform. To avoid linking libgcrypt into the core, instead a
new configure switch is introduced to disable sparkle support directly.

Now, for disabling sparkle support, one needs to pass --disable-sparkle.
It completely removed sparkle from the GUI, and does not copy the
framework to the final bundle as well.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2a584bfba8e8b7eb5c9d5fded49c68810e9bd685
---

 configure.ac                                       |   25 ++++++++++++++------
 extras/package/macosx/configure.sh                 |    1 -
 extras/package/macosx/package.mak                  |    3 +++
 .../package/macosx/vlc.xcodeproj/project.pbxproj   |    2 --
 modules/gui/macosx/MainMenu.m                      |    4 ++--
 modules/gui/macosx/intf.m                          |    6 ++---
 modules/gui/macosx/simple_prefs.m                  |    6 ++---
 7 files changed, 29 insertions(+), 18 deletions(-)

diff --git a/configure.ac b/configure.ac
index faba317..32be8bb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3795,13 +3795,6 @@ then
 
   VLC_ADD_LIBS([macosx], [-Wl,-framework,QTKit -Wl,-framework,IOKit -Wl,-framework,AddressBook -Wl,-framework,WebKit -Wl,-framework,CoreAudio -Wl,-framework,SystemConfiguration -Wl,-framework,ScriptingBridge])
 
-  if test ! -d ${CONTRIB_DIR}/Sparkle.framework
-  then
-    AC_MSG_ERROR([Sparkle framework is required and was not found in ${CONTRIB_DIR}])
-  fi
-  VLC_ADD_LIBS([macosx], [-F${CONTRIB_DIR} -Wl,-framework,Sparkle])
-  VLC_ADD_OBJCFLAGS([macosx], [-F${CONTRIB_DIR}])
-
   if test ! -d ${CONTRIB_DIR}/BGHUDAppKit.framework
   then
     AC_MSG_ERROR([BGHUDAppKit framework is required and was not found in ${CONTRIB_DIR}])
@@ -3812,6 +3805,24 @@ fi
 AM_CONDITIONAL(ENABLE_MACOSX_UI, [test "$enable_macosx" != "no"])
 
 dnl
+dnl  MacOS X sparkle update support
+dnl
+AC_ARG_ENABLE(sparkle,
+  [  --enable-sparkle        Sparkle update support for OS X (default enabled on Mac OS X)])
+if test "x${enable_sparkle}" != "xno" -a "${SYS}" = "darwin"
+then
+  if test ! -d ${CONTRIB_DIR}/Sparkle.framework
+  then
+    AC_MSG_ERROR([Sparkle framework is required and was not found in ${CONTRIB_DIR}])
+  fi
+  VLC_ADD_LIBS([macosx], [-F${CONTRIB_DIR} -Wl,-framework,Sparkle])
+  VLC_ADD_OBJCFLAGS([macosx], [-F${CONTRIB_DIR}])
+  AC_DEFINE([HAVE_SPARKLE], [1], [Define to 1 if sparkle is enabled.])
+fi
+AM_CONDITIONAL(HAVE_SPARKLE, [test "$enable_sparkle" != "no"])
+
+
+dnl
 dnl  Minimal Mac OS X module
 dnl
 AC_ARG_ENABLE(minimal-macosx,
diff --git a/extras/package/macosx/configure.sh b/extras/package/macosx/configure.sh
index 03b0a0d..d4af059 100755
--- a/extras/package/macosx/configure.sh
+++ b/extras/package/macosx/configure.sh
@@ -16,7 +16,6 @@ esac
 
 OPTIONS="
         --prefix=`pwd`/vlc_install_dir
-        --enable-update-check
         --enable-macosx
         --enable-merge-ffmpeg
         --enable-growl
diff --git a/extras/package/macosx/package.mak b/extras/package/macosx/package.mak
index 40e4fe5..630eb9b 100644
--- a/extras/package/macosx/package.mak
+++ b/extras/package/macosx/package.mak
@@ -48,6 +48,9 @@ VLC-tmp: vlc
 		xcodebuild -target vlc SYMROOT=../../../build DSTROOT=../../../build $(silentstd)
 	cp -R $(top_builddir)/tmp/build/Default/VLC.bundle $@
 	mkdir -p $@/Contents/Frameworks && cp -R $(CONTRIB_DIR)/Growl.framework $@/Contents/Frameworks/
+if HAVE_SPARKLE
+	cp -R $(CONTRIB_DIR)/Sparkle.framework $@/Contents/Frameworks/
+endif
 	mkdir -p $@/Contents/MacOS/share/locale/
 	cp -r "$(prefix)/lib/vlc/lua" "$(prefix)/share/vlc/lua" $@/Contents/MacOS/share/
 	mkdir -p $@/Contents/MacOS/include/
diff --git a/extras/package/macosx/vlc.xcodeproj/project.pbxproj b/extras/package/macosx/vlc.xcodeproj/project.pbxproj
index 7743652..87cf1c1 100644
--- a/extras/package/macosx/vlc.xcodeproj/project.pbxproj
+++ b/extras/package/macosx/vlc.xcodeproj/project.pbxproj
@@ -682,7 +682,6 @@
 		CC402F430E00ABBB006A4BA4 /* QTKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CC1941240B9C1F8400635F6B /* QTKit.framework */; };
 		CC402F440E00ABBB006A4BA4 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CC962E2C0CC7992800A56695 /* WebKit.framework */; };
 		CC426FD11020D44F00A32659 /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CC426FD01020D44F00A32659 /* Sparkle.framework */; };
-		CC426FD71020D47100A32659 /* Sparkle.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = CC426FD01020D44F00A32659 /* Sparkle.framework */; };
 		CC461F75160084A10022423C /* SharedDialogs.xib in Resources */ = {isa = PBXBuildFile; fileRef = CC461F73160084A10022423C /* SharedDialogs.xib */; };
 		CC4EFC2D13E96BD00091D19A /* dropzone.png in Resources */ = {isa = PBXBuildFile; fileRef = CC4EFC2C13E96BD00091D19A /* dropzone.png */; };
 		CC68B0331544C1AE00FD9C7F /* vlc-xmas.png in Resources */ = {isa = PBXBuildFile; fileRef = CC68B0321544C1AE00FD9C7F /* vlc-xmas.png */; };
@@ -859,7 +858,6 @@
 			dstSubfolderSpec = 10;
 			files = (
 				CC84FB481300843200816D38 /* BGHUDAppKit.framework in Copy Frameworks */,
-				CC426FD71020D47100A32659 /* Sparkle.framework in Copy Frameworks */,
 			);
 			name = "Copy Frameworks";
 			runOnlyForDeploymentPostprocessing = 0;
diff --git a/modules/gui/macosx/MainMenu.m b/modules/gui/macosx/MainMenu.m
index b11aa2d..f57806b 100644
--- a/modules/gui/macosx/MainMenu.m
+++ b/modules/gui/macosx/MainMenu.m
@@ -49,7 +49,7 @@
 #import "DebugMessageVisualizer.h"
 #import "AddonsWindowController.h"
 
-#ifdef UPDATE_CHECK
+#ifdef HAVE_SPARKLE
 #import <Sparkle/Sparkle.h>
 #endif
 
@@ -148,7 +148,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
 
     p_intf = VLCIntf;
 
-#ifdef UPDATE_CHECK
+#ifdef HAVE_SPARKLE
     [o_mi_checkForUpdate setAction:@selector(checkForUpdates:)];
     [o_mi_checkForUpdate setTarget:[SUUpdater sharedUpdater]];
 #else
diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m
index e33831b..39ffeb5 100644
--- a/modules/gui/macosx/intf.m
+++ b/modules/gui/macosx/intf.m
@@ -67,7 +67,7 @@
 #import "VideoEffects.h"
 #import "AudioEffects.h"
 
-#ifdef UPDATE_CHECK
+#ifdef HAVE_SPARKLE
 #import <Sparkle/Sparkle.h>                 /* we're the update delegate */
 #endif
 
@@ -791,7 +791,7 @@ static VLCMain *_o_sharedMainInstance = nil;
     // So lets enqueue it into the loop for later execution.
     [o_mainwindow performSelector:@selector(makeKeyAndOrderFront:) withObject:nil afterDelay:0];
 
-#ifdef UPDATE_CHECK
+#ifdef HAVE_SPARKLE
     [[SUUpdater sharedUpdater] setDelegate:self];
 #endif
 }
@@ -980,7 +980,7 @@ static bool f_appExit = false;
 #pragma mark -
 #pragma mark Sparkle delegate
 
-#ifdef UPDATE_CHECK
+#ifdef HAVE_SPARKLE
 /* received directly before the update gets installed, so let's shut down a bit */
 - (void)updater:(SUUpdater *)updater willInstallUpdate:(SUAppcastItem *)update
 {
diff --git a/modules/gui/macosx/simple_prefs.m b/modules/gui/macosx/simple_prefs.m
index 4c1aa94..cd05a65 100644
--- a/modules/gui/macosx/simple_prefs.m
+++ b/modules/gui/macosx/simple_prefs.m
@@ -38,7 +38,7 @@
 #import "AppleRemote.h"
 #import "CoreInteraction.h"
 
-#ifdef UPDATE_CHECK
+#ifdef HAVE_SPARKLE
 #import <Sparkle/Sparkle.h>                        //for o_intf_last_update_lbl
 #endif
 
@@ -220,7 +220,7 @@ static VLCSimplePrefs *_o_sharedInstance = nil;
 {
     [self initStrings];
 
-#ifdef UPDATE_CHECK
+#ifdef HAVE_SPARKLE
     [o_intf_update_ckb bind:@"value"
                    toObject:[SUUpdater sharedUpdater]
                 withKeyPath:@"automaticallyChecksForUpdates"
@@ -591,7 +591,7 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam
 
     [self setupButton: o_intf_mediakeys_ckb forBoolValue: "macosx-mediakeys"];
 
-#ifdef UPDATE_CHECK
+#ifdef HAVE_SPARKLE
     if ([[SUUpdater sharedUpdater] lastUpdateCheckDate] != NULL)
         [o_intf_last_update_lbl setStringValue: [NSString stringWithFormat: _NS("Last check on: %@"), [[[SUUpdater sharedUpdater] lastUpdateCheckDate] descriptionWithLocale: [[NSUserDefaults standardUserDefaults] dictionaryRepresentation]]]];
     else



More information about the vlc-commits mailing list