Skip to content

Commit

Permalink
Apply IXWebSocket patch automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
CryptoManiac committed Dec 29, 2021
1 parent f933bb6 commit f6e0cb8
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 19 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ option(WITH_TOOLS "Build utility tools" NO)
add_subdirectory(src/additional/libqrencode)
add_subdirectory(src/additional/IXWebSocket)

# Apply patch for IXWebSocket issue
execute_process (
COMMAND sh -c "${CMAKE_CURRENT_SOURCE_DIR}/src/additional/fix_cerrno.sh"
OUTPUT_VARIABLE outIxVar
)

# Set default root path for berkeley db
if (NOT BerkeleyDB_ROOT)
set(BerkeleyDB_ROOT /usr)
Expand Down
6 changes: 6 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ set(OPENSSL_USE_STATIC_LIBS ON)
find_package(OpenSSL REQUIRED)
add_subdirectory(additional/IXWebSocket)

# Apply patch for IXWebSocket issue
execute_process (
COMMAND sh -c "${CMAKE_CURRENT_SOURCE_DIR}/additional/fix_cerrno.sh"
OUTPUT_VARIABLE outIxVar
)

# Set default root path for berkeley db
if (NOT BerkeleyDB_ROOT)
set(BerkeleyDB_ROOT /usr)
Expand Down
19 changes: 0 additions & 19 deletions src/additional/build.sh

This file was deleted.

12 changes: 12 additions & 0 deletions src/additional/cerrno_include.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/ixwebsocket/IXNetSystem.h b/ixwebsocket/IXNetSystem.h
index 21131b4..7ca58f4 100644
--- a/ixwebsocket/IXNetSystem.h
+++ b/ixwebsocket/IXNetSystem.h
@@ -17,6 +17,7 @@
#include <basetsd.h>
#include <io.h>
#include <ws2def.h>
+#include <cerrno>

#undef EWOULDBLOCK
#undef EAGAIN
11 changes: 11 additions & 0 deletions src/additional/fix_cerrno.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

PREVDIR=$(pwd)
SCRIPT=$(readlink -f $0)
ROOT=`dirname $SCRIPT`

cd $ROOT/IXWebSocket
git reset --hard 8c15405
patch -s -p1 < ../cerrno_include.patch
git -c user.name='CryptoManiac' -c user.email='[email protected]' commit -a -m 'Fix cerrno'
cd $PREVDIR

0 comments on commit f6e0cb8

Please sign in to comment.