mirror of
https://github.com/RetroShare/libretroshare.git
synced 2026-09-12 19:50:03 +05:00
add dependency installation to mac and windows CI
This commit is contained in:
parent
7b8962fb83
commit
ed8653b054
42
.github/workflows/macos-cmake.yml
vendored
42
.github/workflows/macos-cmake.yml
vendored
@ -52,15 +52,43 @@ jobs:
|
||||
openssl@3 botan@2 sqlcipher miniupnpc json-c
|
||||
bzip2 zlib doxygen gnu-sed rapidjson
|
||||
|
||||
# The restbed patch step of CMakeLists.txt runs `sed -i -e ...`, which is
|
||||
# GNU syntax: BSD sed reads the argument after -i as a backup suffix and
|
||||
# fails with "sed: -e: No such file or directory". The super-project never
|
||||
# hits it -- it has restbed as a submodule and takes the add_subdirectory
|
||||
# branch instead of FetchContent -- so this only shows up in the standalone
|
||||
# build. Put GNU sed first in PATH rather than patch the CMakeLists.
|
||||
- name: Install BitDHT
|
||||
run: |
|
||||
git clone https://github.com/dbear496/RetroShare_BitDHT.git libbitdht \
|
||||
--branch cmake-refactor
|
||||
cd libbitdht
|
||||
cmake -G Ninja -B build
|
||||
cmake --build build -j$(nproc)
|
||||
|
||||
- name: Install restbed
|
||||
run: |
|
||||
git clone https://github.com/Corvusoft/restbed.git
|
||||
cd restbed
|
||||
git checkout --detach 6001a322809b5005b8bcccdf593fdda6f0173691
|
||||
cmake -G Ninja -B build -DBUILD_TESTS=NO -DBUILD_SSL=NO \
|
||||
-DBUILD_STATIC_LIBRARY=YES -DBUILD_SHARED_LIBRARY=NO \
|
||||
-DBUILD_DEVEL_PACKAGE=YES \
|
||||
--install-prefix=/usr/local -DCMAKE_INSTALL_LIBDIR=lib
|
||||
cmake --build build -j$(nproc)
|
||||
sudo cmake --install build
|
||||
|
||||
- name: Install rnp
|
||||
run: |
|
||||
git clone https://github.com/rnpgp/rnp.git --recurse-submodules
|
||||
cd rnp
|
||||
cmake -G Ninja -B build
|
||||
cmake --build build -j$(nproc)
|
||||
sudo cmake --install build
|
||||
|
||||
- name: Install udp-discovery-cpp
|
||||
run: |
|
||||
git clone https://github.com/truvorskameikin/udp-discovery-cpp.git
|
||||
cd udp-discovery-cpp
|
||||
cmake -G Ninja -B build
|
||||
cmake --build build -j$(nproc)
|
||||
|
||||
- name: CMake configure
|
||||
run: |
|
||||
export PATH="$(brew --prefix gnu-sed)/libexec/gnubin:$PATH"
|
||||
HB="$(brew --prefix)"
|
||||
IFLAGS="-I$HB/include"; for d in "$HB"/opt/*/include; do IFLAGS="$IFLAGS -I$d"; done
|
||||
LFLAGS="-L$HB/lib"; for d in "$HB"/opt/*/lib; do LFLAGS="$LFLAGS -L$d"; done
|
||||
|
||||
7
.github/workflows/ubuntu-cmake.yml
vendored
7
.github/workflows/ubuntu-cmake.yml
vendored
@ -51,10 +51,9 @@ jobs:
|
||||
run: >
|
||||
sudo apt-get update &&
|
||||
sudo apt-get install -y
|
||||
build-essential g++ cmake ninja-build pkg-config git
|
||||
libssl-dev zlib1g-dev libbz2-dev libjson-c-dev libbotan-2-dev rapidjson-dev
|
||||
libsqlcipher-dev libminiupnpc-dev libasio-dev
|
||||
doxygen python3
|
||||
build-essential g++ cmake ninja-build pkg-config git libssl-dev
|
||||
zlib1g-dev libbz2-dev libjson-c-dev libbotan-2-dev rapidjson-dev
|
||||
libsqlcipher-dev libminiupnpc-dev libasio-dev doxygen python3
|
||||
|
||||
- name: Install BitDHT
|
||||
run: |
|
||||
|
||||
39
.github/workflows/windows-cmake.yml
vendored
39
.github/workflows/windows-cmake.yml
vendored
@ -82,6 +82,42 @@ jobs:
|
||||
mingw-w64-ucrt-x86_64-bzip2
|
||||
mingw-w64-ucrt-x86_64-zlib
|
||||
|
||||
- name: Install BitDHT
|
||||
run: |
|
||||
git clone https://github.com/dbear496/RetroShare_BitDHT.git \
|
||||
libbitdht --branch cmake-refactor
|
||||
cd libbitdht
|
||||
cmake -G Ninja -B build
|
||||
cmake --build build -j$(nproc)
|
||||
|
||||
- name: Install restbed
|
||||
run: |
|
||||
git clone https://github.com/Corvusoft/restbed.git
|
||||
cd restbed
|
||||
git checkout --detach 6001a322809b5005b8bcccdf593fdda6f0173691
|
||||
cmake -G Ninja -B build -DBUILD_TESTS=NO -DBUILD_SSL=NO \
|
||||
-DBUILD_STATIC_LIBRARY=YES -DBUILD_SHARED_LIBRARY=NO \
|
||||
-DBUILD_DEVEL_PACKAGE=YES \
|
||||
--install-prefix="C:/Program Files/restbed" \
|
||||
-DCMAKE_INSTALL_LIBDIR=lib
|
||||
cmake --build build -j$(nproc)
|
||||
cmake --install build
|
||||
|
||||
- name: Install rnp
|
||||
run: |
|
||||
git clone https://github.com/rnpgp/rnp.git --recurse-submodules
|
||||
cd rnp
|
||||
cmake -G Ninja -B build
|
||||
cmake --build build -j$(nproc)
|
||||
cmake --install build
|
||||
|
||||
- name: Install udp-discovery-cpp
|
||||
run: |
|
||||
git clone https://github.com/truvorskameikin/udp-discovery-cpp.git
|
||||
cd udp-discovery-cpp
|
||||
cmake -G Ninja -B build
|
||||
cmake --build build -j$(nproc)
|
||||
|
||||
- name: CMake configure
|
||||
run: |
|
||||
cmake -G Ninja -B Build-cmake -S . \
|
||||
@ -91,6 +127,9 @@ jobs:
|
||||
-DRS_SQLCIPHER=ON -DRS_BITDHT=ON \
|
||||
-DRS_BRODCAST_DISCOVERY=OFF -DRS_MINIUPNPC=ON \
|
||||
-DRS_FORUM_DEEP_INDEX=OFF \
|
||||
-DBITDHT_ROOT=${{github.workspace}}/libbitdht/build \
|
||||
-DRAPIDJSON_ROOT=${{github.workspace}}/rapidjson/build \
|
||||
-DUDP-DISCOVERY-CPP_ROOT=${{github.workspace}}/udp-discovery-cpp\;${{github.workspace}}/udp-discovery-cpp/build \
|
||||
-DCMAKE_C_FLAGS="-include string.h -include stdint.h" \
|
||||
-DCMAKE_CXX_FLAGS="-include cstring -include cstdint -Wno-template-body"
|
||||
|
||||
|
||||
@ -432,7 +432,10 @@ if(RS_BITDHT)
|
||||
target_compile_definitions(${PROJECT_NAME} PUBLIC RS_USE_BITDHT)
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE bitdht::bitdht)
|
||||
|
||||
install(FILES "${BD_BOOT_FILE}" DESTINATION "${RS_DATA_DIR}")
|
||||
install(FILES "${BD_BOOT_FILE}"
|
||||
DESTINATION "${RS_DATA_DIR}"
|
||||
COMPONENT libretroshare
|
||||
)
|
||||
|
||||
if(RS_BITDHT_STUNNER)
|
||||
target_compile_definitions(${PROJECT_NAME} PUBLIC RS_USE_DHT_STUNNER)
|
||||
@ -472,7 +475,7 @@ endif()
|
||||
if(RS_MINIUPNPC)
|
||||
find_package(MiniUPnPc REQUIRED)
|
||||
target_compile_definitions(${PROJECT_NAME} PUBLIC RS_USE_LIBMINIUPNPC)
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE MiniUPnPc::MiniUPnPc)
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE miniupnpc::miniupnpc)
|
||||
endif(RS_MINIUPNPC)
|
||||
|
||||
if(RS_LIBUPNP)
|
||||
|
||||
@ -32,5 +32,5 @@ find_package_handle_standard_args(MiniUPnPc
|
||||
)
|
||||
|
||||
if(MiniUPnPc_FOUND)
|
||||
add_library(MiniUPnPc::MiniUPnPc ALIAS PkgConfig::MiniUPnPc)
|
||||
add_library(miniupnpc::miniupnpc ALIAS PkgConfig::MiniUPnPc)
|
||||
endif()
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
#include <cstdlib>
|
||||
|
||||
#ifdef WINDOWS_SYS
|
||||
# include <Winsock2.h>
|
||||
# include <winsock2.h>
|
||||
/** Provides Linux like accessor for in6_addr.s6_addr16 for Windows.
|
||||
* Yet Windows doesn't provide 32 bits accessors so there is no way to use
|
||||
* in6_addr.s6_addr32 crossplatform.
|
||||
@ -1033,7 +1033,7 @@ bool sockaddr_storage_ipv4_lessthan(const struct sockaddr_storage &addr, const s
|
||||
const struct sockaddr_in *ptr1 = to_const_ipv4_ptr(addr);
|
||||
const struct sockaddr_in *ptr2 = to_const_ipv4_ptr(addr2);
|
||||
|
||||
if (ptr1->sin_addr.s_addr == ptr2->sin_addr.s_addr)
|
||||
if (ptr1->sin_addr.s_addr == ptr2->sin_addr.s_addr)
|
||||
{
|
||||
return ptr1->sin_port < ptr2->sin_port;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user