Make sure libcrypto from brew is linked. In the resulting .app

This commit is contained in:
Maran 2013-06-17 00:25:03 +02:00
parent 3475000902
commit 5e66e81ab7
3 changed files with 28 additions and 14 deletions

1
osx.sh
View File

@ -3,6 +3,7 @@
# OS X Build script wrapper around the py2app script. # OS X Build script wrapper around the py2app script.
# These build can only be generated on OS X. # These build can only be generated on OS X.
# Requires all build dependencies for Bitmessage # Requires all build dependencies for Bitmessage
# Especially important is openssl installed through brew
export ARCHFLAGS="-arch i386 -arch x86_64" export ARCHFLAGS="-arch i386 -arch x86_64"

View File

@ -21,8 +21,9 @@ if sys.platform == 'darwin':
setup_requires=['py2app'], setup_requires=['py2app'],
app=[mainscript], app=[mainscript],
options=dict(py2app=dict(argv_emulation=True, options=dict(py2app=dict(argv_emulation=True,
includes = ['PyQt4.QtCore','PyQt4.QtGui', 'sip', 'sqlite'], includes = ['PyQt4.QtCore','PyQt4.QtGui', 'sip'],
packages = ['bitmessageqt'], packages = ['bitmessageqt'],
frameworks = ['/usr/local/opt/openssl/lib/libcrypto.dylib'],
iconfile='images/bitmessage.icns', iconfile='images/bitmessage.icns',
resources=["images"])), resources=["images"])),
) )
@ -44,9 +45,17 @@ setup(
**extra_options **extra_options
) )
from distutils import dir_util from distutils import dir_util
import glob
if sys.platform == 'darwin': if sys.platform == 'darwin':
resource = "dist/" + name + ".app/Contents/Resources/" resource = "dist/" + name + ".app/Contents/Resources/"
framework = "dist/" + name + ".app/Contents/Frameworks/"
# The pyElliptive module only works with hardcoded libcrypto paths so rename it so it can actually find it.
libs = glob.glob(framework + "libcrypto*.dylib")
for lib in libs:
os.rename(lib, framework + "libcrypto.dylib")
break
# Try to locate qt_menu # Try to locate qt_menu
# Let's try the port version first! # Let's try the port version first!

View File

@ -419,17 +419,21 @@ except:
OpenSSL = _OpenSSL('/usr/local/opt/openssl/lib/libcrypto.dylib') OpenSSL = _OpenSSL('/usr/local/opt/openssl/lib/libcrypto.dylib')
except: except:
try: try:
from os import path # Load it from an Bitmessage.app on OSX
lib_path = path.join(sys._MEIPASS, "libeay32.dll") OpenSSL = _OpenSSL('./../Frameworks/libcrypto.dylib')
OpenSSL = _OpenSSL(lib_path)
except: except:
if 'linux' in sys.platform or 'darwin' in sys.platform: try:
try: from os import path
from ctypes.util import find_library lib_path = path.join(sys._MEIPASS, "libeay32.dll")
OpenSSL = _OpenSSL(find_library('ssl')) OpenSSL = _OpenSSL(lib_path)
except Exception, err: except:
sys.stderr.write('(On Linux) Couldn\'t find and load the OpenSSL library. You must install it. If you believe that you already have it installed, this exception information might be of use:\n') if 'linux' in sys.platform or 'darwin' in sys.platform:
from ctypes.util import find_library try:
OpenSSL = _OpenSSL(find_library('ssl')) from ctypes.util import find_library
else: OpenSSL = _OpenSSL(find_library('ssl'))
raise Exception("Couldn't find and load the OpenSSL library. You must install it.") except Exception, err:
sys.stderr.write('(On Linux) Couldn\'t find and load the OpenSSL library. You must install it. If you believe that you already have it installed, this exception information might be of use:\n')
from ctypes.util import find_library
OpenSSL = _OpenSSL(find_library('ssl'))
else:
raise Exception("Couldn't find and load the OpenSSL library. You must install it.")