mirror of
https://github.com/vtnerd/monero-lws.git
synced 2024-11-17 09:47:38 +00:00
Merge pull request #41 from j-berman/develop-v0.18
update develop branch to v0.18
This commit is contained in:
commit
2a4a5c8f64
2 changed files with 66 additions and 101 deletions
135
CMakeLists.txt
135
CMakeLists.txt
|
@ -88,19 +88,36 @@ if (NOT MONERO_BUILD_DIR)
|
||||||
message(FATAL_ERROR "The argument -DMONERO_BUILD_DIR must specify a location of an existing monero build")
|
message(FATAL_ERROR "The argument -DMONERO_BUILD_DIR must specify a location of an existing monero build")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(STATIC)
|
||||||
|
if(MSVC)
|
||||||
|
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .dll.a .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||||
|
else()
|
||||||
|
set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
load_cache(${MONERO_BUILD_DIR} READ_WITH_PREFIX monero_
|
load_cache(${MONERO_BUILD_DIR} READ_WITH_PREFIX monero_
|
||||||
Boost_THREAD_LIBRARY_RELEASE
|
Boost_THREAD_LIBRARY_RELEASE
|
||||||
CMAKE_CXX_COMPILER
|
CMAKE_CXX_COMPILER
|
||||||
EXTRA_LIBRARIES
|
EXTRA_LIBRARIES
|
||||||
|
LIBUDEV_LIBRARY
|
||||||
|
usb_LIBRARY
|
||||||
HIDAPI_INCLUDE_DIR
|
HIDAPI_INCLUDE_DIR
|
||||||
|
HIDAPI_LIBRARY
|
||||||
LMDB_INCLUDE
|
LMDB_INCLUDE
|
||||||
monero_SOURCE_DIR
|
monero_SOURCE_DIR
|
||||||
|
OPENSSL_INCLUDE_PATH
|
||||||
OPENSSL_CRYPTO_LIBRARY
|
OPENSSL_CRYPTO_LIBRARY
|
||||||
OPENSSL_SSL_LIBRARY
|
OPENSSL_SSL_LIBRARY
|
||||||
SODIUM_LIBRARY
|
SODIUM_LIBRARY
|
||||||
UNBOUND_LIBRARIES
|
UNBOUND_LIBRARIES
|
||||||
ZMQ_INCLUDE_PATH
|
ZMQ_INCLUDE_PATH
|
||||||
ZMQ_LIB
|
ZMQ_LIB
|
||||||
|
PGM_LIBRARY
|
||||||
|
NORM_LIBRARY
|
||||||
|
GSSAPI_LIBRARY
|
||||||
|
PROTOLIB_LIBRARY
|
||||||
|
SODIUM_LIBRARY
|
||||||
)
|
)
|
||||||
|
|
||||||
if (NOT (monero_monero_SOURCE_DIR MATCHES "${MONERO_SOURCE_DIR}(/src/cryptonote_protocol)"))
|
if (NOT (monero_monero_SOURCE_DIR MATCHES "${MONERO_SOURCE_DIR}(/src/cryptonote_protocol)"))
|
||||||
|
@ -136,101 +153,34 @@ if (NOT (Boost_THREAD_LIBRARY STREQUAL monero_Boost_THREAD_LIBRARY_RELEASE))
|
||||||
message(FATAL_ERROR "Boost libraries for monero build differs from this project")
|
message(FATAL_ERROR "Boost libraries for monero build differs from this project")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# hidapi
|
|
||||||
# https://github.com/moneroexamples/openmonero/blob/18370af8fa51a0e9d05dfe678dcd5bcb7fad30f7/cmake/FindHIDAPI.cmake#L26-L60
|
|
||||||
find_library(HIDAPI_LIBRARY
|
|
||||||
NAMES hidapi hidapi-libusb)
|
|
||||||
|
|
||||||
find_path(HIDAPI_INCLUDE_DIR
|
set(LMDB_INCLUDE "${monero_LMDB_INCLUDE}")
|
||||||
NAMES hidapi.h
|
set(LMDB_LIB_PATH "monero::lmdb")
|
||||||
PATH_SUFFIXES
|
set(ZMQ_LIB "${monero_ZMQ_LIB}")
|
||||||
hidapi)
|
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
|
||||||
find_package_handle_standard_args(HIDAPI
|
|
||||||
DEFAULT_MSG
|
|
||||||
HIDAPI_LIBRARY
|
|
||||||
HIDAPI_INCLUDE_DIR)
|
|
||||||
|
|
||||||
if(HIDAPI_FOUND)
|
|
||||||
set(HIDAPI_LIBRARIES "${HIDAPI_LIBRARY}")
|
|
||||||
if((STATIC AND UNIX AND NOT APPLE) OR (DEPENDS AND CMAKE_SYSTEM_NAME STREQUAL "Linux"))
|
|
||||||
find_library(LIBUSB-1.0_LIBRARY usb-1.0)
|
|
||||||
find_library(LIBUDEV_LIBRARY udev)
|
|
||||||
if(LIBUSB-1.0_LIBRARY)
|
|
||||||
set(HIDAPI_LIBRARIES "${HIDAPI_LIBRARIES};${LIBUSB-1.0_LIBRARY}")
|
|
||||||
if(LIBUDEV_LIBRARY)
|
|
||||||
set(HIDAPI_LIBRARIES "${HIDAPI_LIBRARIES};${LIBUDEV_LIBRARY}")
|
|
||||||
else()
|
|
||||||
message(WARNING "libudev library not found, binaries may fail to link.")
|
|
||||||
endif()
|
|
||||||
else()
|
|
||||||
message(WARNING "libusb-1.0 library not found, binaries may fail to link.")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(HIDAPI_INCLUDE_DIRS "${HIDAPI_INCLUDE_DIR}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
mark_as_advanced(HIDAPI_INCLUDE_DIR HIDAPI_LIBRARY)
|
|
||||||
|
|
||||||
if (NOT (HIDAPI_INCLUDE_DIR STREQUAL monero_HIDAPI_INCLUDE_DIR))
|
|
||||||
message(STATUS "Found HIDAPI_INCLUDE_DIR: ${HIDAPI_INCLUDE_DIR}")
|
|
||||||
message(STATUS "Found monero_HIDAPI_INCLUDE_DIR: ${monero_HIDAPI_INCLUDE_DIR}")
|
|
||||||
message(FATAL_ERROR "hidapi libraries for monero build differs from this project")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# openssl
|
|
||||||
if (STATIC)
|
|
||||||
set(OPENSSL_USE_STATIC_LIBS TRUE)
|
|
||||||
endif()
|
|
||||||
find_package(OpenSSL REQUIRED)
|
|
||||||
|
|
||||||
if (NOT (OPENSSL_CRYPTO_LIBRARY STREQUAL monero_OPENSSL_CRYPTO_LIBRARY))
|
|
||||||
message(STATUS "Found OPENSSL_CRYPTO_LIBRARY: ${OPENSSL_CRYPTO_LIBRARY}")
|
|
||||||
message(STATUS "Found monero_OPENSSL_CRYPTO_LIBRARY: ${monero_OPENSSL_CRYPTO_LIBRARY}")
|
|
||||||
message(FATAL_ERROR "openssl libraries for monero build differs from this project")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# zmq
|
|
||||||
# https://github.com/monero-project/monero/blob/9aab19f349433687c7aaf2c1cbc5751e5912c0aa/CMakeLists.txt#L1171-L1199
|
|
||||||
if(STATIC)
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DZMQ_STATIC")
|
|
||||||
endif()
|
|
||||||
find_path(ZMQ_INCLUDE_PATH zmq.h)
|
|
||||||
find_library(ZMQ_LIB zmq)
|
|
||||||
find_library(PGM_LIBRARY pgm)
|
|
||||||
find_library(NORM_LIBRARY norm)
|
|
||||||
find_library(GSSAPI_LIBRARY gssapi_krb5)
|
|
||||||
find_library(PROTOLIB_LIBRARY protolib)
|
|
||||||
find_library(SODIUM_LIBRARY sodium)
|
|
||||||
|
|
||||||
if(NOT ZMQ_INCLUDE_PATH)
|
|
||||||
message(FATAL_ERROR "Could not find required header zmq.h")
|
|
||||||
endif()
|
|
||||||
if(NOT ZMQ_LIB)
|
if(NOT ZMQ_LIB)
|
||||||
message(FATAL_ERROR "Could not find required libzmq")
|
message(FATAL_ERROR "Could not find required libzmq")
|
||||||
endif()
|
endif()
|
||||||
if(PGM_LIBRARY)
|
if(monero_PGM_LIBRARY)
|
||||||
set(ZMQ_LIB "${ZMQ_LIB};${PGM_LIBRARY}")
|
set(ZMQ_LIB "${ZMQ_LIB};${monero_PGM_LIBRARY}")
|
||||||
endif()
|
endif()
|
||||||
if(NORM_LIBRARY)
|
if(monero_NORM_LIBRARY)
|
||||||
set(ZMQ_LIB "${ZMQ_LIB};${NORM_LIBRARY}")
|
set(ZMQ_LIB "${ZMQ_LIB};${monero_NORM_LIBRARY}")
|
||||||
endif()
|
endif()
|
||||||
if(GSSAPI_LIBRARY)
|
if(monero_GSSAPI_LIBRARY)
|
||||||
set(ZMQ_LIB "${ZMQ_LIB};${GSSAPI_LIBRARY}")
|
set(ZMQ_LIB "${ZMQ_LIB};${monero_GSSAPI_LIBRARY}")
|
||||||
endif()
|
endif()
|
||||||
if(PROTOLIB_LIBRARY)
|
if(monero_PROTOLIB_LIBRARY)
|
||||||
set(ZMQ_LIB "${ZMQ_LIB};${PROTOLIB_LIBRARY}")
|
set(ZMQ_LIB "${ZMQ_LIB};${monero_PROTOLIB_LIBRARY}")
|
||||||
endif()
|
endif()
|
||||||
if(SODIUM_LIBRARY)
|
if(monero_SODIUM_LIBRARY)
|
||||||
set(ZMQ_LIB "${ZMQ_LIB};${SODIUM_LIBRARY}")
|
set(ZMQ_LIB "${ZMQ_LIB};${monero_SODIUM_LIBRARY}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (NOT (ZMQ_INCLUDE_PATH STREQUAL monero_ZMQ_INCLUDE_PATH))
|
if(STATIC AND NOT IOS)
|
||||||
message(STATUS "Found ZMQ_INCLUDE_PATH: ${ZMQ_INCLUDE_PATH}")
|
if(UNIX)
|
||||||
message(STATUS "Found monero_ZMQ_INCLUDE_PATH: ${monero_ZMQ_INCLUDE_PATH}")
|
set(monero_OPENSSL_LIBRARIES "${monero_OPENSSL_LIBRARIES};${CMAKE_DL_LIBS};${CMAKE_THREAD_LIBS_INIT}")
|
||||||
message(FATAL_ERROR "zmq libraries for monero build differs from this project")
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
foreach (LIB ${MONERO_LIBRARIES})
|
foreach (LIB ${MONERO_LIBRARIES})
|
||||||
|
@ -247,7 +197,6 @@ foreach (LIB ${MONERO_LIBRARIES})
|
||||||
set_target_properties(${LIB_NAME} PROPERTIES IMPORTED_LOCATION ${LIB_PATH})
|
set_target_properties(${LIB_NAME} PROPERTIES IMPORTED_LOCATION ${LIB_PATH})
|
||||||
list(APPEND IMPORTED_MONERO_LIBRARIES "${LIB_NAME}")
|
list(APPEND IMPORTED_MONERO_LIBRARIES "${LIB_NAME}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
unset(LIB_PATH CACHE)
|
unset(LIB_PATH CACHE)
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
|
@ -255,9 +204,8 @@ add_library(monero::libraries INTERFACE IMPORTED)
|
||||||
set_property(TARGET monero::libraries PROPERTY
|
set_property(TARGET monero::libraries PROPERTY
|
||||||
INTERFACE_INCLUDE_DIRECTORIES
|
INTERFACE_INCLUDE_DIRECTORIES
|
||||||
${Boost_INCLUDE_DIR}
|
${Boost_INCLUDE_DIR}
|
||||||
${HIDAPI_INCLUDE_DIRS}
|
${monero_HIDAPI_INCLUDE_DIRS}
|
||||||
${OPENSSL_INCLUDE_DIR}
|
${monero_OPENSSL_INCLUDE_PATH}
|
||||||
${ZMQ_INCLUDE_PATH}
|
|
||||||
"${MONERO_BUILD_DIR}/generated_include"
|
"${MONERO_BUILD_DIR}/generated_include"
|
||||||
"${MONERO_SOURCE_DIR}/contrib/epee/include"
|
"${MONERO_SOURCE_DIR}/contrib/epee/include"
|
||||||
"${MONERO_SOURCE_DIR}/external/easylogging++"
|
"${MONERO_SOURCE_DIR}/external/easylogging++"
|
||||||
|
@ -274,17 +222,16 @@ set_property(TARGET monero::libraries PROPERTY
|
||||||
${Boost_SERIALIZATION_LIBRARY}
|
${Boost_SERIALIZATION_LIBRARY}
|
||||||
${Boost_SYSTEM_LIBRARY}
|
${Boost_SYSTEM_LIBRARY}
|
||||||
${Boost_THREAD_LIBRARY}
|
${Boost_THREAD_LIBRARY}
|
||||||
${HIDAPI_LIBRARIES}
|
${monero_HIDAPI_LIBRARY}
|
||||||
${OPENSSL_LIBRARIES}
|
${monero_usb_LIBRARY}
|
||||||
|
${monero_LIBUDEV_LIBRARY}
|
||||||
|
${monero_OPENSSL_SSL_LIBRARY}
|
||||||
|
${monero_OPENSSL_CRYPTO_LIBRARY}
|
||||||
${monero_SODIUM_LIBRARY}
|
${monero_SODIUM_LIBRARY}
|
||||||
${monero_UNBOUND_LIBRARIES}
|
${monero_UNBOUND_LIBRARIES}
|
||||||
${CMAKE_DL_LIBS}
|
${CMAKE_DL_LIBS}
|
||||||
)
|
)
|
||||||
|
|
||||||
set(LMDB_INCLUDE "${monero_LMDB_INCLUDE}")
|
|
||||||
set(LMDB_LIB_PATH "monero::lmdb")
|
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Build monero-lws code
|
# Build monero-lws code
|
||||||
#
|
#
|
||||||
|
|
32
Dockerfile
32
Dockerfile
|
@ -1,8 +1,8 @@
|
||||||
# Initial base from https://github.com/sethforprivacy/monero-lws/blob/588c7f1965d3afbda8a65dc870645650e063e897/Dockerfile
|
# Initial base from https://github.com/sethforprivacy/monero-lws/blob/588c7f1965d3afbda8a65dc870645650e063e897/Dockerfile
|
||||||
|
|
||||||
# Set monerod version to install from github
|
# Set monerod version to install from github
|
||||||
ARG MONERO_BRANCH=v0.17.3.2
|
ARG MONERO_BRANCH=v0.18.0.0
|
||||||
ARG MONERO_COMMIT_HASH=424e4de16b98506170db7b0d7d87a79ccf541744
|
ARG MONERO_COMMIT_HASH=b6a029f222abada36c7bc6c65899a4ac969d7dee
|
||||||
|
|
||||||
# Select ubuntu:20.04 for the build image base
|
# Select ubuntu:20.04 for the build image base
|
||||||
FROM ubuntu:20.04 as build
|
FROM ubuntu:20.04 as build
|
||||||
|
@ -32,13 +32,13 @@ RUN apt-get install --no-install-recommends -y \
|
||||||
libsodium-dev \
|
libsodium-dev \
|
||||||
libssl-dev \
|
libssl-dev \
|
||||||
libudev-dev \
|
libudev-dev \
|
||||||
libunbound-dev \
|
|
||||||
libunwind8-dev \
|
libunwind8-dev \
|
||||||
libusb-1.0-0-dev \
|
libusb-1.0-0-dev \
|
||||||
libzmq3-dev \
|
libzmq3-dev \
|
||||||
pkg-config \
|
pkg-config \
|
||||||
protobuf-compiler \
|
protobuf-compiler \
|
||||||
qttools5-dev-tools \
|
qttools5-dev-tools \
|
||||||
|
wget \
|
||||||
&& apt-get clean \
|
&& apt-get clean \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
@ -51,6 +51,27 @@ ENV CXXFLAGS='-fPIC -DELPP_FEATURE_CRASH_LOG'
|
||||||
ENV USE_SINGLE_BUILDDIR 1
|
ENV USE_SINGLE_BUILDDIR 1
|
||||||
ENV BOOST_DEBUG 1
|
ENV BOOST_DEBUG 1
|
||||||
|
|
||||||
|
# Build expat, a dependency for libunbound
|
||||||
|
RUN set -ex && wget https://github.com/libexpat/libexpat/releases/download/R_2_4_8/expat-2.4.8.tar.bz2 && \
|
||||||
|
echo "a247a7f6bbb21cf2ca81ea4cbb916bfb9717ca523631675f99b3d4a5678dcd16 expat-2.4.8.tar.bz2" | sha256sum -c && \
|
||||||
|
tar -xf expat-2.4.8.tar.bz2 && \
|
||||||
|
rm expat-2.4.8.tar.bz2 && \
|
||||||
|
cd expat-2.4.8 && \
|
||||||
|
./configure --enable-static --disable-shared --prefix=/usr && \
|
||||||
|
make -j${NPROC:-$(nproc)} && \
|
||||||
|
make -j${NPROC:-$(nproc)} install
|
||||||
|
|
||||||
|
# Build libunbound for static builds
|
||||||
|
WORKDIR /tmp
|
||||||
|
RUN set -ex && wget https://www.nlnetlabs.nl/downloads/unbound/unbound-1.16.1.tar.gz && \
|
||||||
|
echo "2fe4762abccd564a0738d5d502f57ead273e681e92d50d7fba32d11103174e9a unbound-1.16.1.tar.gz" | sha256sum -c && \
|
||||||
|
tar -xzf unbound-1.16.1.tar.gz && \
|
||||||
|
rm unbound-1.16.1.tar.gz && \
|
||||||
|
cd unbound-1.16.1 && \
|
||||||
|
./configure --disable-shared --enable-static --without-pyunbound --with-libexpat=/usr --with-ssl=/usr --with-libevent=no --without-pythonmodule --disable-flto --with-pthreads --with-libunbound-only --with-pic && \
|
||||||
|
make -j${NPROC:-$(nproc)} && \
|
||||||
|
make -j${NPROC:-$(nproc)} install
|
||||||
|
|
||||||
# Switch to Monero source directory
|
# Switch to Monero source directory
|
||||||
WORKDIR /monero
|
WORKDIR /monero
|
||||||
|
|
||||||
|
@ -63,10 +84,7 @@ RUN git clone --recursive --branch ${MONERO_BRANCH} \
|
||||||
# Create make build files manually for release-static-linux-x86_64
|
# Create make build files manually for release-static-linux-x86_64
|
||||||
&& cmake -D STATIC=ON -D ARCH="x86-64" -D BUILD_64=ON -D CMAKE_BUILD_TYPE=release -D BUILD_TAG="linux-x64" ../.. \
|
&& cmake -D STATIC=ON -D ARCH="x86-64" -D BUILD_64=ON -D CMAKE_BUILD_TYPE=release -D BUILD_TAG="linux-x64" ../.. \
|
||||||
# Build only monerod binary using number of available threads
|
# Build only monerod binary using number of available threads
|
||||||
&& cd /monero && nice -n 19 ionice -c2 -n7 make -j${NPROC:-$(nproc)} -C build/release daemon
|
&& cd /monero && nice -n 19 ionice -c2 -n7 make -j${NPROC:-$(nproc)} -C build/release daemon lmdb_lib multisig
|
||||||
|
|
||||||
# TODO: remove the need to manually make this static liblmdb_lib.a
|
|
||||||
RUN cd /monero/build/release/src/lmdb && make && cd /monero
|
|
||||||
|
|
||||||
# Switch to monero-lws source directory
|
# Switch to monero-lws source directory
|
||||||
WORKDIR /monero-lws
|
WORKDIR /monero-lws
|
||||||
|
|
Loading…
Reference in a new issue