mirror of
https://github.com/wownero/wowlet.git
synced 2026-10-29 04:08:43 +01:00
Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
69e1749856 | ||
|
|
e93488af9b | ||
|
|
a8861c62ea | ||
|
|
e6651d55ff | ||
|
|
9c58913ee2 |
+16
-69
@@ -5,9 +5,9 @@ message(STATUS "Initiating compile using CMake ${CMAKE_VERSION}")
|
||||
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
set(VERSION_MAJOR "4")
|
||||
set(VERSION_MINOR "0")
|
||||
set(VERSION_REVISION "0")
|
||||
set(VERSION "beta-7")
|
||||
set(VERSION_MINOR "1")
|
||||
set(VERSION_REVISION "1")
|
||||
set(VERSION "beta-8")
|
||||
|
||||
option(FETCH_DEPS "Download dependencies if they are not found" ON)
|
||||
option(OPENVR "Include OpenVR support")
|
||||
@@ -30,11 +30,6 @@ set(BUILD_GUI_DEPS ON)
|
||||
set(BUILD_64 ON CACHE BOOL "Build 64-bit binaries")
|
||||
set(INSTALL_VENDORED_LIBUNBOUND ${STATIC})
|
||||
set(USE_SINGLE_BUILDDIR ON)
|
||||
if(UNIX AND NOT APPLE)
|
||||
set(LINUX_ACTIVATION ON)
|
||||
else()
|
||||
set(LINUX_ACTIVATION OFF)
|
||||
endif()
|
||||
|
||||
# Are we in debug mode?
|
||||
set(_CMAKE_BUILD_TYPE "")
|
||||
@@ -101,9 +96,6 @@ include_directories(${EASYLOGGING_INCLUDE})
|
||||
link_directories(${EASYLOGGING_LIBRARY_DIRS})
|
||||
|
||||
# OpenSSL
|
||||
if(APPLE AND NOT OPENSSL_ROOT_DIR)
|
||||
execute_process(COMMAND brew --prefix openssl OUTPUT_VARIABLE OPENSSL_ROOT_DIR OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
endif()
|
||||
find_package(OpenSSL REQUIRED)
|
||||
message(STATUS "OpenSSL: Version ${OPENSSL_VERSION}")
|
||||
message(STATUS "OpenSSL: include dir at ${OPENSSL_INCLUDE_DIR}")
|
||||
@@ -129,20 +121,15 @@ find_package(wownero-seed CONFIG REQUIRED)
|
||||
if(DEBUG)
|
||||
set(Boost_DEBUG ON)
|
||||
endif()
|
||||
if(APPLE AND NOT BOOST_ROOT)
|
||||
execute_process(COMMAND brew --prefix boost OUTPUT_VARIABLE BOOST_ROOT OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
endif()
|
||||
|
||||
if(MINGW)
|
||||
set(Boost_THREADAPI win32)
|
||||
endif()
|
||||
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(UNIX AND NOT ANDROID)
|
||||
if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
# https://github.com/monero-project/monero-gui/issues/3142#issuecomment-705940446
|
||||
set(CMAKE_SKIP_RPATH ON)
|
||||
@@ -184,38 +171,17 @@ if(TOR_BIN)
|
||||
# on the buildbot(s) Tor is baked into the image
|
||||
# - linux: See `Dockerfile`
|
||||
# - windows: See `Dockerfile.windows`
|
||||
#
|
||||
# ## MacOS:
|
||||
# we assume the following files are already present in src/assets/exec:
|
||||
# - tor
|
||||
# - libevent-2.1.7.dylib
|
||||
# so copy them beforehand and set TOR_BIN to something random.
|
||||
if(NOT EXISTS "${TOR_BIN}")
|
||||
message(FATAL_ERROR "TOR_BIN is set, but file does not exist: '${TOR_BIN}'")
|
||||
endif()
|
||||
|
||||
# MacOS, check if required files are present
|
||||
if(APPLE)
|
||||
foreach(fn libevent-2.1.7.dylib tor)
|
||||
set(tor_path "${CMAKE_CURRENT_SOURCE_DIR}/src/assets/exec/${fn}")
|
||||
if (EXISTS "${tor_path}")
|
||||
message(STATUS "Tor found: ${tor_path}")
|
||||
else()
|
||||
message(FATAL_ERROR "TOR_BIN is set, so the following file needs to be present: '${tor_path}'")
|
||||
endif()
|
||||
set(TOR_BIN "${tor_path}")
|
||||
endforeach()
|
||||
else()
|
||||
if(NOT EXISTS "${TOR_BIN}")
|
||||
message(FATAL_ERROR "TOR_BIN is set, but file does not exist: '${TOR_BIN}'")
|
||||
endif()
|
||||
|
||||
# copy the Tor executable over
|
||||
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)
|
||||
if(ret EQUAL "1")
|
||||
message(FATAL_ERROR "Tor copy failure: ${TOR_COPY_CMD}")
|
||||
endif()
|
||||
# copy the Tor executable over
|
||||
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)
|
||||
if(ret EQUAL "1")
|
||||
message(FATAL_ERROR "Tor copy failure: ${TOR_COPY_CMD}")
|
||||
endif()
|
||||
|
||||
# get Tor version while we're at it
|
||||
@@ -260,8 +226,6 @@ if(MINGW)
|
||||
else()
|
||||
set(ICU_LIBRARIES icuio icuin icuuc icudt icutu iconv)
|
||||
endif()
|
||||
elseif(APPLE)
|
||||
set(EXTRA_LIBRARIES "-framework AppKit")
|
||||
elseif(OPENBSD)
|
||||
set(EXTRA_LIBRARIES "")
|
||||
elseif(FREEBSD)
|
||||
@@ -278,14 +242,6 @@ endif()
|
||||
|
||||
list(APPEND EXTRA_LIBRARIES ${CMAKE_DL_LIBS})
|
||||
|
||||
if(APPLE)
|
||||
include_directories(SYSTEM /usr/include/malloc)
|
||||
if(POLICY CMP0042)
|
||||
cmake_policy(SET CMP0042 NEW)
|
||||
endif()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=default -std=c++11 -DGTEST_HAS_TR1_TUPLE=0")
|
||||
endif()
|
||||
|
||||
# warnings
|
||||
# @TODO: enable these 2 for migration to Qt 6
|
||||
#add_c_flag_if_supported(-Werror C_SECURITY_FLAGS)
|
||||
@@ -320,12 +276,7 @@ if (NOT (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VER
|
||||
endif()
|
||||
|
||||
# linker
|
||||
if (APPLE)
|
||||
add_linker_flag_if_supported(-Wl,-bind_at_load LD_SECURITY_FLAGS)
|
||||
add_linker_flag_if_supported(-Wl,-dead_strip LD_SECURITY_FLAGS)
|
||||
add_linker_flag_if_supported(-Wl,-dead_strip_dylibs LD_SECURITY_FLAGS)
|
||||
endif()
|
||||
if (NOT APPLE AND NOT (WIN32 AND CMAKE_C_COMPILER_ID STREQUAL "GNU"))
|
||||
if (NOT (WIN32 AND CMAKE_C_COMPILER_ID STREQUAL "GNU"))
|
||||
# Windows binaries die on startup with PIE when compiled with GCC
|
||||
add_linker_flag_if_supported(-pie LD_SECURITY_FLAGS)
|
||||
endif()
|
||||
@@ -376,10 +327,6 @@ 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()
|
||||
|
||||
if(OPENVR)
|
||||
# Add contrib/openvr as library
|
||||
add_definitions(-DVR_API_PUBLIC)
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
# this image is used internally for the buildbot
|
||||
FROM ubuntu:20.04
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt clean && apt update
|
||||
RUN apt install -y git build-essential wget curl ngrep unzip file ssh zip
|
||||
|
||||
RUN cat /dev/zero | ssh-keygen -q -N ""
|
||||
|
||||
RUN cat ~/.ssh/id_rsa.pub
|
||||
|
||||
RUN printf "Host *\n StrictHostKeyChecking no" > ~/.ssh/config
|
||||
@@ -73,29 +73,3 @@ windows-mxe-debug: CMAKEFLAGS += -DCMAKE_BUILD_TYPE=Debug
|
||||
windows-mxe-debug:
|
||||
cmake -Bbuild $(CMAKEFLAGS)
|
||||
$(MAKE) -Cbuild
|
||||
|
||||
mac: CMAKEFLAGS += -DSTATIC=Off
|
||||
mac: CMAKEFLAGS += -DTOR_BIN=$(or ${TOR_BIN},OFF)
|
||||
mac: CMAKEFLAGS += -DBUILD_TAG="mac-x64"
|
||||
mac: CMAKEFLAGS += -DCMAKE_BUILD_TYPE=Release
|
||||
mac:
|
||||
cmake -Bbuild $(CMAKEFLAGS)
|
||||
$(MAKE) -Cbuild
|
||||
$(MAKE) -Cbuild deploy
|
||||
|
||||
# used for release, covers both intel and M1
|
||||
# 1) assumes a *static* BOOST has been compiled at BOOST_ROOT, see docs/BUILDING.md
|
||||
# 2) assumes a *static* Tor and libevent at src/assets/exec, see docs/BUILDING.md
|
||||
mac-release: CMAKEFLAGS += -DARCH=default
|
||||
mac-release: CMAKEFLAGS += -DCMAKE_OSX_ARCHITECTURES="x86_64"
|
||||
mac-release: CMAKEFLAGS += -DSTATIC=Off
|
||||
mac-release: CMAKEFLAGS += -DTOR_BIN="foo"
|
||||
mac-release: CMAKEFLAGS += -DBUILD_TAG="mac-x64"
|
||||
mac-release: CMAKEFLAGS += -DCMAKE_BUILD_TYPE=Release
|
||||
mac-release: CMAKEFLAGS += -DBoost_USE_STATIC_RUNTIME=ON
|
||||
mac-release: CMAKEFLAGS += -DBoost_USE_STATIC_LIBS=ON
|
||||
mac-release: CMAKEFLAGS += -DBOOST_ROOT=/Users/${USER}/build/boost
|
||||
mac-release:
|
||||
cmake -Bbuild $(CMAKEFLAGS)
|
||||
$(MAKE) -Cbuild
|
||||
$(MAKE) -Cbuild deploy
|
||||
|
||||
@@ -2,23 +2,4 @@ if(APPLE OR (WIN32 AND NOT STATIC))
|
||||
add_custom_target(deploy)
|
||||
get_target_property(_qmake_executable Qt5::qmake IMPORTED_LOCATION)
|
||||
get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY)
|
||||
|
||||
if(APPLE AND NOT IOS)
|
||||
find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${_qt_bin_dir}")
|
||||
add_custom_command(TARGET deploy
|
||||
POST_BUILD
|
||||
COMMAND "${MACDEPLOYQT_EXECUTABLE}" "$<TARGET_FILE_DIR:wowlet>/../.." -always-overwrite -qmldir="${CMAKE_SOURCE_DIR}"
|
||||
COMMENT "Running macdeployqt..."
|
||||
)
|
||||
|
||||
# workaround for a Qt bug that requires manually adding libqsvg.dylib to bundle
|
||||
find_file(_qt_svg_dylib "libqsvg.dylib" PATHS "${CMAKE_PREFIX_PATH}/plugins/imageformats" NO_DEFAULT_PATH)
|
||||
if(_qt_svg_dylib)
|
||||
add_custom_command(TARGET deploy
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${_qt_svg_dylib} $<TARGET_FILE_DIR:wowlet>/../PlugIns/imageformats/
|
||||
COMMENT "Copying libqsvg.dylib"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -69,123 +69,3 @@ docker run --rm -it -v $PWD:/wowlet -w /wowlet wowlet:win sh -c 'make windows ro
|
||||
If you're re-running a build make sure to `rm -rf build/` first.
|
||||
|
||||
The resulting binary can be found in `build/x86_64-w64-mingw32/release/bin/wowlet.exe`.
|
||||
|
||||
# Mac OS
|
||||
|
||||
## method 1 (easiest)
|
||||
|
||||
### 1. Get homebrew
|
||||
|
||||
Get [brew](https://brew.sh) to install the required dependencies.
|
||||
|
||||
```bash
|
||||
HOMEBREW_OPTFLAGS="-march=core2" HOMEBREW_OPTIMIZATION_LEVEL="O0" \
|
||||
brew install boost zmq openssl libpgm miniupnpc libsodium expat libunwind-headers protobuf libgcrypt qrencode ccache cmake pkgconfig git
|
||||
```
|
||||
|
||||
### 2. Compile WOWlet
|
||||
|
||||
```bash
|
||||
CMAKE_PREFIX_PATH=/usr/local/opt/qt5/ make -j4 mac
|
||||
```
|
||||
|
||||
The resulting Mac OS application can be found `build/bin/wowlet.app` and will **not** have Tor embedded.
|
||||
|
||||
Since WOWlet needs Tor, install it, start it, and start at Mac OS boot:
|
||||
```bash
|
||||
brew install tor
|
||||
brew services start tor
|
||||
```
|
||||
|
||||
## method 2 (advanced, intel/m1 release binaries)
|
||||
|
||||
This assumes you have homebrew installed with the packages defined in the previous step ("Get homebrew").
|
||||
|
||||
### 1. Get Qt
|
||||
|
||||
Install Qt `5.15.2` from [the open-source Qt installer](https://www.qt.io/download).
|
||||
|
||||
### 2. Get static Boost
|
||||
|
||||
We'll install boost under `/Users/$USER/build/boost/`
|
||||
|
||||
```bash
|
||||
mkdir -p "/Users/$USER/build/boost"
|
||||
|
||||
wget https://boostorg.jfrog.io/artifactory/main/release/1.73.0/source/boost_1_73_0.tar.gz && \
|
||||
echo "9995e192e68528793755692917f9eb6422f3052a53c5e13ba278a228af6c7acf boost_1_73_0.tar.gz" | sha256sum -c && \
|
||||
tar -xzf boost_1_73_0.tar.gz && \
|
||||
rm boost_1_73_0.tar.gz && \
|
||||
cd boost_1_73_0
|
||||
|
||||
./bootstrap.sh --without-icu
|
||||
./b2 --disable-icu --with-atomic --with-system --with-filesystem --with-thread \
|
||||
--with-date_time --with-chrono --with-regex --with-serialization \
|
||||
--with-program_options --with-locale variant=release link=static \
|
||||
runtime-link=static cxxflags='-std=c++11' install -a --prefix="/Users/$USER/build/boost/"
|
||||
```
|
||||
|
||||
### 3. Get static Tor
|
||||
|
||||
1. Download the official Tor Browser `.dmg`
|
||||
2. Steal `tor.real` and `libevent-2.1.7.dylib` from the `.dmg`
|
||||
3. Place them both in `src/assets/exec/`
|
||||
- `src/assets/exec/tor`
|
||||
- `src/assets/exec/libevent-2.1.7.dylib`
|
||||
|
||||
### 4. Get static Tor
|
||||
|
||||
```bash
|
||||
CMAKE_PREFIX_PATH=/Users/dsc/Qt5.15.2/5.15.2/clang_64 TOR_BIN="foo" make -j10 mac-release
|
||||
```
|
||||
|
||||
Resulting *static* Mac OS package: `build/bin/wowlet.app`
|
||||
|
||||
## method 3 (from source, WIP, does not work yet)
|
||||
|
||||
Download Qt `https://download.qt.io/archive/qt/5.15/5.15.3/single/`, unpack it somewhere.
|
||||
|
||||
Patch Qt 5.15.3 source.
|
||||
|
||||
- Context: [#1](https://github.com/microsoft/vcpkg/pull/21056) [#2](https://code.qt.io/cgit/qt/qtbase.git/diff/?id=dece6f5840463ae2ddf927d65eb1b3680e34a547)
|
||||
|
||||
```
|
||||
diff --git a/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h b/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h
|
||||
index 5d4b6d6a71..cc7193d8b7 100644
|
||||
--- a/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h
|
||||
+++ b/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h
|
||||
@@ -43,6 +43,7 @@
|
||||
#include <qpa/qplatformgraphicsbuffer.h>
|
||||
#include <private/qcore_mac_p.h>
|
||||
|
||||
+#include <CoreGraphics/CGColorSpace.h>
|
||||
#include <IOSurface/IOSurface.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
```
|
||||
|
||||
Build Qt:
|
||||
|
||||
```bash
|
||||
./configure -prefix $PWD/qtbase -release -opensource -confirm-license -ccache \
|
||||
-no-dbus -no-sql-sqlite -no-use-gold-linker -no-kms \
|
||||
-qt-harfbuzz -qt-libjpeg -qt-libpng -qt-pcre -qt-zlib \
|
||||
-skip qt3d -skip qtandroidextras -skip qtcanvas3d -skip qtcharts -skip qtconnectivity -skip qtdatavis3d \
|
||||
-skip qtdoc -skip qtquickcontrols -skip qtquickcontrols2 -skip qtspeech -skip qtgamepad \
|
||||
-skip qtlocation -skip qtmacextras -skip qtnetworkauth -skip qtpurchasing -optimize-size \
|
||||
-skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qttools \
|
||||
-skip qtvirtualkeyboard -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebview \
|
||||
-skip qtwinextras -skip qtx11extras -skip gamepad -skip serialbus -skip location -skip webengine -skip qtdeclarative \
|
||||
-no-feature-cups -no-feature-ftp -no-feature-pdf -no-feature-animation -nomake examples -nomake tests -nomake tools
|
||||
|
||||
./configure -prefix $PWD/qtbase -release -nomake examples -nomake tests -skip qtwebchannel -skip qtpurchasing -skip webengine -skip qtwebview
|
||||
make -j 4
|
||||
```
|
||||
|
||||
Problem: QtQuick does not seem to be compiled, `Qt5QuickConfig.cmake` missing.
|
||||
|
||||
Build:
|
||||
|
||||
```bash
|
||||
CMAKE_PREFIX_PATH=/Users/$USER/Downloads/qt-everywhere-src-5.15.3/qtbase/ make -j4 mac
|
||||
```
|
||||
|
||||
@@ -33,13 +33,6 @@ libzmq3-dev libsodium-dev libhidapi-dev libnorm-dev libusb-1.0-0-dev libpgm-dev
|
||||
libprotobuf-dev protobuf-compiler libgcrypt20-dev libpng-dev
|
||||
```
|
||||
|
||||
## Mac OS
|
||||
|
||||
```bash
|
||||
brew install boost zmq openssl libpgm miniupnpc libsodium expat libunwind-headers \
|
||||
protobuf libgcrypt qrencode ccache cmake pkgconfig git
|
||||
```
|
||||
|
||||
## CMake
|
||||
|
||||
After installing Qt you might have a folder called `/home/$USER/Qt/`. You need to pass this to CMake
|
||||
@@ -87,13 +80,6 @@ apt install -y tor
|
||||
sudo service tor start
|
||||
```
|
||||
|
||||
#### Mac OS
|
||||
|
||||
```bash
|
||||
brew install tor
|
||||
brew services start tor
|
||||
```
|
||||
|
||||
To skip the wizards and open a wallet directly use `--wallet-file`:
|
||||
|
||||
```bash
|
||||
|
||||
+9
-28
@@ -70,11 +70,7 @@ endif()
|
||||
qt5_add_resources(RESOURCES assets.qrc)
|
||||
|
||||
if(TOR_BIN)
|
||||
if(APPLE)
|
||||
set(ASSETS_TOR "assets_tor_macos.qrc")
|
||||
else()
|
||||
set(ASSETS_TOR "assets_tor.qrc")
|
||||
endif()
|
||||
set(ASSETS_TOR "assets_tor.qrc")
|
||||
endif()
|
||||
|
||||
set(EXECUTABLE_FLAG)
|
||||
@@ -222,12 +218,10 @@ target_compile_definitions(wowlet
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
if(UNIX)
|
||||
# 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.
|
||||
target_link_libraries(wowlet PUBLIC -Wl,--whole-archive wownero-seed::wownero-seed -Wl,--no-whole-archive)
|
||||
else()
|
||||
target_link_libraries(wowlet PUBLIC wownero-seed::wownero-seed)
|
||||
endif()
|
||||
|
||||
if(ANDROID)
|
||||
@@ -246,7 +240,8 @@ target_link_libraries(wowlet PUBLIC
|
||||
${OPENSSL_LIBRARIES}
|
||||
${CMAKE_DL_LIBS}
|
||||
${Iconv_LIBRARIES}
|
||||
/usr/local/lib/libunbound.a
|
||||
${UNBOUND_LIBRARIES}
|
||||
# /usr/local/lib/libunbound.a
|
||||
${EXTRA_LIBRARIES})
|
||||
|
||||
# Link Qt libraries
|
||||
@@ -331,26 +326,16 @@ if(OPENVR)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
target_link_libraries(wowlet PUBLIC
|
||||
KDMacTouchBar
|
||||
)
|
||||
target_include_directories(wowlet
|
||||
PUBLIC ../contrib/KDMacTouchBar)
|
||||
endif()
|
||||
|
||||
if(NOT APPLE)
|
||||
target_link_libraries(wowlet PUBLIC
|
||||
Qt5::QSvgIconPlugin
|
||||
Qt5::QSvgPlugin
|
||||
)
|
||||
endif()
|
||||
target_link_libraries(wowlet PUBLIC
|
||||
Qt5::QSvgIconPlugin
|
||||
Qt5::QSvgPlugin
|
||||
)
|
||||
|
||||
if(STATIC)
|
||||
target_link_libraries(wowlet PUBLIC
|
||||
Qt5::QSvgIconPlugin
|
||||
Qt5::QSvgPlugin)
|
||||
if(UNIX AND NOT APPLE)
|
||||
if(UNIX)
|
||||
target_link_libraries(wowlet PUBLIC
|
||||
Qt5::QXcbIntegrationPlugin)
|
||||
endif()
|
||||
@@ -360,10 +345,6 @@ if(X11_FOUND)
|
||||
target_link_libraries(wowlet PUBLIC ${X11_LIBRARIES})
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
include(Deploy)
|
||||
endif()
|
||||
|
||||
install(TARGETS wowlet
|
||||
DESTINATION ${CMAKE_INSTALL_PREFIX}
|
||||
)
|
||||
|
||||
+3
-3
@@ -554,10 +554,10 @@ void AppContext::onWSForum(const QJsonArray& forum_data) {
|
||||
for (auto &&entry: forum_data) {
|
||||
auto obj = entry.toObject();
|
||||
auto forumPost = new ForumPost(
|
||||
obj.value("title").toString(),
|
||||
obj.value("author").toString(),
|
||||
obj.value("thread").toString(),
|
||||
obj.value("member_name").toString(),
|
||||
obj.value("permalink").toString(),
|
||||
obj.value("comments").toInt());
|
||||
obj.value("member_name").toString());
|
||||
QSharedPointer<ForumPost> r = QSharedPointer<ForumPost>(forumPost);
|
||||
l.append(r);
|
||||
}
|
||||
|
||||
+1
-1
@@ -67,7 +67,7 @@ public:
|
||||
QString tmpTxDescription;
|
||||
|
||||
// https://git.wownero.com/wowlet/wowlet-backend/
|
||||
QString backendHost = "6wku2m4zrv6j666crlo7lzofv6ud6enzllyhou3ijeigpukymi37caad.onion";
|
||||
QString backendHost = "l3hkasj5nnrh24yzj4acj5dgqlscq56o5xjvvqsftj55fkonqly5aiid.onion";
|
||||
unsigned int backendPort = 80;
|
||||
bool backendTLS = false;
|
||||
QString backendWSUrl;
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#include "globals.h"
|
||||
#include "config-wowlet.h"
|
||||
#include "utils/ColorScheme.h"
|
||||
#include "utils/activate_linux.h"
|
||||
|
||||
// libwalletqt
|
||||
#include "libwalletqt/AddressBook.h"
|
||||
@@ -361,13 +360,6 @@ MainWindow::MainWindow(AppContext *ctx, QWidget *parent) :
|
||||
m_touchbarWizardItems = {m_touchbarActionWelcome};
|
||||
#endif
|
||||
|
||||
#ifdef LINUX_ACTIVATION
|
||||
// Linux activation kek
|
||||
auto activatedSerial = config()->get(Config::LinuxActivated).toString();
|
||||
if(activatedSerial.isEmpty())
|
||||
LinuxActivator::start();
|
||||
#endif
|
||||
|
||||
// setup some UI
|
||||
this->initMain();
|
||||
this->initWidgets();
|
||||
|
||||
@@ -56,15 +56,15 @@ QVariant ForumModel::data(const QModelIndex &index, int role) const
|
||||
return post->title;
|
||||
case Author:
|
||||
return post->author;
|
||||
case Comments:
|
||||
return QString::number(post->comments);
|
||||
case DateAdded:
|
||||
return post->date_added;
|
||||
default:
|
||||
return QVariant();
|
||||
}
|
||||
}
|
||||
else if (role == Qt::TextAlignmentRole) {
|
||||
switch(index.column()) {
|
||||
case Comments:
|
||||
case DateAdded:
|
||||
return Qt::AlignRight;
|
||||
default:
|
||||
return QVariant();
|
||||
@@ -85,8 +85,8 @@ QVariant ForumModel::headerData(int section, Qt::Orientation orientation, int ro
|
||||
return QString("Forum Post");
|
||||
case Author:
|
||||
return QString("Author");
|
||||
case Comments:
|
||||
return QString("Comments");
|
||||
case DateAdded:
|
||||
return QString("Date");
|
||||
default:
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ public:
|
||||
{
|
||||
Title = 0,
|
||||
Author,
|
||||
Comments,
|
||||
DateAdded,
|
||||
COUNT
|
||||
};
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#include "ui_settings.h"
|
||||
|
||||
#include "mainwindow.h"
|
||||
#include "utils/activate_linux.h"
|
||||
|
||||
#include <QFileDialog>
|
||||
#include <QMessageBox>
|
||||
@@ -86,41 +85,6 @@ Settings::Settings(QWidget *parent) :
|
||||
ui->lineEdit_defaultWalletDir->setText(m_ctx->defaultWalletDir);
|
||||
});
|
||||
|
||||
#ifdef LINUX_ACTIVATION
|
||||
// Setup activation tab
|
||||
auto activatedSerial = config()->get(Config::LinuxActivated).toString();
|
||||
if(!activatedSerial.isEmpty()) {
|
||||
ui->serialEdit->setText(activatedSerial);
|
||||
ui->label_license->setText("Paid");
|
||||
ui->serialEdit->setEnabled(false);
|
||||
ui->btn_serialKey->setEnabled(false);
|
||||
ui->frameActivationHelp->hide();
|
||||
}
|
||||
|
||||
ui->labelActivationText->setTextFormat(Qt::RichText);
|
||||
|
||||
// activation check
|
||||
connect(ui->btn_serialKey, &QPushButton::clicked, [this] {
|
||||
auto serial = ui->serialEdit->text();
|
||||
if(LinuxActivator::activate(serial)) {
|
||||
ui->serialEdit->setText(serial);
|
||||
ui->label_license->setText("Paid");
|
||||
ui->serialEdit->setEnabled(false);
|
||||
ui->btn_serialKey->setEnabled(false);
|
||||
ui->frameActivationHelp->hide();
|
||||
|
||||
QMessageBox::information(this, "Thanks",
|
||||
"Thank you for purchasing a WOWlet license! The funds "
|
||||
"will go straight into our coke & hookers fund. \n\n"
|
||||
"Restart WOWlet to get rid of the watermark in the "
|
||||
"bottom right corner.");
|
||||
} else {
|
||||
QMessageBox::warning(this, "Warning", "Bad serial!");
|
||||
}
|
||||
});
|
||||
#else
|
||||
ui->tabWidget->setTabVisible(5, false);
|
||||
#endif
|
||||
this->adjustSize();
|
||||
}
|
||||
|
||||
|
||||
+3
-130
@@ -17,7 +17,7 @@
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
<number>5</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab_general">
|
||||
<attribute name="title">
|
||||
@@ -141,12 +141,12 @@
|
||||
<widget class="QComboBox" name="comboBox_blockExplorer">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>muchwow.lol</string>
|
||||
<string>explore.wownero.com</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>explorer.suchwow.xyz</string>
|
||||
<string>muchwow.lol</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
@@ -558,133 +558,6 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab">
|
||||
<attribute name="title">
|
||||
<string>Activation</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<widget class="QFrame" name="frameActivationHelp">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="labelActivationText">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p>Please support the development team by upgrading to a paid WOWlet subscription. </p><p>You will get access to: the dankest memes, a better built-in miner, faster startup times, and embarrassing pictures of jwinterm!</p><p>Side-note: <a href="https://forum.wownero.com/t/free-wowlet-license-keys/1294"><span style=" text-decoration: underline; color:#0000ff;">we condone the piracy of licenses</span></a></p><p>Thanks in advance.</p></body></html></string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::TextBrowserInteraction</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>10</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout_3">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string>Subscription License:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="label_license">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Skint</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="serialEdit"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="text">
|
||||
<string>Serial key:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QPushButton" name="btn_serialKey">
|
||||
<property name="text">
|
||||
<string>Submit serial key</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
|
||||
@@ -1,176 +0,0 @@
|
||||
#ifdef LINUX_ACTIVATION
|
||||
|
||||
#include <QObject>
|
||||
#include <QApplication>
|
||||
#include <QPixmap>
|
||||
#include <QMessageBox>
|
||||
#include <QDesktopServices>
|
||||
#include <QDesktopWidget>
|
||||
#include <QCoreApplication>
|
||||
#include <QSystemTrayIcon>
|
||||
#include <QMessageBox>
|
||||
#include <QGroupBox>
|
||||
#include <QFileDialog>
|
||||
|
||||
#include <thread>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/X.h>
|
||||
#include <X11/extensions/shape.h>
|
||||
#include <X11/extensions/Xfixes.h>
|
||||
|
||||
#include <cairo.h>
|
||||
#include <cairo-xlib.h>
|
||||
|
||||
#include "activate_linux.h"
|
||||
#include "utils/config.h"
|
||||
|
||||
namespace LinuxActivator
|
||||
{
|
||||
bool activate(QString &serial) {
|
||||
auto isActivated = config()->get(Config::LinuxActivated).toString();
|
||||
if(!isActivated.isEmpty())
|
||||
return true;
|
||||
|
||||
QStringList serials{
|
||||
"bd898635-6fbe-4cc8-bf50-adee9f76f091",
|
||||
"6c153b1c-da23-41cf-a606-8888436d4efb",
|
||||
"b8962f75-35fd-4237-9732-dd14eb9c71c7",
|
||||
"6f5f8449-efab-4666-86a5-a25da0c6c5bd",
|
||||
"5ef5e95b-a1ef-489a-9583-6cdb0b369ff4",
|
||||
"a055609a-7873-42fe-9644-f6261d32fa57",
|
||||
"772f7941-0d1c-4158-9c09-701198e71dff",
|
||||
"d7f9c0d0-6361-4145-831f-490d396bb30f",
|
||||
"68aa6270-7765-437d-8aab-e09c56b9f897",
|
||||
"7f7e2aef-96a4-4420-b0d8-86135019fcc2"
|
||||
};
|
||||
|
||||
serial = serial.trimmed();
|
||||
if(serials.contains(serial)) {
|
||||
config()->set(Config::LinuxActivated, serial);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// fire & forget
|
||||
void start() {
|
||||
QRect rec = QApplication::desktop()->screenGeometry();
|
||||
std::thread([rec](){
|
||||
const short height = rec.height();
|
||||
const short width = rec.width();
|
||||
LinuxActivator::show(width, height);
|
||||
}).detach();
|
||||
}
|
||||
|
||||
// draw text
|
||||
void draw(cairo_t *cr, const char *title, const char *subtitle, float scale) {
|
||||
//set color
|
||||
cairo_set_source_rgba(cr, 1.0, 1.0, 1.0, 0.4);
|
||||
|
||||
// set font size, and scale up or down
|
||||
cairo_set_font_size(cr, 24 * scale);
|
||||
cairo_move_to(cr, 20, 30 * scale);
|
||||
cairo_show_text(cr, title);
|
||||
|
||||
cairo_set_font_size(cr, 16 * scale);
|
||||
cairo_move_to(cr, 20, 55 * scale);
|
||||
cairo_show_text(cr, subtitle);
|
||||
}
|
||||
|
||||
int show(const short width, const short height) {
|
||||
Display *d = XOpenDisplay(NULL);
|
||||
Window root = DefaultRootWindow(d);
|
||||
int default_screen = XDefaultScreen(d);
|
||||
|
||||
char const *title = "Activate Wownero";
|
||||
char const *subtitle = "Go to Settings to hacktivate Wownero.";
|
||||
|
||||
// default scale
|
||||
float scale = 1.0f;
|
||||
if(width >= 2560) {
|
||||
scale = 1.2f;
|
||||
} else if(width >= 3440) {
|
||||
scale = 1.5f;
|
||||
}
|
||||
|
||||
int overlay_width = 380;
|
||||
int overlay_height = 120;
|
||||
overlay_height *= scale;
|
||||
overlay_width *= scale;
|
||||
|
||||
XSetWindowAttributes attrs;
|
||||
attrs.override_redirect = 1;
|
||||
|
||||
XVisualInfo vinfo;
|
||||
int colorDepth = 32;
|
||||
|
||||
if (!XMatchVisualInfo(d, default_screen, colorDepth, TrueColor, &vinfo)) {
|
||||
printf("Activate linux: no visual found supporting 32 bit color, terminating\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
// sets 32 bit color depth
|
||||
attrs.colormap = XCreateColormap(d, root, vinfo.visual, AllocNone);
|
||||
attrs.background_pixel = 0;
|
||||
attrs.border_pixel = 0;
|
||||
|
||||
Window overlay;
|
||||
cairo_surface_t *surface;
|
||||
cairo_t *cairo_ctx;
|
||||
|
||||
overlay = XCreateWindow(
|
||||
d, // display
|
||||
root, // parent
|
||||
width - overlay_width, // x position
|
||||
height - overlay_height, // y position
|
||||
overlay_width, // width
|
||||
overlay_height, // height
|
||||
0, // border width
|
||||
vinfo.depth, // depth
|
||||
InputOutput, // class
|
||||
vinfo.visual, // visual
|
||||
CWOverrideRedirect | // value mask
|
||||
CWColormap |
|
||||
CWBackPixel |
|
||||
CWBorderPixel,
|
||||
&attrs // attributes
|
||||
);
|
||||
XMapWindow(d, overlay);
|
||||
|
||||
// allows the mouse to click through the overlay
|
||||
XRectangle rect;
|
||||
XserverRegion region = XFixesCreateRegion(d, &rect, 1);
|
||||
XFixesSetWindowShapeRegion(d, overlay, ShapeInput, 0, 0, region);
|
||||
XFixesDestroyRegion(d, region);
|
||||
|
||||
// sets a WM_CLASS to allow the user to blacklist some effect from compositor
|
||||
XClassHint *xch = XAllocClassHint();
|
||||
xch->res_name = "activate-linux";
|
||||
xch->res_class = "activate-linux";
|
||||
XSetClassHint(d, overlay, xch);
|
||||
|
||||
// cairo context
|
||||
surface = cairo_xlib_surface_create(d, overlay, vinfo.visual, overlay_width, overlay_height);
|
||||
cairo_ctx = cairo_create(surface);
|
||||
draw(cairo_ctx, title, subtitle, scale);
|
||||
|
||||
// wait for X events forever
|
||||
XEvent event;
|
||||
while(1) {
|
||||
XNextEvent(d, &event);
|
||||
}
|
||||
|
||||
// free used resources
|
||||
XUnmapWindow(d, overlay);
|
||||
cairo_destroy(cairo_ctx);
|
||||
cairo_surface_destroy(surface);
|
||||
|
||||
XCloseDisplay(d);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,16 +0,0 @@
|
||||
#ifndef ACTIVATE_LINUX_H
|
||||
#define ACTIVATE_LINUX_H
|
||||
|
||||
#ifdef LINUX_ACTIVATION
|
||||
#include <cairo.h>
|
||||
#include <cairo-xlib.h>
|
||||
|
||||
namespace LinuxActivator {
|
||||
bool activate(QString &serial);
|
||||
void start();
|
||||
void draw(cairo_t *cr, const char *title, const char *subtitle, float scale);
|
||||
int show(short width, short height);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // ACTIVATE_LINUX_H
|
||||
@@ -26,7 +26,7 @@ static const QHash<Config::ConfigKey, ConfigDirective> configStrings = {
|
||||
{Config::openVRSkin,{QS("openVRSkin"), "default"}},
|
||||
{Config::openVRStreamerMode,{QS("openVRStreamerMode"), false}},
|
||||
{Config::preferredFiatCurrency,{QS("preferredFiatCurrency"), "USD"}},
|
||||
{Config::blockExplorer,{QS("blockExplorer"), "explorer.suchwow.xyz"}},
|
||||
{Config::blockExplorer,{QS("blockExplorer"), "muchwow.lol"}},
|
||||
{Config::walletDirectory,{QS("walletDirectory"), ""}},
|
||||
{Config::autoOpenWalletPath,{QS("autoOpenWalletPath"), ""}},
|
||||
{Config::walletPath,{QS("walletPath"), ""}},
|
||||
|
||||
+3
-3
@@ -240,10 +240,10 @@ QString Utils::copyFromClipboard() {
|
||||
|
||||
QString Utils::blockExplorerLink(const QString &txid) {
|
||||
auto explorer = config()->get(Config::blockExplorer).toString();
|
||||
if(explorer.startsWith("explorer.suchwow.xyz")) {
|
||||
return QString("https://explorer.suchwow.xyz/tx/%1").arg(txid);
|
||||
} else {
|
||||
if(explorer.startsWith("muchwow.lol")) {
|
||||
return QString("https://muchwow.lol/tx?id=%1").arg(txid);
|
||||
} else {
|
||||
return QString("https://explore.wownero.com/tx/%1").arg(txid);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
#include <QString>
|
||||
|
||||
struct ForumPost {
|
||||
ForumPost(const QString &title, const QString &author, const QString &permalink, int comments)
|
||||
: title(title), author(author), permalink(permalink), comments(comments){};
|
||||
ForumPost(const QString &title, const QString &author, const QString &permalink, const QString date_added)
|
||||
: title(title), author(author), permalink(permalink), date_added(date_added){};
|
||||
|
||||
QString title;
|
||||
QString author;
|
||||
QString permalink;
|
||||
int comments;
|
||||
QString date_added;
|
||||
};
|
||||
|
||||
#endif //WOWLET_FORUMPOST_H
|
||||
|
||||
Reference in New Issue
Block a user