diff --git a/pkgs/default.nix b/pkgs/default.nix index e0e285d..f71b22c 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -6,7 +6,6 @@ let self = { electrs = pkgs.callPackage ./electrs { }; elementsd = pkgs.callPackage ./elementsd { withGui = false; }; hwi = pkgs.callPackage ./hwi { }; - pylightning = pkgs.python3Packages.callPackage ./pylightning { }; liquid-swap = pkgs.python3Packages.callPackage ./liquid-swap { }; joinmarket = pkgs.callPackage ./joinmarket { inherit (self) nbPython3Packages; }; generate-secrets = pkgs.callPackage ./generate-secrets { }; diff --git a/pkgs/pylightning/default.nix b/pkgs/pylightning/default.nix deleted file mode 100644 index 852e7d8..0000000 --- a/pkgs/pylightning/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ lib, buildPythonPackage, fetchPypi }: - -buildPythonPackage rec { - pname = "pylightning"; - version = "0.0.7"; - - src = fetchPypi { - inherit pname version; - sha256 = "0anbixqsfk0dsm790yy21f403lwgalxaqlm1s101ifppmxqccgpi"; - }; -} diff --git a/pkgs/python-packages/default.nix b/pkgs/python-packages/default.nix index 5dde404..7077330 100644 --- a/pkgs/python-packages/default.nix +++ b/pkgs/python-packages/default.nix @@ -4,6 +4,7 @@ let inherit (self) callPackage; joinmarketPkg = pkg: callPackage pkg { inherit (nbPkgs.joinmarket) version src; }; + clightningPkg = pkg: callPackage pkg { inherit (nbPkgs.pinned) clightning; }; in { bencoderpyx = callPackage ./bencoderpyx {}; coincurve = callPackage ./coincurve {}; @@ -16,4 +17,8 @@ in { joinmarketclient = joinmarketPkg ./jmclient; joinmarketbitcoin = joinmarketPkg ./jmbitcoin; joinmarketdaemon = joinmarketPkg ./jmdaemon; + + pyln-client = clightningPkg ./pyln-client; + pyln-proto = clightningPkg ./pyln-proto; + pylightning = clightningPkg ./pylightning; } diff --git a/pkgs/python-packages/pylightning/default.nix b/pkgs/python-packages/pylightning/default.nix new file mode 100644 index 0000000..c9dc340 --- /dev/null +++ b/pkgs/python-packages/pylightning/default.nix @@ -0,0 +1,17 @@ +{ buildPythonPackage, clightning, pyln-client }: + +buildPythonPackage rec { + pname = "pylightning"; + version = "0.8.0"; # defined in ${src}/contrib/pyln-client/pyln/client/__init__.py + + inherit (clightning) src; + + propagatedBuildInputs = [ pyln-client ]; + + postUnpack = "sourceRoot=$sourceRoot/contrib/${pname}"; + + # The clightning source contains pyln-client 0.8.0 + postPatch = '' + substituteInPlace requirements.txt --replace pyln-client==0.7.3 pyln-client==0.8.0 + ''; +} diff --git a/pkgs/python-packages/pyln-client/default.nix b/pkgs/python-packages/pyln-client/default.nix new file mode 100644 index 0000000..ea8a392 --- /dev/null +++ b/pkgs/python-packages/pyln-client/default.nix @@ -0,0 +1,12 @@ +{ buildPythonPackage, clightning, recommonmark }: + +buildPythonPackage rec { + pname = "pyln-client"; + version = "0.8.0"; # defined in ${src}/contrib/pyln-client/pyln/client/__init__.py + + inherit (clightning) src; + + propagatedBuildInputs = [ recommonmark ]; + + postUnpack = "sourceRoot=$sourceRoot/contrib/${pname}"; +} diff --git a/pkgs/python-packages/pyln-proto/default.nix b/pkgs/python-packages/pyln-proto/default.nix new file mode 100644 index 0000000..f924a48 --- /dev/null +++ b/pkgs/python-packages/pyln-proto/default.nix @@ -0,0 +1,31 @@ +{ buildPythonPackage, clightning +, bitstring +, cryptography +, coincurve +, base58 +, mypy +}: + +buildPythonPackage rec { + pname = "pyln-proto"; + version = "0.8.4"; # defined in ${src}/contrib/pyln-proto/setup.py + + inherit (clightning) src; + + propagatedBuildInputs = [ + bitstring + cryptography + coincurve + base58 + mypy + ]; + + postUnpack = "sourceRoot=$sourceRoot/contrib/${pname}"; + + postPatch = '' + substituteInPlace requirements.txt \ + --replace base58==1.0.2 base58==2.0.1 \ + --replace bitstring==3.1.6 bitstring==3.1.5 \ + --replace cryptography==2.8 cryptography==3.1 + ''; +}