X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=OSX%2FMakefile;h=6d808354b0631af6fe986b28ae767098f6dc21b6;hb=dba664f31aa87285db4d76cf8c5e66335299703a;hp=b7b37fd965b6f88bab2d707328a8e699a87139af;hpb=c141c2b05e374757b6499d12bb8a6d4d943b1529;p=xscreensaver
diff --git a/OSX/Makefile b/OSX/Makefile
index b7b37fd9..6d808354 100644
--- a/OSX/Makefile
+++ b/OSX/Makefile
@@ -1,40 +1,55 @@
-# XScreenSaver for MacOS X, Copyright (c) 2006-2012 by Jamie Zawinski.
+# XScreenSaver for MacOS X, Copyright (c) 2006-2014 by Jamie Zawinski.
-XCODEBUILD = /Developer/usr/bin/xcodebuild
-TARGETS = -target "All Savers"
+# We have to use Xcode 5.0.2 in order to build savers that will run on
+# MacOS 10.6 and 10.7, because that's the latest version of Xcode that
+# ships with a version of clang that implements "-fobjc-gc".
+#
+XCODE_APP = /Applications/Xcode-5.0.2.app
+
+TARGETS = All Savers
ARCH = -arch i386 -arch x86_64
CERT = 'Jamie Zawinski'
CERT = 'iPhone Developer: Jamie Zawinski (Y5M82TL69N)'
+PKGID = org.jwz.xscreensaver
THUMBDIR = $(HOME)/www/xscreensaver/screenshots/
+XCODEBUILD = $(XCODE_APP)/Contents/Developer/usr/bin/xcodebuild
+SETFILE = $(XCODE_APP)/Contents/Developer/Tools/SetFile
+SETICON = /usr/local/bin/seticon
+# seticon is from osxutils1.7.pkg
default: release
all: debug release
clean:
-rm -rf build
-# cd ..; $(XCODEBUILD) -target $(TARGETS) clean
+# cd ..; $(XCODEBUILD) -target "$(TARGETS)" clean
distclean:
-rm -f config.status config.cache config.log \
*.bak *.rej TAGS *~ "#"*
-rm -rf autom4te*.cache
- -rm -rf build
+ -rm -rf build Sparkle.framework
+distdepend:: Sparkle.framework
distdepend:: update_plist_version
debug: distdepend
- cd ..; $(XCODEBUILD) $(ARCH) $(TARGETS) -configuration Debug build
+ cd ..; $(XCODEBUILD) $(ARCH) -target "$(TARGETS)" -configuration Debug build
release:: distdepend
- cd ..; $(XCODEBUILD) $(ARCH) $(TARGETS) -configuration Release build
+ cd ..; $(XCODEBUILD) $(ARCH) -target "$(TARGETS)" -configuration Release build
release:: check_versions
release:: update_thumbs
release:: sign
+Sparkle.framework:
+ unzip ../archive/Sparkle.framework-2013-12-04.zip
+
sign:
- @for f in build/Release/*.{saver,app} ; do \
- codesign -vfs $(CERT) $$f ; \
+ @for f in build/Release/*.app/Contents/*/*.saver \
+ build/Release/*.{saver,app} ; do \
+ codesign --deep -vfs $(CERT) $$f ; \
done
check_versions:
@@ -45,9 +60,10 @@ check_versions:
RESULT=0 ; \
for S in $$DIR/*.{saver,app} ; do \
for P in $$S/Contents/Info.plist ; do \
- V2=`perl -0000 -n -e \
+ V2=`plutil -convert xml1 -o - "$$P" | \
+ perl -0000 -n -e \
'm@CFBundleVersion\s*(.*?)@si \
- && print $$1' < $$P` ; \
+ && print $$1'` ; \
if [ "$$V2" != "$$V" ] ; then \
echo "Wrong version: $$S ($$V2)" ; \
RESULT=1 ; \
@@ -57,21 +73,40 @@ check_versions:
if [ "$$RESULT" = 0 ]; then echo "Versions match ($$V2)" ; fi ; \
exit $$RESULT
+
+check_gc:
+ @\
+ DIR="build/Release" ; \
+ RESULT=0 ; \
+ for S in "$$DIR/"*.saver ; do \
+ SS=`echo "$$S" | sed -e 's@^.*/@@' -e 's/.saver$$//'` ; \
+ D="$$S/Contents/MacOS/$$SS" ; \
+ V=`otool -s __DATA __objc_imageinfo "$$D" \
+ | grep ' 00 02 00 '` ; \
+ if [ -z "$$V" ]; then \
+ echo "$$S does not have GC enabled" ; \
+ RESULT=1 ; \
+ fi ; \
+ done ; \
+ if [ "$$RESULT" = 0 ]; then echo "GC enabled" ; fi ; \
+ exit $$RESULT
+
+
update_thumbs::
./update-thumbnail.pl $(THUMBDIR) build/Release/*.saver
# Arrrrgh
-ios_function_tables.h::
- @./build-fntable.pl build/Debug-iphoneos/XScreenSaver.app $@
+ios-function-table.m::
+ @./build-fntable.pl build/Debug-iphonesimulator/XScreenSaver.app $@
echo_tarfiles:
@echo `find . \
\( \( -name '.??*' -o -name build -o -name CVS -o -name '*~*' \
- -o -name 'jwz.*' \) \
+ -o -name 'jwz.*' -o -name 'Screen Savers' \) \
-prune \) \
- -o -type f -print \
+ -o \( -type f -o -type l \) -print \
| sed 's@^\./@@' \
| sort`
@@ -80,9 +115,9 @@ update_plist_version:
SRC=../utils/version.h ; \
V=`sed -n 's/[^0-9]*\([0-9]\.[0-9][^. ]*\).*/\1/p' $$SRC` ; \
T=/tmp/xs.$$$$ ; \
- for S in XScreenSaver.plist SaverRunner.plist iSaverRunner.plist ; do \
+ for S in *.plist ; do \
/bin/echo -n "Updating version number in $$S to \"$$V\"... " ; \
- KEYS="CFBundleVersion|CFBundleShortVersionString" ; \
+ KEYS="CFBundleVersion|CFBundleShortVersionString|CFBundleLongVersionString|CFBundleGetInfoString|NSHumanReadableCopyright" ; \
perl -0777 -pne \
"s@(($$KEYS)\s*)[^<>]+()@\$${1}$$V\$${3}@g" \
< $$S > $$T ; \
@@ -96,8 +131,69 @@ update_plist_version:
rm $$T
+updates.xml::
+ ./updates.pl xscreensaver ../README ../archive ~/www/xscreensaver
+ @$(MAKE) test_sig
+
+test_sig::
+ @ \
+ U=../utils/version.h ; \
+ V=`sed -n 's/[^0-9]*\([0-9]\.[0-9][^. ;]*\).*/\1/p' < $$U` ; \
+ BASE="xscreensaver-$$V" ; \
+ OUTDIR="../archive" ; \
+ DMG="$$OUTDIR/$$BASE.dmg" ; \
+ SIG=`sed -n 's/^.*dsaSignature="\(.*\)".*/\1/p' updates.xml` ; \
+ PUB="sparkle_dsa_pub.pem" ; \
+ NN="t.$$$$" ; \
+ SIGB=/tmp/$$NN.sig ; \
+ HASH=/tmp/$$NN.hash ; \
+ rm -f "$$SIGB" "$$HASH" ; \
+ echo "$$SIG " | base64 -D > "$$SIGB" ; \
+ set -e ; \
+ for OPENSSL in /usr/bin/openssl /opt/local/bin/openssl ; do \
+ $$OPENSSL dgst -sha1 -binary < "$$DMG" > "$$HASH" ; \
+ /bin/echo -n "$$OPENSSL `$$OPENSSL version`: " ; \
+ $$OPENSSL dgst -dss1 -verify "$$PUB" -signature "$$SIGB" "$$HASH" ; \
+ done ; \
+ rm -f "$$SIGB" "$$HASH" ; \
+
+
+build/Release/installer.pkg: installer.rtf installer.xml installer.sh installer.png ../utils/version.h
+ @\
+ set -e ; \
+ SRC=../utils/version.h ; \
+ V=`sed -n 's/[^0-9]*\([0-9]\.[0-9][^. ]*\).*/\1/p' $$SRC` ; \
+ \
+ DIST="installer.xml" ; \
+ STAGE="build/Release/pkg_stage" ; \
+ PKG1="$@" ; \
+ PKG2="$$STAGE/contents.pkg" ; \
+ SCRIPTS="$$STAGE/scripts" ; \
+ RES="$$STAGE/resources" ; \
+ \
+ set -x ; \
+ rm -rf "$$STAGE" ; \
+ mkdir -p "$$SCRIPTS" "$$RES" ; \
+ \
+ cp -p installer.sh "$$SCRIPTS/preinstall" ; \
+ cp -p installer.png "$$RES/background.png" ; \
+ cp -p installer.rtf "$$RES/welcome.rtf" ; \
+ \
+ pkgbuild --identifier "$(PKGID)" --version "$$V" \
+ --scripts "$$SCRIPTS" --nopayload "$$PKG2" ; \
+ codesign -vfs $(CERT) "$$PKG2" ; \
+ codesign -vd "$$PKG2" ; \
+ \
+ productbuild --distribution "$$DIST" --resources "$$RES" \
+ --package-path "$$STAGE" --version "$$V" "$$PKG1" ; \
+ codesign -vfs $(CERT) "$$PKG1" ; \
+ codesign -vd "$$PKG1" ; \
+ \
+ rm -rf "$$STAGE" ; \
+
+
# -format UDBZ saves 4% (~1.2 MB) over UDZO.
-dmg:: distdepend check_versions
+dmg:: distdepend check_versions check_gc build/Release/installer.pkg
@ \
set -e ; \
SRC=../utils/version.h ; \
@@ -111,10 +207,12 @@ dmg:: distdepend check_versions
TMPDMG="$$TMPDIR/tmp.dmg" ; \
VOLNAME="XScreenSaver $$V" ; \
STAGE="$$TMPDIR/dmg_stage" ; \
+ DST="$$STAGE/Screen Savers" ; \
+ PKG="$$STAGE/Install Everything.pkg" ; \
rm -f "$$DMG" ; \
rm -rf "$$STAGE" ; \
- echo + mkdir "$$STAGE" ; \
- mkdir "$$STAGE" ; \
+ echo + mkdir -p "$$DST" ; \
+ mkdir -p "$$DST" ; \
\
retired=`perl -0 -ne \
's/\\\\\\n//g; m/^RETIRED_EXES\s*=\s*(.*)$$/m && print "$$1\n"' \
@@ -122,7 +220,8 @@ dmg:: distdepend check_versions
perl -0 -ne \
's/\\\\\\n//g; m/^RETIRED_GL_EXES\s*=\s*(.*)$$/m && print "$$1\n"' \
../hacks/glx/Makefile.in ; \
- echo xscreensaver` ; \
+ echo xscreensaver ; \
+ echo savertester` ; \
\
for f in $$SRC/*.{saver,app} $$EXTRAS ; do \
ok=yes ; \
@@ -131,28 +230,30 @@ dmg:: distdepend check_versions
if [ "$$ff" = "$$r" ]; then ok=no ; fi ; \
done ; \
if [ "$$ok" = yes ]; then \
- echo + cp -pr "$$f" "$$STAGE/" ; \
- cp -pr "$$f" "$$STAGE/" ; \
+ echo + cp -pR "$$f" "$$DST/" ; \
+ cp -pR "$$f" "$$DST/" ; \
else \
echo skipping "$$f" ; \
fi ; \
done ; \
set -x ; \
- cp -p bindist.rtf "$$STAGE/ READ ME.rtf" ; \
+ cp -p bindist.rtf "$$STAGE/Read Me.rtf" ; \
+ cp -p build/Release/installer.pkg "$$PKG" ; \
cp -p bindist-DS_Store "$$STAGE/.DS_Store" ; \
+ cp -p bindist.webloc "$$STAGE/Get the iPhone:iPad Version.webloc" ; \
cp -p XScreenSaverDMG.icns "$$STAGE/.VolumeIcon.icns" ; \
- /Developer/Tools/SetFile -a C "$$STAGE" ; \
- /Developer/Tools/SetFile -a E "$$STAGE/ READ ME.rtf" ; \
- seticon -d ../../xdaliclock/OSX/daliclockSaver.icns $$STAGE/DaliClock.saver;\
+ ${SETFILE} -a C "$$STAGE" ; \
+ ${SETFILE} -a E "$$STAGE"/*.{rtf,pkg,webloc} ; \
+ $(SETICON) -d ../../xdaliclock/OSX/daliclockSaver.icns \
+ "$$DST/DaliClock.saver" ; \
+ $(SETICON) -d XScreenSaverFolder.icns "$$DST" ; \
+ $(SETICON) -d XScreenSaverWebloc.icns "$$STAGE"/*.webloc ; \
+ $(SETICON) -d XScreenSaverPkg.icns "$$STAGE"/*.pkg ; \
hdiutil makehybrid -quiet -ov -hfs -hfs-volume-name "$$VOLNAME" \
-hfs-openfolder "$$STAGE" "$$STAGE" -o "$$TMPDMG" ; \
rm -rf "$$STAGE" ; \
hdiutil convert -quiet -ov -format UDBZ -imagekey zlib-level=9 \
"$$TMPDMG" -o "$$DMG" ; \
+ xattr -w com.apple.quarantine "0000;00000000;;" "$$DMG" ; \
rm -f "$$TMPDMG" ; \
ls -ldhgF "$$DMG"
-
-# Adding this is cute:
-# hdiutil internet-enable -yes -quiet "$$DMG"
-# but means that nobody will ever see the display settings I used!
-# When finder copies the .dmg to a folder, it doesn't preserve them.