From 9e7f498eafc0469b68fdf8dde8d9412c830def5c Mon Sep 17 00:00:00 2001
From: toonn <toonn@toonn.io>
Date: Mon, 15 Nov 2021 19:38:40 +0100
Subject: [PATCH] jupyter_server: Patch unicode test for Darwin (#145993)

The test relies on creating and then reading files with unicode names
to/from disk. Apple's HFS+, the default file system until recently, is
unicode-normalizing with normal form D (NFD). So not all unicode file
names round-trip. This patch implements one imperfect solution.

ZHF: #144627
---
 .../development/python-modules/jupyter_server/default.nix | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/pkgs/development/python-modules/jupyter_server/default.nix b/pkgs/development/python-modules/jupyter_server/default.nix
index 0e1469e0940e..2cb7d06b646a 100644
--- a/pkgs/development/python-modules/jupyter_server/default.nix
+++ b/pkgs/development/python-modules/jupyter_server/default.nix
@@ -1,6 +1,7 @@
 { lib
 , stdenv
 , buildPythonPackage
+, fetchpatch
 , fetchPypi
 , pythonOlder
 , pytestCheckHook
@@ -34,6 +35,13 @@ buildPythonPackage rec {
     sha256 = "c1f32e0c1807ab2de37bf70af97a36b4436db0bc8af3124632b1f4441038bf95";
   };
 
+  patches = [ (fetchpatch
+    { name = "Normalize-file-name-and-path.patch";
+      url = "https://github.com/jupyter-server/jupyter_server/pull/608/commits/345e26cdfd78651954b68708fa44119c2ac0dbd5.patch";
+      sha256 = "1kqz3dyh2w0h1g1fbvqa13q17hb6y32694rlaasyg213mq6g4k32";
+    })
+  ];
+
   propagatedBuildInputs = [
     argon2_cffi
     jinja2