Skip to content

Commit

Permalink
setup.py for windows improved, works with openssl 1.0.2 and 1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
holgern committed Feb 11, 2019
1 parent d207909 commit cfa4e90
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
5 changes: 5 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ PyPy as well.

Changelog
=========
0.8.8
-----

* setup.py for windows improved, works with openssl 1.0.2 and 1.1.1

0.8.7
-----

Expand Down
26 changes: 19 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import sys
import platform
import struct
import os

includes = []
libraries = []
Expand All @@ -28,15 +29,26 @@
CFLAGS.append('-O2')
elif sys.platform.startswith('win32'):
define_macros = [('inline', '__inline')]
libraries = ['libcrypto', 'advapi32']
extra_sources = ['scrypt-windows-stubs/gettimeofday.c']

extra_sources = ['scrypt-windows-stubs/gettimeofday.c']
if struct.calcsize('P') == 8:
library_dirs = ['c:\OpenSSL-v111-Win64\lib']
includes = ['c:\OpenSSL-v111-Win64\include', 'scrypt-windows-stubs/include']
if os.path.isdir('c:\OpenSSL-Win64'):
openssl_dir = 'c:\OpenSSL-Win64'
else:
openssl_dir = 'c:\OpenSSL-v111-Win64'
library_dirs = [openssl_dir + '\lib']
includes = [openssl_dir + '\include', 'scrypt-windows-stubs/include']
else:
if os.path.isdir('c:\OpenSSL-Win32'):
openssl_dir = 'c:\OpenSSL-Win32'
else:
openssl_dir = 'c:\OpenSSL-v111-Win32'
library_dirs = [openssl_dir + '\lib']
includes = [openssl_dir + '\include', 'scrypt-windows-stubs/include']
if os.path.isfile(library_dirs[0] + '\libcrypto.lib'):
libraries = ['libcrypto', 'advapi32']
else:
library_dirs = ['c:\OpenSSL-v111-Win32\lib']
includes = ['c:\OpenSSL-v111-Win32\include', 'scrypt-windows-stubs/include']
libraries = ['libeay32', 'advapi32']

elif sys.platform.startswith('darwin') and platform.mac_ver()[0] < '10.6':
define_macros = [('HAVE_SYSCTL_HW_USERMEM', '1')]
Expand Down Expand Up @@ -86,7 +98,7 @@
libraries=libraries)

setup(name='scrypt',
version='0.8.7',
version='0.8.8',
description='Bindings for the scrypt key derivation function library',
author='Magnus Hallin',
author_email='[email protected]',
Expand Down

0 comments on commit cfa4e90

Please sign in to comment.