From anonymous, 8 Months ago, written in Plain Text.
Embed
  1. import sys
  2. import pathlib
  3.  
  4. from PyQt5.QtCore import QLibraryInfo
  5.  
  6. plist = """
  7. <?xml version="1.0" encoding="UTF-8"?>
  8. <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  9. <plist version="1.0">
  10. <dict>
  11.         <key>CFBundleExecutable</key>
  12.         <string>QtCore</string>
  13.         <key>CFBundleIdentifier</key>
  14.         <string>org.qt-project.QtCore</string>
  15.         <key>CFBundlePackageType</key>
  16.         <string>FMWK</string>
  17.         <key>CFBundleShortVersionString</key>
  18.         <string>5.14</string>
  19.         <key>CFBundleSignature</key>
  20.         <string>????</string>
  21.         <key>CFBundleVersion</key>
  22.         <string>5.14.0</string>
  23.         <key>NOTE</key>
  24.         <string>Please, do NOT change this file -- It was generated by Qt/QMake.</string>
  25. </dict>
  26. </plist>
  27. """
  28.  
  29. if not sys.platform.startswith('darwin'):
  30.     sys.exit(0)
  31.  
  32. qt_path = pathlib.Path(QLibraryInfo.location(QLibraryInfo.DataPath))
  33. resources_path = qt_path / 'lib' / 'QtCore.framework' / 'Resources'
  34.  
  35. resources_path.mkdir()
  36. (resources_path / 'Info.plist').write_text(plist)
  37.