IGN:Use explicit path to libunrar.so in linux binary and use QT_PLUGIN_PATH env variable instead of loading Qt explicitly on each invocation

This commit is contained in:
Kovid Goyal 2009-10-14 17:26:12 -06:00
parent fb719698f7
commit 15cd7f99c2
2 changed files with 4 additions and 2 deletions

View File

@ -161,8 +161,6 @@ class LinuxFreeze(Command):
elif exe not in executables: elif exe not in executables:
print >>sys.stderr, 'Invalid invocation of calibre loader. CALIBRE_CX_EXE=%%s is unknown'%%exe print >>sys.stderr, 'Invalid invocation of calibre loader. CALIBRE_CX_EXE=%%s is unknown'%%exe
else: else:
from PyQt4.QtCore import QCoreApplication
QCoreApplication.setLibraryPaths([sys.frozen_path, os.path.join(sys.frozen_path, "qtplugins")])
sys.argv[0] = exe sys.argv[0] = exe
module, func = executables[exe] module, func = executables[exe]
module = __import__(module, fromlist=[1]) module = __import__(module, fromlist=[1])
@ -248,6 +246,7 @@ class LinuxFreeze(Command):
export MAGICK_CONFIGURE_PATH=$base/ImageMagick/config export MAGICK_CONFIGURE_PATH=$base/ImageMagick/config
export MAGICK_CODER_MODULE_PATH=$base/ImageMagick/modules-Q16/coders export MAGICK_CODER_MODULE_PATH=$base/ImageMagick/modules-Q16/coders
export MAGICK_CODER_FILTER_PATH=$base/ImageMagick/modules-Q16/filter export MAGICK_CODER_FILTER_PATH=$base/ImageMagick/modules-Q16/filter
export QT_PLUGIN_PATH=$base/qtplugins
$loader "$@" $loader "$@"
''')%exe) ''')%exe)
os.chmod(path, 0755) os.chmod(path, 0755)

View File

@ -27,6 +27,9 @@ else:
if hasattr(sys, 'frozen') and iswindows: if hasattr(sys, 'frozen') and iswindows:
lp = os.path.join(os.path.dirname(sys.executable), 'DLLs', 'unrar.dll') lp = os.path.join(os.path.dirname(sys.executable), 'DLLs', 'unrar.dll')
_libunrar = cdll.LoadLibrary(lp) _libunrar = cdll.LoadLibrary(lp)
elif hasattr(sys, 'frozen_path'):
lp = os.path.join(sys.frozen_path, 'libunrar.so')
_libunrar = cdll.LoadLibrary(lp)
else: else:
_libunrar = load_library(_librar_name, cdll) _libunrar = load_library(_librar_name, cdll)