Ticket #9286: sparkle.patch
File sparkle.patch, 9.8 KB (added by , 13 years ago) |
---|
-
base/main.cpp
diff --git a/base/main.cpp b/base/main.cpp index 65aa0ab..c8a1feb 100644
a b 35 35 #include "engines/metaengine.h" 36 36 #include "base/commandLine.h" 37 37 #include "base/plugins.h" 38 #if defined(USE_SPARKLE) 39 #include "base/sparkle_osx.h" 40 #endif 38 41 #include "base/version.h" 39 42 40 43 #include "common/archive.h" … … extern "C" int scummvm_main(int argc, const char * const argv[]) { 404 407 // Now as the event manager is created, setup the keymapper 405 408 setupKeymapper(system); 406 409 410 // Setup the "Check for Updates..." menu on Mac-OSX when built with Sparkle support 411 #if defined(USE_SPARKLE) 412 SparkleMenu::addUpdateMenuItem(); 413 #endif 414 407 415 // Unless a game was specified, show the launcher dialog 408 416 if (0 == ConfMan.getActiveDomain()) 409 417 launcherDialog(); -
base/module.mk
diff --git a/base/module.mk b/base/module.mk index f12a710..1437f60 100644
a b MODULE_OBJS := \ 6 6 plugins.o \ 7 7 version.o 8 8 9 ifdef USE_SPARKLE 10 MODULE_OBJS += \ 11 sparkle_osx.o 12 endif 13 9 14 # Include common rules 10 15 include $(srcdir)/rules.mk -
new file ase/sparkle_osx.h
diff --git a/base/sparkle_osx.h b/base/sparkle_osx.h new file mode 100644 index 0000000..3b8009b
- + 1 /* ScummVM - Graphic Adventure Engine 2 * 3 * ScummVM is the legal property of its developers, whose names 4 * are too numerous to list here. Please refer to the COPYRIGHT 5 * file distributed with this source distribution. 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation; either version 2 10 * of the License, or (at your option) any later version. 11 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 * 21 * $URL$ 22 * $Id$ 23 * 24 */ 25 26 #ifndef SPARKLE_OSX_H 27 #define SPARKLE_OSX_H 28 29 namespace SparkleMenu { 30 31 /** 32 * This functions adda an "Check for updates..." menu item to the Application 33 * menu on Mac OS X, based on the Sparkle framework. 34 * 35 * @see http://sparkle.andymatuschak.org/ 36 */ 37 void addUpdateMenuItem(); 38 39 } // End of namespace SparkleMenu 40 41 #endif -
new file ase/sparkle_osx.mm
diff --git a/base/sparkle_osx.mm b/base/sparkle_osx.mm new file mode 100644 index 0000000..7beb4f7
- + 1 /* ScummVM - Graphic Adventure Engine 2 * 3 * ScummVM is the legal property of its developers, whose names 4 * are too numerous to list here. Please refer to the COPYRIGHT 5 * file distributed with this source distribution. 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation; either version 2 10 * of the License, or (at your option) any later version. 11 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 * 21 * $URL$ 22 * $Id$ 23 * 24 */ 25 26 #include "base/sparkle_osx.h" 27 28 #include <Cocoa/Cocoa.h> 29 #include <Sparkle/Sparkle.h> 30 31 namespace SparkleMenu { 32 33 void addUpdateMenuItem() { 34 NSMenuItem *menuItem = [[NSApp mainMenu] itemAtIndex:0]; 35 NSMenu *applicationMenu = [menuItem submenu]; 36 37 /* Add "Check for Updates..." menu item */ 38 SUUpdater *updater = [SUUpdater sharedUpdater]; 39 NSMenuItem *updateMenuItem = [applicationMenu insertItemWithTitle:@"Check for Updates..." action:@selector(checkForUpdates:) keyEquivalent:@"" atIndex:1]; 40 [updateMenuItem setTarget:updater]; 41 [updater checkForUpdatesInBackground]; 42 } 43 44 } // End of namespace SparkleMenu -
configure
diff --git a/configure b/configure index fb453d1..db0e0e0 100755
a b _alsa=auto 127 127 _seq_midi=auto 128 128 _timidity=auto 129 129 _zlib=auto 130 _sparkle=auto 130 131 _mpeg2=no 131 132 _png=auto 132 133 _theoradec=auto … … Optional Libraries: 757 758 installed (optional) 758 759 --disable-fluidsynth disable fluidsynth MIDI driver [autodetect] 759 760 761 --with-sparkle-prefix=DIR Prefix where sparkle is installed (MacOSX only - optional) 762 --disable-sparkle disable sparkle automatic update support [MacOSX only - autodetect] 763 760 764 --with-sdl-prefix=DIR Prefix where the sdl-config script is 761 765 installed (optional) 762 766 … … for ac_option in $@; do 802 806 --disable-mad) _mad=no ;; 803 807 --enable-zlib) _zlib=yes ;; 804 808 --disable-zlib) _zlib=no ;; 809 --enable-sparkle) _sparkle=yes ;; 810 --disable-sparkle) _sparkle=no ;; 805 811 --enable-nasm) _nasm=yes ;; 806 812 --disable-nasm) _nasm=no ;; 807 813 --enable-mpeg2) _mpeg2=yes ;; … … for ac_option in $@; do 884 890 ZLIB_CFLAGS="-I$arg/include" 885 891 ZLIB_LIBS="-L$arg/lib" 886 892 ;; 893 --with-sparkle-prefix=*) 894 arg=`echo $ac_option | cut -d '=' -f 2` 895 SPARKLE_CFLAGS="-F$arg" 896 SPARKLE_LIBS="-F$arg" 897 ;; 887 898 --with-readline-prefix=*) 888 899 arg=`echo $ac_option | cut -d '=' -f 2` 889 900 READLINE_CFLAGS="-I$arg/include" … … define_in_config_if_yes "$_zlib" 'USE_ZLIB' 2608 2619 echo "$_zlib" 2609 2620 2610 2621 # 2622 # Check for Sparkle 2623 # 2624 echocheck "Sparkle" 2625 if test "$_sparkle" = auto ; then 2626 _sparkle=no 2627 cat > $TMPC << EOF 2628 #include <Cocoa/Cocoa.h> 2629 #include <Sparkle/Sparkle.h> 2630 int main(void) { SUUpdater *updater = [SUUpdater sharedUpdater]; return 0; } 2631 EOF 2632 cc_check $SPARKLE_CFLAGS $SPARKLE_LIBS -framework Sparkle -ObjC++ -lobjc && _sparkle=yes 2633 fi 2634 if test "$_sparkle" = yes ; then 2635 LIBS="$LIBS $SPARKLE_LIBS -framework Sparkle" 2636 INCLUDES="$INCLUDES $SPARKLE_CFLAGS" 2637 fi 2638 define_in_config_if_yes "$_sparkle" 'USE_SPARKLE' 2639 echo "$_sparkle" 2640 2641 # 2611 2642 # Check for LibMPEG2 2612 2643 # 2613 2644 echocheck "libmpeg2 >= 0.3.2" -
dists/macosx/Info.plist
diff --git a/dists/macosx/Info.plist b/dists/macosx/Info.plist index 9e19926..ffa96a8 100644
a b 28 28 <string>NSApplication</string> 29 29 <key>NSHumanReadableCopyright</key> 30 30 <string>Copyright 2001-2011 The ScummVM team</string> 31 <key>SUFeedURL</key> 32 <string>http://www.scummvm.org/scummvm_osx_appcast.xml</string> 33 <key>SUPublicDSAKeyFile</key> 34 <string>dsa_pub.pem</string> 31 35 </dict> 32 36 </plist> -
dists/macosx/Info.plist.in
diff --git a/dists/macosx/Info.plist.in b/dists/macosx/Info.plist.in index 3ba5a08..7d2e285 100644
a b 28 28 <string>NSApplication</string> 29 29 <key>NSHumanReadableCopyright</key> 30 30 <string>Copyright 2001-2011 The ScummVM team</string> 31 <key>SUFeedURL</key> 32 <string>http://www.scummvm.org/scummvm_osx_appcast.xml</string> 33 <key>SUPublicDSAKeyFile</key> 34 <string>dsa_pub.pem</string> 31 35 </dict> 32 36 </plist> -
new file dists/macosx/scummvm_osx_appcast.xml
diff --git a/dists/macosx/scummvm_osx_appcast.xml b/dists/macosx/scummvm_osx_appcast.xml new file mode 100644 index 0000000..d9b2044
- + 1 <?xml version="1.0" encoding="utf-8"?> 2 <rss version="2.0" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" xmlns:dc="http://purl.org/dc/elements/1.1/"> 3 <channel> 4 <title>ScummVM Changelog</title> 5 <link>http://scummvm.org/scummvm_appcast.xml</link> 6 <description>Most recent changes with links to updates.</description> 7 <language>en</language> 8 <item> 9 <title>Version 1.2.1 (3 bugs fixed; 2 new features)</title> 10 <sparkle:releaseNotesLink> 11 http://sourceforge.net/projects/scummvm/files/scummvm/1.2.1/ReleaseNotes/view 12 </sparkle:releaseNotesLink> 13 <pubDate>Sun, 19 Dec 2010 12:20:11 +0000</pubDate> 14 <enclosure url="http://scummvm.org/ScummVM 1.2.1-Test.zip" sparkle:version="1.2.1" length="1472893" type="application/octet-stream" sparkle:dsaSignature="234818feCa1JyW30nbkBwainOzrN6EQuAh" /> 15 </item> 16 <item> 17 <title>Version 1.2.0</title> 18 <sparkle:releaseNotesLink> 19 http://sourceforge.net/projects/scummvm/files/scummvm/1.2.0/ReleaseNotes/view 20 </sparkle:releaseNotesLink> 21 <pubDate>Fri, 15 Oct 2010 12:20:11 +0000</pubDate> 22 <enclosure url="http://scummvm.org/ScummVM 1.2.0-Test.zip" sparkle:version="1.2.0" length="1472893" type="application/octet-stream" sparkle:dsaSignature="234818feCa1JyW30nbkBwainOzrN6EQuAh" /> 23 </item> 24 </channel> 25 </rss> -
ports.mk
diff --git a/ports.mk b/ports.mk index c56031e..b9b3072 100644
a b bundle: scummvm-static 41 41 mkdir -p $(bundle_name)/Contents/Resources 42 42 echo "APPL????" > $(bundle_name)/Contents/PkgInfo 43 43 cp $(srcdir)/dists/macosx/Info.plist $(bundle_name)/Contents/ 44 ifdef USE_SPARKLE 45 mkdir -p $(bundle_name)/Contents/Frameworks 46 cp $(srcdir)/dists/macosx/dsa_pub.pem $(bundle_name)/Contents/Resources/ 47 cp -R $(STATICLIBPATH)/Sparkle.framework $(bundle_name)/Contents/Frameworks/ 48 endif 44 49 cp $(srcdir)/icons/scummvm.icns $(bundle_name)/Contents/Resources/ 45 50 cp $(DIST_FILES_DOCS) $(bundle_name)/ 46 51 cp $(DIST_FILES_THEMES) $(bundle_name)/Contents/Resources/ … … ifdef USE_ZLIB 110 115 OSX_ZLIB ?= -lz 111 116 endif 112 117 118 ifdef USE_SPARKLE 119 OSX_STATIC_LIBS += -framework Sparkle -F$(STATICLIBPATH) 120 endif 121 113 122 ifdef USE_TERMCONV 114 123 OSX_ICONV ?= -liconv 115 124 endif