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.
# These build can only be generated on OS X.
# Requires all build dependencies for Bitmessage
# Especially important is openssl installed through brew
export ARCHFLAGS="-arch i386 -arch x86_64"

View File

@ -21,8 +21,9 @@ if sys.platform == 'darwin':
setup_requires=['py2app'],
app=[mainscript],
options=dict(py2app=dict(argv_emulation=True,
includes = ['PyQt4.QtCore','PyQt4.QtGui', 'sip', 'sqlite'],
includes = ['PyQt4.QtCore','PyQt4.QtGui', 'sip'],
packages = ['bitmessageqt'],
frameworks = ['/usr/local/opt/openssl/lib/libcrypto.dylib'],
iconfile='images/bitmessage.icns',
resources=["images"])),
)
@ -44,9 +45,17 @@ setup(
**extra_options
)
from distutils import dir_util
import glob
if sys.platform == 'darwin':
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
# Let's try the port version first!

View File

@ -419,17 +419,21 @@ except:
OpenSSL = _OpenSSL('/usr/local/opt/openssl/lib/libcrypto.dylib')
except:
try:
from os import path
lib_path = path.join(sys._MEIPASS, "libeay32.dll")
OpenSSL = _OpenSSL(lib_path)
# Load it from an Bitmessage.app on OSX
OpenSSL = _OpenSSL('./../Frameworks/libcrypto.dylib')
except:
if 'linux' in sys.platform or 'darwin' in sys.platform:
try:
from ctypes.util import find_library
OpenSSL = _OpenSSL(find_library('ssl'))
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.")
try:
from os import path
lib_path = path.join(sys._MEIPASS, "libeay32.dll")
OpenSSL = _OpenSSL(lib_path)
except:
if 'linux' in sys.platform or 'darwin' in sys.platform:
try:
from ctypes.util import find_library
OpenSSL = _OpenSSL(find_library('ssl'))
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.")