Merge pull request #121488 from rnhmjoj/monero

quirc: 2016-08-16 -> 2020-04-06;  monero: 0.17.1.9 -> 0.17.2.0; monero-gui: 0.17.1.9 -> 0.17.2.1
This commit is contained in:
Michele Guerini Rocco
2021-05-02 13:53:40 +02:00
committed by GitHub
4 changed files with 77 additions and 42 deletions
@@ -17,22 +17,15 @@
with lib;
let
arch = if stdenv.isx86_64 then "x86-64"
else if stdenv.isi686 then "i686"
else if stdenv.isAarch64 then "armv8-a"
else throw "unsupported architecture";
in
stdenv.mkDerivation rec {
pname = "monero-gui";
version = "0.17.1.9";
version = "0.17.2.1";
src = fetchFromGitHub {
owner = "monero-project";
repo = "monero-gui";
rev = "v${version}";
sha256 = "0143mmxk0jfb5pmjlx6v0knvf8v49kmkpjxlp6rw8lwnlf71xadn";
sha256 = "1apjvpvn6hg0k0ak6wpg4prcdcslnb6fqhzzg2p4iy846f0ai9ji";
};
nativeBuildInputs = [
@@ -58,7 +51,10 @@ stdenv.mkDerivation rec {
chmod -R +w source/monero
'';
patches = [ ./move-log-file.patch ];
patches = [
./move-log-file.patch
./use-system-libquirc.patch
];
postPatch = ''
# set monero-gui version
@@ -69,17 +65,15 @@ stdenv.mkDerivation rec {
substituteInPlace src/daemon/DaemonManager.cpp \
--replace 'QApplication::applicationDirPath() + "' '"${monero}/bin'
# only build external deps, *not* the full monero
# 1: only build external deps, *not* the full monero
# 2: use nixpkgs libraries
substituteInPlace CMakeLists.txt \
--replace 'add_subdirectory(monero)' \
'add_subdirectory(monero EXCLUDE_FROM_ALL)'
# use nixpkgs quirc
substituteInPlace CMakeLists.txt \
'add_subdirectory(monero EXCLUDE_FROM_ALL)' \
--replace 'add_subdirectory(external)' ""
'';
cmakeFlags = [ "-DARCH=${arch}" ];
cmakeFlags = [ "-DARCH=default" ];
desktopItem = makeDesktopItem {
name = "monero-wallet-gui";
@@ -0,0 +1,37 @@
diff --git a/src/QR-Code-scanner/CMakeLists.txt b/src/QR-Code-scanner/CMakeLists.txt
index 15e288df..2e9b3305 100644
--- a/src/QR-Code-scanner/CMakeLists.txt
+++ b/src/QR-Code-scanner/CMakeLists.txt
@@ -1,11 +1,18 @@
+find_library(QUIRC_LIBRARY quirc REQUIRED)
+find_path(QUIRC_INCLUDE_DIR quirc.h REQUIRED)
+
add_library(qrdecoder STATIC
Decoder.cpp
)
+target_include_directories(qrdecoder
+ PUBLIC
+ ${QUIRC_INCLUDE_DIR}
+)
target_link_libraries(qrdecoder
PUBLIC
Qt5::Gui
PRIVATE
- quirc
+ ${QUIRC_LIBRARY}
)
if(WITH_SCANNER)
diff --git a/src/QR-Code-scanner/Decoder.cpp b/src/QR-Code-scanner/Decoder.cpp
index 1bb99140..353ca189 100644
--- a/src/QR-Code-scanner/Decoder.cpp
+++ b/src/QR-Code-scanner/Decoder.cpp
@@ -30,7 +30,7 @@
#include <limits>
-#include "quirc.h"
+#include <quirc.h>
QrDecoder::QrDecoder()
: m_qr(quirc_new())
@@ -17,13 +17,13 @@ assert trezorSupport -> all (x: x!=null) [ libusb1 protobuf python3 ];
stdenv.mkDerivation rec {
pname = "monero";
version = "0.17.1.9";
version = "0.17.2.0";
src = fetchFromGitHub {
owner = "monero-project";
repo = "monero";
rev = "v${version}";
sha256 = "0jqss4csvkcrhrmaa3vrnyv6yiwqpbfw7037clx9xcfm4qrrfiwy";
sha256 = "0jwlmrpzisvw1c06cvd5b3s3hd4w0pa1qmrypfwah67qj3x6hnb6";
fetchSubmodules = true;
};