Skip to content

Commit

Permalink
Updated git tags for aws-c-common and aws-c-io, added lib64 path supp… (
Browse files Browse the repository at this point in the history
#30)

* Updated git tags for aws-c-common and aws-c-io, added lib64 path support for python build, added codebuild jobs for manylinux1 builds.

* Update s2n for the BSD fixes while we're at it.
  • Loading branch information
JonathanHenson authored Jan 25, 2019
1 parent 61cecbe commit 4e32a1c
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 13 deletions.
2 changes: 1 addition & 1 deletion aws-c-io
19 changes: 19 additions & 0 deletions codebuild/ancient-linux-x64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: 0.2
#this build spec assumes the manylinux1 image for pypi
#additional packages we installed: cmake 3.5, libcrypto 1.1.0j, gcc 4.8.4
phases:
install:
commands:
pre_build:
commands:
- export CC=gcc
build:
commands:
- echo Build started on `date`
- git submodule update --init
- /opt/python/cp35-cp35m/bin/python setup.py sdist bdist_wheel
- /opt/python/cp27-cp27m/bin/python setup.py sdist bdist_wheel
post_build:
commands:
- echo Build completed on `date`

19 changes: 19 additions & 0 deletions codebuild/ancient-linux-x86.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: 0.2
#this build spec assumes the manylinux1 x86 image for pypi
#additional packages we installed: cmake 3.5, libcrypto 1.1.0j, gcc 4.8.4
phases:
install:
commands:
pre_build:
commands:
- export CC=gcc
build:
commands:
- echo Build started on `date`
- git submodule update --init
- /opt/python/cp35-cp35m/bin/python setup.py sdist bdist_wheel
- /opt/python/cp27-cp27m/bin/python setup.py sdist bdist_wheel
post_build:
commands:
- echo Build completed on `date`

2 changes: 1 addition & 1 deletion s2n
Submodule s2n updated from 383586 to e23fb8
25 changes: 15 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,19 @@ def determine_generator_string():
os.mkdir(build_dir)
os.chdir(build_dir)

lib_dir = 'lib'
dep_install_path = os.path.join(build_dir, 'install')
if 'AWS_C_INSTALL' in os.environ:
dep_install_path = os.getenv('AWS_C_INSTALL')
if os.path.exists(os.path.join(dep_install_path, 'lib64')):
lib_dir = 'lib64'

def build_dependency(lib_name, pass_dversion_libs=True):
def build_dependency(lib_name):
lib_source_dir = os.path.join(current_dir, lib_name)

global lib_dir
# Skip library if it wasn't pulled
if not os.path.exists(os.path.join(lib_source_dir, 'CMakeLists.txt')):
lib_dir = 'lib'
return

lib_build_dir = os.path.join(build_dir, lib_name)
Expand All @@ -116,19 +120,20 @@ def build_dependency(lib_name, pass_dversion_libs=True):
'-DCMAKE_PREFIX_PATH={}'.format(dep_install_path),
'-DCMAKE_INSTALL_PREFIX={}'.format(dep_install_path),
'-DBUILD_SHARED_LIBS=OFF',
'-DCMAKE_INSTALL_LIBDIR={}'.format(lib_dir),
]
if pass_dversion_libs:
cmake_args.append('-DVERSION_LIBS=OFF')

cmake_args.append(lib_source_dir)
build_cmd = ['cmake', '--build', './', '--config', 'release', '--target', 'install']

ret_code = subprocess.check_call(cmake_args, stderr=subprocess.STDOUT, shell=shell)
ret_code = subprocess.check_call(build_cmd, stderr=subprocess.STDOUT, shell=shell)

os.chdir(build_dir)
return ret_code

if sys.platform != 'darwin' and sys.platform != 'win32':
build_dependency('s2n', pass_dversion_libs=False)
build_dependency('s2n')
build_dependency('aws-c-common')
build_dependency('aws-c-io')
build_dependency('aws-c-mqtt')
Expand All @@ -145,7 +150,7 @@ def build_dependency(lib_name, pass_dversion_libs=True):

include_dirs = [path.join(dep_install_path, 'include')]
libraries = list(aws_c_libs)
library_dirs = [path.join(dep_install_path, 'lib')]
library_dirs = [path.join(dep_install_path, lib_dir)]
extra_objects = []

if compiler_type == 'msvc':
Expand All @@ -167,11 +172,11 @@ def build_dependency(lib_name, pass_dversion_libs=True):
pass
ldflags += ['-framework Security']
include_dirs = ['/usr/local/include'] + include_dirs
library_dirs = ['/usr/local/lib'] + library_dirs
extra_objects = ['{}/lib/lib{}.a'.format(dep_install_path, lib) for lib in aws_c_libs]
library_dirs = ['/usr/local/' + lib_dir] + library_dirs
extra_objects = ['{}/{}/lib{}.a'.format(dep_install_path, lib_dir, lib) for lib in aws_c_libs]
else:
include_dirs = ['/usr/local/include'] + include_dirs
library_dirs = ['/usr/local/lib'] + library_dirs
library_dirs = ['/usr/local/' + lib_dir] + library_dirs
libraries += ['s2n', 'crypto']
aws_c_libs += ['s2n']
try:
Expand All @@ -194,7 +199,7 @@ def build_dependency(lib_name, pass_dversion_libs=True):
('MINOR_VERSION', '0'),
],
include_dirs = ['/usr/local/include', dep_install_path + '/include'],
library_dirs = ['/usr/local/lib', dep_install_path + '/lib'],
library_dirs = ['/usr/local/' + lib_dir, dep_install_path + '/' + lib_dir],
libraries = libraries,
sources = [
'source/module.c',
Expand Down

0 comments on commit 4e32a1c

Please sign in to comment.