From b75a20420b72fa7bb433c3722377c7212dbb9b2e Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sun, 26 Jun 2022 20:09:01 +0200 Subject: [PATCH 1/2] sphinx_offline: init --- pkgs/top-level/all-packages.nix | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 45a89043efa6..40650b3d148a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -20864,6 +20864,23 @@ with pkgs; sphinx = with python3Packages; toPythonApplication sphinx; + # A variation of sphinx that is only suitable for offline use as it excludes + # pyopenssl, which is broken on aarch64-darwin. + # https://github.com/NixOS/nixpkgs/issues/175875 + sphinx_offline = + if !(stdenv.buildPlatform.isDarwin && stdenv.buildPlatform.isAarch64) + then sphinx + else + sphinx.override (o: { + requests = pkgsBuildTarget.python3Packages.requests.override (o: { + urllib3 = pkgsBuildTarget.python3Packages.urllib3.overrideAttrs (o: { + # urllib3 adds the optional pyopenssl to propagatedBuildInputs + # pkgs/development/python-modules/urllib3/default.nix + propagatedBuildInputs = []; + }); + }); + }); + sphinx-autobuild = with python3Packages; toPythonApplication sphinx-autobuild; sphinx-serve = with python3Packages; toPythonApplication sphinx-serve; From 7898af7d3a134e9741458c335da523f42944d92b Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sun, 26 Jun 2022 13:39:46 +0200 Subject: [PATCH 2/2] ghc: Work around broken pyopenssl on aarch64-darwin --- pkgs/top-level/haskell-packages.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pkgs/top-level/haskell-packages.nix b/pkgs/top-level/haskell-packages.nix index 79815b65f605..1c0cd34c56dc 100644 --- a/pkgs/top-level/haskell-packages.nix +++ b/pkgs/top-level/haskell-packages.nix @@ -47,6 +47,8 @@ let # Use this rather than `rec { ... }` below for sake of overlays. inherit (pkgs.haskell) compiler packages; + sphinx = buildPackages.sphinx_offline; + in { lib = haskellLibUncomposable; @@ -87,7 +89,7 @@ in { packages.ghc8102Binary else packages.ghc865Binary; - inherit (buildPackages.python3Packages) sphinx; + inherit sphinx; buildTargetLlvmPackages = pkgsBuildTarget.llvmPackages_7; llvmPackages = pkgs.llvmPackages_7; }; @@ -100,7 +102,7 @@ in { packages.ghc8107BinaryMinimal else packages.ghc8107Binary; - inherit (buildPackages.python3Packages) sphinx; + inherit sphinx; # Need to use apple's patched xattr until # https://github.com/xattr/xattr/issues/44 and # https://github.com/xattr/xattr/issues/55 are solved. @@ -116,7 +118,7 @@ in { packages.ghc8107BinaryMinimal else packages.ghc8107Binary; - inherit (buildPackages.python3Packages) sphinx; + inherit sphinx; inherit (buildPackages.darwin) autoSignDarwinBinariesHook xattr; buildTargetLlvmPackages = pkgsBuildTarget.llvmPackages_12; llvmPackages = pkgs.llvmPackages_12; @@ -128,7 +130,7 @@ in { packages.ghc8107BinaryMinimal else packages.ghc8107Binary; - inherit (buildPackages.python3Packages) sphinx; + inherit sphinx; # Need to use apple's patched xattr until # https://github.com/xattr/xattr/issues/44 and # https://github.com/xattr/xattr/issues/55 are solved. @@ -138,7 +140,7 @@ in { }; ghcHEAD = callPackage ../development/compilers/ghc/head.nix { bootPkgs = packages.ghc8107Binary; - inherit (buildPackages.python3Packages) sphinx; + inherit sphinx; # Need to use apple's patched xattr until # https://github.com/xattr/xattr/issues/44 and # https://github.com/xattr/xattr/issues/55 are solved.