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
commit d5fe3a1270
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 77 additions and 42 deletions

View file

@ -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";

View file

@ -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())

View file

@ -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;
};

View file

@ -1,36 +1,40 @@
{lib, stdenv, fetchgit, SDL_gfx, SDL, libjpeg, libpng, pkg-config}:
let
s =
rec {
date = "2016-08-16";
version = "git-${date}";
baseName = "quirc";
name = "${baseName}-${version}";
url = "https://github.com/dlbeer/quirc";
rev = "5b262480091d5f84a67a4a56c728fc8b39844339";
sha256 = "1w5qvjafn14s6jjs7kiwsqirlsqbgv0p152hrsq463pm34hp0lzy";
};
in
{ lib, stdenv, fetchFromGitHub
, SDL_gfx, SDL, libjpeg, libpng, pkg-config
}:
stdenv.mkDerivation {
inherit (s) name version;
nativeBuildInputs = [ pkg-config ];
buildInputs = [
SDL SDL_gfx libjpeg libpng
];
src = fetchgit {
inherit (s) url sha256 rev;
pname = "quirc";
version = "2020-04-16";
src = fetchFromGitHub {
owner = "dlbeer";
repo = "quirc";
rev = "ed455904f35270888bc902b9e8c0c9b3184a8302";
sha256 = "1kqqvcnxcaxdgls9sibw5pqjz3g1gys2v64i4kfqp8wfcgd9771q";
};
NIX_CFLAGS_COMPILE="-I${SDL.dev}/include/SDL -I${SDL_gfx}/include/SDL";
nativeBuildInputs = [ pkg-config ];
buildInputs = [ SDL SDL_gfx libjpeg libpng ];
makeFlags = [ "PREFIX=$(out)" ];
NIX_CFLAGS_COMPILE = "-I${SDL.dev}/include/SDL -I${SDL_gfx}/include/SDL";
configurePhase = ''
runHook preConfigure
# don't try to change ownership
sed -e 's/-[og] root//g' -i Makefile
runHook postConfigure
'';
preInstall = ''
mkdir -p "$out"/{bin,lib,include}
find . -maxdepth 1 -type f -perm -0100 -exec cp '{}' "$out"/bin ';'
# install all binaries
find -maxdepth 1 -type f -executable ! -name '*.so.*' | xargs cp -t "$out"/bin
'';
makeFlags = [ "PREFIX=$(out)" ];
meta = {
inherit (s) version;
description = "A small QR code decoding library";
license = lib.licenses.isc;
maintainers = [lib.maintainers.raskin];