From f83ceb2a960e47baedb8238e72392b6f27b7d081 Mon Sep 17 00:00:00 2001 From: dsc Date: Wed, 4 May 2022 18:18:30 +0200 Subject: [PATCH] Fix builds for Windows --- CMakeLists.txt | 30 ++++++++++++++---------------- Dockerfile | 2 ++ Dockerfile.android | 1 - Dockerfile.windows | 2 ++ Makefile | 2 +- src/CMakeLists.txt | 19 +++++++++++++++++++ src/ui/qml/mining.qml | 3 ++- 7 files changed, 40 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 07cee3b..de5bc2e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -142,18 +142,12 @@ endif() if(MINGW) set(Boost_THREADAPI win32) endif() - -find_package(Boost 1.58 REQUIRED COMPONENTS - system - filesystem - thread - atomic - date_time - chrono - regex - serialization - program_options - locale) +set(_BOOST_COMPONENTS system filesystem thread date_time chrono regex serialization program_options locale) +if(APPLE) + # atomic is only present/needed on Apple + list(APPEND _BOOST_COMPONENTS atomic) +endif() +find_package(Boost 1.58 REQUIRED COMPONENTS ${_BOOST_COMPONENTS}) if(UNIX AND NOT APPLE AND NOT ANDROID) if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug") @@ -221,7 +215,7 @@ if(TOR_BIN) endif() # copy the Tor executable over - set(TOR_COPY_CMD "cp -u ${TOR_BIN} ${CMAKE_CURRENT_SOURCE_DIR}/src/assets/exec/tor") + set(TOR_COPY_CMD "cp ${TOR_BIN} ${CMAKE_CURRENT_SOURCE_DIR}/src/assets/exec/tor") message(STATUS "Tor cmd: ${TOR_COPY_CMD}") execute_process(COMMAND bash -c "${TOR_COPY_CMD}" RESULT_VARIABLE ret) @@ -232,9 +226,11 @@ if(TOR_BIN) endif() # get Tor version while we're at it - execute_process(COMMAND bash -c "${TOR_BIN} --version --quiet | head -n1" OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE out RESULT_VARIABLE ret) - if (ret EQUAL "0") - set(TOR_VERSION "${out}") + if(NOT TOR_VERSION) + execute_process(COMMAND bash -c "${TOR_BIN} --version --quiet | head -n1" OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE out RESULT_VARIABLE ret) + if (ret EQUAL "0") + set(TOR_VERSION "${out}") + endif() endif() message(STATUS "Tor version: ${TOR_VERSION}") configure_file("cmake/config-wowlet.h.cmake" "${CMAKE_CURRENT_SOURCE_DIR}/src/config-wowlet.h") @@ -245,6 +241,8 @@ else() endif() if(MINGW) + find_package(Iconv REQUIRED) + string(REGEX MATCH "^[^/]:/[^/]*" msys2_install_path "${CMAKE_C_COMPILER}") message(STATUS "MSYS location: ${msys2_install_path}") set(CMAKE_INCLUDE_PATH "${msys2_install_path}/mingw${ARCH_WIDTH}/include") diff --git a/Dockerfile b/Dockerfile index a2c101b..576d30b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -415,3 +415,5 @@ RUN mkdir linuxdeployqt && \ chmod +x linuxdeployqt-7-x86_64.AppImage && \ ./linuxdeployqt-7-x86_64.AppImage --appimage-extract && \ rm linuxdeployqt-7-x86_64.AppImage + +RUN git config --global --add safe.directory /wowlet \ No newline at end of file diff --git a/Dockerfile.android b/Dockerfile.android index 17bd918..d093b02 100644 --- a/Dockerfile.android +++ b/Dockerfile.android @@ -237,7 +237,6 @@ CMD set -ex \ -DUSE_SINGLE_BUILDDIR=ON \ -DMANUAL_SUBMODULES=1 \ -DUSE_SINGLE_BUILDDIR=ON \ - -DQML=ON \ -DANDROID=ON \ ../../.. \ && PATH=${HOST_PATH} make generate_translations_header \ diff --git a/Dockerfile.windows b/Dockerfile.windows index 69fe6e1..cd67224 100644 --- a/Dockerfile.windows +++ b/Dockerfile.windows @@ -6,6 +6,7 @@ ENV SOURCE_DATE_EPOCH=1397818193 ENV OPENSSL_ROOT_DIR=/usr/local/openssl/ ENV TOR_BIN=/usr/local/tor/bin/tor.exe +ENV TOR_VERSION='tor-0.4.5.7' RUN apt update && \ DEBIAN_FRONTEND=noninteractive apt install -y curl nano wget zip automake build-essential cmake gcc-mingw-w64 g++-mingw-w64 gettext git libtool pkg-config \ @@ -184,3 +185,4 @@ RUN git clone https://git.wownero.com/wowlet/monero-seed.git && \ make -Cbuild install && \ rm -rf $(pwd) +RUN git config --global --add safe.directory /wowlet \ No newline at end of file diff --git a/Makefile b/Makefile index 56370a0..46dc084 100644 --- a/Makefile +++ b/Makefile @@ -54,7 +54,7 @@ depends: windows: mkdir -p build/$(target)/release - cd build/$(target)/release && cmake -D STATIC=ON -DZLIB_ROOT=/usr/x86_64-w64-mingw32/ -DREPRODUCIBLE=$(or ${SOURCE_DATE_EPOCH},OFF) -DTOR_VERSION=$(or ${TOR_VERSION}, OFF) -DOPENVR=ON -DQML=ON -DWITH_SCANNER=ON -DTOR_BIN=$(or ${TOR_BIN},OFF) -D DEV_MODE=$(or ${DEV_MODE},OFF) -D BUILD_TAG=$(tag) -D CMAKE_BUILD_TYPE=Debug -D CMAKE_TOOLCHAIN_FILE=$(root)/$(target)/share/toolchain.cmake ../../.. && $(MAKE) + cd build/$(target)/release && cmake -D STATIC=ON -DZLIB_ROOT=/usr/x86_64-w64-mingw32/ -DREPRODUCIBLE=$(or ${SOURCE_DATE_EPOCH},OFF) -DTOR_VERSION=$(or ${TOR_VERSION}, OFF) -DOPENVR=ON -DWITH_SCANNER=ON -DTOR_BIN=$(or ${TOR_BIN},OFF) -D DEV_MODE=$(or ${DEV_MODE},OFF) -D BUILD_TAG=$(tag) -D CMAKE_BUILD_TYPE=Release -D CMAKE_TOOLCHAIN_FILE=$(root)/$(target)/share/toolchain.cmake ../../.. && $(MAKE) windows-mxe-release: CMAKEFLAGS += -DBUILD_TAG="win-x64" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d4d6d68..2f5325e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -141,6 +141,7 @@ target_include_directories(wowlet PUBLIC ${X11_INCLUDE_DIR} ${QRENCODE_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} + ${Iconv_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR} ${Qt5Core_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS} @@ -237,6 +238,7 @@ target_link_libraries(wowlet PUBLIC ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${CMAKE_DL_LIBS} + ${Iconv_LIBRARIES} ${EXTRA_LIBRARIES}) # Link Qt libraries @@ -365,3 +367,20 @@ message(STATUS "[+] Include Valve's OpenVR library: ${OPENVR}") message(STATUS "[+] This build is for Android: ${ANDROID}") message(STATUS "[+] This build is for testing the Android app on desktop: ${ANDROID_DEBUG}") message(STATUS "[+] TOR_BIN: ${TOR_BIN}") + +message(STATUS "[+] OpenSSL") +message(STATUS " - version: ${OPENSSL_VERSION}") +message(STATUS " - dirs: ${OPENSSL_INCLUDE_DIR}") +message(STATUS " - libs: ${OPENSSL_LIBRARIES} ${OPENSSL_SSL_LIBRARIES}") + +message(STATUS "[+] Boost") +message(STATUS " - version: ${Boost_VERSION}") +message(STATUS " - dirs: ${Boost_INCLUDE_DIRS}") +message(STATUS " - libs: ${Boost_LIBRARIES}") + +if(Iconv_FOUND) + message(STATUS "[+] Iconv") + message(STATUS " - version: ${Iconv_VERSION}") + message(STATUS " - libs: ${Iconv_LIBRARIES}") + message(STATUS " - dirs: ${Iconv_INCLUDE_DIRS}") +endif() diff --git a/src/ui/qml/mining.qml b/src/ui/qml/mining.qml index 46a195c..5f04907 100644 --- a/src/ui/qml/mining.qml +++ b/src/ui/qml/mining.qml @@ -615,7 +615,8 @@ Rectangle { color: "black" anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter - //font.family: ComicMonoBold.name; + font.pointSize: 14 + font.family: ComicMonoBold.name; } } }