diff options
author | Andrew Cann <shum@canndrew.org> | 2017-02-09 00:18:22 +0800 |
---|---|---|
committer | Joachim F <joachifm@users.noreply.github.com> | 2017-02-08 17:18:22 +0100 |
commit | 3082647e740cd6df15f9515c3c436d1344b52b53 (patch) | |
tree | 5382581d222888587a4cbbb9fad0c960d7492f52 /pkgs/servers/trezord | |
parent | ae02508c2a378a5721769bb466b12e8a4ff2e7a2 (diff) | |
download | nixpkgs-3082647e740cd6df15f9515c3c436d1344b52b53.tar nixpkgs-3082647e740cd6df15f9515c3c436d1344b52b53.tar.gz nixpkgs-3082647e740cd6df15f9515c3c436d1344b52b53.tar.bz2 nixpkgs-3082647e740cd6df15f9515c3c436d1344b52b53.tar.lz nixpkgs-3082647e740cd6df15f9515c3c436d1344b52b53.tar.xz nixpkgs-3082647e740cd6df15f9515c3c436d1344b52b53.tar.zst nixpkgs-3082647e740cd6df15f9515c3c436d1344b52b53.zip |
trezord: init at 1.2.0 (#22054)
Diffstat (limited to 'pkgs/servers/trezord')
-rw-r--r-- | pkgs/servers/trezord/default.nix | 51 | ||||
-rw-r--r-- | pkgs/servers/trezord/dynamic-link.patch | 18 |
2 files changed, 69 insertions, 0 deletions
diff --git a/pkgs/servers/trezord/default.nix b/pkgs/servers/trezord/default.nix new file mode 100644 index 00000000000..0fad00e882d --- /dev/null +++ b/pkgs/servers/trezord/default.nix @@ -0,0 +1,51 @@ +{ stdenv, fetchgit, curl, cmake, boost, gcc5, protobuf, pkgconfig, jsoncpp +, libusb1, libmicrohttpd +}: + +let + version = "1.2.0"; +in + +stdenv.mkDerivation rec { + name = "trezord-${version}"; + + src = fetchgit { + url = "https://github.com/trezor/trezord"; + rev = "refs/tags/v${version}"; + sha256 = "1606j5cfngryk4q21yiga1zvc3zpx4q8vqn6ljrvr679hpvlwni4"; + }; + + 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 + gcc5 + pkgconfig + ]; + + buildInputs = [ + curl + boost + protobuf + libusb1 + libmicrohttpd + jsoncpp + ]; + + LD_LIBRARY_PATH = "${stdenv.lib.makeLibraryPath [ curl ]}"; + cmakeFlags="-DJSONCPP_LIBRARY='${jsoncpp}/lib/libjsoncpp.so'"; + + installPhase = '' + mkdir -p $out/bin + cp trezord $out/bin + ''; +} + diff --git a/pkgs/servers/trezord/dynamic-link.patch b/pkgs/servers/trezord/dynamic-link.patch new file mode 100644 index 00000000000..0f1f448a3f7 --- /dev/null +++ b/pkgs/servers/trezord/dynamic-link.patch @@ -0,0 +1,18 @@ +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) |