diff --git a/build/resources/InfoPlist.strings b/build/resources/InfoPlist.strings new file mode 100644 index 0000000000..e69de29bb2 diff --git a/build/resources/InfoPlists.strings b/build/resources/InfoPlists.strings deleted file mode 100644 index 1089a928d6..0000000000 --- a/build/resources/InfoPlists.strings +++ /dev/null @@ -1,10 +0,0 @@ - - - - - CFBundleDisplayName - 0 A.D. - CFBundleName - 0 A.D. - - diff --git a/source/tools/dist/build-osx-bundle.sh b/source/tools/dist/build-osx-bundle.sh index b3f919ba85..5bd4cc29cc 100644 --- a/source/tools/dist/build-osx-bundle.sh +++ b/source/tools/dist/build-osx-bundle.sh @@ -181,28 +181,33 @@ cp -v ../../libraries/LICENSE.txt "${BUNDLE_RESOURCES}/LIB_LICENSE.txt" # Create Info.plist echo "\nCreating Info.plist\n" -alias PlistBuddy=/usr/libexec/PlistBuddy INFO_PLIST="${BUNDLE_CONTENTS}/Info.plist" -PlistBuddy -c "Add :CFBundleName string 0 A.D." "${INFO_PLIST}" -PlistBuddy -c "Add :CFBundleIdentifier string ${BUNDLE_IDENTIFIER}" "${INFO_PLIST}" -PlistBuddy -c "Add :CFBundleVersion string ${BUNDLE_VERSION}" "${INFO_PLIST}" -PlistBuddy -c "Add :CFBundlePackageType string APPL" "${INFO_PLIST}" -PlistBuddy -c "Add :CFBundleSignature string none" "${INFO_PLIST}" -PlistBuddy -c "Add :CFBundleExecutable string pyrogenesis" "${INFO_PLIST}" -PlistBuddy -c "Add :CFBundleShortVersionString string ${BUNDLE_VERSION}" "${INFO_PLIST}" -PlistBuddy -c "Add :CFBundleDevelopmentRegion string English" "${INFO_PLIST}" -PlistBuddy -c "Add :CFBundleInfoDictionaryVersion string 6.0" "${INFO_PLIST}" -PlistBuddy -c "Add :CFBundleIconFile string 0ad" "${INFO_PLIST}" -PlistBuddy -c "Add :LSHasLocalizedDisplayName bool true" "${INFO_PLIST}" -PlistBuddy -c "Add :LSMinimumSystemVersion string ${BUNDLE_MIN_OSX_VERSION}" "${INFO_PLIST}" -PlistBuddy -c "Add :NSHumanReadableCopyright string Copyright © $(date +%Y) Wildfire Games" "${INFO_PLIST}" +# This is kind of awful but plistlib is usde by dmgbuild +# and it's very strict about what it accepts, so for now this will do. +python3 -c "import plistlib; pl = { \ + 'CFBundleName': '0 A.D.', \ + 'CFBundleIdentifier': '${BUNDLE_IDENTIFIER}', \ + 'CFBundleVersion': '${BUNDLE_VERSION}', \ + 'CFBundlePackageType': 'APPL', \ + 'CFBundleSignature': 'none', \ + 'CFBundleExecutable': 'pyrogenesis', \ + 'CFBundleShortVersionString': '${BUNDLE_VERSION}', \ + 'CFBundleDevelopmentRegion': 'English', \ + 'CFBundleInfoDictionaryVersion': '6.0', \ + 'CFBundleIconFile': '0ad', \ + 'LSHasLocalizedDisplayName': True, \ + 'LSMinimumSystemVersion': '${BUNDLE_MIN_OSX_VERSION}', \ + 'NSHumanReadableCopyright': 'Copyright © $(date +%Y) Wildfire Games', \ +}; \ +fp = open('${INFO_PLIST}', 'wb'); plistlib.dump(pl, fp); fp.close();" # Package the app into a dmg dmgbuild \ -s "${DMGBUILD_CONFIG}" \ -D app="${BUNDLE_OUTPUT}" \ -D background="../../build/resources/dmgbackground.png" \ + -D icon="../resources/0ad.icns" \ "${BUNDLE_DMG_NAME}" "${BUNDLE_FILENAME}" diff --git a/source/tools/dist/dmgbuild-settings.py b/source/tools/dist/dmgbuild-settings.py index 5b310ce225..96b9f13ceb 100644 --- a/source/tools/dist/dmgbuild-settings.py +++ b/source/tools/dist/dmgbuild-settings.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -import biplist import os.path # @@ -11,17 +10,6 @@ import os.path application = defines.get('app') - -def icon_from_app(app_path): - plist_path = os.path.join(app_path, 'Contents', 'Info.plist') - plist = biplist.readPlist(plist_path) - icon_name = plist['CFBundleIconFile'] - icon_root,icon_ext = os.path.splitext(icon_name) - if not icon_ext: - icon_ext = '.icns' - icon_name = icon_root + icon_ext - return os.path.join(app_path, 'Contents', 'Resources', icon_name) - # .. Basics .................................................................... # Volume format (see hdiutil create -help) @@ -42,8 +30,7 @@ symlinks = { 'Applications': '/Applications' } # image, *or* you can define badge_icon, in which case the icon file you specify # will be used to badge the system's Removable Disk icon # -#icon = '/path/to/icon.icns' -badge_icon = icon_from_app(application) +badge_icon = defines.get('icon') # Where to put the icons icon_locations = {