Permalink
Browse files

BUILD: Get rid of old macOS packaging code

Manually adding all the “correct” static libraries is error-prone
and broken. The CI service will not have dynamic libraries to link
so there is no concern about making the bundle work there.

If it is really necessary to allow some normal system with dylibs
generate a fully statically linked build some system to convert
all the -l flags in LDFLAGS into absolute library paths would be a
far better choice.
  • Loading branch information...
csnover authored and ccawley2011 committed Dec 3, 2017
1 parent 0cb6970 commit ff224a84931a6e7e82abc6d1b49525fe911ce3bb
Showing with 6 additions and 154 deletions.
  1. +6 −154 ports.mk
160 ports.mk
@@ -95,11 +95,11 @@ endif

bundle_name = ScummVM.app

bundle: all
ifdef USE_DOCKTILEPLUGIN
bundle: scummvm-static scummvm.docktileplugin
else
bundle: scummvm-static
bundle: scummvm.docktileplugin
endif
bundle:
mkdir -p $(bundle_name)/Contents/MacOS
mkdir -p $(bundle_name)/Contents/Resources
echo "APPL????" > $(bundle_name)/Contents/PkgInfo
@@ -121,7 +121,7 @@ ifdef DIST_FILES_ENGINEDATA
endif
$(srcdir)/devtools/credits.pl --rtf > $(bundle_name)/Contents/Resources/Credits.rtf
chmod 644 $(bundle_name)/Contents/Resources/*
cp scummvm-static $(bundle_name)/Contents/MacOS/scummvm
cp scummvm $(bundle_name)/Contents/MacOS/scummvm
chmod 755 $(bundle_name)/Contents/MacOS/scummvm
$(STRIP) $(bundle_name)/Contents/MacOS/scummvm
ifdef USE_DOCKTILEPLUGIN
@@ -277,168 +277,20 @@ endif
cp $(srcdir)/dists/ios7/Images.xcassets/LaunchImage.launchimage/ScummVM-splash-2208x1242.png $(bundle_name)/LaunchImage-800-Landscape-736h@3x.png
cp $(srcdir)/dists/ios7/Images.xcassets/LaunchImage.launchimage/ScummVM-splash-750x1334.png $(bundle_name)/LaunchImage-800-667h@2x.png

# Location of static libs for the iPhone
ifneq ($(BACKEND), iphone)
ifneq ($(BACKEND), ios7)
# Static libaries, used for the scummvm-static and iphone targets
OSX_STATIC_LIBS := `$(SDLCONFIG) --prefix=$(STATICLIBPATH) --static-libs`
ifdef USE_SDL_NET
ifdef USE_SDL2
OSX_STATIC_LIBS += $(STATICLIBPATH)/lib/libSDL2_net.a
else
OSX_STATIC_LIBS += $(STATICLIBPATH)/lib/libSDL_net.a
endif
endif
# With sdl2-config we don't always get the OpenGL framework
OSX_STATIC_LIBS += -framework OpenGL
endif
endif

ifdef USE_LIBCURL
OSX_STATIC_LIBS += -lcurl
endif

ifdef USE_FREETYPE2
OSX_STATIC_LIBS += $(STATICLIBPATH)/lib/libfreetype.a $(STATICLIBPATH)/lib/libbz2.a
endif

ifdef USE_VORBIS
OSX_STATIC_LIBS += \
$(STATICLIBPATH)/lib/libvorbisfile.a \
$(STATICLIBPATH)/lib/libvorbis.a
endif

ifdef USE_TREMOR
OSX_STATIC_LIBS += $(STATICLIBPATH)/lib/libvorbisidec.a
endif

ifdef USE_FLAC
OSX_STATIC_LIBS += $(STATICLIBPATH)/lib/libFLAC.a
endif

ifdef USE_OGG
OSX_STATIC_LIBS += $(STATICLIBPATH)/lib/libogg.a
endif

ifdef USE_FLUIDSYNTH
OSX_STATIC_LIBS += \
-liconv -framework CoreMIDI -framework CoreAudio\
$(STATICLIBPATH)/lib/libfluidsynth.a \
$(STATICLIBPATH)/lib/libglib-2.0.a \
$(STATICLIBPATH)/lib/libintl.a

ifneq ($(BACKEND), iphone)
ifneq ($(BACKEND), ios7)
OSX_STATIC_LIBS += -lreadline -framework AudioUnit
endif
endif
endif

ifdef USE_MAD
OSX_STATIC_LIBS += $(STATICLIBPATH)/lib/libmad.a
endif

ifdef USE_PNG
OSX_STATIC_LIBS += $(STATICLIBPATH)/lib/libpng.a
endif

ifdef USE_THEORADEC
OSX_STATIC_LIBS += $(STATICLIBPATH)/lib/libtheoradec.a
endif

ifdef USE_FAAD
OSX_STATIC_LIBS += $(STATICLIBPATH)/lib/libfaad.a
endif

ifdef USE_MPEG2
OSX_STATIC_LIBS += $(STATICLIBPATH)/lib/libmpeg2.a
endif

ifdef USE_JPEG
OSX_STATIC_LIBS += $(STATICLIBPATH)/lib/libjpeg.a
endif

ifdef USE_ZLIB
OSX_ZLIB ?= $(STATICLIBPATH)/lib/libz.a
endif

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

# Special target to create a static linked binary for Mac OS X.
# We use -force_cpusubtype_ALL to ensure the binary runs on every
# PowerPC machine.
scummvm-static: $(OBJS)
$(CXX) $(LDFLAGS) -force_cpusubtype_ALL -o scummvm-static $(OBJS) \
-framework CoreMIDI \
$(OSX_STATIC_LIBS) \
$(OSX_ZLIB)

# Special target to create a static linked binary for the iPhone (legacy, and iOS 7+)
iphone: $(OBJS)
$(CXX) $(LDFLAGS) -o scummvm $(OBJS) \
$(OSX_STATIC_LIBS) \
-framework UIKit -framework CoreGraphics -framework OpenGLES \
-framework CoreFoundation -framework QuartzCore -framework Foundation \
-framework AudioToolbox -framework CoreAudio -lobjc -lz

# Special target to create a snapshot disk image for Mac OS X
# TODO: Replace AUTHORS by Credits.rtf
osxsnap: bundle
mkdir ScummVM-snapshot
$(srcdir)/devtools/credits.pl --text > $(srcdir)/AUTHORS
cp $(srcdir)/AUTHORS ./ScummVM-snapshot/Authors
cp $(srcdir)/COPYING ./ScummVM-snapshot/License\ \(GPL\)
cp $(srcdir)/COPYING.BSD ./ScummVM-snapshot/License\ \(BSD\)
cp $(srcdir)/COPYING.LGPL ./ScummVM-snapshot/License\ \(LGPL\)
cp $(srcdir)/COPYING.FREEFONT ./ScummVM-snapshot/License\ \(FREEFONT\)
cp $(srcdir)/COPYRIGHT ./ScummVM-snapshot/Copyright\ Holders
cp $(srcdir)/NEWS ./ScummVM-snapshot/News
cp $(srcdir)/README ./ScummVM-snapshot/ScummVM\ ReadMe
mkdir ScummVM-snapshot/doc
cp $(srcdir)/doc/QuickStart ./ScummVM-snapshot/doc/QuickStart
mkdir ScummVM-snapshot/doc/cz
cp $(srcdir)/doc/cz/PrectiMe ./ScummVM-snapshot/doc/cz/PrectiMe
mkdir ScummVM-snapshot/doc/da
cp $(srcdir)/doc/da/HurtigStart ./ScummVM-snapshot/doc/da/HurtigStart
mkdir ScummVM-snapshot/doc/de
cp $(srcdir)/doc/de/LIESMICH ./ScummVM-snapshot/doc/de/LIESMICH
cp $(srcdir)/doc/de/Schnellstart ./ScummVM-snapshot/doc/de/Schnellstart
mkdir ScummVM-snapshot/doc/es
cp $(srcdir)/doc/es/InicioRapido ./ScummVM-snapshot/doc/es
mkdir ScummVM-snapshot/doc/fr
cp $(srcdir)/doc/fr/DemarrageRapide ./ScummVM-snapshot/doc/fr/DemarrageRapide
mkdir ScummVM-snapshot/doc/it
cp $(srcdir)/doc/it/GuidaRapida ./ScummVM-snapshot/doc/it/GuidaRapida
mkdir ScummVM-snapshot/doc/no-nb
cp $(srcdir)/doc/no-nb/HurtigStart ./ScummVM-snapshot/doc/no-nb/HurtigStart
mkdir ScummVM-snapshot/doc/se
cp $(srcdir)/doc/se/LasMig ./ScummVM-snapshot/doc/se/LasMig
cp $(srcdir)/doc/se/Snabbstart ./ScummVM-snapshot/doc/se/Snabbstart
$(XCODETOOLSPATH)/SetFile -t ttro -c ttxt ./ScummVM-snapshot/*
xattr -w "com.apple.TextEncoding" "utf-8;134217984" ./ScummVM-snapshot/doc/cz/*
xattr -w "com.apple.TextEncoding" "utf-8;134217984" ./ScummVM-snapshot/doc/da/*
xattr -w "com.apple.TextEncoding" "utf-8;134217984" ./ScummVM-snapshot/doc/de/*
xattr -w "com.apple.TextEncoding" "utf-8;134217984" ./ScummVM-snapshot/doc/es/*
xattr -w "com.apple.TextEncoding" "utf-8;134217984" ./ScummVM-snapshot/doc/fr/*
xattr -w "com.apple.TextEncoding" "utf-8;134217984" ./ScummVM-snapshot/doc/it/*
xattr -w "com.apple.TextEncoding" "utf-8;134217984" ./ScummVM-snapshot/doc/no-nb/*
xattr -w "com.apple.TextEncoding" "utf-8;134217984" ./ScummVM-snapshot/doc/se/*
$(XCODETOOLSPATH)/CpMac -r $(bundle_name) ./ScummVM-snapshot/
cp $(srcdir)/dists/macosx/DS_Store ./ScummVM-snapshot/.DS_Store
cp $(srcdir)/dists/macosx/background.jpg ./ScummVM-snapshot/background.jpg
$(XCODETOOLSPATH)/SetFile -a V ./ScummVM-snapshot/.DS_Store
$(XCODETOOLSPATH)/SetFile -a V ./ScummVM-snapshot/background.jpg
hdiutil create -ov -format UDZO -imagekey zlib-level=9 -fs HFS+ \
-srcfolder ScummVM-snapshot \
-volname "ScummVM" \
ScummVM-snapshot.dmg
rm -rf ScummVM-snapshot

publish-appcast:
scp dists/macosx/scummvm_appcast.xml www.scummvm.org:/var/www/html/appcasts/macosx/release.xml

0 comments on commit ff224a8

Please sign in to comment.