summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorSarah Brofeldt <sbrofeldt@gmail.com>2018-05-05 19:34:04 +0200
committerGitHub <noreply@github.com>2018-05-05 19:34:04 +0200
commit1d9330d63a5a30f4eb578eda7840be7b11ec6277 (patch)
treee6417749cc6613b25f6bbcd408c15fd98293ee79 /pkgs
parent89bed5b604cd40f135d2f6a17273a2c4a4374609 (diff)
parent9f31a4d622ad760fd33223297acec4ba8bb84347 (diff)
downloadnixpkgs-1d9330d63a5a30f4eb578eda7840be7b11ec6277.tar
nixpkgs-1d9330d63a5a30f4eb578eda7840be7b11ec6277.tar.gz
nixpkgs-1d9330d63a5a30f4eb578eda7840be7b11ec6277.tar.bz2
nixpkgs-1d9330d63a5a30f4eb578eda7840be7b11ec6277.tar.lz
nixpkgs-1d9330d63a5a30f4eb578eda7840be7b11ec6277.tar.xz
nixpkgs-1d9330d63a5a30f4eb578eda7840be7b11ec6277.tar.zst
nixpkgs-1d9330d63a5a30f4eb578eda7840be7b11ec6277.zip
Merge pull request #39295 from jluttine/add-nano-wallet
nano-wallet: init at 12.1
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/applications/altcoins/nano-wallet/CMakeLists.txt.patch13
-rw-r--r--pkgs/applications/altcoins/nano-wallet/default.nix57
-rw-r--r--pkgs/top-level/all-packages.nix2
3 files changed, 72 insertions, 0 deletions
diff --git a/pkgs/applications/altcoins/nano-wallet/CMakeLists.txt.patch b/pkgs/applications/altcoins/nano-wallet/CMakeLists.txt.patch
new file mode 100644
index 00000000000..5bbec1d39be
--- /dev/null
+++ b/pkgs/applications/altcoins/nano-wallet/CMakeLists.txt.patch
@@ -0,0 +1,13 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index b43f02f6..4470abbf 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -119,7 +119,7 @@ endif (RAIBLOCKS_SECURE_RPC)
+ 
+ include_directories (${CMAKE_SOURCE_DIR})
+ 
+-set(Boost_USE_STATIC_LIBS        ON)
++add_definitions(-DBOOST_LOG_DYN_LINK)
+ set(Boost_USE_MULTITHREADED      ON)
+ 
+ if (BOOST_CUSTOM)
diff --git a/pkgs/applications/altcoins/nano-wallet/default.nix b/pkgs/applications/altcoins/nano-wallet/default.nix
new file mode 100644
index 00000000000..8c4722bd991
--- /dev/null
+++ b/pkgs/applications/altcoins/nano-wallet/default.nix
@@ -0,0 +1,57 @@
+{lib, pkgs, stdenv, fetchFromGitHub, cmake, pkgconfig, boost, libGL, qtbase}:
+
+stdenv.mkDerivation rec {
+
+  name = "nano-wallet-${version}";
+  version = "12.1";
+
+  src = fetchFromGitHub {
+    owner = "nanocurrency";
+    repo = "raiblocks";
+    rev = "V${version}";
+    sha256 = "10ng7qn6y31s2bjahmpivw2plx90ljjjzb87j3l7zmppsjd2iq03";
+    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 ];
+  };
+
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index e502294289f..567167fc460 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -3846,6 +3846,8 @@ with pkgs;
 
   namazu = callPackage ../tools/text/namazu { };
 
+  nano-wallet = libsForQt5.callPackage ../applications/altcoins/nano-wallet { };
+
   nasty = callPackage ../tools/security/nasty { };
 
   nat-traverse = callPackage ../tools/networking/nat-traverse { };