Skip to content

Commit

Permalink
clightning: fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
erikarvstedt committed Aug 21, 2022
1 parent 4456123 commit 321e8ba
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 2 deletions.
12 changes: 12 additions & 0 deletions pkgs/clightning-mistune-workaround/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{ clightning, python3 }:

clightning.override {
python3 = python3.override {
packageOverrides = self: super: {
mistune = self.callPackage ./mistune.nix {
version = "0.8.4";
sha256 = "59a3429db53c50b5c6bcc8a07f8848cb00d7dc8bdb431a4ab41920d201d4756e";
};
};
};
}
27 changes: 27 additions & 0 deletions pkgs/clightning-mistune-workaround/mistune.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{ lib
, buildPythonPackage
, fetchPypi
, nose
, version
, sha256
, format ? "setuptools"
, extraMeta ? {}
}:

buildPythonPackage rec {
inherit version format;
pname = "mistune";

src = fetchPypi {
inherit pname version sha256;
};

buildInputs = [ nose ];
pythonImportsCheck = [ "mistune" ];

meta = with lib; {
description = "The fastest markdown parser in pure Python";
homepage = "https://github.com/lepture/mistune";
license = licenses.bsd3;
} // extraMeta;
}
8 changes: 8 additions & 0 deletions pkgs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ let self = {
packageOverrides = import ./python-packages self;
}).pkgs;

# Fix clightning build by using python package mistune 0.8.4, which is a
# strict requirement. This version is affected by CVE-2022-34749, but this
# is irrelevant in this context.
#
# TODO-EXTERNAL:
# Remove this when the clightning build is fixed upstream.
clightning = pkgs.callPackage ./clightning-mistune-workaround { inherit (pkgs) clightning; };

# Internal pkgs
netns-exec = pkgs.callPackage ./netns-exec { };
krops = import ./krops { inherit pkgs; };
Expand Down
1 change: 0 additions & 1 deletion pkgs/pinned.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ pkgs: pkgsUnstable:
inherit (pkgsUnstable)
btcpayserver
charge-lnd
clightning
fulcrum
hwi
lightning-loop
Expand Down
2 changes: 1 addition & 1 deletion pkgs/python-packages/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ let
inherit (self) callPackage;

joinmarketPkg = pkg: callPackage pkg { inherit (nbPkgs.joinmarket) version src; };
clightningPkg = pkg: callPackage pkg { inherit (nbPkgs.pinned) clightning; };
clightningPkg = pkg: callPackage pkg { inherit (nbPkgs) clightning; };

unstable = (import ../nixpkgs-pinned.nix).nixpkgs-unstable;
in {
Expand Down

0 comments on commit 321e8ba

Please sign in to comment.