Skip to content

Instantly share code, notes, and snippets.

@matangover
Last active April 5, 2016 15:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matangover/25c84c75046d2122842699594c82a107 to your computer and use it in GitHub Desktop.
Save matangover/25c84c75046d2122842699594c82a107 to your computer and use it in GitHub Desktop.
Compile Python for Heroku with custom OpenSSL.
--- a/setup.py
+++ b/setup.py
@@ -788,11 +788,9 @@ class PyBuildExt(build_ext):
depends=['socketmodule.h'],
libraries=math_libs) )
# Detect SSL support for the socket module (via _ssl)
- search_for_ssl_incs_in = [
- '/usr/local/ssl/include',
- '/usr/contrib/ssl/include/'
- ]
- ssl_incs = find_file('openssl/ssl.h', inc_dirs,
+ CUSTOM_OPENSSL = '/app/.heroku/vendor/'
+ search_for_ssl_incs_in = [os.path.join(CUSTOM_OPENSSL, 'include')]
+ ssl_incs = find_file('openssl/ssl.h', [],
search_for_ssl_incs_in
)
if ssl_incs is not None:
@@ -800,10 +798,8 @@ class PyBuildExt(build_ext):
['/usr/kerberos/include'])
if krb5_h:
ssl_incs += krb5_h
- ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
- ['/usr/local/ssl/lib',
- '/usr/contrib/ssl/lib/'
- ] )
+ ssl_libs = find_library_file(self.compiler, 'ssl',[],
+ [os.path.join(CUSTOM_OPENSSL, 'lib')])
if (ssl_incs is not None and
ssl_libs is not None):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment