-
-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14664 from ocefpaf/awscrt
add awscrt
- Loading branch information
Showing
5 changed files
with
132 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
From d6d8f22948046b5c683d442b34d33258615a1ff6 Mon Sep 17 00:00:00 2001 | ||
From: "Uwe L. Korn" <[email protected]> | ||
Date: Thu, 10 Jun 2021 21:51:53 +0200 | ||
Subject: [PATCH] Use aws-* libs from PREFIX | ||
|
||
--- | ||
setup.py | 9 ++------- | ||
1 file changed, 2 insertions(+), 7 deletions(-) | ||
|
||
diff --git a/setup.py b/setup.py | ||
index b7fba7e..d15cb17 100644 | ||
--- a/setup.py | ||
+++ b/setup.py | ||
@@ -192,10 +192,6 @@ class awscrt_build_ext(setuptools.command.build_ext.build_ext): | ||
os.chdir(prev_cwd) | ||
|
||
def run(self): | ||
- # build dependencies | ||
- for lib in AWS_LIBS: | ||
- self._build_dependency(lib) | ||
- | ||
# update paths so awscrt_ext can access dependencies | ||
self.include_dirs.append(os.path.join(DEP_INSTALL_PATH, 'include')) | ||
|
||
@@ -237,13 +233,12 @@ def awscrt_ext(): | ||
# HACK: Don't understand why, but if AWS_LIBS are linked normally on macos, we get this error: | ||
# ImportError: dlopen(_awscrt.cpython-37m-darwin.so, 2): Symbol not found: _aws_byte_cursor_eq_ignore_case | ||
# Workaround is to pass them as 'extra_objects' instead of 'libraries'. | ||
- extra_objects = [os.path.join(DEP_INSTALL_PATH, 'lib', 'lib{}.a'.format(x)) for x in libraries] | ||
- libraries = [] | ||
+ libraries = ['{}'.format(x) for x in libraries] | ||
|
||
else: # unix | ||
# linker will prefer shared libraries over static if it can find both. | ||
# force linker to choose static variant by using using "-l:libcrypto.a" syntax instead of just "-lcrypto". | ||
- libraries = [':lib{}.a'.format(x) for x in libraries] | ||
+ libraries = ['{}'.format(x) for x in libraries] | ||
libraries += ['rt'] | ||
|
||
if distutils.ccompiler.get_default_compiler() != 'msvc': | ||
-- | ||
2.30.2 | ||
|
25 changes: 25 additions & 0 deletions
25
recipes/awscrt/0002-Remove-Werror-from-compile-arguments.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
From f21b57a87ebfa5a875c4bf02ab5490d7af34894d Mon Sep 17 00:00:00 2001 | ||
From: "Uwe L. Korn" <[email protected]> | ||
Date: Mon, 14 Jun 2021 14:13:08 +0200 | ||
Subject: [PATCH] Remove Werror from compile arguments | ||
|
||
--- | ||
setup.py | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/setup.py b/setup.py | ||
index d15cb17..6ca8e1e 100644 | ||
--- a/setup.py | ||
+++ b/setup.py | ||
@@ -242,7 +242,7 @@ def awscrt_ext(): | ||
libraries += ['rt'] | ||
|
||
if distutils.ccompiler.get_default_compiler() != 'msvc': | ||
- extra_compile_args += ['-Wextra', '-Werror', '-Wno-strict-aliasing', '-std=gnu99'] | ||
+ extra_compile_args += ['-Wextra', '-Wno-strict-aliasing', '-std=gnu99'] | ||
|
||
return setuptools.Extension( | ||
'_awscrt', | ||
-- | ||
2.30.1 (Apple Git-130) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
set AWS_C_INSTALL=%LIBRARY_PREFIX% | ||
%PYTHON% -m pip install . -vv | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
|
||
set -exuo pipefail | ||
|
||
export AWS_C_INSTALL=$PREFIX | ||
$PYTHON -m pip install . -vv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{% set name = "awscrt" %} | ||
{% set version = "0.11.11" %} | ||
|
||
|
||
package: | ||
name: {{ name|lower }} | ||
version: {{ version }} | ||
|
||
source: | ||
url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/awscrt-{{ version }}.tar.gz | ||
sha256: 5a91645032bd5d112e97b70c3b7eb7d4d365ba98b94b2579a707e1daf420c104 | ||
patches: | ||
- 0001-Use-aws-libs-from-PREFIX.patch | ||
- 0002-Remove-Werror-from-compile-arguments.patch | ||
|
||
build: | ||
number: 0 | ||
|
||
requirements: | ||
build: | ||
- {{ compiler('c') }} | ||
host: | ||
- python | ||
- pip | ||
- s2n # [linux] | ||
- aws-c-common | ||
- aws-c-cal | ||
- aws-c-io | ||
- aws-c-event-stream | ||
- aws-c-http | ||
- aws-c-auth | ||
- aws-c-mqtt | ||
- aws-c-s3 | ||
run: | ||
- python | ||
|
||
test: | ||
imports: | ||
- awscrt | ||
- awscrt.eventstream | ||
commands: | ||
- pip check | ||
requires: | ||
- pip | ||
|
||
about: | ||
home: https://github.com/awslabs/aws-crt-python | ||
summary: A common runtime for AWS Python projects | ||
license: Apache-2.0 | ||
license_file: crt/s2n/LICENSE | ||
|
||
extra: | ||
recipe-maintainers: | ||
- ocefpaf | ||
- xhochy |