summaryrefslogtreecommitdiff
path: root/repo/monero-gui
diff options
context:
space:
mode:
Diffstat (limited to 'repo/monero-gui')
-rw-r--r--repo/monero-gui/easylogging.patch11
-rw-r--r--repo/monero-gui/monero-gui.desktop15
-rw-r--r--repo/monero-gui/monero-gui.xibuild44
-rw-r--r--repo/monero-gui/system-miniupnpc.patch105
-rw-r--r--repo/monero-gui/version-string.patch13
5 files changed, 188 insertions, 0 deletions
diff --git a/repo/monero-gui/easylogging.patch b/repo/monero-gui/easylogging.patch
new file mode 100644
index 0000000..3cddc78
--- /dev/null
+++ b/repo/monero-gui/easylogging.patch
@@ -0,0 +1,11 @@
+--- a/external/easylogging++/easylogging++.h
++++ b/external/easylogging++/easylogging++.h
+@@ -221,7 +221,7 @@
+ # define ELPP_INTERNAL_INFO(lvl, msg)
+ #endif // (defined(ELPP_DEBUG_INFO))
+ #if (defined(ELPP_FEATURE_ALL)) || (defined(ELPP_FEATURE_CRASH_LOG))
+-# if (ELPP_COMPILER_GCC && !ELPP_MINGW && !ELPP_OS_OPENBSD && !ELPP_OS_NETBSD && !ELPP_OS_ANDROID && !ELPP_OS_EMSCRIPTEN)
++# if (__has_include(<execinfo.h>) && ELPP_COMPILER_GCC && !ELPP_MINGW && !ELPP_OS_OPENBSD && !ELPP_OS_NETBSD && !ELPP_OS_ANDROID && !ELPP_OS_EMSCRIPTEN)
+ # define ELPP_STACKTRACE 1
+ # else
+ # define ELPP_STACKTRACE 0
diff --git a/repo/monero-gui/monero-gui.desktop b/repo/monero-gui/monero-gui.desktop
new file mode 100644
index 0000000..4d951b4
--- /dev/null
+++ b/repo/monero-gui/monero-gui.desktop
@@ -0,0 +1,15 @@
+[Desktop Entry]
+Name=Monero GUI
+GenericName=Monero-GUI
+X-GNOME-FullName=Monero-GUI
+Comment=Monero GUI
+Keywords=Monero;
+Exec=monero-wallet-gui %u
+Terminal=false
+Type=Application
+Icon=monero-gui
+Categories=Network;GNOME;Qt;
+MimeType=x-scheme-handler/monero;x-scheme-handler/moneroseed
+StartupNotify=true
+X-GNOME-Bugzilla-Bugzilla=GNOME
+X-GNOME-UsesNotifications=true
diff --git a/repo/monero-gui/monero-gui.xibuild b/repo/monero-gui/monero-gui.xibuild
new file mode 100644
index 0000000..8cb1dd9
--- /dev/null
+++ b/repo/monero-gui/monero-gui.xibuild
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+NAME="monero-gui"
+DESC="QT GUI wallet for Monero: the secure, private, untraceable peer-to-peer currency"
+
+MAKEDEPS="cmake monero git qt5-qtquickcontrols2 qt5-qtdeclarative qt5-qtbase qt5-qtsvg libgpg-error"
+DEPS="musl "
+
+PKG_VER=musl
+SOURCE="https://github.com/monero-project/monero-gui"
+ADDITIONAL="
+easylogging.patch
+monero-gui.desktop
+monero-gui.xibuild
+system-miniupnpc.patch
+version-string.patch
+"
+
+prepare () {
+ git submodule update --init --force --recursive
+ cp *.patch monero/
+ cd monero
+ apply_patches
+ cd $BUILD_ROOT
+}
+
+build () {
+ cmake -B build \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DARCH=default \
+ -DWITH_DESKTOP_ENTRY=OFF \
+ -DSTACK_TRACE=OFF \
+ .
+ cmake --build build
+}
+
+package () {
+ install -Dm755 build/bin/monero-wallet-gui "${PKG_DEST}/usr/bin/monero-wallet-gui"
+
+ install -Dm644 monero-gui.desktop "${PKG_DEST}/usr/share/applications"
+ for x in 16 24 32 48 64 96 128 256; do
+ install -Dm644 "images/appicons/${x}x${x}.png" "${PKG_DEST}/usr/share/icons/hicolor/${x}x${x}/apps/monero-gui.png"
+ done
+}
diff --git a/repo/monero-gui/system-miniupnpc.patch b/repo/monero-gui/system-miniupnpc.patch
new file mode 100644
index 0000000..fc303fb
--- /dev/null
+++ b/repo/monero-gui/system-miniupnpc.patch
@@ -0,0 +1,105 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -547,6 +547,14 @@
+ include_directories("${CMAKE_CURRENT_BINARY_DIR}/translations")
+ add_subdirectory(external)
+
++# Final setup for miniupnpc
++if(UPNP_STATIC OR IOS)
++ add_definitions("-DUPNP_STATIC")
++else()
++ add_definitions("-DUPNP_DYNAMIC")
++ include_directories(${UPNP_INCLUDE})
++endif()
++
+ # Final setup for libunbound
+ include_directories(${UNBOUND_INCLUDE})
+ link_directories(${UNBOUND_LIBRARY_DIRS})
+diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl
+index 9b21705e..76340a22 100644
+--- a/src/p2p/net_node.inl
++++ b/src/p2p/net_node.inl
+@@ -61,9 +61,16 @@
+ #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>
++// We have to look for miniupnpc headers in different places, dependent on if its compiled or external
++#ifdef UPNP_STATIC
++ #include <miniupnp/miniupnpc/miniupnpc.h>
++ #include <miniupnp/miniupnpc/upnpcommands.h>
++ #include <miniupnp/miniupnpc/upnperrors.h>
++#else
++ #include "miniupnpc.h"
++ #include "upnpcommands.h"
++ #include "upnperrors.h"
++#endif
+
+ #undef MONERO_DEFAULT_LOG_CATEGORY
+ #define MONERO_DEFAULT_LOG_CATEGORY "net.p2p"
+--
+2.17.0
+
+--- a/external/CMakeLists.txt 2021-12-04 03:56:51.405517304 +0200
++++ b/external/CMakeLists.txt 2021-12-04 04:02:37.649484660 +0200
+@@ -34,24 +34,46 @@
+ # We always compile if we are building statically to reduce static dependency issues...
+ # ...except for FreeBSD, because FreeBSD is a special case that doesn't play well with
+ # others.
++if(NOT IOS)
++ find_package(Miniupnpc QUIET)
++endif()
+
+-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")
++# If we have the correct shared version and we're not building static, use it
++if(STATIC OR IOS)
++ set(USE_SHARED_MINIUPNPC false)
++elseif(MINIUPNP_FOUND AND MINIUPNPC_VERSION_1_7_OR_HIGHER)
++ set(USE_SHARED_MINIUPNPC true)
+ endif()
++
++
++if(USE_SHARED_MINIUPNPC)
++ message(STATUS "Using shared miniupnpc found at ${MINIUPNP_INCLUDE_DIR}")
++
++ set(UPNP_STATIC false PARENT_SCOPE)
++ set(UPNP_INCLUDE ${MINIUPNP_INCLUDE_DIR} PARENT_SCOPE)
++ set(UPNP_LIBRARIES ${MINIUPNP_LIBRARY} PARENT_SCOPE)
++else()
++ if(STATIC)
++ message(STATUS "Using miniupnpc from local source tree for static build")
++ else()
++ message(STATUS "Using miniupnpc from local source tree (/external/miniupnp/miniupnpc)")
++ endif()
++ add_subdirectory(miniupnp/miniupnpc)
++
++ set_property(TARGET libminiupnpc-static PROPERTY FOLDER "external")
++ 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)
++ set(UPNP_STATIC true PARENT_SCOPE)
++ set(UPNP_LIBRARIES "libminiupnpc-static" PARENT_SCOPE)
++endif()
+
+ find_package(Unbound)
+
diff --git a/repo/monero-gui/version-string.patch b/repo/monero-gui/version-string.patch
new file mode 100644
index 0000000..f64be9d
--- /dev/null
+++ b/repo/monero-gui/version-string.patch
@@ -0,0 +1,13 @@
+diff --git a/cmake/Version.cmake b/cmake/Version.cmake
+index 3677e80..490de2c 100644
+--- a/cmake/Version.cmake
++++ b/cmake/Version.cmake
+@@ -32,7 +32,7 @@ function (write_static_version_header hash)
+ endfunction ()
+
+ find_package(Git QUIET)
+-if ("$Format:$" STREQUAL "")
++if ("$Format:$" STREQUAL "" OR NOT EXISTS .git)
+ # We're in a tarball; use hard-coded variables.
+ set(VERSION_IS_RELEASE "true")
+ write_version("release")