monero-{cli,gui}: 0.18.3.3 -> 0.18.3.4

Also:

  - Remove unnecessary dependencies

  - Fix trezor support

  - Format using nixfmt
This commit is contained in:
rnhmjoj 2024-09-09 02:41:40 +02:00
parent 70efff65e0
commit 473b09f778
No known key found for this signature in database
GPG Key ID: BFBAF4C975F76450
4 changed files with 212 additions and 100 deletions

View File

@ -1,9 +1,30 @@
{ lib, stdenv, fetchFromGitHub, fetchpatch2, cmake, ninja, pkg-config {
, boost, miniupnpc, openssl, unbound lib,
, zeromq, pcsclite, readline, libsodium, hidapi stdenv,
, randomx, rapidjson fetchFromGitHub,
, CoreData, IOKit, PCSC cmake,
, trezorSupport ? true, libusb1, protobuf, python3 ninja,
pkg-config,
boost,
libsodium,
miniupnpc,
openssl,
python3,
randomx,
rapidjson,
readline,
unbound,
zeromq,
# darwin
CoreData,
IOKit,
trezorSupport ? true,
hidapi,
libusb1,
protobuf_21,
udev,
}: }:
let let
@ -25,40 +46,16 @@ in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "monero-cli"; pname = "monero-cli";
version = "0.18.3.3"; version = "0.18.3.4";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "monero-project"; owner = "monero-project";
repo = "monero"; repo = "monero";
rev = "v${version}"; rev = "v${version}";
hash = "sha256-1LkKIrud317BEE+713t5wiJV6FcDlJdj4ypXPR0bKTs="; hash = "sha256-nDiFJjhsISYM8kTgJUaPYL44iyccnz5+Pd5beBh+lsM=";
}; };
patches = [ patches = [ ./use-system-libraries.patch ];
# cmake: remove unused/extera cmake/FindMiniupnpc.cmake and only rely on external/miniupnpc
# https://github.com/monero-project/monero/pull/9366
(fetchpatch2 {
url = "https://github.com/monero-project/monero/commit/5074a543a49f7e23fb39b6462fd4c4c9741c3693.patch?full_index=1";
hash = "sha256-dS2hhEU6m2of0ULlsf+/tZMHUmq3vGGXJPGHvtnpQnY=";
})
# cmake: add different parameters to add_monero_library.
# https://github.com/monero-project/monero/pull/9367
(fetchpatch2 {
url = "https://github.com/monero-project/monero/commit/b91ead90254ac6d6daf908f689c38e372a44c615.patch?full_index=1";
hash = "sha256-DL2YqkvEONbeEDqLOAo2eSF5JF5gOzKcLKeNlUXBY1w=";
})
# external: update miniupnpc to 2.2.8
# https://github.com/monero-project/monero/pull/9367
(fetchpatch2 {
url = "https://github.com/monero-project/monero/commit/d81da086ec5088a04b3f7b34831e72910300e2f7.patch?full_index=1";
hash = "sha256-ZJGiDMk5DMmEXwzoUYPC+DIoebluFh54kMQtQU78ckI=";
excludes = [ "external/miniupnp" ];
})
./use-system-libraries.patch
];
postPatch = '' postPatch = ''
# manually install submodules # manually install submodules
@ -69,31 +66,58 @@ stdenv.mkDerivation rec {
cp -r . $source cp -r . $source
''; '';
nativeBuildInputs = [ cmake ninja pkg-config ]; nativeBuildInputs = [
cmake
pkg-config
];
buildInputs = [ buildInputs =
boost miniupnpc openssl unbound [
zeromq pcsclite readline boost
libsodium hidapi randomx rapidjson libsodium
protobuf miniupnpc
] ++ lib.optionals stdenv.isDarwin [ IOKit CoreData PCSC ] openssl
++ lib.optionals trezorSupport [ libusb1 protobuf python3 ]; randomx
rapidjson
readline
unbound
zeromq
]
++ lib.optionals stdenv.isDarwin [
IOKit
CoreData
]
++ lib.optionals trezorSupport [
python3
hidapi
libusb1
protobuf_21
udev
];
cmakeFlags = [ cmakeFlags =
"-DUSE_DEVICE_TREZOR=ON" [
"-DBUILD_GUI_DEPS=ON" # skip submodules init
"-DReadline_ROOT_DIR=${readline.dev}" "-DMANUAL_SUBMODULES=ON"
"-DRandomX_ROOT_DIR=${randomx}" # required by monero-gui
] ++ lib.optional stdenv.isDarwin "-DBoost_USE_MULTITHREADED=OFF"; "-DBUILD_GUI_DEPS=ON"
"-DReadline_ROOT_DIR=${readline.dev}"
]
++ lib.optional stdenv.isDarwin "-DBoost_USE_MULTITHREADED=OFF"
++ lib.optional trezorSupport [
"-DUSE_DEVICE_TREZOR=ON"
# fix build on recent gcc versions
"-DCMAKE_CXX_FLAGS=-fpermissive"
];
outputs = [ "out" "source" ]; outputs = [ "out" "source" ];
meta = with lib; { meta = {
description = "Private, secure, untraceable currency"; description = "Private, secure, untraceable currency";
homepage = "https://getmonero.org/"; homepage = "https://getmonero.org/";
license = licenses.bsd3; license = lib.licenses.bsd3;
platforms = platforms.all; platforms = lib.platforms.all;
maintainers = with maintainers; [ rnhmjoj ]; maintainers = with lib.maintainers; [ rnhmjoj ];
mainProgram = "monero-wallet-cli"; mainProgram = "monero-wallet-cli";
}; };
} }

View File

@ -1,14 +1,15 @@
diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt
index f8b834ac17...520e148428 100644 index 5b7f69a56..cc4b0a346 100644
--- a/external/CMakeLists.txt --- a/external/CMakeLists.txt
+++ b/external/CMakeLists.txt +++ b/external/CMakeLists.txt
@@ -39,23 +39,12 @@ @@ -35,25 +35,14 @@
add_compile_options(-D_GNU_SOURCE) # ...except for FreeBSD, because FreeBSD is a special case that doesn't play well with
endif() # others.
-find_package(Miniupnpc REQUIRED)
-
-message(STATUS "Using in-tree miniupnpc") -message(STATUS "Using in-tree miniupnpc")
-set(UPNPC_NO_INSTALL TRUE CACHE BOOL "Disable miniupnp installation" FORCE) -set(UPNPC_NO_INSTALL TRUE CACHE BOOL "Disable miniupnp installation" FORCE)
-set(UPNPC_BUILD_TESTS FALSE CACHE BOOL "Disable miniupnp internal tests." FORCE)
-add_subdirectory(miniupnp/miniupnpc) -add_subdirectory(miniupnp/miniupnpc)
-set_property(TARGET libminiupnpc-static PROPERTY FOLDER "external") -set_property(TARGET libminiupnpc-static PROPERTY FOLDER "external")
-set_property(TARGET libminiupnpc-static PROPERTY POSITION_INDEPENDENT_CODE ON) -set_property(TARGET libminiupnpc-static PROPERTY POSITION_INDEPENDENT_CODE ON)
@ -20,19 +21,58 @@ index f8b834ac17...520e148428 100644
-if(CMAKE_SYSTEM_NAME MATCHES "NetBSD") -if(CMAKE_SYSTEM_NAME MATCHES "NetBSD")
- set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -D_NETBSD_SOURCE") - set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -D_NETBSD_SOURCE")
-endif() -endif()
+include(FindPkgConfig)
+pkg_check_modules(MINIUPNPC REQUIRED IMPORTED_TARGET GLOBAL miniupnpc)
+get_target_property(MINIUPNPC_INCLUDE_DIR PkgConfig::MINIUPNPC INTERFACE_INCLUDE_DIRECTORIES)
+set_target_properties(PkgConfig::MINIUPNPC PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${MINIUPNPC_INCLUDE_DIR}/miniupnpc")
+set(UPNP_LIBRARIES PkgConfig::MINIUPNPC PARENT_SCOPE)
-set(UPNP_LIBRARIES "libminiupnpc-static" PARENT_SCOPE)
- -
-set(UPNP_LIBRARIES "libminiupnpc-static" PARENT_SCOPE)
+find_package(PkgConfig REQUIRED)
+pkg_check_modules(MINIUPNPC REQUIRED miniupnpc)
+link_libraries(${MINIUPNPC_LIBRARIES})
+include_directories(${MINIUPNPC_INCLUDE_DIRS})
+find_package(RapidJSON)
find_package(Unbound) find_package(Unbound)
+find_library(RANDOMX_LIBRARY randomx)
if(NOT UNBOUND_INCLUDE_DIR) if(NOT UNBOUND_INCLUDE_DIR)
@@ -72,4 +61,3 @@ die("Could not find libunbound")
@@ -69,4 +58,3 @@ endif()
add_subdirectory(db_drivers) add_subdirectory(db_drivers)
add_subdirectory(easylogging++) add_subdirectory(easylogging++)
add_subdirectory(qrcodegen) add_subdirectory(qrcodegen)
-add_subdirectory(randomx EXCLUDE_FROM_ALL) -add_subdirectory(randomx EXCLUDE_FROM_ALL)
diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl
index 71f5393e8..bb48083d0 100644
--- a/src/p2p/net_node.inl
+++ b/src/p2p/net_node.inl
@@ -60,9 +60,9 @@
#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>
+#include <miniupnpc/miniupnpc.h>
+#include <miniupnpc/upnpcommands.h>
+#include <miniupnpc/upnperrors.h>
#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "net.p2p"
@@ -2989,7 +2989,8 @@ namespace nodetool
UPNPUrls urls;
IGDdatas igdData;
char lanAddress[64];
- result = UPNP_GetValidIGD(deviceList, &urls, &igdData, lanAddress, sizeof lanAddress);
+ char wanAddress[64];
+ result = UPNP_GetValidIGD(deviceList, &urls, &igdData, lanAddress, sizeof lanAddress, wanAddress, sizeof wanAddress);
freeUPNPDevlist(deviceList);
if (result > 0) {
if (result == 1) {
@@ -3057,7 +3058,8 @@ namespace nodetool
UPNPUrls urls;
IGDdatas igdData;
char lanAddress[64];
- result = UPNP_GetValidIGD(deviceList, &urls, &igdData, lanAddress, sizeof lanAddress);
+ char wanAddress[64];
+ result = UPNP_GetValidIGD(deviceList, &urls, &igdData, lanAddress, sizeof lanAddress, wanAddress, sizeof wanAddress);
freeUPNPDevlist(deviceList);
if (result > 0) {
if (result == 1) {

View File

@ -1,43 +1,86 @@
{ lib, stdenv, wrapQtAppsHook, makeDesktopItem {
, fetchFromGitHub lib,
, cmake, qttools, pkg-config fetchFromGitHub,
, qtbase, qtdeclarative, qtgraphicaleffects makeDesktopItem,
, qtmultimedia, qtxmlpatterns boost,
, qtquickcontrols, qtquickcontrols2 cmake,
, qtmacextras libgcrypt,
, monero-cli, miniupnpc, unbound, readline libgpg-error,
, boost, libunwind, libsodium, pcsclite libsodium,
, randomx, zeromq, libgcrypt, libgpg-error miniupnpc,
, hidapi, rapidjson, quirc monero-cli,
, trezorSupport ? true, libusb1, protobuf, python3 pkg-config,
qtbase,
qtdeclarative,
qtgraphicaleffects,
qtmacextras,
qtmultimedia,
qtquickcontrols,
qtquickcontrols2,
qttools,
qtxmlpatterns,
quirc,
randomx,
rapidjson,
stdenv,
unbound,
wrapQtAppsHook,
zeromq,
trezorSupport ? true,
hidapi,
libusb1,
protobuf_21,
python3,
udev,
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "monero-gui"; pname = "monero-gui";
version = "0.18.3.3"; version = "0.18.3.4";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "monero-project"; owner = "monero-project";
repo = "monero-gui"; repo = "monero-gui";
rev = "v${version}"; rev = "v${version}";
hash = "sha256-6qadBm4bPui11OVY1tLFcHsfswXWBFiJvutIsF6EfX8="; hash = "sha256-wnU24EmZig2W/psy4OhaQVy2WwR0CgljlyYwOg4bzwM=";
}; };
nativeBuildInputs = [ nativeBuildInputs = [
cmake pkg-config wrapQtAppsHook cmake
pkg-config
wrapQtAppsHook
(lib.getDev qttools) (lib.getDev qttools)
]; ];
buildInputs = [ buildInputs =
qtbase qtdeclarative qtgraphicaleffects [
qtmultimedia qtquickcontrols qtquickcontrols2 boost
qtxmlpatterns libgcrypt
monero-cli miniupnpc unbound readline libgpg-error
randomx libgcrypt libgpg-error libsodium
boost libunwind libsodium pcsclite miniupnpc
zeromq hidapi rapidjson quirc qtbase
] ++ lib.optionals trezorSupport [ libusb1 protobuf python3 ] qtdeclarative
++ lib.optionals stdenv.isDarwin [ qtmacextras ]; qtgraphicaleffects
qtmultimedia
qtquickcontrols
qtquickcontrols2
qtxmlpatterns
quirc
randomx
rapidjson
unbound
zeromq
]
++ lib.optionals stdenv.isDarwin [ qtmacextras ]
++ lib.optionals trezorSupport [
hidapi
libusb1
protobuf_21
python3
udev
];
postUnpack = '' postUnpack = ''
# copy monero sources here # copy monero sources here
@ -68,7 +111,12 @@ stdenv.mkDerivation rec {
--replace 'add_subdirectory(external)' "" --replace 'add_subdirectory(external)' ""
''; '';
cmakeFlags = [ "-DARCH=default" ]; cmakeFlags =
[ "-DARCH=default" ]
++ lib.optional trezorSupport [
# fix build on recent gcc versions
"-DCMAKE_CXX_FLAGS=-fpermissive"
];
desktopItem = makeDesktopItem { desktopItem = makeDesktopItem {
name = "monero-wallet-gui"; name = "monero-wallet-gui";
@ -76,7 +124,7 @@ stdenv.mkDerivation rec {
icon = "monero"; icon = "monero";
desktopName = "Monero"; desktopName = "Monero";
genericName = "Wallet"; genericName = "Wallet";
categories = [ "Network" "Utility" ]; categories = [ "Network" "Utility" ];
}; };
postInstall = '' postInstall = ''
@ -93,12 +141,12 @@ stdenv.mkDerivation rec {
done; done;
''; '';
meta = with lib; { meta = {
description = "Private, secure, untraceable currency"; description = "Private, secure, untraceable currency";
homepage = "https://getmonero.org/"; homepage = "https://getmonero.org/";
license = licenses.bsd3; license = lib.licenses.bsd3;
platforms = platforms.all; platforms = lib.platforms.all;
maintainers = with maintainers; [ rnhmjoj ]; maintainers = with lib.maintainers; [ rnhmjoj ];
mainProgram = "monero-wallet-gui"; mainProgram = "monero-wallet-gui";
}; };
} }

View File

@ -34949,7 +34949,7 @@ with pkgs;
lndmanage = callPackage ../applications/blockchains/lndmanage { }; lndmanage = callPackage ../applications/blockchains/lndmanage { };
monero-cli = callPackage ../applications/blockchains/monero-cli { monero-cli = callPackage ../applications/blockchains/monero-cli {
inherit (darwin.apple_sdk.frameworks) CoreData IOKit PCSC; inherit (darwin.apple_sdk.frameworks) CoreData IOKit;
}; };
haven-cli = callPackage ../applications/blockchains/haven-cli { haven-cli = callPackage ../applications/blockchains/haven-cli {