Skip to content

Commit 48b6a6e

Browse files
committed
Allow building on macos
1 parent 2a62749 commit 48b6a6e

File tree

5 files changed

+59
-44
lines changed

5 files changed

+59
-44
lines changed

deps/aws-lambda-cpp-0.2.6.tar.gz

88.8 KB
Binary file not shown.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
diff --git a/include/backward.h b/include/backward.h
2+
index e065783..9e369a6 100644
3+
--- a/include/backward.h
4+
+++ b/include/backward.h
5+
@@ -43,7 +43,7 @@
6+
7+
// You can define one of the following (or leave it to the auto-detection):
8+
//
9+
-# define BACKWARD_SYSTEM_LINUX
10+
+// #define BACKWARD_SYSTEM_LINUX
11+
// - specialization for linux
12+
//
13+
// #define BACKWARD_SYSTEM_DARWIN
14+
@@ -3057,7 +3057,7 @@ public:
15+
if (st.size() == 0) {
16+
return;
17+
}
18+
- _symbols.reset(backtrace_symbols(st.begin(), st.size()));
19+
+ _symbols.reset(backtrace_symbols(st.begin(), (int)st.size()));
20+
}
21+
22+
ResolvedTrace resolve(ResolvedTrace trace)

scripts/postinstall.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
set -e
44

5-
if [ "$(uname)" = "Darwin" ]; then
6-
echo "aws-lambda-cpp does not build on OS X. Skipping the postinstall step."
7-
else
8-
npm run build:gyp
9-
fi
5+
npm run build:gyp
106

117
# If the path of this file ends in "node_modules/aws-lambda-ric/scripts"
128
# the package is being installed as a dependency and we can clean the deps folder.

scripts/preinstall.sh

Lines changed: 34 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -4,47 +4,43 @@ set -e
44

55
ARTIFACTS_DIR=$(pwd)/deps/artifacts
66

7-
if [ "$(uname)" = "Darwin" ]; then
8-
echo "aws-lambda-cpp does not build on OS X. Skipping the preinstall step."
7+
if [ -x "$(command -v cmake3)" ]; then
8+
CMAKE=cmake3
9+
elif [ -x "$(command -v cmake)" ]; then
10+
CMAKE=cmake
911
else
10-
if [ -x "$(command -v cmake3)" ]; then
11-
CMAKE=cmake3
12-
elif [ -x "$(command -v cmake)" ]; then
13-
CMAKE=cmake
14-
else
15-
echo 'Error: cmake is not installed.' >&2
16-
exit 1
17-
fi
12+
echo 'Error: cmake is not installed.' >&2
13+
exit 1
14+
fi
1815

19-
cd deps
20-
. ./versions
16+
cd deps
17+
. ./versions
2118

22-
# unpack dependencies
23-
tar xzf ./curl-$CURL_VERSION.tar.gz && \
24-
tar xzf ./aws-lambda-cpp-$AWS_LAMBDA_CPP_RELEASE.tar.gz
19+
# unpack dependencies
20+
tar xzf ./curl-$CURL_VERSION.tar.gz && \
21+
tar xzf ./aws-lambda-cpp-$AWS_LAMBDA_CPP_RELEASE.tar.gz
2522

26-
(
27-
# Build Curl
28-
cd curl-curl-$CURL_VERSION && \
29-
./buildconf && \
30-
./configure \
31-
--prefix "$ARTIFACTS_DIR" \
32-
--disable-shared \
33-
--without-ssl \
34-
--without-zlib && \
35-
make && \
36-
make install
37-
)
23+
(
24+
# Build Curl
25+
cd curl-curl-$CURL_VERSION && \
26+
./buildconf && \
27+
./configure \
28+
--prefix "$ARTIFACTS_DIR" \
29+
--disable-shared \
30+
--without-ssl \
31+
--without-zlib && \
32+
make && \
33+
make install
34+
)
3835

39-
(
40-
# Build aws-lambda-cpp
41-
mkdir -p ./aws-lambda-cpp-$AWS_LAMBDA_CPP_RELEASE/build && \
42-
cd ./aws-lambda-cpp-$AWS_LAMBDA_CPP_RELEASE/build
36+
(
37+
# Build aws-lambda-cpp
38+
mkdir -p ./aws-lambda-cpp-$AWS_LAMBDA_CPP_RELEASE/build && \
39+
cd ./aws-lambda-cpp-$AWS_LAMBDA_CPP_RELEASE/build
4340

44-
$CMAKE .. \
45-
-DCMAKE_CXX_FLAGS="-fPIC" \
46-
-DCMAKE_INSTALL_PREFIX="$ARTIFACTS_DIR" \
47-
-DCMAKE_MODULE_PATH="$ARTIFACTS_DIR"/lib/pkgconfig && \
48-
make && make install
49-
)
50-
fi
41+
$CMAKE .. \
42+
-DCMAKE_CXX_FLAGS="-fPIC" \
43+
-DCMAKE_INSTALL_PREFIX="$ARTIFACTS_DIR" \
44+
-DCMAKE_MODULE_PATH="$ARTIFACTS_DIR"/lib/pkgconfig && \
45+
make && make install
46+
)

scripts/update_dependencies.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ wget -c https://github.com/awslabs/aws-lambda-cpp/archive/v$AWS_LAMBDA_CPP_RELEA
2222
patch -p1 < ../patches/aws-lambda-cpp-posting-init-errors.patch && \
2323
patch -p1 < ../patches/aws-lambda-cpp-make-the-runtime-client-user-agent-overrideable.patch && \
2424
patch -p1 < ../patches/aws-lambda-cpp-make-lto-optional.patch && \
25-
patch -p1 < ../patches/aws-lambda-cpp-add-content-type.patch
25+
patch -p1 < ../patches/aws-lambda-cpp-add-content-type.patch && \
26+
patch -p1 < ../patches/aws-lambda-cpp-macos-fixes.patch
2627
)
2728

2829
# Pack again and remove the folder

0 commit comments

Comments
 (0)