diff --git a/.gitmodules b/.gitmodules index 294bfc9..73afa17 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,10 @@ -[submodule "contrib/KDMacTouchBar"] - path = contrib/KDMacTouchBar - url = https://github.com/KDAB/KDMacTouchBar.git -[submodule "monero"] - path = monero +[submodule "external/wownero"] + path = external/wownero url = https://git.wownero.com/wownero/wownero branch = wowlet +[submodule "external/monero-seed"] + path = external/monero-seed + url = https://git.wownero.com/wowlet/monero-seed +[submodule "external/KDMacTouchBar"] + path = external/KDMacTouchBar + url = https://github.com/KDAB/KDMacTouchBar diff --git a/CMakeLists.txt b/CMakeLists.txt index b81ff8f..522423d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,13 +28,26 @@ if(DEBUG) set(CMAKE_VERBOSE_MAKEFILE ON) endif() -set(WOWNERO_HEAD "f611d5c9e32bc62f1735f6571b0bdb95cc020531") +# Submodule commit hashes +set(TOUCH_BAR_HEAD "696bb2141c") +set(MONERO_SEED_HEAD "4674ef09b6") +set(WOWNERO_HEAD "f611d5c9e3") + set(BUILD_GUI_DEPS ON) set(ARCH "x86-64") set(BUILD_64 ON) set(INSTALL_VENDORED_LIBUNBOUND ${STATIC}) set(USE_SINGLE_BUILDDIR ON) +if(NOT WIN32) + string(ASCII 27 Esc) + set(BoldRed "${Esc}[1;31m") + set(BoldGreen "${Esc}[1;32m") + set(BoldYellow "${Esc}[1;33m") + set(ResetColor "${Esc}[m") + set(BoldColor "${Esc}[1m") +endif() + check_include_file(sys/prctl.h HAVE_SYS_PRCTL_H) check_symbol_exists(prctl "sys/prctl.h" HAVE_PRCTL) @@ -47,7 +60,7 @@ if(STATIC) # manually set the unbound submodule the right commit that has the fix. # This only works with -DMANUAL_SUBMODULES=1 message(STATUS "applying unbound static build fix contrib/unbound_static.patch") - execute_process(COMMAND bash -c "git -C ${CMAKE_SOURCE_DIR}/monero/external/unbound apply ${CMAKE_SOURCE_DIR}/contrib/unbound_static.patch") + execute_process(COMMAND bash -c "git -C ${CMAKE_SOURCE_DIR}/external/wownero/external/unbound apply ${CMAKE_SOURCE_DIR}/contrib/unbound_static.patch") set(Boost_USE_STATIC_LIBS ON) set(Boost_USE_STATIC_RUNTIME ON) @@ -81,23 +94,49 @@ endfunction() find_package(Git) if(GIT_FOUND) - message(STATUS "Initializing submodules") - execute_process(COMMAND git "submodule" "update" "--init" "--recursive") - execute_process(COMMAND git rev-parse "HEAD" WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/monero OUTPUT_VARIABLE _WOWNERO_HEAD OUTPUT_STRIP_TRAILING_WHITESPACE) + # Update and initialize submodules + message("\n${BoldYellow}Initializing submodules...\n${ResetColor}") + if(APPLE) + execute_process(COMMAND git "submodule" "update" "--init" "--recursive" -- ${CMAKE_SOURCE_DIR}/external/KDMacTouchBar) + endif() + execute_process(COMMAND git "submodule" "update" "--init" "--recursive" -- ${CMAKE_SOURCE_DIR}/external/monero-seed) + execute_process(COMMAND git "submodule" "update" "--init" "--recursive" -- ${CMAKE_SOURCE_DIR}/external/wownero) + # Get submodule commit hashes + if(APPLE) + execute_process(COMMAND git rev-parse --short=10 "HEAD" WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/external/KDMacTouchBar OUTPUT_VARIABLE _TOUCH_BAR_HEAD OUTPUT_STRIP_TRAILING_WHITESPACE) + endif() + execute_process(COMMAND git rev-parse --short=10 "HEAD" WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/external/monero-seed OUTPUT_VARIABLE _MONERO_SEED_HEAD OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process(COMMAND git rev-parse --short=10 "HEAD" WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/external/wownero OUTPUT_VARIABLE _WOWNERO_HEAD OUTPUT_STRIP_TRAILING_WHITESPACE) + # Sanity check + if(APPLE AND NOT _TOUCH_BAR_HEAD STREQUAL TOUCH_BAR_HEAD) + message(FATAL_ERROR "[submodule] KDMacTouchBar HEAD was at ${_TOUCH_BAR_HEAD} but should be at ${TOUCH_BAR_HEAD}") + elseif(APPLE) + message("${BoldGreen}[submodule] KDMacTouchBar HEAD @ ${_TOUCH_BAR_HEAD}${ResetColor}") + add_subdirectory(external/KDMacTouchBar) + endif() + if(NOT _MONERO_SEED_HEAD STREQUAL MONERO_SEED_HEAD) + message(FATAL_ERROR "[submodule] monero-seed HEAD was at ${_MONERO_SEED} but should be at ${MONERO_SEED_HEAD}") + else() + message("${BoldGreen}[submodule] monero-seed HEAD @ ${_MONERO_SEED_HEAD}${ResetColor}") + endif() if(NOT _WOWNERO_HEAD STREQUAL WOWNERO_HEAD) - message(FATAL_ERROR "[submodule] Monero HEAD was at ${_WOWNERO_HEAD} but should be at ${WOWNERO_HEAD}") + message(FATAL_ERROR "[submodule] wownero HEAD was at ${_WOWNERO_HEAD} but should be at ${WOWNERO_HEAD}") else() - message(STATUS "[submodule] Monero HEAD @ ${WOWNERO_HEAD}") + message("${BoldGreen}[submodule] wownero HEAD @ ${WOWNERO_HEAD}${ResetColor}") endif() endif() -add_subdirectory(monero) -set_property(TARGET wallet_merged PROPERTY FOLDER "monero") -get_directory_property(ARCH_WIDTH DIRECTORY "monero" DEFINITION ARCH_WIDTH) -get_directory_property(UNBOUND_LIBRARY DIRECTORY "monero" DEFINITION UNBOUND_LIBRARY) +add_subdirectory(external/wownero) +add_subdirectory(external/monero-seed) +add_library(monero-seed::monero-seed ALIAS monero-seed) + +set_property(TARGET wallet_merged PROPERTY FOLDER "external/wownero") +get_directory_property(ARCH_WIDTH DIRECTORY "external/wownero" DEFINITION ARCH_WIDTH) +get_directory_property(UNBOUND_LIBRARY DIRECTORY "external/wownero" DEFINITION UNBOUND_LIBRARY) + include(CMakePackageConfigHelpers) -include(VersionMonero) +include(VersionWownero) include(VersionWowlet) include_directories(${EASYLOGGING_INCLUDE}) @@ -122,24 +161,6 @@ set(HIDAPI_FOUND OFF) # QrEncode find_package(QREncode REQUIRED) -# Tevador 14 word Monero seed -find_package(monero-seed CONFIG) -if(NOT monero-seed_FOUND) - if(FETCH_DEPS) - FetchContent_Declare(monero-seed - GIT_REPOSITORY https://git.wownero.com/wowlet/monero-seed.git) - FetchContent_GetProperties(monero-seed) - if(NOT monero-seed_POPULATED) - message(STATUS "Fetching monero-seed") - FetchContent_Populate(monero-seed) - add_subdirectory(${monero-seed_SOURCE_DIR} ${monero-seed_BINARY_DIR}) - endif() - add_library(monero-seed::monero-seed ALIAS monero-seed) - else() - message(FATAL_ERROR "monero-seed was not installed and fetching deps is disabled") - endif() -endif() - # Boost if(DEBUG) set(Boost_DEBUG ON) @@ -361,8 +382,4 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 ${C_SECURITY_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ${CXX_SECURITY_FLAGS}") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LD_SECURITY_FLAGS} ${STATIC_FLAGS}") -if(APPLE) - add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/contrib/KDMacTouchBar") -endif() - add_subdirectory(src) diff --git a/cmake/GenVersion.cmake b/cmake/GenVersion.cmake index 220a03a..987e0be 100644 --- a/cmake/GenVersion.cmake +++ b/cmake/GenVersion.cmake @@ -35,7 +35,7 @@ if(RET) message(WARNING "Cannot determine current commit. Make sure that you are building either from a Git working tree or from a source archive.") set(VERSIONTAG "unknown") set(VERSION_IS_RELEASE "false") - configure_file("monero/src/version.cpp.in" "${TO}") + configure_file("external/wownero/src/version.cpp.in" "${TO}") else() string(SUBSTRING ${COMMIT} 0 9 COMMIT) message(STATUS "You are currently on commit ${COMMIT}") @@ -61,5 +61,5 @@ else() set(VERSION_IS_RELEASE "false") endif() endif() - configure_file("monero/src/version.cpp.in" "${TO}") + configure_file("external/wownero/src/version.cpp.in" "${TO}") endif() \ No newline at end of file diff --git a/cmake/Version.cmake b/cmake/Version.cmake index 81857ff..d42fbf5 100644 --- a/cmake/Version.cmake +++ b/cmake/Version.cmake @@ -28,7 +28,7 @@ function (write_static_version_header hash) set(VERSIONTAG "${hash}") - configure_file("${CMAKE_SOURCE_DIR}/monero/src/version.cpp.in" "${CMAKE_BINARY_DIR}/version.cpp") + configure_file("${CMAKE_SOURCE_DIR}/external/wownero/src/version.cpp.in" "${CMAKE_BINARY_DIR}/version.cpp") endfunction () find_package(Git QUIET) diff --git a/cmake/VersionMonero.cmake b/cmake/VersionWownero.cmake similarity index 81% rename from cmake/VersionMonero.cmake rename to cmake/VersionWownero.cmake index 2ce459c..84d840a 100644 --- a/cmake/VersionMonero.cmake +++ b/cmake/VersionWownero.cmake @@ -4,13 +4,13 @@ find_package(Git QUIET) # Check what commit we're on execute_process(COMMAND "${GIT_EXECUTABLE}" rev-parse --short=9 HEAD RESULT_VARIABLE RET OUTPUT_VARIABLE COMMIT OUTPUT_STRIP_TRAILING_WHITESPACE - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/monero) + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/external/wownero) if(RET) # Something went wrong, set the version tag to -unknown message(WARNING "Cannot determine current commit. Make sure that you are building either from a Git working tree or from a source archive.") - set(MONERO_BRANCH "unknown") + set(WOWNERO_BRANCH "unknown") else() string(SUBSTRING ${COMMIT} 0 9 COMMIT) message(STATUS "You are currently on commit ${COMMIT}") @@ -20,30 +20,30 @@ else() if(NOT TAGGEDCOMMIT) message(STATUS "Cannot determine most recent tag. Make sure that you are building either from a Git working tree or from a source archive.") - set(MONERO_BRANCH "${COMMIT}") + set(WOWNERO_BRANCH "${COMMIT}") else() message(STATUS "The most recent tag was at ${TAGGEDCOMMIT}") # Check if we're building that tagged commit or a different one if(COMMIT STREQUAL TAGGEDCOMMIT) message(STATUS "You are building a tagged release") - set(MONERO_BRANCH "release") + set(WOWNERO_BRANCH "release") else() message(STATUS "You are ahead of or behind a tagged release") - set(MONERO_BRANCH "${COMMIT}") + set(WOWNERO_BRANCH "${COMMIT}") endif() endif() endif() # Check latest tagged release execute_process(COMMAND "${GIT_EXECUTABLE}" describe --abbrev=0 RESULT_VARIABLE RET OUTPUT_VARIABLE TAG OUTPUT_STRIP_TRAILING_WHITESPACE - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/monero) + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/external/wownero) if(RET) message(WARNING "Cannot determine most recent tag. Make sure that you are building either from a Git working tree or from a source archive.") - set(MONERO_VERSION "unknown") + set(WOWNERO_VERSION "unknown") else () - set(MONERO_VERSION "${TAG}") + set(WOWNERO_VERSION "${TAG}") endif() configure_file("cmake/config-wowlet.h.cmake" "${CMAKE_CURRENT_SOURCE_DIR}/src/config-wowlet.h") \ No newline at end of file diff --git a/cmake/config-wowlet.h.cmake b/cmake/config-wowlet.h.cmake index 1790145..661f2b4 100644 --- a/cmake/config-wowlet.h.cmake +++ b/cmake/config-wowlet.h.cmake @@ -4,8 +4,8 @@ #define WOWLET_VERSION "@VERSION@" #define WOWLET_BRANCH "@WOWLET_BRANCH@" -#define MONERO_VERSION "@MONERO_VERSION@" -#define MONERO_BRANCH "@MONERO_BRANCH@" +#define WOWNERO_VERSION "@WOWNERO_VERSION@" +#define WOWNERO_BRANCH "@WOWNERO_BRANCH@" #define TOR_VERSION "@TOR_VERSION@" diff --git a/contrib/KDMacTouchBar b/contrib/KDMacTouchBar deleted file mode 160000 index 470c431..0000000 --- a/contrib/KDMacTouchBar +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 470c4316460bb8c3e23bfa37c79c8621ef3f1b4c diff --git a/external/KDMacTouchBar b/external/KDMacTouchBar new file mode 160000 index 0000000..696bb21 --- /dev/null +++ b/external/KDMacTouchBar @@ -0,0 +1 @@ +Subproject commit 696bb2141cbc141023c8766f293c0ed6449a8f1f diff --git a/external/monero-seed b/external/monero-seed new file mode 160000 index 0000000..4674ef0 --- /dev/null +++ b/external/monero-seed @@ -0,0 +1 @@ +Subproject commit 4674ef09b6faa6fe602ab5ae0b9ca8e1fd7d5e1b diff --git a/monero b/external/wownero similarity index 100% rename from monero rename to external/wownero diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6f882f5..fd28ca1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -94,10 +94,10 @@ file(GLOB_RECURSE SRC_HEADERS *.h) target_include_directories(wowlet PUBLIC ${CMAKE_BINARY_DIR}/src/wowlet_autogen/include - ${CMAKE_SOURCE_DIR}/monero/include - ${CMAKE_SOURCE_DIR}/monero/src - ${CMAKE_SOURCE_DIR}/monero/external/easylogging++ - ${CMAKE_SOURCE_DIR}/monero/contrib/epee/include + ${CMAKE_SOURCE_DIR}/external/wownero/include + ${CMAKE_SOURCE_DIR}/external/wownero/src + ${CMAKE_SOURCE_DIR}/external/wownero/external/easylogging++ + ${CMAKE_SOURCE_DIR}/external/wownero/contrib/epee/include ${CMAKE_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/daemon @@ -165,7 +165,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}") if(UNIX AND NOT APPLE) # https://stackoverflow.com/questions/57766620/cmake-add-library-doesnt-initialize-static-global-variable - # so that contrib/monero-seed/src/gf_elem.cpp properly initializes. A better solution is welcome. + # so that external/monero-seed/src/gf_elem.cpp properly initializes. A better solution is welcome. target_link_libraries(wowlet -Wl,--whole-archive monero-seed::monero-seed -Wl,--no-whole-archive) else() target_link_libraries(wowlet monero-seed::monero-seed) @@ -202,7 +202,7 @@ if(APPLE) KDMacTouchBar ) target_include_directories(wowlet - PUBLIC ../contrib/KDMacTouchBar) + PUBLIC ../external/KDMacTouchBar) endif() if(NOT APPLE) diff --git a/src/dialog/debuginfodialog.cpp b/src/dialog/debuginfodialog.cpp index f1aeed0..a08fe25 100644 --- a/src/dialog/debuginfodialog.cpp +++ b/src/dialog/debuginfodialog.cpp @@ -41,7 +41,7 @@ void DebugInfoDialog::updateInfo() { torStatus = "Unknown"; ui->label_wowletVersion->setText(QString("%1-%2").arg(WOWLET_VERSION, WOWLET_BRANCH)); - ui->label_moneroVersion->setText(QString("%1-%2").arg(MONERO_VERSION, MONERO_BRANCH)); + ui->label_wowneroVersion->setText(QString("%1-%2").arg(WOWNERO_VERSION, WOWNERO_BRANCH)); ui->label_walletHeight->setText(QString::number(m_ctx->currentWallet->blockChainHeight())); ui->label_daemonHeight->setText(QString::number(m_ctx->currentWallet->daemonBlockChainHeight())); @@ -90,7 +90,7 @@ void DebugInfoDialog::copyToClipboad() { // Two spaces at the end of each line are for newlines in Markdown QString text = ""; text += QString("WOWlet version: %1 \n").arg(ui->label_wowletVersion->text()); - text += QString("Wownero version: %1 \n").arg(ui->label_moneroVersion->text()); + text += QString("Wownero version: %1 \n").arg(ui->label_wowneroVersion->text()); text += QString("Wallet height: %1 \n").arg(ui->label_walletHeight->text()); text += QString("Daemon height: %1 \n").arg(ui->label_daemonHeight->text()); diff --git a/src/dialog/debuginfodialog.ui b/src/dialog/debuginfodialog.ui index 73f7352..48c9881 100644 --- a/src/dialog/debuginfodialog.ui +++ b/src/dialog/debuginfodialog.ui @@ -41,7 +41,7 @@ - + TextLabel diff --git a/src/openpgp/CMakeLists.txt b/src/openpgp/CMakeLists.txt index 1c3f4ba..f13ca79 100644 --- a/src/openpgp/CMakeLists.txt +++ b/src/openpgp/CMakeLists.txt @@ -10,7 +10,7 @@ add_library(openpgp find_package(GCrypt) target_include_directories(openpgp PUBLIC - ${CMAKE_SOURCE_DIR}/monero/contrib/epee/include + ${CMAKE_SOURCE_DIR}/external/wownero/contrib/epee/include ${GCRYPT_INCLUDE_DIRS} )