2019-09-08 16:41:05 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, pkgconfig, wrapQtAppsHook, boost, libGL
|
|
|
|
, qtbase}:
|
2018-01-07 15:54:08 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "nano-wallet";
|
2019-11-27 15:52:25 +00:00
|
|
|
version = "20.0";
|
2018-01-07 15:54:08 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "nanocurrency";
|
|
|
|
repo = "raiblocks";
|
|
|
|
rev = "V${version}";
|
2019-11-27 15:52:25 +00:00
|
|
|
sha256 = "12nrjjd89yjzx20d85ccmp395pl0djpx0x0qb8dgka8xfy11k7xn";
|
2018-01-07 15:54:08 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
# Use a patch to force dynamic linking
|
|
|
|
patches = [
|
|
|
|
./CMakeLists.txt.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = let
|
|
|
|
options = {
|
2019-09-08 23:38:31 +00:00
|
|
|
BOOST_ROOT = boost;
|
2018-01-07 15:54:08 +00:00
|
|
|
Boost_USE_STATIC_LIBS = "OFF";
|
|
|
|
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;
|
|
|
|
|
2019-09-08 16:41:05 +00:00
|
|
|
nativeBuildInputs = [ cmake pkgconfig wrapQtAppsHook ];
|
2018-01-07 15:54:08 +00:00
|
|
|
buildInputs = [ boost libGL qtbase ];
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
make nano_wallet
|
|
|
|
'';
|
|
|
|
|
2019-09-08 13:01:03 +00:00
|
|
|
# Move executables under bin directory
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
mv $out/nano* $out/bin/
|
|
|
|
'';
|
|
|
|
|
2018-01-07 15:54:08 +00:00
|
|
|
checkPhase = ''
|
|
|
|
./core_test
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
inherit version;
|
|
|
|
description = "Wallet for Nano cryptocurrency";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://nano.org/en/wallet/";
|
2018-01-07 15:54:08 +00:00
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|