commit eee27317af799d0e937eb7f84273c900974f73e6 Author: Arlo Breault arlolra@gmail.com Date: Wed Nov 9 11:15:34 2016 -0800
Fix info plist
* Use TB script, slightly modified for TM.
* The copyright_year var isn't entirely satisfying. --- projects/tor-messenger/build.osx | 6 ++++++ projects/tor-messenger/config | 2 ++ projects/tor-messenger/fix-info-plist.py | 33 ++++++++++++++++++++++++++++++++ rbm.conf | 1 + 4 files changed, 42 insertions(+)
diff --git a/projects/tor-messenger/build.osx b/projects/tor-messenger/build.osx index 2c65e3f..06ad562 100755 --- a/projects/tor-messenger/build.osx +++ b/projects/tor-messenger/build.osx @@ -45,6 +45,12 @@ mv torbrowser/TorBrowser.app/Contents/Resources/TorBrowser/ $rootdir/TorMessenge
mv torbrowser/TorBrowser.app/Contents/MacOS/Tor/ $rootdir/TorMessenger.app/Contents/MacOS/
+# Adjust the Info.plist file +INFO_PLIST=$rootdir/TorMessenger.app/Contents/Info.plist +mv $INFO_PLIST tmp.plist +python fix-info-plist.py [% c("var/tormessenger_version") %] [% c("var/copyright_year") %] < tmp.plist > $INFO_PLIST +rm -f tmp.plist + mkdir dmg mv TorMessenger.app dmg cd dmg diff --git a/projects/tor-messenger/config b/projects/tor-messenger/config index ba60a99..4b75b12 100644 --- a/projects/tor-messenger/config +++ b/projects/tor-messenger/config @@ -36,6 +36,8 @@ input_files: enable: '[% c("var/windows") %]' - filename: pe_checksum_fix.py enable: '[% c("var/windows") %]' + - filename: fix-info-plist.py + enable: '[% c("var/osx") %]' - filename: cert_override.txt - filename: tor-messenger.ico enable: '[% c("var/windows") %]' diff --git a/projects/tor-messenger/fix-info-plist.py b/projects/tor-messenger/fix-info-plist.py new file mode 100755 index 0000000..b364c86 --- /dev/null +++ b/projects/tor-messenger/fix-info-plist.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python + +# Sets these keys in a property list file: +# CFBundleGetInfoString +# CFBundleShortVersionString +# NSHumanReadableCopyright + +import getopt +import plistlib +import sys + +def usage(): + print >> sys.stderr, "usage: %s TORBROWSER_VERSION YEAR < Info.plist > FixedInfo.plist" % sys.argv[0] + sys.exit(2) + +_, args = getopt.gnu_getopt(sys.argv[1:], "") + +if len(args) != 2: + usage() + +TORBROWSER_VERSION = args[0] +YEAR = args[1] + +COPYRIGHT = "Tor Messenger %s Copyright %s The Tor Project" % (TORBROWSER_VERSION, YEAR) + +plist = plistlib.readPlist(sys.stdin) + +plist["CFBundleGetInfoString"] = "Tor Messenger %s" % TORBROWSER_VERSION +plist["CFBundleVersion"] = TORBROWSER_VERSION +plist["CFBundleShortVersionString"] = TORBROWSER_VERSION +plist["NSHumanReadableCopyright"] = COPYRIGHT + +plistlib.writePlist(plist, sys.stdout) diff --git a/rbm.conf b/rbm.conf index 04d6dc9..62c9b6b 100644 --- a/rbm.conf +++ b/rbm.conf @@ -7,6 +7,7 @@ pkg_type: build
var: tormessenger_version: '0.3.0b1' + copyright_year: '2016' build_id: '[% sha256(c("var/build_id_txt")).substr(0, 6) %]' build_id_txt: | [% c("version") %]