From a71f69cb3aa6bdd2418b5bd7dbfecaebeca5104f Mon Sep 17 00:00:00 2001 From: nixbitcoin Date: Fri, 23 Apr 2021 10:46:17 +0000 Subject: [PATCH] hwi: replace local version with upstream --- pkgs/default.nix | 1 - pkgs/hwi/default.nix | 36 ----------------------------------- pkgs/hwi/ecdsa/default.nix | 29 ---------------------------- pkgs/hwi/hidapi/default.nix | 32 ------------------------------- pkgs/hwi/mnemonic/default.nix | 20 ------------------- pkgs/pinned.nix | 3 ++- test/pkgs-unstable.nix | 1 - 7 files changed, 2 insertions(+), 120 deletions(-) delete mode 100644 pkgs/hwi/default.nix delete mode 100644 pkgs/hwi/ecdsa/default.nix delete mode 100644 pkgs/hwi/hidapi/default.nix delete mode 100644 pkgs/hwi/mnemonic/default.nix diff --git a/pkgs/default.nix b/pkgs/default.nix index 5fa33df..b2556a5 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -3,7 +3,6 @@ let self = { spark-wallet = pkgs.callPackage ./spark-wallet { }; electrs = pkgs.callPackage ./electrs { }; elementsd = pkgs.callPackage ./elementsd { withGui = false; }; - hwi = pkgs.callPackage ./hwi { }; liquid-swap = pkgs.python3Packages.callPackage ./liquid-swap { }; joinmarket = pkgs.callPackage ./joinmarket { inherit (self) nbPython3Packages; }; generate-secrets = pkgs.callPackage ./generate-secrets { }; diff --git a/pkgs/hwi/default.nix b/pkgs/hwi/default.nix deleted file mode 100644 index 2ab6ce0..0000000 --- a/pkgs/hwi/default.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ lib, pkgs, stdenv, fetchurl, fetchFromGitHub, python3 }: - -let - 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 {}; - # HWI requires hidapi 0.7.99 but nixpkgs has a newer version - hidapi = self.callPackage ./hidapi { - inherit (pkgs) udev libusb1; - }; - }; - }; -in -python.pkgs.buildPythonPackage rec { - pname = "hwi"; - version = "1.1.2"; - - src = fetchFromGitHub { - owner = "bitcoin-core"; - repo = "HWI"; - rev = version; - sha256 = "01xjkv74ksj8m0l6frk03wq82ilzp5gkz4rf7lhi1h6qkb9kb1x0"; - }; - - # TODO: enable tests - doCheck = false; - - propagatedBuildInputs = with python.pkgs; [ mnemonic ecdsa typing-extensions hidapi libusb1 pyaes ]; - - meta = with lib; { - homepage = https://github.com/bitcoin-core/hwi; - }; -} diff --git a/pkgs/hwi/ecdsa/default.nix b/pkgs/hwi/ecdsa/default.nix deleted file mode 100644 index 9ab0397..0000000 --- a/pkgs/hwi/ecdsa/default.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ lib -, 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 lib; { - description = "ECDSA cryptographic signature library"; - homepage = "https://github.com/warner/python-ecdsa"; - license = licenses.mit; - maintainers = with maintainers; [ aszlig ]; - }; - -} diff --git a/pkgs/hwi/hidapi/default.nix b/pkgs/hwi/hidapi/default.nix deleted file mode 100644 index 0d2692e..0000000 --- a/pkgs/hwi/hidapi/default.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ lib, stdenv, libusb1, udev, darwin, fetchPypi, buildPythonPackage, cython }: - -buildPythonPackage rec { - pname = "hidapi"; - version = "0.7.99.post21"; - - src = fetchPypi { - inherit pname version; - sha256 = "e0be1aa6566979266a8fc845ab0e18613f4918cf2c977fe67050f5dc7e2a9a97"; - }; - - propagatedBuildInputs = - lib.optionals stdenv.isLinux [ libusb1 udev ] ++ - lib.optionals stdenv.isDarwin [ darwin.IOKit darwin.apple_sdk.frameworks.CoreFoundation ] ++ - [ cython ]; - - # Fix the USB backend library lookup - postPatch = lib.optionalString stdenv.isLinux '' - libusb=${libusb1.dev}/include/libusb-1.0 - test -d $libusb || { echo "ERROR: $libusb doesn't exist, please update/fix this build expression."; exit 1; } - sed -i -e "s|/usr/include/libusb-1.0|$libusb|" setup.py - ''; - - meta = with lib; { - description = "A Cython interface to the hidapi from https://github.com/signal11/hidapi"; - homepage = "https://github.com/trezor/cython-hidapi"; - # license can actually be either bsd3 or gpl3 - # see https://github.com/trezor/cython-hidapi/blob/master/LICENSE-orig.txt - license = licenses.bsd3; - maintainers = with maintainers; [ np ]; - }; -} diff --git a/pkgs/hwi/mnemonic/default.nix b/pkgs/hwi/mnemonic/default.nix deleted file mode 100644 index 4cb416a..0000000 --- a/pkgs/hwi/mnemonic/default.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ 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 ]; - }; -} diff --git a/pkgs/pinned.nix b/pkgs/pinned.nix index a1086b0..9284fce 100644 --- a/pkgs/pinned.nix +++ b/pkgs/pinned.nix @@ -13,7 +13,8 @@ in lnd lndconnect nbxplorer - btcpayserver; + btcpayserver + hwi; stable = nixBitcoinPkgsStable; unstable = nixBitcoinPkgsUnstable; diff --git a/test/pkgs-unstable.nix b/test/pkgs-unstable.nix index 6d12ba1..fed037c 100644 --- a/test/pkgs-unstable.nix +++ b/test/pkgs-unstable.nix @@ -4,7 +4,6 @@ let nbPkgs = import ../pkgs { inherit pkgs; }; pkgsUnstable = with nbPkgs; [ electrs - hwi joinmarket lightning-loop lightning-pool