mirror of
https://gitlab.com/openlp/packaging.git
synced 2024-12-22 21:12:50 +00:00
Link mudraw binary to bundled libraries on Mac OS X
Add Retina support for Mac Add bzrignore bzr-revno: 12
This commit is contained in:
commit
d4844ce03b
36
.bzrignore
Normal file
36
.bzrignore
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
*.pyc
|
||||||
|
*.*~
|
||||||
|
\#*\#
|
||||||
|
*.eric4project
|
||||||
|
*.eric5project
|
||||||
|
*.ropeproject
|
||||||
|
*.e4*
|
||||||
|
.eric4project
|
||||||
|
.komodotools
|
||||||
|
*.komodoproject
|
||||||
|
list
|
||||||
|
openlp.org 2.0.e4*
|
||||||
|
documentation/build/html
|
||||||
|
documentation/build/doctrees
|
||||||
|
*.log*
|
||||||
|
dist
|
||||||
|
OpenLP.egg-info
|
||||||
|
build
|
||||||
|
resources/innosetup/Output
|
||||||
|
_eric4project
|
||||||
|
.pylint.d
|
||||||
|
*.qm
|
||||||
|
openlp/core/resources.py.old
|
||||||
|
*.qm
|
||||||
|
resources/windows/warnOpenLP.txt
|
||||||
|
openlp.cfg
|
||||||
|
.idea
|
||||||
|
openlp.pro
|
||||||
|
.kdev4
|
||||||
|
tests.kdev4
|
||||||
|
*.nja
|
||||||
|
*.orig
|
||||||
|
__pycache__
|
||||||
|
*.dll
|
||||||
|
*.DS_Store
|
||||||
|
config.ini
|
239
osx/Info.plist
239
osx/Info.plist
@ -1,125 +1,124 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
|
<key>CFBundleDocumentTypes</key>
|
||||||
<key>CFBundleDocumentTypes</key>
|
<array>
|
||||||
<array>
|
<dict>
|
||||||
<dict>
|
<key>CFBundleTypeExtension</key>
|
||||||
<key>CFBundleTypeExtension</key>
|
<array>
|
||||||
<array>
|
<string>osz</string>
|
||||||
<string>osz</string>
|
</array>
|
||||||
</array>
|
<key>CFBundleTypeIconFiles</key>
|
||||||
<key>CFBundleTypeIconFiles</key>
|
<array>
|
||||||
<array>
|
<string>OpenLP.icns</string>
|
||||||
<string>OpenLP.icns</string>
|
</array>
|
||||||
</array>
|
<key>CFBundleTypeName</key>
|
||||||
<key>CFBundleTypeName</key>
|
<string>OpenLP Service</string>
|
||||||
<string>OpenLP Service</string>
|
<key>CFBundleTypeRole</key>
|
||||||
<key>CFBundleTypeRole</key>
|
<string>Viewer</string>
|
||||||
<string>Viewer</string>
|
<key>LSHandlerRank</key>
|
||||||
<key>LSHandlerRank</key>
|
<string>Owner</string>
|
||||||
<string>Owner</string>
|
<key>LSItemContentTypes</key>
|
||||||
<key>LSItemContentTypes</key>
|
<array>
|
||||||
<array>
|
<string>org.openlp.osz</string>
|
||||||
<string>org.openlp.osz</string>
|
</array>
|
||||||
</array>
|
</dict>
|
||||||
</dict>
|
<dict>
|
||||||
<dict>
|
<key>CFBundleTypeExtension</key>
|
||||||
<key>CFBundleTypeExtension</key>
|
<array>
|
||||||
<array>
|
<string>otz</string>
|
||||||
<string>otz</string>
|
</array>
|
||||||
</array>
|
<key>CFBundleTypeIconFiles</key>
|
||||||
<key>CFBundleTypeIconFiles</key>
|
<array>
|
||||||
<array>
|
<string>OpenLP.icns</string>
|
||||||
<string>OpenLP.icns</string>
|
</array>
|
||||||
</array>
|
<key>CFBundleTypeName</key>
|
||||||
<key>CFBundleTypeName</key>
|
<string>OpenLP Theme</string>
|
||||||
<string>OpenLP Theme</string>
|
<key>CFBundleTypeRole</key>
|
||||||
<key>CFBundleTypeRole</key>
|
<string>Viewer</string>
|
||||||
<string>Viewer</string>
|
<key>LSHandlerRank</key>
|
||||||
<key>LSHandlerRank</key>
|
<string>Owner</string>
|
||||||
<string>Owner</string>
|
<key>LSItemContentTypes</key>
|
||||||
<key>LSItemContentTypes</key>
|
<array>
|
||||||
<array>
|
<string>org.openlp.otz</string>
|
||||||
<string>org.openlp.otz</string>
|
</array>
|
||||||
</array>
|
</dict>
|
||||||
</dict>
|
</array>
|
||||||
</array>
|
<key>UTExportedTypeDeclarations</key>
|
||||||
|
<array>
|
||||||
<key>UTExportedTypeDeclarations</key>
|
<dict>
|
||||||
<array>
|
<key>UTTypeIdentifier</key>
|
||||||
<dict>
|
<string>org.openlp.osz</string>
|
||||||
<key>UTTypeIdentifier</key>
|
<key>UTTypeDescription</key>
|
||||||
<string>org.openlp.osz</string>
|
<string>OpenLP Service</string>
|
||||||
<key>UTTypeDescription</key>
|
<key>UTTypeConformsTo</key>
|
||||||
<string>OpenLP Service</string>
|
<array>
|
||||||
<key>UTTypeConformsTo</key>
|
<string>public.data</string>
|
||||||
<array>
|
<string>public.content</string>
|
||||||
<string>public.data</string>
|
</array>
|
||||||
<string>public.content</string>
|
<key>UTTypeTagSpecification</key>
|
||||||
</array>
|
<dict>
|
||||||
<key>UTTypeTagSpecification</key>
|
<key>public.filename-extension</key>
|
||||||
<dict>
|
<array>
|
||||||
<key>public.filename-extension</key>
|
<string>osz</string>
|
||||||
<array>
|
</array>
|
||||||
<string>osz</string>
|
<key>public.mime-type</key>
|
||||||
</array>
|
<array>
|
||||||
<key>public.mime-type</key>
|
<string>application/x-openlp-service</string>
|
||||||
<array>
|
</array>
|
||||||
<string>application/x-openlp-service</string>
|
</dict>
|
||||||
</array>
|
</dict>
|
||||||
</dict>
|
<dict>
|
||||||
</dict>
|
<key>UTTypeIdentifier</key>
|
||||||
<dict>
|
<string>org.openlp.otz</string>
|
||||||
<key>UTTypeIdentifier</key>
|
<key>UTTypeDescription</key>
|
||||||
<string>org.openlp.otz</string>
|
<string>OpenLP Theme</string>
|
||||||
<key>UTTypeDescription</key>
|
<key>UTTypeConformsTo</key>
|
||||||
<string>OpenLP Theme</string>
|
<array>
|
||||||
<key>UTTypeConformsTo</key>
|
<string>public.data</string>
|
||||||
<array>
|
<string>public.content</string>
|
||||||
<string>public.data</string>
|
</array>
|
||||||
<string>public.content</string>
|
<key>UTTypeTagSpecification</key>
|
||||||
</array>
|
<dict>
|
||||||
<key>UTTypeTagSpecification</key>
|
<key>public.filename-extension</key>
|
||||||
<dict>
|
<array>
|
||||||
<key>public.filename-extension</key>
|
<string>otz</string>
|
||||||
<array>
|
</array>
|
||||||
<string>otz</string>
|
<key>public.mime-type</key>
|
||||||
</array>
|
<array>
|
||||||
<key>public.mime-type</key>
|
<string>application/x-openlp-theme</string>
|
||||||
<array>
|
</array>
|
||||||
<string>application/x-openlp-theme</string>
|
</dict>
|
||||||
</array>
|
</dict>
|
||||||
</dict>
|
</array>
|
||||||
</dict>
|
<key>CFBundleIdentifier</key>
|
||||||
</array>
|
<string>org.openlp</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
<key>CFBundleIdentifier</key>
|
<string>%(openlp_version)s</string>
|
||||||
<string>org.openlp</string>
|
<key>CFBundleVersion</key>
|
||||||
<key>CFBundleShortVersionString</key>
|
<string>%(openlp_version)s</string>
|
||||||
<string>%(openlp_version)s</string>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<key>CFBundleVersion</key>
|
<string>6.0</string>
|
||||||
<string>%(openlp_version)s</string>
|
<key>CFBundleDisplayName</key>
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<string>OpenLP</string>
|
||||||
<string>6.0</string>
|
<key>CFBundleIconFile</key>
|
||||||
<key>CFBundleDisplayName</key>
|
<string>OpenLP.icns</string>
|
||||||
<string>OpenLP</string>
|
<key>CFBundleExecutable</key>
|
||||||
<key>CFBundleIconFile</key>
|
<string>MacOS/OpenLP</string>
|
||||||
<string>OpenLP.icns</string>
|
<key>CFBundleName</key>
|
||||||
<key>CFBundleExecutable</key>
|
<string>OpenLP</string>
|
||||||
<string>MacOS/OpenLP</string>
|
<key>CFBundleGetInfoString</key>
|
||||||
<key>CFBundleName</key>
|
<string>OpenLP %(openlp_version)s</string>
|
||||||
<string>OpenLP</string>
|
<key>LSHasLocalizedDisplayName</key>
|
||||||
<key>CFBundleGetInfoString</key>
|
<false/>
|
||||||
<string>OpenLP %(openlp_version)s</string>
|
<key>NSAppleScriptEnabled</key>
|
||||||
<key>LSHasLocalizedDisplayName</key>
|
<false/>
|
||||||
<false/>
|
<key>CFBundlePackageType</key>
|
||||||
<key>NSAppleScriptEnabled</key>
|
<string>APPL</string>
|
||||||
<false/>
|
<key>LSBackgroundOnly</key>
|
||||||
<key>CFBundlePackageType</key>
|
<true/>
|
||||||
<string>APPL</string>
|
<key>NSHighResolutionCapable</key>
|
||||||
<key>LSBackgroundOnly</key>
|
<true/>
|
||||||
<false/>
|
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
@ -93,6 +93,11 @@ MuPDF
|
|||||||
Required for PDF support in OpenLP. Install using macports, or use the
|
Required for PDF support in OpenLP. Install using macports, or use the
|
||||||
'--mudraw-bin' option of this script to point to the mudraw binary.
|
'--mudraw-bin' option of this script to point to the mudraw binary.
|
||||||
|
|
||||||
|
MachOLib
|
||||||
|
Python library to analyze and edit Mach-O headers, the executable format
|
||||||
|
used by Mac OS X. Used to relink the mudraw binary from MuPDF to the bundled
|
||||||
|
libraries. Install using macports or pip.
|
||||||
|
|
||||||
config.ini.default
|
config.ini.default
|
||||||
The configuration file contains settings of the version string to include
|
The configuration file contains settings of the version string to include
|
||||||
in the bundle as well as directory and file settings for different
|
in the bundle as well as directory and file settings for different
|
||||||
@ -126,6 +131,9 @@ from subprocess import Popen, PIPE
|
|||||||
from configparser import ConfigParser
|
from configparser import ConfigParser
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
|
|
||||||
|
from macholib.MachO import MachO
|
||||||
|
from macholib.util import flipwritable, in_system_path
|
||||||
|
|
||||||
|
|
||||||
def _which(command):
|
def _which(command):
|
||||||
"""
|
"""
|
||||||
@ -451,9 +459,58 @@ class MacosxBuilder(object):
|
|||||||
self._print_verbose('... mudraw')
|
self._print_verbose('... mudraw')
|
||||||
if self.mudraw_bin and os.path.isfile(self.mudraw_bin):
|
if self.mudraw_bin and os.path.isfile(self.mudraw_bin):
|
||||||
copy(os.path.join(self.mudraw_bin), os.path.join(self.dist_path, 'mudraw'))
|
copy(os.path.join(self.mudraw_bin), os.path.join(self.dist_path, 'mudraw'))
|
||||||
|
self.relink_mudraw()
|
||||||
else:
|
else:
|
||||||
self._print('... WARNING: mudraw not found')
|
self._print('... WARNING: mudraw not found')
|
||||||
|
|
||||||
|
def relink_mudraw(self):
|
||||||
|
"""
|
||||||
|
Relink mudraw to bundled libraries
|
||||||
|
"""
|
||||||
|
self._print('Linking mudraw with bundled libraries...')
|
||||||
|
libname = os.path.join(self.dist_path, 'mudraw')
|
||||||
|
distname = os.path.relpath(self.dist_path, libname)
|
||||||
|
self._print_verbose('... mudraw path %s', libname)
|
||||||
|
|
||||||
|
# Determine how many directories up is the directory with shared
|
||||||
|
# dynamic libraries. '../'
|
||||||
|
# E.g. ./qt4_plugins/images/ -> ./../../
|
||||||
|
parent_dir = ''
|
||||||
|
# Check if distname is not only base filename.
|
||||||
|
if os.path.dirname(distname):
|
||||||
|
parent_level = len(os.path.dirname(distname).split(os.sep))
|
||||||
|
parent_dir = parent_level * (os.pardir + os.sep)
|
||||||
|
|
||||||
|
def match_func(pth):
|
||||||
|
"""
|
||||||
|
For system libraries leave path unchanged.
|
||||||
|
"""
|
||||||
|
# Match non system dynamic libraries.
|
||||||
|
if not in_system_path(pth):
|
||||||
|
# Use relative path to dependend dynamic libraries bases on
|
||||||
|
# location of the executable.
|
||||||
|
pth = os.path.join('@loader_path', parent_dir, os.path.basename(pth))
|
||||||
|
self._print_verbose('... %s', pth)
|
||||||
|
return pth
|
||||||
|
|
||||||
|
# Rewrite mach headers with @loader_path.
|
||||||
|
dll = MachO(libname)
|
||||||
|
dll.rewriteLoadCommands(match_func)
|
||||||
|
|
||||||
|
# Write changes into file.
|
||||||
|
# Write code is based on macholib example.
|
||||||
|
try:
|
||||||
|
self._print_verbose('... writing new library paths')
|
||||||
|
f = open(dll.filename, 'rb+')
|
||||||
|
for header in dll.headers:
|
||||||
|
f.seek(0)
|
||||||
|
dll.write(f)
|
||||||
|
f.seek(0, 2)
|
||||||
|
f.flush()
|
||||||
|
f.close()
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
def update_translations(self):
|
def update_translations(self):
|
||||||
"""
|
"""
|
||||||
Update the translations.
|
Update the translations.
|
||||||
|
Loading…
Reference in New Issue
Block a user