Ensure proper format of Info.plist
The Information Property List (Info.plist) is a property list that contains information about macOS and iOS application and framework bundles. There are multiple supported formats, those property lists can be stored in, most notably XML and binary. Problem If the Info.plist file is edited with an external editor, such as Xcode, it is possible that it is stored in binary format. A Makefile generated by the qmake tool contains a call to sed, which works on text but not binary files. Consequently, this call would fail. Solution Since Mac OS X 10.2, the plutil tool is available. It can be used to convert the property lists into a specific format. The plutil tool is now used to convert the plist to XML, so that the sed invocation succeeds. [ChangeLog][qmake] Fixed handling binary Info.plist files in generated Makefiles by always converting them to XML before substituting placeholders. Fixes: QTBUG-45357 Change-Id: I066039301c391a5034710458500a096f09e5ca24 Pick-to: 6.2 6.4 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
parent
665d727a28
commit
bbad6440ae
@ -804,7 +804,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
|
||||
QString icon = fileFixify(var("ICON"));
|
||||
t << "@$(DEL_FILE) " << info_plist_out << "\n\t"
|
||||
<< "@sed ";
|
||||
<< "@plutil -convert xml1 -o - " << info_plist << " | "
|
||||
<< "sed ";
|
||||
for (const ProString &arg : std::as_const(commonSedArgs))
|
||||
t << arg;
|
||||
const QString iconName = icon.section(Option::dir_sep, -1);
|
||||
@ -815,7 +816,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
<< "-e \"s,\\$${EXECUTABLE_NAME}," << (app_bundle_name.isEmpty() ? app_bundle_name : plugin_bundle_name) << ",g\" "
|
||||
<< "-e \"s,@TYPEINFO@,"<< typeInfo << ",g\" "
|
||||
<< "-e \"s,\\$${QMAKE_PKGINFO_TYPEINFO},"<< typeInfo << ",g\" "
|
||||
<< "" << info_plist << " >" << info_plist_out << Qt::endl;
|
||||
<< ">" << info_plist_out << Qt::endl;
|
||||
//copy the icon
|
||||
if (!project->isEmpty("ICON")) {
|
||||
QString dir = bundle_dir + "Contents/Resources/";
|
||||
@ -836,14 +837,15 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
if (!isShallowBundle)
|
||||
symlinks[bundle_dir + "Resources"] = "Versions/Current/Resources";
|
||||
t << "@$(DEL_FILE) " << info_plist_out << "\n\t"
|
||||
<< "@sed ";
|
||||
<< "@plutil -convert xml1 -o - " << info_plist << " | "
|
||||
<< "sed ";
|
||||
for (const ProString &arg : std::as_const(commonSedArgs))
|
||||
t << arg;
|
||||
t << "-e \"s,@LIBRARY@," << lib_bundle_name << ",g\" "
|
||||
<< "-e \"s,\\$${EXECUTABLE_NAME}," << lib_bundle_name << ",g\" "
|
||||
<< "-e \"s,@TYPEINFO@," << typeInfo << ",g\" "
|
||||
<< "-e \"s,\\$${QMAKE_PKGINFO_TYPEINFO}," << typeInfo << ",g\" "
|
||||
<< "" << info_plist << " >" << info_plist_out << Qt::endl;
|
||||
<< ">" << info_plist_out << Qt::endl;
|
||||
}
|
||||
break;
|
||||
} // project->isActiveConfig("no_plist")
|
||||
|
Loading…
Reference in New Issue
Block a user