nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 fetchpatch,
6 cmake,
7 pkg-config,
8 wrapQtAppsHook,
9 boost,
10 libGL,
11 qtbase,
12 python3,
13}:
14
15stdenv.mkDerivation rec {
16
17 pname = "nano-wallet";
18 version = "25.1";
19
20 src = fetchFromGitHub {
21 owner = "nanocurrency";
22 repo = "nano-node";
23 rev = "V${version}";
24 fetchSubmodules = true;
25 hash = "sha256-YvYEXHC8kxviZLQwINs+pS61wITSfqfrrPmlR+zNRoE=";
26 };
27
28 patches = [
29 # Fix gcc-13 build failure due to missing <cstdint> includes.
30 (fetchpatch {
31 name = "gcc-13.patch";
32 url = "https://github.com/facebook/rocksdb/commit/88edfbfb5e1cac228f7cc31fbec24bb637fe54b1.patch";
33 stripLen = 1;
34 extraPrefix = "submodules/rocksdb/";
35 hash = "sha256-HhlIYyPzIZFuyzHTUPz3bXgXiaFSQ8pVrLLMzegjTgE=";
36 })
37 ];
38
39 cmakeFlags =
40 let
41 options = {
42 PYTHON_EXECUTABLE = "${python3.interpreter}";
43 NANO_SHARED_BOOST = "ON";
44 BOOST_ROOT = boost;
45 RAIBLOCKS_GUI = "ON";
46 RAIBLOCKS_TEST = "ON";
47 Qt5_DIR = "${qtbase.dev}/lib/cmake/Qt5";
48 Qt5Core_DIR = "${qtbase.dev}/lib/cmake/Qt5Core";
49 Qt5Gui_INCLUDE_DIRS = "${qtbase.dev}/include/QtGui";
50 Qt5Widgets_INCLUDE_DIRS = "${qtbase.dev}/include/QtWidgets";
51 };
52 optionToFlag = name: value: "-D${name}=${value}";
53 in
54 lib.mapAttrsToList optionToFlag options;
55
56 nativeBuildInputs = [
57 cmake
58 pkg-config
59 wrapQtAppsHook
60 ];
61 buildInputs = [
62 boost
63 libGL
64 qtbase
65 ];
66
67 strictDeps = true;
68
69 makeFlags = [ "nano_wallet" ];
70
71 checkPhase = ''
72 runHook preCheck
73 ./core_test
74 runHook postCheck
75 '';
76
77 meta = {
78 description = "Wallet for Nano cryptocurrency";
79 homepage = "https://nano.org/en/wallet/";
80 license = lib.licenses.bsd2;
81 # Fails on Darwin. See:
82 # https://github.com/NixOS/nixpkgs/pull/39295#issuecomment-386800962
83 platforms = lib.platforms.linux;
84 maintainers = with lib.maintainers; [ jluttine ];
85 };
86
87}