Merge pull request #38704 from roconnor-blockstream/trezor

trezord: 1.2.1 -> 2.0.12
This commit is contained in:
adisbladis 2018-04-12 23:10:24 +08:00 committed by GitHub
commit fbcbac6769
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 71 deletions

View File

@ -38,7 +38,7 @@ in {
path = [];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.trezord}/bin/trezord -f";
ExecStart = "${pkgs.trezord}/bin/trezord-go";
User = "trezord";
};
};

View File

@ -1,65 +1,26 @@
{ stdenv, fetchgit, fetchFromGitHub, curl, cmake, boost, gcc, protobuf, pkgconfig, jsoncpp
, libusb1, libmicrohttpd
}:
{ stdenv, buildGoPackage, fetchFromGitHub }:
let
version = "1.2.1";
in
buildGoPackage rec {
name = "trezord-go-${version}";
version = "2.0.12";
stdenv.mkDerivation rec {
name = "trezord-${version}";
# Fixes Cgo related build failures (see https://github.com/NixOS/nixpkgs/issues/25959 )
hardeningDisable = [ "fortify" ];
src = fetchgit {
url = "https://github.com/trezor/trezord";
rev = "refs/tags/v${version}";
sha256 = "1iaxmwyidjdcrc6jg0859v6v5x3qnz5b0p78pq0bypvmgyijhpm4";
};
goPackagePath = "github.com/trezor/trezord-go";
common = fetchFromGitHub {
src = fetchFromGitHub {
owner = "trezor";
repo = "trezor-common";
rev = "b55fb61218431e9c99c9d6c1673801902fc9e92e";
sha256 = "1zanbgz1qjs8wfwp0z91sqcvj77a9iis694k415jyd2dn4riqhdg";
repo = "trezord-go";
rev = "v${version}";
sha256 = "03pz223jjfbd0g9gkk21q6d27jc8vd1bc1jz00i0f3dzvsyfx5g6";
};
meta = with stdenv.lib; {
description = "TREZOR Bridge daemon for TREZOR bitcoin hardware wallet";
description = "TREZOR Communication Daemon aka TREZOR Bridge";
homepage = https://mytrezor.com;
license = licenses.gpl3;
maintainers = with stdenv.lib.maintainers; [ canndrew jb55 ];
platforms = platforms.linux;
};
patches = [ ./dynamic-link.patch ];
nativeBuildInputs = [
cmake
gcc
pkgconfig
];
buildInputs = [
curl
boost
protobuf
libusb1
libmicrohttpd
jsoncpp
];
preConfigure = ''
( cd src/config
ln -s $common/protob/config.proto
protoc -I . --cpp_out=. config.proto
)
'';
LD_LIBRARY_PATH = "${stdenv.lib.makeLibraryPath [ curl ]}";
cmakeFlags = [ "-DJSONCPP_LIBRARY='${jsoncpp}/lib/libjsoncpp.so'" ];
installPhase = ''
mkdir -p $out/bin
cp trezord $out/bin
'';
}

View File

@ -1,18 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7c0e2cf..0e3f4ac 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -59,13 +59,6 @@ target_link_libraries(trezord ${OS_LIBRARIES})
find_package(CURL REQUIRED)
find_package(libmicrohttpd REQUIRED)
-# add static libs
-if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
- set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
- set(BUILD_SHARED_LIBS off)
- set(Boost_USE_STATIC_LIBS on)
- set(CMAKE_FIND_STATIC FIRST)
-endif(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
find_package(Boost 1.53.0 REQUIRED
regex thread system unit_test_framework program_options chrono)
find_package(Protobuf 2.5.0 REQUIRED)