From 1a16e5523712dce7cc702128499dae41e268a338 Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Thu, 12 Nov 2020 18:07:38 +0100 Subject: [PATCH] move python packages to pkgs/python-packages Remove obsolete passthru from joinmarket because joinmarket packages are now accessible via pkgs/python-packages. --- pkgs/default.nix | 6 +++- pkgs/joinmarket/default.nix | 28 ++----------------- .../bencoderpyx/default.nix | 0 .../chromalog/default.nix | 0 .../coincurve/default.nix | 0 pkgs/python-packages/default.nix | 19 +++++++++++++ .../jmbase/default.nix | 0 .../jmbitcoin/default.nix | 0 .../jmclient/default.nix | 0 .../jmdaemon/default.nix | 0 .../python-bitcointx/default.nix | 0 .../python-bitcointx/get-sha256.sh | 0 .../secp256k1/default.nix | 0 .../urldecode/default.nix | 0 14 files changed, 27 insertions(+), 26 deletions(-) rename pkgs/{joinmarket => python-packages}/bencoderpyx/default.nix (100%) rename pkgs/{joinmarket => python-packages}/chromalog/default.nix (100%) rename pkgs/{joinmarket => python-packages}/coincurve/default.nix (100%) create mode 100644 pkgs/python-packages/default.nix rename pkgs/{joinmarket => python-packages}/jmbase/default.nix (100%) rename pkgs/{joinmarket => python-packages}/jmbitcoin/default.nix (100%) rename pkgs/{joinmarket => python-packages}/jmclient/default.nix (100%) rename pkgs/{joinmarket => python-packages}/jmdaemon/default.nix (100%) rename pkgs/{joinmarket => python-packages}/python-bitcointx/default.nix (100%) rename pkgs/{joinmarket => python-packages}/python-bitcointx/get-sha256.sh (100%) rename pkgs/{joinmarket => python-packages}/secp256k1/default.nix (100%) rename pkgs/{joinmarket => python-packages}/urldecode/default.nix (100%) diff --git a/pkgs/default.nix b/pkgs/default.nix index 46a4691..e0e285d 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -8,13 +8,17 @@ let self = { hwi = pkgs.callPackage ./hwi { }; pylightning = pkgs.python3Packages.callPackage ./pylightning { }; liquid-swap = pkgs.python3Packages.callPackage ./liquid-swap { }; - joinmarket = pkgs.callPackage ./joinmarket { }; + joinmarket = pkgs.callPackage ./joinmarket { inherit (self) nbPython3Packages; }; generate-secrets = pkgs.callPackage ./generate-secrets { }; nixops19_09 = pkgs.callPackage ./nixops { }; netns-exec = pkgs.callPackage ./netns-exec { }; lightning-loop = pkgs.callPackage ./lightning-loop { }; extra-container = pkgs.callPackage ./extra-container { }; + nbPython3Packages = (pkgs.python3.override { + packageOverrides = pySelf: super: import ./python-packages self pySelf; + }).pkgs; + pinned = import ./pinned.nix; lib = import ./lib.nix { inherit (pkgs) lib; }; diff --git a/pkgs/joinmarket/default.nix b/pkgs/joinmarket/default.nix index 1f0a05c..36bf050 100644 --- a/pkgs/joinmarket/default.nix +++ b/pkgs/joinmarket/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, python3, pkgs }: +{ stdenv, lib, fetchurl, python3, nbPython3Packages, pkgs }: let version = "0.7.2"; @@ -7,32 +7,14 @@ let sha256 = "03gvs20d2cfzy9x82l6v4c69w0j9mr4p9zj2hpymnb6xs1yq6dr1"; }; - python = python3.override { - packageOverrides = self: super: let - joinmarketPkg = pkg: self.callPackage pkg { inherit version src; }; - in { - joinmarketbase = joinmarketPkg ./jmbase; - joinmarketclient = joinmarketPkg ./jmclient; - joinmarketbitcoin = joinmarketPkg ./jmbitcoin; - joinmarketdaemon = joinmarketPkg ./jmdaemon; - - chromalog = self.callPackage ./chromalog {}; - bencoderpyx = self.callPackage ./bencoderpyx {}; - coincurve = self.callPackage ./coincurve {}; - urldecode = self.callPackage ./urldecode {}; - python-bitcointx = self.callPackage ./python-bitcointx {}; - secp256k1 = self.callPackage ./secp256k1 {}; - }; - }; - - runtimePackages = with python.pkgs; [ + runtimePackages = with nbPython3Packages; [ joinmarketbase joinmarketclient joinmarketbitcoin joinmarketdaemon ]; - pythonEnv = python.withPackages (_: runtimePackages); + pythonEnv = python3.withPackages (_: runtimePackages); in stdenv.mkDerivation { pname = "joinmarket"; @@ -62,8 +44,4 @@ stdenv.mkDerivation { chmod +x -R $out/bin patchShebangs $out/bin ''; - - passthru = { - inherit python runtimePackages pythonEnv; - }; } diff --git a/pkgs/joinmarket/bencoderpyx/default.nix b/pkgs/python-packages/bencoderpyx/default.nix similarity index 100% rename from pkgs/joinmarket/bencoderpyx/default.nix rename to pkgs/python-packages/bencoderpyx/default.nix diff --git a/pkgs/joinmarket/chromalog/default.nix b/pkgs/python-packages/chromalog/default.nix similarity index 100% rename from pkgs/joinmarket/chromalog/default.nix rename to pkgs/python-packages/chromalog/default.nix diff --git a/pkgs/joinmarket/coincurve/default.nix b/pkgs/python-packages/coincurve/default.nix similarity index 100% rename from pkgs/joinmarket/coincurve/default.nix rename to pkgs/python-packages/coincurve/default.nix diff --git a/pkgs/python-packages/default.nix b/pkgs/python-packages/default.nix new file mode 100644 index 0000000..5dde404 --- /dev/null +++ b/pkgs/python-packages/default.nix @@ -0,0 +1,19 @@ +nbPkgs: +self: +let + inherit (self) callPackage; + + joinmarketPkg = pkg: callPackage pkg { inherit (nbPkgs.joinmarket) version src; }; +in { + bencoderpyx = callPackage ./bencoderpyx {}; + coincurve = callPackage ./coincurve {}; + python-bitcointx = callPackage ./python-bitcointx {}; + secp256k1 = callPackage ./secp256k1 {}; + urldecode = callPackage ./urldecode {}; + chromalog = callPackage ./chromalog {}; + + joinmarketbase = joinmarketPkg ./jmbase; + joinmarketclient = joinmarketPkg ./jmclient; + joinmarketbitcoin = joinmarketPkg ./jmbitcoin; + joinmarketdaemon = joinmarketPkg ./jmdaemon; +} diff --git a/pkgs/joinmarket/jmbase/default.nix b/pkgs/python-packages/jmbase/default.nix similarity index 100% rename from pkgs/joinmarket/jmbase/default.nix rename to pkgs/python-packages/jmbase/default.nix diff --git a/pkgs/joinmarket/jmbitcoin/default.nix b/pkgs/python-packages/jmbitcoin/default.nix similarity index 100% rename from pkgs/joinmarket/jmbitcoin/default.nix rename to pkgs/python-packages/jmbitcoin/default.nix diff --git a/pkgs/joinmarket/jmclient/default.nix b/pkgs/python-packages/jmclient/default.nix similarity index 100% rename from pkgs/joinmarket/jmclient/default.nix rename to pkgs/python-packages/jmclient/default.nix diff --git a/pkgs/joinmarket/jmdaemon/default.nix b/pkgs/python-packages/jmdaemon/default.nix similarity index 100% rename from pkgs/joinmarket/jmdaemon/default.nix rename to pkgs/python-packages/jmdaemon/default.nix diff --git a/pkgs/joinmarket/python-bitcointx/default.nix b/pkgs/python-packages/python-bitcointx/default.nix similarity index 100% rename from pkgs/joinmarket/python-bitcointx/default.nix rename to pkgs/python-packages/python-bitcointx/default.nix diff --git a/pkgs/joinmarket/python-bitcointx/get-sha256.sh b/pkgs/python-packages/python-bitcointx/get-sha256.sh similarity index 100% rename from pkgs/joinmarket/python-bitcointx/get-sha256.sh rename to pkgs/python-packages/python-bitcointx/get-sha256.sh diff --git a/pkgs/joinmarket/secp256k1/default.nix b/pkgs/python-packages/secp256k1/default.nix similarity index 100% rename from pkgs/joinmarket/secp256k1/default.nix rename to pkgs/python-packages/secp256k1/default.nix diff --git a/pkgs/joinmarket/urldecode/default.nix b/pkgs/python-packages/urldecode/default.nix similarity index 100% rename from pkgs/joinmarket/urldecode/default.nix rename to pkgs/python-packages/urldecode/default.nix