Skip to content

Commit

Permalink
BUILD: Fix creating OS X application bundle when Sparkle is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
criezy committed Mar 27, 2016
1 parent dec8106 commit 1b42aae
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 14 deletions.
29 changes: 17 additions & 12 deletions configure
Expand Up @@ -183,6 +183,7 @@ _win32path="c:/scummvm"
_amigaospath="Games:ScummVM"
_staticlibpath=
_xcodetoolspath=
_sparklepath=
_sdlconfig=sdl-config
_freetypeconfig=freetype-config
_sdlpath="$PATH"
Expand Down Expand Up @@ -1173,8 +1174,7 @@ for ac_option in $@; do
;;
--with-sparkle-prefix=*)
arg=`echo $ac_option | cut -d '=' -f 2`
SPARKLE_CFLAGS="-F$arg"
SPARKLE_LIBS="-F$arg"
_sparklepath=$arg
;;
--with-readline-prefix=*)
arg=`echo $ac_option | cut -d '=' -f 2`
Expand Down Expand Up @@ -3946,20 +3946,24 @@ case $_host_os in
if test "$_updates" = no; then
_sparkle=no
else
if test "$_sparkle" = auto ; then
_sparkle=no
cat > $TMPC << EOF
if test ! -z $_sparklepath ; then
SPARKLE_CFLAGS="-F$_sparklepath"
SPARKLE_LIBS="-F$_sparklepath"
fi
if test "$_sparkle" = auto ; then
_sparkle=no
cat > $TMPC << EOF
#include <Cocoa/Cocoa.h>
#include <Sparkle/Sparkle.h>
int main(void) { SUUpdater *updater = [SUUpdater sharedUpdater]; return 0; }
EOF
cc_check $SPARKLE_CFLAGS $SPARKLE_LIBS -framework Sparkle -ObjC++ -lobjc && _sparkle=yes
fi
if test "$_sparkle" = yes ; then
append_var LIBS "$SPARKLE_LIBS -framework Sparkle"
append_var INCLUDES "$SPARKLE_CFLAGS"
fi
define_in_config_if_yes "$_sparkle" 'USE_SPARKLE'
cc_check $SPARKLE_CFLAGS $SPARKLE_LIBS -framework Sparkle -ObjC++ -lobjc && _sparkle=yes
fi
if test "$_sparkle" = yes ; then
append_var LIBS "$SPARKLE_LIBS -framework Sparkle"
append_var INCLUDES "$SPARKLE_CFLAGS"
fi
define_in_config_if_yes "$_sparkle" 'USE_SPARKLE'
fi
echo "$_sparkle"
;;
Expand Down Expand Up @@ -4791,6 +4795,7 @@ WIN32PATH=$_win32path
AMIGAOSPATH=$_amigaospath
STATICLIBPATH=$_staticlibpath
XCODETOOLSPATH=$_xcodetoolspath
SPARKLEPATH=$_sparklepath
SDLCONFIG=$_sdlconfig
ABI := $ABI
Expand Down
8 changes: 6 additions & 2 deletions ports.mk
Expand Up @@ -97,7 +97,8 @@ endif
ifdef USE_SPARKLE
mkdir -p $(bundle_name)/Contents/Frameworks
cp $(srcdir)/dists/macosx/dsa_pub.pem $(bundle_name)/Contents/Resources/
cp -R $(STATICLIBPATH)/Sparkle.framework $(bundle_name)/Contents/Frameworks/
rm -rf $(bundle_name)/Contents/Frameworks/Sparkle.framework
cp -R $(SPARKLEPATH)/Sparkle.framework $(bundle_name)/Contents/Frameworks/
endif
cp $(srcdir)/icons/scummvm.icns $(bundle_name)/Contents/Resources/
cp $(DIST_FILES_DOCS) $(bundle_name)/
Expand Down Expand Up @@ -329,7 +330,10 @@ OSX_ZLIB ?= $(STATICLIBPATH)/lib/libz.a
endif

ifdef USE_SPARKLE
OSX_STATIC_LIBS += -framework Sparkle -F$(STATICLIBPATH)
ifneq ($(SPARKLEPATH),)
OSX_STATIC_LIBS += -F$(SPARKLEPATH)
endif
OSX_STATIC_LIBS += -framework Sparkle -Wl,-rpath,@loader_path/../Frameworks
endif

# Special target to create a static linked binary for Mac OS X.
Expand Down

0 comments on commit 1b42aae

Please sign in to comment.