rbutil: Change MacOS dmgbuild to use plistlib.

We're not dealing with binary plist files, to biplist is not the one we
want. Also, plistlib is part of Python.

Change-Id: I529516da0d6b04809a7c0d38b20c6f40900560f8
This commit is contained in:
Dominik Riebeling 2021-12-26 21:48:19 +01:00
parent 5999b4f791
commit 88a50ab104
2 changed files with 6 additions and 4 deletions

View file

@ -78,7 +78,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
COMMENT "Setting up dmgbuild virtualenv"
OUTPUT ${DMGBUILD}
COMMAND python3 -m venv ${CMAKE_BINARY_DIR}/venv
COMMAND ${CMAKE_BINARY_DIR}/venv/bin/python -m pip install -q dmgbuild biplist
COMMAND ${CMAKE_BINARY_DIR}/venv/bin/python -m pip install -q dmgbuild
)
add_custom_command(

View file

@ -1,12 +1,14 @@
# Configuration for creating a dmg with dmgbuild
# (https://github.com/al45tair/dmgbuild)
# Needs biplist as additional package.
# Requires at least Python 3.4
import os
import biplist
import plistlib
_appbundle = defines['appbundle']
_plist = biplist.readPlist(os.path.join(_appbundle, 'Contents/Info.plist'))
_plfile = open(os.path.join(_appbundle, 'Contents/Info.plist'))
_pldata = _plfile.read().encode()
_plist = plistlib.loads(_pldata)
_iconfile = os.path.join(_appbundle, 'Contents/Resources', _plist['CFBundleIconFile'])
files = [ _appbundle ]