2024-02-29 20:09:43 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, cmake, pkg-config, wrapQtAppsHook, boost, libGL
|
2021-08-05 21:33:18 +00:00
|
|
|
, qtbase, python3 }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
|
|
|
pname = "nano-wallet";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "25.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "nanocurrency";
|
2021-03-23 19:22:30 +00:00
|
|
|
repo = "nano-node";
|
2020-04-24 23:36:52 +00:00
|
|
|
rev = "V${version}";
|
|
|
|
fetchSubmodules = true;
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-YvYEXHC8kxviZLQwINs+pS61wITSfqfrrPmlR+zNRoE=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
patches = [
|
|
|
|
# Fix gcc-13 build failure due to missing <cstdint> includes.
|
|
|
|
(fetchpatch {
|
|
|
|
name = "gcc-13.patch";
|
|
|
|
url = "https://github.com/facebook/rocksdb/commit/88edfbfb5e1cac228f7cc31fbec24bb637fe54b1.patch";
|
|
|
|
stripLen = 1;
|
|
|
|
extraPrefix = "submodules/rocksdb/";
|
|
|
|
hash = "sha256-HhlIYyPzIZFuyzHTUPz3bXgXiaFSQ8pVrLLMzegjTgE=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
cmakeFlags = let
|
|
|
|
options = {
|
2021-08-05 21:33:18 +00:00
|
|
|
PYTHON_EXECUTABLE = "${python3.interpreter}";
|
2021-03-23 19:22:30 +00:00
|
|
|
NANO_SHARED_BOOST = "ON";
|
2020-04-24 23:36:52 +00:00
|
|
|
BOOST_ROOT = boost;
|
|
|
|
RAIBLOCKS_GUI = "ON";
|
|
|
|
RAIBLOCKS_TEST = "ON";
|
|
|
|
Qt5_DIR = "${qtbase.dev}/lib/cmake/Qt5";
|
|
|
|
Qt5Core_DIR = "${qtbase.dev}/lib/cmake/Qt5Core";
|
|
|
|
Qt5Gui_INCLUDE_DIRS = "${qtbase.dev}/include/QtGui";
|
|
|
|
Qt5Widgets_INCLUDE_DIRS = "${qtbase.dev}/include/QtWidgets";
|
|
|
|
};
|
|
|
|
optionToFlag = name: value: "-D${name}=${value}";
|
|
|
|
in lib.mapAttrsToList optionToFlag options;
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config wrapQtAppsHook ];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ boost libGL qtbase ];
|
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
makeFlags = [ "nano_wallet" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
checkPhase = ''
|
2021-03-23 19:22:30 +00:00
|
|
|
runHook preCheck
|
2020-04-24 23:36:52 +00:00
|
|
|
./core_test
|
2021-03-23 19:22:30 +00:00
|
|
|
runHook postCheck
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Wallet for Nano cryptocurrency";
|
|
|
|
homepage = "https://nano.org/en/wallet/";
|
|
|
|
license = lib.licenses.bsd2;
|
|
|
|
# Fails on Darwin. See:
|
|
|
|
# https://github.com/NixOS/nixpkgs/pull/39295#issuecomment-386800962
|
|
|
|
platforms = lib.platforms.linux;
|
|
|
|
maintainers = with lib.maintainers; [ jluttine ];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|