summary refs log tree commit diff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2022-05-16 10:55:46 +0300
committerEfraim Flashner <efraim@flashner.co.il>2022-05-16 11:14:42 +0300
commite5e0e283ffd92f153303401c39dfcc1d8dde4f96 (patch)
tree82c7f8498081c1f807a0e4a25d0fd75c0e493043 /gnu/packages/patches
parent7c204281ff0b57de59261cd7b68fab3df1c0f49c (diff)
parent40a729a0e6f1d660b942241416c1e2c567616d4d (diff)
downloadguix-e5e0e283ffd92f153303401c39dfcc1d8dde4f96.tar.gz
Merge branch 'master' into staging
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/emacs-exec-path.patch12
-rw-r--r--gnu/packages/patches/emacs-ignore-empty-xim-styles.patch24
-rw-r--r--gnu/packages/patches/emacs-yasnippet-fix-tests.patch95
-rw-r--r--gnu/packages/patches/isc-dhcp-gcc-compat.patch72
-rw-r--r--gnu/packages/patches/libxmlb-install-xb-tool-into-bindir.patch100
-rw-r--r--gnu/packages/patches/python-debugpy-unbundle-pydevd.patch254
-rw-r--r--gnu/packages/patches/python-ipython-documentation-chars.patch18
-rw-r--r--gnu/packages/patches/python-ipython-documentation-repro.patch25
-rw-r--r--gnu/packages/patches/python-mypy-use-sys-path.patch130
-rw-r--r--gnu/packages/patches/racket-enable-scheme-backport.patch465
-rw-r--r--gnu/packages/patches/racket-gui-tethered-launcher-backport.patch26
11 files changed, 628 insertions, 593 deletions
diff --git a/gnu/packages/patches/emacs-exec-path.patch b/gnu/packages/patches/emacs-exec-path.patch
index 7303599df1..9a76b0237d 100644
--- a/gnu/packages/patches/emacs-exec-path.patch
+++ b/gnu/packages/patches/emacs-exec-path.patch
@@ -4,13 +4,13 @@ with things like GCC being referenced.
 
 --- a/lisp/loadup.el
 +++ b/lisp/loadup.el
-@@ -481,7 +481,8 @@ lost after dumping")))
+@@ -530,7 +530,8 @@ lost after dumping")))
                          ((equal dump-mode "dump") "emacs")
                          ((equal dump-mode "bootstrap") "emacs")
                          ((equal dump-mode "pbootstrap") "bootstrap-emacs.pdmp")
--                        (t (error "unrecognized dump mode %s" dump-mode)))))
-+                        (t (error "unrecognized dump mode %s" dump-mode))))
+-                        (t (error "Unrecognized dump mode %s" dump-mode)))))
++                        (t (error "Unrecognized dump mode %s" dump-mode))))
 +          (exec-path nil))
-       (message "Dumping under the name %s" output)
-       (condition-case ()
-           (delete-file output)
+       (when (and (featurep 'native-compile)
+                  (equal dump-mode "pdump"))
+         ;; Don't enable this before bootstrap is completed, as the
diff --git a/gnu/packages/patches/emacs-ignore-empty-xim-styles.patch b/gnu/packages/patches/emacs-ignore-empty-xim-styles.patch
deleted file mode 100644
index 398e65bdc8..0000000000
--- a/gnu/packages/patches/emacs-ignore-empty-xim-styles.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-Fix contributed upstream here:
-https://debbugs.gnu.org/cgi/bugreport.cgi?bug=42694.
-
-Index: emacs-26.3/src/xfns.c
-===================================================================
---- emacs-26.3.orig/src/xfns.c
-+++ emacs-26.3/src/xfns.c
-@@ -2628,6 +2628,8 @@ xic_free_xfontset (struct frame *f)
- static XIMStyle
- best_xim_style (XIMStyles *xim)
- {
-+  if (xim == NULL) goto out;
-+
-   int i, j;
-   int nr_supported = ARRAYELTS (supported_xim_styles);
-
-@@ -2636,6 +2638,7 @@ best_xim_style (XIMStyles *xim)
-       if (supported_xim_styles[i] == xim->supported_styles[j])
-	return supported_xim_styles[i];
-
-+ out:
-   /* Return the default style.  */
-   return XIMPreeditNothing | XIMStatusNothing;
- }
diff --git a/gnu/packages/patches/emacs-yasnippet-fix-tests.patch b/gnu/packages/patches/emacs-yasnippet-fix-tests.patch
new file mode 100644
index 0000000000..475352d8db
--- /dev/null
+++ b/gnu/packages/patches/emacs-yasnippet-fix-tests.patch
@@ -0,0 +1,95 @@
+From 904a058fcf4e1f4985e03f8551eec282ca12ccb5 Mon Sep 17 00:00:00 2001
+From: Philipp Stephani <phst@google.com>
+Date: Mon, 6 Dec 2021 18:50:10 +0100
+Subject: [PATCH] Unbreak unit tests under Emacs 28.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+- Emacs 28 has a new mode ‘lisp-data-mode’ for Lisp data.
+- A test that was temporarily broken passes again.
+- The default for ‘org-adapt-indentation’ has changed.
+---
+ yasnippet-tests.el | 41 ++++++++++++++++++++++++++---------------
+ 1 file changed, 26 insertions(+), 15 deletions(-)
+
+diff --git a/yasnippet-tests.el b/yasnippet-tests.el
+index b8a7980f..9fadf00c 100644
+--- a/yasnippet-tests.el
++++ b/yasnippet-tests.el
+@@ -1,6 +1,6 @@
+ ;;; yasnippet-tests.el --- some yasnippet tests  -*- lexical-binding: t -*-
+ 
+-;; Copyright (C) 2012-2015, 2017-2018  Free Software Foundation, Inc.
++;; Copyright (C) 2012-2015, 2017-2018, 2021  Free Software Foundation, Inc.
+ 
+ ;; Author: João Távora <joaot@siscog.pt>
+ ;; Keywords: emulations, convenience
+@@ -556,16 +556,19 @@ XXXXX   ------------------------"))))
+     (yas-mock-insert "foo bar")
+     (ert-simulate-command '(yas-next-field))
+     (goto-char (point-min))
+-    (let ((expected (with-temp-buffer
+-                      (insert (format (concat "* Test foo bar\n"
+-                                              "  " org-property-format "\n"
+-                                              "  " org-property-format "\n"
+-                                              "  " org-property-format)
+-                                      ":PROPERTIES:" ""
+-                                      ":ID:" "foo bar-after"
+-                                      ":END:" ""))
+-                      (delete-trailing-whitespace)
+-                      (buffer-string))))
++    ;; The default value of `org-adapt-indentation' changed between Org-mode 9.4
++    ;; and 9.5, so force a specific value.
++    (let* ((org-adapt-indentation nil)
++           (expected (with-temp-buffer
++                       (insert (format (concat "* Test foo bar\n"
++                                               org-property-format "\n"
++                                               org-property-format "\n"
++                                               org-property-format)
++                                       ":PROPERTIES:" ""
++                                       ":ID:" "foo bar-after"
++                                       ":END:" ""))
++                       (delete-trailing-whitespace)
++                       (buffer-string))))
+       ;; Some org-mode versions leave trailing whitespace, some don't.
+       (delete-trailing-whitespace)
+       (should (equal expected (buffer-string))))))
+@@ -1390,7 +1393,9 @@ hello ${1:$(when (stringp yas-text) (funcall func yas-text))} foo${1:$$(concat \
+                           ,@(if (fboundp 'prog-mode)
+                                 '(prog-mode))
+                           emacs-lisp-mode
+-                          lisp-interaction-mode))
++                          lisp-interaction-mode
++                          ;; `lisp-data-mode' doesn't exist prior to Emacs 28.
++                          ,@(and (fboundp 'lisp-data-mode) '(lisp-data-mode))))
+               (observed (yas--modes-to-activate)))
+          (should (equal major-mode (car observed)))
+          (should (equal (sort expected #'string<) (sort observed #'string<))))))))
+@@ -1418,7 +1423,11 @@ hello ${1:$(when (stringp yas-text) (funcall func yas-text))} foo${1:$$(concat \
+                                      '(prog-mode))
+                                emacs-lisp-mode
+                                and-also-this-one
+-                               lisp-interaction-mode))
++                               lisp-interaction-mode
++                               ;; `lisp-data-mode' doesn't exist prior to
++                               ;; Emacs 28.
++                               ,@(and (fboundp 'lisp-data-mode)
++                                      '(lisp-data-mode))))
+               (observed (yas--modes-to-activate)))
+          (should (equal expected-first
+                         (cl-subseq observed 0 (length expected-first))))
+@@ -1691,9 +1700,11 @@ TODO: be meaner"
+   "Test expansion of snippets in org source blocks."
+   ;; org 9+ no longer runs fontification for text-mode, so our hacks
+   ;; don't work.  Note that old ert doesn't have skipping, so we have
+-  ;; to expect failure instead.
++  ;; to expect failure instead.  Starting with Org-mode 9.5 this seems
++  ;; to work again.
+   :expected-result (if (and (fboundp 'org-in-src-block-p)
+-                            (version< (org-version) "9"))
++                            (or (version< (org-version) "9")
++                                (version<= "9.5" (org-version))))
+                        :passed :failed)
+   (let ((text-mode-hook #'yas-minor-mode))
+     (do-yas-org-native-tab-in-source-block "text")))
diff --git a/gnu/packages/patches/isc-dhcp-gcc-compat.patch b/gnu/packages/patches/isc-dhcp-gcc-compat.patch
deleted file mode 100644
index 82cb572d17..0000000000
--- a/gnu/packages/patches/isc-dhcp-gcc-compat.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-Add minor fixes for compiling with GCC 10.
-
-Taken from upstream:
-https://gitlab.isc.org/isc-projects/dhcp/-/commit/6c7e61578b1b449272dbb40dd8b98d03dad8a57a
-
-diff --git a/client/dhclient.c b/client/dhclient.c
---- a/client/dhclient.c
-+++ b/client/dhclient.c
-@@ -83,8 +83,9 @@ static const char message [] = "Internet Systems Consortium DHCP Client";
- static const char url [] = "For info, please visit https://www.isc.org/software/dhcp/";
- #endif /* UNIT_TEST */
- 
--u_int16_t local_port = 0;
--u_int16_t remote_port = 0;
-+extern u_int16_t local_port;
-+extern u_int16_t remote_port;
-+
- #if defined(DHCPv6) && defined(DHCP4o6)
- int dhcp4o6_state = -1; /* -1 = stopped, 0 = polling, 1 = started */
- #endif
-diff --git a/common/discover.c b/common/discover.c
---- a/common/discover.c
-+++ b/common/discover.c
-@@ -45,8 +45,8 @@ struct interface_info *fallback_interface = 0;
- 
- int interfaces_invalidated;
- int quiet_interface_discovery;
--u_int16_t local_port;
--u_int16_t remote_port;
-+u_int16_t local_port = 0;
-+u_int16_t remote_port = 0;
- u_int16_t relay_port = 0;
- int dhcpv4_over_dhcpv6 = 0;
- int (*dhcp_interface_setup_hook) (struct interface_info *, struct iaddr *);
-diff --git a/relay/dhcrelay.c b/relay/dhcrelay.c
---- a/relay/dhcrelay.c
-+++ b/relay/dhcrelay.c
-@@ -95,8 +95,8 @@ enum { forward_and_append,	/* Forward and append our own relay option. */
-        forward_untouched,	/* Forward without changes. */
-        discard } agent_relay_mode = forward_and_replace;
- 
--u_int16_t local_port;
--u_int16_t remote_port;
-+extern u_int16_t local_port;
-+extern u_int16_t remote_port;
- 
- /* Relay agent server list. */
- struct server_list {
-diff --git a/server/mdb.c b/server/mdb.c
---- a/server/mdb.c
-+++ b/server/mdb.c
-@@ -67,7 +67,7 @@ static host_id_info_t *host_id_info = NULL;
- 
- int numclasseswritten;
- 
--omapi_object_type_t *dhcp_type_host;
-+extern omapi_object_type_t *dhcp_type_host;
- 
- isc_result_t enter_class(cd, dynamicp, commit)
- 	struct class *cd;
-diff --git a/server/mdb6.c b/server/mdb6.c
---- a/server/mdb6.c
-+++ b/server/mdb6.c
-@@ -1945,7 +1945,7 @@ create_prefix6(struct ipv6_pool *pool, struct iasubopt **pref,
- 		}
- 		new_ds.data = new_ds.buffer->data;
- 		memcpy(new_ds.buffer->data, ds.data, ds.len);
--		memcpy(new_ds.buffer->data + ds.len, &tmp, sizeof(tmp));
-+		memcpy(&new_ds.buffer->data[0] + ds.len, &tmp, sizeof(tmp));
- 		data_string_forget(&ds, MDL);
- 		data_string_copy(&ds, &new_ds, MDL);
- 		data_string_forget(&new_ds, MDL);
diff --git a/gnu/packages/patches/libxmlb-install-xb-tool-into-bindir.patch b/gnu/packages/patches/libxmlb-install-xb-tool-into-bindir.patch
new file mode 100644
index 0000000000..97f0f5fbd3
--- /dev/null
+++ b/gnu/packages/patches/libxmlb-install-xb-tool-into-bindir.patch
@@ -0,0 +1,100 @@
+From f91a9cfcd70178404ac2aafdfa124c9a4efe8866 Mon Sep 17 00:00:00 2001
+From: Richard Hughes <richard@hughsie.com>
+Date: Mon, 18 Apr 2022 10:50:42 +0100
+Subject: [PATCH 11/11] Install xb-tool into bindir
+
+Fixes https://github.com/hughsie/libxmlb/issues/123
+---
+ contrib/libxmlb.spec.in |  3 ++-
+ meson.build             |  4 +++-
+ src/meson.build         |  9 ++++++++-
+ src/xb-tool.1           | 19 +++++++++++++++++++
+ 4 files changed, 32 insertions(+), 3 deletions(-)
+ create mode 100644 src/xb-tool.1
+
+diff --git a/contrib/libxmlb.spec.in b/contrib/libxmlb.spec.in
+index 6be65d1..24478fe 100644
+--- a/contrib/libxmlb.spec.in
++++ b/contrib/libxmlb.spec.in
+@@ -71,7 +71,8 @@ Executable and data files for installed tests.
+ %files
+ %doc README.md
+ %license LICENSE
+-%{_libexecdir}/xb-tool
++%{_bindir}/xb-tool
++%{_mandir}/man1/xb-tool.1*
+ %dir %{_libdir}/girepository-1.0
+ %{_libdir}/girepository-1.0/Xmlb-2.0.typelib
+ %{_libdir}/libxmlb.so.2*
+diff --git a/meson.build b/meson.build
+index 6870907..53b1324 100644
+--- a/meson.build
++++ b/meson.build
+@@ -103,16 +103,18 @@ add_project_link_arguments(
+ )
+ 
+ if host_machine.system() == 'windows'
+-  libexecdir = get_option('libexecdir')
++  bindir = get_option('bindir')
+   installed_test_bindir = get_option('libexecdir')
+   installed_test_datadir = get_option('datadir')
+ else
+   prefix = get_option('prefix')
+   datadir = join_paths(prefix, get_option('datadir'))
++  bindir = join_paths(prefix, get_option('bindir'))
+   libexecdir = join_paths(prefix, get_option('libexecdir'))
+   installed_test_bindir = join_paths(libexecdir, 'installed-tests', meson.project_name())
+   installed_test_datadir = join_paths(datadir, 'installed-tests', meson.project_name())
+ endif
++mandir = join_paths(prefix, get_option('mandir'))
+ 
+ gio = dependency('gio-2.0', version : '>= 2.45.8')
+ giounix = dependency('gio-unix-2.0', version : '>= 2.45.8', required: false)
+diff --git a/src/meson.build b/src/meson.build
+index d7a1401..93fb8ba 100644
+--- a/src/meson.build
++++ b/src/meson.build
+@@ -96,7 +96,14 @@ xb_tool = executable(
+     libxmlb,
+   ],
+   install : true,
+-  install_dir : libexecdir
++  install_dir : bindir
++)
++configure_file(
++  input : 'xb-tool.1',
++  output : 'xb-tool.1',
++  configuration : conf,
++  install: true,
++  install_dir: join_paths(mandir, 'man1'),
+ )
+ endif
+ 
+diff --git a/src/xb-tool.1 b/src/xb-tool.1
+new file mode 100644
+index 0000000..348d1b1
+--- /dev/null
++++ b/src/xb-tool.1
+@@ -0,0 +1,19 @@
++.\" Report problems in https://github.com/hughsie/libxmlb
++.TH man 1 "18 April 2022" @PACKAGE_VERSION@ "xb-tool man page"
++.SH NAME
++xb-tool \- standalone XMLb utility
++.SH SYNOPSIS
++xb-tool [CMD]
++.SH DESCRIPTION
++This tool allows creating, dumping and querying binary XML blobs.
++.PP
++Additionally \fBxb-tool\fR can be used to profile specfic tokenized queries.
++.SH OPTIONS
++The xb-tool command takes various options depending on the action.
++Run \fBxb-tool --help\fR for the full list.
++.SH EXIT STATUS
++Commands that successfully execute will return "0", otherwise "1".
++.SH BUGS
++No known bugs.
++.SH AUTHOR
++Richard Hughes (richard@hughsie.com)
+-- 
+2.35.1
+
diff --git a/gnu/packages/patches/python-debugpy-unbundle-pydevd.patch b/gnu/packages/patches/python-debugpy-unbundle-pydevd.patch
new file mode 100644
index 0000000000..7a6ad54489
--- /dev/null
+++ b/gnu/packages/patches/python-debugpy-unbundle-pydevd.patch
@@ -0,0 +1,254 @@
+Allow using pydevd as a regular dependency.
+Submitted upstream at: https://github.com/microsoft/debugpy/pull/902
+
+diff --git a/setup.py b/setup.py
+index 5fc40070..3a530a29 100644
+--- a/setup.py
++++ b/setup.py
+@@ -11,6 +11,9 @@ import subprocess
+ import sys
+ 
+ 
++DEBUGPY_BUNDLING_DISABLED = bool(os.getenv('DEBUGPY_BUNDLING_DISABLED'))
++
++
+ sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
+ import versioneer  # noqa
+ 
+@@ -18,12 +21,15 @@ del sys.path[0]
+ 
+ sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "src"))
+ import debugpy
+-import debugpy._vendored
++
++if not DEBUGPY_BUNDLING_DISABLED:
++    import debugpy._vendored
+ 
+ del sys.path[0]
+ 
+ 
+-PYDEVD_ROOT = debugpy._vendored.project_root("pydevd")
++PYDEVD_ROOT = (None if DEBUGPY_BUNDLING_DISABLED else
++               debugpy._vendored.project_root("pydevd"))
+ DEBUGBY_ROOT = os.path.dirname(os.path.abspath(debugpy.__file__))
+ 
+ 
+@@ -67,7 +73,7 @@ def iter_vendored_files():
+ # relevant setuptools versions.
+ class ExtModules(list):
+     def __bool__(self):
+-        return True
++        return not DEBUGPY_BUNDLING_DISABLED
+ 
+ 
+ def override_build(cmds):
+@@ -133,9 +139,24 @@ with open("DESCRIPTION.md", "r") as fh:
+ 
+ 
+ if __name__ == "__main__":
+-    if not os.getenv("SKIP_CYTHON_BUILD"):
++    if not (os.getenv("SKIP_CYTHON_BUILD") or DEBUGPY_BUNDLING_DISABLED):
+         cython_build()
+ 
++    # Etch bundling status in the source.
++    if debugpy.__bundling_disabled__ != DEBUGPY_BUNDLING_DISABLED:
++
++        with open(os.path.join(DEBUGBY_ROOT, '__init__.py'), 'r') as f:
++            lines = f.readlines()
++        with open(os.path.join(DEBUGBY_ROOT, '__init__.py'), 'w') as f:
++            edited = []
++            for line in lines:
++                if line.startswith('__bundling_disabled__'):
++                    edited.append(
++                        f'__bundling_disabled__ = {DEBUGPY_BUNDLING_DISABLED}\n')
++                else:
++                    edited.append(line)
++            f.writelines(edited)
++
+     extras = {}
+     platforms = get_buildplatform()
+     if platforms is not None:
+@@ -145,6 +166,18 @@ if __name__ == "__main__":
+     override_build(cmds)
+     override_build_py(cmds)
+ 
++    data = {"debugpy": ["ThirdPartyNotices.txt"]}
++    packages = [
++            "debugpy",
++            "debugpy.adapter",
++            "debugpy.common",
++            "debugpy.launcher",
++            "debugpy.server",
++        ]
++    if not DEBUGPY_BUNDLING_DISABLED:
++        data.update({"debugpy._vendored": list(iter_vendored_files())})
++        packages.append("debugpy._vendored")
++
+     setuptools.setup(
+         name="debugpy",
+         version=versioneer.get_version(),
+@@ -173,20 +206,10 @@ if __name__ == "__main__":
+             "License :: OSI Approved :: MIT License",
+         ],
+         package_dir={"": "src"},
+-        packages=[
+-            "debugpy",
+-            "debugpy.adapter",
+-            "debugpy.common",
+-            "debugpy.launcher",
+-            "debugpy.server",
+-            "debugpy._vendored",
+-        ],
+-        package_data={
+-            "debugpy": ["ThirdPartyNotices.txt"],
+-            "debugpy._vendored": list(iter_vendored_files()),
+-        },
++        packages=packages,
++        package_data=data,
+         ext_modules=ExtModules(),
+-        has_ext_modules=lambda: True,
++        has_ext_modules=lambda: not DEBUGPY_BUNDLING_DISABLED,
+         cmdclass=cmds,
+         **extras
+     )
+diff --git a/src/debugpy/__init__.py b/src/debugpy/__init__.py
+index baa5a7c5..7b7a29aa 100644
+--- a/src/debugpy/__init__.py
++++ b/src/debugpy/__init__.py
+@@ -206,6 +206,8 @@ def trace_this_thread(should_trace):
+ 
+ __version__ = _version.get_versions()["version"]
+ 
++__bundling_disabled__ = False
++
+ # Force absolute path on Python 2.
+ __file__ = os.path.abspath(__file__)
+ 
+diff --git a/src/debugpy/server/__init__.py b/src/debugpy/server/__init__.py
+index e6a1ad66..5f29a87a 100644
+--- a/src/debugpy/server/__init__.py
++++ b/src/debugpy/server/__init__.py
+@@ -4,6 +4,50 @@
+ 
+ from __future__ import absolute_import, division, print_function, unicode_literals
+ 
++from importlib import import_module
++import os
++
+ # "force_pydevd" must be imported first to ensure (via side effects)
+ # that the debugpy-vendored copy of pydevd gets used.
+-import debugpy._vendored.force_pydevd  # noqa
++import debugpy
++if debugpy.__bundling_disabled__:
++    # Do what force_pydevd.py does, but using the system-provided
++    # pydevd.
++
++    # XXX: This is copied here so that the whole '_vendored' directory
++    # can be deleted when DEBUGPY_BUNDLING_DISABLED is set.
++
++    # If debugpy logging is enabled, enable it for pydevd as well
++    if "DEBUGPY_LOG_DIR" in os.environ:
++        os.environ[str("PYDEVD_DEBUG")] = str("True")
++        os.environ[str("PYDEVD_DEBUG_FILE")] = \
++            os.environ["DEBUGPY_LOG_DIR"] + str("/debugpy.pydevd.log")
++
++    # Work around https://github.com/microsoft/debugpy/issues/346.
++    # Disable pydevd frame-eval optimizations only if unset, to allow opt-in.
++    if "PYDEVD_USE_FRAME_EVAL" not in os.environ:
++        os.environ[str("PYDEVD_USE_FRAME_EVAL")] = str("NO")
++
++    # Constants must be set before importing any other pydevd module
++    # due to heavy use of "from" in them.
++    pydevd_constants = import_module('_pydevd_bundle.pydevd_constants')
++    # The default pydevd value is 1000.
++    pydevd_constants.MAXIMUM_VARIABLE_REPRESENTATION_SIZE = 2 ** 32
++
++    # When pydevd is imported it sets the breakpoint behavior, but it needs to be
++    # overridden because by default pydevd will connect to the remote debugger using
++    # its own custom protocol rather than DAP.
++    import pydevd   # noqa
++    import debugpy  # noqa
++
++    def debugpy_breakpointhook():
++        debugpy.breakpoint()
++
++    pydevd.install_breakpointhook(debugpy_breakpointhook)
++
++    # Ensure that pydevd uses JSON protocol
++    from _pydevd_bundle import pydevd_constants
++    from _pydevd_bundle import pydevd_defaults
++    pydevd_defaults.PydevdCustomization.DEFAULT_PROTOCOL = pydevd_constants.HTTP_JSON_PROTOCOL
++else:
++    import debugpy._vendored.force_pydevd  # noqa
+diff --git a/src/debugpy/server/attach_pid_injected.py b/src/debugpy/server/attach_pid_injected.py
+index e6345996..87cfdd53 100644
+--- a/src/debugpy/server/attach_pid_injected.py
++++ b/src/debugpy/server/attach_pid_injected.py
+@@ -8,6 +8,7 @@ from __future__ import absolute_import, division, print_function, unicode_litera
+ 
+ import os
+ 
++import debugpy
+ 
+ __file__ = os.path.abspath(__file__)
+ _debugpy_dir = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
+@@ -30,25 +31,29 @@ def attach(setup):
+                 def on_critical(msg):
+                     print(msg, file=sys.stderr)
+ 
+-                pydevd_attach_to_process_path = os.path.join(
+-                    _debugpy_dir,
+-                    "debugpy",
+-                    "_vendored",
+-                    "pydevd",
+-                    "pydevd_attach_to_process",
+-                )
+-                assert os.path.exists(pydevd_attach_to_process_path)
+-                sys.path.insert(0, pydevd_attach_to_process_path)
+-
+-                # NOTE: that it's not a part of the pydevd PYTHONPATH
+-                import attach_script
++                if debugpy.__bundling_disabled__:
++                    from pydevd_attach_to_process import attach_script
++                else:
++                    pydevd_attach_to_process_path = os.path.join(
++                        _debugpy_dir,
++                        "debugpy",
++                        "_vendored",
++                        "pydevd",
++                        "pydevd_attach_to_process",
++                    )
++                    assert os.path.exists(pydevd_attach_to_process_path)
++                    sys.path.insert(0, pydevd_attach_to_process_path)
++
++                    # NOTE: that it's not a part of the pydevd PYTHONPATH
++                    import attach_script
+ 
+                 attach_script.fix_main_thread_id(
+                     on_warn=on_warn, on_exception=on_exception, on_critical=on_critical
+                 )
+ 
+-                # NOTE: At this point it should be safe to remove this.
+-                sys.path.remove(pydevd_attach_to_process_path)
++                if not debugpy.__bundling_disabled__:
++                    # NOTE: At this point it should be safe to remove this.
++                    sys.path.remove(pydevd_attach_to_process_path)
+             except:
+                 import traceback
+ 
+diff --git a/tests/tests/test_vendoring.py b/tests/tests/test_vendoring.py
+index dd6c4269..28c03702 100644
+--- a/tests/tests/test_vendoring.py
++++ b/tests/tests/test_vendoring.py
+@@ -1,3 +1,8 @@
++import pytest
++
++import debugpy
++
++@pytest.mark.skipif(debugpy.__bundling_disabled__, reason='Bundling disabled')
+ def test_vendoring(pyfile):
+     @pyfile
+     def import_debugpy():
+-- 
+2.34.0
+
diff --git a/gnu/packages/patches/python-ipython-documentation-chars.patch b/gnu/packages/patches/python-ipython-documentation-chars.patch
new file mode 100644
index 0000000000..a52c54f513
--- /dev/null
+++ b/gnu/packages/patches/python-ipython-documentation-chars.patch
@@ -0,0 +1,18 @@
+Avoid LaTeX errors due to non-printable characters.
+Submitted upstream: https://github.com/ipython/ipython/pull/13640
+
+diff --git a/IPython/utils/coloransi.py b/IPython/utils/coloransi.py
+index e33142180..9300b0108 100644
+--- a/IPython/utils/coloransi.py
++++ b/IPython/utils/coloransi.py
+@@ -74,8 +74,8 @@ class TermColors:
+ class InputTermColors:
+     """Color escape sequences for input prompts.
+ 
+-    This class is similar to TermColors, but the escapes are wrapped in \001
+-    and \002 so that readline can properly know the length of each line and
++    This class is similar to TermColors, but the escapes are wrapped in \\001
++    and \\002 so that readline can properly know the length of each line and
+     can wrap lines accordingly.  Use this class for any colored text which
+     needs to be used in input prompts, such as in calls to raw_input().
+ 
diff --git a/gnu/packages/patches/python-ipython-documentation-repro.patch b/gnu/packages/patches/python-ipython-documentation-repro.patch
new file mode 100644
index 0000000000..d6a6e9c3fd
--- /dev/null
+++ b/gnu/packages/patches/python-ipython-documentation-repro.patch
@@ -0,0 +1,25 @@
+Fix non-reproducibilities caused by time-dependent procedures.
+Submitted upstream: https://github.com/ipython/ipython/pull/13640
+
+diff --git a/IPython/sphinxext/ipython_directive.py b/IPython/sphinxext/ipython_directive.py
+index 18bdfcae9..2c665ac87 100644
+--- a/IPython/sphinxext/ipython_directive.py
++++ b/IPython/sphinxext/ipython_directive.py
+@@ -19,7 +19,7 @@
+    In [1]: 1+1
+ 
+    In [1]: import datetime
+-      ...: datetime.datetime.now()
++      ...: datetime.date.fromisoformat('2022-02-22')
+ 
+ It supports IPython construct that plain
+ Python does not understand (like magics):
+@@ -28,7 +28,7 @@
+ 
+    In [0]: import time
+ 
+-   In [0]: %timeit time.sleep(0.05)
++   In [0]: %pdoc time
+ 
+ This will also support top-level async when using IPython 7.0+
+ 
diff --git a/gnu/packages/patches/python-mypy-use-sys-path.patch b/gnu/packages/patches/python-mypy-use-sys-path.patch
new file mode 100644
index 0000000000..1b12526456
--- /dev/null
+++ b/gnu/packages/patches/python-mypy-use-sys-path.patch
@@ -0,0 +1,130 @@
+This patch fixes the annotation files search of mypy on non-FHS distributions.
+
+Submitted upstream: https://github.com/python/mypy/pull/12530
+
+diff --git a/mypy/main.py b/mypy/main.py
+index 3d9836587..f9b0cbd39 100644
+--- a/mypy/main.py
++++ b/mypy/main.py
+@@ -1033,10 +1033,10 @@ def process_options(args: List[str],
+     # Set target.
+     if special_opts.modules + special_opts.packages:
+         options.build_type = BuildType.MODULE
+-        egg_dirs, site_packages = get_site_packages_dirs(options.python_executable)
++        site_packages = get_site_packages_dirs(options.python_executable)
+         search_paths = SearchPaths((os.getcwd(),),
+                                    tuple(mypy_path() + options.mypy_path),
+-                                   tuple(egg_dirs + site_packages),
++                                   tuple(site_packages),
+                                    ())
+         targets = []
+         # TODO: use the same cache that the BuildManager will
+diff --git a/mypy/modulefinder.py b/mypy/modulefinder.py
+index 94d2dd34c..337a2d59b 100644
+--- a/mypy/modulefinder.py
++++ b/mypy/modulefinder.py
+@@ -629,7 +629,7 @@ def get_prefixes(python_executable: Optional[str]) -> Tuple[str, str]:
+ 
+ 
+ @functools.lru_cache(maxsize=None)
+-def get_site_packages_dirs(python_executable: Optional[str]) -> Tuple[List[str], List[str]]:
++def get_site_packages_dirs(python_executable: Optional[str]) -> List[str]:
+     """Find package directories for given python.
+ 
+     This runs a subprocess call, which generates a list of the egg directories, and the site
+@@ -648,51 +648,7 @@ def get_site_packages_dirs(python_executable: Optional[str]) -> Tuple[List[str],
+         site_packages = ast.literal_eval(
+             subprocess.check_output([python_executable, pyinfo.__file__, 'getsitepackages'],
+             stderr=subprocess.PIPE).decode())
+-    return expand_site_packages(site_packages)
+-
+-
+-def expand_site_packages(site_packages: List[str]) -> Tuple[List[str], List[str]]:
+-    """Expands .pth imports in site-packages directories"""
+-    egg_dirs: List[str] = []
+-    for dir in site_packages:
+-        if not os.path.isdir(dir):
+-            continue
+-        pth_filenames = sorted(name for name in os.listdir(dir) if name.endswith(".pth"))
+-        for pth_filename in pth_filenames:
+-            egg_dirs.extend(_parse_pth_file(dir, pth_filename))
+-
+-    return egg_dirs, site_packages
+-
+-
+-def _parse_pth_file(dir: str, pth_filename: str) -> Iterator[str]:
+-    """
+-    Mimics a subset of .pth import hook from Lib/site.py
+-    See https://github.com/python/cpython/blob/3.5/Lib/site.py#L146-L185
+-    """
+-
+-    pth_file = os.path.join(dir, pth_filename)
+-    try:
+-        f = open(pth_file, "r")
+-    except OSError:
+-        return
+-    with f:
+-        for line in f.readlines():
+-            if line.startswith("#"):
+-                # Skip comment lines
+-                continue
+-            if line.startswith(("import ", "import\t")):
+-                # import statements in .pth files are not supported
+-                continue
+-
+-            yield _make_abspath(line.rstrip(), dir)
+-
+-
+-def _make_abspath(path: str, root: str) -> str:
+-    """Take a path and make it absolute relative to root if not already absolute."""
+-    if os.path.isabs(path):
+-        return os.path.normpath(path)
+-    else:
+-        return os.path.join(root, os.path.normpath(path))
++    return site_packages
+ 
+ 
+ def add_py2_mypypath_entries(mypypath: List[str]) -> List[str]:
+@@ -781,7 +737,7 @@ def compute_search_paths(sources: List[BuildSource],
+     if options.python_version[0] == 2:
+         mypypath = add_py2_mypypath_entries(mypypath)
+ 
+-    egg_dirs, site_packages = get_site_packages_dirs(options.python_executable)
++    site_packages = get_site_packages_dirs(options.python_executable)
+     base_prefix, prefix = get_prefixes(options.python_executable)
+     is_venv = base_prefix != prefix
+     for site_dir in site_packages:
+@@ -801,7 +757,7 @@ def compute_search_paths(sources: List[BuildSource],
+ 
+     return SearchPaths(python_path=tuple(reversed(python_path)),
+                        mypy_path=tuple(mypypath),
+-                       package_path=tuple(egg_dirs + site_packages),
++                       package_path=tuple(site_packages),
+                        typeshed_path=tuple(lib_path))
+ 
+ 
+diff --git a/mypy/pyinfo.py b/mypy/pyinfo.py
+index ab2d3286b..9fb0501a1 100644
+--- a/mypy/pyinfo.py
++++ b/mypy/pyinfo.py
+@@ -24,16 +24,11 @@ def getprefixes():
+ 
+ def getsitepackages():
+     # type: () -> List[str]
+-    res = []
+-    if hasattr(site, 'getsitepackages'):
+-        res.extend(site.getsitepackages())
+ 
+-        if hasattr(site, 'getusersitepackages') and site.ENABLE_USER_SITE:
+-            res.insert(0, site.getusersitepackages())
+-    else:
+-        from distutils.sysconfig import get_python_lib
+-        res = [get_python_lib()]
+-    return res
++    # Simply return sys.path, which has already been expanded
++    # correctly via Python's site.py module, which takes care of .pth,
++    # sitecustomize.py files, etc.
++    return sys.path
+ 
+ 
+ if __name__ == '__main__':
diff --git a/gnu/packages/patches/racket-enable-scheme-backport.patch b/gnu/packages/patches/racket-enable-scheme-backport.patch
deleted file mode 100644
index 3a5a4a3d82..0000000000
--- a/gnu/packages/patches/racket-enable-scheme-backport.patch
+++ /dev/null
@@ -1,465 +0,0 @@
-From 8d7687842f099e3e7e60d3a83fed58b2c6a92863 Mon Sep 17 00:00:00 2001
-From: Matthew Flatt <mflatt@racket-lang.org>
-Date: Sun, 6 Feb 2022 10:36:09 -0700
-Subject: [PATCH 1/2] Chez Scheme: adapt bootfile build for supplied `Scheme=`
-
-(cherry picked from commit fca1e02349664060e10278ca2ce6577a949bebf5)
-
-(Fixed conflicts by dropping pbchunks and pbarch changes.)
----
- racket/src/ChezScheme/configure  | 15 ++++++++++++++-
- racket/src/ChezScheme/s/Mf-base  |  4 ++--
- racket/src/ChezScheme/s/Mf-cross |  4 +++-
- 3 files changed, 19 insertions(+), 4 deletions(-)
-
-diff --git a/racket/src/ChezScheme/configure b/racket/src/ChezScheme/configure
-index 4515ffc105..0098829091 100755
---- a/racket/src/ChezScheme/configure
-+++ b/racket/src/ChezScheme/configure
-@@ -45,6 +45,7 @@ threads=yes
- nothreads=no
- temproot=""
- help=no
-+forceworkarea=no
- gzipmanpages=yes
- installowner=""
- installgroup=""
-@@ -205,6 +206,9 @@ while [ $# != 0 ] ; do
-     --pb)
-       pb=yes
-       ;;
-+    --force)
-+      forceworkarea=yes
-+      ;;
-     --installprefix=*)
-       installprefix=`echo $1 | sed -e 's/^--installprefix=//'`
-       ;;
-@@ -439,6 +443,7 @@ if [ "$help" = "yes" ]; then
-   echo "  --toolprefix=<prefix>             prefix tool (compiler, linker, ...) names"
-   echo "  --[no]gzip-man-pages              compress manual pages ($gzipmanpages)"
-   echo "  --workarea=<pathname>             build directory ($w)"
-+  echo "  --force                           configure even without boot files"
-   echo "  CC=<C compiler>                   C compiler"
-   echo "  CPPFLAGS=<C preprocessor flags>   C preprocessor flags"
-   echo "  CFLAGS=<C compiler flags>         C compiler flags"
-@@ -721,8 +726,16 @@ case "${flagsmuni}" in
-         ;;
- esac
- 
-+if [ "$w" = "$m" ] ; then
-+    configuringin=""
-+else
-+    configuringin=" in $w"
-+fi
-+
- if [ -f boot/$m/scheme.boot -o -f "$srcdir"/boot/$m/scheme.boot ] ; then
--  echo "Configuring for $m"
-+    echo "Configuring for $m$configuringin"
-+elif [ "$forceworkarea" = yes ] ; then
-+    echo "Configuring for $m$configuringin despite missing boot files"
- else
-   if [ "$m" = "" ] ; then
-       maybem="<machine type>"
-diff --git a/racket/src/ChezScheme/s/Mf-base b/racket/src/ChezScheme/s/Mf-base
-index cc6178c973..1f4a967998 100644
---- a/racket/src/ChezScheme/s/Mf-base
-+++ b/racket/src/ChezScheme/s/Mf-base
-@@ -94,7 +94,7 @@ endif
- # that Scheme and SCHEMEHEAPDIRS are set by Mf-cross to point to the host Scheme
- # implementation
- Scheme = ../bin/$m/scheme${ExeSuffix}
--export SCHEMEHEAPDIRS=../boot/%m
-+export SCHEMEHEAPDIRS=../boot/$m
- export CHEZSCHEMELIBDIRS=.
- 
- # Define the libdirs separator character
-@@ -691,4 +691,4 @@ reset-one:
- 
- .PHONY: run
- run:
--	env SCHEMEHEAPDIRS=../boot/$m/ ../bin/$m/scheme $(ARGS)
-+	env SCHEMEHEAPDIRS=${SCHEMEHEAPDIRS} ${Scheme} $(ARGS)
-diff --git a/racket/src/ChezScheme/s/Mf-cross b/racket/src/ChezScheme/s/Mf-cross
-index d796cbb459..397af59a28 100644
---- a/racket/src/ChezScheme/s/Mf-cross
-+++ b/racket/src/ChezScheme/s/Mf-cross
-@@ -43,5 +43,7 @@ x$(xm).$(m):
- 	$(MAKE) -f Mf-cross m=$(m) xm=$(xm) i=f o=3 d=0 xpatch
- 	mv xpatch x$(xm).$(m)
- 
-+ifneq ($(SCHEMEHEAPDIRS),:)
- # Ensure that cross-compiling "nanopass.so" is rebuilt if the host compiler changed
--nanopass.so: ${SCHEME} ${SCHEMEHEAPDIRS}/petite.boot ${SCHEMEHEAPDIRS}/scheme.boot
-+nanopass.so: ${Scheme} ${SCHEMEHEAPDIRS}/petite.boot ${SCHEMEHEAPDIRS}/scheme.boot
-+endif
--- 
-2.32.0
-
-
-From 26c8e2c1d9b02ad85acef8bda40d92154cf0b699 Mon Sep 17 00:00:00 2001
-From: Matthew Flatt <mflatt@racket-lang.org>
-Date: Sun, 6 Feb 2022 11:03:30 -0700
-Subject: [PATCH 2/2] configure: make `--enable-scheme` work with an executable
-
-When the same Chez Scheme version as used by Racket is already
-available, then `--enable-scheme=...` can supply an executable. For
-cross builds, `--enable-scheme=...` can still supply a build
-directory, instead, as before.
-
-(cherry picked from commit 4f0e76855ce7e86107de495292a553469daf0b3f)
----
- racket/src/ChezScheme/makefiles/Makefile.in |  3 ++
- racket/src/README.txt                       | 30 +++++++++++---
- racket/src/configure                        |  8 +++-
- racket/src/cs/README.txt                    |  6 ++-
- racket/src/cs/c/Makefile.in                 | 44 ++++++++++++++++-----
- racket/src/cs/c/configure                   | 24 +++++++++--
- racket/src/cs/c/configure.ac                | 21 ++++++++--
- 7 files changed, 112 insertions(+), 24 deletions(-)
-
-diff --git a/racket/src/ChezScheme/makefiles/Makefile.in b/racket/src/ChezScheme/makefiles/Makefile.in
-index c396efc851..3998ef9ccd 100644
---- a/racket/src/ChezScheme/makefiles/Makefile.in
-+++ b/racket/src/ChezScheme/makefiles/Makefile.in
-@@ -59,6 +59,9 @@ reset:
- %.boot:
- 	(cd $(workarea) && $(MAKE) $*.boot)
- 
-+auto.boot:
-+	(cd $(workarea) && $(MAKE) $(defaultm).boot)
-+
- # <machine>.bootquick to build boot files for <machine>
- # with o=3 d=0 for the cross compiler, and only after
- # building the kernel for the configured machine
-diff --git a/racket/src/README.txt b/racket/src/README.txt
-index 98647aebce..d77310b4a4 100644
---- a/racket/src/README.txt
-+++ b/racket/src/README.txt
-@@ -354,6 +354,10 @@ variant of MinGW without "libdelayimp.a", get the implementation of
- ========================================================================
- 
- Cross-compilation requires at least two flags to `configure`:
-+`--host=OS` and either `--enable-racket=RACKET` or (for Racket CS)
-+`--enable-scheme-SCHEME`.
-+
-+More information:
- 
-  * `--host=OS`, where OS is something like `i386-gnu-linux` to
-    indicate the target platform.
-@@ -374,11 +378,27 @@ Cross-compilation requires at least two flags to `configure`:
-    run `configure` again (with no arguments) in a "local" subdirectory
-    to create a build for the current platform.
- 
--An additional flag is needed for building Racket CS, unless the flag
--`--enable-racket=auto` is used:
--
-- * `--enable-scheme=DIR`, where DIR is a path that has a "ChezScheme"
--   directory where Chez Scheme is built for the host system.
-+ * `--enable-scheme=SCHEME`, where SCHEME is a Chez Scheme executable
-+   executable that runs on the build platform; the executable must be
-+   the same version as used in Racket built for the target platform.
-+ 
-+   Supplying `--enable-scheme=DIR` is also supported in cross-build
-+   mode, where DIR is a path that has a "ChezScheme" directory where
-+   Chez Scheme is built for the host system.
-+
-+The `--enable-racket=RACKET` and `--enable-scheme=SCHEME` flags are
-+allowed for non-cross builds, too:
-+
-+ * For Racket CS, supplying either selects a Racket or Chez Scheme
-+   implementation used to create boot files to the build platform.
-+   Suppling Chez Scheme is a much more direct path, but when Racket is
-+   supplied, its version does not have to match the version being
-+   built.
-+
-+ * For Racket BC, `--enable-racket=RACKET` selects a Racket for
-+   prepare C sources to cooperate with garbage collection. Its version
-+   needs to be close to the one being built, and potentially exactly
-+   the same version.
- 
- Some less commonly needed `configure` flags are for Racket BC:
- 
-diff --git a/racket/src/configure b/racket/src/configure
-index c9f3ba4419..1b53ec7ce2 100755
---- a/racket/src/configure
-+++ b/racket/src/configure
-@@ -9,6 +9,7 @@ pb_dir="$dir/ChezScheme/boot/pb"
- use_cs=maybe
- use_bc=maybe
- supplied_racket=no
-+supplied_scheme=no
- enable_boothelp=
- 
- # We don't have to detect conflicts like `--enable-csdefault --enable-bcdefault`,
-@@ -34,6 +35,9 @@ for arg in $*; do
-         --enable-racket=*)
-             supplied_racket=yes
-             ;;
-+        --enable-scheme=*)
-+            supplied_scheme=yes
-+            ;;
-         --help | -h)
-             echo $0:
-             echo see --help-bc or --help-cs, since the Racket CS build and the
-@@ -70,8 +74,8 @@ elif test "$use_cs" = "maybe" ; then
- fi
- 
- if test "$use_cs" = "yes" ; then
--    if test $use_bc = no  -a $supplied_racket = no -a ! -d "$pb_dir" ; then
--        echo $0: must have $pb_dir or --enable-racket=... for --enable-csonly
-+    if test $use_bc = no  -a $supplied_racket = no  -a $supplied_scheme = no  -a ! -d "$pb_dir" ; then
-+        echo $0: must have $pb_dir, --enable-racket=... or --enable-scheme=... for --enable-csonly
-         exit 1
-     fi
- 
-diff --git a/racket/src/cs/README.txt b/racket/src/cs/README.txt
-index 2ece417b78..8e6fc57b74 100644
---- a/racket/src/cs/README.txt
-+++ b/racket/src/cs/README.txt
-@@ -39,6 +39,11 @@ build:
-    installed in the "../ChezScheme/boot/pb" directory as described by
-    "../ChezScheme/BUILDING".
- 
-+   Supplying `--enable-scheme=...` is also an option if you alerady
-+   have the same version of Chez Scheme built on the current platform.
-+   Another build will be created, anyway, but more quickly than
-+   without Chez Scheme.
-+
-  * Racket is needed to generate the files in the "schemified"
-    directory from the sources in sibling directories like "../io". The
-    Racket version must be practically the same as the current Racket
-@@ -48,7 +53,6 @@ build:
-    Unlike Chez Scheme boot files, the files generated in "schemified"
-    are human-readable and -editable Scheme code. That provides a way
-    out of bootstrapping black holes, even without BC.
--   
- 
- 
- ========================================================================
-diff --git a/racket/src/cs/c/Makefile.in b/racket/src/cs/c/Makefile.in
-index 54a644a1d9..d73993f0fc 100644
---- a/racket/src/cs/c/Makefile.in
-+++ b/racket/src/cs/c/Makefile.in
-@@ -12,7 +12,9 @@ CS_HOST_WORKAREA_PREFIX = @CS_HOST_WORKAREA_PREFIX@
- SCHEME_HOST_WORKAREA = $(CS_HOST_WORKAREA_PREFIX)$(SCHEME_WORKAREA)
- SCHEME_BIN = $(SCHEME_HOST_WORKAREA)/$(MACH)/bin/$(MACH)/scheme
- SCHEME_INC = $(SCHEME_HOST_WORKAREA)/$(MACH)/boot/$(MACH)
--SCHEME = $(SCHEME_BIN) -B $(SCHEME_INC)/petite.boot -B $(SCHEME_INC)/scheme.boot
-+SCHEME_built = $(SCHEME_BIN) -B $(SCHEME_INC)/petite.boot -B $(SCHEME_INC)/scheme.boot
-+SCHEME_existing = @MAKE_SCHEME_SCHEME@
-+SCHEME = $(SCHEME@USE_SCHEME_MODE@)
- 
- TARGET_MACH = @TARGET_MACH@
- SCHEME_TARGET_INC = $(SCHEME_WORKAREA)/$(TARGET_MACH)/boot/$(TARGET_MACH)
-@@ -88,7 +90,7 @@ mainsrcdir = @srcdir@/../..
- @INCLUDEDEP@ @srcdir@/../../version/version.mak
- 
- cs:
--	$(MAKE) scheme@T_CROSS_MODE@
-+	$(MAKE) scheme@MAKE_SCHEME_MODE@
- 	$(MAKE) racket-so
- 	cd rktio; $(MAKE)
- 	$(MAKE) racketcs
-@@ -121,9 +123,13 @@ racket-so:
- 
- RACKET_SO_ENV = @CONFIGURE_RACKET_SO_COMPILE@
- 
-+TARGET_MACH_built = $(TARGET_MACH)
-+TARGET_MACH_existing = xc-$(TARGET_MACH)
-+XPATCH_FILE = $(SCHEME_WORKAREA)/$(TARGET_MACH@USE_SCHEME_MODE@)/s/xpatch
-+
- CS_PROGS = SCHEME="$(SCHEME)"
- CS_OPTS = COMPRESS_COMP=@COMPRESS_COMP@ @ENABLE_OR_DISABLE_WPO@
--CS_OPTScross = $(CS_OPTS) CSO=$(MACH) CROSS_COMP="--xpatch $(SCHEME_WORKAREA)/$(TARGET_MACH)/s/xpatch"
-+CS_OPTScross = $(CS_OPTS) CSO=$(MACH) CROSS_COMP="--xpatch $(XPATCH_FILE)"
- PASS_COMPILE_DEPS = EXTRA_COMPILE_DEPS="$(SCHEME_INC)/petite.boot $(SCHEME_INC)/scheme.boot"
- 
- build-racket-so:
-@@ -163,6 +169,15 @@ pb-bootquick:
- 	cd $(SCHEME_WORKAREA) && $(MAKE) reset
- 	$(SHELL) $(srcdir)/ready_boot.sh $(MACH) $(SCHEME_WORKAREA)
- 
-+scheme-via-scheme:
-+	$(MAKE) $(SCHEME_WORKAREA)/boot/$(MACH)/scheme.boot
-+	$(MAKE) mach-make
-+
-+$(SCHEME_WORKAREA)/boot/$(MACH)/scheme.boot:
-+	mkdir -p $(SCHEME_WORKAREA)
-+	$(MAKE) config-scheme CONFIG_SCHEME_MODE="$(CONFIG_SCHEME_MODE) --force"
-+	cd $(SCHEME_WORKAREA) && $(MAKE) $(MACH).boot Scheme="$(SCHEME)" SCHEMEHEAPDIRS=: o=3 d=0 what=all
-+
- mach-make:
- 	$(MAKE) config-scheme
- 	cd $(SCHEME_WORKAREA) && $(MAKE)
-@@ -182,24 +197,33 @@ config-scheme:
- 
- scheme-cross:
- 	env MAKE_BOOT_FOR_CROSS=yes SCHEME_SRC="$(SCHEME_DIR)" SCHEME_WORKAREA=$(SCHEME_WORKAREA) MACH="$(TARGET_MACH)" $(BOOTSTRAP_RACKET) "$(SCHEME_DIR)"/rktboot/make-boot.rkt
-+	$(MAKE) finish-scheme-cross
-+
-+finish-scheme-cross:
- 	$(SHELL) $(srcdir)/reset_boot.sh $(TARGET_MACH) $(SCHEME_WORKAREA)
- 	cd $(SCHEME_WORKAREA) && "$(UP_SCHEME_DIR)"/configure @SCHEME_CROSS_CONFIG_ARGS@ $(SCHEME_CONFIG_VARS)
- 	cd $(SCHEME_WORKAREA)/$(TARGET_MACH)/c && $(CHOST_HACK@T_CROSS_MODE@) $(MAKE) o=o cross=t
--	$(MAKE) $(SCHEME_WORKAREA)/$(TARGET_MACH)/s/xpatch
-+	$(MAKE) $(XPATCH_FILE)
-+
-+scheme-cross-via-scheme:
-+	$(MAKE) $(SCHEME_WORKAREA)/boot/$(TARGET_MACH)/scheme.boot MACH=$(TARGET_MACH)
-+	$(MAKE) finish-scheme-cross
- 
- # Rebuild patch file and cross "petite.boot" and "scheme.boot" when older
--# than the build-host "scheme.boot" or when "make-boot.rkt" touchs dummy boot files
--XPATCH_DEPS = $(SCHEME_HOST_WORKAREA)/$(MACH)/boot/$(MACH)/scheme.boot \
--              $(SCHEME_WORKAREA)/boot/$(TARGET_MACH)/scheme.boot
-+# than the build-<host "scheme.boot" or when "make-boot.rkt" touchs dummy boot files
-+XPATCH_DEPS_built = $(SCHEME_HOST_WORKAREA)/$(MACH)/boot/$(MACH)/scheme.boot \
-+                    $(SCHEME_WORKAREA)/boot/$(TARGET_MACH)/scheme.boot
-+XPATCH_DEPS_existing = 
-+XPATCH_DEPS = $(XPATCH_DEPS@USE_SCHEME_MODE@)
- 
--$(SCHEME_WORKAREA)/$(TARGET_MACH)/s/xpatch: $(XPATCH_DEPS)
-+$(XPATCH_FILE): $(XPATCH_DEPS)
- 	$(MAKE) bounce TARGET=build-xpatch-using-host
- 
- build-xpatch-using-host:
- 	cd $(SCHEME_WORKAREA)/$(TARGET_MACH)/s && $(MAKE) -f Mf-cross m=$(MACH) xm=$(TARGET_MACH) Scheme="$(SCHEME_BIN)" SCHEMEHEAPDIRS="$(SCHEME_INC)"
- 
- XPATCH =
--XPATCHcross = --xpatch $(SCHEME_WORKAREA)/$(TARGET_MACH)/s/xpatch
-+XPATCHcross = --xpatch $(XPATCH_FILE)
- 
- racket.boot: racket.so
- 	$(SCHEME) --script $(srcdir)/convert-to-boot.ss @BOOT_COMPRESS_COMP@ $(XPATCH@CROSS_MODE@) racket.so racket.boot $(TARGET_MACH)
-@@ -410,7 +434,7 @@ install-cross:
- 	$(MAKE) compile-xpatch.$(TARGET_MACH)
- 	$(MAKE) library-xpatch.$(TARGET_MACH)
- 
--SCHEME_XPATCH = $(SCHEME_WORKAREA)/$(TARGET_MACH)/s/xpatch
-+SCHEME_XPATCH = $(XPATCH_FILE)
- 
- CROSS_SERVE_DEPS = $(srcdir)/mk-cross-serve.ss $(srcdir)/cross-serve.ss \
-                    $(srcdir)/../expander/env.ss $(srcdir)/../linklet/config.ss
-diff --git a/racket/src/cs/c/configure b/racket/src/cs/c/configure
-index 21695a431a..1eeef57753 100755
---- a/racket/src/cs/c/configure
-+++ b/racket/src/cs/c/configure
-@@ -654,6 +654,9 @@ MINGW
- NOT_OSX
- OSX
- SETUP_BOOT_MODE
-+USE_SCHEME_MODE
-+MAKE_SCHEME_SCHEME
-+MAKE_SCHEME_MODE
- TT_CROSS_MODE
- T_CROSS_MODE
- CROSS_MODE
-@@ -1448,7 +1451,7 @@ Optional Features:
-   --enable-docs           build docs on install (enabled by default)
-   --enable-usersetup      setup user-specific files on install
-   --enable-racket=<path>  use <path> as Racket for build; or "auto" to create
--  --enable-scheme=<path>  use <path> as host's build directory for cross
-+  --enable-scheme=<path>  use <path> as host build for cross
-   --enable-mach=<mach>    use Chez Scheme machine type <mach>
-   --enable-target=<mach>  cross-build for Chez Scheme machine type <mach>
-   --enable-portable       prefer portable to host-specific
-@@ -2867,7 +2870,7 @@ show_explicitly_enabled "${enable_xonx}" "Unix style"
- show_explicitly_enabled "${enable_libzo}" 'Compiled ".zo" files moved to lib'
- 
- show_explicitly_set "${enable_racket}" "Racket"
--show_explicitly_set "${enable_scheme}" "Chez Scheme build directory"
-+show_explicitly_set "${enable_scheme}" "Chez Scheme for build"
- show_explicitly_set "${enable_mach}" "machine type"
- show_explicitly_set "${enable_target}" "cross-build machine type"
- show_explicitly_enabled "${enable_portable}" "portable"
-@@ -4745,9 +4748,21 @@ esac
- 
- SCHEME_DIR=${srcdir}/../../ChezScheme
- MAKE_BUILD_SCHEME=checkout
-+USE_SCHEME_MODE="_built"
-+MAKE_SCHEME_MODE="${T_CROSS_MODE}"
- 
- if test "${enable_scheme}" != "" ; then
--  CS_HOST_WORKAREA_PREFIX="${enable_scheme}/"
-+   if test -d "${enable_scheme}" ; then
-+     # Directory exists, so use it as a build directory
-+     echo "Using supplied Scheme path as a build directory"
-+     CS_HOST_WORKAREA_PREFIX="${enable_scheme}/"
-+   else
-+     # Directory does not exist, so assume it's an executable
-+     echo "Using supplied Scheme path as an executable"
-+     MAKE_SCHEME_MODE="${T_CROSS_MODE}-via-scheme"
-+     MAKE_SCHEME_SCHEME="${enable_scheme}"
-+     USE_SCHEME_MODE="_existing"
-+   fi
- fi
- 
- if test "${enable_racket}" != "" ; then
-@@ -6012,6 +6027,9 @@ SCHEME_CROSS_CONFIG_ARGS="--machine=${TARGET_MACH} --disable-x11 ${cs_auto_flags
- 
- 
- 
-+
-+
-+
- 
- 
- 
-diff --git a/racket/src/cs/c/configure.ac b/racket/src/cs/c/configure.ac
-index 464ebe1760..aaee88156d 100644
---- a/racket/src/cs/c/configure.ac
-+++ b/racket/src/cs/c/configure.ac
-@@ -23,7 +23,7 @@ AC_ARG_ENABLE(compressmore, [  --enable-compressmore   compress compiled code ev
- AC_ARG_ENABLE(compressboot, [  --enable-compressboot   compress boot files])
- m4_include(../ac/path_arg.m4)
- AC_ARG_ENABLE(racket,     [  --enable-racket=<path>  use <path> as Racket for build; or "auto" to create])
--AC_ARG_ENABLE(scheme,     [  --enable-scheme=<path>  use <path> as host's build directory for cross])
-+AC_ARG_ENABLE(scheme,     [  --enable-scheme=<path>  use <path> as host build for cross])
- AC_ARG_ENABLE(mach,       [  --enable-mach=<mach>    use Chez Scheme machine type <mach>])
- AC_ARG_ENABLE(target,     [  --enable-target=<mach>  cross-build for Chez Scheme machine type <mach>])
- m4_include(../ac/portable_arg.m4)
-@@ -81,7 +81,7 @@ show_explicitly_disabled "${enable_compressboot}" "Compressed boot files"
- show_explicitly_enabled "${enable_xonx}" "Unix style"
- m4_include(../ac/path_show.m4)
- show_explicitly_set "${enable_racket}" "Racket"
--show_explicitly_set "${enable_scheme}" "Chez Scheme build directory"
-+show_explicitly_set "${enable_scheme}" "Chez Scheme for build"
- show_explicitly_set "${enable_mach}" "machine type"
- show_explicitly_set "${enable_target}" "cross-build machine type"
- m4_include(../ac/portable_show.m4)
-@@ -504,9 +504,21 @@ esac
- 
- SCHEME_DIR=${srcdir}/../../ChezScheme
- MAKE_BUILD_SCHEME=checkout
-+USE_SCHEME_MODE="_built"
-+MAKE_SCHEME_MODE="${T_CROSS_MODE}"
- 
- if test "${enable_scheme}" != "" ; then
--  CS_HOST_WORKAREA_PREFIX="${enable_scheme}/"
-+   if test -d "${enable_scheme}" ; then
-+     # Directory exists, so use it as a build directory
-+     echo "Using supplied Scheme path as a build directory"
-+     CS_HOST_WORKAREA_PREFIX="${enable_scheme}/"
-+   else
-+     # Directory does not exist, so assume it's an executable
-+     echo "Using supplied Scheme path as an executable"
-+     MAKE_SCHEME_MODE="${T_CROSS_MODE}-via-scheme"
-+     MAKE_SCHEME_SCHEME="${enable_scheme}"
-+     USE_SCHEME_MODE="_existing"
-+   fi     
- fi
- 
- if test "${enable_racket}" != "" ; then
-@@ -821,6 +833,9 @@ AC_SUBST(DIFF_MACH)
- AC_SUBST(CROSS_MODE)
- AC_SUBST(T_CROSS_MODE)
- AC_SUBST(TT_CROSS_MODE)
-+AC_SUBST(MAKE_SCHEME_MODE)
-+AC_SUBST(MAKE_SCHEME_SCHEME)
-+AC_SUBST(USE_SCHEME_MODE)
- AC_SUBST(SETUP_BOOT_MODE)
- AC_SUBST(OSX)
- AC_SUBST(NOT_OSX)
--- 
-2.32.0
-
diff --git a/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch b/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch
deleted file mode 100644
index 1e018eaa79..0000000000
--- a/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From aa792e707b1fbc5cc33691bfaee5828dc3fbebaa Mon Sep 17 00:00:00 2001
-From: Matthew Flatt <mflatt@racket-lang.org>
-Date: Mon, 31 Jan 2022 15:31:22 -0700
-Subject: [PATCH] fix creation of tethered launchers
-
-Related to racket/racket#4133
-
-(cherry picked from commit 563c68432f127729592f234ef30c31e92618b517)
----
- gui-lib/mred/installer.rkt | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/gui-lib/mred/installer.rkt b/gui-lib/mred/installer.rkt
-index b1691472..9ef06c53 100644
---- a/gui-lib/mred/installer.rkt
-+++ b/gui-lib/mred/installer.rkt
-@@ -72,4 +72,5 @@
-    (list "-A" (path->string (find-system-path 'addon-dir)))))
- 
- (define (config-flags)
--  (list "-G" (path->string (find-config-dir))))
-+  (list "-X" (path->string (find-collects-dir))
-+        "-G" (path->string (find-config-dir))))
--- 
-2.32.0
-