2017-09-11 20:26:40 +00:00
|
|
|
{ stdenv, fetchgit, fetchFromGitHub, curl, cmake, boost, gcc, protobuf, pkgconfig, jsoncpp
|
2017-02-08 16:18:22 +00:00
|
|
|
, libusb1, libmicrohttpd
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2017-08-30 07:25:53 +00:00
|
|
|
version = "1.2.1";
|
2017-02-08 16:18:22 +00:00
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "trezord-${version}";
|
|
|
|
|
|
|
|
src = fetchgit {
|
|
|
|
url = "https://github.com/trezor/trezord";
|
|
|
|
rev = "refs/tags/v${version}";
|
2017-08-30 07:25:53 +00:00
|
|
|
sha256 = "1iaxmwyidjdcrc6jg0859v6v5x3qnz5b0p78pq0bypvmgyijhpm4";
|
2017-02-08 16:18:22 +00:00
|
|
|
};
|
|
|
|
|
2017-09-11 20:26:40 +00:00
|
|
|
common = fetchFromGitHub {
|
|
|
|
owner = "trezor";
|
|
|
|
repo = "trezor-common";
|
|
|
|
rev = "b55fb61218431e9c99c9d6c1673801902fc9e92e";
|
|
|
|
sha256 = "1zanbgz1qjs8wfwp0z91sqcvj77a9iis694k415jyd2dn4riqhdg";
|
|
|
|
};
|
|
|
|
|
2017-02-08 16:18:22 +00:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "TREZOR Bridge daemon for TREZOR bitcoin hardware wallet";
|
|
|
|
homepage = https://mytrezor.com;
|
|
|
|
license = licenses.gpl3;
|
|
|
|
maintainers = with stdenv.lib.maintainers; [ canndrew jb55 ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
|
|
|
|
patches = [ ./dynamic-link.patch ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
2017-08-30 07:25:53 +00:00
|
|
|
gcc
|
2017-02-08 16:18:22 +00:00
|
|
|
pkgconfig
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
curl
|
|
|
|
boost
|
|
|
|
protobuf
|
|
|
|
libusb1
|
|
|
|
libmicrohttpd
|
|
|
|
jsoncpp
|
|
|
|
];
|
|
|
|
|
2017-09-11 20:26:40 +00:00
|
|
|
preConfigure = ''
|
|
|
|
( cd src/config
|
|
|
|
ln -s $common/protob/config.proto
|
|
|
|
protoc -I . --cpp_out=. config.proto
|
|
|
|
)
|
|
|
|
'';
|
|
|
|
|
2017-02-08 16:18:22 +00:00
|
|
|
LD_LIBRARY_PATH = "${stdenv.lib.makeLibraryPath [ curl ]}";
|
2017-09-11 20:26:40 +00:00
|
|
|
cmakeFlags = [ "-DJSONCPP_LIBRARY='${jsoncpp}/lib/libjsoncpp.so'" ];
|
2017-02-08 16:18:22 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp trezord $out/bin
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
|