2018-07-21 01:44:44 +01:00
|
|
|
{lib, stdenv, fetchFromGitHub, cmake, pkgconfig, boost, libGL, qtbase}:
|
2018-01-07 15:54:08 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
|
|
|
name = "nano-wallet-${version}";
|
2019-02-24 14:39:31 +00:00
|
|
|
version = "18.0";
|
2018-01-07 15:54:08 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "nanocurrency";
|
|
|
|
repo = "raiblocks";
|
|
|
|
rev = "V${version}";
|
2019-02-24 14:39:31 +00:00
|
|
|
sha256 = "03f9g1x7rs7vic9yzsjxsh5ddx9ys78rssbfghbccfw9qrwylh3y";
|
2018-01-07 15:54:08 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
# Use a patch to force dynamic linking
|
|
|
|
patches = [
|
|
|
|
./CMakeLists.txt.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = let
|
|
|
|
options = {
|
|
|
|
BOOST_ROOT = "${boost}";
|
|
|
|
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;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake pkgconfig ];
|
|
|
|
buildInputs = [ boost libGL qtbase ];
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
make nano_wallet
|
|
|
|
'';
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
./core_test
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
inherit version;
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|