HWI: allow building with unstable nixpkgs

This commit is contained in:
Jonas Nick 2020-04-26 18:51:28 +00:00
parent 199b9bf315
commit b7047c7286
No known key found for this signature in database
GPG Key ID: 4861DBF262123605
4 changed files with 59 additions and 5 deletions

View File

@ -21,6 +21,7 @@ env:
jobs: jobs:
- TestModules=1 STABLE=1 - TestModules=1 STABLE=1
- PKG=hwi STABLE=1 - PKG=hwi STABLE=1
- PKG=hwi STABLE=0
- PKG=lightning-charge STABLE=1 - PKG=lightning-charge STABLE=1
- PKG=lightning-charge STABLE=0 - PKG=lightning-charge STABLE=0
- PKG=nanopos STABLE=1 - PKG=nanopos STABLE=1

View File

@ -1,12 +1,18 @@
{ stdenv, fetchurl, fetchFromGitHub, python3 }: { stdenv, fetchurl, fetchFromGitHub, python3 }:
with stdenv.lib; with stdenv.lib;
with python3.pkgs;
let let
buildInputs = [ mnemonic ecdsa typing-extensions hidapi libusb1 pyaes ]; python = python3.override {
packageOverrides = self: super: {
# HWI requires mnemonic <0.19 but nixpkgs has a newer version
mnemonic = self.callPackage ./mnemonic {};
# HWI requires ecdsa <0.14 but nixpkgs has a newer version
ecdsa = self.callPackage ./ecdsa {};
};
};
in in
buildPythonPackage rec { python.pkgs.buildPythonPackage rec {
pname = "hwi"; pname = "hwi";
version = "1.0.3"; version = "1.0.3";
@ -20,8 +26,7 @@ buildPythonPackage rec {
# TODO: enable tests # TODO: enable tests
doCheck = false; doCheck = false;
inherit buildInputs; propagatedBuildInputs = with python.pkgs; [ mnemonic ecdsa typing-extensions hidapi libusb1 pyaes ];
propagatedBuildInputs = buildInputs;
meta = with lib; { meta = with lib; {
homepage = https://github.com/bitcoin-core/hwi; homepage = https://github.com/bitcoin-core/hwi;

View File

@ -0,0 +1,28 @@
{ stdenv
, buildPythonPackage
, fetchPypi
, pkgs
, six
}:
buildPythonPackage rec {
pname = "ecdsa";
version = "0.13.3";
src = fetchPypi {
inherit pname version;
sha256 = "163c80b064a763ea733870feb96f9dd9b92216cfcacd374837af18e4e8ec3d4d";
};
propagatedBuildInputs = [ six ];
# Only needed for tests
checkInputs = [ pkgs.openssl ];
meta = with stdenv.lib; {
description = "ECDSA cryptographic signature library";
homepage = "https://github.com/warner/python-ecdsa";
license = licenses.mit;
maintainers = with maintainers; [ aszlig ];
};
}

View File

@ -0,0 +1,20 @@
{ lib, fetchPypi, buildPythonPackage, pbkdf2 }:
buildPythonPackage rec {
pname = "mnemonic";
version = "0.18";
src = fetchPypi {
inherit pname version;
sha256 = "02a7306a792370f4a0c106c2cf1ce5a0c84b9dbd7e71c6792fdb9ad88a727f1d";
};
propagatedBuildInputs = [ pbkdf2 ];
meta = {
description = "Implementation of Bitcoin BIP-0039";
homepage = "https://github.com/trezor/python-mnemonic";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ np ];
};
}