pull/9273/merge
tobtoht 2 months ago committed by GitHub
commit 3661961e38
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -15,7 +15,7 @@ env:
REMOVE_BUNDLED_PACKAGES : sudo rm -rf /usr/local
BUILD_DEFAULT_LINUX: |
cmake -S . -B build -D ARCH="default" -D BUILD_TESTS=ON -D CMAKE_BUILD_TYPE=Release && cmake --build build -j3
APT_INSTALL_LINUX: 'sudo apt -y install build-essential cmake libboost-all-dev miniupnpc libunbound-dev graphviz doxygen libunwind8-dev pkg-config libssl-dev libzmq3-dev libsodium-dev libhidapi-dev libnorm-dev libusb-1.0-0-dev libpgm-dev libprotobuf-dev protobuf-compiler ccache'
APT_INSTALL_LINUX: 'sudo apt -y install build-essential cmake libboost-all-dev libminiupnpc-dev libunbound-dev graphviz doxygen libunwind8-dev pkg-config libssl-dev libzmq3-dev libsodium-dev libhidapi-dev libnorm-dev libusb-1.0-0-dev libpgm-dev libprotobuf-dev protobuf-compiler ccache'
APT_SET_CONF: |
echo "Acquire::Retries \"3\";" | sudo tee -a /etc/apt/apt.conf.d/80-custom
echo "Acquire::http::Timeout \"120\";" | sudo tee -a /etc/apt/apt.conf.d/80-custom
@ -68,7 +68,7 @@ jobs:
- uses: msys2/setup-msys2@v2
with:
update: true
install: mingw-w64-x86_64-toolchain make mingw-w64-x86_64-cmake mingw-w64-x86_64-ccache mingw-w64-x86_64-boost mingw-w64-x86_64-openssl mingw-w64-x86_64-zeromq mingw-w64-x86_64-libsodium mingw-w64-x86_64-hidapi mingw-w64-x86_64-libusb mingw-w64-x86_64-unbound git
install: mingw-w64-x86_64-toolchain make mingw-w64-x86_64-cmake mingw-w64-x86_64-ccache mingw-w64-x86_64-boost mingw-w64-x86_64-openssl mingw-w64-x86_64-zeromq mingw-w64-x86_64-libsodium mingw-w64-x86_64-hidapi mingw-w64-x86_64-libusb mingw-w64-x86_64-unbound mingw-w64-x86_64-miniupnpc git
- shell: msys2 {0}
run: |
curl -O https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-protobuf-c-1.4.1-1-any.pkg.tar.zst

3
.gitmodules vendored

@ -1,6 +1,3 @@
[submodule "external/miniupnp"]
path = external/miniupnp
url = https://github.com/miniupnp/miniupnp
[submodule "external/rapidjson"]
path = external/rapidjson
url = https://github.com/Tencent/rapidjson

@ -367,7 +367,6 @@ if(NOT MANUAL_SUBMODULES)
endfunction ()
message(STATUS "Checking submodules")
check_submodule(external/miniupnp)
check_submodule(external/rapidjson)
check_submodule(external/trezor-common)
check_submodule(external/randomx)
@ -599,6 +598,9 @@ if (WIN32)
list(APPEND OPENSSL_LIBRARIES ws2_32 crypt32)
endif()
find_package(Miniupnpc REQUIRED)
message(STATUS "Using Miniupnpc include dir at ${MINIUPNP_INCLUDE_DIRS}")
find_package(HIDAPI)
add_definition_if_library_exists(c memset_s "string.h" HAVE_MEMSET_S)
@ -690,6 +692,10 @@ include_directories(${LMDB_INCLUDE})
include_directories(${LIBUNWIND_INCLUDE})
link_directories(${LIBUNWIND_LIBRARY_DIRS})
# Final setup for miniupnpc
include_directories(${MINIUPNP_INCLUDE_DIRS})
link_directories(${MINIUPNP_LIBRARIES})
# Final setup for hid
if (HIDAPI_FOUND)
message(STATUS "Using HIDAPI include dir at ${HIDAPI_INCLUDE_DIR}")

@ -176,6 +176,7 @@ library archives (`.a`).
| libnorm[2] | ? | NO | `libnorm-dev` | | | | YES | For ZeroMQ |
| libunbound | 1.4.16 | NO | `libunbound-dev` | `unbound` | `unbound-devel` | `unbound-devel` | NO | DNS resolver |
| libsodium | ? | NO | `libsodium-dev` | `libsodium` | `libsodium-devel` | `libsodium-devel` | NO | cryptography |
| miniupnpc | 2.2.0 | NO | `libminiupnpc-dev` | `miniupnpc` | `miniupnpc-devel` | `miniupnpc-devel` | NO | UPNP mapping |
| libunwind | any | NO | `libunwind8-dev` | `libunwind` | `libunwind-devel` | `libunwind-devel` | YES | Stack traces |
| liblzma | any | NO | `liblzma-dev` | `xz` | `liblzma-devel` | `xz-devel` | YES | For libunwind |
| libreadline | 6.3.0 | NO | `libreadline6-dev` | `readline` | `readline-devel` | `readline-devel` | YES | Input editing |
@ -205,17 +206,17 @@ then:
Install all dependencies at once on Debian/Ubuntu:
```
sudo apt update && sudo apt install build-essential cmake pkg-config libssl-dev libzmq3-dev libunbound-dev libsodium-dev libunwind8-dev liblzma-dev libreadline6-dev libexpat1-dev libpgm-dev qttools5-dev-tools libhidapi-dev libusb-1.0-0-dev libprotobuf-dev protobuf-compiler libudev-dev libboost-chrono-dev libboost-date-time-dev libboost-filesystem-dev libboost-locale-dev libboost-program-options-dev libboost-regex-dev libboost-serialization-dev libboost-system-dev libboost-thread-dev python3 ccache doxygen graphviz
sudo apt update && sudo apt install build-essential cmake pkg-config libssl-dev libzmq3-dev libunbound-dev libsodium-dev libunwind8-dev liblzma-dev libreadline6-dev libexpat1-dev libpgm-dev qttools5-dev-tools libhidapi-dev libusb-1.0-0-dev libprotobuf-dev protobuf-compiler libudev-dev libboost-chrono-dev libboost-date-time-dev libboost-filesystem-dev libboost-locale-dev libboost-program-options-dev libboost-regex-dev libboost-serialization-dev libboost-system-dev libboost-thread-dev libminiupnpc-dev python3 ccache doxygen graphviz
```
Install all dependencies at once on Arch:
```
sudo pacman -Syu --needed base-devel cmake boost openssl zeromq libpgm unbound libsodium libunwind xz readline expat gtest python3 ccache doxygen graphviz qt5-tools hidapi libusb protobuf systemd
sudo pacman -Syu --needed base-devel cmake boost openssl zeromq libpgm unbound libsodium libunwind xz readline expat gtest python3 ccache doxygen graphviz qt5-tools hidapi libusb protobuf systemd miniupnpc
```
Install all dependencies at once on Fedora:
```
sudo dnf install gcc gcc-c++ cmake pkgconf boost-devel openssl-devel zeromq-devel openpgm-devel unbound-devel libsodium-devel libunwind-devel xz-devel readline-devel expat-devel gtest-devel ccache doxygen graphviz qt5-linguist hidapi-devel libusbx-devel protobuf-devel protobuf-compiler systemd-devel
sudo dnf install gcc gcc-c++ cmake pkgconf boost-devel openssl-devel zeromq-devel openpgm-devel unbound-devel libsodium-devel libunwind-devel xz-devel readline-devel expat-devel gtest-devel ccache doxygen graphviz qt5-linguist hidapi-devel libusbx-devel protobuf-devel protobuf-compiler systemd-devel miniupnpc-devel
```
Install all dependencies at once on openSUSE:
@ -233,7 +234,7 @@ brew update && brew bundle --file=contrib/brew/Brewfile
FreeBSD 12.1 one-liner required to build dependencies:
```
pkg install git gmake cmake pkgconf boost-libs libzmq4 libsodium unbound
pkg install git gmake cmake pkgconf boost-libs libzmq4 libsodium unbound miniupnpc
```
### Cloning the repository

@ -172,6 +172,18 @@ endif
ifneq ($($(1)_ldflags),)
$(1)_autoconf += LDFLAGS="$$($(1)_ldflags)"
endif
$(1)_cmake=env CC="$$($(1)_cc)" \
CFLAGS="$$($(1)_cppflags) $$($(1)_cflags)" \
CXX="$$($(1)_cxx)" \
CXXFLAGS="$$($(1)_cppflags) $$($(1)_cxxflags)" \
LDFLAGS="$$($(1)_ldflags)" \
cmake -DCMAKE_INSTALL_PREFIX:PATH="$$($($(1)_type)_prefix)" $$($(1)_config_opts)
ifneq ($(host),$(build))
$(1)_cmake += -DCMAKE_SYSTEM_NAME=$($(host_os)_cmake_system)
$(1)_cmake += -DCMAKE_C_COMPILER_TARGET=$(host)
$(1)_cmake += -DCMAKE_CXX_COMPILER_TARGET=$(host)
endif
endef
define int_add_cmds

@ -1,39 +1,23 @@
package=gtest
$(package)_version=1.8.1
$(package)_version=1.14.0
$(package)_download_path=https://github.com/google/googletest/archive/
$(package)_download_file=release-$($(package)_version).tar.gz
$(package)_download_file=v$($(package)_version).tar.gz
$(package)_file_name=$(package)-$($(package)_version).tar.gz
$(package)_sha256_hash=9bf1fe5182a604b4135edc1a425ae356c9ad15e9b23f9f12a02e80184c3a249c
$(package)_cxxflags=-std=c++11
$(package)_sha256_hash=8ad598c73ad796e0d8280b082cebd82a630d73e73cd3c70057938a6501bba5d7
$(package)_cxxflags=-std=c++14
$(package)_cxxflags_linux=-fPIC
define $(package)_config_cmds
cd googletest && \
CC="$(host_prefix)/native/bin/$($(package)_cc)" \
CXX="$(host_prefix)/native/bin/$($(package)_cxx)" \
AR="$(host_prefix)/native/bin/$($(package)_ar)" \
RANLIB="$(host_prefix)/native/bin/$($(package)_ranlib)" \
LIBTOOL="$(host_prefix)/native/bin/$($(package)_libtool)" \
CXXFLAGS="$($(package)_cxxflags)" \
CCFLAGS="$($(package)_ccflags)" \
CPPFLAGS="$($(package)_cppflags)" \
CFLAGS="$($(package)_cflags) $($(package)_cppflags)" \
LDLAGS="$($(package)_ldflags)" \
cmake -DCMAKE_INSTALL_PREFIX=$(build_prefix) \
-DTOOLCHAIN_PREFIX=$(host_toolchain) \
-DCMAKE_AR="$(host_prefix)/native/bin/$($(package)_ar)" \
-DCMAKE_RANLIB="$(host_prefix)/native/bin/$($(package)_ranlib)" \
-DCMAKE_CXX_FLAGS_DEBUG=ON
$($(package)_cmake) -S . -B .
endef
# -DCMAKE_TOOLCHAIN_FILE=$(HOST)/share/toolchain.cmake
define $(package)_build_cmds
cd googletest && CC="$(host_prefix)/native/bin/$($(package)_cc)" $(MAKE)
$(MAKE)
endef
define $(package)_stage_cmds
mkdir $($(package)_staging_prefix_dir)/lib $($(package)_staging_prefix_dir)/include &&\
cp googletest/libgtest.a $($(package)_staging_prefix_dir)/lib/ &&\
cp googletest/libgtest_main.a $($(package)_staging_prefix_dir)/lib/ &&\
cp lib/libgtest.a $($(package)_staging_prefix_dir)/lib/ &&\
cp lib/libgtest_main.a $($(package)_staging_prefix_dir)/lib/ &&\
cp -a googletest/include/* $($(package)_staging_prefix_dir)/include/
endef

@ -0,0 +1,24 @@
package=miniupnpc
$(package)_version=2.2.7
$(package)_download_path=https://miniupnp.tuxfamily.org/files/
$(package)_file_name=$(package)-$($(package)_version).tar.gz
$(package)_sha256_hash=b0c3a27056840fd0ec9328a5a9bac3dc5e0ec6d2e8733349cf577b0aa1e70ac1
$(package)_build_subdir=build
define $(package)_set_vars
$(package)_config_opts = -DUPNPC_BUILD_SAMPLE=OFF -DUPNPC_BUILD_SHARED=OFF
$(package)_config_opts += -DUPNPC_BUILD_STATIC=ON -DUPNPC_BUILD_TESTS=OFF
$(package)_config_opts_mingw32 += -DMINIUPNPC_TARGET_WINDOWS_VERSION=0x0601
endef
define $(package)_config_cmds
$($(package)_cmake) -S .. -B .
endef
define $(package)_build_cmds
$(MAKE)
endef
define $(package)_stage_cmds
cmake --install . --prefix $($(package)_staging_prefix_dir)
endef

@ -1,4 +1,4 @@
packages:=boost openssl zeromq expat unbound sodium
packages:=boost openssl zeromq expat unbound sodium miniupnpc
hardware_packages := hidapi protobuf libusb
hardware_native_packages := native_protobuf

@ -35,24 +35,6 @@
# ...except for FreeBSD, because FreeBSD is a special case that doesn't play well with
# others.
find_package(Miniupnpc REQUIRED)
message(STATUS "Using in-tree miniupnpc")
set(UPNPC_NO_INSTALL TRUE CACHE BOOL "Disable miniupnp installation" FORCE)
add_subdirectory(miniupnp/miniupnpc)
set_property(TARGET libminiupnpc-static PROPERTY FOLDER "external")
set_property(TARGET libminiupnpc-static PROPERTY POSITION_INDEPENDENT_CODE ON)
if(MSVC)
set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -wd4244 -wd4267")
elseif(NOT MSVC)
set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-undef -Wno-unused-result -Wno-unused-value")
endif()
if(CMAKE_SYSTEM_NAME MATCHES "NetBSD")
set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -D_NETBSD_SOURCE")
endif()
set(UPNP_LIBRARIES "libminiupnpc-static" PARENT_SCOPE)
find_package(Unbound)
if(NOT UNBOUND_INCLUDE_DIR)

1
external/miniupnp vendored

@ -1 +0,0 @@
Subproject commit 544e6fcc73c5ad9af48a8985c94f0f1d742ef2e0

@ -41,7 +41,7 @@ target_link_libraries(p2p
version
cryptonote_core
net
${UPNP_LIBRARIES}
${MINIUPNP_LIBRARIES}
${Boost_CHRONO_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}

@ -58,9 +58,9 @@
#include "cryptonote_core/cryptonote_core.h"
#include "net/parse.h"
#include <miniupnp/miniupnpc/miniupnpc.h>
#include <miniupnp/miniupnpc/upnpcommands.h>
#include <miniupnp/miniupnpc/upnperrors.h>
#include <miniupnpc/miniupnpc.h>
#include <miniupnpc/upnpcommands.h>
#include <miniupnpc/upnperrors.h>
#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "net.p2p"

Loading…
Cancel
Save