Added patch to build LWS properly on macOS. (#10333)
Austin S. Hemmelgarn committed
Dec 8, 2020 at 10:54 UTC
0a808249b8a5cecb9e0be1b489b987717d7eca51
1 file changed
+21
netdata-installer.sh
+21
@@ -619,6 +619,27 @@ build_libwebsockets() {
619
fi
620
621
pushd "${1}" > /dev/null || exit 1
622
+
623
+ if [ "$(uname)" = "Darwin" ]; then
624
+ run patch -p1 << "EOF"
625
+--- a/lib/plat/unix/private.h
626
++++ b/lib/plat/unix/private.h
627
+@@ -164,6 +164,8 @@ delete_from_fd(const struct lws_context *context, int fd);
628
+ * but happily have something equivalent in the SO_NOSIGPIPE flag.
629
+ */
630
+ #ifdef __APPLE__
631
++/* iOS SDK 12+ seems to define it, undef it for compatibility both ways */
632
++#undef MSG_NOSIGNAL
633
+ #define MSG_NOSIGNAL SO_NOSIGPIPE
634
+ #endif
635
+EOF
636
+
637
+ # shellcheck disable=SC2181
638
+ if [ $? -ne 0 ]; then
639
+ return 1
640
+ fi
641
+ fi
642
+
643
if [ "$(uname)" = "Darwin" ] && [ -d /usr/local/opt/openssl ]; then
644
run ${env_cmd} cmake \
645
-D OPENSSL_ROOT_DIR=/usr/local/opt/openssl \