summary refs log tree commit diff
path: root/pkgs/development/python-modules/furo
diff options
context:
space:
mode:
authorLuflosi <luflosi@luflosi.de>2022-02-11 14:45:18 +0100
committerRobert Schütz <github@dotlambda.de>2022-02-12 03:21:15 +0000
commit1670125d5d3e0146d144d316804e3e6fd2f01d43 (patch)
tree503dbc89314c8ffe123216ad3ea9c678aa0b1a53 /pkgs/development/python-modules/furo
parentf7f72f344cc0f2c98ce184af78f70c9dbdb6cdd0 (diff)
downloadnixpkgs-1670125d5d3e0146d144d316804e3e6fd2f01d43.tar
nixpkgs-1670125d5d3e0146d144d316804e3e6fd2f01d43.tar.gz
nixpkgs-1670125d5d3e0146d144d316804e3e6fd2f01d43.tar.bz2
nixpkgs-1670125d5d3e0146d144d316804e3e6fd2f01d43.tar.lz
nixpkgs-1670125d5d3e0146d144d316804e3e6fd2f01d43.tar.xz
nixpkgs-1670125d5d3e0146d144d316804e3e6fd2f01d43.tar.zst
nixpkgs-1670125d5d3e0146d144d316804e3e6fd2f01d43.zip
python3Packages.furo: fix build
furo requires webpack since version 2021.11.12 and was recently updated in 7b890d59335f78ff3a06b237b3d06d06c7fe0e78. Without this dependency, the built package is broken as it is missing some important files. This can be seen when trying to build kitty on Linux. webpack doesn't work correctly in nixpkgs, see https://github.com/NixOS/nixpkgs/issues/42275. I wasn't able to fix this.
To make furo build correctly again despite the broken webpack, I switched to fetching the wheel instead of the source from PyPI, which has the necessary files already generated.
I also added a small test to make sure that this directory won't be empty again in the future.
Diffstat (limited to 'pkgs/development/python-modules/furo')
-rw-r--r--pkgs/development/python-modules/furo/default.nix19
1 files changed, 16 insertions, 3 deletions
diff --git a/pkgs/development/python-modules/furo/default.nix b/pkgs/development/python-modules/furo/default.nix
index 9dc336e17f1..875de68facd 100644
--- a/pkgs/development/python-modules/furo/default.nix
+++ b/pkgs/development/python-modules/furo/default.nix
@@ -9,12 +9,14 @@
 buildPythonPackage rec {
   pname = "furo";
   version = "2022.1.2";
-  format = "flit";
+  format = "wheel";
   disable = pythonOlder "3.6";
 
   src = fetchPypi {
-    inherit pname version;
-    sha256 = "b217f218cbcd423ffbfe69baa79389d4ecebf2d86f0d593c44ef31da7b5aed30";
+    inherit pname version format;
+    dist = "py3";
+    python = "py3";
+    sha256 = "sha256-lYAWv+E4fB6N31udcWlracTqpc2K/JSSq/sAirotMAw=";
   };
 
   propagatedBuildInputs = [
@@ -22,6 +24,17 @@ buildPythonPackage rec {
     beautifulsoup4
   ];
 
+  installCheckPhase = ''
+    # furo was built incorrectly if this directory is empty
+    # Ignore the hidden file .gitignore
+    cd "$out/lib/python"*
+    if [ "$(ls 'site-packages/furo/theme/furo/static/' | wc -l)" -le 0 ]; then
+      echo 'static directory must not be empty'
+      exit 1
+    fi
+    cd -
+  '';
+
   pythonImportsCheck = [ "furo" ];
 
   meta = with lib; {