summary refs log tree commit diff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/agg-2.5-gcc8.patch14
-rw-r--r--gnu/packages/patches/alpine-fix-privacy-policy-crash.patch39
-rw-r--r--gnu/packages/patches/atlas-gfortran-compat.patch37
-rw-r--r--gnu/packages/patches/audacity-add-include.patch15
-rw-r--r--gnu/packages/patches/audacity-build-with-system-portaudio.patch62
-rw-r--r--gnu/packages/patches/awesome-4.3-fno-common.patch178
-rw-r--r--gnu/packages/patches/aws-c-auth-install-private-headers.patch19
-rw-r--r--gnu/packages/patches/aws-c-cal-cmake-prefix.patch13
-rw-r--r--gnu/packages/patches/aws-c-event-stream-cmake-prefix.patch13
-rw-r--r--gnu/packages/patches/aws-c-io-cmake-prefix.patch13
-rw-r--r--gnu/packages/patches/aws-c-io-disable-networking-tests.patch81
-rw-r--r--gnu/packages/patches/aws-checksums-cmake-prefix.patch13
-rw-r--r--gnu/packages/patches/bdb-5.3-atomics-on-gcc-9.patch22
-rw-r--r--gnu/packages/patches/bear-disable-preinstall-tests.patch40
-rw-r--r--gnu/packages/patches/behave-skip-a-couple-of-tests.patch462
-rw-r--r--gnu/packages/patches/biber-fix-encoding-write.patch31
-rw-r--r--gnu/packages/patches/biber-sortinithash.patch1666
-rw-r--r--gnu/packages/patches/bind-re-add-attr-constructor-priority.patch57
-rw-r--r--gnu/packages/patches/binutils-2.37-file-descriptor-leak.patch231
-rw-r--r--gnu/packages/patches/binutils-CVE-2021-45078.patch257
-rw-r--r--gnu/packages/patches/binutils-loongson-workaround.patch14
-rw-r--r--gnu/packages/patches/binutils-mingw-w64-timestamp.patch39
-rw-r--r--gnu/packages/patches/blender-2.79-gcc8.patch36
-rw-r--r--gnu/packages/patches/blender-2.79-gcc9.patch53
-rw-r--r--gnu/packages/patches/blender-2.79-newer-ffmpeg.patch80
-rw-r--r--gnu/packages/patches/blender-2.79-oiio2.patch284
-rw-r--r--gnu/packages/patches/blender-2.79-python-3.7-fix.patch43
-rw-r--r--gnu/packages/patches/blender-2.79-python-3.8-fix.patch204
-rw-r--r--gnu/packages/patches/bubblewrap-fix-locale-in-tests.patch34
-rw-r--r--gnu/packages/patches/c++-gsl-move-array-bounds-tests.patch126
-rw-r--r--gnu/packages/patches/cabal-install-base16-bytestring1.0.patch29
-rw-r--r--gnu/packages/patches/cabal-install-ghc8.10.patch393
-rw-r--r--gnu/packages/patches/calibre-fix-zeroconf.patch38
-rw-r--r--gnu/packages/patches/ccache-fix-basedir-test.patch26
-rw-r--r--gnu/packages/patches/cdrkit-libre-cross-compile.patch32
-rw-r--r--gnu/packages/patches/ceph-boost-compat.patch18
-rw-r--r--gnu/packages/patches/ceph-rocksdb-compat.patch303
-rw-r--r--gnu/packages/patches/cheese-vala-update.patch180
-rw-r--r--gnu/packages/patches/chez-scheme-build-util-paths-backport.patch780
-rw-r--r--gnu/packages/patches/clang-10.0-libc-search-path.patch93
-rw-r--r--gnu/packages/patches/clang-11.0-libc-search-path.patch101
-rw-r--r--gnu/packages/patches/clang-12.0-libc-search-path.patch84
-rw-r--r--gnu/packages/patches/clang-13.0-libc-search-path.patch96
-rw-r--r--gnu/packages/patches/clang-7.0-libc-search-path.patch82
-rw-r--r--gnu/packages/patches/clang-8.0-libc-search-path.patch94
-rw-r--r--gnu/packages/patches/clang-9.0-libc-search-path.patch90
-rw-r--r--gnu/packages/patches/classpath-miscompilation.patch71
-rw-r--r--gnu/packages/patches/cling-use-shared-library.patch329
-rw-r--r--gnu/packages/patches/cool-retro-term-wctype.patch13
-rw-r--r--gnu/packages/patches/coq-fix-envvars.patch139
-rw-r--r--gnu/packages/patches/coreutils-gnulib-tests.patch45
-rw-r--r--gnu/packages/patches/cpufrequtils-fix-aclocal.patch46
-rw-r--r--gnu/packages/patches/cups-CVE-2020-10001.patch47
-rw-r--r--gnu/packages/patches/curl-7.76-use-ssl-cert-env.patch64
-rw-r--r--gnu/packages/patches/curl-7.77-tls-priority-string.patch98
-rw-r--r--gnu/packages/patches/curl-use-ssl-cert-env.patch4
-rw-r--r--gnu/packages/patches/dbus-CVE-2020-12049.patch58
-rw-r--r--gnu/packages/patches/dealii-fix-compiliation-with-boost-1.78.patch40
-rw-r--r--gnu/packages/patches/dealii-fix-sundials.patch60
-rw-r--r--gnu/packages/patches/diffoscope-fix-llvm-test.patch28
-rw-r--r--gnu/packages/patches/diffutils-fix-signal-processing.patch58
-rw-r--r--gnu/packages/patches/diffutils-gets-undeclared.patch71
-rw-r--r--gnu/packages/patches/disarchive-cross-compilation.patch77
-rw-r--r--gnu/packages/patches/docbook-xsl-nonrecursive-string-subst.patch11
-rw-r--r--gnu/packages/patches/docbook-xsl-support-old-url.patch17
-rw-r--r--gnu/packages/patches/doxygen-1.8.17-runtests.patch73
-rw-r--r--gnu/packages/patches/doxygen-test.patch60
-rw-r--r--gnu/packages/patches/dune-istl-2.7-fix-non-mpi-tests.patch82
-rw-r--r--gnu/packages/patches/dynaconf-unvendor-deps.patch179
-rw-r--r--gnu/packages/patches/elogind-revert-polkit-detection.patch41
-rw-r--r--gnu/packages/patches/emacs-exwm-fix-fullscreen-states.patch39
-rw-r--r--gnu/packages/patches/emacs-telega-path-placeholder.patch49
-rw-r--r--gnu/packages/patches/emacs-telega-test-env.patch30
-rw-r--r--gnu/packages/patches/enlightenment-fix-setuid-path.patch33
-rw-r--r--gnu/packages/patches/eog-update-libportal-usage.patch40
-rw-r--r--gnu/packages/patches/epiphany-update-libportal-usage.patch53
-rw-r--r--gnu/packages/patches/evolution-CVE-2020-11879.patch122
-rw-r--r--gnu/packages/patches/evolution-data-server-CVE-2020-14928.patch115
-rw-r--r--gnu/packages/patches/evolution-data-server-CVE-2020-16117.patch28
-rw-r--r--gnu/packages/patches/evolution-data-server-libical-compat.patch36
-rw-r--r--gnu/packages/patches/evolution-data-server-locales.patch33
-rw-r--r--gnu/packages/patches/fifengine-boost-compat.patch17
-rw-r--r--gnu/packages/patches/findutils-test-rwlock-threads.patch38
-rw-r--r--gnu/packages/patches/flatpak-fix-path.patch29
-rw-r--r--gnu/packages/patches/fontconfig-cache-ignore-mtime.patch15
-rw-r--r--gnu/packages/patches/fontconfig-hurd-path-max.patch17
-rw-r--r--gnu/packages/patches/freecad-boost-serialization.patch27
-rw-r--r--gnu/packages/patches/freecad-vtk9.patch827
-rw-r--r--gnu/packages/patches/freeglut-gcc-compat.patch53
-rw-r--r--gnu/packages/patches/ganeti-deterministic-manual.patch16
-rw-r--r--gnu/packages/patches/ganeti-drbd-compat.patch166
-rw-r--r--gnu/packages/patches/ganeti-haskell-compat.patch18
-rw-r--r--gnu/packages/patches/ganeti-os-disk-size.patch17
-rw-r--r--gnu/packages/patches/ganeti-preserve-PYTHONPATH.patch21
-rw-r--r--gnu/packages/patches/ganeti-sphinx-compat.patch24
-rw-r--r--gnu/packages/patches/gcc-10-cross-environment-variables.patch51
-rw-r--r--gnu/packages/patches/gcc-5-fix-powerpc64le-build.patch64
-rw-r--r--gnu/packages/patches/gcc-cross-gxx-include-dir.patch73
-rw-r--r--gnu/packages/patches/gd-Revert-fix-303-gdlib.pc.patch179
-rw-r--r--gnu/packages/patches/gdb-fix-gnu-nat-build.patch254
-rw-r--r--gnu/packages/patches/gdb-hurd.patch69
-rw-r--r--gnu/packages/patches/gdk-pixbuf-CVE-2020-29385.patch53
-rw-r--r--gnu/packages/patches/gdm-default-session.patch37
-rw-r--r--gnu/packages/patches/gdm-elogind-support.patch211
-rw-r--r--gnu/packages/patches/gdm-pass-gdk-pixbuf-loader-env.patch24
-rw-r--r--gnu/packages/patches/gdm-remove-hardcoded-xwayland-path.patch22
-rw-r--r--gnu/packages/patches/gdm-wayland-session-wrapper-from-env.patch35
-rw-r--r--gnu/packages/patches/geary-CVE-2020-24661.patch133
-rw-r--r--gnu/packages/patches/geeqie-clutter.patch35
-rw-r--r--gnu/packages/patches/genimage-mke2fs-test.patch40
-rw-r--r--gnu/packages/patches/genimage-signedness.patch24
-rw-r--r--gnu/packages/patches/ghc-diff-swap-cover-args.patch20
-rw-r--r--gnu/packages/patches/ghc-haddock-api-fix-haddock.patch54
-rw-r--r--gnu/packages/patches/ghc-hpack-fix-tests.patch193
-rw-r--r--gnu/packages/patches/ghc-language-haskell-extract-ghc-8.10.patch27
-rw-r--r--gnu/packages/patches/ghc-microlens-aeson-fix-tests.patch27
-rw-r--r--gnu/packages/patches/ghc-pandoc-fix-html-tests.patch92
-rw-r--r--gnu/packages/patches/ghc-pandoc-fix-latex-test.patch31
-rw-r--r--gnu/packages/patches/ghostscript-CVE-2020-15900.patch36
-rw-r--r--gnu/packages/patches/ghostscript-freetype-compat.patch35
-rw-r--r--gnu/packages/patches/ghostscript-no-header-creationdate.patch22
-rw-r--r--gnu/packages/patches/glade-gls-set-script-name.patch32
-rw-r--r--gnu/packages/patches/glade-test-widget-null-icon.patch30
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27218.patch132
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-01.patch176
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-02.patch264
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-03.patch136
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-04.patch308
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-05.patch47
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-06.patch94
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-07.patch118
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-08.patch94
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-09.patch98
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-10.patch52
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-11.patch57
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-12.patch30
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-13.patch32
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-14.patch32
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-15.patch95
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-16.patch43
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-17.patch37
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-18.patch232
-rw-r--r--gnu/packages/patches/glib-CVE-2021-28153.patch283
-rw-r--r--gnu/packages/patches/glib-networking-32-bit-time.patch61
-rw-r--r--gnu/packages/patches/glib-networking-gnutls-binding.patch21
-rw-r--r--gnu/packages/patches/glib-skip-failing-test.patch27
-rw-r--r--gnu/packages/patches/glib-tests-timer.patch15
-rw-r--r--gnu/packages/patches/glibc-2.27-git-fixes.patch702
-rw-r--r--gnu/packages/patches/glibc-2.27-supported-locales.patch33
-rw-r--r--gnu/packages/patches/glibc-2.28-git-fixes.patch248
-rw-r--r--gnu/packages/patches/glibc-2.28-supported-locales.patch33
-rw-r--r--gnu/packages/patches/glibc-2.31-hurd-clock_gettime_monotonic.patch84
-rw-r--r--gnu/packages/patches/glibc-bootstrap-system.patch37
-rw-r--r--gnu/packages/patches/glibc-cross-objcopy.patch159
-rw-r--r--gnu/packages/patches/glibc-cross-objdump.patch159
-rw-r--r--gnu/packages/patches/glibc-dl-cache.patch140
-rw-r--r--gnu/packages/patches/glibc-hurd-clock_gettime_monotonic.patch19
-rw-r--r--gnu/packages/patches/glibc-skip-c++.patch31
-rw-r--r--gnu/packages/patches/glibc-static-nss.patch1244
-rw-r--r--gnu/packages/patches/gnome-boxes-add-guix-logo.patch32
-rw-r--r--gnu/packages/patches/gnome-builder-update-libportal.patch93
-rw-r--r--gnu/packages/patches/gnome-control-center-libexecdir.patch58
-rw-r--r--gnu/packages/patches/gnome-online-miners-tracker-3.patch1505
-rw-r--r--gnu/packages/patches/gnome-screenshot-meson-0.60.patch39
-rw-r--r--gnu/packages/patches/gnome-session-support-elogind.patch73
-rw-r--r--gnu/packages/patches/gnome-shell-CVE-2020-17489.patch46
-rw-r--r--gnu/packages/patches/gnome-shell-disable-test.patch25
-rw-r--r--gnu/packages/patches/gnome-shell-theme.patch51
-rw-r--r--gnu/packages/patches/gnome-todo-delete-esource-duplicate.patch10
-rw-r--r--gnu/packages/patches/gnome-todo-libportal.patch54
-rw-r--r--gnu/packages/patches/gnupg-1-build-with-gcc10.patch64
-rw-r--r--gnu/packages/patches/gnutls-CVE-2021-20231.patch62
-rw-r--r--gnu/packages/patches/gnutls-CVE-2021-20232.patch60
-rw-r--r--gnu/packages/patches/gnutls-guile-eintr-eagain.patch56
-rw-r--r--gnu/packages/patches/go-github-com-golang-snappy-32bit-test.patch53
-rw-r--r--gnu/packages/patches/gpaste-fix-paths.patch24
-rw-r--r--gnu/packages/patches/graphviz-CVE-2020-18032.patch49
-rw-r--r--gnu/packages/patches/grfcodec-gcc-compat.patch31
-rw-r--r--gnu/packages/patches/gtk-doc-respect-xml-catalog.patch16
-rw-r--r--gnu/packages/patches/gtk-introspection-test.patch22
-rw-r--r--gnu/packages/patches/gtk2-fix-builder-test.patch94
-rw-r--r--gnu/packages/patches/gtk4-respect-GUIX_GTK4_PATH.patch51
-rw-r--r--gnu/packages/patches/guile-email-fix-tests.patch35
-rw-r--r--gnu/packages/patches/guile-git-adjust-for-libgit2-1.2.0.patch78
-rw-r--r--gnu/packages/patches/guile-ssh-fix-test-suite.patch217
-rw-r--r--gnu/packages/patches/guile-ssh-read-error.patch18
-rw-r--r--gnu/packages/patches/gvfs-add-support-for-libplist-2.2.patch34
-rw-r--r--gnu/packages/patches/hedgewars-network-bsd.patch150
-rw-r--r--gnu/packages/patches/helm-fix-gcc-9-build.patch140
-rw-r--r--gnu/packages/patches/hexchat-add-libera-chat.patch76
-rw-r--r--gnu/packages/patches/htslib-for-stringtie.patch26
-rw-r--r--gnu/packages/patches/hueplusplus-mbedtls.patch20
-rw-r--r--gnu/packages/patches/i3status-rust-enable-unstable-features.patch20
-rw-r--r--gnu/packages/patches/i7z-gcc-10.patch23
-rw-r--r--gnu/packages/patches/icecat-makeicecat.patch133
-rw-r--r--gnu/packages/patches/icedtea-6-extend-hotspot-aarch64-support.patch1831
-rw-r--r--gnu/packages/patches/icu4c-CVE-2020-10531.patch127
-rw-r--r--gnu/packages/patches/idris-build-with-haskeline-0.8.patch85
-rw-r--r--gnu/packages/patches/idris-build-with-megaparsec-9.patch27
-rw-r--r--gnu/packages/patches/inetutils-hurd.patch583
-rw-r--r--gnu/packages/patches/inkscape-1.1-fix-build-witch-gcc7.5.patch24
-rw-r--r--gnu/packages/patches/jacal-fix-texinfo.patch92
-rw-r--r--gnu/packages/patches/jami-fix-crash-on-quit.patch34
-rw-r--r--gnu/packages/patches/jsoncpp-fix-inverted-case.patch22
-rw-r--r--gnu/packages/patches/jsoncpp-pkg-config-version.patch24
-rw-r--r--gnu/packages/patches/julia-allow-parallel-build.patch32
-rw-r--r--gnu/packages/patches/lcms-CVE-2018-16435.patch171
-rw-r--r--gnu/packages/patches/ldc-bootstrap-disable-tests.patch72
-rw-r--r--gnu/packages/patches/ldc-disable-phobos-tests.patch22
-rw-r--r--gnu/packages/patches/libblockdev-glib-compat.patch61
-rw-r--r--gnu/packages/patches/libcacard-unknown-variable.patch50
-rw-r--r--gnu/packages/patches/libmicrohttpd-0.9.73-test-ssl3.patch35
-rw-r--r--gnu/packages/patches/librime-fix-build-with-gcc10.patch41
-rw-r--r--gnu/packages/patches/libsequoia-fix-ffi-Makefile.patch32
-rw-r--r--gnu/packages/patches/libsequoia-remove-store.patch432
-rw-r--r--gnu/packages/patches/libsigrokdecode-python3.9-fix.patch19
-rw-r--r--gnu/packages/patches/libtirpc-hurd-client.patch50
-rw-r--r--gnu/packages/patches/libtool-skip-tests2.patch8
-rw-r--r--gnu/packages/patches/libunwind-julia-fix-GCC10-fno-common.patch40
-rw-r--r--gnu/packages/patches/libxml2-parent-pointers.patch228
-rw-r--r--gnu/packages/patches/libxml2-terminating-newline.patch33
-rw-r--r--gnu/packages/patches/libxml2-xpath-recursion-limit.patch20
-rw-r--r--gnu/packages/patches/libxt-guix-search-paths.patch13
-rw-r--r--gnu/packages/patches/linuxdcpp-openssl-1.1.patch26
-rw-r--r--gnu/packages/patches/llvm-3.6-fix-build-with-gcc-10.patch13
-rw-r--r--gnu/packages/patches/lua-5.4-liblua-so.patch33
-rw-r--r--gnu/packages/patches/lua-5.4-pkgconfig.patch110
-rw-r--r--gnu/packages/patches/mariadb-CVE-2021-27928.patch642
-rw-r--r--gnu/packages/patches/mathjax-disable-webpack.patch23
-rw-r--r--gnu/packages/patches/mathjax-no-a11y.patch286
-rw-r--r--gnu/packages/patches/mesa-opencl-all-targets.patch25
-rw-r--r--gnu/packages/patches/mesa-skip-tests.patch48
-rw-r--r--gnu/packages/patches/meson-allow-dirs-outside-of-prefix.patch20
-rw-r--r--gnu/packages/patches/meson-for-build-rpath.patch24
-rw-r--r--gnu/packages/patches/metabat-fix-compilation.patch39
-rw-r--r--gnu/packages/patches/mit-krb5-hurd.patch15
-rw-r--r--gnu/packages/patches/mit-krb5-qualify-short-hostnames.patch29
-rw-r--r--gnu/packages/patches/mixxx-link-qtscriptbytearray-qtscript.patch25
-rw-r--r--gnu/packages/patches/mixxx-system-googletest-benchmark.patch43
-rw-r--r--gnu/packages/patches/monero-use-system-miniupnpc.patch12
-rw-r--r--gnu/packages/patches/mpg321-gcc-10.patch83
-rw-r--r--gnu/packages/patches/mupdf-CVE-2021-3407.patch51
-rw-r--r--gnu/packages/patches/mupdf-fix-linkage.patch27
-rw-r--r--gnu/packages/patches/nautilus-add-libportal-gtk3.patch61
-rw-r--r--gnu/packages/patches/network-manager-meson.patch21
-rw-r--r--gnu/packages/patches/network-manager-plugin-path.patch69
-rw-r--r--gnu/packages/patches/ngless-unliftio.patch66
-rw-r--r--gnu/packages/patches/nix-dont-build-html-doc.diff26
-rw-r--r--gnu/packages/patches/nss-getcwd-nonnull.patch30
-rw-r--r--gnu/packages/patches/ocaml-4.09-multiple-definitions.patch41
-rw-r--r--gnu/packages/patches/ocaml-cairo2-caml_ba_array-fix.patch68
-rw-r--r--gnu/packages/patches/ocaml-multiple-definitions.patch43
-rw-r--r--gnu/packages/patches/ocaml-ppx-variants-ppxlib-api-change.patch42
-rw-r--r--gnu/packages/patches/ocaml-qcheck-fix-test-whitespace.patch24
-rw-r--r--gnu/packages/patches/opencv-fix-build-of-grfmt_jpeg2000.cpp.patch39
-rw-r--r--gnu/packages/patches/opencv-rgbd-aarch64-test-fix.patch40
-rw-r--r--gnu/packages/patches/openrgb-unbundle-hueplusplus.patch58
-rw-r--r--gnu/packages/patches/p11-kit-hurd.patch46
-rw-r--r--gnu/packages/patches/password-store-tree-compat.patch29
-rw-r--r--gnu/packages/patches/passwordsafe-meson-remove-extra-argument.patch20
-rw-r--r--gnu/packages/patches/perl-cross.patch60
-rw-r--r--gnu/packages/patches/perl-deterministic-ordering.patch29
-rw-r--r--gnu/packages/patches/perl-io-socket-ssl-openssl-1.0.2f-fix.patch33
-rw-r--r--gnu/packages/patches/perl-no-sys-dirs.patch99
-rw-r--r--gnu/packages/patches/php-bug-74093-test.patch48
-rw-r--r--gnu/packages/patches/php-openssl_x509_checkpurpose_basic.patch108
-rw-r--r--gnu/packages/patches/pigx-bsseq-no-citeproc.patch33
-rw-r--r--gnu/packages/patches/pigx-chipseq-no-citeproc.patch33
-rw-r--r--gnu/packages/patches/pigx-rnaseq-no-citeproc.patch33
-rw-r--r--gnu/packages/patches/pigx-sars-cov2-ww-no-citeproc.patch33
-rw-r--r--gnu/packages/patches/pigx-scrnaseq-no-citeproc.patch33
-rw-r--r--gnu/packages/patches/pipewire-0.2.7-fno-common.patch51
-rw-r--r--gnu/packages/patches/pitivi-fix-build-with-meson-0.60.patch46
-rw-r--r--gnu/packages/patches/pjproject-correct-the-cflags-field.patch121
-rw-r--r--gnu/packages/patches/pjproject-fix-pkg-config-ldflags.patch79
-rw-r--r--gnu/packages/patches/pjproject-install-libpjsua2.patch19
-rw-r--r--gnu/packages/patches/polkit-configure-elogind.patch15
-rw-r--r--gnu/packages/patches/polkit-use-duktape.patch5030
-rw-r--r--gnu/packages/patches/ppsspp-disable-upgrade-and-gold.patch234
-rw-r--r--gnu/packages/patches/pulseview-glib-2.68.patch54
-rw-r--r--gnu/packages/patches/purescript-relax-dependencies.patch40
-rw-r--r--gnu/packages/patches/python-2.7-no-static-lib.patch70
-rw-r--r--gnu/packages/patches/python-3-fix-tests.patch194
-rw-r--r--gnu/packages/patches/python-3-hurd-configure.patch27
-rw-r--r--gnu/packages/patches/python-3-no-static-lib.patch75
-rw-r--r--gnu/packages/patches/python-3.8-CVE-2021-3177.patch194
-rw-r--r--gnu/packages/patches/python-3.8-fix-tests.patch42
-rw-r--r--gnu/packages/patches/python-3.9-fix-tests.patch370
-rw-r--r--gnu/packages/patches/python-babel-fix-parse-future-test.patch68
-rw-r--r--gnu/packages/patches/python-chai-drop-python2.patch32
-rw-r--r--gnu/packages/patches/python-docopt-pytest6-compat.patch29
-rw-r--r--gnu/packages/patches/python-fixtures-remove-monkeypatch-test.patch59
-rw-r--r--gnu/packages/patches/python-magic-python-bytecode.patch19
-rw-r--r--gnu/packages/patches/python-pdoc3-tests.patch42
-rw-r--r--gnu/packages/patches/python-peachpy-determinism.patch25
-rw-r--r--gnu/packages/patches/python-piexif-fix-tests-with-pillow-7.2.patch44
-rw-r--r--gnu/packages/patches/python-poppler-qt5-fix-build.patch116
-rw-r--r--gnu/packages/patches/python-pydot-regression-test.patch79
-rw-r--r--gnu/packages/patches/python-pyflakes-test-location.patch42
-rw-r--r--gnu/packages/patches/python-pytorch-system-libraries.patch164
-rw-r--r--gnu/packages/patches/python-random2-getrandbits-test.patch23
-rw-r--r--gnu/packages/patches/python-testtools.patch57
-rw-r--r--gnu/packages/patches/python-typing-inspect-fix.patch38
-rw-r--r--gnu/packages/patches/python-versioneer-guix-support.patch35
-rw-r--r--gnu/packages/patches/python-werkzeug-tests.patch58
-rw-r--r--gnu/packages/patches/qemu-CVE-2021-20203.patch172
-rw-r--r--gnu/packages/patches/qemu-fix-agent-paths.patch66
-rw-r--r--gnu/packages/patches/qemu-meson-compat.patch27
-rw-r--r--gnu/packages/patches/qemu-sphinx-compat.patch18
-rw-r--r--gnu/packages/patches/qtwebkit-fix-building-with-bison-3.7.patch54
-rw-r--r--gnu/packages/patches/qtwebkit-fix-building-with-glib-2.68.patch21
-rw-r--r--gnu/packages/patches/qtwebkit-fix-building-with-icu-68.patch152
-rw-r--r--gnu/packages/patches/qtwebkit-fix-building-with-python-3.9.patch35
-rw-r--r--gnu/packages/patches/quassel-qt-514-compat.patch130
-rw-r--r--gnu/packages/patches/r-httpuv-1.5.5-unvendor-libuv.patch34
-rw-r--r--gnu/packages/patches/racket-minimal-backport-1629887.patch28
-rw-r--r--gnu/packages/patches/ragel-char-signedness.patch42
-rw-r--r--gnu/packages/patches/range-v3-build-with-gcc10.patch122
-rw-r--r--gnu/packages/patches/retroarch-LIBRETRO_DIRECTORY.patch32
-rw-r--r--gnu/packages/patches/rust-1.19-mrustc.patch28
-rw-r--r--gnu/packages/patches/rust-1.25-accept-more-detailed-gdb-lines.patch111
-rw-r--r--gnu/packages/patches/rust-1.30-gdb-llvm.patch89
-rw-r--r--gnu/packages/patches/rust-1.45-linker-locale.patch14
-rw-r--r--gnu/packages/patches/rust-1.48-linker-locale.patch14
-rw-r--r--gnu/packages/patches/rust-adblock-ignore-live-tests.patch69
-rw-r--r--gnu/packages/patches/rust-bootstrap-stage0-test.patch55
-rw-r--r--gnu/packages/patches/rust-openssl-sys-no-vendor.patch2
-rw-r--r--gnu/packages/patches/rust-reproducible-builds.patch25
-rw-r--r--gnu/packages/patches/rust-shell2batch-lint-fix.patch25
-rw-r--r--gnu/packages/patches/rust-wl-clipboard-rs-newer-wl.patch26
-rw-r--r--gnu/packages/patches/rustc-1.39.0-src.patch99
-rw-r--r--gnu/packages/patches/sbcl-aserve-add-HTML-5-elements.patch63
-rw-r--r--gnu/packages/patches/sbcl-aserve-fix-rfe12668.patch43
-rw-r--r--gnu/packages/patches/scalapack-blacs-mpi-deprecations.patch170
-rw-r--r--gnu/packages/patches/scalapack-gcc-10-compilation.patch5684
-rw-r--r--gnu/packages/patches/sendgmail-accept-ignored-gsuite-flag.patch39
-rw-r--r--gnu/packages/patches/sendgmail-remove-domain-restriction.patch34
-rw-r--r--gnu/packages/patches/shadow-hurd-pctrl.patch16
-rw-r--r--gnu/packages/patches/spice-vdagent-glib-2.68.patch112
-rw-r--r--gnu/packages/patches/sssd-collision-with-external-nss-symbol.patch71
-rw-r--r--gnu/packages/patches/sssd-fix-samba-4.15.3.patch523
-rw-r--r--gnu/packages/patches/strace-readlink-tests.patch46
-rw-r--r--gnu/packages/patches/supertux-unbundle-squirrel.patch17
-rw-r--r--gnu/packages/patches/syslinux-gcc10.patch87
-rw-r--r--gnu/packages/patches/syslinux-strip-gnu-property.patch31
-rw-r--r--gnu/packages/patches/tcl-fix-cross-compilation.patch39
-rw-r--r--gnu/packages/patches/tcsh-fix-autotest.patch11
-rw-r--r--gnu/packages/patches/telepathy-glib-channel-memory-leak.patch19
-rw-r--r--gnu/packages/patches/tensorflow-c-api-fix.patch312
-rw-r--r--gnu/packages/patches/texlive-bin-poppler-0.83.patch52
-rw-r--r--gnu/packages/patches/texlive-bin-poppler-0.86.patch17
-rw-r--r--gnu/packages/patches/tootle-glib-object-naming.patch66
-rw-r--r--gnu/packages/patches/tootle-reason-phrase.patch48
-rw-r--r--gnu/packages/patches/tor-sandbox-i686.patch36
-rw-r--r--gnu/packages/patches/transmission-remote-gtk-fix-appstream.patch61
-rw-r--r--gnu/packages/patches/tremc-fix-decodestring.patch25
-rw-r--r--gnu/packages/patches/trytond-add-egg-modules-to-path.patch22
-rw-r--r--gnu/packages/patches/trytond-add-guix_trytond_path.patch26
-rw-r--r--gnu/packages/patches/u-boot-allow-disabling-openssl.patch164
-rw-r--r--gnu/packages/patches/u-boot-rk3399-enable-emmc-phy.patch26
-rw-r--r--gnu/packages/patches/udiskie-no-appindicator.patch155
-rw-r--r--gnu/packages/patches/ungoogled-chromium-RUNPATH.patch22
-rw-r--r--gnu/packages/patches/ungoogled-chromium-accelerated-video-decode.patch18
-rw-r--r--gnu/packages/patches/ungoogled-chromium-system-ffmpeg.patch18
-rw-r--r--gnu/packages/patches/vigra-python-compat.patch18
-rw-r--r--gnu/packages/patches/widelands-add-missing-map-include.patch28
-rw-r--r--gnu/packages/patches/wpa-supplicant-CVE-2021-27803.patch50
-rw-r--r--gnu/packages/patches/wpa-supplicant-CVE-2021-30004.patch115
-rw-r--r--gnu/packages/patches/xdg-desktop-portal-wlr-harcoded-length.patch28
-rw-r--r--gnu/packages/patches/xf86-video-mach64-bool-to-boolean.patch79
-rw-r--r--gnu/packages/patches/xf86-video-nouveau-fixup-ABI.patch64
-rw-r--r--gnu/packages/patches/xf86-video-qxl-fix-build.patch101
-rw-r--r--gnu/packages/patches/xgboost-use-system-dmlc-core.patch53
-rw-r--r--gnu/packages/patches/xmonad-next-dynamic-linking.patch16
-rw-r--r--gnu/packages/patches/xpra-4.2-install_libs.patch29
-rw-r--r--gnu/packages/patches/xygrib-fix-finding-data.patch131
-rw-r--r--gnu/packages/patches/yggdrasil-extra-config.patch78
-rw-r--r--gnu/packages/patches/zig-disable-libc-note-test.patch31
-rw-r--r--gnu/packages/patches/zig-use-system-paths.patch148
-rw-r--r--gnu/packages/patches/zstd-CVE-2021-24031_CVE-2021-24032.patch68
-rw-r--r--gnu/packages/patches/zziplib-CVE-2018-16548.patch49
381 files changed, 28924 insertions, 17366 deletions
diff --git a/gnu/packages/patches/agg-2.5-gcc8.patch b/gnu/packages/patches/agg-2.5-gcc8.patch
new file mode 100644
index 0000000000..dfcfc6cd4a
--- /dev/null
+++ b/gnu/packages/patches/agg-2.5-gcc8.patch
@@ -0,0 +1,14 @@
+Taken from: https://gitweb.gentoo.org/repo/gentoo.git/tree/x11-libs/agg/files/agg-2.5-gcc8.patch.
+
+diff -uprN agg-2.5/include/agg_renderer_outline_aa.h agg-2.5-fixed/include/agg_renderer_outline_aa.h
+--- agg-2.5/include/agg_renderer_outline_aa.h	2018-08-25 02:02:52.507254241 +0800
++++ agg-2.5-fixed/include/agg_renderer_outline_aa.h	2018-08-25 02:04:15.291175316 +0800
+@@ -1375,7 +1375,7 @@ namespace agg
+         //---------------------------------------------------------------------
+         void profile(const line_profile_aa& prof) { m_profile = &prof; }
+         const line_profile_aa& profile() const { return *m_profile; }
+-        line_profile_aa& profile() { return *m_profile; }
++        const line_profile_aa& profile() { return *m_profile; }
+ 
+         //---------------------------------------------------------------------
+         int subpixel_width() const { return m_profile->subpixel_width(); }
diff --git a/gnu/packages/patches/alpine-fix-privacy-policy-crash.patch b/gnu/packages/patches/alpine-fix-privacy-policy-crash.patch
new file mode 100644
index 0000000000..d514ac33a0
--- /dev/null
+++ b/gnu/packages/patches/alpine-fix-privacy-policy-crash.patch
@@ -0,0 +1,39 @@
+X-Git-Url: https://repo.or.cz/alpine.git/blobdiff_plain/fb2217ac67706e4cbef69bea41041e2fb8b910e9..3ee981816abfb7d47ffc0ac522fff002b5749b72:/alpine/help.c
+
+diff --git a/alpine/help.c b/alpine/help.c
+index 4f1bf46..e9c7b34 100644
+--- a/alpine/help.c
++++ b/alpine/help.c
+@@ -36,6 +36,7 @@ static char rcsid[] = "$Id: help.c 1032 2008-04-11 00:30:04Z hubert@u.washington
+ #include "../pith/detoken.h"
+ #include "../pith/list.h"
+ #include "../pith/margin.h"
++#include "../pith/busy.h"
+ 
+ 
+ typedef struct _help_scroll {
+@@ -135,10 +136,12 @@ helper_internal(HelpType text, char *frag, char *title, int flags)
+     is_external = 0;
+ 
+     if(shown_text && *shown_text && !struncmp(*shown_text, "x-alpine-http:", 14)){
+-	int status;
++	int status, we_cancel = 0;
++
++	we_cancel = busy_cue(_("Retrieving help text"), NULL, 1);
+ 	HTTPSTREAM *stream = http_open(*shown_text + 14);
+ 	if(stream) help_text = http_get(stream, NULL);
+-	status = stream->status ? stream->status->code : -1;
++	status = stream && stream->status ? stream->status->code : -1;
+ 	if(stream) http_close(stream);
+ 	if(status != HTTP_OK){
+ 	    shown_text = NO_HELP;
+@@ -165,7 +168,8 @@ helper_internal(HelpType text, char *frag, char *title, int flags)
+ 		*rv = NULL;
+ 	    }
+ 	}
+-
++	if(we_cancel)
++	   cancel_busy_cue(-1);
+     }
+ 
+     if(F_ON(F_BLANK_KEYMENU,ps_global)){
diff --git a/gnu/packages/patches/atlas-gfortran-compat.patch b/gnu/packages/patches/atlas-gfortran-compat.patch
new file mode 100644
index 0000000000..5b46f5a64d
--- /dev/null
+++ b/gnu/packages/patches/atlas-gfortran-compat.patch
@@ -0,0 +1,37 @@
+Fix build with gfortran 10.
+
+Taken from Debian:
+https://salsa.debian.org/science-team/atlas/-/blob/master/debian/patches/gfortran-10.patch
+
+--- a/interfaces/blas/C/testing/c_dblat1.f
++++ b/interfaces/blas/C/testing/c_dblat1.f
+@@ -247,11 +247,11 @@
+             IF (ICASE.EQ.7) THEN
+ *              .. DNRM2TEST ..
+                STEMP(1) = DTRUE1(NP1)
+-               CALL STEST1(DNRM2TEST(N,SX,INCX),STEMP,STEMP,SFAC)
++               CALL STEST1(DNRM2TEST(N,SX,INCX),STEMP(1),STEMP,SFAC)
+             ELSE IF (ICASE.EQ.8) THEN
+ *              .. DASUMTEST ..
+                STEMP(1) = DTRUE3(NP1)
+-               CALL STEST1(DASUMTEST(N,SX,INCX),STEMP,STEMP,SFAC)
++               CALL STEST1(DASUMTEST(N,SX,INCX),STEMP(1),STEMP,SFAC)
+             ELSE IF (ICASE.EQ.9) THEN
+ *              .. DSCALTEST ..
+                CALL DSCALTEST(N,SA((INCX-1)*5+NP1),SX,INCX)
+--- a/interfaces/blas/C/testing/c_sblat1.f
++++ b/interfaces/blas/C/testing/c_sblat1.f
+@@ -247,11 +247,11 @@
+             IF (ICASE.EQ.7) THEN
+ *              .. SNRM2TEST ..
+                STEMP(1) = DTRUE1(NP1)
+-               CALL STEST1(SNRM2TEST(N,SX,INCX),STEMP,STEMP,SFAC)
++               CALL STEST1(SNRM2TEST(N,SX,INCX),STEMP(1),STEMP,SFAC)
+             ELSE IF (ICASE.EQ.8) THEN
+ *              .. SASUMTEST ..
+                STEMP(1) = DTRUE3(NP1)
+-               CALL STEST1(SASUMTEST(N,SX,INCX),STEMP,STEMP,SFAC)
++               CALL STEST1(SASUMTEST(N,SX,INCX),STEMP(1),STEMP,SFAC)
+             ELSE IF (ICASE.EQ.9) THEN
+ *              .. SSCALTEST ..
+                CALL SSCALTEST(N,SA((INCX-1)*5+NP1),SX,INCX)
diff --git a/gnu/packages/patches/audacity-add-include.patch b/gnu/packages/patches/audacity-add-include.patch
deleted file mode 100644
index a7f27918e7..0000000000
--- a/gnu/packages/patches/audacity-add-include.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-Without <sys/time.h>, gettimeofday is undefined.
-
-diff --git a/src/AudioIO.cpp b/src/AudioIO.cpp
-index 0187e3962..e15d55f4c 100644
---- a/src/AudioIO.cpp
-+++ b/src/AudioIO.cpp
-@@ -479,6 +479,8 @@ time warp info and AudioIOListener and whether the playback is looped.
- #include "../lib-src/portmidi/porttime/porttime.h"
- #include "../lib-src/header-substitutes/allegro.h"
- 
-+#include <sys/time.h>
-+
-    #define MIDI_SLEEP 10 /* milliseconds */
-    // how long do we think the thread that fills MIDI buffers,
-    // if it is separate from the portaudio thread,
diff --git a/gnu/packages/patches/audacity-build-with-system-portaudio.patch b/gnu/packages/patches/audacity-build-with-system-portaudio.patch
deleted file mode 100644
index 05325a1493..0000000000
--- a/gnu/packages/patches/audacity-build-with-system-portaudio.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-Downloaded from here:
-https://sourceforge.net/p/audacity/mailman/message/36106562/
-
-Modified for use on later versions of audacity.
-
->From 5f9482a191359f2c477763a36d2c865c5f186602 Mon Sep 17 00:00:00 2001
-From: Antonio Ospite <ao2@ao2.it>
-Date: Tue, 7 Nov 2017 13:06:33 +0100
-Subject: [PATCH] Fix building against the system portaudio library
-
-Building against the system portaudio results in this error:
-
-./src/AudioIO.cpp:983: undefined reference to `PaUtil_GetTime'
-audacity-AudioIO.o: In function `audacityAudioCallback(void const*, void*,
-unsigned long, PaStreamCallbackTimeInfo const*, unsigned long, void*)':
-./src/AudioIO.cpp:4630: undefined reference to `PaUtil_GetTime'
-collect2: error: ld returned 1 exit status
-Makefile:2349: recipe for target 'audacity' failed
-make[3]: *** [audacity] Error 1
-
-This is because PaUtil_GetTime is declared as a C symbol in pa_util.h
-but is resolved as a C++ symbol at link time.
-
-Audacity fixes this in the local tree with this change:
-https://github.com/audacity/audacity/commit/38fd97b8e26060332ab3e9e000a8882326a70ba7
-
-However this is not general enough for the portaudio debian package.
-
-Since PaUtil_GetTime() is the only function causing problems, just copy
-over the code where it's used.
----
- src/AudioIO.cpp | 17 ++++++++++++++++-
- 1 file changed, 16 insertions(+), 1 deletion(-)
-
-diff --git a/src/AudioIO.cpp b/src/AudioIO.cpp
-index 48715869c..bb4bf472c 100644
---- a/src/AudioIO.cpp
-+++ b/src/AudioIO.cpp
-@@ -480,9 +480,22 @@ time warp info and AudioIOListener and whether the playback is looped.
-    #define ROUND(x) (int) ((x)+0.5)
-    //#include <string.h>
- //   #include "../lib-src/portmidi/pm_common/portmidi.h"
--   #include "../lib-src/portaudio-v19/src/common/pa_util.h"
-    #include "NoteTrack.h"
- #endif
-+PaTime PaUtil_GetTime( void )
-+{
-+#ifdef HAVE_MACH_ABSOLUTE_TIME
-+    return mach_absolute_time() * machSecondsConversionScaler_;
-+#elif defined(HAVE_CLOCK_GETTIME)
-+    struct timespec tp;
-+    clock_gettime(CLOCK_REALTIME, &tp);
-+    return (PaTime)(tp.tv_sec + tp.tv_nsec * 1e-9);
-+#else
-+    struct timeval tv;
-+    gettimeofday( &tv, NULL );
-+    return (PaTime) tv.tv_usec * 1e-6 + tv.tv_sec;
-+#endif
-+}
- 
- #ifdef EXPERIMENTAL_AUTOMATED_INPUT_LEVEL_ADJUSTMENT
-    #define LOWER_BOUND 0.0
diff --git a/gnu/packages/patches/awesome-4.3-fno-common.patch b/gnu/packages/patches/awesome-4.3-fno-common.patch
new file mode 100644
index 0000000000..62f153d012
--- /dev/null
+++ b/gnu/packages/patches/awesome-4.3-fno-common.patch
@@ -0,0 +1,178 @@
+Taken from: https://github.com/awesomeWM/awesome/commit/d256d9055095f27a33696e0aeda4ee20ed4fb1a0
+Author: Reiner Herrmann <reiner@reiner-h.de>
+
+--- a/common/lualib.c
++++ b/common/lualib.c
+@@ -20,6 +20,8 @@
+ #include "common/lualib.h"
+ #include "luaa.h"
+ 
++lua_CFunction lualib_dofunction_on_error;
++
+ void luaA_checkfunction(lua_State *L, int idx)
+ {
+     if(!lua_isfunction(L, idx))
+--- a/common/lualib.h
++++ b/common/lualib.h
+@@ -28,7 +28,7 @@
+ #include "common/util.h"
+ 
+ /** Lua function to call on dofunction() error */
+-lua_CFunction lualib_dofunction_on_error;
++extern lua_CFunction lualib_dofunction_on_error;
+ 
+ void luaA_checkfunction(lua_State *, int);
+ void luaA_checktable(lua_State *, int);
+--- a/luaa.c
++++ b/luaa.c
+@@ -91,6 +91,8 @@ extern const struct luaL_Reg awesome_mouse_meta[];
+ extern const struct luaL_Reg awesome_root_methods[];
+ extern const struct luaL_Reg awesome_root_meta[];
+ 
++signal_array_t global_signals;
++
+ /** A call into the Lua code aborted with an error.
+  *
+  * This signal is used in the example configuration, @{05-awesomerc.md},
+--- a/luaa.h
++++ b/luaa.h
+@@ -317,7 +317,7 @@ const char *luaA_find_config(xdgHandle *, const char *, luaA_config_callback *);
+ bool luaA_parserc(xdgHandle *, const char *);
+ 
+ /** Global signals */
+-signal_array_t global_signals;
++extern signal_array_t global_signals;
+ 
+ int luaA_class_index_miss_property(lua_State *, lua_object_t *);
+ int luaA_class_newindex_miss_property(lua_State *, lua_object_t *);
+--- a/objects/button.c
++++ b/objects/button.c
+@@ -35,6 +35,8 @@
+ 
+ #include "button.h"
+ 
++lua_class_t button_class;
++
+ /** Button object.
+  *
+  * @tfield int button The mouse button number, or 0 for any button.
+--- a/objects/button.h
++++ b/objects/button.h
+@@ -39,7 +39,7 @@ typedef struct button_t
+     xcb_button_t button;
+ } button_t;
+ 
+-lua_class_t button_class;
++extern lua_class_t button_class;
+ LUA_OBJECT_FUNCS(button_class, button_t, button)
+ ARRAY_FUNCS(button_t *, button, DO_NOTHING)
+ 
+--- a/objects/client.c
++++ b/objects/client.c
+@@ -108,6 +108,8 @@
+ #include <xcb/shape.h>
+ #include <cairo-xcb.h>
+ 
++lua_class_t client_class;
++
+ /** Client class.
+  *
+  * This table allow to add more dynamic properties to the clients. For example,
+--- a/objects/client.h
++++ b/objects/client.h
+@@ -200,7 +200,7 @@ struct client_t
+ ARRAY_FUNCS(client_t *, client, DO_NOTHING)
+ 
+ /** Client class */
+-lua_class_t client_class;
++extern lua_class_t client_class;
+ 
+ LUA_OBJECT_FUNCS(client_class, client_t, client)
+ 
+--- a/objects/drawin.c
++++ b/objects/drawin.c
+@@ -46,6 +46,8 @@
+ #include <cairo-xcb.h>
+ #include <xcb/shape.h>
+ 
++lua_class_t drawin_class;
++
+ /** Drawin object.
+  *
+  * @field border_width Border width.
+--- a/objects/drawin.h
++++ b/objects/drawin.h
+@@ -52,7 +52,7 @@ void luaA_drawin_systray_kickout(lua_State *);
+ 
+ void drawin_class_setup(lua_State *);
+ 
+-lua_class_t drawin_class;
++extern lua_class_t drawin_class;
+ 
+ #endif
+ // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
+--- a/objects/key.c
++++ b/objects/key.c
+@@ -43,6 +43,8 @@
+ #include <xkbcommon/xkbcommon.h>
+ #include <glib.h>
+ 
++lua_class_t key_class;
++
+ /** Key object.
+  *
+  * @tfield string key The key to trigger an event.
+--- a/objects/key.h
++++ b/objects/key.h
+@@ -36,7 +36,7 @@ typedef struct keyb_t
+     xcb_keycode_t keycode;
+ } keyb_t;
+ 
+-lua_class_t key_class;
++extern lua_class_t key_class;
+ LUA_OBJECT_FUNCS(key_class, keyb_t, key)
+ DO_ARRAY(keyb_t *, key, DO_NOTHING)
+ 
+--- a/objects/tag.c
++++ b/objects/tag.c
+@@ -190,6 +190,8 @@
+ #include "ewmh.h"
+ #include "luaa.h"
+
++lua_class_t tag_class;
++
+ /**
+  * @signal request::select
+  */
+--- a/objects/tag.h
++++ b/objects/tag.h
+@@ -46,7 +46,7 @@ struct tag
+     client_array_t clients;
+ };
+ 
+-lua_class_t tag_class;
++extern lua_class_t tag_class;
+ LUA_OBJECT_FUNCS(tag_class, tag_t, tag)
+ 
+ void tag_class_setup(lua_State *);
+--- a/objects/window.c
++++ b/objects/window.c
+@@ -59,6 +59,7 @@
+ #include "property.h"
+ #include "xwindow.h"
+ 
++lua_class_t window_class;
+ LUA_CLASS_FUNCS(window, window_class)
+ 
+ static xcb_window_t
+--- a/objects/window.h
++++ b/objects/window.h
+@@ -80,7 +80,7 @@ typedef struct
+     WINDOW_OBJECT_HEADER
+ } window_t;
+ 
+-lua_class_t window_class;
++extern lua_class_t window_class;
+ 
+ void window_class_setup(lua_State *);
+
diff --git a/gnu/packages/patches/aws-c-auth-install-private-headers.patch b/gnu/packages/patches/aws-c-auth-install-private-headers.patch
new file mode 100644
index 0000000000..990fd6f2eb
--- /dev/null
+++ b/gnu/packages/patches/aws-c-auth-install-private-headers.patch
@@ -0,0 +1,19 @@
+aws-sdk-cpp depends on the private headers from aws-c-auth. This dependency was
+added to aws-sdk-cpp in commit 23cca02c2df on 2021-06-04.
+
+The following error is generated when building aws-sdk-cpp when the private
+aws-c-auth headers are not installed:
+
+/tmp/guix-build-aws-sdk-cpp-1.9.121.drv-0/aws-sdk-cpp-1.9.121-checkout/aws-cpp-sdk-core-tests/aws/auth/AWSAuthSignerTest.cpp:17:10: fatal error: aws/auth/private/aws_signing.h: No such file or directory
+ #include <aws/auth/private/aws_signing.h>
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -110,6 +114,7 @@ target_link_libraries(${PROJECT_NAME} PUBLIC ${DEP_AWS_LIBS} ${PLATFORM_LIBS})
+ aws_prepare_shared_lib_exports(${PROJECT_NAME})
+ 
+ install(FILES ${AWS_AUTH_ROOT_HEADERS} DESTINATION "include/aws/auth" COMPONENT Development)
++install(FILES ${AWS_AUTH_PRIVATE_HEADERS} DESTINATION "include/aws/auth/private" COMPONENT Development)
+ 
+ if (BUILD_SHARED_LIBS)
+    set (TARGET_DIR "shared")
diff --git a/gnu/packages/patches/aws-c-cal-cmake-prefix.patch b/gnu/packages/patches/aws-c-cal-cmake-prefix.patch
deleted file mode 100644
index 1ee7aa851d..0000000000
--- a/gnu/packages/patches/aws-c-cal-cmake-prefix.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -10,6 +10,10 @@ endif()
- 
- option(BYO_CRYPTO "Set this if you want to provide your own cryptography implementation. This will cause the defaults to not be compiled." OFF)
- 
-+if (DEFINED ENV{CMAKE_PREFIX_PATH})
-+    set(CMAKE_PREFIX_PATH $ENV{CMAKE_PREFIX_PATH})
-+endif()
-+
- if (DEFINED CMAKE_PREFIX_PATH)
-     file(TO_CMAKE_PATH "${CMAKE_PREFIX_PATH}" CMAKE_PREFIX_PATH)
- endif()
diff --git a/gnu/packages/patches/aws-c-event-stream-cmake-prefix.patch b/gnu/packages/patches/aws-c-event-stream-cmake-prefix.patch
deleted file mode 100644
index 79655a910b..0000000000
--- a/gnu/packages/patches/aws-c-event-stream-cmake-prefix.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -3,6 +3,10 @@
- cmake_minimum_required (VERSION 3.1)
- project (aws-c-event-stream C)
- 
-+if (DEFINED ENV{CMAKE_PREFIX_PATH})
-+    set(CMAKE_PREFIX_PATH $ENV{CMAKE_PREFIX_PATH})
-+endif()
-+
- if (DEFINED CMAKE_PREFIX_PATH)
-     file(TO_CMAKE_PATH "${CMAKE_PREFIX_PATH}" CMAKE_PREFIX_PATH)
- endif()
diff --git a/gnu/packages/patches/aws-c-io-cmake-prefix.patch b/gnu/packages/patches/aws-c-io-cmake-prefix.patch
deleted file mode 100644
index da3e4eb4a5..0000000000
--- a/gnu/packages/patches/aws-c-io-cmake-prefix.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -6,6 +6,10 @@ if (POLICY CMP0069)
-     cmake_policy(SET CMP0069 NEW) # Enable LTO/IPO if available in the compiler, see AwsCFlags
- endif()
- 
-+if (DEFINED ENV{CMAKE_PREFIX_PATH})
-+    set(CMAKE_PREFIX_PATH $ENV{CMAKE_PREFIX_PATH})
-+endif()
-+
- if (DEFINED CMAKE_PREFIX_PATH)
-     file(TO_CMAKE_PATH "${CMAKE_PREFIX_PATH}" CMAKE_PREFIX_PATH)
- endif()
diff --git a/gnu/packages/patches/aws-c-io-disable-networking-tests.patch b/gnu/packages/patches/aws-c-io-disable-networking-tests.patch
deleted file mode 100644
index 09fe11310c..0000000000
--- a/gnu/packages/patches/aws-c-io-disable-networking-tests.patch
+++ /dev/null
@@ -1,81 +0,0 @@
---- a/tests/CMakeLists.txt
-+++ b/tests/CMakeLists.txt
-@@ -52,8 +52,8 @@ add_test_case(local_socket_communication)
- add_net_test_case(tcp_socket_communication)
- add_net_test_case(udp_socket_communication)
- add_test_case(udp_bind_connect_communication)
--add_net_test_case(connect_timeout)
--add_net_test_case(connect_timeout_cancelation)
-+#add_net_test_case(connect_timeout)
-+#add_net_test_case(connect_timeout_cancelation)
- if (USE_VSOCK)
- 	add_test_case(vsock_loopback_socket_communication)
- endif ()
-@@ -64,7 +64,7 @@ add_test_case(incoming_tcp_sock_errors)
- add_test_case(incoming_duplicate_tcp_bind_errors)
- add_test_case(incoming_udp_sock_errors)
- add_test_case(wrong_thread_read_write_fails)
--add_net_test_case(cleanup_before_connect_or_timeout_doesnt_explode)
-+#add_net_test_case(cleanup_before_connect_or_timeout_doesnt_explode)
- add_test_case(cleanup_in_accept_doesnt_explode)
- add_test_case(cleanup_in_write_cb_doesnt_explode)
- add_test_case(sock_write_cb_is_async)
-@@ -81,21 +81,21 @@ add_test_case(channel_tasks_run)
- add_test_case(channel_rejects_post_shutdown_tasks)
- add_test_case(channel_cancels_pending_tasks)
- add_test_case(channel_duplicate_shutdown)
--add_net_test_case(channel_connect_some_hosts_timeout)
-+#add_net_test_case(channel_connect_some_hosts_timeout)
-
--add_net_test_case(test_default_with_ipv6_lookup)
-+#add_net_test_case(test_default_with_ipv6_lookup)
- add_test_case(test_resolver_ipv6_address_lookup)
--add_net_test_case(test_default_with_multiple_lookups)
-+#add_net_test_case(test_default_with_multiple_lookups)
- add_test_case(test_resolver_ipv4_address_lookup)
--add_net_test_case(test_default_with_ipv4_only_lookup)
-+#add_net_test_case(test_default_with_ipv4_only_lookup)
- add_test_case(test_resolver_ttls)
- add_test_case(test_resolver_connect_failure_recording)
- add_test_case(test_resolver_ttl_refreshes_on_resolve)
-
- add_net_test_case(test_resolver_listener_create_destroy)
--add_net_test_case(test_resolver_add_listener_before_host)
--add_net_test_case(test_resolver_add_listener_after_host)
--add_net_test_case(test_resolver_add_multiple_listeners_fn)
-+#add_net_test_case(test_resolver_add_listener_before_host)
-+#add_net_test_case(test_resolver_add_listener_after_host)
-+#add_net_test_case(test_resolver_add_multiple_listeners_fn)
- add_net_test_case(test_resolver_listener_host_re_add_fn)
- add_net_test_case(test_resolver_listener_multiple_results)
- add_net_test_case(test_resolver_listener_address_expired_fn)
-@@ -119,20 +119,20 @@ add_test_case(socket_handler_close)
- if (NOT BYO_CRYPTO)
-     add_net_test_case(test_concurrent_cert_import)
-     add_test_case(tls_channel_echo_and_backpressure_test)
--    add_net_test_case(tls_client_channel_negotiation_error_expired)
--    add_net_test_case(tls_client_channel_negotiation_error_wrong_host)
--    add_net_test_case(tls_client_channel_negotiation_error_self_signed)
--    add_net_test_case(tls_client_channel_negotiation_error_untrusted_root)
-+    #add_net_test_case(tls_client_channel_negotiation_error_expired)
-+    #add_net_test_case(tls_client_channel_negotiation_error_wrong_host)
-+    #add_net_test_case(tls_client_channel_negotiation_error_self_signed)
-+    #add_net_test_case(tls_client_channel_negotiation_error_untrusted_root)
-     #track these down in s2n and find out why that aren't failing.
-     #add_net_test_case(tls_client_channel_negotiation_error_revoked)
-     #add_net_test_case(tls_client_channel_negotiation_error_pinning)
--    add_net_test_case(tls_client_channel_negotiation_error_socket_closed)
--    add_net_test_case(tls_client_channel_negotiation_success)
--    add_net_test_case(tls_client_channel_negotiation_success_ecc256)
--    add_net_test_case(tls_client_channel_negotiation_success_ecc384)
-+    #add_net_test_case(tls_client_channel_negotiation_error_socket_closed)
-+    #add_net_test_case(tls_client_channel_negotiation_success)
-+    #add_net_test_case(tls_client_channel_negotiation_success_ecc256)
-+    #add_net_test_case(tls_client_channel_negotiation_success_ecc384)
-     add_net_test_case(tls_server_multiple_connections)
-     add_net_test_case(tls_server_hangup_during_negotiation)
--    add_net_test_case(tls_client_channel_no_verify)
-+    #add_net_test_case(tls_client_channel_no_verify)
-     add_net_test_case(test_tls_negotiation_timeout)
-     add_net_test_case(tls_double_channel)
-     add_net_test_case(alpn_successfully_negotiates)
diff --git a/gnu/packages/patches/aws-checksums-cmake-prefix.patch b/gnu/packages/patches/aws-checksums-cmake-prefix.patch
deleted file mode 100644
index f6a5c9ad9c..0000000000
--- a/gnu/packages/patches/aws-checksums-cmake-prefix.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -8,6 +8,10 @@
-     cmake_policy(SET CMP0069 NEW) # Enable LTO/IPO if available in the compiler, see AwsCFlags
- endif()
- 
-+if (DEFINED ENV{CMAKE_PREFIX_PATH})
-+    set(CMAKE_PREFIX_PATH $ENV{CMAKE_PREFIX_PATH})
-+endif()
-+
- if (DEFINED CMAKE_PREFIX_PATH)
-     file(TO_CMAKE_PATH "${CMAKE_PREFIX_PATH}" CMAKE_PREFIX_PATH)
- endif()
diff --git a/gnu/packages/patches/bdb-5.3-atomics-on-gcc-9.patch b/gnu/packages/patches/bdb-5.3-atomics-on-gcc-9.patch
new file mode 100644
index 0000000000..56d404da15
--- /dev/null
+++ b/gnu/packages/patches/bdb-5.3-atomics-on-gcc-9.patch
@@ -0,0 +1,22 @@
+Patch borrowed from Arch Linux. Allows compiling bdb 5.3 and earlier with GCC newer than 7.
+
+--- src/dbinc/atomic.h	2013-03-12 14:07:22.000000000 -0400
++++ src/dbinc/atomic.h.change	2013-03-12 14:06:35.000000000 -0400
+@@ -144,7 +144,7 @@
+ #define	atomic_inc(env, p)	__atomic_inc(p)
+ #define	atomic_dec(env, p)	__atomic_dec(p)
+ #define	atomic_compare_exchange(env, p, o, n)	\
+-	__atomic_compare_exchange((p), (o), (n))
++	__atomic_compare_exchange_db((p), (o), (n))
+ static inline int __atomic_inc(db_atomic_t *p)
+ {
+ 	int	temp;
+@@ -176,7 +176,7 @@
+  * http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Atomic-Builtins.html
+  * which configure could be changed to use.
+  */
+-static inline int __atomic_compare_exchange(
++static inline int __atomic_compare_exchange_db(
+ 	db_atomic_t *p, atomic_value_t oldval, atomic_value_t newval)
+ {
+ 	atomic_value_t was;
diff --git a/gnu/packages/patches/bear-disable-preinstall-tests.patch b/gnu/packages/patches/bear-disable-preinstall-tests.patch
deleted file mode 100644
index c65095405f..0000000000
--- a/gnu/packages/patches/bear-disable-preinstall-tests.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From d7d0cdd48017679e8529f8475d1b9902944cf243 Mon Sep 17 00:00:00 2001
-From: Brett Gilio <brettg@gnu.org>
-Date: Sun, 20 Dec 2020 14:43:30 -0600
-Subject: [PATCH] Disallow Pre-install Checks
-
----
- CMakeLists.txt | 8 --------
- 1 file changed, 8 deletions(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 45c6d27..73b4ace 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -58,10 +58,6 @@ ExternalProject_Add(BearSource
-             -DROOT_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
-             -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-             -DENABLE_UNIT_TESTS:BOOL=${ENABLE_UNIT_TESTS}
--        TEST_BEFORE_INSTALL
--            1
--        TEST_COMMAND
--            ctest # or `ctest -T memcheck`
-         )
- 
- # Run the functional tests
-@@ -73,12 +69,8 @@ if (ENABLE_FUNC_TESTS)
-                 BearSource
-             CMAKE_CACHE_ARGS
-                 -DSTAGED_INSTALL_PREFIX:PATH=${STAGED_INSTALL_PREFIX}
--            TEST_BEFORE_INSTALL
--                1
-             INSTALL_COMMAND
-                 ""
--            TEST_COMMAND
--                ctest --verbose
-             )
- endif ()
- 
--- 
-2.29.2
-
diff --git a/gnu/packages/patches/behave-skip-a-couple-of-tests.patch b/gnu/packages/patches/behave-skip-a-couple-of-tests.patch
deleted file mode 100644
index e3d4e15241..0000000000
--- a/gnu/packages/patches/behave-skip-a-couple-of-tests.patch
+++ /dev/null
@@ -1,462 +0,0 @@
-Fix build with Python 3.8, this is a patch based on upstream commit [1].
-
-1: c000c88eb5239b87f299c85e83b349b0ef387ae7
-
-
-diff --git a/behave.ini b/behave.ini
-index 45c0f0d7..952240d6 100644
---- a/behave.ini
-+++ b/behave.ini
-@@ -15,8 +15,9 @@ show_skipped = false
- format   = rerun
-     progress3
- outfiles = rerun.txt
--    reports/report_progress3.txt
-+    build/behave.reports/report_progress3.txt
- junit = true
-+junit_directory = build/behave.reports
- logging_level = INFO
- # logging_format = LOG.%(levelname)-8s  %(name)-10s: %(message)s
- # logging_format = LOG.%(levelname)-8s  %(asctime)s  %(name)-10s: %(message)s
-diff --git a/features/environment.py b/features/environment.py
-index 4744e89a..3769ee40 100644
---- a/features/environment.py
-+++ b/features/environment.py
-@@ -1,5 +1,7 @@
- # -*- coding: UTF-8 -*-
-+# FILE: features/environemnt.py
- 
-+from __future__ import absolute_import, print_function
- from behave.tag_matcher import ActiveTagMatcher, setup_active_tag_values
- from behave4cmd0.setup_command_shell import setup_command_shell_processors4behave
- import platform
-@@ -20,6 +22,15 @@
- }
- active_tag_matcher = ActiveTagMatcher(active_tag_value_provider)
- 
-+
-+def print_active_tags_summary():
-+    active_tag_data = active_tag_value_provider
-+    print("ACTIVE-TAG SUMMARY:")
-+    print("use.with_python.version=%s" % active_tag_data.get("python.version"))
-+    # print("use.with_os=%s" % active_tag_data.get("os"))
-+    print()
-+
-+
- # -----------------------------------------------------------------------------
- # HOOKS:
- # -----------------------------------------------------------------------------
-@@ -30,11 +41,14 @@ def before_all(context):
-     setup_python_path()
-     setup_context_with_global_params_test(context)
-     setup_command_shell_processors4behave()
-+    print_active_tags_summary()
-+
- 
- def before_feature(context, feature):
-     if active_tag_matcher.should_exclude_with(feature.tags):
-         feature.skip(reason=active_tag_matcher.exclude_reason)
- 
-+
- def before_scenario(context, scenario):
-     if active_tag_matcher.should_exclude_with(scenario.effective_tags):
-         scenario.skip(reason=active_tag_matcher.exclude_reason)
-diff --git a/features/step.duplicated_step.feature b/features/step.duplicated_step.feature
-index 59888b0f..396cca27 100644
---- a/features/step.duplicated_step.feature
-+++ b/features/step.duplicated_step.feature
-@@ -32,11 +32,11 @@ Feature: Duplicated Step Definitions
-         AmbiguousStep: @given('I call Alice') has already been defined in
-         existing step @given('I call Alice') at features/steps/alice_steps.py:3
-         """
--    And the command output should contain:
--        """
--        File "features/steps/alice_steps.py", line 7, in <module>
--        @given(u'I call Alice')
--        """
-+    # -- DISABLED: Python 3.8 traceback line numbers differ w/ decorators (+1).
-+    # And the command output should contain:
-+    #    """
-+    #    File "features/steps/alice_steps.py", line 7, in <module>
-+    #    """
- 
- 
-   Scenario: Duplicated Step Definition in another File
-@@ -70,11 +70,11 @@ Feature: Duplicated Step Definitions
-         AmbiguousStep: @given('I call Bob') has already been defined in
-         existing step @given('I call Bob') at features/steps/bob1_steps.py:3
-         """
--    And the command output should contain:
--        """
--        File "features/steps/bob2_steps.py", line 3, in <module>
--        @given('I call Bob')
--        """
-+    # -- DISABLED: Python 3.8 traceback line numbers differ w/ decorators (+1).
-+    # And the command output should contain:
-+    #    """
-+    #    File "features/steps/bob2_steps.py", line 3, in <module>
-+    #    """
- 
-   @xfail
-   Scenario: Duplicated Same Step Definition via import from another File
-diff --git a/issue.features/environment.py b/issue.features/environment.py
-index 2dfec751..7e48ee03 100644
---- a/issue.features/environment.py
-+++ b/issue.features/environment.py
-@@ -1,5 +1,5 @@
- # -*- coding: UTF-8 -*-
--# FILE: features/environment.py
-+# FILE: issue.features/environemnt.py
- # pylint: disable=unused-argument
- """
- Functionality:
-@@ -7,17 +7,20 @@
-   * active tags
- """
- 
--from __future__ import print_function
-+
-+from __future__ import absolute_import, print_function
- import sys
- import platform
- import os.path
- import six
- from behave.tag_matcher import ActiveTagMatcher
- from behave4cmd0.setup_command_shell import setup_command_shell_processors4behave
--# PREPARED:
--# from behave.tag_matcher import setup_active_tag_values
-+# PREPARED: from behave.tag_matcher import setup_active_tag_values
- 
- 
-+# ---------------------------------------------------------------------------
-+# TEST SUPPORT: For Active Tags
-+# ---------------------------------------------------------------------------
- def require_tool(tool_name):
-     """Check if a tool (an executable program) is provided on this platform.
- 
-@@ -45,12 +48,14 @@ def require_tool(tool_name):
-     # print("TOOL-NOT-FOUND: %s" % tool_name)
-     return False
- 
-+
- def as_bool_string(value):
-     if bool(value):
-         return "yes"
-     else:
-         return "no"
- 
-+
- def discover_ci_server():
-     # pylint: disable=invalid-name
-     ci_server = "none"
-@@ -67,11 +72,17 @@ def discover_ci_server():
-     return ci_server
- 
- 
-+# ---------------------------------------------------------------------------
-+# BEHAVE SUPPORT: Active Tags
-+# ---------------------------------------------------------------------------
- # -- MATCHES ANY TAGS: @use.with_{category}={value}
- # NOTE: active_tag_value_provider provides category values for active tags.
-+python_version = "%s.%s" % sys.version_info[:2]
- active_tag_value_provider = {
-+    "platform": sys.platform,
-     "python2": str(six.PY2).lower(),
-     "python3": str(six.PY3).lower(),
-+    "python.version": python_version,
-     # -- python.implementation: cpython, pypy, jython, ironpython
-     "python.implementation": platform.python_implementation().lower(),
-     "pypy":    str("__pypy__" in sys.modules).lower(),
-@@ -82,17 +92,33 @@ def discover_ci_server():
- }
- active_tag_matcher = ActiveTagMatcher(active_tag_value_provider)
- 
-+
-+def print_active_tags_summary():
-+    active_tag_data = active_tag_value_provider
-+    print("ACTIVE-TAG SUMMARY:")
-+    print("use.with_python.version=%s" % active_tag_data.get("python.version"))
-+    # print("use.with_platform=%s" % active_tag_data.get("platform"))
-+    # print("use.with_os=%s" % active_tag_data.get("os"))
-+    print()
-+
-+
-+# ---------------------------------------------------------------------------
-+# BEHAVE HOOKS:
-+# ---------------------------------------------------------------------------
- def before_all(context):
-     # -- SETUP ACTIVE-TAG MATCHER (with userdata):
-     # USE: behave -D browser=safari ...
--    # NOT-NEEDED: setup_active_tag_values(active_tag_value_provider,
--    #                                     context.config.userdata)
-+    # NOT-NEEDED:
-+    # setup_active_tag_values(active_tag_value_provider, context.config.userdata)
-     setup_command_shell_processors4behave()
-+    print_active_tags_summary()
-+
- 
- def before_feature(context, feature):
-     if active_tag_matcher.should_exclude_with(feature.tags):
-         feature.skip(reason=active_tag_matcher.exclude_reason)
- 
-+
- def before_scenario(context, scenario):
-     if active_tag_matcher.should_exclude_with(scenario.effective_tags):
-         scenario.skip(reason=active_tag_matcher.exclude_reason)
-diff --git a/issue.features/issue0330.feature b/issue.features/issue0330.feature
-index dc1ebe75..81cb6e29 100644
---- a/issue.features/issue0330.feature
-+++ b/issue.features/issue0330.feature
-@@ -70,6 +70,7 @@ Feature: Issue #330: Skipped scenarios are included in junit reports when --no-s
-     And note that "bob.feature is skipped"
- 
- 
-+  @not.with_python.version=3.8
-   Scenario: Junit report for skipped feature is created with --show-skipped
-     When I run "behave --junit -t @tag1 --show-skipped @alice_and_bob.featureset"
-     Then it should pass with:
-@@ -83,6 +84,23 @@ Feature: Issue #330: Skipped scenarios are included in junit reports when --no-s
-       <testsuite errors="0" failures="0" name="bob.Bob" skipped="1" tests="1" time="0.0">
-       """
- 
-+  @use.with_python.version=3.8
-+  Scenario: Junit report for skipped feature is created with --show-skipped
-+    When I run "behave --junit -t @tag1 --show-skipped @alice_and_bob.featureset"
-+    Then it should pass with:
-+      """
-+      1 feature passed, 0 failed, 1 skipped
-+      """
-+    And a file named "test_results/TESTS-alice.xml" exists
-+    And a file named "test_results/TESTS-bob.xml" exists
-+    And the file "test_results/TESTS-bob.xml" should contain:
-+      """
-+      <testsuite name="bob.Bob" tests="1" errors="0" failures="0" skipped="1" time="0.0">
-+      """
-+      # -- HINT FOR: Python < 3.8
-+      # <testsuite errors="0" failures="0" name="bob.Bob" skipped="1" tests="1" time="0.0">
-+
-+  @not.with_python.version=3.8
-   Scenario: Junit report for skipped scenario is neither shown nor counted with --no-skipped
-     When I run "behave --junit -t @tag1 --no-skipped"
-     Then it should pass with:
-@@ -102,7 +120,30 @@ Feature: Issue #330: Skipped scenarios are included in junit reports when --no-s
-       """
-     And note that "Charly2 is the skipped scenarion in charly.feature"
- 
-+  @use.with_python.version=3.8
-+  Scenario: Junit report for skipped scenario is neither shown nor counted with --no-skipped
-+    When I run "behave --junit -t @tag1 --no-skipped"
-+    Then it should pass with:
-+      """
-+      2 features passed, 0 failed, 1 skipped
-+      2 scenarios passed, 0 failed, 2 skipped
-+      """
-+    And a file named "test_results/TESTS-alice.xml" exists
-+    And a file named "test_results/TESTS-charly.xml" exists
-+    And the file "test_results/TESTS-charly.xml" should contain:
-+      """
-+      <testsuite name="charly.Charly" tests="1" errors="0" failures="0" skipped="0"
-+      """
-+      # -- HINT FOR: Python < 3.8
-+      # <testsuite errors="0" failures="0" name="charly.Charly" skipped="0" tests="1"
-+    And the file "test_results/TESTS-charly.xml" should not contain:
-+      """
-+      <testcase classname="charly.Charly" name="Charly2"
-+      """
-+    And note that "Charly2 is the skipped scenarion in charly.feature"
-+
- 
-+  @not.with_python.version=3.8
-   Scenario: Junit report for skipped scenario is shown and counted with --show-skipped
-     When I run "behave --junit -t @tag1 --show-skipped"
-     Then it should pass with:
-@@ -122,3 +163,26 @@ Feature: Issue #330: Skipped scenarios are included in junit reports when --no-s
-       """
-     And note that "Charly2 is the skipped scenarion in charly.feature"
- 
-+
-+  @use.with_python.version=3.8
-+  Scenario: Junit report for skipped scenario is shown and counted with --show-skipped
-+    When I run "behave --junit -t @tag1 --show-skipped"
-+    Then it should pass with:
-+      """
-+      2 features passed, 0 failed, 1 skipped
-+      2 scenarios passed, 0 failed, 2 skipped
-+      """
-+    And a file named "test_results/TESTS-alice.xml" exists
-+    And a file named "test_results/TESTS-charly.xml" exists
-+    And the file "test_results/TESTS-charly.xml" should contain:
-+      """
-+      <testsuite name="charly.Charly" tests="2" errors="0" failures="0" skipped="1"
-+      """
-+      # HINT: Python < 3.8
-+      # <testsuite errors="0" failures="0" name="charly.Charly" skipped="1" tests="2"
-+    And the file "test_results/TESTS-charly.xml" should contain:
-+      """
-+      <testcase classname="charly.Charly" name="Charly2" status="skipped"
-+      """
-+    And note that "Charly2 is the skipped scenarion in charly.feature"
-+
-diff --git a/issue.features/issue0446.feature b/issue.features/issue0446.feature
-index a2ed892d..901bdec5 100644
---- a/issue.features/issue0446.feature
-+++ b/issue.features/issue0446.feature
-@@ -58,6 +58,7 @@ Feature: Issue #446 -- Support scenario hook-errors with JUnitReporter
-         behave.reporter.junit.show_hostname = False
-         """
- 
-+    @not.with_python.version=3.8
-     Scenario: Hook error in before_scenario()
-       When I run "behave -f plain --junit features/before_scenario_failure.feature"
-       Then it should fail with:
-@@ -86,6 +87,40 @@ Feature: Issue #446 -- Support scenario hook-errors with JUnitReporter
-       And note that "the traceback is contained in the XML element <error/>"
- 
- 
-+    @use.with_python.version=3.8
-+    Scenario: Hook error in before_scenario()
-+      When I run "behave -f plain --junit features/before_scenario_failure.feature"
-+      Then it should fail with:
-+        """
-+        0 scenarios passed, 1 failed, 0 skipped
-+        """
-+      And the command output should contain:
-+        """
-+        HOOK-ERROR in before_scenario: RuntimeError: OOPS
-+        """
-+      And the file "reports/TESTS-before_scenario_failure.xml" should contain:
-+        """
-+        <testsuite name="before_scenario_failure.Alice" tests="1" errors="1" failures="0" skipped="0"
-+        """
-+        # -- HINT FOR: Python < 3.8
-+        # <testsuite errors="1" failures="0" name="before_scenario_failure.Alice" skipped="0" tests="1"
-+      And the file "reports/TESTS-before_scenario_failure.xml" should contain:
-+        """
-+        <error type="RuntimeError" message="HOOK-ERROR in before_scenario: RuntimeError: OOPS">
-+        """
-+        # -- HINT FOR: Python < 3.8
-+        # <error message="HOOK-ERROR in before_scenario: RuntimeError: OOPS" type="RuntimeError">
-+      And the file "reports/TESTS-before_scenario_failure.xml" should contain:
-+        """
-+        File "features/environment.py", line 6, in before_scenario
-+          cause_hook_failure()
-+        File "features/environment.py", line 2, in cause_hook_failure
-+          raise RuntimeError("OOPS")
-+        """
-+      And note that "the traceback is contained in the XML element <error/>"
-+
-+
-+    @not.with_python.version=3.8
-     Scenario: Hook error in after_scenario()
-       When I run "behave -f plain --junit features/after_scenario_failure.feature"
-       Then it should fail with:
-@@ -114,3 +149,38 @@ Feature: Issue #446 -- Support scenario hook-errors with JUnitReporter
-           raise RuntimeError("OOPS")
-         """
-       And note that "the traceback is contained in the XML element <error/>"
-+
-+
-+    @use.with_python.version=3.8
-+    Scenario: Hook error in after_scenario()
-+      When I run "behave -f plain --junit features/after_scenario_failure.feature"
-+      Then it should fail with:
-+        """
-+        0 scenarios passed, 1 failed, 0 skipped
-+        """
-+      And the command output should contain:
-+        """
-+          Scenario: B1
-+            Given another step passes ... passed
-+        HOOK-ERROR in after_scenario: RuntimeError: OOPS
-+        """
-+      And the file "reports/TESTS-after_scenario_failure.xml" should contain:
-+        """
-+        <testsuite name="after_scenario_failure.Bob" tests="1" errors="1" failures="0" skipped="0"
-+        """
-+        # -- HINT FOR: Python < 3.8
-+        # <testsuite errors="1" failures="0" name="after_scenario_failure.Bob" skipped="0" tests="1"
-+      And the file "reports/TESTS-after_scenario_failure.xml" should contain:
-+        """
-+        <error type="RuntimeError" message="HOOK-ERROR in after_scenario: RuntimeError: OOPS">
-+        """
-+        # -- HINT FOR: Python < 3.8
-+        # <error message="HOOK-ERROR in after_scenario: RuntimeError: OOPS" type="RuntimeError">
-+      And the file "reports/TESTS-after_scenario_failure.xml" should contain:
-+        """
-+        File "features/environment.py", line 10, in after_scenario
-+          cause_hook_failure()
-+        File "features/environment.py", line 2, in cause_hook_failure
-+          raise RuntimeError("OOPS")
-+        """
-+      And note that "the traceback is contained in the XML element <error/>"
-diff --git a/issue.features/issue0457.feature b/issue.features/issue0457.feature
-index f80640e9..46f96e9c 100644
---- a/issue.features/issue0457.feature
-+++ b/issue.features/issue0457.feature
-@@ -24,6 +24,7 @@ Feature: Issue #457 -- Double-quotes in error messages of JUnit XML reports
-         """
- 
- 
-+    @not.with_python.version=3.8
-     Scenario: Use failing assertation in a JUnit XML report
-       Given a file named "features/fails1.feature" with:
-         """
-@@ -44,6 +45,31 @@ Feature: Issue #457 -- Double-quotes in error messages of JUnit XML reports
-         <failure message="FAILED: My name is &quot;Alice&quot;"
-         """
- 
-+    @use.with_python.version=3.8
-+    Scenario: Use failing assertation in a JUnit XML report
-+      Given a file named "features/fails1.feature" with:
-+        """
-+        Feature:
-+          Scenario: Alice
-+            Given a step fails with message:
-+              '''
-+              My name is "Alice"
-+              '''
-+        """
-+      When I run "behave --junit features/fails1.feature"
-+      Then it should fail with:
-+        """
-+        0 scenarios passed, 1 failed, 0 skipped
-+        """
-+      And the file "reports/TESTS-fails1.xml" should contain:
-+        """
-+        <failure type="AssertionError" message="FAILED: My name is &quot;Alice&quot;">
-+        """
-+        # -- HINT FOR: Python < 3.8
-+        # <failure message="FAILED: My name is &quot;Alice&quot;"
-+
-+
-+    @not.with_python.version=3.8
-     Scenario: Use exception in a JUnit XML report
-       Given a file named "features/fails2.feature" with:
-         """
-@@ -63,3 +89,26 @@ Feature: Issue #457 -- Double-quotes in error messages of JUnit XML reports
-         """
-         <error message="My name is &quot;Bob&quot; and &lt;here&gt; I am"
-         """
-+
-+    @use.with_python.version=3.8
-+    Scenario: Use exception in a JUnit XML report
-+      Given a file named "features/fails2.feature" with:
-+        """
-+        Feature:
-+          Scenario: Bob
-+            Given a step fails with error and message:
-+              '''
-+              My name is "Bob" and <here> I am
-+              '''
-+        """
-+      When I run "behave --junit features/fails2.feature"
-+      Then it should fail with:
-+        """
-+        0 scenarios passed, 1 failed, 0 skipped
-+        """
-+      And the file "reports/TESTS-fails2.xml" should contain:
-+        """
-+        <error type="RuntimeError" message="My name is &quot;Bob&quot; and &lt;here&gt; I am">
-+        """
-+        # -- HINT FOR: Python < 3.8
-+        # <error message="My name is &quot;Bob&quot; and &lt;here&gt; I am"
diff --git a/gnu/packages/patches/biber-fix-encoding-write.patch b/gnu/packages/patches/biber-fix-encoding-write.patch
deleted file mode 100644
index 56cd11212e..0000000000
--- a/gnu/packages/patches/biber-fix-encoding-write.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 2a9b15aefb842a734637f3d230936ea1b7c60096 Mon Sep 17 00:00:00 2001
-From: Philip Kime <Philip@kime.org.uk>
-Date: Thu, 8 Nov 2018 22:02:09 +0100
-Subject: [PATCH] Fix to address #239
-
----
- lib/Biber.pm | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/lib/Biber.pm b/lib/Biber.pm
-index 8b1f80a5..d97fca29 100644
---- a/lib/Biber.pm
-+++ b/lib/Biber.pm
-@@ -311,6 +311,8 @@ sub parse_ctrlfile {
-     unless (eval {$checkbuf = File::Slurper::read_text($ctrl_file_path, 'latin1')}) {
-       biber_error("$ctrl_file_path is not UTF-8 or even latin1, how horrible.");
-     }
-+    # Write ctrl file as UTF-8
-+    File::Slurper::write_text($ctrl_file_path, NFC($checkbuf));# Unicode NFC boundary
-   }
- 
-   $checkbuf = NFD($checkbuf);# Unicode NFD boundary
-@@ -319,8 +321,6 @@ sub parse_ctrlfile {
-     unlink($output) unless $output eq '-';# ignore deletion of STDOUT marker
-     biber_error("$ctrl_file_path is malformed, last biblatex run probably failed. Deleted $output");
-   }
--  # Write ctrl file as UTF-8
--  File::Slurper::write_text($ctrl_file_path, NFC($checkbuf));# Unicode NFC boundary
- 
-   # Validate if asked to
-   if (Biber::Config->getoption('validate_control')) {
diff --git a/gnu/packages/patches/biber-sortinithash.patch b/gnu/packages/patches/biber-sortinithash.patch
deleted file mode 100644
index 5a626705e6..0000000000
--- a/gnu/packages/patches/biber-sortinithash.patch
+++ /dev/null
@@ -1,1666 +0,0 @@
-This is a backport of this upstream commit to Biber 2.12:
-
-  From 6b61b4c13778cf638f82569ab9e413f09f111ba5 Mon Sep 17 00:00:00 2001
-  From: Philip Kime <Philip@kime.org.uk>
-  Date: Sat, 12 Jan 2019 17:19:51 +0100
-  Subject: [PATCH] Updated tests after U::C upgrade changed sortinit hashes
-
-It addresses test failures found with recent versions of the
-Biber dependencies.
-
-diff --git a/t/annotations.t b/t/annotations.t
-index b4f641e..c6f86c7 100644
---- a/t/annotations.t
-+++ b/t/annotations.t
-@@ -73,7 +73,7 @@ my $ann1 = q|    \entry{ann1}{misc}{}
-       \strng{authorfullhash}{90ae96c82de92e36949bc64254bbde0c}
-       \field{extraname}{1}
-       \field{sortinit}{L}
--      \field{sortinithash}{2c7981aaabc885868aba60f0c09ee20f}
-+      \field{sortinithash}{dad3efd0836470093a7b4a7bb756eb8c}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-       \field{title}{The Title}
-@@ -116,7 +116,7 @@ my $ann2 = q|    \entry{ann2}{misc}{}
-       \strng{authorfullhash}{90ae96c82de92e36949bc64254bbde0c}
-       \field{extraname}{2}
-       \field{sortinit}{L}
--      \field{sortinithash}{2c7981aaabc885868aba60f0c09ee20f}
-+      \field{sortinithash}{dad3efd0836470093a7b4a7bb756eb8c}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-       \field{title}{The Title}
-diff --git a/t/basic-misc.t b/t/basic-misc.t
-index d4664b1..a9168cc 100644
---- a/t/basic-misc.t
-+++ b/t/basic-misc.t
-@@ -97,7 +97,7 @@ my $u1 = q|    \entry{u1}{misc}{}
-       \strng{authorfullhash}{b78abdc838d79b6576f2ed0021642766}
-       \field{labelalpha}{AAA\textbf{+}00}
-       \field{sortinit}{A}
--      \field{sortinithash}{d77c7cdd82ff690d4c3ef13216f92f0b}
-+      \field{sortinithash}{a3dcedd53b04d1adfd5ac303ecd5e6fa}
-       \true{singletitle}
-       \true{uniquework}
-       \field{labelnamesource}{author}
-@@ -231,7 +231,7 @@ my $murray1 = q|    \entry{murray}{article}{}
-       \strng{authorfullhash}{1572cc3fd324f560e5e71d041a6bd764}
-       \field{labelalpha}{Hos\textbf{+}98}
-       \field{sortinit}{H}
--      \field{sortinithash}{5f15a7bc777ad49ff15aa4d2831b1681}
-+      \field{sortinithash}{6db6145dae8dc9e1271a8d556090b50a}
-       \true{singletitle}
-       \true{uniquework}
-       \field{labelnamesource}{author}
-@@ -348,7 +348,7 @@ my $murray2 = q|    \entry{murray}{article}{}
-       \strng{authorfullhash}{1572cc3fd324f560e5e71d041a6bd764}
-       \field{labelalpha}{Hos98}
-       \field{sortinit}{H}
--      \field{sortinithash}{5f15a7bc777ad49ff15aa4d2831b1681}
-+      \field{sortinithash}{6db6145dae8dc9e1271a8d556090b50a}
-       \true{singletitle}
-       \true{uniquework}
-       \field{labelnamesource}{author}
-@@ -389,7 +389,7 @@ my $t1 = q+    \entry{t1}{misc}{}
-       \field{extraname}{1}
-       \field{labelalpha}{Bro92}
-       \field{sortinit}{B}
--      \field{sortinithash}{276475738cc058478c1677046f857703}
-+      \field{sortinithash}{8de16967003c7207dae369d874f1456e}
-       \true{uniquework}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-@@ -419,7 +419,7 @@ my $t2 = q|    \entry{t2}{misc}{}
-       \field{extraname}{2}
-       \field{labelalpha}{Bro94}
-       \field{sortinit}{B}
--      \field{sortinithash}{276475738cc058478c1677046f857703}
-+      \field{sortinithash}{8de16967003c7207dae369d874f1456e}
-       \true{uniquework}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-@@ -452,7 +452,7 @@ my $anon1 = q|    \entry{anon1}{unpublished}{}
-       \strng{shortauthorfullhash}{9873a6cc65c553faa2b21aaad626fe4b}
-       \field{labelalpha}{XAn35}
-       \field{sortinit}{A}
--      \field{sortinithash}{d77c7cdd82ff690d4c3ef13216f92f0b}
-+      \field{sortinithash}{a3dcedd53b04d1adfd5ac303ecd5e6fa}
-       \true{singletitle}
-       \true{uniquework}
-       \field{labelnamesource}{shortauthor}
-@@ -491,7 +491,7 @@ my $anon2 = q|    \entry{anon2}{unpublished}{}
-       \strng{shortauthorfullhash}{f64c29e89ea49402b997956610b58ef6}
-       \field{labelalpha}{YAn39}
-       \field{sortinit}{A}
--      \field{sortinithash}{d77c7cdd82ff690d4c3ef13216f92f0b}
-+      \field{sortinithash}{a3dcedd53b04d1adfd5ac303ecd5e6fa}
-       \true{singletitle}
-       \true{uniquework}
-       \field{labelnamesource}{shortauthor}
-@@ -526,7 +526,7 @@ my $url1 = q|    \entry{url1}{misc}{}
-       \field{extraname}{4}
-       \field{labelalpha}{Ali05}
-       \field{sortinit}{A}
--      \field{sortinithash}{d77c7cdd82ff690d4c3ef13216f92f0b}
-+      \field{sortinithash}{a3dcedd53b04d1adfd5ac303ecd5e6fa}
-       \field{extraalpha}{4}
-       \field{labelnamesource}{author}
-       \field{year}{2005}
-@@ -710,7 +710,7 @@ my $isbn1 = q|    \entry{isbn1}{misc}{}
-       \field{extraname}{1}
-       \field{labelalpha}{Flu}
-       \field{sortinit}{F}
--      \field{sortinithash}{669c706c6f1fbf3b5a83d26f1d9e9e72}
-+      \field{sortinithash}{fb0c0faa89eb6abae8213bf60e6799ea}
-       \field{extraalpha}{1}
-       \field{labelnamesource}{author}
-       \field{isbn}{978-0-8165-2066-4}
-@@ -735,7 +735,7 @@ my $isbn2 = q|    \entry{isbn2}{misc}{}
-       \field{extraname}{2}
-       \field{labelalpha}{Flu}
-       \field{sortinit}{F}
--      \field{sortinithash}{669c706c6f1fbf3b5a83d26f1d9e9e72}
-+      \field{sortinithash}{fb0c0faa89eb6abae8213bf60e6799ea}
-       \field{extraalpha}{2}
-       \field{labelnamesource}{author}
-       \field{isbn}{978-0-8165-2066-4}
-@@ -778,7 +778,7 @@ my $clone1 = q|    \entry{snk1}{book}{}
-       \field{extraname}{2}
-       \field{labelalpha}{vDoe}
-       \field{sortinit}{v}
--      \field{sortinithash}{75dd7385c90b2252c3ae853a80ca853b}
-+      \field{sortinithash}{02432525618c08e2b03cac47c19764af}
-       \field{extraalpha}{2}
-       \field{labelnamesource}{author}
-     \endentry
-@@ -807,7 +807,7 @@ my $clone2 = q|    \entry{clone-snk1}{book}{}
-       \field{extraname}{1}
-       \field{labelalpha}{vDoe}
-       \field{sortinit}{v}
--      \field{sortinithash}{75dd7385c90b2252c3ae853a80ca853b}
-+      \field{sortinithash}{02432525618c08e2b03cac47c19764af}
-       \field{extraalpha}{1}
-       \field{labelnamesource}{author}
-       \field{addendum}{add}
-@@ -839,7 +839,7 @@ my $ent1 = q|    \entry{ent1}{book}{}
-       \strng{authorfullhash}{b2536a425d549b46de5f21c4d468050a}
-       \field{labelalpha}{SdB}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \true{singletitle}
-       \field{labelnamesource}{author}
-     \endentry
-@@ -862,7 +862,7 @@ my $verb1 = q|    \entry{verb1}{book}{}
-       \strng{authorfullhash}{cac5a25f503e71f5ef28f474e14007b6}
-       \field{labelalpha}{All}
-       \field{sortinit}{A}
--      \field{sortinithash}{d77c7cdd82ff690d4c3ef13216f92f0b}
-+      \field{sortinithash}{a3dcedd53b04d1adfd5ac303ecd5e6fa}
-       \true{singletitle}
-       \field{labelnamesource}{author}
-       \verb{verba}
-diff --git a/t/biblatexml.t b/t/biblatexml.t
-index ad9ad25..0959bfa 100644
---- a/t/biblatexml.t
-+++ b/t/biblatexml.t
-@@ -111,7 +111,7 @@ my $l1 = q|    \entry{bltx1}{misc}{useprefix=false}
-       \strng{translatornamehash}{b44eba830fe9817fbe8e53c82f1cbe04}
-       \strng{translatorfullhash}{b44eba830fe9817fbe8e53c82f1cbe04}
-       \field{sortinit}{v}
--      \field{sortinithash}{75dd7385c90b2252c3ae853a80ca853b}
-+      \field{sortinithash}{02432525618c08e2b03cac47c19764af}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-       \field{labelnamesource}{author}
-@@ -158,7 +158,7 @@ my $l1 = q|    \entry{bltx1}{misc}{useprefix=false}
- 
- my $l2 = q|    \entry{loopkey:a}{book}{}
-       \field{sortinit}{0}
--      \field{sortinithash}{168ad0c7c5ed09f1d28c6675717b5b03}
-+      \field{sortinithash}{bcf7a1f4afb88b7299f988caccb80d1c}
-     \endentry
- |;
- 
-diff --git a/t/crossrefs.t b/t/crossrefs.t
-index 915b52b..b6191c6 100644
---- a/t/crossrefs.t
-+++ b/t/crossrefs.t
-@@ -82,7 +82,7 @@ my $cr1 = q|    \entry{cr1}{inbook}{}
-       \strng{editornamehash}{c129df5593fdaa7475548811bfbb227d}
-       \strng{editorfullhash}{c129df5593fdaa7475548811bfbb227d}
-       \field{sortinit}{G}
--      \field{sortinithash}{5e8d2bf9d38de41b1528bd307546008f}
-+      \field{sortinithash}{62eb2aa29549e4fdbd3cb154ec5711cb}
-       \true{singletitle}
-       \true{uniquetitle}
-       \true{uniquework}
-@@ -131,7 +131,7 @@ my $cr2 = q|    \entry{cr2}{inbook}{}
-       \strng{editornamehash}{c129df5593fdaa7475548811bfbb227d}
-       \strng{editorfullhash}{c129df5593fdaa7475548811bfbb227d}
-       \field{sortinit}{F}
--      \field{sortinithash}{669c706c6f1fbf3b5a83d26f1d9e9e72}
-+      \field{sortinithash}{fb0c0faa89eb6abae8213bf60e6799ea}
-       \true{singletitle}
-       \true{uniquetitle}
-       \true{uniquework}
-@@ -165,7 +165,7 @@ my $cr_m = q|    \entry{cr_m}{book}{}
-       \strng{editornamehash}{c129df5593fdaa7475548811bfbb227d}
-       \strng{editorfullhash}{c129df5593fdaa7475548811bfbb227d}
-       \field{sortinit}{G}
--      \field{sortinithash}{5e8d2bf9d38de41b1528bd307546008f}
-+      \field{sortinithash}{62eb2aa29549e4fdbd3cb154ec5711cb}
-       \true{crossrefsource}
-       \true{uniquetitle}
-       \field{labeltitlesource}{title}
-@@ -203,7 +203,7 @@ my $cr3 = q|    \entry{cr3}{inbook}{}
-       \strng{editornamehash}{a1f5c22413396d599ec766725b226735}
-       \strng{editorfullhash}{a1f5c22413396d599ec766725b226735}
-       \field{sortinit}{A}
--      \field{sortinithash}{d77c7cdd82ff690d4c3ef13216f92f0b}
-+      \field{sortinithash}{a3dcedd53b04d1adfd5ac303ecd5e6fa}
-       \true{singletitle}
-       \true{uniquetitle}
-       \true{uniquework}
-@@ -248,7 +248,7 @@ my $cr4 = q|    \entry{cr4}{inbook}{}
-       \strng{editornamehash}{6ea89bd4958743a20b70fe17647d6af5}
-       \strng{editorfullhash}{6ea89bd4958743a20b70fe17647d6af5}
-       \field{sortinit}{M}
--      \field{sortinithash}{cfd219b90152c06204fab207bc6c7cab}
-+      \field{sortinithash}{2e5c2f51f7fa2d957f3206819bf86dc3}
-       \true{singletitle}
-       \true{uniquetitle}
-       \true{uniquework}
-@@ -279,7 +279,7 @@ my $crt = q|    \entry{crt}{book}{}
-       \strng{editornamehash}{a1f5c22413396d599ec766725b226735}
-       \strng{editorfullhash}{a1f5c22413396d599ec766725b226735}
-       \field{sortinit}{B}
--      \field{sortinithash}{276475738cc058478c1677046f857703}
-+      \field{sortinithash}{8de16967003c7207dae369d874f1456e}
-       \true{uniquetitle}
-       \field{labeltitlesource}{title}
-       \field{title}{Beasts of the Burbling Burns}
-@@ -315,7 +315,7 @@ my $cr6 = q|    \entry{cr6}{inproceedings}{}
-       \strng{editorfullhash}{344a7f427fb765610ef96eb7bce95257}
-       \field{extraname}{2}
-       \field{sortinit}{A}
--      \field{sortinithash}{d77c7cdd82ff690d4c3ef13216f92f0b}
-+      \field{sortinithash}{a3dcedd53b04d1adfd5ac303ecd5e6fa}
-       \true{uniquetitle}
-       \true{uniquework}
-       \field{labelnamesource}{author}
-@@ -366,7 +366,7 @@ my $cr7 = q|    \entry{cr7}{inbook}{}
-       \strng{bookauthorfullhash}{91a1dd4aeed3c4ec29ca74c4e778be5f}
-       \field{extraname}{1}
-       \field{sortinit}{A}
--      \field{sortinithash}{d77c7cdd82ff690d4c3ef13216f92f0b}
-+      \field{sortinithash}{a3dcedd53b04d1adfd5ac303ecd5e6fa}
-       \true{uniquetitle}
-       \true{uniquework}
-       \field{labelnamesource}{author}
-@@ -401,7 +401,7 @@ my $cr8 = q|    \entry{cr8}{incollection}{}
-       \strng{authorfullhash}{3d449e56eb3ca1ae80dc99a18d689795}
-       \field{extraname}{4}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \true{singletitle}
-       \true{uniquetitle}
-       \true{uniquework}
-@@ -431,7 +431,7 @@ my $xr1 = q|    \entry{xr1}{inbook}{}
-       \strng{authornamehash}{e0ecc4fc668ee499d1afba44e1ac064d}
-       \strng{authorfullhash}{e0ecc4fc668ee499d1afba44e1ac064d}
-       \field{sortinit}{Z}
--      \field{sortinithash}{156173bd08b075d7295bc3e0f4735a04}
-+      \field{sortinithash}{8f7b480688e809b50b6f6577b16f3db5}
-       \true{singletitle}
-       \true{uniquetitle}
-       \true{uniquework}
-@@ -460,7 +460,7 @@ my $xr2 = q|    \entry{xr2}{inbook}{}
-       \strng{authornamehash}{6afa09374ecfd6b394ce714d2d9709c7}
-       \strng{authorfullhash}{6afa09374ecfd6b394ce714d2d9709c7}
-       \field{sortinit}{I}
--      \field{sortinithash}{320bc8fe8101b9376f9f21cd507de0e8}
-+      \field{sortinithash}{9417e9a1288a9371e2691d999083ed39}
-       \true{singletitle}
-       \true{uniquetitle}
-       \true{uniquework}
-@@ -491,7 +491,7 @@ my $xrm = q|    \entry{xrm}{book}{}
-       \strng{editornamehash}{809950f9b59ae207092b909a19dcb27b}
-       \strng{editorfullhash}{809950f9b59ae207092b909a19dcb27b}
-       \field{sortinit}{C}
--      \field{sortinithash}{963e9d84a3da2344e8833203de5aed05}
-+      \field{sortinithash}{4c244ceae61406cdc0cc2ce1cb1ff703}
-       \true{xrefsource}
-       \true{uniquetitle}
-       \field{labeltitlesource}{title}
-@@ -516,7 +516,7 @@ my $xr3 = q|    \entry{xr3}{inbook}{}
-       \strng{authornamehash}{9788055665b9bb4b37c776c3f6b74f16}
-       \strng{authorfullhash}{9788055665b9bb4b37c776c3f6b74f16}
-       \field{sortinit}{N}
--      \field{sortinithash}{f7242c3ed3dc50029fca1be76c497c7c}
-+      \field{sortinithash}{98cf339a479c0454fe09153a08675a15}
-       \true{singletitle}
-       \true{uniquetitle}
-       \true{uniquework}
-@@ -546,7 +546,7 @@ my $xrt = q|    \entry{xrt}{book}{}
-       \strng{editornamehash}{bf7d6b02f3e073913e5bfe5059508dd5}
-       \strng{editorfullhash}{bf7d6b02f3e073913e5bfe5059508dd5}
-       \field{sortinit}{K}
--      \field{sortinithash}{9fd838a31ba64d981e8f44562bd33f89}
-+      \field{sortinithash}{d3edc18d54b9438a72c24c925bfb38f4}
-       \true{uniquetitle}
-       \field{labeltitlesource}{title}
-       \field{title}{Kings, Cork and Calculation}
-@@ -572,7 +572,7 @@ my $xr4 = q|    \entry{xr4}{inbook}{}
-       \strng{authorfullhash}{7804ffef086c0c4686c235807f5cb502}
-       \field{extraname}{1}
-       \field{sortinit}{M}
--      \field{sortinithash}{cfd219b90152c06204fab207bc6c7cab}
-+      \field{sortinithash}{2e5c2f51f7fa2d957f3206819bf86dc3}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-       \field{origyear}{1933}
-@@ -600,7 +600,7 @@ my $mxr = q|    \entry{mxr}{inbook}{}
-       \strng{authorfullhash}{7804ffef086c0c4686c235807f5cb502}
-       \field{extraname}{2}
-       \field{sortinit}{M}
--      \field{sortinithash}{cfd219b90152c06204fab207bc6c7cab}
-+      \field{sortinithash}{2e5c2f51f7fa2d957f3206819bf86dc3}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-       \field{origyear}{1933}
-@@ -625,7 +625,7 @@ my $mcr = q|    \entry{mcr}{inbook}{}
-       \strng{authorfullhash}{7804ffef086c0c4686c235807f5cb502}
-       \field{extraname}{3}
-       \field{sortinit}{M}
--      \field{sortinithash}{cfd219b90152c06204fab207bc6c7cab}
-+      \field{sortinithash}{2e5c2f51f7fa2d957f3206819bf86dc3}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-       \field{origyear}{1933}
-@@ -660,7 +660,7 @@ my $ccr1 = q|    \entry{ccr2}{book}{}
-       \strng{editorfullhash}{cfee758a1c82df2e26af1985e061bb0a}
-       \field{extraname}{1}
-       \field{sortinit}{V}
--      \field{sortinithash}{75dd7385c90b2252c3ae853a80ca853b}
-+      \field{sortinithash}{02432525618c08e2b03cac47c19764af}
-       \true{uniquetitle}
-       \true{uniquework}
-       \field{labelnamesource}{author}
-@@ -694,7 +694,7 @@ my $ccr2 = q|    \entry{ccr3}{inbook}{}
-       \strng{editornamehash}{cfee758a1c82df2e26af1985e061bb0a}
-       \strng{editorfullhash}{cfee758a1c82df2e26af1985e061bb0a}
-       \field{sortinit}{P}
--      \field{sortinithash}{8d51b3d5b78d75b54308d706b9bbe285}
-+      \field{sortinithash}{bb5b15f2db90f7aef79bb9e83defefcb}
-       \true{uniquetitle}
-       \field{labeltitlesource}{title}
-       \field{booktitle}{Misc etc.}
-@@ -726,7 +726,7 @@ my $ccr3 = q|    \entry{ccr4}{inbook}{}
- 
- my $s1 = q|    \entry{s1}{inbook}{}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \true{uniquetitle}
-       \field{labeltitlesource}{title}
-       \strng{crossref}{s2}
-@@ -760,7 +760,7 @@ my $xc2 = q|    \entry{xc2}{inbook}{}
-       \strng{bookauthorfullhash}{1a0f7d518cccdad859a74412ef956474}
-       \field{extraname}{2}
-       \field{sortinit}{C}
--      \field{sortinithash}{963e9d84a3da2344e8833203de5aed05}
-+      \field{sortinithash}{4c244ceae61406cdc0cc2ce1cb1ff703}
-       \true{xrefsource}
-       \field{labelnamesource}{author}
-       \field{booktitle}{Title}
-@@ -769,7 +769,7 @@ my $xc2 = q|    \entry{xc2}{inbook}{}
- 
- my $b1 = q|    \entry{b1}{inbook}{}
-       \field{sortinit}{2}
--      \field{sortinithash}{cbff857e587bcb4635511624d773949e}
-+      \field{sortinithash}{ed39bb39cf854d5250e95b1c1f94f4ed}
-       \strng{crossref}{b2}
-       \field{day}{3}
-       \field{month}{3}
-@@ -803,7 +803,7 @@ my $sup1 = q|    \entry{sup1}{mvbook}{}
-       \strng{authorfullhash}{556c8dba145b472e6a8598d506f7cbe2}
-       \field{extraname}{3}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \true{crossrefsource}
-       \true{singletitle}
-       \field{labelnamesource}{author}
-@@ -828,7 +828,7 @@ my $sup2 = q|    \entry{sup2}{book}{}
-       \strng{authorfullhash}{556c8dba145b472e6a8598d506f7cbe2}
-       \field{extraname}{1}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \true{singletitle}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-diff --git a/t/datalists.t b/t/datalists.t
-index 3081cc4..4855e3d 100644
---- a/t/datalists.t
-+++ b/t/datalists.t
-@@ -187,7 +187,7 @@ my $K11 = q|    \entry{K11}{book}{}
-       \strng{authornamehash}{4edc280a0ef229f9c061e3b121b17482}
-       \strng{authorfullhash}{4edc280a0ef229f9c061e3b121b17482}
-       \field{sortinit}{a}
--      \field{sortinithash}{d77c7cdd82ff690d4c3ef13216f92f0b}
-+      \field{sortinithash}{a3dcedd53b04d1adfd5ac303ecd5e6fa}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-       \field{labelnamesource}{author}
-@@ -219,7 +219,7 @@ my $K12 = q|    \entry{K12}{book}{}
-       \strng{authornamehash}{a846a485fc9cbb59b0ebeedd6ac637e4}
-       \strng{authorfullhash}{a846a485fc9cbb59b0ebeedd6ac637e4}
-       \field{sortinit}{Z}
--      \field{sortinithash}{156173bd08b075d7295bc3e0f4735a04}
-+      \field{sortinithash}{8f7b480688e809b50b6f6577b16f3db5}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-       \field{labelnamesource}{author}
-diff --git a/t/dateformats.t b/t/dateformats.t
-index 6beb567..0d5072a 100644
---- a/t/dateformats.t
-+++ b/t/dateformats.t
-@@ -88,7 +88,7 @@ my $l13c = q|    \entry{L13}{book}{}
-       \strng{authorfullhash}{8c77336299b25bdada7bf8038f46722f}
-       \field{extraname}{3}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-       \field{labelnamesource}{author}
-@@ -126,7 +126,7 @@ my $l14 = q|    \entry{L14}{book}{}
-       \strng{authorfullhash}{8c77336299b25bdada7bf8038f46722f}
-       \field{extraname}{4}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \field{extradate}{3}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-@@ -168,7 +168,7 @@ my $l15 = q|    \entry{L15}{book}{}
-       \strng{authorfullhash}{8c77336299b25bdada7bf8038f46722f}
-       \field{extraname}{12}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \field{extradate}{4}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-@@ -201,7 +201,7 @@ my $l16 = q|    \entry{L16}{proceedings}{}
-       \strng{editorfullhash}{8c77336299b25bdada7bf8038f46722f}
-       \field{extraname}{13}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \field{extradate}{7}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{event}
-@@ -240,7 +240,7 @@ my $l17 = q|    \entry{L17}{proceedings}{}
-       \strng{editorfullhash}{8c77336299b25bdada7bf8038f46722f}
-       \field{extraname}{5}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \field{extradate}{4}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-@@ -299,7 +299,7 @@ my $l17c = q|    \entry{L17}{proceedings}{}
-       \strng{editorfullhash}{8c77336299b25bdada7bf8038f46722f}
-       \field{extraname}{5}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{orig}
-       \field{labelnamesource}{editor}
-@@ -357,7 +357,7 @@ my $l17e = q|    \entry{L17}{proceedings}{}
-       \strng{editorfullhash}{8c77336299b25bdada7bf8038f46722f}
-       \field{extraname}{5}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{event}
-       \field{labelnamesource}{editor}
-@@ -479,7 +479,7 @@ my $era1 = q|    \entry{era1}{article}{}
-       \strng{authorfullhash}{556c8dba145b472e6a8598d506f7cbe2}
-       \field{extraname}{9}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-       \field{labelnamesource}{author}
-@@ -512,7 +512,7 @@ my $era2 = q|    \entry{era2}{inproceedings}{}
-       \strng{authorfullhash}{556c8dba145b472e6a8598d506f7cbe2}
-       \field{extraname}{10}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-       \field{labelnamesource}{author}
-@@ -546,7 +546,7 @@ my $era3 = q|    \entry{era3}{inproceedings}{}
-       \strng{authorfullhash}{556c8dba145b472e6a8598d506f7cbe2}
-       \field{extraname}{11}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-       \field{labelnamesource}{author}
-@@ -580,7 +580,7 @@ my $era4 = q|    \entry{era4}{inproceedings}{}
-       \strng{authorfullhash}{556c8dba145b472e6a8598d506f7cbe2}
-       \field{extraname}{6}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-       \field{labelnamesource}{author}
-@@ -622,7 +622,7 @@ my $time1 = q|    \entry{time1}{article}{}
-       \strng{authorfullhash}{556c8dba145b472e6a8598d506f7cbe2}
-       \field{extraname}{2}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-       \field{labelnamesource}{author}
-@@ -671,7 +671,7 @@ my $range1 = q|    \entry{range1}{inproceedings}{}
-       \strng{authorfullhash}{556c8dba145b472e6a8598d506f7cbe2}
-       \field{extraname}{7}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{extradate}{1}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-@@ -712,7 +712,7 @@ my $range2 = q|    \entry{range2}{inproceedings}{}
-       \strng{authorfullhash}{556c8dba145b472e6a8598d506f7cbe2}
-       \field{extraname}{8}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{extradate}{2}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-@@ -753,7 +753,7 @@ my $season1 = q|    \entry{season1}{inproceedings}{}
-       \strng{authorfullhash}{556c8dba145b472e6a8598d506f7cbe2}
-       \field{extraname}{1}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-       \field{labelnamesource}{author}
-@@ -785,7 +785,7 @@ my $unspec1 = q|    \entry{unspec1}{inproceedings}{}
-       \strng{authorfullhash}{556c8dba145b472e6a8598d506f7cbe2}
-       \field{extraname}{4}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-       \field{labelnamesource}{author}
-@@ -838,7 +838,7 @@ my $unspec2 = q|    \entry{unspec2}{article}{}
-       \strng{authorfullhash}{556c8dba145b472e6a8598d506f7cbe2}
-       \field{extraname}{3}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-       \field{labelnamesource}{author}
-diff --git a/t/encoding.t b/t/encoding.t
-index a150b4f..36d9955 100644
---- a/t/encoding.t
-+++ b/t/encoding.t
-@@ -52,7 +52,7 @@ my $encode1 = q|    \entry{testŠ}{book}{}
-       \strng{authorfullhash}{06a47edae2e847800cfd78323a0e6be8}
-       \field{labelalpha}{Enc99}
-       \field{sortinit}{E}
--      \field{sortinithash}{f615fb9c6fba11c6f962fb3fd599810e}
-+      \field{sortinithash}{c554bd1a0b76ea92b9f105fe36d9c7b0}
-       \field{labeldatesource}{year}
-       \true{singletitle}
-       \field{labelnamesource}{author}
-@@ -82,7 +82,7 @@ my $encode2 = q|    \entry{test1}{book}{}
-       \strng{authorfullhash}{06a47edae2e847800cfd78323a0e6be8}
-       \field{labelalpha}{Enc99}
-       \field{sortinit}{E}
--      \field{sortinithash}{f615fb9c6fba11c6f962fb3fd599810e}
-+      \field{sortinithash}{c554bd1a0b76ea92b9f105fe36d9c7b0}
-       \field{labeldatesource}{year}
-       \true{singletitle}
-       \field{labelnamesource}{author}
-@@ -112,7 +112,7 @@ my $encode3 = q|    \entry{test1}{book}{}
-       \strng{authorfullhash}{06a47edae2e847800cfd78323a0e6be8}
-       \field{labelalpha}{Enc99}
-       \field{sortinit}{E}
--      \field{sortinithash}{f615fb9c6fba11c6f962fb3fd599810e}
-+      \field{sortinithash}{c554bd1a0b76ea92b9f105fe36d9c7b0}
-       \field{labeldatesource}{year}
-       \true{singletitle}
-       \field{labelnamesource}{author}
-@@ -142,7 +142,7 @@ my $encode5 = q|    \entry{test}{book}{}
-       \strng{authorfullhash}{06a47edae2e847800cfd78323a0e6be8}
-       \field{labelalpha}{Enc99}
-       \field{sortinit}{E}
--      \field{sortinithash}{f615fb9c6fba11c6f962fb3fd599810e}
-+      \field{sortinithash}{c554bd1a0b76ea92b9f105fe36d9c7b0}
-       \field{labeldatesource}{year}
-       \true{singletitle}
-       \field{labelnamesource}{author}
-@@ -172,7 +172,7 @@ my $encode6 = q|    \entry{test}{book}{}
-       \strng{authorfullhash}{06a47edae2e847800cfd78323a0e6be8}
-       \field{labelalpha}{Enc99}
-       \field{sortinit}{E}
--      \field{sortinithash}{f615fb9c6fba11c6f962fb3fd599810e}
-+      \field{sortinithash}{c554bd1a0b76ea92b9f105fe36d9c7b0}
-       \field{labeldatesource}{year}
-       \true{singletitle}
-       \field{labelnamesource}{author}
-@@ -202,7 +202,7 @@ my $encode7 = q|    \entry{test}{book}{}
-       \strng{authorfullhash}{06a47edae2e847800cfd78323a0e6be8}
-       \field{labelalpha}{Enc99}
-       \field{sortinit}{E}
--      \field{sortinithash}{f615fb9c6fba11c6f962fb3fd599810e}
-+      \field{sortinithash}{c554bd1a0b76ea92b9f105fe36d9c7b0}
-       \field{labeldatesource}{year}
-       \true{singletitle}
-       \field{labelnamesource}{author}
-diff --git a/t/names.t b/t/names.t
-index 7228042..b73f2ed 100644
---- a/t/names.t
-+++ b/t/names.t
-@@ -188,7 +188,7 @@ my $l1 = q|    \entry{L1}{book}{}
-       \strng{authornamehash}{72287a68c1714cb1b9f4ab9e03a88b96}
-       \strng{authorfullhash}{72287a68c1714cb1b9f4ab9e03a88b96}
-       \field{sortinit}{A}
--      \field{sortinithash}{d77c7cdd82ff690d4c3ef13216f92f0b}
-+      \field{sortinithash}{a3dcedd53b04d1adfd5ac303ecd5e6fa}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -208,7 +208,7 @@ my $l2 = q|    \entry{L2}{book}{}
-       \strng{authornamehash}{2098d59d0f19a2e003ee06c1aa750d57}
-       \strng{authorfullhash}{2098d59d0f19a2e003ee06c1aa750d57}
-       \field{sortinit}{B}
--      \field{sortinithash}{276475738cc058478c1677046f857703}
-+      \field{sortinithash}{8de16967003c7207dae369d874f1456e}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -228,7 +228,7 @@ my $l3 = q|    \entry{L3}{book}{}
-       \strng{authornamehash}{c8b06fe88bde128b25eb0b3b1cc5837c}
-       \strng{authorfullhash}{c8b06fe88bde128b25eb0b3b1cc5837c}
-       \field{sortinit}{C}
--      \field{sortinithash}{963e9d84a3da2344e8833203de5aed05}
-+      \field{sortinithash}{4c244ceae61406cdc0cc2ce1cb1ff703}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -248,7 +248,7 @@ my $l4 = q|    \entry{L4}{book}{}
-       \strng{authornamehash}{5ec958b850c0c2de7de7c42c84b9c419}
-       \strng{authorfullhash}{5ec958b850c0c2de7de7c42c84b9c419}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -270,7 +270,7 @@ my $l5 = q|    \entry{L5}{book}{}
-       \strng{authornamehash}{c6b9d281cc1ff3f35570f76f463d4244}
-       \strng{authorfullhash}{c6b9d281cc1ff3f35570f76f463d4244}
-       \field{sortinit}{v}
--      \field{sortinithash}{75dd7385c90b2252c3ae853a80ca853b}
-+      \field{sortinithash}{02432525618c08e2b03cac47c19764af}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -292,7 +292,7 @@ my $l6 = q|    \entry{L6}{book}{}
-       \strng{authornamehash}{5fd24d3d1608a310ec205a6b201a5495}
-       \strng{authorfullhash}{5fd24d3d1608a310ec205a6b201a5495}
-       \field{sortinit}{v}
--      \field{sortinithash}{75dd7385c90b2252c3ae853a80ca853b}
-+      \field{sortinithash}{02432525618c08e2b03cac47c19764af}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -314,7 +314,7 @@ my $l7 = q|    \entry{L7}{book}{}
-       \strng{authornamehash}{98edb0b90251df22b74328d9227eceb7}
-       \strng{authorfullhash}{98edb0b90251df22b74328d9227eceb7}
-       \field{sortinit}{v}
--      \field{sortinithash}{75dd7385c90b2252c3ae853a80ca853b}
-+      \field{sortinithash}{02432525618c08e2b03cac47c19764af}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -336,7 +336,7 @@ my $l8 = q|    \entry{L8}{book}{}
-       \strng{authornamehash}{1211dc8dbbc191cbcab4da3c3c1fc48a}
-       \strng{authorfullhash}{1211dc8dbbc191cbcab4da3c3c1fc48a}
-       \field{sortinit}{v}
--      \field{sortinithash}{75dd7385c90b2252c3ae853a80ca853b}
-+      \field{sortinithash}{02432525618c08e2b03cac47c19764af}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -356,7 +356,7 @@ my $l9 = q|    \entry{L9}{book}{}
-       \strng{authornamehash}{bae61a889ab149a6deafe45333204cf0}
-       \strng{authorfullhash}{bae61a889ab149a6deafe45333204cf0}
-       \field{sortinit}{I}
--      \field{sortinithash}{320bc8fe8101b9376f9f21cd507de0e8}
-+      \field{sortinithash}{9417e9a1288a9371e2691d999083ed39}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -379,7 +379,7 @@ my $l10 = q|    \entry{L10}{book}{}
-       \strng{authornamehash}{37b4325752e394ddfb2fc810f6c88e27}
-       \strng{authorfullhash}{37b4325752e394ddfb2fc810f6c88e27}
-       \field{sortinit}{J}
--      \field{sortinithash}{fce5f8d0bd05e8d93f3dbe21c78897ca}
-+      \field{sortinithash}{c45040a764d616897e7f5b30174d7b92}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -402,7 +402,7 @@ my $l10a = q|    \entry{L10a}{book}{}
-       \strng{authornamehash}{7bf2c9d8b89a1930ee91bfddcaf20c9c}
-       \strng{authorfullhash}{7bf2c9d8b89a1930ee91bfddcaf20c9c}
-       \field{sortinit}{P}
--      \field{sortinithash}{8d51b3d5b78d75b54308d706b9bbe285}
-+      \field{sortinithash}{bb5b15f2db90f7aef79bb9e83defefcb}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -427,7 +427,7 @@ my $l11 = q|    \entry{L11}{book}{}
-       \strng{authornamehash}{9f48d231be68c9435fab4faca55a5caf}
-       \strng{authorfullhash}{9f48d231be68c9435fab4faca55a5caf}
-       \field{sortinit}{v}
--      \field{sortinithash}{75dd7385c90b2252c3ae853a80ca853b}
-+      \field{sortinithash}{02432525618c08e2b03cac47c19764af}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -449,7 +449,7 @@ my $l12 = q|    \entry{L12}{book}{}
-       \strng{authornamehash}{d7ca88c13a8f7ce1c23e920010a31f83}
-       \strng{authorfullhash}{d7ca88c13a8f7ce1c23e920010a31f83}
-       \field{sortinit}{d}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \true{uniqueprimaryauthor}
-       \field{labelnamesource}{author}
-     \endentry
-@@ -470,7 +470,7 @@ my $l13 = q|    \entry{L13}{book}{}
-       \strng{authornamehash}{227ac48bb788a658cfaa4eefc71ff0cc}
-       \strng{authorfullhash}{227ac48bb788a658cfaa4eefc71ff0cc}
-       \field{sortinit}{V}
--      \field{sortinithash}{75dd7385c90b2252c3ae853a80ca853b}
-+      \field{sortinithash}{02432525618c08e2b03cac47c19764af}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -490,7 +490,7 @@ my $l14 = q|    \entry{L14}{book}{}
-       \strng{authornamehash}{779475052c17ed56dc3be900d0dfdf87}
-       \strng{authorfullhash}{779475052c17ed56dc3be900d0dfdf87}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -513,7 +513,7 @@ my $l15 = q|    \entry{L15}{book}{}
-       \strng{authorfullhash}{783c636e853e47a854ae034ebe9dde62}
-       \field{extraname}{1}
-       \field{sortinit}{v}
--      \field{sortinithash}{75dd7385c90b2252c3ae853a80ca853b}
-+      \field{sortinithash}{02432525618c08e2b03cac47c19764af}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -536,7 +536,7 @@ my $l16 = q|    \entry{L16}{book}{}
-       \strng{authorfullhash}{783c636e853e47a854ae034ebe9dde62}
-       \field{extraname}{2}
-       \field{sortinit}{v}
--      \field{sortinithash}{75dd7385c90b2252c3ae853a80ca853b}
-+      \field{sortinithash}{02432525618c08e2b03cac47c19764af}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -557,7 +557,7 @@ my $l17 = q|    \entry{L17}{book}{}
-       \strng{authorfullhash}{b51f667a3384d92ea5458ba80716bff7}
-       \field{extraname}{1}
-       \field{sortinit}{L}
--      \field{sortinithash}{2c7981aaabc885868aba60f0c09ee20f}
-+      \field{sortinithash}{dad3efd0836470093a7b4a7bb756eb8c}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -578,7 +578,7 @@ my $l18 = q|    \entry{L18}{book}{}
-       \strng{authorfullhash}{b51f667a3384d92ea5458ba80716bff7}
-       \field{extraname}{2}
-       \field{sortinit}{L}
--      \field{sortinithash}{2c7981aaabc885868aba60f0c09ee20f}
-+      \field{sortinithash}{dad3efd0836470093a7b4a7bb756eb8c}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -598,7 +598,7 @@ my $l19 = q|    \entry{L19}{book}{}
-       \strng{authornamehash}{83caa52f21f97e572dd3267bdf62978a}
-       \strng{authorfullhash}{83caa52f21f97e572dd3267bdf62978a}
-       \field{sortinit}{M}
--      \field{sortinithash}{cfd219b90152c06204fab207bc6c7cab}
-+      \field{sortinithash}{2e5c2f51f7fa2d957f3206819bf86dc3}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -618,7 +618,7 @@ my $l19a = q|    \entry{L19a}{book}{}
-       \strng{authornamehash}{0963f6904ccfeaac2770c5882a587001}
-       \strng{authorfullhash}{0963f6904ccfeaac2770c5882a587001}
-       \field{sortinit}{L}
--      \field{sortinithash}{2c7981aaabc885868aba60f0c09ee20f}
-+      \field{sortinithash}{dad3efd0836470093a7b4a7bb756eb8c}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -639,7 +639,7 @@ my $l20 = q|    \entry{L20}{book}{}
-       \strng{authornamehash}{5f26c2f3b33095d5b005714893f4d698}
-       \strng{authorfullhash}{5f26c2f3b33095d5b005714893f4d698}
-       \field{sortinit}{F}
--      \field{sortinithash}{669c706c6f1fbf3b5a83d26f1d9e9e72}
-+      \field{sortinithash}{fb0c0faa89eb6abae8213bf60e6799ea}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -660,7 +660,7 @@ my $l21 = q|    \entry{L21}{book}{}
-       \strng{authorfullhash}{4389a3c0dc7da74487b50808ba9436ad}
-       \field{extraname}{1}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -681,7 +681,7 @@ my $l22u = q|    \entry{L22}{book}{}
-       \strng{authorfullhash}{e58b861545799d0eaf883402a882126e}
-       \field{extraname}{1}
-       \field{sortinit}{Š}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -703,7 +703,7 @@ my $l22 = q|    \entry{L22}{book}{}
-       \strng{authorfullhash}{e58b861545799d0eaf883402a882126e}
-       \field{extraname}{1}
-       \field{sortinit}{\v{S}}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \true{uniqueprimaryauthor}
-       \field{labelnamesource}{author}
-     \endentry
-@@ -726,7 +726,7 @@ my $l23 = q|    \entry{L23}{book}{}
-       \strng{authorfullhash}{4389a3c0dc7da74487b50808ba9436ad}
-       \field{extraname}{3}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -747,7 +747,7 @@ my $l24 = q|    \entry{L24}{book}{}
-       \strng{authorfullhash}{e58b861545799d0eaf883402a882126e}
-       \field{extraname}{2}
-       \field{sortinit}{Š}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -765,7 +765,7 @@ my $l25 = q|    \entry{L25}{book}{}
-       \strng{authornamehash}{d7cd2c5ea0848abc3e90609558b84a45}
-       \strng{authorfullhash}{d7cd2c5ea0848abc3e90609558b84a45}
-       \field{sortinit}{A}
--      \field{sortinithash}{d77c7cdd82ff690d4c3ef13216f92f0b}
-+      \field{sortinithash}{a3dcedd53b04d1adfd5ac303ecd5e6fa}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -783,7 +783,7 @@ my $l26 = q|    \entry{L26}{book}{}
-       \strng{authornamehash}{8eee1dbafdbd0a4b73157e60f18b4784}
-       \strng{authorfullhash}{8eee1dbafdbd0a4b73157e60f18b4784}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -791,7 +791,7 @@ my $l26 = q|    \entry{L26}{book}{}
- # Malformed anyway but a decent test
- my $l28 = q|    \entry{L28}{book}{}
-       \field{sortinit}{0}
--      \field{sortinithash}{168ad0c7c5ed09f1d28c6675717b5b03}
-+      \field{sortinithash}{bcf7a1f4afb88b7299f988caccb80d1c}
-       \warn{\item Name "Deux et al.,, O." is malformed (consecutive commas): skipping name}
-     \endentry
- |;
-@@ -810,7 +810,7 @@ my $l29 = q|    \entry{L29}{book}{}
-       \strng{authornamehash}{27ad192a3a715aa89152b2a4ee392e8c}
-       \strng{authorfullhash}{27ad192a3a715aa89152b2a4ee392e8c}
-       \field{sortinit}{U}
--      \field{sortinithash}{36a2444f5238e0dcf4bb59704df6624d}
-+      \field{sortinithash}{77a6935510e008adcf5b555e7b4f0711}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -850,7 +850,7 @@ my $l31 = q|    \entry{L31}{book}{}
-       \strng{translatornamehash}{29c3ff92fff79d09a8b44d2f775de0b1}
-       \strng{translatorfullhash}{29c3ff92fff79d09a8b44d2f775de0b1}
-       \field{sortinit}{\~{Z}}
--      \field{sortinithash}{156173bd08b075d7295bc3e0f4735a04}
-+      \field{sortinithash}{8f7b480688e809b50b6f6577b16f3db5}
-       \true{uniqueprimaryauthor}
-       \field{labelnamesource}{author}
-     \endentry
-diff --git a/t/options.t b/t/options.t
-index 940a282..c14d694 100644
---- a/t/options.t
-+++ b/t/options.t
-@@ -100,7 +100,7 @@ my $l1 = q|    \entry{L1}{book}{}
-       \strng{authornamehash}{bd051a2f7a5f377e3a62581b0e0f8577}
-       \strng{authorfullhash}{bd051a2f7a5f377e3a62581b0e0f8577}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-       \field{labelnamesource}{author}
-@@ -137,7 +137,7 @@ my $l2 = q|    \entry{L2}{book}{maxcitenames=3,maxbibnames=3,maxsortnames=3,maxi
-       \strng{authornamehash}{19eec87c959944d6d9c72434a42856ba}
-       \strng{authorfullhash}{19eec87c959944d6d9c72434a42856ba}
-       \field{sortinit}{E}
--      \field{sortinithash}{f615fb9c6fba11c6f962fb3fd599810e}
-+      \field{sortinithash}{c554bd1a0b76ea92b9f105fe36d9c7b0}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-       \field{labelnamesource}{author}
-@@ -169,7 +169,7 @@ my $l3 = q|    \entry{L3}{book}{blah=10}
-       \strng{authornamehash}{490250da1f3b92580d97563dc96c6c84}
-       \strng{authorfullhash}{490250da1f3b92580d97563dc96c6c84}
-       \field{sortinit}{B}
--      \field{sortinithash}{276475738cc058478c1677046f857703}
-+      \field{sortinithash}{8de16967003c7207dae369d874f1456e}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-       \field{labelnamesource}{author}
-diff --git a/t/related-entries.t b/t/related-entries.t
-index 53dce64..b38ac79 100644
---- a/t/related-entries.t
-+++ b/t/related-entries.t
-@@ -56,7 +56,7 @@ my $k1 = q|    \entry{key1}{article}{}
-       \strng{authorfullhash}{a517747c3d12f99244ae598910d979c5}
-       \field{extraname}{1}
-       \field{sortinit}{1}
--      \field{sortinithash}{2174f786c6195e7fe2ee1c229b416e29}
-+      \field{sortinithash}{50c6687d7fc80f50136d75228e3c59ba}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-       \field{labelnamesource}{author}
-@@ -95,7 +95,7 @@ my $k2 = q|    \entry{key2}{inbook}{}
-       \strng{authorfullhash}{a517747c3d12f99244ae598910d979c5}
-       \field{extraname}{2}
-       \field{sortinit}{2}
--      \field{sortinithash}{cbff857e587bcb4635511624d773949e}
-+      \field{sortinithash}{ed39bb39cf854d5250e95b1c1f94f4ed}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-       \field{labelnamesource}{author}
-@@ -243,7 +243,7 @@ my $kck4 = q|    \entry{caf8e34be07426ae7127c1b4829983c1}{inbook}{dataonly,useed
- 
- my $c1 = q|    \entry{c1}{book}{}
-       \field{sortinit}{3}
--      \field{sortinithash}{a4b52e5432884761f50fb9571273b93e}
-+      \field{sortinithash}{a37a8ef248a93c322189792c34fc68c9}
-       \field{related}{9ab62b5ef34a985438bfdf7ee0102229}
-     \endentry
- |;
-@@ -330,7 +330,7 @@ my $un1 = q|    \entry{kullback}{book}{}
-       \strng{authorfullhash}{34c5bbf9876c37127c3abe4e7d7a7198}
-       \field{extraname}{1}
-       \field{sortinit}{5}
--      \field{sortinithash}{3c19c3776b658b3558e9e2e4840c01e2}
-+      \field{sortinithash}{5dd416adbafacc8226114bc0202d5fdd}
-       \field{extradatescope}{year}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-@@ -364,7 +364,7 @@ my $un2 = q|    \entry{kullback:related}{book}{}
-       \strng{authorfullhash}{34c5bbf9876c37127c3abe4e7d7a7198}
-       \field{extraname}{2}
-       \field{sortinit}{6}
--      \field{sortinithash}{57e57fb8451e7fcfa45d1e069f6d3136}
-+      \field{sortinithash}{7851c86048328b027313775d8fbd2131}
-       \field{extradatescope}{year}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-diff --git a/t/remote-files.t b/t/remote-files.t
-index c747dcd..6f4cf4d 100644
---- a/t/remote-files.t
-+++ b/t/remote-files.t
-@@ -86,7 +86,7 @@ my $cu1 = q|    \entry{citeulike:8283461}{article}{}
-       \strng{authornamehash}{a700cc0bdce78f5a1f50ff6314ff6f2a}
-       \strng{authorfullhash}{094b095bbb7ac93fdd3e2eafdcec0cac}
-       \field{sortinit}{M}
--      \field{sortinithash}{cfd219b90152c06204fab207bc6c7cab}
-+      \field{sortinithash}{2e5c2f51f7fa2d957f3206819bf86dc3}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{year}
-       \field{labelnamesource}{author}
-@@ -133,7 +133,7 @@ my $dl1 = q|    \entry{AbdelbarH98}{article}{}
-       \strng{authornamehash}{bb887c5d0458bfb1f3f7e6afc8d1def4}
-       \strng{authorfullhash}{bb887c5d0458bfb1f3f7e6afc8d1def4}
-       \field{sortinit}{A}
--      \field{sortinithash}{d77c7cdd82ff690d4c3ef13216f92f0b}
-+      \field{sortinithash}{a3dcedd53b04d1adfd5ac303ecd5e6fa}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{year}
-       \field{labelnamesource}{author}
-diff --git a/t/set-dynamic.t b/t/set-dynamic.t
-index 9ab5fdd..0846f8a 100644
---- a/t/set-dynamic.t
-+++ b/t/set-dynamic.t
-@@ -51,7 +51,7 @@ my $out = $biber->get_output_obj;
- my $string1 = q|    \entry{DynSet}{set}{}
-       \set{Dynamic1,Dynamic2,Dynamic3}
-       \field{sortinit}{1}
--      \field{sortinithash}{2174f786c6195e7fe2ee1c229b416e29}
-+      \field{sortinithash}{50c6687d7fc80f50136d75228e3c59ba}
-     \endentry
- |;
- 
-@@ -71,7 +71,7 @@ my $string2 = q|    \entry{Dynamic1}{book}{}
-       \strng{authornamehash}{252caa7921a061ca92087a1a52f15b78}
-       \strng{authorfullhash}{252caa7921a061ca92087a1a52f15b78}
-       \field{sortinit}{8}
--      \field{sortinithash}{07edf88d4ea82509b9c4b4d13f41c452}
-+      \field{sortinithash}{1b24cab5087933ef0826a7cd3b99e994}
-       \field{labeldatesource}{year}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-@@ -98,7 +98,7 @@ my $string3 = q|    \entry{Dynamic2}{book}{}
-       \strng{authornamehash}{894a5fe6de820f5dcce84a65581667f4}
-       \strng{authorfullhash}{894a5fe6de820f5dcce84a65581667f4}
-       \field{sortinit}{9}
--      \field{sortinithash}{1dd72ab054147731c9d824b49aba0534}
-+      \field{sortinithash}{54047ffb55bdefa0694bbd554c1b11a0}
-       \field{labeldatesource}{year}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-@@ -124,7 +124,7 @@ my $string4 = q|    \entry{Dynamic3}{book}{}
-       \strng{authornamehash}{fc3cc97631ceaecdde2aee6cc60ab42b}
-       \strng{authorfullhash}{fc3cc97631ceaecdde2aee6cc60ab42b}
-       \field{sortinit}{1}
--      \field{sortinithash}{2174f786c6195e7fe2ee1c229b416e29}
-+      \field{sortinithash}{50c6687d7fc80f50136d75228e3c59ba}
-       \field{labeldatesource}{year}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-@@ -151,7 +151,7 @@ my $string5 = q|    \entry{Dynamic3}{book}{}
-       \strng{authornamehash}{fc3cc97631ceaecdde2aee6cc60ab42b}
-       \strng{authorfullhash}{fc3cc97631ceaecdde2aee6cc60ab42b}
-       \field{sortinit}{1}
--      \field{sortinithash}{2174f786c6195e7fe2ee1c229b416e29}
-+      \field{sortinithash}{50c6687d7fc80f50136d75228e3c59ba}
-       \field{labeldatesource}{year}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-diff --git a/t/set-legacy.t b/t/set-legacy.t
-index 4e56991..9d40acb 100644
---- a/t/set-legacy.t
-+++ b/t/set-legacy.t
-@@ -45,7 +45,7 @@ my $out = $biber->get_output_obj;
- my $string1 = q|    \entry{Elias1955}{set}{}
-       \set{Elias1955a,Elias1955b}
-       \field{sortinit}{1}
--      \field{sortinithash}{2174f786c6195e7fe2ee1c229b416e29}
-+      \field{sortinithash}{50c6687d7fc80f50136d75228e3c59ba}
-     \endentry
- |;
- 
-diff --git a/t/set-static.t b/t/set-static.t
-index 1e45d4d..a6cbe73 100644
---- a/t/set-static.t
-+++ b/t/set-static.t
-@@ -47,7 +47,7 @@ my $out = $biber->get_output_obj;
- my $string1 = q|    \entry{Static1}{set}{}
-       \set{Static2,Static4,Static3}
-       \field{sortinit}{B}
--      \field{sortinithash}{276475738cc058478c1677046f857703}
-+      \field{sortinithash}{8de16967003c7207dae369d874f1456e}
-       \field{annotation}{Some notes}
-     \endentry
- |;
-@@ -68,7 +68,7 @@ my $string2 = q|    \entry{Static2}{book}{}
-       \strng{authornamehash}{43874d80d7ce68027102819f16c47df1}
-       \strng{authorfullhash}{43874d80d7ce68027102819f16c47df1}
-       \field{sortinit}{B}
--      \field{sortinithash}{276475738cc058478c1677046f857703}
-+      \field{sortinithash}{8de16967003c7207dae369d874f1456e}
-       \field{labeldatesource}{year}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-@@ -94,7 +94,7 @@ my $string3 = q|    \entry{Static3}{book}{}
-       \strng{authornamehash}{22dafa5cd57bb5dd7f3e3bab98fd539c}
-       \strng{authorfullhash}{22dafa5cd57bb5dd7f3e3bab98fd539c}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \field{labeldatesource}{year}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-@@ -119,7 +119,7 @@ my $string4 = q|    \entry{Static4}{book}{}
-       \strng{authornamehash}{da80091c8cd89e5269bd55af1bd5d2fa}
-       \strng{authorfullhash}{da80091c8cd89e5269bd55af1bd5d2fa}
-       \field{sortinit}{C}
--      \field{sortinithash}{963e9d84a3da2344e8833203de5aed05}
-+      \field{sortinithash}{4c244ceae61406cdc0cc2ce1cb1ff703}
-       \field{labeldatesource}{year}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-@@ -145,7 +145,7 @@ my $string5 = q|    \entry{Static2}{book}{}
-       \strng{authornamehash}{43874d80d7ce68027102819f16c47df1}
-       \strng{authorfullhash}{43874d80d7ce68027102819f16c47df1}
-       \field{sortinit}{1}
--      \field{sortinithash}{2174f786c6195e7fe2ee1c229b416e29}
-+      \field{sortinithash}{50c6687d7fc80f50136d75228e3c59ba}
-       \field{labeldatesource}{year}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-diff --git a/t/skips.t b/t/skips.t
-index 7c80d39..caa835f 100644
---- a/t/skips.t
-+++ b/t/skips.t
-@@ -50,7 +50,7 @@ my $set1 = q|    \entry{seta}{set}{}
-       \field{labelalpha}{Doe10}
-       \field{extraalpha}{1}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-     \endentry
- |;
- 
-@@ -70,7 +70,7 @@ my $set2 = q|    \entry{set:membera}{book}{}
-       \strng{authornamehash}{bd051a2f7a5f377e3a62581b0e0f8577}
-       \strng{authorfullhash}{bd051a2f7a5f377e3a62581b0e0f8577}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \field{labeldatesource}{}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-@@ -97,7 +97,7 @@ my $set3 = q|    \entry{set:memberb}{book}{}
-       \strng{authornamehash}{bd051a2f7a5f377e3a62581b0e0f8577}
-       \strng{authorfullhash}{bd051a2f7a5f377e3a62581b0e0f8577}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \field{labeldatesource}{}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-@@ -123,7 +123,7 @@ my $set4 = q|    \entry{set:memberc}{book}{}
-       \strng{authornamehash}{bd051a2f7a5f377e3a62581b0e0f8577}
-       \strng{authorfullhash}{bd051a2f7a5f377e3a62581b0e0f8577}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \field{labeldatesource}{}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-@@ -150,7 +150,7 @@ my $noset1 = q|    \entry{noseta}{book}{}
-       \field{extraname}{3}
-       \field{labelalpha}{Doe10}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \field{extradate}{2}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-@@ -180,7 +180,7 @@ my $noset2 = q|    \entry{nosetb}{book}{}
-       \field{extraname}{4}
-       \field{labelalpha}{Doe10}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \field{extradate}{3}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-@@ -210,7 +210,7 @@ my $noset3 = q|    \entry{nosetc}{book}{}
-       \field{extraname}{5}
-       \field{labelalpha}{Doe10}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \field{extradate}{4}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-@@ -244,7 +244,7 @@ my $sk4 = q|    \entry{skip4}{article}{dataonly}
-       \strng{authornamehash}{bd051a2f7a5f377e3a62581b0e0f8577}
-       \strng{authorfullhash}{bd051a2f7a5f377e3a62581b0e0f8577}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \field{labeldatesource}{year}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-diff --git a/t/sort-complex.t b/t/sort-complex.t
-index aa3e564..d52db08 100644
---- a/t/sort-complex.t
-+++ b/t/sort-complex.t
-@@ -123,7 +123,7 @@ my $l4 = q|    \entry{L4}{book}{}
-       \field{extraname}{2}
-       \field{labelalpha}{Doe\textbf{+}95}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \field{extraalpha}{2}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-@@ -155,7 +155,7 @@ my $l1 = q|    \entry{L1}{book}{}
-       \field{extraname}{1}
-       \field{labelalpha}{Doe95}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \field{extraalpha}{1}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-@@ -187,7 +187,7 @@ my $l2 = q|    \entry{L2}{book}{}
-       \field{extraname}{3}
-       \field{labelalpha}{Doe95}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \field{extraalpha}{3}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-@@ -219,7 +219,7 @@ my $l3 = q|    \entry{L3}{book}{}
-       \field{extraname}{2}
-       \field{labelalpha}{Doe95}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \field{extraalpha}{2}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-@@ -253,7 +253,7 @@ my $l5 = q|    \entry{L5}{book}{}
-       \field{extraname}{1}
-       \field{labelalpha}{Doe\textbf{+}95}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \field{extraalpha}{1}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-diff --git a/t/tdata/full-bbl.bbl b/t/tdata/full-bbl.bbl
-index 4f168de..07c2fab 100644
---- a/t/tdata/full-bbl.bbl
-+++ b/t/tdata/full-bbl.bbl
-@@ -36,7 +36,7 @@
-       \strng{authorfullhash}{bd051a2f7a5f377e3a62581b0e0f8577}
-       \field{labelalpha}{\emph{A}}
-       \field{sortinit}{A}
--      \field{sortinithash}{d77c7cdd82ff690d4c3ef13216f92f0b}
-+      \field{sortinithash}{a3dcedd53b04d1adfd5ac303ecd5e6fa}
-       \true{singletitle}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-@@ -63,7 +63,7 @@
-       \strng{authorfullhash}{bd051a2f7a5f377e3a62581b0e0f8577}
-       \field{labelalpha}{\emph{A}}
-       \field{sortinit}{A}
--      \field{sortinithash}{d77c7cdd82ff690d4c3ef13216f92f0b}
-+      \field{sortinithash}{a3dcedd53b04d1adfd5ac303ecd5e6fa}
-       \true{singletitle}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-@@ -90,7 +90,7 @@
-       \strng{authorfullhash}{bd051a2f7a5f377e3a62581b0e0f8577}
-       \field{labelalpha}{\emph{A}}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \true{singletitle}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-diff --git a/t/tdata/full-bblxml.bblxml b/t/tdata/full-bblxml.bblxml
-index 9eea7d1..a39a787 100644
---- a/t/tdata/full-bblxml.bblxml
-+++ b/t/tdata/full-bblxml.bblxml
-@@ -47,7 +47,7 @@
-         <bbl:field name="authorbibnamehash">860705eb8ffac6e40507746c7ede79ca</bbl:field>
-         <bbl:field name="labelalpha">Aks\textbf{+}06</bbl:field>
-         <bbl:field name="sortinit">A</bbl:field>
--        <bbl:field name="sortinithash">d77c7cdd82ff690d4c3ef13216f92f0b</bbl:field>
-+        <bbl:field name="sortinithash">a3dcedd53b04d1adfd5ac303ecd5e6fa</bbl:field>
-         <bbl:field name="labelnamesource">author</bbl:field>
-         <bbl:field name="labeltitlesource">title</bbl:field>
-         <bbl:field name="indextitle">Effect of immobilization on catalytic characteristics</bbl:field>
-@@ -79,7 +79,7 @@
-         <bbl:field name="authorbibnamehash">9717d2d959a4b18727868ca7928c34b4</bbl:field>
-         <bbl:field name="labelalpha">Ang02</bbl:field>
-         <bbl:field name="sortinit">A</bbl:field>
--        <bbl:field name="sortinithash">d77c7cdd82ff690d4c3ef13216f92f0b</bbl:field>
-+        <bbl:field name="sortinithash">a3dcedd53b04d1adfd5ac303ecd5e6fa</bbl:field>
-         <bbl:field name="labelnamesource">author</bbl:field>
-         <bbl:field name="labeltitlesource">shorttitle</bbl:field>
-         <bbl:field name="annotation">A German article in a French journal. Apart from that, a typical article entry. Note the indextitle field</bbl:field>
-@@ -109,7 +109,7 @@
-         </bbl:set>
-         <bbl:field name="labelalpha">Gla61</bbl:field>
-         <bbl:field name="sortinit">G</bbl:field>
--        <bbl:field name="sortinithash">5e8d2bf9d38de41b1528bd307546008f</bbl:field>
-+        <bbl:field name="sortinithash">62eb2aa29549e4fdbd3cb154ec5711cb</bbl:field>
-         <bbl:field name="annotation">A set entry with three members discussing the standard model of particle physics.</bbl:field>
-       </bbl:entry>
-       <bbl:entry key="stdmodel:glashow" type="article">
-@@ -129,7 +129,7 @@
-         <bbl:field name="authorfullhash">eb3f242602109f5bdbeb41fdd990fcc0</bbl:field>
-         <bbl:field name="authorbibnamehash">eb3f242602109f5bdbeb41fdd990fcc0</bbl:field>
-         <bbl:field name="sortinit">G</bbl:field>
--        <bbl:field name="sortinithash">5e8d2bf9d38de41b1528bd307546008f</bbl:field>
-+        <bbl:field name="sortinithash">62eb2aa29549e4fdbd3cb154ec5711cb</bbl:field>
-         <bbl:field name="labelnamesource">author</bbl:field>
-         <bbl:field name="labeltitlesource">title</bbl:field>
-         <bbl:field name="journaltitle">Nucl. Phys.</bbl:field>
-@@ -168,7 +168,7 @@
-         <bbl:field name="extraname">1</bbl:field>
-         <bbl:field name="labelalpha">Knu86</bbl:field>
-         <bbl:field name="sortinit">K</bbl:field>
--        <bbl:field name="sortinithash">9fd838a31ba64d981e8f44562bd33f89</bbl:field>
-+        <bbl:field name="sortinithash">d3edc18d54b9438a72c24c925bfb38f4</bbl:field>
-         <bbl:field name="extraalpha">1</bbl:field>
-         <bbl:field name="labelnamesource">author</bbl:field>
-         <bbl:field name="labeltitlesource">shorttitle</bbl:field>
-@@ -207,7 +207,7 @@
-         <bbl:field name="extraname">2</bbl:field>
-         <bbl:field name="labelalpha">Knu86</bbl:field>
-         <bbl:field name="sortinit">K</bbl:field>
--        <bbl:field name="sortinithash">9fd838a31ba64d981e8f44562bd33f89</bbl:field>
-+        <bbl:field name="sortinithash">d3edc18d54b9438a72c24c925bfb38f4</bbl:field>
-         <bbl:field name="extraalpha">2</bbl:field>
-         <bbl:field name="labelnamesource">author</bbl:field>
-         <bbl:field name="labeltitlesource">shorttitle</bbl:field>
-@@ -236,7 +236,7 @@
-         <bbl:field name="authorbibnamehash">d52f05e0199eae563725b4165f4b2520</bbl:field>
-         <bbl:field name="labelalpha">Ree58</bbl:field>
-         <bbl:field name="sortinit">R</bbl:field>
--        <bbl:field name="sortinithash">da6b42bd3ab22fee61abed031ee405f7</bbl:field>
-+        <bbl:field name="sortinithash">b9c68a358aea118dfa887b6e902414a7</bbl:field>
-         <bbl:field name="labelnamesource">author</bbl:field>
-         <bbl:field name="labeltitlesource">title</bbl:field>
-         <bbl:field name="annotation">An article entry with a series and a volume field. Note the format of the series. If the value of the series field is an integer, this number is printed as an ordinal and the string *series is appended automatically</bbl:field>
-@@ -286,7 +286,7 @@
-         <bbl:field name="editorfullhash">d0ec890e59163c24c111a08d2a4be982</bbl:field>
-         <bbl:field name="editorbibnamehash">d0ec890e59163c24c111a08d2a4be982</bbl:field>
-         <bbl:field name="sortinit">S</bbl:field>
--        <bbl:field name="sortinithash">322b1d5276f2f6c1bccdcd15920dbee6</bbl:field>
-+        <bbl:field name="sortinithash">c319cff79d99c853d775f88277d4e45f</bbl:field>
-         <bbl:field name="labelnamesource">author</bbl:field>
-         <bbl:field name="labeltitlesource">title</bbl:field>
-         <bbl:field name="booksubtitle">Relativistic groups and analyticity</bbl:field>
-@@ -317,7 +317,7 @@
-         <bbl:field name="authorbibnamehash">93f17724cbd884231ef39a73755ef5bb</bbl:field>
-         <bbl:field name="labelalpha">Sho91</bbl:field>
-         <bbl:field name="sortinit">S</bbl:field>
--        <bbl:field name="sortinithash">322b1d5276f2f6c1bccdcd15920dbee6</bbl:field>
-+        <bbl:field name="sortinithash">c319cff79d99c853d775f88277d4e45f</bbl:field>
-         <bbl:field name="labelnamesource">author</bbl:field>
-         <bbl:field name="labeltitlesource">title</bbl:field>
-         <bbl:field name="annotation">An article entry with series, volume, and number fields. Note the format of the series which is a localization key</bbl:field>
-@@ -353,7 +353,7 @@
-         <bbl:field name="authorfullhash">15e144c72b0b9d10db00ddc6d37a19e6</bbl:field>
-         <bbl:field name="authorbibnamehash">15e144c72b0b9d10db00ddc6d37a19e6</bbl:field>
-         <bbl:field name="sortinit">W</bbl:field>
--        <bbl:field name="sortinithash">ecb89ff85896a47dc313960773ac311d</bbl:field>
-+        <bbl:field name="sortinithash">1af34bd8c148ffb32de1494636b49713</bbl:field>
-         <bbl:field name="labelnamesource">author</bbl:field>
-         <bbl:field name="labeltitlesource">title</bbl:field>
-         <bbl:field name="journaltitle">Phys. Rev. Lett.</bbl:field>
-@@ -411,7 +411,7 @@
-         <bbl:field name="authorbibnamehash">860705eb8ffac6e40507746c7ede79ca</bbl:field>
-         <bbl:field name="labelalpha">Aks\textbf{+}06</bbl:field>
-         <bbl:field name="sortinit">A</bbl:field>
--        <bbl:field name="sortinithash">d77c7cdd82ff690d4c3ef13216f92f0b</bbl:field>
-+        <bbl:field name="sortinithash">a3dcedd53b04d1adfd5ac303ecd5e6fa</bbl:field>
-         <bbl:field name="labelnamesource">author</bbl:field>
-         <bbl:field name="labeltitlesource">title</bbl:field>
-         <bbl:field name="indextitle">Effect of immobilization on catalytic characteristics</bbl:field>
-@@ -443,7 +443,7 @@
-         <bbl:field name="authorbibnamehash">9717d2d959a4b18727868ca7928c34b4</bbl:field>
-         <bbl:field name="labelalpha">Ang02</bbl:field>
-         <bbl:field name="sortinit">A</bbl:field>
--        <bbl:field name="sortinithash">d77c7cdd82ff690d4c3ef13216f92f0b</bbl:field>
-+        <bbl:field name="sortinithash">a3dcedd53b04d1adfd5ac303ecd5e6fa</bbl:field>
-         <bbl:field name="labelnamesource">author</bbl:field>
-         <bbl:field name="labeltitlesource">shorttitle</bbl:field>
-         <bbl:field name="annotation">A German article in a French journal. Apart from that, a typical article entry. Note the indextitle field</bbl:field>
-@@ -473,7 +473,7 @@
-         </bbl:set>
-         <bbl:field name="labelalpha">Gla61</bbl:field>
-         <bbl:field name="sortinit">G</bbl:field>
--        <bbl:field name="sortinithash">5e8d2bf9d38de41b1528bd307546008f</bbl:field>
-+        <bbl:field name="sortinithash">62eb2aa29549e4fdbd3cb154ec5711cb</bbl:field>
-         <bbl:field name="annotation">A set entry with three members discussing the standard model of particle physics.</bbl:field>
-       </bbl:entry>
-       <bbl:entry key="stdmodel:glashow" type="article">
-@@ -493,7 +493,7 @@
-         <bbl:field name="authorfullhash">eb3f242602109f5bdbeb41fdd990fcc0</bbl:field>
-         <bbl:field name="authorbibnamehash">eb3f242602109f5bdbeb41fdd990fcc0</bbl:field>
-         <bbl:field name="sortinit">G</bbl:field>
--        <bbl:field name="sortinithash">5e8d2bf9d38de41b1528bd307546008f</bbl:field>
-+        <bbl:field name="sortinithash">62eb2aa29549e4fdbd3cb154ec5711cb</bbl:field>
-         <bbl:field name="labelnamesource">author</bbl:field>
-         <bbl:field name="labeltitlesource">title</bbl:field>
-         <bbl:field name="journaltitle">Nucl. Phys.</bbl:field>
-@@ -532,7 +532,7 @@
-         <bbl:field name="extraname">1</bbl:field>
-         <bbl:field name="labelalpha">Knu86</bbl:field>
-         <bbl:field name="sortinit">K</bbl:field>
--        <bbl:field name="sortinithash">9fd838a31ba64d981e8f44562bd33f89</bbl:field>
-+        <bbl:field name="sortinithash">d3edc18d54b9438a72c24c925bfb38f4</bbl:field>
-         <bbl:field name="extraalpha">1</bbl:field>
-         <bbl:field name="labelnamesource">author</bbl:field>
-         <bbl:field name="labeltitlesource">shorttitle</bbl:field>
-@@ -571,7 +571,7 @@
-         <bbl:field name="extraname">2</bbl:field>
-         <bbl:field name="labelalpha">Knu86</bbl:field>
-         <bbl:field name="sortinit">K</bbl:field>
--        <bbl:field name="sortinithash">9fd838a31ba64d981e8f44562bd33f89</bbl:field>
-+        <bbl:field name="sortinithash">d3edc18d54b9438a72c24c925bfb38f4</bbl:field>
-         <bbl:field name="extraalpha">2</bbl:field>
-         <bbl:field name="labelnamesource">author</bbl:field>
-         <bbl:field name="labeltitlesource">shorttitle</bbl:field>
-@@ -600,7 +600,7 @@
-         <bbl:field name="authorbibnamehash">d52f05e0199eae563725b4165f4b2520</bbl:field>
-         <bbl:field name="labelalpha">Ree58</bbl:field>
-         <bbl:field name="sortinit">R</bbl:field>
--        <bbl:field name="sortinithash">da6b42bd3ab22fee61abed031ee405f7</bbl:field>
-+        <bbl:field name="sortinithash">b9c68a358aea118dfa887b6e902414a7</bbl:field>
-         <bbl:field name="labelnamesource">author</bbl:field>
-         <bbl:field name="labeltitlesource">title</bbl:field>
-         <bbl:field name="annotation">An article entry with a series and a volume field. Note the format of the series. If the value of the series field is an integer, this number is printed as an ordinal and the string *series is appended automatically</bbl:field>
-@@ -650,7 +650,7 @@
-         <bbl:field name="editorfullhash">d0ec890e59163c24c111a08d2a4be982</bbl:field>
-         <bbl:field name="editorbibnamehash">d0ec890e59163c24c111a08d2a4be982</bbl:field>
-         <bbl:field name="sortinit">S</bbl:field>
--        <bbl:field name="sortinithash">322b1d5276f2f6c1bccdcd15920dbee6</bbl:field>
-+        <bbl:field name="sortinithash">c319cff79d99c853d775f88277d4e45f</bbl:field>
-         <bbl:field name="labelnamesource">author</bbl:field>
-         <bbl:field name="labeltitlesource">title</bbl:field>
-         <bbl:field name="booksubtitle">Relativistic groups and analyticity</bbl:field>
-@@ -681,7 +681,7 @@
-         <bbl:field name="authorbibnamehash">93f17724cbd884231ef39a73755ef5bb</bbl:field>
-         <bbl:field name="labelalpha">Sho91</bbl:field>
-         <bbl:field name="sortinit">S</bbl:field>
--        <bbl:field name="sortinithash">322b1d5276f2f6c1bccdcd15920dbee6</bbl:field>
-+        <bbl:field name="sortinithash">c319cff79d99c853d775f88277d4e45f</bbl:field>
-         <bbl:field name="labelnamesource">author</bbl:field>
-         <bbl:field name="labeltitlesource">title</bbl:field>
-         <bbl:field name="annotation">An article entry with series, volume, and number fields. Note the format of the series which is a localization key</bbl:field>
-@@ -717,7 +717,7 @@
-         <bbl:field name="authorfullhash">15e144c72b0b9d10db00ddc6d37a19e6</bbl:field>
-         <bbl:field name="authorbibnamehash">15e144c72b0b9d10db00ddc6d37a19e6</bbl:field>
-         <bbl:field name="sortinit">W</bbl:field>
--        <bbl:field name="sortinithash">ecb89ff85896a47dc313960773ac311d</bbl:field>
-+        <bbl:field name="sortinithash">1af34bd8c148ffb32de1494636b49713</bbl:field>
-         <bbl:field name="labelnamesource">author</bbl:field>
-         <bbl:field name="labeltitlesource">title</bbl:field>
-         <bbl:field name="journaltitle">Phys. Rev. Lett.</bbl:field>
-diff --git a/t/tdata/remote-files.bcf b/t/tdata/remote-files.bcf
-index c2d784b..a2a1842 100644
---- a/t/tdata/remote-files.bcf
-+++ b/t/tdata/remote-files.bcf
-@@ -1853,12 +1853,12 @@
-     <bcf:datasource type="file" datatype="bibtex">http://www.citeulike.org/bibtex/group/8082</bcf:datasource>
-     <bcf:datasource type="file" datatype="bibtex">http://people.cs.uu.nl/hansb/graphs-bib/definitions.bib</bcf:datasource>
-     <bcf:datasource type="file" datatype="bibtex">http://people.cs.uu.nl/hansb/graphs-bib/papers.bib</bcf:datasource>
--    <bcf:datasource type="file" datatype="bibtex">https://api.zotero.org/groups/9097/items/II22KQ7D?format=bibtex&amp;limit=1</bcf:datasource>
-+    <bcf:datasource type="file" datatype="bibtex">https://api.zotero.org/groups/9097/items/8VITAT46?format=bibtex&amp;limit=1</bcf:datasource>
-   </bcf:bibdata>
-   <bcf:section number="0">
-     <bcf:citekey order="1">citeulike:8283461</bcf:citekey>
-     <bcf:citekey order="2">AbdelbarH98</bcf:citekey>
--    <bcf:citekey order="3">merleau-ponty_philosophe_2010</bcf:citekey>
-+    <bcf:citekey order="3">crossley_politics_1994</bcf:citekey>
-   </bcf:section>
-   <!-- SORTING TEMPLATES -->
-   <bcf:sortingtemplate name="nty">
-diff --git a/t/uniqueness-nameparts.t b/t/uniqueness-nameparts.t
-index beb2e39..1fb65a8 100644
---- a/t/uniqueness-nameparts.t
-+++ b/t/uniqueness-nameparts.t
-@@ -81,7 +81,7 @@ my $un1 = q|    \entry{un1}{article}{}
-       \strng{authorfullhash}{329d8f9192ea3349d700160c9ddb505d}
-       \field{labelalpha}{SmiJohSim}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -106,7 +106,7 @@ my $un2 = q|    \entry{un2}{article}{}
-       \strng{authorfullhash}{7551114aede4ef69e4b3683039801706}
-       \field{labelalpha}{SmiJohAla}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -131,7 +131,7 @@ my $un3 = q|    \entry{un3}{article}{}
-       \strng{authorfullhash}{401aebda288799a7c757526242d8c9fc}
-       \field{labelalpha}{SmiJohArt}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -156,7 +156,7 @@ my $un4 = q|    \entry{un4}{article}{}
-       \strng{authorfullhash}{f6038a264619efefd49c7daac56424ca}
-       \field{labelalpha}{SmiAlaSim}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -181,7 +181,7 @@ my $un1a = q|    \entry{un1}{article}{}
-       \strng{authorfullhash}{329d8f9192ea3349d700160c9ddb505d}
-       \field{labelalpha}{SmiJohSim}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -206,7 +206,7 @@ my $un2a = q|    \entry{un2}{article}{}
-       \strng{authorfullhash}{7551114aede4ef69e4b3683039801706}
-       \field{labelalpha}{SmiJohAla}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -231,7 +231,7 @@ my $un3a = q|    \entry{un3}{article}{}
-       \strng{authorfullhash}{401aebda288799a7c757526242d8c9fc}
-       \field{labelalpha}{SmiJohArt}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -257,7 +257,7 @@ my $un4a = q|    \entry{un4}{article}{}
-       \strng{authorfullhash}{f6038a264619efefd49c7daac56424ca}
-       \field{labelalpha}{SmiAlaSim}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -285,7 +285,7 @@ my $un1b = q|    \entry{un1}{article}{}
-       \field{extraname}{5}
-       \field{labelalpha}{SmiJohSim}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{extradate}{5}
-       \field{labelnamesource}{author}
-     \endentry
-@@ -311,7 +311,7 @@ my $un2b = q|    \entry{un2}{article}{}
-       \strng{authorfullhash}{7551114aede4ef69e4b3683039801706}
-       \field{labelalpha}{SmiJohAla}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -336,7 +336,7 @@ my $un3b = q|    \entry{un3}{article}{}
-       \strng{authorfullhash}{401aebda288799a7c757526242d8c9fc}
-       \field{labelalpha}{SmiJohArt}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -364,7 +364,7 @@ my $un4b = q|    \entry{un4}{article}{}
-       \field{extraname}{1}
-       \field{labelalpha}{SmiAlaSim}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{extradate}{1}
-       \field{labelnamesource}{author}
-     \endentry
-@@ -393,7 +393,7 @@ my $un5 = q|    \entry{un5}{article}{uniquenametemplatename=test3}
-       \field{extraname}{2}
-       \field{labelalpha}{SmiArtSim}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{extradate}{2}
-       \field{labelnamesource}{author}
-     \endentry
-@@ -422,7 +422,7 @@ my $un6 = q|    \entry{un6}{article}{}
-       \field{extraname}{3}
-       \field{labelalpha}{SmiArtSmy}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{extradate}{3}
-       \field{labelnamesource}{author}
-     \\endentry
-@@ -451,7 +451,7 @@ my $un7 = q|    \entry{un7}{article}{}
-       \field{extraname}{4}
-       \field{labelalpha}{SmiArtSme}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{extradate}{4}
-       \field{labelnamesource}{author}
-     \endentry
-diff --git a/t/xdata.t b/t/xdata.t
-index 7411b1d..73dcb8b 100644
---- a/t/xdata.t
-+++ b/t/xdata.t
-@@ -75,7 +75,7 @@ my $xd1 = q|    \entry{xd1}{book}{}
-       \strng{authorfullhash}{51db4bfd331cba22959ce2d224c517cd}
-       \field{extraname}{2}
-       \field{sortinit}{E}
--      \field{sortinithash}{f615fb9c6fba11c6f962fb3fd599810e}
-+      \field{sortinithash}{c554bd1a0b76ea92b9f105fe36d9c7b0}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-       \field{labelnamesource}{author}
-@@ -107,7 +107,7 @@ my $xd2 = q|    \entry{xd2}{book}{}
-       \strng{authornamehash}{68539e0ce4922cc4957c6cabf35e6fc8}
-       \strng{authorfullhash}{68539e0ce4922cc4957c6cabf35e6fc8}
-       \field{sortinit}{P}
--      \field{sortinithash}{8d51b3d5b78d75b54308d706b9bbe285}
-+      \field{sortinithash}{bb5b15f2db90f7aef79bb9e83defefcb}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-       \field{labelnamesource}{author}
diff --git a/gnu/packages/patches/bind-re-add-attr-constructor-priority.patch b/gnu/packages/patches/bind-re-add-attr-constructor-priority.patch
new file mode 100644
index 0000000000..33e4f183f6
--- /dev/null
+++ b/gnu/packages/patches/bind-re-add-attr-constructor-priority.patch
@@ -0,0 +1,57 @@
+From 6361de07a35f2e9dc1d7201d6b26ca31da93ee69 Mon Sep 17 00:00:00 2001
+From: Tobias Geerinckx-Rice <me@tobias.gr>
+Date: Thu, 9 Dec 2021 01:07:32 +0100
+Subject: [PATCH] Revert "Remove priority from attribute
+ constructor/destructor"
+
+This reverts commit 0340df46ec5897636dd071bc8b5c4272cfa7d7be.  It works
+around an irrelevant operating system and breaks compilation on Guix:
+
+mem.c:873: fatal error: RUNTIME_CHECK(((pthread_mutex_lock(((&contextslock))) == 0) ? 0 : 34) == 0) failed
+/gnu/store/…-bash-minimal-5.0.16/bin/bash: line 1: 13768 Aborted                 ./${fuzzer}
+
+Let's simply revert it for now---there are securities at stake!
+---
+ lib/isc/include/isc/util.h | 8 ++++----
+ lib/isc/lib.c              | 4 ++--
+ 2 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/lib/isc/include/isc/util.h b/lib/isc/include/isc/util.h
+index f0f7f85fa4..64c26587ac 100644
+--- a/lib/isc/include/isc/util.h
++++ b/lib/isc/include/isc/util.h
+@@ -49,11 +49,11 @@
+ #endif /* __GNUC__ */
+ 
+ #if HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR && HAVE_FUNC_ATTRIBUTE_DESTRUCTOR
+-#define ISC_CONSTRUCTOR __attribute__((constructor))
+-#define ISC_DESTRUCTOR	__attribute__((destructor))
++#define ISC_CONSTRUCTOR(priority) __attribute__((constructor(priority)))
++#define ISC_DESTRUCTOR(priority)  __attribute__((destructor(priority)))
+ #elif WIN32
+-#define ISC_CONSTRUCTOR
+-#define ISC_DESTRUCTOR
++#define ISC_CONSTRUCTOR(priority)
++#define ISC_DESTRUCTOR(priority)
+ #endif
+ 
+ /*%
+diff --git a/lib/isc/lib.c b/lib/isc/lib.c
+index f3576b2659..2a167fec21 100644
+--- a/lib/isc/lib.c
++++ b/lib/isc/lib.c
+@@ -35,9 +35,9 @@ isc_lib_register(void) {
+ }
+ 
+ void
+-isc__initialize(void) ISC_CONSTRUCTOR;
++isc__initialize(void) ISC_CONSTRUCTOR(101);
+ void
+-isc__shutdown(void) ISC_DESTRUCTOR;
++isc__shutdown(void) ISC_DESTRUCTOR(101);
+ 
+ void
+ isc__initialize(void) {
+-- 
+2.34.0
+
diff --git a/gnu/packages/patches/binutils-2.37-file-descriptor-leak.patch b/gnu/packages/patches/binutils-2.37-file-descriptor-leak.patch
new file mode 100644
index 0000000000..1fd3d3d9b7
--- /dev/null
+++ b/gnu/packages/patches/binutils-2.37-file-descriptor-leak.patch
@@ -0,0 +1,231 @@
+From 1c611b40e6bfc8029bff7696814330b5bc0ee5c0 Mon Sep 17 00:00:00 2001
+From: "H.J. Lu" <hjl.tools@gmail.com>
+Date: Mon, 26 Jul 2021 05:59:55 -0700
+Subject: [PATCH] bfd: Close the file descriptor if there is no archive fd
+
+Close the file descriptor if there is no archive plugin file descriptor
+to avoid running out of file descriptors on thin archives with many
+archive members.
+
+bfd/
+
+	PR ld/28138
+	* plugin.c (bfd_plugin_close_file_descriptor): Close the file
+	descriptor there is no archive plugin file descriptor.
+
+ld/
+
+	PR ld/28138
+	* testsuite/ld-plugin/lto.exp: Run tmpdir/pr28138 only for
+	native build.
+
+	PR ld/28138
+	* testsuite/ld-plugin/lto.exp: Run ld/28138 tests.
+	* testsuite/ld-plugin/pr28138.c: New file.
+	* testsuite/ld-plugin/pr28138-1.c: Likewise.
+	* testsuite/ld-plugin/pr28138-2.c: Likewise.
+	* testsuite/ld-plugin/pr28138-3.c: Likewise.
+	* testsuite/ld-plugin/pr28138-4.c: Likewise.
+	* testsuite/ld-plugin/pr28138-5.c: Likewise.
+	* testsuite/ld-plugin/pr28138-6.c: Likewise.
+	* testsuite/ld-plugin/pr28138-7.c: Likewise.
+
+(cherry picked from commit 5a98fb7513b559e20dfebdbaa2a471afda3b4742)
+(cherry picked from commit 7dc37e1e1209c80e0bab784df6b6bac335e836f2)
+---
+ bfd/plugin.c                       |  8 +++++++
+ ld/testsuite/ld-plugin/lto.exp     | 34 ++++++++++++++++++++++++++++++
+ ld/testsuite/ld-plugin/pr28138-1.c |  6 ++++++
+ ld/testsuite/ld-plugin/pr28138-2.c |  6 ++++++
+ ld/testsuite/ld-plugin/pr28138-3.c |  6 ++++++
+ ld/testsuite/ld-plugin/pr28138-4.c |  6 ++++++
+ ld/testsuite/ld-plugin/pr28138-5.c |  6 ++++++
+ ld/testsuite/ld-plugin/pr28138-6.c |  6 ++++++
+ ld/testsuite/ld-plugin/pr28138-7.c |  6 ++++++
+ ld/testsuite/ld-plugin/pr28138.c   | 20 ++++++++++++++++++
+ 10 files changed, 104 insertions(+)
+ create mode 100644 ld/testsuite/ld-plugin/pr28138-1.c
+ create mode 100644 ld/testsuite/ld-plugin/pr28138-2.c
+ create mode 100644 ld/testsuite/ld-plugin/pr28138-3.c
+ create mode 100644 ld/testsuite/ld-plugin/pr28138-4.c
+ create mode 100644 ld/testsuite/ld-plugin/pr28138-5.c
+ create mode 100644 ld/testsuite/ld-plugin/pr28138-6.c
+ create mode 100644 ld/testsuite/ld-plugin/pr28138-7.c
+ create mode 100644 ld/testsuite/ld-plugin/pr28138.c
+
+diff --git a/bfd/plugin.c b/bfd/plugin.c
+index 6cfa2b66470..3bab8febe88 100644
+--- a/bfd/plugin.c
++++ b/bfd/plugin.c
+@@ -291,6 +291,14 @@ bfd_plugin_close_file_descriptor (bfd *abfd, int fd)
+ 	     && !bfd_is_thin_archive (abfd->my_archive))
+ 	abfd = abfd->my_archive;
+ 
++      /* Close the file descriptor if there is no archive plugin file
++	 descriptor.  */
++      if (abfd->archive_plugin_fd == -1)
++	{
++	  close (fd);
++	  return;
++	}
++
+       abfd->archive_plugin_fd_open_count--;
+       /* Dup the archive plugin file descriptor for later use, which
+ 	 will be closed by _bfd_archive_close_and_cleanup.  */
+diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
+index def69e43ab3..999d911ce6a 100644
+--- a/ld/testsuite/ld-plugin/lto.exp
++++ b/ld/testsuite/ld-plugin/lto.exp
+@@ -687,6 +687,40 @@ if { [is_elf_format] && [check_lto_shared_available] } {
+     }
+ }
+ 
++run_cc_link_tests [list \
++    [list \
++	"Build pr28138.a" \
++	"-T" "" \
++	{pr28138-1.c pr28138-2.c pr28138-3.c pr28138-4.c pr28138-5.c \
++	 pr28138-6.c pr28138-7.c} {} "pr28138.a" \
++    ] \
++    [list \
++	"Build pr28138.o" \
++	"" "" \
++	{pr28138.c} {} \
++    ] \
++]
++
++set exec_output [run_host_cmd "sh" \
++			      "-c \"ulimit -n 20; \
++			      $CC -Btmpdir/ld -o tmpdir/pr28138 \
++			      tmpdir/pr28138.o tmpdir/pr28138.a\""]
++set exec_output [prune_warnings $exec_output]
++if [string match "" $exec_output] then {
++    if { [isnative] } {
++	set exec_output [run_host_cmd "tmpdir/pr28138" ""]
++	if [string match "PASS" $exec_output] then {
++	    pass "PR ld/28138"
++	} else {
++	    fail "PR ld/28138"
++	}
++    } else {
++	pass "PR ld/28138"
++    }
++} else {
++    fail "PR ld/28138"
++}
++
+ set testname "Build liblto-11.a"
+ remote_file host delete "tmpdir/liblto-11.a"
+ set catch_output [run_host_cmd "$ar" "rc $plug_opt tmpdir/liblto-11.a tmpdir/lto-11a.o tmpdir/lto-11b.o tmpdir/lto-11c.o"]
+diff --git a/ld/testsuite/ld-plugin/pr28138-1.c b/ld/testsuite/ld-plugin/pr28138-1.c
+new file mode 100644
+index 00000000000..51d119e1642
+--- /dev/null
++++ b/ld/testsuite/ld-plugin/pr28138-1.c
+@@ -0,0 +1,6 @@
++extern int a0(void);
++int
++a1(void)
++{
++  return 1 + a0();
++}
+diff --git a/ld/testsuite/ld-plugin/pr28138-2.c b/ld/testsuite/ld-plugin/pr28138-2.c
+new file mode 100644
+index 00000000000..1120cd797e9
+--- /dev/null
++++ b/ld/testsuite/ld-plugin/pr28138-2.c
+@@ -0,0 +1,6 @@
++extern int a1(void);
++int
++a2(void)
++{
++  return 1 + a1();
++}
+diff --git a/ld/testsuite/ld-plugin/pr28138-3.c b/ld/testsuite/ld-plugin/pr28138-3.c
+new file mode 100644
+index 00000000000..ec464947ee6
+--- /dev/null
++++ b/ld/testsuite/ld-plugin/pr28138-3.c
+@@ -0,0 +1,6 @@
++extern int a2(void);
++int
++a3(void)
++{
++  return 1 + a2();
++}
+diff --git a/ld/testsuite/ld-plugin/pr28138-4.c b/ld/testsuite/ld-plugin/pr28138-4.c
+new file mode 100644
+index 00000000000..475701b2c5c
+--- /dev/null
++++ b/ld/testsuite/ld-plugin/pr28138-4.c
+@@ -0,0 +1,6 @@
++extern int a3(void);
++int
++a4(void)
++{
++  return 1 + a3();
++}
+diff --git a/ld/testsuite/ld-plugin/pr28138-5.c b/ld/testsuite/ld-plugin/pr28138-5.c
+new file mode 100644
+index 00000000000..e24f86c363e
+--- /dev/null
++++ b/ld/testsuite/ld-plugin/pr28138-5.c
+@@ -0,0 +1,6 @@
++extern int a4(void);
++int
++a5(void)
++{
++  return 1 + a4();
++}
+diff --git a/ld/testsuite/ld-plugin/pr28138-6.c b/ld/testsuite/ld-plugin/pr28138-6.c
+new file mode 100644
+index 00000000000..b5b938bdb21
+--- /dev/null
++++ b/ld/testsuite/ld-plugin/pr28138-6.c
+@@ -0,0 +1,6 @@
++extern int a5(void);
++int
++a6(void)
++{
++  return 1 + a5();
++}
+diff --git a/ld/testsuite/ld-plugin/pr28138-7.c b/ld/testsuite/ld-plugin/pr28138-7.c
+new file mode 100644
+index 00000000000..4ef75bf0f0c
+--- /dev/null
++++ b/ld/testsuite/ld-plugin/pr28138-7.c
+@@ -0,0 +1,6 @@
++extern int a6(void);
++int
++a7(void)
++{
++  return 1 + a6();
++}
+diff --git a/ld/testsuite/ld-plugin/pr28138.c b/ld/testsuite/ld-plugin/pr28138.c
+new file mode 100644
+index 00000000000..68252c9f382
+--- /dev/null
++++ b/ld/testsuite/ld-plugin/pr28138.c
+@@ -0,0 +1,20 @@
++#include <stdio.h>
++
++extern int a7(void);
++
++int
++a0(void)
++{
++  return 0;
++}
++
++int
++main()
++{
++  if (a7() == 7)
++    {
++      printf ("PASS\n");
++      return 0;
++    }
++  return 1;
++}
+-- 
+2.27.0
diff --git a/gnu/packages/patches/binutils-CVE-2021-45078.patch b/gnu/packages/patches/binutils-CVE-2021-45078.patch
new file mode 100644
index 0000000000..fca692bdb5
--- /dev/null
+++ b/gnu/packages/patches/binutils-CVE-2021-45078.patch
@@ -0,0 +1,257 @@
+Fix CVE-2021-45078 (incomplete fix for CVE-2018-12699):
+
+https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-45078
+https://sourceware.org/bugzilla/show_bug.cgi?id=28694
+
+Patch copied from upstream source repository:
+
+https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=161e87d12167b1e36193385485c1f6ce92f74f02
+
+From 161e87d12167b1e36193385485c1f6ce92f74f02 Mon Sep 17 00:00:00 2001
+From: Alan Modra <amodra@gmail.com>
+Date: Wed, 15 Dec 2021 11:48:42 +1030
+Subject: [PATCH] PR28694, Out-of-bounds write in stab_xcoff_builtin_type
+
+	PR 28694
+	* stabs.c (stab_xcoff_builtin_type): Make typenum unsigned.
+	Negate typenum earlier, simplifying bounds checking.  Correct
+	off-by-one indexing.  Adjust switch cases.
+---
+ binutils/stabs.c | 87 ++++++++++++++++++++++++------------------------
+ 1 file changed, 43 insertions(+), 44 deletions(-)
+
+diff --git a/binutils/stabs.c b/binutils/stabs.c
+index 274bfb0e7fa..83ee3ea5fa4 100644
+--- a/binutils/stabs.c
++++ b/binutils/stabs.c
+@@ -202,7 +202,7 @@ static debug_type stab_find_type (void *, struct stab_handle *, const int *);
+ static bool stab_record_type
+   (void *, struct stab_handle *, const int *, debug_type);
+ static debug_type stab_xcoff_builtin_type
+-  (void *, struct stab_handle *, int);
++  (void *, struct stab_handle *, unsigned int);
+ static debug_type stab_find_tagged_type
+   (void *, struct stab_handle *, const char *, int, enum debug_type_kind);
+ static debug_type *stab_demangle_argtypes
+@@ -3496,166 +3496,167 @@ stab_record_type (void *dhandle ATTRIBUTE_UNUSED, struct stab_handle *info,
+ 
+ static debug_type
+ stab_xcoff_builtin_type (void *dhandle, struct stab_handle *info,
+-			 int typenum)
++			 unsigned int typenum)
+ {
+   debug_type rettype;
+   const char *name;
+ 
+-  if (typenum >= 0 || typenum < -XCOFF_TYPE_COUNT)
++  typenum = -typenum - 1;
++  if (typenum >= XCOFF_TYPE_COUNT)
+     {
+-      fprintf (stderr, _("Unrecognized XCOFF type %d\n"), typenum);
++      fprintf (stderr, _("Unrecognized XCOFF type %d\n"), -typenum - 1);
+       return DEBUG_TYPE_NULL;
+     }
+-  if (info->xcoff_types[-typenum] != NULL)
+-    return info->xcoff_types[-typenum];
++  if (info->xcoff_types[typenum] != NULL)
++    return info->xcoff_types[typenum];
+ 
+-  switch (-typenum)
++  switch (typenum)
+     {
+-    case 1:
++    case 0:
+       /* The size of this and all the other types are fixed, defined
+ 	 by the debugging format.  */
+       name = "int";
+       rettype = debug_make_int_type (dhandle, 4, false);
+       break;
+-    case 2:
++    case 1:
+       name = "char";
+       rettype = debug_make_int_type (dhandle, 1, false);
+       break;
+-    case 3:
++    case 2:
+       name = "short";
+       rettype = debug_make_int_type (dhandle, 2, false);
+       break;
+-    case 4:
++    case 3:
+       name = "long";
+       rettype = debug_make_int_type (dhandle, 4, false);
+       break;
+-    case 5:
++    case 4:
+       name = "unsigned char";
+       rettype = debug_make_int_type (dhandle, 1, true);
+       break;
+-    case 6:
++    case 5:
+       name = "signed char";
+       rettype = debug_make_int_type (dhandle, 1, false);
+       break;
+-    case 7:
++    case 6:
+       name = "unsigned short";
+       rettype = debug_make_int_type (dhandle, 2, true);
+       break;
+-    case 8:
++    case 7:
+       name = "unsigned int";
+       rettype = debug_make_int_type (dhandle, 4, true);
+       break;
+-    case 9:
++    case 8:
+       name = "unsigned";
+       rettype = debug_make_int_type (dhandle, 4, true);
+       break;
+-    case 10:
++    case 9:
+       name = "unsigned long";
+       rettype = debug_make_int_type (dhandle, 4, true);
+       break;
+-    case 11:
++    case 10:
+       name = "void";
+       rettype = debug_make_void_type (dhandle);
+       break;
+-    case 12:
++    case 11:
+       /* IEEE single precision (32 bit).  */
+       name = "float";
+       rettype = debug_make_float_type (dhandle, 4);
+       break;
+-    case 13:
++    case 12:
+       /* IEEE double precision (64 bit).  */
+       name = "double";
+       rettype = debug_make_float_type (dhandle, 8);
+       break;
+-    case 14:
++    case 13:
+       /* This is an IEEE double on the RS/6000, and different machines
+ 	 with different sizes for "long double" should use different
+ 	 negative type numbers.  See stabs.texinfo.  */
+       name = "long double";
+       rettype = debug_make_float_type (dhandle, 8);
+       break;
+-    case 15:
++    case 14:
+       name = "integer";
+       rettype = debug_make_int_type (dhandle, 4, false);
+       break;
+-    case 16:
++    case 15:
+       name = "boolean";
+       rettype = debug_make_bool_type (dhandle, 4);
+       break;
+-    case 17:
++    case 16:
+       name = "short real";
+       rettype = debug_make_float_type (dhandle, 4);
+       break;
+-    case 18:
++    case 17:
+       name = "real";
+       rettype = debug_make_float_type (dhandle, 8);
+       break;
+-    case 19:
++    case 18:
+       /* FIXME */
+       name = "stringptr";
+       rettype = NULL;
+       break;
+-    case 20:
++    case 19:
+       /* FIXME */
+       name = "character";
+       rettype = debug_make_int_type (dhandle, 1, true);
+       break;
+-    case 21:
++    case 20:
+       name = "logical*1";
+       rettype = debug_make_bool_type (dhandle, 1);
+       break;
+-    case 22:
++    case 21:
+       name = "logical*2";
+       rettype = debug_make_bool_type (dhandle, 2);
+       break;
+-    case 23:
++    case 22:
+       name = "logical*4";
+       rettype = debug_make_bool_type (dhandle, 4);
+       break;
+-    case 24:
++    case 23:
+       name = "logical";
+       rettype = debug_make_bool_type (dhandle, 4);
+       break;
+-    case 25:
++    case 24:
+       /* Complex type consisting of two IEEE single precision values.  */
+       name = "complex";
+       rettype = debug_make_complex_type (dhandle, 8);
+       break;
+-    case 26:
++    case 25:
+       /* Complex type consisting of two IEEE double precision values.  */
+       name = "double complex";
+       rettype = debug_make_complex_type (dhandle, 16);
+       break;
+-    case 27:
++    case 26:
+       name = "integer*1";
+       rettype = debug_make_int_type (dhandle, 1, false);
+       break;
+-    case 28:
++    case 27:
+       name = "integer*2";
+       rettype = debug_make_int_type (dhandle, 2, false);
+       break;
+-    case 29:
++    case 28:
+       name = "integer*4";
+       rettype = debug_make_int_type (dhandle, 4, false);
+       break;
+-    case 30:
++    case 29:
+       /* FIXME */
+       name = "wchar";
+       rettype = debug_make_int_type (dhandle, 2, false);
+       break;
+-    case 31:
++    case 30:
+       name = "long long";
+       rettype = debug_make_int_type (dhandle, 8, false);
+       break;
+-    case 32:
++    case 31:
+       name = "unsigned long long";
+       rettype = debug_make_int_type (dhandle, 8, true);
+       break;
+-    case 33:
++    case 32:
+       name = "logical*8";
+       rettype = debug_make_bool_type (dhandle, 8);
+       break;
+-    case 34:
++    case 33:
+       name = "integer*8";
+       rettype = debug_make_int_type (dhandle, 8, false);
+       break;
+@@ -3664,9 +3665,7 @@ stab_xcoff_builtin_type (void *dhandle, struct stab_handle *info,
+     }
+ 
+   rettype = debug_name_type (dhandle, name, rettype);
+-
+-  info->xcoff_types[-typenum] = rettype;
+-
++  info->xcoff_types[typenum] = rettype;
+   return rettype;
+ }
+ 
+-- 
+2.27.0
+
diff --git a/gnu/packages/patches/binutils-loongson-workaround.patch b/gnu/packages/patches/binutils-loongson-workaround.patch
index f43572a53d..f05d6c3c96 100644
--- a/gnu/packages/patches/binutils-loongson-workaround.patch
+++ b/gnu/packages/patches/binutils-loongson-workaround.patch
@@ -4,22 +4,22 @@ Patch by Mark H Weaver <mhw@netris.org>.
 
 --- binutils/gas/config/tc-mips.c.orig	2012-09-04 10:21:03.000000000 -0400
 +++ binutils/gas/config/tc-mips.c	2013-10-06 02:23:21.651983768 -0400
-@@ -910,10 +910,10 @@
+@@ -934,10 +934,10 @@ enum fix_vr4120_class
  };
  
  /* ...likewise -mfix-loongson2f-jump.  */
--static bfd_boolean mips_fix_loongson2f_jump;
-+static bfd_boolean mips_fix_loongson2f_jump = FALSE;
+-static bool mips_fix_loongson2f_jump;
++static bool mips_fix_loongson2f_jump = FALSE;
  
  /* ...likewise -mfix-loongson2f-nop.  */
--static bfd_boolean mips_fix_loongson2f_nop;
-+static bfd_boolean mips_fix_loongson2f_nop = TRUE;
+-static bool mips_fix_loongson2f_nop;
++static bool mips_fix_loongson2f_nop = TRUE;
  
  /* True if -mfix-loongson2f-nop or -mfix-loongson2f-jump passed.  */
- static bfd_boolean mips_fix_loongson2f;
+ static bool mips_fix_loongson2f;
 --- binutils/gas/testsuite/gas/mips/mips.exp.orig	2012-09-04 10:17:13.000000000 -0400
 +++ binutils/gas/testsuite/gas/mips/mips.exp	2013-10-06 02:23:21.663983768 -0400
-@@ -91,6 +91,12 @@
+@@ -110,6 +110,12 @@ proc mips_arch_init {} {
  
      # Catch because the variable won't be set the first time through.
      catch {unset mips_arches}
diff --git a/gnu/packages/patches/binutils-mingw-w64-timestamp.patch b/gnu/packages/patches/binutils-mingw-w64-timestamp.patch
index b785043b62..fcfe4a36aa 100644
--- a/gnu/packages/patches/binutils-mingw-w64-timestamp.patch
+++ b/gnu/packages/patches/binutils-mingw-w64-timestamp.patch
@@ -4,14 +4,14 @@ https://salsa.debian.org/mingw-w64-team/binutils-mingw-w64.git
 
 Invoke the following in the aforementioned repo to see the original patch:
 
-  $ git show da63f6b:debian/patches/specify-timestamp.patch
+  $ git show faf7c64:debian/patches/specify-timestamp.patch
 
 Description: Allow the PE timestamp to be specified
 Author: Stephen Kitt <skitt@debian.org>
 
 --- a/bfd/peXXigen.c
 +++ b/bfd/peXXigen.c
-@@ -70,6 +70,9 @@
+@@ -77,6 +77,9 @@
  #include <wctype.h>
  #endif
  
@@ -21,20 +21,20 @@ Author: Stephen Kitt <skitt@debian.org>
  /* NOTE: it's strange to be including an architecture specific header
     in what's supposed to be general (to PE/PEI) code.  However, that's
     where the definitions are, and they don't vary per architecture
-@@ -879,10 +882,38 @@
+@@ -876,9 +879,36 @@
  
    /* Use a real timestamp by default, unless the no-insert-timestamp
       option was chosen.  */
--  if ((pe_data (abfd)->insert_timestamp))
+-  if ((pe_data (abfd)->timestamp) == -1)
 -    H_PUT_32 (abfd, time (0), filehdr_out->f_timdat);
 -  else
-+  if (pe_data (abfd)->insert_timestamp) {
++  if ((pe_data (abfd)->timestamp) == -1) {
 +    time_t now;
 +    char *source_date_epoch;
 +    unsigned long long epoch;
 +    char *endptr;
 +
-+    now = time(NULL);
++    now = time (NULL);
 +    source_date_epoch = getenv("SOURCE_DATE_EPOCH");
 +    if (source_date_epoch) {
 +      errno = 0;
@@ -57,30 +57,29 @@ Author: Stephen Kitt <skitt@debian.org>
 +      }
 +    }
 +    H_PUT_32 (abfd, now, filehdr_out->f_timdat);
-+  } else {
-     H_PUT_32 (abfd, 0, filehdr_out->f_timdat);
-+  }
++  } else
+     H_PUT_32 (abfd, pe_data (abfd)->timestamp, filehdr_out->f_timdat);
  
    PUT_FILEHDR_SYMPTR (abfd, filehdr_in->f_symptr,
- 		      filehdr_out->f_symptr);
 --- a/ld/pe-dll.c
 +++ b/ld/pe-dll.c
-@@ -26,6 +26,8 @@
- #include "filenames.h"
+@@ -27,6 +27,8 @@
  #include "safe-ctype.h"
+ #include "ctf-api.h"
  
 +#include <errno.h>
 +#include <limits.h>
  #include <time.h>
  
  #include "ld.h"
-@@ -1202,8 +1204,36 @@
+@@ -1218,9 +1220,36 @@
  
    memset (edata_d, 0, edata_sz);
  
--  if (pe_data (abfd)->insert_timestamp)
+-  if (pe_data (abfd)->timestamp == -1)
 -    H_PUT_32 (abfd, time (0), edata_d + 4);
-+  if (pe_data (abfd)->insert_timestamp) {
+-  else
++  if (pe_data (abfd)->timestamp == -1) {
 +    time_t now;
 +    char *source_date_epoch;
 +    unsigned long long epoch;
@@ -109,13 +108,13 @@ Author: Stephen Kitt <skitt@debian.org>
 +      }
 +    }
 +    H_PUT_32 (abfd, now, edata_d + 4);
-+  }
++  } else
+     H_PUT_32 (abfd, pe_data (abfd)->timestamp, edata_d + 4);
  
    if (pe_def_file->version_major != -1)
-     {
 --- a/ld/emultempl/pe.em
 +++ b/ld/emultempl/pe.em
-@@ -303,7 +303,7 @@
+@@ -304,7 +304,7 @@
       OPTION_USE_NUL_PREFIXED_IMPORT_TABLES},
      {"no-leading-underscore", no_argument, NULL, OPTION_NO_LEADING_UNDERSCORE},
      {"leading-underscore", no_argument, NULL, OPTION_LEADING_UNDERSCORE},
@@ -126,7 +125,7 @@ Author: Stephen Kitt <skitt@debian.org>
      /* getopt allows abbreviations, so we do this to stop it
 --- a/ld/emultempl/pep.em
 +++ b/ld/emultempl/pep.em
-@@ -321,7 +321,7 @@
+@@ -323,7 +323,7 @@
      {"no-bind", no_argument, NULL, OPTION_NO_BIND},
      {"wdmdriver", no_argument, NULL, OPTION_WDM_DRIVER},
      {"tsaware", no_argument, NULL, OPTION_TERMINAL_SERVER_AWARE},
@@ -134,4 +133,4 @@ Author: Stephen Kitt <skitt@debian.org>
 +    {"insert-timestamp", optional_argument, NULL, OPTION_INSERT_TIMESTAMP},
      {"no-insert-timestamp", no_argument, NULL, OPTION_NO_INSERT_TIMESTAMP},
      {"build-id", optional_argument, NULL, OPTION_BUILD_ID},
-     {NULL, no_argument, NULL, 0}
+     {"enable-reloc-section", no_argument, NULL, OPTION_ENABLE_RELOC_SECTION},
diff --git a/gnu/packages/patches/blender-2.79-gcc8.patch b/gnu/packages/patches/blender-2.79-gcc8.patch
deleted file mode 100644
index 6a9186323b..0000000000
--- a/gnu/packages/patches/blender-2.79-gcc8.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-diff --git a/intern/itasc/kdl/tree.hpp b/intern/itasc/kdl/tree.hpp
-index c8a253fc901..bd35f82d185 100644
---- a/intern/itasc/kdl/tree.hpp
-+++ b/intern/itasc/kdl/tree.hpp
-@@ -34,7 +34,7 @@ namespace KDL
-     //Forward declaration
-     class TreeElement;
-     // Eigen allocator is needed for alignment of Eigen data types
--    typedef std::map<std::string,TreeElement, std::less<std::string>, Eigen::aligned_allocator<std::pair<std::string, TreeElement> > > SegmentMap;
-+    typedef std::map<std::string,TreeElement, std::less<std::string>, Eigen::aligned_allocator<std::pair<const std::string, TreeElement> > > SegmentMap;
- 
-     class TreeElement
-     {
-diff --git a/intern/cycles/util/util_sseb.h b/intern/cycles/util/util_sseb.h
-index 6e669701f3b..977976c3fc0 100644
---- a/intern/cycles/util/util_sseb.h
-+++ b/intern/cycles/util/util_sseb.h
-@@ -22,6 +22,9 @@ CCL_NAMESPACE_BEGIN
- 
- #ifdef __KERNEL_SSE2__
- 
-+struct ssei;
-+struct ssef;
-+
- /*! 4-wide SSE bool type. */
- struct sseb
- {
-@@ -116,7 +119,7 @@ __forceinline const sseb unpacklo( const sseb& a, const sseb& b ) { return _mm_u
- __forceinline const sseb unpackhi( const sseb& a, const sseb& b ) { return _mm_unpackhi_ps(a, b); }
- 
- template<size_t i0, size_t i1, size_t i2, size_t i3> __forceinline const sseb shuffle( const sseb& a ) {
--	return _mm_shuffle_epi32(a, _MM_SHUFFLE(i3, i2, i1, i0));
-+	return _mm_castsi128_ps(_mm_shuffle_epi32(a, _MM_SHUFFLE(i3, i2, i1, i0)));
- }
- 
- template<> __forceinline const sseb shuffle<0, 1, 0, 1>( const sseb& a ) {
diff --git a/gnu/packages/patches/blender-2.79-gcc9.patch b/gnu/packages/patches/blender-2.79-gcc9.patch
deleted file mode 100644
index d538a02620..0000000000
--- a/gnu/packages/patches/blender-2.79-gcc9.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-commit e6d803fd4a383cecf8c643095f093a31c944b785
-Author: Robert-André Mauchin <zebob.m@gmail.com>
-Date:   Wed Apr 3 01:36:52 2019 +0200
-
-    Fix for GCC9 new OpenMP data sharing
-    
-    GCC 9 started implementing the OpenMP 4.0 and later behavior. When not using
-    default clause or when using default(shared), this makes no difference, but
-    if using default(none), previously the choice was not specify the const
-    qualified variables on the construct at all, or specify in firstprivate
-    clause. In GCC 9 as well as for OpenMP 4.0 compliance, those variables need
-    to be specified on constructs in which they are used, either in shared or
-    in firstprivate clause. Specifying them in firstprivate clause is one way to
-    achieve compatibility with both older GCC versions and GCC 9,
-    another option is to drop the default(none) clause.
-    
-    This patch thus drops the default(none) clause.
-    
-    See https://gcc.gnu.org/gcc-9/porting_to.html#ompdatasharing
-    
-    Signed-off-by: Robert-André Mauchin <zebob.m@gmail.com>
-
-diff --git a/intern/elbeem/intern/solver_main.cpp b/intern/elbeem/intern/solver_main.cpp
-index 68f7c04cd54..514087b6130 100644
---- a/intern/elbeem/intern/solver_main.cpp
-+++ b/intern/elbeem/intern/solver_main.cpp
-@@ -381,7 +381,7 @@ LbmFsgrSolver::mainLoop(const int lev)
- 	GRID_REGION_INIT();
- #if PARALLEL==1
- 	const int gDebugLevel = ::gDebugLevel;
--#pragma omp parallel default(none) num_threads(mNumOMPThreads) \
-+#pragma omp parallel num_threads(mNumOMPThreads) \
-   reduction(+: \
- 	  calcCurrentMass,calcCurrentVolume, \
- 		calcCellsFilled,calcCellsEmptied, \
-@@ -1126,7 +1126,7 @@ LbmFsgrSolver::preinitGrids()
- 		GRID_REGION_INIT();
- #if PARALLEL==1
- 	const int gDebugLevel = ::gDebugLevel;
--#pragma omp parallel default(none) num_threads(mNumOMPThreads) \
-+#pragma omp parallel num_threads(mNumOMPThreads) \
-   reduction(+: \
- 	  calcCurrentMass,calcCurrentVolume, \
- 		calcCellsFilled,calcCellsEmptied, \
-@@ -1164,7 +1164,7 @@ LbmFsgrSolver::standingFluidPreinit()
- 	GRID_REGION_INIT();
- #if PARALLEL==1
- 	const int gDebugLevel = ::gDebugLevel;
--#pragma omp parallel default(none) num_threads(mNumOMPThreads) \
-+#pragma omp parallel num_threads(mNumOMPThreads) \
-   reduction(+: \
- 	  calcCurrentMass,calcCurrentVolume, \
- 		calcCellsFilled,calcCellsEmptied, \
diff --git a/gnu/packages/patches/blender-2.79-newer-ffmpeg.patch b/gnu/packages/patches/blender-2.79-newer-ffmpeg.patch
deleted file mode 100644
index 363489bc70..0000000000
--- a/gnu/packages/patches/blender-2.79-newer-ffmpeg.patch
+++ /dev/null
@@ -1,80 +0,0 @@
-https://sources.debian.org/data/main/b/blender/2.79.b+dfsg0-4/debian/patches/0008-fix_building_with_latest_versions_of_FFmpeg.patch
-
-From: Bastien Montagne <montagne29@wanadoo.fr>
-Date: Tue, 8 May 2018 16:00:52 +0200
-Subject: fix_building_with_latest_versions_of_FFmpeg
-
-Some years-old deprecated stuff has now been removed.
-
-Correct solution is probably to use valid defines etc. in own code, but
-this is more FFMEPG maintainer task (since it also may change how old
-FFMPEG we do support...).
----
- intern/ffmpeg/ffmpeg_compat.h                  | 39 ++++++++++++++++++++++++++
- source/blender/blenkernel/intern/writeffmpeg.c |  3 +-
- 2 files changed, 41 insertions(+), 1 deletion(-)
-
-diff --git a/intern/ffmpeg/ffmpeg_compat.h b/intern/ffmpeg/ffmpeg_compat.h
-index 9c06c8a..f7f437c 100644
---- a/intern/ffmpeg/ffmpeg_compat.h
-+++ b/intern/ffmpeg/ffmpeg_compat.h
-@@ -109,6 +109,45 @@ int av_sample_fmt_is_planar(enum AVSampleFormat sample_fmt)
- 
- #endif
- 
-+/* XXX TODO Probably fix to correct modern flags in code? Not sure how old FFMPEG we want to support though,
-+ * so for now this will do. */
-+
-+#ifndef FF_MIN_BUFFER_SIZE
-+#  ifdef AV_INPUT_BUFFER_MIN_SIZE
-+#    define FF_MIN_BUFFER_SIZE AV_INPUT_BUFFER_MIN_SIZE
-+#  endif
-+#endif
-+
-+#ifndef FF_INPUT_BUFFER_PADDING_SIZE
-+#  ifdef AV_INPUT_BUFFER_PADDING_SIZE
-+#    define FF_INPUT_BUFFER_PADDING_SIZE AV_INPUT_BUFFER_PADDING_SIZE
-+#  endif
-+#endif
-+
-+#ifndef CODEC_FLAG_GLOBAL_HEADER
-+#  ifdef AV_CODEC_FLAG_GLOBAL_HEADER
-+#    define CODEC_FLAG_GLOBAL_HEADER AV_CODEC_FLAG_GLOBAL_HEADER
-+#  endif
-+#endif
-+
-+#ifndef CODEC_FLAG_GLOBAL_HEADER
-+#  ifdef AV_CODEC_FLAG_GLOBAL_HEADER
-+#    define CODEC_FLAG_GLOBAL_HEADER AV_CODEC_FLAG_GLOBAL_HEADER
-+#  endif
-+#endif
-+
-+#ifndef CODEC_FLAG_INTERLACED_DCT
-+#  ifdef AV_CODEC_FLAG_INTERLACED_DCT
-+#    define CODEC_FLAG_INTERLACED_DCT AV_CODEC_FLAG_INTERLACED_DCT
-+#  endif
-+#endif
-+
-+#ifndef CODEC_FLAG_INTERLACED_ME
-+#  ifdef AV_CODEC_FLAG_INTERLACED_ME
-+#    define CODEC_FLAG_INTERLACED_ME AV_CODEC_FLAG_INTERLACED_ME
-+#  endif
-+#endif
-+
- /* FFmpeg upstream 1.0 is the first who added AV_ prefix. */
- #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(54, 59, 100)
- #  define AV_CODEC_ID_NONE CODEC_ID_NONE
-diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c
-index a19e414..04d508a 100644
---- a/source/blender/blenkernel/intern/writeffmpeg.c
-+++ b/source/blender/blenkernel/intern/writeffmpeg.c
-@@ -605,7 +605,8 @@ static AVStream *alloc_video_stream(FFMpegContext *context, RenderData *rd, int
- 	c->rc_buffer_aggressivity = 1.0;
- #endif
- 
--	c->me_method = ME_EPZS;
-+	/* Deprecated and not doing anything since July 2015, deleted in recent ffmpeg */
-+	//c->me_method = ME_EPZS;
- 	
- 	codec = avcodec_find_encoder(c->codec_id);
- 	if (!codec)
diff --git a/gnu/packages/patches/blender-2.79-oiio2.patch b/gnu/packages/patches/blender-2.79-oiio2.patch
deleted file mode 100644
index 1c3606a940..0000000000
--- a/gnu/packages/patches/blender-2.79-oiio2.patch
+++ /dev/null
@@ -1,284 +0,0 @@
-From: Sergey Sharybin <sergey@blender.org>
-Date: Fri, 28 Dec 2018 11:25:35 +0100
-Subject: adapt_build_against_OIIO2
-
----
- intern/cycles/blender/blender_python.cpp           |  2 +-
- intern/cycles/graph/node_xml.cpp                   |  2 +-
- intern/cycles/render/buffers.cpp                   |  4 ++--
- intern/cycles/render/image.cpp                     | 15 ++++--------
- intern/cycles/render/image.h                       |  3 ++-
- intern/cycles/util/util_unique_ptr.h               | 28 ++++++++++++++++++++++
- .../blender/imbuf/intern/oiio/openimageio_api.cpp  | 19 +++++++--------
- 7 files changed, 48 insertions(+), 25 deletions(-)
- create mode 100644 intern/cycles/util/util_unique_ptr.h
-
-diff --git a/intern/cycles/blender/blender_python.cpp b/intern/cycles/blender/blender_python.cpp
-index 54973fd..bee6dd1 100644
---- a/intern/cycles/blender/blender_python.cpp
-+++ b/intern/cycles/blender/blender_python.cpp
-@@ -493,7 +493,7 @@ static PyObject *osl_update_node_func(PyObject * /*self*/, PyObject *args)
- 				socket_type = "NodeSocketString";
- 				data_type = BL::NodeSocket::type_STRING;
- 				if(param->validdefault)
--					default_string = param->sdefault[0];
-+					default_string = param->sdefault[0].string();
- 			}
- 			else
- 				continue;
-diff --git a/intern/cycles/graph/node_xml.cpp b/intern/cycles/graph/node_xml.cpp
-index d26b3b2..2a24104 100644
---- a/intern/cycles/graph/node_xml.cpp
-+++ b/intern/cycles/graph/node_xml.cpp
-@@ -250,7 +250,7 @@ void xml_read_node(XMLReader& reader, Node *node, xml_node xml_node)
- 		}
- 	}
- 
--	if(node->name)
-+	if(!node->name.empty())
- 		reader.node_map[node->name] = node;
- }
- 
-diff --git a/intern/cycles/render/buffers.cpp b/intern/cycles/render/buffers.cpp
-index cf402c3..f84a37a 100644
---- a/intern/cycles/render/buffers.cpp
-+++ b/intern/cycles/render/buffers.cpp
-@@ -27,6 +27,7 @@
- #include "util/util_opengl.h"
- #include "util/util_time.h"
- #include "util/util_types.h"
-+#include "util/util_unique_ptr.h"
- 
- CCL_NAMESPACE_BEGIN
- 
-@@ -453,7 +454,7 @@ void DisplayBuffer::write(Device *device, const string& filename)
- 	device->pixels_copy_from(rgba, 0, w, h);
- 
- 	/* write image */
--	ImageOutput *out = ImageOutput::create(filename);
-+	unique_ptr<ImageOutput> out = unique_ptr<ImageOutput>(ImageOutput::create(filename));
- 	ImageSpec spec(w, h, 4, TypeDesc::UINT8);
- 	int scanlinesize = w*4*sizeof(uchar);
- 
-@@ -468,7 +469,6 @@ void DisplayBuffer::write(Device *device, const string& filename)
- 
- 	out->close();
- 
--	delete out;
- }
- 
- device_memory& DisplayBuffer::rgba_data()
-diff --git a/intern/cycles/render/image.cpp b/intern/cycles/render/image.cpp
-index 595eb46..a143b02 100644
---- a/intern/cycles/render/image.cpp
-+++ b/intern/cycles/render/image.cpp
-@@ -23,6 +23,7 @@
- #include "util/util_path.h"
- #include "util/util_progress.h"
- #include "util/util_texture.h"
-+#include "util/util_unique_ptr.h"
- 
- #ifdef WITH_OSL
- #include <OSL/oslexec.h>
-@@ -148,7 +149,7 @@ ImageDataType ImageManager::get_image_metadata(const string& filename,
- 		return IMAGE_DATA_TYPE_BYTE4;
- 	}
- 
--	ImageInput *in = ImageInput::create(filename);
-+	unique_ptr<ImageInput> in(ImageInput::create(filename));
- 
- 	if(in) {
- 		ImageSpec spec;
-@@ -194,7 +195,6 @@ ImageDataType ImageManager::get_image_metadata(const string& filename,
- 			in->close();
- 		}
- 
--		delete in;
- 	}
- 
- 	if(is_half) {
-@@ -449,7 +449,7 @@ void ImageManager::tag_reload_image(const string& filename,
- }
- 
- bool ImageManager::file_load_image_generic(Image *img,
--                                           ImageInput **in,
-+                                           unique_ptr<ImageInput> *in,
-                                            int &width,
-                                            int &height,
-                                            int &depth,
-@@ -465,7 +465,7 @@ bool ImageManager::file_load_image_generic(Image *img,
- 		}
- 
- 		/* load image from file through OIIO */
--		*in = ImageInput::create(img->filename);
-+		*in = unique_ptr<ImageInput>(ImageInput::create(img->filename));
- 
- 		if(!*in)
- 			return false;
-@@ -477,8 +477,6 @@ bool ImageManager::file_load_image_generic(Image *img,
- 			config.attribute("oiio:UnassociatedAlpha", 1);
- 
- 		if(!(*in)->open(img->filename, spec, config)) {
--			delete *in;
--			*in = NULL;
- 			return false;
- 		}
- 
-@@ -500,8 +498,6 @@ bool ImageManager::file_load_image_generic(Image *img,
- 	if(!(components >= 1 && components <= 4)) {
- 		if(*in) {
- 			(*in)->close();
--			delete *in;
--			*in = NULL;
- 		}
- 
- 		return false;
-@@ -519,7 +515,7 @@ bool ImageManager::file_load_image(Image *img,
-                                    device_vector<DeviceType>& tex_img)
- {
- 	const StorageType alpha_one = (FileFormat == TypeDesc::UINT8)? 255 : 1;
--	ImageInput *in = NULL;
-+	unique_ptr<ImageInput> in = NULL;
- 	int width, height, depth, components;
- 	if(!file_load_image_generic(img, &in, width, height, depth, components)) {
- 		return false;
-@@ -575,7 +571,6 @@ bool ImageManager::file_load_image(Image *img,
- 		}
- 		cmyk = strcmp(in->format_name(), "jpeg") == 0 && components == 4;
- 		in->close();
--		delete in;
- 	}
- 	else {
- 		if(FileFormat == TypeDesc::FLOAT) {
-diff --git a/intern/cycles/render/image.h b/intern/cycles/render/image.h
-index db7e28a..f4a14f4 100644
---- a/intern/cycles/render/image.h
-+++ b/intern/cycles/render/image.h
-@@ -23,6 +23,7 @@
- #include "util/util_image.h"
- #include "util/util_string.h"
- #include "util/util_thread.h"
-+#include "util/util_unique_ptr.h"
- #include "util/util_vector.h"
- 
- CCL_NAMESPACE_BEGIN
-@@ -133,7 +134,7 @@ private:
- 	bool pack_images;
- 
- 	bool file_load_image_generic(Image *img,
--	                             ImageInput **in,
-+	                             unique_ptr<ImageInput> *in,
- 	                             int &width,
- 	                             int &height,
- 	                             int &depth,
-diff --git a/intern/cycles/util/util_unique_ptr.h b/intern/cycles/util/util_unique_ptr.h
-new file mode 100644
-index 0000000..1ceae73
---- /dev/null
-+++ b/intern/cycles/util/util_unique_ptr.h
-@@ -0,0 +1,28 @@
-+/*
-+ * Copyright 2011-2013 Blender Foundation
-+ *
-+ * Licensed under the Apache License, Version 2.0 (the "License");
-+ * you may not use this file except in compliance with the License.
-+ * You may obtain a copy of the License at
-+ *
-+ * http://www.apache.org/licenses/LICENSE-2.0
-+ *
-+ * Unless required by applicable law or agreed to in writing, software
-+ * distributed under the License is distributed on an "AS IS" BASIS,
-+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-+ * See the License for the specific language governing permissions and
-+ * limitations under the License.
-+ */
-+
-+#ifndef __UTIL_UNIQUE_PTR_H__
-+#define __UTIL_UNIQUE_PTR_H__
-+
-+#include <memory>
-+
-+CCL_NAMESPACE_BEGIN
-+
-+using std::unique_ptr;
-+
-+CCL_NAMESPACE_END
-+
-+#endif  /* __UTIL_UNIQUE_PTR_H__ */
-diff --git a/source/blender/imbuf/intern/oiio/openimageio_api.cpp b/source/blender/imbuf/intern/oiio/openimageio_api.cpp
-index b123d50..7f2fac9 100644
---- a/source/blender/imbuf/intern/oiio/openimageio_api.cpp
-+++ b/source/blender/imbuf/intern/oiio/openimageio_api.cpp
-@@ -35,6 +35,11 @@
- #include "utfconv.h"
- #endif
- 
-+// NOTE: Keep first, BLI_path_util conflicts with OIIO's format.
-+#include <memory>
-+#include <openimageio_api.h>
-+#include <OpenImageIO/imageio.h>
-+
- extern "C"
- {
- #include "MEM_guardedalloc.h"
-@@ -48,12 +53,10 @@ extern "C"
- #include "IMB_colormanagement_intern.h"
- }
- 
--#include <openimageio_api.h>
--#include <OpenImageIO/imageio.h>
--
- OIIO_NAMESPACE_USING
- 
- using std::string;
-+using std::unique_ptr;
- 
- typedef unsigned char uchar;
- 
-@@ -197,7 +200,6 @@ int imb_save_photoshop(struct ImBuf *ibuf, const char * /*name*/, int flags)
- 
- struct ImBuf *imb_load_photoshop(const char *filename, int flags, char colorspace[IM_MAX_SPACE])
- {
--	ImageInput *in = NULL;
- 	struct ImBuf *ibuf = NULL;
- 	int width, height, components;
- 	bool is_float, is_alpha;
-@@ -210,7 +212,7 @@ struct ImBuf *imb_load_photoshop(const char *filename, int flags, char colorspac
- 
- 	colorspace_set_default_role(colorspace, IM_MAX_SPACE, COLOR_ROLE_DEFAULT_BYTE);
- 
--	in = ImageInput::create(filename);
-+	unique_ptr<ImageInput> in(ImageInput::create(filename));
- 	if (!in) {
- 		std::cerr << __func__ << ": ImageInput::create() failed:" << std::endl
- 		          << OIIO_NAMESPACE::geterror() << std::endl;
-@@ -223,7 +225,6 @@ struct ImBuf *imb_load_photoshop(const char *filename, int flags, char colorspac
- 	if (!in->open(filename, spec, config)) {
- 		std::cerr << __func__ << ": ImageInput::open() failed:" << std::endl
- 		          << in->geterror() << std::endl;
--		delete in;
- 		return NULL;
- 	}
- 
-@@ -249,19 +250,17 @@ struct ImBuf *imb_load_photoshop(const char *filename, int flags, char colorspac
- 	if (!(components >= 1 && components <= 4)) {
- 		if (in) {
- 			in->close();
--			delete in;
- 		}
- 		return NULL;
- 	}
- 
- 	if (is_float)
--		ibuf = imb_oiio_load_image_float(in, width, height, components, flags, is_alpha);
-+		ibuf = imb_oiio_load_image_float(in.get(), width, height, components, flags, is_alpha);
- 	else
--		ibuf = imb_oiio_load_image(in, width, height, components, flags, is_alpha);
-+		ibuf = imb_oiio_load_image(in.get(), width, height, components, flags, is_alpha);
- 
- 	if (in) {
- 		in->close();
--		delete in;
- 	}
- 
- 	if (!ibuf)
diff --git a/gnu/packages/patches/blender-2.79-python-3.7-fix.patch b/gnu/packages/patches/blender-2.79-python-3.7-fix.patch
deleted file mode 100644
index fd1d8ba437..0000000000
--- a/gnu/packages/patches/blender-2.79-python-3.7-fix.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-Copied from https://git.blender.org/gitweb/gitweb.cgi/blender.git/patch/1db47a2ccd1e68994bf8140eba6cc2a26a2bc91f
-Fixes <https://bugs.gnu.org/33608>.
-
-From 1db47a2ccd1e68994bf8140eba6cc2a26a2bc91f Mon Sep 17 00:00:00 2001
-From: Campbell Barton <ideasman42@gmail.com>
-Date: Thu, 12 Jul 2018 08:28:06 +0200
-Subject: [PATCH] Fix PyRNA class registration w/ Python 3.7
-
-In Python3.7 this now raises an error.
----
- source/blender/python/intern/bpy_rna.c | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
-index 9052b6f580a..80b0aa7a51b 100644
---- a/source/blender/python/intern/bpy_rna.c
-+++ b/source/blender/python/intern/bpy_rna.c
-@@ -7577,10 +7577,12 @@ static int bpy_class_validate_recursive(PointerRNA *dummyptr, StructRNA *srna, v
- 		if (!(flag & PROP_REGISTER))
- 			continue;
- 
-+		/* TODO(campbell): Use Python3.7x _PyObject_LookupAttr(), also in the macro below. */
- 		identifier = RNA_property_identifier(prop);
- 		item = PyObject_GetAttrString(py_class, identifier);
- 
- 		if (item == NULL) {
-+			PyErr_Clear();
- 			/* Sneaky workaround to use the class name as the bl_idname */
- 
- #define     BPY_REPLACEMENT_STRING(rna_attr, py_attr)                         \
-@@ -7596,6 +7598,9 @@ static int bpy_class_validate_recursive(PointerRNA *dummyptr, StructRNA *srna, v
- 					}                                                         \
- 					Py_DECREF(item);                                          \
- 				}                                                             \
-+				else {                                                        \
-+					PyErr_Clear();                                            \
-+				}                                                             \
- 			}  /* intentionally allow else here */
- 
- 			if (false) {}  /* needed for macro */
--- 
-2.20.1
-
diff --git a/gnu/packages/patches/blender-2.79-python-3.8-fix.patch b/gnu/packages/patches/blender-2.79-python-3.8-fix.patch
deleted file mode 100644
index 18d25449ee..0000000000
--- a/gnu/packages/patches/blender-2.79-python-3.8-fix.patch
+++ /dev/null
@@ -1,204 +0,0 @@
-From 4b663ecf264020b1d7003a137ce84b06d7ec4ce6 Mon Sep 17 00:00:00 2001
-From: bartus <szczepaniak.bartek+github@gmail.com>
-Date: Sat, 16 Nov 2019 20:29:30 +0100
-Subject: [PATCH] Add python 3.8 support.
-
----
- source/blender/python/generic/py_capi_utils.c | 27 +++++++++++++++----
- 1 file changed, 22 insertions(+), 5 deletions(-)
-
-diff --git a/source/blender/python/generic/py_capi_utils.c b/source/blender/python/generic/py_capi_utils.c
-index 545e0506f84..a7eab70600b 100644
---- a/source/blender/python/generic/py_capi_utils.c
-+++ b/source/blender/python/generic/py_capi_utils.c
-@@ -696,9 +696,16 @@ PyObject *PyC_UnicodeFromByte(const char *str)
-  ****************************************************************************/
- PyObject *PyC_DefaultNameSpace(const char *filename)
- {
-+	#if PY_VERSION_HEX >= 0x03080000
-+	PyObject *modules = PyImport_GetModuleDict();
-+	PyObject *builtins = PyEval_GetBuiltins();
-+	#else
- 	PyInterpreterState *interp = PyThreadState_GET()->interp;
-+	PyObject *modules = interp->modules;
-+	PyObject *builtins = interp->builtins;
-+	#endif
- 	PyObject *mod_main = PyModule_New("__main__");
--	PyDict_SetItemString(interp->modules, "__main__", mod_main);
-+	PyDict_SetItemString(modules, "__main__", mod_main);
- 	Py_DECREF(mod_main); /* sys.modules owns now */
- 	PyModule_AddStringConstant(mod_main, "__name__", "__main__");
- 	if (filename) {
-@@ -706,8 +713,8 @@ PyObject *PyC_DefaultNameSpace(const char *filename)
- 		 * note: this wont map to a real file when executing text-blocks and buttons. */
- 		PyModule_AddObject(mod_main, "__file__", PyC_UnicodeFromByte(filename));
- 	}
--	PyModule_AddObject(mod_main, "__builtins__", interp->builtins);
--	Py_INCREF(interp->builtins); /* AddObject steals a reference */
-+	PyModule_AddObject(mod_main, "__builtins__", builtins);
-+	Py_INCREF(builtins); /* AddObject steals a reference */
- 	return PyModule_GetDict(mod_main);
- }
- 
-@@ -734,15 +741,25 @@ bool PyC_NameSpace_ImportArray(PyObject *py_dict, const char *imports[])
- /* restore MUST be called after this */
- void PyC_MainModule_Backup(PyObject **main_mod)
- {
-+	#if PY_VERSION_HEX >= 0x03080000
-+	PyObject *modules = PyImport_GetModuleDict();
-+	#else
- 	PyInterpreterState *interp = PyThreadState_GET()->interp;
--	*main_mod = PyDict_GetItemString(interp->modules, "__main__");
-+	PyObject *modules = interp->modules;
-+	#endif
-+	*main_mod = PyDict_GetItemString(modules, "__main__");
- 	Py_XINCREF(*main_mod); /* don't free */
- }
- 
- void PyC_MainModule_Restore(PyObject *main_mod)
- {
-+	#if PY_VERSION_HEX >= 0x03080000
-+	PyObject *modules = PyImport_GetModuleDict();
-+	#else
- 	PyInterpreterState *interp = PyThreadState_GET()->interp;
--	PyDict_SetItemString(interp->modules, "__main__", main_mod);
-+	PyObject *modules = interp->modules;
-+	#endif
-+	PyDict_SetItemString(modules, "__main__", main_mod);
- 	Py_XDECREF(main_mod);
- }
- 
--- 
-2.24.0
-
-From 44f719b63238503ef8f933f55383c6d4798995cc Mon Sep 17 00:00:00 2001
-From: Campbell Barton <ideasman42@gmail.com>
-Date: Thu, 13 Sep 2018 17:06:07 +1000
-Subject: [PATCH] Cleanup: use PyImport_GetModuleDict
-
-Replace direct access using PyThreadState_GET
----
- source/blender/python/bmesh/bmesh_py_api.c        | 2 +-
- source/blender/python/generic/idprop_py_api.c     | 2 +-
- source/blender/python/intern/bpy_interface.c      | 2 +-
- source/blender/python/intern/gpu.c                | 4 ++--
- source/blender/python/mathutils/mathutils.c       | 2 +-
- source/blender/python/mathutils/mathutils_noise.c | 5 +++--
- source/gameengine/Ketsji/KX_PythonInit.cpp        | 2 +-
- 7 files changed, 10 insertions(+), 9 deletions(-)
-
-diff --git a/source/blender/python/bmesh/bmesh_py_api.c b/source/blender/python/bmesh/bmesh_py_api.c
-index d5973baeadb..d7324eabb6c 100644
---- a/source/blender/python/bmesh/bmesh_py_api.c
-+++ b/source/blender/python/bmesh/bmesh_py_api.c
-@@ -196,7 +196,7 @@ PyObject *BPyInit_bmesh(void)
- {
- 	PyObject *mod;
- 	PyObject *submodule;
--	PyObject *sys_modules = PyThreadState_GET()->interp->modules;
-+	PyObject *sys_modules = PyImport_GetModuleDict();
- 
- 	BPy_BM_init_types();
- 	BPy_BM_init_types_select();
-diff --git a/source/blender/python/generic/idprop_py_api.c b/source/blender/python/generic/idprop_py_api.c
-index 4d4d5232800..8bed0f28cba 100644
---- a/source/blender/python/generic/idprop_py_api.c
-+++ b/source/blender/python/generic/idprop_py_api.c
-@@ -1795,7 +1795,7 @@ PyObject *BPyInit_idprop(void)
- {
- 	PyObject *mod;
- 	PyObject *submodule;
--	PyObject *sys_modules = PyThreadState_GET()->interp->modules;
-+	PyObject *sys_modules = PyImport_GetModuleDict();
- 
- 	mod = PyModule_Create(&IDProp_module_def);
- 
-diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c
-index 7ca087e4993..123c938b921 100644
---- a/source/blender/python/intern/bpy_interface.c
-+++ b/source/blender/python/intern/bpy_interface.c
-@@ -537,7 +537,7 @@ static bool python_script_exec(
- 
- 	if (py_dict) {
- #ifdef PYMODULE_CLEAR_WORKAROUND
--		PyModuleObject *mmod = (PyModuleObject *)PyDict_GetItemString(PyThreadState_GET()->interp->modules, "__main__");
-+		PyModuleObject *mmod = (PyModuleObject *)PyDict_GetItemString(PyImport_GetModuleDict(), "__main__");
- 		PyObject *dict_back = mmod->md_dict;
- 		/* freeing the module will clear the namespace,
- 		 * gives problems running classes defined in this namespace being used later. */
-diff --git a/source/blender/python/intern/gpu.c b/source/blender/python/intern/gpu.c
-index 43796dc9474..d902b6838f4 100644
---- a/source/blender/python/intern/gpu.c
-+++ b/source/blender/python/intern/gpu.c
-@@ -326,7 +326,7 @@ PyObject *GPU_initPython(void)
- {
- 	PyObject *module;
- 	PyObject *submodule;
--	PyObject *sys_modules = PyThreadState_GET()->interp->modules;
-+	PyObject *sys_modules = PyImport_GetModuleDict();
- 
- 	module = PyInit_gpu();
- 
-@@ -337,6 +337,6 @@ PyObject *GPU_initPython(void)
- 	PyDict_SetItem(sys_modules, PyModule_GetNameObject(submodule), submodule);
- 	Py_INCREF(submodule);
- 
--	PyDict_SetItem(PyImport_GetModuleDict(), PyModule_GetNameObject(module), module);
-+	PyDict_SetItem(sys_modules, PyModule_GetNameObject(module), module);
- 	return module;
- }
-diff --git a/source/blender/python/mathutils/mathutils.c b/source/blender/python/mathutils/mathutils.c
-index a3a4e7f313b..f021d456b3a 100644
---- a/source/blender/python/mathutils/mathutils.c
-+++ b/source/blender/python/mathutils/mathutils.c
-@@ -615,7 +615,7 @@ PyMODINIT_FUNC PyInit_mathutils(void)
- {
- 	PyObject *mod;
- 	PyObject *submodule;
--	PyObject *sys_modules = PyThreadState_GET()->interp->modules;
-+	PyObject *sys_modules = PyImport_GetModuleDict();
- 
- 	if (PyType_Ready(&vector_Type) < 0)
- 		return NULL;
-diff --git a/source/blender/python/mathutils/mathutils_noise.c b/source/blender/python/mathutils/mathutils_noise.c
-index 839d1ffc588..834322c0aed 100644
---- a/source/blender/python/mathutils/mathutils_noise.c
-+++ b/source/blender/python/mathutils/mathutils_noise.c
-@@ -845,6 +845,7 @@ static struct PyModuleDef M_Noise_module_def = {
- /*----------------------------MODULE INIT-------------------------*/
- PyMODINIT_FUNC PyInit_mathutils_noise(void)
- {
-+	PyObject *sys_modules = PyImport_GetModuleDict();
- 	PyObject *submodule = PyModule_Create(&M_Noise_module_def);
- 	PyObject *item_types, *item_metrics;
- 
-@@ -852,11 +853,11 @@ PyMODINIT_FUNC PyInit_mathutils_noise(void)
- 	setRndSeed(0);
- 
- 	PyModule_AddObject(submodule, "types", (item_types = PyInit_mathutils_noise_types()));
--	PyDict_SetItemString(PyThreadState_GET()->interp->modules, "noise.types", item_types);
-+	PyDict_SetItemString(sys_modules, "noise.types", item_types);
- 	Py_INCREF(item_types);
- 
- 	PyModule_AddObject(submodule, "distance_metrics", (item_metrics = PyInit_mathutils_noise_metrics()));
--	PyDict_SetItemString(PyThreadState_GET()->interp->modules, "noise.distance_metrics", item_metrics);
-+	PyDict_SetItemString(sys_modules, "noise.distance_metrics", item_metrics);
- 	Py_INCREF(item_metrics);
- 
- 	return submodule;
-diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp
-index 251273cf7a8..9611a4ea49b 100644
---- a/source/gameengine/Ketsji/KX_PythonInit.cpp
-+++ b/source/gameengine/Ketsji/KX_PythonInit.cpp
-@@ -2234,7 +2234,7 @@ PyMODINIT_FUNC initBGE(void)
- {
- 	PyObject *mod;
- 	PyObject *submodule;
--	PyObject *sys_modules = PyThreadState_GET()->interp->modules;
-+	PyObject *sys_modules = PyImport_GetModuleDict();
- 	const char *mod_full;
- 
- 	mod = PyModule_Create(&BGE_module_def);
--- 
-2.25.0
-
diff --git a/gnu/packages/patches/bubblewrap-fix-locale-in-tests.patch b/gnu/packages/patches/bubblewrap-fix-locale-in-tests.patch
new file mode 100644
index 0000000000..bd5924ef87
--- /dev/null
+++ b/gnu/packages/patches/bubblewrap-fix-locale-in-tests.patch
@@ -0,0 +1,34 @@
+From 9282223de4b511aeda3b7d2caf3810a56a865710 Mon Sep 17 00:00:00 2001
+From: kiasoc5 <kiasoc5@tutanota.com>
+Date: Mon, 10 Jan 2022 14:16:32 -0500
+Subject: [PATCH] Use C locale unconditionally for tests.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The ‘en_US.utf8’ locale is available. However, the ‘locale -a’ command won’t list it.
+---
+ tests/libtest-core.sh | 7 +------
+ 1 file changed, 1 insertion(+), 6 deletions(-)
+
+diff --git a/tests/libtest-core.sh b/tests/libtest-core.sh
+index 9632e90..82951dd 100644
+--- a/tests/libtest-core.sh
++++ b/tests/libtest-core.sh
+@@ -41,12 +41,7 @@ assert_not_reached () {
+ #
+ # If we can't find the locale command assume we have support for C.UTF-8
+ # (e.g. musl based systems)
+-if type -p locale >/dev/null; then
+-    export LC_ALL=$(locale -a | grep -iEe '^(C|en_US)\.(UTF-8|utf8)$' | head -n1 || true)
+-    if [ -z "${LC_ALL}" ]; then fatal "Can't find suitable UTF-8 locale"; fi
+-else
+-    export LC_ALL=C.UTF-8
+-fi
++export LC_ALL=en_US.utf8
+ # A GNU extension, used whenever LC_ALL is not C
+ unset LANGUAGE
+ 
+-- 
+2.34.1
+
diff --git a/gnu/packages/patches/c++-gsl-move-array-bounds-tests.patch b/gnu/packages/patches/c++-gsl-move-array-bounds-tests.patch
new file mode 100644
index 0000000000..0629212688
--- /dev/null
+++ b/gnu/packages/patches/c++-gsl-move-array-bounds-tests.patch
@@ -0,0 +1,126 @@
+Description: Move tests that trigger -Warray-bounds to separate compilation unit
+ GCC 10 is now smart enough to detect violation of array boundaries that tests
+ are actually tested. Along with -Werror this led to tests failure, so I move
+ such tests to another compilation unit to have the warning deactivated for
+ only these tests.
+Bug-Debian: https://bugs.debian.org/966895
+Author: Nicholas Guriev <guriev-ns@ya.ru>
+Last-Modified: Wed, 19 Aug 2020 08:55:52 +0300
+
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -179,6 +179,7 @@ add_gsl_test(owner_tests)
+ add_gsl_test(byte_tests)
+ add_gsl_test(algorithm_tests)
+ add_gsl_test(strict_notnull_tests)
++add_gsl_test(array_bounds)
+ 
+ 
+ # No exception tests
+--- /dev/null
++++ b/tests/array_bounds.cpp
+@@ -0,0 +1,68 @@
++///////////////////////////////////////////////////////////////////////////////
++//
++// Copyright (c) 2015 Microsoft Corporation. All rights reserved.
++//
++// This code is licensed under the MIT License (MIT).
++//
++// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
++// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
++// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
++// THE SOFTWARE.
++//
++///////////////////////////////////////////////////////////////////////////////
++
++#ifdef __GNUC__
++#pragma GCC diagnostic warning "-Warray-bounds"
++#endif // __GNUC__
++
++#include <gtest/gtest.h>
++
++#include <gsl/multi_span> // for gsl::multi_span
++
++namespace gsl
++{
++struct fail_fast;
++} // namespace gsl
++
++namespace
++{
++static constexpr char deathstring[] = "Expected Death";
++} // namespace
++
++TEST(array_bounds, subspan_from_multi_span_test)
++{
++    int arr[5] = {1, 2, 3, 4, 5};
++    gsl::multi_span<int> av = arr;
++
++    std::set_terminate([] {
++        std::cerr << "Expected Death. subspan";
++        std::abort();
++    });
++
++    EXPECT_DEATH(av.subspan(6).length(), deathstring);
++}
++
++TEST(array_bounds, strided_span_bounds_from_strided_span_tests)
++{
++    int arr[] = {0, 1, 2, 3};
++    gsl::multi_span<int> av(arr);
++
++    std::set_terminate([] {
++        std::cerr << "Expected Death. strided_span_bounds";
++        std::abort();
++    });
++
++    // incorrect sections
++    EXPECT_DEATH(av.section(0, 0)[0], deathstring);
++    EXPECT_DEATH(av.section(1, 0)[0], deathstring);
++    EXPECT_DEATH(av.section(1, 1)[1], deathstring);
++
++    EXPECT_DEATH(av.section(2, 5), deathstring);
++    EXPECT_DEATH(av.section(5, 2), deathstring);
++    EXPECT_DEATH(av.section(5, 0), deathstring);
++    EXPECT_DEATH(av.section(0, 5), deathstring);
++    EXPECT_DEATH(av.section(5, 5), deathstring);
++}
+--- a/tests/multi_span_tests.cpp
++++ b/tests/multi_span_tests.cpp
+@@ -1042,10 +1042,6 @@ TEST(multi_span_test, subspan)
+         EXPECT_TRUE(av.subspan(1).length() == 4);
+         EXPECT_TRUE(av.subspan(4).length() == 1);
+         EXPECT_TRUE(av.subspan(5).length() == 0);
+-        // Disabled test instead of fixing since multi_span is deprecated. (PR#835)
+-#if !(defined(__GNUC__) && __GNUC__ == 8)
+-        EXPECT_DEATH(av.subspan(6).length(), deathstring);
+-#endif
+         auto av2 = av.subspan(1);
+         for (int i = 0; i < 4; ++i) EXPECT_TRUE(av2[i] == i + 2);
+     }
+--- a/tests/strided_span_tests.cpp
++++ b/tests/strided_span_tests.cpp
+@@ -403,20 +403,6 @@ TEST(strided_span_tests, strided_span_bo
+     });
+ 
+     {
+-        // incorrect sections
+-
+-        EXPECT_DEATH(av.section(0, 0)[0], deathstring);
+-        EXPECT_DEATH(av.section(1, 0)[0], deathstring);
+-        EXPECT_DEATH(av.section(1, 1)[1], deathstring);
+-
+-        EXPECT_DEATH(av.section(2, 5), deathstring);
+-        EXPECT_DEATH(av.section(5, 2), deathstring);
+-        EXPECT_DEATH(av.section(5, 0), deathstring);
+-        EXPECT_DEATH(av.section(0, 5), deathstring);
+-        EXPECT_DEATH(av.section(5, 5), deathstring);
+-    }
+-
+-    {
+         // zero stride
+         strided_span<int, 1> sav{av, {{4}, {}}};
+         EXPECT_TRUE(sav[0] == 0);
diff --git a/gnu/packages/patches/cabal-install-base16-bytestring1.0.patch b/gnu/packages/patches/cabal-install-base16-bytestring1.0.patch
new file mode 100644
index 0000000000..998bf08718
--- /dev/null
+++ b/gnu/packages/patches/cabal-install-base16-bytestring1.0.patch
@@ -0,0 +1,29 @@
+Restore compatibility with newer version of base16-bytestring.
+
+Taken from https://raw.githubusercontent.com/archlinux/svntogit-community/packages/trunk/cabal-install-base16-bytestring1.0.patch
+
+diff --git a/Distribution/Client/HashValue.hs b/Distribution/Client/HashValue.hs
+index 54b8aee9e..11e647c1c 100644
+--- a/Distribution/Client/HashValue.hs
++++ b/Distribution/Client/HashValue.hs
+@@ -1,3 +1,4 @@
++{-# LANGUAGE CPP          #-}
+ {-# LANGUAGE DeriveDataTypeable #-}
+ {-# LANGUAGE DeriveGeneric      #-}
+ module Distribution.Client.HashValue (
+@@ -72,10 +73,14 @@ hashFromTUF (Sec.Hash hashstr) =
+     --TODO: [code cleanup] either we should get TUF to use raw bytestrings or
+     -- perhaps we should also just use a base16 string as the internal rep.
+     case Base16.decode (BS.pack hashstr) of
++#if MIN_VERSION_base16_bytestring(1,0,0)
++      Right hash -> HashValue hash
++      Left _ -> error "hashFromTUF: cannot decode base16"
++#else
+       (hash, trailing) | not (BS.null hash) && BS.null trailing
+         -> HashValue hash
+       _ -> error "hashFromTUF: cannot decode base16 hash"
+-
++#endif
+ 
+ -- | Truncate a 32 byte SHA256 hash to
+ --
diff --git a/gnu/packages/patches/cabal-install-ghc8.10.patch b/gnu/packages/patches/cabal-install-ghc8.10.patch
new file mode 100644
index 0000000000..67c0953058
--- /dev/null
+++ b/gnu/packages/patches/cabal-install-ghc8.10.patch
@@ -0,0 +1,393 @@
+From ac9b41eef3c781ce188ded2551f98fe75152e30c Mon Sep 17 00:00:00 2001
+From: Oleg Grenrus <oleg.grenrus@iki.fi>
+Date: Tue, 14 Apr 2020 11:31:34 +0300
+Subject: [PATCH] GHC-8.10 support for 3.2
+
+Includes cherry-picked commits:
+
+- Test cabal-install with GHC-8.10 #6709
+- Add GHC-8.10.1 job. Only tests Cabal-the-lib part atm. #6617
+
+Also add topHandler' signature.
+---
+ .docker/validate-8.10.1.dockerfile            |  60 ++++++
+ .github/workflows/artifacts.yml               |   6 +-
+ .github/workflows/bootstrap.yml               |   4 +-
+ .github/workflows/linux.yml                   | 179 ++++++++++++------
+ .github/workflows/macos.yml                   |  40 ++--
+ .github/workflows/quick-jobs.yml              |   4 +-
+ .github/workflows/windows.yml                 | 117 +++++++++++-
+ .../Distribution/PackageDescription/Quirks.hs |  19 +-
+ Makefile                                      |   4 +
+ boot/ci-artifacts.template.yml                |   6 +-
+ boot/ci-bootstrap.template.yml                |   4 +-
+ boot/ci-linux.template.yml                    |   8 +-
+ boot/ci-macos.template.yml                    |   7 +-
+ boot/ci-quick-jobs.template.yml               |   4 +-
+ boot/ci-windows.template.yml                  |   8 +-
+ cabal-dev-scripts/src/GenValidate.hs          |  33 ++--
+ Distribution/Client/CmdSdist.hs |   3 +
+ .../Distribution/Client/FetchUtils.hs         |   4 +-
+ .../Distribution/Client/IndexUtils.hs         |   2 +-
+ Distribution/Client/Sandbox.hs  |   5 +-
+ .../Distribution/Client/TargetSelector.hs     |   2 +-
+ Distribution/Client/Update.hs   |   4 +-
+ .../Distribution/Client/Utils/Json.hs         |  13 +-
+ .../Distribution/Solver/Modular/Assignment.hs |  11 +-
+ .../Distribution/Solver/Modular/Builder.hs    |  10 +-
+ .../Distribution/Solver/Modular/Index.hs      |   6 +-
+ .../Solver/Modular/IndexConversion.hs         |   8 +-
+ .../Distribution/Solver/Modular/Solver.hs     |  12 +-
+ .../Distribution/Solver/Modular/Validate.hs   |   5 +-
+ bootstrap.sh                    |   6 +-
+ cabal-install.cabal             |   4 +-
+ cabal-install.cabal.pp          |   4 +-
+ .../targets/complex/q/q.cabal                 |   3 +-
+ cabal-testsuite/cabal-testsuite.cabal         |   4 +-
+ validate.sh                                   |  21 +-
+ 35 files changed, 461 insertions(+), 169 deletions(-)
+ create mode 100644 .docker/validate-8.10.1.dockerfile
+diff --git a/Distribution/Client/CmdSdist.hs b/Distribution/Client/CmdSdist.hs
+index 9ce0c80100e..a22317004c4 100644
+--- a/Distribution/Client/CmdSdist.hs
++++ b/Distribution/Client/CmdSdist.hs
+@@ -237,7 +237,10 @@ packageToSdist verbosity projectRootDir format outputFile pkg = do
+         (norm NoExec -> nonexec, norm Exec -> exec) <-
+            listPackageSources verbosity (flattenPackageDescription $ packageDescription pkg) knownSuffixHandlers
+ 
++        print $ map snd exec
++        print $ map snd nonexec
+         let files =  nub . sortOn snd $ nonexec ++ exec
++        print files
+ 
+         case format of
+             SourceList nulSep -> do
+diff --git a/Distribution/Client/FetchUtils.hs b/Distribution/Client/FetchUtils.hs
+index e9a31a91f84..4e5e581f9ec 100644
+--- a/Distribution/Client/FetchUtils.hs
++++ b/Distribution/Client/FetchUtils.hs
+@@ -176,8 +176,8 @@ fetchRepoTarball verbosity' repoCtxt repo pkgid = do
+     verbosity = verboseUnmarkOutput verbosity'
+ 
+     downloadRepoPackage = case repo of
+-      RepoLocal{..} -> return (packageFile repo pkgid)
+-      RepoLocalNoIndex{..} -> return (packageFile repo pkgid)
++      RepoLocal{} -> return (packageFile repo pkgid)
++      RepoLocalNoIndex{} -> return (packageFile repo pkgid)
+ 
+       RepoRemote{..} -> do
+         transport <- repoContextGetTransport repoCtxt
+diff --git a/Distribution/Client/IndexUtils.hs b/Distribution/Client/IndexUtils.hs
+index a76becc05ba..bf0ff7cf5ba 100644
+--- a/Distribution/Client/IndexUtils.hs
++++ b/Distribution/Client/IndexUtils.hs
+@@ -634,7 +634,7 @@ withIndexEntries
+     -> ([IndexCacheEntry] -> IO a)
+     -> ([NoIndexCacheEntry] -> IO a)
+     -> IO a
+-withIndexEntries _ (RepoIndex repoCtxt repo@RepoSecure{..}) callback _ =
++withIndexEntries _ (RepoIndex repoCtxt repo@RepoSecure{}) callback _ =
+     repoContextWithSecureRepo repoCtxt repo $ \repoSecure ->
+       Sec.withIndex repoSecure $ \Sec.IndexCallbacks{..} -> do
+         -- Incrementally (lazily) read all the entries in the tar file in order,
+diff --git a/Distribution/Client/Sandbox.hs b/Distribution/Client/Sandbox.hs
+index 66b415d7239..14bad3f2135 100644
+--- a/Distribution/Client/Sandbox.hs
++++ b/Distribution/Client/Sandbox.hs
+@@ -666,7 +666,7 @@ reinstallAddSourceDeps :: Verbosity
+                           -> FilePath
+                           -> IO WereDepsReinstalled
+ reinstallAddSourceDeps verbosity configFlags' configExFlags
+-                       installFlags globalFlags sandboxDir = topHandler' $ do
++                       installFlags globalFlags sandboxDir = topHandlerWith errorMsg $ do
+   let sandboxDistPref     = sandboxBuildDir sandboxDir
+       configFlags         = configFlags'
+                             { configDistPref  = Flag sandboxDistPref }
+@@ -710,7 +710,8 @@ reinstallAddSourceDeps verbosity configFlags' configExFlags
+         ++ "offending packages or recreating the sandbox."
+       logMsg message rest = debugNoWrap verbosity message >> rest
+ 
+-      topHandler' = topHandlerWith $ \_ -> do
++      errorMsg :: a -> IO WereDepsReinstalled
++      errorMsg _ = do
+         warn verbosity "Couldn't reinstall some add-source dependencies."
+         -- Here we can't know whether any deps have been reinstalled, so we have
+         -- to be conservative.
+diff --git a/Distribution/Client/TargetSelector.hs b/Distribution/Client/TargetSelector.hs
+index 23d92f580fd..f8f683d9875 100644
+--- a/Distribution/Client/TargetSelector.hs
++++ b/Distribution/Client/TargetSelector.hs
+@@ -222,7 +222,7 @@ readTargetSelectorsWith :: (Applicative m, Monad m) => DirActions m
+                         -> Maybe ComponentKindFilter
+                         -> [String]
+                         -> m (Either [TargetSelectorProblem] [TargetSelector])
+-readTargetSelectorsWith dirActions@DirActions{..} pkgs mfilter targetStrs =
++readTargetSelectorsWith dirActions@DirActions{} pkgs mfilter targetStrs =
+     case parseTargetStrings targetStrs of
+       ([], usertargets) -> do
+         usertargets' <- mapM (getTargetStringFileStatus dirActions) usertargets
+diff --git a/Distribution/Client/Update.hs b/Distribution/Client/Update.hs
+index 52bb1f76c96..8ded78b9d2e 100644
+--- a/Distribution/Client/Update.hs
++++ b/Distribution/Client/Update.hs
+@@ -73,8 +73,8 @@ updateRepo :: Verbosity -> UpdateFlags -> RepoContext -> Repo -> IO ()
+ updateRepo verbosity updateFlags repoCtxt repo = do
+   transport <- repoContextGetTransport repoCtxt
+   case repo of
+-    RepoLocal{..} -> return ()
+-    RepoLocalNoIndex{..} -> return ()
++    RepoLocal{} -> return ()
++    RepoLocalNoIndex{} -> return ()
+     RepoRemote{..} -> do
+       downloadResult <- downloadIndex transport verbosity repoRemote repoLocalDir
+       case downloadResult of
+diff --git a/Distribution/Client/Utils/Json.hs b/Distribution/Client/Utils/Json.hs
+index 89a13af87a4..01d5753136b 100644
+--- a/Distribution/Client/Utils/Json.hs
++++ b/Distribution/Client/Utils/Json.hs
+@@ -15,12 +15,9 @@ module Distribution.Client.Utils.Json
+     )
+     where
+ 
+-import Data.Char
+-import Data.Int
+-import Data.String
+-import Data.Word
+-import Data.List
+-import Data.Monoid
++import Distribution.Client.Compat.Prelude
++
++import Data.Char (intToDigit)
+ 
+ import Data.ByteString.Builder (Builder)
+ import qualified Data.ByteString.Builder as BB
+@@ -135,13 +132,13 @@ encodeArrayBB :: [Value] -> Builder
+ encodeArrayBB [] = "[]"
+ encodeArrayBB jvs = BB.char8 '[' <> go jvs <> BB.char8 ']'
+   where
+-    go = Data.Monoid.mconcat . intersperse (BB.char8 ',') . map encodeValueBB
++    go = mconcat . intersperse (BB.char8 ',') . map encodeValueBB
+ 
+ encodeObjectBB :: Object -> Builder
+ encodeObjectBB [] = "{}"
+ encodeObjectBB jvs = BB.char8 '{' <> go jvs <> BB.char8 '}'
+   where
+-    go = Data.Monoid.mconcat . intersperse (BB.char8 ',') . map encPair
++    go = mconcat . intersperse (BB.char8 ',') . map encPair
+     encPair (l,x) = encodeStringBB l <> BB.char8 ':' <> encodeValueBB x
+ 
+ encodeStringBB :: String -> Builder
+diff --git a/Distribution/Solver/Modular/Assignment.hs b/Distribution/Solver/Modular/Assignment.hs
+index be5e63bfbc1..b05a099ec5a 100644
+--- a/Distribution/Solver/Modular/Assignment.hs
++++ b/Distribution/Solver/Modular/Assignment.hs
+@@ -9,10 +9,11 @@ module Distribution.Solver.Modular.Assignment
+ import Prelude ()
+ import Distribution.Solver.Compat.Prelude hiding (pi)
+ 
+-import Data.Array as A
+-import Data.List as L
+-import Data.Map as M
+-import Data.Maybe
++import qualified Data.Array as A
++import qualified Data.List as L
++import qualified Data.Map as M
++
++import Data.Maybe (fromJust)
+ 
+ import Distribution.PackageDescription (FlagAssignment, mkFlagAssignment) -- from Cabal
+ 
+@@ -79,7 +80,7 @@ toCPs (A pa fa sa) rdm =
+     -- Dependencies per package.
+     depp :: QPN -> [(Component, PI QPN)]
+     depp qpn = let v :: Vertex
+-                   v   = fromJust (cvm qpn)
++                   v   = fromJust (cvm qpn) -- TODO: why this is safe?
+                    dvs :: [(Component, Vertex)]
+                    dvs = tg A.! v
+                in L.map (\ (comp, dv) -> case vm dv of (_, x, _) -> (comp, PI x (pa M.! x))) dvs
+diff --git a/Distribution/Solver/Modular/Builder.hs b/Distribution/Solver/Modular/Builder.hs
+index eb11a36aa16..5d196f4fd9f 100644
+--- a/Distribution/Solver/Modular/Builder.hs
++++ b/Distribution/Solver/Modular/Builder.hs
+@@ -19,10 +19,10 @@ module Distribution.Solver.Modular.Builder (
+ -- flag-guarded dependencies, we cannot introduce them immediately. Instead, we
+ -- store the entire dependency.
+ 
+-import Data.List as L
+-import Data.Map as M
+-import Data.Set as S
+-import Prelude hiding (sequence, mapM)
++import qualified Data.List as L
++import qualified Data.Map as M
++import qualified Data.Set as S
++import Prelude
+ 
+ import qualified Distribution.Solver.Modular.ConflictSet as CS
+ import Distribution.Solver.Modular.Dependency
+@@ -55,7 +55,7 @@ data BuildState = BS {
+ }
+ 
+ -- | Map of available linking targets.
+-type LinkingState = Map (PN, I) [PackagePath]
++type LinkingState = M.Map (PN, I) [PackagePath]
+ 
+ -- | Extend the set of open goals with the new goals listed.
+ --
+diff --git a/Distribution/Solver/Modular/Index.hs b/Distribution/Solver/Modular/Index.hs
+index fdddfc8237a..ac60fec7d65 100644
+--- a/Distribution/Solver/Modular/Index.hs
++++ b/Distribution/Solver/Modular/Index.hs
+@@ -6,10 +6,12 @@ module Distribution.Solver.Modular.Index
+     , mkIndex
+     ) where
+ 
+-import Data.List as L
+-import Data.Map as M
+ import Prelude hiding (pi)
+ 
++import Data.Map (Map)
++import qualified Data.List as L
++import qualified Data.Map as M
++
+ import Distribution.Solver.Modular.Dependency
+ import Distribution.Solver.Modular.Flag
+ import Distribution.Solver.Modular.Package
+diff --git a/Distribution/Solver/Modular/IndexConversion.hs b/Distribution/Solver/Modular/IndexConversion.hs
+index c9565c80dba..8e9ef614184 100644
+--- a/Distribution/Solver/Modular/IndexConversion.hs
++++ b/Distribution/Solver/Modular/IndexConversion.hs
+@@ -2,12 +2,12 @@ module Distribution.Solver.Modular.IndexConversion
+     ( convPIs
+     ) where
+ 
+-import Data.List as L
++import qualified Data.List as L
+ import Data.Map.Strict (Map)
+ import qualified Data.Map.Strict as M
+-import Data.Maybe
++import Data.Maybe (mapMaybe, fromMaybe, maybeToList)
+ import Data.Monoid as Mon
+-import Data.Set as S
++import qualified Data.Set as S
+ 
+ import Distribution.Compiler
+ import Distribution.InstalledPackageInfo as IPI
+@@ -330,7 +330,7 @@ flagInfo (StrongFlags strfl) =
+ 
+ -- | Internal package names, which should not be interpreted as true
+ -- dependencies.
+-type IPNs = Set PN
++type IPNs = S.Set PN
+ 
+ -- | Convenience function to delete a 'Dependency' if it's
+ -- for a 'PN' that isn't actually real.
+diff --git a/Distribution/Solver/Modular/Solver.hs b/Distribution/Solver/Modular/Solver.hs
+index 32452550556..e6aa1fb4374 100644
+--- a/Distribution/Solver/Modular/Solver.hs
++++ b/Distribution/Solver/Modular/Solver.hs
+@@ -9,9 +9,9 @@ module Distribution.Solver.Modular.Solver
+     , PruneAfterFirstSuccess(..)
+     ) where
+ 
+-import Data.Map as M
+-import Data.List as L
+-import Data.Set as S
++import qualified Data.Map as M
++import qualified Data.List as L
++import qualified Data.Set as S
+ import Distribution.Verbosity
+ 
+ import Distribution.Compiler (CompilerInfo)
+@@ -91,8 +91,8 @@ solve :: SolverConfig                         -- ^ solver parameters
+       -> Index                                -- ^ all available packages as an index
+       -> PkgConfigDb                          -- ^ available pkg-config pkgs
+       -> (PN -> PackagePreferences)           -- ^ preferences
+-      -> Map PN [LabeledPackageConstraint]    -- ^ global constraints
+-      -> Set PN                               -- ^ global goals
++      -> M.Map PN [LabeledPackageConstraint]  -- ^ global constraints
++      -> S.Set PN                             -- ^ global goals
+       -> RetryLog Message SolverFailure (Assignment, RevDepMap)
+ solve sc cinfo idx pkgConfigDB userPrefs userConstraints userGoals =
+   explorePhase     $
+@@ -232,7 +232,7 @@ instance GSimpleTree (Tree d c) where
+ 
+       -- Show conflict set
+       goCS :: ConflictSet -> String
+-      goCS cs = "{" ++ (intercalate "," . L.map showVar . CS.toList $ cs) ++ "}"
++      goCS cs = "{" ++ (L.intercalate "," . L.map showVar . CS.toList $ cs) ++ "}"
+ #endif
+ 
+ -- | Replace all goal reasons with a dummy goal reason in the tree
+diff --git a/Distribution/Solver/Modular/Validate.hs b/Distribution/Solver/Modular/Validate.hs
+index 6195d101b02..a3dec6e1f67 100644
+--- a/Distribution/Solver/Modular/Validate.hs
++++ b/Distribution/Solver/Modular/Validate.hs
+@@ -15,11 +15,12 @@ module Distribution.Solver.Modular.Validate (validateTree) where
+ import Control.Applicative
+ import Control.Monad.Reader hiding (sequence)
+ import Data.Function (on)
+-import Data.List as L
+-import Data.Set as S
+ import Data.Traversable
+ import Prelude hiding (sequence)
+ 
++import qualified Data.List as L
++import qualified Data.Set as S
++
+ import Language.Haskell.Extension (Extension, Language)
+ 
+ import Data.Map.Strict as M
+diff --git a/bootstrap.sh b/bootstrap.sh
+index 077d7f4efd2..d5141660474 100755
+--- a/bootstrap.sh
++++ b/bootstrap.sh
+@@ -260,9 +260,9 @@ EDIT_DISTANCE_VER="0.2.2.1"; EDIT_DISTANCE_VER_REGEXP="0\.2\.2\.?"
+                        # 0.2.2.*
+ ED25519_VER="0.0.5.0"; ED25519_VER_REGEXP="0\.0\.?"
+                        # 0.0.*
+-HACKAGE_SECURITY_VER="0.6.0.0"; HACKAGE_SECURITY_VER_REGEXP="0\.6\."
+-                       # >= 0.7.0.0 && < 0.7
+-TAR_VER="0.5.1.0";     TAR_VER_REGEXP="0\.5\.([1-9]|1[0-9]|0\.[3-9]|0\.1[0-9])\.?"
++HACKAGE_SECURITY_VER="0.6.0.1"; HACKAGE_SECURITY_VER_REGEXP="0\.6\."
++                       # >= 0.6.0.0 && < 0.7
++TAR_VER="0.5.1.1";     TAR_VER_REGEXP="0\.5\.([1-9]|1[0-9]|0\.[3-9]|0\.1[0-9])\.?"
+                        # >= 0.5.0.3  && < 0.6
+ DIGEST_VER="0.0.1.2"; DIGEST_REGEXP="0\.0\.(1\.[2-9]|[2-9]\.?)"
+                        # >= 0.0.1.2 && < 0.1
+diff --git a/cabal-install.cabal b/cabal-install.cabal
+index 985ea9a5a69..c9d713c29fe 100644
+--- a/cabal-install.cabal
++++ b/cabal-install.cabal
+@@ -316,7 +316,7 @@ executable cabal
+     build-depends:
+         async      >= 2.0      && < 2.3,
+         array      >= 0.4      && < 0.6,
+-        base       >= 4.8      && < 4.14,
++        base       >= 4.8      && < 4.15,
+         base16-bytestring >= 0.1.1 && < 0.2,
+         binary     >= 0.7.3    && < 0.9,
+         bytestring >= 0.10.6.0 && < 0.11,
+@@ -341,7 +341,7 @@ executable cabal
+         time       >= 1.5.0.1  && < 1.10,
+         transformers >= 0.4.2.0 && < 0.6,
+         zlib       >= 0.5.3    && < 0.7,
+-        hackage-security >= 0.6.0.0 && < 0.7,
++        hackage-security >= 0.6.0.1 && < 0.7,
+         text       >= 1.2.3    && < 1.3,
+         parsec     >= 3.1.13.0 && < 3.2
+ 
+diff --git a/tests/IntegrationTests2/targets/complex/q/q.cabal b/tests/IntegrationTests2/targets/complex/q/q.cabal
+index 556fa4a4202..7ee22fcb28d 100644
+--- a/tests/IntegrationTests2/targets/complex/q/q.cabal
++++ b/tests/IntegrationTests2/targets/complex/q/q.cabal
+@@ -5,7 +5,8 @@ cabal-version: >= 1.2
+ 
+ library
+   exposed-modules: Q
+-  build-depends: base, filepath
++  -- we rely that filepath has filepath-tests component
++  build-depends: base, filepath >=1.4.0.0
+ 
+ executable buildable-false
+   main-is: Main.hs
diff --git a/gnu/packages/patches/calibre-fix-zeroconf.patch b/gnu/packages/patches/calibre-fix-zeroconf.patch
new file mode 100644
index 0000000000..d7d0f18667
--- /dev/null
+++ b/gnu/packages/patches/calibre-fix-zeroconf.patch
@@ -0,0 +1,38 @@
+Fix a build failure when upgrading zeroconf from 0.28.8 to 0.38.1:
+
+https://issues.guix.gnu.org/53247
+
+Patch copied from Gentoo:
+
+https://bugs.gentoo.org/800233#c5
+
+diff --color -Naru a/src/calibre/devices/smart_device_app/driver.py b/src/calibre/devices/smart_device_app/driver.py
+--- a/src/calibre/devices/smart_device_app/driver.py	2021-08-08 08:32:03.104016444 +0200
++++ b/src/calibre/devices/smart_device_app/driver.py	2021-08-08 08:33:30.699018403 +0200
+@@ -2040,13 +2040,6 @@
+ # Function to monkeypatch zeroconf to remove the 15 character name length restriction.
+ # Copied from https://github.com/jstasiak/python-zeroconf version 0.28.1
+ 
+-
+-from zeroconf import (BadTypeInNameException, _HAS_A_TO_Z,
+-                      _HAS_ONLY_A_TO_Z_NUM_HYPHEN_UNDERSCORE,
+-                      _HAS_ASCII_CONTROL_CHARS,
+-                      _HAS_ONLY_A_TO_Z_NUM_HYPHEN)
+-
+-
+ def service_type_name(type_: str, *, allow_underscores: bool = False) -> str:
+     """
+     Validate a fully qualified service name, instance or subtype. [rfc6763]
+@@ -2087,6 +2080,12 @@
+     :param type_: Type, SubType or service name to validate
+     :return: fully qualified service name (eg: _http._tcp.local.)
+     """
++
++    from zeroconf import (BadTypeInNameException, _HAS_A_TO_Z,
++                      _HAS_ONLY_A_TO_Z_NUM_HYPHEN_UNDERSCORE,
++                      _HAS_ASCII_CONTROL_CHARS,
++                      _HAS_ONLY_A_TO_Z_NUM_HYPHEN)
++
+     if not (type_.endswith('._tcp.local.') or type_.endswith('._udp.local.')):
+         raise BadTypeInNameException("Type '%s' must end with '._tcp.local.' or '._udp.local.'" % type_)
+ 
diff --git a/gnu/packages/patches/ccache-fix-basedir-test.patch b/gnu/packages/patches/ccache-fix-basedir-test.patch
deleted file mode 100644
index c5f6de7780..0000000000
--- a/gnu/packages/patches/ccache-fix-basedir-test.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From ad18f15287b83cee5a45b63e02b31c6a601a134f Mon Sep 17 00:00:00 2001
-From: Tobias Geerinckx-Rice <me@tobias.gr>
-Date: Mon, 27 Sep 2021 19:36:30 +0200
-Subject: [PATCH] gnu: ccache: Fix basedir test.
-
-Applied upstream.
----
- test/suites/basedir.bash | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/test/suites/basedir.bash b/test/suites/basedir.bash
-index 479c632..34e5cb7 100644
---- a/test/suites/basedir.bash
-+++ b/test/suites/basedir.bash
-@@ -269,7 +269,7 @@ EOF
- EOF
-     backdate test.h
- 
--    pwd="$(/bin/pwd -P)"
-+    pwd="$(pwd -P)"
-     $REAL_COMPILER -c $pwd/test.c 2>reference.stderr
- 
-     CCACHE_ABSSTDERR=1 CCACHE_BASEDIR="$pwd" $CCACHE_COMPILE -c $pwd/test.c 2>ccache.stderr
--- 
-2.33.0
-
diff --git a/gnu/packages/patches/cdrkit-libre-cross-compile.patch b/gnu/packages/patches/cdrkit-libre-cross-compile.patch
new file mode 100644
index 0000000000..09c34b8c0a
--- /dev/null
+++ b/gnu/packages/patches/cdrkit-libre-cross-compile.patch
@@ -0,0 +1,32 @@
+Patch extracted from a set of patches to cross-compile ffmeg and dependencies for mingw-w64.
+https://github.com/Warblefly/MultimediaTools-mingw-w64/commit/01e30a17637b67afd65c1e24302f8daf94b19b32#diff-503bd595ad2a49840cc56acdb3432487a20a0acb7981ce83be51fe311216de8f
+
+diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
+index 99a69fd..e5ba8a7 100644
+--- a/include/CMakeLists.txt
++++ b/include/CMakeLists.txt
+@@ -35,8 +35,6 @@ endif(VA_LIST_IS_ARRAY)
+ INCLUDE(TestBigEndian)
+ TEST_BIG_ENDIAN(WORDS_BIGENDIAN)
+ 
+-TRY_RUN(BITFIELDS_HTOL TEST_DUMMY ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/test_BITFIELDS_HTOL.c)
+-
+ INCLUDE(CheckIncludeFiles)
+ 
+ #SET(CMAKE_REQUIRED_INCLUDES "/usr/include;/usr/local/include")
+diff --git a/include/xconfig.h.in b/include/xconfig.h.in
+index c130600..476c00b 100644
+--- a/include/xconfig.h.in
++++ b/include/xconfig.h.in
+@@ -233,7 +233,11 @@
+ /* If using network byte order             */
+ #cmakedefine WORDS_BIGENDIAN
+ /* If high bits come first in structures   */
+-#cmakedefine BITFIELDS_HTOL
++#ifdef WORDS_BIGENDIAN
++#define BITFIELDS_HTOL
++#else
++#define BITFIELDS_LTOH
++#endif
+ #define	HAVE_C_BIGENDIAN	/* Flag that WORDS_BIGENDIAN test was done */
+ #define	HAVE_C_BITFIELDS	/* Flag that BITFIELDS_HTOL test was done  */
diff --git a/gnu/packages/patches/ceph-boost-compat.patch b/gnu/packages/patches/ceph-boost-compat.patch
new file mode 100644
index 0000000000..1aecfbbed5
--- /dev/null
+++ b/gnu/packages/patches/ceph-boost-compat.patch
@@ -0,0 +1,18 @@
+Add extra includes required for Boost 1.75 and later.
+
+Taken from upstram:
+
+  https://github.com/ceph/ceph/commit/ebf3a0398f18eab67d2ba25e6a10b41ff140f6a4
+
+diff --git a/src/rgw/rgw_string.h b/src/rgw/rgw_string.h
+index 257daa9c1fe6e..90e64f98a2587 100644
+--- a/src/rgw/rgw_string.h
++++ b/src/rgw/rgw_string.h
+@@ -8,5 +8,7 @@
+ #include <stdlib.h>
+ #include <limits.h>
+ #include <string_view>
++#include <string>
++#include <stdexcept>
+ 
+ #include <boost/container/small_vector.hpp>
diff --git a/gnu/packages/patches/ceph-rocksdb-compat.patch b/gnu/packages/patches/ceph-rocksdb-compat.patch
new file mode 100644
index 0000000000..9fb9b0caeb
--- /dev/null
+++ b/gnu/packages/patches/ceph-rocksdb-compat.patch
@@ -0,0 +1,303 @@
+Adjust for newer versions of RocksDB.
+
+Taken from upstream:
+
+  https://github.com/ceph/ceph/pull/42815
+  https://github.com/ceph/ceph/commit/ff7f192ea3cf88ca1098bcf9396ff4f8ed1e8792.diff
+
+diff --git a/src/kv/rocksdb_cache/BinnedLRUCache.cc b/src/kv/rocksdb_cache/BinnedLRUCache.cc
+index 0d657883e92de..47c56e2ddd769 100644
+--- a/src/kv/rocksdb_cache/BinnedLRUCache.cc
++++ b/src/kv/rocksdb_cache/BinnedLRUCache.cc
+@@ -151,13 +151,20 @@ void BinnedLRUCacheShard::EraseUnRefEntries() {
+   }
+ }
+ 
+-void BinnedLRUCacheShard::ApplyToAllCacheEntries(void (*callback)(void*, size_t),
+-                                           bool thread_safe) {
++void BinnedLRUCacheShard::ApplyToAllCacheEntries(
++  const std::function<void(const rocksdb::Slice& key,
++                           void* value,
++                           size_t charge,
++                           DeleterFn)>& callback,
++  bool thread_safe)
++{
+   if (thread_safe) {
+     mutex_.lock();
+   }
+   table_.ApplyToAllCacheEntries(
+-      [callback](BinnedLRUHandle* h) { callback(h->value, h->charge); });
++    [callback](BinnedLRUHandle* h) {
++      callback(h->key(), h->value, h->charge, h->deleter);
++    });
+   if (thread_safe) {
+     mutex_.unlock();
+   }
+@@ -345,7 +352,7 @@ bool BinnedLRUCacheShard::Release(rocksdb::Cache::Handle* handle, bool force_era
+ 
+ rocksdb::Status BinnedLRUCacheShard::Insert(const rocksdb::Slice& key, uint32_t hash, void* value,
+                              size_t charge,
+-                             void (*deleter)(const rocksdb::Slice& key, void* value),
++                             DeleterFn deleter,
+                              rocksdb::Cache::Handle** handle, rocksdb::Cache::Priority priority) {
+   auto e = new BinnedLRUHandle();
+   rocksdb::Status s;
+@@ -464,6 +471,12 @@ std::string BinnedLRUCacheShard::GetPrintableOptions() const {
+   return std::string(buffer);
+ }
+ 
++DeleterFn BinnedLRUCacheShard::GetDeleter(rocksdb::Cache::Handle* h) const
++{
++  auto* handle = reinterpret_cast<BinnedLRUHandle*>(h);
++  return handle->deleter;
++}
++
+ BinnedLRUCache::BinnedLRUCache(CephContext *c, 
+                                size_t capacity, 
+                                int num_shard_bits,
+@@ -519,6 +532,13 @@ void BinnedLRUCache::DisownData() {
+ #endif  // !__SANITIZE_ADDRESS__
+ }
+ 
++#if (ROCKSDB_MAJOR >= 6 && ROCKSDB_MINOR >= 22)
++DeleterFn BinnedLRUCache::GetDeleter(Handle* handle) const
++{
++  return reinterpret_cast<const BinnedLRUHandle*>(handle)->deleter;
++}
++#endif
++
+ size_t BinnedLRUCache::TEST_GetLRUSize() {
+   size_t lru_size_of_all_shards = 0;
+   for (int i = 0; i < num_shards_; i++) {
+diff --git a/src/kv/rocksdb_cache/BinnedLRUCache.h b/src/kv/rocksdb_cache/BinnedLRUCache.h
+index 85608be0e5734..88bf4502e8927 100644
+--- a/src/kv/rocksdb_cache/BinnedLRUCache.h
++++ b/src/kv/rocksdb_cache/BinnedLRUCache.h
+@@ -56,7 +56,7 @@ std::shared_ptr<rocksdb::Cache> NewBinnedLRUCache(
+ 
+ struct BinnedLRUHandle {
+   void* value;
+-  void (*deleter)(const rocksdb::Slice&, void* value);
++  DeleterFn deleter;
+   BinnedLRUHandle* next_hash;
+   BinnedLRUHandle* next;
+   BinnedLRUHandle* prev;
+@@ -189,7 +189,7 @@ class alignas(CACHE_LINE_SIZE) BinnedLRUCacheShard : public CacheShard {
+   // Like Cache methods, but with an extra "hash" parameter.
+   virtual rocksdb::Status Insert(const rocksdb::Slice& key, uint32_t hash, void* value,
+                         size_t charge,
+-                        void (*deleter)(const rocksdb::Slice& key, void* value),
++                        DeleterFn deleter,
+                         rocksdb::Cache::Handle** handle,
+                         rocksdb::Cache::Priority priority) override;
+   virtual rocksdb::Cache::Handle* Lookup(const rocksdb::Slice& key, uint32_t hash) override;
+@@ -205,13 +205,19 @@ class alignas(CACHE_LINE_SIZE) BinnedLRUCacheShard : public CacheShard {
+   virtual size_t GetUsage() const override;
+   virtual size_t GetPinnedUsage() const override;
+ 
+-  virtual void ApplyToAllCacheEntries(void (*callback)(void*, size_t),
+-                                      bool thread_safe) override;
++  virtual void ApplyToAllCacheEntries(
++    const std::function<void(const rocksdb::Slice& key,
++                             void* value,
++                             size_t charge,
++                             DeleterFn)>& callback,
++    bool thread_safe) override;
+ 
+   virtual void EraseUnRefEntries() override;
+ 
+   virtual std::string GetPrintableOptions() const override;
+ 
++  virtual DeleterFn GetDeleter(rocksdb::Cache::Handle* handle) const override;
++
+   void TEST_GetLRUList(BinnedLRUHandle** lru, BinnedLRUHandle** lru_low_pri);
+ 
+   //  Retrieves number of elements in LRU, for unit test purpose only
+@@ -304,7 +310,9 @@ class BinnedLRUCache : public ShardedCache {
+   virtual size_t GetCharge(Handle* handle) const override;
+   virtual uint32_t GetHash(Handle* handle) const override;
+   virtual void DisownData() override;
+-
++#if (ROCKSDB_MAJOR >= 6 && ROCKSDB_MINOR >= 22)
++  virtual DeleterFn GetDeleter(Handle* handle) const override;
++#endif
+   //  Retrieves number of elements in LRU, for unit test purpose only
+   size_t TEST_GetLRUSize();
+   // Sets the high pri pool ratio
+diff --git a/src/kv/rocksdb_cache/ShardedCache.cc b/src/kv/rocksdb_cache/ShardedCache.cc
+index 367140a94d8be..6cbd89ad6472c 100644
+--- a/src/kv/rocksdb_cache/ShardedCache.cc
++++ b/src/kv/rocksdb_cache/ShardedCache.cc
+@@ -44,7 +44,7 @@ void ShardedCache::SetStrictCapacityLimit(bool strict_capacity_limit) {
+ }
+ 
+ rocksdb::Status ShardedCache::Insert(const rocksdb::Slice& key, void* value, size_t charge,
+-                            void (*deleter)(const rocksdb::Slice& key, void* value),
++                            DeleterFn deleter,
+                             rocksdb::Cache::Handle** handle, Priority priority) {
+   uint32_t hash = HashSlice(key);
+   return GetShard(Shard(hash))
+@@ -109,13 +109,36 @@ size_t ShardedCache::GetPinnedUsage() const {
+   return usage;
+ }
+ 
++#if (ROCKSDB_MAJOR >= 6 && ROCKSDB_MINOR >= 22)
++DeleterFn ShardedCache::GetDeleter(Handle* handle) const
++{
++  uint32_t hash = GetHash(handle);
++  return GetShard(Shard(hash))->GetDeleter(handle);
++}
++
++void ShardedCache::ApplyToAllEntries(
++    const std::function<void(const rocksdb::Slice& key, void* value, size_t charge,
++                             DeleterFn deleter)>& callback,
++    const ApplyToAllEntriesOptions& opts)
++{
++  int num_shards = 1 << num_shard_bits_;
++  for (int s = 0; s < num_shards; s++) {
++    GetShard(s)->ApplyToAllCacheEntries(callback, true /* thread_safe */);
++  }
++}
++#else
+ void ShardedCache::ApplyToAllCacheEntries(void (*callback)(void*, size_t),
+                                           bool thread_safe) {
+   int num_shards = 1 << num_shard_bits_;
+   for (int s = 0; s < num_shards; s++) {
+-    GetShard(s)->ApplyToAllCacheEntries(callback, thread_safe);
++    GetShard(s)->ApplyToAllCacheEntries(
++      [callback](const rocksdb::Slice&, void* value, size_t charge, DeleterFn) {
++        callback(value, charge);
++      },
++      thread_safe);
+   }
+ }
++#endif
+ 
+ void ShardedCache::EraseUnRefEntries() {
+   int num_shards = 1 << num_shard_bits_;
+@@ -131,7 +154,7 @@ std::string ShardedCache::GetPrintableOptions() const {
+   char buffer[kBufferSize];
+   {
+     std::lock_guard<std::mutex> l(capacity_mutex_);
+-    snprintf(buffer, kBufferSize, "    capacity : %" ROCKSDB_PRIszt "\n",
++    snprintf(buffer, kBufferSize, "    capacity : %zu\n",
+              capacity_);
+     ret.append(buffer);
+     snprintf(buffer, kBufferSize, "    num_shard_bits : %d\n", num_shard_bits_);
+diff --git a/src/kv/rocksdb_cache/ShardedCache.h b/src/kv/rocksdb_cache/ShardedCache.h
+index 4d64893ab1c7b..f98421a09a33a 100644
+--- a/src/kv/rocksdb_cache/ShardedCache.h
++++ b/src/kv/rocksdb_cache/ShardedCache.h
+@@ -14,6 +14,7 @@
+ #include <string>
+ #include <mutex>
+ 
++#include "rocksdb/version.h"
+ #include "rocksdb/cache.h"
+ #include "include/ceph_hash.h"
+ #include "common/PriorityCache.h"
+@@ -22,10 +23,11 @@
+ #ifndef CACHE_LINE_SIZE
+ #define CACHE_LINE_SIZE 64 // XXX arch-specific define 
+ #endif
+-#define ROCKSDB_PRIszt "zu"
+ 
+ namespace rocksdb_cache {
+ 
++using DeleterFn = void (*)(const rocksdb::Slice& key, void* value);
++
+ // Single cache shard interface.
+ class CacheShard {
+  public:
+@@ -34,7 +36,7 @@ class CacheShard {
+ 
+   virtual rocksdb::Status Insert(const rocksdb::Slice& key, uint32_t hash, void* value,
+                                  size_t charge,
+-                                 void (*deleter)(const rocksdb::Slice& key, void* value),
++                                 DeleterFn deleter,
+                                  rocksdb::Cache::Handle** handle, rocksdb::Cache::Priority priority) = 0;
+   virtual rocksdb::Cache::Handle* Lookup(const rocksdb::Slice& key, uint32_t hash) = 0;
+   virtual bool Ref(rocksdb::Cache::Handle* handle) = 0;
+@@ -44,10 +46,15 @@ class CacheShard {
+   virtual void SetStrictCapacityLimit(bool strict_capacity_limit) = 0;
+   virtual size_t GetUsage() const = 0;
+   virtual size_t GetPinnedUsage() const = 0;
+-  virtual void ApplyToAllCacheEntries(void (*callback)(void*, size_t),
+-                                      bool thread_safe) = 0;
++  virtual void ApplyToAllCacheEntries(
++    const std::function<void(const rocksdb::Slice& key,
++                             void* value,
++                             size_t charge,
++                             DeleterFn)>& callback,
++    bool thread_safe) = 0;
+   virtual void EraseUnRefEntries() = 0;
+   virtual std::string GetPrintableOptions() const { return ""; }
++  virtual DeleterFn GetDeleter(rocksdb::Cache::Handle* handle) const = 0;
+ };
+ 
+ // Generic cache interface which shards cache by hash of keys. 2^num_shard_bits
+@@ -57,34 +64,43 @@ class ShardedCache : public rocksdb::Cache, public PriorityCache::PriCache {
+  public:
+   ShardedCache(size_t capacity, int num_shard_bits, bool strict_capacity_limit);
+   virtual ~ShardedCache() = default;
++  // rocksdb::Cache
+   virtual const char* Name() const override = 0;
+-  virtual CacheShard* GetShard(int shard) = 0;
+-  virtual const CacheShard* GetShard(int shard) const = 0;
+-  virtual void* Value(Handle* handle) override = 0;
+-  virtual size_t GetCharge(Handle* handle) const = 0;
+-  virtual uint32_t GetHash(Handle* handle) const = 0;
+-  virtual void DisownData() override = 0;
+-
+-  virtual void SetCapacity(size_t capacity) override;
+-  virtual void SetStrictCapacityLimit(bool strict_capacity_limit) override;
+-
+   virtual rocksdb::Status Insert(const rocksdb::Slice& key, void* value, size_t charge,
+-                                 void (*deleter)(const rocksdb::Slice& key, void* value),
++                                 DeleterFn,
+                                  rocksdb::Cache::Handle** handle, Priority priority) override;
+   virtual rocksdb::Cache::Handle* Lookup(const rocksdb::Slice& key, rocksdb::Statistics* stats) override;
+   virtual bool Ref(rocksdb::Cache::Handle* handle) override;
+   virtual bool Release(rocksdb::Cache::Handle* handle, bool force_erase = false) override;
++  virtual void* Value(Handle* handle) override = 0;
+   virtual void Erase(const rocksdb::Slice& key) override;
+   virtual uint64_t NewId() override;
+-  virtual size_t GetCapacity() const override;
++  virtual void SetCapacity(size_t capacity) override;
++  virtual void SetStrictCapacityLimit(bool strict_capacity_limit) override;
+   virtual bool HasStrictCapacityLimit() const override;
++  virtual size_t GetCapacity() const override;
+   virtual size_t GetUsage() const override;
+   virtual size_t GetUsage(rocksdb::Cache::Handle* handle) const override;
+   virtual size_t GetPinnedUsage() const override;
++  virtual size_t GetCharge(Handle* handle) const = 0;
++#if (ROCKSDB_MAJOR >= 6 && ROCKSDB_MINOR >= 22)
++  virtual DeleterFn GetDeleter(Handle* handle) const override;
++#endif
++  virtual void DisownData() override = 0;
++#if (ROCKSDB_MAJOR >= 6 && ROCKSDB_MINOR >= 22)
++  virtual void ApplyToAllEntries(
++      const std::function<void(const rocksdb::Slice& key, void* value, size_t charge,
++                               DeleterFn deleter)>& callback,
++      const ApplyToAllEntriesOptions& opts) override;
++#else
+   virtual void ApplyToAllCacheEntries(void (*callback)(void*, size_t),
+                                       bool thread_safe) override;
++#endif
+   virtual void EraseUnRefEntries() override;
+   virtual std::string GetPrintableOptions() const override;
++  virtual CacheShard* GetShard(int shard) = 0;
++  virtual const CacheShard* GetShard(int shard) const = 0;
++  virtual uint32_t GetHash(Handle* handle) const = 0;
+ 
+   int GetNumShardBits() const { return num_shard_bits_; }
+ 
+@@ -120,7 +136,7 @@ class ShardedCache : public rocksdb::Cache, public PriorityCache::PriCache {
+ //    return Hash(s.data(), s.size(), 0);
+   }
+ 
+-  uint32_t Shard(uint32_t hash) {
++  uint32_t Shard(uint32_t hash) const {
+     // Note, hash >> 32 yields hash in gcc, not the zero we expect!
+     return (num_shard_bits_ > 0) ? (hash >> (32 - num_shard_bits_)) : 0;
+   }
diff --git a/gnu/packages/patches/cheese-vala-update.patch b/gnu/packages/patches/cheese-vala-update.patch
new file mode 100644
index 0000000000..cb18952ce4
--- /dev/null
+++ b/gnu/packages/patches/cheese-vala-update.patch
@@ -0,0 +1,180 @@
+Taken from upstream:
+https://gitlab.gnome.org/GNOME/cheese/-/commit/7cf6268e54620bbbe5e6e61800c50fb0cb4bea57.patch.
+
+From 7cf6268e54620bbbe5e6e61800c50fb0cb4bea57 Mon Sep 17 00:00:00 2001 From:
+=?UTF-8?q?Corentin=20No=C3=ABl?= <corentin@elementary.io> Date: Fri, 16 Oct
+2020 19:56:26 +0200 Subject: [PATCH] Change GLib.PtrArray into
+GLib.GenericArray
+
+This is the vala-friendly way of handling GPtrArray.
+Fix several memory leaks on the go and unnecessary reference increase.
+---
+ src/cheese-preferences.vala | 26 ++++++++++++--------------
+ src/cheese-window.vala      | 22 +++++++++++-----------
+ src/vapi/cheese-common.vapi |  2 +-
+ 3 files changed, 24 insertions(+), 26 deletions(-)
+
+diff --git a/src/cheese-preferences.vala b/src/cheese-preferences.vala
+index f56af7e0..80a92431 100644
+--- a/src/cheese-preferences.vala
++++ b/src/cheese-preferences.vala
+@@ -100,7 +100,7 @@ public PreferencesDialog (Cheese.Camera camera)
+    */
+   private void initialize_camera_devices ()
+   {
+-    unowned GLib.PtrArray devices = camera.get_camera_devices ();
++    GLib.GenericArray<unowned Cheese.CameraDevice> devices = camera.get_camera_devices ();
+     camera_model = new Gtk.ListStore (2, typeof (string), typeof (Cheese.CameraDevice));
+ 
+     source_combo.model = camera_model;
+@@ -357,13 +357,13 @@ public PreferencesDialog (Cheese.Camera camera)
+    */
+   private void on_camera_update_num_camera_devices ()
+   {
+-    unowned GLib.PtrArray devices = camera.get_camera_devices ();
+-    Cheese.CameraDevice   dev;
++    GLib.GenericArray<unowned Cheese.CameraDevice> devices = camera.get_camera_devices ();
++    unowned Cheese.CameraDevice   dev;
+ 
+     // Add (if) / Remove (else) a camera device.
+-    if (devices.len > camera_model.iter_n_children (null))
++    if (devices.length > camera_model.iter_n_children (null))
+     {
+-      dev = (Cheese.CameraDevice) devices.index (devices.len - 1);
++      dev = devices.get (devices.length - 1);
+       add_camera_device(dev);
+     }
+     else
+@@ -382,12 +382,11 @@ public PreferencesDialog (Cheese.Camera camera)
+       bool device_removed = false;
+       devices.foreach ((device) =>
+       {
+-        var old_device = (Cheese.CameraDevice) device;
+         Cheese.CameraDevice new_device;
+         camera_model.get (iter, 1, out new_device, -1);
+ 
+         // Found the device that was removed.
+-        if (old_device != new_device)
++        if (device != new_device)
+         {
+             remove_camera_device (iter, new_device, active_device);
+             device_removed = true;
+@@ -418,17 +417,16 @@ public PreferencesDialog (Cheese.Camera camera)
+    *
+    * @param device a Cheese.CameraDevice to add to the device combo box model
+    */
+-  private void add_camera_device (void *device)
++  private void add_camera_device (Cheese.CameraDevice device)
+   {
+     TreeIter iter;
+-    Cheese.CameraDevice dev = (Cheese.CameraDevice) device;
+ 
+     camera_model.append (out iter);
+     camera_model.set (iter,
+-                      0, dev.get_name (),
+-                      1, dev);
++                      0, device.get_name (),
++                      1, device);
+ 
+-    if (camera.get_selected_device () == dev)
++    if (camera.get_selected_device () == device)
+         source_combo.set_active_iter (iter);
+ 
+     if (camera_model.iter_n_children (null) > 1)
+@@ -445,12 +443,12 @@ public PreferencesDialog (Cheese.Camera camera)
+   private void remove_camera_device (TreeIter iter, Cheese.CameraDevice device_node,
+                              Cheese.CameraDevice active_device_node)
+   {
+-      unowned GLib.PtrArray devices = camera.get_camera_devices ();
++      GLib.GenericArray<unowned Cheese.CameraDevice> devices = camera.get_camera_devices ();
+ 
+       // Check if the camera that we want to remove, is the active one
+       if (device_node == active_device_node)
+       {
+-        if (devices.len > 0)
++        if (devices.length > 0)
+           set_new_available_camera_device (iter);
+         else
+           this.hide ();
+diff --git a/src/cheese-window.vala b/src/cheese-window.vala
+index ff069808..cc119b68 100644
+--- a/src/cheese-window.vala
++++ b/src/cheese-window.vala
+@@ -1216,9 +1216,9 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
+    */
+   public void on_switch_camera_clicked ()
+   {
+-      Cheese.CameraDevice selected;
+-      Cheese.CameraDevice next = null;
+-      GLib.PtrArray cameras;
++      unowned Cheese.CameraDevice selected;
++      unowned Cheese.CameraDevice next = null;
++      GLib.GenericArray<unowned Cheese.CameraDevice> cameras;
+       uint i;
+ 
+       if (camera == null)
+@@ -1235,9 +1235,9 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
+ 
+       cameras = camera.get_camera_devices ();
+ 
+-      for (i = 0; i < cameras.len; i++)
++      for (i = 0; i < cameras.length; i++)
+       {
+-          next = (Cheese.CameraDevice )cameras.index (i);
++          next = cameras.get (i);
+ 
+           if (next == selected)
+           {
+@@ -1245,13 +1245,13 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
+           }
+       }
+ 
+-      if (i + 1 < cameras.len)
++      if (i + 1 < cameras.length)
+       {
+-          next = (Cheese.CameraDevice )cameras.index (i + 1);
++          next = cameras.get (i + 1);
+       }
+       else
+       {
+-          next = (Cheese.CameraDevice )cameras.index (0);
++          next = cameras.get (0);
+       }
+ 
+       if (next == selected)
+@@ -1269,8 +1269,8 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
+    */
+   public void set_switch_camera_button_state ()
+   {
+-      Cheese.CameraDevice selected;
+-      GLib.PtrArray cameras;
++      unowned Cheese.CameraDevice selected;
++      GLib.GenericArray<unowned Cheese.CameraDevice> cameras;
+ 
+       if (camera == null)
+       {
+@@ -1288,7 +1288,7 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
+ 
+       cameras = camera.get_camera_devices ();
+ 
+-      if (cameras.len > 1)
++      if (cameras.length > 1)
+       {
+          switch_camera_button.set_visible (true);
+          return;
+diff --git a/src/vapi/cheese-common.vapi b/src/vapi/cheese-common.vapi
+index 6517cdfc..e4ae7ad3 100644
+--- a/src/vapi/cheese-common.vapi
++++ b/src/vapi/cheese-common.vapi
+@@ -35,7 +35,7 @@ namespace Cheese
+     [CCode (has_construct_function = false)]
+     public Camera (Clutter.Actor video_texture, string camera_device_node, int x_resolution, int y_resolution);
+     public bool                        get_balance_property_range (string property, double min, double max, double def);
+-    public unowned GLib.PtrArray       get_camera_devices ();
++    public GLib.GenericArray<unowned Cheese.CameraDevice> get_camera_devices ();
+     public unowned Cheese.VideoFormat  get_current_video_format ();
+     public int                         get_num_camera_devices ();
+     public unowned Cheese.CameraDevice get_selected_device ();
+-- 
+GitLab
+
diff --git a/gnu/packages/patches/chez-scheme-build-util-paths-backport.patch b/gnu/packages/patches/chez-scheme-build-util-paths-backport.patch
deleted file mode 100644
index aad2d99996..0000000000
--- a/gnu/packages/patches/chez-scheme-build-util-paths-backport.patch
+++ /dev/null
@@ -1,780 +0,0 @@
-From 2447e047b750c3371778beb487f881641a582e66 Mon Sep 17 00:00:00 2001
-From: Philip McGrath <philip@philipmcgrath.com>
-Date: Thu, 11 Mar 2021 18:17:47 -0500
-Subject: [PATCH] avoid hard-coded paths for utilities in build scripts
-
-Backported from
-https://github.com/cisco/ChezScheme/commit/8f4633ce24ac6425b2ab13cc78026b1c9bb5361e
-
-Specific changes:
-  - `cc` -> `$(CC)`
-  - `/bin/rm` -> `rm`
-  - `/bin/ln` -> `ln`
-  - `/bin/cp` -> `cp`
-  - `/bin/echo` -> `echo`
-  - in `makefiles/installsh`, add a case to find `true`
-    at an unusual path or as a shell builtin
-
-Co-authored-by: Andy Keep <akeep@robotman.org>
----
- LOG                                 | 12 ++++++++++++
- csug/gifs/Makefile                  |  8 ++++----
- csug/math/Makefile                  |  4 ++--
- examples/Makefile                   |  2 +-
- makefiles/Makefile-csug.in          |  6 +++---
- makefiles/Makefile-release_notes.in |  2 +-
- makefiles/Mf-install.in             |  4 ++--
- makefiles/installsh                 |  3 ++-
- mats/6.ms                           |  2 +-
- mats/Mf-a6fb                        |  4 ++--
- mats/Mf-a6le                        |  4 ++--
- mats/Mf-a6nb                        |  4 ++--
- mats/Mf-a6ob                        |  4 ++--
- mats/Mf-a6osx                       |  4 ++--
- mats/Mf-arm32le                     |  4 ++--
- mats/Mf-i3fb                        |  4 ++--
- mats/Mf-i3le                        |  4 ++--
- mats/Mf-i3nb                        |  4 ++--
- mats/Mf-i3ob                        |  4 ++--
- mats/Mf-i3osx                       |  4 ++--
- mats/Mf-i3qnx                       |  4 ++--
- mats/Mf-ppc32le                     |  4 ++--
- mats/Mf-ta6fb                       |  4 ++--
- mats/Mf-ta6le                       |  4 ++--
- mats/Mf-ta6nb                       |  4 ++--
- mats/Mf-ta6ob                       |  4 ++--
- mats/Mf-ta6osx                      |  4 ++--
- mats/Mf-ti3fb                       |  4 ++--
- mats/Mf-ti3le                       |  4 ++--
- mats/Mf-ti3nb                       |  4 ++--
- mats/Mf-ti3ob                       |  4 ++--
- mats/Mf-ti3osx                      |  4 ++--
- mats/Mf-tppc32le                    |  4 ++--
- mats/unix.ms                        |  4 ++--
- newrelease                          | 22 +++++++++++-----------
- pkg/Makefile                        |  2 +-
- release_notes/gifs/Makefile         |  6 +++---
- release_notes/math/Makefile         |  4 ++--
- s/Mf-base                           |  2 +-
- workarea                            | 10 +++++-----
- 40 files changed, 101 insertions(+), 88 deletions(-)
-
-diff --git a/LOG b/LOG
-index e1631df..399104d 100644
---- a/LOG
-+++ b/LOG
-@@ -2119,3 +2119,15 @@
-     bintar/Makefile rpm/Makefile pkg/Makefile wininstall/Makefile
-     wininstall/a6nt.wxs wininstall/i3nt.wxs wininstall/ta6nt.wxs
-     wininstall/ti3nt.wxs
-+9.5.5 changes:
-+- avoid hard-coded paths for utilities in build scripts
-+    checkin csug/gifs/Makefile csug/math/Makefile examples/Makefile
-+    makefiles/Makefile-csug.in makefiles/Makefile-release_notes.in
-+    makefiles/Mf-install.in makefiles/installsh mats/6.ms mats/Mf-a6fb
-+    mats/Mf-a6le mats/Mf-a6nb mats/Mf-a6ob mats/Mf-a6osx mats/Mf-arm32le
-+    mats/Mf-i3fb mats/Mf-i3le mats/Mf-i3nb mats/Mf-i3ob mats/Mf-i3osx
-+    mats/Mf-i3qnx mats/Mf-ppc32le mats/Mf-ta6fb mats/Mf-ta6le mats/Mf-ta6nb
-+    mats/Mf-ta6ob mats/Mf-ta6osx mats/Mf-ti3fb mats/Mf-ti3le mats/Mf-ti3nb
-+    mats/Mf-ti3ob mats/Mf-ti3osx mats/Mf-tppc32le mats/unix.ms newrelease
-+    pkg/Makefile release_notes/gifs/Makefile release_notes/math/Makefile
-+    s/Mf-base workarea
-diff --git a/csug/gifs/Makefile b/csug/gifs/Makefile
-index 8676e4c..4253ffd 100644
---- a/csug/gifs/Makefile
-+++ b/csug/gifs/Makefile
-@@ -18,7 +18,7 @@ density=-r90x90
-           ${density} - |\
-           pnmcrop |\
-           ppmtogif -transparent white > $*.gif
--	/bin/rm -f $*.dvi $*.log *.aux
-+	rm -f $*.dvi $*.log *.aux
- 	test -f $*.gif && chmod 644 $*.gif
-
- # translate ps file to gif w/o transparent white background
-@@ -28,7 +28,7 @@ density=-r90x90
-           ${density} - |\
-           pnmcrop |\
-           ppmtogif > $*.gif
--	/bin/rm -f $*.dvi $*.log *.aux
-+	rm -f $*.dvi $*.log *.aux
- 	test -f $*.gif && chmod 644 $*.gif
-
- all: ${gifs}
-@@ -57,7 +57,7 @@ ghostRightarrow.gif: Rightarrow.tex
-           giftrans -g '#000000=#ffffff' |\
-           giftopnm |\
-           ppmtogif -transparent white > $*.gif
--	/bin/rm -f Rightarrow.dvi Rightarrow.log Rightarrow.aux
-+	rm -f Rightarrow.dvi Rightarrow.log Rightarrow.aux
- 	test -f $*.gif && chmod 644 $*.gif
-
--clean: ; /bin/rm -f *.gif Make.out
-+clean: ; rm -f *.gif Make.out
-diff --git a/csug/math/Makefile b/csug/math/Makefile
-index 3385fdb..3392ea8 100644
---- a/csug/math/Makefile
-+++ b/csug/math/Makefile
-@@ -15,11 +15,11 @@ density=-r90x90
-           ${density} - |\
-           pnmcrop |\
-           ppmtogif -transparent white > $*.gif
--	/bin/rm -f $*.dvi $*.log $*.aux
-+	rm -f $*.dvi $*.log $*.aux
- 	test -f $*.gif && chmod 644 $*.gif
-
- all: ${gifs}
-
- ${gifs}: mathmacros
-
--clean: ; /bin/rm -f *.gif Make.out
-+clean: ; rm -f *.gif Make.out
-diff --git a/examples/Makefile b/examples/Makefile
-index b1b4e1d..3edfdd0 100644
---- a/examples/Makefile
-+++ b/examples/Makefile
-@@ -25,4 +25,4 @@ needed:	${obj}
-
- all: ; echo "(time (for-each compile-file (map symbol->string '(${src}))))" | ${Scheme}
-
--clean: ; /bin/rm -f $(obj) expr.md
-+clean: ; rm -f $(obj) expr.md
-diff --git a/makefiles/Makefile-csug.in b/makefiles/Makefile-csug.in
-index df24092..6f8a8d9 100644
---- a/makefiles/Makefile-csug.in
-+++ b/makefiles/Makefile-csug.in
-@@ -29,7 +29,7 @@ install: target
- # thrice is not enough when starting from scratch
- logcheck1: $(x).thirdrun
- 	@if [ -n "`grep 'Warning: Label(s) may have changed' $(x).log`" ] ; then\
--            /bin/rm -f $(x).thirdrun ;\
-+            rm -f $(x).thirdrun ;\
-             $(MAKE) $(x).thirdrun;\
-          fi
-
-@@ -55,7 +55,7 @@ stexsrc = csug.stex title.stex copyright.stex contents.stex\
- texsrc = ${stexsrc:%.stex=%.tex}
-
- title.tex contents.tex bibliography.tex:
--	/bin/rm -f $*.tex
-+	rm -f $*.tex
- 	echo "%%% DO NOT EDIT THIS FILE" > $*.tex
- 	echo "%%% Edit the .stex version instead" >> $*.tex
- 	echo "" >> $*.tex
-@@ -147,7 +147,7 @@ code: $(stexsrc)
- 	echo '(load "code" pretty-print)' | $(Scheme) -q
-
- $(x).clean:
--	-/bin/rm -f $(x).rfm $(x).sfm $(x).prefirstrun $(x).presecondrun\
-+	-rm -f $(x).rfm $(x).sfm $(x).prefirstrun $(x).presecondrun\
-                     $(x).prethirdrun $(x).ans\
-                     $(x).hprefirstrun $(x).hpresecondrun $(x).hprethirdrun\
-                     tspl.aux tspl.haux tspl.rfm tspl.idx in.hidx\
-diff --git a/makefiles/Makefile-release_notes.in b/makefiles/Makefile-release_notes.in
-index 4435b6f..64348a4 100644
---- a/makefiles/Makefile-release_notes.in
-+++ b/makefiles/Makefile-release_notes.in
-@@ -38,7 +38,7 @@ install: $x.pdf $x.html
- 	$(INSTALL) -m 2755 -d $(installdir)/gifs
- 	$(INSTALL) -m 0644 --ifdiff gifs/*.gif $(installdir)/gifs
- 	$(INSTALL) -m 2755 -d $(installdir)/math
--	-/bin/rm -rf $(installdir)/$(mathdir)
-+	-rm -rf $(installdir)/$(mathdir)
- 	$(INSTALL) -m 2755 -d $(installdir)/$(mathdir)
- 	if [ -e $(mathdir)/0.gif ] ; then $(INSTALL) -m 0644 $(mathdir)/*.gif $(installdir)/$(mathdir) ; fi
-
-diff --git a/makefiles/Mf-install.in b/makefiles/Mf-install.in
-index a702c34..c09043d 100644
---- a/makefiles/Mf-install.in
-+++ b/makefiles/Mf-install.in
-@@ -114,12 +114,12 @@ bininstall: ${Bin}
- libbininstall: ${LibBin}
- 	$I -m 444 ${PetiteBoot} ${LibBin}/petite.boot
- 	if [ "${InstallPetiteName}" != "petite" ]; then\
--          /bin/rm -f ${LibBin}/${InstallPetiteName}.boot;\
-+          rm -f ${LibBin}/${InstallPetiteName}.boot;\
-           ln -f ${LibBin}/petite.boot ${LibBin}/${InstallPetiteName}.boot;\
-         fi
- 	$I -m 444 ${SchemeBoot} ${LibBin}/scheme.boot;\
- 	if [ "${InstallSchemeName}" != "scheme" ]; then\
--          /bin/rm -f ${LibBin}/${InstallSchemeName}.boot;\
-+          rm -f ${LibBin}/${InstallSchemeName}.boot;\
-           ln -f ${LibBin}/scheme.boot ${LibBin}/${InstallSchemeName}.boot;\
-         fi
- 	ln -f ${LibBin}/scheme.boot ${LibBin}/${InstallScriptName}.boot;
-diff --git a/makefiles/installsh b/makefiles/installsh
-index 48f1e46..95d85fb 100755
---- a/makefiles/installsh
-+++ b/makefiles/installsh
-@@ -1,7 +1,8 @@
- #! /bin/sh
- if [ -x /bin/true ]; then TRUE=/bin/true;
- elif [ -x /usr/bin/true ]; then TRUE=/usr/bin/true;
--else echo "Can't find /bin/true or /usr/bin/true" ; exit 1;
-+elif command -v true &> /dev/null; then TRUE=true;
-+else echo "Can't find /bin/true or /usr/bin/true and no true command" ; exit 1;
- fi
-
- while ${TRUE} ; do
-diff --git a/mats/6.ms b/mats/6.ms
-index 102f84b..e504230 100644
---- a/mats/6.ms
-+++ b/mats/6.ms
-@@ -2685,7 +2685,7 @@
-       (begin
-         (system "ln -s ../examples .")
-         (load "examples/fatfib.ss" compile)
--        (system "/bin/rm examples")
-+        (system "rm -f examples")
-         #t))
-   (or (windows?) (embedded?)
-       (equal?
-diff --git a/mats/Mf-a6fb b/mats/Mf-a6fb
-index b16d1b6..ff9e687 100644
---- a/mats/Mf-a6fb
-+++ b/mats/Mf-a6fb
-@@ -21,7 +21,7 @@ fobj = foreign1.so
- include Mf-base
-
- foreign1.so: ${fsrc} ../boot/$m/scheme.h
--	cc -fPIC -shared -I${Include} -o foreign1.so ${fsrc}
-+	$(CC) -fPIC -shared -I${Include} -o foreign1.so ${fsrc}
-
- cat_flush: cat_flush.c
--	cc -o cat_flush cat_flush.c
-+	$(CC) -o cat_flush cat_flush.c
-diff --git a/mats/Mf-a6le b/mats/Mf-a6le
-index d6fee09..a3bda76 100644
---- a/mats/Mf-a6le
-+++ b/mats/Mf-a6le
-@@ -21,7 +21,7 @@ fobj = foreign1.so
- include Mf-base
-
- foreign1.so: ${fsrc} ../boot/$m/scheme.h
--	cc -m64 -fPIC -shared -I${Include} -o foreign1.so ${fsrc}
-+	$(CC) -m64 -fPIC -shared -I${Include} -o foreign1.so ${fsrc}
-
- cat_flush: cat_flush.c
--	cc -o cat_flush cat_flush.c
-+	$(CC) -o cat_flush cat_flush.c
-diff --git a/mats/Mf-a6nb b/mats/Mf-a6nb
-index 48187ef..0f7ac17 100644
---- a/mats/Mf-a6nb
-+++ b/mats/Mf-a6nb
-@@ -21,7 +21,7 @@ fobj = foreign1.so
- include Mf-base
-
- foreign1.so: ${fsrc} ../boot/$m/scheme.h
--	cc -fPIC -shared -I${Include} -o foreign1.so ${fsrc}
-+	$(CC) -fPIC -shared -I${Include} -o foreign1.so ${fsrc}
-
- cat_flush: cat_flush.c
--	cc -o cat_flush cat_flush.c
-+	$(CC) -o cat_flush cat_flush.c
-diff --git a/mats/Mf-a6ob b/mats/Mf-a6ob
-index 12758f3..0ffcccc 100644
---- a/mats/Mf-a6ob
-+++ b/mats/Mf-a6ob
-@@ -21,7 +21,7 @@ fobj = foreign1.so
- include Mf-base
-
- foreign1.so: ${fsrc} ../boot/$m/scheme.h
--	cc -fPIC -shared -I${Include} -o foreign1.so ${fsrc}
-+	$(CC) -fPIC -shared -I${Include} -o foreign1.so ${fsrc}
-
- cat_flush: cat_flush.c
--	cc -o cat_flush cat_flush.c
-+	$(CC) -o cat_flush cat_flush.c
-diff --git a/mats/Mf-a6osx b/mats/Mf-a6osx
-index f1dbf85..57bac22 100644
---- a/mats/Mf-a6osx
-+++ b/mats/Mf-a6osx
-@@ -21,7 +21,7 @@ fobj = foreign1.so
- include Mf-base
-
- foreign1.so: ${fsrc} ../boot/$m/scheme.h
--	cc -m64 -dynamiclib -undefined dynamic_lookup -I${Include} -o foreign1.so ${fsrc}
-+	$(CC) -m64 -dynamiclib -undefined dynamic_lookup -I${Include} -o foreign1.so ${fsrc}
-
- cat_flush: cat_flush.c
--	cc -o cat_flush cat_flush.c
-+	$(CC) -o cat_flush cat_flush.c
-diff --git a/mats/Mf-arm32le b/mats/Mf-arm32le
-index f33a665..83896eb 100644
---- a/mats/Mf-arm32le
-+++ b/mats/Mf-arm32le
-@@ -21,7 +21,7 @@ fobj = foreign1.so
- include Mf-base
-
- foreign1.so: ${fsrc} ../boot/$m/scheme.h
--	cc -fPIC -fomit-frame-pointer -shared -I${Include} -o foreign1.so ${fsrc}
-+	$(CC) -fPIC -fomit-frame-pointer -shared -I${Include} -o foreign1.so ${fsrc}
-
- cat_flush: cat_flush.c
--	cc -o cat_flush cat_flush.c
-+	$(CC) -o cat_flush cat_flush.c
-diff --git a/mats/Mf-i3fb b/mats/Mf-i3fb
-index 150cedb..1e4e8fc 100644
---- a/mats/Mf-i3fb
-+++ b/mats/Mf-i3fb
-@@ -21,7 +21,7 @@ fobj = foreign1.so
- include Mf-base
-
- foreign1.so: ${fsrc} ../boot/$m/scheme.h
--	cc -fPIC -shared -I${Include} -o foreign1.so ${fsrc}
-+	$(CC) -fPIC -shared -I${Include} -o foreign1.so ${fsrc}
-
- cat_flush: cat_flush.c
--	cc -o cat_flush cat_flush.c
-+	$(CC) -o cat_flush cat_flush.c
-diff --git a/mats/Mf-i3le b/mats/Mf-i3le
-index 8f521c8..b248620 100644
---- a/mats/Mf-i3le
-+++ b/mats/Mf-i3le
-@@ -21,7 +21,7 @@ fobj = foreign1.so
- include Mf-base
-
- foreign1.so: ${fsrc} ../boot/$m/scheme.h
--	cc -m32 -fPIC -shared -I${Include} -o foreign1.so ${fsrc}
-+	$(CC) -m32 -fPIC -shared -I${Include} -o foreign1.so ${fsrc}
-
- cat_flush: cat_flush.c
--	cc -o cat_flush cat_flush.c
-+	$(CC) -o cat_flush cat_flush.c
-diff --git a/mats/Mf-i3nb b/mats/Mf-i3nb
-index e81f6ff..8afeb5c 100644
---- a/mats/Mf-i3nb
-+++ b/mats/Mf-i3nb
-@@ -21,7 +21,7 @@ fobj = foreign1.so
- include Mf-base
-
- foreign1.so: ${fsrc} ../boot/$m/scheme.h
--	cc -fPIC -shared -I${Include} -o foreign1.so ${fsrc}
-+	$(CC) -fPIC -shared -I${Include} -o foreign1.so ${fsrc}
-
- cat_flush: cat_flush.c
--	cc -o cat_flush cat_flush.c
-+	$(CC) -o cat_flush cat_flush.c
-diff --git a/mats/Mf-i3ob b/mats/Mf-i3ob
-index 4e3ee1b..fcd4dee 100644
---- a/mats/Mf-i3ob
-+++ b/mats/Mf-i3ob
-@@ -21,7 +21,7 @@ fobj = foreign1.so
- include Mf-base
-
- foreign1.so: ${fsrc} ../boot/$m/scheme.h
--	cc -fPIC -shared -I${Include} -o foreign1.so ${fsrc}
-+	$(CC) -fPIC -shared -I${Include} -o foreign1.so ${fsrc}
-
- cat_flush: cat_flush.c
--	cc -o cat_flush cat_flush.c
-+	$(CC) -o cat_flush cat_flush.c
-diff --git a/mats/Mf-i3osx b/mats/Mf-i3osx
-index 53c7d4a..a55f6ee 100644
---- a/mats/Mf-i3osx
-+++ b/mats/Mf-i3osx
-@@ -21,7 +21,7 @@ fobj = foreign1.so
- include Mf-base
-
- foreign1.so: ${fsrc} ../boot/$m/scheme.h
--	cc -m32 -dynamiclib -undefined dynamic_lookup -I${Include} -o foreign1.so ${fsrc}
-+	$(CC) -m32 -dynamiclib -undefined dynamic_lookup -I${Include} -o foreign1.so ${fsrc}
-
- cat_flush: cat_flush.c
--	cc -o cat_flush cat_flush.c
-+	$(CC) -o cat_flush cat_flush.c
-diff --git a/mats/Mf-i3qnx b/mats/Mf-i3qnx
-index 724f2db..3e1437a 100644
---- a/mats/Mf-i3qnx
-+++ b/mats/Mf-i3qnx
-@@ -21,7 +21,7 @@ fobj = foreign1.so
- include Mf-base
-
- foreign1.so: ${fsrc} ../boot/$m/scheme.h
--	cc -m32 -fPIC -shared -I${Include} -o foreign1.so ${fsrc}
-+	$(CC) -m32 -fPIC -shared -I${Include} -o foreign1.so ${fsrc}
-
- cat_flush: cat_flush.c
--	cc -o cat_flush cat_flush.c
-+	$(CC) -o cat_flush cat_flush.c
-diff --git a/mats/Mf-ppc32le b/mats/Mf-ppc32le
-index 28151a8..547ca00 100644
---- a/mats/Mf-ppc32le
-+++ b/mats/Mf-ppc32le
-@@ -21,7 +21,7 @@ fobj = foreign1.so
- include Mf-base
-
- foreign1.so: ${fsrc} ../boot/$m/scheme.h
--	cc -m32 -fPIC -shared -I${Include} -o foreign1.so ${fsrc}
-+	$(CC) -m32 -fPIC -shared -I${Include} -o foreign1.so ${fsrc}
-
- cat_flush: cat_flush.c
--	cc -o cat_flush cat_flush.c
-+	$(CC) -o cat_flush cat_flush.c
-diff --git a/mats/Mf-ta6fb b/mats/Mf-ta6fb
-index 921d609..5ed233e 100644
---- a/mats/Mf-ta6fb
-+++ b/mats/Mf-ta6fb
-@@ -21,7 +21,7 @@ fobj = foreign1.so
- include Mf-base
-
- foreign1.so: ${fsrc} ../boot/$m/scheme.h
--	cc -pthread -fPIC -shared -I${Include} -o foreign1.so ${fsrc}
-+	$(CC) -pthread -fPIC -shared -I${Include} -o foreign1.so ${fsrc}
-
- cat_flush: cat_flush.c
--	cc -o cat_flush cat_flush.c
-+	$(CC) -o cat_flush cat_flush.c
-diff --git a/mats/Mf-ta6le b/mats/Mf-ta6le
-index cd014ec..21c686a 100644
---- a/mats/Mf-ta6le
-+++ b/mats/Mf-ta6le
-@@ -21,7 +21,7 @@ fobj = foreign1.so
- include Mf-base
-
- foreign1.so: ${fsrc} ../boot/$m/scheme.h
--	cc -m64 -pthread -fPIC -shared -I${Include} -o foreign1.so ${fsrc}
-+	$(CC) -m64 -pthread -fPIC -shared -I${Include} -o foreign1.so ${fsrc}
-
- cat_flush: cat_flush.c
--	cc -o cat_flush cat_flush.c
-+	$(CC) -o cat_flush cat_flush.c
-diff --git a/mats/Mf-ta6nb b/mats/Mf-ta6nb
-index 6b1929d..9b9b898 100644
---- a/mats/Mf-ta6nb
-+++ b/mats/Mf-ta6nb
-@@ -21,7 +21,7 @@ fobj = foreign1.so
- include Mf-base
-
- foreign1.so: ${fsrc} ../boot/$m/scheme.h
--	cc -pthread -fPIC -shared -I${Include} -o foreign1.so ${fsrc}
-+	$(CC) -pthread -fPIC -shared -I${Include} -o foreign1.so ${fsrc}
-
- cat_flush: cat_flush.c
--	cc -o cat_flush cat_flush.c
-+	$(CC) -o cat_flush cat_flush.c
-diff --git a/mats/Mf-ta6ob b/mats/Mf-ta6ob
-index a7aee91..8f25aed 100644
---- a/mats/Mf-ta6ob
-+++ b/mats/Mf-ta6ob
-@@ -21,7 +21,7 @@ fobj = foreign1.so
- include Mf-base
-
- foreign1.so: ${fsrc} ../boot/$m/scheme.h
--	cc -pthread -fPIC -shared -I${Include} -o foreign1.so ${fsrc}
-+	$(CC) -pthread -fPIC -shared -I${Include} -o foreign1.so ${fsrc}
-
- cat_flush: cat_flush.c
--	cc -o cat_flush cat_flush.c
-+	$(CC) -o cat_flush cat_flush.c
-diff --git a/mats/Mf-ta6osx b/mats/Mf-ta6osx
-index 42da5d7..0dd386f 100644
---- a/mats/Mf-ta6osx
-+++ b/mats/Mf-ta6osx
-@@ -21,7 +21,7 @@ fobj = foreign1.so
- include Mf-base
-
- foreign1.so: ${fsrc} ../boot/$m/scheme.h
--	cc -m64 -pthread -dynamiclib -undefined dynamic_lookup -I${Include} -o foreign1.so ${fsrc}
-+	$(CC) -m64 -pthread -dynamiclib -undefined dynamic_lookup -I${Include} -o foreign1.so ${fsrc}
-
- cat_flush: cat_flush.c
--	cc -o cat_flush cat_flush.c
-+	$(CC) -o cat_flush cat_flush.c
-diff --git a/mats/Mf-ti3fb b/mats/Mf-ti3fb
-index c891145..56bf7d3 100644
---- a/mats/Mf-ti3fb
-+++ b/mats/Mf-ti3fb
-@@ -21,7 +21,7 @@ fobj = foreign1.so
- include Mf-base
-
- foreign1.so: ${fsrc} ../boot/$m/scheme.h
--	cc -pthread -fPIC -shared -I${Include} -o foreign1.so ${fsrc}
-+	$(CC) -pthread -fPIC -shared -I${Include} -o foreign1.so ${fsrc}
-
- cat_flush: cat_flush.c
--	cc -o cat_flush cat_flush.c
-+	$(CC) -o cat_flush cat_flush.c
-diff --git a/mats/Mf-ti3le b/mats/Mf-ti3le
-index 12e77b8..22b4148 100644
---- a/mats/Mf-ti3le
-+++ b/mats/Mf-ti3le
-@@ -21,7 +21,7 @@ fobj = foreign1.so
- include Mf-base
-
- foreign1.so: ${fsrc} ../boot/$m/scheme.h
--	cc -m32 -pthread -fPIC -shared -I${Include} -o foreign1.so ${fsrc}
-+	$(CC) -m32 -pthread -fPIC -shared -I${Include} -o foreign1.so ${fsrc}
-
- cat_flush: cat_flush.c
--	cc -o cat_flush cat_flush.c
-+	$(CC) -o cat_flush cat_flush.c
-diff --git a/mats/Mf-ti3nb b/mats/Mf-ti3nb
-index 028c652..573946e 100644
---- a/mats/Mf-ti3nb
-+++ b/mats/Mf-ti3nb
-@@ -21,7 +21,7 @@ fobj = foreign1.so
- include Mf-base
-
- foreign1.so: ${fsrc} ../boot/$m/scheme.h
--	cc -pthread -fPIC -shared -I${Include} -o foreign1.so ${fsrc}
-+	$(CC) -pthread -fPIC -shared -I${Include} -o foreign1.so ${fsrc}
-
- cat_flush: cat_flush.c
--	cc -o cat_flush cat_flush.c
-+	$(CC) -o cat_flush cat_flush.c
-diff --git a/mats/Mf-ti3ob b/mats/Mf-ti3ob
-index 8a4741c..4472b60 100644
---- a/mats/Mf-ti3ob
-+++ b/mats/Mf-ti3ob
-@@ -21,7 +21,7 @@ fobj = foreign1.so
- include Mf-base
-
- foreign1.so: ${fsrc} ../boot/$m/scheme.h
--	cc -pthread -fPIC -shared -I${Include} -o foreign1.so ${fsrc}
-+	$(CC) -pthread -fPIC -shared -I${Include} -o foreign1.so ${fsrc}
-
- cat_flush: cat_flush.c
--	cc -o cat_flush cat_flush.c
-+	$(CC) -o cat_flush cat_flush.c
-diff --git a/mats/Mf-ti3osx b/mats/Mf-ti3osx
-index 6913c34..9273b44 100644
---- a/mats/Mf-ti3osx
-+++ b/mats/Mf-ti3osx
-@@ -21,7 +21,7 @@ fobj = foreign1.so
- include Mf-base
-
- foreign1.so: ${fsrc} ../boot/$m/scheme.h
--	cc -m32 -pthread -dynamiclib -undefined dynamic_lookup -I${Include} -o foreign1.so ${fsrc}
-+	$(CC) -m32 -pthread -dynamiclib -undefined dynamic_lookup -I${Include} -o foreign1.so ${fsrc}
-
- cat_flush: cat_flush.c
--	cc -o cat_flush cat_flush.c
-+	$(CC) -o cat_flush cat_flush.c
-diff --git a/mats/Mf-tppc32le b/mats/Mf-tppc32le
-index a12b515..8b9d9f0 100644
---- a/mats/Mf-tppc32le
-+++ b/mats/Mf-tppc32le
-@@ -21,7 +21,7 @@ fobj = foreign1.so
- include Mf-base
-
- foreign1.so: ${fsrc} ../boot/$m/scheme.h
--	cc -m32 -pthread -fPIC -shared -I${Include} -o foreign1.so ${fsrc}
-+	$(CC) -m32 -pthread -fPIC -shared -I${Include} -o foreign1.so ${fsrc}
-
- cat_flush: cat_flush.c
--	cc -o cat_flush cat_flush.c
-+	$(CC) -o cat_flush cat_flush.c
-diff --git a/mats/unix.ms b/mats/unix.ms
-index cfba3e7..db7f6f9 100644
---- a/mats/unix.ms
-+++ b/mats/unix.ms
-@@ -72,8 +72,8 @@
-   (mat system
-     (eqv? (with-output-to-file "testfile.ss" void '(replace)) (void))
-     (begin
--      (system (format "~:[~;/pkg~]/bin/rm testfile.ss" (embedded?)))
--      (system (format "~:[~;/pkg~]/bin/echo hello > testfile.ss" (embedded?)))
-+      (system "rm -f testfile.ss")
-+      (system "echo hello > testfile.ss")
-       (let ([p (open-input-file "testfile.ss")])
-         (and (eq? (read p) 'hello)
-              (begin (close-input-port p) #t))))
-diff --git a/newrelease b/newrelease
-index e903956..2d06740 100755
---- a/newrelease
-+++ b/newrelease
-@@ -75,13 +75,13 @@ if ($status != 0) exit 1
-
- cd $W
-
--/bin/rm -f BUILDING
-+rm -f BUILDING
- sed -e "s/Chez Scheme Version [^ ]*/Chez Scheme Version $R/" \
-     -e "s/Copyright 1984-.... /Copyright 1984-`date +%Y` /" \
-     ../BUILDING > BUILDING
- set updatedfiles = ($updatedfiles BUILDING)
-
--/bin/rm -f NOTICE
-+rm -f NOTICE
- sed -e "s/Chez Scheme Version [^ ]*/Chez Scheme Version $R/" \
-     -e "s/Copyright 1984-.... /Copyright 1984-`date +%Y` /" \
-     ../NOTICE > NOTICE
-@@ -92,19 +92,19 @@ sed -e "s/csv[0-9]\.[0-9]\(\.[0-9]\)*/csv$R/" ../makefiles/Mf-install.in > makef
- sed -e "s/csug[0-9]\.[0-9]/csug$MR.$mR/" -e "s/csug[0-9]_[0-9]/csug$MR""_$mR/" ../makefiles/Makefile-csug.in > makefiles/Makefile-csug.in
- set updatedfiles = ($updatedfiles makefiles/Mf-install.in makefiles/Makefile-csug.in)
-
--/bin/rm scheme.1.in
-+rm -f scheme.1.in
- sed -e "s/Chez Scheme Version [0-9]\.[0-9]\(\.[0-9]\)* .* [0-9][0-9]*/Chez Scheme Version $R `date +'%B %Y'`/" \
-     -e "s/Copyright .* Cisco Systems, Inc./Copyright `date +%Y` Cisco Systems, Inc./" \
-   ../scheme.1.in > scheme.1.in
- set updatedfiles = ($updatedfiles scheme.1.in)
-
--/bin/rm -f c/Makefile.{,t}{i3,a6}nt
-+rm -f c/Makefile.{,t}{i3,a6}nt
- foreach fn (c/Makefile.{,t}{a6,i3}nt)
-   set updatedfiles = ($updatedfiles $fn)
-   sed -e "s/csv[0-9][0-9][0-9]*/csv$ZR/g" ../$fn > $fn
- end
-
--/bin/rm -f mats/Mf-{,t}{i3,a6}nt
-+rm -f mats/Mf-{,t}{i3,a6}nt
- foreach fn (mats/Mf-{,t}{a6,i3}nt)
-   set updatedfiles = ($updatedfiles $fn)
-   sed -e "s/csv[0-9][0-9][0-9]*/csv$ZR/g" ../$fn > $fn
-@@ -123,11 +123,11 @@ sed -e "s/FILEVERSION .*/FILEVERSION $RCVERSION/"\
-     -e "s/Copyright 1984-..../Copyright 1984-`date +%Y`/g" ../c/scheme.rc > c/scheme.rc
- set updatedfiles = ($updatedfiles c/scheme.rc)
-
--/bin/rm -f s/7.ss
-+rm -f s/7.ss
- sed -e "s/nCopyright 1984-..../nCopyright 1984-`date +%Y`/g" ../s/7.ss > s/7.ss
- set updatedfiles = ($updatedfiles s/7.ss)
-
--/bin/rm -f s/cmacros.ss
-+rm -f s/cmacros.ss
- set VNUM = `printf "%04x%02x%02x" $MR $mR $bR`
- sed -e "s/scheme-version #x......../scheme-version #x$VNUM/" ../s/cmacros.ss > s/cmacros.ss
- set updatedfiles = ($updatedfiles s/cmacros.ss)
-@@ -146,17 +146,17 @@ sed -e "s/Revised\(.*\)for Chez Scheme Version [^ ]*<br>/Revised\1for Chez Schem
-   ../csug/csug.stex > csug/csug.stex
- set updatedfiles = ($updatedfiles csug/copyright.stex csug/csug.stex)
-
--/bin/rm bintar/Makefile
-+rm -f bintar/Makefile
- sed -e "s/^version = .*/version = $R/" \
-     -e "s/csv[0-9][0-9][0-9]*/csv$ZR/g" \
-   ../bintar/Makefile > bintar/Makefile
- set updatedfiles = ($updatedfiles bintar/Makefile)
-
--/bin/rm rpm/Makefile
-+rm -f rpm/Makefile
- sed -e "s/^version = .*/version = $R/" ../rpm/Makefile > rpm/Makefile
- set updatedfiles = ($updatedfiles rpm/Makefile)
-
--/bin/rm pkg/Makefile
-+rm -f pkg/Makefile
- sed -e "s/^version = .*/version = $R/" \
-     -e "s/&copy; .* Cisco Systems/\&copy; `date +%Y` Cisco Systems/" \
-      ../pkg/Makefile > pkg/Makefile
-@@ -170,7 +170,7 @@ foreach fn (wininstall/{,t}{a6,i3}nt.wxs)
-   sed -e "s/csv[0-9][0-9][0-9]*/csv$ZR/" ../$fn > $fn
- end
-
--/bin/rm LOG
-+rm -f LOG
- cat ../LOG > LOG
- echo "" >> LOG
- echo "$R changes:" >> LOG
-diff --git a/pkg/Makefile b/pkg/Makefile
-index e0eef67..a3fe83f 100644
---- a/pkg/Makefile
-+++ b/pkg/Makefile
-@@ -39,7 +39,7 @@ $(PKG): $(BUILDROOT)/$(PKG)
-           --package-path $(BUILDROOT)\
-           $(PKG)
- 	sudo chown $(DOTUSER):$(DOTGROUP) $(PKG)
--	sudo /bin/rm -rf $(RELEASE) $(BUILDROOT)
-+	sudo rm -rf $(RELEASE) $(BUILDROOT)
-
- $(BUILDROOT)/$(PKG): $(PKGCONTENT)
- 	sudo /usr/bin/pkgbuild\
-diff --git a/release_notes/gifs/Makefile b/release_notes/gifs/Makefile
-index 9572965..701d53a 100644
---- a/release_notes/gifs/Makefile
-+++ b/release_notes/gifs/Makefile
-@@ -15,7 +15,7 @@ density=-r90x90
-           ${density} - |\
-           pnmcrop |\
-           ppmtogif -transparent white > $*.gif
--	/bin/rm -f $*.dvi $*.log *.aux
-+	rm -f $*.dvi $*.log *.aux
- 	test -f $*.gif && chmod 644 $*.gif
-
- all: ${gifs}
-@@ -44,7 +44,7 @@ ghostRightarrow.gif: Rightarrow.tex
-           giftrans -g '#000000=#ffffff' |\
-           giftopnm |\
-           ppmtogif -transparent white > $*.gif
--	/bin/rm -f Rightarrow.dvi Rightarrow.log Rightarrow.aux
-+	rm -f Rightarrow.dvi Rightarrow.log Rightarrow.aux
- 	test -f $*.gif && chmod 644 $*.gif
-
--clean: ; /bin/rm -f *.gif Make.out
-+clean: ; rm -f *.gif Make.out
-diff --git a/release_notes/math/Makefile b/release_notes/math/Makefile
-index b3ffae3..9eca430 100644
---- a/release_notes/math/Makefile
-+++ b/release_notes/math/Makefile
-@@ -16,11 +16,11 @@ density=-r90x90
-           ${density} - |\
-           pnmcrop |\
-           ppmtogif -transparent white > $*.gif
--	/bin/rm -f $*.dvi $*.log $*.aux
-+	rm -f $*.dvi $*.log $*.aux
- 	test -f $*.gif && chmod 644 $*.gif
-
- all: ${gifs}
-
- ${gifs}: mathmacros
-
--clean: ; /bin/rm -f *.gif Make.out
-+clean: ; rm -f *.gif Make.out
-diff --git a/s/Mf-base b/s/Mf-base
-index c709608..40d816c 100644
---- a/s/Mf-base
-+++ b/s/Mf-base
-@@ -206,7 +206,7 @@ profiled:
- 	$(MAKE) all loadspd=t bp=t PetiteBoot=../boot/$m/xpetite.boot SchemeBoot=../boot/$m/xscheme.boot
- 	$(MAKE) prettyclean
- 	$(MAKE) io.$m loadspd=t dumpbpd=t Scheme="../bin/$m/scheme -b ../boot/$m/xpetite.boot -b ../boot/$m/xscheme.boot"
--	/bin/rm -f ../boot/$m/xpetite.boot ../boot/$m/xscheme.boot
-+	rm -f ../boot/$m/xpetite.boot ../boot/$m/xscheme.boot
- 	$(MAKE) prettyclean
- 	$(MAKE) all loadspd=t loadbpd=t
-
-diff --git a/workarea b/workarea
-index bacc712..0461919 100755
---- a/workarea
-+++ b/workarea
-@@ -70,9 +70,9 @@ esac
-
- if [ "$OS" = "Windows_NT" ]
- then
--    ln="/bin/cp -R"
-+    ln="cp -R"
- else
--    ln="/bin/ln -s"
-+    ln="ln -s"
- fi
-
- # This shell script creates a workarea for local modifications to the
-@@ -102,7 +102,7 @@ workln()
- forceworkln()
- {
-     if [ ! -e $2 ] ; then
--        /bin/ln -s $1 $2 2> /dev/null
-+        ln -s $1 $2 2> /dev/null
-     fi
- }
-
-@@ -168,13 +168,13 @@ done
- # deep copy submodules where builds occur so changes don't propagate through symlinks
- for dir in `echo zlib` ; do
-   if [ ! -e $W/$dir ] ; then
--    /bin/cp -R $dir $W/$dir
-+    cp -R $dir $W/$dir
-   fi
- done
-
- for dir in `echo lz4` ; do
-   if [ ! -e $W/$dir ] ; then
--    /bin/cp -R $dir $W/$dir
-+    cp -R $dir $W/$dir
-   fi
- done
-
---
-2.21.1 (Apple Git-122.3)
-
diff --git a/gnu/packages/patches/clang-10.0-libc-search-path.patch b/gnu/packages/patches/clang-10.0-libc-search-path.patch
index 966e40b93c..c2854e3f33 100644
--- a/gnu/packages/patches/clang-10.0-libc-search-path.patch
+++ b/gnu/packages/patches/clang-10.0-libc-search-path.patch
@@ -4,18 +4,47 @@ but unfortunately, that doesn't work for us.
 This patch makes it easy to insert libc's $libdir so that Clang passes the
 correct absolute file name of crt1.o etc. to 'ld'.  It also disables all
 the distro-specific stuff and removes the hard-coded FHS directory names
-to make sure Clang also works on non-Guix systems.
+to make sure Clang also works on foreign distros.
 
+diff --git a/lib/Driver/Distro.cpp b/lib/Driver/Distro.cpp
+index 06707fef..f3bd43de 100644
+--- a/lib/Driver/Distro.cpp
++++ b/lib/Driver/Distro.cpp
+@@ -20,6 +20,10 @@ using namespace clang;
+ 
+ static Distro::DistroType DetectDistro(llvm::vfs::FileSystem &VFS,
+                                        const llvm::Triple &TargetOrHost) {
++  // The compiler should always behave the same, even when used via Guix on a
++  // foreign distro.
++  return Distro::UnknownDistro;
++
+   // If we don't target Linux, no need to check the distro. This saves a few
+   // OS calls.
+   if (!TargetOrHost.isOSLinux())
+diff --git a/lib/Driver/ToolChains/Cuda.cpp b/lib/Driver/ToolChains/Cuda.cpp
+index 50d22a2a..4ab93e0a 100644
+--- a/lib/Driver/ToolChains/Cuda.cpp
++++ b/lib/Driver/ToolChains/Cuda.cpp
+@@ -60,6 +60,9 @@ CudaInstallationDetector::CudaInstallationDetector(
+     const Driver &D, const llvm::Triple &HostTriple,
+     const llvm::opt::ArgList &Args)
+     : D(D) {
++  // Don't look for CUDA in /usr.
++  return;
++
+   struct Candidate {
+     std::string Path;
+     bool StrictChecking;
 diff --git a/lib/Driver/ToolChains/Linux.cpp b/lib/Driver/ToolChains/Linux.cpp
-index bff1ab10..79e1477e 100644
+index bff1ab10..e996d3b8 100644
 --- a/lib/Driver/ToolChains/Linux.cpp
 +++ b/lib/Driver/ToolChains/Linux.cpp
 @@ -240,6 +240,9 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
                           .str());
    }
  
-+// Comment out the distro-specific tweaks so that they don't bite when
-+// using Guix on a foreign distro.
++  // Comment out the distro-specific tweaks so that they don't bite when
++  // using Guix on a foreign distro.
 +#if 0
    Distro Distro(D.getVFS(), Triple);
  
@@ -24,61 +53,41 @@ index bff1ab10..79e1477e 100644
  
    if (IsAndroid || Distro.IsOpenSUSE())
      ExtraOpts.push_back("--enable-new-dtags");
-+#endif	// Guix
++#endif
  
    // The selection of paths to try here is designed to match the patterns which
    // the GCC driver itself uses, as this is part of the GCC-compatible driver.
-@@ -363,7 +367,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
-     // the cross. Note that GCC does include some of these directories in some
-     // configurations but this seems somewhere between questionable and simply
-     // a bug.
--    if (StringRef(LibPath).startswith(SysRoot)) {
-+    if (0) {
-       addPathIfExists(D, LibPath + "/" + MultiarchTriple, Paths);
-       addPathIfExists(D, LibPath + "/../" + OSLibDir, Paths);
+@@ -369,6 +373,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
      }
-@@ -382,6 +386,8 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
-   addPathIfExists(D, SysRoot + "/lib/" + MultiarchTriple, Paths);
-   addPathIfExists(D, SysRoot + "/lib/../" + OSLibDir, Paths);
- 
-+// This requires the commented distro tweaks above.
-+#if 0
-   if (IsAndroid) {
-     // Android sysroots contain a library directory for each supported OS
-     // version as well as some unversioned libraries in the usual multiarch
-@@ -410,10 +416,15 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
-     addPathIfExists(D, SysRoot + "/" + OSLibDir + "/" + ABIName, Paths);
-     addPathIfExists(D, SysRoot + "/usr/" + OSLibDir + "/" + ABIName, Paths);
    }
-+#endif
  
++#if 0
+   // Similar to the logic for GCC above, if we currently running Clang inside
+   // of the requested system root, add its parent library paths to
+   // those searched.
+@@ -414,6 +419,8 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
    // Try walking via the GCC triple path in case of biarch or multiarch GCC
    // installations with strange symlinks.
    if (GCCInstallation.isValid()) {
-+
-+// The following code would end up adding things like
-+// "/usr/lib/x86_64-unknown-linux-gnu/../../lib64" to the search path.
-+#if 0
++    // The following code would end up adding things like
++    // "/usr/lib/x86_64-unknown-linux-gnu/../../lib64" to the search path.
      addPathIfExists(D,
                      SysRoot + "/usr/lib/" + GCCInstallation.getTriple().str() +
                          "/../../" + OSLibDir,
-@@ -426,6 +437,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
-                              BiarchSibling.gccSuffix(),
-                       Paths);
-     }
-+#endif
- 
-     // See comments above on the multilib variant for details of why this is
-     // included even from outside the sysroot.
-@@ -450,8 +462,9 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
+@@ -449,9 +456,14 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
+   // directory ('Dir' below) or the ResourceDir.
    if (StringRef(D.Dir).startswith(SysRoot))
      addPathIfExists(D, D.Dir + "/../lib", Paths);
- 
--  addPathIfExists(D, SysRoot + "/lib", Paths);
--  addPathIfExists(D, SysRoot + "/usr/lib", Paths);
++#endif
++
 +  // Add libc's lib/ directory to the search path, so that crt1.o, crti.o,
 +  // and friends can be found.
 +  addPathIfExists(D, "@GLIBC_LIBDIR@", Paths);
+ 
+-  addPathIfExists(D, SysRoot + "/lib", Paths);
+-  addPathIfExists(D, SysRoot + "/usr/lib", Paths);
++  // Add GCC's lib/ directory so libstdc++.so can be found.
++  addPathIfExists(D, GCCInstallation.getParentLibPath(), Paths);
  }
  
  ToolChain::CXXStdlibType Linux::GetDefaultCXXStdlibType() const {
diff --git a/gnu/packages/patches/clang-11.0-libc-search-path.patch b/gnu/packages/patches/clang-11.0-libc-search-path.patch
index c014de179d..d0581d3a29 100644
--- a/gnu/packages/patches/clang-11.0-libc-search-path.patch
+++ b/gnu/packages/patches/clang-11.0-libc-search-path.patch
@@ -4,48 +4,47 @@ but unfortunately, that doesn't work for us.
 This patch makes it easy to insert libc's $libdir so that Clang passes the
 correct absolute file name of crt1.o etc. to 'ld'.  It also disables all
 the distro-specific stuff and removes the hard-coded FHS directory names
-to make sure Clang also works on non-Guix systems.
+to make sure Clang also works on foreign distros.
 
-diff --git a/lib/Driver/ToolChains/Gnu.cpp b/lib/Driver/ToolChains/Gnu.cpp
---- a/lib/Driver/ToolChains/Gnu.cpp
-+++ b/lib/Driver/ToolChains/Gnu.cpp
-@@ -2797,7 +2797,7 @@ void Generic_GCC::AddMultilibPaths(const Driver &D,
-     // the cross. Note that GCC does include some of these directories in some
-     // configurations but this seems somewhere between questionable and simply
-     // a bug.
--    if (StringRef(LibPath).startswith(SysRoot)) {
-+    if (0) {
-       addPathIfExists(D, LibPath + "/" + MultiarchTriple, Paths);
-       addPathIfExists(D, LibPath + "/../" + OSLibDir, Paths);
-     }
-@@ -2811,6 +2811,10 @@ void Generic_GCC::AddMultiarchPaths(const Driver &D,
-   // Try walking via the GCC triple path in case of biarch or multiarch GCC
-   // installations with strange symlinks.
-   if (GCCInstallation.isValid()) {
-+
-+// The following code would end up adding things like
-+// "/usr/lib/x86_64-unknown-linux-gnu/../../lib64" to the search path.
-+#if 0
-     addPathIfExists(D,
-                     SysRoot + "/usr/lib/" + GCCInstallation.getTriple().str() +
-                         "/../../" + OSLibDir,
-@@ -2823,6 +2827,7 @@ void Generic_GCC::AddMultiarchPaths(const Driver &D,
-           D, GCCInstallation.getInstallPath() + BiarchSibling.gccSuffix(),
-                       Paths);
-     }
-+#endif // Guix
+diff --git a/lib/Driver/Distro.cpp b/lib/Driver/Distro.cpp
+index 4d58ad1a..6f638eca 100644
+--- a/lib/Driver/Distro.cpp
++++ b/lib/Driver/Distro.cpp
+@@ -21,6 +21,10 @@ using namespace clang;
  
-     // See comments above on the multilib variant for details of why this is
-     // included even from outside the sysroot.
+ static Distro::DistroType DetectDistro(llvm::vfs::FileSystem &VFS,
+                                        const llvm::Triple &TargetOrHost) {
++  // The compiler should always behave the same, even when used via Guix on a
++  // foreign distro.
++  return Distro::UnknownDistro;
++
+   // If we don't target Linux, no need to check the distro. This saves a few
+   // OS calls.
+   if (!TargetOrHost.isOSLinux())
+diff --git a/lib/Driver/ToolChains/Cuda.cpp b/lib/Driver/ToolChains/Cuda.cpp
+index 110a0bca..42b9f7b7 100644
+--- a/lib/Driver/ToolChains/Cuda.cpp
++++ b/lib/Driver/ToolChains/Cuda.cpp
+@@ -67,6 +67,9 @@ CudaInstallationDetector::CudaInstallationDetector(
+     const Driver &D, const llvm::Triple &HostTriple,
+     const llvm::opt::ArgList &Args)
+     : D(D) {
++  // Don't look for CUDA in /usr.
++  return;
++
+   struct Candidate {
+     std::string Path;
+     bool StrictChecking;
 diff --git a/lib/Driver/ToolChains/Linux.cpp b/lib/Driver/ToolChains/Linux.cpp
+index 18035047..ace8f443 100644
 --- a/lib/Driver/ToolChains/Linux.cpp
 +++ b/lib/Driver/ToolChains/Linux.cpp
 @@ -219,6 +219,9 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
  
    Generic_GCC::PushPPaths(PPaths);
  
-+// Comment out the distro-specific tweaks so that they don't bite when
-+// using Guix on a foreign distro.
++  // Comment out the distro-specific tweaks so that they don't bite when
++  // using Guix on a foreign distro.
 +#if 0
    Distro Distro(D.getVFS(), Triple);
  
@@ -54,36 +53,32 @@ diff --git a/lib/Driver/ToolChains/Linux.cpp b/lib/Driver/ToolChains/Linux.cpp
  
    if (IsAndroid || Distro.IsOpenSUSE())
      ExtraOpts.push_back("--enable-new-dtags");
-+#endif	// Guix
++#endif
  
    // The selection of paths to try here is designed to match the patterns which
    // the GCC driver itself uses, as this is part of the GCC-compatible driver.
-@@ -310,6 +314,8 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
-   addPathIfExists(D, SysRoot + "/lib/" + MultiarchTriple, Paths);
-   addPathIfExists(D, SysRoot + "/lib/../" + OSLibDir, Paths);
+@@ -297,6 +301,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
  
-+// This requires the commented distro tweaks above.
-+#if 0
-   if (IsAndroid) {
-     // Android sysroots contain a library directory for each supported OS
-     // version as well as some unversioned libraries in the usual multiarch
-@@ -338,6 +344,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
-     addPathIfExists(D, SysRoot + "/" + OSLibDir + "/" + ABIName, Paths);
-     addPathIfExists(D, SysRoot + "/usr/" + OSLibDir + "/" + ABIName, Paths);
-   }
-+#endif // Guix
- 
-   Generic_GCC::AddMultiarchPaths(D, SysRoot, OSLibDir, Paths);
+   Generic_GCC::AddMultilibPaths(D, SysRoot, OSLibDir, MultiarchTriple, Paths);
  
-@@ -349,8 +356,9 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
++#if 0
+   // Similar to the logic for GCC above, if we currently running Clang inside
+   // of the requested system root, add its parent library paths to
+   // those searched.
+@@ -348,9 +353,14 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
+   // directory ('Dir' below) or the ResourceDir.
    if (StringRef(D.Dir).startswith(SysRoot))
      addPathIfExists(D, D.Dir + "/../lib", Paths);
- 
--  addPathIfExists(D, SysRoot + "/lib", Paths);
--  addPathIfExists(D, SysRoot + "/usr/lib", Paths);
++#endif
++
 +  // Add libc's lib/ directory to the search path, so that crt1.o, crti.o,
 +  // and friends can be found.
 +  addPathIfExists(D, "@GLIBC_LIBDIR@", Paths);
+ 
+-  addPathIfExists(D, SysRoot + "/lib", Paths);
+-  addPathIfExists(D, SysRoot + "/usr/lib", Paths);
++  // Add GCC's lib/ directory so libstdc++.so can be found.
++  addPathIfExists(D, GCCInstallation.getParentLibPath(), Paths);
  }
  
  ToolChain::CXXStdlibType Linux::GetDefaultCXXStdlibType() const {
diff --git a/gnu/packages/patches/clang-12.0-libc-search-path.patch b/gnu/packages/patches/clang-12.0-libc-search-path.patch
new file mode 100644
index 0000000000..38de275048
--- /dev/null
+++ b/gnu/packages/patches/clang-12.0-libc-search-path.patch
@@ -0,0 +1,84 @@
+Clang attempts to guess file names based on the OS and distro (yes!),
+but unfortunately, that doesn't work for us.
+
+This patch makes it easy to insert libc's $libdir so that Clang passes the
+correct absolute file name of crt1.o etc. to 'ld'.  It also disables all
+the distro-specific stuff and removes the hard-coded FHS directory names
+to make sure Clang also works on foreign distros.
+
+diff --git a/lib/Driver/Distro.cpp b/lib/Driver/Distro.cpp
+index ee4fe841..f0313bbe 100644
+--- a/lib/Driver/Distro.cpp
++++ b/lib/Driver/Distro.cpp
+@@ -93,6 +93,10 @@ static Distro::DistroType DetectLsbRelease(llvm::vfs::FileSystem &VFS) {
+ }
+ 
+ static Distro::DistroType DetectDistro(llvm::vfs::FileSystem &VFS) {
++  // The compiler should always behave the same, even when used via Guix on a
++  // foreign distro.
++  return Distro::UnknownDistro;
++
+   Distro::DistroType Version = Distro::UnknownDistro;
+ 
+   // Newer freedesktop.org's compilant systemd-based systems
+diff --git a/lib/Driver/ToolChains/Cuda.cpp b/lib/Driver/ToolChains/Cuda.cpp
+index d14776c5..88bc3ccd 100644
+--- a/lib/Driver/ToolChains/Cuda.cpp
++++ b/lib/Driver/ToolChains/Cuda.cpp
+@@ -119,6 +119,9 @@ CudaInstallationDetector::CudaInstallationDetector(
+     const Driver &D, const llvm::Triple &HostTriple,
+     const llvm::opt::ArgList &Args)
+     : D(D) {
++  // Don't look for CUDA in /usr.
++  return;
++
+   struct Candidate {
+     std::string Path;
+     bool StrictChecking;
+diff --git a/lib/Driver/ToolChains/Linux.cpp b/lib/Driver/ToolChains/Linux.cpp
+index 9663a739..107f96d6 100644
+--- a/lib/Driver/ToolChains/Linux.cpp
++++ b/lib/Driver/ToolChains/Linux.cpp
+@@ -223,6 +223,9 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
+ 
+   Generic_GCC::PushPPaths(PPaths);
+ 
++  // Comment out the distro-specific tweaks so that they don't bite when
++  // using Guix on a foreign distro.
++#if 0
+   Distro Distro(D.getVFS(), Triple);
+ 
+   if (Distro.IsAlpineLinux() || Triple.isAndroid()) {
+@@ -288,6 +291,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
+ 
+   if (IsAndroid || Distro.IsOpenSUSE())
+     ExtraOpts.push_back("--enable-new-dtags");
++#endif
+ 
+   // The selection of paths to try here is designed to match the patterns which
+   // the GCC driver itself uses, as this is part of the GCC-compatible driver.
+@@ -301,6 +305,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
+ 
+   Generic_GCC::AddMultilibPaths(D, SysRoot, OSLibDir, MultiarchTriple, Paths);
+ 
++#if 0
+   // Similar to the logic for GCC above, if we currently running Clang inside
+   // of the requested system root, add its parent library paths to
+   // those searched.
+@@ -352,9 +357,14 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
+   // directory ('Dir' below) or the ResourceDir.
+   if (StringRef(D.Dir).startswith(SysRoot))
+     addPathIfExists(D, D.Dir + "/../lib", Paths);
++#endif
++
++  // Add libc's lib/ directory to the search path, so that crt1.o, crti.o,
++  // and friends can be found.
++  addPathIfExists(D, "@GLIBC_LIBDIR@", Paths);
+ 
+-  addPathIfExists(D, SysRoot + "/lib", Paths);
+-  addPathIfExists(D, SysRoot + "/usr/lib", Paths);
++  // Add GCC's lib/ directory so libstdc++.so can be found.
++  addPathIfExists(D, GCCInstallation.getParentLibPath(), Paths);
+ }
+ 
+ ToolChain::CXXStdlibType Linux::GetDefaultCXXStdlibType() const {
diff --git a/gnu/packages/patches/clang-13.0-libc-search-path.patch b/gnu/packages/patches/clang-13.0-libc-search-path.patch
new file mode 100644
index 0000000000..77303e636d
--- /dev/null
+++ b/gnu/packages/patches/clang-13.0-libc-search-path.patch
@@ -0,0 +1,96 @@
+Clang attempts to guess file names based on the OS and distro (yes!),
+but unfortunately, that doesn't work for us.
+
+This patch makes it easy to insert libc's $libdir so that Clang passes the
+correct absolute file name of crt1.o etc. to 'ld'.  It also disables all
+the distro-specific stuff and removes the hard-coded FHS directory names
+to make sure Clang also works on foreign distros.
+
+diff --git a/lib/Driver/Distro.cpp b/lib/Driver/Distro.cpp
+index ee4fe841..f0313bbe 100644
+--- a/lib/Driver/Distro.cpp
++++ b/lib/Driver/Distro.cpp
+@@ -93,6 +93,10 @@ static Distro::DistroType DetectLsbRelease(llvm::vfs::FileSystem &VFS) {
+ }
+ 
+ static Distro::DistroType DetectDistro(llvm::vfs::FileSystem &VFS) {
++  // The compiler should always behave the same, even when used via Guix on a
++  // foreign distro.
++  return Distro::UnknownDistro;
++
+   Distro::DistroType Version = Distro::UnknownDistro;
+ 
+   // Newer freedesktop.org's compilant systemd-based systems
+diff --git a/lib/Driver/ToolChains/Cuda.cpp b/lib/Driver/ToolChains/Cuda.cpp
+index d14776c5..88bc3ccd 100644
+--- a/lib/Driver/ToolChains/Cuda.cpp
++++ b/lib/Driver/ToolChains/Cuda.cpp
+@@ -119,6 +119,9 @@ CudaInstallationDetector::CudaInstallationDetector(
+     const Driver &D, const llvm::Triple &HostTriple,
+     const llvm::opt::ArgList &Args)
+     : D(D) {
++  // Don't look for CUDA in /usr.
++  return;
++
+   struct Candidate {
+     std::string Path;
+     bool StrictChecking;
+diff --git a/lib/Driver/ToolChains/Linux.cpp b/lib/Driver/ToolChains/Linux.cpp
+--- a/lib/Driver/ToolChains/Linux.cpp
++++ b/lib/Driver/ToolChains/Linux.cpp
+@@ -186,6 +186,10 @@
+ 
+   Generic_GCC::PushPPaths(PPaths);
+ 
++  // Comment out the distro-specific tweaks so that they don't bite when
++  // using Guix on a foreign distro.
++#if 0
++
+   Distro Distro(D.getVFS(), Triple);
+ 
+   if (Distro.IsAlpineLinux() || Triple.isAndroid()) {
+@@ -251,6 +255,7 @@
+ 
+   if (IsAndroid || Distro.IsOpenSUSE())
+     ExtraOpts.push_back("--enable-new-dtags");
++#endif
+ 
+   // The selection of paths to try here is designed to match the patterns which
+   // the GCC driver itself uses, as this is part of the GCC-compatible driver.
+@@ -264,6 +269,7 @@
+ 
+   Generic_GCC::AddMultilibPaths(D, SysRoot, OSLibDir, MultiarchTriple, Paths);
+ 
++#if 0
+   addPathIfExists(D, SysRoot + "/lib/" + MultiarchTriple, Paths);
+   addPathIfExists(D, SysRoot + "/lib/../" + OSLibDir, Paths);
+ 
+@@ -295,9 +301,11 @@
+     addPathIfExists(D, SysRoot + "/" + OSLibDir + "/" + ABIName, Paths);
+     addPathIfExists(D, SysRoot + "/usr/" + OSLibDir + "/" + ABIName, Paths);
+   }
++#endif
+ 
+   Generic_GCC::AddMultiarchPaths(D, SysRoot, OSLibDir, Paths);
+ 
++#if 0
+   // Similar to the logic for GCC above, if we are currently running Clang
+   // inside of the requested system root, add its parent library path to those
+   // searched.
+@@ -305,9 +313,14 @@
+   // directory ('Dir' below) or the ResourceDir.
+   if (StringRef(D.Dir).startswith(SysRoot))
+     addPathIfExists(D, D.Dir + "/../lib", Paths);
++#endif
++
++  // Add libc's lib/ directory to the search path, so that crt1.o, crti.o,
++  // and friends can be found.
++  addPathIfExists(D, "@GLIBC_LIBDIR@", Paths);
+ 
+-  addPathIfExists(D, SysRoot + "/lib", Paths);
+-  addPathIfExists(D, SysRoot + "/usr/lib", Paths);
++  // Add GCC's lib/ directory so libstdc++.so can be found.
++  addPathIfExists(D, GCCInstallation.getParentLibPath(), Paths);
+ }
+ 
+ ToolChain::RuntimeLibType Linux::GetDefaultRuntimeLibType() const {
diff --git a/gnu/packages/patches/clang-7.0-libc-search-path.patch b/gnu/packages/patches/clang-7.0-libc-search-path.patch
index 07ff8c90bd..cb7088eda4 100644
--- a/gnu/packages/patches/clang-7.0-libc-search-path.patch
+++ b/gnu/packages/patches/clang-7.0-libc-search-path.patch
@@ -4,8 +4,39 @@ but unfortunately, that doesn't work for us.
 This patch makes it easy to insert libc's $libdir so that Clang passes the
 correct absolute file name of crt1.o etc. to 'ld'.  It also disables all
 the distro-specific stuff and removes the hard-coded FHS directory names
-to make sure Clang also works on non-GuixSD systems.
+to make sure Clang also works on foreign distros.
 
+diff --git a/lib/Driver/Distro.cpp b/lib/Driver/Distro.cpp
+index 2c4d44f..0493b0a 100644
+--- a/lib/Driver/Distro.cpp
++++ b/lib/Driver/Distro.cpp
+@@ -18,6 +18,10 @@ using namespace clang::driver;
+ using namespace clang;
+ 
+ static Distro::DistroType DetectDistro(vfs::FileSystem &VFS) {
++  // The compiler should always behave the same, even when used via Guix on a
++  // foreign distro.
++  return Distro::UnknownDistro;
++
+   llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> File =
+       VFS.getBufferForFile("/etc/lsb-release");
+   if (File) {
+diff --git a/lib/Driver/ToolChains/Cuda.cpp b/lib/Driver/ToolChains/Cuda.cpp
+index 7fb4ae4..cb21344 100644
+--- a/lib/Driver/ToolChains/Cuda.cpp
++++ b/lib/Driver/ToolChains/Cuda.cpp
+@@ -66,6 +66,9 @@ CudaInstallationDetector::CudaInstallationDetector(
+     const Driver &D, const llvm::Triple &HostTriple,
+     const llvm::opt::ArgList &Args)
+     : D(D) {
++  // Don't look for CUDA in /usr.
++  return;
++
+   struct Candidate {
+     std::string Path;
+     bool StrictChecking;
+diff --git a/lib/Driver/ToolChains/Linux.cpp b/lib/Driver/ToolChains/Linux.cpp
+index f8f3623..36dc722 100644
 --- a/lib/Driver/ToolChains/Linux.cpp
 +++ b/lib/Driver/ToolChains/Linux.cpp
 @@ -225,7 +225,9 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
@@ -27,56 +58,37 @@ to make sure Clang also works on non-GuixSD systems.
  
    // The selection of paths to try here is designed to match the patterns which
    // the GCC driver itself uses, as this is part of the GCC-compatible driver.
-@@ -342,7 +345,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
-     // the cross. Note that GCC does include some of these directories in some
-     // configurations but this seems somewhere between questionable and simply
-     // a bug.
--    if (StringRef(LibPath).startswith(SysRoot)) {
-+    if (0) {
-       addPathIfExists(D, LibPath + "/" + MultiarchTriple, Paths);
-       addPathIfExists(D, LibPath + "/../" + OSLibDir, Paths);
+@@ -348,6 +351,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
      }
-@@ -361,6 +364,8 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
-   addPathIfExists(D, SysRoot + "/lib/" + MultiarchTriple, Paths);
-   addPathIfExists(D, SysRoot + "/lib/../" + OSLibDir, Paths);
- 
-+  // This requires the commented distro tweaks above.
-+#if 0
-   if (IsAndroid) {
-     // Android sysroots contain a library directory for each supported OS
-     // version as well as some unversioned libraries in the usual multiarch
-@@ -389,10 +394,14 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
-     addPathIfExists(D, SysRoot + "/" + OSLibDir + "/" + ABIName, Paths);
-     addPathIfExists(D, SysRoot + "/usr/" + OSLibDir + "/" + ABIName, Paths);
    }
-+#endif
  
++#if 0
+   // Similar to the logic for GCC above, if we currently running Clang inside
+   // of the requested system root, add its parent library paths to
+   // those searched.
+@@ -393,6 +397,8 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
    // Try walking via the GCC triple path in case of biarch or multiarch GCC
    // installations with strange symlinks.
    if (GCCInstallation.isValid()) {
 +    // The following code would end up adding things like
 +    // "/usr/lib/x86_64-unknown-linux-gnu/../../lib64" to the search path.
-+#if 0
      addPathIfExists(D,
                      SysRoot + "/usr/lib/" + GCCInstallation.getTriple().str() +
                          "/../../" + OSLibDir,
-@@ -405,6 +414,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
-                              BiarchSibling.gccSuffix(),
-                       Paths);
-     }
-+#endif
- 
-     // See comments above on the multilib variant for details of why this is
-     // included even from outside the sysroot.
-@@ -429,8 +439,9 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
+@@ -428,9 +434,14 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
+   // directory ('Dir' below) or the ResourceDir.
    if (StringRef(D.Dir).startswith(SysRoot))
      addPathIfExists(D, D.Dir + "/../lib", Paths);
- 
--  addPathIfExists(D, SysRoot + "/lib", Paths);
--  addPathIfExists(D, SysRoot + "/usr/lib", Paths);
++#endif
++
 +  // Add libc's lib/ directory to the search path, so that crt1.o, crti.o,
 +  // and friends can be found.
 +  addPathIfExists(D, "@GLIBC_LIBDIR@", Paths);
+ 
+-  addPathIfExists(D, SysRoot + "/lib", Paths);
+-  addPathIfExists(D, SysRoot + "/usr/lib", Paths);
++  // Add GCC's lib/ directory so libstdc++.so can be found.
++  addPathIfExists(D, GCCInstallation.getParentLibPath(), Paths);
  }
  
  bool Linux::HasNativeLLVMSupport() const { return true; }
diff --git a/gnu/packages/patches/clang-8.0-libc-search-path.patch b/gnu/packages/patches/clang-8.0-libc-search-path.patch
new file mode 100644
index 0000000000..2003fef217
--- /dev/null
+++ b/gnu/packages/patches/clang-8.0-libc-search-path.patch
@@ -0,0 +1,94 @@
+Clang attempts to guess file names based on the OS and distro (yes!),
+but unfortunately, that doesn't work for us.
+
+This patch makes it easy to insert libc's $libdir so that Clang passes the
+correct absolute file name of crt1.o etc. to 'ld'.  It also disables all
+the distro-specific stuff and removes the hard-coded FHS directory names
+to make sure Clang also works on foreign distros.
+
+diff --git a/lib/Driver/Distro.cpp b/lib/Driver/Distro.cpp
+index 396d0bee..90e06613 100644
+--- a/lib/Driver/Distro.cpp
++++ b/lib/Driver/Distro.cpp
+@@ -19,6 +19,10 @@ using namespace clang::driver;
+ using namespace clang;
+ 
+ static Distro::DistroType DetectDistro(llvm::vfs::FileSystem &VFS) {
++  // The compiler should always behave the same, even when used via Guix on a
++  // foreign distro.
++  return Distro::UnknownDistro;
++
+   llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> File =
+       VFS.getBufferForFile("/etc/lsb-release");
+   if (File) {
+diff --git a/lib/Driver/ToolChains/Cuda.cpp b/lib/Driver/ToolChains/Cuda.cpp
+index 57b8d434..57339f1a 100644
+--- a/lib/Driver/ToolChains/Cuda.cpp
++++ b/lib/Driver/ToolChains/Cuda.cpp
+@@ -68,6 +68,9 @@ CudaInstallationDetector::CudaInstallationDetector(
+     const Driver &D, const llvm::Triple &HostTriple,
+     const llvm::opt::ArgList &Args)
+     : D(D) {
++  // Don't look for CUDA in /usr.
++  return;
++
+   struct Candidate {
+     std::string Path;
+     bool StrictChecking;
+diff --git a/lib/Driver/ToolChains/Linux.cpp b/lib/Driver/ToolChains/Linux.cpp
+index 65ab9b2d..5ed28e0a 100644
+--- a/lib/Driver/ToolChains/Linux.cpp
++++ b/lib/Driver/ToolChains/Linux.cpp
+@@ -233,7 +233,9 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
+   PPaths.push_back(Twine(GCCInstallation.getParentLibPath() + "/../" +
+                          GCCInstallation.getTriple().str() + "/bin")
+                        .str());
+-
++  // Comment out the distro-specific tweaks so that they don't bite when
++  // using Guix on a foreign distro.
++#if 0
+   Distro Distro(D.getVFS());
+ 
+   if (Distro.IsAlpineLinux() || Triple.isAndroid()) {
+@@ -304,6 +306,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
+ 
+   if (IsAndroid || Distro.IsOpenSUSE())
+     ExtraOpts.push_back("--enable-new-dtags");
++#endif
+ 
+   // The selection of paths to try here is designed to match the patterns which
+   // the GCC driver itself uses, as this is part of the GCC-compatible driver.
+@@ -366,6 +369,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
+     }
+   }
+ 
++#if 0
+   // Similar to the logic for GCC above, if we currently running Clang inside
+   // of the requested system root, add its parent library paths to
+   // those searched.
+@@ -411,6 +415,8 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
+   // Try walking via the GCC triple path in case of biarch or multiarch GCC
+   // installations with strange symlinks.
+   if (GCCInstallation.isValid()) {
++    // The following code would end up adding things like
++    // "/usr/lib/x86_64-unknown-linux-gnu/../../lib64" to the search path.
+     addPathIfExists(D,
+                     SysRoot + "/usr/lib/" + GCCInstallation.getTriple().str() +
+                         "/../../" + OSLibDir,
+@@ -446,9 +452,14 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
+   // directory ('Dir' below) or the ResourceDir.
+   if (StringRef(D.Dir).startswith(SysRoot))
+     addPathIfExists(D, D.Dir + "/../lib", Paths);
++#endif
++
++  // Add libc's lib/ directory to the search path, so that crt1.o, crti.o,
++  // and friends can be found.
++  addPathIfExists(D, "@GLIBC_LIBDIR@", Paths);
+ 
+-  addPathIfExists(D, SysRoot + "/lib", Paths);
+-  addPathIfExists(D, SysRoot + "/usr/lib", Paths);
++  // Add GCC's lib/ directory so libstdc++.so can be found.
++  addPathIfExists(D, GCCInstallation.getParentLibPath(), Paths);
+ }
+ 
+ ToolChain::CXXStdlibType Linux::GetDefaultCXXStdlibType() const {
diff --git a/gnu/packages/patches/clang-9.0-libc-search-path.patch b/gnu/packages/patches/clang-9.0-libc-search-path.patch
index be34344842..1984895a9c 100644
--- a/gnu/packages/patches/clang-9.0-libc-search-path.patch
+++ b/gnu/packages/patches/clang-9.0-libc-search-path.patch
@@ -4,17 +4,47 @@ but unfortunately, that doesn't work for us.
 This patch makes it easy to insert libc's $libdir so that Clang passes the
 correct absolute file name of crt1.o etc. to 'ld'.  It also disables all
 the distro-specific stuff and removes the hard-coded FHS directory names
-to make sure Clang also works on non-GuixSD systems.
+to make sure Clang also works on foreign distros.
 
+diff --git a/lib/Driver/Distro.cpp b/lib/Driver/Distro.cpp
+index f2a3074d..536db89c 100644
+--- a/lib/Driver/Distro.cpp
++++ b/lib/Driver/Distro.cpp
+@@ -18,6 +18,10 @@ using namespace clang::driver;
+ using namespace clang;
+ 
+ static Distro::DistroType DetectDistro(llvm::vfs::FileSystem &VFS) {
++  // The compiler should always behave the same, even when used via Guix on a
++  // foreign distro.
++  return Distro::UnknownDistro;
++
+   llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> File =
+       VFS.getBufferForFile("/etc/lsb-release");
+   if (File) {
+diff --git a/lib/Driver/ToolChains/Cuda.cpp b/lib/Driver/ToolChains/Cuda.cpp
+index 96f8c513..64fd7a26 100644
+--- a/lib/Driver/ToolChains/Cuda.cpp
++++ b/lib/Driver/ToolChains/Cuda.cpp
+@@ -69,6 +69,9 @@ CudaInstallationDetector::CudaInstallationDetector(
+     const Driver &D, const llvm::Triple &HostTriple,
+     const llvm::opt::ArgList &Args)
+     : D(D) {
++  // Don't look for CUDA in /usr.
++  return;
++
+   struct Candidate {
+     std::string Path;
+     bool StrictChecking;
 diff --git a/lib/Driver/ToolChains/Linux.cpp b/lib/Driver/ToolChains/Linux.cpp
+index 7f59bc77..67d8ce22 100644
 --- a/lib/Driver/ToolChains/Linux.cpp
 +++ b/lib/Driver/ToolChains/Linux.cpp
 @@ -240,6 +240,9 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
                           .str());
    }
  
-+// Comment out the distro-specific tweaks so that they don't bite when
-+// using Guix on a foreign distro.
++  // Comment out the distro-specific tweaks so that they don't bite when
++  // using Guix on a foreign distro.
 +#if 0
    Distro Distro(D.getVFS());
  
@@ -27,57 +57,37 @@ diff --git a/lib/Driver/ToolChains/Linux.cpp b/lib/Driver/ToolChains/Linux.cpp
  
    // The selection of paths to try here is designed to match the patterns which
    // the GCC driver itself uses, as this is part of the GCC-compatible driver.
-@@ -363,7 +367,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
-     // the cross. Note that GCC does include some of these directories in some
-     // configurations but this seems somewhere between questionable and simply
-     // a bug.
--    if (StringRef(LibPath).startswith(SysRoot)) {
-+    if (0) {
-       addPathIfExists(D, LibPath + "/" + MultiarchTriple, Paths);
-       addPathIfExists(D, LibPath + "/../" + OSLibDir, Paths);
+@@ -369,6 +373,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
      }
-@@ -382,6 +386,8 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
-   addPathIfExists(D, SysRoot + "/lib/" + MultiarchTriple, Paths);
-   addPathIfExists(D, SysRoot + "/lib/../" + OSLibDir, Paths);
- 
-+// This requires the commented distro tweaks above.
-+#if 0
-   if (IsAndroid) {
-     // Android sysroots contain a library directory for each supported OS
-     // version as well as some unversioned libraries in the usual multiarch
-@@ -410,10 +416,15 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
-     addPathIfExists(D, SysRoot + "/" + OSLibDir + "/" + ABIName, Paths);
-     addPathIfExists(D, SysRoot + "/usr/" + OSLibDir + "/" + ABIName, Paths);
    }
-+#endif
  
++#if 0
+   // Similar to the logic for GCC above, if we currently running Clang inside
+   // of the requested system root, add its parent library paths to
+   // those searched.
+@@ -414,6 +419,8 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
    // Try walking via the GCC triple path in case of biarch or multiarch GCC
    // installations with strange symlinks.
    if (GCCInstallation.isValid()) {
-+
-+// The following code would end up adding things like
-+// "/usr/lib/x86_64-unknown-linux-gnu/../../lib64" to the search path.
-+#if 0
++    // The following code would end up adding things like
++    // "/usr/lib/x86_64-unknown-linux-gnu/../../lib64" to the search path.
      addPathIfExists(D,
                      SysRoot + "/usr/lib/" + GCCInstallation.getTriple().str() +
                          "/../../" + OSLibDir,
-@@ -426,6 +437,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
-                              BiarchSibling.gccSuffix(),
-                       Paths);
-     }
-+#endif
- 
-     // See comments above on the multilib variant for details of why this is
-     // included even from outside the sysroot.
-@@ -450,8 +462,9 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
+@@ -449,9 +456,14 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
+   // directory ('Dir' below) or the ResourceDir.
    if (StringRef(D.Dir).startswith(SysRoot))
      addPathIfExists(D, D.Dir + "/../lib", Paths);
- 
--  addPathIfExists(D, SysRoot + "/lib", Paths);
--  addPathIfExists(D, SysRoot + "/usr/lib", Paths);
++#endif
++
 +  // Add libc's lib/ directory to the search path, so that crt1.o, crti.o,
 +  // and friends can be found.
 +  addPathIfExists(D, "@GLIBC_LIBDIR@", Paths);
+ 
+-  addPathIfExists(D, SysRoot + "/lib", Paths);
+-  addPathIfExists(D, SysRoot + "/usr/lib", Paths);
++  // Add GCC's lib/ directory so libstdc++.so can be found.
++  addPathIfExists(D, GCCInstallation.getParentLibPath(), Paths);
  }
  
  ToolChain::CXXStdlibType Linux::GetDefaultCXXStdlibType() const {
diff --git a/gnu/packages/patches/classpath-miscompilation.patch b/gnu/packages/patches/classpath-miscompilation.patch
new file mode 100644
index 0000000000..c3a569ea4f
--- /dev/null
+++ b/gnu/packages/patches/classpath-miscompilation.patch
@@ -0,0 +1,71 @@
+For some reason, the original code gets miscompiled on x86_64, leading
+'Java_java_io_VMFile_isFile' to return true when the return value of
+'cpio_checkType' is ENOENT (= 2).
+
+See <https://issues.guix.gnu.org/issue/36685>
+and <https://issues.guix.gnu.org/49990>.
+
+diff --git a/native/jni/java-io/java_io_VMFile.c b/native/jni/java-io/java_io_VMFile.c
+index de1320b..6695e1f 100644
+--- a/native/jni/java-io/java_io_VMFile.c
++++ b/native/jni/java-io/java_io_VMFile.c
+@@ -240,6 +240,7 @@ Java_java_io_VMFile_exists (JNIEnv * env,
+ #ifndef WITHOUT_FILESYSTEM
+   const char *filename;
+   int result;
++  jboolean exists;
+ 
+   /* Don't use the JCL convert function because it throws an exception
+      on failure */
+@@ -250,9 +251,10 @@ Java_java_io_VMFile_exists (JNIEnv * env,
+     }
+ 
+   result = cpio_isFileExists (filename);
++  exists = (result == CPNATIVE_OK ? 1 : 0);
+   (*env)->ReleaseStringUTFChars (env, name, filename);
+ 
+-  return result == CPNATIVE_OK ? 1 : 0;
++  return exists;
+ #else /* not WITHOUT_FILESYSTEM */
+   return 0;
+ #endif /* not WITHOUT_FILESYSTEM */
+@@ -278,6 +280,7 @@ Java_java_io_VMFile_isFile (JNIEnv * env,
+   const char *filename;
+   int result;
+   jint entryType;
++  jboolean isfile;
+ 
+   /* Don't use the JCL convert function because it throws an exception
+      on failure */
+@@ -288,9 +291,10 @@ Java_java_io_VMFile_isFile (JNIEnv * env,
+     }
+ 
+   result = cpio_checkType (filename, &entryType);
++  isfile = (result == CPNATIVE_OK && entryType == CPFILE_FILE ? 1 : 0);
+   (*env)->ReleaseStringUTFChars (env, name, filename);
+ 
+-  return result == CPNATIVE_OK && entryType == CPFILE_FILE ? 1 : 0;
++  return isfile;
+ #else /* not WITHOUT_FILESYSTEM */
+   return 0;
+ #endif /* not WITHOUT_FILESYSTEM */
+@@ -315,6 +319,7 @@ Java_java_io_VMFile_isDirectory (JNIEnv * env,
+   const char *filename;
+   int result;
+   jint entryType;
++  jboolean isdirectory;
+ 
+   /* Don't use the JCL convert function because it throws an exception
+      on failure */
+@@ -325,9 +330,10 @@ Java_java_io_VMFile_isDirectory (JNIEnv * env,
+     }
+   
+   result = cpio_checkType (filename, &entryType);
++  isdirectory = (result == CPNATIVE_OK && entryType == CPFILE_DIRECTORY ? 1 : 0);
+   (*env)->ReleaseStringUTFChars (env, name, filename);
+ 
+-  return result == CPNATIVE_OK && entryType == CPFILE_DIRECTORY ? 1 : 0;
++  return isdirectory;
+ #else /* not WITHOUT_FILESYSTEM */
+   return 0;
+ #endif /* not WITHOUT_FILESYSTEM */
diff --git a/gnu/packages/patches/cling-use-shared-library.patch b/gnu/packages/patches/cling-use-shared-library.patch
new file mode 100644
index 0000000000..6385b307b3
--- /dev/null
+++ b/gnu/packages/patches/cling-use-shared-library.patch
@@ -0,0 +1,329 @@
+From 811f0a575231496318b5e9c9a0ff0ed195b16dc0 Mon Sep 17 00:00:00 2001
+From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
+Date: Tue, 7 Sep 2021 16:35:07 -0400
+Subject: [PATCH] build: Allow building Cling using the Clang shared library.
+
+The officially supported way to build LLVM/Clang as a shared library
+is via the LLVM_BUILD_LLVM_DYLIB and LLVM_LINK_LLVM_DYLIB CMake
+options (see: https://llvm.org/docs/BuildingADistribution.html).  When
+built this way, the whole of Clang API is exposed as a shared
+library (libclang-cpp.so).
+
+* CMakeLists.txt: Query if we're in shared mode via llvm-config, and
+register the result as LLVM_LIB_IS_SHARED.
+[LLVM_LIB_IS_SHARED] <target_link_libraries>: Use the PUBLIC interface of the
+LLVM shared library.
+* lib/Interpreter/CMakeLists.txt [LLVM_LIB_IS_SHARED]: When defined, replace the
+individual Clang components by clang-cpp.
+* lib/MetaProcessor/CMakeLists.txt: Likewise.
+* lib/Utils/CMakeLists.txt: Likewise.
+* tools/Jupyter/CMakeLists.txt: Likewise.
+* tools/driver/CMakeLists.txt: Likewise.
+* tools/libcling/CMakeLists.txt: Likewise.
+---
+ CMakeLists.txt                   | 10 ++++++--
+ lib/Interpreter/CMakeLists.txt   | 40 ++++++++++++++++++--------------
+ lib/MetaProcessor/CMakeLists.txt | 16 +++++++++----
+ lib/Utils/CMakeLists.txt         | 34 +++++++++++++++------------
+ tools/Jupyter/CMakeLists.txt     | 11 ++++++++-
+ tools/driver/CMakeLists.txt      | 16 +++----------
+ tools/libcling/CMakeLists.txt    | 38 +++++++++++++++---------------
+ 7 files changed, 93 insertions(+), 72 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 65b14b27..888f7ee9 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -23,6 +23,7 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
+       "--libdir"
+       "--includedir"
+       "--prefix"
++      "--shared-mode"
+       "--src-root")
+     execute_process(
+       COMMAND ${CONFIG_COMMAND}
+@@ -47,7 +48,8 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
+   list(GET CONFIG_OUTPUT 2 LIBRARY_DIR)
+   list(GET CONFIG_OUTPUT 3 INCLUDE_DIR)
+   list(GET CONFIG_OUTPUT 4 LLVM_OBJ_ROOT)
+-  list(GET CONFIG_OUTPUT 5 MAIN_SRC_DIR)
++  list(GET CONFIG_OUTPUT 5 LLVM_LIB_IS_SHARED)
++  list(GET CONFIG_OUTPUT 6 MAIN_SRC_DIR)
+ 
+   if(NOT MSVC_IDE)
+     set(LLVM_ENABLE_ASSERTIONS ${ENABLE_ASSERTIONS}
+@@ -427,7 +429,11 @@ macro(add_cling_library name)
+   endif()
+ 
+   if(TARGET ${name})
+-    target_link_libraries(${name} INTERFACE ${LLVM_COMMON_LIBS})
++      if(LLVM_LIB_IS_SHARED)
++          target_link_libraries(${name} PUBLIC LLVM)
++      else()
++          target_link_libraries(${name} INTERFACE ${LLVM_COMMON_LIBS})
++      endif()
+ 
+     if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "libcling")
+       install(TARGETS ${name}
+diff --git a/lib/Interpreter/CMakeLists.txt b/lib/Interpreter/CMakeLists.txt
+index 921c773c..af65c020 100644
+--- a/lib/Interpreter/CMakeLists.txt
++++ b/lib/Interpreter/CMakeLists.txt
+@@ -6,22 +6,28 @@
+ # LICENSE.TXT for details.
+ #------------------------------------------------------------------------------
+ 
+-set(LIBS
+-  clingUtils
+-  clangCodeGen
+-  clangDriver
+-  clangFrontend
+-  clangParse
+-  clangSema
+-  clangAnalysis
+-  clangEdit
+-  clangRewrite
+-  clangRewriteFrontend
+-  clangSerialization
+-  clangAST
+-  clangBasic
+-  clangLex
+-)
++if (LLVM_LIB_IS_SHARED)
++    set(LIBS
++        clang-cpp
++        clingUtils)
++else()
++    set(LIBS
++        clingUtils
++        clangCodeGen
++        clangDriver
++        clangFrontend
++        clangParse
++        clangSema
++        clangAnalysis
++        clangEdit
++        clangRewrite
++        clangRewriteFrontend
++        clangSerialization
++        clangAST
++        clangBasic
++        clangLex
++        )
++endif()
+ 
+ set(LLVM_LINK_COMPONENTS
+   analysis
+@@ -369,4 +375,4 @@ if ((NOT builtin_llvm) AND builtin_clang)
+   get_property(P SOURCE TransactionUnloader.cpp PROPERTY INCLUDE_DIRECTORIES)
+   list(INSERT P 0 ${FixInclude})
+   set_property(SOURCE TransactionUnloader.cpp PROPERTY INCLUDE_DIRECTORIES "${P}")
+-endif()
+\ No newline at end of file
++endif()
+diff --git a/lib/MetaProcessor/CMakeLists.txt b/lib/MetaProcessor/CMakeLists.txt
+index e753dca3..5f4641bb 100644
+--- a/lib/MetaProcessor/CMakeLists.txt
++++ b/lib/MetaProcessor/CMakeLists.txt
+@@ -10,7 +10,16 @@ set( LLVM_LINK_COMPONENTS
+   core
+   support
+   binaryformat
+-)
++  )
++
++if (LLVM_LIB_IS_SHARED)
++    set(LIBS clang-cpp)
++else()
++    set(LIBS
++        clangLex
++        clangAST
++        clangBasic)
++endif()
+ 
+ add_cling_library(clingMetaProcessor OBJECT
+   Display.cpp
+@@ -21,10 +30,7 @@ add_cling_library(clingMetaProcessor OBJECT
+   MetaSema.cpp
+ 
+   LINK_LIBS
+-  clangLex
+-  clangAST
+-  clangBasic
+-
++  ${LIBS}
+   clingInterpreter
+   clingUtils
+ )
+diff --git a/lib/Utils/CMakeLists.txt b/lib/Utils/CMakeLists.txt
+index 327c9fff..fbe4bd87 100644
+--- a/lib/Utils/CMakeLists.txt
++++ b/lib/Utils/CMakeLists.txt
+@@ -26,21 +26,25 @@ set(LLVM_LINK_COMPONENTS
+   ${LLVM_TARGETS_TO_BUILD}
+ )
+ 
+-set(LIBS
+-  clangCodeGen
+-  clangDriver
+-  clangFrontend
+-  clangParse
+-  clangSema
+-  clangAnalysis
+-  clangEdit
+-  clangRewrite
+-  clangRewriteFrontend
+-  clangSerialization
+-  clangAST
+-  clangBasic
+-  clangLex
+-)
++if (LLVM_LIB_IS_SHARED)
++    set(LIBS clang-cpp)
++else()
++    set(LIBS
++        clangCodeGen
++        clangDriver
++        clangFrontend
++        clangParse
++        clangSema
++        clangAnalysis
++        clangEdit
++        clangRewrite
++        clangRewriteFrontend
++        clangSerialization
++        clangAST
++        clangBasic
++        clangLex
++        )
++endif()
+ 
+ find_library(DL_LIBRARY_PATH dl)
+ if (DL_LIBRARY_PATH)
+diff --git a/tools/Jupyter/CMakeLists.txt b/tools/Jupyter/CMakeLists.txt
+index aad5f3f7..8b4ac36f 100644
+--- a/tools/Jupyter/CMakeLists.txt
++++ b/tools/Jupyter/CMakeLists.txt
+@@ -39,6 +39,14 @@ else()
+    endif()
+ endif()
+ 
++if (LLVM_LIB_IS_SHARED)
++    set(LIBS
++        clang-cpp
++        clingUserInterface
++        clingMetaProcessor
++        ${INTERPRETER}
++        clingUtils)
++else()
+ set(LIBS
+         clangAST
+         clangBasic
+@@ -54,7 +62,8 @@ set(LIBS
+         clingMetaProcessor
+         ${INTERPRETER}
+         clingUtils
+-    )
++        )
++endif()
+ 
+ if( LLVM_ENABLE_PIC )
+     set(ENABLE_SHARED SHARED)
+diff --git a/tools/driver/CMakeLists.txt b/tools/driver/CMakeLists.txt
+index 1968b97f..5ed53fb7 100644
+--- a/tools/driver/CMakeLists.txt
++++ b/tools/driver/CMakeLists.txt
+@@ -9,23 +9,13 @@
+ # Keep symbols for JIT resolution
+ set(LLVM_NO_DEAD_STRIP 1)
+ 
+-if(BUILD_SHARED_LIBS)
+-  set(LIBS
+-    LLVMSupport
+-
+-    clangFrontendTool
+-
+-    clingInterpreter
+-    clingMetaProcessor
+-    clingUserInterface
+-    clingUtils
+-  )
++if(LLVM_LIB_IS_SHARED)
++  set(LIBS clang-cpp clingUserInterface)
+   add_cling_executable(cling
+     cling.cpp
+   )
+ else()
+   set(LIBS
+-    LLVMSupport
+ 
+     clangASTMatchers
+     clangFrontendTool
+@@ -38,7 +28,7 @@ else()
+     $<TARGET_OBJECTS:obj.clingMetaProcessor>
+     $<TARGET_OBJECTS:obj.clingUtils>
+   )
+-endif(BUILD_SHARED_LIBS)
++endif(LLVM_LIB_IS_SHARED)
+ 
+ set_target_properties(cling
+   PROPERTIES ENABLE_EXPORTS 1)
+diff --git a/tools/libcling/CMakeLists.txt b/tools/libcling/CMakeLists.txt
+index 143d3bdb..ba000d44 100644
+--- a/tools/libcling/CMakeLists.txt
++++ b/tools/libcling/CMakeLists.txt
+@@ -10,21 +10,25 @@ set(SOURCES
+   ADDITIONAL_HEADERS
+   )
+ 
+-set(LIBS
+-  clangAnalysis
+-  clangDriver
+-  clangFrontend
+-  clangParse
+-  clangSema
+-  clangAST
+-  clangLex
+-  clangSerialization
+-  clangCodeGen
+-  clangBasic
+-  clangEdit
+-
+-  clingUtils
+-)
++if (LLVM_LIB_IS_SHARED)
++    set(LIBS clang-cpp)
++else()
++    set(LIBS
++        clangAnalysis
++        clangDriver
++        clangFrontend
++        clangParse
++        clangSema
++        clangAST
++        clangLex
++        clangSerialization
++        clangCodeGen
++        clangBasic
++        clangEdit
++
++        clingUtils
++        )
++endif()
+ 
+ set( LLVM_LINK_COMPONENTS
+   analysis
+@@ -63,10 +67,6 @@ option(LIBCLING_BUILD_STATIC
+ #  set(LLVM_EXPORTED_SYMBOL_FILE)
+ #endif()
+ 
+-if( LLVM_ENABLE_PIC )
+-  set(ENABLE_SHARED SHARED)
+-endif()
+-
+ if((NOT LLVM_ENABLE_PIC OR LIBCLING_BUILD_STATIC) AND NOT WIN32)
+   set(ENABLE_STATIC STATIC)
+ endif()
+-- 
+2.33.0
+
diff --git a/gnu/packages/patches/cool-retro-term-wctype.patch b/gnu/packages/patches/cool-retro-term-wctype.patch
new file mode 100644
index 0000000000..790b0c4453
--- /dev/null
+++ b/gnu/packages/patches/cool-retro-term-wctype.patch
@@ -0,0 +1,13 @@
+Submitted upstream at https://github.com/Swordfish90/cool-retro-term/issues/692
+
+--- a/qmltermwidget/lib/TerminalCharacterDecoder.cpp	1969-12-31 18:00:01.000000000 -0600
++++ b/qmltermwidget/lib/TerminalCharacterDecoder.cpp	2021-12-27 22:07:04.452256118 -0600
+@@ -19,6 +19,8 @@
+     02110-1301  USA.
+ */
+ 
++#include <cwctype>
++
+ // Own
+ #include "TerminalCharacterDecoder.h"
+ 
diff --git a/gnu/packages/patches/coq-fix-envvars.patch b/gnu/packages/patches/coq-fix-envvars.patch
new file mode 100644
index 0000000000..deecf5ce74
--- /dev/null
+++ b/gnu/packages/patches/coq-fix-envvars.patch
@@ -0,0 +1,139 @@
+From ebe09fcac72b21d17c4e8fe6edc1b6076a4ae97c Mon Sep 17 00:00:00 2001
+From: Julien Lepiller <julien@lepiller.eu>
+Date: Sun, 21 Nov 2021 00:38:03 +0100
+Subject: [PATCH] Fix environment variable usage.
+
+---
+ checker/checker.ml      |  2 ++
+ lib/envars.ml           | 26 ++++++++++++++++----------
+ sysinit/coqargs.ml      |  3 ++-
+ sysinit/coqloadpath.ml  |  3 ++-
+ sysinit/coqloadpath.mli |  2 +-
+ tools/coqdep.ml         |  2 +-
+ 6 files changed, 24 insertions(+), 14 deletions(-)
+
+diff --git a/checker/checker.ml b/checker/checker.ml
+index f55ed9e8d6..3b797729ed 100644
+--- a/checker/checker.ml
++++ b/checker/checker.ml
+@@ -104,6 +104,7 @@ let set_include d p =
+ (* Initializes the LoadPath *)
+ let init_load_path () =
+   let coqlib = Envars.coqlib () in
++  let coqcorelib = Envars.coqcorelib () in
+   let user_contrib = coqlib/"user-contrib" in
+   let xdg_dirs = Envars.xdg_dirs in
+   let coqpath = Envars.coqpath in
+@@ -111,6 +112,7 @@ let init_load_path () =
+     CPath.choose_existing
+       [ CPath.make [ coqlib ; "plugins" ]
+       ; CPath.make [ coqlib ; ".."; "coq-core"; "plugins" ]
++      ; CPath.make [ coqcorelib ; "plugins" ]
+       ] |> function
+     | None ->
+       CErrors.user_err (Pp.str "Cannot find plugins directory")
+diff --git a/lib/envars.ml b/lib/envars.ml
+index 750bd60e71..c7affbd437 100644
+--- a/lib/envars.ml
++++ b/lib/envars.ml
+@@ -127,15 +127,21 @@ let check_file_else ~dir ~file oth =
+ let guess_coqlib fail =
+   getenv_else "COQLIB" (fun () ->
+   let prelude = "theories/Init/Prelude.vo" in
+-  check_file_else ~dir:Coq_config.coqlibsuffix ~file:prelude
+-    (fun () ->
+-      if Sys.file_exists (Coq_config.coqlib / prelude)
+-      then Coq_config.coqlib
+-      else
+-        fail "cannot guess a path for Coq libraries; please use -coqlib option \
+-              or ensure you have installed the package containing Coq's stdlib (coq-stdlib in OPAM) \
+-              If you intend to use Coq without a standard library, the -boot -noinit options must be used.")
+-  )
++  let coqlibpath = getenv_else "COQLIBPATH" (fun () -> Coq_config.coqlibsuffix) in
++  let paths = path_to_list coqlibpath in
++  let valid_paths =
++    List.filter
++      (fun dir -> (check_file_else ~dir:dir ~file:prelude (fun () -> "")) <> "")
++      paths in
++  match valid_paths with
++  | [] ->
++    if Sys.file_exists (Coq_config.coqlib / prelude)
++    then Coq_config.coqlib
++    else
++      fail "cannot guess a path for Coq libraries; please use -coqlib option \
++            or ensure you have installed the package containing Coq's stdlib (coq-stdlib in OPAM) \
++            If you intend to use Coq without a standard library, the -boot -noinit options must be used."
++  | p::_ -> p)
+ 
+ let coqlib_ref : string option ref = ref None
+ let set_user_coqlib path = coqlib_ref := Some path
+@@ -208,7 +214,7 @@ let xdg_dirs ~warn =
+ let print_config ?(prefix_var_name="") f coq_src_subdirs =
+   let open Printf in
+   fprintf f "%sCOQLIB=%s/\n" prefix_var_name (coqlib ());
+-  fprintf f "%sCOQCORELIB=%s/\n" prefix_var_name (coqlib () / "../coq-core/");
++  fprintf f "%sCOQCORELIB=%s/\n" prefix_var_name (coqcorelib ());
+   fprintf f "%sDOCDIR=%s/\n" prefix_var_name (docdir ());
+   fprintf f "%sOCAMLFIND=%s\n" prefix_var_name (ocamlfind ());
+   fprintf f "%sCAMLFLAGS=%s\n" prefix_var_name Coq_config.caml_flags;
+diff --git a/sysinit/coqargs.ml b/sysinit/coqargs.ml
+index 00f70a5fea..8325623a63 100644
+--- a/sysinit/coqargs.ml
++++ b/sysinit/coqargs.ml
+@@ -453,7 +453,8 @@ let build_load_path opts =
+     if opts.pre.boot then [],[]
+     else
+       let coqlib = Envars.coqlib () in
+-      Coqloadpath.init_load_path ~coqlib in
++      let coqcorelib = Envars.coqcorelib () in
++      Coqloadpath.init_load_path ~coqlib ~coqcorelib in
+   ml_path @ opts.pre.ml_includes ,
+   vo_path @ opts.pre.vo_includes
+ 
+diff --git a/sysinit/coqloadpath.ml b/sysinit/coqloadpath.ml
+index 95ae5da3de..a58cfe6928 100644
+--- a/sysinit/coqloadpath.ml
++++ b/sysinit/coqloadpath.ml
+@@ -35,7 +35,7 @@ let build_userlib_path ~unix_path =
+   else [], []
+ 
+ (* LoadPath for Coq user libraries *)
+-let init_load_path ~coqlib =
++let init_load_path ~coqlib ~coqcorelib =
+ 
+   let open Loadpath in
+   let user_contrib = coqlib/"user-contrib" in
+@@ -50,6 +50,7 @@ let init_load_path ~coqlib =
+     CPath.choose_existing
+       [ CPath.make [ coqlib ; "plugins" ]
+       ; CPath.make [ coqlib ; ".."; "coq-core"; "plugins" ]
++      ; CPath.make [ coqcorelib ; "plugins" ]
+       ] |> function
+     | None ->
+       CErrors.user_err (Pp.str "Cannot find plugins directory")
+diff --git a/sysinit/coqloadpath.mli b/sysinit/coqloadpath.mli
+index d853e9ea54..43c6dfa134 100644
+--- a/sysinit/coqloadpath.mli
++++ b/sysinit/coqloadpath.mli
+@@ -12,5 +12,5 @@
+    includes (in-order) Coq's standard library, Coq's [user-contrib]
+    folder, and directories specified in [COQPATH] and [XDG_DIRS] *)
+ val init_load_path
+-  : coqlib:CUnix.physical_path
++  : coqlib:CUnix.physical_path -> coqcorelib:CUnix.physical_path
+   -> CUnix.physical_path list * Loadpath.vo_path list
+diff --git a/tools/coqdep.ml b/tools/coqdep.ml
+index c1c87993e1..6c78e10866 100644
+--- a/tools/coqdep.ml
++++ b/tools/coqdep.ml
+@@ -33,7 +33,7 @@ let coqdep () =
+     let coqlib = Envars.coqlib () in
+     let coq_plugins_dir = Filename.concat (Envars.coqcorelib ()) "plugins" in
+     if not (Sys.file_exists coq_plugins_dir) then
+-      CErrors.user_err Pp.(str "coqdep: cannot find plugins directory for coqlib: " ++ str coqlib ++ fnl ());
++      CErrors.user_err Pp.(str "coqdep: cannot find plugins directory " ++ str coq_plugins_dir ++ str " for coqlib: " ++ str coqlib ++ fnl ());
+     CD.add_rec_dir_import CD.add_coqlib_known (coqlib//"theories") ["Coq"];
+     CD.add_rec_dir_import CD.add_coqlib_known (coq_plugins_dir) ["Coq"];
+     let user = coqlib//"user-contrib" in
+-- 
+2.33.1
diff --git a/gnu/packages/patches/coreutils-gnulib-tests.patch b/gnu/packages/patches/coreutils-gnulib-tests.patch
new file mode 100644
index 0000000000..7142401202
--- /dev/null
+++ b/gnu/packages/patches/coreutils-gnulib-tests.patch
@@ -0,0 +1,45 @@
+Fix Gnulib test failures showing up on ARMv7:
+
+  https://issues.guix.gnu.org/49459
+
+This is a backport of this Gnulib commit:
+
+  commit 175e0bc72808d564074c4adcc72aeadb74adfcc6
+  Author: Paul Eggert <eggert@cs.ucla.edu>
+  Date:   Thu Aug 27 17:52:58 2020 -0700
+
+      perror, strerror_r: remove unportable tests
+
+      Problem reported by Florian Weimer in:
+      https://lists.gnu.org/r/bug-gnulib/2020-08/msg00220.html
+      * tests/test-perror2.c (main):
+      * tests/test-strerror_r.c (main): Omit unportable tests.
+
+diff --git a/tests/test-perror2.c b/tests/test-perror2.c
+index 1d14eda7be..c6214dd25c 100644
+--- a/gnulib-tests/test-perror2.c
++++ b/gnulib-tests/test-perror2.c
+@@ -79,9 +79,6 @@ main (void)
+     errno = -5;
+     perror ("");
+     ASSERT (!ferror (stderr));
+-    ASSERT (msg1 == msg2 || msg1 == msg4 || STREQ (msg1, str1));
+-    ASSERT (msg2 == msg4 || STREQ (msg2, str2));
+-    ASSERT (msg3 == msg4 || STREQ (msg3, str3));
+     ASSERT (STREQ (msg4, str4));
+ 
+     free (str1);
+diff --git a/tests/test-strerror_r.c b/tests/test-strerror_r.c
+index b11d6fd9f6..c1dbcf837b 100644
+--- a/gnulib-tests/test-strerror_r.c
++++ b/gnulib-tests/test-strerror_r.c
+@@ -165,9 +165,6 @@ main (void)
+ 
+     strerror_r (EACCES, buf, sizeof buf);
+     strerror_r (-5, buf, sizeof buf);
+-    ASSERT (msg1 == msg2 || msg1 == msg4 || STREQ (msg1, str1));
+-    ASSERT (msg2 == msg4 || STREQ (msg2, str2));
+-    ASSERT (msg3 == msg4 || STREQ (msg3, str3));
+     ASSERT (STREQ (msg4, str4));
+ 
+     free (str1);
diff --git a/gnu/packages/patches/cpufrequtils-fix-aclocal.patch b/gnu/packages/patches/cpufrequtils-fix-aclocal.patch
deleted file mode 100644
index be5767f462..0000000000
--- a/gnu/packages/patches/cpufrequtils-fix-aclocal.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-Add an extra layer of quoting to ltmain.sh sanity check.
-
---- a/configure	2005-05-07 14:19:31.000000000 +0200
-+++ b/configure	2015-02-10 11:16:32.456146934 +0100
-@@ -6266,7 +6266,7 @@
-   exit 1
- fi
- gentoo_lt_version="1.5.16"
--gentoo_ltmain_version=`grep '^[:space:]*VERSION=' $ltmain | sed -e 's|^[:space:]*VERSION=||'`
-+gentoo_ltmain_version=`grep '^[[:space:]]*VERSION=' $ltmain | sed -e 's|^[[:space:]]*VERSION=||'`
- if test "$gentoo_lt_version" != "$gentoo_ltmain_version"; then
-   echo "$as_me:$LINENO: result: no" >&5
- echo "${ECHO_T}no" >&6
---- a/aclocal.m4	2005-05-07 14:19:25.000000000 +0200
-+++ b/aclocal.m4	2015-02-10 11:16:15.352030318 +0100
-@@ -246,7 +246,7 @@
-   exit 1
- fi
- gentoo_lt_version="1.5.16"
--gentoo_ltmain_version=`grep '^[[:space:]]*VERSION=' $ltmain | sed -e 's|^[[:space:]]*VERSION=||'`
-+gentoo_ltmain_version=`[grep '^[[:space:]]*VERSION=' $ltmain | sed -e 's|^[[:space:]]*VERSION=||']`
- if test "$gentoo_lt_version" != "$gentoo_ltmain_version"; then
-   AC_MSG_RESULT(no)
-   echo
---- a/libcpufreq/configure	2005-05-07 14:19:31.000000000 +0200
-+++ b/libcpufreq/configure	2015-02-10 11:16:32.456146934 +0100
-@@ -6266,7 +6266,7 @@
-   exit 1
- fi
- gentoo_lt_version="1.5.16"
--gentoo_ltmain_version=`grep '^[:space:]*VERSION=' $ltmain | sed -e 's|^[:space:]*VERSION=||'`
-+gentoo_ltmain_version=`grep '^[[:space:]]*VERSION=' $ltmain | sed -e 's|^[[:space:]]*VERSION=||'`
- if test "$gentoo_lt_version" != "$gentoo_ltmain_version"; then
-   echo "$as_me:$LINENO: result: no" >&5
- echo "${ECHO_T}no" >&6
---- a/libcpufreq/aclocal.m4	2005-05-07 14:19:25.000000000 +0200
-+++ b/libcpufreq/aclocal.m4	2015-02-10 11:16:15.352030318 +0100
-@@ -246,7 +246,7 @@
-   exit 1
- fi
- gentoo_lt_version="1.5.16"
--gentoo_ltmain_version=`grep '^[[:space:]]*VERSION=' $ltmain | sed -e 's|^[[:space:]]*VERSION=||'`
-+gentoo_ltmain_version=`[grep '^[[:space:]]*VERSION=' $ltmain | sed -e 's|^[[:space:]]*VERSION=||']`
- if test "$gentoo_lt_version" != "$gentoo_ltmain_version"; then
-   AC_MSG_RESULT(no)
-   echo
diff --git a/gnu/packages/patches/cups-CVE-2020-10001.patch b/gnu/packages/patches/cups-CVE-2020-10001.patch
deleted file mode 100644
index 1b16c7d97c..0000000000
--- a/gnu/packages/patches/cups-CVE-2020-10001.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From efbea1742bd30f842fbbfb87a473e5c84f4162f9 Mon Sep 17 00:00:00 2001
-From: Michael R Sweet <msweet@msweet.org>
-Date: Mon, 1 Feb 2021 15:02:32 -0500
-Subject: [PATCH] Fix a buffer (read) overflow in ippReadIO (CVE-2020-10001)
-
----
-
-diff --git a/cups/ipp.c b/cups/ipp.c
-index 3d529346c..adbb26fba 100644
---- a/cups/ipp.c
-+++ b/cups/ipp.c
-@@ -2866,7 +2866,8 @@ ippReadIO(void       *src,		/* I - Data source */
-   unsigned char		*buffer,	/* Data buffer */
- 			string[IPP_MAX_TEXT],
- 					/* Small string buffer */
--			*bufptr;	/* Pointer into buffer */
-+			*bufptr,	/* Pointer into buffer */
-+			*bufend;	/* End of buffer */
-   ipp_attribute_t	*attr;		/* Current attribute */
-   ipp_tag_t		tag;		/* Current tag */
-   ipp_tag_t		value_tag;	/* Current value tag */
-@@ -3441,6 +3442,7 @@ ippReadIO(void       *src,		/* I - Data source */
- 		}
- 
-                 bufptr = buffer;
-+                bufend = buffer + n;
- 
- 	       /*
- 	        * text-with-language and name-with-language are composite
-@@ -3454,7 +3456,7 @@ ippReadIO(void       *src,		/* I - Data source */
- 
- 		n = (bufptr[0] << 8) | bufptr[1];
- 
--		if ((bufptr + 2 + n) >= (buffer + IPP_BUF_SIZE) || n >= (int)sizeof(string))
-+		if ((bufptr + 2 + n + 2) > bufend || n >= (int)sizeof(string))
- 		{
- 		  _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
- 		                _("IPP language length overflows value."), 1);
-@@ -3481,7 +3483,7 @@ ippReadIO(void       *src,		/* I - Data source */
-                 bufptr += 2 + n;
- 		n = (bufptr[0] << 8) | bufptr[1];
- 
--		if ((bufptr + 2 + n) >= (buffer + IPP_BUF_SIZE))
-+		if ((bufptr + 2 + n) > bufend)
- 		{
- 		  _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
- 		                _("IPP string length overflows value."), 1);
diff --git a/gnu/packages/patches/curl-7.76-use-ssl-cert-env.patch b/gnu/packages/patches/curl-7.76-use-ssl-cert-env.patch
deleted file mode 100644
index 24be6e31d9..0000000000
--- a/gnu/packages/patches/curl-7.76-use-ssl-cert-env.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-Make libcurl respect the SSL_CERT_{DIR,FILE} variables by default. The variables
-are fetched during initialization to preserve thread-safety (curl_global_init(3)
-must be called when no other threads exist).
-
-This fixes network functionality in rust:cargo, and probably removes the need
-for other future workarounds.
-===================================================================
---- curl-7.66.0.orig/lib/easy.c	2020-01-02 15:43:11.883921171 +0100
-+++ curl-7.66.0/lib/easy.c	2020-01-02 16:18:54.691882797 +0100
-@@ -134,6 +134,9 @@
- #  pragma warning(default:4232) /* MSVC extension, dllimport identity */
- #endif
- 
-+char * Curl_ssl_cert_dir = NULL;
-+char * Curl_ssl_cert_file = NULL;
-+
- /**
-  * curl_global_init() globally initializes curl given a bitwise set of the
-  * different features of what to initialize.
-@@ -155,6 +158,9 @@
- #endif
-   }
- 
-+  Curl_ssl_cert_dir = curl_getenv("SSL_CERT_DIR");
-+  Curl_ssl_cert_file = curl_getenv("SSL_CERT_FILE");
-+
-   if(!Curl_ssl_init()) {
-     DEBUGF(fprintf(stderr, "Error: Curl_ssl_init failed\n"));
-     return CURLE_FAILED_INIT;
-@@ -260,6 +266,9 @@
-   Curl_ssl_cleanup();
-   Curl_resolver_global_cleanup();
- 
-+  free(Curl_ssl_cert_dir);
-+  free(Curl_ssl_cert_file);
-+
- #ifdef WIN32
-   Curl_win32_cleanup(init_flags);
- #endif
-diff -ur curl-7.66.0.orig/lib/url.c curl-7.66.0/lib/url.c
---- curl-7.66.0.orig/lib/url.c	2020-01-02 15:43:11.883921171 +0100
-+++ curl-7.66.0/lib/url.c	2020-01-02 16:21:11.563880346 +0100
-@@ -524,6 +524,21 @@
-     if(result)
-       return result;
- #endif
-+    extern char * Curl_ssl_cert_dir;
-+    extern char * Curl_ssl_cert_file;
-+    if(Curl_ssl_cert_dir) {
-+        if(result = Curl_setstropt(&set->str[STRING_SSL_CAPATH], Curl_ssl_cert_dir))
-+            return result;
-+        if(result = Curl_setstropt(&set->str[STRING_SSL_CAPATH_PROXY], Curl_ssl_cert_dir))
-+            return result;
-+    }
-+
-+    if(Curl_ssl_cert_file) {
-+        if(result = Curl_setstropt(&set->str[STRING_SSL_CAFILE], Curl_ssl_cert_file))
-+            return result;
-+        if(result = Curl_setstropt(&set->str[STRING_SSL_CAFILE_PROXY], Curl_ssl_cert_file))
-+            return result;
-+    }
-   }
- 
-   set->wildcard_enabled = FALSE;
diff --git a/gnu/packages/patches/curl-7.77-tls-priority-string.patch b/gnu/packages/patches/curl-7.77-tls-priority-string.patch
deleted file mode 100644
index bf1bfa8aaa..0000000000
--- a/gnu/packages/patches/curl-7.77-tls-priority-string.patch
+++ /dev/null
@@ -1,98 +0,0 @@
-cURL 7.77.0 would use a bogus TLS priority string favoring older TLS
-protocol versions, which in turn would prevent access to bitbucket.org:
-
-  https://issues.guix.gnu.org/49035
-  https://github.com/curl/curl/pull/7278
-
-This patch fixes it.
-From <https://github.com/curl/curl/pull/7278/commits/b98f79f6ecdb708c67f9a0cec56ce48952a54556>.
-
-From b98f79f6ecdb708c67f9a0cec56ce48952a54556 Mon Sep 17 00:00:00 2001
-From: Daniel Stenberg <daniel@haxx.se>
-Date: Fri, 18 Jun 2021 14:54:07 +0200
-Subject: [PATCH] gnutls: set the prefer ciphers in correct order
-
-Reported-by: civodul on github
-Assisted-by: Nikos Mavrogiannopoulos
-Fixes #7277
----
- lib/vtls/gtls.c | 30 +++++++++++++-----------------
- 1 file changed, 13 insertions(+), 17 deletions(-)
-
-diff --git a/lib/vtls/gtls.c b/lib/vtls/gtls.c
-index d9bc5611e8f9..da2af64955c3 100644
---- a/lib/vtls/gtls.c
-+++ b/lib/vtls/gtls.c
-@@ -330,6 +330,9 @@ set_ssl_version_min_max(struct Curl_easy *data,
-       ssl_version_max = CURL_SSLVERSION_MAX_TLSv1_2;
-     }
-   }
-+  else if(ssl_version_max == CURL_SSLVERSION_MAX_DEFAULT) {
-+    ssl_version_max = CURL_SSLVERSION_MAX_TLSv1_3;
-+  }
- 
-   switch(ssl_version | ssl_version_max) {
-   case CURL_SSLVERSION_TLSv1_0 | CURL_SSLVERSION_MAX_TLSv1_0:
-@@ -338,11 +341,11 @@ set_ssl_version_min_max(struct Curl_easy *data,
-     return CURLE_OK;
-   case CURL_SSLVERSION_TLSv1_0 | CURL_SSLVERSION_MAX_TLSv1_1:
-     *prioritylist = GNUTLS_CIPHERS ":-VERS-SSL3.0:-VERS-TLS-ALL:"
--      "+VERS-TLS1.0:+VERS-TLS1.1";
-+      "+VERS-TLS1.1:+VERS-TLS1.0";
-     return CURLE_OK;
-   case CURL_SSLVERSION_TLSv1_0 | CURL_SSLVERSION_MAX_TLSv1_2:
-     *prioritylist = GNUTLS_CIPHERS ":-VERS-SSL3.0:-VERS-TLS-ALL:"
--      "+VERS-TLS1.0:+VERS-TLS1.1:+VERS-TLS1.2";
-+      "+VERS-TLS1.2:+VERS-TLS1.1:+VERS-TLS1.0";
-     return CURLE_OK;
-   case CURL_SSLVERSION_TLSv1_1 | CURL_SSLVERSION_MAX_TLSv1_1:
-     *prioritylist = GNUTLS_CIPHERS ":-VERS-SSL3.0:-VERS-TLS-ALL:"
-@@ -350,7 +353,7 @@ set_ssl_version_min_max(struct Curl_easy *data,
-     return CURLE_OK;
-   case CURL_SSLVERSION_TLSv1_1 | CURL_SSLVERSION_MAX_TLSv1_2:
-     *prioritylist = GNUTLS_CIPHERS ":-VERS-SSL3.0:-VERS-TLS-ALL:"
--      "+VERS-TLS1.1:+VERS-TLS1.2";
-+      "+VERS-TLS1.2:+VERS-TLS1.1";
-     return CURLE_OK;
-   case CURL_SSLVERSION_TLSv1_2 | CURL_SSLVERSION_MAX_TLSv1_2:
-     *prioritylist = GNUTLS_CIPHERS ":-VERS-SSL3.0:-VERS-TLS-ALL:"
-@@ -360,25 +363,17 @@ set_ssl_version_min_max(struct Curl_easy *data,
-     *prioritylist = GNUTLS_CIPHERS ":-VERS-SSL3.0:-VERS-TLS-ALL:"
-       "+VERS-TLS1.3";
-     return CURLE_OK;
--  case CURL_SSLVERSION_TLSv1_0 | CURL_SSLVERSION_MAX_DEFAULT:
--    *prioritylist = GNUTLS_CIPHERS ":-VERS-SSL3.0:-VERS-TLS-ALL:"
--      "+VERS-TLS1.0:+VERS-TLS1.1:+VERS-TLS1.2"
--      ":+VERS-TLS1.3";
-+  case CURL_SSLVERSION_TLSv1_0 | CURL_SSLVERSION_MAX_TLSv1_3:
-+    *prioritylist = GNUTLS_CIPHERS ":-VERS-SSL3.0";
-     return CURLE_OK;
--  case CURL_SSLVERSION_TLSv1_1 | CURL_SSLVERSION_MAX_DEFAULT:
-+  case CURL_SSLVERSION_TLSv1_1 | CURL_SSLVERSION_MAX_TLSv1_3:
-     *prioritylist = GNUTLS_CIPHERS ":-VERS-SSL3.0:-VERS-TLS-ALL:"
--      "+VERS-TLS1.1:+VERS-TLS1.2"
--      ":+VERS-TLS1.3";
-+      "+VERS-TLS1.3:+VERS-TLS1.2:+VERS-TLS1.1";
-     return CURLE_OK;
--  case CURL_SSLVERSION_TLSv1_2 | CURL_SSLVERSION_MAX_DEFAULT:
-+  case CURL_SSLVERSION_TLSv1_2 | CURL_SSLVERSION_MAX_TLSv1_3:
-     *prioritylist = GNUTLS_CIPHERS ":-VERS-SSL3.0:-VERS-TLS-ALL:"
--      "+VERS-TLS1.2"
--      ":+VERS-TLS1.3";
-+      "+VERS-TLS1.3:+VERS-TLS1.2";
-     return CURLE_OK;
--  case CURL_SSLVERSION_TLSv1_3 | CURL_SSLVERSION_MAX_DEFAULT:
--    *prioritylist = GNUTLS_CIPHERS ":-VERS-SSL3.0:-VERS-TLS-ALL:"
--      "+VERS-TLS1.2"
--      ":+VERS-TLS1.3";
-     return CURLE_OK;
-   }
- 
-@@ -608,6 +603,7 @@ gtls_connect_step1(struct Curl_easy *data,
-   }
-   else {
- #endif
-+    infof(data, "GnuTLS ciphers: %s\n", prioritylist);
-     rc = gnutls_priority_set_direct(session, prioritylist, &err);
- #ifdef HAVE_GNUTLS_SRP
-   }
diff --git a/gnu/packages/patches/curl-use-ssl-cert-env.patch b/gnu/packages/patches/curl-use-ssl-cert-env.patch
index c8e80b4445..24be6e31d9 100644
--- a/gnu/packages/patches/curl-use-ssl-cert-env.patch
+++ b/gnu/packages/patches/curl-use-ssl-cert-env.patch
@@ -47,14 +47,14 @@ diff -ur curl-7.66.0.orig/lib/url.c curl-7.66.0/lib/url.c
 +    extern char * Curl_ssl_cert_dir;
 +    extern char * Curl_ssl_cert_file;
 +    if(Curl_ssl_cert_dir) {
-+        if(result = Curl_setstropt(&set->str[STRING_SSL_CAPATH_ORIG], Curl_ssl_cert_dir))
++        if(result = Curl_setstropt(&set->str[STRING_SSL_CAPATH], Curl_ssl_cert_dir))
 +            return result;
 +        if(result = Curl_setstropt(&set->str[STRING_SSL_CAPATH_PROXY], Curl_ssl_cert_dir))
 +            return result;
 +    }
 +
 +    if(Curl_ssl_cert_file) {
-+        if(result = Curl_setstropt(&set->str[STRING_SSL_CAFILE_ORIG], Curl_ssl_cert_file))
++        if(result = Curl_setstropt(&set->str[STRING_SSL_CAFILE], Curl_ssl_cert_file))
 +            return result;
 +        if(result = Curl_setstropt(&set->str[STRING_SSL_CAFILE_PROXY], Curl_ssl_cert_file))
 +            return result;
diff --git a/gnu/packages/patches/dbus-CVE-2020-12049.patch b/gnu/packages/patches/dbus-CVE-2020-12049.patch
deleted file mode 100644
index 71280144a1..0000000000
--- a/gnu/packages/patches/dbus-CVE-2020-12049.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-Fix CVE-2020-12049:
-
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-12049
-https://lists.freedesktop.org/archives/ftp-release/2020-June/000753.html
-
-Taken from upstream:
-
-https://gitlab.freedesktop.org/dbus/dbus/-/commit/272d484283883fa9ff95b69d924fff6cd34842f5
-
-diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c
---- a/dbus/dbus-sysdeps-unix.c
-+++ b/dbus/dbus-sysdeps-unix.c
-@@ -435,18 +435,6 @@ _dbus_read_socket_with_unix_fds (DBusSocket        fd,
-       struct cmsghdr *cm;
-       dbus_bool_t found = FALSE;
- 
--      if (m.msg_flags & MSG_CTRUNC)
--        {
--          /* Hmm, apparently the control data was truncated. The bad
--             thing is that we might have completely lost a couple of fds
--             without chance to recover them. Hence let's treat this as a
--             serious error. */
--
--          errno = ENOSPC;
--          _dbus_string_set_length (buffer, start);
--          return -1;
--        }
--
-       for (cm = CMSG_FIRSTHDR(&m); cm; cm = CMSG_NXTHDR(&m, cm))
-         if (cm->cmsg_level == SOL_SOCKET && cm->cmsg_type == SCM_RIGHTS)
-           {
-@@ -501,6 +489,26 @@ _dbus_read_socket_with_unix_fds (DBusSocket        fd,
-       if (!found)
-         *n_fds = 0;
- 
-+      if (m.msg_flags & MSG_CTRUNC)
-+        {
-+          unsigned int i;
-+
-+          /* Hmm, apparently the control data was truncated. The bad
-+             thing is that we might have completely lost a couple of fds
-+             without chance to recover them. Hence let's treat this as a
-+             serious error. */
-+
-+          /* We still need to close whatever fds we *did* receive,
-+           * otherwise they'll never get closed. (CVE-2020-12049) */
-+          for (i = 0; i < *n_fds; i++)
-+            close (fds[i]);
-+
-+          *n_fds = 0;
-+          errno = ENOSPC;
-+          _dbus_string_set_length (buffer, start);
-+          return -1;
-+        }
-+
-       /* put length back (doesn't actually realloc) */
-       _dbus_string_set_length (buffer, start + bytes_read);
- 
diff --git a/gnu/packages/patches/dealii-fix-compiliation-with-boost-1.78.patch b/gnu/packages/patches/dealii-fix-compiliation-with-boost-1.78.patch
new file mode 100644
index 0000000000..1937aa9afc
--- /dev/null
+++ b/gnu/packages/patches/dealii-fix-compiliation-with-boost-1.78.patch
@@ -0,0 +1,40 @@
+From cbef761731627cece2a6f0276b87dacabbdc8a72 Mon Sep 17 00:00:00 2001
+From: David Wells <drwells@email.unc.edu>
+Date: Tue, 4 Jan 2022 12:46:30 -0500
+Subject: [PATCH] Fix compilation with boost 1.78.
+
+I bisected (fortunately Boost.Geometry a header-only library so adding the
+include directory sufficed) and
+https://github.com/boostorg/geometry/commit/6eb9e238bcb37e26dc31d16acf826784a2ba30f4
+is where this problem starts for us. See also
+https://github.com/boostorg/geometry/issues/792 - the easiest fix for all such
+issues is to just include the project header `boost/geometry/geometry.hpp`.
+
+In this particular case, if you look at the commit which causes grid_tools.cc
+fails to compile, its because we were relying on some implicit includes. In
+particular, we need the distance header to find the distance between points and
+boxes, but that was previously included in another file.
+
+This patch has been adapted from
+e0e76835519d122fd12b5858e16d08641a641c6a to apply to dealii 9.3.2.
+
+See https://github.com/dealii/dealii/pull/13165.
+---
+ include/deal.II/numerics/rtree.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/include/deal.II/numerics/rtree.h b/include/deal.II/numerics/rtree.h
+index 1b9d04dacd..1e1bfd2932 100644
+--- a/include/deal.II/numerics/rtree.h
++++ b/include/deal.II/numerics/rtree.h
+@@ -26,6 +26,7 @@
+ #include <deal.II/boost_adaptors/segment.h>
+ 
+ DEAL_II_DISABLE_EXTRA_DIAGNOSTICS
++#include <boost/geometry/algorithms/distance.hpp>
+ #include <boost/geometry/index/rtree.hpp>
+ #include <boost/geometry/strategies/strategies.hpp>
+ DEAL_II_ENABLE_EXTRA_DIAGNOSTICS
+-- 
+2.30.2
+
diff --git a/gnu/packages/patches/dealii-fix-sundials.patch b/gnu/packages/patches/dealii-fix-sundials.patch
new file mode 100644
index 0000000000..7dd5df45da
--- /dev/null
+++ b/gnu/packages/patches/dealii-fix-sundials.patch
@@ -0,0 +1,60 @@
+From af73f368f7f9d4a00df075d1a9f50fc495f8e87a Mon Sep 17 00:00:00 2001
+From: Timo Heister <timo.heister@gmail.com>
+Date: Sat, 25 Dec 2021 12:30:45 -0500
+Subject: [PATCH] fix sundials compilation
+
+---
+ include/deal.II/sundials/n_vector.templates.h | 11 ++++++-----
+ 1 file changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/include/deal.II/sundials/n_vector.templates.h b/include/deal.II/sundials/n_vector.templates.h
+index 2b49e3efc9..746f63a03b 100644
+--- a/include/deal.II/sundials/n_vector.templates.h
++++ b/include/deal.II/sundials/n_vector.templates.h
+@@ -253,13 +253,13 @@ namespace SUNDIALS
+       template <
+         typename VectorType,
+         typename std::enable_if_t<!IsBlockVector<VectorType>::value, int> = 0>
+-      MPI_Comm
++      const MPI_Comm &
+       get_communicator(N_Vector v);
+ 
+       template <
+         typename VectorType,
+         typename std::enable_if_t<IsBlockVector<VectorType>::value, int> = 0>
+-      MPI_Comm
++      const MPI_Comm &
+       get_communicator(N_Vector v);
+ 
+       /**
+@@ -481,7 +481,7 @@ SUNDIALS::internal::NVectorOperations::destroy(N_Vector v)
+ 
+ template <typename VectorType,
+           std::enable_if_t<IsBlockVector<VectorType>::value, int>>
+-MPI_Comm
++const MPI_Comm &
+ SUNDIALS::internal::NVectorOperations::get_communicator(N_Vector v)
+ {
+   return unwrap_nvector_const<VectorType>(v)->block(0).get_mpi_communicator();
+@@ -491,7 +491,7 @@ SUNDIALS::internal::NVectorOperations::get_communicator(N_Vector v)
+ 
+ template <typename VectorType,
+           std::enable_if_t<!IsBlockVector<VectorType>::value, int>>
+-MPI_Comm
++const MPI_Comm &
+ SUNDIALS::internal::NVectorOperations::get_communicator(N_Vector v)
+ {
+   return unwrap_nvector_const<VectorType>(v)->get_mpi_communicator();
+@@ -519,7 +519,8 @@ SUNDIALS::internal::NVectorOperations::get_communicator_as_void_ptr(N_Vector v)
+   (void)v;
+   return nullptr;
+ #  else
+-  return get_communicator<VectorType>(v);
++  // We need to cast away const here, as SUNDIALS demands a pure `void *`.
++  return &(const_cast<MPI_Comm &>(get_communicator<VectorType>(v)));
+ #  endif
+ }
+ 
+-- 
+2.30.2
+
diff --git a/gnu/packages/patches/diffoscope-fix-llvm-test.patch b/gnu/packages/patches/diffoscope-fix-llvm-test.patch
new file mode 100644
index 0000000000..45e496a128
--- /dev/null
+++ b/gnu/packages/patches/diffoscope-fix-llvm-test.patch
@@ -0,0 +1,28 @@
+From b7eeac09eb068083bdee1a3aa062d1e52a2fa61a Mon Sep 17 00:00:00 2001
+From: Tobias Geerinckx-Rice <me@tobias.gr>
+Date: Mon, 4 Oct 2021 21:03:43 +0200
+Subject: [PATCH] gnu: diffoscope: Fix test_item3_deflate_llvm_bitcode.
+
+Taken verbatim from Nixpkgs[0].
+
+[0]: https://github.com/NixOS/nixpkgs/blob/589e03f109092a3ba97781fd0533110bf78a3f97/pkgs/tools/misc/diffoscope/fix-tests.patch
+---
+ tests/comparators/test_rlib.py | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/tests/comparators/test_rlib.py b/tests/comparators/test_rlib.py
+index 8d201ab..05960aa 100644
+--- a/tests/comparators/test_rlib.py
++++ b/tests/comparators/test_rlib.py
+@@ -81,9 +81,6 @@ def rlib_dis_expected_diff():
+     if actual_ver >= "7.0":
+         diff_file = "rlib_llvm_dis_expected_diff_7"
+ 
+-    if actual_ver >= "10.0":
+-        diff_file = "rlib_llvm_dis_expected_diff_10"
+-
+     return get_data(diff_file)
+ 
+ 
+--
+2.33.0
diff --git a/gnu/packages/patches/diffutils-fix-signal-processing.patch b/gnu/packages/patches/diffutils-fix-signal-processing.patch
new file mode 100644
index 0000000000..134dd3f718
--- /dev/null
+++ b/gnu/packages/patches/diffutils-fix-signal-processing.patch
@@ -0,0 +1,58 @@
+Author: Frédéric Bonnard <frediz@debian.org>
+
+Obtained from:
+
+https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=922552#19
+
+Fixes bug reported upstream at:
+
+https://debbugs.gnu.org/cgi/bugreport.cgi?bug=34519
+
+diff --git a/src/diff.c b/src/diff.c
+index e2eb32437353..b574e8282dc9 100644
+--- a/src/diff.c
++++ b/src/diff.c
+@@ -1451,6 +1451,8 @@ compare_files (struct comparison const *parent,
+ 	}
+     }
+ 
++  final_process_signals ();
++
+   /* Now the comparison has been done, if no error prevented it,
+      and STATUS is the value this function will return.  */
+ 
+diff --git a/src/diff.h b/src/diff.h
+index 03daaa4a0530..e177fe600a25 100644
+--- a/src/diff.h
++++ b/src/diff.h
+@@ -390,6 +390,7 @@ extern enum changes analyze_hunk (struct change *, lin *, lin *, lin *, lin *);
+ extern void begin_output (void);
+ extern void debug_script (struct change *);
+ extern void fatal (char const *) __attribute__((noreturn));
++extern void final_process_signals (void);
+ extern void finish_output (void);
+ extern void message (char const *, char const *, char const *);
+ extern void message5 (char const *, char const *, char const *,
+diff --git a/src/util.c b/src/util.c
+index 4f4d9bb285eb..56d292de2927 100644
+--- a/src/util.c
++++ b/src/util.c
+@@ -237,6 +237,18 @@ process_signals (void)
+     }
+ }
+ 
++/* Process remaining signals once before exit  */
++void
++final_process_signals (void)
++{
++  static int last = 1;
++
++  if (last) {
++    process_signals ();
++    last = 0;
++  }
++}
++
+ static void
+ install_signal_handlers (void)
+ {
diff --git a/gnu/packages/patches/diffutils-gets-undeclared.patch b/gnu/packages/patches/diffutils-gets-undeclared.patch
deleted file mode 100644
index b6cdc77caa..0000000000
--- a/gnu/packages/patches/diffutils-gets-undeclared.patch
+++ /dev/null
@@ -1,71 +0,0 @@
-This patch is needed to allow builds with newer versions of
-the GNU libc (2.16+).
-
-
-commit 66712c23388e93e5c518ebc8515140fa0c807348
-Author: Eric Blake <eblake@redhat.com>
-Date:   Thu Mar 29 13:30:41 2012 -0600
-
-    stdio: don't assume gets any more
-    
-    Gnulib intentionally does not have a gets module, and now that C11
-    and glibc have dropped it, we should be more proactive about warning
-    any user on a platform that still has a declaration of this dangerous
-    interface.
-    
-    * m4/stdio_h.m4 (gl_STDIO_H, gl_STDIO_H_DEFAULTS): Drop gets
-    support.
-    * modules/stdio (Makefile.am): Likewise.
-    * lib/stdio-read.c (gets): Likewise.
-    * tests/test-stdio-c++.cc: Likewise.
-    * m4/warn-on-use.m4 (gl_WARN_ON_USE_PREPARE): Fix comment.
-    * lib/stdio.in.h (gets): Make warning occur in more places.
-    * doc/posix-functions/gets.texi (gets): Update documentation.
-    Reported by Christer Solskogen.
-    
-    Signed-off-by: Eric Blake <eblake@redhat.com>
-
-diff --git a/lib/stdio.in.h b/lib/stdio.in.h
-index aa7b599..c377b6e 100644
---- a/lib/stdio.in.h
-+++ b/lib/stdio.in.h
-@@ -698,22 +698,11 @@ _GL_WARN_ON_USE (getline, "getline is unportable - "
- # endif
- #endif
- 
--#if @GNULIB_GETS@
--# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
--#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
--#   undef gets
--#   define gets rpl_gets
--#  endif
--_GL_FUNCDECL_RPL (gets, char *, (char *s) _GL_ARG_NONNULL ((1)));
--_GL_CXXALIAS_RPL (gets, char *, (char *s));
--# else
--_GL_CXXALIAS_SYS (gets, char *, (char *s));
--#  undef gets
--# endif
--_GL_CXXALIASWARN (gets);
- /* It is very rare that the developer ever has full control of stdin,
--   so any use of gets warrants an unconditional warning.  Assume it is
--   always declared, since it is required by C89.  */
-+   so any use of gets warrants an unconditional warning; besides, C11
-+   removed it.  */
-+#undef gets
-+#if HAVE_RAW_DECL_GETS
- _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
- #endif
- 
-@@ -1053,9 +1042,9 @@ _GL_WARN_ON_USE (snprintf, "snprintf is unportable - "
- # endif
- #endif
- 
--/* Some people would argue that sprintf should be handled like gets
--   (for example, OpenBSD issues a link warning for both functions),
--   since both can cause security holes due to buffer overruns.
-+/* Some people would argue that all sprintf uses should be warned about
-+   (for example, OpenBSD issues a link warning for it),
-+   since it can cause security holes due to buffer overruns.
-    However, we believe that sprintf can be used safely, and is more
-    efficient than snprintf in those safe cases; and as proof of our
-    belief, we use sprintf in several gnulib modules.  So this header
diff --git a/gnu/packages/patches/disarchive-cross-compilation.patch b/gnu/packages/patches/disarchive-cross-compilation.patch
deleted file mode 100644
index 8061262168..0000000000
--- a/gnu/packages/patches/disarchive-cross-compilation.patch
+++ /dev/null
@@ -1,77 +0,0 @@
-From dc0f8f8bf8608c39da32e3c8ca1484b766fc7452 Mon Sep 17 00:00:00 2001
-From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
-Date: Mon, 17 May 2021 16:47:19 -0400
-Subject: [PATCH] build: Fix cross-compilation.
-
-The cross-compilation issues corrected by this change were discovered
-when attempting to cross-compile disarchive for the i586-gnu target on
-GNU Guix.
-
-* configure.ac [O_NOFOLLOW]: Rewrite test using AC_COMPUTE_INT, which
-is supported even when cross-compiling.
-(GUILD_TARGET_OPTION): New computed variable.
-* build-aux/guile.am ($(AM_V_GUILEC)GUILE_AUTO_COMPILE): Use it.
----
- build-aux/guile.am |  6 +++---
- configure.ac       | 24 +++++++++++++++---------
- 2 files changed, 18 insertions(+), 12 deletions(-)
-
-diff --git a/build-aux/guile.am b/build-aux/guile.am
-index bec04ea..7745125 100644
---- a/build-aux/guile.am
-+++ b/build-aux/guile.am
-@@ -54,7 +54,7 @@ AM_V_GUILEC_0 = @echo "  GUILEC" $@;
- SUFFIXES = .scm .go
- 
- .scm.go:
--	$(AM_V_GUILEC)GUILE_AUTO_COMPILE=0      \
--	$(top_builddir)/pre-inst-env            \
--	$(GUILD) compile $(GUILE_WARNINGS)      \
-+	$(AM_V_GUILEC)GUILE_AUTO_COMPILE=0                              \
-+	$(top_builddir)/pre-inst-env                                    \
-+	$(GUILD) compile $(GUILE_WARNINGS) $(GUILD_TARGET_OPTION)       \
- 	         -o "$@" "$<"
-diff --git a/configure.ac b/configure.ac
-index 99c5ac5..0cd0173 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -39,21 +39,27 @@ AS_IF([test "x$GUILD" = "x"],
-     [AC_MSG_ERROR(m4_normalize([
-       'guild' binary not found; please check your Guile installation.]))])])
- 
-+dnl This argument is passed to guild; it ensures cross-compiling uses
-+dnl the right target.
-+if test -n "$host_alias"; then
-+   AC_SUBST([GUILD_TARGET_OPTION], [--target=$host_alias])
-+fi
-+
- GUILE_MODULE_REQUIRED(gcrypt hash)
- 
- dnl Guile defines a handful of values from <fcntl.h>, but it is
- dnl missing O_NOFOLLOW.
- AC_ARG_VAR([O_NOFOLLOW], [value to use for O_NOFOLLOW (cf. <fcntl.h>)])
- AS_IF([test "x$O_NOFOLLOW" = "x"],
--  [AC_MSG_CHECKING([the value of O_NOFOLLOW])
--   AC_RUN_IFELSE([AC_LANG_PROGRAM([[
--       #include <fcntl.h>
--       #include <stdio.h>
--     ]], [[
--       printf("%d\n", O_NOFOLLOW)
--     ]])],
--     [O_NOFOLLOW=`./conftest$EXEEXT`],
--     [AC_MSG_FAILURE([could find value for O_NOFOLLOW])])])
-+  [AC_MSG_CHECKING([the value of O_NOFOLLOW])]
-+  [AC_COMPUTE_INT([O_NOFOLLOW],
-+      [O_NOFOLLOW],
-+      [[
-+        #include <fcntl.h>
-+        #include <stdio.h>
-+      ]],
-+      [AC_MSG_FAILURE([could find value for O_NOFOLLOW])])]
-+  [AC_MSG_RESULT([$O_NOFOLLOW])])
- 
- AC_ARG_VAR([TAR], [tar utility])
- AS_IF([test "x$TAR" = "x"], [AC_PATH_PROG([TAR], [tar])])
--- 
-2.31.1
-
diff --git a/gnu/packages/patches/docbook-xsl-nonrecursive-string-subst.patch b/gnu/packages/patches/docbook-xsl-nonrecursive-string-subst.patch
index 4199dd18a5..fed4b76429 100644
--- a/gnu/packages/patches/docbook-xsl-nonrecursive-string-subst.patch
+++ b/gnu/packages/patches/docbook-xsl-nonrecursive-string-subst.patch
@@ -5,7 +5,7 @@ https://bugzilla.samba.org/show_bug.cgi?id=9515
 https://bugzilla.gnome.org/show_bug.cgi?id=736077 (for xsltproc)
 
 Patch copied from Debian:
-https://anonscm.debian.org/cgit/collab-maint/docbook-xsl.git/tree/debian/patches/765567_non-recursive_string_subst.patch
+https://salsa.debian.org/debian/docbook-xsl/-/blob/master/debian/patches/765567_non-recursive_string_subst.patch
 
 Description: use EXSLT "replace" function when available
  A recursive implementation  of string.subst is problematic,
@@ -15,11 +15,12 @@ Bug-Debian: https://bugs.debian.org/750593
 
 --- a/lib/lib.xsl
 +++ b/lib/lib.xsl
-@@ -10,7 +10,10 @@
+@@ -6,7 +6,11 @@
+ 
       This module implements DTD-independent functions
  
-      ******************************************************************** -->
--<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+-     ******************************************************************** --><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
++     ******************************************************************** -->
 +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 +                xmlns:str="http://exslt.org/strings"
 +                exclude-result-prefixes="str"
@@ -27,7 +28,7 @@ Bug-Debian: https://bugs.debian.org/750593
  
  <xsl:template name="dot.count">
    <!-- Returns the number of "." characters in a string -->
-@@ -56,6 +59,9 @@
+@@ -52,6 +56,9 @@
    <xsl:param name="replacement"/>
  
    <xsl:choose>
diff --git a/gnu/packages/patches/docbook-xsl-support-old-url.patch b/gnu/packages/patches/docbook-xsl-support-old-url.patch
new file mode 100644
index 0000000000..5b7dda458f
--- /dev/null
+++ b/gnu/packages/patches/docbook-xsl-support-old-url.patch
@@ -0,0 +1,17 @@
+Docbook 1.79.2 makes very few changes apart from changing the canonical URL
+to cdn.docbook.org.  This patch adds support for the previous URL to avoid
+breaking packages that still use that.
+
+Adapted from Debian:
+https://salsa.debian.org/debian/docbook-xsl/-/blob/master/debian/patches/0005-catalog.xml-Compatibility-with-1.79.1-or-earlier.patch
+
+--- a/catalog.xml
++++ b/catalog.xml
+@@ -5,4 +5,7 @@
+   <rewriteSystem systemIdStartString="http://cdn.docbook.org/release/xsl/current/" rewritePrefix="./"/>
+   <rewriteURI uriStartString="http://cdn.docbook.org/release/xsl/1.79.2/" rewritePrefix="./"/>
+   <rewriteSystem systemIdStartString="http://cdn.docbook.org/release/xsl/1.79.2/" rewritePrefix="./"/>
++  <!-- Also support old URI of v1.79.1 or earlier -->
++  <rewriteURI uriStartString="http://docbook.sourceforge.net/release/xsl/current/" rewritePrefix="./"/>
++  <rewriteSystem systemIdStartString="http://docbook.sourceforge.net/release/xsl/current/" rewritePrefix="./"/>
+ </catalog>
diff --git a/gnu/packages/patches/doxygen-1.8.17-runtests.patch b/gnu/packages/patches/doxygen-1.8.17-runtests.patch
deleted file mode 100644
index 0340c72448..0000000000
--- a/gnu/packages/patches/doxygen-1.8.17-runtests.patch
+++ /dev/null
@@ -1,73 +0,0 @@
-1.8.17 was released with a broken test runner.
-
-https://github.com/doxygen/doxygen/issues/7464
-
-Taken from upstream:
-https://github.com/doxygen/doxygen/commit/cd9dee013dc749a10bbe019c350e0e62b6635795
-
-diff --git a/testing/runtests.py b/testing/runtests.py
-index a4118b865..10fe50214 100755
---- a/testing/runtests.py
-+++ b/testing/runtests.py
-@@ -3,6 +3,7 @@
- from __future__ import print_function
- import argparse, glob, itertools, re, shutil, os, sys
- import subprocess
-+import shlex
- 
- config_reg = re.compile('.*\/\/\s*(?P<name>\S+):\s*(?P<value>.*)$')
- 
-@@ -28,10 +29,10 @@ def xpopen(cmd, cmd1="",encoding='utf-8-sig', getStderr=False):
- 		return os.popen(cmd).read() # Python 2 without encoding
- 	else:
- 		if (getStderr):
--			proc = subprocess.run(cmd1,encoding=encoding,capture_output=True) # Python 3 with encoding
--			return proc.stderr
-+			proc = subprocess.Popen(shlex.split(cmd1),stdout=subprocess.PIPE,stderr=subprocess.PIPE,encoding=encoding) # Python 3 with encoding
-+			return proc.stderr.read()
- 		else:
--			proc = subprocess.Popen(cmd,stdout=subprocess.PIPE,stderr=subprocess.PIPE,encoding=encoding) # Python 3 with encoding
-+			proc = subprocess.Popen(shlex.split(cmd),stdout=subprocess.PIPE,stderr=subprocess.PIPE,encoding=encoding) # Python 3 with encoding
- 			return proc.stdout.read()
- 
- class Tester:
-@@ -137,7 +138,7 @@ def prepare_test(self):
- 				print('GENERATE_DOCBOOK=NO', file=f)
- 			if (self.args.xhtml):
- 				print('GENERATE_HTML=YES', file=f)
--			# HTML_OUTPUT can also be set locally
-+			# HTML_OUTPUT can also have been set locally
- 			print('HTML_OUTPUT=%s/html' % self.test_out, file=f)
- 			print('HTML_FILE_EXTENSION=.xhtml', file=f)
- 			if (self.args.pdf):
-@@ -184,7 +185,7 @@ def update_test(self,testmgr):
- 					print('Non-existing file %s after \'check:\' statement' % check_file)
- 					return
- 				# convert output to canonical form
--				data = xpopen('%s --format --noblanks --nowarning %s' % (self.args.xmllint,check_file)).read()
-+				data = xpopen('%s --format --noblanks --nowarning %s' % (self.args.xmllint,check_file))
- 				if data:
- 					# strip version
- 					data = re.sub(r'xsd" version="[0-9.-]+"','xsd" version=""',data).rstrip('\n')
-@@ -326,7 +327,7 @@ def perform_test(self,testmgr):
- 			tests.append(glob.glob('%s/*.xml' % (docbook_output)))
- 			tests.append(glob.glob('%s/*/*/*.xml' % (docbook_output)))
- 			tests = ' '.join(list(itertools.chain.from_iterable(tests))).replace(self.args.outputdir +'/','').replace('\\','/')
--			exe_string = '%s --nonet --postvalid %s' % (self.args.xmllint,tests)
-+			exe_string = '%s --noout --nonet --postvalid %s' % (self.args.xmllint,tests)
- 			exe_string1 = exe_string
- 			exe_string += ' %s' % (redirx)
- 			exe_string += ' %s more "%s/temp"' % (separ,docbook_output)
-@@ -346,7 +347,11 @@ def perform_test(self,testmgr):
- 				redirx=' 2> %s/temp >nul:'%html_output
- 			else:
- 				redirx='2>%s/temp >/dev/null'%html_output
--			exe_string = '%s --path dtd --nonet --postvalid %s/*xhtml' % (self.args.xmllint,html_output)
-+			check_file = []
-+			check_file.append(glob.glob('%s/*.xhtml' % (html_output)))
-+			check_file.append(glob.glob('%s/*/*/*.xhtml' % (html_output)))
-+			check_file = ' '.join(list(itertools.chain.from_iterable(check_file))).replace(self.args.outputdir +'/','').replace('\\','/')
-+			exe_string = '%s --noout --path dtd --nonet --postvalid %s' % (self.args.xmllint,check_file)
- 			exe_string1 = exe_string
- 			exe_string += ' %s' % (redirx)
- 			exe_string += ' %s more "%s/temp"' % (separ,html_output)
diff --git a/gnu/packages/patches/doxygen-test.patch b/gnu/packages/patches/doxygen-test.patch
deleted file mode 100644
index 1c0d4eb946..0000000000
--- a/gnu/packages/patches/doxygen-test.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-Modify the expected outcome of test 012 so that it passes when bibtex is
-not in the path, as we do not wish to add texlive as an input just for this
-test.
-
-diff -u -r doxygen-1.8.7.orig/testing/012/citelist.xml doxygen-1.8.7/testing/012/citelist.xml
---- doxygen-1.8.7.orig/testing/012/citelist.xml	2014-04-24 23:43:34.000000000 +0200
-+++ doxygen-1.8.7/testing/012/citelist.xml	2014-04-24 23:49:43.000000000 +0200
-@@ -6,38 +6,6 @@
-     <briefdescription>
-     </briefdescription>
-     <detaileddescription>
--      <para>
--        <variablelist>
--          <varlistentry>
--            <term><anchor id="citelist_1CITEREF_Be09"/>[1]</term>
--          </varlistentry>
--          <listitem>
--            <para>P.<nonbreakablespace/>Belotti. <ulink url="http://doi.org/10.1007/978-1-4614-1927-3_5">Disjunctive cuts for non-convex MINLP</ulink>. In <ulink url="#CITEREF_LeLe12">Lee and Leyffer</ulink> <ulink url="#CITEREF_LeLe12">[4]</ulink>, pages 117<ndash/>144.</para>
--            <para/>
--          </listitem>
--          <varlistentry>
--            <term><anchor id="citelist_1CITEREF_BertholdHeinzVigerske2009"/>[2]</term>
--          </varlistentry>
--          <listitem>
--            <para>T.<nonbreakablespace/>Berthold, S.<nonbreakablespace/>Heinz, and S.<nonbreakablespace/>Vigerske. <ulink url="http://doi.org/10.1007/978-1-4614-1927-3_15">Extending a CIP framework to solve MIQCPs</ulink>. In <ulink url="#CITEREF_LeLe12">Lee and Leyffer</ulink> <ulink url="#CITEREF_LeLe12">[4]</ulink>, pages 427<ndash/>444.</para>
--            <para/>
--          </listitem>
--          <varlistentry>
--            <term><anchor id="citelist_1CITEREF_knuth79"/>[3]</term>
--          </varlistentry>
--          <listitem>
--            <para>Donald<nonbreakablespace/>E. Knuth. <emphasis>Tex and Metafont, New Directions in Typesetting</emphasis>. American Mathematical Society and Digital Press, Stanford, 1979.</para>
--            <para/>
--          </listitem>
--          <varlistentry>
--            <term><anchor id="citelist_1CITEREF_LeLe12"/>[4]</term>
--          </varlistentry>
--          <listitem>
--            <para>Jon Lee and Sven Leyffer, editors. <ulink url="http://doi.org/10.1007/978-1-4614-1927-3"><emphasis>Mixed Integer Nonlinear Programming</emphasis></ulink>, volume 154 of <emphasis>The IMA Volumes in Mathematics and its Applications</emphasis>. Springer, 2012.</para>
--            <para/>
--          </listitem>
--        </variablelist>
--      </para>
-     </detaileddescription>
-   </compounddef>
- </doxygen>
-diff -u -r doxygen-1.8.7.orig/testing/012/indexpage.xml doxygen-1.8.7/testing/012/indexpage.xml
---- doxygen-1.8.7.orig/testing/012/indexpage.xml	2014-04-24 23:43:34.000000000 +0200
-+++ doxygen-1.8.7/testing/012/indexpage.xml	2014-04-24 23:44:05.000000000 +0200
-@@ -6,8 +6,8 @@
-     <briefdescription>
-     </briefdescription>
-     <detaileddescription>
--      <para>See <ref refid="citelist_1CITEREF_knuth79" kindref="member">[3]</ref> for more info.</para>
--      <para>Other references with cross references see <ref refid="citelist_1CITEREF_Be09" kindref="member">[1]</ref> and <ref refid="citelist_1CITEREF_BertholdHeinzVigerske2009" kindref="member">[2]</ref> for more info. </para>
-+      <para>See knuth79 for more info.</para>
-+      <para>Other references with cross references see Be09 and BertholdHeinzVigerske2009 for more info. </para>
-     </detaileddescription>
-   </compounddef>
- </doxygen>
diff --git a/gnu/packages/patches/dune-istl-2.7-fix-non-mpi-tests.patch b/gnu/packages/patches/dune-istl-2.7-fix-non-mpi-tests.patch
deleted file mode 100644
index ee2bb8f676..0000000000
--- a/gnu/packages/patches/dune-istl-2.7-fix-non-mpi-tests.patch
+++ /dev/null
@@ -1,82 +0,0 @@
-Fix build of dune-istl's tests
-
-Patch copied from upstream source repository:
-
-https://gitlab.dune-project.org/core/dune-istl/-/commit/9eee3462df5a64881c08574f9291e76db398de0a
-
-From 9eee3462df5a64881c08574f9291e76db398de0a Mon Sep 17 00:00:00 2001
-From: Felix Gruber <felgru@posteo.net>
-Date: Sat, 4 Apr 2020 15:27:09 +0200
-Subject: [PATCH] make tests succeed when MPI is disabled
-
-When MPI is not available or explicitly disabled with the CMake build
-option -DCMAKE_IDSABLE_FIND_PACKAGE_MPI=TRUE, some tests were unable to
-build.
-
-The tests created from solverfactorytest.cc.in and part of
-scalarproductstest.cc use Dune::OwnerOverlapCopyCommunication which is
-defined behind `#if HAVE_MPI` and is thus not available in a non-MPI
-build. I've thus disabled those tests when MPI is unavailable.
-
-The matrixmarkettest did not work without MPI, as it contained some code
-using the wrong template parameters when HAVE_MPI was not set. Those
-template paramters have been fixed now.
-
-I've confirmed, that after my changes `make build_tests` succeeds to
-build all tests and that those tests run without failure.
----
- dune/istl/test/CMakeLists.txt        | 3 ++-
- dune/istl/test/matrixmarkettest.cc   | 2 +-
- dune/istl/test/scalarproductstest.cc | 2 ++
- 3 files changed, 5 insertions(+), 2 deletions(-)
-
-diff --git a/dune/istl/test/CMakeLists.txt b/dune/istl/test/CMakeLists.txt
-index ffd87969..2c7b2387 100644
---- a/dune/istl/test/CMakeLists.txt
-+++ b/dune/istl/test/CMakeLists.txt
-@@ -77,7 +77,8 @@ set(DUNE_TEST_FACTORY_BLOCK_SIZES
- function(add_factory_test BLOCK)
-   STRING(REGEX REPLACE "[^a-zA-Z0-9]" "" BLOCK_CLEAN ${BLOCK})
-   configure_file(solverfactorytest.cc.in solverfactorytest_${BLOCK_CLEAN}.cc)
--  dune_add_test(SOURCES ${CMAKE_CURRENT_BINARY_DIR}/solverfactorytest_${BLOCK_CLEAN}.cc)
-+  dune_add_test(SOURCES ${CMAKE_CURRENT_BINARY_DIR}/solverfactorytest_${BLOCK_CLEAN}.cc
-+                CMAKE_GUARD HAVE_MPI)
- endfunction(add_factory_test)
-
- foreach(FIELD_TYPE ${DUNE_TEST_FACTORY_FIELD_TYPES})
-diff --git a/dune/istl/test/matrixmarkettest.cc b/dune/istl/test/matrixmarkettest.cc
-index b335afe6..ce30e8ae 100644
---- a/dune/istl/test/matrixmarkettest.cc
-+++ b/dune/istl/test/matrixmarkettest.cc
-@@ -52,7 +52,7 @@ int testMatrixMarket(int N)
-   storeMatrixMarket(mat, std::string("testmat"), comm);
-   storeMatrixMarket(bv, std::string("testvec"), comm, false);
- #else
--  typedef Dune::MatrixAdapter<BCRSMat,BVector,BVector> Operator;
-+  typedef Dune::MatrixAdapter<Matrix,Vector,Vector> Operator;
-   Operator op(mat);
-   op.apply(bv, cv);
-
-diff --git a/dune/istl/test/scalarproductstest.cc b/dune/istl/test/scalarproductstest.cc
-index 452b1d89..f46ce2a9 100644
---- a/dune/istl/test/scalarproductstest.cc
-+++ b/dune/istl/test/scalarproductstest.cc
-@@ -115,6 +115,7 @@ int main(int argc, char** argv)
-     scalarProductTest<ScalarProduct, Vector>(scalarProduct,numBlocks);
-   }
-
-+#if HAVE_MPI
-   // Test the ParallelScalarProduct class
-   {
-     using Vector = BlockVector<FieldVector<double,BlockSize> >;
-@@ -139,6 +140,7 @@ int main(int argc, char** argv)
-     ScalarProduct scalarProduct(communicator,SolverCategory::nonoverlapping);
-     scalarProductTest<ScalarProduct, Vector>(scalarProduct,numBlocks);
-   }
-+#endif
-
-   return t.exit();
- }
---
-2.25.1
-
diff --git a/gnu/packages/patches/dynaconf-unvendor-deps.patch b/gnu/packages/patches/dynaconf-unvendor-deps.patch
new file mode 100644
index 0000000000..550e311363
--- /dev/null
+++ b/gnu/packages/patches/dynaconf-unvendor-deps.patch
@@ -0,0 +1,179 @@
+From 3f7b48195500cbbbbecd3cac2f5308c64004479b Mon Sep 17 00:00:00 2001
+From: Giacomo Leidi <goodoldpaul@autistici.org>
+Date: Sun, 29 Aug 2021 23:39:27 +0200
+Subject: [PATCH] Use system site dependencies.
+
+Box was not unvendored because it appears to be heavily patched.
+---
+ dynaconf/cli.py                       | 4 ++--
+ dynaconf/default_settings.py          | 2 +-
+ dynaconf/loaders/env_loader.py        | 2 +-
+ dynaconf/loaders/toml_loader.py       | 2 +-
+ dynaconf/loaders/yaml_loader.py       | 2 +-
+ dynaconf/utils/parse_conf.py          | 2 +-
+ dynaconf/vendor/box/converters.py     | 4 ++--
+ dynaconf/vendor/box/from_file.py      | 4 ++--
+ dynaconf/vendor_src/box/converters.py | 4 ++--
+ dynaconf/vendor_src/box/from_file.py  | 4 ++--
+ tests/test_cli.py                     | 2 +-
+ 11 files changed, 16 insertions(+), 16 deletions(-)
+
+diff --git a/dynaconf/cli.py b/dynaconf/cli.py
+index 5bb8316..1341a95 100644
+--- a/dynaconf/cli.py
++++ b/dynaconf/cli.py
+@@ -20,8 +20,8 @@ from dynaconf.utils.functional import empty
+ from dynaconf.utils.parse_conf import parse_conf_data
+ from dynaconf.validator import ValidationError
+ from dynaconf.validator import Validator
+-from dynaconf.vendor import click
+-from dynaconf.vendor import toml
++import click
++import toml
+ 
+ 
+ CWD = Path.cwd()
+diff --git a/dynaconf/default_settings.py b/dynaconf/default_settings.py
+index 66601b0..9605fc5 100644
+--- a/dynaconf/default_settings.py
++++ b/dynaconf/default_settings.py
+@@ -8,7 +8,7 @@ from dynaconf.utils import upperfy
+ from dynaconf.utils import warn_deprecations
+ from dynaconf.utils.files import find_file
+ from dynaconf.utils.parse_conf import parse_conf_data
+-from dynaconf.vendor.dotenv import load_dotenv
++from dotenv import load_dotenv
+ 
+ 
+ def try_renamed(key, value, older_key, current_key):
+diff --git a/dynaconf/loaders/env_loader.py b/dynaconf/loaders/env_loader.py
+index e7b13bd..b034c8a 100644
+--- a/dynaconf/loaders/env_loader.py
++++ b/dynaconf/loaders/env_loader.py
+@@ -2,7 +2,7 @@ from os import environ
+ 
+ from dynaconf.utils import upperfy
+ from dynaconf.utils.parse_conf import parse_conf_data
+-from dynaconf.vendor.dotenv import cli as dotenv_cli
++from dotenv import cli as dotenv_cli
+ 
+ 
+ IDENTIFIER = "env"
+diff --git a/dynaconf/loaders/toml_loader.py b/dynaconf/loaders/toml_loader.py
+index 07b973f..d81d675 100644
+--- a/dynaconf/loaders/toml_loader.py
++++ b/dynaconf/loaders/toml_loader.py
+@@ -5,7 +5,7 @@ from dynaconf import default_settings
+ from dynaconf.constants import TOML_EXTENSIONS
+ from dynaconf.loaders.base import BaseLoader
+ from dynaconf.utils import object_merge
+-from dynaconf.vendor import toml
++import toml
+ 
+ 
+ def load(obj, env=None, silent=True, key=None, filename=None):
+diff --git a/dynaconf/loaders/yaml_loader.py b/dynaconf/loaders/yaml_loader.py
+index 33c6532..3ef419a 100644
+--- a/dynaconf/loaders/yaml_loader.py
++++ b/dynaconf/loaders/yaml_loader.py
+@@ -7,7 +7,7 @@ from dynaconf.constants import YAML_EXTENSIONS
+ from dynaconf.loaders.base import BaseLoader
+ from dynaconf.utils import object_merge
+ from dynaconf.utils.parse_conf import try_to_encode
+-from dynaconf.vendor.ruamel import yaml
++from ruamel import yaml
+ 
+ # Add support for Dynaconf Lazy values to YAML dumper
+ yaml.SafeDumper.yaml_representers[
+diff --git a/dynaconf/utils/parse_conf.py b/dynaconf/utils/parse_conf.py
+index c42b07a..01ccdae 100644
+--- a/dynaconf/utils/parse_conf.py
++++ b/dynaconf/utils/parse_conf.py
+@@ -9,7 +9,7 @@ from dynaconf.utils import isnamedtupleinstance
+ from dynaconf.utils import multi_replace
+ from dynaconf.utils import recursively_evaluate_lazy_format
+ from dynaconf.utils.boxing import DynaBox
+-from dynaconf.vendor import toml
++import toml
+ 
+ try:
+     from jinja2 import Environment
+diff --git a/dynaconf/vendor/box/converters.py b/dynaconf/vendor/box/converters.py
+index 93cdcfb..e34c7dc 100644
+--- a/dynaconf/vendor/box/converters.py
++++ b/dynaconf/vendor/box/converters.py
+@@ -7,9 +7,9 @@ _B='utf-8'
+ _A=None
+ import csv,json,sys,warnings
+ from pathlib import Path
+-import dynaconf.vendor.ruamel.yaml as yaml
++import ruamel.yaml as yaml
+ from dynaconf.vendor.box.exceptions import BoxError,BoxWarning
+-from dynaconf.vendor import toml
++import toml
+ BOX_PARAMETERS='default_box','default_box_attr','conversion_box','frozen_box','camel_killer_box','box_safe_prefix','box_duplicates','ordered_box','default_box_none_transform','box_dots','modify_tuples_box','box_intact_types','box_recast'
+ def _exists(filename,create=_E):
+ 	A=filename;B=Path(A)
+diff --git a/dynaconf/vendor/box/from_file.py b/dynaconf/vendor/box/from_file.py
+index daa1137..d75940b 100644
+--- a/dynaconf/vendor/box/from_file.py
++++ b/dynaconf/vendor/box/from_file.py
+@@ -1,8 +1,8 @@
+ from json import JSONDecodeError
+ from pathlib import Path
+ from typing import Union
+-from dynaconf.vendor.toml import TomlDecodeError
+-from dynaconf.vendor.ruamel.yaml import YAMLError
++from toml import TomlDecodeError
++from ruamel.yaml import YAMLError
+ from .exceptions import BoxError
+ from .box import Box
+ from .box_list import BoxList
+diff --git a/dynaconf/vendor_src/box/converters.py b/dynaconf/vendor_src/box/converters.py
+index c9a2293..ae42bf6 100644
+--- a/dynaconf/vendor_src/box/converters.py
++++ b/dynaconf/vendor_src/box/converters.py
+@@ -9,9 +9,9 @@ import sys
+ import warnings
+ from pathlib import Path
+ 
+-import dynaconf.vendor.ruamel.yaml as yaml
++import ruamel.yaml as yaml
+ from dynaconf.vendor.box.exceptions import BoxError, BoxWarning
+-from dynaconf.vendor import toml
++import toml
+ 
+ 
+ BOX_PARAMETERS = ('default_box', 'default_box_attr', 'conversion_box',
+diff --git a/dynaconf/vendor_src/box/from_file.py b/dynaconf/vendor_src/box/from_file.py
+index 2e2a6ad..3f76819 100644
+--- a/dynaconf/vendor_src/box/from_file.py
++++ b/dynaconf/vendor_src/box/from_file.py
+@@ -3,8 +3,8 @@
+ from json import JSONDecodeError
+ from pathlib import Path
+ from typing import Union
+-from dynaconf.vendor.toml import TomlDecodeError
+-from dynaconf.vendor.ruamel.yaml import YAMLError
++from toml import TomlDecodeError
++from ruamel.yaml import YAMLError
+ 
+ 
+ from .exceptions import BoxError
+diff --git a/tests/test_cli.py b/tests/test_cli.py
+index 6693701..df44409 100644
+--- a/tests/test_cli.py
++++ b/tests/test_cli.py
+@@ -11,7 +11,7 @@ from dynaconf.cli import main
+ from dynaconf.cli import read_file_in_root_directory
+ from dynaconf.cli import WRITERS
+ from dynaconf.utils.files import read_file
+-from dynaconf.vendor.click.testing import CliRunner
++from click.testing import CliRunner
+ 
+ 
+ runner = CliRunner()
+
+base-commit: ebf7b17cffd5e08b212948bd8036d580718d5bf8
+-- 
+2.32.0
diff --git a/gnu/packages/patches/elogind-revert-polkit-detection.patch b/gnu/packages/patches/elogind-revert-polkit-detection.patch
new file mode 100644
index 0000000000..43dd1684b6
--- /dev/null
+++ b/gnu/packages/patches/elogind-revert-polkit-detection.patch
@@ -0,0 +1,41 @@
+From 715ce0a6459e418f92e74c7ce52df3244c18f383 Mon Sep 17 00:00:00 2001
+From: Sven Eden <sven.eden@prydeworx.com>
+Date: Mon, 8 Mar 2021 08:40:08 +0100
+Subject: [PATCH] Revert "Disable polkit support if libpolkit is not installed"
+
+This reverts commit 1194dec4f8f2d1b8bd14e1625f34418ecfce817e.
+
+Removing polkit support with -Dpolkit=auto when libpolkit is not
+installed, removes the whole interface. This makes it impossible to
+add polkit support as a runtime dependency.
+
+Bug: #167
+Closes: #206
+Signed-off-by: Sven Eden <sven.eden@prydeworx.com>
+---
+ meson.build | 9 ---------
+ 1 file changed, 9 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index 2dd05db3c..f38551f55 100644
+--- a/meson.build
++++ b/meson.build
+@@ -1157,15 +1157,6 @@ if want_polkit != 'false' and not skip_deps
+                 message('Old polkit detected, will install pkla files')
+                 install_polkit_pkla = true
+         endif
+-#if 1 /// Disable polkit completely if libpolkit is not there. See elogind issue #167
+-        if not libpolkit.found()
+-                if want_polkit != 'auto'
+-                        error('Polkit requested but libpolkit was not found.')
+-                endif
+-                install_polkit = false
+-                want_polkit    = false
+-        endif
+-#endif // 1
+ endif
+ conf.set10('ENABLE_POLKIT', install_polkit)
+ 
+-- 
+2.33.1
+
diff --git a/gnu/packages/patches/emacs-exwm-fix-fullscreen-states.patch b/gnu/packages/patches/emacs-exwm-fix-fullscreen-states.patch
deleted file mode 100644
index 6d31021f67..0000000000
--- a/gnu/packages/patches/emacs-exwm-fix-fullscreen-states.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From edb930005b0ba83051ca8a59b493e9a3c8ef580a Mon Sep 17 00:00:00 2001
-From: Chris Feng <chris.w.feng@gmail.com>
-Date: Sun, 14 Jun 2020 00:00:00 +0000
-Subject: [PATCH] Fix fullscreen states
-
-* exwm-layout.el (exwm-layout-set-fullscreen,
-exwm-layout-unset-fullscreen): Use `exwm--id' for interactive use.
-(exwm-layout-unset-fullscreen): Mandatorily clear fullscreen states.
----
- exwm-layout.el | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
-
-diff --git a/exwm-layout.el b/exwm-layout.el
-index 170c2be..79d0c95 100644
---- a/exwm-layout.el
-+++ b/exwm-layout.el
-@@ -205,7 +205,7 @@
-                        :border-width 0
-                        :stack-mode xcb:StackMode:Above))
-     (cl-pushnew xcb:Atom:_NET_WM_STATE_FULLSCREEN exwm--ewmh-state)
--    (exwm-layout--set-ewmh-state id)
-+    (exwm-layout--set-ewmh-state exwm--id)
-     (xcb:flush exwm--connection)
-     (set-window-dedicated-p (get-buffer-window) t)
-     (exwm-input--release-keyboard exwm--id)))
-@@ -233,7 +233,9 @@
-       (let ((window (get-buffer-window nil t)))
-         (when window
-           (exwm-layout--show exwm--id window))))
--    (exwm-layout--set-ewmh-state id)
-+    (setq exwm--ewmh-state
-+          (delq xcb:Atom:_NET_WM_STATE_FULLSCREEN exwm--ewmh-state))
-+    (exwm-layout--set-ewmh-state exwm--id)
-     (xcb:flush exwm--connection)
-     (set-window-dedicated-p (get-buffer-window) nil)
-     (when (eq 'line-mode exwm--selected-input-mode)
--- 
-2.26.2
-
diff --git a/gnu/packages/patches/emacs-telega-path-placeholder.patch b/gnu/packages/patches/emacs-telega-path-placeholder.patch
index c20be36712..5829edd22a 100644
--- a/gnu/packages/patches/emacs-telega-path-placeholder.patch
+++ b/gnu/packages/patches/emacs-telega-path-placeholder.patch
@@ -1,36 +1,31 @@
-From 865b8c553722a971c68742c2e849e41eb0e2360c Mon Sep 17 00:00:00 2001
-From: Zhu Zihao <all_but_last@163.com>
-Date: Thu, 24 Jun 2021 23:43:50 +0800
-Subject: [PATCH] Replace code that search path with placeholder for
- configuration.
+From bf95de21faa623e48bca00d6a2c9b33ab2c5d812 Mon Sep 17 00:00:00 2001
+From: Andrew Tropin <andrew@trop.in>
+Date: Wed, 8 Dec 2021 11:01:31 +0300
+Subject: [PATCH] Use absolute path for telega-server-command.
 
 ---
- telega-server.el | 6 +-----
- telega-util.el   | 2 +-
- 2 files changed, 2 insertions(+), 6 deletions(-)
+ telega-customize.el | 2 +-
+ telega-util.el      | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
 
-diff --git a/telega-server.el b/telega-server.el
-index 999125d..0fa0817 100644
---- a/telega-server.el
-+++ b/telega-server.el
-@@ -142,11 +142,7 @@ Otherwise query user about building flags."
- (defun telega-server--find-bin ()
-   "Find telega-server executable.
- Raise error if not found."
--  (let ((exec-path (cons telega-directory exec-path)))
--    (or (executable-find "telega-server")
--        (progn (telega-server-build)
--               (executable-find "telega-server"))
--        (error "`telega-server' not found in exec-path"))))
-+  "@TELEGA_SERVER_BIN@")
+diff --git a/telega-customize.el b/telega-customize.el
+index 0af343f..cc2938c 100644
+--- a/telega-customize.el
++++ b/telega-customize.el
+@@ -591,7 +591,7 @@ In range [1..3].  Use 1."
+   :prefix "telega-server-"
+   :group 'telega)
  
- (defun telega-server-version ()
-   "Return telega-server version."
+-(defcustom telega-server-command "telega-server"
++(defcustom telega-server-command "@TELEGA_SERVER_BIN@"
+   "Command to run as telega server.
+ It should be absolute path or binary file searchable in `exec-path'."
+   :type 'string
 diff --git a/telega-util.el b/telega-util.el
-index 73a46b1..f53e20a 100644
+index 6340c27..01e3cb7 100644
 --- a/telega-util.el
 +++ b/telega-util.el
-@@ -464,7 +464,7 @@ N can't be 0."
+@@ -587,7 +587,7 @@ N can't be 0."
  
  (defun telega-etc-file (filename)
    "Return absolute path to FILENAME from etc/ directory in telega."
@@ -40,5 +35,5 @@ index 73a46b1..f53e20a 100644
  (defun telega-link-props (link-type link-to &optional face)
    "Generate props for link button openable with `telega-link--button-action'."
 -- 
-2.32.0
+2.34.0
 
diff --git a/gnu/packages/patches/emacs-telega-test-env.patch b/gnu/packages/patches/emacs-telega-test-env.patch
index 75fe2e12fc..c6b02be6ff 100644
--- a/gnu/packages/patches/emacs-telega-test-env.patch
+++ b/gnu/packages/patches/emacs-telega-test-env.patch
@@ -1,14 +1,24 @@
-Test Emacs environment on startup.
+From 237ea2471bb6521390bbac174ac2a8a5e9683e4d Mon Sep 17 00:00:00 2001
+From: Andrew Tropin <andrew@trop.in>
+Date: Tue, 7 Dec 2021 16:20:38 +0300
+Subject: [PATCH] Test Emacs environment on startup.
 
-Patch by Diego N. Barbato
+---
+ telega.el | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
---- a/telega.el	2020-02-07 17:07:18.549970090 +0100
-+++ b/telega.el	2020-02-07 17:10:08.383499765 +0100
-@@ -82,6 +82,7 @@
-   "Start telegramming.
- If prefix ARG is given, then will not pop to telega root buffer."
+diff --git a/telega.el b/telega.el
+index d6b28b5..40854ec 100644
+--- a/telega.el
++++ b/telega.el
+@@ -181,7 +181,7 @@ can't write to `telega-server-logfile'" logfile-dir)))
+ Pop to root buffer.
+ If `\\[universal-argument]' is specified, then do not pop to root buffer."
    (interactive "P")
+-
 +  (telega-test-env t)
-   (telega--create-hier)
- 
-   (unless (telega-server-live-p)
+   ;; For multiple accounts setup possibly select (if there is no
+   ;; default account declared) an account to use
+   (if (and telega-accounts (not (telega-account-current)))
+-- 
+2.34.0
diff --git a/gnu/packages/patches/enlightenment-fix-setuid-path.patch b/gnu/packages/patches/enlightenment-fix-setuid-path.patch
index a0efb29857..e4f98de7c8 100644
--- a/gnu/packages/patches/enlightenment-fix-setuid-path.patch
+++ b/gnu/packages/patches/enlightenment-fix-setuid-path.patch
@@ -1,9 +1,11 @@
+This diff was generated against enlightenment-0.25.0, targeting all the occurances of 'suid_exes'.
+
 diff --git a/src/bin/e_auth.c b/src/bin/e_auth.c
-index 8b0aa6641..3dff0ad84 100644
+index 6d07a0ac3..31e0e728f 100644
 --- a/src/bin/e_auth.c
 +++ b/src/bin/e_auth.c
-@@ -12,8 +12,7 @@ e_auth_begin(char *passwd)
-    if (pwlen == 0) goto out;
+@@ -38,8 +38,7 @@ e_auth_begin(char *passwd)
+    pwlen = strlen(passwd);
  
     snprintf(buf, sizeof(buf),
 -            "%s/enlightenment/utils/enlightenment_ckpasswd pw",
@@ -11,9 +13,9 @@ index 8b0aa6641..3dff0ad84 100644
 +            "/run/setuid-programs/enlightenment_ckpasswd pw");
     exe = ecore_exe_pipe_run(buf, ECORE_EXE_PIPE_WRITE, NULL);
     if (!exe) goto out;
-    if (ecore_exe_send(exe, passwd, pwlen) != EINA_TRUE) goto out;
-@@ -47,8 +46,7 @@ e_auth_polkit_begin(char *passwd, const char *cookie, unsigned int uid)
-    if (pwlen == 0) goto out;
+    snprintf(buf, sizeof(buf), "pw %s", passwd);
+@@ -75,8 +74,7 @@ e_auth_polkit_begin(char *passwd, const char *cookie, unsigned int uid)
+    pwlen = strlen(passwd);
  
     snprintf(buf, sizeof(buf),
 -            "%s/enlightenment/utils/enlightenment_ckpasswd pk",
@@ -54,23 +56,24 @@ index 9b10b3117..74e6b72ad 100644
       }
     v->guard = ecore_timer_loop_add(E_FM_MOUNT_TIMEOUT, (Ecore_Task_Cb)_e_fm_main_eeze_vol_mount_timeout, v);
 diff --git a/src/bin/e_start_main.c b/src/bin/e_start_main.c
-index b2c439455..cb16c7bd4 100644
+index 722063339..2da2d5a23 100644
 --- a/src/bin/e_start_main.c
 +++ b/src/bin/e_start_main.c
-@@ -710,7 +710,7 @@ main(int argc, char **argv)
-             "E_ALERT_FONT_DIR=%s/data/fonts", eina_prefix_data_get(pfx));
+@@ -596,8 +596,7 @@ main(int argc, char **argv)
+               eina_prefix_data_get(pfx));
     putenv(buf2);
-    snprintf(buf3, sizeof(buf3),
--            "E_ALERT_SYSTEM_BIN=%s/enlightenment/utils/enlightenment_system", eina_prefix_lib_get(pfx));
-+            "E_ALERT_SYSTEM_BIN=/run/setuid-programs/enlightenment_system");
+    myasprintf(&buf3,
+-              "E_ALERT_SYSTEM_BIN=%s/enlightenment/utils/enlightenment_system",
+-              eina_prefix_lib_get(pfx));
++              "E_ALERT_SYSTEM_BIN=/run/setuid-programs/enlightenment_system");
     putenv(buf3);
  
-    if ((valgrind_mode || valgrind_tool) &&
+    home = getenv("HOME");
 diff --git a/src/bin/e_system.c b/src/bin/e_system.c
-index 1e7aabb64..dc0173219 100644
+index bfd43e7e2..45d78b7ed 100644
 --- a/src/bin/e_system.c
 +++ b/src/bin/e_system.c
-@@ -132,7 +132,7 @@ _system_spawn(void)
+@@ -133,7 +133,7 @@ _system_spawn(void)
     else _respawn_count = 0;
     if (_respawn_count > 5) return;
     snprintf(buf, sizeof(buf),
diff --git a/gnu/packages/patches/eog-update-libportal-usage.patch b/gnu/packages/patches/eog-update-libportal-usage.patch
new file mode 100644
index 0000000000..220a16ddc4
--- /dev/null
+++ b/gnu/packages/patches/eog-update-libportal-usage.patch
@@ -0,0 +1,40 @@
+Fix eog to work with libportal-0.5
+
+This patch is extracted from upstream, see here
+https://gitlab.gnome.org/GNOME/eog/-/commit/a06e6325907e136678b0bbe7058c25d688034afd
+
+diff --git a/meson.build b/meson.build
+index 9a32e4bb..9d49aa45 100644
+--- a/meson.build
++++ b/meson.build
+@@ -165,10 +165,14 @@ config_h.set('HAVE_EXEMPI', enable_xmp)
+ # xdg-desktop-portal support with libportal (optional)
+ enable_libportal = get_option('libportal')
+ if enable_libportal
+-  libportal_dep = dependency('libportal', version: '>= 0.3', required: false)
++  libportal_dep = dependency('libportal', version: '>= 0.5', required: false)
+   assert(libportal_dep.found() and cc.has_header('libportal/portal.h', dependencies: libportal_dep),
+          'xdg-desktop-portal support requested but library not found. Please use -Dlibportal=false')
+ 
+-  common_deps += libportal_dep
++  libportal_gtk3_dep = dependency('libportal-gtk3', version: '>= 0.5', required: false)
++  assert(libportal_gtk3_dep.found() and cc.has_header('libportal-gtk3/portal-gtk3.h', dependencies: libportal_gtk3_dep),
++         'xdg-desktop-portal support requested but library not found. Please use -Dlibportal=false')
++
++  common_deps += [libportal_dep, libportal_gtk3_dep]
+ endif
+ config_h.set('HAVE_LIBPORTAL', enable_libportal)
+
+diff --git a/src/eog-util.c b/src/eog-util.c
+index 90b9768e..56d23472 100644
+--- a/src/eog-util.c
++++ b/src/eog-util.c
+@@ -45,7 +45,7 @@
+ #include <glib/gi18n.h>
+ #ifdef HAVE_LIBPORTAL
+ #include <libportal/portal.h>
+-#include <libportal/portal-gtk3.h>
++#include <libportal-gtk3/portal-gtk3.h>
+ #endif
+ 
+ void
diff --git a/gnu/packages/patches/epiphany-update-libportal-usage.patch b/gnu/packages/patches/epiphany-update-libportal-usage.patch
new file mode 100644
index 0000000000..0d8ea045fb
--- /dev/null
+++ b/gnu/packages/patches/epiphany-update-libportal-usage.patch
@@ -0,0 +1,53 @@
+Fix for epiphany with libportal-0.5.
+
+This patch was adapted from upstream
+https://gitlab.gnome.org/GNOME/epiphany/-/commit/e4d259f614f75c26ad0d2094f4f569ffd1bc06d1
+
+diff --git a/lib/ephy-flatpak-utils.c b/lib/ephy-flatpak-utils.c
+index 6fc9a5dec17a63c0660cbc1d95103c8f77231d30..0fd90b3f178392930e812a8391fd81bf1371b8bf 100644
+--- a/lib/ephy-flatpak-utils.c
++++ b/lib/ephy-flatpak-utils.c
+@@ -29,7 +29,7 @@
+ #include <gio/gio.h>
+ #include <gio/gunixfdlist.h>
+ #if USE_LIBPORTAL
+-#include <libportal/portal-gtk3.h>
++#include <libportal-gtk3/portal-gtk3.h>
+ #endif
+ #include <string.h>
+ #include <sys/stat.h>
+diff --git a/lib/meson.build b/lib/meson.build
+index 264f9c5fb66268fc248f780b8d1c06c8291f856d..db0a0557f0ae634d7fb95e57aba0cd901ca4d6c1 100644
+--- a/lib/meson.build
++++ b/lib/meson.build
+@@ -66,6 +66,7 @@ libephymisc_deps = [
+   libxml_dep,
+   m_dep,
+   portal_dep,
++  portal_gtk_dep,
+   sqlite3_dep,
+   webkit2gtk_dep
+ ]
+diff --git a/meson.build b/meson.build
+index 0b9f862b22a23619289342ec39fa0a0274558c25..4285a975004e48366789a4e66f8b23f3af05a636 100644
+--- a/meson.build
++++ b/meson.build
+@@ -95,7 +95,8 @@ libhandy_dep = dependency('libhandy-1', version: '>= 1.5.0')
+ libsecret_dep = dependency('libsecret-1', version: '>= 0.19.0')
+ libxml_dep = dependency('libxml-2.0', version: '>= 2.6.12')
+ nettle_dep = dependency('nettle', version: nettle_requirement)
+-portal_dep = dependency('libportal', version: '>= 0.0.2', required: get_option('libportal'))
++portal_dep = dependency('libportal', version: '>= 0.5', required: get_option('libportal'))
++portal_gtk_dep = dependency('libportal-gtk3', version: '>= 0.5', required: get_option('libportal'))
+ sqlite3_dep = dependency('sqlite3', version: '>= 3.22')
+ 
+ if get_option('soup2').enabled()
+@@ -108,7 +109,7 @@ else
+   webkit2gtk_web_extension_dep = dependency('webkit2gtk-web-extension-4.1', version: webkitgtk_requirement)
+ endif
+ 
+-conf.set10('USE_LIBPORTAL', portal_dep.found())
++conf.set10('USE_LIBPORTAL', portal_dep.found() and portal_gtk_dep.found())
+ 
+ webkit_revision = webkit2gtk_dep.get_variable(pkgconfig : 'revision', default_value : '')
+ if webkit_revision == 'tarball'
diff --git a/gnu/packages/patches/evolution-CVE-2020-11879.patch b/gnu/packages/patches/evolution-CVE-2020-11879.patch
deleted file mode 100644
index 8c85895aab..0000000000
--- a/gnu/packages/patches/evolution-CVE-2020-11879.patch
+++ /dev/null
@@ -1,122 +0,0 @@
-From 6489f20d6905cc797e2b2581c415e558c457caa7 Mon Sep 17 00:00:00 2001
-From: Milan Crha <mcrha@redhat.com>
-Date: Wed, 12 Feb 2020 18:59:52 +0100
-Subject: [PATCH] I#784 - Warn about and limit what can be attached using
- mailto: URI
-
-Closes https://gitlab.gnome.org/GNOME/evolution/issues/784
----
- src/composer/e-msg-composer.c | 58 +++++++++++++++++++++++++++++------
- src/e-util/e-system.error.xml |  7 ++++-
- 2 files changed, 54 insertions(+), 11 deletions(-)
-
-diff --git a/src/composer/e-msg-composer.c b/src/composer/e-msg-composer.c
-index e4c9ac095e..cd3168d882 100644
---- a/src/composer/e-msg-composer.c
-+++ b/src/composer/e-msg-composer.c
-@@ -4761,7 +4761,8 @@ handle_mailto (EMsgComposer *composer,
- 	gchar *header, *content, *buf;
- 	gsize nread, nwritten;
- 	const gchar *p;
--	gint len, clen;
-+	gint len, clen, has_attachments = 0;
-+	gboolean has_blacklisted_attachment = FALSE;
- 
- 	table = e_msg_composer_get_header_table (composer);
- 	view = e_msg_composer_get_attachment_view (composer);
-@@ -4844,22 +4845,36 @@ handle_mailto (EMsgComposer *composer,
- 			} else if (!g_ascii_strcasecmp (header, "attach") ||
- 				   !g_ascii_strcasecmp (header, "attachment")) {
- 				EAttachment *attachment;
-+				GFile *file;
- 
- 				camel_url_decode (content);
--				if (file_is_blacklisted (content))
--					e_alert_submit (
--						E_ALERT_SINK (e_msg_composer_get_editor (composer)),
--						"mail:blacklisted-file",
--						content, NULL);
- 				if (g_ascii_strncasecmp (content, "file:", 5) == 0)
- 					attachment = e_attachment_new_for_uri (content);
- 				else
- 					attachment = e_attachment_new_for_path (content);
--				e_attachment_store_add_attachment (store, attachment);
--				e_attachment_load_async (
--					attachment, (GAsyncReadyCallback)
--					e_attachment_load_handle_error, composer);
-+				file = e_attachment_ref_file (attachment);
-+				if (!file || !g_file_peek_path (file) ||
-+				    !g_file_test (g_file_peek_path (file), G_FILE_TEST_EXISTS) ||
-+				    g_file_test (g_file_peek_path (file), G_FILE_TEST_IS_DIR)) {
-+					/* Do nothing, simply ignore the attachment request */
-+				} else {
-+					has_attachments++;
-+
-+					if (file_is_blacklisted (content)) {
-+						has_blacklisted_attachment = TRUE;
-+						e_alert_submit (
-+							E_ALERT_SINK (e_msg_composer_get_editor (composer)),
-+							"mail:blacklisted-file",
-+							content, NULL);
-+					}
-+
-+					e_attachment_store_add_attachment (store, attachment);
-+					e_attachment_load_async (
-+						attachment, (GAsyncReadyCallback)
-+						e_attachment_load_handle_error, composer);
-+				}
- 				g_object_unref (attachment);
-+				g_clear_object (&file);
- 			} else if (!g_ascii_strcasecmp (header, "from")) {
- 				/* Ignore */
- 			} else if (!g_ascii_strcasecmp (header, "reply-to")) {
-@@ -4883,6 +4898,29 @@ handle_mailto (EMsgComposer *composer,
- 
- 	g_free (buf);
- 
-+	if (has_attachments && !has_blacklisted_attachment) {
-+		const gchar *primary;
-+		gchar *secondary;
-+
-+		primary = g_dngettext (GETTEXT_PACKAGE,
-+			"Review attachment before sending.",
-+			"Review attachments before sending.",
-+			has_attachments);
-+
-+		secondary = g_strdup_printf (g_dngettext (GETTEXT_PACKAGE,
-+			"There had been added %d attachment. Make sure it does not contain any sensitive information before sending the message.",
-+			"There had been added %d attachments. Make sure they do not contain any sensitive information before sending the message.",
-+			has_attachments),
-+			has_attachments);
-+
-+		e_alert_submit (
-+			E_ALERT_SINK (e_msg_composer_get_editor (composer)),
-+			"system:generic-warning",
-+			primary, secondary, NULL);
-+
-+		g_free (secondary);
-+	}
-+
- 	merge_always_cc_and_bcc (table, to, &cc, &bcc);
- 
- 	tov = destination_list_to_vector (to);
-diff --git a/src/e-util/e-system.error.xml b/src/e-util/e-system.error.xml
-index ddcf989fda..02facb7d26 100644
---- a/src/e-util/e-system.error.xml
-+++ b/src/e-util/e-system.error.xml
-@@ -1,6 +1,11 @@
- <?xml version="1.0"?>
- <error-list domain="system">
--  <error type="error" id="generic-error">
-+  <error id="generic-error" type="error">
-+    <primary>{0}</primary>
-+    <secondary>{1}</secondary>
-+  </error>
-+
-+  <error id="generic-warning" type="warning">
-     <primary>{0}</primary>
-     <secondary>{1}</secondary>
-   </error>
--- 
-GitLab
-
diff --git a/gnu/packages/patches/evolution-data-server-CVE-2020-14928.patch b/gnu/packages/patches/evolution-data-server-CVE-2020-14928.patch
deleted file mode 100644
index 421f292c9d..0000000000
--- a/gnu/packages/patches/evolution-data-server-CVE-2020-14928.patch
+++ /dev/null
@@ -1,115 +0,0 @@
-From ba82be72cfd427b5d72ff21f929b3a6d8529c4df Mon Sep 17 00:00:00 2001
-From: Milan Crha <mcrha@redhat.com>
-Date: Mon, 22 Jun 2020 13:40:17 +0200
-Subject: [PATCH] I#226 - CVE-2020-14928: Response Injection via STARTTLS in
- SMTP and POP3
-
-Closes https://gitlab.gnome.org/GNOME/evolution-data-server/-/issues/226
----
- src/camel/camel-stream-buffer.c               | 19 +++++++++++++++++++
- src/camel/camel-stream-buffer.h               |  1 +
- src/camel/providers/pop3/camel-pop3-store.c   |  2 ++
- src/camel/providers/pop3/camel-pop3-stream.c  | 11 +++++++++++
- src/camel/providers/pop3/camel-pop3-stream.h  |  1 +
- .../providers/smtp/camel-smtp-transport.c     |  2 ++
- 6 files changed, 36 insertions(+)
-
-diff --git a/src/camel/camel-stream-buffer.c b/src/camel/camel-stream-buffer.c
-index 3e2e0dd36..a6f605ae5 100644
---- a/src/camel/camel-stream-buffer.c
-+++ b/src/camel/camel-stream-buffer.c
-@@ -518,3 +518,22 @@ camel_stream_buffer_read_line (CamelStreamBuffer *sbf,
- 
- 	return g_strdup ((gchar *) sbf->priv->linebuf);
- }
-+
-+/**
-+ * camel_stream_buffer_discard_cache:
-+ * @sbf: a #CamelStreamBuffer
-+ *
-+ * Discards any cached data in the @sbf. The next read reads
-+ * from the stream.
-+ *
-+ * Since: 3.38
-+ **/
-+void
-+camel_stream_buffer_discard_cache (CamelStreamBuffer *sbf)
-+{
-+	g_return_if_fail (CAMEL_IS_STREAM_BUFFER (sbf));
-+
-+	sbf->priv->ptr = sbf->priv->buf;
-+	sbf->priv->end = sbf->priv->buf;
-+	sbf->priv->ptr[0] = '\0';
-+}
-diff --git a/src/camel/camel-stream-buffer.h b/src/camel/camel-stream-buffer.h
-index ef92cfd8e..094e9926b 100644
---- a/src/camel/camel-stream-buffer.h
-+++ b/src/camel/camel-stream-buffer.h
-@@ -93,6 +93,7 @@ gint		camel_stream_buffer_gets	(CamelStreamBuffer *sbf,
- gchar *		camel_stream_buffer_read_line	(CamelStreamBuffer *sbf,
- 						 GCancellable *cancellable,
- 						 GError **error);
-+void		camel_stream_buffer_discard_cache	(CamelStreamBuffer *sbf);
- 
- G_END_DECLS
- 
-diff --git a/src/camel/providers/pop3/camel-pop3-store.c b/src/camel/providers/pop3/camel-pop3-store.c
-index 81c370f0a..5c9eb1eaa 100644
---- a/src/camel/providers/pop3/camel-pop3-store.c
-+++ b/src/camel/providers/pop3/camel-pop3-store.c
-@@ -205,6 +205,8 @@ connect_to_server (CamelService *service,
- 
- 	if (tls_stream != NULL) {
- 		camel_stream_set_base_stream (stream, tls_stream);
-+		/* Truncate any left cached input from the insecure part of the session */
-+		camel_pop3_stream_discard_cache (pop3_engine->stream);
- 		g_object_unref (tls_stream);
- 	} else {
- 		g_prefix_error (
-diff --git a/src/camel/providers/pop3/camel-pop3-stream.c b/src/camel/providers/pop3/camel-pop3-stream.c
-index 74bb11e61..c485b9bd6 100644
---- a/src/camel/providers/pop3/camel-pop3-stream.c
-+++ b/src/camel/providers/pop3/camel-pop3-stream.c
-@@ -457,3 +457,14 @@ camel_pop3_stream_getd (CamelPOP3Stream *is,
- 
- 	return 1;
- }
-+
-+void
-+camel_pop3_stream_discard_cache (CamelPOP3Stream *is)
-+{
-+	if (is) {
-+		is->ptr = is->end = is->buf;
-+		is->lineptr = is->linebuf;
-+		is->lineend = is->linebuf + CAMEL_POP3_STREAM_LINE_SIZE;
-+		is->ptr[0] = '\n';
-+	}
-+}
-diff --git a/src/camel/providers/pop3/camel-pop3-stream.h b/src/camel/providers/pop3/camel-pop3-stream.h
-index bb6dbb903..128c8c45a 100644
---- a/src/camel/providers/pop3/camel-pop3-stream.h
-+++ b/src/camel/providers/pop3/camel-pop3-stream.h
-@@ -87,6 +87,7 @@ gint		camel_pop3_stream_getd		(CamelPOP3Stream *is,
- 						 guint *len,
- 						 GCancellable *cancellable,
- 						 GError **error);
-+void		camel_pop3_stream_discard_cache	(CamelPOP3Stream *is);
- 
- G_END_DECLS
- 
-diff --git a/src/camel/providers/smtp/camel-smtp-transport.c b/src/camel/providers/smtp/camel-smtp-transport.c
-index 035baf367..1fc0f3206 100644
---- a/src/camel/providers/smtp/camel-smtp-transport.c
-+++ b/src/camel/providers/smtp/camel-smtp-transport.c
-@@ -323,6 +323,8 @@ connect_to_server (CamelService *service,
- 
- 	if (tls_stream != NULL) {
- 		camel_stream_set_base_stream (stream, tls_stream);
-+		/* Truncate any left cached input from the insecure part of the session */
-+		camel_stream_buffer_discard_cache (transport->istream);
- 		g_object_unref (tls_stream);
- 	} else {
- 		g_prefix_error (
--- 
-GitLab
-
diff --git a/gnu/packages/patches/evolution-data-server-CVE-2020-16117.patch b/gnu/packages/patches/evolution-data-server-CVE-2020-16117.patch
deleted file mode 100644
index b2c0622a90..0000000000
--- a/gnu/packages/patches/evolution-data-server-CVE-2020-16117.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 2cc39592b532cf0dc994fd3694b8e6bf924c9ab5 Mon Sep 17 00:00:00 2001
-From: Milan Crha <mcrha@redhat.com>
-Date: Mon, 10 Feb 2020 10:00:32 +0100
-Subject: [PATCH] I#189 - Crash on malformed server response with minimal
- capabilities
-
-Closes https://gitlab.gnome.org/GNOME/evolution-data-server/issues/189
----
- src/camel/providers/imapx/camel-imapx-server.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/src/camel/providers/imapx/camel-imapx-server.c b/src/camel/providers/imapx/camel-imapx-server.c
-index 3c38fb1e9..3883321ec 100644
---- a/src/camel/providers/imapx/camel-imapx-server.c
-+++ b/src/camel/providers/imapx/camel-imapx-server.c
-@@ -3045,7 +3045,8 @@ connected:
- 
- 			/* See if we got new capabilities
- 			 * in the STARTTLS response. */
--			imapx_free_capability (is->priv->cinfo);
-+			if (is->priv->cinfo)
-+				imapx_free_capability (is->priv->cinfo);
- 			is->priv->cinfo = NULL;
- 			if (ic->status->condition == IMAPX_CAPABILITY) {
- 				is->priv->cinfo = ic->status->u.cinfo;
--- 
-GitLab
-
diff --git a/gnu/packages/patches/evolution-data-server-libical-compat.patch b/gnu/packages/patches/evolution-data-server-libical-compat.patch
deleted file mode 100644
index da4302d42e..0000000000
--- a/gnu/packages/patches/evolution-data-server-libical-compat.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-Prevent test failure and possible data loss due to API change in libical 3.0.7.
-
-https://gitlab.gnome.org/GNOME/evolution-data-server/issues/185
-https://lists.infradead.org/pipermail/libical-devel/2020-January/000907.html
-
-Adapted from upstream:
-
-https://gitlab.gnome.org/GNOME/evolution-data-server/commit/77384ab552c19bf374dbeda53dc37f98d07bd4ec
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index e16b8b225..b3c881967 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -111,7 +111,7 @@ add_definitions(-DSOUP_VERSION_MIN_REQUIRED=${soup_encoded_version})
- 
- set(gcr_minimum_version 3.4)
- set(libgdata_minimum_version 0.15.1)
--set(libical_glib_minimum_version 3.0.5)
-+set(libical_glib_minimum_version 3.0.7)
- set(libsecret_minimum_version 0.5)
- set(libxml_minimum_version 2.0.0)
- set(sqlite_minimum_version 3.7.17)
-diff --git a/src/calendar/libedata-cal/e-cal-meta-backend.c b/src/calendar/libedata-cal/e-cal-meta-backend.c
-index 7501f2a43..93f4806ba 100644
---- a/src/calendar/libedata-cal/e-cal-meta-backend.c
-+++ b/src/calendar/libedata-cal/e-cal-meta-backend.c
-@@ -4067,8 +4067,7 @@ e_cal_meta_backend_inline_local_attachments_sync (ECalMetaBackend *meta_backend,
- 					gchar *base64;
- 
- 					base64 = g_base64_encode ((const guchar *) content, len);
--					new_attach = i_cal_attach_new_from_data (base64, NULL, NULL);
-+					new_attach = i_cal_attach_new_from_data (base64, (GFunc) g_free, NULL);
- 					g_free (content);
--					g_free (base64);
- 
- 					ecmb_remove_all_but_filename_parameter (prop);
diff --git a/gnu/packages/patches/evolution-data-server-locales.patch b/gnu/packages/patches/evolution-data-server-locales.patch
deleted file mode 100644
index 48baefb0d8..0000000000
--- a/gnu/packages/patches/evolution-data-server-locales.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-This patch fixes locale canonicalization when using newer versions of
-ICU.  It comes from the upstream repo, and should appear starting in
-version 3.33.5.
-
-From fe4ac94ce3c14f200e049a5d102fc0e4b811c71e Mon Sep 17 00:00:00 2001
-From: Milan Crha <mcrha@redhat.com>
-Date: Tue, 16 Jul 2019 07:22:07 +0200
-Subject: [PATCH] I#137 - POSIX locale tests fail with ICU 64.x
-
-Closes https://gitlab.gnome.org/GNOME/evolution-data-server/issues/137
----
- src/libedataserver/e-collator.c | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/src/libedataserver/e-collator.c b/src/libedataserver/e-collator.c
-index 718eac5da..ec2cf7951 100644
---- a/src/libedataserver/e-collator.c
-+++ b/src/libedataserver/e-collator.c
-@@ -132,6 +132,11 @@ canonicalize_locale (const gchar *posix_locale,
- 	gint   len;
- 	const gchar *collation_type = NULL;
- 
-+	if (posix_locale && (
-+	    g_ascii_strcasecmp (posix_locale, "C") == 0 ||
-+	    g_ascii_strcasecmp (posix_locale, "POSIX") == 0))
-+		posix_locale = "en_US_POSIX";
-+
- 	len = uloc_canonicalize (posix_locale, locale_buffer, LOCALE_BUFFER_LEN, &status);
- 
- 	if (U_FAILURE (status)) {
--- 
-2.22.0
-
diff --git a/gnu/packages/patches/fifengine-boost-compat.patch b/gnu/packages/patches/fifengine-boost-compat.patch
new file mode 100644
index 0000000000..dcbf923297
--- /dev/null
+++ b/gnu/packages/patches/fifengine-boost-compat.patch
@@ -0,0 +1,17 @@
+Fix build with newer Boost.
+
+Taken from upstream:
+
+  https://github.com/fifengine/fifengine/commit/8072f18a9bf4e75c3e1b197b6ccda11e82954460
+
+diff --git a/engine/core/vfs/zip/zipnode.cpp b/engine/core/vfs/zip/zipnode.cpp
+--- a/engine/core/vfs/zip/zipnode.cpp
++++ b/engine/core/vfs/zip/zipnode.cpp
+@@ -28,6 +28,7 @@
+ #include "vfs/fife_boost_filesystem.h"
+ 
+ #include "zipnode.h"
++#include <algorithm>
+ 
+ namespace {
+     /** helper function to find a value in a ZipNodeContainer
diff --git a/gnu/packages/patches/findutils-test-rwlock-threads.patch b/gnu/packages/patches/findutils-test-rwlock-threads.patch
deleted file mode 100644
index 3062577c21..0000000000
--- a/gnu/packages/patches/findutils-test-rwlock-threads.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-Skip "test-rwlock1" when multithreading is disabled, which is the case
-during bootstrapping on architectures not supported by GNU Mes.
-
-Taken from upstream gnulib:
-https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=fdff8bd09a7f053381f8bdb107ab5280b7c95959
-
-diff --git a/gnulib-tests/test-rwlock1.c b/gnulib-tests/test-rwlock1.c
---- a/gnulib-tests/test-rwlock1.c
-+++ b/gnulib-tests/test-rwlock1.c
-@@ -21,6 +21,8 @@
- 
- #include <config.h>
- 
-+#if USE_ISOC_THREADS || USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS || USE_WINDOWS_THREADS
-+
- #include "glthread/lock.h"
- 
- #include <errno.h>
-@@ -151,3 +153,18 @@ main ()
-       sleep (1);
-     }
- }
-+
-+#else
-+
-+/* No multithreading available.  */
-+
-+#include <stdio.h>
-+
-+int
-+main ()
-+{
-+  fputs ("Skipping test: multithreading not enabled\n", stderr);
-+  return 77;
-+}
-+
-+#endif
-
diff --git a/gnu/packages/patches/flatpak-fix-path.patch b/gnu/packages/patches/flatpak-fix-path.patch
new file mode 100644
index 0000000000..e87a08a7fe
--- /dev/null
+++ b/gnu/packages/patches/flatpak-fix-path.patch
@@ -0,0 +1,29 @@
+Flatpak writes files for installed applications with the full Flatpak (store) path. This patch makes it write just "flatpak", using Flatpak from PATH. This is similar to the NixOS [0] patch, updated for Flatpak 1.12.1
+
+[0] https://github.com/NixOS/nixpkgs/blob/bf4167861d0f864b0fc457778d54feb4a2675ea2/pkgs/development/libraries/flatpak/use-flatpak-from-path.patch
+
+diff --git a/common/flatpak-dir.c b/common/flatpak-dir.c
+index 80ff5e5f..0c111c31 100644
+--- a/common/flatpak-dir.c
++++ b/common/flatpak-dir.c
+@@ -7134,8 +7134,7 @@ export_desktop_file (const char         *app,
+         flatpak = FLATPAK_BINDIR "/flatpak";
+
+       g_string_append_printf (new_exec,
+-                              "%s run --branch=%s --arch=%s",
+-                              flatpak,
++                              "flatpak run --branch=%s --arch=%s",
+                               escaped_branch,
+                               escaped_arch);
+
+@@ -8467,8 +8466,8 @@ flatpak_dir_deploy (FlatpakDir          *self,
+       if ((flatpak = g_getenv ("FLATPAK_BINARY")) == NULL)
+         flatpak = FLATPAK_BINDIR "/flatpak";
+
+-      bin_data = g_strdup_printf ("#!/bin/sh\nexec %s run --branch=%s --arch=%s %s \"$@\"\n",
+-                                  flatpak, escaped_branch, escaped_arch, escaped_app);
++      bin_data = g_strdup_printf ("#!/bin/sh\nexec flatpak run --branch=%s --arch=%s %s \"$@\"\n",
++                                  escaped_branch, escaped_arch, escaped_app);
+       if (!g_file_replace_contents (wrapper, bin_data, strlen (bin_data), NULL, FALSE,
+                                     G_FILE_CREATE_REPLACE_DESTINATION, NULL, cancellable, error))
+         return FALSE;
diff --git a/gnu/packages/patches/fontconfig-cache-ignore-mtime.patch b/gnu/packages/patches/fontconfig-cache-ignore-mtime.patch
new file mode 100644
index 0000000000..b6e942ee10
--- /dev/null
+++ b/gnu/packages/patches/fontconfig-cache-ignore-mtime.patch
@@ -0,0 +1,15 @@
+Pretend that stat's mtime is broken, so that the fontconfig cache does not
+depend upon modification time to determine if a cache is stale.
+
+diff --git a/src/fcstat.c b/src/fcstat.c
+index 5a2bd7c..d603a96 100644
+--- a/src/fcstat.c
++++ b/src/fcstat.c
+@@ -431,6 +431,7 @@ FcIsFsMmapSafe (int fd)
+ FcBool
+ FcIsFsMtimeBroken (const FcChar8 *dir)
+ {
++    return FcTrue;
+     int fd = FcOpen ((const char *) dir, O_RDONLY);
+ 
+     if (fd != -1)
diff --git a/gnu/packages/patches/fontconfig-hurd-path-max.patch b/gnu/packages/patches/fontconfig-hurd-path-max.patch
deleted file mode 100644
index f804e6801f..0000000000
--- a/gnu/packages/patches/fontconfig-hurd-path-max.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-Avoid usage of PATH_MAX.
-
-Taken from https://salsa.debian.org/freedesktop-team/fontconfig/-/blob/master/debian/patches/path_max.patch
-
-Index: fontconfig-2.13.1/src/fccfg.c
-===================================================================
---- fontconfig-2.13.1.orig/src/fccfg.c
-+++ fontconfig-2.13.1/src/fccfg.c
-@@ -2231,7 +2231,7 @@ FcConfigRealFilename (FcConfig		*config,
- 
-     if (n)
-     {
--	FcChar8 buf[PATH_MAX];
-+	FcChar8 buf[FC_PATH_MAX];
- 	ssize_t len;
- 
- 	if (sysroot)
diff --git a/gnu/packages/patches/freecad-boost-serialization.patch b/gnu/packages/patches/freecad-boost-serialization.patch
new file mode 100644
index 0000000000..374eabc966
--- /dev/null
+++ b/gnu/packages/patches/freecad-boost-serialization.patch
@@ -0,0 +1,27 @@
+Taken from: https://github.com/archlinux/svntogit-community/blob/packages/freecad/trunk/freecad-boost.patch.
+
+Index: FreeCAD-0.19.2/CMakeLists.txt
+===================================================================
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -46,6 +46,7 @@ if(NOT FREECAD_LIBPACK_USE OR FREECAD_LI
+     SetupPCL()
+     SetupPybind11()
+     SetupBoost()
++	set(Boost_LIBRARIES_App ${Boost_LIBRARIES})
+     SetupXercesC()
+     find_package(ZLIB REQUIRED)
+     find_package(PyCXX REQUIRED)
+Index: FreeCAD-0.19.2/src/App/CMakeLists.txt
+===================================================================
+--- a/src/App/CMakeLists.txt
++++ b/src/App/CMakeLists.txt
+@@ -59,7 +59,7 @@ include_directories(
+ 
+ set(FreeCADApp_LIBS
+     FreeCADBase
+-    ${Boost_LIBRARIES}
++    ${Boost_LIBRARIES_App}
+ )
+ 
+ if (BUILD_QT5)
diff --git a/gnu/packages/patches/freecad-vtk9.patch b/gnu/packages/patches/freecad-vtk9.patch
new file mode 100644
index 0000000000..74568f4318
--- /dev/null
+++ b/gnu/packages/patches/freecad-vtk9.patch
@@ -0,0 +1,827 @@
+From bb9bcbd51df7c3cb76c5823038e4ea0f7e25a9ff Mon Sep 17 00:00:00 2001
+From: wmayer <wmayer@users.sourceforge.net>
+Date: Mon, 12 Oct 2020 17:56:03 +0200
+Subject: [PATCH] Make smesh compile with vtk9
+
+---
+ .../salomesmesh/inc/SMDS_MeshElement.hxx      |  9 +++-
+ .../salomesmesh/inc/SMDS_UnstructuredGrid.hxx |  4 ++
+ .../salomesmesh/src/SMDS/SMDS_BallElement.cpp |  9 +++-
+ .../salomesmesh/src/SMDS/SMDS_Downward.cpp    | 44 +++++++++----------
+ .../salomesmesh/src/SMDS/SMDS_Mesh.cpp        |  6 ++-
+ .../src/SMDS/SMDS_Mesh0DElement.cpp           | 12 +++++
+ .../salomesmesh/src/SMDS/SMDS_MeshNode.cpp    | 10 ++---
+ .../src/SMDS/SMDS_UnstructuredGrid.cpp        | 35 +++++++++++++--
+ .../src/SMDS/SMDS_VtkCellIterator.cpp         |  7 +--
+ .../salomesmesh/src/SMDS/SMDS_VtkEdge.cpp     | 19 +++++++-
+ .../salomesmesh/src/SMDS/SMDS_VtkFace.cpp     | 29 ++++++++++--
+ .../salomesmesh/src/SMDS/SMDS_VtkVolume.cpp   | 38 +++++++++++-----
+ .../src/SMESH/SMESH_MeshEditor.cpp            |  8 ++--
+ src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp |  7 ++-
+ 14 files changed, 179 insertions(+), 58 deletions(-)
+
+Index: FreeCAD-0.19.2/src/3rdParty/salomesmesh/inc/SMDS_MeshElement.hxx
+===================================================================
+--- FreeCAD-0.19.2.orig/src/3rdParty/salomesmesh/inc/SMDS_MeshElement.hxx
++++ FreeCAD-0.19.2/src/3rdParty/salomesmesh/inc/SMDS_MeshElement.hxx
+@@ -40,11 +40,16 @@
+ 
+ #include <vtkType.h>
+ #include <vtkCellType.h>
++#include <vtkCellArray.h>
+ 
+ //typedef unsigned short UShortType;
+ typedef short ShortType;
+ typedef int   LongType;
+-
++#ifdef VTK_CELL_ARRAY_V2
++typedef const vtkIdType* vtkIdTypePtr;
++#else
++typedef vtkIdType* vtkIdTypePtr;
++#endif
+ class SMDS_MeshNode;
+ class SMDS_MeshEdge;
+ class SMDS_MeshFace;
+@@ -192,7 +197,7 @@ protected:
+   //! Element index in vector SMDS_Mesh::myNodes or SMDS_Mesh::myCells
+   int myID;
+   //! index in vtkUnstructuredGrid
+-  int myVtkID;
++  vtkIdType myVtkID;
+   //! SMDS_Mesh identification in SMESH
+   ShortType myMeshId;
+   //! SubShape and SubMesh identification in SMESHDS
+Index: FreeCAD-0.19.2/src/3rdParty/salomesmesh/inc/SMDS_UnstructuredGrid.hxx
+===================================================================
+--- FreeCAD-0.19.2.orig/src/3rdParty/salomesmesh/inc/SMDS_UnstructuredGrid.hxx
++++ FreeCAD-0.19.2/src/3rdParty/salomesmesh/inc/SMDS_UnstructuredGrid.hxx
+@@ -95,7 +95,11 @@ public:
+                                        std::map<int, std::map<long,int> >& nodeQuadDomains);
+   vtkCellLinks* GetLinks()
+   {
++#ifdef VTK_CELL_ARRAY_V2
++    return static_cast<vtkCellLinks*>(GetCellLinks());
++#else
+     return Links;
++#endif
+   }
+   SMDS_Downward* getDownArray(unsigned char vtkType)
+   {
+Index: FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMDS/SMDS_BallElement.cpp
+===================================================================
+--- FreeCAD-0.19.2.orig/src/3rdParty/salomesmesh/src/SMDS/SMDS_BallElement.cpp
++++ FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMDS/SMDS_BallElement.cpp
+@@ -67,10 +67,16 @@ void SMDS_BallElement::SetDiameter(doubl
+ bool SMDS_BallElement::ChangeNode (const SMDS_MeshNode * node)
+ {
+   vtkUnstructuredGrid* grid = SMDS_Mesh::_meshList[myMeshId]->getGrid();
++#ifdef VTK_CELL_ARRAY_V2
++  vtkNew<vtkIdList> cellPoints;
++  grid->GetCellPoints(myVtkID, cellPoints.GetPointer());
++  cellPoints->SetId(0, node->getVtkId());
++#else
+   vtkIdType npts = 0;
+   vtkIdType* pts = 0;
+   grid->GetCellPoints(myVtkID, npts, pts);
+   pts[0] = node->getVtkId();
++#endif
+   SMDS_Mesh::_meshList[myMeshId]->setMyModified();
+   return true;
+ }
+@@ -83,7 +89,8 @@ void SMDS_BallElement::Print (std::ostre
+ const SMDS_MeshNode* SMDS_BallElement::GetNode (const int ind) const
+ {
+   vtkUnstructuredGrid* grid = SMDS_Mesh::_meshList[myMeshId]->getGrid();
+-  vtkIdType npts, *pts;
++  vtkIdType npts;
++  vtkIdTypePtr pts;
+   grid->GetCellPoints( myVtkID, npts, pts );
+   return SMDS_Mesh::_meshList[myMeshId]->FindNodeVtk( pts[ 0 ]);
+ }
+Index: FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMDS/SMDS_Downward.cpp
+===================================================================
+--- FreeCAD-0.19.2.orig/src/3rdParty/salomesmesh/src/SMDS/SMDS_Downward.cpp
++++ FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMDS/SMDS_Downward.cpp
+@@ -303,7 +303,7 @@ int SMDS_Down1D::getNodeSet(int cellId,
+ void SMDS_Down1D::setNodes(int cellId, int vtkId)
+ {
+   vtkIdType npts = 0;
+-  vtkIdType *pts; // will refer to the point id's of the face
++  vtkIdTypePtr pts; // will refer to the point id's of the face
+   _grid->GetCellPoints(vtkId, npts, pts);
+   // MESSAGE(vtkId << " " << npts << "  " << _nbDownCells);
+   //ASSERT(npts == _nbDownCells);
+@@ -357,7 +357,7 @@ int SMDS_Down1D::computeVtkCells(int *pt
+     {
+       vtkIdType point = pts[i];
+       int numCells = _grid->GetLinks()->GetNcells(point);
+-      vtkIdType *cells = _grid->GetLinks()->GetCells(point);
++      vtkIdTypePtr cells = _grid->GetLinks()->GetCells(point);
+       for (int j = 0; j < numCells; j++)
+         {
+           int vtkCellId = cells[j];
+@@ -532,7 +532,7 @@ int SMDS_Down2D::computeVolumeIds(int ce
+   // --- find point id's of the face
+ 
+   vtkIdType npts = 0;
+-  vtkIdType *pts; // will refer to the point id's of the face
++  vtkIdTypePtr pts; // will refer to the point id's of the face
+   _grid->GetCellPoints(cellId, npts, pts);
+   vector<int> nodes;
+   for (int i = 0; i < npts; i++)
+@@ -577,7 +577,7 @@ int SMDS_Down2D::computeVolumeIdsFromNod
+       vtkIdType point = pts[i];
+       int numCells = _grid->GetLinks()->GetNcells(point);
+       //MESSAGE("cells pour " << i << " " << numCells);
+-      vtkIdType *cells = _grid->GetLinks()->GetCells(point);
++      vtkIdTypePtr cells = _grid->GetLinks()->GetCells(point);
+       for (int j = 0; j < numCells; j++)
+         {
+           int vtkCellId = cells[j];
+@@ -627,7 +627,7 @@ int SMDS_Down2D::computeVolumeIdsFromNod
+ void SMDS_Down2D::setTempNodes(int cellId, int vtkId)
+ {
+   vtkIdType npts = 0;
+-  vtkIdType *pts; // will refer to the point id's of the face
++  vtkIdTypePtr pts; // will refer to the point id's of the face
+   _grid->GetCellPoints(vtkId, npts, pts);
+   // MESSAGE(vtkId << " " << npts << "  " << _nbNodes);
+   //ASSERT(npts == _nbNodes);
+@@ -795,7 +795,7 @@ void SMDS_Down3D::getNodeIds(int cellId,
+ {
+   int vtkId = this->_vtkCellIds[cellId];
+   vtkIdType npts = 0;
+-  vtkIdType *nodes; // will refer to the point id's of the volume
++  vtkIdTypePtr nodes; // will refer to the point id's of the volume
+   _grid->GetCellPoints(vtkId, npts, nodes);
+   for (int i = 0; i < npts; i++)
+     nodeSet.insert(nodes[i]);
+@@ -1126,7 +1126,7 @@ void SMDS_DownTetra::getOrderedNodesOfFa
+   //MESSAGE("cellId = " << cellId);
+ 
+   vtkIdType npts = 0;
+-  vtkIdType *nodes; // will refer to the point id's of the volume
++  vtkIdTypePtr nodes; // will refer to the point id's of the volume
+   _grid->GetCellPoints(this->_vtkCellIds[cellId], npts, nodes);
+ 
+   set<int> tofind;
+@@ -1178,7 +1178,7 @@ void SMDS_DownTetra::computeFacesWithNod
+   // --- find point id's of the volume
+ 
+   vtkIdType npts = 0;
+-  vtkIdType *nodes; // will refer to the point id's of the volume
++  vtkIdTypePtr nodes; // will refer to the point id's of the volume
+   _grid->GetCellPoints(cellId, npts, nodes);
+ 
+   // --- create all the ordered list of node id's for each face
+@@ -1234,7 +1234,7 @@ void SMDS_DownQuadTetra::getOrderedNodes
+   //MESSAGE("cellId = " << cellId);
+ 
+   vtkIdType npts = 0;
+-  vtkIdType *nodes; // will refer to the point id's of the volume
++  vtkIdTypePtr nodes; // will refer to the point id's of the volume
+   _grid->GetCellPoints(this->_vtkCellIds[cellId], npts, nodes);
+ 
+   set<int> tofind;
+@@ -1288,7 +1288,7 @@ void SMDS_DownQuadTetra::computeFacesWit
+   // --- find point id's of the volume
+ 
+   vtkIdType npts = 0;
+-  vtkIdType *nodes; // will refer to the point id's of the volume
++  vtkIdTypePtr nodes; // will refer to the point id's of the volume
+   _grid->GetCellPoints(cellId, npts, nodes);
+ 
+   // --- create all the ordered list of node id's for each face
+@@ -1357,7 +1357,7 @@ void SMDS_DownPyramid::getOrderedNodesOf
+   //MESSAGE("cellId = " << cellId);
+ 
+   vtkIdType npts = 0;
+-  vtkIdType *nodes; // will refer to the point id's of the volume
++  vtkIdTypePtr nodes; // will refer to the point id's of the volume
+   _grid->GetCellPoints(this->_vtkCellIds[cellId], npts, nodes);
+ 
+   set<int> tofind;
+@@ -1435,7 +1435,7 @@ void SMDS_DownPyramid::computeFacesWithN
+   // --- find point id's of the volume
+ 
+   vtkIdType npts = 0;
+-  vtkIdType *nodes; // will refer to the point id's of the volume
++  vtkIdTypePtr nodes; // will refer to the point id's of the volume
+   _grid->GetCellPoints(cellId, npts, nodes);
+ 
+   // --- create all the ordered list of node id's for each face
+@@ -1500,7 +1500,7 @@ void SMDS_DownQuadPyramid::getOrderedNod
+   //MESSAGE("cellId = " << cellId);
+ 
+   vtkIdType npts = 0;
+-  vtkIdType *nodes; // will refer to the point id's of the volume
++  vtkIdTypePtr nodes; // will refer to the point id's of the volume
+   _grid->GetCellPoints(this->_vtkCellIds[cellId], npts, nodes);
+ 
+   set<int> tofind;
+@@ -1580,7 +1580,7 @@ void SMDS_DownQuadPyramid::computeFacesW
+   // --- find point id's of the volume
+ 
+   vtkIdType npts = 0;
+-  vtkIdType *nodes; // will refer to the point id's of the volume
++  vtkIdTypePtr nodes; // will refer to the point id's of the volume
+   _grid->GetCellPoints(cellId, npts, nodes);
+ 
+   // --- create all the ordered list of node id's for each face
+@@ -1660,7 +1660,7 @@ void SMDS_DownPenta::getOrderedNodesOfFa
+   //MESSAGE("cellId = " << cellId);
+ 
+   vtkIdType npts = 0;
+-  vtkIdType *nodes; // will refer to the point id's of the volume
++  vtkIdTypePtr nodes; // will refer to the point id's of the volume
+   _grid->GetCellPoints(this->_vtkCellIds[cellId], npts, nodes);
+ 
+   set<int> tofind;
+@@ -1744,7 +1744,7 @@ void SMDS_DownPenta::computeFacesWithNod
+   // --- find point id's of the volume
+ 
+   vtkIdType npts = 0;
+-  vtkIdType *nodes; // will refer to the point id's of the volume
++  vtkIdTypePtr nodes; // will refer to the point id's of the volume
+   _grid->GetCellPoints(cellId, npts, nodes);
+ 
+   // --- create all the ordered list of node id's for each face
+@@ -1810,7 +1810,7 @@ void SMDS_DownQuadPenta::getOrderedNodes
+   //MESSAGE("cellId = " << cellId);
+ 
+   vtkIdType npts = 0;
+-  vtkIdType *nodes; // will refer to the point id's of the volume
++  vtkIdTypePtr nodes; // will refer to the point id's of the volume
+   _grid->GetCellPoints(this->_vtkCellIds[cellId], npts, nodes);
+ 
+   set<int> tofind;
+@@ -1896,7 +1896,7 @@ void SMDS_DownQuadPenta::computeFacesWit
+   // --- find point id's of the volume
+ 
+   vtkIdType npts = 0;
+-  vtkIdType *nodes; // will refer to the point id's of the volume
++  vtkIdTypePtr nodes; // will refer to the point id's of the volume
+   _grid->GetCellPoints(cellId, npts, nodes);
+ 
+   // --- create all the ordered list of node id's for each face
+@@ -1981,7 +1981,7 @@ void SMDS_DownHexa::getOrderedNodesOfFac
+   //MESSAGE("cellId = " << cellId);
+ 
+   vtkIdType npts = 0;
+-  vtkIdType *nodes; // will refer to the point id's of the volume
++  vtkIdTypePtr nodes; // will refer to the point id's of the volume
+   _grid->GetCellPoints(this->_vtkCellIds[cellId], npts, nodes);
+ 
+   set<int> tofind;
+@@ -2036,7 +2036,7 @@ void SMDS_DownHexa::computeFacesWithNode
+   // --- find point id's of the volume
+ 
+   vtkIdType npts = 0;
+-  vtkIdType *nodes; // will refer to the point id's of the volume
++  vtkIdTypePtr nodes; // will refer to the point id's of the volume
+   _grid->GetCellPoints(cellId, npts, nodes);
+ 
+   // --- create all the ordered list of node id's for each face
+@@ -2112,7 +2112,7 @@ void SMDS_DownQuadHexa::getOrderedNodesO
+   //MESSAGE("cellId = " << cellId);
+ 
+   vtkIdType npts = 0;
+-  vtkIdType *nodes; // will refer to the point id's of the volume
++  vtkIdTypePtr nodes; // will refer to the point id's of the volume
+   _grid->GetCellPoints(this->_vtkCellIds[cellId], npts, nodes);
+ 
+   set<int> tofind;
+@@ -2167,7 +2167,7 @@ void SMDS_DownQuadHexa::computeFacesWith
+   // --- find point id's of the volume
+ 
+   vtkIdType npts = 0;
+-  vtkIdType *nodes; // will refer to the point id's of the volume
++  vtkIdTypePtr nodes; // will refer to the point id's of the volume
+   _grid->GetCellPoints(cellId, npts, nodes);
+ 
+   // --- create all the ordered list of node id's for each face
+Index: FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMDS/SMDS_Mesh.cpp
+===================================================================
+--- FreeCAD-0.19.2.orig/src/3rdParty/salomesmesh/src/SMDS/SMDS_Mesh.cpp
++++ FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMDS/SMDS_Mesh.cpp
+@@ -4768,7 +4768,11 @@ void SMDS_Mesh::dumpGrid(string ficdump)
+         ficcon << endl;
+   }
+   ficcon << "-------------------------------- connectivity " <<  nbPoints << endl;
+-        vtkCellLinks *links = myGrid->GetCellLinks();
++#ifdef VTK_CELL_ARRAY_V2
++  vtkCellLinks *links = static_cast<vtkCellLinks*>(myGrid->GetCellLinks());
++#else
++  vtkCellLinks *links = myGrid->GetCellLinks();
++#endif
+   for (int i=0; i<nbPoints; i++)
+   {
+         int ncells = links->GetNcells(i);
+Index: FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMDS/SMDS_Mesh0DElement.cpp
+===================================================================
+--- FreeCAD-0.19.2.orig/src/3rdParty/salomesmesh/src/SMDS/SMDS_Mesh0DElement.cpp
++++ FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMDS/SMDS_Mesh0DElement.cpp
+@@ -146,6 +146,17 @@ bool SMDS_Mesh0DElement::ChangeNodes(con
+   if ( nbNodes == 1 )
+   {
+     vtkUnstructuredGrid* grid = SMDS_Mesh::_meshList[myMeshId]->getGrid();
++#ifdef VTK_CELL_ARRAY_V2
++    vtkNew<vtkIdList> cellPoints;
++    grid->GetCellPoints(myVtkID, cellPoints.GetPointer());
++    if (nbNodes != cellPoints->GetNumberOfIds())
++    {
++      MESSAGE("ChangeNodes problem: not the same number of nodes " << cellPoints->GetNumberOfIds() << " -> " << nbNodes);
++      return false;
++    }
++    myNode = nodes[0];
++    cellPoints->SetId(0, myNode->getVtkId());
++#else
+     vtkIdType npts = 0;
+     vtkIdType* pts = 0;
+     grid->GetCellPoints(myVtkID, npts, pts);
+@@ -156,6 +167,7 @@ bool SMDS_Mesh0DElement::ChangeNodes(con
+     }
+     myNode = nodes[0];
+     pts[0] = myNode->getVtkId();
++#endif
+ 
+     SMDS_Mesh::_meshList[myMeshId]->setMyModified();
+     return true;
+Index: FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMDS/SMDS_MeshNode.cpp
+===================================================================
+--- FreeCAD-0.19.2.orig/src/3rdParty/salomesmesh/src/SMDS/SMDS_MeshNode.cpp
++++ FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMDS/SMDS_MeshNode.cpp
+@@ -191,7 +191,7 @@ public:
+ SMDS_ElemIteratorPtr SMDS_MeshNode::
+ GetInverseElementIterator(SMDSAbs_ElementType type) const
+ {
+-  vtkCellLinks::Link l = SMDS_Mesh::_meshList[myMeshId]->getGrid()->GetCellLinks()->GetLink(myVtkID);
++  vtkCellLinks::Link l = static_cast<vtkCellLinks*>(SMDS_Mesh::_meshList[myMeshId]->getGrid()->GetCellLinks())->GetLink(myVtkID);
+   //MESSAGE("myID " << myID << " ncells " << l.ncells);
+   return SMDS_ElemIteratorPtr(new SMDS_MeshNode_MyInvIterator(SMDS_Mesh::_meshList[myMeshId], l.cells, l.ncells, type));
+ }
+@@ -251,7 +251,7 @@ elementsIterator(SMDSAbs_ElementType typ
+     return SMDS_MeshElement::elementsIterator(SMDSAbs_Node);
+   else
+   {
+-    vtkCellLinks::Link l = SMDS_Mesh::_meshList[myMeshId]->getGrid()->GetCellLinks()->GetLink(myVtkID);
++    vtkCellLinks::Link l = static_cast<vtkCellLinks*>(SMDS_Mesh::_meshList[myMeshId]->getGrid()->GetCellLinks())->GetLink(myVtkID);
+     return SMDS_ElemIteratorPtr(new SMDS_MeshNode_MyIterator(SMDS_Mesh::_meshList[myMeshId], l.cells, l.ncells, type));
+   }
+ }
+@@ -350,7 +350,7 @@ void SMDS_MeshNode::AddInverseElement(co
+   const SMDS_MeshCell *cell = dynamic_cast<const SMDS_MeshCell*> (ME);
+   assert(cell);
+   SMDS_UnstructuredGrid* grid = SMDS_Mesh::_meshList[myMeshId]->getGrid();
+-  vtkCellLinks *Links = grid->GetCellLinks();
++  vtkCellLinks *Links = static_cast<vtkCellLinks*>(grid->GetCellLinks());
+   Links->ResizeCellList(myVtkID, 1);
+   Links->AddCellReference(cell->getVtkId(), myVtkID);
+ }
+@@ -366,7 +366,7 @@ void SMDS_MeshNode::ClearInverseElements
+ 
+ bool SMDS_MeshNode::emptyInverseElements()
+ {
+-  vtkCellLinks::Link l = SMDS_Mesh::_meshList[myMeshId]->getGrid()->GetCellLinks()->GetLink(myVtkID);
++  vtkCellLinks::Link l = static_cast<vtkCellLinks*>(SMDS_Mesh::_meshList[myMeshId]->getGrid()->GetCellLinks())->GetLink(myVtkID);
+   return (l.ncells == 0);
+ }
+ 
+@@ -378,7 +378,7 @@ bool SMDS_MeshNode::emptyInverseElements
+ 
+ int SMDS_MeshNode::NbInverseElements(SMDSAbs_ElementType type) const
+ {
+-  vtkCellLinks::Link l = SMDS_Mesh::_meshList[myMeshId]->getGrid()->GetCellLinks()->GetLink(myVtkID);
++  vtkCellLinks::Link l = static_cast<vtkCellLinks*>(SMDS_Mesh::_meshList[myMeshId]->getGrid()->GetCellLinks())->GetLink(myVtkID);
+ 
+   if ( type == SMDSAbs_All )
+     return l.ncells;
+Index: FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMDS/SMDS_UnstructuredGrid.cpp
+===================================================================
+--- FreeCAD-0.19.2.orig/src/3rdParty/salomesmesh/src/SMDS/SMDS_UnstructuredGrid.cpp
++++ FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMDS/SMDS_UnstructuredGrid.cpp
+@@ -139,8 +139,8 @@ int SMDS_UnstructuredGrid::InsertNextLin
+   for (; it != setOfNodes.end(); ++it)
+     {
+       //MESSAGE("reverse link for node " << *it << " cell " << cellid);
+-      this->Links->ResizeCellList(*it, 1);
+-      this->Links->AddCellReference(cellid, *it);
++      this->GetLinks()->ResizeCellList(*it, 1);
++      this->GetLinks()->AddCellReference(cellid, *it);
+     }
+ 
+   return cellid;
+@@ -332,9 +332,13 @@ void SMDS_UnstructuredGrid::copyBloc(vtk
+     {
+       newTypes->SetValue(alreadyCopied, this->Types->GetValue(j));
+       idCellsOldToNew[j] = alreadyCopied; // old vtkId --> new vtkId
++#ifdef VTK_CELL_ARRAY_V2
++      vtkIdType oldLoc = this->GetCellLocationsArray()->GetValue(j);
++#else
+       vtkIdType oldLoc = this->Locations->GetValue(j);
++#endif
+       vtkIdType nbpts;
+-      vtkIdType *oldPtsCell = 0;
++      vtkIdTypePtr oldPtsCell = 0;
+       this->Connectivity->GetCell(oldLoc, nbpts, oldPtsCell);
+       assert(nbpts < NBMAXNODESINCELL);
+       //MESSAGE(j << " " << alreadyCopied << " " << (int)this->Types->GetValue(j) << " " << oldLoc << " " << nbpts );
+@@ -952,6 +956,21 @@ void SMDS_UnstructuredGrid::GetNodeIds(s
+  */
+ void SMDS_UnstructuredGrid::ModifyCellNodes(int vtkVolId, std::map<int, int> localClonedNodeIds)
+ {
++#ifdef VTK_CELL_ARRAY_V2
++  vtkNew<vtkIdList> cellPoints;
++  this->GetCellPoints(vtkVolId, cellPoints.GetPointer());
++  for (vtkIdType i = 0; i < cellPoints->GetNumberOfIds(); i++)
++    {
++      if (localClonedNodeIds.count(cellPoints->GetId(i)))
++        {
++          vtkIdType oldpt = cellPoints->GetId(i);
++          cellPoints->SetId(i, localClonedNodeIds[oldpt]);
++          //MESSAGE(oldpt << " --> " << pts[i]);
++          //this->RemoveReferenceToCell(oldpt, vtkVolId);
++          //this->AddReferenceToCell(pts[i], vtkVolId);
++        }
++    }
++#else
+   vtkIdType npts = 0;
+   vtkIdType *pts; // will refer to the point id's of the face
+   this->GetCellPoints(vtkVolId, npts, pts);
+@@ -966,6 +985,7 @@ void SMDS_UnstructuredGrid::ModifyCellNo
+           //this->AddReferenceToCell(pts[i], vtkVolId);
+         }
+     }
++#endif
+ }
+ 
+ /*! reorder the nodes of a face
+@@ -995,11 +1015,20 @@ void SMDS_UnstructuredGrid::BuildLinks()
+     this->Links->UnRegister(this);
+     }
+ 
++#ifdef VTK_CELL_ARRAY_V2
++  this->Links = SMDS_CellLinks::New();
++  GetLinks()->Allocate(this->GetNumberOfPoints());
++  GetLinks()->Register(this);
++//FIXME: vtk9
++  GetLinks()->BuildLinks(this);
++  GetLinks()->Delete();
++#else
+   this->Links = SMDS_CellLinks::New();
+   this->Links->Allocate(this->GetNumberOfPoints());
+   this->Links->Register(this);
+   this->Links->BuildLinks(this, this->Connectivity);
+   this->Links->Delete();
++#endif
+ }
+ 
+ /*! Create a volume (prism or hexahedron) by duplication of a face.
+Index: FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMDS/SMDS_VtkCellIterator.cpp
+===================================================================
+--- FreeCAD-0.19.2.orig/src/3rdParty/salomesmesh/src/SMDS/SMDS_VtkCellIterator.cpp
++++ FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMDS/SMDS_VtkCellIterator.cpp
+@@ -33,7 +33,8 @@ SMDS_VtkCellIterator::SMDS_VtkCellIterat
+   }
+   else
+   {
+-    vtkIdType npts, *pts;
++    vtkIdType npts;
++    vtkIdTypePtr pts;
+     grid->GetCellPoints( _cellId, npts, pts );
+     _vtkIdList->SetNumberOfIds( _nbNodes = npts );
+     for (int i = 0; i < _nbNodes; i++)
+@@ -67,7 +68,7 @@ SMDS_VtkCellIteratorToUNV::SMDS_VtkCellI
+   //MESSAGE("SMDS_VtkCellInterlacedIterator (UNV)" << _type);
+ 
+   _vtkIdList = vtkIdList::New();
+-  vtkIdType* pts;
++  vtkIdTypePtr pts;
+   vtkIdType npts;
+   vtkUnstructuredGrid* grid = _mesh->getGrid();
+   grid->GetCellPoints((vtkIdType)_cellId, npts, pts);
+@@ -182,7 +183,7 @@ SMDS_VtkCellIteratorPolyH::SMDS_VtkCellI
+   {
+     //MESSAGE("SMDS_VtkCellIterator Polyhedra");
+     vtkIdType nFaces = 0;
+-    vtkIdType* ptIds = 0;
++    vtkIdTypePtr ptIds = 0;
+     grid->GetFaceStream(_cellId, nFaces, ptIds);
+     int id = 0;
+     _nbNodesInFaces = 0;
+Index: FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMDS/SMDS_VtkEdge.cpp
+===================================================================
+--- FreeCAD-0.19.2.orig/src/3rdParty/salomesmesh/src/SMDS/SMDS_VtkEdge.cpp
++++ FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMDS/SMDS_VtkEdge.cpp
+@@ -67,6 +67,19 @@ bool SMDS_VtkEdge::ChangeNodes(const SMD
+ bool SMDS_VtkEdge::ChangeNodes(const SMDS_MeshNode* nodes[], const int nbNodes)
+ {
+   vtkUnstructuredGrid* grid = SMDS_Mesh::_meshList[myMeshId]->getGrid();
++#ifdef VTK_CELL_ARRAY_V2
++  vtkNew<vtkIdList> cellPoints;
++  grid->GetCellPoints(myVtkID, cellPoints.GetPointer());
++  if (nbNodes != cellPoints->GetNumberOfIds())
++    {
++      MESSAGE("ChangeNodes problem: not the same number of nodes " << cellPoints->GetNumberOfIds() << " -> " << nbNodes);
++      return false;
++    }
++  for (int i = 0; i < nbNodes; i++)
++    {
++      cellPoints->SetId(i, nodes[i]->getVtkId());
++    }
++#else
+   vtkIdType npts = 0;
+   vtkIdType* pts = 0;
+   grid->GetCellPoints(myVtkID, npts, pts);
+@@ -79,6 +92,7 @@ bool SMDS_VtkEdge::ChangeNodes(const SMD
+     {
+       pts[i] = nodes[i]->getVtkId();
+     }
++#endif
+   SMDS_Mesh::_meshList[myMeshId]->setMyModified();
+   return true;
+ }
+@@ -87,7 +101,7 @@ bool SMDS_VtkEdge::IsMediumNode(const SM
+ {
+   vtkUnstructuredGrid* grid = SMDS_Mesh::_meshList[myMeshId]->getGrid();
+   vtkIdType npts = 0;
+-  vtkIdType* pts = 0;
++  vtkIdTypePtr pts = 0;
+   grid->GetCellPoints(myVtkID, npts, pts);
+   //MESSAGE("IsMediumNode " << npts  << " " << (node->getVtkId() == pts[npts-1]));
+   return ((npts == 3) && (node->getVtkId() == pts[2]));
+@@ -137,7 +151,8 @@ const SMDS_MeshNode*
+ SMDS_VtkEdge::GetNode(const int ind) const
+ {
+   vtkUnstructuredGrid* grid = SMDS_Mesh::_meshList[myMeshId]->getGrid();
+-  vtkIdType npts, *pts;
++  vtkIdType npts;
++  vtkIdTypePtr pts;
+   grid->GetCellPoints( this->myVtkID, npts, pts );
+   return SMDS_Mesh::_meshList[myMeshId]->FindNodeVtk( pts[ ind ]);
+ }
+Index: FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMDS/SMDS_VtkFace.cpp
+===================================================================
+--- FreeCAD-0.19.2.orig/src/3rdParty/salomesmesh/src/SMDS/SMDS_VtkFace.cpp
++++ FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMDS/SMDS_VtkFace.cpp
+@@ -101,6 +101,19 @@ void SMDS_VtkFace::initQuadPoly(const st
+ bool SMDS_VtkFace::ChangeNodes(const SMDS_MeshNode* nodes[], const int nbNodes)
+ {
+   vtkUnstructuredGrid* grid = SMDS_Mesh::_meshList[myMeshId]->getGrid();
++#ifdef VTK_CELL_ARRAY_V2
++  vtkNew<vtkIdList> cellPoints;
++  grid->GetCellPoints(myVtkID, cellPoints.GetPointer());
++  if (nbNodes != cellPoints->GetNumberOfIds())
++    {
++      MESSAGE("ChangeNodes problem: not the same number of nodes " << cellPoints->GetNumberOfIds() << " -> " << nbNodes);
++      return false;
++    }
++  for (int i = 0; i < nbNodes; i++)
++    {
++      cellPoints->SetId(i, nodes[i]->getVtkId());
++    }
++#else
+   vtkIdType npts = 0;
+   vtkIdType* pts = 0;
+   grid->GetCellPoints(myVtkID, npts, pts);
+@@ -113,6 +126,7 @@ bool SMDS_VtkFace::ChangeNodes(const SMD
+     {
+       pts[i] = nodes[i]->getVtkId();
+     }
++#endif
+   SMDS_Mesh::_meshList[myMeshId]->setMyModified();
+   return true;
+ }
+@@ -173,7 +187,8 @@ const SMDS_MeshNode*
+ SMDS_VtkFace::GetNode(const int ind) const
+ {
+   vtkUnstructuredGrid* grid = SMDS_Mesh::_meshList[myMeshId]->getGrid();
+-  vtkIdType npts, *pts;
++  vtkIdType npts;
++  vtkIdTypePtr pts;
+   grid->GetCellPoints( this->myVtkID, npts, pts );
+   return SMDS_Mesh::_meshList[myMeshId]->FindNodeVtk( pts[ ind ]);
+ }
+@@ -186,7 +201,8 @@ SMDS_VtkFace::GetNode(const int ind) con
+ int SMDS_VtkFace::GetNodeIndex( const SMDS_MeshNode* node ) const
+ {
+   vtkUnstructuredGrid* grid = SMDS_Mesh::_meshList[myMeshId]->getGrid();
+-  vtkIdType npts, *pts;
++  vtkIdType npts;
++  vtkIdTypePtr pts;
+   grid->GetCellPoints( this->myVtkID, npts, pts );
+   for ( vtkIdType i = 0; i < npts; ++i )
+     if ( pts[i] == node->getVtkId() )
+@@ -251,7 +267,7 @@ bool SMDS_VtkFace::IsMediumNode(const SM
+     return false;
+   }
+   vtkIdType npts = 0;
+-  vtkIdType* pts = 0;
++  vtkIdTypePtr pts = 0;
+   grid->GetCellPoints(myVtkID, npts, pts);
+   vtkIdType nodeId = node->getVtkId();
+   for (int rank = 0; rank < npts; rank++)
+@@ -356,11 +372,18 @@ SMDS_NodeIteratorPtr SMDS_VtkFace::inter
+ void SMDS_VtkFace::ChangeApex(SMDS_MeshNode* node)
+ {
+   vtkUnstructuredGrid* grid = SMDS_Mesh::_meshList[myMeshId]->getGrid();
++#ifdef VTK_CELL_ARRAY_V2
++  vtkNew<vtkIdList> cellPoints;
++  grid->GetCellPoints(myVtkID, cellPoints.GetPointer());
++  grid->RemoveReferenceToCell(cellPoints->GetId(0), myVtkID);
++  cellPoints->SetId(0, node->getVtkId());
++#else
+   vtkIdType npts = 0;
+   vtkIdType* pts = 0;
+   grid->GetCellPoints(myVtkID, npts, pts);
+   grid->RemoveReferenceToCell(pts[0], myVtkID);
+   pts[0] = node->getVtkId();
++#endif
+   node->AddInverseElement(this),
+   SMDS_Mesh::_meshList[myMeshId]->setMyModified();
+ }
+Index: FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMDS/SMDS_VtkVolume.cpp
+===================================================================
+--- FreeCAD-0.19.2.orig/src/3rdParty/salomesmesh/src/SMDS/SMDS_VtkVolume.cpp
++++ FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMDS/SMDS_VtkVolume.cpp
+@@ -133,6 +133,19 @@ void SMDS_VtkVolume::initPoly(const std:
+ bool SMDS_VtkVolume::ChangeNodes(const SMDS_MeshNode* nodes[], const int nbNodes)
+ {
+   vtkUnstructuredGrid* grid = SMDS_Mesh::_meshList[myMeshId]->getGrid();
++#ifdef VTK_CELL_ARRAY_V2
++  vtkNew<vtkIdList> cellPoints;
++  grid->GetCellPoints(myVtkID, cellPoints.GetPointer());
++  if (nbNodes != cellPoints->GetNumberOfIds())
++    {
++      MESSAGE("ChangeNodes problem: not the same number of nodes " << cellPoints->GetNumberOfIds() << " -> " << nbNodes);
++      return false;
++    }
++  for (int i = 0; i < nbNodes; i++)
++    {
++      cellPoints->SetId(i, nodes[i]->getVtkId());
++    }
++#else
+   vtkIdType npts = 0;
+   vtkIdType* pts = 0;
+   grid->GetCellPoints(myVtkID, npts, pts);
+@@ -145,6 +158,7 @@ bool SMDS_VtkVolume::ChangeNodes(const S
+     {
+       pts[i] = nodes[i]->getVtkId();
+     }
++#endif
+   SMDS_Mesh::_meshList[myMeshId]->setMyModified();
+   return true;
+ }
+@@ -207,7 +221,7 @@ int SMDS_VtkVolume::NbFaces() const
+     case VTK_POLYHEDRON:
+       {
+         vtkIdType nFaces = 0;
+-        vtkIdType* ptIds = 0;
++        vtkIdTypePtr ptIds = 0;
+         grid->GetFaceStream(this->myVtkID, nFaces, ptIds);
+         nbFaces = nFaces;
+         break;
+@@ -236,7 +250,7 @@ int SMDS_VtkVolume::NbNodes() const
+   else
+     {
+       vtkIdType nFaces = 0;
+-      vtkIdType* ptIds = 0;
++      vtkIdTypePtr ptIds = 0;
+       grid->GetFaceStream(this->myVtkID, nFaces, ptIds);
+       int id = 0;
+       for (int i = 0; i < nFaces; i++)
+@@ -276,7 +290,7 @@ int SMDS_VtkVolume::NbEdges() const
+     case VTK_POLYHEDRON:
+       {
+         vtkIdType nFaces = 0;
+-        vtkIdType* ptIds = 0;
++        vtkIdTypePtr ptIds = 0;
+         grid->GetFaceStream(this->myVtkID, nFaces, ptIds);
+         nbEdges = 0;
+         int id = 0;
+@@ -312,7 +326,7 @@ int SMDS_VtkVolume::NbFaceNodes(const in
+   if (aVtkType == VTK_POLYHEDRON)
+     {
+       vtkIdType nFaces = 0;
+-      vtkIdType* ptIds = 0;
++      vtkIdTypePtr ptIds = 0;
+       grid->GetFaceStream(this->myVtkID, nFaces, ptIds);
+       int id = 0;
+       for (int i = 0; i < nFaces; i++)
+@@ -342,7 +356,7 @@ const SMDS_MeshNode* SMDS_VtkVolume::Get
+   if (aVtkType == VTK_POLYHEDRON)
+     {
+       vtkIdType nFaces = 0;
+-      vtkIdType* ptIds = 0;
++      vtkIdTypePtr ptIds = 0;
+       grid->GetFaceStream(this->myVtkID, nFaces, ptIds);
+       int id = 0;
+       for (int i = 0; i < nFaces; i++)
+@@ -372,7 +386,7 @@ std::vector<int> SMDS_VtkVolume::GetQuan
+   if (aVtkType == VTK_POLYHEDRON)
+     {
+       vtkIdType nFaces = 0;
+-      vtkIdType* ptIds = 0;
++      vtkIdTypePtr ptIds = 0;
+       grid->GetFaceStream(this->myVtkID, nFaces, ptIds);
+       int id = 0;
+       for (int i = 0; i < nFaces; i++)
+@@ -430,7 +444,7 @@ const SMDS_MeshNode* SMDS_VtkVolume::Get
+   if ( aVtkType == VTK_POLYHEDRON)
+   {
+     vtkIdType nFaces = 0;
+-    vtkIdType* ptIds = 0;
++    vtkIdTypePtr ptIds = 0;
+     grid->GetFaceStream(this->myVtkID, nFaces, ptIds);
+     int id = 0, nbPoints = 0;
+     for (int i = 0; i < nFaces; i++)
+@@ -443,7 +457,8 @@ const SMDS_MeshNode* SMDS_VtkVolume::Get
+     }
+     return 0;
+   }
+-  vtkIdType npts, *pts;
++  vtkIdType npts;
++  vtkIdTypePtr pts;
+   grid->GetCellPoints( this->myVtkID, npts, pts );
+   const std::vector<int>& interlace = SMDS_MeshCell::fromVtkOrder( VTKCellType( aVtkType ));
+   return SMDS_Mesh::_meshList[myMeshId]->FindNodeVtk( pts[ interlace.empty() ? ind : interlace[ind]] );
+@@ -460,7 +475,7 @@ int SMDS_VtkVolume::GetNodeIndex( const
+   if ( aVtkType == VTK_POLYHEDRON)
+   {
+     vtkIdType nFaces = 0;
+-    vtkIdType* ptIds = 0;
++    vtkIdTypePtr ptIds = 0;
+     grid->GetFaceStream(this->myVtkID, nFaces, ptIds);
+     int id = 0;
+     for (int iF = 0; iF < nFaces; iF++)
+@@ -473,7 +488,8 @@ int SMDS_VtkVolume::GetNodeIndex( const
+     }
+     return -1;
+   }
+-  vtkIdType npts, *pts;
++  vtkIdType npts;
++  vtkIdTypePtr pts;
+   grid->GetCellPoints( this->myVtkID, npts, pts );
+   for ( vtkIdType i = 0; i < npts; ++i )
+     if ( pts[i] == node->getVtkId() )
+@@ -534,7 +550,7 @@ bool SMDS_VtkVolume::IsMediumNode(const
+       return false;
+   }
+   vtkIdType npts = 0;
+-  vtkIdType* pts = 0;
++  vtkIdTypePtr pts = 0;
+   grid->GetCellPoints(myVtkID, npts, pts);
+   vtkIdType nodeId = node->getVtkId();
+   for (int rank = 0; rank < npts; rank++)
+Index: FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMESH/SMESH_MeshEditor.cpp
+===================================================================
+--- FreeCAD-0.19.2.orig/src/3rdParty/salomesmesh/src/SMESH/SMESH_MeshEditor.cpp
++++ FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMESH/SMESH_MeshEditor.cpp
+@@ -11348,7 +11348,7 @@ bool SMESH_MeshEditor::DoubleNodesOnGrou
+             {
+               int oldId = *itn;
+               //MESSAGE("     node " << oldId);
+-              vtkCellLinks::Link l = grid->GetCellLinks()->GetLink(oldId);
++              vtkCellLinks::Link l = static_cast<vtkCellLinks*>(grid->GetCellLinks())->GetLink(oldId);
+               for (int i=0; i<l.ncells; i++)
+                 {
+                   int vtkId = l.cells[i];
+@@ -11527,7 +11527,7 @@ bool SMESH_MeshEditor::DoubleNodesOnGrou
+                                           //MESSAGE("  domain " << idom << " volume " << elem->GetID());
+                                           double values[3];
+                                           vtkIdType npts = 0;
+-                                          vtkIdType* pts = 0;
++                                          vtkIdTypePtr pts = 0;
+                                           grid->GetCellPoints(vtkVolIds[ivol], npts, pts);
+                                           SMDS_VtkVolume::gravityCenter(grid, pts, npts, values);
+                                           if (id ==0)
+@@ -11708,7 +11708,7 @@ bool SMESH_MeshEditor::DoubleNodesOnGrou
+         {
+           int oldId = itnod->first;
+           //MESSAGE("     node " << oldId);
+-          vtkCellLinks::Link l = grid->GetCellLinks()->GetLink(oldId);
++          vtkCellLinks::Link l = static_cast<vtkCellLinks*>(grid->GetCellLinks())->GetLink(oldId);
+           for (int i = 0; i < l.ncells; i++)
+             {
+               int vtkId = l.cells[i];
+@@ -12165,7 +12165,7 @@ void SMESH_MeshEditor::CreateHoleSkin(do
+           MESSAGE("volume to check,  vtkId " << vtkId << " smdsId " << meshDS->fromVtkToSmds(vtkId));
+           bool volInside = false;
+           vtkIdType npts = 0;
+-          vtkIdType* pts = 0;
++          vtkIdTypePtr pts = 0;
+           grid->GetCellPoints(vtkId, npts, pts);
+           for (int i=0; i<npts; i++)
+             {
+Index: FreeCAD-0.19.2/src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp
+===================================================================
+--- FreeCAD-0.19.2.orig/src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp
++++ FreeCAD-0.19.2/src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp
+@@ -20,7 +20,6 @@
+  *                                                                         *
+  ***************************************************************************/
+ 
+-
+ #include "PreCompiled.h"
+ 
+ #ifndef _PreComp_
diff --git a/gnu/packages/patches/freeglut-gcc-compat.patch b/gnu/packages/patches/freeglut-gcc-compat.patch
new file mode 100644
index 0000000000..126bbd89f4
--- /dev/null
+++ b/gnu/packages/patches/freeglut-gcc-compat.patch
@@ -0,0 +1,53 @@
+Fix build failure with GCC 10.
+
+Taken from upstream:
+https://github.com/dcnieho/FreeGLUT/commit/b9998bbc1e1c329f6bf69c24606a2be7a4973b8c
+
+diff --git a/src/fg_gl2.c b/src/fg_gl2.c
+--- a/src/fg_gl2.c
++++ b/src/fg_gl2.c
+@@ -27,6 +27,20 @@
+ #include "fg_internal.h"
+ #include "fg_gl2.h"
+ 
++#ifndef GL_ES_VERSION_2_0
++/* GLES2 has the corresponding entry points built-in, and these fgh-prefixed
++ * names are defined in fg_gl2.h header to reference them, for any other case,
++ * define them as function pointers here.
++ */
++FGH_PFNGLGENBUFFERSPROC fghGenBuffers;
++FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers;
++FGH_PFNGLBINDBUFFERPROC fghBindBuffer;
++FGH_PFNGLBUFFERDATAPROC fghBufferData;
++FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray;
++FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray;
++FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer;
++#endif
++
+ void FGAPIENTRY glutSetVertexAttribCoord3(GLint attrib) {
+   if (fgStructure.CurrentWindow != NULL)
+     fgStructure.CurrentWindow->Window.attribute_v_coord = attrib;
+diff --git a/src/fg_gl2.h b/src/fg_gl2.h
+--- a/src/fg_gl2.h
++++ b/src/fg_gl2.h
+@@ -67,13 +67,13 @@ typedef void (APIENTRY *FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index);
+ typedef void (APIENTRY *FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint);
+ typedef void (APIENTRY *FGH_PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
+ 
+-FGH_PFNGLGENBUFFERSPROC fghGenBuffers;
+-FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers;
+-FGH_PFNGLBINDBUFFERPROC fghBindBuffer;
+-FGH_PFNGLBUFFERDATAPROC fghBufferData;
+-FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray;
+-FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray;
+-FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer;
++extern FGH_PFNGLGENBUFFERSPROC fghGenBuffers;
++extern FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers;
++extern FGH_PFNGLBINDBUFFERPROC fghBindBuffer;
++extern FGH_PFNGLBUFFERDATAPROC fghBufferData;
++extern FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray;
++extern FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray;
++extern FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer;
+ 
+ #    endif
+ 
diff --git a/gnu/packages/patches/ganeti-deterministic-manual.patch b/gnu/packages/patches/ganeti-deterministic-manual.patch
deleted file mode 100644
index 2d90aa740e..0000000000
--- a/gnu/packages/patches/ganeti-deterministic-manual.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-Sort the ecode list in the gnt-cluster manual for deterministic results.
-
-Submitted upstream: <https://github.com/ganeti/ganeti/pull/1504>.
-
-diff --git a/lib/build/sphinx_ext.py b/lib/build/sphinx_ext.py
---- a/lib/build/sphinx_ext.py
-+++ b/lib/build/sphinx_ext.py
-@@ -108,7 +108,7 @@ CV_ECODES_DOC = "ecodes"
- # pylint: disable=W0621
- CV_ECODES_DOC_LIST = [(name, doc) for (_, name, doc) in constants.CV_ALL_ECODES]
- DOCUMENTED_CONSTANTS = {
--  CV_ECODES_DOC: CV_ECODES_DOC_LIST,
-+  CV_ECODES_DOC: sorted(CV_ECODES_DOC_LIST, key=lambda tup: tup[0]),
-   }
- 
- 
diff --git a/gnu/packages/patches/ganeti-drbd-compat.patch b/gnu/packages/patches/ganeti-drbd-compat.patch
deleted file mode 100644
index 32f46bc7ed..0000000000
--- a/gnu/packages/patches/ganeti-drbd-compat.patch
+++ /dev/null
@@ -1,166 +0,0 @@
-This patch adds support for newer versions of DRBD.
-
-Submitted upstream: <https://github.com/ganeti/ganeti/pull/1496>.
-
-diff --git a/lib/storage/drbd.py b/lib/storage/drbd.py
---- a/lib/storage/drbd.py
-+++ b/lib/storage/drbd.py
-@@ -315,6 +315,13 @@ class DRBD8Dev(base.BlockDev):
-     """
-     return self._show_info_cls.GetDevInfo(self._GetShowData(minor))
- 
-+  @staticmethod
-+  def _NeedsLocalSyncerParams():
-+    # For DRBD >= 8.4, syncer init must be done after local, not in net.
-+    info = DRBD8.GetProcInfo()
-+    version = info.GetVersion()
-+    return version["k_minor"] >= 4
-+
-   def _MatchesLocal(self, info):
-     """Test if our local config matches with an existing device.
- 
-@@ -397,6 +404,20 @@ class DRBD8Dev(base.BlockDev):
-         base.ThrowError("drbd%d: can't attach local disk: %s",
-                         minor, result.output)
- 
-+    def _WaitForMinorSyncParams():
-+      """Call _SetMinorSyncParams and raise RetryAgain on errors.
-+      """
-+      if self._SetMinorSyncParams(minor, self.params):
-+        raise utils.RetryAgain()
-+
-+    if self._NeedsLocalSyncerParams():
-+      # Retry because disk config for DRBD resource may be still uninitialized.
-+      try:
-+        utils.Retry(_WaitForMinorSyncParams, 1.0, 5.0)
-+      except utils.RetryTimeout as e:
-+        base.ThrowError("drbd%d: can't set the synchronization parameters: %s" %
-+                        (minor, utils.CommaJoin(e.args[0])))
-+
-   def _AssembleNet(self, minor, net_info, dual_pri=False, hmac=None,
-                    secret=None):
-     """Configure the network part of the device.
-@@ -432,21 +453,24 @@ class DRBD8Dev(base.BlockDev):
-     # sync speed only after setting up both sides can race with DRBD
-     # connecting, hence we set it here before telling DRBD anything
-     # about its peer.
--    sync_errors = self._SetMinorSyncParams(minor, self.params)
--    if sync_errors:
--      base.ThrowError("drbd%d: can't set the synchronization parameters: %s" %
--                      (minor, utils.CommaJoin(sync_errors)))
-+
-+    if not self._NeedsLocalSyncerParams():
-+      sync_errors = self._SetMinorSyncParams(minor, self.params)
-+      if sync_errors:
-+        base.ThrowError("drbd%d: can't set the synchronization parameters: %s" %
-+                        (minor, utils.CommaJoin(sync_errors)))
- 
-     family = self._GetNetFamily(minor, lhost, rhost)
- 
--    cmd = self._cmd_gen.GenNetInitCmd(minor, family, lhost, lport,
-+    cmds = self._cmd_gen.GenNetInitCmds(minor, family, lhost, lport,
-                                       rhost, rport, protocol,
-                                       dual_pri, hmac, secret, self.params)
- 
--    result = utils.RunCmd(cmd)
--    if result.failed:
--      base.ThrowError("drbd%d: can't setup network: %s - %s",
--                      minor, result.fail_reason, result.output)
-+    for cmd in cmds:
-+      result = utils.RunCmd(cmd)
-+      if result.failed:
-+        base.ThrowError("drbd%d: can't setup network: %s - %s",
-+                         minor, result.fail_reason, result.output)
- 
-     def _CheckNetworkConfig():
-       info = self._GetShowInfo(minor)
-@@ -463,19 +487,20 @@ class DRBD8Dev(base.BlockDev):
-       base.ThrowError("drbd%d: timeout while configuring network", minor)
- 
-     # Once the assembly is over, try to set the synchronization parameters
--    try:
--      # The minor may not have been set yet, requiring us to set it at least
--      # temporarily
--      old_minor = self.minor
--      self._SetFromMinor(minor)
--      sync_errors = self.SetSyncParams(self.params)
--      if sync_errors:
--        base.ThrowError("drbd%d: can't set the synchronization parameters: %s" %
--                        (self.minor, utils.CommaJoin(sync_errors)))
--    finally:
--      # Undo the change, regardless of whether it will have to be done again
--      # soon
--      self._SetFromMinor(old_minor)
-+    if not self._NeedsLocalSyncerParams():
-+      try:
-+        # The minor may not have been set yet, requiring us to set it at least
-+        # temporarily
-+        old_minor = self.minor
-+        self._SetFromMinor(minor)
-+        sync_errors = self.SetSyncParams(self.params)
-+        if sync_errors:
-+          base.ThrowError("drbd%d: can't set the synchronization parameters: %s" %
-+                          (self.minor, utils.CommaJoin(sync_errors)))
-+      finally:
-+        # Undo the change, regardless of whether it will have to be done again
-+        # soon
-+        self._SetFromMinor(old_minor)
- 
-   @staticmethod
-   def _GetNetFamily(minor, lhost, rhost):
-diff --git a/lib/storage/drbd_cmdgen.py b/lib/storage/drbd_cmdgen.py
---- a/lib/storage/drbd_cmdgen.py
-+++ b/lib/storage/drbd_cmdgen.py
-@@ -56,7 +56,7 @@ class BaseDRBDCmdGenerator(object):
-   def GenLocalInitCmds(self, minor, data_dev, meta_dev, size_mb, params):
-     raise NotImplementedError
- 
--  def GenNetInitCmd(self, minor, family, lhost, lport, rhost, rport, protocol,
-+  def GenNetInitCmds(self, minor, family, lhost, lport, rhost, rport, protocol,
-                     dual_pri, hmac, secret, params):
-     raise NotImplementedError
- 
-@@ -138,7 +138,7 @@ class DRBD83CmdGenerator(BaseDRBDCmdGenerator):
- 
-     return [args]
- 
--  def GenNetInitCmd(self, minor, family, lhost, lport, rhost, rport, protocol,
-+  def GenNetInitCmds(self, minor, family, lhost, lport, rhost, rport, protocol,
-                     dual_pri, hmac, secret, params):
-     args = ["drbdsetup", self._DevPath(minor), "net",
-             "%s:%s:%s" % (family, lhost, lport),
-@@ -155,7 +155,7 @@ class DRBD83CmdGenerator(BaseDRBDCmdGenerator):
-     if params[constants.LDP_NET_CUSTOM]:
-       args.extend(shlex.split(params[constants.LDP_NET_CUSTOM]))
- 
--    return args
-+    return [args]
- 
-   def GenSyncParamsCmd(self, minor, params):
-     args = ["drbdsetup", self._DevPath(minor), "syncer"]
-@@ -345,8 +345,14 @@ class DRBD84CmdGenerator(BaseDRBDCmdGenerator):
- 
-     return cmds
- 
--  def GenNetInitCmd(self, minor, family, lhost, lport, rhost, rport, protocol,
-+  def GenNetInitCmds(self, minor, family, lhost, lport, rhost, rport, protocol,
-                     dual_pri, hmac, secret, params):
-+    cmds = []
-+
-+    cmds.append(["drbdsetup", "new-resource", self._GetResource(minor)])
-+    cmds.append(["drbdsetup", "new-minor", self._GetResource(minor),
-+                 str(minor), "0"])
-+
-     args = ["drbdsetup", "connect", self._GetResource(minor),
-             "%s:%s:%s" % (family, lhost, lport),
-             "%s:%s:%s" % (family, rhost, rport),
-@@ -362,7 +368,8 @@ class DRBD84CmdGenerator(BaseDRBDCmdGenerator):
-     if params[constants.LDP_NET_CUSTOM]:
-       args.extend(shlex.split(params[constants.LDP_NET_CUSTOM]))
- 
--    return args
-+    cmds.append(args)
-+    return cmds
- 
-   def GenSyncParamsCmd(self, minor, params):
-     args = ["drbdsetup", "disk-options", minor]
diff --git a/gnu/packages/patches/ganeti-haskell-compat.patch b/gnu/packages/patches/ganeti-haskell-compat.patch
new file mode 100644
index 0000000000..931c50e116
--- /dev/null
+++ b/gnu/packages/patches/ganeti-haskell-compat.patch
@@ -0,0 +1,18 @@
+Adjust to type change of TupE in Template Haskell 2.16.
+
+diff --git a/src/Ganeti/THH/Types.hs b/src/Ganeti/THH/Types.hs
+--- a/src/Ganeti/THH/Types.hs
++++ b/src/Ganeti/THH/Types.hs
+@@ -123,4 +123,11 @@ curryN n = do
+   f <- newName "f"
+   ps <- replicateM n (newName "x")
+   return $ LamE (VarP f : map VarP ps)
+-             (AppE (VarE f) (TupE $ map VarE ps))
++             (AppE (VarE f) (nonUnaryTupE $ map VarE ps))
++  where
++    nonUnaryTupE :: [Exp] -> Exp
++    nonUnaryTupE es = TupE $
++#if MIN_VERSION_template_haskell(2,16,0)
++                            map Just
++#endif
++                            es
diff --git a/gnu/packages/patches/ganeti-os-disk-size.patch b/gnu/packages/patches/ganeti-os-disk-size.patch
deleted file mode 100644
index 16b1d7615c..0000000000
--- a/gnu/packages/patches/ganeti-os-disk-size.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-This exposes information about disk sizes to OS install scripts.  instance-guix
-uses this if available to determine the size of the VM image.
-
-Submitted upstream:
-https://github.com/ganeti/ganeti/pull/1503
-
-diff --git a/lib/backend.py b/lib/backend.py
---- a/lib/backend.py
-+++ b/lib/backend.py
-@@ -4305,6 +4305,7 @@ def OSEnvironment(instance, inst_os, debug=0):
-     uri = _CalculateDeviceURI(instance, disk, real_disk)
-     result["DISK_%d_ACCESS" % idx] = disk.mode
-     result["DISK_%d_UUID" % idx] = disk.uuid
-+    result["DISK_%d_SIZE" % idx] = str(disk.size)
-     if real_disk.dev_path:
-       result["DISK_%d_PATH" % idx] = real_disk.dev_path
-     if uri:
diff --git a/gnu/packages/patches/ganeti-preserve-PYTHONPATH.patch b/gnu/packages/patches/ganeti-preserve-PYTHONPATH.patch
deleted file mode 100644
index 1358e30633..0000000000
--- a/gnu/packages/patches/ganeti-preserve-PYTHONPATH.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-Do not override PYTHONPATH when calling Python code from the Haskell
-daemons.  This is necessary because the Python library dependencies are
-only available through PYTHONPATH.
-
-diff --git a/src/Ganeti/Query/Exec.hs b/src/Ganeti/Query/Exec.hs
---- a/src/Ganeti/Query/Exec.hs
-+++ b/src/Ganeti/Query/Exec.hs
-@@ -99,12 +99,10 @@ spawnJobProcess jid = withErrorLogAt CRITICAL (show jid) $
-   do
-     use_debug <- isDebugMode
-     env_ <- (M.toList . M.insert "GNT_DEBUG" (if use_debug then "1" else "0")
--            . M.insert "PYTHONPATH" AC.pythondir
-             . M.fromList)
-            `liftM` getEnvironment
-     execPy <- P.jqueueExecutorPy
-     logDebug $ "Executing " ++ AC.pythonPath ++ " " ++ execPy
--               ++ " with PYTHONPATH=" ++ AC.pythondir
- 
-     (master, child) <- pipeClient connectConfig
-     let (rh, wh) = clientToHandle child
-
diff --git a/gnu/packages/patches/ganeti-sphinx-compat.patch b/gnu/packages/patches/ganeti-sphinx-compat.patch
new file mode 100644
index 0000000000..4e84abbf37
--- /dev/null
+++ b/gnu/packages/patches/ganeti-sphinx-compat.patch
@@ -0,0 +1,24 @@
+Adjust documentation for Sphinx 4.0.
+
+Discussed upstream at <https://github.com/ganeti/ganeti/pull/1615>.
+
+diff --git a/doc/index.rst b/doc/index.rst
+--- a/doc/index.rst
++++ b/doc/index.rst
+@@ -119,7 +119,6 @@ Draft designs
+    design-hotplug.rst
+    design-internal-shutdown.rst
+    design-kvmd.rst
+-   design-location.rst
+    design-linuxha.rst
+    design-location.rst
+    design-lu-generated-jobs.rst
+diff --git a/lib/build/shell_example_lexer.py b/lib/build/shell_example_lexer.py
+--- a/lib/build/shell_example_lexer.py
++++ b/lib/build/shell_example_lexer.py
+@@ -79,4 +79,4 @@ class ShellExampleLexer(RegexLexer):
+ 
+ 
+ def setup(app):
+-  app.add_lexer("shell-example", ShellExampleLexer())
++  app.add_lexer("shell-example", ShellExampleLexer)
diff --git a/gnu/packages/patches/gcc-10-cross-environment-variables.patch b/gnu/packages/patches/gcc-10-cross-environment-variables.patch
new file mode 100644
index 0000000000..414198657d
--- /dev/null
+++ b/gnu/packages/patches/gcc-10-cross-environment-variables.patch
@@ -0,0 +1,51 @@
+Search path environment variables for cross-compilers.  See the discussion
+at <http://gcc.gnu.org/ml/gcc/2013-02/msg00124.html>.
+
+Note: Touch 'C_INCLUDE_PATH' et al. rather than 'CPATH', as discussed
+at <http://bugs.gnu.org/22186>.
+
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -4474,7 +4474,7 @@ process_command (unsigned int decoded_options_count,
+     }
+ 
+   temp = env.get (LIBRARY_PATH_ENV);
+-  if (temp && *cross_compile == '0')
++  if (temp)
+     {
+       const char *startp, *endp;
+       char *nstore = (char *) alloca (strlen (temp) + 3);
+diff --git a/gcc/incpath.c b/gcc/incpath.c
+--- a/gcc/incpath.c
++++ b/gcc/incpath.c
+@@ -472,8 +472,8 @@ register_include_chains (cpp_reader *pfile, const char *sysroot,
+ 			 int stdinc, int cxx_stdinc, int verbose)
+ {
+   static const char *const lang_env_vars[] =
+-    { "C_INCLUDE_PATH", "CPLUS_INCLUDE_PATH",
+-      "OBJC_INCLUDE_PATH", "OBJCPLUS_INCLUDE_PATH" };
++    { "CROSS_C_INCLUDE_PATH", "CROSS_CPLUS_INCLUDE_PATH",
++      "CROSS_OBJC_INCLUDE_PATH", "CROSS_OBJCPLUS_INCLUDE_PATH" };
+   cpp_options *cpp_opts = cpp_get_options (pfile);
+   size_t idx = (cpp_opts->objc ? 2: 0);
+ 
+@@ -484,7 +484,7 @@ register_include_chains (cpp_reader *pfile, const char *sysroot,
+ 
+   /* CPATH and language-dependent environment variables may add to the
+      include chain.  */
+-  add_env_var_paths ("CPATH", INC_BRACKET);
++  add_env_var_paths ("CROSS_CPATH", INC_BRACKET);
+   add_env_var_paths (lang_env_vars[idx], INC_SYSTEM);
+ 
+   target_c_incpath.extra_pre_includes (sysroot, iprefix, stdinc);
+diff --git a/gcc/system.h b/gcc/system.h
+--- a/gcc/system.h
++++ b/gcc/system.h
+@@ -1244,4 +1244,6 @@ void gcc_stablesort (void *, size_t, size_t,
+    of the number.  */
+ #define PRsa(n) "%" #n PRIu64 "%c"
+ 
++#define LIBRARY_PATH_ENV "CROSS_LIBRARY_PATH"
++
+ #endif /* ! GCC_SYSTEM_H */
diff --git a/gnu/packages/patches/gcc-5-fix-powerpc64le-build.patch b/gnu/packages/patches/gcc-5-fix-powerpc64le-build.patch
new file mode 100644
index 0000000000..289d648875
--- /dev/null
+++ b/gnu/packages/patches/gcc-5-fix-powerpc64le-build.patch
@@ -0,0 +1,64 @@
+From ee6c0081c03330045b3d4cde8421cd1d3a459609 Mon Sep 17 00:00:00 2001
+From: Martin Liska <mliska@suse.cz>
+Date: Fri, 15 Jun 2018 10:51:28 +0200
+Subject: [PATCH] Partial backport r256656
+
+2018-06-15  Martin Liska  <mliska@suse.cz>
+
+	Backport from mainline
+	2018-01-10  Kelvin Nilsen  <kelvin@gcc.gnu.org>
+
+	* lex.c (search_line_fast): Remove illegal coercion of an
+	unaligned pointer value to vector pointer type and replace with
+	use of __builtin_vec_vsx_ld () built-in function, which operates
+	on unaligned pointer values.
+
+From-SVN: r261621
+---
+
+Obtained from:
+
+https://gcc.gnu.org/git/?p=gcc.git;a=patch;h=ee6c0081c03330045b3d4cde8421cd1d3a459609
+
+The libcpp/ChangeLog hunk was modified to apply on top of gcc-5's libcpp/ChangeLog.
+
+ libcpp/ChangeLog | 12 ++++++++++++
+ libcpp/lex.c     |  2 +-
+ 2 files changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
+index c920a05d438..a63abb04f5e 100644
+--- a/libcpp/ChangeLog
++++ b/libcpp/ChangeLog
+@@ -1,3 +1,15 @@
++2018-06-15  Martin Liska  <mliska@suse.cz>
++
++	PR bootstrap/86162
++
++	Backport from mainline
++	2018-01-10  Kelvin Nilsen  <kelvin@gcc.gnu.org>
++
++	* lex.c (search_line_fast): Remove illegal coercion of an
++	unaligned pointer value to vector pointer type and replace with
++	use of __builtin_vec_vsx_ld () built-in function, which operates
++	on unaligned pointer values.
++
+ 2017-10-10  Release Manager
+ 
+ 	* GCC 5.5.0 released.
+diff --git a/libcpp/lex.c b/libcpp/lex.c
+index e5a0397f309..b789686f1c4 100644
+--- a/libcpp/lex.c
++++ b/libcpp/lex.c
+@@ -568,7 +568,7 @@ search_line_fast (const uchar *s, const uchar *end ATTRIBUTE_UNUSED)
+     {
+       vc m_nl, m_cr, m_bs, m_qm;
+ 
+-      data = *((const vc *)s);
++      data = __builtin_vec_vsx_ld (0, s);
+       s += 16;
+ 
+       m_nl = (vc) __builtin_vec_cmpeq(data, repl_nl);
+-- 
+2.27.0
+
diff --git a/gnu/packages/patches/gcc-cross-gxx-include-dir.patch b/gnu/packages/patches/gcc-cross-gxx-include-dir.patch
new file mode 100644
index 0000000000..d6c4ffddc4
--- /dev/null
+++ b/gnu/packages/patches/gcc-cross-gxx-include-dir.patch
@@ -0,0 +1,73 @@
+This patch reverts upstream commit b4d3485e4fc1d:
+
+  https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=b4d3485e4fc1d029e620a59deb54b3f4f3f6b209
+
+Otherwise, GCC ends up searching the wrong target directory for cross-headers.
+
+diff --git a/gcc/configure b/gcc/configure
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -3689,11 +3689,6 @@ esac
+ fi
+ 
+ 
+-# If both --with-sysroot and --with-gxx-include-dir are passed, we interpolate
+-# the former in the latter and, upon success, compute gcc_gxx_include_dir as
+-# relative to the sysroot.
+-gcc_gxx_include_dir_add_sysroot=0
+-
+ # This logic must match libstdc++-v3/acinclude.m4:GLIBCXX_EXPORT_INSTALL_INFO.
+ if test x${gcc_gxx_include_dir} = x; then
+   if test x${enable_version_specific_runtime_libs} = xyes; then
+@@ -3705,10 +3700,15 @@ if test x${gcc_gxx_include_dir} = x; then
+     fi
+     gcc_gxx_include_dir="\$(libsubdir)/\$(libsubdir_to_prefix)$libstdcxx_incdir"
+   fi
+-elif test "${with_sysroot+set}" = set; then
++fi
++
++gcc_gxx_include_dir_add_sysroot=0
++if test "${with_sysroot+set}" = set; then
+   gcc_gxx_without_sysroot=`expr "${gcc_gxx_include_dir}" : "${with_sysroot}"'\(.*\)'`
+   if test "${gcc_gxx_without_sysroot}"; then
+-    gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
++    if test x${with_sysroot} != x/; then
++      gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
++    fi
+     gcc_gxx_include_dir_add_sysroot=1
+   fi
+ fi
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index 715fcba0482..88136e232df 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -204,11 +204,6 @@ no)	;;
+ *)	gcc_gxx_include_dir=$with_gxx_include_dir ;;
+ esac])
+ 
+-# If both --with-sysroot and --with-gxx-include-dir are passed, we interpolate
+-# the former in the latter and, upon success, compute gcc_gxx_include_dir as
+-# relative to the sysroot.
+-gcc_gxx_include_dir_add_sysroot=0
+-
+ # This logic must match libstdc++-v3/acinclude.m4:GLIBCXX_EXPORT_INSTALL_INFO.
+ if test x${gcc_gxx_include_dir} = x; then
+   if test x${enable_version_specific_runtime_libs} = xyes; then
+@@ -220,10 +215,15 @@ if test x${gcc_gxx_include_dir} = x; then
+     fi
+     gcc_gxx_include_dir="\$(libsubdir)/\$(libsubdir_to_prefix)$libstdcxx_incdir"
+   fi
+-elif test "${with_sysroot+set}" = set; then
++fi
++
++gcc_gxx_include_dir_add_sysroot=0
++if test "${with_sysroot+set}" = set; then
+   gcc_gxx_without_sysroot=`expr "${gcc_gxx_include_dir}" : "${with_sysroot}"'\(.*\)'`
+   if test "${gcc_gxx_without_sysroot}"; then
+-    gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
++    if test x${with_sysroot} != x/; then
++      gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
++    fi
+     gcc_gxx_include_dir_add_sysroot=1
+   fi
+ fi
diff --git a/gnu/packages/patches/gd-Revert-fix-303-gdlib.pc.patch b/gnu/packages/patches/gd-Revert-fix-303-gdlib.pc.patch
new file mode 100644
index 0000000000..6329b129d3
--- /dev/null
+++ b/gnu/packages/patches/gd-Revert-fix-303-gdlib.pc.patch
@@ -0,0 +1,179 @@
+From 9b31dfda73ee2d1b56b3f0dcfd3246c2faa592fe Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?L=C3=A9o=20Le=20Bouter?= <lle-bout@zaclys.net>
+Date: Sun, 28 Mar 2021 19:47:25 +0200
+Subject: [PATCH] Revert "fix #303: gdlib.pc: use Requires instead of Libs
+ (#537)"
+
+This reverts commit 28ecfe77c817aff8ce56422d3e4e8533a281bc76.
+---
+ CMakeLists.txt        | 12 ------------
+ config/gdlib.pc.cmake |  4 +---
+ config/gdlib.pc.in    |  4 +---
+ configure.ac          | 11 +----------
+ src/CMakeLists.txt    |  6 ------
+ 5 files changed, 3 insertions(+), 34 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 57cd95d..6bd0c73 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -53,8 +53,6 @@ SET (CMAKE_ARCHIVE_OUTPUT_DIRECTORY
+   "Single Directory for all static libraries."
+   )
+ 
+-SET(PKG_REQUIRES_PRIVATES "")
+-
+ if (USE_EXT_GD)
+ 	message("Using GD at: ${USE_EXT_GD}")
+ 	INCLUDE_DIRECTORIES(BEFORE ${GD_INCLUDE_DIR})
+@@ -170,13 +168,11 @@ else (USE_EXT_GD)
+ 		INCLUDE_DIRECTORIES(${FREETYPE_INCLUDE_DIRS})
+ 		SET(HAVE_FT2BUILD_H 1)
+ 		SET(HAVE_LIBFREETYPE 1)
+-		LIST(APPEND PKG_REQUIRES_PRIVATES freetype2)
+ 	ENDIF(FREETYPE_FOUND)
+ 
+ 	IF(ZLIB_FOUND)
+ 		INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
+ 		SET(HAVE_LIBZ 1)
+-		LIST(APPEND PKG_REQUIRES_PRIVATES zlib)
+ 	ENDIF(ZLIB_FOUND)
+ 
+ 	IF(WEBP_FOUND)
+@@ -192,7 +188,6 @@ else (USE_EXT_GD)
+ 	IF(PNG_FOUND)
+ 		INCLUDE_DIRECTORIES(${PNG_INCLUDE_DIR})
+ 		SET(HAVE_LIBPNG 1)
+-		LIST(APPEND PKG_REQUIRES_PRIVATES libpng)
+ 	ENDIF(PNG_FOUND)
+ 
+ 	IF(ICONV_FOUND)
+@@ -209,25 +204,21 @@ else (USE_EXT_GD)
+ 	IF(XPM_FOUND)
+ 		INCLUDE_DIRECTORIES(${XPM_INCLUDE_DIR})
+ 		SET(HAVE_LIBXPM 1)
+-		LIST(APPEND PKG_REQUIRES_PRIVATES xpm)
+ 	ENDIF(XPM_FOUND)
+ 
+ 	IF(JPEG_FOUND)
+ 		INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR})
+ 		SET(HAVE_LIBJPEG 1)
+-		LIST(APPEND PKG_REQUIRES_PRIVATES libjpeg)
+ 	ENDIF(JPEG_FOUND)
+ 
+ 	IF(TIFF_FOUND)
+ 		INCLUDE_DIRECTORIES(${TIFF_INCLUDE_DIR})
+ 		SET(HAVE_LIBTIFF 1)
+-		LIST(APPEND PKG_REQUIRES_PRIVATES libtiff-4)
+ 	ENDIF(TIFF_FOUND)
+ 
+ 	IF(FONTCONFIG_FOUND)
+ 		INCLUDE_DIRECTORIES(${FONTCONFIG_INCLUDE_DIR})
+ 		SET(HAVE_LIBFONTCONFIG 1)
+-		LIST(APPEND PKG_REQUIRES_PRIVATES fontconfig)
+ 	ELSE (FONTCONFIG_FOUND)
+ 		SET(FONTCONFIG_LIBRARY "")
+ 		SET(FONTCONFIG_INCLUDE_DIR "")
+@@ -236,11 +227,8 @@ else (USE_EXT_GD)
+ 
+ 	IF(RAQM_FOUND)
+ 		INCLUDE_DIRECTORIES(${RAQM_INCLUDE_DIR})
+-		SET(HAVE_RAQM 1)
+-		LIST(APPEND PKG_REQUIRES_PRIVAES raqm)
+ 	ENDIF(RAQM_FOUND)
+ 
+-	string(REPLACE ";" ", " PKG_REQUIRES_PRIVATES "${PKG_REQUIRES_PRIVATES}")
+ 	SET(HAVE_CONFIG_H 1)
+ 
+ 	ADD_DEFINITIONS(-DHAVE_CONFIG_H)
+diff --git a/config/gdlib.pc.cmake b/config/gdlib.pc.cmake
+index 5fc8af4..d1a0dda 100644
+--- a/config/gdlib.pc.cmake
++++ b/config/gdlib.pc.cmake
+@@ -6,8 +6,6 @@ includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
+ Name: gd
+ Description: GD graphics library
+ Version: @GDLIB_VERSION@
+-Requires:
+-Requires.private: @PKG_REQUIRES_PRIVATES@
+ Cflags: -I${includedir}
+-Libs.private: @LIBS_PRIVATES@
++Libs.private: @LIBGD_DEP_LIBS@
+ Libs: -L${libdir} -lgd
+diff --git a/config/gdlib.pc.in b/config/gdlib.pc.in
+index d6bc375..b980a60 100644
+--- a/config/gdlib.pc.in
++++ b/config/gdlib.pc.in
+@@ -6,8 +6,6 @@ includedir=@includedir@
+ Name: gd
+ Description: GD graphics library
+ Version: @VERSION@
+-Requires:
+-Requires.private: @PKG_REQUIRES_PRIVATES@
+ Cflags: -I${includedir}
+-Libs.private: @LIBS_PRIVATES@ @LIBICONV@
++Libs.private: @LIBS@ @LIBICONV@
+ Libs: -L${libdir} -lgd
+diff --git a/configure.ac b/configure.ac
+index 535db68..329c99c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -33,9 +33,6 @@ AC_SUBST(GDLIB_LT_CURRENT)
+ AC_SUBST(GDLIB_LT_REVISION)
+ AC_SUBST(GDLIB_LT_AGE)
+ 
+-AC_SUBST(LIBS_PRIVATES)
+-AC_SUBST(PKG_REQUIRES_PRIVATES)
+-
+ AM_INIT_AUTOMAKE([1.11 foreign dist-xz -Wall -Werror subdir-objects])
+ AC_CONFIG_HEADERS([src/config.h:src/config.hin])
+ 
+@@ -133,7 +130,6 @@ m4_define([GD_LIB_CHECK], [dnl
+   AC_MSG_RESULT([$gd_with_lib])
+ 
+   gd_found_lib=no
+-  gd_require_pkg_name=""
+   if test "$gd_with_lib" != "no"; then
+     save_CPPFLAGS=$CPPFLAGS
+     save_LDFLAGS=$LDFLAGS
+@@ -165,11 +161,6 @@ m4_define([GD_LIB_CHECK], [dnl
+       $1][_CFLAGS="$gd_lib_cflags $][$1][_CFLAGS"
+       AS_VAR_APPEND([LIBS], [" $][$1][_LIBS"])
+       AS_VAR_APPEND([CPPFLAGS], [" $][$1][_CFLAGS"])
+-      if test -z "$gd_require_pkg_name"; then
+-        AS_VAR_APPEND([LIBS_PRIVATES], [" $][$1][_LIBS"])
+-      else
+-        AS_VAR_APPEND([PKG_REQUIRES_PRIVATES], ["  $gd_require_pkg_name"])
+-      fi
+     elif test "$gd_with_lib" = "yes"; then
+       AC_MSG_ERROR([$3 requested but not found])
+     else
+@@ -189,7 +180,7 @@ dnl $4 - pkg-config module to look for
+ dnl $5 - fallback test for the feature
+ m4_define([GD_LIB_PKG_CHECK], [dnl
+   GD_LIB_CHECK([$1], [$2], [$3], [dnl
+-    PKG_CHECK_MODULES([$1], [$4], [gd_found_lib=yes gd_require_pkg_name="$4"], [$5])
++    PKG_CHECK_MODULES([$1], [$4], [gd_found_lib=yes], [$5])
+   ])
+ ])
+ 
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 509c422..49adbd6 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -142,12 +142,6 @@ if (BUILD_STATIC_LIBS)
+ 	target_link_libraries(${GD_LIB_STATIC} ${LIBGD_DEP_LIBS})
+ endif()
+ 
+-SET(LIBS_PRIVATES
+-	${ICONV_LIBRARIES}
+-	${LIQ_LIBRARIES}
+-	${WEBP_LIBRARIES}
+-)
+-
+ set(GD_PROGRAMS gdcmpgif)
+ 
+ if (PNG_FOUND)
+-- 
+2.31.1
+
diff --git a/gnu/packages/patches/gdb-fix-gnu-nat-build.patch b/gnu/packages/patches/gdb-fix-gnu-nat-build.patch
new file mode 100644
index 0000000000..b0249d9cec
--- /dev/null
+++ b/gnu/packages/patches/gdb-fix-gnu-nat-build.patch
@@ -0,0 +1,254 @@
+Fix build on the Hurd.
+
+Patch #1 taken from upstream
+
+    https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=a1700a3199d31910b87cd7db3c394ddd091cfcde
+
+Patch #2 taken from upstream mailing list
+
+    https://sourceware.org/pipermail/gdb/2021-November/049777.html
+
+Patch #3 sent to upstream
+
+    https://sourceware.org/pipermail/gdb/2021-November/049788.html
+
+From 30d89407ad6bb62fafc72fa9c547c2d7ff371401 Mon Sep 17 00:00:00 2001
+From: Simon Marchi <simon.marchi@polymtl.ca>
+Date: Wed, 3 Nov 2021 15:09:19 -0400
+Subject: [PATCH 1/3] gdb: fix gnu-nat build
+Content-Transfer-Encoding: 8bit
+Content-Type: text/plain; charset=UTF-8
+
+When building gnu-nat.c, we get:
+
+      CXX    gnu-nat.o
+    gnu-nat.c: In member function 'virtual void gnu_nat_target::create_inferior(const char*, const string&, char**, int)':
+    gnu-nat.c:2117:13: error: 'struct inf' has no member named 'target_is_pushed'
+     2117 |   if (!inf->target_is_pushed (this))
+          |             ^~~~~~~~~~~~~~~~
+    gnu-nat.c:2118:10: error: 'struct inf' has no member named 'push_target'
+     2118 |     inf->push_target (this);
+          |          ^~~~~~~~~~~
+
+This is because of a confusion between the generic `struct inferior`
+variable and the gnu-nat-specific `struct inf` variable.  Fix by
+referring to `inferior`, not `inf`.
+
+Adjust the comment on top of `struct inf` to clarify the purpose of that
+type.
+
+Co-Authored-By: Andrea Monaco <andrea.monaco@autistici.org>
+Change-Id: I2fe2f7f6ef61a38d79860fd262b08835c963fc77
+---
+ gdb/gnu-nat.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c
+index 67ce00e9c30..ab539b4d8b4 100644
+--- a/gdb/gnu-nat.c
++++ b/gdb/gnu-nat.c
+@@ -149,7 +149,7 @@ struct inf_wait
+     int suppress;		/* Something trivial happened.  */
+   };
+ 
+-/* The state of an inferior.  */
++/* Further Hurd-specific state of an inferior.  */
+ struct inf
+   {
+     /* Fields describing the current inferior.  */
+@@ -2114,8 +2114,8 @@ gnu_nat_target::create_inferior (const char *exec_file,
+ 
+   inf_debug (inf, "creating inferior");
+ 
+-  if (!inf->target_is_pushed (this))
+-    inf->push_target (this);
++  if (!inferior->target_is_pushed (this))
++    inferior->push_target (this);
+ 
+   pid = fork_inferior (exec_file, allargs, env, gnu_ptrace_me,
+ 		       NULL, NULL, NULL, NULL);
+From ebc0837f4693232f74eb2cc3033515b18a8f0900 Mon Sep 17 00:00:00 2001
+From: "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org>
+Date: Mon, 22 Nov 2021 07:47:28 +0100
+Subject: [PATCH 2/3] gdb: gnu-nat.c: port-rights.
+Content-Transfer-Encoding: 8bit
+Content-Type: text/plain; charset=UTF-8
+
+Taken from:
+
+    https://sourceware.org/pipermail/gdb/2021-November/049777.html
+---
+ gdb/gnu-nat.c | 18 ++++++++++--------
+ 1 file changed, 10 insertions(+), 8 deletions(-)
+
+diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c
+index ab539b4d8b4..8cd876b21d0 100644
+--- a/gdb/gnu-nat.c
++++ b/gdb/gnu-nat.c
+@@ -3292,15 +3292,17 @@ This is the same as setting `task pause', `exceptions', and\n\
+ 	    _("Show information about the task's send rights."));
+   add_info ("receive-rights", info_recv_rights_cmd,
+ 	    _("Show information about the task's receive rights."));
+-  add_info ("port-rights", info_port_rights_cmd,
+-	    _("Show information about the task's port rights."));
+-  add_info ("port-sets", info_port_sets_cmd,
+-	    _("Show information about the task's port sets."));
++  cmd_list_element *port_rights_cmd =
++    add_info ("port-rights", info_port_rights_cmd,
++             _("Show information about the task's port rights."));
++  cmd_list_element *port_sets_cmd =
++    add_info ("port-sets", info_port_sets_cmd,
++             _("Show information about the task's port sets."));
+   add_info ("dead-names", info_dead_names_cmd,
+-	    _("Show information about the task's dead names."));
+-  add_info_alias ("ports", "port-rights", 1);
+-  add_info_alias ("port", "port-rights", 1);
+-  add_info_alias ("psets", "port-sets", 1);
++            _("Show information about the task's dead names."));
++  add_info_alias ("ports", port_rights_cmd, 1);
++  add_info_alias ("port", port_rights_cmd, 1);
++  add_info_alias ("psets", port_sets_cmd, 1);
+ }
+ 
+ 
+From e8df985cdd95e4808c390e226a0e852d23c502f9 Mon Sep 17 00:00:00 2001
+From: "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org>
+Date: Mon, 22 Nov 2021 08:22:15 +0100
+Subject: [PATCH 3/3] gdb: More compile fixes for gnu-nat.c.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+Content-Transfer-Encoding: 8bit
+Content-Type: text/plain; charset=UTF-8
+
+This fixes compile errors like
+
+    ../../gdb-11.1/gdb/gnu-nat.c: In function ‘void add_task_commands()’:
+    ../../gdb-11.1/gdb/gnu-nat.c:3204:17: error: no matching function for call to ‘add_cmd(const char [8], command_class, cmd_list_element*&, char*, cmd_list_element**)’
+     3204 |         &setlist);
+          |                 ^
+    In file included from ../../gdb-11.1/gdb/completer.h:21,
+                     from ../../gdb-11.1/gdb/symtab.h:36,
+                     from ../../gdb-11.1/gdb/infrun.h:21,
+                     from ../../gdb-11.1/gdb/target.h:42,
+                     from ../../gdb-11.1/gdb/inf-child.h:23,
+                     from ../../gdb-11.1/gdb/gnu-nat.h:38,
+                     from ../../gdb-11.1/gdb/gnu-nat.c:24:
+    ../../gdb-11.1/gdb/command.h:160:33: note: candidate: ‘cmd_list_element* add_cmd(const char*, command_class, void (*)(const char*, int), const char*, cmd_list_element**)’
+      160 | extern struct cmd_list_element *add_cmd (const char *, enum command_class,
+          |                                 ^~~~~~~
+    ../../gdb-11.1/gdb/command.h:161:30: note:   no known conversion for argument 3 from ‘cmd_list_element*’ to ‘void (*)(const char*, int)’
+      161 |       cmd_const_cfunc_ftype *fun,
+          |       ~~~~~~~~~~~~~~~~~~~~~~~^~~
+    ../../gdb-11.1/gdb/command.h:167:33: note: candidate: ‘cmd_list_element* add_cmd(const char*, command_class, const char*, cmd_list_element**)’
+      167 | extern struct cmd_list_element *add_cmd (const char *, enum command_class,
+          |                                 ^~~~~~~
+    ../../gdb-11.1/gdb/command.h:167:33: note:   candidate expects 4 arguments, 5 provided
+    ../../gdb-11.1/gdb/gnu-nat.c:3210:18: error: no matching function for call to ‘add_cmd(const char [8], command_class, cmd_list_element*&, char*, cmd_list_element**)’
+     3210 |         &showlist);
+          |                  ^
+
+* gdb/gnu-nat.c (add_task_commands): Use a fresh variable instead of
+shadowing set_signals_cmd etc.
+(add_thread_commands): Likewise.
+---
+ gdb/gnu-nat.c | 33 +++++++++++++++++----------------
+ 1 file changed, 17 insertions(+), 16 deletions(-)
+
+diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c
+index 8cd876b21d0..7aecc2295f8 100644
+--- a/gdb/gnu-nat.c
++++ b/gdb/gnu-nat.c
+@@ -3197,31 +3197,31 @@ Show whether new threads are allowed to run (once gdb has noticed them)."),
+ 	   _("Show the default detach-suspend-count value for new threads."),
+ 	   &show_thread_default_cmd_list);
+ 
+-  cmd_list_element *set_signals_cmd
++  cmd_list_element *set_signals_cmd_
+     = add_cmd ("signals", class_run, set_signals_cmd, _("\
+ Set whether the inferior process's signals will be intercepted.\n\
+ Mach exceptions (such as breakpoint traps) are not affected."),
+ 	       &setlist);
+-  add_alias_cmd ("sigs", set_signals_cmd, class_run, 1, &setlist);
++  add_alias_cmd ("sigs", set_signals_cmd_, class_run, 1, &setlist);
+ 
+-  cmd_list_element *show_signals_cmd
++  cmd_list_element *show_signals_cmd_
+     = add_cmd ("signals", no_class, show_signals_cmd, _("\
+ Show whether the inferior process's signals will be intercepted."),
+ 	       &showlist);
+-  add_alias_cmd ("sigs", show_signals_cmd, no_class, 1, &showlist);
++  add_alias_cmd ("sigs", show_signals_cmd_, no_class, 1, &showlist);
+ 
+-  cmd_list_element *set_signal_thread_cmd
++  cmd_list_element *set_signal_thread_cmd_
+     = add_cmd ("signal-thread", class_run, set_sig_thread_cmd, _("\
+ Set the thread that gdb thinks is the libc signal thread.\n\
+ This thread is run when delivering a signal to a non-stopped process."),
+ 	       &setlist);
+-  add_alias_cmd ("sigthread", set_signal_thread_cmd, class_run, 1, &setlist);
++  add_alias_cmd ("sigthread", set_signal_thread_cmd_, class_run, 1, &setlist);
+ 
+-  cmd_list_element *show_signal_thread_cmd
++  cmd_list_element *show_signal_thread_cmd_
+     = add_cmd ("signal-thread", no_class, show_sig_thread_cmd, _("\
+ Set the thread that gdb thinks is the libc signal thread."),
+ 	       &showlist);
+-  add_alias_cmd ("sigthread", show_signal_thread_cmd, no_class, 1, &showlist);
++  add_alias_cmd ("sigthread", show_signal_thread_cmd_, no_class, 1, &showlist);
+ 
+   add_cmd ("stopped", class_run, set_stopped_cmd, _("\
+ Set whether gdb thinks the inferior process is stopped as with SIGSTOP.\n\
+@@ -3231,13 +3231,13 @@ Stopped process will be continued by sending them a signal."),
+ Show whether gdb thinks the inferior process is stopped as with SIGSTOP."),
+ 	   &showlist);
+ 
+-  cmd_list_element *set_exceptions_cmd
++  cmd_list_element *set_exceptions_cmd_
+     = add_cmd ("exceptions", class_run, set_exceptions_cmd, _("\
+ Set whether exceptions in the inferior process will be trapped.\n\
+ When exceptions are turned off, neither breakpoints nor single-stepping\n\
+ will work."), &setlist);
+   /* Allow `set exc' despite conflict with `set exception-port'.  */
+-  add_alias_cmd ("exc", set_exceptions_cmd, class_run, 1, &setlist);
++  add_alias_cmd ("exc", set_exceptions_cmd_, class_run, 1, &setlist);
+ 
+   add_cmd ("exceptions", no_class, show_exceptions_cmd, _("\
+ Show whether exceptions in the inferior process will be trapped."),
+@@ -3269,14 +3269,14 @@ used to pause individual threads by default instead."),
+ 	     "on the thread when detaching."),
+ 	   &show_task_cmd_list);
+ 
+-  cmd_list_element *set_task_exception_port_cmd
++  cmd_list_element *set_task_exception_port_cmd_
+     = add_cmd ("exception-port", no_class, set_task_exc_port_cmd, _("\
+ Set the task exception port to which we forward exceptions.\n\
+ The argument should be the value of the send right in the task."),
+ 	       &set_task_cmd_list);
+-  add_alias_cmd ("excp", set_task_exception_port_cmd, no_class, 1,
++  add_alias_cmd ("excp", set_task_exception_port_cmd_, no_class, 1,
+ 		 &set_task_cmd_list);
+-  add_alias_cmd ("exc-port", set_task_exception_port_cmd, no_class, 1,
++  add_alias_cmd ("exc-port", set_task_exception_port_cmd_, no_class, 1,
+ 		 &set_task_cmd_list);
+ 
+   /* A convenient way of turning on all options require to noninvasively
+@@ -3464,14 +3464,15 @@ Note that this is relative to suspend count when gdb noticed the thread;\n\
+ use the `thread takeover-suspend-count' to force it to an absolute value."),
+ 	   &show_thread_cmd_list);
+ 
+-  add_cmd ("exception-port", no_class, set_thread_exc_port_cmd, _("\
++  cmd_list_element *set_thread_exception_port_cmd_
++    = add_cmd ("exception-port", no_class, set_thread_exc_port_cmd, _("\
+ Set the thread exception port to which we forward exceptions.\n\
+ This overrides the task exception port.\n\
+ The argument should be the value of the send right in the task."),
+ 	   &set_thread_cmd_list);
+-  add_alias_cmd ("excp", set_thread_exception_port_cmd, no_class, 1,
++  add_alias_cmd ("excp", set_thread_exception_port_cmd_, no_class, 1,
+ 		 &set_thread_cmd_list);
+-  add_alias_cmd ("exc-port", set_thread_exception_port_cmd, no_class, 1,
++  add_alias_cmd ("exc-port", set_thread_exception_port_cmd_, no_class, 1,
+ 		 &set_thread_cmd_list);
+ 
+   add_cmd ("takeover-suspend-count", no_class, thread_takeover_sc_cmd, _("\
diff --git a/gnu/packages/patches/gdb-hurd.patch b/gnu/packages/patches/gdb-hurd.patch
deleted file mode 100644
index 0af8d4dc28..0000000000
--- a/gnu/packages/patches/gdb-hurd.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-Taken from upstream, removed ChangeLog.
-
-From 6930bffe3373690b3431d6291f9f7c116d6a1ec4 Mon Sep 17 00:00:00 2001
-From: Samuel Thibault <samuel.thibault@ens-lyon.org>
-Date: Sat, 30 May 2020 18:35:59 +0000
-Subject: [PATCH] hurd: fix gnu_debug_flag type
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Fixes
-
-../../gdb/gnu-nat.c:96:6: error: conflicting declaration ‘bool gnu_debug_flag’
-   96 | bool gnu_debug_flag = false;
-../../gdb/gnu-nat.c: In function ‘void _initialize_gnu_nat()’:
-../../gdb/gnu-nat.c:3511:7: error: cannot
-
-gdb/ChangeLog:
-
-	* gnu-nat.h (gnu_debug_flag): Set type to bool.
----
- gdb/ChangeLog | 4 ++++
- gdb/gnu-nat.h | 2 +-
- 2 files changed, 5 insertions(+), 1 deletion(-)
-
-diff --git a/gdb/gnu-nat.h b/gdb/gnu-nat.h
-index 77c57817b2..766f716587 100644
---- a/gdb/gnu-nat.h
-+++ b/gdb/gnu-nat.h
-@@ -111,7 +111,7 @@ extern char *proc_string (struct proc *proc);
- 	      __proc_pid (__proc), __proc->tid, \
- 	      host_address_to_string (__proc) , ##args); } while (0)
- 
--extern int gnu_debug_flag;
-+extern bool gnu_debug_flag;
- 
- #define debug(msg, args...) \
-  do { if (gnu_debug_flag) \
--- 
-Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
-Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com
-
-commit 366f550a593c7e6bae3699a4b6d65fe937af5603
-Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
-Date:   Sat May 30 18:41:30 2020 +0000
-
-    hurd: add missing include
-    
-    Fixes
-    
-    ../../gdb/gnu-nat.c:2522:14: error: ‘target_gdbarch’ was not declared in this scope; did you mean ‘target_detach’?
-     2522 |    paddress (target_gdbarch (), memaddr), pulongest (len),
-    
-    gdb/Changelog:
-    
-            * gnu-nat.c: Include "gdbarch.h".
-
-diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c
-index 3b438a9a43..9b93488b41 100644
---- a/gdb/gnu-nat.c
-+++ b/gdb/gnu-nat.c
-@@ -64,6 +64,7 @@ extern "C"
- #include "language.h"
- #include "target.h"
- #include "gdbsupport/gdb_wait.h"
-+#include "gdbarch.h"
- #include "gdbcmd.h"
- #include "gdbcore.h"
- #include "gdbthread.h"
diff --git a/gnu/packages/patches/gdk-pixbuf-CVE-2020-29385.patch b/gnu/packages/patches/gdk-pixbuf-CVE-2020-29385.patch
deleted file mode 100644
index e6ac4de00b..0000000000
--- a/gnu/packages/patches/gdk-pixbuf-CVE-2020-29385.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-Fix CVE-2020-29385.  Note that we omit the binary test file
-tests/test-images/fail/hang_114.gif from the following commit, to avoid
-requiring 'git' to apply the patch.
-
-
-From bdd3acbd48a575d418ba6bf1b32d7bda2fae1c81 Mon Sep 17 00:00:00 2001
-From: Robert Ancell <robert.ancell@canonical.com>
-Date: Mon, 30 Nov 2020 12:26:12 +1300
-Subject: [PATCH] gif: Fix LZW decoder accepting invalid LZW code.
-
-The code value after a reset wasn't being validated, which means we would
-accept invalid codes. This could cause an infinite loop in the decoder.
-
-Fixes CVE-2020-29385
-
-Fixes https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/issues/164
----
- gdk-pixbuf/lzw.c                    |  13 +++++++------
- tests/test-images/fail/hang_114.gif | Bin 0 -> 5561 bytes
- 2 files changed, 7 insertions(+), 6 deletions(-)
- create mode 100644 tests/test-images/fail/hang_114.gif
-
-diff --git a/gdk-pixbuf/lzw.c b/gdk-pixbuf/lzw.c
-index 9e052a6f7..105daf2b1 100644
---- a/gdk-pixbuf/lzw.c
-+++ b/gdk-pixbuf/lzw.c
-@@ -195,19 +195,20 @@ lzw_decoder_feed (LZWDecoder *self,
-                                 if (self->last_code != self->clear_code && self->code_table_size < MAX_CODES) {
-                                         if (self->code < self->code_table_size)
-                                                 add_code (self, self->code);
--                                        else if (self->code == self->code_table_size)
-+                                        else
-                                                 add_code (self, self->last_code);
--                                        else {
--                                                /* Invalid code received - just stop here */
--                                                self->last_code = self->eoi_code;
--                                                return output_length;
--                                        }
- 
-                                         /* When table is full increase code size */
-                                         if (self->code_table_size == (1 << self->code_size) && self->code_size < LZW_CODE_MAX)
-                                                 self->code_size++;
-                                 }
- 
-+                                /* Invalid code received - just stop here */
-+                                if (self->code >= self->code_table_size) {
-+                                        self->last_code = self->eoi_code;
-+                                        return output_length;
-+                                }
-+
-                                 /* Convert codeword into indexes */
-                                 n_written += write_indexes (self, output + n_written, output_length - n_written);
-                         }
diff --git a/gnu/packages/patches/gdm-default-session.patch b/gnu/packages/patches/gdm-default-session.patch
index 9ab2829cdb..8325b6102b 100644
--- a/gnu/packages/patches/gdm-default-session.patch
+++ b/gnu/packages/patches/gdm-default-session.patch
@@ -4,11 +4,9 @@ and not in the directories listed in $XDG_DATA_DIRS.  The latter includes
 /run/current-system/profile, and only then.
 
 Fixes <https://bugs.gnu.org/37831>.
-
-diff -ur a/daemon/gdm-session.c b/daemon/gdm-session.c
---- a/daemon/gdm-session.c	2019-09-25 10:40:24.000000000 -0400
-+++ b/daemon/gdm-session.c	2020-04-18 18:30:02.671856808 -0400
-@@ -348,24 +348,18 @@
+--- a/daemon/gdm-session.c	2021-07-23 15:16:15.164201000 +0000
++++ b/daemon/gdm-session.c	2021-09-26 08:18:58.730134555 +0000
+@@ -354,25 +354,19 @@
          GArray *search_array = NULL;
          char **search_dirs;
          int i;
@@ -19,22 +17,24 @@ diff -ur a/daemon/gdm-session.c b/daemon/gdm-session.c
                  DMCONFDIR "/Sessions/",
                  DATADIR "/gdm/BuiltInSessions/",
 -                DATADIR "/xsessions/",
-+                "/run/current-system/profile/share/xsessions/"
++                "/run/current-system/profile/share/xsessions/",
          };
  
-         static const char *wayland_search_dir = DATADIR "/wayland-sessions/";
+-        static const char *wayland_search_dir = DATADIR "/wayland-sessions/";
++        static const char *wayland_search_dir = "/run/current-system/profile/share/wayland-sessions/";
  
          search_array = g_array_new (TRUE, TRUE, sizeof (char *));
  
--        for (i = 0; system_data_dirs[i]; i++) {
--                gchar *dir = g_build_filename (system_data_dirs[i], "xsessions", NULL);
--                g_array_append_val (search_array, dir);
--        }
+         if (type == NULL || g_str_equal (type, "x11")) {
+-                for (i = 0; system_data_dirs[i]; i++) {
+-                        gchar *dir = g_build_filename (system_data_dirs[i], "xsessions", NULL);
+-                        g_array_append_val (search_array, dir);
+-                }
 -
-         g_array_append_vals (search_array, x_search_dirs, G_N_ELEMENTS (x_search_dirs));
+                 g_array_append_vals (search_array, x_search_dirs, G_N_ELEMENTS (x_search_dirs));
+         }
  
- #ifdef ENABLE_WAYLAND_SUPPORT
-@@ -373,16 +367,7 @@
+@@ -382,16 +376,7 @@
  #ifdef ENABLE_USER_DISPLAY_SERVER
                  g_array_prepend_val (search_array, wayland_search_dir);
  
@@ -54,7 +54,7 @@ diff -ur a/daemon/gdm-session.c b/daemon/gdm-session.c
 diff -ur a/libgdm/gdm-sessions.c b/libgdm/gdm-sessions.c
 --- a/libgdm/gdm-sessions.c	2019-10-07 04:53:35.000000000 -0400
 +++ b/libgdm/gdm-sessions.c	2020-04-18 18:31:42.491348691 -0400
-@@ -245,19 +245,12 @@
+@@ -245,35 +245,23 @@
                  "/etc/X11/sessions/",
                  DMCONFDIR "/Sessions/",
                  DATADIR "/gdm/BuiltInSessions/",
@@ -75,7 +75,12 @@ diff -ur a/libgdm/gdm-sessions.c b/libgdm/gdm-sessions.c
          for (i = 0; i < G_N_ELEMENTS (xorg_search_dirs); i++) {
                  g_ptr_array_add (xorg_search_array, g_strdup (xorg_search_dirs[i]));
          }
-@@ -269,11 +262,6 @@
+ 
+ #ifdef ENABLE_WAYLAND_SUPPORT
+         const char *wayland_search_dirs[] = {
+-                DATADIR "/wayland-sessions/",
++                "/run/current-system/profile/share/wayland-sessions/",
+         };
  
          wayland_search_array = g_ptr_array_new_with_free_func (g_free);
  
diff --git a/gnu/packages/patches/gdm-elogind-support.patch b/gnu/packages/patches/gdm-elogind-support.patch
new file mode 100644
index 0000000000..39cd12dd22
--- /dev/null
+++ b/gnu/packages/patches/gdm-elogind-support.patch
@@ -0,0 +1,211 @@
+https://gitlab.gnome.org/GNOME/gdm/-/merge_requests/113
+
+From 462cc0f5346f5913cf7151044f1c232c5d21c1c3 Mon Sep 17 00:00:00 2001
+From: Dudemanguy <random342@airmail.cc>
+Date: Mon, 5 Oct 2020 18:41:55 -0500
+Subject: [PATCH] meson: allow building with elogind
+
+Currently, the GDM meson build has a hard dependency on systemd.
+However, GDM can function just fine if one is using elogind. This allows
+a user to build GDM against libelogind and also disable the systemd
+system and user units.
+---
+ common/meson.build                       |  2 +-
+ data/meson.build                         | 62 ++++++++++++++----------
+ data/pam-arch/gdm-launch-environment.pam |  1 +
+ libgdm/meson.build                       |  2 +-
+ meson.build                              | 36 +++++++++-----
+ meson_options.txt                        |  5 +-
+ 6 files changed, 66 insertions(+), 42 deletions(-)
+
+diff --git a/common/meson.build b/common/meson.build
+index 074dd92e1..bca58f7c4 100644
+--- a/common/meson.build
++++ b/common/meson.build
+@@ -11,7 +11,7 @@ libgdmcommon_src = files(
+ )
+ 
+ libgdmcommon_deps = [
+-  libsystemd_dep,
++  logind_dep,
+   gobject_dep,
+   gio_dep,
+   gio_unix_dep,
+diff --git a/data/meson.build b/data/meson.build
+index 7c5222eaf..403336c31 100644
+--- a/data/meson.build
++++ b/data/meson.build
+@@ -168,41 +168,53 @@ else
+   service_config.set('PLYMOUTH_QUIT_SERVICE', '')
+ endif
+ 
+-if get_option('systemdsystemunitdir') != ''
+-  systemd_systemunitdir = get_option('systemdsystemunitdir')
+-else
+-  systemd_systemunitdir = systemd_dep.get_pkgconfig_variable('systemdsystemunitdir')
++systemdsystemunitdir = get_option('systemdsystemunitdir')
++if systemdsystemunitdir != 'no'
++  assert(systemd_dep.found(), 'systemd required but not found, please provide a valid systemd system unit dir or disable it')
++  if get_option('systemdsystemunitdir') != ''
++    systemd_systemunitdir = get_option('systemdsystemunitdir')
++  else
++    systemd_systemunitdir = systemd_dep.get_pkgconfig_variable('systemdsystemunitdir')
++  endif
+ endif
+ 
+-if get_option('systemduserunitdir') != ''
+-  systemd_userunitdir = get_option('systemduserunitdir')
+-else
+-  systemd_userunitdir = systemd_dep.get_pkgconfig_variable('systemduserunitdir',
+-                                                           define_variable: ['prefix', get_option('prefix')])
++systemduserunitdir = get_option('systemduserunitdir')
++if systemduserunitdir != 'no'
++  assert(systemd_dep.found(), 'systemd required but not found, please provide a valid systemd user unit dir or disable it')
++  if get_option('systemduserunitdir') != ''
++    systemd_userunitdir = get_option('systemduserunitdir')
++  else
++    systemd_userunitdir = systemd_dep.get_pkgconfig_variable('systemduserunitdir',
++                                                             define_variable: ['prefix', get_option('prefix')])
++  endif
+ endif
+ 
+-configure_file(
+-  input: 'gdm.service.in',
+-  output: '@BASENAME@',
+-  configuration: service_config,
+-  install_dir: systemd_systemunitdir,
+-  format: 'cmake'
+-)
++if systemdsystemunitdir != 'no'
++  configure_file(
++    input: 'gdm.service.in',
++    output: '@BASENAME@',
++    configuration: service_config,
++    install_dir: systemd_systemunitdir,
++    format: 'cmake'
++  )
++endif
+ 
+ gdm_gnome_session_wanted_targets = []
+ foreach component: gdm_gnome_user_session_wanted_components
+   gdm_gnome_session_wanted_targets += 'Wants=@0@.target'.format(component)
+ endforeach
+ 
+-configure_file(
+-  input: 'session.conf.in',
+-  output: 'session.conf',
+-  configuration: {
+-    'requires_component': gdm_gnome_shell_component,
+-    'wants_required_components': '\n'.join(gdm_gnome_session_wanted_targets),
+-  },
+-  install_dir: systemd_userunitdir / 'gnome-session@gnome-login.target.d',
+-)
++if systemduserunitdir != 'no'
++  configure_file(
++    input: 'session.conf.in',
++    output: 'session.conf',
++    configuration: {
++      'requires_component': gdm_gnome_shell_component,
++      'wants_required_components': '\n'.join(gdm_gnome_session_wanted_targets),
++    },
++    install_dir: systemd_userunitdir / 'gnome-session@gnome-login.target.d',
++  )
++endif
+ 
+ # XSession
+ if get_option('gdm-xsession')
+diff --git a/libgdm/meson.build b/libgdm/meson.build
+index 3f8cafbb7..83e95151b 100644
+--- a/libgdm/meson.build
++++ b/libgdm/meson.build
+@@ -56,7 +56,7 @@ libgdm_deps = [
+   glib_dep,
+   gio_dep,
+   gio_unix_dep,
+-  libsystemd_dep,
++  logind_dep,
+   libgdmcommon_dep,
+ ]
+ 
+diff --git a/meson.build b/meson.build
+index e6fcf4b8b..a86a486b7 100644
+--- a/meson.build
++++ b/meson.build
+@@ -92,21 +92,30 @@ xdmcp_dep = cc.find_library('Xdmcp', required: get_option('xdmcp'))
+ if xdmcp_dep.found() and get_option('tcp-wrappers')
+   libwrap_dep = cc.find_library('libwrap')
+ endif
+-# systemd
+-systemd_dep = dependency('systemd')
+-libsystemd_dep = dependency('libsystemd')
+-if meson.version().version_compare('>= 0.53')
+-  systemd_multiseat_x = find_program('systemd-multi-seat-x',
+-    required: false,
+-    dirs: [
+-      systemd_dep.get_pkgconfig_variable('systemdutildir'),
+-      '/lib/systemd',
+-      '/usr/lib/systemd',
+-    ])
++
++logind_provider = get_option('logind-provider')
++systemd_dep = dependency('systemd', required: false)
++if logind_provider == 'systemd'
++  libsystemd_dep = dependency('libsystemd')
++  logind_dep = libsystemd_dep
++  if meson.version().version_compare('>= 0.53')
++    systemd_multiseat_x = find_program('systemd-multi-seat-x',
++      required: false,
++      dirs: [
++        systemd_dep.get_pkgconfig_variable('systemdutildir'),
++        '/lib/systemd',
++        '/usr/lib/systemd',
++      ])
++  else
++    systemd_multiseat_x = find_program('systemd-multi-seat-x', required: false)
++  endif
++  systemd_x_server = systemd_multiseat_x.found()? systemd_multiseat_x.path() : '/lib/systemd/systemd-multi-seat-x'
+ else
+-  systemd_multiseat_x = find_program('systemd-multi-seat-x', required: false)
++  elogind_dep = dependency('libelogind')
++  logind_dep = elogind_dep
++  systemd_x_server = 'disabled'
+ endif
+-systemd_x_server = systemd_multiseat_x.found()? systemd_multiseat_x.path() : '/lib/systemd/systemd-multi-seat-x'
++
+ # Plymouth
+ plymouth_dep = dependency('ply-boot-client', required: get_option('plymouth'))
+ # Check for Solaris auditing API (ADT)
+@@ -313,6 +322,7 @@ summary({
+     'PAM Syslog': have_pam_syslog,
+     'Supports PAM Extensions': pam_extensions_supported,
+     'SeLinux': libselinux_dep.found(),
++    'Logind Provider': get_option('logind-provider'),
+     'Use GDM Xsession': get_option('gdm-xsession'),
+     'Use UserDisplayServer': get_option('user-display-server'),
+     'Use SystemdJournal': get_option('systemd-journal'),
+diff --git a/meson_options.txt b/meson_options.txt
+index 14e0b908b..5135d7d66 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -12,6 +12,7 @@ option('initial-vt', type: 'integer', value: 1, description: 'Initial virtual te
+ option('ipv6', type: 'boolean', value: false, description: 'Enables compilation of IPv6 code.')
+ option('lang-file', type: 'string', value: '', description: 'File containing default language settings.')
+ option('libaudit', type: 'feature', value: 'auto', description: 'Add Linux audit support.')
++option('logind-provider', type: 'combo', choices: ['systemd', 'elogind'], value: 'systemd', description: 'Which logind library to use.')
+ option('log-dir', type: 'string', value: '/var/log/gdm', description: 'Log directory.')
+ option('pam-mod-dir', type: 'string', value: '', description: 'Directory to install PAM modules in.')
+ option('pam-prefix', type: 'string', value: '', description: 'Specify where PAM files go.')
+@@ -27,8 +28,8 @@ option('solaris', type: 'boolean', value: false, description: 'Build for Solaris
+ option('split-authentication', type: 'boolean', value: true, description: 'Enable multiple simultaneous PAM conversations during login.')
+ option('sysconfsubdir', type: 'string', value: 'gdm', description: 'Directory name used under sysconfdir.')
+ option('systemd-journal', type: 'boolean', value: true, description: 'Use journald support.')
+-option('systemdsystemunitdir', type: 'string', value: '', description: 'Directory for systemd service files.')
+-option('systemduserunitdir', type: 'string', value: '', description: 'Directory for systemd user service files.')
++option('systemdsystemunitdir', type: 'string', value: '', description: 'Directory for systemd service files, or \'no\' to disable.')
++option('systemduserunitdir', type: 'string', value: '', description: 'Directory for systemd user service files, or \'no\' to disable.')
+ option('tcp-wrappers', type: 'boolean', value: false, description: 'Use TCP wrappers.')
+ option('udev-dir', type: 'string', value: '', description: 'Directory for udev rules file.')
+ option('user', type: 'string', value: 'gdm', description: 'GDM\'s username.')
+-- 
+GitLab
+
diff --git a/gnu/packages/patches/gdm-pass-gdk-pixbuf-loader-env.patch b/gnu/packages/patches/gdm-pass-gdk-pixbuf-loader-env.patch
new file mode 100644
index 0000000000..4341e3fc30
--- /dev/null
+++ b/gnu/packages/patches/gdm-pass-gdk-pixbuf-loader-env.patch
@@ -0,0 +1,24 @@
+From 444250fce55f916af993bc855930c6809686e4bd Mon Sep 17 00:00:00 2001
+From: Josselin Poiret <dev@jpoiret.xyz>
+Date: Tue, 23 Nov 2021 18:39:39 +0000
+Subject: [PATCH] Make GDM pass GDK_PIXBUF_MODULE_FILE to sessions
+
+---
+ daemon/gdm-launch-environment.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/daemon/gdm-launch-environment.c b/daemon/gdm-launch-environment.c
+index 14ecfac2..3e618321 100644
+--- a/daemon/gdm-launch-environment.c
++++ b/daemon/gdm-launch-environment.c
+@@ -158,6 +158,7 @@ build_launch_environment (GdmLaunchEnvironment *launch_environment,
+                 "WINDOWPATH",
+                 "XCURSOR_PATH",
+                 "XDG_CONFIG_DIRS",
++                "GDK_PIXBUF_MODULE_FILE",
+                 NULL
+         };
+         char *system_data_dirs;
+-- 
+2.33.1
+
diff --git a/gnu/packages/patches/gdm-remove-hardcoded-xwayland-path.patch b/gnu/packages/patches/gdm-remove-hardcoded-xwayland-path.patch
new file mode 100644
index 0000000000..366fb91668
--- /dev/null
+++ b/gnu/packages/patches/gdm-remove-hardcoded-xwayland-path.patch
@@ -0,0 +1,22 @@
+Remove check for hardcoded Xwayland path in gdm.
+
+---
+ daemon/gdm-local-display-factory.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c
+index da1093bb..37355c06 100644
+--- a/daemon/gdm-local-display-factory.c
++++ b/daemon/gdm-local-display-factory.c
+@@ -203,7 +203,7 @@ gdm_local_display_factory_use_wayland (void)
+ #ifdef ENABLE_WAYLAND_SUPPORT
+         gboolean wayland_enabled = FALSE;
+         if (gdm_settings_direct_get_boolean (GDM_KEY_WAYLAND_ENABLE, &wayland_enabled)) {
+-                if (wayland_enabled && g_file_test ("/usr/bin/Xwayland", G_FILE_TEST_IS_EXECUTABLE) )
++                if (wayland_enabled)
+                         return TRUE;
+         }
+ #endif
+--
+2.33.0
+
diff --git a/gnu/packages/patches/gdm-wayland-session-wrapper-from-env.patch b/gnu/packages/patches/gdm-wayland-session-wrapper-from-env.patch
new file mode 100644
index 0000000000..44ab6a9471
--- /dev/null
+++ b/gnu/packages/patches/gdm-wayland-session-wrapper-from-env.patch
@@ -0,0 +1,35 @@
+Get wayland-session wrapper from environment.
+
+---
+ daemon/gdm-session.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
+index 4e303e70..1deca4e9 100644
+--- a/daemon/gdm-session.c
++++ b/daemon/gdm-session.c
+@@ -2888,8 +2888,9 @@ gdm_session_start_session (GdmSession *self,
+                                                            allow_remote_connections? "--allow-remote-connections " : "",
+                                                            command);
+                         } else {
+-                                program = g_strdup_printf (LIBEXECDIR "/gdm-wayland-session %s\"%s\"",
++                                program = g_strdup_printf (LIBEXECDIR "/gdm-wayland-session %s\"%s %s\"",
+                                                            register_session ? "--register-session " : "",
++                                                           g_getenv ("GDM_WAYLAND_SESSION"),
+                                                            command);
+                         }
+                 } else if (run_xsession_script) {
+@@ -2942,8 +2942,9 @@
+                                                            register_session ? "--register-session " : "",
+                                                            self->selected_program);
+                         } else {
+-                                program = g_strdup_printf (LIBEXECDIR "/gdm-wayland-session %s\"dbus-run-session -- %s\"",
++                                program = g_strdup_printf (LIBEXECDIR "/gdm-wayland-session %s\"dbus-run-session -- %s %s\"",
+                                                            register_session ? "--register-session " : "",
++                                                           g_getenv ("GDM_WAYLAND_SESSION"),
+                                                            self->selected_program);
+                         }
+                 } else {
+--
+2.33.0
+
diff --git a/gnu/packages/patches/geary-CVE-2020-24661.patch b/gnu/packages/patches/geary-CVE-2020-24661.patch
deleted file mode 100644
index 6cbc224786..0000000000
--- a/gnu/packages/patches/geary-CVE-2020-24661.patch
+++ /dev/null
@@ -1,133 +0,0 @@
-From d4e86dc91e1d8a940dc40872fe94ef9ac0fed1b5 Mon Sep 17 00:00:00 2001
-From: Michael Gratton <mike@vee.net>
-Date: Tue, 25 Aug 2020 03:54:09 +0000
-Subject: [PATCH] Merge branch 'mjog/866-self-signed-certificates' into
- 'mainline'
-
-Fix invalid certificate pinning when GCR support is unavailable
-
-Closes #866
-
-See merge request GNOME/geary!529
-
-(cherry picked from commit 423a55b00f1dc6bee9dc17e67c0aea6f42387a77)
-
-5088adfe Application.CertificateManager: Rename some methods for clarity
-0d957559 Application.CertificateManager: Check locally pinned certs for equality
----
- .../application-certificate-manager.vala      | 44 +++++++++----------
- 1 file changed, 22 insertions(+), 22 deletions(-)
-
-diff --git a/src/client/application/application-certificate-manager.vala b/src/client/application/application-certificate-manager.vala
-index 4881d73c0..65f6af4fa 100644
---- a/src/client/application/application-certificate-manager.vala
-+++ b/src/client/application/application-certificate-manager.vala
-@@ -381,8 +381,8 @@ private class Application.TlsDatabase : GLib.TlsDatabase {
-         GLib.TlsCertificateFlags ret = this.parent.verify_chain(
-             chain, purpose, identity, interaction, flags, cancellable
-         );
--        if (should_verify(ret, purpose, identity) &&
--            verify(chain, identity, cancellable)) {
-+        if (check_pinned(ret, purpose, identity) &&
-+            is_pinned(chain, identity, cancellable)) {
-             ret = 0;
-         }
-         return ret;
-@@ -399,16 +399,16 @@ private class Application.TlsDatabase : GLib.TlsDatabase {
-         GLib.TlsCertificateFlags ret = yield this.parent.verify_chain_async(
-             chain, purpose, identity, interaction, flags, cancellable
-         );
--        if (should_verify(ret, purpose, identity) &&
--            yield verify_async(chain, identity, cancellable)) {
-+        if (check_pinned(ret, purpose, identity) &&
-+            yield is_pinned_async(chain, identity, cancellable)) {
-             ret = 0;
-         }
-         return ret;
-     }
- 
--    private inline bool should_verify(GLib.TlsCertificateFlags parent_ret,
--                                      string purpose,
--                                      GLib.SocketConnectable? identity) {
-+    private inline bool check_pinned(GLib.TlsCertificateFlags parent_ret,
-+                                     string purpose,
-+                                     GLib.SocketConnectable? identity) {
-         // If the parent didn't verify, check for a locally pinned
-         // cert if it looks like we should, but always reject revoked
-         // certs
-@@ -420,22 +420,22 @@ private class Application.TlsDatabase : GLib.TlsDatabase {
-         );
-     }
- 
--    private bool verify(GLib.TlsCertificate chain,
--                        GLib.SocketConnectable identity,
--                        GLib.Cancellable? cancellable)
-+    private bool is_pinned(GLib.TlsCertificate chain,
-+                           GLib.SocketConnectable identity,
-+                           GLib.Cancellable? cancellable)
-         throws GLib.Error {
--        bool is_verified = false;
-+        bool is_pinned = false;
-         string id = to_name(identity);
-         TrustContext? context = null;
-         lock (this.pinned_certs) {
-             context = this.pinned_certs.get(id);
-             if (context != null) {
--                is_verified = true;
-+                is_pinned = context.certificate.is_same(chain);
-             } else {
-                 // Cert not found in memory, check with GCR if
-                 // enabled.
-                 if (this.use_gcr) {
--                    is_verified = gcr_trust_is_certificate_pinned(
-+                    is_pinned = gcr_trust_is_certificate_pinned(
-                         new Gcr.SimpleCertificate(chain.certificate.data),
-                         GLib.TlsDatabase.PURPOSE_AUTHENTICATE_SERVER,
-                         id,
-@@ -443,7 +443,7 @@ private class Application.TlsDatabase : GLib.TlsDatabase {
-                     );
-                 }
- 
--                if (!is_verified) {
-+                if (!is_pinned) {
-                     // Cert is not pinned in memory or in GCR, so look
-                     // for it on disk. Do this even if GCR support is
-                     // enabled, since if the cert was previously saved
-@@ -453,7 +453,7 @@ private class Application.TlsDatabase : GLib.TlsDatabase {
-                             this.store_dir, id, cancellable
-                         );
-                         this.pinned_certs.set(id, context);
--                        is_verified = true;
-+                        is_pinned = context.certificate.is_same(chain);
-                     } catch (GLib.IOError.NOT_FOUND err) {
-                         // Cert was not found saved, so it not pinned
-                     } catch (GLib.Error err) {
-@@ -465,18 +465,18 @@ private class Application.TlsDatabase : GLib.TlsDatabase {
-                 }
-             }
-         }
--        return is_verified;
-+        return is_pinned;
-     }
- 
--    private async bool verify_async(GLib.TlsCertificate chain,
--                                    GLib.SocketConnectable identity,
--                                    GLib.Cancellable? cancellable)
-+    private async bool is_pinned_async(GLib.TlsCertificate chain,
-+                                       GLib.SocketConnectable identity,
-+                                       GLib.Cancellable? cancellable)
-         throws GLib.Error {
--        bool is_valid = false;
-+        bool pinned = false;
-         yield Geary.Nonblocking.Concurrent.global.schedule_async(() => {
--                is_valid = verify(chain, identity, cancellable);
-+                pinned = is_pinned(chain, identity, cancellable);
-             }, cancellable);
--        return is_valid;
-+        return pinned;
-     }
- 
-     private TrustContext? lookup_id(string id) {
--- 
-GitLab
-
diff --git a/gnu/packages/patches/geeqie-clutter.patch b/gnu/packages/patches/geeqie-clutter.patch
new file mode 100644
index 0000000000..ab7cc957d8
--- /dev/null
+++ b/gnu/packages/patches/geeqie-clutter.patch
@@ -0,0 +1,35 @@
+From c99084ac5fc2fb854ff8e8abd4bd3298fb08fb43 Mon Sep 17 00:00:00 2001
+From: Colin Clark <colin.clark@cclark.uk>
+Date: Sat, 9 Jan 2021 11:35:41 +0000
+Subject: [PATCH] Fix #829: segfault with clutter-gtk
+
+https://github.com/BestImageViewer/geeqie/issues/829
+
+This fix might cause other problems which might be cured by calling:
+LIBGL_ALWAYS_INDIRECT=1 geeqie
+
+or, worst case:
+geeqie --disable-clutter
+---
+ src/main.c | 5 -----
+ 1 file changed, 5 deletions(-)
+
+diff --git a/src/main.c b/src/main.c
+index f497240d..4af654fe 100644
+--- a/src/main.c
++++ b/src/main.c
+@@ -904,11 +904,6 @@ gint main(gint argc, gchar *argv[])
+ #ifdef HAVE_GTHREAD
+ #if !GLIB_CHECK_VERSION(2,32,0)
+ 	g_thread_init(NULL);
+-#endif
+-#ifdef HAVE_CLUTTER
+-/* FIXME: see below */
+-	putenv("LIBGL_ALWAYS_INDIRECT=1");
+-	XInitThreads();
+ #endif
+ 	gdk_threads_init();
+ 	gdk_threads_enter();
+-- 
+2.34.0
+
diff --git a/gnu/packages/patches/genimage-mke2fs-test.patch b/gnu/packages/patches/genimage-mke2fs-test.patch
new file mode 100644
index 0000000000..5d4fbcfe44
--- /dev/null
+++ b/gnu/packages/patches/genimage-mke2fs-test.patch
@@ -0,0 +1,40 @@
+diff --git a/test/mke2fs.dump b/test/mke2fs.dump
+index 8e63662..0c25798 100644
+--- a/test/mke2fs.0.dump
++++ b/test/mke2fs.0.dump
+@@ -11,7 +11,7 @@
+ Inode count:              8192
+ Block count:              32768
+ Reserved block count:     1638
+-Free blocks:              26568
++Free blocks:              26566
+ Free inodes:              8141
+ First block:              1
+ Block size:               1024
+@@ -29,7 +29,7 @@
+ Maximum mount count:      -1
+ Last checked:             Sat Jan  1 00:00:00 2000
+ Check interval:           0 (<none>)
+-Lifetime writes:          141 kB
++Lifetime writes:          143 kB
+ Reserved blocks uid:      0 (user root)
+ Reserved blocks gid:      0 (group root)
+ First inode:              11
+@@ -51,13 +51,13 @@
+ Journal start:            0
+ 
+ 
+-Group 0: (Blocks 1-8192) csum 0x74a0 [ITABLE_ZEROED]
++Group 0: (Blocks 1-8192) csum 0x3f30 [ITABLE_ZEROED]
+   Primary superblock at 1, Group descriptors at 2-2
+-  Block bitmap at 3 (+2), csum 0x16cec4db
++  Block bitmap at 3 (+2), csum 0x8d67cdef
+   Inode bitmap at 7 (+6), csum 0xb1052088
+   Inode table at 11-522 (+10)
+-  6093 free blocks, 1997 free inodes, 18 directories, 1997 unused inodes
+-  Free blocks: 2100-8192
++  6091 free blocks, 1997 free inodes, 18 directories, 1997 unused inodes
++  Free blocks: 2102-8192
+   Free inodes: 52-2048
+ Group 1: (Blocks 8193-16384) csum 0x8fde [INODE_UNINIT, BLOCK_UNINIT, ITABLE_ZEROED]
+   Backup superblock at 8193, Group descriptors at 8194-8194
diff --git a/gnu/packages/patches/genimage-signedness.patch b/gnu/packages/patches/genimage-signedness.patch
deleted file mode 100644
index 2204dfb545..0000000000
--- a/gnu/packages/patches/genimage-signedness.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-commit 6574665f9d6c0757e8f55ccb465afbcaa90bf019
-Author: Timotej Lazar <timotej.lazar@araneo.si>
-Date:   Wed Aug 19 19:36:02 2020 +0200
-
-    test: normalize flags reported by dumpe2fs
-    
-    Filesystem flags depend on the system – usually signed_directory_hash,
-    but unsigned_directory_hash at least on arm64.
-    
-    Signed-off-by: Timotej Lazar <timotej.lazar@araneo.si>
-
-diff --git a/test/basic-images.test b/test/basic-images.test
-index f6685e1..cb104c3 100755
---- a/test/basic-images.test
-+++ b/test/basic-images.test
-@@ -158,6 +158,8 @@ check_ext() {
- 	# format change
- 	csum2="Group 0: (Blocks 1-4095) \\[ITABLE_ZEROED\\]\|  Checksum .*, unused inodes 205"
- 	dumpe2fs "${1}" | grep -v "^\($uuid\|$seed\|$csum1\|$csum2\)" > "dump" &&
-+	# some architectures (including arm64) use unsigned char
-+	sed -i 's/un\(signed_directory_hash\)/\1/' "dump" &&
- 	# fixup for ext3 journal size with old tune2fs
- 	sed -i 's/^\(Journal size:             \)1029k$/\11024k/' "dump" &&
- 	# output format changed with some version
diff --git a/gnu/packages/patches/ghc-diff-swap-cover-args.patch b/gnu/packages/patches/ghc-diff-swap-cover-args.patch
deleted file mode 100644
index 724416ff7a..0000000000
--- a/gnu/packages/patches/ghc-diff-swap-cover-args.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-The QuickCheck library swapped the order of the arguments of the 'cover'
-function in version 2.12.  Version 0.3.4 of the Diff library still uses
-the old argument order.  Swapping the argument order makes Diff work
-with newer versions of QuickCheck.
-
-See <https://github.com/commercialhaskell/stackage/issues/4289> for the
-upstream bug report.
-
-diff -ruN a/test/Test.hs b/test/Test.hs
---- a/test/Test.hs	2016-04-23 01:21:45.000000000 -0400
-+++ b/test/Test.hs	2019-11-01 19:13:04.590770903 -0400
-@@ -134,7 +134,7 @@
- prop_ppDiffR (DiffInput le ri) =
-     let haskDiff=ppDiff $ getGroupedDiff le ri
-         utilDiff= unsafePerformIO (runDiff (unlines le) (unlines ri))
--    in  cover (haskDiff == utilDiff) 90 "exact match" $
-+    in  cover 90 (haskDiff == utilDiff) "exact match" $
-                 classify (haskDiff == utilDiff) "exact match"
-                         (div ((length haskDiff)*100) (length utilDiff) < 110) -- less than 10% bigger
-     where
diff --git a/gnu/packages/patches/ghc-haddock-api-fix-haddock.patch b/gnu/packages/patches/ghc-haddock-api-fix-haddock.patch
deleted file mode 100644
index 927cb5b366..0000000000
--- a/gnu/packages/patches/ghc-haddock-api-fix-haddock.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-This patch is taken from upstream.  It fixes documentation generation.
-The patch has been lightly adapted to apply to the release tarball, but
-the commit message was left untouched, so it refers to some changes not
-included in the patch.
-
-From 0d9a81e20238a6b72f9f5c005f1f7e9cf05f6fb9 Mon Sep 17 00:00:00 2001
-From: Alec Theriault <alec.theriault@gmail.com>
-Date: Sat, 27 Oct 2018 10:05:04 -0700
-Subject: [PATCH] Fix documentation in `haddock-api` (#957)
-
-* Fix misplaced Haddocks in Haddock itself
-
-Haddock should be able to generate documentation for 'haddock-api'
-again.
-
-* Make CI check that documentation can be built.
-
-* Add back a doc that is OK
----
- .travis.yml                               |  3 +++
- haddock-api/src/Haddock/Backends/LaTeX.hs | 10 +++++-----
- 2 files changed, 8 insertions(+), 5 deletions(-)
-
-diff --git a/src/Haddock/Backends/LaTeX.hs b/src/Haddock/Backends/LaTeX.hs
-index 4e0e6eba..613c6deb 100644
---- a/src/Haddock/Backends/LaTeX.hs
-+++ b/src/Haddock/Backends/LaTeX.hs
-@@ -243,8 +243,8 @@ ppDocGroup lev doc = sec lev <> braces doc
- 
- -- | Given a declaration, extract out the names being declared
- declNames :: LHsDecl DocNameI
--          -> ( LaTeX           -- ^ to print before each name in an export list
--             , [DocName]       -- ^ names being declared
-+          -> ( LaTeX           --   to print before each name in an export list
-+             , [DocName]       --   names being declared
-              )
- declNames (L _ decl) = case decl of
-   TyClD _ d  -> (empty, [tcdName d])
-@@ -444,9 +444,9 @@ ppLPatSig doc docnames ty unicode
- -- arguments as needed.
- ppTypeOrFunSig :: HsType DocNameI
-                -> DocForDecl DocName  -- ^ documentation
--               -> ( LaTeX             -- ^ first-line (no-argument docs only)
--                  , LaTeX             -- ^ first-line (argument docs only)
--                  , LaTeX             -- ^ type prefix (argument docs only)
-+               -> ( LaTeX             --   first-line (no-argument docs only)
-+                  , LaTeX             --   first-line (argument docs only)
-+                  , LaTeX             --   type prefix (argument docs only)
-                   )
-                -> Bool                -- ^ unicode
-                -> LaTeX
--- 
-2.23.0
-
diff --git a/gnu/packages/patches/ghc-hpack-fix-tests.patch b/gnu/packages/patches/ghc-hpack-fix-tests.patch
deleted file mode 100644
index 19aa762174..0000000000
--- a/gnu/packages/patches/ghc-hpack-fix-tests.patch
+++ /dev/null
@@ -1,193 +0,0 @@
-This patch is taken and adapted from upstream.  It landed shortly after
-the release of 0.31.2, and fixes eleven tests.  The patch has been
-lightly adapted to apply to the release tarball, but the commit message
-was left untouched, so it refers to some changes not included in the
-patch.
-
-From a8d9362d4b686074f698c04c20beea88587511a1 Mon Sep 17 00:00:00 2001
-From: quasicomputational <quasicomputational@gmail.com>
-Date: Sat, 1 Jun 2019 15:11:31 +0100
-Subject: [PATCH] Make CI green (#345)
-
-* AppVeyor workaround for TMP issue
-
-https://github.com/commercialhaskell/stack/issues/3944
-
-* Bump resolver to nightly-2018-12-12.
-
-This has the primary benefit of moving to GHC 8.6.3 and should fix
-AppVeyor.
-
-* Add clock 0.8 as an extra-dep.
-
-* Adapt expected output to aeson 1.4.3.0.
----
- appveyor.yml                            |  3 +++
- hpack.cabal                             | 10 +++++-----
- package.yaml                            |  2 +-
- stack.yaml                              |  5 +++--
- test/Data/Aeson/Config/FromValueSpec.hs |  2 +-
- test/Data/Aeson/Config/TypesSpec.hs     |  2 +-
- test/EndToEndSpec.hs                    |  8 ++++----
- test/Hpack/ConfigSpec.hs                |  2 +-
- test/Hpack/Syntax/DefaultsSpec.hs       |  2 +-
- test/Hpack/Syntax/DependenciesSpec.hs   |  4 ++--
- 10 files changed, 22 insertions(+), 18 deletions(-)
-
-diff --git a/hpack.cabal b/hpack.cabal
-index fedb9a8..4db3014 100644
---- a/hpack.cabal
-+++ b/hpack.cabal
-@@ -1,10 +1,10 @@
- cabal-version: 1.12
- 
---- This file has been generated from package.yaml by hpack version 0.31.0.
-+-- This file has been generated from package.yaml by hpack version 0.31.2.
- --
- -- see: https://github.com/sol/hpack
- --
---- hash: 3d060180293c32b8d0c25b710d0f419e96a6cc6ec3f95ac5e70bb77f44cbafc3
-+-- hash: bd5dd178c7e9f7f7a3456d79b592ea336c41ef43c9892354c001f06659e8b901
- 
- name:           hpack
- version:        0.31.2
-@@ -31,7 +31,7 @@ library
-   build-depends:
-       Cabal >=2.2
-     , Glob >=0.9.0
--    , aeson >=1.2.1.0
-+    , aeson >=1.4.3.0
-     , base >=4.9 && <5
-     , bifunctors
-     , bytestring
-@@ -87,7 +87,7 @@ executable hpack
-   build-depends:
-       Cabal >=2.2
-     , Glob >=0.9.0
--    , aeson >=1.2.1.0
-+    , aeson >=1.4.3.0
-     , base >=4.9 && <5
-     , bifunctors
-     , bytestring
-@@ -125,7 +125,7 @@ test-suite spec
-     , Glob >=0.9.0
-     , HUnit >=1.6.0.0
-     , QuickCheck
--    , aeson >=1.2.1.0
-+    , aeson >=1.4.3.0
-     , base >=4.9 && <5
-     , bifunctors
-     , bytestring
-diff --git a/test/Data/Aeson/Config/FromValueSpec.hs b/test/Data/Aeson/Config/FromValueSpec.hs
-index 33de8b7..06b3eb9 100644
---- a/test/Data/Aeson/Config/FromValueSpec.hs
-+++ b/test/Data/Aeson/Config/FromValueSpec.hs
-@@ -85,7 +85,7 @@ spec = do
-         [yaml|
-         name: "Joe"
-         age: "23"
--        |] `shouldDecodeTo` left "Error while parsing $.age - expected Int, encountered String"
-+        |] `shouldDecodeTo` left "Error while parsing $.age - parsing Int failed, expected Number, but encountered String"
- 
-     context "with (,)" $ do
-       it "captures unrecognized fields" $ do
-diff --git a/test/Data/Aeson/Config/TypesSpec.hs b/test/Data/Aeson/Config/TypesSpec.hs
-index c954534..472aa42 100644
---- a/test/Data/Aeson/Config/TypesSpec.hs
-+++ b/test/Data/Aeson/Config/TypesSpec.hs
-@@ -13,7 +13,7 @@ spec = do
-     context "List" $ do
-       let
-         parseError :: String -> Result (List Int)
--        parseError prefix = Left (prefix ++ " - expected Int, encountered String")
-+        parseError prefix = Left (prefix ++ " - parsing Int failed, expected Number, but encountered String")
- 
-       context "when parsing single values" $ do
-         it "returns the value in a singleton list" $ do
-diff --git a/test/EndToEndSpec.hs b/test/EndToEndSpec.hs
-index 283c72c..46389ea 100644
---- a/test/EndToEndSpec.hs
-+++ b/test/EndToEndSpec.hs
-@@ -285,7 +285,7 @@ spec = around_ (inTempDirectoryNamed "foo") $ do
-           path: defaults.yaml
-           ref: "2017"
-         library: {}
--        |] `shouldFailWith` (file ++ ": Error while parsing $ - expected Object, encountered Array")
-+        |] `shouldFailWith` (file ++ ": Error while parsing $ - expected Object, but encountered Array")
- 
-       it "warns on unknown fields" $ do
-         let file = joinPath ["defaults", "sol", "hpack-template", "2017", "defaults.yaml"]
-@@ -340,7 +340,7 @@ spec = around_ (inTempDirectoryNamed "foo") $ do
-       it "rejects other values" $ do
-         [i|
-         version: {}
--        |] `shouldFailWith` "package.yaml: Error while parsing $.version - expected Number or String, encountered Object"
-+        |] `shouldFailWith` "package.yaml: Error while parsing $.version - expected Number or String, but encountered Object"
- 
-     describe "license" $ do
-       it "accepts cabal-style licenses" $ do
-@@ -1363,14 +1363,14 @@ spec = around_ (inTempDirectoryNamed "foo") $ do
-             then:
-               dependencies: Win32
-             else: null
--          |] `shouldFailWith` "package.yaml: Error while parsing $.when.else - expected Object, encountered Null"
-+          |] `shouldFailWith` "package.yaml: Error while parsing $.when.else - expected Object, but encountered Null"
- 
-         it "rejects invalid conditionals" $ do
-           [i|
-             dependencies:
-               - foo
-               - 23
--          |] `shouldFailWith` "package.yaml: Error while parsing $.dependencies[1] - expected Object or String, encountered Number"
-+          |] `shouldFailWith` "package.yaml: Error while parsing $.dependencies[1] - expected Object or String, but encountered Number"
- 
-         it "warns on unknown fields" $ do
-           [i|
-diff --git a/test/Hpack/ConfigSpec.hs b/test/Hpack/ConfigSpec.hs
-index 9f4b279..69cbea1 100644
---- a/test/Hpack/ConfigSpec.hs
-+++ b/test/Hpack/ConfigSpec.hs
-@@ -675,7 +675,7 @@ spec = do
-       it "rejects other values" $ do
-         [yaml|
-         23
--        |] `shouldDecodeTo` (Left "Error while parsing $ - expected Boolean or String, encountered Number" :: Result Cond)
-+        |] `shouldDecodeTo` (Left "Error while parsing $ - expected Boolean or String, but encountered Number" :: Result Cond)
- 
-   describe "formatOrList" $ do
-     it "formats a singleton list" $ do
-diff --git a/test/Hpack/Syntax/DefaultsSpec.hs b/test/Hpack/Syntax/DefaultsSpec.hs
-index 5875413..5438b7a 100644
---- a/test/Hpack/Syntax/DefaultsSpec.hs
-+++ b/test/Hpack/Syntax/DefaultsSpec.hs
-@@ -151,4 +151,4 @@ spec = do
-         it "fails" $ do
-           [yaml|
-           10
--          |] `shouldDecodeTo` left "Error while parsing $ - expected Object or String, encountered Number"
-+          |] `shouldDecodeTo` left "Error while parsing $ - expected Object or String, but encountered Number"
-diff --git a/test/Hpack/Syntax/DependenciesSpec.hs b/test/Hpack/Syntax/DependenciesSpec.hs
-index 1a83732..d95044f 100644
---- a/test/Hpack/Syntax/DependenciesSpec.hs
-+++ b/test/Hpack/Syntax/DependenciesSpec.hs
-@@ -125,7 +125,7 @@ spec = do
-         it "rejects invalid values" $ do
-           [yaml|
-             hpack: []
--          |] `shouldDecodeTo` left "Error while parsing $.hpack - expected Null, Object, Number, or String, encountered Array"
-+          |] `shouldDecodeTo` left "Error while parsing $.hpack - expected Null, Object, Number, or String, but encountered Array"
- 
-         context "when the constraint is a Number" $ do
-           it "accepts 1" $ do
-@@ -213,7 +213,7 @@ spec = do
-               [yaml|
-                 foo:
-                   version: {}
--              |] `shouldDecodeTo` left "Error while parsing $.foo.version - expected Null, Number, or String, encountered Object"
-+              |] `shouldDecodeTo` left "Error while parsing $.foo.version - expected Null, Number, or String, but encountered Object"
- 
-             it "accepts a string" $ do
-               [yaml|
--- 
-2.23.0
-
diff --git a/gnu/packages/patches/ghc-language-haskell-extract-ghc-8.10.patch b/gnu/packages/patches/ghc-language-haskell-extract-ghc-8.10.patch
new file mode 100644
index 0000000000..a1358dec94
--- /dev/null
+++ b/gnu/packages/patches/ghc-language-haskell-extract-ghc-8.10.patch
@@ -0,0 +1,27 @@
+Compatibility with GHC 8.10 and template-haskell 2.16.
+
+Taken from 
+https://raw.githubusercontent.com/archlinux/svntogit-community/packages/haskell-language-haskell-extract/trunk/ghc-8.10.patch
+
+diff --git a/src/Language/Haskell/Extract.hs b/src/Language/Haskell/Extract.hs
+index 3e8958b..43dfe04 100644
+--- a/src/Language/Haskell/Extract.hs
++++ b/src/Language/Haskell/Extract.hs
+@@ -1,3 +1,4 @@
++{-# LANGUAGE CPP #-}
+ module Language.Haskell.Extract (
+   functionExtractor,
+   functionExtractorMap,
+@@ -25,7 +26,11 @@ extractAllFunctions pattern =
+ functionExtractor :: String -> ExpQ
+ functionExtractor pattern =
+   do functions <- extractAllFunctions pattern
+-     let makePair n = TupE [ LitE $ StringL n , VarE $ mkName n]
++     let makePair n = TupE
++#if MIN_VERSION_template_haskell(2,16,0)
++                           $ map Just
++#endif
++                           [ LitE $ StringL n , VarE $ mkName n]
+      return $ ListE $ map makePair functions
+ 
+ 
diff --git a/gnu/packages/patches/ghc-microlens-aeson-fix-tests.patch b/gnu/packages/patches/ghc-microlens-aeson-fix-tests.patch
deleted file mode 100644
index c1ef6a837c..0000000000
--- a/gnu/packages/patches/ghc-microlens-aeson-fix-tests.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-This patch fixes the test suite to allow any order when listing the
-members of a JSON object.  Aeson (being true to the JSON specification)
-does not specify an order for objects.  In practice, the order depends
-on your processor architecture.
-
-See <https://github.com/bos/aeson/issues/568> for a discussion resulting
-in a similar patch fixing the Aeson tests.
-
-See <https://github.com/fosskers/microlens-aeson/issues/1> for the
-upstream bug report.
-
-diff -ruN a/test/Test.hs b/test/Test.hs
---- a/test/Test.hs	2018-12-31 15:10:50.000000000 -0500
-+++ b/test/Test.hs	2019-11-08 01:34:07.419706831 -0500
-@@ -48,8 +48,10 @@
-     , testCase "" $ ("{\"a\": {}, \"b\": null}" ^? key (T.pack "b") . _Object) @?= Nothing
-     , testCase "" $ ("{\"a\": 100, \"b\": 200}" ^? key (T.pack "a")) @?= Just (Number 100.0)
-     , testCase "" $ ("[1,2,3]" ^? key (T.pack "a")) @?= Nothing
--    , testCase "" $ ("{\"a\": 4, \"b\": 7}" ^.. members) @?= [Number 4.0,Number 7.0]
--    , testCase "" $ ("{\"a\": 4, \"b\": 7}" & members . _Number %~ (* 10)) @?= "{\"a\":40,\"b\":70}"
-+    , testCase "" $ assertBool "" (let x = ("{\"a\": 4, \"b\": 7}" ^.. members)
-+                                   in x == [Number 4.0,Number 7.0] || x == [Number 7.0,Number 4.0])
-+    , testCase "" $ assertBool "" (let x = ("{\"a\": 4, \"b\": 7}" & members . _Number %~ (* 10))
-+                                   in x == "{\"a\":40,\"b\":70}" || x == "{\"b\":70,\"a\":40}")
-     , testCase "" $ ("[1,2,3]" ^? nth 1) @?= Just (Number 2.0)
-     , testCase "" $ ("{\"a\": 100, \"b\": 200}" ^? nth 1) @?= Nothing
-     , testCase "" $ ("[1,2,3]" & nth 1 .~ Number 20) @?= "[1,20,3]"
diff --git a/gnu/packages/patches/ghc-pandoc-fix-html-tests.patch b/gnu/packages/patches/ghc-pandoc-fix-html-tests.patch
deleted file mode 100644
index b624ff9e9e..0000000000
--- a/gnu/packages/patches/ghc-pandoc-fix-html-tests.patch
+++ /dev/null
@@ -1,92 +0,0 @@
-This patch is taken from upstream.  It fixes two HTML tests that are broken
-due to using a Skylighting version greater than or equal to 0.8.2.
-
-From 968d2046a3cb6db661673be580660ac402753c34 Mon Sep 17 00:00:00 2001
-From: John MacFarlane <jgm@berkeley.edu>
-Date: Sun, 14 Jul 2019 10:48:14 -0700
-Subject: [PATCH] Update test for new skylighting.
-
----
- test/lhs-test.html     | 13 ++++++-------
- test/lhs-test.html+lhs | 13 ++++++-------
- 2 files changed, 12 insertions(+), 14 deletions(-)
-
-diff --git a/test/lhs-test.html b/test/lhs-test.html
-index 6685555f4..446dd3d95 100644
---- a/test/lhs-test.html
-+++ b/test/lhs-test.html
-@@ -12,19 +12,18 @@
-       div.column{display: inline-block; vertical-align: top; width: 50%;}
-   </style>
-   <style>
--code.sourceCode > span { display: inline-block; line-height: 1.25; }
-+pre > code.sourceCode { white-space: pre; position: relative; }
-+pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
-+pre > code.sourceCode > span:empty { height: 1.2em; }
- code.sourceCode > span { color: inherit; text-decoration: inherit; }
--code.sourceCode > span:empty { height: 1.2em; }
--.sourceCode { overflow: visible; }
--code.sourceCode { white-space: pre; position: relative; }
- div.sourceCode { margin: 1em 0; }
- pre.sourceCode { margin: 0; }
- @media screen {
- div.sourceCode { overflow: auto; }
- }
- @media print {
--code.sourceCode { white-space: pre-wrap; }
--code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
-+pre > code.sourceCode { white-space: pre-wrap; }
-+pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
- }
- pre.numberSource code
-   { counter-reset: source-line 0; }
-@@ -44,7 +43,7 @@ pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa;  padding-le
- div.sourceCode
-   {   }
- @media screen {
--code.sourceCode > span > a:first-child::before { text-decoration: underline; }
-+pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
- }
- code span.al { color: #ff0000; font-weight: bold; } /* Alert */
- code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
-diff --git a/test/lhs-test.html+lhs b/test/lhs-test.html+lhs
-index e57dfc105..a5cdb0245 100644
---- a/test/lhs-test.html+lhs
-+++ b/test/lhs-test.html+lhs
-@@ -12,19 +12,18 @@
-       div.column{display: inline-block; vertical-align: top; width: 50%;}
-   </style>
-   <style>
--code.sourceCode > span { display: inline-block; line-height: 1.25; }
-+pre > code.sourceCode { white-space: pre; position: relative; }
-+pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
-+pre > code.sourceCode > span:empty { height: 1.2em; }
- code.sourceCode > span { color: inherit; text-decoration: inherit; }
--code.sourceCode > span:empty { height: 1.2em; }
--.sourceCode { overflow: visible; }
--code.sourceCode { white-space: pre; position: relative; }
- div.sourceCode { margin: 1em 0; }
- pre.sourceCode { margin: 0; }
- @media screen {
- div.sourceCode { overflow: auto; }
- }
- @media print {
--code.sourceCode { white-space: pre-wrap; }
--code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
-+pre > code.sourceCode { white-space: pre-wrap; }
-+pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
- }
- pre.numberSource code
-   { counter-reset: source-line 0; }
-@@ -44,7 +43,7 @@ pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa;  padding-le
- div.sourceCode
-   {   }
- @media screen {
--code.sourceCode > span > a:first-child::before { text-decoration: underline; }
-+pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
- }
- code span.al { color: #ff0000; font-weight: bold; } /* Alert */
- code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
--- 
-2.23.0
-
diff --git a/gnu/packages/patches/ghc-pandoc-fix-latex-test.patch b/gnu/packages/patches/ghc-pandoc-fix-latex-test.patch
deleted file mode 100644
index b38476882d..0000000000
--- a/gnu/packages/patches/ghc-pandoc-fix-latex-test.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-This patch is taken from upstream.  It fixes a LaTeX test that is broken due
-to using a Skylighting version greater than or equal to 0.8.1.1.
-
-From 2cd1c7b30f200d18f1f1bdef1671369e1ad303ed Mon Sep 17 00:00:00 2001
-From: John MacFarlane <jgm@berkeley.edu>
-Date: Thu, 13 Jun 2019 19:33:52 -0700
-Subject: [PATCH] Update test for skylighting 0.8.1.1.
-
----
- test/lhs-test.latex | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/test/lhs-test.latex b/test/lhs-test.latex
-index 0442db5ca..a456995a3 100644
---- a/test/lhs-test.latex
-+++ b/test/lhs-test.latex
-@@ -94,9 +94,9 @@ return a single value:
- 
- \begin{Shaded}
- \begin{Highlighting}[]
--\OtherTok{unsplit ::}\NormalTok{ (}\DataTypeTok{Arrow}\NormalTok{ a) }\OtherTok{=>}\NormalTok{ (b }\OtherTok{->}\NormalTok{ c }\OtherTok{->}\NormalTok{ d) }\OtherTok{->}\NormalTok{ a (b, c) d}
-+\OtherTok{unsplit ::}\NormalTok{ (}\DataTypeTok{Arrow}\NormalTok{ a) }\OtherTok{=>}\NormalTok{ (b }\OtherTok{{-}>}\NormalTok{ c }\OtherTok{{-}>}\NormalTok{ d) }\OtherTok{{-}>}\NormalTok{ a (b, c) d}
- \NormalTok{unsplit }\OtherTok{=}\NormalTok{ arr }\OperatorTok{.} \FunctionTok{uncurry}
--          \CommentTok{-- arr (\textbackslash{}op (x,y) -> x `op` y)}
-+          \CommentTok{{-}{-} arr (\textbackslash{}op (x,y) {-}> x \textasciigrave{}op\textasciigrave{} y)}
- \end{Highlighting}
- \end{Shaded}
- 
--- 
-2.23.0
-
diff --git a/gnu/packages/patches/ghostscript-CVE-2020-15900.patch b/gnu/packages/patches/ghostscript-CVE-2020-15900.patch
deleted file mode 100644
index b6658d7c7f..0000000000
--- a/gnu/packages/patches/ghostscript-CVE-2020-15900.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-Fix CVE-2020-15900.
-
-https://cve.circl.lu/cve/CVE-2020-15900
-https://artifex.com/security-advisories/CVE-2020-15900
-
-Taken from upstream:
-https://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=5d499272b95a6b890a1397e11d20937de000d31b
-
-diff --git a/psi/zstring.c b/psi/zstring.c
---- a/psi/zstring.c
-+++ b/psi/zstring.c
-@@ -142,13 +142,18 @@ search_impl(i_ctx_t *i_ctx_p, bool forward)
-     return 0;
- found:
-     op->tas.type_attrs = op1->tas.type_attrs;
--    op->value.bytes = ptr;
--    r_set_size(op, size);
-+    op->value.bytes = ptr;				/* match */
-+    op->tas.rsize = size;				/* match */
-     push(2);
--    op[-1] = *op1;
--    r_set_size(op - 1, ptr - op[-1].value.bytes);
--    op1->value.bytes = ptr + size;
--    r_set_size(op1, count + (!forward ? (size - 1) : 0));
-+    op[-1] = *op1;					/* pre */
-+    op[-3].value.bytes = ptr + size;			/* post */
-+    if (forward) {
-+        op[-1].tas.rsize = ptr - op[-1].value.bytes;	/* pre */
-+        op[-3].tas.rsize = count;			/* post */
-+    } else {
-+        op[-1].tas.rsize = count;			/* pre */
-+        op[-3].tas.rsize -= count + size;		/* post */
-+    }
-     make_true(op);
-     return 0;
- }
diff --git a/gnu/packages/patches/ghostscript-freetype-compat.patch b/gnu/packages/patches/ghostscript-freetype-compat.patch
deleted file mode 100644
index cc225b5ad6..0000000000
--- a/gnu/packages/patches/ghostscript-freetype-compat.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-Fix build with FreeType 2.10.3 and newer.
-
-Taken from upstream:
-https://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=41ef9a0bc36b9db7115fbe9623f989bfb47bbade
-
-diff --git a/base/fapi_ft.c b/base/fapi_ft.c
---- a/base/fapi_ft.c
-+++ b/base/fapi_ft.c
-@@ -125,7 +125,7 @@ static void
- delete_inc_int_info(gs_fapi_server * a_server,
-                     FT_IncrementalRec * a_inc_int_info);
- 
--FT_CALLBACK_DEF(void *)
-+static void *
- FF_alloc(FT_Memory memory, long size)
- {
-     gs_memory_t *mem = (gs_memory_t *) memory->user;
-@@ -133,7 +133,7 @@ FF_alloc(FT_Memory memory, long size)
-     return (gs_malloc(mem, size, 1, "FF_alloc"));
- }
- 
--FT_CALLBACK_DEF(void *)
-+static void *
-     FF_realloc(FT_Memory memory, long cur_size, long new_size, void *block)
- {
-     gs_memory_t *mem = (gs_memory_t *) memory->user;
-@@ -153,7 +153,7 @@ FT_CALLBACK_DEF(void *)
-     return (tmp);
- }
- 
--FT_CALLBACK_DEF(void)
-+static void
-     FF_free(FT_Memory memory, void *block)
- {
-     gs_memory_t *mem = (gs_memory_t *) memory->user;
diff --git a/gnu/packages/patches/ghostscript-no-header-creationdate.patch b/gnu/packages/patches/ghostscript-no-header-creationdate.patch
index 92ddbdade0..b19f3ab5d9 100644
--- a/gnu/packages/patches/ghostscript-no-header-creationdate.patch
+++ b/gnu/packages/patches/ghostscript-no-header-creationdate.patch
@@ -20,3 +20,25 @@ index 0fb067e..b342e2c 100644
      {
          struct tm tms;
          time_t t;
+--- orig/gnu-ghostscript-9.14.0/devices/vector/gdevpdfe.c
++++ gnu-ghostscript-9.14.0/devices/vector/gdevpdfe.c
+@@ -692,6 +692,9 @@
+             pdf_xml_attribute_name(s, "xmlns:xmp");
+             pdf_xml_attribute_value(s, "http://ns.adobe.com/xap/1.0/");
+             pdf_xml_tag_end(s);
++            if (!getenv("GS_GENERATE_UUIDS") ||
++                (strcasecmp(getenv("GS_GENERATE_UUIDS"), "0") != 0 &&
++                 strcasecmp(getenv("GS_GENERATE_UUIDS"), "no") != 0))
+             {
+                 pdf_xml_tag_open_beg(s, "xmp:ModifyDate");
+                 pdf_xml_tag_end(s);
+@@ -700,6 +701,9 @@
+                 pdf_xml_tag_close(s, "xmp:ModifyDate");
+                 pdf_xml_newline(s);
+             }
++            if (!getenv("GS_GENERATE_UUIDS") ||
++                (strcasecmp(getenv("GS_GENERATE_UUIDS"), "0") != 0 &&
++                 strcasecmp(getenv("GS_GENERATE_UUIDS"), "no") != 0))
+             {
+                 pdf_xml_tag_open_beg(s, "xmp:CreateDate");
+                 pdf_xml_tag_end(s);
diff --git a/gnu/packages/patches/glade-gls-set-script-name.patch b/gnu/packages/patches/glade-gls-set-script-name.patch
new file mode 100644
index 0000000000..61fbdf3914
--- /dev/null
+++ b/gnu/packages/patches/glade-gls-set-script-name.patch
@@ -0,0 +1,32 @@
+Taken from upstream:
+https://gitlab.gnome.org/GNOME/glade/-/commit/eb0429d318c017b57b9e59de1d5b3f142a0f455e.
+
+From 6cf1d3e11d4f8035f33c3003d33f6465896025a5 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= <mail@3v1n0.net>
+Date: Tue, 18 May 2021 19:54:50 +0200
+Subject: [PATCH] plugins: Define an invalid but non-null file path as script
+ path
+
+This is following the gjs applications behaviors, setting a valid string
+as the script path that will be shown in JS stack traces, even though
+won't load a real file through g_file_new_for_commandline_arg()
+---
+ plugins/gjs/glade-gjs.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/plugins/gjs/glade-gjs.c b/plugins/gjs/glade-gjs.c
+index e1779665..aeae9906 100644
+--- a/plugins/gjs/glade-gjs.c
++++ b/plugins/gjs/glade-gjs.c
+@@ -93,7 +93,7 @@ glade_gjs_init (const gchar *name)
+ 
+   /* Importing the module will create all the GTypes so that glade can use them at runtime */
+   retval = gjs_context_eval (gjs_context_get_current (),
+-                             import_sentence, -1, NULL,
++                             import_sentence, -1, "<glade-gjs>",
+                              &exit_status,
+                              &error);
+   if (!retval && error)
+-- 
+GitLab
+
diff --git a/gnu/packages/patches/glade-test-widget-null-icon.patch b/gnu/packages/patches/glade-test-widget-null-icon.patch
new file mode 100644
index 0000000000..75668a2f68
--- /dev/null
+++ b/gnu/packages/patches/glade-test-widget-null-icon.patch
@@ -0,0 +1,30 @@
+Taken from upstream:
+https://gitlab.gnome.org/GNOME/glade/-/commit/6cf1d3e11d4f8035f33c3003d33f6465896025a5.
+
+From eb0429d318c017b57b9e59de1d5b3f142a0f455e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= <mail@3v1n0.net>
+Date: Wed, 19 May 2021 00:10:29 +0200
+Subject: [PATCH] tests: Do not create a file icon when no filename is provided
+
+This would fail otherwise as GFileIcon requires a GFile parameter on
+construction.
+---
+ tests/create-widgets.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/tests/create-widgets.c b/tests/create-widgets.c
+index 2094059d..db8311f8 100644
+--- a/tests/create-widgets.c
++++ b/tests/create-widgets.c
+@@ -106,6 +106,8 @@ main (int   argc,
+       if (G_TYPE_IS_INSTANTIATABLE (adaptor_type) && !G_TYPE_IS_ABSTRACT (adaptor_type) &&
+           /* FIXME: can not create a themed icon without a name */
+           !g_type_is_a (adaptor_type, G_TYPE_THEMED_ICON) &&
++          /* FIXME: can not create a file icon without a file name */
++          !g_type_is_a (adaptor_type, G_TYPE_FILE_ICON) &&
+           /* FIXME: GtkPopoverMenu gives a few warnings */
+           !g_type_is_a (adaptor_type, GTK_TYPE_POPOVER_MENU) &&
+           /* FIXME: GtkFileChooserNative is hard to test here */
+-- 
+GitLab
+
diff --git a/gnu/packages/patches/glib-CVE-2021-27218.patch b/gnu/packages/patches/glib-CVE-2021-27218.patch
deleted file mode 100644
index 00fa5ebf79..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27218.patch
+++ /dev/null
@@ -1,132 +0,0 @@
-Backport of:
-
-From 0f384c88a241bbbd884487b1c40b7b75f1e638d3 Mon Sep 17 00:00:00 2001
-From: Krzesimir Nowak <qdlacz@gmail.com>
-Date: Wed, 10 Feb 2021 23:51:07 +0100
-Subject: [PATCH] gbytearray: Do not accept too large byte arrays
-
-GByteArray uses guint for storing the length of the byte array, but it
-also has a constructor (g_byte_array_new_take) that takes length as a
-gsize. gsize may be larger than guint (64 bits for gsize vs 32 bits
-for guint). It is possible to call the function with a value greater
-than G_MAXUINT, which will result in silent length truncation. This
-may happen as a result of unreffing GBytes into GByteArray, so rather
-be loud about it.
-
-(Test case tweaked by Philip Withnall.)
-
-(Backport 2.66: Add #include gstrfuncsprivate.h in the test case for
-`g_memdup2()`.)
----
- glib/garray.c      |  6 ++++++
- glib/gbytes.c      |  4 ++++
- glib/tests/bytes.c | 35 ++++++++++++++++++++++++++++++++++-
- 3 files changed, 44 insertions(+), 1 deletion(-)
-
-diff --git a/glib/garray.c b/glib/garray.c
-index 942e74c9f..fb1a42aaf 100644
---- a/glib/garray.c
-+++ b/glib/garray.c
-@@ -2013,6 +2013,10 @@ g_byte_array_new (void)
-  * Create byte array containing the data. The data will be owned by the array
-  * and will be freed with g_free(), i.e. it could be allocated using g_strdup().
-  *
-+ * Do not use it if @len is greater than %G_MAXUINT. #GByteArray
-+ * stores the length of its data in #guint, which may be shorter than
-+ * #gsize.
-+ *
-  * Since: 2.32
-  *
-  * Returns: (transfer full): a new #GByteArray
-@@ -2024,6 +2028,8 @@ g_byte_array_new_take (guint8 *data,
-   GByteArray *array;
-   GRealArray *real;
- 
-+  g_return_val_if_fail (len <= G_MAXUINT, NULL);
-+
-   array = g_byte_array_new ();
-   real = (GRealArray *)array;
-   g_assert (real->data == NULL);
-diff --git a/glib/gbytes.c b/glib/gbytes.c
-index 7b72886e5..d56abe6c3 100644
---- a/glib/gbytes.c
-+++ b/glib/gbytes.c
-@@ -519,6 +519,10 @@ g_bytes_unref_to_data (GBytes *bytes,
-  * g_bytes_new(), g_bytes_new_take() or g_byte_array_free_to_bytes(). In all
-  * other cases the data is copied.
-  *
-+ * Do not use it if @bytes contains more than %G_MAXUINT
-+ * bytes. #GByteArray stores the length of its data in #guint, which
-+ * may be shorter than #gsize, that @bytes is using.
-+ *
-  * Returns: (transfer full): a new mutable #GByteArray containing the same byte data
-  *
-  * Since: 2.32
-diff --git a/glib/tests/bytes.c b/glib/tests/bytes.c
-index 5ea5c2b35..15a6aaad6 100644
---- a/glib/tests/bytes.c
-+++ b/glib/tests/bytes.c
-@@ -10,12 +10,12 @@
-  */
- 
- #undef G_DISABLE_ASSERT
--#undef G_LOG_DOMAIN
- 
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include "glib.h"
-+#include "glib/gstrfuncsprivate.h"
- 
- /* Keep in sync with glib/gbytes.c */
- struct _GBytes
-@@ -333,6 +333,38 @@ test_to_array_transferred (void)
-   g_byte_array_unref (array);
- }
- 
-+static void
-+test_to_array_transferred_oversize (void)
-+{
-+  g_test_message ("g_bytes_unref_to_array() can only take GBytes up to "
-+                  "G_MAXUINT in length; test that longer ones are rejected");
-+
-+  if (sizeof (guint) >= sizeof (gsize))
-+    {
-+      g_test_skip ("Skipping test as guint is not smaller than gsize");
-+    }
-+  else if (g_test_undefined ())
-+    {
-+      GByteArray *array = NULL;
-+      GBytes *bytes = NULL;
-+      gpointer data = g_memdup2 (NYAN, N_NYAN);
-+      gsize len = ((gsize) G_MAXUINT) + 1;
-+
-+      bytes = g_bytes_new_take (data, len);
-+      g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL,
-+                             "g_byte_array_new_take: assertion 'len <= G_MAXUINT' failed");
-+      array = g_bytes_unref_to_array (g_steal_pointer (&bytes));
-+      g_test_assert_expected_messages ();
-+      g_assert_null (array);
-+
-+      g_free (data);
-+    }
-+  else
-+    {
-+      g_test_skip ("Skipping test as testing undefined behaviour is disabled");
-+    }
-+}
-+
- static void
- test_to_array_two_refs (void)
- {
-@@ -410,6 +442,7 @@ main (int argc, char *argv[])
-   g_test_add_func ("/bytes/to-array/transfered", test_to_array_transferred);
-   g_test_add_func ("/bytes/to-array/two-refs", test_to_array_two_refs);
-   g_test_add_func ("/bytes/to-array/non-malloc", test_to_array_non_malloc);
-+  g_test_add_func ("/bytes/to-array/transferred/oversize", test_to_array_transferred_oversize);
-   g_test_add_func ("/bytes/null", test_null);
- 
-   return g_test_run ();
--- 
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-01.patch b/gnu/packages/patches/glib-CVE-2021-27219-01.patch
deleted file mode 100644
index 5db360d468..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-01.patch
+++ /dev/null
@@ -1,176 +0,0 @@
-Backport of:
-
-From 5e5f75a77e399c638be66d74e5daa8caeb433e00 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Thu, 4 Feb 2021 13:30:52 +0000
-Subject: [PATCH 01/11] gstrfuncs: Add internal g_memdup2() function
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-This will replace the existing `g_memdup()` function for use within
-GLib. It has an unavoidable security flaw of taking its `byte_size`
-argument as a `guint` rather than as a `gsize`. Most callers will
-expect it to be a `gsize`, and may pass in large values which could
-silently be truncated, resulting in an undersize allocation compared
-to what the caller expects.
-
-This could lead to a classic buffer overflow vulnerability for many
-callers of `g_memdup()`.
-
-`g_memdup2()`, in comparison, takes its `byte_size` as a `gsize`.
-
-Spotted by Kevin Backhouse of GHSL.
-
-In GLib 2.68, `g_memdup2()` will be a new public API. In this version
-for backport to older stable releases, it’s a new `static inline` API
-in a private header, so that use of `g_memdup()` within GLib can be
-fixed without adding a new API in a stable release series.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
-Helps: GHSL-2021-045
-Helps: #2319
----
- docs/reference/glib/meson.build |  1 +
- glib/gstrfuncsprivate.h         | 55 +++++++++++++++++++++++++++++++++
- glib/meson.build                |  1 +
- glib/tests/strfuncs.c           | 23 ++++++++++++++
- 4 files changed, 80 insertions(+)
- create mode 100644 glib/gstrfuncsprivate.h
-
-diff --git a/docs/reference/glib/meson.build b/docs/reference/glib/meson.build
-index bba7649f0..ee39f6d04 100644
---- a/docs/reference/glib/meson.build
-+++ b/docs/reference/glib/meson.build
-@@ -22,6 +22,7 @@ if get_option('gtk_doc')
-     'gprintfint.h',
-     'gmirroringtable.h',
-     'gscripttable.h',
-+    'gstrfuncsprivate.h',
-     'glib-mirroring-tab',
-     'gnulib',
-     'pcre',
-diff --git a/glib/gstrfuncsprivate.h b/glib/gstrfuncsprivate.h
-new file mode 100644
-index 000000000..85c88328a
---- /dev/null
-+++ b/glib/gstrfuncsprivate.h
-@@ -0,0 +1,55 @@
-+/* GLIB - Library of useful routines for C programming
-+ * Copyright (C) 1995-1997  Peter Mattis, Spencer Kimball and Josh MacDonald
-+ *
-+ * This library is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU Lesser General Public
-+ * License as published by the Free Software Foundation; either
-+ * version 2.1 of the License, or (at your option) any later version.
-+ *
-+ * This library is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+ * Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public
-+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
-+ */
-+
-+#include <glib.h>
-+#include <string.h>
-+
-+/*
-+ * g_memdup2:
-+ * @mem: (nullable): the memory to copy.
-+ * @byte_size: the number of bytes to copy.
-+ *
-+ * Allocates @byte_size bytes of memory, and copies @byte_size bytes into it
-+ * from @mem. If @mem is %NULL it returns %NULL.
-+ *
-+ * This replaces g_memdup(), which was prone to integer overflows when
-+ * converting the argument from a #gsize to a #guint.
-+ *
-+ * This static inline version is a backport of the new public API from
-+ * GLib 2.68, kept internal to GLib for backport to older stable releases.
-+ * See https://gitlab.gnome.org/GNOME/glib/-/issues/2319.
-+ *
-+ * Returns: (nullable): a pointer to the newly-allocated copy of the memory,
-+ *    or %NULL if @mem is %NULL.
-+ * Since: 2.68
-+ */
-+static inline gpointer
-+g_memdup2 (gconstpointer mem,
-+           gsize         byte_size)
-+{
-+  gpointer new_mem;
-+
-+  if (mem && byte_size != 0)
-+    {
-+      new_mem = g_malloc (byte_size);
-+      memcpy (new_mem, mem, byte_size);
-+    }
-+  else
-+    new_mem = NULL;
-+
-+  return new_mem;
-+}
-diff --git a/glib/meson.build b/glib/meson.build
-index aaf5f00f5..5a6eea397 100644
---- a/glib/meson.build
-+++ b/glib/meson.build
-@@ -268,6 +268,7 @@ glib_sources = files(
-   'gslist.c',
-   'gstdio.c',
-   'gstrfuncs.c',
-+  'gstrfuncsprivate.h',
-   'gstring.c',
-   'gstringchunk.c',
-   'gtestutils.c',
-diff --git a/glib/tests/strfuncs.c b/glib/tests/strfuncs.c
-index e1f9619c7..d968afff9 100644
---- a/glib/tests/strfuncs.c
-+++ b/glib/tests/strfuncs.c
-@@ -32,6 +32,8 @@
- #include <string.h>
- #include "glib.h"
- 
-+#include "gstrfuncsprivate.h"
-+
- #if defined (_MSC_VER) && (_MSC_VER <= 1800)
- #define isnan(x) _isnan(x)
- 
-@@ -219,6 +221,26 @@ test_memdup (void)
-   g_free (str_dup);
- }
- 
-+/* Testing g_memdup2() function with various positive and negative cases */
-+static void
-+test_memdup2 (void)
-+{
-+  gchar *str_dup = NULL;
-+  const gchar *str = "The quick brown fox jumps over the lazy dog";
-+
-+  /* Testing negative cases */
-+  g_assert_null (g_memdup2 (NULL, 1024));
-+  g_assert_null (g_memdup2 (str, 0));
-+  g_assert_null (g_memdup2 (NULL, 0));
-+
-+  /* Testing normal usage cases */
-+  str_dup = g_memdup2 (str, strlen (str) + 1);
-+  g_assert_nonnull (str_dup);
-+  g_assert_cmpstr (str, ==, str_dup);
-+
-+  g_free (str_dup);
-+}
-+
- /* Testing g_strpcpy() function with various positive and negative cases */
- static void
- test_stpcpy (void)
-@@ -2523,6 +2545,7 @@ main (int   argc,
-   g_test_add_func ("/strfuncs/has-prefix", test_has_prefix);
-   g_test_add_func ("/strfuncs/has-suffix", test_has_suffix);
-   g_test_add_func ("/strfuncs/memdup", test_memdup);
-+  g_test_add_func ("/strfuncs/memdup2", test_memdup2);
-   g_test_add_func ("/strfuncs/stpcpy", test_stpcpy);
-   g_test_add_func ("/strfuncs/str_match_string", test_str_match_string);
-   g_test_add_func ("/strfuncs/str_tokenize_and_fold", test_str_tokenize_and_fold);
--- 
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-02.patch b/gnu/packages/patches/glib-CVE-2021-27219-02.patch
deleted file mode 100644
index 431959fa8f..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-02.patch
+++ /dev/null
@@ -1,264 +0,0 @@
-Backport of:
-
-From be8834340a2d928ece82025463ae23dee2c333d0 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Thu, 4 Feb 2021 13:37:56 +0000
-Subject: [PATCH 02/11] gio: Use g_memdup2() instead of g_memdup() in obvious
- places
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Convert all the call sites which use `g_memdup()`’s length argument
-trivially (for example, by passing a `sizeof()`), so that they use
-`g_memdup2()` instead.
-
-In almost all of these cases the use of `g_memdup()` would not have
-caused problems, but it will soon be deprecated, so best port away from
-it.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
-Helps: #2319
----
- gio/gdbusconnection.c                 | 5 +++--
- gio/gdbusinterfaceskeleton.c          | 3 ++-
- gio/gfile.c                           | 7 ++++---
- gio/gsettingsschema.c                 | 5 +++--
- gio/gwin32registrykey.c               | 8 +++++---
- gio/tests/async-close-output-stream.c | 6 ++++--
- gio/tests/gdbus-export.c              | 5 +++--
- gio/win32/gwinhttpfile.c              | 9 +++++----
- 8 files changed, 29 insertions(+), 19 deletions(-)
-
-diff --git a/gio/gdbusconnection.c b/gio/gdbusconnection.c
-index f1f0921d4..d56453486 100644
---- a/gio/gdbusconnection.c
-+++ b/gio/gdbusconnection.c
-@@ -110,6 +110,7 @@
- #include "gasyncinitable.h"
- #include "giostream.h"
- #include "gasyncresult.h"
-+#include "gstrfuncsprivate.h"
- #include "gtask.h"
- #include "gmarshal-internal.h"
- 
-@@ -3997,7 +3998,7 @@ _g_dbus_interface_vtable_copy (const GDBusInterfaceVTable *vtable)
-   /* Don't waste memory by copying padding - remember to update this
-    * when changing struct _GDBusInterfaceVTable in gdbusconnection.h
-    */
--  return g_memdup ((gconstpointer) vtable, 3 * sizeof (gpointer));
-+  return g_memdup2 ((gconstpointer) vtable, 3 * sizeof (gpointer));
- }
- 
- static void
-@@ -4014,7 +4015,7 @@ _g_dbus_subtree_vtable_copy (const GDBusSubtreeVTable *vtable)
-   /* Don't waste memory by copying padding - remember to update this
-    * when changing struct _GDBusSubtreeVTable in gdbusconnection.h
-    */
--  return g_memdup ((gconstpointer) vtable, 3 * sizeof (gpointer));
-+  return g_memdup2 ((gconstpointer) vtable, 3 * sizeof (gpointer));
- }
- 
- static void
-diff --git a/gio/gdbusinterfaceskeleton.c b/gio/gdbusinterfaceskeleton.c
-index 4a06516c1..4a4b719a5 100644
---- a/gio/gdbusinterfaceskeleton.c
-+++ b/gio/gdbusinterfaceskeleton.c
-@@ -28,6 +28,7 @@
- #include "gdbusmethodinvocation.h"
- #include "gdbusconnection.h"
- #include "gmarshal-internal.h"
-+#include "gstrfuncsprivate.h"
- #include "gtask.h"
- #include "gioerror.h"
- 
-@@ -701,7 +702,7 @@ add_connection_locked (GDBusInterfaceSkeleton *interface_,
-        * properly before building the hooked_vtable, so we create it
-        * once at the last minute.
-        */
--      interface_->priv->hooked_vtable = g_memdup (g_dbus_interface_skeleton_get_vtable (interface_), sizeof (GDBusInterfaceVTable));
-+      interface_->priv->hooked_vtable = g_memdup2 (g_dbus_interface_skeleton_get_vtable (interface_), sizeof (GDBusInterfaceVTable));
-       interface_->priv->hooked_vtable->method_call = skeleton_intercept_handle_method_call;
-     }
- 
-diff --git a/gio/gfile.c b/gio/gfile.c
-index ba93f7c75..88b341e7d 100644
---- a/gio/gfile.c
-+++ b/gio/gfile.c
-@@ -60,6 +60,7 @@
- #include "gasyncresult.h"
- #include "gioerror.h"
- #include "glibintl.h"
-+#include "gstrfuncsprivate.h"
- 
- 
- /**
-@@ -7884,7 +7885,7 @@ measure_disk_usage_progress (gboolean reporting,
-   g_main_context_invoke_full (g_task_get_context (task),
-                               g_task_get_priority (task),
-                               measure_disk_usage_invoke_progress,
--                              g_memdup (&progress, sizeof progress),
-+                              g_memdup2 (&progress, sizeof progress),
-                               g_free);
- }
- 
-@@ -7902,7 +7903,7 @@ measure_disk_usage_thread (GTask        *task,
-                                  data->progress_callback ? measure_disk_usage_progress : NULL, task,
-                                  &result.disk_usage, &result.num_dirs, &result.num_files,
-                                  &error))
--    g_task_return_pointer (task, g_memdup (&result, sizeof result), g_free);
-+    g_task_return_pointer (task, g_memdup2 (&result, sizeof result), g_free);
-   else
-     g_task_return_error (task, error);
- }
-@@ -7926,7 +7927,7 @@ g_file_real_measure_disk_usage_async (GFile                        *file,
- 
-   task = g_task_new (file, cancellable, callback, user_data);
-   g_task_set_source_tag (task, g_file_real_measure_disk_usage_async);
--  g_task_set_task_data (task, g_memdup (&data, sizeof data), g_free);
-+  g_task_set_task_data (task, g_memdup2 (&data, sizeof data), g_free);
-   g_task_set_priority (task, io_priority);
- 
-   g_task_run_in_thread (task, measure_disk_usage_thread);
-diff --git a/gio/gsettingsschema.c b/gio/gsettingsschema.c
-index 3a60b8c64..dded9b1ca 100644
---- a/gio/gsettingsschema.c
-+++ b/gio/gsettingsschema.c
-@@ -20,6 +20,7 @@
- 
- #include "gsettingsschema-internal.h"
- #include "gsettings.h"
-+#include "gstrfuncsprivate.h"
- 
- #include "gvdb/gvdb-reader.h"
- #include "strinfo.c"
-@@ -1058,9 +1059,9 @@ g_settings_schema_list_children (GSettingsSchema *schema)
- 
-       if (g_str_has_suffix (key, "/"))
-         {
--          gint length = strlen (key);
-+          gsize length = strlen (key);
- 
--          strv[j] = g_memdup (key, length);
-+          strv[j] = g_memdup2 (key, length);
-           strv[j][length - 1] = '\0';
-           j++;
-         }
-diff --git a/gio/gwin32registrykey.c b/gio/gwin32registrykey.c
-index c19fede4e..619fd48af 100644
---- a/gio/gwin32registrykey.c
-+++ b/gio/gwin32registrykey.c
-@@ -28,6 +28,8 @@
- #include <ntstatus.h>
- #include <winternl.h>
- 
-+#include "gstrfuncsprivate.h"
-+
- #ifndef _WDMDDK_
- typedef enum _KEY_INFORMATION_CLASS {
-   KeyBasicInformation,
-@@ -247,7 +249,7 @@ g_win32_registry_value_iter_copy (const GWin32RegistryValueIter *iter)
-   new_iter->value_name_size = iter->value_name_size;
- 
-   if (iter->value_data != NULL)
--    new_iter->value_data = g_memdup (iter->value_data, iter->value_data_size);
-+    new_iter->value_data = g_memdup2 (iter->value_data, iter->value_data_size);
- 
-   new_iter->value_data_size = iter->value_data_size;
- 
-@@ -268,8 +270,8 @@ g_win32_registry_value_iter_copy (const GWin32RegistryValueIter *iter)
-   new_iter->value_data_expanded_charsize = iter->value_data_expanded_charsize;
- 
-   if (iter->value_data_expanded_u8 != NULL)
--    new_iter->value_data_expanded_u8 = g_memdup (iter->value_data_expanded_u8,
--                                                 iter->value_data_expanded_charsize);
-+    new_iter->value_data_expanded_u8 = g_memdup2 (iter->value_data_expanded_u8,
-+                                                  iter->value_data_expanded_charsize);
- 
-   new_iter->value_data_expanded_u8_size = iter->value_data_expanded_charsize;
- 
-diff --git a/gio/tests/async-close-output-stream.c b/gio/tests/async-close-output-stream.c
-index 5f6620275..d3f97a119 100644
---- a/gio/tests/async-close-output-stream.c
-+++ b/gio/tests/async-close-output-stream.c
-@@ -24,6 +24,8 @@
- #include <stdlib.h>
- #include <string.h>
- 
-+#include "gstrfuncsprivate.h"
-+
- #define DATA_TO_WRITE "Hello world\n"
- 
- typedef struct
-@@ -147,9 +149,9 @@ prepare_data (SetupData *data,
- 
-   data->expected_size = g_memory_output_stream_get_data_size (G_MEMORY_OUTPUT_STREAM (data->data_stream));
- 
--  g_assert_cmpint (data->expected_size, >, 0);
-+  g_assert_cmpuint (data->expected_size, >, 0);
- 
--  data->expected_output = g_memdup (written, (guint)data->expected_size);
-+  data->expected_output = g_memdup2 (written, data->expected_size);
- 
-   /* then recreate the streams and prepare them for the asynchronous close */
-   destroy_streams (data);
-diff --git a/gio/tests/gdbus-export.c b/gio/tests/gdbus-export.c
-index 506c7458a..5513306f8 100644
---- a/gio/tests/gdbus-export.c
-+++ b/gio/tests/gdbus-export.c
-@@ -23,6 +23,7 @@
- #include <string.h>
- 
- #include "gdbus-tests.h"
-+#include "gstrfuncsprivate.h"
- 
- /* all tests rely on a shared mainloop */
- static GMainLoop *loop = NULL;
-@@ -671,7 +672,7 @@ subtree_introspect (GDBusConnection       *connection,
-       g_assert_not_reached ();
-     }
- 
--  return g_memdup (interfaces, 2 * sizeof (void *));
-+  return g_memdup2 (interfaces, 2 * sizeof (void *));
- }
- 
- static const GDBusInterfaceVTable *
-@@ -727,7 +728,7 @@ dynamic_subtree_introspect (GDBusConnection       *connection,
- {
-   const GDBusInterfaceInfo *interfaces[2] = { &dyna_interface_info, NULL };
- 
--  return g_memdup (interfaces, 2 * sizeof (void *));
-+  return g_memdup2 (interfaces, 2 * sizeof (void *));
- }
- 
- static const GDBusInterfaceVTable *
-diff --git a/gio/win32/gwinhttpfile.c b/gio/win32/gwinhttpfile.c
-index cf5eed31d..040ee8564 100644
---- a/gio/win32/gwinhttpfile.c
-+++ b/gio/win32/gwinhttpfile.c
-@@ -29,6 +29,7 @@
- #include "gio/gfile.h"
- #include "gio/gfileattribute.h"
- #include "gio/gfileinfo.h"
-+#include "gstrfuncsprivate.h"
- #include "gwinhttpfile.h"
- #include "gwinhttpfileinputstream.h"
- #include "gwinhttpfileoutputstream.h"
-@@ -393,10 +394,10 @@ g_winhttp_file_resolve_relative_path (GFile      *file,
-   child = g_object_new (G_TYPE_WINHTTP_FILE, NULL);
-   child->vfs = winhttp_file->vfs;
-   child->url = winhttp_file->url;
--  child->url.lpszScheme = g_memdup (winhttp_file->url.lpszScheme, (winhttp_file->url.dwSchemeLength+1)*2);
--  child->url.lpszHostName = g_memdup (winhttp_file->url.lpszHostName, (winhttp_file->url.dwHostNameLength+1)*2);
--  child->url.lpszUserName = g_memdup (winhttp_file->url.lpszUserName, (winhttp_file->url.dwUserNameLength+1)*2);
--  child->url.lpszPassword = g_memdup (winhttp_file->url.lpszPassword, (winhttp_file->url.dwPasswordLength+1)*2);
-+  child->url.lpszScheme = g_memdup2 (winhttp_file->url.lpszScheme, (winhttp_file->url.dwSchemeLength+1)*2);
-+  child->url.lpszHostName = g_memdup2 (winhttp_file->url.lpszHostName, (winhttp_file->url.dwHostNameLength+1)*2);
-+  child->url.lpszUserName = g_memdup2 (winhttp_file->url.lpszUserName, (winhttp_file->url.dwUserNameLength+1)*2);
-+  child->url.lpszPassword = g_memdup2 (winhttp_file->url.lpszPassword, (winhttp_file->url.dwPasswordLength+1)*2);
-   child->url.lpszUrlPath = wnew_path;
-   child->url.dwUrlPathLength = wcslen (wnew_path);
-   child->url.lpszExtraInfo = NULL;
--- 
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-03.patch b/gnu/packages/patches/glib-CVE-2021-27219-03.patch
deleted file mode 100644
index 99e849c43c..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-03.patch
+++ /dev/null
@@ -1,136 +0,0 @@
-From 6110caea45b235420b98cd41d845cc92238f6781 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Thu, 4 Feb 2021 13:39:25 +0000
-Subject: [PATCH 03/11] gobject: Use g_memdup2() instead of g_memdup() in
- obvious places
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Convert all the call sites which use `g_memdup()`’s length argument
-trivially (for example, by passing a `sizeof()`), so that they use
-`g_memdup2()` instead.
-
-In almost all of these cases the use of `g_memdup()` would not have
-caused problems, but it will soon be deprecated, so best port away from
-it.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
-Helps: #2319
----
- gobject/gsignal.c     | 3 ++-
- gobject/gtype.c       | 9 +++++----
- gobject/gtypemodule.c | 3 ++-
- gobject/tests/param.c | 4 +++-
- 4 files changed, 12 insertions(+), 7 deletions(-)
-
-diff --git a/gobject/gsignal.c b/gobject/gsignal.c
-index 77d8f211e..41c54ab57 100644
---- a/gobject/gsignal.c
-+++ b/gobject/gsignal.c
-@@ -28,6 +28,7 @@
- #include <signal.h>
- 
- #include "gsignal.h"
-+#include "gstrfuncsprivate.h"
- #include "gtype-private.h"
- #include "gbsearcharray.h"
- #include "gvaluecollector.h"
-@@ -1730,7 +1731,7 @@ g_signal_newv (const gchar       *signal_name,
-   node->single_va_closure_is_valid = FALSE;
-   node->flags = signal_flags & G_SIGNAL_FLAGS_MASK;
-   node->n_params = n_params;
--  node->param_types = g_memdup (param_types, sizeof (GType) * n_params);
-+  node->param_types = g_memdup2 (param_types, sizeof (GType) * n_params);
-   node->return_type = return_type;
-   node->class_closure_bsa = NULL;
-   if (accumulator)
-diff --git a/gobject/gtype.c b/gobject/gtype.c
-index 7d3789400..8441b90e9 100644
---- a/gobject/gtype.c
-+++ b/gobject/gtype.c
-@@ -33,6 +33,7 @@
- 
- #include "glib-private.h"
- #include "gconstructor.h"
-+#include "gstrfuncsprivate.h"
- 
- #ifdef G_OS_WIN32
- #include <windows.h>
-@@ -1470,7 +1471,7 @@ type_add_interface_Wm (TypeNode             *node,
-   iholder->next = iface_node_get_holders_L (iface);
-   iface_node_set_holders_W (iface, iholder);
-   iholder->instance_type = NODE_TYPE (node);
--  iholder->info = info ? g_memdup (info, sizeof (*info)) : NULL;
-+  iholder->info = info ? g_memdup2 (info, sizeof (*info)) : NULL;
-   iholder->plugin = plugin;
- 
-   /* create an iface entry for this type */
-@@ -1731,7 +1732,7 @@ type_iface_retrieve_holder_info_Wm (TypeNode *iface,
-         INVALID_RECURSION ("g_type_plugin_*", iholder->plugin, NODE_NAME (iface));
-       
-       check_interface_info_I (iface, instance_type, &tmp_info);
--      iholder->info = g_memdup (&tmp_info, sizeof (tmp_info));
-+      iholder->info = g_memdup2 (&tmp_info, sizeof (tmp_info));
-     }
-   
-   return iholder;	/* we don't modify write lock upon returning NULL */
-@@ -2016,10 +2017,10 @@ type_iface_vtable_base_init_Wm (TypeNode *iface,
-       IFaceEntry *pentry = type_lookup_iface_entry_L (pnode, iface);
-       
-       if (pentry)
--	vtable = g_memdup (pentry->vtable, iface->data->iface.vtable_size);
-+	vtable = g_memdup2 (pentry->vtable, iface->data->iface.vtable_size);
-     }
-   if (!vtable)
--    vtable = g_memdup (iface->data->iface.dflt_vtable, iface->data->iface.vtable_size);
-+    vtable = g_memdup2 (iface->data->iface.dflt_vtable, iface->data->iface.vtable_size);
-   entry->vtable = vtable;
-   vtable->g_type = NODE_TYPE (iface);
-   vtable->g_instance_type = NODE_TYPE (node);
-diff --git a/gobject/gtypemodule.c b/gobject/gtypemodule.c
-index 4ecaf8c88..20911fafd 100644
---- a/gobject/gtypemodule.c
-+++ b/gobject/gtypemodule.c
-@@ -19,6 +19,7 @@
- 
- #include <stdlib.h>
- 
-+#include "gstrfuncsprivate.h"
- #include "gtypeplugin.h"
- #include "gtypemodule.h"
- 
-@@ -436,7 +437,7 @@ g_type_module_register_type (GTypeModule     *module,
-   module_type_info->loaded = TRUE;
-   module_type_info->info = *type_info;
-   if (type_info->value_table)
--    module_type_info->info.value_table = g_memdup (type_info->value_table,
-+    module_type_info->info.value_table = g_memdup2 (type_info->value_table,
- 						   sizeof (GTypeValueTable));
- 
-   return module_type_info->type;
-diff --git a/gobject/tests/param.c b/gobject/tests/param.c
-index 758289bf8..971cff162 100644
---- a/gobject/tests/param.c
-+++ b/gobject/tests/param.c
-@@ -2,6 +2,8 @@
- #include <glib-object.h>
- #include <stdlib.h>
- 
-+#include "gstrfuncsprivate.h"
-+
- static void
- test_param_value (void)
- {
-@@ -851,7 +853,7 @@ main (int argc, char *argv[])
-             test_path = g_strdup_printf ("/param/implement/subprocess/%d-%d-%d-%d",
-                                          data.change_this_flag, data.change_this_type,
-                                          data.use_this_flag, data.use_this_type);
--            test_data = g_memdup (&data, sizeof (TestParamImplementData));
-+            test_data = g_memdup2 (&data, sizeof (TestParamImplementData));
-             g_test_add_data_func_full (test_path, test_data, test_param_implement_child, g_free);
-             g_free (test_path);
-           }
--- 
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-04.patch b/gnu/packages/patches/glib-CVE-2021-27219-04.patch
deleted file mode 100644
index 3ae01f34b1..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-04.patch
+++ /dev/null
@@ -1,308 +0,0 @@
-Backport of:
-
-From 0736b7c1e7cf4232c5d7eb2b0fbfe9be81bd3baa Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Thu, 4 Feb 2021 13:41:21 +0000
-Subject: [PATCH 04/11] glib: Use g_memdup2() instead of g_memdup() in obvious
- places
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Convert all the call sites which use `g_memdup()`’s length argument
-trivially (for example, by passing a `sizeof()` or an existing `gsize`
-variable), so that they use `g_memdup2()` instead.
-
-In almost all of these cases the use of `g_memdup()` would not have
-caused problems, but it will soon be deprecated, so best port away from
-it
-
-In particular, this fixes an overflow within `g_bytes_new()`, identified
-as GHSL-2021-045 by GHSL team member Kevin Backhouse.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
-Fixes: GHSL-2021-045
-Helps: #2319
----
- glib/gbytes.c               | 6 ++++--
- glib/gdir.c                 | 3 ++-
- glib/ghash.c                | 7 ++++---
- glib/giochannel.c           | 3 ++-
- glib/gslice.c               | 3 ++-
- glib/gtestutils.c           | 3 ++-
- glib/gvariant.c             | 7 ++++---
- glib/gvarianttype.c         | 3 ++-
- glib/tests/array-test.c     | 4 +++-
- glib/tests/option-context.c | 6 ++++--
- 10 files changed, 29 insertions(+), 16 deletions(-)
-
-diff --git a/glib/gbytes.c b/glib/gbytes.c
-index d56abe6c3..dee494820 100644
---- a/glib/gbytes.c
-+++ b/glib/gbytes.c
-@@ -34,6 +34,8 @@
- 
- #include <string.h>
- 
-+#include "gstrfuncsprivate.h"
-+
- /**
-  * GBytes:
-  *
-@@ -95,7 +97,7 @@ g_bytes_new (gconstpointer data,
- {
-   g_return_val_if_fail (data != NULL || size == 0, NULL);
- 
--  return g_bytes_new_take (g_memdup (data, size), size);
-+  return g_bytes_new_take (g_memdup2 (data, size), size);
- }
- 
- /**
-@@ -499,7 +501,7 @@ g_bytes_unref_to_data (GBytes *bytes,
-        * Copy: Non g_malloc (or compatible) allocator, or static memory,
-        * so we have to copy, and then unref.
-        */
--      result = g_memdup (bytes->data, bytes->size);
-+      result = g_memdup2 (bytes->data, bytes->size);
-       *size = bytes->size;
-       g_bytes_unref (bytes);
-     }
-diff --git a/glib/gdir.c b/glib/gdir.c
-index 6b85e99c8..6747a8c6f 100644
---- a/glib/gdir.c
-+++ b/glib/gdir.c
-@@ -37,6 +37,7 @@
- #include "gconvert.h"
- #include "gfileutils.h"
- #include "gstrfuncs.h"
-+#include "gstrfuncsprivate.h"
- #include "gtestutils.h"
- #include "glibintl.h"
- 
-@@ -112,7 +113,7 @@ g_dir_open_with_errno (const gchar *path,
-     return NULL;
- #endif
- 
--  return g_memdup (&dir, sizeof dir);
-+  return g_memdup2 (&dir, sizeof dir);
- }
- 
- /**
-diff --git a/glib/ghash.c b/glib/ghash.c
-index e61b03788..26f26062b 100644
---- a/glib/ghash.c
-+++ b/glib/ghash.c
-@@ -34,6 +34,7 @@
- #include "gmacros.h"
- #include "glib-private.h"
- #include "gstrfuncs.h"
-+#include "gstrfuncsprivate.h"
- #include "gatomic.h"
- #include "gtestutils.h"
- #include "gslice.h"
-@@ -964,7 +965,7 @@ g_hash_table_ensure_keyval_fits (GHashTable *hash_table, gpointer key, gpointer
-       if (hash_table->have_big_keys)
-         {
-           if (key != value)
--            hash_table->values = g_memdup (hash_table->keys, sizeof (gpointer) * hash_table->size);
-+            hash_table->values = g_memdup2 (hash_table->keys, sizeof (gpointer) * hash_table->size);
-           /* Keys and values are both big now, so no need for further checks */
-           return;
-         }
-@@ -972,7 +973,7 @@ g_hash_table_ensure_keyval_fits (GHashTable *hash_table, gpointer key, gpointer
-         {
-           if (key != value)
-             {
--              hash_table->values = g_memdup (hash_table->keys, sizeof (guint) * hash_table->size);
-+              hash_table->values = g_memdup2 (hash_table->keys, sizeof (guint) * hash_table->size);
-               is_a_set = FALSE;
-             }
-         }
-@@ -1000,7 +1001,7 @@ g_hash_table_ensure_keyval_fits (GHashTable *hash_table, gpointer key, gpointer
- 
-   /* Just split if necessary */
-   if (is_a_set && key != value)
--    hash_table->values = g_memdup (hash_table->keys, sizeof (gpointer) * hash_table->size);
-+    hash_table->values = g_memdup2 (hash_table->keys, sizeof (gpointer) * hash_table->size);
- 
- #endif
- }
-diff --git a/glib/giochannel.c b/glib/giochannel.c
-index 1956e9dc6..15927c391 100644
---- a/glib/giochannel.c
-+++ b/glib/giochannel.c
-@@ -37,6 +37,7 @@
- #include "giochannel.h"
- 
- #include "gstrfuncs.h"
-+#include "gstrfuncsprivate.h"
- #include "gtestutils.h"
- #include "glibintl.h"
- 
-@@ -892,7 +893,7 @@ g_io_channel_set_line_term (GIOChannel	*channel,
-     length = strlen (line_term);
- 
-   g_free (channel->line_term);
--  channel->line_term = line_term ? g_memdup (line_term, length) : NULL;
-+  channel->line_term = line_term ? g_memdup2 (line_term, length) : NULL;
-   channel->line_term_len = length;
- }
- 
-diff --git a/glib/gslice.c b/glib/gslice.c
-index 4c758c3be..bcdbb8853 100644
---- a/glib/gslice.c
-+++ b/glib/gslice.c
-@@ -41,6 +41,7 @@
- #include "gmain.h"
- #include "gmem.h"               /* gslice.h */
- #include "gstrfuncs.h"
-+#include "gstrfuncsprivate.h"
- #include "gutils.h"
- #include "gtrashstack.h"
- #include "gtestutils.h"
-@@ -350,7 +351,7 @@ g_slice_get_config_state (GSliceConfig ckey,
-       array[i++] = allocator->contention_counters[address];
-       array[i++] = allocator_get_magazine_threshold (allocator, address);
-       *n_values = i;
--      return g_memdup (array, sizeof (array[0]) * *n_values);
-+      return g_memdup2 (array, sizeof (array[0]) * *n_values);
-     default:
-       return NULL;
-     }
-diff --git a/glib/gtestutils.c b/glib/gtestutils.c
-index dd789482f..5887ecc36 100644
---- a/glib/gtestutils.c
-+++ b/glib/gtestutils.c
-@@ -49,6 +49,7 @@
- #include "gpattern.h"
- #include "grand.h"
- #include "gstrfuncs.h"
-+#include "gstrfuncsprivate.h"
- #include "gtimer.h"
- #include "gslice.h"
- #include "gspawn.h"
-@@ -3798,7 +3799,7 @@ g_test_log_extract (GTestLogBuffer *tbuffer)
-       if (p <= tbuffer->data->str + mlength)
-         {
-           g_string_erase (tbuffer->data, 0, mlength);
--          tbuffer->msgs = g_slist_prepend (tbuffer->msgs, g_memdup (&msg, sizeof (msg)));
-+          tbuffer->msgs = g_slist_prepend (tbuffer->msgs, g_memdup2 (&msg, sizeof (msg)));
-           return TRUE;
-         }
- 
-diff --git a/glib/gvariant.c b/glib/gvariant.c
-index b61bf7278..d6f68a9ea 100644
---- a/glib/gvariant.c
-+++ b/glib/gvariant.c
-@@ -33,6 +33,7 @@
- 
- #include <string.h>
- 
-+#include "gstrfuncsprivate.h"
- 
- /**
-  * SECTION:gvariant
-@@ -725,7 +726,7 @@ g_variant_new_variant (GVariant *value)
-   g_variant_ref_sink (value);
- 
-   return g_variant_new_from_children (G_VARIANT_TYPE_VARIANT,
--                                      g_memdup (&value, sizeof value),
-+                                      g_memdup2 (&value, sizeof value),
-                                       1, g_variant_is_trusted (value));
- }
- 
-@@ -1229,7 +1230,7 @@ g_variant_new_fixed_array (const GVariantType  *element_type,
-       return NULL;
-     }
- 
--  data = g_memdup (elements, n_elements * element_size);
-+  data = g_memdup2 (elements, n_elements * element_size);
-   value = g_variant_new_from_data (array_type, data,
-                                    n_elements * element_size,
-                                    FALSE, g_free, data);
-@@ -1908,7 +1909,7 @@ g_variant_dup_bytestring (GVariant *value,
-   if (length)
-     *length = size;
- 
--  return g_memdup (original, size + 1);
-+  return g_memdup2 (original, size + 1);
- }
- 
- /**
-diff --git a/glib/gvarianttype.c b/glib/gvarianttype.c
-index 1a228f73b..07659ff12 100644
---- a/glib/gvarianttype.c
-+++ b/glib/gvarianttype.c
-@@ -28,6 +28,7 @@
- 
- #include <string.h>
- 
-+#include "gstrfuncsprivate.h"
- 
- /**
-  * SECTION:gvarianttype
-@@ -1181,7 +1182,7 @@ g_variant_type_new_tuple (const GVariantType * const *items,
-   g_assert (offset < sizeof buffer);
-   buffer[offset++] = ')';
- 
--  return (GVariantType *) g_memdup (buffer, offset);
-+  return (GVariantType *) g_memdup2 (buffer, offset);
- }
- 
- /**
-diff --git a/glib/tests/array-test.c b/glib/tests/array-test.c
-index 3fcf1136a..11982f822 100644
---- a/glib/tests/array-test.c
-+++ b/glib/tests/array-test.c
-@@ -29,6 +29,8 @@
- #include <string.h>
- #include "glib.h"
- 
-+#include "gstrfuncsprivate.h"
-+
- /* Test data to be passed to any function which calls g_array_new(), providing
-  * the parameters for that call. Most #GArray tests should be repeated for all
-  * possible values of #ArrayTestData. */
-@@ -1642,7 +1644,7 @@ byte_array_new_take (void)
-   GByteArray *gbarray;
-   guint8 *data;
- 
--  data = g_memdup ("woooweeewow", 11);
-+  data = g_memdup2 ("woooweeewow", 11);
-   gbarray = g_byte_array_new_take (data, 11);
-   g_assert (gbarray->data == data);
-   g_assert_cmpuint (gbarray->len, ==, 11);
-diff --git a/glib/tests/option-context.c b/glib/tests/option-context.c
-index 149d22353..88d2b80d1 100644
---- a/glib/tests/option-context.c
-+++ b/glib/tests/option-context.c
-@@ -27,6 +27,8 @@
- #include <string.h>
- #include <locale.h>
- 
-+#include "gstrfuncsprivate.h"
-+
- static GOptionEntry main_entries[] = {
-   { "main-switch", 0, 0,
-     G_OPTION_ARG_NONE, NULL,
-@@ -256,7 +258,7 @@ join_stringv (int argc, char **argv)
- static char **
- copy_stringv (char **argv, int argc)
- {
--  return g_memdup (argv, sizeof (char *) * (argc + 1));
-+  return g_memdup2 (argv, sizeof (char *) * (argc + 1));
- }
- 
- static void
-@@ -2323,7 +2325,7 @@ test_group_parse (void)
-   g_option_context_add_group (context, group);
- 
-   argv = split_string ("program --test arg1 -f arg2 --group-test arg3 --frob arg4 -z arg5", &argc);
--  orig_argv = g_memdup (argv, (argc + 1) * sizeof (char *));
-+  orig_argv = g_memdup2 (argv, (argc + 1) * sizeof (char *));
- 
-   retval = g_option_context_parse (context, &argc, &argv, &error);
- 
--- 
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-05.patch b/gnu/packages/patches/glib-CVE-2021-27219-05.patch
deleted file mode 100644
index 62bce1b188..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-05.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From 0cbad673215ec8a049b7fe2ff44b0beed31b376e Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Thu, 4 Feb 2021 16:12:24 +0000
-Subject: [PATCH 05/11] gwinhttpfile: Avoid arithmetic overflow when
- calculating a size
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The members of `URL_COMPONENTS` (`winhttp_file->url`) are `DWORD`s, i.e.
-32-bit unsigned integers. Adding to and multiplying them may cause them
-to overflow the unsigned integer bounds, even if the result is passed to
-`g_memdup2()` which accepts a `gsize`.
-
-Cast the `URL_COMPONENTS` members to `gsize` first to ensure that the
-arithmetic is done in terms of `gsize`s rather than unsigned integers.
-
-Spotted by Sebastian Dröge.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
-Helps: #2319
----
- gio/win32/gwinhttpfile.c | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/gio/win32/gwinhttpfile.c b/gio/win32/gwinhttpfile.c
-index 040ee8564..246ec0578 100644
---- a/gio/win32/gwinhttpfile.c
-+++ b/gio/win32/gwinhttpfile.c
-@@ -394,10 +394,10 @@ g_winhttp_file_resolve_relative_path (GFile      *file,
-   child = g_object_new (G_TYPE_WINHTTP_FILE, NULL);
-   child->vfs = winhttp_file->vfs;
-   child->url = winhttp_file->url;
--  child->url.lpszScheme = g_memdup2 (winhttp_file->url.lpszScheme, (winhttp_file->url.dwSchemeLength+1)*2);
--  child->url.lpszHostName = g_memdup2 (winhttp_file->url.lpszHostName, (winhttp_file->url.dwHostNameLength+1)*2);
--  child->url.lpszUserName = g_memdup2 (winhttp_file->url.lpszUserName, (winhttp_file->url.dwUserNameLength+1)*2);
--  child->url.lpszPassword = g_memdup2 (winhttp_file->url.lpszPassword, (winhttp_file->url.dwPasswordLength+1)*2);
-+  child->url.lpszScheme = g_memdup2 (winhttp_file->url.lpszScheme, ((gsize) winhttp_file->url.dwSchemeLength + 1) * 2);
-+  child->url.lpszHostName = g_memdup2 (winhttp_file->url.lpszHostName, ((gsize) winhttp_file->url.dwHostNameLength + 1) * 2);
-+  child->url.lpszUserName = g_memdup2 (winhttp_file->url.lpszUserName, ((gsize) winhttp_file->url.dwUserNameLength + 1) * 2);
-+  child->url.lpszPassword = g_memdup2 (winhttp_file->url.lpszPassword, ((gsize) winhttp_file->url.dwPasswordLength + 1) * 2);
-   child->url.lpszUrlPath = wnew_path;
-   child->url.dwUrlPathLength = wcslen (wnew_path);
-   child->url.lpszExtraInfo = NULL;
--- 
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-06.patch b/gnu/packages/patches/glib-CVE-2021-27219-06.patch
deleted file mode 100644
index 4e2435f5fd..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-06.patch
+++ /dev/null
@@ -1,94 +0,0 @@
-From f9ee2275cbc312c0b4cdbc338a4fbb76eb36fb9a Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Thu, 4 Feb 2021 13:49:00 +0000
-Subject: [PATCH 06/11] gdatainputstream: Handle stop_chars_len internally as
- gsize
-
-Previously it was handled as a `gssize`, which meant that if the
-`stop_chars` string was longer than `G_MAXSSIZE` there would be an
-overflow.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
-Helps: #2319
----
- gio/gdatainputstream.c | 25 +++++++++++++++++--------
- 1 file changed, 17 insertions(+), 8 deletions(-)
-
-diff --git a/gio/gdatainputstream.c b/gio/gdatainputstream.c
-index 2e7750cb5..2cdcbda19 100644
---- a/gio/gdatainputstream.c
-+++ b/gio/gdatainputstream.c
-@@ -27,6 +27,7 @@
- #include "gioenumtypes.h"
- #include "gioerror.h"
- #include "glibintl.h"
-+#include "gstrfuncsprivate.h"
- 
- #include <string.h>
- 
-@@ -856,7 +857,7 @@ static gssize
- scan_for_chars (GDataInputStream *stream,
- 		gsize            *checked_out,
- 		const char       *stop_chars,
--                gssize            stop_chars_len)
-+                gsize             stop_chars_len)
- {
-   GBufferedInputStream *bstream;
-   const char *buffer;
-@@ -952,7 +953,7 @@ typedef struct
-   gsize checked;
- 
-   gchar *stop_chars;
--  gssize stop_chars_len;
-+  gsize stop_chars_len;
-   gsize length;
- } GDataInputStreamReadData;
- 
-@@ -1078,12 +1079,17 @@ g_data_input_stream_read_async (GDataInputStream    *stream,
- {
-   GDataInputStreamReadData *data;
-   GTask *task;
-+  gsize stop_chars_len_unsigned;
- 
-   data = g_slice_new0 (GDataInputStreamReadData);
--  if (stop_chars_len == -1)
--    stop_chars_len = strlen (stop_chars);
--  data->stop_chars = g_memdup (stop_chars, stop_chars_len);
--  data->stop_chars_len = stop_chars_len;
-+
-+  if (stop_chars_len < 0)
-+    stop_chars_len_unsigned = strlen (stop_chars);
-+  else
-+    stop_chars_len_unsigned = (gsize) stop_chars_len;
-+
-+  data->stop_chars = g_memdup2 (stop_chars, stop_chars_len_unsigned);
-+  data->stop_chars_len = stop_chars_len_unsigned;
-   data->last_saw_cr = FALSE;
- 
-   task = g_task_new (stream, cancellable, callback, user_data);
-@@ -1338,17 +1344,20 @@ g_data_input_stream_read_upto (GDataInputStream  *stream,
-   gssize found_pos;
-   gssize res;
-   char *data_until;
-+  gsize stop_chars_len_unsigned;
- 
-   g_return_val_if_fail (G_IS_DATA_INPUT_STREAM (stream), NULL);
- 
-   if (stop_chars_len < 0)
--    stop_chars_len = strlen (stop_chars);
-+    stop_chars_len_unsigned = strlen (stop_chars);
-+  else
-+    stop_chars_len_unsigned = (gsize) stop_chars_len;
- 
-   bstream = G_BUFFERED_INPUT_STREAM (stream);
- 
-   checked = 0;
- 
--  while ((found_pos = scan_for_chars (stream, &checked, stop_chars, stop_chars_len)) == -1)
-+  while ((found_pos = scan_for_chars (stream, &checked, stop_chars, stop_chars_len_unsigned)) == -1)
-     {
-       if (g_buffered_input_stream_get_available (bstream) ==
-           g_buffered_input_stream_get_buffer_size (bstream))
--- 
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-07.patch b/gnu/packages/patches/glib-CVE-2021-27219-07.patch
deleted file mode 100644
index dad3d285f4..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-07.patch
+++ /dev/null
@@ -1,118 +0,0 @@
-Backport of:
-
-From 2aaf593a9eb96d84fe3be740aca2810a97d95592 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Thu, 4 Feb 2021 13:50:37 +0000
-Subject: [PATCH 07/11] gwin32: Use gsize internally in g_wcsdup()
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-This allows it to handle strings up to length `G_MAXSIZE` — previously
-it would overflow with such strings.
-
-Update the several copies of it identically.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
-Helps: #2319
----
- gio/gwin32appinfo.c     | 33 ++++++++++++++++++++++++++-------
- gio/gwin32registrykey.c | 34 ++++++++++++++++++++++++++--------
- 2 files changed, 52 insertions(+), 15 deletions(-)
-
-diff --git a/gio/gwin32appinfo.c b/gio/gwin32appinfo.c
-index 9f335b370..dd7a96a4a 100644
---- a/gio/gwin32appinfo.c
-+++ b/gio/gwin32appinfo.c
-@@ -464,15 +464,34 @@ static GWin32RegistryKey *applications_key;
- /* Watch this key */
- static GWin32RegistryKey *classes_root_key;
- 
-+static gsize
-+g_utf16_len (const gunichar2 *str)
-+{
-+  gsize result;
-+
-+  for (result = 0; str[0] != 0; str++, result++)
-+    ;
-+
-+  return result;
-+}
-+
- static gunichar2 *
--g_wcsdup (const gunichar2 *str, gssize str_size)
-+g_wcsdup (const gunichar2 *str, gssize str_len)
- {
--  if (str_size == -1)
--    {
--      str_size = wcslen (str) + 1;
--      str_size *= sizeof (gunichar2);
--    }
--  return g_memdup (str, str_size);
-+  gsize str_len_unsigned;
-+  gsize str_size;
-+
-+  g_return_val_if_fail (str != NULL, NULL);
-+
-+  if (str_len < 0)
-+    str_len_unsigned = g_utf16_len (str);
-+  else
-+    str_len_unsigned = (gsize) str_len;
-+
-+  g_assert (str_len_unsigned <= G_MAXSIZE / sizeof (gunichar2) - 1);
-+  str_size = (str_len_unsigned + 1) * sizeof (gunichar2);
-+
-+  return g_memdup2 (str, str_size);
- }
- 
- #define URL_ASSOCIATIONS L"HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\"
-diff --git a/gio/gwin32registrykey.c b/gio/gwin32registrykey.c
-index 619fd48af..fbd65311a 100644
---- a/gio/gwin32registrykey.c
-+++ b/gio/gwin32registrykey.c
-@@ -127,16 +127,34 @@ typedef enum
-   G_WIN32_REGISTRY_UPDATED_PATH = 1,
- } GWin32RegistryKeyUpdateFlag;
- 
-+static gsize
-+g_utf16_len (const gunichar2 *str)
-+{
-+  gsize result;
-+
-+  for (result = 0; str[0] != 0; str++, result++)
-+    ;
-+
-+  return result;
-+}
-+
- static gunichar2 *
--g_wcsdup (const gunichar2 *str,
--          gssize           str_size)
-+g_wcsdup (const gunichar2 *str, gssize str_len)
- {
--  if (str_size == -1)
--    {
--      str_size = wcslen (str) + 1;
--      str_size *= sizeof (gunichar2);
--    }
--  return g_memdup (str, str_size);
-+  gsize str_len_unsigned;
-+  gsize str_size;
-+
-+  g_return_val_if_fail (str != NULL, NULL);
-+
-+  if (str_len < 0)
-+    str_len_unsigned = g_utf16_len (str);
-+  else
-+    str_len_unsigned = (gsize) str_len;
-+
-+  g_assert (str_len_unsigned <= G_MAXSIZE / sizeof (gunichar2) - 1);
-+  str_size = (str_len_unsigned + 1) * sizeof (gunichar2);
-+
-+  return g_memdup2 (str, str_size);
- }
- 
- /**
--- 
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-08.patch b/gnu/packages/patches/glib-CVE-2021-27219-08.patch
deleted file mode 100644
index 2c021ad317..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-08.patch
+++ /dev/null
@@ -1,94 +0,0 @@
-From ba8ca443051f93a74c0d03d62e70402036f967a5 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Thu, 4 Feb 2021 13:58:32 +0000
-Subject: [PATCH 08/11] gkeyfilesettingsbackend: Handle long keys when
- converting paths
-
-Previously, the code in `convert_path()` could not handle keys longer
-than `G_MAXINT`, and would overflow if that was exceeded.
-
-Convert the code to use `gsize` and `g_memdup2()` throughout, and
-change from identifying the position of the final slash in the string
-using a signed offset `i`, to using a pointer to the character (and
-`strrchr()`). This allows the slash to be at any position in a
-`G_MAXSIZE`-long string, without sacrificing a bit of the offset for
-indicating whether a slash was found.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
-Helps: #2319
----
- gio/gkeyfilesettingsbackend.c | 21 ++++++++++-----------
- 1 file changed, 10 insertions(+), 11 deletions(-)
-
-diff --git a/gio/gkeyfilesettingsbackend.c b/gio/gkeyfilesettingsbackend.c
-index cd5765afd..25b057672 100644
---- a/gio/gkeyfilesettingsbackend.c
-+++ b/gio/gkeyfilesettingsbackend.c
-@@ -33,6 +33,7 @@
- #include "gfilemonitor.h"
- #include "gsimplepermission.h"
- #include "gsettingsbackendinternal.h"
-+#include "gstrfuncsprivate.h"
- #include "giomodule-priv.h"
- #include "gportalsupport.h"
- 
-@@ -145,8 +146,8 @@ convert_path (GKeyfileSettingsBackend  *kfsb,
-               gchar                   **group,
-               gchar                   **basename)
- {
--  gint key_len = strlen (key);
--  gint i;
-+  gsize key_len = strlen (key);
-+  const gchar *last_slash;
- 
-   if (key_len < kfsb->prefix_len ||
-       memcmp (key, kfsb->prefix, kfsb->prefix_len) != 0)
-@@ -155,38 +156,36 @@ convert_path (GKeyfileSettingsBackend  *kfsb,
-   key_len -= kfsb->prefix_len;
-   key += kfsb->prefix_len;
- 
--  for (i = key_len; i >= 0; i--)
--    if (key[i] == '/')
--      break;
-+  last_slash = strrchr (key, '/');
- 
-   if (kfsb->root_group)
-     {
-       /* if a root_group was specified, make sure the user hasn't given
-        * a path that ghosts that group name
-        */
--      if (i == kfsb->root_group_len && memcmp (key, kfsb->root_group, i) == 0)
-+      if (last_slash != NULL && (last_slash - key) == kfsb->root_group_len && memcmp (key, kfsb->root_group, last_slash - key) == 0)
-         return FALSE;
-     }
-   else
-     {
-       /* if no root_group was given, ensure that the user gave a path */
--      if (i == -1)
-+      if (last_slash == NULL)
-         return FALSE;
-     }
- 
-   if (group)
-     {
--      if (i >= 0)
-+      if (last_slash != NULL)
-         {
--          *group = g_memdup (key, i + 1);
--          (*group)[i] = '\0';
-+          *group = g_memdup2 (key, (last_slash - key) + 1);
-+          (*group)[(last_slash - key)] = '\0';
-         }
-       else
-         *group = g_strdup (kfsb->root_group);
-     }
- 
-   if (basename)
--    *basename = g_memdup (key + i + 1, key_len - i);
-+    *basename = g_memdup2 (last_slash + 1, key_len - (last_slash - key));
- 
-   return TRUE;
- }
--- 
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-09.patch b/gnu/packages/patches/glib-CVE-2021-27219-09.patch
deleted file mode 100644
index 4de0c1b349..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-09.patch
+++ /dev/null
@@ -1,98 +0,0 @@
-From 65ec7f4d6e8832c481f6e00e2eb007b9a60024ce Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Thu, 4 Feb 2021 14:00:53 +0000
-Subject: [PATCH 09/11] gsocket: Use gsize to track native sockaddr's size
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Don’t use an `int`, that’s potentially too small. In practical terms,
-this is not a problem, since no socket address is going to be that big.
-
-By making these changes we can use `g_memdup2()` without warnings,
-though. Fewer warnings is good.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
-Helps: #2319
----
- gio/gsocket.c | 16 ++++++++++------
- 1 file changed, 10 insertions(+), 6 deletions(-)
-
-diff --git a/gio/gsocket.c b/gio/gsocket.c
-index 66073af83..a3af149e8 100644
---- a/gio/gsocket.c
-+++ b/gio/gsocket.c
-@@ -75,6 +75,7 @@
- #include "gcredentialsprivate.h"
- #include "glibintl.h"
- #include "gioprivate.h"
-+#include "gstrfuncsprivate.h"
- 
- #ifdef G_OS_WIN32
- /* For Windows XP runtime compatibility, but use the system's if_nametoindex() if available */
-@@ -174,7 +175,7 @@ static gboolean     g_socket_datagram_based_condition_wait       (GDatagramBased
-                                                                   GError          **error);
- 
- static GSocketAddress *
--cache_recv_address (GSocket *socket, struct sockaddr *native, int native_len);
-+cache_recv_address (GSocket *socket, struct sockaddr *native, size_t native_len);
- 
- static gssize
- g_socket_receive_message_with_timeout  (GSocket                 *socket,
-@@ -260,7 +261,7 @@ struct _GSocketPrivate
-   struct {
-     GSocketAddress *addr;
-     struct sockaddr *native;
--    gint native_len;
-+    gsize native_len;
-     guint64 last_used;
-   } recv_addr_cache[RECV_ADDR_CACHE_SIZE];
- };
-@@ -5211,14 +5212,14 @@ g_socket_send_messages_with_timeout (GSocket        *socket,
- }
- 
- static GSocketAddress *
--cache_recv_address (GSocket *socket, struct sockaddr *native, int native_len)
-+cache_recv_address (GSocket *socket, struct sockaddr *native, size_t native_len)
- {
-   GSocketAddress *saddr;
-   gint i;
-   guint64 oldest_time = G_MAXUINT64;
-   gint oldest_index = 0;
- 
--  if (native_len <= 0)
-+  if (native_len == 0)
-     return NULL;
- 
-   saddr = NULL;
-@@ -5226,7 +5227,7 @@ cache_recv_address (GSocket *socket, struct sockaddr *native, int native_len)
-     {
-       GSocketAddress *tmp = socket->priv->recv_addr_cache[i].addr;
-       gpointer tmp_native = socket->priv->recv_addr_cache[i].native;
--      gint tmp_native_len = socket->priv->recv_addr_cache[i].native_len;
-+      gsize tmp_native_len = socket->priv->recv_addr_cache[i].native_len;
- 
-       if (!tmp)
-         continue;
-@@ -5256,7 +5257,7 @@ cache_recv_address (GSocket *socket, struct sockaddr *native, int native_len)
-       g_free (socket->priv->recv_addr_cache[oldest_index].native);
-     }
- 
--  socket->priv->recv_addr_cache[oldest_index].native = g_memdup (native, native_len);
-+  socket->priv->recv_addr_cache[oldest_index].native = g_memdup2 (native, native_len);
-   socket->priv->recv_addr_cache[oldest_index].native_len = native_len;
-   socket->priv->recv_addr_cache[oldest_index].addr = g_object_ref (saddr);
-   socket->priv->recv_addr_cache[oldest_index].last_used = g_get_monotonic_time ();
-@@ -5404,6 +5405,9 @@ g_socket_receive_message_with_timeout (GSocket                 *socket,
-     /* do it */
-     while (1)
-       {
-+        /* addrlen has to be of type int because that’s how WSARecvFrom() is defined */
-+        G_STATIC_ASSERT (sizeof addr <= G_MAXINT);
-+
- 	addrlen = sizeof addr;
- 	if (address)
- 	  result = WSARecvFrom (socket->priv->fd,
--- 
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-10.patch b/gnu/packages/patches/glib-CVE-2021-27219-10.patch
deleted file mode 100644
index 36198b8eef..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-10.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From 777b95a88f006d39d9fe6d3321db17e7b0d4b9a4 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Thu, 4 Feb 2021 14:07:39 +0000
-Subject: [PATCH 10/11] gtlspassword: Forbid very long TLS passwords
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The public API `g_tls_password_set_value_full()` (and the vfunc it
-invokes) can only accept a `gssize` length. Ensure that nul-terminated
-strings passed to `g_tls_password_set_value()` can’t exceed that length.
-Use `g_memdup2()` to avoid an overflow if they’re longer than
-`G_MAXUINT` similarly.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
-Helps: #2319
----
- gio/gtlspassword.c | 10 ++++++++--
- 1 file changed, 8 insertions(+), 2 deletions(-)
-
-diff --git a/gio/gtlspassword.c b/gio/gtlspassword.c
-index 1e437a7b6..dbcec41a8 100644
---- a/gio/gtlspassword.c
-+++ b/gio/gtlspassword.c
-@@ -23,6 +23,7 @@
- #include "glibintl.h"
- 
- #include "gioenumtypes.h"
-+#include "gstrfuncsprivate.h"
- #include "gtlspassword.h"
- 
- #include <string.h>
-@@ -287,9 +288,14 @@ g_tls_password_set_value (GTlsPassword  *password,
-   g_return_if_fail (G_IS_TLS_PASSWORD (password));
- 
-   if (length < 0)
--    length = strlen ((gchar *)value);
-+    {
-+      /* FIXME: g_tls_password_set_value_full() doesn’t support unsigned gsize */
-+      gsize length_unsigned = strlen ((gchar *) value);
-+      g_return_if_fail (length_unsigned > G_MAXSSIZE);
-+      length = (gssize) length_unsigned;
-+    }
- 
--  g_tls_password_set_value_full (password, g_memdup (value, length), length, g_free);
-+  g_tls_password_set_value_full (password, g_memdup2 (value, (gsize) length), length, g_free);
- }
- 
- /**
--- 
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-11.patch b/gnu/packages/patches/glib-CVE-2021-27219-11.patch
deleted file mode 100644
index 4413cb9827..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-11.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From ecdf91400e9a538695a0895b95ad7e8abcdf1749 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Thu, 4 Feb 2021 14:09:40 +0000
-Subject: [PATCH 11/11] giochannel: Forbid very long line terminator strings
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The public API `GIOChannel.line_term_len` is only a `guint`. Ensure that
-nul-terminated strings passed to `g_io_channel_set_line_term()` can’t
-exceed that length. Use `g_memdup2()` to avoid a warning (`g_memdup()`
-is due to be deprecated), but not to avoid a bug, since it’s also
-limited to `G_MAXUINT`.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
-Helps: #2319
----
- glib/giochannel.c | 17 +++++++++++++----
- 1 file changed, 13 insertions(+), 4 deletions(-)
-
-diff --git a/glib/giochannel.c b/glib/giochannel.c
-index 15927c391..66c6591f0 100644
---- a/glib/giochannel.c
-+++ b/glib/giochannel.c
-@@ -884,16 +884,25 @@ g_io_channel_set_line_term (GIOChannel	*channel,
-                             const gchar	*line_term,
- 			    gint         length)
- {
-+  guint length_unsigned;
-+
-   g_return_if_fail (channel != NULL);
-   g_return_if_fail (line_term == NULL || length != 0); /* Disallow "" */
- 
-   if (line_term == NULL)
--    length = 0;
--  else if (length < 0)
--    length = strlen (line_term);
-+    length_unsigned = 0;
-+  else if (length >= 0)
-+    length_unsigned = (guint) length;
-+  else
-+    {
-+      /* FIXME: We’re constrained by line_term_len being a guint here */
-+      gsize length_size = strlen (line_term);
-+      g_return_if_fail (length_size > G_MAXUINT);
-+      length_unsigned = (guint) length_size;
-+    }
- 
-   g_free (channel->line_term);
--  channel->line_term = line_term ? g_memdup2 (line_term, length) : NULL;
-+  channel->line_term = line_term ? g_memdup2 (line_term, length_unsigned) : NULL;
-   channel->line_term_len = length;
- }
- 
--- 
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-12.patch b/gnu/packages/patches/glib-CVE-2021-27219-12.patch
deleted file mode 100644
index 4fdbb81750..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-12.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From f8273b9aded135fe07094faebd527e43851aaf6e Mon Sep 17 00:00:00 2001
-From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
-Date: Sun, 7 Feb 2021 23:32:40 +0100
-Subject: [PATCH 1/5] giochannel: Fix length_size bounds check
-
-The inverted condition is an obvious error introduced by ecdf91400e9a.
-
-Fixes https://gitlab.gnome.org/GNOME/glib/-/issues/2323
-
-(cherry picked from commit a149bf2f9030168051942124536e303af8ba6176)
----
- glib/giochannel.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/glib/giochannel.c b/glib/giochannel.c
-index 66c6591f0..0d9d5f223 100644
---- a/glib/giochannel.c
-+++ b/glib/giochannel.c
-@@ -897,7 +897,7 @@ g_io_channel_set_line_term (GIOChannel	*channel,
-     {
-       /* FIXME: We’re constrained by line_term_len being a guint here */
-       gsize length_size = strlen (line_term);
--      g_return_if_fail (length_size > G_MAXUINT);
-+      g_return_if_fail (length_size <= G_MAXUINT);
-       length_unsigned = (guint) length_size;
-     }
- 
--- 
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-13.patch b/gnu/packages/patches/glib-CVE-2021-27219-13.patch
deleted file mode 100644
index 6a287cc3a2..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-13.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From e069c50467712e6d607822afd6b6c15c2c343dff Mon Sep 17 00:00:00 2001
-From: Simon McVittie <smcv@collabora.com>
-Date: Mon, 8 Feb 2021 10:34:50 +0000
-Subject: [PATCH 2/5] giochannel: Don't store negative line_term_len in
- GIOChannel struct
-
-Adding test coverage indicated that this was another bug in 0cc11f74.
-
-Fixes: 0cc11f74 "giochannel: Forbid very long line terminator strings"
-Resolves: https://gitlab.gnome.org/GNOME/glib/-/issues/2323
-Signed-off-by: Simon McVittie <smcv@collabora.com>
-(cherry picked from commit 5dc8b0014c03e7491d93b90275ab442e888a9628)
----
- glib/giochannel.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/glib/giochannel.c b/glib/giochannel.c
-index 0d9d5f223..4c39b9dc0 100644
---- a/glib/giochannel.c
-+++ b/glib/giochannel.c
-@@ -903,7 +903,7 @@ g_io_channel_set_line_term (GIOChannel	*channel,
- 
-   g_free (channel->line_term);
-   channel->line_term = line_term ? g_memdup2 (line_term, length_unsigned) : NULL;
--  channel->line_term_len = length;
-+  channel->line_term_len = length_unsigned;
- }
- 
- /**
--- 
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-14.patch b/gnu/packages/patches/glib-CVE-2021-27219-14.patch
deleted file mode 100644
index 78de2846da..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-14.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 4506d1859a863087598c8d122740bae25b65b099 Mon Sep 17 00:00:00 2001
-From: Simon McVittie <smcv@collabora.com>
-Date: Mon, 8 Feb 2021 10:04:48 +0000
-Subject: [PATCH 4/5] gtlspassword: Fix inverted assertion
-
-The intention here was to assert that the length of the password fits
-in a gssize. Passwords more than half the size of virtual memory are
-probably excessive.
-
-Fixes: a8b204ff "gtlspassword: Forbid very long TLS passwords"
-Signed-off-by: Simon McVittie <smcv@collabora.com>
-(cherry picked from commit 61bb52ec42de1082bfb06ce1c737fc295bfe60b8)
----
- gio/gtlspassword.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/gio/gtlspassword.c b/gio/gtlspassword.c
-index dbcec41a8..bd86a6dfe 100644
---- a/gio/gtlspassword.c
-+++ b/gio/gtlspassword.c
-@@ -291,7 +291,7 @@ g_tls_password_set_value (GTlsPassword  *password,
-     {
-       /* FIXME: g_tls_password_set_value_full() doesn’t support unsigned gsize */
-       gsize length_unsigned = strlen ((gchar *) value);
--      g_return_if_fail (length_unsigned > G_MAXSSIZE);
-+      g_return_if_fail (length_unsigned <= G_MAXSSIZE);
-       length = (gssize) length_unsigned;
-     }
- 
--- 
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-15.patch b/gnu/packages/patches/glib-CVE-2021-27219-15.patch
deleted file mode 100644
index 37ef85b4fa..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-15.patch
+++ /dev/null
@@ -1,95 +0,0 @@
-From 3d1550354c3c6a8491c39881752d51cb7515f2c2 Mon Sep 17 00:00:00 2001
-From: Simon McVittie <smcv@collabora.com>
-Date: Mon, 8 Feb 2021 10:22:39 +0000
-Subject: [PATCH 5/5] tls-interaction: Add test coverage for various ways to
- set the password
-
-Signed-off-by: Simon McVittie <smcv@collabora.com>
-(cherry picked from commit df4501316ca3903072400504a5ea76498db19538)
----
- gio/tests/tls-interaction.c | 55 +++++++++++++++++++++++++++++++++++++
- 1 file changed, 55 insertions(+)
-
-diff --git a/gio/tests/tls-interaction.c b/gio/tests/tls-interaction.c
-index 4f0737d7e..5661e8e0d 100644
---- a/gio/tests/tls-interaction.c
-+++ b/gio/tests/tls-interaction.c
-@@ -174,6 +174,38 @@ test_interaction_ask_password_finish_failure (GTlsInteraction    *interaction,
- }
- 
- 
-+/* Return a copy of @str that is allocated in a silly way, to exercise
-+ * custom free-functions. The returned pointer points to a copy of @str
-+ * in a buffer of the form "BEFORE \0 str \0 AFTER". */
-+static guchar *
-+special_dup (const char *str)
-+{
-+  GString *buf = g_string_new ("BEFORE");
-+  guchar *ret;
-+
-+  g_string_append_c (buf, '\0');
-+  g_string_append (buf, str);
-+  g_string_append_c (buf, '\0');
-+  g_string_append (buf, "AFTER");
-+  ret = (guchar *) g_string_free (buf, FALSE);
-+  return ret + strlen ("BEFORE") + 1;
-+}
-+
-+
-+/* Free a copy of @str that was made with special_dup(), after asserting
-+ * that it has not been corrupted. */
-+static void
-+special_free (gpointer p)
-+{
-+  gchar *s = p;
-+  gchar *buf = s - strlen ("BEFORE") - 1;
-+
-+  g_assert_cmpstr (buf, ==, "BEFORE");
-+  g_assert_cmpstr (s + strlen (s) + 1, ==, "AFTER");
-+  g_free (buf);
-+}
-+
-+
- static GTlsInteractionResult
- test_interaction_ask_password_sync_success (GTlsInteraction    *interaction,
-                                             GTlsPassword       *password,
-@@ -181,6 +213,8 @@ test_interaction_ask_password_sync_success (GTlsInteraction    *interaction,
-                                             GError            **error)
- {
-   TestInteraction *self;
-+  const guchar *value;
-+  gsize len;
- 
-   g_assert (TEST_IS_INTERACTION (interaction));
-   self = TEST_INTERACTION (interaction);
-@@ -192,6 +226,27 @@ test_interaction_ask_password_sync_success (GTlsInteraction    *interaction,
-   g_assert (error != NULL);
-   g_assert (*error == NULL);
- 
-+  /* Exercise different ways to set the value */
-+  g_tls_password_set_value (password, (const guchar *) "foo", 4);
-+  len = 0;
-+  value = g_tls_password_get_value (password, &len);
-+  g_assert_cmpmem (value, len, "foo", 4);
-+
-+  g_tls_password_set_value (password, (const guchar *) "bar", -1);
-+  len = 0;
-+  value = g_tls_password_get_value (password, &len);
-+  g_assert_cmpmem (value, len, "bar", 3);
-+
-+  g_tls_password_set_value_full (password, special_dup ("baa"), 4, special_free);
-+  len = 0;
-+  value = g_tls_password_get_value (password, &len);
-+  g_assert_cmpmem (value, len, "baa", 4);
-+
-+  g_tls_password_set_value_full (password, special_dup ("baz"), -1, special_free);
-+  len = 0;
-+  value = g_tls_password_get_value (password, &len);
-+  g_assert_cmpmem (value, len, "baz", 3);
-+
-   /* Don't do this in real life. Include a null terminator for testing */
-   g_tls_password_set_value (password, (const guchar *)"the password", 13);
-   return G_TLS_INTERACTION_HANDLED;
--- 
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-16.patch b/gnu/packages/patches/glib-CVE-2021-27219-16.patch
deleted file mode 100644
index 43635e72ed..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-16.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From cb9ee701ef46c1819eed4e2a4dc181682bdfc176 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Wed, 10 Feb 2021 21:16:39 +0000
-Subject: [PATCH 1/3] gkeyfilesettingsbackend: Fix basename handling when group
- is unset
-
-Fix an effective regression in commit
-7781a9cbd2fd0aa84bee0f4eee88470640ff6706, which happens when
-`convert_path()` is called with a `key` which contains no slashes. In
-that case, the `key` is entirely the `basename`.
-
-Prior to commit 7781a9cb, the code worked through a fluke of `i == -1`
-cancelling out with the various additions in the `g_memdup()` call, and
-effectively resulting in `g_strdup (key)`.
-
-Spotted by Guido Berhoerster.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
----
- gio/gkeyfilesettingsbackend.c | 7 ++++++-
- 1 file changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/gio/gkeyfilesettingsbackend.c b/gio/gkeyfilesettingsbackend.c
-index 25b057672..861c3a661 100644
---- a/gio/gkeyfilesettingsbackend.c
-+++ b/gio/gkeyfilesettingsbackend.c
-@@ -185,7 +185,12 @@ convert_path (GKeyfileSettingsBackend  *kfsb,
-     }
- 
-   if (basename)
--    *basename = g_memdup2 (last_slash + 1, key_len - (last_slash - key));
-+    {
-+      if (last_slash != NULL)
-+        *basename = g_memdup2 (last_slash + 1, key_len - (last_slash - key));
-+      else
-+        *basename = g_strdup (key);
-+    }
- 
-   return TRUE;
- }
--- 
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-17.patch b/gnu/packages/patches/glib-CVE-2021-27219-17.patch
deleted file mode 100644
index 3153979071..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-17.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From 31e0d403ba635dbbacbfbff74295e5db02558d76 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Wed, 10 Feb 2021 21:19:30 +0000
-Subject: [PATCH 2/3] gkeyfilesettingsbackend: Disallow empty key or group
- names
-
-These should never have been allowed; they will result in precondition
-failures from the `GKeyFile` later on in the code.
-
-A test will be added for this shortly.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
----
- gio/gkeyfilesettingsbackend.c | 7 +++++++
- 1 file changed, 7 insertions(+)
-
-diff --git a/gio/gkeyfilesettingsbackend.c b/gio/gkeyfilesettingsbackend.c
-index 861c3a661..de216e615 100644
---- a/gio/gkeyfilesettingsbackend.c
-+++ b/gio/gkeyfilesettingsbackend.c
-@@ -158,6 +158,13 @@ convert_path (GKeyfileSettingsBackend  *kfsb,
- 
-   last_slash = strrchr (key, '/');
- 
-+  /* Disallow empty group names or key names */
-+  if (key_len == 0 ||
-+      (last_slash != NULL &&
-+       (*(last_slash + 1) == '\0' ||
-+        last_slash == key)))
-+    return FALSE;
-+
-   if (kfsb->root_group)
-     {
-       /* if a root_group was specified, make sure the user hasn't given
--- 
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-18.patch b/gnu/packages/patches/glib-CVE-2021-27219-18.patch
deleted file mode 100644
index c18d44ddeb..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-18.patch
+++ /dev/null
@@ -1,232 +0,0 @@
-Backport of:
-
-From 221c26685354dea2b2732df94404e8e5e77a1591 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Wed, 10 Feb 2021 21:21:36 +0000
-Subject: [PATCH 3/3] tests: Add tests for key name handling in the keyfile
- backend
-
-This tests the two recent commits.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
----
- gio/tests/gsettings.c | 171 +++++++++++++++++++++++++++++++++++++++++-
- 1 file changed, 170 insertions(+), 1 deletion(-)
-
-diff --git a/gio/tests/gsettings.c b/gio/tests/gsettings.c
-index baadca8f5..afe594a23 100644
---- a/gio/tests/gsettings.c
-+++ b/gio/tests/gsettings.c
-@@ -1,3 +1,4 @@
-+#include <errno.h>
- #include <stdlib.h>
- #include <locale.h>
- #include <libintl.h>
-@@ -1740,6 +1741,14 @@ key_changed_cb (GSettings *settings, const gchar *key, gpointer data)
-   (*b) = TRUE;
- }
- 
-+typedef struct
-+{
-+  const gchar *path;
-+  const gchar *root_group;
-+  const gchar *keyfile_group;
-+  const gchar *root_path;
-+} KeyfileTestData;
-+
- /*
-  * Test that using a keyfile works
-  */
-@@ -1834,7 +1843,11 @@ test_keyfile (Fixture       *fixture,
-   g_free (str);
- 
-   g_settings_set (settings, "farewell", "s", "cheerio");
--  
-+
-+  /* Check that empty keys/groups are not allowed. */
-+  g_assert_false (g_settings_is_writable (settings, ""));
-+  g_assert_false (g_settings_is_writable (settings, "/"));
-+
-   /* When executing as root, changing the mode of the keyfile will have
-    * no effect on the writability of the settings.
-    */
-@@ -1866,6 +1879,149 @@ test_keyfile (Fixture       *fixture,
-   g_free (keyfile_path);
- }
- 
-+/*
-+ * Test that using a keyfile works with a schema with no path set.
-+ */
-+static void
-+test_keyfile_no_path (Fixture       *fixture,
-+                      gconstpointer  user_data)
-+{
-+  const KeyfileTestData *test_data = user_data;
-+  GSettingsBackend *kf_backend;
-+  GSettings *settings;
-+  GKeyFile *keyfile;
-+  gboolean writable;
-+  gchar *key = NULL;
-+  GError *error = NULL;
-+  gchar *keyfile_path = NULL, *store_path = NULL;
-+
-+  keyfile_path = g_build_filename (fixture->tmp_dir, "keyfile", NULL);
-+  store_path = g_build_filename (keyfile_path, "gsettings.store", NULL);
-+  kf_backend = g_keyfile_settings_backend_new (store_path, test_data->root_path, test_data->root_group);
-+  settings = g_settings_new_with_backend_and_path ("org.gtk.test.no-path", kf_backend, test_data->path);
-+  g_object_unref (kf_backend);
-+
-+  g_settings_reset (settings, "test-boolean");
-+  g_assert_true (g_settings_get_boolean (settings, "test-boolean"));
-+
-+  writable = g_settings_is_writable (settings, "test-boolean");
-+  g_assert_true (writable);
-+  g_settings_set (settings, "test-boolean", "b", FALSE);
-+
-+  g_assert_false (g_settings_get_boolean (settings, "test-boolean"));
-+
-+  g_settings_delay (settings);
-+  g_settings_set (settings, "test-boolean", "b", TRUE);
-+  g_settings_apply (settings);
-+
-+  keyfile = g_key_file_new ();
-+  g_assert_true (g_key_file_load_from_file (keyfile, store_path, 0, NULL));
-+
-+  g_assert_true (g_key_file_get_boolean (keyfile, test_data->keyfile_group, "test-boolean", NULL));
-+
-+  g_key_file_free (keyfile);
-+
-+  g_settings_reset (settings, "test-boolean");
-+  g_settings_apply (settings);
-+  keyfile = g_key_file_new ();
-+  g_assert_true (g_key_file_load_from_file (keyfile, store_path, 0, NULL));
-+
-+  g_assert_false (g_key_file_get_string (keyfile, test_data->keyfile_group, "test-boolean", &error));
-+  g_assert_error (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_KEY_NOT_FOUND);
-+  g_clear_error (&error);
-+
-+  /* Check that empty keys/groups are not allowed. */
-+  g_assert_false (g_settings_is_writable (settings, ""));
-+  g_assert_false (g_settings_is_writable (settings, "/"));
-+
-+  /* Keys which ghost the root group name are not allowed. This can only be
-+   * tested when the path is `/` as otherwise it acts as a prefix and prevents
-+   * any ghosting. */
-+  if (g_str_equal (test_data->path, "/"))
-+    {
-+      key = g_strdup_printf ("%s/%s", test_data->root_group, "");
-+      g_assert_false (g_settings_is_writable (settings, key));
-+      g_free (key);
-+
-+      key = g_strdup_printf ("%s/%s", test_data->root_group, "/");
-+      g_assert_false (g_settings_is_writable (settings, key));
-+      g_free (key);
-+
-+      key = g_strdup_printf ("%s/%s", test_data->root_group, "test-boolean");
-+      g_assert_false (g_settings_is_writable (settings, key));
-+      g_free (key);
-+    }
-+
-+  g_key_file_free (keyfile);
-+  g_object_unref (settings);
-+
-+  /* Clean up the temporary directory. */
-+  g_assert_cmpint (g_chmod (keyfile_path, 0777) == 0 ? 0 : errno, ==, 0);
-+  g_assert_cmpint (g_remove (store_path) == 0 ? 0 : errno, ==, 0);
-+  g_assert_cmpint (g_rmdir (keyfile_path) == 0 ? 0 : errno, ==, 0);
-+  g_free (store_path);
-+  g_free (keyfile_path);
-+}
-+
-+/*
-+ * Test that a keyfile rejects writes to keys outside its root path.
-+ */
-+static void
-+test_keyfile_outside_root_path (Fixture       *fixture,
-+                                gconstpointer  user_data)
-+{
-+  GSettingsBackend *kf_backend;
-+  GSettings *settings;
-+  gchar *keyfile_path = NULL, *store_path = NULL;
-+
-+  keyfile_path = g_build_filename (fixture->tmp_dir, "keyfile", NULL);
-+  store_path = g_build_filename (keyfile_path, "gsettings.store", NULL);
-+  kf_backend = g_keyfile_settings_backend_new (store_path, "/tests/basic-types/", "root");
-+  settings = g_settings_new_with_backend_and_path ("org.gtk.test.no-path", kf_backend, "/tests/");
-+  g_object_unref (kf_backend);
-+
-+  g_assert_false (g_settings_is_writable (settings, "test-boolean"));
-+
-+  g_object_unref (settings);
-+
-+  /* Clean up the temporary directory. The keyfile probably doesn’t exist, so
-+   * don’t error on failure. */
-+  g_remove (store_path);
-+  g_assert_cmpint (g_rmdir (keyfile_path) == 0 ? 0 : errno, ==, 0);
-+  g_free (store_path);
-+  g_free (keyfile_path);
-+}
-+
-+/*
-+ * Test that a keyfile rejects writes to keys in the root if no root group is set.
-+ */
-+static void
-+test_keyfile_no_root_group (Fixture       *fixture,
-+                            gconstpointer  user_data)
-+{
-+  GSettingsBackend *kf_backend;
-+  GSettings *settings;
-+  gchar *keyfile_path = NULL, *store_path = NULL;
-+
-+  keyfile_path = g_build_filename (fixture->tmp_dir, "keyfile", NULL);
-+  store_path = g_build_filename (keyfile_path, "gsettings.store", NULL);
-+  kf_backend = g_keyfile_settings_backend_new (store_path, "/", NULL);
-+  settings = g_settings_new_with_backend_and_path ("org.gtk.test.no-path", kf_backend, "/");
-+  g_object_unref (kf_backend);
-+
-+  g_assert_false (g_settings_is_writable (settings, "test-boolean"));
-+  g_assert_true (g_settings_is_writable (settings, "child/test-boolean"));
-+
-+  g_object_unref (settings);
-+
-+  /* Clean up the temporary directory. The keyfile probably doesn’t exist, so
-+   * don’t error on failure. */
-+  g_remove (store_path);
-+  g_assert_cmpint (g_rmdir (keyfile_path) == 0 ? 0 : errno, ==, 0);
-+  g_free (store_path);
-+  g_free (keyfile_path);
-+}
-+
- /* Test that getting child schemas works
-  */
- static void
-@@ -2844,6 +3000,14 @@ main (int argc, char *argv[])
-   gchar *override_text;
-   gchar *enums;
-   gint result;
-+  const KeyfileTestData keyfile_test_data_explicit_path = { "/tests/", "root", "tests", "/" };
-+  const KeyfileTestData keyfile_test_data_empty_path = { "/", "root", "root", "/" };
-+  const KeyfileTestData keyfile_test_data_long_path = {
-+    "/tests/path/is/very/long/and/this/makes/some/comparisons/take/a/different/branch/",
-+    "root",
-+    "tests/path/is/very/long/and/this/makes/some/comparisons/take/a/different/branch",
-+    "/"
-+  };
- 
- /* Meson build sets this */
- #ifdef TEST_LOCALE_PATH
-@@ -2967,6 +3131,11 @@ main (int argc, char *argv[])
-     }
- 
-   g_test_add ("/gsettings/keyfile", Fixture, NULL, setup, test_keyfile, teardown);
-+  g_test_add ("/gsettings/keyfile/explicit-path", Fixture, &keyfile_test_data_explicit_path, setup, test_keyfile_no_path, teardown);
-+  g_test_add ("/gsettings/keyfile/empty-path", Fixture, &keyfile_test_data_empty_path, setup, test_keyfile_no_path, teardown);
-+  g_test_add ("/gsettings/keyfile/long-path", Fixture, &keyfile_test_data_long_path, setup, test_keyfile_no_path, teardown);
-+  g_test_add ("/gsettings/keyfile/outside-root-path", Fixture, NULL, setup, test_keyfile_outside_root_path, teardown);
-+  g_test_add ("/gsettings/keyfile/no-root-group", Fixture, NULL, setup, test_keyfile_no_root_group, teardown);
-   g_test_add_func ("/gsettings/child-schema", test_child_schema);
-   g_test_add_func ("/gsettings/strinfo", test_strinfo);
-   g_test_add_func ("/gsettings/enums", test_enums);
--- 
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-28153.patch b/gnu/packages/patches/glib-CVE-2021-28153.patch
deleted file mode 100644
index 54443186d9..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-28153.patch
+++ /dev/null
@@ -1,283 +0,0 @@
-Backport of:
-
-From 317b3b587058a05dca95d56dac26568c5b098d33 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Wed, 24 Feb 2021 17:35:40 +0000
-Subject: [PATCH] glocalfileoutputstream: Fix CREATE_REPLACE_DESTINATION
- with symlinks
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The `G_FILE_CREATE_REPLACE_DESTINATION` flag is equivalent to unlinking
-the destination file and re-creating it from scratch. That did
-previously work, but in the process the code would call `open(O_CREAT)`
-on the file. If the file was a dangling symlink, this would create the
-destination file (empty). That’s not an intended side-effect, and has
-security implications if the symlink is controlled by a lower-privileged
-process.
-
-Fix that by not opening the destination file if it’s a symlink, and
-adjusting the rest of the code to cope with
- - the fact that `fd == -1` is not an error iff `is_symlink` is true,
- - and that `original_stat` will contain the `lstat()` results for the
-   symlink now, rather than the `stat()` results for its target (again,
-   iff `is_symlink` is true).
-
-This means that the target of the dangling symlink is no longer created,
-which was the bug. The symlink itself continues to be replaced (as
-before) with the new file — this is the intended behaviour of
-`g_file_replace()`.
-
-The behaviour for non-symlink cases, or cases where the symlink was not
-dangling, should be unchanged.
-
-Includes a unit test.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
-
-Fixes: #2325
----
- gio/glocalfileoutputstream.c |  70 ++++++++++++++++-------
- gio/tests/file.c             | 108 +++++++++++++++++++++++++++++++++++
- 2 files changed, 158 insertions(+), 20 deletions(-)
-
-diff --git a/gio/glocalfileoutputstream.c b/gio/glocalfileoutputstream.c
-index a3dd62172..553fcbbae 100644
---- a/gio/glocalfileoutputstream.c
-+++ b/gio/glocalfileoutputstream.c
-@@ -874,16 +874,22 @@ handle_overwrite_open (const char    *filename,
-       /* Could be a symlink, or it could be a regular ELOOP error,
-        * but then the next open will fail too. */
-       is_symlink = TRUE;
--      fd = g_open (filename, open_flags, mode);
-+      if (!(flags & G_FILE_CREATE_REPLACE_DESTINATION))
-+        fd = g_open (filename, open_flags, mode);
-     }
--#else
--  fd = g_open (filename, open_flags, mode);
--  errsv = errno;
-+#else  /* if !O_NOFOLLOW */
-   /* This is racy, but we do it as soon as possible to minimize the race */
-   is_symlink = g_file_test (filename, G_FILE_TEST_IS_SYMLINK);
-+
-+  if (!is_symlink || !(flags & G_FILE_CREATE_REPLACE_DESTINATION))
-+    {
-+      fd = g_open (filename, open_flags, mode);
-+      errsv = errno;
-+    }
- #endif
- 
--  if (fd == -1)
-+  if (fd == -1 &&
-+      (!is_symlink || !(flags & G_FILE_CREATE_REPLACE_DESTINATION)))
-     {
-       char *display_name = g_filename_display_name (filename);
-       g_set_error (error, G_IO_ERROR,
-@@ -893,13 +899,25 @@ handle_overwrite_open (const char    *filename,
-       g_free (display_name);
-       return -1;
-     }
--  
-+
-+  if (!is_symlink)
-+    {
- #ifdef G_OS_WIN32
--  res = GLIB_PRIVATE_CALL (g_win32_fstat) (fd, &original_stat);
-+      res = GLIB_PRIVATE_CALL (g_win32_fstat) (fd, &original_stat);
- #else
--  res = fstat (fd, &original_stat);
-+      res = fstat (fd, &original_stat);
- #endif
--  errsv = errno;
-+      errsv = errno;
-+    }
-+  else
-+    {
-+#ifdef G_OS_WIN32
-+      res = GLIB_PRIVATE_CALL (g_win32_lstat_utf8) (filename, &original_stat);
-+#else
-+      res = g_lstat (filename, &original_stat);
-+#endif
-+      errsv = errno;
-+    }
- 
-   if (res != 0)
-     {
-@@ -916,16 +934,27 @@ handle_overwrite_open (const char    *filename,
-   if (!S_ISREG (original_stat.st_mode))
-     {
-       if (S_ISDIR (original_stat.st_mode))
--	g_set_error_literal (error,
--                             G_IO_ERROR,
--                             G_IO_ERROR_IS_DIRECTORY,
--                             _("Target file is a directory"));
--      else
--	g_set_error_literal (error,
--                             G_IO_ERROR,
--                             G_IO_ERROR_NOT_REGULAR_FILE,
--                             _("Target file is not a regular file"));
--      goto err_out;
-+        {
-+          g_set_error_literal (error,
-+                               G_IO_ERROR,
-+                               G_IO_ERROR_IS_DIRECTORY,
-+                               _("Target file is a directory"));
-+          goto err_out;
-+        }
-+      else if (!is_symlink ||
-+#ifdef S_ISLNK
-+               !S_ISLNK (original_stat.st_mode)
-+#else
-+               FALSE
-+#endif
-+               )
-+        {
-+          g_set_error_literal (error,
-+                               G_IO_ERROR,
-+                               G_IO_ERROR_NOT_REGULAR_FILE,
-+                               _("Target file is not a regular file"));
-+          goto err_out;
-+        }
-     }
-   
-   if (etag != NULL)
-@@ -1006,7 +1035,8 @@ handle_overwrite_open (const char    *filename,
- 	    }
- 	}
- 
--      g_close (fd, NULL);
-+      if (fd >= 0)
-+        g_close (fd, NULL);
-       *temp_filename = tmp_filename;
-       return tmpfd;
-     }
-diff --git a/gio/tests/file.c b/gio/tests/file.c
-index efb2eaadd..bc55f3af4 100644
---- a/gio/tests/file.c
-+++ b/gio/tests/file.c
-@@ -804,6 +804,113 @@ test_replace_cancel (void)
-   g_object_unref (tmpdir);
- }
- 
-+static void
-+test_replace_symlink (void)
-+{
-+#ifdef G_OS_UNIX
-+  gchar *tmpdir_path = NULL;
-+  GFile *tmpdir = NULL, *source_file = NULL, *target_file = NULL;
-+  GFileOutputStream *stream = NULL;
-+  const gchar *new_contents = "this is a test message which should be written to source and not target";
-+  gsize n_written;
-+  GFileEnumerator *enumerator = NULL;
-+  GFileInfo *info = NULL;
-+  gchar *contents = NULL;
-+  gsize length = 0;
-+  GError *local_error = NULL;
-+
-+  g_test_bug ("https://gitlab.gnome.org/GNOME/glib/-/issues/2325");
-+  g_test_summary ("Test that G_FILE_CREATE_REPLACE_DESTINATION doesn’t follow symlinks");
-+
-+  /* Create a fresh, empty working directory. */
-+  tmpdir_path = g_dir_make_tmp ("g_file_replace_symlink_XXXXXX", &local_error);
-+  g_assert_no_error (local_error);
-+  tmpdir = g_file_new_for_path (tmpdir_path);
-+
-+  g_test_message ("Using temporary directory %s", tmpdir_path);
-+  g_free (tmpdir_path);
-+
-+  /* Create symlink `source` which points to `target`. */
-+  source_file = g_file_get_child (tmpdir, "source");
-+  target_file = g_file_get_child (tmpdir, "target");
-+  g_file_make_symbolic_link (source_file, "target", NULL, &local_error);
-+  g_assert_no_error (local_error);
-+
-+  /* Ensure that `target` doesn’t exist */
-+  g_assert_false (g_file_query_exists (target_file, NULL));
-+
-+  /* Replace the `source` symlink with a regular file using
-+   * %G_FILE_CREATE_REPLACE_DESTINATION, which should replace it *without*
-+   * following the symlink */
-+  stream = g_file_replace (source_file, NULL, FALSE  /* no backup */,
-+                           G_FILE_CREATE_REPLACE_DESTINATION, NULL, &local_error);
-+  g_assert_no_error (local_error);
-+
-+  g_output_stream_write_all (G_OUTPUT_STREAM (stream), new_contents, strlen (new_contents),
-+                             &n_written, NULL, &local_error);
-+  g_assert_no_error (local_error);
-+  g_assert_cmpint (n_written, ==, strlen (new_contents));
-+
-+  g_output_stream_close (G_OUTPUT_STREAM (stream), NULL, &local_error);
-+  g_assert_no_error (local_error);
-+
-+  g_clear_object (&stream);
-+
-+  /* At this point, there should still only be one file: `source`. It should
-+   * now be a regular file. `target` should not exist. */
-+  enumerator = g_file_enumerate_children (tmpdir,
-+                                          G_FILE_ATTRIBUTE_STANDARD_NAME ","
-+                                          G_FILE_ATTRIBUTE_STANDARD_TYPE,
-+                                          G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, NULL, &local_error);
-+  g_assert_no_error (local_error);
-+
-+  info = g_file_enumerator_next_file (enumerator, NULL, &local_error);
-+  g_assert_no_error (local_error);
-+  g_assert_nonnull (info);
-+
-+  g_assert_cmpstr (g_file_info_get_name (info), ==, "source");
-+  g_assert_cmpint (g_file_info_get_file_type (info), ==, G_FILE_TYPE_REGULAR);
-+
-+  g_clear_object (&info);
-+
-+  info = g_file_enumerator_next_file (enumerator, NULL, &local_error);
-+  g_assert_no_error (local_error);
-+  g_assert_null (info);
-+
-+  g_file_enumerator_close (enumerator, NULL, &local_error);
-+  g_assert_no_error (local_error);
-+  g_clear_object (&enumerator);
-+
-+  /* Double-check that `target` doesn’t exist */
-+  g_assert_false (g_file_query_exists (target_file, NULL));
-+
-+  /* Check the content of `source`. */
-+  g_file_load_contents (source_file,
-+                        NULL,
-+                        &contents,
-+                        &length,
-+                        NULL,
-+                        &local_error);
-+  g_assert_no_error (local_error);
-+  g_assert_cmpstr (contents, ==, new_contents);
-+  g_assert_cmpuint (length, ==, strlen (new_contents));
-+  g_free (contents);
-+
-+  /* Tidy up. */
-+  g_file_delete (source_file, NULL, &local_error);
-+  g_assert_no_error (local_error);
-+
-+  g_file_delete (tmpdir, NULL, &local_error);
-+  g_assert_no_error (local_error);
-+
-+  g_clear_object (&target_file);
-+  g_clear_object (&source_file);
-+  g_clear_object (&tmpdir);
-+#else  /* if !G_OS_UNIX */
-+  g_test_skip ("Symlink replacement tests can only be run on Unix")
-+#endif
-+}
-+
- static void
- on_file_deleted (GObject      *object,
- 		 GAsyncResult *result,
-@@ -1754,6 +1861,7 @@ main (int argc, char *argv[])
-   g_test_add_data_func ("/file/async-create-delete/4096", GINT_TO_POINTER (4096), test_create_delete);
-   g_test_add_func ("/file/replace-load", test_replace_load);
-   g_test_add_func ("/file/replace-cancel", test_replace_cancel);
-+  g_test_add_func ("/file/replace-symlink", test_replace_symlink);
-   g_test_add_func ("/file/async-delete", test_async_delete);
- #ifdef G_OS_UNIX
-   g_test_add_func ("/file/copy-preserve-mode", test_copy_preserve_mode);
--- 
-2.30.1
-
diff --git a/gnu/packages/patches/glib-networking-32-bit-time.patch b/gnu/packages/patches/glib-networking-32-bit-time.patch
new file mode 100644
index 0000000000..a437310270
--- /dev/null
+++ b/gnu/packages/patches/glib-networking-32-bit-time.patch
@@ -0,0 +1,61 @@
+Work around a year-2038 issue when building with a 32-bit 'time_t'
+on 32-bit platforms:
+
+  https://gitlab.gnome.org/GNOME/glib-networking/-/issues/172
+
+From 4f8ca86a0e460794188c3355f0c7cc11fdbe4229 Mon Sep 17 00:00:00 2001
+From: Simon McVittie <simon.mcvittie@collabora.co.uk>
+Date: Tue, 21 Sep 2021 17:07:44 +0000
+Subject: [PATCH] tests: Accept GNUTLS' workaround for limited size of time_t
+
+---
+ tls/tests/certificate.c | 15 +++++++++++++++
+ tls/tests/meson.build   |  1 +
+ 2 files changed, 16 insertions(+)
+
+diff --git a/tls/tests/certificate.c b/tls/tests/certificate.c
+index c0100d30..d216c710 100644
+--- a/tls/tests/certificate.c
++++ b/tls/tests/certificate.c
+@@ -672,6 +672,12 @@ test_certificate_not_valid_before (void)
+   g_object_unref (cert);
+ }
+ 
++/* On 32-bit, GNUTLS caps expiry times at 2037-12-31 23:23:23 to avoid
++ * overflowing time_t. Hopefully by 2037, either 32-bit will finally have
++ * died out, or GNUTLS will rethink its approach to
++ * https://gitlab.com/gnutls/gnutls/-/issues/370 */
++#define GNUTLS_32_BIT_NOT_VALID_AFTER_MAX 2145914603
++
+ static void
+ test_certificate_not_valid_after (void)
+ {
+@@ -686,7 +692,16 @@ test_certificate_not_valid_after (void)
+   actual = g_tls_certificate_get_not_valid_after (cert);
+   g_assert_nonnull (actual);
+   actual_str = g_date_time_format_iso8601 (actual);
++
++#if SIZEOF_TIME_T <= 4
++  if (g_date_time_to_unix (actual) == GNUTLS_32_BIT_NOT_VALID_AFTER_MAX)
++    g_test_incomplete ("not-valid-after date not representable on 32-bit");
++  else
++    g_assert_cmpstr (actual_str, ==, EXPECTED_NOT_VALID_AFTER);
++#else
+   g_assert_cmpstr (actual_str, ==, EXPECTED_NOT_VALID_AFTER);
++#endif
++
+   g_free (actual_str);
+   g_date_time_unref (actual);
+   g_object_unref (cert);
+diff --git a/tls/tests/meson.build b/tls/tests/meson.build
+index e9c7d8c6..7415f913 100644
+--- a/tls/tests/meson.build
++++ b/tls/tests/meson.build
+@@ -69,6 +69,7 @@ foreach backend: backends
+     test_cflags = cflags + [
+       '-DBACKEND="@0@"'.format(backend),
+       '-DBACKEND_IS_' + backend.to_upper(),
++      '-DSIZEOF_TIME_T=@0@'.format(cc.sizeof('time_t', prefix: '#include <time.h>')),
+     ]
+ 
+     if backend == 'openssl'
diff --git a/gnu/packages/patches/glib-networking-gnutls-binding.patch b/gnu/packages/patches/glib-networking-gnutls-binding.patch
new file mode 100644
index 0000000000..91d0743056
--- /dev/null
+++ b/gnu/packages/patches/glib-networking-gnutls-binding.patch
@@ -0,0 +1,21 @@
+Skip failing test in 'test_connection_binding_match_tls_unique'
+in 'tls/tests/connection.c' when building glib-networking against
+GnuTLS 3.7.2.  The failure stems from the fact that
+'gnutls_session_channel_binding' returns GNUTLS_E_INVALID_REQUEST
+is known upstream:
+
+  https://gitlab.gnome.org/GNOME/glib-networking/-/issues/164
+
+diff --git a/tls/tests/connection.c b/tls/tests/connection.c
+index 036df04..347c7a4 100644
+--- a/tls/tests/connection.c
++++ b/tls/tests/connection.c
+@@ -3037,8 +3037,6 @@ main (int   argc,
+               setup_connection, test_connection_missing_server_identity, teardown_connection);
+   g_test_add ("/tls/" BACKEND "/connection/peer-certificate-notify", TestConnection, NULL,
+               setup_connection, test_peer_certificate_notify, teardown_connection);
+-  g_test_add ("/tls/" BACKEND "/connection/binding/match-tls-unique", TestConnection, NULL,
+-              setup_connection, test_connection_binding_match_tls_unique, teardown_connection);
+   g_test_add ("/tls/" BACKEND "/connection/binding/match-tls-server-end-point", TestConnection, NULL,
+               setup_connection, test_connection_binding_match_tls_server_end_point, teardown_connection);
+   g_test_add ("/tls/" BACKEND "/connection/binding/match-tls-exporter", TestConnection, NULL,
diff --git a/gnu/packages/patches/glib-skip-failing-test.patch b/gnu/packages/patches/glib-skip-failing-test.patch
new file mode 100644
index 0000000000..c7706aaa74
--- /dev/null
+++ b/gnu/packages/patches/glib-skip-failing-test.patch
@@ -0,0 +1,27 @@
+This test timed out on powerpc-linux even after extending the
+test_timeout_slow to 1800 seconds. Previously we tried to work around
+this test by extending test_timeout_slow by 1.5 its previous value.
+
+---
+ gio/tests/meson.build | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/gio/tests/meson.build b/gio/tests/meson.build
+index a926ae0..4fdbe7a 100644
+--- a/gio/tests/meson.build
++++ b/gio/tests/meson.build
+@@ -317,10 +317,6 @@ if host_machine.system() != 'windows'
+         'extra_sources' : [extra_sources, gdbus_test_codegen_generated, gdbus_test_codegen_generated_interface_info],
+         'c_args' : ['-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32'],
+       },
+-      'gdbus-threading' : {
+-        'extra_sources' : extra_sources,
+-        'suite' : ['slow'],
+-      },
+       'gmenumodel' : {
+         'extra_sources' : extra_sources,
+         'suite' : ['slow'],
+
+-- 
+2.31.1
+
diff --git a/gnu/packages/patches/glib-tests-timer.patch b/gnu/packages/patches/glib-tests-timer.patch
deleted file mode 100644
index e37425c0c8..0000000000
--- a/gnu/packages/patches/glib-tests-timer.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-* On i686 floating-point roundoff errors could sometimes cause this check to
-  fail depending on the elapsed microseconds.  Improve rounding by adding a
-  fractional bit.
-
---- glib-2.40.0/glib/tests/timer.c	2014-03-05 08:05:42.000000000 -0600
-+++ glib-2.40.0/glib/tests/timer.c	2014-07-10 16:33:12.746862822 -0500
-@@ -35,7 +35,7 @@
-   elapsed = g_timer_elapsed (timer, &micros);
- 
-   g_assert_cmpfloat (elapsed, <, 1.0);
--  g_assert_cmpuint (micros, ==, ((guint64)(elapsed * 1e6)) % 1000000);
-+  g_assert_cmpuint (micros, ==, ((guint64)(elapsed * 1e6 + 0.5)) % 1000000);
- 
-   g_timer_destroy (timer);
- }
diff --git a/gnu/packages/patches/glibc-2.27-git-fixes.patch b/gnu/packages/patches/glibc-2.27-git-fixes.patch
deleted file mode 100644
index 4ed67c7c25..0000000000
--- a/gnu/packages/patches/glibc-2.27-git-fixes.patch
+++ /dev/null
@@ -1,702 +0,0 @@
-These commits are cherry-picked from the "release/2.27/master" branch.
-
-https://sourceware.org/git/?p=glibc.git;a=shortlog;h=refs/heads/release/2.27/master
-
-Currently, we have the following (with NEWS and ChangeLog entries omitted).
-
-56170e064e2b21ce204f0817733e92f1730541ea
-516fa6080481a1433c173320b1c1432868e1e38a
-f36553bf6a4f69070f99badbdab5802b43e6e211
-7c6304182b9f422b782ace1cdd3efbde056aec36
-78a90c2f74a2012dd3eff302189e47ff6779a757
-1e52d8e65a58c49a48549053a1b89c06240e0c6c
-55ad82e45c313454de657931898e974a7a036cad
-
-From 56170e064e2b21ce204f0817733e92f1730541ea Mon Sep 17 00:00:00 2001
-From: Igor Gnatenko <ignatenko@redhat.com>
-Date: Wed, 7 Feb 2018 13:53:10 +0100
-Subject: [PATCH] Linux: use reserved name __key in pkey_get [BZ #22797]
-
-_key is not reserved name and we should avoid using that. It seems that
-it was simple typo when pkey_* was implemented.
-
-(cherry picked from commit 388ff7bd0d57d7061fdd39a2f26f65687e8058da)
-
-diff --git a/sysdeps/unix/sysv/linux/bits/mman-shared.h b/sysdeps/unix/sysv/linux/bits/mman-shared.h
-index 7715e680ca..d15ba95c9d 100644
---- a/sysdeps/unix/sysv/linux/bits/mman-shared.h
-+++ b/sysdeps/unix/sysv/linux/bits/mman-shared.h
-@@ -61,7 +61,7 @@ int pkey_set (int __key, unsigned int __access_rights) __THROW;
- 
- /* Return the access rights for the current thread for KEY, which must
-    have been allocated using pkey_alloc.  */
--int pkey_get (int _key) __THROW;
-+int pkey_get (int __key) __THROW;
- 
- /* Free an allocated protection key, which must have been allocated
-    using pkey_alloc.  */
-
-From 516fa6080481a1433c173320b1c1432868e1e38a Mon Sep 17 00:00:00 2001
-From: "Dmitry V. Levin" <ldv@altlinux.org>
-Date: Fri, 29 Dec 2017 23:19:32 +0000
-Subject: [PATCH] linux/aarch64: sync sys/ptrace.h with Linux 4.15 [BZ #22433]
-
-Remove compat-specific constants that were never exported by kernel
-headers under these names.  Before linux commit v3.7-rc1~16^2~1 they
-were exported with COMPAT_ prefix, and since that commit they are not
-exported at all.
-
-* sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h (__ptrace_request):
-Remove arm-specific PTRACE_GET_THREAD_AREA, PTRACE_GETHBPREGS,
-and PTRACE_SETHBPREGS.
-
-(cherry picked from commit 2fd4bbaa1446f1be700e10c526cf585a796c4991)
-
-diff --git a/sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h b/sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h
-index 4be45b95ff..444edbb702 100644
---- a/sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h
-+++ b/sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h
-@@ -78,18 +78,10 @@ enum __ptrace_request
-   PTRACE_DETACH = 17,
- #define PT_DETACH PTRACE_DETACH
- 
--  PTRACE_GET_THREAD_AREA = 22,
--
-   /* Continue and stop at the next entry to or return from syscall.  */
-   PTRACE_SYSCALL = 24,
- #define PT_SYSCALL PTRACE_SYSCALL
- 
--  /* Get all hardware breakpoint registers.  */
--  PTRACE_GETHBPREGS = 29,
--
--  /* Set all hardware breakpoint registers.  */
--  PTRACE_SETHBPREGS = 30,
--
-   /* Set ptrace filter options.  */
-   PTRACE_SETOPTIONS = 0x4200,
- #define PT_SETOPTIONS PTRACE_SETOPTIONS
-
-From f36553bf6a4f69070f99badbdab5802b43e6e211 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 19 Feb 2018 21:59:30 +0100
-Subject: [PATCH] =?UTF-8?q?Add=20missing=20=E2=80=9Creorder-end=E2=80=9D?=
- =?UTF-8?q?=20in=20LC=5FCOLLATE=20of=20et=5FEE=20[BZ=20#22517]?=
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-	[BZ #22517]
-	* localedata/locales/et_EE (LC_COLLATE): add missing “reorder-end”
-
-(cherry picked from commit 7ec5f9465e732e668d0dc94ac078ba68056d6d0a)
-
-diff --git a/localedata/locales/et_EE b/localedata/locales/et_EE
-index 9cb55b568f..bab7493c98 100644
---- a/localedata/locales/et_EE
-+++ b/localedata/locales/et_EE
-@@ -103,6 +103,8 @@ reorder-after <w>
- <U00FC> <u-diaresis>;<BAS>;<MIN>;IGNORE % ü
- <U00DC> <u-diaresis>;<BAS>;<CAP>;IGNORE % Ü
- 
-+reorder-end
-+
- END LC_COLLATE
- 
- LC_CTYPE
-
-From 7c6304182b9f422b782ace1cdd3efbde056aec36 Mon Sep 17 00:00:00 2001
-From: DJ Delorie <dj@redhat.com>
-Date: Thu, 1 Mar 2018 23:20:45 -0500
-Subject: [PATCH] [BZ #22342] Fix netgroup cache keys.
-
-Unlike other nscd caches, the netgroup cache contains two types of
-records - those for "iterate through a netgroup" (i.e. setnetgrent())
-and those for "is this user in this netgroup" (i.e. innetgr()),
-i.e. full and partial records.  The timeout code assumes these records
-have the same key for the group name, so that the collection of records
-that is "this netgroup" can be expired as a unit.
-
-However, the keys are not the same, as the in-netgroup key is generated
-by nscd rather than being passed to it from elsewhere, and is generated
-without the trailing NUL.  All other keys have the trailing NUL, and as
-noted in the linked BZ, debug statements confirm that two keys for the
-same netgroup are added to the cache with two different lengths.
-
-The result of this is that as records in the cache expire, the purge
-code only cleans out one of the two types of entries, resulting in
-stale, possibly incorrect, and possibly inconsistent cache data.
-
-The patch simply includes the existing NUL in the computation for the
-key length ('key' points to the char after the NUL, and 'group' to the
-first char of the group, so 'key-group' includes the first char to the
-NUL, inclusive).
-
-	[BZ #22342]
-	* nscd/netgroupcache.c (addinnetgrX): Include trailing NUL in
-	key value.
-
-Reviewed-by: Carlos O'Donell <carlos@redhat.com>
-(cherry picked from commit 1c81d55fc4b07b51adf68558ba74ce975153e580)
-
-diff --git a/nscd/netgroupcache.c b/nscd/netgroupcache.c
-index b832c9315f..2f187b208c 100644
---- a/nscd/netgroupcache.c
-+++ b/nscd/netgroupcache.c
-@@ -480,7 +480,7 @@ addinnetgrX (struct database_dyn *db, int fd, request_header *req,
- {
-   const char *group = key;
-   key = (char *) rawmemchr (key, '\0') + 1;
--  size_t group_len = key - group - 1;
-+  size_t group_len = key - group;
-   const char *host = *key++ ? key : NULL;
-   if (host != NULL)
-     key = (char *) rawmemchr (key, '\0') + 1;
-
-From 78a90c2f74a2012dd3eff302189e47ff6779a757 Mon Sep 17 00:00:00 2001
-From: Andreas Schwab <schwab@linux-m68k.org>
-Date: Fri, 2 Mar 2018 23:07:14 +0100
-Subject: [PATCH] Fix multiple definitions of __nss_*_database (bug 22918)
-
-(cherry picked from commit eaf6753f8aac33a36deb98c1031d1bad7b593d2d)
-
-diff --git a/nscd/gai.c b/nscd/gai.c
-index d081747797..576fd0045b 100644
---- a/nscd/gai.c
-+++ b/nscd/gai.c
-@@ -45,3 +45,6 @@
- #ifdef HAVE_LIBIDN
- # include <libidn/idn-stub.c>
- #endif
-+
-+/* Some variables normally defined in libc.  */
-+service_user *__nss_hosts_database attribute_hidden;
-diff --git a/nss/nsswitch.c b/nss/nsswitch.c
-index d5e655974f..b0f0c11a3e 100644
---- a/nss/nsswitch.c
-+++ b/nss/nsswitch.c
-@@ -62,7 +62,7 @@ static service_library *nss_new_service (name_database *database,
- 
- /* Declare external database variables.  */
- #define DEFINE_DATABASE(name)						      \
--  extern service_user *__nss_##name##_database attribute_hidden;	      \
-+  service_user *__nss_##name##_database attribute_hidden;		      \
-   weak_extern (__nss_##name##_database)
- #include "databases.def"
- #undef DEFINE_DATABASE
-diff --git a/nss/nsswitch.h b/nss/nsswitch.h
-index eccb535ef5..63573b9ebc 100644
---- a/nss/nsswitch.h
-+++ b/nss/nsswitch.h
-@@ -226,10 +226,10 @@ libc_hidden_proto (__nss_hostname_digits_dots)
- #define MAX_NR_ADDRS    48
- 
- /* Prototypes for __nss_*_lookup2 functions.  */
--#define DEFINE_DATABASE(arg)				    \
--  service_user *__nss_##arg##_database attribute_hidden;    \
--  int __nss_##arg##_lookup2 (service_user **, const char *, \
--			     const char *, void **);	    \
-+#define DEFINE_DATABASE(arg)						      \
-+  extern service_user *__nss_##arg##_database attribute_hidden;		      \
-+  int __nss_##arg##_lookup2 (service_user **, const char *,		      \
-+			     const char *, void **);			      \
-   libc_hidden_proto (__nss_##arg##_lookup2)
- #include "databases.def"
- #undef DEFINE_DATABASE
-diff --git a/posix/tst-rfc3484-2.c b/posix/tst-rfc3484-2.c
-index f509534ca9..8c64ac59ff 100644
---- a/posix/tst-rfc3484-2.c
-+++ b/posix/tst-rfc3484-2.c
-@@ -58,6 +58,7 @@ _res_hconf_init (void)
- #undef	USE_NSCD
- #include "../sysdeps/posix/getaddrinfo.c"
- 
-+service_user *__nss_hosts_database attribute_hidden;
- 
- /* This is the beginning of the real test code.  The above defines
-    (among other things) the function rfc3484_sort.  */
-diff --git a/posix/tst-rfc3484-3.c b/posix/tst-rfc3484-3.c
-index ae44087a10..1c61aaf844 100644
---- a/posix/tst-rfc3484-3.c
-+++ b/posix/tst-rfc3484-3.c
-@@ -58,6 +58,7 @@ _res_hconf_init (void)
- #undef	USE_NSCD
- #include "../sysdeps/posix/getaddrinfo.c"
- 
-+service_user *__nss_hosts_database attribute_hidden;
- 
- /* This is the beginning of the real test code.  The above defines
-    (among other things) the function rfc3484_sort.  */
-diff --git a/posix/tst-rfc3484.c b/posix/tst-rfc3484.c
-index 7f191abbbc..8f45848e44 100644
---- a/posix/tst-rfc3484.c
-+++ b/posix/tst-rfc3484.c
-@@ -58,6 +58,7 @@ _res_hconf_init (void)
- #undef	USE_NSCD
- #include "../sysdeps/posix/getaddrinfo.c"
- 
-+service_user *__nss_hosts_database attribute_hidden;
- 
- /* This is the beginning of the real test code.  The above defines
-    (among other things) the function rfc3484_sort.  */
-
-From 1e52d8e65a58c49a48549053a1b89c06240e0c6c Mon Sep 17 00:00:00 2001
-From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
-Date: Fri, 17 Nov 2017 16:04:29 -0200
-Subject: [PATCH] i386: Fix i386 sigaction sa_restorer initialization
- (BZ#21269)
-
-This patch fixes the i386 sa_restorer field initialization for sigaction
-syscall for kernel with vDSO.  As described in bug report, i386 Linux
-(and compat on x86_64) interprets SA_RESTORER clear with nonzero
-sa_restorer as a request for stack switching if the SS segment is 'funny'.
-This means that anything that tries to mix glibc's signal handling with
-segmentation (for instance through modify_ldt syscall) is randomly broken
-depending on what values lands in sa_restorer.
-
-The testcase added  is based on Linux test tools/testing/selftests/x86/ldt_gdt.c,
-more specifically in do_multicpu_tests function.  The main changes are:
-
-  - C11 atomics instead of plain access.
-
-  - Remove x86_64 support which simplifies the syscall handling and fallbacks.
-
-  - Replicate only the test required to trigger the issue.
-
-Checked on i686-linux-gnu.
-
-	[BZ #21269]
-	* sysdeps/unix/sysv/linux/i386/Makefile (tests): Add tst-bz21269.
-	* sysdeps/unix/sysv/linux/i386/sigaction.c (SET_SA_RESTORER): Clear
-	sa_restorer for vDSO case.
-	* sysdeps/unix/sysv/linux/i386/tst-bz21269.c: New file.
-
-(cherry picked from commit 68448be208ee06e76665918b37b0a57e3e00c8b4)
-
-diff --git a/sysdeps/unix/sysv/linux/i386/Makefile b/sysdeps/unix/sysv/linux/i386/Makefile
-index 4080b8c966..da716e2c1b 100644
---- a/sysdeps/unix/sysv/linux/i386/Makefile
-+++ b/sysdeps/unix/sysv/linux/i386/Makefile
-@@ -3,6 +3,9 @@ default-abi := 32
- 
- ifeq ($(subdir),misc)
- sysdep_routines += ioperm iopl vm86
-+
-+tests += tst-bz21269
-+$(objpfx)tst-bz21269: $(shared-thread-library)
- endif
- 
- ifeq ($(subdir),elf)
-diff --git a/sysdeps/unix/sysv/linux/i386/sigaction.c b/sysdeps/unix/sysv/linux/i386/sigaction.c
-index a5eb9e0d3e..177ff60ee6 100644
---- a/sysdeps/unix/sysv/linux/i386/sigaction.c
-+++ b/sysdeps/unix/sysv/linux/i386/sigaction.c
-@@ -42,7 +42,6 @@ extern void restore_rt (void) asm ("__restore_rt") attribute_hidden;
- #endif
- extern void restore (void) asm ("__restore") attribute_hidden;
- 
--
- /* If ACT is not NULL, change the action for SIG to *ACT.
-    If OACT is not NULL, put the old action for SIG in *OACT.  */
- int
-@@ -65,6 +64,8 @@ __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
- 	  kact.sa_restorer = ((act->sa_flags & SA_SIGINFO)
- 			      ? &restore_rt : &restore);
- 	}
-+      else
-+	kact.sa_restorer = NULL;
-     }
- 
-   /* XXX The size argument hopefully will have to be changed to the
-diff --git a/sysdeps/unix/sysv/linux/i386/tst-bz21269.c b/sysdeps/unix/sysv/linux/i386/tst-bz21269.c
-new file mode 100644
-index 0000000000..353e36507d
---- /dev/null
-+++ b/sysdeps/unix/sysv/linux/i386/tst-bz21269.c
-@@ -0,0 +1,233 @@
-+/* Test for i386 sigaction sa_restorer handling (BZ#21269)
-+   Copyright (C) 2017 Free Software Foundation, Inc.
-+   This file is part of the GNU C Library.
-+
-+   The GNU C Library is free software; you can redistribute it and/or
-+   modify it under the terms of the GNU Lesser General Public
-+   License as published by the Free Software Foundation; either
-+   version 2.1 of the License, or (at your option) any later version.
-+
-+   The GNU C Library is distributed in the hope that it will be useful,
-+   but WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   Lesser General Public License for more details.
-+
-+   You should have received a copy of the GNU Lesser General Public
-+   License along with the GNU C Library; if not, see
-+   <http://www.gnu.org/licenses/>.  */
-+
-+/* This is based on Linux test tools/testing/selftests/x86/ldt_gdt.c,
-+   more specifically in do_multicpu_tests function.  The main changes
-+   are:
-+
-+   - C11 atomics instead of plain access.
-+   - Remove x86_64 support which simplifies the syscall handling
-+     and fallbacks.
-+   - Replicate only the test required to trigger the issue for the
-+     BZ#21269.  */
-+
-+#include <stdatomic.h>
-+
-+#include <asm/ldt.h>
-+#include <linux/futex.h>
-+
-+#include <setjmp.h>
-+#include <signal.h>
-+#include <errno.h>
-+#include <sys/syscall.h>
-+#include <sys/mman.h>
-+
-+#include <support/xunistd.h>
-+#include <support/check.h>
-+#include <support/xthread.h>
-+
-+static int
-+xset_thread_area (struct user_desc *u_info)
-+{
-+  long ret = syscall (SYS_set_thread_area, u_info);
-+  TEST_VERIFY_EXIT (ret == 0);
-+  return ret;
-+}
-+
-+static void
-+xmodify_ldt (int func, const void *ptr, unsigned long bytecount)
-+{
-+  TEST_VERIFY_EXIT (syscall (SYS_modify_ldt, 1, ptr, bytecount) == 0);
-+}
-+
-+static int
-+futex (int *uaddr, int futex_op, int val, void *timeout, int *uaddr2,
-+	int val3)
-+{
-+  return syscall (SYS_futex, uaddr, futex_op, val, timeout, uaddr2, val3);
-+}
-+
-+static void
-+xsethandler (int sig, void (*handler)(int, siginfo_t *, void *), int flags)
-+{
-+  struct sigaction sa = { 0 };
-+  sa.sa_sigaction = handler;
-+  sa.sa_flags = SA_SIGINFO | flags;
-+  TEST_VERIFY_EXIT (sigemptyset (&sa.sa_mask) == 0);
-+  TEST_VERIFY_EXIT (sigaction (sig, &sa, 0) == 0);
-+}
-+
-+static jmp_buf jmpbuf;
-+
-+static void
-+sigsegv_handler (int sig, siginfo_t *info, void *ctx_void)
-+{
-+  siglongjmp (jmpbuf, 1);
-+}
-+
-+/* Points to an array of 1024 ints, each holding its own index.  */
-+static const unsigned int *counter_page;
-+static struct user_desc *low_user_desc;
-+static struct user_desc *low_user_desc_clear; /* Used to delete GDT entry.  */
-+static int gdt_entry_num;
-+
-+static void
-+setup_counter_page (void)
-+{
-+  long page_size = sysconf (_SC_PAGE_SIZE);
-+  TEST_VERIFY_EXIT (page_size > 0);
-+  unsigned int *page = xmmap (NULL, page_size, PROT_READ | PROT_WRITE,
-+			      MAP_ANONYMOUS | MAP_PRIVATE | MAP_32BIT, -1);
-+  for (int i = 0; i < (page_size / sizeof (unsigned int)); i++)
-+    page[i] = i;
-+  counter_page = page;
-+}
-+
-+static void
-+setup_low_user_desc (void)
-+{
-+  low_user_desc = xmmap (NULL, 2 * sizeof (struct user_desc),
-+			 PROT_READ | PROT_WRITE,
-+			 MAP_ANONYMOUS | MAP_PRIVATE | MAP_32BIT, -1);
-+
-+  low_user_desc->entry_number    = -1;
-+  low_user_desc->base_addr       = (unsigned long) &counter_page[1];
-+  low_user_desc->limit           = 0xffff;
-+  low_user_desc->seg_32bit       = 1;
-+  low_user_desc->contents        = 0;
-+  low_user_desc->read_exec_only  = 0;
-+  low_user_desc->limit_in_pages  = 1;
-+  low_user_desc->seg_not_present = 0;
-+  low_user_desc->useable         = 0;
-+
-+  xset_thread_area (low_user_desc);
-+
-+  low_user_desc_clear = low_user_desc + 1;
-+  low_user_desc_clear->entry_number = gdt_entry_num;
-+  low_user_desc_clear->read_exec_only = 1;
-+  low_user_desc_clear->seg_not_present = 1;
-+}
-+
-+/* Possible values of futex:
-+   0: thread is idle.
-+   1: thread armed.
-+   2: thread should clear LDT entry 0.
-+   3: thread should exit.  */
-+static atomic_uint ftx;
-+
-+static void *
-+threadproc (void *ctx)
-+{
-+  while (1)
-+    {
-+      futex ((int *) &ftx, FUTEX_WAIT, 1, NULL, NULL, 0);
-+      while (atomic_load (&ftx) != 2)
-+	{
-+	  if (atomic_load (&ftx) >= 3)
-+	    return NULL;
-+	}
-+
-+      /* clear LDT entry 0.  */
-+      const struct user_desc desc = { 0 };
-+      xmodify_ldt (1, &desc, sizeof (desc));
-+
-+      /* If ftx == 2, set it to zero,  If ftx == 100, quit.  */
-+      if (atomic_fetch_add (&ftx, -2) != 2)
-+	return NULL;
-+    }
-+}
-+
-+
-+/* As described in testcase, for historical reasons x86_32 Linux (and compat
-+   on x86_64) interprets SA_RESTORER clear with nonzero sa_restorer as a
-+   request for stack switching if the SS segment is 'funny' (this is default
-+   scenario for vDSO system).  This means that anything that tries to mix
-+   signal handling with segmentation should explicit clear the sa_restorer.
-+
-+   This testcase check if sigaction in fact does it by changing the local
-+   descriptor table (LDT) through the modify_ldt syscall and triggering
-+   a synchronous segfault on iret fault by trying to install an invalid
-+   segment.  With a correct zeroed sa_restorer it should not trigger an
-+   'real' SEGSEGV and allows the siglongjmp in signal handler.  */
-+
-+static int
-+do_test (void)
-+{
-+  setup_counter_page ();
-+  setup_low_user_desc ();
-+
-+  pthread_t thread;
-+  unsigned short orig_ss;
-+
-+  xsethandler (SIGSEGV, sigsegv_handler, 0);
-+  /* 32-bit kernels send SIGILL instead of SIGSEGV on IRET faults.  */
-+  xsethandler (SIGILL, sigsegv_handler, 0);
-+
-+  thread = xpthread_create (0, threadproc, 0);
-+
-+  asm volatile ("mov %%ss, %0" : "=rm" (orig_ss));
-+
-+  for (int i = 0; i < 5; i++)
-+    {
-+      if (sigsetjmp (jmpbuf, 1) != 0)
-+	continue;
-+
-+      /* Make sure the thread is ready after the last test. */
-+      while (atomic_load (&ftx) != 0)
-+	;
-+
-+      struct user_desc desc = {
-+	.entry_number       = 0,
-+	.base_addr          = 0,
-+	.limit              = 0xffff,
-+	.seg_32bit          = 1,
-+	.contents           = 0,
-+	.read_exec_only     = 0,
-+	.limit_in_pages     = 1,
-+	.seg_not_present    = 0,
-+	.useable            = 0
-+      };
-+
-+      xmodify_ldt (0x11, &desc, sizeof (desc));
-+
-+      /* Arm the thread.  */
-+      ftx = 1;
-+      futex ((int*) &ftx, FUTEX_WAKE, 0, NULL, NULL, 0);
-+
-+      asm volatile ("mov %0, %%ss" : : "r" (0x7));
-+
-+      /* Fire up thread modify_ldt call.  */
-+      atomic_store (&ftx, 2);
-+
-+      while (atomic_load (&ftx) != 0)
-+	;
-+
-+      /* On success, modify_ldt will segfault us synchronously and we will
-+	 escape via siglongjmp.  */
-+      support_record_failure ();
-+    }
-+
-+  atomic_store (&ftx, 100);
-+  futex ((int*) &ftx, FUTEX_WAKE, 0, NULL, NULL, 0);
-+
-+  xpthread_join (thread);
-+
-+  return 0;
-+}
-+
-+#include <support/test-driver.c>
-
-From 55ad82e45c313454de657931898e974a7a036cad Mon Sep 17 00:00:00 2001
-From: Andrew Senkevich <andrew.n.senkevich@gmail.com>
-Date: Fri, 23 Mar 2018 16:19:45 +0100
-Subject: [PATCH] Fix i386 memmove issue (bug 22644).
-
-	[BZ #22644]
-	* sysdeps/i386/i686/multiarch/memcpy-sse2-unaligned.S: Fixed
-	branch conditions.
-	* string/test-memmove.c (do_test2): New testcase.
-
-(cherry picked from commit cd66c0e584c6d692bc8347b5e72723d02b8a8ada)
-
-diff --git a/string/test-memmove.c b/string/test-memmove.c
-index edc7a4c3bf..64e3651ba4 100644
---- a/string/test-memmove.c
-+++ b/string/test-memmove.c
-@@ -24,6 +24,7 @@
- # define TEST_NAME "memmove"
- #endif
- #include "test-string.h"
-+#include <support/test-driver.h>
- 
- char *simple_memmove (char *, const char *, size_t);
- 
-@@ -245,6 +246,60 @@ do_random_tests (void)
-     }
- }
- 
-+static void
-+do_test2 (void)
-+{
-+  size_t size = 0x20000000;
-+  uint32_t * large_buf;
-+
-+  large_buf = mmap ((void*) 0x70000000, size, PROT_READ | PROT_WRITE,
-+		    MAP_PRIVATE | MAP_ANON, -1, 0);
-+
-+  if (large_buf == MAP_FAILED)
-+    error (EXIT_UNSUPPORTED, errno, "Large mmap failed");
-+
-+  if ((uintptr_t) large_buf > 0x80000000 - 128
-+      || 0x80000000 - (uintptr_t) large_buf > 0x20000000)
-+    {
-+      error (0, 0, "Large mmap allocated improperly");
-+      ret = EXIT_UNSUPPORTED;
-+      munmap ((void *) large_buf, size);
-+      return;
-+    }
-+
-+  size_t bytes_move = 0x80000000 - (uintptr_t) large_buf;
-+  size_t arr_size = bytes_move / sizeof (uint32_t);
-+  size_t i;
-+
-+  FOR_EACH_IMPL (impl, 0)
-+    {
-+      for (i = 0; i < arr_size; i++)
-+        large_buf[i] = (uint32_t) i;
-+
-+      uint32_t * dst = &large_buf[33];
-+
-+#ifdef TEST_BCOPY
-+      CALL (impl, (char *) large_buf, (char *) dst, bytes_move);
-+#else
-+      CALL (impl, (char *) dst, (char *) large_buf, bytes_move);
-+#endif
-+
-+      for (i = 0; i < arr_size; i++)
-+	{
-+	  if (dst[i] != (uint32_t) i)
-+	    {
-+	      error (0, 0,
-+		     "Wrong result in function %s dst \"%p\" src \"%p\" offset \"%zd\"",
-+		     impl->name, dst, large_buf, i);
-+	      ret = 1;
-+	      break;
-+	    }
-+	}
-+    }
-+
-+  munmap ((void *) large_buf, size);
-+}
-+
- int
- test_main (void)
- {
-@@ -284,6 +339,9 @@ test_main (void)
-     }
- 
-   do_random_tests ();
-+
-+  do_test2 ();
-+
-   return ret;
- }
- 
-diff --git a/sysdeps/i386/i686/multiarch/memcpy-sse2-unaligned.S b/sysdeps/i386/i686/multiarch/memcpy-sse2-unaligned.S
-index 9c3bbe7e17..9aa17de99c 100644
---- a/sysdeps/i386/i686/multiarch/memcpy-sse2-unaligned.S
-+++ b/sysdeps/i386/i686/multiarch/memcpy-sse2-unaligned.S
-@@ -72,7 +72,7 @@ ENTRY (MEMCPY)
- 	cmp	%edx, %eax
- 
- # ifdef USE_AS_MEMMOVE
--	jg	L(check_forward)
-+	ja	L(check_forward)
- 
- L(mm_len_0_or_more_backward):
- /* Now do checks for lengths. We do [0..16], [16..32], [32..64], [64..128]
-@@ -81,7 +81,7 @@ L(mm_len_0_or_more_backward):
- 	jbe	L(mm_len_0_16_bytes_backward)
- 
- 	cmpl	$32, %ecx
--	jg	L(mm_len_32_or_more_backward)
-+	ja	L(mm_len_32_or_more_backward)
- 
- /* Copy [0..32] and return.  */
- 	movdqu	(%eax), %xmm0
-@@ -92,7 +92,7 @@ L(mm_len_0_or_more_backward):
- 
- L(mm_len_32_or_more_backward):
- 	cmpl	$64, %ecx
--	jg	L(mm_len_64_or_more_backward)
-+	ja	L(mm_len_64_or_more_backward)
- 
- /* Copy [0..64] and return.  */
- 	movdqu	(%eax), %xmm0
-@@ -107,7 +107,7 @@ L(mm_len_32_or_more_backward):
- 
- L(mm_len_64_or_more_backward):
- 	cmpl	$128, %ecx
--	jg	L(mm_len_128_or_more_backward)
-+	ja	L(mm_len_128_or_more_backward)
- 
- /* Copy [0..128] and return.  */
- 	movdqu	(%eax), %xmm0
-@@ -132,7 +132,7 @@ L(mm_len_128_or_more_backward):
- 	add	%ecx, %eax
- 	cmp	%edx, %eax
- 	movl	SRC(%esp), %eax
--	jle	L(forward)
-+	jbe	L(forward)
- 	PUSH (%esi)
- 	PUSH (%edi)
- 	PUSH (%ebx)
-@@ -269,7 +269,7 @@ L(check_forward):
- 	add	%edx, %ecx
- 	cmp	%eax, %ecx
- 	movl	LEN(%esp), %ecx
--	jle	L(forward)
-+	jbe	L(forward)
- 
- /* Now do checks for lengths. We do [0..16], [0..32], [0..64], [0..128]
- 	separately.  */
diff --git a/gnu/packages/patches/glibc-2.27-supported-locales.patch b/gnu/packages/patches/glibc-2.27-supported-locales.patch
deleted file mode 100644
index 2888052bb8..0000000000
--- a/gnu/packages/patches/glibc-2.27-supported-locales.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-This patch is taken from debian's glibc package (generate-supported.mk).
-It install the localedata/SUPPORTED file of the glibc. This file lists
-all the supported locales of the glibc.
-
-diff --git a/localedata/Makefile.old b/localedata/Makefile
-index 34877c0..a61d9b9 100644
---- a/localedata/Makefile.old
-+++ b/localedata/Makefile
-@@ -91,7 +91,8 @@ endif
- # Files to install.
- install-others := $(addprefix $(inst_i18ndir)/, \
- 			      $(addsuffix .gz, $(charmaps)) \
--			      $(locales))
-+			      $(locales)) \
-+                   $(inst_i18ndir)/SUPPORTED
- 
- tests: $(objdir)/iconvdata/gconv-modules
- 
-@@ -195,6 +196,14 @@ endif
- 
- include SUPPORTED
- 
-+$(inst_i18ndir)/SUPPORTED: SUPPORTED $(+force)
-+	for locale in $(SUPPORTED-LOCALES); do \
-+		[ $$locale = true ] && continue; \
-+		echo $$locale | sed 's,/, ,' >> LOCALES; \
-+	done
-+	$(make-target-directory)
-+	$(INSTALL_DATA) LOCALES $@
-+
- INSTALL-SUPPORTED-LOCALES=$(addprefix install-, $(SUPPORTED-LOCALES))
- 
- # Sometimes the whole collection of locale files should be installed.
diff --git a/gnu/packages/patches/glibc-2.28-git-fixes.patch b/gnu/packages/patches/glibc-2.28-git-fixes.patch
deleted file mode 100644
index 7e370ef0b1..0000000000
--- a/gnu/packages/patches/glibc-2.28-git-fixes.patch
+++ /dev/null
@@ -1,248 +0,0 @@
-This file contains fixes from the "release/2.28/master" branch:
-https://sourceware.org/git/?p=glibc.git;a=shortlog;h=refs/heads/release/2.28/master
-
-Currently we have these commits (sans tests and ChangeLog updates):
-7f11842e7483da7aa9fa3031be122021978ef600
-726e1554ce4db5e35af41cb0110c54c5e1232054
-4b25485f03158959cff45379eecc1d73c7dcdd11
-d05b05d1570ba3ae354a2f5a3cfeefb373b09979
-bfcfa22589f2b4277a65e60c6b736b6bbfbd87d0
-2f498f3d140ab5152bd784df2be7af7d9c5e63ed
-
-diff --git a/htl/Versions b/htl/Versions
-index 6a63a1b8a1..c5a616da10 100644
---- a/htl/Versions
-+++ b/htl/Versions
-@@ -150,6 +150,8 @@ libpthread {
-     __cthread_keycreate;
-     __cthread_getspecific;
-     __cthread_setspecific;
-+    __pthread_getspecific;
-+    __pthread_setspecific;
-     __pthread_getattr_np;
-     __pthread_attr_getstack;
-   }
-
-diff --git a/sysdeps/htl/pt-getspecific.c b/sysdeps/htl/pt-getspecific.c
-index a0227a67f6..64ddf9551a 100644
---- a/sysdeps/htl/pt-getspecific.c
-+++ b/sysdeps/htl/pt-getspecific.c
-@@ -36,3 +36,4 @@ __pthread_getspecific (pthread_key_t key)
-   return self->thread_specifics[key];
- }
- strong_alias (__pthread_getspecific, pthread_getspecific);
-+hidden_def (__pthread_getspecific)
-diff --git a/sysdeps/htl/pt-setspecific.c b/sysdeps/htl/pt-setspecific.c
-index a46a12f157..02aff417ef 100644
---- a/sysdeps/htl/pt-setspecific.c
-+++ b/sysdeps/htl/pt-setspecific.c
-@@ -48,3 +48,4 @@ __pthread_setspecific (pthread_key_t key, const void *value)
-   return 0;
- }
- strong_alias (__pthread_setspecific, pthread_setspecific);
-+hidden_def (__pthread_setspecific)
-diff --git a/sysdeps/htl/pthreadP.h b/sysdeps/htl/pthreadP.h
-index 132ac1718e..71c2fcd9c6 100644
---- a/sysdeps/htl/pthreadP.h
-+++ b/sysdeps/htl/pthreadP.h
-@@ -68,6 +68,8 @@ struct __pthread_cancelation_handler **___pthread_get_cleanup_stack (void) attri
- 
- #if IS_IN (libpthread)
- hidden_proto (__pthread_key_create)
-+hidden_proto (__pthread_getspecific)
-+hidden_proto (__pthread_setspecific)
- hidden_proto (_pthread_mutex_init)
- #endif
- 
-diff --git a/sysdeps/unix/sysv/linux/getdents64.c b/sysdeps/unix/sysv/linux/getdents64.c
-index 3bde0cf4f0..bc140b5a7f 100644
---- a/sysdeps/unix/sysv/linux/getdents64.c
-+++ b/sysdeps/unix/sysv/linux/getdents64.c
-@@ -33,41 +33,80 @@ strong_alias (__getdents64, __getdents)
- # include <shlib-compat.h>
- 
- # if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2)
--# include <olddirent.h>
-+#  include <olddirent.h>
-+#  include <unistd.h>
- 
--/* kernel definition of as of 3.2.  */
--struct compat_linux_dirent
-+static ssize_t
-+handle_overflow (int fd, __off64_t offset, ssize_t count)
- {
--  /* Both d_ino and d_off are compat_ulong_t which are defined in all
--     architectures as 'u32'.  */
--  uint32_t        d_ino;
--  uint32_t        d_off;
--  unsigned short  d_reclen;
--  char            d_name[1];
--};
-+  /* If this is the first entry in the buffer, we can report the
-+     error.  */
-+  if (count == 0)
-+    {
-+      __set_errno (EOVERFLOW);
-+      return -1;
-+    }
-+
-+  /* Otherwise, seek to the overflowing entry, so that the next call
-+     will report the error, and return the data read so far..  */
-+  if (__lseek64 (fd, offset, SEEK_SET) != 0)
-+    return -1;
-+  return count;
-+}
- 
- ssize_t
- __old_getdents64 (int fd, char *buf, size_t nbytes)
- {
--  ssize_t retval = INLINE_SYSCALL_CALL (getdents, fd, buf, nbytes);
-+  /* We do not move the individual directory entries.  This is only
-+     possible if the target type (struct __old_dirent64) is smaller
-+     than the source type.  */
-+  _Static_assert (offsetof (struct __old_dirent64, d_name)
-+		  <= offsetof (struct dirent64, d_name),
-+		  "__old_dirent64 is larger than dirent64");
-+  _Static_assert (__alignof__ (struct __old_dirent64)
-+		  <= __alignof__ (struct dirent64),
-+		  "alignment of __old_dirent64 is larger than dirent64");
- 
--  /* The kernel added the d_type value after the name.  Change this now.  */
--  if (retval != -1)
-+  ssize_t retval = INLINE_SYSCALL_CALL (getdents64, fd, buf, nbytes);
-+  if (retval > 0)
-     {
--      union
--      {
--	struct compat_linux_dirent k;
--	struct dirent u;
--      } *kbuf = (void *) buf;
--
--      while ((char *) kbuf < buf + retval)
-+      char *p = buf;
-+      char *end = buf + retval;
-+      while (p < end)
- 	{
--	  char d_type = *((char *) kbuf + kbuf->k.d_reclen - 1);
--	  memmove (kbuf->u.d_name, kbuf->k.d_name,
--		   strlen (kbuf->k.d_name) + 1);
--	  kbuf->u.d_type = d_type;
-+	  struct dirent64 *source = (struct dirent64 *) p;
-+
-+	  /* Copy out the fixed-size data.  */
-+	  __ino_t ino = source->d_ino;
-+	  __off64_t offset = source->d_off;
-+	  unsigned int reclen = source->d_reclen;
-+	  unsigned char type = source->d_type;
-+
-+	  /* Check for ino_t overflow.  */
-+	  if (__glibc_unlikely (ino != source->d_ino))
-+	    return handle_overflow (fd, offset, p - buf);
-+
-+	  /* Convert to the target layout.  Use a separate struct and
-+	     memcpy to side-step aliasing issues.  */
-+	  struct __old_dirent64 result;
-+	  result.d_ino = ino;
-+	  result.d_off = offset;
-+	  result.d_reclen = reclen;
-+	  result.d_type = type;
-+
-+	  /* Write the fixed-sized part of the result to the
-+	     buffer.  */
-+	  size_t result_name_offset = offsetof (struct __old_dirent64, d_name);
-+	  memcpy (p, &result, result_name_offset);
-+
-+	  /* Adjust the position of the name if necessary.  Copy
-+	     everything until the end of the record, including the
-+	     terminating NUL byte.  */
-+	  if (result_name_offset != offsetof (struct dirent64, d_name))
-+	    memmove (p + result_name_offset, source->d_name,
-+		     reclen - offsetof (struct dirent64, d_name));
- 
--	  kbuf = (void *) ((char *) kbuf + kbuf->k.d_reclen);
-+	  p += reclen;
- 	}
-      }
-   return retval;
-
-diff --git a/misc/error.c b/misc/error.c
-index b4e8b6c938..03378e2f2a 100644
---- a/misc/error.c
-+++ b/misc/error.c
-@@ -319,6 +319,7 @@ error (int status, int errnum, const char *message, ...)
- 
-   va_start (args, message);
-   error_tail (status, errnum, message, args);
-+  va_end (args);
- 
- #ifdef _LIBC
-   _IO_funlockfile (stderr);
-@@ -390,6 +391,7 @@ error_at_line (int status, int errnum, const char *file_name,
- 
-   va_start (args, message);
-   error_tail (status, errnum, message, args);
-+  va_end (args);
- 
- #ifdef _LIBC
-   _IO_funlockfile (stderr);
-
-diff --git a/nscd/nscd_conf.c b/nscd/nscd_conf.c
-index 265a02434d..7293b795b6 100644
---- a/nscd/nscd_conf.c
-+++ b/nscd/nscd_conf.c
-@@ -190,7 +190,10 @@ nscd_parse_file (const char *fname, struct database_dyn dbs[lastdb])
- 	  if (!arg1)
- 	    error (0, 0, _("Must specify user name for server-user option"));
- 	  else
--	    server_user = xstrdup (arg1);
-+	    {
-+	      free ((char *) server_user);
-+	      server_user = xstrdup (arg1);
-+	    }
- 	}
-       else if (strcmp (entry, "stat-user") == 0)
- 	{
-@@ -198,6 +201,7 @@ nscd_parse_file (const char *fname, struct database_dyn dbs[lastdb])
- 	    error (0, 0, _("Must specify user name for stat-user option"));
- 	  else
- 	    {
-+	      free ((char *) stat_user);
- 	      stat_user = xstrdup (arg1);
- 
- 	      struct passwd *pw = getpwnam (stat_user);
-
-diff --git a/nss/nss_files/files-alias.c b/nss/nss_files/files-alias.c
-index cfd34b66b9..35b0bfc5d2 100644
---- a/nss/nss_files/files-alias.c
-+++ b/nss/nss_files/files-alias.c
-@@ -221,6 +221,13 @@ get_next_alias (FILE *stream, const char *match, struct aliasent *result,
- 			{
- 			  while (! feof_unlocked (listfile))
- 			    {
-+			      if (room_left < 2)
-+				{
-+				  free (old_line);
-+				  fclose (listfile);
-+				  goto no_more_room;
-+				}
-+
- 			      first_unused[room_left - 1] = '\xff';
- 			      line = fgets_unlocked (first_unused, room_left,
- 						     listfile);
-@@ -229,6 +236,7 @@ get_next_alias (FILE *stream, const char *match, struct aliasent *result,
- 			      if (first_unused[room_left - 1] != '\xff')
- 				{
- 				  free (old_line);
-+				  fclose (listfile);
- 				  goto no_more_room;
- 				}
- 
-@@ -256,6 +264,7 @@ get_next_alias (FILE *stream, const char *match, struct aliasent *result,
- 						       + __alignof__ (char *)))
- 					{
- 					  free (old_line);
-+					  fclose (listfile);
- 					  goto no_more_room;
- 					}
- 				      room_left -= ((first_unused - cp)
-
diff --git a/gnu/packages/patches/glibc-2.28-supported-locales.patch b/gnu/packages/patches/glibc-2.28-supported-locales.patch
deleted file mode 100644
index 2888052bb8..0000000000
--- a/gnu/packages/patches/glibc-2.28-supported-locales.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-This patch is taken from debian's glibc package (generate-supported.mk).
-It install the localedata/SUPPORTED file of the glibc. This file lists
-all the supported locales of the glibc.
-
-diff --git a/localedata/Makefile.old b/localedata/Makefile
-index 34877c0..a61d9b9 100644
---- a/localedata/Makefile.old
-+++ b/localedata/Makefile
-@@ -91,7 +91,8 @@ endif
- # Files to install.
- install-others := $(addprefix $(inst_i18ndir)/, \
- 			      $(addsuffix .gz, $(charmaps)) \
--			      $(locales))
-+			      $(locales)) \
-+                   $(inst_i18ndir)/SUPPORTED
- 
- tests: $(objdir)/iconvdata/gconv-modules
- 
-@@ -195,6 +196,14 @@ endif
- 
- include SUPPORTED
- 
-+$(inst_i18ndir)/SUPPORTED: SUPPORTED $(+force)
-+	for locale in $(SUPPORTED-LOCALES); do \
-+		[ $$locale = true ] && continue; \
-+		echo $$locale | sed 's,/, ,' >> LOCALES; \
-+	done
-+	$(make-target-directory)
-+	$(INSTALL_DATA) LOCALES $@
-+
- INSTALL-SUPPORTED-LOCALES=$(addprefix install-, $(SUPPORTED-LOCALES))
- 
- # Sometimes the whole collection of locale files should be installed.
diff --git a/gnu/packages/patches/glibc-2.31-hurd-clock_gettime_monotonic.patch b/gnu/packages/patches/glibc-2.31-hurd-clock_gettime_monotonic.patch
new file mode 100644
index 0000000000..1c3fe427f9
--- /dev/null
+++ b/gnu/packages/patches/glibc-2.31-hurd-clock_gettime_monotonic.patch
@@ -0,0 +1,84 @@
+This is needed to run Python on the Hurd, especially during the build of
+python-boot0.
+
+Adapted from https://salsa.debian.org/glibc-team/glibc/-/blob/glibc-2.31/debian/patches/hurd-i386/unsubmitted-clock_t_centiseconds.diff
+
+Use the realtime clock for the monotonic clock. This is of course not a proper
+implementation (which is being done in Mach), but will permit to fix at least
+the iceweasel stack.
+
+vlc however doesn't build when _POSIX_CLOCK_SELECTION is enabled but
+_POSIX_TIMERS is not, and they refuse to fix that (see #765578), so disable the
+former.
+
+From 0aa1dfd580cf9ad7b812c307b128decb782b825f Mon Sep 17 00:00:00 2001
+From: Jan Nieuwenhuizen <janneke@gnu.org>
+Date: Mon, 2 Mar 2020 18:59:04 +0100
+Subject: [PATCH 2/2] Use realtime clock for the monotonic clock.
+
+---
+ sysdeps/mach/clock_gettime.c       | 2 +-
+ sysdeps/mach/hurd/bits/posix_opt.h | 6 +++---
+ sysdeps/posix/clock_getres.c       | 1 +
+ sysdeps/pthread/timer_create.c     | 2 +-
+ 4 files changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/sysdeps/mach/clock_gettime.c b/sysdeps/mach/clock_gettime.c
+index ac3547df3c..af8681ba4e 100644
+--- a/sysdeps/mach/clock_gettime.c
++++ b/sysdeps/mach/clock_gettime.c
+@@ -25,7 +25,7 @@
+ int
+ __clock_gettime (clockid_t clock_id, struct timespec *ts)
+ {
+-  if (clock_id != CLOCK_REALTIME)
++  if (clock_id != CLOCK_MONOTONIC && clock_id != CLOCK_REALTIME)
+     {
+       errno = EINVAL;
+       return -1;
+diff --git a/sysdeps/mach/hurd/bits/posix_opt.h b/sysdeps/mach/hurd/bits/posix_opt.h
+index 0050151332..27b3a28ab7 100644
+--- a/sysdeps/mach/hurd/bits/posix_opt.h
++++ b/sysdeps/mach/hurd/bits/posix_opt.h
+@@ -163,10 +163,10 @@
+ #define _POSIX_THREAD_PROCESS_SHARED	-1
+ 
+ /* The monotonic clock might be available.  */
+-#define _POSIX_MONOTONIC_CLOCK	0
++#define _POSIX_MONOTONIC_CLOCK	200809L
+ 
+-/* The clock selection interfaces are available.  */
+-#define _POSIX_CLOCK_SELECTION	200809L
++/* The clock selection interfaces are not really available yet.  */
++#define _POSIX_CLOCK_SELECTION	-1
+ 
+ /* Advisory information interfaces could be available in future.  */
+ #define _POSIX_ADVISORY_INFO	0
+diff --git a/sysdeps/posix/clock_getres.c b/sysdeps/posix/clock_getres.c
+index fcd79fd554..1dd02aa449 100644
+--- a/sysdeps/posix/clock_getres.c
++++ b/sysdeps/posix/clock_getres.c
+@@ -52,6 +52,7 @@ __clock_getres (clockid_t clock_id, struct timespec *res)
+   switch (clock_id)
+     {
+     case CLOCK_REALTIME:
++    case CLOCK_MONOTONIC:
+       retval = realtime_getres (res);
+       break;
+ 
+diff --git a/sysdeps/pthread/timer_create.c b/sysdeps/pthread/timer_create.c
+index 9d8a9ea8ae..3430582c09 100644
+--- a/sysdeps/pthread/timer_create.c
++++ b/sysdeps/pthread/timer_create.c
+@@ -48,7 +48,7 @@ timer_create (clockid_t clock_id, struct sigevent *evp, timer_t *timerid)
+       return -1;
+     }
+ 
+-  if (clock_id != CLOCK_REALTIME)
++  if (clock_id != CLOCK_REALTIME && clock_id != CLOCK_MONOTONIC)
+     {
+       __set_errno (EINVAL);
+       return -1;
+-- 
+2.24.0
+
diff --git a/gnu/packages/patches/glibc-bootstrap-system.patch b/gnu/packages/patches/glibc-bootstrap-system.patch
index db6457e939..9c0fac3ff5 100644
--- a/gnu/packages/patches/glibc-bootstrap-system.patch
+++ b/gnu/packages/patches/glibc-bootstrap-system.patch
@@ -3,17 +3,10 @@ and popen(3) need to be tweaked to use the right shell.  For the bootstrap
 glibc, we just use whatever `sh' can be found in $PATH.  The final glibc
 instead uses the hard-coded absolute file name of `bash'.
 
---- a/sysdeps/posix/system.c
-+++ b/sysdeps/posix/system.c
-@@ -140,7 +140,7 @@ do_system (const char *line)
-   __posix_spawnattr_setflags (&spawn_attr,
- 			      POSIX_SPAWN_SETSIGDEF | POSIX_SPAWN_SETSIGMASK);
- 
--  status = __posix_spawn (&pid, SHELL_PATH, 0, &spawn_attr,
-+  status = __posix_spawnp (&pid, SHELL_NAME, 0, &spawn_attr,
- 			  (char *const[]){ (char*) SHELL_NAME,
- 					   (char*) "-c",
- 					   (char *) line, NULL },
+In addition, status should be initialized to 0 and not -1.
+
+diff --git a/libio/iopopen.c b/libio/iopopen.c
+index ebc381ed7c..e0d3ed1bc3 100644
 --- a/libio/iopopen.c
 +++ b/libio/iopopen.c
 @@ -85,7 +85,7 @@ spawn_process (posix_spawn_file_actions_t *fa, FILE *fp, const char *command,
@@ -25,6 +18,28 @@ instead uses the hard-coded absolute file name of `bash'.
  		     (char *const[]){ (char*) "sh", (char*) "-c",
  		     (char *) command, NULL }, __environ) != 0)
      return false;
+diff --git a/sysdeps/posix/system.c b/sysdeps/posix/system.c
+index a03f478fc7..94da6facf3 100644
+--- a/sysdeps/posix/system.c
++++ b/sysdeps/posix/system.c
+@@ -101,7 +101,7 @@ cancel_handler (void *arg)
+ static int
+ do_system (const char *line)
+ {
+-  int status = -1;
++  int status = 0;
+   int ret;
+   pid_t pid;
+   struct sigaction sa;
+@@ -145,7 +145,7 @@ do_system (const char *line)
+   __posix_spawnattr_setflags (&spawn_attr,
+ 			      POSIX_SPAWN_SETSIGDEF | POSIX_SPAWN_SETSIGMASK);
+ 
+-  ret = __posix_spawn (&pid, SHELL_PATH, 0, &spawn_attr,
++  ret = __posix_spawnp (&pid, SHELL_NAME, 0, &spawn_attr,
+ 		       (char *const[]){ (char *) SHELL_NAME,
+ 					(char *) "-c",
+ 					(char *) line, NULL },
 
 --- a/include/spawn.h
 +++ b/include/spawn.h
diff --git a/gnu/packages/patches/glibc-cross-objcopy.patch b/gnu/packages/patches/glibc-cross-objcopy.patch
new file mode 100644
index 0000000000..e4c693aa44
--- /dev/null
+++ b/gnu/packages/patches/glibc-cross-objcopy.patch
@@ -0,0 +1,159 @@
+Use 'powerpc64le-linux-gnu-objcopy' rather than 'objcopy' when cross-compiling
+to powerpc64le-linux-gnu: <https://issues.guix.gnu.org/49417>.
+
+Patch submitted:
+  <https://sourceware.org/pipermail/libc-alpha/2021-July/128333.html>
+
+diff --git a/aclocal.m4 b/aclocal.m4
+index 13a791ffde..5b370c07a2 100644
+--- a/aclocal.m4
++++ b/aclocal.m4
+@@ -118,8 +118,6 @@ AS=`$CC -print-prog-name=as`
+ LD=`$CC -print-prog-name=ld`
+ AR=`$CC -print-prog-name=ar`
+ AC_SUBST(AR)
+-OBJCOPY=`$CC -print-prog-name=objcopy`
+-AC_SUBST(OBJCOPY)
+ GPROF=`$CC -print-prog-name=gprof`
+ AC_SUBST(GPROF)
+ 
+diff --git a/configure b/configure
+index fe0eda1cd5..3a08270734 100755
+--- a/configure
++++ b/configure
+@@ -654,7 +654,6 @@ MAKE
+ LD
+ AS
+ GPROF
+-OBJCOPY
+ AR
+ LN_S
+ INSTALL_DATA
+@@ -689,6 +688,7 @@ sysheaders
+ ac_ct_CXX
+ CXXFLAGS
+ CXX
++OBJCOPY
+ OBJDUMP
+ READELF
+ CPP
+@@ -3054,6 +3054,98 @@ else
+   OBJDUMP="$ac_cv_prog_OBJDUMP"
+ fi
+ 
++if test -n "$ac_tool_prefix"; then
++  # Extract the first word of "${ac_tool_prefix}objcopy", so it can be a program name with args.
++set dummy ${ac_tool_prefix}objcopy; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if ${ac_cv_prog_OBJCOPY+:} false; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$OBJCOPY"; then
++  ac_cv_prog_OBJCOPY="$OBJCOPY" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++    ac_cv_prog_OBJCOPY="${ac_tool_prefix}objcopy"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++OBJCOPY=$ac_cv_prog_OBJCOPY
++if test -n "$OBJCOPY"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJCOPY" >&5
++$as_echo "$OBJCOPY" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_OBJCOPY"; then
++  ac_ct_OBJCOPY=$OBJCOPY
++  # Extract the first word of "objcopy", so it can be a program name with args.
++set dummy objcopy; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if ${ac_cv_prog_ac_ct_OBJCOPY+:} false; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$ac_ct_OBJCOPY"; then
++  ac_cv_prog_ac_ct_OBJCOPY="$ac_ct_OBJCOPY" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++    ac_cv_prog_ac_ct_OBJCOPY="objcopy"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_OBJCOPY=$ac_cv_prog_ac_ct_OBJCOPY
++if test -n "$ac_ct_OBJCOPY"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJCOPY" >&5
++$as_echo "$ac_ct_OBJCOPY" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++  if test "x$ac_ct_OBJCOPY" = x; then
++    OBJCOPY="false"
++  else
++    case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++    OBJCOPY=$ac_ct_OBJCOPY
++  fi
++else
++  OBJCOPY="$ac_cv_prog_OBJCOPY"
++fi
++
+ 
+ # We need the C++ compiler only for testing.
+ ac_ext=cpp
+@@ -4645,8 +4737,6 @@ AS=`$CC -print-prog-name=as`
+ LD=`$CC -print-prog-name=ld`
+ AR=`$CC -print-prog-name=ar`
+ 
+-OBJCOPY=`$CC -print-prog-name=objcopy`
+-
+ GPROF=`$CC -print-prog-name=gprof`
+ 
+ 
+diff --git a/configure.ac b/configure.ac
+index 924af12738..2148cd2ec8 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -53,6 +53,7 @@ AC_SUBST(cross_compiling)
+ AC_PROG_CPP
+ AC_CHECK_TOOL(READELF, readelf, false)
+ AC_CHECK_TOOL(OBJDUMP, objdump, false)
++AC_CHECK_TOOL(OBJCOPY, objcopy, false)
+ 
+ # We need the C++ compiler only for testing.
+ AC_PROG_CXX
diff --git a/gnu/packages/patches/glibc-cross-objdump.patch b/gnu/packages/patches/glibc-cross-objdump.patch
new file mode 100644
index 0000000000..1660d915f7
--- /dev/null
+++ b/gnu/packages/patches/glibc-cross-objdump.patch
@@ -0,0 +1,159 @@
+Arrange so that glibc uses 'TRIPLET-objdump -f' rather than 'objdump -f'
+to determine the 'OUTPUT_FORMAT' value in libc.so when cross-compiling.
+
+Patch submitted upstream:
+  <https://sourceware.org/pipermail/libc-alpha/2021-July/128333.html>.
+
+diff --git a/aclocal.m4 b/aclocal.m4
+index c195c4db56..13a791ffde 100644
+--- a/aclocal.m4
++++ b/aclocal.m4
+@@ -118,8 +118,6 @@ AS=`$CC -print-prog-name=as`
+ LD=`$CC -print-prog-name=ld`
+ AR=`$CC -print-prog-name=ar`
+ AC_SUBST(AR)
+-OBJDUMP=`$CC -print-prog-name=objdump`
+-AC_SUBST(OBJDUMP)
+ OBJCOPY=`$CC -print-prog-name=objcopy`
+ AC_SUBST(OBJCOPY)
+ GPROF=`$CC -print-prog-name=gprof`
+diff --git a/configure b/configure
+index 9619c10991..fe0eda1cd5 100755
+--- a/configure
++++ b/configure
+@@ -655,7 +655,6 @@ LD
+ AS
+ GPROF
+ OBJCOPY
+-OBJDUMP
+ AR
+ LN_S
+ INSTALL_DATA
+@@ -690,6 +689,7 @@ sysheaders
+ ac_ct_CXX
+ CXXFLAGS
+ CXX
++OBJDUMP
+ READELF
+ CPP
+ cross_compiling
+@@ -2962,6 +2962,98 @@ else
+   READELF="$ac_cv_prog_READELF"
+ fi
+ 
++if test -n "$ac_tool_prefix"; then
++  # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
++set dummy ${ac_tool_prefix}objdump; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if ${ac_cv_prog_OBJDUMP+:} false; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$OBJDUMP"; then
++  ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++    ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++OBJDUMP=$ac_cv_prog_OBJDUMP
++if test -n "$OBJDUMP"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
++$as_echo "$OBJDUMP" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_OBJDUMP"; then
++  ac_ct_OBJDUMP=$OBJDUMP
++  # Extract the first word of "objdump", so it can be a program name with args.
++set dummy objdump; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$ac_ct_OBJDUMP"; then
++  ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++    ac_cv_prog_ac_ct_OBJDUMP="objdump"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
++if test -n "$ac_ct_OBJDUMP"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
++$as_echo "$ac_ct_OBJDUMP" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++  if test "x$ac_ct_OBJDUMP" = x; then
++    OBJDUMP="false"
++  else
++    case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++    OBJDUMP=$ac_ct_OBJDUMP
++  fi
++else
++  OBJDUMP="$ac_cv_prog_OBJDUMP"
++fi
++
+ 
+ # We need the C++ compiler only for testing.
+ ac_ext=cpp
+@@ -4553,8 +4645,6 @@ AS=`$CC -print-prog-name=as`
+ LD=`$CC -print-prog-name=ld`
+ AR=`$CC -print-prog-name=ar`
+ 
+-OBJDUMP=`$CC -print-prog-name=objdump`
+-
+ OBJCOPY=`$CC -print-prog-name=objcopy`
+ 
+ GPROF=`$CC -print-prog-name=gprof`
+diff --git a/configure.ac b/configure.ac
+index 34ecbba540..924af12738 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -52,6 +52,7 @@ fi
+ AC_SUBST(cross_compiling)
+ AC_PROG_CPP
+ AC_CHECK_TOOL(READELF, readelf, false)
++AC_CHECK_TOOL(OBJDUMP, objdump, false)
+ 
+ # We need the C++ compiler only for testing.
+ AC_PROG_CXX
diff --git a/gnu/packages/patches/glibc-dl-cache.patch b/gnu/packages/patches/glibc-dl-cache.patch
new file mode 100644
index 0000000000..68c3a94846
--- /dev/null
+++ b/gnu/packages/patches/glibc-dl-cache.patch
@@ -0,0 +1,140 @@
+Read the shared library cache relative to $ORIGIN instead of reading
+from /etc/ld.so.cache.  Also arrange so that this cache takes
+precedence over RUNPATH.
+
+diff --git a/elf/dl-cache.c b/elf/dl-cache.c
+index 93d185e788..e0760a1f40 100644
+--- a/elf/dl-cache.c
++++ b/elf/dl-cache.c
+@@ -171,6 +171,51 @@ _dl_cache_libcmp (const char *p1, const char *p2)
+   return *p1 - *p2;
+ }
+ 
++/* Special value representing the lack of an ld.so cache.  */
++static const char ld_so_cache_lacking[] = "/ld.so cache is lacking";
++
++/* Return the per-application ld.so cache, relative to $ORIGIN, or NULL if
++   that fails for some reason.  Do not return the system-wide LD_SO_CACHE
++   since on a foreign distro it would contain invalid information.  */
++static const char *
++ld_so_cache (void)
++{
++  static const char *loader_cache;
++
++  if (loader_cache == NULL)
++    {
++      static const char store[] = @STORE_DIRECTORY@;
++      const char *origin = _dl_get_origin ();
++
++      /* Check whether ORIGIN is something like "/gnu/store/…-foo/bin".  */
++      if (strncmp (store, origin, strlen (store)) == 0
++	  && origin[sizeof store - 1] == '/')
++	{
++	  char *store_item_end = strchr (origin + sizeof store, '/');
++
++	  if (store_item_end != NULL)
++	    {
++	      static const char suffix[] = "/etc/ld.so.cache";
++	      size_t store_item_len = store_item_end - origin;
++
++	      /* Note: We can't use 'malloc' because it can be interposed.
++		 Likewise, 'strncpy' is not available.  */
++	      char *cache = alloca (strlen (origin) + sizeof suffix);
++
++	      strcpy (cache, origin);
++	      strcpy (cache + store_item_len, suffix);
++
++	      loader_cache = __strdup (cache) ?: ld_so_cache_lacking;
++	    }
++	  else
++	    loader_cache = ld_so_cache_lacking;
++	}
++      else
++	loader_cache = ld_so_cache_lacking;
++    }
++
++  return loader_cache;
++}
+ 
+ /* Look up NAME in ld.so.cache and return the file name stored there, or null
+    if none is found.  The cache is loaded if it was not already.  If loading
+@@ -190,12 +235,15 @@ _dl_load_cache_lookup (const char *name)
+ 
+   /* Print a message if the loading of libs is traced.  */
+   if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_LIBS))
+-    _dl_debug_printf (" search cache=%s\n", LD_SO_CACHE);
++    _dl_debug_printf (" search cache=%s\n", ld_so_cache ());
++
++  if (__glibc_unlikely (ld_so_cache () == ld_so_cache_lacking))
++    return NULL;
+ 
+   if (cache == NULL)
+     {
+       /* Read the contents of the file.  */
+-      void *file = _dl_sysdep_read_whole_file (LD_SO_CACHE, &cachesize,
++      void *file = _dl_sysdep_read_whole_file (ld_so_cache (), &cachesize,
+ 					       PROT_READ);
+ 
+       /* We can handle three different cache file formats here:
+diff --git a/elf/dl-load.c b/elf/dl-load.c
+index f3201e7c14..a69aec3428 100644
+--- a/elf/dl-load.c
++++ b/elf/dl-load.c
+@@ -2152,28 +2152,6 @@ _dl_map_object (struct link_map *loader, const char *name,
+ 			loader ?: GL(dl_ns)[LM_ID_BASE]._ns_loaded,
+ 			LA_SER_LIBPATH, &found_other_class);
+ 
+-      /* Look at the RUNPATH information for this binary.  */
+-      if (fd == -1 && loader != NULL
+-	  && cache_rpath (loader, &loader->l_runpath_dirs,
+-			  DT_RUNPATH, "RUNPATH"))
+-	fd = open_path (name, namelen, mode,
+-			&loader->l_runpath_dirs, &realname, &fb, loader,
+-			LA_SER_RUNPATH, &found_other_class);
+-
+-      if (fd == -1)
+-        {
+-          realname = _dl_sysdep_open_object (name, namelen, &fd);
+-          if (realname != NULL)
+-            {
+-              fd = open_verify (realname, fd,
+-                                &fb, loader ?: GL(dl_ns)[nsid]._ns_loaded,
+-                                LA_SER_CONFIG, mode, &found_other_class,
+-                                false);
+-              if (fd == -1)
+-                free (realname);
+-            }
+-        }
+-
+ #ifdef USE_LDCONFIG
+       if (fd == -1
+ 	  && (__glibc_likely ((mode & __RTLD_SECURE) == 0)
+@@ -2232,6 +2210,28 @@ _dl_map_object (struct link_map *loader, const char *name,
+ 	}
+ #endif
+ 
++      /* Look at the RUNPATH information for this binary.  */
++      if (fd == -1 && loader != NULL
++	  && cache_rpath (loader, &loader->l_runpath_dirs,
++			  DT_RUNPATH, "RUNPATH"))
++	fd = open_path (name, namelen, mode,
++			&loader->l_runpath_dirs, &realname, &fb, loader,
++			LA_SER_RUNPATH, &found_other_class);
++
++      if (fd == -1)
++        {
++          realname = _dl_sysdep_open_object (name, namelen, &fd);
++          if (realname != NULL)
++            {
++              fd = open_verify (realname, fd,
++                                &fb, loader ?: GL(dl_ns)[nsid]._ns_loaded,
++                                LA_SER_CONFIG, mode, &found_other_class,
++                                false);
++              if (fd == -1)
++                free (realname);
++            }
++        }
++
+       /* Finally, try the default path.  */
+       if (fd == -1
+ 	  && ((l = loader ?: GL(dl_ns)[nsid]._ns_loaded) == NULL
diff --git a/gnu/packages/patches/glibc-hurd-clock_gettime_monotonic.patch b/gnu/packages/patches/glibc-hurd-clock_gettime_monotonic.patch
index 1c3fe427f9..e31f99a1ce 100644
--- a/gnu/packages/patches/glibc-hurd-clock_gettime_monotonic.patch
+++ b/gnu/packages/patches/glibc-hurd-clock_gettime_monotonic.patch
@@ -24,18 +24,17 @@ Subject: [PATCH 2/2] Use realtime clock for the monotonic clock.
  4 files changed, 6 insertions(+), 5 deletions(-)
 
 diff --git a/sysdeps/mach/clock_gettime.c b/sysdeps/mach/clock_gettime.c
-index ac3547df3c..af8681ba4e 100644
+index 6862fc8c..be1449bf 100644
 --- a/sysdeps/mach/clock_gettime.c
 +++ b/sysdeps/mach/clock_gettime.c
-@@ -25,7 +25,7 @@
- int
- __clock_gettime (clockid_t clock_id, struct timespec *ts)
- {
--  if (clock_id != CLOCK_REALTIME)
-+  if (clock_id != CLOCK_MONOTONIC && clock_id != CLOCK_REALTIME)
-     {
-       errno = EINVAL;
-       return -1;
+@@ -32,6 +32,7 @@ __clock_gettime (clockid_t clock_id, struct timespec *ts)
+   switch (clock_id) {
+ 
+     case CLOCK_REALTIME:
++    case CLOCK_MONOTONIC:
+       {
+ 	/* __host_get_time can only fail if passed an invalid host_t.
+ 	   __mach_host_self could theoretically fail (producing an
 diff --git a/sysdeps/mach/hurd/bits/posix_opt.h b/sysdeps/mach/hurd/bits/posix_opt.h
 index 0050151332..27b3a28ab7 100644
 --- a/sysdeps/mach/hurd/bits/posix_opt.h
diff --git a/gnu/packages/patches/glibc-skip-c++.patch b/gnu/packages/patches/glibc-skip-c++.patch
new file mode 100644
index 0000000000..b2cbe76d3b
--- /dev/null
+++ b/gnu/packages/patches/glibc-skip-c++.patch
@@ -0,0 +1,31 @@
+When building, say, glibc 2.31 using a compiler that's itself linked
+against 2.33, linking fails with:
+
+  gcc -Wl,-rpath-link=/tmp/guix-build-glibc-2.31.drv-0/build:/tmp/guix-build-glibc-2.31.drv-0/build/math:/tmp/guix-build-glibc-2.31.drv-0/build/elf:/tmp/guix-build-glibc-2.31.drv-0/build/dlfcn:/tmp/guix-build-glibc-2.31.drv-0/build/nss:/tmp/guix-build-glibc-2.31.drv-0/build/nis:/tmp/guix-build-glibc-2.31.drv-0/build/rt:/tmp/guix-build-glibc-2.31.drv-0/build/resolv:/tmp/guix-build-glibc-2.31.drv-0/build/mathvec:/tmp/guix-build-glibc-2.31.drv-0/build/support:/tmp/guix-build-glibc-2.31.drv-0/build/crypt:/tmp/guix-build-glibc-2.31.drv-0/build/nptl -nostdlib -nostartfiles -o /tmp/guix-build-glibc-2.31.drv-0/build/support/links-dso-program    -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both /tmp/guix-build-glibc-2.31.drv-0/build/csu/crt1.o /tmp/guix-build-glibc-2.31.drv-0/build/csu/crti.o `gcc  --print-file-name=crtbegin.o` /tmp/guix-build-glibc-2.31.drv-0/build/support/links-dso-program.o -lstdc++ -lgcc -lgcc_s  -Wl,-dynamic-linker=/gnu/store/...-glibc-2.31/lib/ld-linux-x86-64.so.2  /tmp/guix-build-glibc-2.31.drv-0/build/libc.so.6 /tmp/guix-build-glibc-2.31.drv-0/build/libc_nonshared.a -Wl,--as-needed /tmp/guix-build-glibc-2.31.drv-0/build/elf/ld.so -Wl,--no-as-needed -lgcc  `gcc  --print-file-name=crtend.o` /tmp/guix-build-glibc-2.31.drv-0/build/csu/crtn.o
+  ld: /gnu/store/...-gcc-10.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../libstdc++.so: undefined reference to `fstat64@GLIBC_2.33'
+  ld: /gnu/store/...-gcc-10.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../libstdc++.so: undefined reference to `lstat@GLIBC_2.33'
+  ld: /gnu/store/...-gcc-10.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../libstdc++.so: undefined reference to `stat@GLIBC_2.33'
+  collect2: error: ld returned 1 exit status
+
+This is unsurprising given that libstdc++.so here is linked against 2.33,
+whereas libc.so.6 here is 2.31.
+
+This patch works around it by not building the offending program.
+
+diff --git a/support/Makefile b/support/Makefile
+index bb9889ef..6614943b 100644
+--- a/support/Makefile
++++ b/support/Makefile
+@@ -210,12 +210,7 @@ CFLAGS-support_paths.c = \
+ # -fexcess-precision=standard.
+ CFLAGS-timespec.c += -fexcess-precision=standard
+ 
+-ifeq (,$(CXX))
+ LINKS_DSO_PROGRAM = links-dso-program-c
+-else
+-LINKS_DSO_PROGRAM = links-dso-program
+-LDLIBS-links-dso-program = -lstdc++ -lgcc -lgcc_s $(libunwind)
+-endif
+ 
+ ifeq (yes,$(have-selinux))
+ LDLIBS-$(LINKS_DSO_PROGRAM) += -lselinux
diff --git a/gnu/packages/patches/glibc-static-nss.patch b/gnu/packages/patches/glibc-static-nss.patch
new file mode 100644
index 0000000000..1a9db616cc
--- /dev/null
+++ b/gnu/packages/patches/glibc-static-nss.patch
@@ -0,0 +1,1244 @@
+This patch reinstates support for static NSS, which glibc 2.33 broke:
+
+  https://sourceware.org/bugzilla/show_bug.cgi?id=27959
+
+Patch obtained by running:
+
+  git diff f0c28504a9877be5da3ed1215f2da2d5914bbb0b..f9c8b11ed7726b858cd7b7cea0d3d7c5233d78cf
+  git diff 5e1ce61e3e71fb7ffe53f58fe96e67cb15f94854{^,}
+  git diff 135425a1dd50cbe2b9db0628d6c2b36c7889f30b{^,}
+
+It corresponds to these changes:
+
+  f9c8b11ed7 * nss: Access nss_files through direct references
+  6212bb67f4 * nss_files: Move into libc
+  36861a968a * nss_files: Add generic code for set*ent, end*ent and file open
+  f0c28504a9 * nss_files: Allocate nscd file registration data on the heap
+  5e1ce61e3e * nss: Fix NSS_DECLARE_MODULE_FUNCTIONS handling of _nss_*_endnetgrent
+  135425a1dd * nss: Fix build error with --disable-nscd
+
+... plus a manual fix in 'files-network.c' to address this compilation error:
+
+  nss_files/files-network.c: In function ‘_nss_files_parse_netent’:
+  nss_files/files-network.c:72:20: error: implicit declaration of function ‘__inet_network’; did you mean ‘inet_network’? [-Werror=implicit-function-declaration]
+     72 |    result->n_net = __inet_network (addr);
+	|                    ^~~~~~~~~~~~~~
+  nss_files/files-parse.c:106:3: note: in definition of macro ‘LINE_PARSER’
+    106 |   BODY;               \
+	|   ^~~~
+
+diff --git a/include/libc-symbols.h b/include/libc-symbols.h
+index 127ea656c2..d41ecf4384 100644
+--- a/include/libc-symbols.h
++++ b/include/libc-symbols.h
+@@ -798,29 +798,6 @@ for linking")
+ # define libdl_hidden_data_ver(local, name)
+ #endif
+ 
+-#if IS_IN (libnss_files)
+-# define libnss_files_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
+-# define libnss_files_hidden_tls_proto(name, attrs...) \
+-  hidden_tls_proto (name, ##attrs)
+-# define libnss_files_hidden_def(name) hidden_def (name)
+-# define libnss_files_hidden_weak(name) hidden_weak (name)
+-# define libnss_files_hidden_ver(local, name) hidden_ver (local, name)
+-# define libnss_files_hidden_data_def(name) hidden_data_def (name)
+-# define libnss_files_hidden_tls_def(name) hidden_tls_def (name)
+-# define libnss_files_hidden_data_weak(name) hidden_data_weak (name)
+-# define libnss_files_hidden_data_ver(local, name) hidden_data_ver(local, name)
+-#else
+-# define libnss_files_hidden_proto(name, attrs...)
+-# define libnss_files_hidden_tls_proto(name, attrs...)
+-# define libnss_files_hidden_def(name)
+-# define libnss_files_hidden_weak(name)
+-# define libnss_files_hidden_ver(local, name)
+-# define libnss_files_hidden_data_def(name)
+-# define libnss_files_hidden_tls_def(name)
+-# define libnss_files_hidden_data_weak(name)
+-# define libnss_files_hidden_data_ver(local, name)
+-#endif
+-
+ #if IS_IN (libnsl)
+ # define libnsl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
+ # define libnsl_hidden_tls_proto(name, attrs...) \
+diff --git a/include/netdb.h b/include/netdb.h
+index 82e102ff76..4dcdbb8cd4 100644
+--- a/include/netdb.h
++++ b/include/netdb.h
+@@ -217,7 +217,7 @@ extern enum nss_status _nss_netgroup_parseline (char **cursor,
+ 						struct __netgrent *result,
+ 						char *buffer, size_t buflen,
+ 						int *errnop);
+-libnss_files_hidden_proto (_nss_netgroup_parseline)
++libc_hidden_proto (_nss_netgroup_parseline)
+ 
+ #define DECLARE_NSS_PROTOTYPES(service)					      \
+ extern enum nss_status _nss_ ## service ## _setprotoent (int);		      \
+diff --git a/include/nss_files.h b/include/nss_files.h
+index 6a0dcdb85b..6190cac6be 100644
+--- a/include/nss_files.h
++++ b/include/nss_files.h
+@@ -19,7 +19,11 @@
+ #ifndef _NSS_FILES_H
+ #define _NSS_FILES_H
+ 
++#include <nss.h>
+ #include <stdio.h>
++#if IS_IN (libc)
++#include <libc-lock.h>
++#endif
+ 
+ /* Open PATH for reading, as a data source for nss_files.  */
+ FILE *__nss_files_fopen (const char *path);
+@@ -47,6 +51,63 @@ int __nss_readline_seek (FILE *fp, off64_t offset) attribute_hidden;
+ int __nss_parse_line_result (FILE *fp, off64_t offset, int parse_line_result);
+ libc_hidden_proto (__nss_parse_line_result)
+ 
++/* Per-file data.  Used by the *ent functions that need to preserve
++   state across calls.  */
++struct nss_files_per_file_data
++{
++  FILE *stream;
++#if IS_IN (libc)
++  /* The size of locks changes between libc and nss_files, so this
++     member must be last and is only available in libc.  */
++  __libc_lock_define (, lock);
++#endif
++};
++
++/* File index for __nss_files_data_get.  */
++enum nss_files_file
++  {
++    nss_file_aliasent,
++    nss_file_etherent,
++    nss_file_grent,
++    nss_file_hostent,
++    nss_file_netent,
++    nss_file_protoent,
++    nss_file_pwent,
++    nss_file_rpcent,
++    nss_file_servent,
++    nss_file_sgent,
++    nss_file_spent,
++
++    nss_file_count
++  };
++
++/* Obtains a pointer to the per-file data for FILE, which is written
++   to *PDATA, and tries to open the file at PATH for it.  On success,
++   returns NSS_STATUS_SUCCESS, and the caller must later call
++   __nss_files_data_put.  On failure, NSS_STATUS_TRYAGAIN is returned,
++   and *ERRNOP and *HERRNOP are updated if these pointers are not
++   null.  */
++enum nss_status __nss_files_data_open (struct nss_files_per_file_data **pdata,
++                                       enum nss_files_file file,
++                                       const char *path,
++                                       int *errnop, int *herrnop);
++libc_hidden_proto (__nss_files_data_open)
++
++/* Unlock the per-file data, previously obtained by
++   __nss_files_data_open.  */
++void __nss_files_data_put (struct nss_files_per_file_data *data);
++libc_hidden_proto (__nss_files_data_put)
++
++/* Performs the set*ent operation for FILE.  PATH is the file to
++   open.  */
++enum nss_status __nss_files_data_setent (enum nss_files_file file,
++                                           const char *path);
++libc_hidden_proto (__nss_files_data_setent)
++
++/* Performs the end*ent operation for FILE.  */
++enum nss_status __nss_files_data_endent (enum nss_files_file file);
++libc_hidden_proto (__nss_files_data_endent)
++
+ struct parser_data;
+ 
+ /* Instances of the parse_line function from
+@@ -64,16 +125,25 @@ extern nss_files_parse_line _nss_files_parse_servent;
+ extern nss_files_parse_line _nss_files_parse_sgent;
+ extern nss_files_parse_line _nss_files_parse_spent;
+ 
+-libnss_files_hidden_proto (_nss_files_parse_etherent)
++libc_hidden_proto (_nss_files_parse_etherent)
+ libc_hidden_proto (_nss_files_parse_grent)
+-libnss_files_hidden_proto (_nss_files_parse_netent)
+-libnss_files_hidden_proto (_nss_files_parse_protoent)
++libc_hidden_proto (_nss_files_parse_netent)
++libc_hidden_proto (_nss_files_parse_protoent)
+ libc_hidden_proto (_nss_files_parse_pwent)
+-libnss_files_hidden_proto (_nss_files_parse_rpcent)
+-libnss_files_hidden_proto (_nss_files_parse_servent)
++libc_hidden_proto (_nss_files_parse_rpcent)
++libc_hidden_proto (_nss_files_parse_servent)
+ libc_hidden_proto (_nss_files_parse_sgent)
+ libc_hidden_proto (_nss_files_parse_spent)
+ 
++NSS_DECLARE_MODULE_FUNCTIONS (files)
++#undef DEFINE_NSS_FUNCTION
++#define DEFINE_NSS_FUNCTION(x) libc_hidden_proto (_nss_files_##x)
++#include <nss/function.def>
++#undef DEFINE_NSS_FUNCTION
++
++void _nss_files_init (void (*cb) (size_t, struct traced_file *));
++libc_hidden_proto (_nss_files_init)
++
+ /* Generic implementation of fget*ent_r.  Reads lines from FP until
+    EOF or a successful parse into *RESULT using PARSER.  Returns 0 on
+    success, ENOENT on EOF, ERANGE on too-small buffer.  */
+diff --git a/nss/Makefile b/nss/Makefile
+index 9682a31e20..63a386af18 100644
+--- a/nss/Makefile
++++ b/nss/Makefile
+@@ -31,7 +31,8 @@ routines		= nsswitch getnssent getnssent_r digits_dots \
+ 			  compat-lookup nss_hash nss_files_fopen \
+ 			  nss_readline nss_parse_line_result \
+ 			  nss_fgetent_r nss_module nss_action \
+-			  nss_action_parse nss_database
++			  nss_action_parse nss_database nss_files_data \
++			  nss_files_functions
+ 
+ # These are the databases that go through nss dispatch.
+ # Caution: if you add a database here, you must add its real name
+@@ -98,9 +99,11 @@ subdir-dirs = $(services:%=nss_%)
+ vpath %.c $(subdir-dirs) ../locale/programs ../intl
+ 
+ 
+-libnss_files-routines	:= $(addprefix files-, \
+-			     $(filter-out key, $(databases))) \
+-			   files-initgroups files-init
++routines += \
++  $(addprefix files-, $(filter-out key, $(databases))) \
++  files-init \
++  files-initgroups \
++  # routines
+ 
+ libnss_db-dbs		:= $(addprefix db-,\
+ 				       $(filter-out hosts network key alias,\
+@@ -116,12 +119,9 @@ libnss_compat-routines	:= $(addprefix compat-,grp pwd spwd initgroups) \
+ install-others		+= $(inst_vardbdir)/Makefile
+ 
+ # Build static module into libc if requested
+-libnss_files-inhibit-o	= $(filter-out .os,$(object-suffixes))
+ libnss_db-inhibit-o	= $(filter-out .os,$(object-suffixes))
+ libnss_compat-inhibit-o	= $(filter-out .os,$(object-suffixes))
+ ifeq ($(build-static-nss),yes)
+-routines                += $(libnss_files-routines)
+-static-only-routines    += $(libnss_files-routines)
+ tests-static		+= tst-nss-static
+ endif
+ extra-test-objs		+= nss_test1.os nss_test2.os
+@@ -138,8 +138,6 @@ libnss-libc = $(common-objpfx)linkobj/libc.so
+ # for new links:
+ $(services:%=$(objpfx)libnss_%.so): libc-for-link = $(libnss-libc)
+ 
+-$(objpfx)libnss_db.so: $(objpfx)libnss_files.so
+-
+ $(libnss_db-dbs:%=$(objpfx)%.c): $(objpfx)db-%.c: nss_files/files-%.c
+ 	@rm -f $@.new
+ 	(echo '#define EXTERN_PARSER';\
+diff --git a/nss/Versions b/nss/Versions
+index fdddea104c..e551524aa9 100644
+--- a/nss/Versions
++++ b/nss/Versions
+@@ -19,11 +19,12 @@ libc {
+     __nss_services_lookup2; __nss_next2; __nss_lookup;
+     __nss_hash; __nss_database_get;
+     __nss_files_fopen; __nss_readline; __nss_parse_line_result;
+-  }
+-}
++    __nss_files_data_endent;
++    __nss_files_data_open;
++    __nss_files_data_put;
++    __nss_files_data_setent;
+ 
+-libnss_files {
+-  GLIBC_PRIVATE {
++    # Routines formerly in libnss_files.so.2.
+     _nss_files_setaliasent;
+     _nss_files_endaliasent;
+     _nss_files_getaliasbyname_r;
+@@ -109,6 +110,14 @@ libnss_files {
+   }
+ }
+ 
++libnss_files {
++  GLIBC_PRIVATE {
++    # Keep a version node (with a synthesized local: * directive) so that
++    # __bss_* symbols are hidden on targets that need it.
++    __libnss_files_version_placeholder;
++  }
++}
++
+ libnss_db {
+   GLIBC_PRIVATE {
+     _nss_db_setetherent;
+diff --git a/nss/nss_files/files-XXX.c b/nss/nss_files/files-XXX.c
+index b4b989d9bb..c158a891bd 100644
+--- a/nss/nss_files/files-XXX.c
++++ b/nss/nss_files/files-XXX.c
+@@ -45,10 +45,12 @@
+ # include <netdb.h>
+ # define H_ERRNO_PROTO	, int *herrnop
+ # define H_ERRNO_ARG	, herrnop
++# define H_ERRNO_ARG_OR_NULL herrnop
+ # define H_ERRNO_SET(val) (*herrnop = (val))
+ #else
+ # define H_ERRNO_PROTO
+ # define H_ERRNO_ARG
++# define H_ERRNO_ARG_OR_NULL NULL
+ # define H_ERRNO_SET(val) ((void) 0)
+ #endif
+ 
+@@ -58,15 +60,11 @@
+ # define EXTRA_ARGS_VALUE
+ #endif
+ 
+-/* Locks the static variables in this file.  */
+-__libc_lock_define_initialized (static, lock)
+ 
+ /* Maintenance of the stream open on the database file.  For getXXent
+    operations the stream needs to be held open across calls, the other
+    getXXbyYY operations all use their own stream.  */
+ 
+-static FILE *stream;
+-
+ /* Open database file if not already opened.  */
+ static enum nss_status
+ internal_setent (FILE **stream)
+@@ -91,42 +89,16 @@ internal_setent (FILE **stream)
+ enum nss_status
+ CONCAT(_nss_files_set,ENTNAME) (int stayopen)
+ {
+-  enum nss_status status;
+-
+-  __libc_lock_lock (lock);
+-
+-  status = internal_setent (&stream);
+-
+-  __libc_lock_unlock (lock);
+-
+-  return status;
++  return __nss_files_data_setent (CONCAT (nss_file_, ENTNAME), DATAFILE);
+ }
++libc_hidden_def (CONCAT (_nss_files_set,ENTNAME))
+ 
+-
+-/* Close the database file.  */
+-static void
+-internal_endent (FILE **stream)
+-{
+-  if (*stream != NULL)
+-    {
+-      fclose (*stream);
+-      *stream = NULL;
+-    }
+-}
+-
+-
+-/* Thread-safe, exported version of that.  */
+ enum nss_status
+ CONCAT(_nss_files_end,ENTNAME) (void)
+ {
+-  __libc_lock_lock (lock);
+-
+-  internal_endent (&stream);
+-
+-  __libc_lock_unlock (lock);
+-
+-  return NSS_STATUS_SUCCESS;
++  return __nss_files_data_endent (CONCAT (nss_file_, ENTNAME));
+ }
++libc_hidden_def (CONCAT (_nss_files_end,ENTNAME))
+ 
+ 
+ /* Parsing the database file into `struct STRUCTURE' data structures.  */
+@@ -194,28 +166,22 @@ CONCAT(_nss_files_get,ENTNAME_r) (struct STRUCTURE *result, char *buffer,
+ 				  size_t buflen, int *errnop H_ERRNO_PROTO)
+ {
+   /* Return next entry in host file.  */
+-  enum nss_status status = NSS_STATUS_SUCCESS;
+-
+-  __libc_lock_lock (lock);
+ 
+-  /* Be prepared that the set*ent function was not called before.  */
+-  if (stream == NULL)
+-    {
+-      int save_errno = errno;
+-
+-      status = internal_setent (&stream);
+-
+-      __set_errno (save_errno);
+-    }
+-
+-  if (status == NSS_STATUS_SUCCESS)
+-    status = internal_getent (stream, result, buffer, buflen, errnop
+-			      H_ERRNO_ARG EXTRA_ARGS_VALUE);
++  struct nss_files_per_file_data *data;
++  enum nss_status status = __nss_files_data_open (&data,
++						  CONCAT (nss_file_, ENTNAME),
++						  DATAFILE,
++						  errnop, H_ERRNO_ARG_OR_NULL);
++  if (status != NSS_STATUS_SUCCESS)
++    return status;
+ 
+-  __libc_lock_unlock (lock);
++  status = internal_getent (data->stream, result, buffer, buflen, errnop
++			    H_ERRNO_ARG EXTRA_ARGS_VALUE);
+ 
++  __nss_files_data_put (data);
+   return status;
+ }
++libc_hidden_def (CONCAT (_nss_files_get,ENTNAME_r))
+ 
+ /* Macro for defining lookup functions for this file-based database.
+ 
+@@ -248,8 +214,9 @@ _nss_files_get##name##_r (proto,					      \
+ 	     == NSS_STATUS_SUCCESS)					      \
+ 	{ break_if_match }						      \
+ 									      \
+-      internal_endent (&stream);					      \
++      fclose (stream);							      \
+     }									      \
+ 									      \
+   return status;							      \
+-}
++}									      \
++libc_hidden_def (_nss_files_get##name##_r)
+diff --git a/nss/nss_files/files-alias.c b/nss/nss_files/files-alias.c
+index 30971bfe56..8c6e176ff6 100644
+--- a/nss/nss_files/files-alias.c
++++ b/nss/nss_files/files-alias.c
+@@ -31,18 +31,11 @@
+ #include "nsswitch.h"
+ #include <nss_files.h>
+ 
+-NSS_DECLARE_MODULE_FUNCTIONS (files)
+-
+-/* Locks the static variables in this file.  */
+-__libc_lock_define_initialized (static, lock)
+ 
+ /* Maintenance of the stream open on the database file.  For getXXent
+    operations the stream needs to be held open across calls, the other
+    getXXbyYY operations all use their own stream.  */
+ 
+-static FILE *stream;
+-
+-
+ static enum nss_status
+ internal_setent (FILE **stream)
+ {
+@@ -66,42 +59,16 @@ internal_setent (FILE **stream)
+ enum nss_status
+ _nss_files_setaliasent (void)
+ {
+-  enum nss_status status;
+-
+-  __libc_lock_lock (lock);
+-
+-  status = internal_setent (&stream);
+-
+-  __libc_lock_unlock (lock);
+-
+-  return status;
++  return __nss_files_data_setent (nss_file_aliasent, "/etc/aliases");
+ }
++libc_hidden_def (_nss_files_setaliasent)
+ 
+-
+-/* Close the database file.  */
+-static void
+-internal_endent (FILE **stream)
+-{
+-  if (*stream != NULL)
+-    {
+-      fclose (*stream);
+-      *stream = NULL;
+-    }
+-}
+-
+-
+-/* Thread-safe, exported version of that.  */
+ enum nss_status
+ _nss_files_endaliasent (void)
+ {
+-  __libc_lock_lock (lock);
+-
+-  internal_endent (&stream);
+-
+-  __libc_lock_unlock (lock);
+-
+-  return NSS_STATUS_SUCCESS;
++  return __nss_files_data_endent (nss_file_aliasent);
+ }
++libc_hidden_def (_nss_files_endaliasent)
+ 
+ /* Parsing the database file into `struct aliasent' data structures.  */
+ static enum nss_status
+@@ -131,7 +98,7 @@ get_next_alias (FILE *stream, const char *match, struct aliasent *result,
+       /* Read the first line.  It must contain the alias name and
+ 	 possibly some alias names.  */
+       first_unused[room_left - 1] = '\xff';
+-      line = fgets_unlocked (first_unused, room_left, stream);
++      line = __fgets_unlocked (first_unused, room_left, stream);
+       if (line == NULL)
+ 	/* Nothing to read.  */
+ 	break;
+@@ -220,7 +187,7 @@ get_next_alias (FILE *stream, const char *match, struct aliasent *result,
+ 		      /* If the file does not exist we simply ignore
+ 			 the statement.  */
+ 		      if (listfile != NULL
+-			  && (old_line = strdup (line)) != NULL)
++			  && (old_line = __strdup (line)) != NULL)
+ 			{
+ 			  while (! feof_unlocked (listfile))
+ 			    {
+@@ -232,8 +199,8 @@ get_next_alias (FILE *stream, const char *match, struct aliasent *result,
+ 				}
+ 
+ 			      first_unused[room_left - 1] = '\xff';
+-			      line = fgets_unlocked (first_unused, room_left,
+-						     listfile);
++			      line = __fgets_unlocked (first_unused, room_left,
++						       listfile);
+ 			      if (line == NULL)
+ 				break;
+ 			      if (first_unused[room_left - 1] != '\xff')
+@@ -335,7 +302,7 @@ get_next_alias (FILE *stream, const char *match, struct aliasent *result,
+ 		  /* The just read character is a white space and so
+ 		     can be ignored.  */
+ 		  first_unused[room_left - 1] = '\xff';
+-		  line = fgets_unlocked (first_unused, room_left, stream);
++		  line = __fgets_unlocked (first_unused, room_left, stream);
+ 		  if (line == NULL)
+ 		    {
+ 		      /* Continuation line without any data and
+@@ -369,29 +336,25 @@ _nss_files_getaliasent_r (struct aliasent *result, char *buffer, size_t buflen,
+ 			  int *errnop)
+ {
+   /* Return next entry in host file.  */
+-  enum nss_status status = NSS_STATUS_SUCCESS;
+ 
+-  __libc_lock_lock (lock);
+-
+-  /* Be prepared that the set*ent function was not called before.  */
+-  if (stream == NULL)
+-    status = internal_setent (&stream);
+-
+-  if (status == NSS_STATUS_SUCCESS)
+-    {
+-      result->alias_local = 1;
++  struct nss_files_per_file_data *data;
++  enum nss_status status = __nss_files_data_open (&data, nss_file_aliasent,
++						  "/etc/aliases", errnop, NULL);
++  if (status != NSS_STATUS_SUCCESS)
++    return status;
+ 
+-      /* Read lines until we get a definite result.  */
+-      do
+-	status = get_next_alias (stream, NULL, result, buffer, buflen, errnop);
+-      while (status == NSS_STATUS_RETURN);
+-    }
++  result->alias_local = 1;
+ 
+-  __libc_lock_unlock (lock);
++  /* Read lines until we get a definite result.  */
++  do
++    status = get_next_alias (data->stream, NULL, result, buffer, buflen,
++			     errnop);
++  while (status == NSS_STATUS_RETURN);
+ 
++  __nss_files_data_put (data);
+   return status;
+ }
+-
++libc_hidden_def (_nss_files_getaliasent_r)
+ 
+ enum nss_status
+ _nss_files_getaliasbyname_r (const char *name, struct aliasent *result,
+@@ -418,9 +381,10 @@ _nss_files_getaliasbyname_r (const char *name, struct aliasent *result,
+       do
+ 	status = get_next_alias (stream, name, result, buffer, buflen, errnop);
+       while (status == NSS_STATUS_RETURN);
+-    }
+ 
+-  internal_endent (&stream);
++      fclose (stream);
++    }
+ 
+   return status;
+ }
++libc_hidden_def (_nss_files_getaliasbyname_r)
+diff --git a/nss/nss_files/files-ethers.c b/nss/nss_files/files-ethers.c
+index 2fe7f81e4b..7c2c2b9833 100644
+--- a/nss/nss_files/files-ethers.c
++++ b/nss/nss_files/files-ethers.c
+@@ -20,8 +20,6 @@
+ #include <netinet/if_ether.h>
+ #include <nss.h>
+ 
+-NSS_DECLARE_MODULE_FUNCTIONS (files)
+-
+ struct etherent_data {};
+ 
+ #define ENTNAME		etherent
+diff --git a/nss/nss_files/files-grp.c b/nss/nss_files/files-grp.c
+index 49be38e8b1..a716d948e2 100644
+--- a/nss/nss_files/files-grp.c
++++ b/nss/nss_files/files-grp.c
+@@ -19,8 +19,6 @@
+ #include <grp.h>
+ #include <nss.h>
+ 
+-NSS_DECLARE_MODULE_FUNCTIONS (files)
+-
+ #define STRUCTURE	group
+ #define ENTNAME		grent
+ #define DATABASE	"group"
+diff --git a/nss/nss_files/files-hosts.c b/nss/nss_files/files-hosts.c
+index 2b47ec3e53..d54d91d038 100644
+--- a/nss/nss_files/files-hosts.c
++++ b/nss/nss_files/files-hosts.c
+@@ -26,8 +26,6 @@
+ #include <alloc_buffer.h>
+ #include <nss.h>
+ 
+-NSS_DECLARE_MODULE_FUNCTIONS (files)
+-
+ /* Get implementation for some internal functions.  */
+ #include "../resolv/res_hconf.h"
+ 
+@@ -57,12 +55,13 @@ LINE_PARSER
+    STRING_FIELD (addr, isspace, 1);
+ 
+    /* Parse address.  */
+-   if (inet_pton (af == AF_UNSPEC ? AF_INET : af, addr, entdata->host_addr)
++   if (__inet_pton (af == AF_UNSPEC ? AF_INET : af, addr, entdata->host_addr)
+        > 0)
+      af = af == AF_UNSPEC ? AF_INET : af;
+    else
+      {
+-       if (af == AF_INET && inet_pton (AF_INET6, addr, entdata->host_addr) > 0)
++       if (af == AF_INET
++	   && __inet_pton (AF_INET6, addr, entdata->host_addr) > 0)
+ 	 {
+ 	   if (IN6_IS_ADDR_V4MAPPED (entdata->host_addr))
+ 	     memcpy (entdata->host_addr, entdata->host_addr + 12, INADDRSZ);
+@@ -76,7 +75,7 @@ LINE_PARSER
+ 	     return 0;
+ 	 }
+        else if (af == AF_UNSPEC
+-		&& inet_pton (AF_INET6, addr, entdata->host_addr) > 0)
++		&& __inet_pton (AF_INET6, addr, entdata->host_addr) > 0)
+ 	 af = AF_INET6;
+        else
+ 	 /* Illegal address: ignore line.  */
+@@ -349,7 +348,7 @@ _nss_files_gethostbyname3_r (const char *name, int af, struct hostent *result,
+ 	status = gethostbyname3_multi
+ 	  (stream, name, af, result, buffer, buflen, errnop, herrnop);
+ 
+-      internal_endent (&stream);
++      fclose (stream);
+     }
+ 
+   if (canonp && status == NSS_STATUS_SUCCESS)
+@@ -357,6 +356,7 @@ _nss_files_gethostbyname3_r (const char *name, int af, struct hostent *result,
+ 
+   return status;
+ }
++libc_hidden_def (_nss_files_gethostbyname3_r)
+ 
+ enum nss_status
+ _nss_files_gethostbyname_r (const char *name, struct hostent *result,
+@@ -366,6 +366,7 @@ _nss_files_gethostbyname_r (const char *name, struct hostent *result,
+   return _nss_files_gethostbyname3_r (name, AF_INET, result, buffer, buflen,
+ 				      errnop, herrnop, NULL, NULL);
+ }
++libc_hidden_def (_nss_files_gethostbyname_r)
+ 
+ enum nss_status
+ _nss_files_gethostbyname2_r (const char *name, int af, struct hostent *result,
+@@ -375,6 +376,7 @@ _nss_files_gethostbyname2_r (const char *name, int af, struct hostent *result,
+   return _nss_files_gethostbyname3_r (name, af, result, buffer, buflen,
+ 				      errnop, herrnop, NULL, NULL);
+ }
++libc_hidden_def (_nss_files_gethostbyname2_r)
+ 
+ enum nss_status
+ _nss_files_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat,
+@@ -475,7 +477,7 @@ _nss_files_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat,
+ 	  status = NSS_STATUS_SUCCESS;
+ 	}
+ 
+-      internal_endent (&stream);
++      fclose (stream);
+     }
+   else if (status == NSS_STATUS_TRYAGAIN)
+     {
+@@ -490,3 +492,4 @@ _nss_files_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat,
+ 
+   return status;
+ }
++libc_hidden_def (_nss_files_gethostbyname4_r)
+diff --git a/nss/nss_files/files-init.c b/nss/nss_files/files-init.c
+index 717c9fd334..18ed288d04 100644
+--- a/nss/nss_files/files-init.c
++++ b/nss/nss_files/files-init.c
+@@ -21,8 +21,7 @@
+ #include <string.h>
+ #include <nscd/nscd.h>
+ #include <nss.h>
+-
+-NSS_DECLARE_MODULE_FUNCTIONS (files)
++#include <nss_files.h>
+ 
+ static void
+ register_file (void (*cb) (size_t, struct traced_file *),
+@@ -49,5 +48,6 @@ _nss_files_init (void (*cb) (size_t, struct traced_file *))
+   register_file (cb, servdb, "/etc/services", 0);
+   register_file (cb, netgrdb, "/etc/netgroup", 0);
+ }
++libc_hidden_def (_nss_files_init)
+ 
+ #endif
+diff --git a/nss/nss_files/files-initgroups.c b/nss/nss_files/files-initgroups.c
+index 6fcea40b55..b44211e50b 100644
+--- a/nss/nss_files/files-initgroups.c
++++ b/nss/nss_files/files-initgroups.c
+@@ -28,8 +28,6 @@
+ #include <nss.h>
+ #include <nss_files.h>
+ 
+-NSS_DECLARE_MODULE_FUNCTIONS (files)
+-
+ enum nss_status
+ _nss_files_initgroups_dyn (const char *user, gid_t group, long int *start,
+ 			   long int *size, gid_t **groupsp, long int limit,
+@@ -129,3 +127,4 @@ _nss_files_initgroups_dyn (const char *user, gid_t group, long int *start,
+ 
+   return status == NSS_STATUS_SUCCESS && !any ? NSS_STATUS_NOTFOUND : status;
+ }
++libc_hidden_def (_nss_files_initgroups_dyn)
+diff --git a/nss/nss_files/files-netgrp.c b/nss/nss_files/files-netgrp.c
+index f8c821c2f0..75bfbd9e44 100644
+--- a/nss/nss_files/files-netgrp.c
++++ b/nss/nss_files/files-netgrp.c
+@@ -28,11 +28,9 @@
+ #include "netgroup.h"
+ #include <nss_files.h>
+ 
+-NSS_DECLARE_MODULE_FUNCTIONS (files)
+-
+ #define DATAFILE	"/etc/netgroup"
+ 
+-libnss_files_hidden_proto (_nss_files_endnetgrent)
++libc_hidden_proto (_nss_files_endnetgrent)
+ 
+ #define EXPAND(needed)							      \
+   do									      \
+@@ -152,7 +150,7 @@ _nss_files_setnetgrent (const char *group, struct __netgrent *result)
+ 
+   return status;
+ }
+-
++libc_hidden_def (_nss_files_setnetgrent)
+ 
+ enum nss_status
+ _nss_files_endnetgrent (struct __netgrent *result)
+@@ -164,7 +162,7 @@ _nss_files_endnetgrent (struct __netgrent *result)
+   result->cursor = NULL;
+   return NSS_STATUS_SUCCESS;
+ }
+-libnss_files_hidden_def (_nss_files_endnetgrent)
++libc_hidden_def (_nss_files_endnetgrent)
+ 
+ static char *
+ strip_whitespace (char *str)
+@@ -279,7 +277,7 @@ _nss_netgroup_parseline (char **cursor, struct __netgrent *result,
+ 
+   return status;
+ }
+-libnss_files_hidden_def (_nss_netgroup_parseline)
++libc_hidden_def (_nss_netgroup_parseline)
+ 
+ 
+ enum nss_status
+@@ -293,3 +291,4 @@ _nss_files_getnetgrent_r (struct __netgrent *result, char *buffer,
+ 
+   return status;
+ }
++libc_hidden_def (_nss_files_getnetgrent_r)
+diff --git a/nss/nss_files/files-network.c b/nss/nss_files/files-network.c
+index 9cd7d7dc79..217ed78609 100644
+--- a/nss/nss_files/files-network.c
++++ b/nss/nss_files/files-network.c
+@@ -22,8 +22,6 @@
+ #include <stdint.h>
+ #include <nss.h>
+ 
+-NSS_DECLARE_MODULE_FUNCTIONS (files)
+-
+ #define ENTNAME		netent
+ #define DATABASE	"networks"
+ #define NEED_H_ERRNO
+@@ -71,7 +69,7 @@ LINE_PARSER
+        *cp = '\0';
+        addr = newp;
+      }
+-   result->n_net = inet_network (addr);
++   result->n_net = inet_network (addr);
+    result->n_addrtype = AF_INET;
+ 
+  })
+diff --git a/nss/nss_files/files-parse.c b/nss/nss_files/files-parse.c
+index 68c51c7cbf..997eac573a 100644
+--- a/nss/nss_files/files-parse.c
++++ b/nss/nss_files/files-parse.c
+@@ -74,13 +74,7 @@ struct parser_data
+ /* Export the line parser function so it can be used in nss_db.  */
+ # define parser_stclass /* Global */
+ # define parse_line CONCAT(_nss_files_parse_,ENTNAME)
+-# if IS_IN (libc)
+-/* We are defining one of the functions that actually lives in libc
+-   because it is used to implement fget*ent and suchlike.  */
+-#  define nss_files_parse_hidden_def(name) libc_hidden_def (name)
+-# else
+-#  define nss_files_parse_hidden_def(name) libnss_files_hidden_def (name)
+-# endif
++# define nss_files_parse_hidden_def(name) libc_hidden_def (name)
+ #endif
+ 
+ 
+diff --git a/nss/nss_files/files-proto.c b/nss/nss_files/files-proto.c
+index 98d082c642..13072692c1 100644
+--- a/nss/nss_files/files-proto.c
++++ b/nss/nss_files/files-proto.c
+@@ -19,8 +19,6 @@
+ #include <netdb.h>
+ #include <nss.h>
+ 
+-NSS_DECLARE_MODULE_FUNCTIONS (files)
+-
+ #define ENTNAME		protoent
+ #define DATABASE	"protocols"
+ 
+diff --git a/nss/nss_files/files-pwd.c b/nss/nss_files/files-pwd.c
+index b04165ddde..5c74c6da9b 100644
+--- a/nss/nss_files/files-pwd.c
++++ b/nss/nss_files/files-pwd.c
+@@ -19,8 +19,6 @@
+ #include <pwd.h>
+ #include <nss.h>
+ 
+-NSS_DECLARE_MODULE_FUNCTIONS (files)
+-
+ #define STRUCTURE	passwd
+ #define ENTNAME		pwent
+ #define DATABASE	"passwd"
+diff --git a/nss/nss_files/files-rpc.c b/nss/nss_files/files-rpc.c
+index eeb2725d2c..3dea8f18f2 100644
+--- a/nss/nss_files/files-rpc.c
++++ b/nss/nss_files/files-rpc.c
+@@ -19,8 +19,6 @@
+ #include <rpc/netdb.h>
+ #include <nss.h>
+ 
+-NSS_DECLARE_MODULE_FUNCTIONS (files)
+-
+ #define ENTNAME		rpcent
+ #define DATABASE	"rpc"
+ 
+diff --git a/nss/nss_files/files-service.c b/nss/nss_files/files-service.c
+index f4f0985377..a8d83e094e 100644
+--- a/nss/nss_files/files-service.c
++++ b/nss/nss_files/files-service.c
+@@ -20,8 +20,6 @@
+ #include <netdb.h>
+ #include <nss.h>
+ 
+-NSS_DECLARE_MODULE_FUNCTIONS (files)
+-
+ #define ENTNAME		servent
+ #define DATABASE	"services"
+ 
+diff --git a/nss/nss_files/files-sgrp.c b/nss/nss_files/files-sgrp.c
+index 6b1c9eac02..213a408e7b 100644
+--- a/nss/nss_files/files-sgrp.c
++++ b/nss/nss_files/files-sgrp.c
+@@ -19,8 +19,6 @@
+ #include <gshadow.h>
+ #include <nss.h>
+ 
+-NSS_DECLARE_MODULE_FUNCTIONS (files)
+-
+ #define STRUCTURE	sgrp
+ #define ENTNAME		sgent
+ #define DATABASE	"gshadow"
+diff --git a/nss/nss_files/files-spwd.c b/nss/nss_files/files-spwd.c
+index 976deaf918..d031257a20 100644
+--- a/nss/nss_files/files-spwd.c
++++ b/nss/nss_files/files-spwd.c
+@@ -19,8 +19,6 @@
+ #include <shadow.h>
+ #include <nss.h>
+ 
+-NSS_DECLARE_MODULE_FUNCTIONS (files)
+-
+ #define STRUCTURE	spwd
+ #define ENTNAME		spent
+ #define DATABASE	"shadow"
+diff --git a/nss/nss_files_data.c b/nss/nss_files_data.c
+new file mode 100644
+index 0000000000..80fbfe5fff
+--- /dev/null
++++ b/nss/nss_files_data.c
+@@ -0,0 +1,161 @@
++/* Returns a pointer to the global nss_files data structure.
++   Copyright (C) 2021 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <nss_files.h>
++
++#include <allocate_once.h>
++#include <errno.h>
++#include <netdb.h>
++#include <nss.h>
++#include <stdlib.h>
++
++/* This collects all per file-data.   */
++struct nss_files_data
++{
++  struct nss_files_per_file_data files[nss_file_count];
++};
++
++/* For use with allocate_once.  */
++static void *nss_files_global;
++static void *
++nss_files_global_allocate (void *closure)
++{
++  struct nss_files_data *result = malloc (sizeof (*result));
++  if (result != NULL)
++    {
++      for (int i = 0; i < nss_file_count; ++i)
++        {
++          result->files[i].stream = NULL;
++          __libc_lock_init (result->files[i].lock);
++        }
++    }
++  return result;
++}
++/* Like __nss_files_data_open, but does not perform the open call.  */
++static enum nss_status
++__nss_files_data_get (struct nss_files_per_file_data **pdata,
++                      enum nss_files_file file, int *errnop, int *herrnop)
++{
++  struct nss_files_data *data = allocate_once (&nss_files_global,
++                                               nss_files_global_allocate,
++                                               NULL, NULL);
++  if (data == NULL)
++    {
++      if (errnop != NULL)
++        *errnop = errno;
++      if (herrnop != NULL)
++        {
++          __set_h_errno (NETDB_INTERNAL);
++          *herrnop = NETDB_INTERNAL;
++        }
++      return NSS_STATUS_TRYAGAIN;
++    }
++
++  *pdata = &data->files[file];
++  __libc_lock_lock ((*pdata)->lock);
++  return NSS_STATUS_SUCCESS;
++}
++
++/* Helper function for opening the backing file at PATH.  */
++static enum nss_status
++__nss_files_data_internal_open (struct nss_files_per_file_data *data,
++                                const char *path)
++{
++  enum nss_status status = NSS_STATUS_SUCCESS;
++
++  if (data->stream == NULL)
++    {
++      data->stream = __nss_files_fopen (path);
++
++      if (data->stream == NULL)
++        status = errno == EAGAIN ? NSS_STATUS_TRYAGAIN : NSS_STATUS_UNAVAIL;
++    }
++
++  return status;
++}
++
++
++enum nss_status
++__nss_files_data_open (struct nss_files_per_file_data **pdata,
++                       enum nss_files_file file, const char *path,
++                       int *errnop, int *herrnop)
++{
++  enum nss_status status = __nss_files_data_get (pdata, file, errnop, herrnop);
++  if (status != NSS_STATUS_SUCCESS)
++    return status;
++
++  /* Be prepared that the set*ent function was not called before.  */
++  if ((*pdata)->stream == NULL)
++    {
++      int saved_errno = errno;
++      status = __nss_files_data_internal_open (*pdata, path);
++      __set_errno (saved_errno);
++      if (status != NSS_STATUS_SUCCESS)
++        __nss_files_data_put (*pdata);
++    }
++
++  return status;
++}
++
++libc_hidden_def (__nss_files_data_open)
++
++void
++__nss_files_data_put (struct nss_files_per_file_data *data)
++{
++  __libc_lock_unlock (data->lock);
++}
++libc_hidden_def (__nss_files_data_put)
++
++enum nss_status
++__nss_files_data_setent (enum nss_files_file file, const char *path)
++{
++  struct nss_files_per_file_data *data;
++  enum nss_status status = __nss_files_data_get (&data, file, NULL, NULL);
++  if (status != NSS_STATUS_SUCCESS)
++    return status;
++
++  if (data->stream == NULL)
++    status = __nss_files_data_internal_open (data, path);
++  else
++    rewind (data->stream);
++
++  __nss_files_data_put (data);
++  return status;
++}
++libc_hidden_def (__nss_files_data_setent)
++
++enum nss_status
++__nss_files_data_endent (enum nss_files_file file)
++{
++  /* No cleanup is necessary if not initialized.  */
++  struct nss_files_data *data = atomic_load_acquire (&nss_files_global);
++  if (data == NULL)
++    return NSS_STATUS_SUCCESS;
++
++  struct nss_files_per_file_data *fdata = &data->files[file];
++  __libc_lock_lock (fdata->lock);
++  if (fdata->stream != NULL)
++    {
++      fclose (fdata->stream);
++      fdata->stream = NULL;
++    }
++  __libc_lock_unlock (fdata->lock);
++
++  return NSS_STATUS_SUCCESS;
++}
++libc_hidden_def (__nss_files_data_endent)
+diff --git a/nss/nss_files_functions.c b/nss/nss_files_functions.c
+new file mode 100644
+index 0000000000..85720b4311
+--- /dev/null
++++ b/nss/nss_files_functions.c
+@@ -0,0 +1,43 @@
++/* Direct access for nss_files functions for NSS module loading.
++   Copyright (C) 2021 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <nss_module.h>
++#include <nss_files.h>
++
++void
++__nss_files_functions (nss_module_functions_untyped pointers)
++{
++  void **fptr = pointers;
++
++  /* Functions which are not implemented.  */
++#define _nss_files_getcanonname_r NULL
++#define _nss_files_gethostbyaddr2_r NULL
++#define _nss_files_getpublickey NULL
++#define _nss_files_getsecretkey NULL
++#define _nss_files_netname2user NULL
++
++#undef DEFINE_NSS_FUNCTION
++#define DEFINE_NSS_FUNCTION(x) *fptr++ = _nss_files_##x;
++#include "function.def"
++
++#ifdef PTR_MANGLE
++  void **end = fptr;
++  for (fptr = pointers; fptr != end; ++fptr)
++    PTR_MANGLE (*fptr);
++#endif
++}
+diff --git a/nss/nss_module.c b/nss/nss_module.c
+index 60c070c851..7b42c585a4 100644
+--- a/nss/nss_module.c
++++ b/nss/nss_module.c
+@@ -30,6 +30,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <nss_files.h>
+ 
+ /* Suffix after .so of NSS service modules.  This is a bit of magic,
+    but we assume LIBNSS_FILES_SO looks like "libnss_files.so.2" and we
+@@ -110,10 +111,45 @@ static const function_name nss_function_name_array[] =
+ #include "function.def"
+   };
+ 
++static bool
++module_load_nss_files (struct nss_module *module)
++{
++  if (is_nscd)
++    {
++      void (*cb) (size_t, struct traced_file *) = nscd_init_cb;
++#  ifdef PTR_DEMANGLE
++      PTR_DEMANGLE (cb);
++#  endif
++      _nss_files_init (cb);
++    }
++
++  /* Initialize the function pointers, following the double-checked
++     locking idiom.  */
++  __libc_lock_lock (nss_module_list_lock);
++  switch ((enum nss_module_state) atomic_load_acquire (&module->state))
++    {
++    case nss_module_uninitialized:
++    case nss_module_failed:
++      __nss_files_functions (module->functions.untyped);
++      module->handle = NULL;
++      /* Synchronizes with unlocked __nss_module_load atomic_load_acquire.  */
++      atomic_store_release (&module->state, nss_module_loaded);
++      break;
++    case nss_module_loaded:
++      /* Nothing to clean up.  */
++      break;
++    }
++  __libc_lock_unlock (nss_module_list_lock);
++  return true;
++}
++
+ /* Internal implementation of __nss_module_load.  */
+ static bool
+ module_load (struct nss_module *module)
+ {
++  if (strcmp (module->name, "files") == 0)
++    return module_load_nss_files (module);
++
+   void *handle;
+   {
+     char *shlib_name;
+@@ -360,7 +396,7 @@ __nss_module_freeres (void)
+   struct nss_module *current = nss_module_list;
+   while (current != NULL)
+     {
+-      if (current->state == nss_module_loaded)
++      if (current->state == nss_module_loaded && current->handle != NULL)
+         __libc_dlclose (current->handle);
+ 
+       struct nss_module *next = current->next;
+diff --git a/nss/nss_module.h b/nss/nss_module.h
+index 05c4791d11..c1a1d90b60 100644
+--- a/nss/nss_module.h
++++ b/nss/nss_module.h
+@@ -38,6 +38,10 @@ struct nss_module_functions
+ typedef void *nss_module_functions_untyped[sizeof (struct nss_module_functions)
+                                            / sizeof (void *)];
+ 
++/* Locate the nss_files functions, as if by dlopen/dlsym.  */
++void __nss_files_functions (nss_module_functions_untyped pointers)
++  attribute_hidden;
++
+ /* Initialization state of a NSS module.  */
+ enum nss_module_state
+ {
+diff --git a/nss/nss_readline.c b/nss/nss_readline.c
+index 4b3ecbccc8..a2f397a11f 100644
+--- a/nss/nss_readline.c
++++ b/nss/nss_readline.c
+@@ -40,7 +40,7 @@ __nss_readline (FILE *fp, char *buf, size_t len, off64_t *poffset)
+       *poffset = __ftello64 (fp);
+ 
+       buf[len - 1] = '\xff';        /* Marker to recognize truncation.  */
+-      if (fgets_unlocked (buf, len, fp) == NULL)
++      if (__fgets_unlocked (buf, len, fp) == NULL)
+         {
+           if (feof_unlocked (fp))
+             {
+@@ -61,7 +61,7 @@ __nss_readline (FILE *fp, char *buf, size_t len, off64_t *poffset)
+            line on the next call.  */
+         return __nss_readline_seek (fp, *poffset);
+ 
+-      /* fgets_unlocked succeeded.  */
++      /* __fgets_unlocked succeeded.  */
+ 
+       /* Remove leading whitespace.  */
+       char *p = buf;
+diff --git a/nss/nss.h b/nss/nss.h
+index ae213f9a6c..c6d62adc0f 100644
+--- a/nss/nss.h
++++ b/nss/nss.h
+@@ -196,7 +196,7 @@ typedef enum nss_status nss_setspent (int);
+   extern nss_endgrent _nss_##module##_endgrent;                          \
+   extern nss_endhostent _nss_##module##_endhostent;                      \
+   extern nss_endnetent _nss_##module##_endnetent;                        \
+-  extern nss_endnetgrent _nss_##module##__endnetgrent;                   \
++  extern nss_endnetgrent _nss_##module##_endnetgrent;                    \
+   extern nss_endprotoent _nss_##module##_endprotoent;                    \
+   extern nss_endpwent _nss_##module##_endpwent;                          \
+   extern nss_endrpcent _nss_##module##_endrpcent;                        \
+diff --git a/nss/nss_module.c b/nss/nss_module.c
+index 7b42c585a4..7ea5ad9887 100644
+--- a/nss/nss_module.c
++++ b/nss/nss_module.c
+@@ -114,14 +114,16 @@ static const function_name nss_function_name_array[] =
+ static bool
+ module_load_nss_files (struct nss_module *module)
+ {
++#ifdef USE_NSCD
+   if (is_nscd)
+     {
+       void (*cb) (size_t, struct traced_file *) = nscd_init_cb;
+-#  ifdef PTR_DEMANGLE
++# ifdef PTR_DEMANGLE
+       PTR_DEMANGLE (cb);
+-#  endif
++# endif
+       _nss_files_init (cb);
+     }
++#endif
+ 
+   /* Initialize the function pointers, following the double-checked
+      locking idiom.  */
diff --git a/gnu/packages/patches/gnome-boxes-add-guix-logo.patch b/gnu/packages/patches/gnome-boxes-add-guix-logo.patch
new file mode 100644
index 0000000000..e570675083
--- /dev/null
+++ b/gnu/packages/patches/gnome-boxes-add-guix-logo.patch
@@ -0,0 +1,32 @@
+Taken from upstream commit: 9091c6849652fa083297bc12645d8c57a962874a.
+
+diff --git a/data/osinfo/guix-1.3.xml b/data/osinfo/guix-1.3.xml
+new file mode 100644
+index 00000000..d4e1c167
+--- /dev/null
++++ b/data/osinfo/guix-1.3.xml
+@@ -0,0 +1,9 @@
++<libosinfo version="0.0.1">
++
++  <!-- Please read README.logos for any questions about usage of product logos in Boxes. !-->
++
++  <os id="http://guix.gnu.org/guix/1.3">
++    <logo>https://gitlab.gnome.org/GNOME/gnome-boxes-logos/-/raw/master/logos/guix.svg</logo>
++  </os>
++
++</libosinfo>
+diff --git a/data/osinfo/meson.build b/data/osinfo/meson.build
+index 46ff1570..d5531e60 100644
+--- a/data/osinfo/meson.build
++++ b/data/osinfo/meson.build
+@@ -7,6 +7,7 @@ osinfo_db = [
+   ['freedos-1.2.xml', 'gnome-boxes/osinfo/os/freedos.org'],
+   ['gnome-nightly.xml', 'gnome-boxes/osinfo/os/gnome.org'],
+   ['gnome-3.38.xml', 'gnome-boxes/osinfo/os/gnome.org'],
++  ['guix-1.3.xml', 'gnome-boxes/osinfo/os/guix.gnu.org'],
+   ['manjaro-19.0.xml', 'gnome-boxes/osinfo/os/manjaro.org'],
+   ['nixos-20.03.xml', 'gnome-boxes/osinfo/os/nixos.org'],
+   ['opensuse-10.2.xml', 'gnome-boxes/osinfo/os/opensuse.org'],
+-- 
+2.34.0
+
diff --git a/gnu/packages/patches/gnome-builder-update-libportal.patch b/gnu/packages/patches/gnome-builder-update-libportal.patch
new file mode 100644
index 0000000000..1cf7f32132
--- /dev/null
+++ b/gnu/packages/patches/gnome-builder-update-libportal.patch
@@ -0,0 +1,93 @@
+From b3bfa0df53a3749c3b73cb6c4bad5cab3fa549a1 Mon Sep 17 00:00:00 2001
+From: Abderrahim Kitouni <akitouni@gnome.org>
+Date: Sat, 25 Dec 2021 16:25:43 +0100
+Subject: [PATCH] build: use libportal 0.5
+
+This partly reverts 2aea4bd7d0ced77a7d0778517b4505af5dea2dac
+---
+ build-aux/flatpak/org.gnome.Builder.json                 | 7 ++++---
+ meson.build                                              | 2 +-
+ src/gstyle/gstyle-color-panel.c                          | 2 +-
+ src/plugins/devhelp/gbp-devhelp-page.c                   | 2 +-
+ src/plugins/open-with-external/gbp-owe-workbench-addin.c | 2 +-
+ 5 files changed, 8 insertions(+), 7 deletions(-)
+
+diff --git a/build-aux/flatpak/org.gnome.Builder.json b/build-aux/flatpak/org.gnome.Builder.json
+index 02ac31ede..a32d29b92 100644
+--- a/build-aux/flatpak/org.gnome.Builder.json
++++ b/build-aux/flatpak/org.gnome.Builder.json
+@@ -601,15 +601,16 @@
+             "name" : "libportal",
+             "config-opts" : [
+                 "--libdir=/app/lib",
+-                "--buildtype=debugoptimized"
++                "--buildtype=debugoptimized",
++                "-Dbackends=gtk3"
+             ],
+             "buildsystem" : "meson",
+             "builddir" : true,
+             "sources" : [
+                 {
+                     "type" : "archive",
+-                    "url" : "https://github.com/flatpak/libportal/releases/download/0.4/libportal-0.4.tar.xz",
+-                    "sha256" : "3cd5f50907831cf236b40aa14c5a14ccbbf08828cecb3286efa82ce03cacef28"
++                    "url" : "https://github.com/flatpak/libportal/releases/download/0.5/libportal-0.5.tar.xz",
++                    "sha256" : "d8c8cb18a34e5eeb26a39c94044c955995b01de0e139caac5e18c076cf821b3b"
+                 }
+             ]
+         },
+diff --git a/meson.build b/meson.build
+index 01737034b..494e0d752 100644
+--- a/meson.build
++++ b/meson.build
+@@ -284,7 +284,7 @@ libjsonrpc_glib_dep = dependency('jsonrpc-glib-1.0', version: '>= 3.41.0')
+ libm_dep = cc.find_library('m', required: false)
+ libpangoft2_dep = dependency('pangoft2', version: '>= 1.38.0')
+ libpeas_dep = dependency('libpeas-1.0', version: '>= 1.22.0')
+-libportal_dep = dependency('libportal', version: '>= 0.3', required: false)
++libportal_dep = dependency('libportal-gtk3', required: false)
+ libtemplate_glib_dep = dependency('template-glib-1.0', version: '>= 3.28.0')
+ libvte_dep = dependency('vte-2.91', version: '>= 0.65.0')
+ libwebkit_dep = dependency('webkit2gtk-4.0', version: '>= 2.26', required: false)
+diff --git a/src/gstyle/gstyle-color-panel.c b/src/gstyle/gstyle-color-panel.c
+index 15742a7be..a6295c168 100644
+--- a/src/gstyle/gstyle-color-panel.c
++++ b/src/gstyle/gstyle-color-panel.c
+@@ -30,7 +30,7 @@
+ #include "gstyle-color.h"
+ 
+ #include <libportal/portal.h>
+-#include <libportal/portal-gtk3.h>
++#include <libportal-gtk3/portal-gtk3.h>
+ 
+ #define HSV_TO_SCALE_FACTOR (1.0 / 256.0)
+ #define CIELAB_L_TO_SCALE_FACTOR (100.0 / 256.0)
+diff --git a/src/plugins/devhelp/gbp-devhelp-page.c b/src/plugins/devhelp/gbp-devhelp-page.c
+index 5d5c52b0d..2ac788414 100644
+--- a/src/plugins/devhelp/gbp-devhelp-page.c
++++ b/src/plugins/devhelp/gbp-devhelp-page.c
+@@ -25,7 +25,7 @@
+ #include <webkit2/webkit2.h>
+ 
+ #include <libportal/portal.h>
+-#include <libportal/portal-gtk3.h>
++#include <libportal-gtk3/portal-gtk3.h>
+ 
+ #include "gbp-devhelp-page.h"
+ #include "gbp-devhelp-search.h"
+diff --git a/src/plugins/open-with-external/gbp-owe-workbench-addin.c b/src/plugins/open-with-external/gbp-owe-workbench-addin.c
+index 51d2da844..816fe643f 100644
+--- a/src/plugins/open-with-external/gbp-owe-workbench-addin.c
++++ b/src/plugins/open-with-external/gbp-owe-workbench-addin.c
+@@ -23,7 +23,7 @@
+ #include "gbp-owe-workbench-addin.h"
+ 
+ #include <libportal/portal.h>
+-#include <libportal/portal-gtk3.h>
++#include <libportal-gtk3/portal-gtk3.h>
+ 
+ struct _GbpOweWorkbenchAddin
+ {
+-- 
+GitLab
+
diff --git a/gnu/packages/patches/gnome-control-center-libexecdir.patch b/gnu/packages/patches/gnome-control-center-libexecdir.patch
new file mode 100644
index 0000000000..a5f4988e34
--- /dev/null
+++ b/gnu/packages/patches/gnome-control-center-libexecdir.patch
@@ -0,0 +1,58 @@
+This reverts commit 2007a5b2, which broke installation of the package.
+See: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1579.
+
+diff --git a/meson.build b/meson.build
+index 734810d01..b4a45c60d 100644
+--- a/meson.build
++++ b/meson.build
+@@ -259,6 +259,13 @@ config_h.set('HAVE_WACOM', host_is_linux_not_s390,
+ config_h.set('BUILD_THUNDERBOLT', host_is_linux_not_s390,
+              description: 'Define to 1 to build the Thunderbolt panel')
+ 
++# Check for info panel
++gnome_session_libexecdir = get_option('gnome_session_libexecdir')
++if gnome_session_libexecdir == ''
++  gnome_session_libexecdir = control_center_libexecdir
++endif
++
++
+ gnome = import('gnome')
+ i18n = import('i18n')
+ pkg = import('pkgconfig')
+diff --git a/meson_options.txt b/meson_options.txt
+index 1b7b54810..910226c56 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -1,5 +1,6 @@
+ option('cheese', type: 'boolean', value: true, description: 'build with cheese webcam support')
+ option('documentation', type: 'boolean', value: false, description: 'build documentation')
++option('gnome_session_libexecdir', type: 'string', value: '', description: 'Directory for gnome-session\'s libexecdir')
+ option('ibus', type: 'boolean', value: true, description: 'build with IBus support')
+ option('privileged_group', type: 'string', value: 'wheel', description: 'name of group that has elevated permissions')
+ option('snap', type: 'boolean', value: false, description: 'build with Snap support')
+diff --git a/panels/info-overview/cc-info-overview-panel.c b/panels/info-overview/cc-info-overview-panel.c
+index 6e832eb35..b34030c8c 100644
+--- a/panels/info-overview/cc-info-overview-panel.c
++++ b/panels/info-overview/cc-info-overview-panel.c
+@@ -236,7 +236,7 @@ static char *
+ get_renderer_from_helper (const char **env)
+ {
+   int status;
+-  char *argv[] = { LIBEXECDIR "/gnome-control-center-print-renderer", NULL };
++  char *argv[] = { GNOME_SESSION_DIR "/gnome-session-check-accelerated", NULL };
+   g_auto(GStrv) envp = NULL;
+   g_autofree char *renderer = NULL;
+   g_autoptr(GError) error = NULL;
+diff --git a/panels/info-overview/meson.build b/panels/info-overview/meson.build
+index 2fe10b32c..506b7274e 100644
+--- a/panels/info-overview/meson.build
++++ b/panels/info-overview/meson.build
+@@ -19,7 +19,7 @@ i18n.merge_file(
+ 
+ cflags += [
+   '-DDATADIR="@0@"'.format(control_center_datadir),
+-  '-DLIBEXECDIR="@0@"'.format(control_center_libexecdir),
++  '-DGNOME_SESSION_DIR="@0@"'.format(gnome_session_libexecdir)
+ ]
+ 
+ sources = files(
diff --git a/gnu/packages/patches/gnome-online-miners-tracker-3.patch b/gnu/packages/patches/gnome-online-miners-tracker-3.patch
new file mode 100644
index 0000000000..0f89c56695
--- /dev/null
+++ b/gnu/packages/patches/gnome-online-miners-tracker-3.patch
@@ -0,0 +1,1505 @@
+Apply the following merge requests:
+
+https://gitlab.gnome.org/GNOME/gnome-online-miners/-/merge_requests/3
+https://gitlab.gnome.org/GNOME/gnome-online-miners/-/merge_requests/4
+
+to add tracker 3 support and fix a use after free error.
+
+diff --git a/src/gom-miner.c b/src/gom-miner.c
+index 7147b33..4fb4d80 100644
+--- a/src/gom-miner.c
++++ b/src/gom-miner.c
+@@ -221,6 +221,7 @@ gom_miner_check_pending_jobs (GTask *task)
+     return;
+ 
+   g_task_return_boolean (task, TRUE);
++  g_clear_object (&cleanup_job->self);
+   g_slice_free (CleanupJob, cleanup_job);
+ }
+ 
+@@ -461,7 +462,9 @@ miner_job_process_ready_cb (GObject *source,
+   cleanup_job->pending_jobs = g_list_remove (cleanup_job->pending_jobs,
+                                              account_miner_job);
+ 
++  /* This will free the cleanup job data if there are no more pending jobs. */
+   gom_miner_check_pending_jobs (account_miner_job->parent_task);
++
+   gom_account_miner_job_free (account_miner_job);
+ }
+ 
+@@ -520,10 +523,9 @@ cleanup_old_accounts_done (gpointer data)
+       job->old_datasources = NULL;
+     }
+ 
++  /* This will free the task data if there are no more pending jobs */
+   gom_miner_check_pending_jobs (task);
+ 
+-  g_clear_object (&job->self);
+-
+   return FALSE;
+ }
+ 
+@@ -690,6 +692,8 @@ gom_miner_cleanup_old_accounts (GomMiner *self,
+ {
+   CleanupJob *job = g_slice_new0 (CleanupJob);
+ 
++  g_return_if_fail (GOM_IS_MINER (self));
++
+   job->self = g_object_ref (self);
+   job->content_objects = content_objects;
+   job->acc_objects = acc_objects;
+
+diff --git a/src/gom-application.c b/src/gom-application.c
+index fadd388..9e558f5 100644
+--- a/src/gom-application.c
++++ b/src/gom-application.c
+@@ -229,10 +229,16 @@ gom_application_constructed (GObject *object)
+ {
+   GomApplication *self = GOM_APPLICATION (object);
+   const gchar *display_name;
++  GError *error = NULL;
+ 
+   G_OBJECT_CLASS (gom_application_parent_class)->constructed (object);
+ 
+-  self->miner = g_object_new (self->miner_type, NULL);
++  self->miner = g_initable_new (self->miner_type, NULL, &error, NULL);
++
++  if (self->miner == NULL) {
++    g_error (error->message);
++  }
++
+   display_name = gom_miner_get_display_name (self->miner);
+   gom_dbus_set_display_name (self->skeleton, display_name);
+ }
+diff --git a/src/gom-miner.c b/src/gom-miner.c
+index 7147b33..1dd9bb8 100644
+--- a/src/gom-miner.c
++++ b/src/gom-miner.c
+@@ -28,7 +28,11 @@
+ 
+ #include "gom-miner.h"
+ 
+-G_DEFINE_TYPE (GomMiner, gom_miner, G_TYPE_OBJECT)
++static void gom_miner_initable_interface_init (GInitableIface *iface);
++
++G_DEFINE_TYPE_WITH_CODE (GomMiner, gom_miner, G_TYPE_OBJECT,
++                         G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, gom_miner_initable_interface_init))
++
+ 
+ struct _GomMinerPrivate {
+   GoaClient *client;
+@@ -132,20 +136,21 @@ gom_miner_dispose (GObject *object)
+ }
+ 
+ static void
+-gom_miner_init_goa (GomMiner *self)
++gom_miner_init_goa (GomMiner  *self,
++                    GError   **error)
+ {
+   GoaAccount *account;
+   GoaObject *object;
+   const gchar *provider_type;
+   GList *accounts, *l;
+   GomMinerClass *miner_class = GOM_MINER_GET_CLASS (self);
++  GError *inner_error = NULL;
+ 
+-  self->priv->client = goa_client_new_sync (NULL, &self->priv->client_error);
++  self->priv->client = goa_client_new_sync (NULL, &inner_error);
+ 
+-  if (self->priv->client_error != NULL)
++  if (inner_error)
+     {
+-      g_critical ("Unable to create GoaClient: %s - indexing for %s will not work",
+-                  self->priv->client_error->message, miner_class->goa_provider_type);
++      g_propagate_error (error, inner_error);
+       return;
+     }
+ 
+@@ -170,16 +175,34 @@ gom_miner_init_goa (GomMiner *self)
+   g_list_free_full (accounts, g_object_unref);
+ }
+ 
+-static void
+-gom_miner_constructed (GObject *obj)
++static gboolean
++gom_miner_initable_init (GInitable     *initable,
++                         GCancellable  *cancellable,
++                         GError       **error)
+ {
+-  GomMiner *self = GOM_MINER (obj);
++  GError *inner_error = NULL;
++  GomMiner *self;
+ 
+-  G_OBJECT_CLASS (gom_miner_parent_class)->constructed (obj);
++  self = GOM_MINER (initable);
+ 
+-  gom_miner_init_goa (self);
++  self->priv->connection = tracker_sparql_connection_get (cancellable, &inner_error);
++  if (inner_error)
++    {
++      g_propagate_prefixed_error (error, inner_error, "Unable to connect to Tracker store: ");
++      return FALSE;
++    }
++
++  gom_miner_init_goa (self, &inner_error);
++  if (inner_error)
++    {
++      g_propagate_prefixed_error (error, inner_error, "Unable to connect to GNOME Online Accounts: ");
++      return FALSE;
++    }
++
++  return TRUE;
+ }
+ 
++
+ static void
+ gom_miner_init (GomMiner *self)
+ {
+@@ -187,14 +210,12 @@ gom_miner_init (GomMiner *self)
+ 
+   self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GOM_TYPE_MINER, GomMinerPrivate);
+   self->priv->display_name = g_strdup ("");
++}
+ 
+-  self->priv->connection = tracker_sparql_connection_get (NULL, &self->priv->connection_error);
+-  if (self->priv->connection_error != NULL)
+-    {
+-      g_critical ("Unable to create TrackerSparqlConnection: %s - indexing for %s will not work",
+-                  self->priv->connection_error->message,
+-                  klass->goa_provider_type);
+-    }
++static void
++gom_miner_initable_interface_init (GInitableIface *iface)
++{
++  iface->init = gom_miner_initable_init;
+ }
+ 
+ static void
+@@ -202,7 +223,6 @@ gom_miner_class_init (GomMinerClass *klass)
+ {
+   GObjectClass *oclass = G_OBJECT_CLASS (klass);
+ 
+-  oclass->constructed = gom_miner_constructed;
+   oclass->dispose = gom_miner_dispose;
+ 
+   cleanup_pool = g_thread_pool_new (cleanup_job, NULL, 1, FALSE, NULL);
+diff --git a/configure.ac b/configure.ac
+index 06cba71..6c61247 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -21,7 +21,7 @@ AC_HEADER_STDC
+ 
+ GDATA_MIN_VERSION=0.15.2
+ GFBGRAPH_MIN_VERSION=0.2.2
+-GLIB_MIN_VERSION=2.35.1
++GLIB_MIN_VERSION=2.56.0
+ GOA_MIN_VERSION=3.13.3
+ GRILO_MIN_VERSION=0.3.0
+ ZAPOJIT_MIN_VERSION=0.0.2
+@@ -36,7 +36,7 @@ PKG_CHECK_MODULES(GIO, [gio-2.0 gio-unix-2.0])
+ PKG_CHECK_MODULES(GOA, [goa-1.0 >= $GOA_MIN_VERSION])
+ AC_DEFINE([GOA_API_IS_SUBJECT_TO_CHANGE], [], [We are aware that GOA's API can change])
+ 
+-PKG_CHECK_MODULES(TRACKER, [tracker-miner-2.0 tracker-sparql-2.0])
++PKG_CHECK_MODULES(TRACKER, [tracker-sparql-3.0])
+ 
+ # Facebook
+ AC_ARG_ENABLE([facebook], [AS_HELP_STRING([--enable-facebook], [Enable Facebook miner])], [], [enable_facebook=yes])
+diff --git a/src/gom-application.c b/src/gom-application.c
+index 9e558f5..b435e26 100644
+--- a/src/gom-application.c
++++ b/src/gom-application.c
+@@ -233,7 +233,9 @@ gom_application_constructed (GObject *object)
+ 
+   G_OBJECT_CLASS (gom_application_parent_class)->constructed (object);
+ 
+-  self->miner = g_initable_new (self->miner_type, NULL, &error, NULL);
++  self->miner = g_initable_new (self->miner_type, NULL, &error,
++                                "bus-name", g_application_get_application_id (G_APPLICATION (self)),
++                                NULL);
+ 
+   if (self->miner == NULL) {
+     g_error (error->message);
+diff --git a/src/gom-miner.c b/src/gom-miner.c
+index 1dd9bb8..ba76ebb 100644
+--- a/src/gom-miner.c
++++ b/src/gom-miner.c
+@@ -33,12 +33,13 @@ static void gom_miner_initable_interface_init (GInitableIface *iface);
+ G_DEFINE_TYPE_WITH_CODE (GomMiner, gom_miner, G_TYPE_OBJECT,
+                          G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, gom_miner_initable_interface_init))
+ 
+-
+ struct _GomMinerPrivate {
+   GoaClient *client;
+   GError *client_error;
+ 
++  gchar *bus_name;
+   TrackerSparqlConnection *connection;
++  TrackerEndpointDBus *endpoint;
+   GError *connection_error;
+ 
+   gchar *display_name;
+@@ -62,6 +63,14 @@ typedef struct {
+   gpointer service;
+ } InsertSharedContentData;
+ 
++typedef enum
++{
++    PROP_BUS_NAME = 1,
++    N_PROPERTIES
++} GomMinerProperty;
++
++static GParamSpec *obj_properties[N_PROPERTIES] = { NULL, };
++
+ static GThreadPool *cleanup_pool;
+ 
+ static void cleanup_job (gpointer data, gpointer user_data);
+@@ -135,6 +144,58 @@ gom_miner_dispose (GObject *object)
+   G_OBJECT_CLASS (gom_miner_parent_class)->dispose (object);
+ }
+ 
++static void
++gom_miner_init_database (GomMiner      *self,
++                         GCancellable  *cancellable,
++                         GError       **error)
++{
++  TrackerSparqlConnectionFlags flags;
++  g_autoptr (GFile) store_path = NULL;
++  g_autoptr (GDBusConnection) bus = NULL;
++  GError *inner_error = NULL;
++
++  flags = TRACKER_SPARQL_CONNECTION_FLAGS_FTS_ENABLE_STEMMER |
++          TRACKER_SPARQL_CONNECTION_FLAGS_FTS_ENABLE_UNACCENT |
++          TRACKER_SPARQL_CONNECTION_FLAGS_FTS_ENABLE_STOP_WORDS |
++          TRACKER_SPARQL_CONNECTION_FLAGS_FTS_IGNORE_NUMBERS;
++
++  store_path = g_file_new_build_filename (g_get_user_cache_dir (),
++                                          "gnome-online-miners",
++                                          self->priv->bus_name,
++                                          NULL);
++
++  self->priv->connection = tracker_sparql_connection_new (flags,
++                                                          store_path,
++                                                          tracker_sparql_get_ontology_nepomuk (),
++                                                          cancellable,
++                                                          &inner_error);
++
++  if (inner_error)
++    {
++      g_propagate_error (error, inner_error);
++      return;
++    }
++
++  bus = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &inner_error);
++
++  if (inner_error)
++    {
++      g_propagate_error (error, inner_error);
++      return;
++    }
++
++  self->priv->endpoint = tracker_endpoint_dbus_new (self->priv->connection,
++                                                    bus,
++                                                    NULL, /* object path */
++                                                    cancellable,
++                                                    &inner_error);
++  if (inner_error)
++    {
++      g_propagate_error (error, inner_error);
++      return;
++    }
++}
++
+ static void
+ gom_miner_init_goa (GomMiner  *self,
+                     GError   **error)
+@@ -185,10 +246,10 @@ gom_miner_initable_init (GInitable     *initable,
+ 
+   self = GOM_MINER (initable);
+ 
+-  self->priv->connection = tracker_sparql_connection_get (cancellable, &inner_error);
++  gom_miner_init_database (self, cancellable, &inner_error);
+   if (inner_error)
+     {
+-      g_propagate_prefixed_error (error, inner_error, "Unable to connect to Tracker store: ");
++      g_propagate_prefixed_error (error, inner_error, "Unable to set up Tracker database: ");
+       return FALSE;
+     }
+ 
+@@ -212,6 +273,47 @@ gom_miner_init (GomMiner *self)
+   self->priv->display_name = g_strdup ("");
+ }
+ 
++static void
++gom_miner_set_property (GObject      *object,
++                        guint         property_id,
++                        const GValue *value,
++                        GParamSpec   *pspec)
++{
++  GomMiner *self = GOM_MINER (object);
++
++  switch ((GomMinerProperty) property_id)
++    {
++      case PROP_BUS_NAME:
++        g_free (self->priv->bus_name);
++        self->priv->bus_name = g_value_dup_string (value);
++        break;
++
++      default:
++        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
++        break;
++    }
++}
++
++static void
++gom_miner_get_property (GObject    *object,
++                        guint       property_id,
++                        GValue     *value,
++                        GParamSpec *pspec)
++{
++  GomMiner *self = GOM_MINER (object);
++
++  switch ((GomMinerProperty) property_id)
++    {
++       case PROP_BUS_NAME:
++         g_value_set_string (value, self->priv->bus_name);
++         break;
++
++       default:
++         G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
++         break;
++    }
++}
++
+ static void
+ gom_miner_initable_interface_init (GInitableIface *iface)
+ {
+@@ -224,6 +326,19 @@ gom_miner_class_init (GomMinerClass *klass)
+   GObjectClass *oclass = G_OBJECT_CLASS (klass);
+ 
+   oclass->dispose = gom_miner_dispose;
++  oclass->set_property = gom_miner_set_property;
++  oclass->get_property = gom_miner_get_property;
++
++  obj_properties[PROP_BUS_NAME] = g_param_spec_string ("bus-name",
++                                                       "Bus Name",
++                                                       "D-Bus name of the miner",
++                                                       NULL  /* default value */,
++                                                       G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE |
++                                                       G_PARAM_STATIC_STRINGS);
++
++  g_object_class_install_properties (oclass,
++                                     N_PROPERTIES,
++                                     obj_properties);
+ 
+   cleanup_pool = g_thread_pool_new (cleanup_job, NULL, 1, FALSE, NULL);
+ 
+diff --git a/src/gom-miner.h b/src/gom-miner.h
+index 8f83139..5dcfc8d 100644
+--- a/src/gom-miner.h
++++ b/src/gom-miner.h
+@@ -61,6 +61,7 @@ typedef struct _GomMinerPrivate GomMinerPrivate;
+ typedef struct {
+   GomMiner *miner;
+   TrackerSparqlConnection *connection;
++  gchar *bus_name;
+ 
+   GoaAccount *account;
+   GHashTable *services;
+diff --git a/src/gom-tracker.c b/src/gom-tracker.c
+index 68818c4..5666c16 100644
+--- a/src/gom-tracker.c
++++ b/src/gom-tracker.c
+@@ -408,7 +408,7 @@ gom_tracker_utils_ensure_equipment_resource (TrackerSparqlConnection *connection
+   gchar *retval = NULL;
+   gchar *select = NULL;
+ 
+-  g_return_val_if_fail (TRACKER_SPARQL_IS_CONNECTION (connection), NULL);
++  g_return_val_if_fail (TRACKER_IS_SPARQL_CONNECTION (connection), NULL);
+   g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL);
+   g_return_val_if_fail (error == NULL || *error == NULL, NULL);
+   g_return_val_if_fail (make != NULL || model != NULL, NULL);
+
+diff --git a/src/gom-tracker.c b/src/gom-tracker.c
+index 5666c16..63a4c29 100644
+--- a/src/gom-tracker.c
++++ b/src/gom-tracker.c
+@@ -208,6 +208,6 @@ gom_tracker_sparql_connection_insert_or_replace_triple (TrackerSparqlConnection
+   insert = g_string_new (NULL);
+   g_string_append_printf
+     (insert,
+-     "INSERT OR REPLACE %s { <%s> a nie:InformationElement ; %s %s }",
++     "INSERT OR REPLACE %s { <%s> a nie:InformationElement, nie:DataObject ; %s %s }",
+      graph_str, resource, property_name, quoted);
+   g_free (quoted);
+
+diff --git a/src/gom-facebook-miner.c b/src/gom-facebook-miner.c
+index ff42ca5..fc89096 100644
+--- a/src/gom-facebook-miner.c
++++ b/src/gom-facebook-miner.c
+@@ -70,7 +70,7 @@ account_miner_job_process_photo (GomAccountMinerJob *job,
+     (connection,
+      cancellable, error,
+      &resource_exists,
+-     datasource_urn, identifier,
++     TRACKER_PICTURES_GRAPH, identifier,
+      "nfo:RemoteDataObject", class, NULL);
+ 
+   if (*error != NULL)
+@@ -239,7 +239,7 @@ account_miner_job_process_album (GomAccountMinerJob *job,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_PICTURES_GRAPH, resource,
+      "nie:url", album_link);
+ 
+   if (*error != NULL)
+@@ -248,7 +248,7 @@ account_miner_job_process_album (GomAccountMinerJob *job,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_PICTURES_GRAPH, resource,
+      "nie:description", album_description);
+ 
+   if (*error != NULL)
+@@ -257,7 +257,7 @@ account_miner_job_process_album (GomAccountMinerJob *job,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_PICTURES_GRAPH, resource,
+      "nie:title", album_name);
+ 
+   if (*error != NULL)
+@@ -274,7 +274,7 @@ account_miner_job_process_album (GomAccountMinerJob *job,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_PICTURES_GRAPH, resource,
+      "nco:creator", contact_resource);
+   g_free (contact_resource);
+ 
+@@ -284,7 +284,7 @@ account_miner_job_process_album (GomAccountMinerJob *job,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_PICTURES_GRAPH, resource,
+      "nie:contentCreated", album_created_time);
+ 
+   if (*error != NULL)
+
+diff --git a/src/gom-flickr-miner.c b/src/gom-flickr-miner.c
+index 9ac338e..dc7349e 100644
+--- a/src/gom-flickr-miner.c
++++ b/src/gom-flickr-miner.c
+@@ -143,14 +143,14 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
+     (connection,
+      cancellable, error,
+      &resource_exists,
+-     datasource_urn, identifier,
++     TRACKER_PICTURES_GRAPH, identifier,
+      "nfo:RemoteDataObject", class, NULL);
+ 
+   if (*error != NULL)
+     goto out;
+ 
+   gom_tracker_update_datasource (connection, datasource_urn,
+-                                 resource_exists, identifier, resource,
++                                 resource_exists, TRACKER_PICTURES_GRAPH, resource,
+                                  cancellable, error);
+ 
+   if (*error != NULL)
+@@ -166,7 +166,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
+       parent_resource_urn = gom_tracker_sparql_connection_ensure_resource
+         (connection, cancellable, error,
+          NULL,
+-         datasource_urn, parent_identifier,
++         TRACKER_PICTURES_GRAPH, parent_identifier,
+          "nfo:RemoteDataObject", "nfo:DataContainer", NULL);
+       g_free (parent_identifier);
+ 
+@@ -176,7 +176,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
+       gom_tracker_sparql_connection_insert_or_replace_triple
+         (connection,
+          cancellable, error,
+-         datasource_urn, resource,
++         TRACKER_PICTURES_GRAPH, resource,
+          "nie:isPartOf", parent_resource_urn);
+       g_free (parent_resource_urn);
+ 
+@@ -187,7 +187,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_PICTURES_GRAPH, resource,
+      "nie:title", grl_media_get_title (entry->media));
+ 
+   if (*error != NULL)
+@@ -202,7 +202,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
+   created_time = modification_date = grl_media_get_creation_date (entry->media);
+   new_mtime = g_date_time_to_unix (modification_date);
+   mtime_changed = gom_tracker_update_mtime (connection, new_mtime,
+-                                            resource_exists, identifier, resource,
++                                            resource_exists, TRACKER_PICTURES_GRAPH, resource,
+                                             cancellable, error);
+ 
+   if (*error != NULL)
+@@ -221,7 +221,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
+       gom_tracker_sparql_connection_insert_or_replace_triple
+         (connection,
+          cancellable, error,
+-         datasource_urn, resource,
++         TRACKER_PICTURES_GRAPH, resource,
+          "nie:contentCreated", date);
+       g_free (date);
+     }
+@@ -233,7 +233,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_PICTURES_GRAPH, resource,
+      "nie:url", url);
+ 
+   if (*error != NULL)
+@@ -242,7 +242,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_PICTURES_GRAPH, resource,
+      "nie:description", grl_media_get_description (entry->media));
+ 
+   if (*error != NULL)
+@@ -254,7 +254,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
+       gom_tracker_sparql_connection_insert_or_replace_triple
+         (connection,
+          cancellable, error,
+-         datasource_urn, resource,
++         TRACKER_PICTURES_GRAPH, resource,
+          "nie:mimeType", mime);
+       g_free (mime);
+ 
+@@ -265,7 +265,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
+   contact_resource = gom_tracker_utils_ensure_contact_resource
+     (connection,
+      cancellable, error,
+-     datasource_urn, grl_media_get_author (entry->media));
++     TRACKER_PICTURES_GRAPH, grl_media_get_author (entry->media));
+ 
+   if (*error != NULL)
+     goto out;
+@@ -273,7 +273,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_PICTURES_GRAPH, resource,
+      "nco:creator", contact_resource);
+   g_free (contact_resource);
+ 
+diff --git a/src/gom-gdata-miner.c b/src/gom-gdata-miner.c
+index 7872431..d0deb80 100644
+--- a/src/gom-gdata-miner.c
++++ b/src/gom-gdata-miner.c
+@@ -120,7 +120,7 @@ account_miner_job_process_entry (TrackerSparqlConnection *connection,
+     (connection,
+      cancellable, error,
+      &resource_exists,
+-     datasource_urn, identifier,
++     TRACKER_DOCUMENTS_GRAPH, identifier,
+      "nfo:RemoteDataObject", class, NULL);
+ 
+   if (*error != NULL)
+@@ -187,7 +187,7 @@ account_miner_job_process_entry (TrackerSparqlConnection *connection,
+       parent_resource_urn = gom_tracker_sparql_connection_ensure_resource
+         (connection, cancellable, error,
+          NULL,
+-         datasource_urn, parent_resource_id,
++         GOM_GRAPH, parent_resource_id,
+          "nfo:RemoteDataObject", "nfo:DataContainer", NULL);
+       g_free (parent_resource_id);
+ 
+@@ -219,7 +219,7 @@ account_miner_job_process_entry (TrackerSparqlConnection *connection,
+   gom_tracker_sparql_connection_toggle_favorite
+     (connection,
+      cancellable, error,
+-     resource, starred);
++     TRACKER_PICTURES_GRAPH, resource, starred);
+ 
+   if (*error != NULL)
+     goto out;
+@@ -400,14 +400,14 @@ account_miner_job_process_photo (TrackerSparqlConnection *connection,
+     (connection,
+      cancellable, error,
+      &resource_exists,
+-     datasource_urn, identifier,
++     TRACKER_PICTURES_GRAPH, identifier,
+      "nfo:RemoteDataObject", "nmm:Photo", NULL);
+ 
+   if (*error != NULL)
+     goto out;
+ 
+   gom_tracker_update_datasource (connection, datasource_urn,
+-                                 resource_exists, identifier, resource,
++                                 resource_exists, TRACKER_PICTURES_GRAPH, resource,
+                                  cancellable, error);
+   if (*error != NULL)
+     goto out;
+@@ -566,6 +566,7 @@ account_miner_job_process_photo (TrackerSparqlConnection *connection,
+       equipment_resource = gom_tracker_utils_ensure_equipment_resource (connection,
+                                                                         cancellable,
+                                                                         error,
++                                                                        TRACKER_PICTURES_GRAPH,
+                                                                         make,
+                                                                         model);
+ 
+@@ -665,7 +666,7 @@ account_miner_job_process_album (TrackerSparqlConnection *connection,
+     (connection,
+      cancellable, error,
+      &resource_exists,
+-     datasource_urn, identifier,
++     TRACKER_PICTURES_GRAPH, identifier,
+      "nfo:RemoteDataObject", "nfo:DataContainer",
+      NULL);
+ 
+@@ -674,7 +675,7 @@ account_miner_job_process_album (TrackerSparqlConnection *connection,
+ 
+   gom_tracker_update_datasource
+     (connection, datasource_urn,
+-     resource_exists, identifier, resource,
++     resource_exists, TRACKER_PICTURES_GRAPH, resource,
+      cancellable, error);
+ 
+   if (*error != NULL)
+@@ -685,7 +686,7 @@ account_miner_job_process_album (TrackerSparqlConnection *connection,
+    */
+   new_mtime = gdata_entry_get_updated (GDATA_ENTRY (album));
+   mtime_changed = gom_tracker_update_mtime (connection, new_mtime,
+-                                            resource_exists, identifier, resource,
++                                            resource_exists, TRACKER_PICTURES_GRAPH, resource,
+                                             cancellable, error);
+ 
+   if (*error != NULL)
+@@ -703,7 +704,7 @@ account_miner_job_process_album (TrackerSparqlConnection *connection,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_PICTURES_GRAPH, resource,
+      "nie:url", alternate_uri);
+ 
+   if (*error != NULL)
+@@ -713,7 +714,7 @@ account_miner_job_process_album (TrackerSparqlConnection *connection,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_PICTURES_GRAPH, resource,
+      "nie:description", summary);
+ 
+   if (*error != NULL)
+@@ -723,7 +724,7 @@ account_miner_job_process_album (TrackerSparqlConnection *connection,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_PICTURES_GRAPH, resource,
+      "nie:title", title);
+ 
+   if (*error != NULL)
+@@ -743,7 +744,7 @@ account_miner_job_process_album (TrackerSparqlConnection *connection,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_PICTURES_GRAPH, resource,
+      "nco:creator", contact_resource);
+   g_free (contact_resource);
+ 
+@@ -755,7 +756,7 @@ account_miner_job_process_album (TrackerSparqlConnection *connection,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_PICTURES_GRAPH, resource,
+      "nie:contentCreated", date);
+   g_free (date);
+ 
+@@ -865,7 +866,7 @@ insert_shared_content_photos (TrackerSparqlConnection *connection,
+   if (!gom_tracker_sparql_connection_insert_or_replace_triple (connection,
+                                                                cancellable,
+                                                                &local_error,
+-                                                               datasource_urn,
++                                                               TRACKER_PICTURES_GRAPH,
+                                                                source_urn,
+                                                                "nie:relatedTo",
+                                                                photo_resource_urn))
+@@ -878,7 +879,7 @@ insert_shared_content_photos (TrackerSparqlConnection *connection,
+   if (!gom_tracker_sparql_connection_insert_or_replace_triple (connection,
+                                                                cancellable,
+                                                                &local_error,
+-                                                               datasource_urn,
++                                                               TRACKER_PICTURES_GRAPH,
+                                                                photo_resource_urn,
+                                                                "nie:links",
+                                                                source_urn))
+
+diff --git a/src/gom-media-server-miner.c b/src/gom-media-server-miner.c
+index 490869e..32e08c6 100644
+--- a/src/gom-media-server-miner.c
++++ b/src/gom-media-server-miner.c
+@@ -65,14 +65,14 @@ account_miner_job_process_photo (GomAccountMinerJob *job,
+     (connection,
+      cancellable, error,
+      &resource_exists,
+-     datasource_urn, identifier,
++     TRACKER_PICTURES_GRAPH, identifier,
+      "nfo:RemoteDataObject", class, NULL);
+ 
+   if (*error != NULL)
+     goto out;
+ 
+   gom_tracker_update_datasource (connection, datasource_urn,
+-                                 resource_exists, identifier, resource,
++                                 resource_exists, TRACKER_PICTURES_GRAPH, resource,
+                                  cancellable, error);
+   if (*error != NULL)
+     goto out;
+@@ -81,7 +81,7 @@ account_miner_job_process_photo (GomAccountMinerJob *job,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_PICTURES_GRAPH, resource,
+      "nie:url", photo->url);
+ 
+   if (*error != NULL)
+@@ -90,7 +90,7 @@ account_miner_job_process_photo (GomAccountMinerJob *job,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_PICTURES_GRAPH, resource,
+      "nie:mimeType", photo->mimetype);
+ 
+   if (*error != NULL)
+@@ -99,7 +99,7 @@ account_miner_job_process_photo (GomAccountMinerJob *job,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_PICTURES_GRAPH, resource,
+      "nie:title", photo->name);
+ 
+   if (*error != NULL)
+
+diff --git a/src/gom-miner.c b/src/gom-miner.c
+index ba76ebb..40b111d 100644
+--- a/src/gom-miner.c
++++ b/src/gom-miner.c
+@@ -375,7 +375,7 @@ gom_miner_ensure_datasource (GomMiner *self,
+                           "  <%s> a nie:DataSource ; nao:identifier \"%s\" . "
+                           "  <%s> a nie:InformationElement ; nie:rootElementOf <%s> ; nie:version \"%d\""
+                           "}",
+-                          datasource_urn,
++                          GOM_GRAPH,
+                           datasource_urn, klass->miner_identifier,
+                           root_element_urn, datasource_urn, klass->version);
+ 
+@@ -400,8 +400,8 @@ gom_account_miner_job_query_existing (GomAccountMinerJob *job,
+ 
+   select = g_string_new (NULL);
+   g_string_append_printf (select,
+-                          "SELECT ?urn nao:identifier(?urn) WHERE { ?urn nie:dataSource <%s> }",
+-                          job->datasource_urn);
++                          "SELECT ?urn ?id WHERE { GRAPH <%s> { ?urn nie:dataSource <%s> ; nao:identifier ?id . } }",
++                          GOM_GRAPH, job->datasource_urn);
+ 
+   cursor = tracker_sparql_connection_query (job->connection,
+                                             select->str,
+@@ -414,9 +414,21 @@ gom_account_miner_job_query_existing (GomAccountMinerJob *job,
+ 
+   while (tracker_sparql_cursor_next (cursor, cancellable, error))
+     {
+-      g_hash_table_insert (job->previous_resources,
+-                           g_strdup (tracker_sparql_cursor_get_string (cursor, 1, NULL)),
+-                           g_strdup (tracker_sparql_cursor_get_string (cursor, 0, NULL)));
++      const gchar *urn, *identifier;
++
++      urn = tracker_sparql_cursor_get_string (cursor, 0, NULL);
++      identifier = tracker_sparql_cursor_get_string (cursor, 1, NULL);
++
++      if (identifier != NULL)
++        {
++          g_hash_table_insert (job->previous_resources,
++                               g_strdup (identifier),
++                               g_strdup (urn));
++        }
++      else
++        {
++          g_warning ("Missing identifier for urn %s", urn);
++        }
+     }
+ 
+   g_object_unref (cursor);
+@@ -488,16 +500,19 @@ gom_account_miner_job (GTask *task,
+   if (error != NULL)
+     goto out;
+ 
++  g_debug ("account miner: Querying existing accounts stored in database");
+   gom_account_miner_job_query_existing (job, &error);
+ 
+   if (error != NULL)
+     goto out;
+ 
++  g_debug ("account miner: Querying remote server");
+   gom_account_miner_job_query (job, &error);
+ 
+   if (error != NULL)
+     goto out;
+ 
++  g_debug ("account miner: Removing stale accounts");
+   gom_account_miner_job_cleanup_previous (job, &error);
+ 
+   if (error != NULL)
+@@ -751,10 +766,15 @@ cleanup_job (gpointer data,
+ 
+   /* find all our datasources in the tracker DB */
+   select = g_string_new (NULL);
+-  g_string_append_printf (select, "SELECT ?datasource nie:version(?root) WHERE { "
+-                          "?datasource a nie:DataSource . "
+-                          "?datasource nao:identifier \"%s\" . "
+-                          "OPTIONAL { ?root nie:rootElementOf ?datasource } }",
++  g_string_append_printf (select,
++                          "SELECT ?datasource nie:version(?root) WHERE { "
++                          "  GRAPH <%s> { "
++                          "    ?datasource a nie:DataSource . "
++                          "    ?datasource nao:identifier \"%s\" . "
++                          "    OPTIONAL { ?root nie:rootElementOf ?datasource } "
++                          "  }"
++                          "}",
++                          GOM_GRAPH,
+                           klass->miner_identifier);
+ 
+   cursor = tracker_sparql_connection_query (self->priv->connection,
+
+diff --git a/src/gom-miner.h b/src/gom-miner.h
+index 5dcfc8d..8f83139 100644
+--- a/src/gom-miner.h
++++ b/src/gom-miner.h
+@@ -61,7 +61,6 @@ typedef struct _GomMinerPrivate GomMinerPrivate;
+ typedef struct {
+   GomMiner *miner;
+   TrackerSparqlConnection *connection;
+-  gchar *bus_name;
+ 
+   GoaAccount *account;
+   GHashTable *services;
+
+diff --git a/src/gom-owncloud-miner.c b/src/gom-owncloud-miner.c
+index 34d303b..623f2e1 100644
+--- a/src/gom-owncloud-miner.c
++++ b/src/gom-owncloud-miner.c
+@@ -100,14 +100,14 @@ account_miner_job_process_file (GomAccountMinerJob *job,
+     (connection,
+      cancellable, error,
+      &resource_exists,
+-     datasource_urn, identifier,
++     TRACKER_DOCUMENTS_GRAPH, identifier,
+      "nfo:RemoteDataObject", class, NULL);
+ 
+   if (*error != NULL)
+     goto out;
+ 
+   gom_tracker_update_datasource (connection, datasource_urn,
+-                                 resource_exists, identifier, resource,
++                                 resource_exists, TRACKER_DOCUMENTS_GRAPH, resource,
+                                  cancellable, error);
+ 
+   if (*error != NULL)
+@@ -117,7 +117,7 @@ account_miner_job_process_file (GomAccountMinerJob *job,
+   modification_time = g_date_time_new_from_timeval_local (&tv);
+   new_mtime = g_date_time_to_unix (modification_time);
+   mtime_changed = gom_tracker_update_mtime (connection, new_mtime,
+-                                            resource_exists, identifier, resource,
++                                            resource_exists, TRACKER_DOCUMENTS_GRAPH, resource,
+                                             cancellable, error);
+ 
+   if (*error != NULL)
+@@ -133,7 +133,7 @@ account_miner_job_process_file (GomAccountMinerJob *job,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_DOCUMENTS_GRAPH, resource,
+      "nie:url", uri);
+ 
+   if (*error != NULL)
+@@ -156,7 +156,7 @@ account_miner_job_process_file (GomAccountMinerJob *job,
+           parent_resource_urn = gom_tracker_sparql_connection_ensure_resource
+             (connection, cancellable, error,
+              NULL,
+-             datasource_urn, parent_identifier,
++             GOM_GRAPH, parent_identifier,
+              "nfo:RemoteDataObject", "nfo:DataContainer", NULL);
+           g_checksum_reset (checksum);
+           g_free (parent_identifier);
+@@ -168,7 +168,7 @@ account_miner_job_process_file (GomAccountMinerJob *job,
+           gom_tracker_sparql_connection_insert_or_replace_triple
+             (connection,
+              cancellable, error,
+-             datasource_urn, resource,
++             TRACKER_DOCUMENTS_GRAPH, resource,
+              "nie:isPartOf", parent_resource_urn);
+           g_free (parent_resource_urn);
+ 
+@@ -182,7 +182,7 @@ account_miner_job_process_file (GomAccountMinerJob *job,
+           gom_tracker_sparql_connection_insert_or_replace_triple
+             (connection,
+              cancellable, error,
+-             datasource_urn, resource,
++             TRACKER_DOCUMENTS_GRAPH, resource,
+              "nie:mimeType", mime);
+ 
+           if (*error != NULL)
+@@ -194,7 +194,7 @@ account_miner_job_process_file (GomAccountMinerJob *job,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_DOCUMENTS_GRAPH, resource,
+      "nfo:fileName", display_name);
+ 
+   if (*error != NULL)
+@@ -416,6 +416,11 @@ query_owncloud (GomAccountMinerJob *job,
+   mount = g_volume_get_mount (volume);
+   if (mount == NULL)
+     {
++      g_autofree gchar *volume_name;
++
++      volume_name = g_volume_get_name (volume);
++      g_debug ("Mounting Online Account volume %s", volume_name);
++
+       data.error = error;
+ 
+       context = g_main_context_new ();
+@@ -436,6 +441,7 @@ query_owncloud (GomAccountMinerJob *job,
+     }
+ 
+   root = g_mount_get_root (mount);
++  g_debug ("Got volume from gnome-online-accounts: root is %s", g_file_peek_path (root));
+   account_miner_job_traverse_dir (job, connection, previous_resources, datasource_urn, root, TRUE, cancellable, error);
+ 
+   g_object_unref (root);
+
+diff --git a/src/gom-tracker.c b/src/gom-tracker.c
+index 63a4c29..469583e 100644
+--- a/src/gom-tracker.c
++++ b/src/gom-tracker.c
+@@ -26,16 +26,11 @@
+ #include "gom-tracker.h"
+ #include "gom-utils.h"
+ 
+-static gchar *
+-_tracker_utils_format_into_graph (const gchar *graph)
+-{
+-  return (graph != NULL) ? g_strdup_printf ("INTO <%s> ", graph) : g_strdup ("");
+-}
+-
+ static gboolean
+ gom_tracker_sparql_connection_get_string_attribute (TrackerSparqlConnection *connection,
+                                                     GCancellable *cancellable,
+                                                     GError **error,
++                                                    const gchar *graph,
+                                                     const gchar *resource,
+                                                     const gchar *attribute,
+                                                     gchar **value)
+@@ -45,8 +40,8 @@ gom_tracker_sparql_connection_get_string_attribute (TrackerSparqlConnection *con
+   const gchar *string_value = NULL;
+   gboolean res;
+ 
+-  g_string_append_printf (select, "SELECT ?val { <%s> %s ?val }",
+-                          resource, attribute);
++  g_string_append_printf (select, "SELECT ?val { GRAPH <%s> { <%s> %s ?val } }",
++                          graph, resource, attribute);
+   cursor = tracker_sparql_connection_query (connection,
+                                             select->str,
+                                             cancellable, error);
+@@ -86,7 +81,8 @@ gom_tracker_sparql_connection_ensure_resource (TrackerSparqlConnection *connecti
+                                                const gchar *class,
+                                                ...)
+ {
+-  GString *select, *insert, *inner;
++  GString *select, *inner;
++  gchar *insert;
+   va_list args;
+   const gchar *arg;
+   TrackerSparqlCursor *cursor;
+@@ -98,6 +94,8 @@ gom_tracker_sparql_connection_ensure_resource (TrackerSparqlConnection *connecti
+   gchar *key = NULL, *val = NULL;
+   gboolean exists = FALSE;
+ 
++  g_return_val_if_fail (graph != NULL, NULL);
++
+   /* build the inner query with all the classes */
+   va_start (args, class);
+   inner = g_string_new (NULL);
+@@ -112,7 +110,7 @@ gom_tracker_sparql_connection_ensure_resource (TrackerSparqlConnection *connecti
+   /* query if such a resource is already in the DB */
+   select = g_string_new (NULL);
+   g_string_append_printf (select,
+-                          "SELECT ?urn WHERE { ?urn %s }", inner->str);
++                          "SELECT ?urn WHERE { GRAPH <%s> { ?urn %s } }", graph, inner->str);
+ 
+   cursor = tracker_sparql_connection_query (connection,
+                                             select->str,
+@@ -138,19 +136,12 @@ gom_tracker_sparql_connection_ensure_resource (TrackerSparqlConnection *connecti
+     }
+ 
+   /* not found, create the resource */
+-  insert = g_string_new (NULL);
+-  graph_str = _tracker_utils_format_into_graph (graph);
+-
+-  g_string_append_printf (insert, "INSERT %s { _:res %s }",
+-                          graph_str, inner->str);
+-  g_free (graph_str);
+-  g_string_free (inner, TRUE);
+-
++  insert = g_strdup_printf ("INSERT INTO <%s> { _:res %s }",
++                            graph, inner->str);
+   insert_res =
+-    tracker_sparql_connection_update_blank (connection, insert->str,
++    tracker_sparql_connection_update_blank (connection, insert,
+                                             G_PRIORITY_DEFAULT, NULL, error);
+-
+-  g_string_free (insert, TRUE);
++  g_free (insert);
+ 
+   if (*error != NULL)
+     goto out;
+@@ -194,10 +185,10 @@ gom_tracker_sparql_connection_insert_or_replace_triple (TrackerSparqlConnection
+                                                         const gchar *property_value)
+ {
+   GString *insert;
+-  gchar *graph_str, *quoted;
++  gchar *quoted;
+   gboolean retval = TRUE;
+ 
+-  graph_str = _tracker_utils_format_into_graph (graph);
++  g_return_val_if_fail (graph != NULL, FALSE);
+ 
+   /* the "null" value must not be quoted */
+   if (property_value == NULL)
+@@ -208,8 +199,8 @@ gom_tracker_sparql_connection_insert_or_replace_triple (TrackerSparqlConnection
+   insert = g_string_new (NULL);
+   g_string_append_printf
+     (insert,
+-     "INSERT OR REPLACE %s { <%s> a nie:InformationElement, nie:DataObject ; %s %s }",
+-     graph_str, resource, property_name, quoted);
++     "INSERT OR REPLACE INTO <%s> { <%s> a nie:InformationElement, nie:DataObject ; %s %s }",
++     graph, resource, property_name, quoted);
+   g_free (quoted);
+ 
+   g_debug ("Insert or replace triple: query %s", insert->str);
+@@ -223,8 +214,6 @@ gom_tracker_sparql_connection_insert_or_replace_triple (TrackerSparqlConnection
+   if (*error != NULL)
+     retval = FALSE;
+ 
+-  g_free (graph_str);
+-
+   return retval;
+ }
+ 
+@@ -271,6 +260,7 @@ gboolean
+ gom_tracker_sparql_connection_toggle_favorite (TrackerSparqlConnection *connection,
+                                                GCancellable *cancellable,
+                                                GError **error,
++                                               const gchar *graph,
+                                                const gchar *resource,
+                                                gboolean favorite)
+ {
+@@ -279,15 +269,15 @@ gom_tracker_sparql_connection_toggle_favorite (TrackerSparqlConnection *connecti
+   gboolean retval = TRUE;
+ 
+   if (favorite)
+-    op_str = "INSERT OR REPLACE";
++    op_str = "INSERT OR REPLACE INTO";
+   else
+-    op_str = "DELETE";
++    op_str = "DELETE FROM";
+ 
+   update = g_string_new (NULL);
+   g_string_append_printf
+     (update,
+-     "%s { <%s> nao:hasTag nao:predefined-tag-favorite }",
+-     op_str, resource);
++     "%s <%s> { <%s> nao:hasTag nao:predefined-tag-favorite }",
++     op_str, graph, resource);
+ 
+   g_debug ("Toggle favorite: query %s", update->str);
+ 
+@@ -321,9 +311,13 @@ gom_tracker_utils_ensure_contact_resource (TrackerSparqlConnection *connection,
+   mail_uri = g_strconcat ("mailto:", email, NULL);
+   select = g_string_new (NULL);
+   g_string_append_printf (select,
+-                          "SELECT ?urn WHERE { ?urn a nco:Contact . "
+-                          "?urn nco:hasEmailAddress ?mail . "
+-                          "FILTER (fn:contains(?mail, \"%s\" )) }", mail_uri);
++                          "SELECT ?urn WHERE { "
++                          "  GRAPH <%s> { "
++                          "    ?urn a nco:Contact . "
++                          "    ?urn nco:hasEmailAddress ?mail . "
++                          "    FILTER (fn:contains(?mail, \"%s\" )) "
++                          "  }"
++                          "}", TRACKER_CONTACTS_GRAPH, mail_uri);
+ 
+   cursor = tracker_sparql_connection_query (connection,
+                                             select->str,
+@@ -351,8 +345,9 @@ gom_tracker_utils_ensure_contact_resource (TrackerSparqlConnection *connection,
+   insert = g_string_new (NULL);
+ 
+   g_string_append_printf (insert,
+-                          "INSERT { <%s> a nco:EmailAddress ; nco:emailAddress \"%s\" . "
++                          "INSERT INTO <%s> { <%s> a nco:EmailAddress ; nco:emailAddress \"%s\" . "
+                           "_:res a nco:Contact ; nco:hasEmailAddress <%s> ; nco:fullname \"%s\" . }",
++                          TRACKER_CONTACTS_GRAPH,
+                           mail_uri, email,
+                           mail_uri, fullname);
+ 
+@@ -397,6 +392,7 @@ gchar *
+ gom_tracker_utils_ensure_equipment_resource (TrackerSparqlConnection *connection,
+                                              GCancellable *cancellable,
+                                              GError **error,
++                                             const gchar *graph,
+                                              const gchar *make,
+                                              const gchar *model)
+ {
+@@ -416,7 +412,7 @@ gom_tracker_utils_ensure_equipment_resource (TrackerSparqlConnection *connection
+   equip_uri = tracker_sparql_escape_uri_printf ("urn:equipment:%s:%s:",
+                                                 make != NULL ? make : "",
+                                                 model != NULL ? model : "");
+-  select = g_strdup_printf ("SELECT <%s> WHERE { }", equip_uri);
++  select = g_strdup_printf ("SELECT <%s> WHERE { GRAPH <%s> { } }", equip_uri, graph);
+ 
+   local_error = NULL;
+   cursor = tracker_sparql_connection_query (connection, select, cancellable, &local_error);
+@@ -449,7 +445,8 @@ gom_tracker_utils_ensure_equipment_resource (TrackerSparqlConnection *connection
+     }
+ 
+   /* not found, create the resource */
+-  insert = g_strdup_printf ("INSERT { <%s> a nfo:Equipment ; nfo:manufacturer \"%s\" ; nfo:model \"%s\" }",
++  insert = g_strdup_printf ("INSERT INTO <%s> { <%s> a nfo:Equipment ; nfo:manufacturer \"%s\" ; nfo:model \"%s\" }",
++                            graph,
+                             equip_uri,
+                             make,
+                             model);
+@@ -480,7 +477,7 @@ void
+ gom_tracker_update_datasource (TrackerSparqlConnection  *connection,
+                                const gchar              *datasource_urn,
+                                gboolean                  resource_exists,
+-                               const gchar              *identifier,
++                               const gchar              *graph,
+                                const gchar              *resource,
+                                GCancellable             *cancellable,
+                                GError                  **error)
+@@ -498,7 +495,7 @@ gom_tracker_update_datasource (TrackerSparqlConnection  *connection,
+ 
+       res = gom_tracker_sparql_connection_get_string_attribute
+         (connection, cancellable, error,
+-         resource, "nie:dataSource", &old_value);
++         graph, resource, "nie:dataSource", &old_value);
+       g_clear_error (error);
+ 
+       if (res)
+@@ -514,7 +511,7 @@ gom_tracker_update_datasource (TrackerSparqlConnection  *connection,
+   if (set_datasource)
+     gom_tracker_sparql_connection_set_triple
+       (connection, cancellable, error,
+-       identifier, resource,
++       graph, resource,
+        "nie:dataSource", datasource_urn);
+ }
+ 
+@@ -522,7 +519,7 @@ gboolean
+ gom_tracker_update_mtime (TrackerSparqlConnection  *connection,
+                           gint64                    new_mtime,
+                           gboolean                  resource_exists,
+-                          const gchar              *identifier,
++                          const gchar              *graph,
+                           const gchar              *resource,
+                           GCancellable             *cancellable,
+                           GError                  **error)
+@@ -536,7 +533,7 @@ gom_tracker_update_mtime (TrackerSparqlConnection  *connection,
+     {
+       res = gom_tracker_sparql_connection_get_string_attribute
+         (connection, cancellable, error,
+-         resource, "nie:contentLastModified", &old_value);
++         graph, resource, "nie:contentLastModified", &old_value);
+       g_clear_error (error);
+ 
+       if (res)
+@@ -552,7 +549,7 @@ gom_tracker_update_mtime (TrackerSparqlConnection  *connection,
+   date = gom_iso8601_from_timestamp (new_mtime);
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection, cancellable, error,
+-     identifier, resource,
++     graph, resource,
+      "nie:contentLastModified", date);
+   g_free (date);
+ 
+diff --git a/src/gom-tracker.h b/src/gom-tracker.h
+index 94a39e8..a5ae6fd 100644
+--- a/src/gom-tracker.h
++++ b/src/gom-tracker.h
+@@ -29,6 +29,14 @@
+ 
+ G_BEGIN_DECLS
+ 
++/* The graph where we store account meta information */
++#define GOM_GRAPH "tracker.api.gnome.org/ontology/v3/gnome-online-miners"
++
++/* Graphs where we store content information */
++#define TRACKER_CONTACTS_GRAPH "http://tracker.api.gnome.org/ontology/v3/tracker#Contacts"
++#define TRACKER_DOCUMENTS_GRAPH "http://tracker.api.gnome.org/ontology/v3/tracker#Documents"
++#define TRACKER_PICTURES_GRAPH "http://tracker.api.gnome.org/ontology/v3/tracker#Pictures"
++
+ gchar *gom_tracker_sparql_connection_ensure_resource (TrackerSparqlConnection *connection,
+                                                       GCancellable *cancellable,
+                                                       GError **error,
+@@ -57,6 +65,7 @@ gboolean gom_tracker_sparql_connection_set_triple (TrackerSparqlConnection *conn
+ gboolean gom_tracker_sparql_connection_toggle_favorite (TrackerSparqlConnection *connection,
+                                                         GCancellable *cancellable,
+                                                         GError **error,
++                                                        const gchar *graph,
+                                                         const gchar *resource,
+                                                         gboolean favorite);
+ 
+@@ -69,20 +78,21 @@ gchar* gom_tracker_utils_ensure_contact_resource (TrackerSparqlConnection *conne
+ gchar *gom_tracker_utils_ensure_equipment_resource (TrackerSparqlConnection *connection,
+                                                     GCancellable *cancellable,
+                                                     GError **error,
++                                                    const gchar *graph,
+                                                     const gchar *make,
+                                                     const gchar *model);
+ 
+ void gom_tracker_update_datasource (TrackerSparqlConnection  *connection,
+                                     const gchar              *datasource_urn,
+                                     gboolean                  resource_exists,
+-                                    const gchar              *identifier,
++                                    const gchar              *graph,
+                                     const gchar              *resource,
+                                     GCancellable             *cancellable,
+                                     GError                  **error);
+ gboolean gom_tracker_update_mtime (TrackerSparqlConnection  *connection,
+                                    gint64                    new_mtime,
+                                    gboolean                  resource_exists,
+-                                   const gchar              *identifier,
++                                   const gchar              *graph,
+                                    const gchar              *resource,
+                                    GCancellable             *cancellable,
+                                    GError                  **error);
+diff --git a/src/gom-zpj-miner.c b/src/gom-zpj-miner.c
+index 6dff947..1372de5 100644
+--- a/src/gom-zpj-miner.c
++++ b/src/gom-zpj-miner.c
+@@ -70,14 +70,14 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
+     (connection,
+      cancellable, error,
+      &resource_exists,
+-     datasource_urn, identifier,
++     TRACKER_PICTURES_GRAPH, identifier,
+      "nfo:RemoteDataObject", class, NULL);
+ 
+   if (*error != NULL)
+     goto out;
+ 
+   gom_tracker_update_datasource (connection, datasource_urn,
+-                                 resource_exists, identifier, resource,
++                                 resource_exists, TRACKER_PICTURES_GRAPH, resource,
+                                  cancellable, error);
+ 
+   if (*error != NULL)
+@@ -86,7 +86,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
+   updated_time = zpj_skydrive_entry_get_updated_time (entry);
+   new_mtime = g_date_time_to_unix (updated_time);
+   mtime_changed = gom_tracker_update_mtime (connection, new_mtime,
+-                                            resource_exists, identifier, resource,
++                                            resource_exists, TRACKER_PICTURES_GRAPH, resource,
+                                             cancellable, error);
+ 
+   if (*error != NULL)
+@@ -102,7 +102,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_PICTURES_GRAPH, resource,
+      "nie:url", identifier);
+ 
+   if (*error != NULL)
+@@ -119,7 +119,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
+       parent_resource_urn = gom_tracker_sparql_connection_ensure_resource
+         (connection, cancellable, error,
+          NULL,
+-         datasource_urn, parent_identifier,
++         TRACKER_PICTURES_GRAPH, parent_identifier,
+          "nfo:RemoteDataObject", "nfo:DataContainer", NULL);
+       g_free (parent_identifier);
+ 
+@@ -129,7 +129,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
+       gom_tracker_sparql_connection_insert_or_replace_triple
+         (connection,
+          cancellable, error,
+-         datasource_urn, resource,
++         TRACKER_PICTURES_GRAPH, resource,
+          "nie:isPartOf", parent_resource_urn);
+       g_free (parent_resource_urn);
+ 
+@@ -142,7 +142,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
+           gom_tracker_sparql_connection_insert_or_replace_triple
+             (connection,
+              cancellable, error,
+-             datasource_urn, resource,
++             TRACKER_PICTURES_GRAPH, resource,
+              "nie:mimeType", mime);
+           g_free (mime);
+ 
+@@ -154,7 +154,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_PICTURES_GRAPH, resource,
+      "nie:description", zpj_skydrive_entry_get_description (entry));
+ 
+   if (*error != NULL)
+@@ -163,7 +163,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_PICTURES_GRAPH, resource,
+      "nfo:fileName", name);
+ 
+   if (*error != NULL)
+@@ -180,7 +180,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_PICTURES_GRAPH, resource,
+      "nco:creator", contact_resource);
+   g_free (contact_resource);
+ 
+@@ -192,6 +192,6 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_PICTURES_GRAPH, resource,
+      "nie:contentCreated", date);
+   g_free (date);
+
+diff --git a/src/gom-miner.c b/src/gom-miner.c
+index 40b111d..f9e4be0 100644
+--- a/src/gom-miner.c
++++ b/src/gom-miner.c
+@@ -381,7 +381,6 @@ gom_miner_ensure_datasource (GomMiner *self,
+ 
+   tracker_sparql_connection_update (self->priv->connection,
+                                     datasource_insert->str,
+-                                    G_PRIORITY_DEFAULT,
+                                     cancellable,
+                                     error);
+ 
+@@ -468,7 +467,6 @@ gom_account_miner_job_cleanup_previous (GomAccountMinerJob *job,
+ 
+   tracker_sparql_connection_update (job->connection,
+                                     delete->str,
+-                                    G_PRIORITY_DEFAULT,
+                                     cancellable,
+                                     error);
+ 
+@@ -708,7 +706,6 @@ cleanup_job_do_cleanup (CleanupJob *job, GCancellable *cancellable)
+ 
+   tracker_sparql_connection_update (self->priv->connection,
+                                     update->str,
+-                                    G_PRIORITY_DEFAULT,
+                                     cancellable,
+                                     &error);
+   g_string_free (update, TRUE);
+
+diff --git a/src/gom-tracker.c b/src/gom-tracker.c
+index 469583e..716fc14 100644
+--- a/src/gom-tracker.c
++++ b/src/gom-tracker.c
+@@ -138,9 +138,7 @@ gom_tracker_sparql_connection_ensure_resource (TrackerSparqlConnection *connecti
+   /* not found, create the resource */
+   insert = g_strdup_printf ("INSERT INTO <%s> { _:res %s }",
+                             graph, inner->str);
+-  insert_res =
+-    tracker_sparql_connection_update_blank (connection, insert,
+-                                            G_PRIORITY_DEFAULT, NULL, error);
++  insert_res = tracker_sparql_connection_update_blank (connection, insert, NULL, error);
+   g_free (insert);
+ 
+   if (*error != NULL)
+@@ -205,9 +203,7 @@ gom_tracker_sparql_connection_insert_or_replace_triple (TrackerSparqlConnection
+ 
+   g_debug ("Insert or replace triple: query %s", insert->str);
+ 
+-  tracker_sparql_connection_update (connection, insert->str,
+-                                    G_PRIORITY_DEFAULT, cancellable,
+-                                    error);
++  tracker_sparql_connection_update (connection, insert->str, cancellable, error);
+ 
+   g_string_free (insert, TRUE);
+ 
+@@ -235,9 +231,7 @@ gom_tracker_sparql_connection_set_triple (TrackerSparqlConnection *connection,
+      "DELETE { <%s> %s ?val } WHERE { <%s> %s ?val }", resource,
+      property_name, resource, property_name);
+ 
+-  tracker_sparql_connection_update (connection, delete->str,
+-                                    G_PRIORITY_DEFAULT, cancellable,
+-                                    error);
++  tracker_sparql_connection_update (connection, delete->str, cancellable, error);
+ 
+   g_string_free (delete, TRUE);
+   if (*error != NULL)
+@@ -281,9 +275,7 @@ gom_tracker_sparql_connection_toggle_favorite (TrackerSparqlConnection *connecti
+ 
+   g_debug ("Toggle favorite: query %s", update->str);
+ 
+-  tracker_sparql_connection_update (connection, update->str,
+-                                    G_PRIORITY_DEFAULT, cancellable,
+-                                    error);
++  tracker_sparql_connection_update (connection, update->str, cancellable, error);
+ 
+   g_string_free (update, TRUE);
+ 
+@@ -351,9 +343,7 @@ gom_tracker_utils_ensure_contact_resource (TrackerSparqlConnection *connection,
+                           mail_uri, email,
+                           mail_uri, fullname);
+ 
+-  insert_res =
+-    tracker_sparql_connection_update_blank (connection, insert->str,
+-                                            G_PRIORITY_DEFAULT, cancellable, error);
++  insert_res = tracker_sparql_connection_update_blank (connection, insert->str, cancellable, error);
+ 
+   g_string_free (insert, TRUE);
+ 
+@@ -452,7 +442,7 @@ gom_tracker_utils_ensure_equipment_resource (TrackerSparqlConnection *connection
+                             model);
+ 
+   local_error = NULL;
+-  tracker_sparql_connection_update (connection, insert, G_PRIORITY_DEFAULT, cancellable, &local_error);
++  tracker_sparql_connection_update (connection, insert, cancellable, &local_error);
+   if (local_error != NULL)
+     {
+       g_propagate_error (error, local_error);
diff --git a/gnu/packages/patches/gnome-screenshot-meson-0.60.patch b/gnu/packages/patches/gnome-screenshot-meson-0.60.patch
new file mode 100644
index 0000000000..c80ce9d6a3
--- /dev/null
+++ b/gnu/packages/patches/gnome-screenshot-meson-0.60.patch
@@ -0,0 +1,39 @@
+Fixes build issue with Meson 0.60.0. Taken from upstream
+https://gitlab.gnome.org/GNOME/gnome-screenshot/-/merge_requests/57
+
+From b60dad3c2536c17bd201f74ad8e40eb74385ed9f Mon Sep 17 00:00:00 2001
+From: Jack Hill <jackhill@jackhill.us>
+Date: Thu, 18 Nov 2021 00:46:58 -0500
+Subject: [PATCH] meson: remove extraneous positional argument
+
+* data/meson.build (desktop_file)
+  (metainfo_file): Remove extraneous positional argument.
+
+Closes #186
+---
+ data/meson.build | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/data/meson.build b/data/meson.build
+index fd570b3..4e2e2e8 100644
+--- a/data/meson.build
++++ b/data/meson.build
+@@ -1,7 +1,6 @@
+ gnome = import('gnome')
+ 
+ desktop_file = i18n.merge_file(
+-  'desktop',
+   type: 'desktop',
+   input: 'org.gnome.Screenshot.desktop.in',
+   output: 'org.gnome.Screenshot.desktop',
+@@ -23,7 +22,6 @@ if desktop_file_validate.found()
+ endif
+ 
+ metainfo_file = i18n.merge_file(
+-  'appdata',
+   input: 'org.gnome.Screenshot.metainfo.xml.in',
+   output: 'org.gnome.Screenshot.metainfo.xml',
+   po_dir: join_paths(meson.current_source_dir(), '../po'),
+-- 
+2.33.1
+
diff --git a/gnu/packages/patches/gnome-session-support-elogind.patch b/gnu/packages/patches/gnome-session-support-elogind.patch
new file mode 100644
index 0000000000..b52b4c6855
--- /dev/null
+++ b/gnu/packages/patches/gnome-session-support-elogind.patch
@@ -0,0 +1,73 @@
+This patch, borrowed from Gentoo, allows configuring gnome-sesssion with
+elogind support.
+
+https://gitweb.gentoo.org/repo/gentoo.git/plain/gnome-base/gnome-session/files/gnome-session-3.38.0-meson-Support-elogind.patch?id=5f7fe88af5f888aff58fa0c069c3fe07973c7cd2
+
+From 4454f2a63394b69fba2c900151165ad8b5742f31 Mon Sep 17 00:00:00 2001
+From: Mart Raudsepp <leio@gentoo.org>
+Date: Sun, 15 Mar 2020 14:34:39 +0200
+Subject: [PATCH] meson: Support elogind
+
+---
+ meson.build       | 12 +++++++++---
+ meson_options.txt |  1 +
+ 2 files changed, 10 insertions(+), 3 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index ef5132c6..7f68aaae 100644
+--- a/meson.build
++++ b/meson.build
+@@ -124,8 +124,10 @@ enable_systemd = get_option('systemd')
+ enable_systemd_session = get_option('systemd_session') != 'disable'
+ use_systemd_session = get_option('systemd_session') == 'default'
+ enable_systemd_journal = get_option('systemd_journal')
++enable_elogind = get_option('elogind')
+ enable_consolekit = get_option('consolekit')
+-if enable_systemd or enable_consolekit
++assert(not (enable_systemd and enable_elogind), 'Can not support systemd and elogind at once')
++if enable_systemd or enable_elogind or enable_consolekit
+   session_bin_deps += dependency('gio-unix-2.0', version: glib_req_version)
+ 
+   # Check for systemd
+@@ -152,6 +154,10 @@ if enable_systemd or enable_consolekit
+     endif
+ 
+     session_tracking = 'systemd'
++  elif enable_elogind
++    libelogind_dep = dependency('libelogind', version: '>= 239.4')
++    session_bin_deps += libelogind_dep
++    session_tracking = 'elogind'
+   endif
+ 
+   # Check for ConsoleKit
+@@ -161,7 +167,7 @@ if enable_systemd or enable_consolekit
+ 
+     session_bin_deps += dbus_glib_dep
+ 
+-    if enable_systemd
++    if enable_systemd or enable_elogind
+       session_tracking += ' (with fallback to ConsoleKit)'
+     else
+       session_tracking = 'ConsoleKit'
+@@ -171,7 +177,7 @@ endif
+ if enable_systemd_session
+   assert(enable_systemd, 'Systemd support must be enabled when using systemd session management')
+ endif
+-config_h.set('HAVE_SYSTEMD', enable_systemd)
++config_h.set('HAVE_SYSTEMD', enable_systemd or enable_elogind)
+ config_h.set('ENABLE_SYSTEMD_SESSION', enable_systemd_session)
+ config_h.set('ENABLE_SYSTEMD_JOURNAL', enable_systemd_journal)
+ config_h.set('HAVE_CONSOLEKIT', enable_consolekit)
+diff --git a/meson_options.txt b/meson_options.txt
+index 4c05dc6e..512d1528 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -1,4 +1,5 @@
+ option('deprecation_flags', type: 'boolean', value: false, description: 'use *_DISABLE_DEPRECATED flags')
++option('elogind', type: 'boolean', value: true, description: 'Use elogind')
+ option('session_selector', type: 'boolean', value: false, description: 'enable building a custom session selector dialog')
+ option('systemd', type: 'boolean', value: true, description: 'Use systemd')
+ option('systemd_session', type: 'combo', choices: ['disable', 'enable', 'default'], value: 'default', description: 'Whether to include systemd session support and use it by default')
+-- 
+2.26.2
+
diff --git a/gnu/packages/patches/gnome-shell-CVE-2020-17489.patch b/gnu/packages/patches/gnome-shell-CVE-2020-17489.patch
deleted file mode 100644
index 4b7748950e..0000000000
--- a/gnu/packages/patches/gnome-shell-CVE-2020-17489.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From 05b7aec747282f62212b605249d518280ff80059 Mon Sep 17 00:00:00 2001
-From: Ray Strode <rstrode@redhat.com>
-Date: Mon, 27 Jul 2020 10:58:22 -0400
-Subject: [PATCH] loginDialog: Reset auth prompt on vt switch before fade in
-
-At the moment, if a user switches to the login screen vt,
-the login screen fades in whatever was on screen prior, and
-then does a reset.
-
-It makes more sense to reset first, so we fade in what the
-user is going to interact with instead of what they interacted
-with before.
-
-Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2997
----
- js/gdm/loginDialog.js | 9 ++++-----
- 1 file changed, 4 insertions(+), 5 deletions(-)
-
-diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js
-index c3f90dc58..6b35ebb16 100644
---- a/js/gdm/loginDialog.js
-+++ b/js/gdm/loginDialog.js
-@@ -920,16 +920,15 @@ var LoginDialog = GObject.registerClass({
-         if (this.opacity == 255 && this._authPrompt.verificationStatus == AuthPrompt.AuthPromptStatus.NOT_VERIFYING)
-             return;
- 
-+        if (this._authPrompt.verificationStatus !== AuthPrompt.AuthPromptStatus.NOT_VERIFYING)
-+            this._authPrompt.reset();
-+
-         this._bindOpacity();
-         this.ease({
-             opacity: 255,
-             duration: _FADE_ANIMATION_TIME,
-             mode: Clutter.AnimationMode.EASE_OUT_QUAD,
--            onComplete: () => {
--                if (this._authPrompt.verificationStatus != AuthPrompt.AuthPromptStatus.NOT_VERIFYING)
--                    this._authPrompt.reset();
--                this._unbindOpacity();
--            }
-+            onComplete: () => this._unbindOpacity(),
-         });
-     }
- 
--- 
-2.30.1
-
diff --git a/gnu/packages/patches/gnome-shell-disable-test.patch b/gnu/packages/patches/gnome-shell-disable-test.patch
deleted file mode 100644
index b4c7e73cd7..0000000000
--- a/gnu/packages/patches/gnome-shell-disable-test.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-This test seems to require a D-Bus connection not available in the build
-environment.
-
-diff -ur /tmp/guix-build-gnome-shell-3.34.2.drv-0/gnome-shell-3.34.2/src/st/meson.build b/src/st/meson.build
---- /tmp/guix-build-gnome-shell-3.34.2.drv-0/gnome-shell-3.34.2/src/st/meson.build	1969-12-31 19:00:00.000000000 -0500
-+++ b/src/st/meson.build	2019-12-23 00:46:14.721198022 -0500
-@@ -132,18 +132,6 @@
-   sources: st_enums[1]
- )
- 
--test_theme = executable('test-theme',
--  sources: 'test-theme.c',
--  c_args: st_cflags,
--  dependencies: [mutter_dep, gtk_dep],
--  build_rpath: mutter_typelibdir,
--  link_with: libst
--)
--
--test('CSS styling support', test_theme,
--  workdir: meson.current_source_dir()
--)
--
- libst_gir = gnome.generate_gir(libst,
-   sources: st_gir_sources,
-   nsversion: '1.0',
diff --git a/gnu/packages/patches/gnome-shell-theme.patch b/gnu/packages/patches/gnome-shell-theme.patch
deleted file mode 100644
index 3fa0670c43..0000000000
--- a/gnu/packages/patches/gnome-shell-theme.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-Adjust GNOME-Shell so that it uses a Guix theme by default.
-
-Patch by Ludovic Courtès <ludo@gnu.org>.
-
-diff -ur a/data/gnome-shell-theme.gresource.xml b/data/gnome-shell-theme.gresource.xml
---- a/data/gnome-shell-theme.gresource.xml	2019-12-11 15:06:31.000000000 -0500
-+++ b/data/gnome-shell-theme.gresource.xml	2019-12-21 00:31:55.895866241 -0500
-@@ -19,6 +19,8 @@
-     <file>no-events.svg</file>
-     <file>no-notifications.svg</file>
-     <file>noise-texture.png</file>
-+    <file>guix-background.png</file>
-+    <file>guix-logo.png</file>
-     <file>pad-osd.css</file>
-     <file alias="icons/pointer-double-click-symbolic.svg">pointer-double-click-symbolic.svg</file>
-     <file alias="icons/pointer-drag-symbolic.svg">pointer-drag-symbolic.svg</file>
-diff -ur a/data/theme/gnome-shell-sass/_common.scss b/data/theme/gnome-shell-sass/_common.scss
---- a/data/theme/gnome-shell-sass/_common.scss	2019-12-11 15:06:31.000000000 -0500
-+++ b/data/theme/gnome-shell-sass/_common.scss	2019-12-21 00:33:49.495832135 -0500
-@@ -1994,7 +1994,16 @@
-   }
- }
- 
--  .login-dialog-logo-bin { padding: 24px 0px; }
-+  .login-dialog-logo-bin {
-+      /* Make it a bit narrower than .login-dialog-user-list.  */
-+      width: 12em;
-+      height: 8em;
-+      background: url(resource:///org/gnome/shell/theme/guix-logo.png);
-+      background-color: transparent;
-+      background-repeat: no-repeat;
-+      background-size: contain;
-+      background-position: center; }
-+
-   .login-dialog-banner { color: darken($osd_fg_color,10%); }
-   .login-dialog-button-box { spacing: 5px; }
-   .login-dialog-message-warning { color: $warning_color; }
-@@ -2143,9 +2152,10 @@
- }
- 
- #lockDialogGroup {
--  background: lighten(#2e3436, 8%) url(resource:///org/gnome/shell/theme/noise-texture.png);
--  background-repeat: repeat;
--}
-+  background: lighten(#2e3436, 8%) url(resource:///org/gnome/shell/theme/guix-background.png);
-+  background-repeat: no-repeat;
-+  background-size: cover;
-+  background-position: center; }
- 
- #screenShieldNotifications {
-   StButton#vhandle, StButton#hhandle {
diff --git a/gnu/packages/patches/gnome-todo-delete-esource-duplicate.patch b/gnu/packages/patches/gnome-todo-delete-esource-duplicate.patch
deleted file mode 100644
index c680e86495..0000000000
--- a/gnu/packages/patches/gnome-todo-delete-esource-duplicate.patch
+++ /dev/null
@@ -1,10 +0,0 @@
-From: Emmanuele Bassi <ebassi@gnome.org>
-
-See also: https://gitlab.gnome.org/GNOME/gnome-todo/commit/6cdabc4dd0c6c804a093b94c269461ce376fed4f
---- gnome-todo-3.28.1/plugins/eds/gtd-eds-autoptr.h.orig	2020-05-06 14:20:49.589902539 +0200
-+++ gnome-todo-3.28.1/plugins/eds/gtd-eds-autoptr.h	2020-05-06 14:20:54.593919721 +0200
-@@ -25,4 +25,3 @@
- G_DEFINE_AUTOPTR_CLEANUP_FUNC (ECalComponent, g_object_unref);
- G_DEFINE_AUTOPTR_CLEANUP_FUNC (ECalComponentId, e_cal_component_free_id);
- G_DEFINE_AUTOPTR_CLEANUP_FUNC (ECalClient, g_object_unref);
--G_DEFINE_AUTOPTR_CLEANUP_FUNC (ESource, g_object_unref);
diff --git a/gnu/packages/patches/gnome-todo-libportal.patch b/gnu/packages/patches/gnome-todo-libportal.patch
new file mode 100644
index 0000000000..380c628592
--- /dev/null
+++ b/gnu/packages/patches/gnome-todo-libportal.patch
@@ -0,0 +1,54 @@
+From 3e1f4da8c0e536c09ffaf3b43fe2eb5dc17cc23e Mon Sep 17 00:00:00 2001
+From: Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
+Date: Thu, 18 Nov 2021 19:46:13 -0300
+Subject: [PATCH] flatpak: Adjust to libportal changes
+
+---
+ build-aux/flatpak/org.gnome.Todo.json          | 3 +++
+ src/plugins/background/gtd-plugin-background.c | 2 +-
+ src/plugins/background/meson.build             | 2 +-
+ 3 files changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/build-aux/flatpak/org.gnome.Todo.json b/build-aux/flatpak/org.gnome.Todo.json
+index 034e200c..44b83d66 100644
+--- a/build-aux/flatpak/org.gnome.Todo.json
++++ b/build-aux/flatpak/org.gnome.Todo.json
+@@ -143,6 +143,9 @@
+         {
+             "name" : "libportal",
+             "buildsystem" : "meson",
++            "config-opts" : [
++                "-Dbackends=gtk4"
++            ],
+             "sources" : [
+                 {
+                     "type" : "git",
+diff --git a/src/plugins/background/gtd-plugin-background.c b/src/plugins/background/gtd-plugin-background.c
+index cf48786c..f64d07aa 100644
+--- a/src/plugins/background/gtd-plugin-background.c
++++ b/src/plugins/background/gtd-plugin-background.c
+@@ -28,7 +28,7 @@
+ #include <gtk/gtk.h>
+ 
+ #include <libportal/portal.h>
+-#include <libportal/portal-gtk4.h>
++#include <libportal-gtk4/portal-gtk4.h>
+ 
+ #define AUTOSTART_NOTIFICATION_ID      "Gtd::BackgroundPlugin::autostart_notification"
+ #define AUTOSTART_NOTIFICATION_TIMEOUT 3  /* seconds */
+diff --git a/src/plugins/background/meson.build b/src/plugins/background/meson.build
+index a671a4f3..59d3635f 100644
+--- a/src/plugins/background/meson.build
++++ b/src/plugins/background/meson.build
+@@ -1,7 +1,7 @@
+ plugins_ldflags += ['-Wl,--undefined=gtd_plugin_background_register_types']
+ 
+ plugins_deps += [
+-  dependency('libportal'),
++  dependency('libportal-gtk4'),
+ ]
+ 
+ plugins_sources += files(
+-- 
+GitLab
+
diff --git a/gnu/packages/patches/gnupg-1-build-with-gcc10.patch b/gnu/packages/patches/gnupg-1-build-with-gcc10.patch
new file mode 100644
index 0000000000..40b2aff98e
--- /dev/null
+++ b/gnu/packages/patches/gnupg-1-build-with-gcc10.patch
@@ -0,0 +1,64 @@
+Borrowed from Debian
+https://sources.debian.org/src/gnupg1/1.4.23-1.1/debian/patches/0006-fix-for-gcc10.patch/
+
+Subject: Fix build with gcc-10
+Author: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
+Date: 2021-01-04
+Bug: https://dev.gnupg.org/T5215
+Bug-Debian: https://bugs.debian.org/957293
+
+--- a/g10/options.h
++++ b/g10/options.h
+@@ -29,6 +29,8 @@
+ /* Norcraft can't cope with common symbols */
+ #if defined (__riscos__) && !defined (INCLUDED_BY_MAIN_MODULE)
+ #define EXTERN_UNLESS_MAIN_MODULE extern
++#elif defined (__GNUC__) && __GNUC__ >= 10
++#define EXTERN_UNLESS_MAIN_MODULE __attribute__((__common__))
+ #else
+ #define EXTERN_UNLESS_MAIN_MODULE
+ #endif
+--- a/include/cipher.h
++++ b/include/cipher.h
+@@ -117,6 +117,8 @@
+ #ifndef EXTERN_UNLESS_MAIN_MODULE
+ #if defined (__riscos__) && !defined (INCLUDED_BY_MAIN_MODULE)
+ #define EXTERN_UNLESS_MAIN_MODULE extern
++#elif defined (__GNUC__) && __GNUC__ >= 10
++#define EXTERN_UNLESS_MAIN_MODULE __attribute__((__common__))
+ #else
+ #define EXTERN_UNLESS_MAIN_MODULE
+ #endif
+--- a/include/iobuf.h
++++ b/include/iobuf.h
+@@ -72,6 +72,8 @@
+ #ifndef EXTERN_UNLESS_MAIN_MODULE
+ #if defined (__riscos__) && !defined (INCLUDED_BY_MAIN_MODULE)
+ #define EXTERN_UNLESS_MAIN_MODULE extern
++#elif defined (__GNUC__) && __GNUC__ >= 10
++#define EXTERN_UNLESS_MAIN_MODULE __attribute__((__common__))
+ #else
+ #define EXTERN_UNLESS_MAIN_MODULE 
+ #endif
+--- a/include/memory.h
++++ b/include/memory.h
+@@ -93,6 +93,8 @@
+ #ifndef EXTERN_UNLESS_MAIN_MODULE
+ #if defined (__riscos__) && !defined (INCLUDED_BY_MAIN_MODULE)
+ #define EXTERN_UNLESS_MAIN_MODULE extern
++#elif defined (__GNUC__) && __GNUC__ >= 10
++#define EXTERN_UNLESS_MAIN_MODULE __attribute__((__common__))
+ #else
+ #define EXTERN_UNLESS_MAIN_MODULE 
+ #endif
+--- a/include/mpi.h
++++ b/include/mpi.h
+@@ -38,6 +38,8 @@
+ #ifndef EXTERN_UNLESS_MAIN_MODULE
+ #if defined (__riscos__) && !defined (INCLUDED_BY_MAIN_MODULE)
+ #define EXTERN_UNLESS_MAIN_MODULE extern
++#elif defined (__GNUC__) && __GNUC__ >= 10
++#define EXTERN_UNLESS_MAIN_MODULE __attribute__((__common__))
+ #else
+ #define EXTERN_UNLESS_MAIN_MODULE 
+ #endif
diff --git a/gnu/packages/patches/gnutls-CVE-2021-20231.patch b/gnu/packages/patches/gnutls-CVE-2021-20231.patch
deleted file mode 100644
index 5186522eee..0000000000
--- a/gnu/packages/patches/gnutls-CVE-2021-20231.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From 15beb4b193b2714d88107e7dffca781798684e7e Mon Sep 17 00:00:00 2001
-From: Daiki Ueno <ueno@gnu.org>
-Date: Fri, 29 Jan 2021 14:06:05 +0100
-Subject: [PATCH 1/2] key_share: avoid use-after-free around realloc
-
-Signed-off-by: Daiki Ueno <ueno@gnu.org>
----
- lib/ext/key_share.c | 12 +++++-------
- 1 file changed, 5 insertions(+), 7 deletions(-)
-
-diff --git a/lib/ext/key_share.c b/lib/ext/key_share.c
-index ab8abf8fe..a8c4bb5cf 100644
---- a/lib/ext/key_share.c
-+++ b/lib/ext/key_share.c
-@@ -664,14 +664,14 @@ key_share_send_params(gnutls_session_t session,
- {
- 	unsigned i;
- 	int ret;
--	unsigned char *lengthp;
--	unsigned int cur_length;
- 	unsigned int generated = 0;
- 	const gnutls_group_entry_st *group;
- 	const version_entry_st *ver;
- 
- 	/* this extension is only being sent on client side */
- 	if (session->security_parameters.entity == GNUTLS_CLIENT) {
-+		unsigned int length_pos;
-+
- 		ver = _gnutls_version_max(session);
- 		if (unlikely(ver == NULL || ver->key_shares == 0))
- 			return 0;
-@@ -679,16 +679,13 @@ key_share_send_params(gnutls_session_t session,
- 		if (!have_creds_for_tls13(session))
- 			return 0;
- 
--		/* write the total length later */
--		lengthp = &extdata->data[extdata->length];
-+		length_pos = extdata->length;
- 
- 		ret =
- 		    _gnutls_buffer_append_prefix(extdata, 16, 0);
- 		if (ret < 0)
- 			return gnutls_assert_val(ret);
- 
--		cur_length = extdata->length;
--
- 		if (session->internals.hsk_flags & HSK_HRR_RECEIVED) { /* we know the group */
- 			group = get_group(session);
- 			if (unlikely(group == NULL))
-@@ -736,7 +733,8 @@ key_share_send_params(gnutls_session_t session,
- 		}
- 
- 		/* copy actual length */
--		_gnutls_write_uint16(extdata->length - cur_length, lengthp);
-+		_gnutls_write_uint16(extdata->length - length_pos - 2,
-+				     &extdata->data[length_pos]);
- 
- 	} else { /* server */
- 		ver = get_version(session);
--- 
-2.30.2
-
diff --git a/gnu/packages/patches/gnutls-CVE-2021-20232.patch b/gnu/packages/patches/gnutls-CVE-2021-20232.patch
deleted file mode 100644
index dc3a0be690..0000000000
--- a/gnu/packages/patches/gnutls-CVE-2021-20232.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 75a937d97f4fefc6f9b08e3791f151445f551cb3 Mon Sep 17 00:00:00 2001
-From: Daiki Ueno <ueno@gnu.org>
-Date: Fri, 29 Jan 2021 14:06:23 +0100
-Subject: [PATCH 2/2] pre_shared_key: avoid use-after-free around realloc
-
-Signed-off-by: Daiki Ueno <ueno@gnu.org>
----
- lib/ext/pre_shared_key.c | 15 ++++++++++++---
- 1 file changed, 12 insertions(+), 3 deletions(-)
-
-diff --git a/lib/ext/pre_shared_key.c b/lib/ext/pre_shared_key.c
-index a042c6488..380bf39ed 100644
---- a/lib/ext/pre_shared_key.c
-+++ b/lib/ext/pre_shared_key.c
-@@ -267,7 +267,7 @@ client_send_params(gnutls_session_t session,
- 	size_t spos;
- 	gnutls_datum_t username = {NULL, 0};
- 	gnutls_datum_t user_key = {NULL, 0}, rkey = {NULL, 0};
--	gnutls_datum_t client_hello;
-+	unsigned client_hello_len;
- 	unsigned next_idx;
- 	const mac_entry_st *prf_res = NULL;
- 	const mac_entry_st *prf_psk = NULL;
-@@ -428,8 +428,7 @@ client_send_params(gnutls_session_t session,
- 	assert(extdata->length >= sizeof(mbuffer_st));
- 	assert(ext_offset >= (ssize_t)sizeof(mbuffer_st));
- 	ext_offset -= sizeof(mbuffer_st);
--	client_hello.data = extdata->data+sizeof(mbuffer_st);
--	client_hello.size = extdata->length-sizeof(mbuffer_st);
-+	client_hello_len = extdata->length-sizeof(mbuffer_st);
- 
- 	next_idx = 0;
- 
-@@ -440,6 +439,11 @@ client_send_params(gnutls_session_t session,
- 	}
- 
- 	if (prf_res && rkey.size > 0) {
-+		gnutls_datum_t client_hello;
-+
-+		client_hello.data = extdata->data+sizeof(mbuffer_st);
-+		client_hello.size = client_hello_len;
-+
- 		ret = compute_psk_binder(session, prf_res,
- 					 binders_len, binders_pos,
- 					 ext_offset, &rkey, &client_hello, 1,
-@@ -474,6 +478,11 @@ client_send_params(gnutls_session_t session,
- 	}
- 
- 	if (prf_psk && user_key.size > 0 && info) {
-+		gnutls_datum_t client_hello;
-+
-+		client_hello.data = extdata->data+sizeof(mbuffer_st);
-+		client_hello.size = client_hello_len;
-+
- 		ret = compute_psk_binder(session, prf_psk,
- 					 binders_len, binders_pos,
- 					 ext_offset, &user_key, &client_hello, 0,
--- 
-2.30.2
-
diff --git a/gnu/packages/patches/gnutls-guile-eintr-eagain.patch b/gnu/packages/patches/gnutls-guile-eintr-eagain.patch
new file mode 100644
index 0000000000..e04c945158
--- /dev/null
+++ b/gnu/packages/patches/gnutls-guile-eintr-eagain.patch
@@ -0,0 +1,56 @@
+Fixes <https://issues.guix.gnu.org/47867>.
+
+This fix was merged upstream
+in <https://gitlab.com/gnutls/gnutls/-/merge_requests/1417> and will
+be in GnuTLS 3.7.3.  Upstream commit:
+
+commit 110e2172dbef1fbdf7399dab1e80780847b61c0c
+Author: Ludovic Courtès <ludo@gnu.org>
+Date:   Sat Apr 24 22:02:14 2021 +0200
+
+    guile: Writes to record ports handle EAGAIN/EINTR transparently.
+
+diff --git a/guile/src/core.c b/guile/src/core.c
+index a13670fc7b..0926dc8a97 100644
+--- a/guile/src/core.c
++++ b/guile/src/core.c
+@@ -985,7 +985,10 @@ write_to_session_record_port (SCM port, const void *data, size_t size)
+       c_result = gnutls_record_send (c_session, (char *) data + c_sent,
+                                      size - c_sent);
+       if (EXPECT_FALSE (c_result < 0))
+-        scm_gnutls_error (c_result, FUNC_NAME);
++	{
++	  if (c_result != GNUTLS_E_AGAIN && c_result != GNUTLS_E_INTERRUPTED)
++	    scm_gnutls_error (c_result, FUNC_NAME);
++	}
+       else
+         c_sent += c_result;
+     }
+@@ -1069,7 +1072,8 @@ read_from_session_record_port (SCM port, SCM dst, size_t start, size_t count)
+ #undef FUNC_NAME
+ 
+ /* Return the file descriptor that backs PORT.  This function is called upon a
+-   blocking read--i.e., 'read_from_session_record_port' returned -1.  */
++   blocking read--i.e., 'read_from_session_record_port' or
++   'write_to_session_record_port' returned -1.  */
+ static int
+ session_record_port_fd (SCM port)
+ {
+@@ -1097,7 +1101,16 @@ write_to_session_record_port (SCM port, SCM src, size_t start, size_t count)
+   c_session = scm_to_gnutls_session (session, 1, FUNC_NAME);
+   data = (char *) SCM_BYTEVECTOR_CONTENTS (src) + start;
+ 
+-  result = gnutls_record_send (c_session, data, count);
++  do
++    result = gnutls_record_send (c_session, data, count);
++  while (result == GNUTLS_E_INTERRUPTED
++	 || (result == GNUTLS_E_AGAIN
++	     && !SCM_GNUTLS_SESSION_TRANSPORT_IS_FD (c_session)));
++
++  if (result == GNUTLS_E_AGAIN
++      && SCM_GNUTLS_SESSION_TRANSPORT_IS_FD (c_session))
++    /* Tell Guile that reading would block.  */
++    return (size_t) -1;
+ 
+   if (EXPECT_FALSE (result < 0))
+     scm_gnutls_error (result, FUNC_NAME);
diff --git a/gnu/packages/patches/go-github-com-golang-snappy-32bit-test.patch b/gnu/packages/patches/go-github-com-golang-snappy-32bit-test.patch
new file mode 100644
index 0000000000..95b5819cdb
--- /dev/null
+++ b/gnu/packages/patches/go-github-com-golang-snappy-32bit-test.patch
@@ -0,0 +1,53 @@
+https://salsa.debian.org/go-team/packages/golang-github-golang-snappy/-/raw/debian/0.0.2-2/debian/patches/0002-Skip-failed-test-on-32bit-system.patch
+
+From: Shengjing Zhu <zhsj@debian.org>
+Date: Sun, 31 Jan 2021 22:41:42 +0800
+Subject: Skip failed test on 32bit system
+
+The test doesn't pass on old version too, not a regression.
+
+Bug: https://github.com/golang/snappy/issues/58
+---
+ snappy_test.go | 20 +++++++++++++++-----
+ 1 file changed, 15 insertions(+), 5 deletions(-)
+
+diff --git a/snappy_test.go b/snappy_test.go
+index d7c3ea6..c310ba1 100644
+--- a/snappy_test.go
++++ b/snappy_test.go
+@@ -19,6 +19,7 @@ import (
+ 	"runtime"
+ 	"strings"
+ 	"testing"
++	"unsafe"
+ )
+ 
+ var (
+@@ -316,13 +317,22 @@ func TestDecode(t *testing.T) {
+ 		"\x06" + "\x0cabcd" + "\x07\x03\x00\x00\x00",
+ 		"abcdbc",
+ 		nil,
+-	}, {
+-		`decodedLen=0; tagCopy4, 4 extra length|offset bytes; with msb set (0x93); discovered by go-fuzz`,
+-		"\x00\xfc000\x93",
+-		"",
+-		ErrCorrupt,
+ 	}}
+ 
++	if unsafe.Sizeof(int(0)) == 8 {
++		testCases = append(testCases, struct {
++			desc    string
++			input   string
++			want    string
++			wantErr error
++		}{
++			`decodedLen=0; tagCopy4, 4 extra length|offset bytes; with msb set (0x93); discovered by go-fuzz`,
++			"\x00\xfc000\x93",
++			"",
++			ErrCorrupt,
++		})
++	}
++
+ 	const (
+ 		// notPresentXxx defines a range of byte values [0xa0, 0xc5) that are
+ 		// not present in either the input or the output. It is written to dBuf
diff --git a/gnu/packages/patches/gpaste-fix-paths.patch b/gnu/packages/patches/gpaste-fix-paths.patch
new file mode 100644
index 0000000000..be63878fe6
--- /dev/null
+++ b/gnu/packages/patches/gpaste-fix-paths.patch
@@ -0,0 +1,24 @@
+This is copied from NixOS, which is under MIT licence.
+https://github.com/NixOS/nixpkgs/blob/master/pkgs/desktops/gnome/misc/gpaste/
+--- a/src/gnome-shell/extension.js
++++ b/src/gnome-shell/extension.js
+@@ -6,6 +6,8 @@
+ 
+ const Config = imports.misc.config;
+ 
++imports.gi.GIRepository.Repository.prepend_search_path('@typelibPath@');
++
+ imports.gi.versions.Clutter = Config.LIBMUTTER_API_VERSION;
+ imports.gi.versions.GLib = '2.0';
+ imports.gi.versions.GPaste = '1.0';
+--- a/src/gnome-shell/prefs.js
++++ b/src/gnome-shell/prefs.js
+@@ -6,6 +6,8 @@
+ 
+ const Gettext = imports.gettext;
+ 
++imports.gi.GIRepository.Repository.prepend_search_path('@typelibPath@');
++
+ //const { GPaste } = imports.gi;
+ 
+ const ExtensionUtils = imports.misc.extensionUtils;
diff --git a/gnu/packages/patches/graphviz-CVE-2020-18032.patch b/gnu/packages/patches/graphviz-CVE-2020-18032.patch
deleted file mode 100644
index 4cf94a9a36..0000000000
--- a/gnu/packages/patches/graphviz-CVE-2020-18032.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-Fix CVE-2020-18032:
-
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=2020-18032
-https://gitlab.com/graphviz/graphviz/-/issues/1700
-
-Patch copied from upstream source repository:
-
-https://gitlab.com/graphviz/graphviz/-/commit/784411ca3655c80da0f6025ab20634b2a6ff696b
-
-From 784411ca3655c80da0f6025ab20634b2a6ff696b Mon Sep 17 00:00:00 2001
-From: Matthew Fernandez <matthew.fernandez@gmail.com>
-Date: Sat, 25 Jul 2020 19:31:01 -0700
-Subject: [PATCH] fix: out-of-bounds write on invalid label
-
-When the label for a node cannot be parsed (due to it being malformed), it falls
-back on the symbol name of the node itself. I.e. the default label the node
-would have had if it had no label attribute at all. However, this is applied by
-dynamically altering the node's label to "\N", a shortcut for the symbol name of
-the node. All of this is fine, however if the hand written label itself is
-shorter than the literal string "\N", not enough memory would have been
-allocated to write "\N" into the label text.
-
-Here we account for the possibility of error during label parsing, and assume
-that the label text may need to be overwritten with "\N" after the fact. Fixes
-issue #1700.
----
- lib/common/shapes.c | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
-
-diff --git a/lib/common/shapes.c b/lib/common/shapes.c
-index 0a0635fc3..9dca9ba6e 100644
---- a/lib/common/shapes.c
-+++ b/lib/common/shapes.c
-@@ -3546,9 +3546,10 @@ static void record_init(node_t * n)
-     reclblp = ND_label(n)->text;
-     len = strlen(reclblp);
-     /* For some forgotten reason, an empty label is parsed into a space, so
--     * we need at least two bytes in textbuf.
-+     * we need at least two bytes in textbuf, as well as accounting for the
-+     * error path involving "\\N" below.
-      */
--    len = MAX(len, 1);
-+    len = MAX(MAX(len, 1), (int)strlen("\\N"));
-     textbuf = N_NEW(len + 1, char);
-     if (!(info = parse_reclbl(n, flip, TRUE, textbuf))) {
- 	agerr(AGERR, "bad label format %s\n", ND_label(n)->text);
--- 
-2.31.1
-
diff --git a/gnu/packages/patches/grfcodec-gcc-compat.patch b/gnu/packages/patches/grfcodec-gcc-compat.patch
new file mode 100644
index 0000000000..02685d46fd
--- /dev/null
+++ b/gnu/packages/patches/grfcodec-gcc-compat.patch
@@ -0,0 +1,31 @@
+Fix type comparison issue that is a hard error in GCC 10.
+
+Taken from upstream:
+
+  https://github.com/OpenTTD/grfcodec/commit/bb692b2c723c5e87cc8f89f445928e97594d5b8f
+
+diff --git a/src/command.cpp b/src/command.cpp
+index 9aa0e14..1f32cf1 100644
+--- a/src/command.cpp
++++ b/src/command.cpp
+@@ -300,8 +300,9 @@ bool parse_comment(const string&line){
+ 		break;
+ 	case BEAUTIFY:{
+ 		commandstream>>command_part;
+-		uint val=find_command(command_part,beaut),togglebit;
+-		if(val!=(uint)-1&&val!=OFF)_commandState.beautifier=true;
++		int val=find_command(command_part,beaut);
++		uint togglebit;
++		if(val!=-1&&val!=OFF)_commandState.beautifier=true;
+ 		switch(val){
+ 		case -1:
+ 			IssueMessage(0,COMMAND_INVALID_ARG,gen[BEAUTIFY].name);
+@@ -372,7 +373,7 @@ bool parse_comment(const string&line){
+ dotoggle:
+ 			commandstream>>command_part;
+ 			val=find_command(command_part,beaut);
+-			if(!commandstream||val==(uint)-1){
++			if(!commandstream||val==-1){
+ 				IssueMessage(0,COMMAND_INVALID_ARG,gen[BEAUTIFY].name);
+ 				return true;
+ 			}
diff --git a/gnu/packages/patches/gtk-doc-respect-xml-catalog.patch b/gnu/packages/patches/gtk-doc-respect-xml-catalog.patch
new file mode 100644
index 0000000000..710f208285
--- /dev/null
+++ b/gnu/packages/patches/gtk-doc-respect-xml-catalog.patch
@@ -0,0 +1,16 @@
+Taken from here:
+https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/tools/documentation/gtk-doc/respect-xml-catalog-files-var.patch.
+
+--- a/m4/gtkdoc_jh_check_xml_catalog.m4
++++ b/m4/gtkdoc_jh_check_xml_catalog.m4
+@@ -5,8 +5,8 @@
+ [
+ 	AC_REQUIRE([JH_PATH_XML_CATALOG],[JH_PATH_XML_CATALOG(,[:])])dnl
+ 	AC_MSG_CHECKING([for ifelse([$2],,[$1],[$2]) in XML catalog])
+-	if $jh_found_xmlcatalog && \
+-		AC_RUN_LOG([$XMLCATALOG --noout "$XML_CATALOG_FILE" "$1" >&2]); then
++	# empty argument forces libxml to use XML_CATALOG_FILES variable
++	if AC_RUN_LOG([$XMLCATALOG --noout "" "$1" >&2]); then
+ 		AC_MSG_RESULT([found])
+ 		ifelse([$3],,,[$3])
+ 	else
diff --git a/gnu/packages/patches/gtk-introspection-test.patch b/gnu/packages/patches/gtk-introspection-test.patch
new file mode 100644
index 0000000000..570ea806a9
--- /dev/null
+++ b/gnu/packages/patches/gtk-introspection-test.patch
@@ -0,0 +1,22 @@
+# Extend rather than stomp environment variables.
+# Upstream status: https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/4268
+diff --git a/testsuite/introspection/meson.build b/testsuite/introspection/meson.build
+index 6202fb7446..b59191eb0f 100644
+--- a/testsuite/introspection/meson.build
++++ b/testsuite/introspection/meson.build
+@@ -1,9 +1,10 @@
++env = environment()
++env.prepend('GI_TYPELIB_PATH',
++    join_paths(project_build_root, 'gtk'),
++    gi_dep.get_pkgconfig_variable('typelibdir'))
++env.prepend('LD_PRELOAD', join_paths(project_build_root, 'gtk', 'libgtk-4.so'))
+ 
+ test('api',
+      find_program('api.py', dirs: meson.current_source_dir()),
+      suite: ['introspection'],
+-     env: [
+-       'GI_TYPELIB_PATH=@0@/gtk:@1@'.format(project_build_root,
+-          gi_dep.get_pkgconfig_variable('typelibdir')),
+-       'LD_PRELOAD=@0@/gtk/libgtk-4.so'.format(project_build_root),
+-     ])
++     env: env)
diff --git a/gnu/packages/patches/gtk2-fix-builder-test.patch b/gnu/packages/patches/gtk2-fix-builder-test.patch
new file mode 100644
index 0000000000..8c41e596fe
--- /dev/null
+++ b/gnu/packages/patches/gtk2-fix-builder-test.patch
@@ -0,0 +1,94 @@
+From e45e11238036e06c8fe78bea1691b256ca41837b Mon Sep 17 00:00:00 2001
+From: Steve Langasek <steve.langasek@ubuntu.com>
+Date: Tue, 7 Jan 2014 13:55:28 +0100
+Subject: [PATCH] fix prototypes of signal callbacks in the test suite
+
+The signal callbacks are defined to take pointers as their arguments, but the
+callbacks found in testsuite/gtk/builder.c are passing a GParamSpec by value
+as the second argument.  This confuses and angers the compiler on ppc64el,
+resulting in segfaults after return from the function due to stack-smashing
+by the (completely-unused) argument.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=721700
+---
+
+This is a backport to v2.24.33 of upstream commit:
+
+https://gitlab.gnome.org/GNOME/gtk/-/commit/256561db2f0b34e01047f8882b3e0cb8c6d9dbab
+
+ gtk/tests/builder.c | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/gtk/tests/builder.c b/gtk/tests/builder.c
+index 8529dacc2f6e..23d5096062fa 100644
+--- a/gtk/tests/builder.c
++++ b/gtk/tests/builder.c
+@@ -132,7 +132,7 @@ static int object = 0;
+ static int object_after = 0;
+ 
+ void /* exported for GtkBuilder */
+-signal_normal (GtkWindow *window, GParamSpec spec)
++signal_normal (GtkWindow *window, GParamSpec *spec)
+ {
+   g_assert (GTK_IS_WINDOW (window));
+   g_assert (normal == 0);
+@@ -142,7 +142,7 @@ signal_normal (GtkWindow *window, GParamSpec spec)
+ }
+ 
+ void /* exported for GtkBuilder */
+-signal_after (GtkWindow *window, GParamSpec spec)
++signal_after (GtkWindow *window, GParamSpec *spec)
+ {
+   g_assert (GTK_IS_WINDOW (window));
+   g_assert (normal == 1);
+@@ -152,7 +152,7 @@ signal_after (GtkWindow *window, GParamSpec spec)
+ }
+ 
+ void /* exported for GtkBuilder */
+-signal_object (GtkButton *button, GParamSpec spec)
++signal_object (GtkButton *button, GParamSpec *spec)
+ {
+   g_assert (GTK_IS_BUTTON (button));
+   g_assert (object == 0);
+@@ -162,7 +162,7 @@ signal_object (GtkButton *button, GParamSpec spec)
+ }
+ 
+ void /* exported for GtkBuilder */
+-signal_object_after (GtkButton *button, GParamSpec spec)
++signal_object_after (GtkButton *button, GParamSpec *spec)
+ {
+   g_assert (GTK_IS_BUTTON (button));
+   g_assert (object == 1);
+@@ -172,28 +172,28 @@ signal_object_after (GtkButton *button, GParamSpec spec)
+ }
+ 
+ void /* exported for GtkBuilder */
+-signal_first (GtkButton *button, GParamSpec spec)
++signal_first (GtkButton *button, GParamSpec *spec)
+ {
+   g_assert (normal == 0);
+   normal = 10;
+ }
+ 
+ void /* exported for GtkBuilder */
+-signal_second (GtkButton *button, GParamSpec spec)
++signal_second (GtkButton *button, GParamSpec *spec)
+ {
+   g_assert (normal == 10);
+   normal = 20;
+ }
+ 
+ void /* exported for GtkBuilder */
+-signal_extra (GtkButton *button, GParamSpec spec)
++signal_extra (GtkButton *button, GParamSpec *spec)
+ {
+   g_assert (normal == 20);
+   normal = 30;
+ }
+ 
+ void /* exported for GtkBuilder */
+-signal_extra2 (GtkButton *button, GParamSpec spec)
++signal_extra2 (GtkButton *button, GParamSpec *spec)
+ {
+   g_assert (normal == 30);
+   normal = 40;
diff --git a/gnu/packages/patches/gtk4-respect-GUIX_GTK4_PATH.patch b/gnu/packages/patches/gtk4-respect-GUIX_GTK4_PATH.patch
new file mode 100644
index 0000000000..4a60023bf7
--- /dev/null
+++ b/gnu/packages/patches/gtk4-respect-GUIX_GTK4_PATH.patch
@@ -0,0 +1,51 @@
+From 889294a93fc6464c2c2919bc47f6fd85ec823363 Mon Sep 17 00:00:00 2001
+From: Raghav Gururajan <rg@raghavgururajan.name>
+Date: Tue, 18 May 2021 19:57:00 -0400
+Subject: [PATCH] [PATCH]: Honor GUIX_GTK4_PATH.
+
+This patch makes GTK look for additional modules in a list of directories
+specified by the environment variable "GUIX_GTK4_PATH". This can be used
+instead of "GTK_PATH" to make GTK find modules that are incompatible with
+other major versions of GTK.
+---
+ gtk/gtkmodules.c | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/gtk/gtkmodules.c b/gtk/gtkmodules.c
+index aace5dcbc9..193b6a02e9 100644
+--- a/gtk/gtkmodules.c
++++ b/gtk/gtkmodules.c
+@@ -105,6 +105,7 @@ static char **
+ get_module_path (void)
+ {
+   const char *module_path_env;
++  const gchar *module_guix_gtk4_path_env;
+   const char *exe_prefix;
+   char *module_path;
+   char *default_dir;
+@@ -114,6 +115,7 @@ get_module_path (void)
+     return result;
+ 
+   module_path_env = g_getenv ("GTK_PATH");
++  module_guix_gtk4_path_env = g_getenv ("GUIX_GTK4_PATH");
+   exe_prefix = g_getenv ("GTK_EXE_PREFIX");
+ 
+   if (exe_prefix)
+@@ -121,7 +123,13 @@ get_module_path (void)
+   else
+     default_dir = g_build_filename (_gtk_get_libdir (), "gtk-4.0", NULL);
+ 
+-  if (module_path_env)
++  if (module_guix_gtk4_path_env && module_path_env)
++    module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S,
++				module_guix_gtk4_path_env, module_path_env, default_dir, NULL);
++  else if (module_guix_gtk4_path_env)
++    module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S,
++				module_guix_gtk4_path_env, default_dir, NULL);
++  else if (module_path_env)
+     module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S,
+ 				module_path_env, default_dir, NULL);
+   else
+-- 
+2.31.1
+
diff --git a/gnu/packages/patches/guile-email-fix-tests.patch b/gnu/packages/patches/guile-email-fix-tests.patch
new file mode 100644
index 0000000000..8621aaea02
--- /dev/null
+++ b/gnu/packages/patches/guile-email-fix-tests.patch
@@ -0,0 +1,35 @@
+This patch has been proposed upstream:
+https://lists.systemreboot.net/guile-email/87mtnv1r2p.fsf@gnu.org/T/#u.
+
+From c21fe0f0e28b80b606973d3e372e2bc8528c9766 Mon Sep 17 00:00:00 2001
+From: Mathieu Othacehe <othacehe@gnu.org>
+Date: Wed, 29 Sep 2021 12:47:35 +0000
+Subject: [PATCH 1/1] email: Do not use an empty bytevector to test the
+ charset.
+
+Using an empty bytevector no longer throws an exception since this Guile
+commit: 5ea8c69e9153a970952bf6f0b32c4fad6a28e839.
+
+* email/email.scm (post-process-content-transfer-encoding): Use a bytevector
+containg the 'e' character to test the charset validity.
+---
+ email/email.scm | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/email/email.scm b/email/email.scm
+index 3f4e194..ac70463 100644
+--- a/email/email.scm
++++ b/email/email.scm
+@@ -832,7 +832,8 @@ values. The returned headers is a string and body is a bytevector."
+   (define (valid-charset? charset)
+     (catch #t
+       (lambda ()
+-        (bytevector->string (make-bytevector 0 0) charset)
++        ;; Try to convert a bytevector containg the 'e' character.
++        (bytevector->string (make-bytevector 1 48) charset)
+         #t)
+       (const #f)))
+ 
+-- 
+2.33.0
+
diff --git a/gnu/packages/patches/guile-git-adjust-for-libgit2-1.2.0.patch b/gnu/packages/patches/guile-git-adjust-for-libgit2-1.2.0.patch
new file mode 100644
index 0000000000..436a11ad19
--- /dev/null
+++ b/gnu/packages/patches/guile-git-adjust-for-libgit2-1.2.0.patch
@@ -0,0 +1,78 @@
+diff --git a/configure.ac b/configure.ac
+index 107e6ca..20e9019 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -2,6 +2,7 @@ dnl Guile-Git --- GNU Guile bindings of libgit2
+ dnl Copyright © 2016-2018 Erik Edrosa <erik.edrosa@gmail.com>
+ dnl Copyright © 2017, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
+ dnl Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
++dnl Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+ dnl
+ dnl This file is part of Guile-Git.
+ dnl
+@@ -43,15 +44,20 @@ AS_IF([test "x$LIBGIT2_LIBDIR" = "x"], [
+ ])
+ AC_SUBST([LIBGIT2_LIBDIR])
+ 
++dnl Does the 'git_remote_callbacks' struct have a 'remote_ready' field?
++dnl It was added in 1.2.0, obsoleting 'resolve_url'.
++AC_CHECK_MEMBER([git_remote_callbacks.remote_ready],
++  [HAVE_REMOTE_CALLBACKS_REMOTE_READY="#true"],
++  [HAVE_REMOTE_CALLBACKS_REMOTE_READY="#false"],
++  [[#include <git2.h>]])
++AC_SUBST([HAVE_REMOTE_CALLBACKS_REMOTE_READY])
++
+ dnl Does the 'git_remote_callbacks' struct have a 'resolve_url' field?
+ dnl It's missing in libgit2 0.28.5, added in 1.0.
+-AC_CHECK_MEMBER([git_remote_callbacks.resolve_url], [], [],
++AC_CHECK_MEMBER([git_remote_callbacks.resolve_url],
++  [HAVE_REMOTE_CALLBACKS_RESOLVE_URL="#true"],
++  [HAVE_REMOTE_CALLBACKS_RESOLVE_URL="#false"],
+   [[#include <git2.h>]])
+-if test "x$ac_cv_member_git_remote_callbacks_resolve_url" = "xyes"; then
+-  HAVE_REMOTE_CALLBACKS_RESOLVE_URL="#true"
+-else
+-  HAVE_REMOTE_CALLBACKS_RESOLVE_URL="#false"
+-fi
+ AC_SUBST([HAVE_REMOTE_CALLBACKS_RESOLVE_URL])
+ 
+ dnl Those binaries are required for ssh authentication tests.
+diff --git a/git/configuration.scm.in b/git/configuration.scm.in
+index c45f698..64c4360 100644
+--- a/git/configuration.scm.in
++++ b/git/configuration.scm.in
+@@ -19,11 +19,17 @@
+ 
+ (define-module (git configuration)
+   #:export (%libgit2
++            %have-remote-callbacks-remote-ready?
+             %have-remote-callbacks-resolve-url?))
+ 
+ (define %libgit2
+   "@LIBGIT2_LIBDIR@/libgit2")
+ 
++(define %have-remote-callbacks-remote-ready?
++  ;; True if the 'git_remote_callbacks' struct has a
++  ;; 'remote_ready' field.
++  @HAVE_REMOTE_CALLBACKS_REMOTE_READY@)
++
+ (define %have-remote-callbacks-resolve-url?
+   ;; True if the 'git_remote_callbacks' struct has a 'resolve_url' field.
+   @HAVE_REMOTE_CALLBACKS_RESOLVE_URL@)
+diff --git a/git/structs.scm b/git/structs.scm
+index ca51728..be3d050 100644
+--- a/git/structs.scm
++++ b/git/structs.scm
+@@ -637,6 +637,12 @@ type to 'specified for this to take effect."
+                (push-update-reference ,(bs:pointer uint8))
+                (push-negotiation ,(bs:pointer uint8))
+                (transport ,(bs:pointer uint8))
++
++               ;; Added in libgit2 1.2.0.
++               ,@(if %have-remote-callbacks-remote-ready?
++                     `((remote-ready ,(bs:pointer uint8)))
++                     '())
++
+                (payload ,(bs:pointer uint8))
+ 
+                ;; libgit2 1.0 added this field, which is missing from 0.28.5,
diff --git a/gnu/packages/patches/guile-ssh-fix-test-suite.patch b/gnu/packages/patches/guile-ssh-fix-test-suite.patch
new file mode 100644
index 0000000000..dc10e08b0f
--- /dev/null
+++ b/gnu/packages/patches/guile-ssh-fix-test-suite.patch
@@ -0,0 +1,217 @@
+From f7942cded8b65341916a555186e2219efe174cd0 Mon Sep 17 00:00:00 2001
+From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
+Date: Thu, 4 Feb 2021 14:38:25 -0500
+Subject: [PATCH] tests: Fix test suite for Guile 3.0.5.
+
+The test-runner object is now reset to #f when calling the 'test-end'
+procedure.  See the commit de5d1a7f99b8e952b115237ebc29633062f99bb9 in
+Guile (srfi-64: Reset test-runner-current if done) which introduced this
+change.
+
+* tests/client-server.scm (exit-status): New variable.  Use it when calling
+exit.
+* tests/dist.scm: Likewise.
+* tests/key.scm: Likewise.
+* tests/log.scm: Likewise.
+* tests/popen.scm: Likewise.
+* tests/server-client.scm: Likewise.
+* tests/server.scm: Likewise.
+* tests/session.scm: Likewise.
+* tests/shell.scm: Likewise.
+* tests/sssh-ssshd.scm: Likewise.
+* tests/tunnel.scm: Likewise.
+---
+ tests/client-server.scm | 4 +++-
+ tests/dist.scm          | 4 +++-
+ tests/key.scm           | 3 ++-
+ tests/log.scm           | 5 ++++-
+ tests/popen.scm         | 4 +++-
+ tests/server-client.scm | 4 +++-
+ tests/server.scm        | 4 +++-
+ tests/session.scm       | 4 +++-
+ tests/shell.scm         | 3 ++-
+ tests/sssh-ssshd.scm    | 4 +++-
+ tests/tunnel.scm        | 4 +++-
+ 11 files changed, 32 insertions(+), 11 deletions(-)
+
+diff --git a/tests/client-server.scm b/tests/client-server.scm
+index 432a48c..fc46140 100644
+--- a/tests/client-server.scm
++++ b/tests/client-server.scm
+@@ -743,8 +743,10 @@
+ 
+ ;;;
+ 
++(define exit-status (test-runner-fail-count (test-runner-current)))
++
+ (test-end "client-server")
+ 
+-(exit (= (test-runner-fail-count (test-runner-current)) 0))
++(exit (= 0 exit-status))
+ 
+ ;;; client-server.scm ends here.
+diff --git a/tests/dist.scm b/tests/dist.scm
+index 2a3a75f..79f9e23 100644
+--- a/tests/dist.scm
++++ b/tests/dist.scm
+@@ -269,8 +269,10 @@ $4 = #<session #<undefined>@#<undefined>:22 (disconnected) 453fff>"
+ ;;;
+ 
+ 
++(define exit-status (test-runner-fail-count (test-runner-current)))
++
+ (test-end "dist")
+ 
+-(exit (= (test-runner-fail-count (test-runner-current)) 0))
++(exit (= 0 exit-status))
+ 
+ ;;; dist.scm ends here.
+diff --git a/tests/key.scm b/tests/key.scm
+index be31378..e1678f4 100644
+--- a/tests/key.scm
++++ b/tests/key.scm
+@@ -170,9 +170,10 @@
+                    (eq? (get-key-type key) 'ecdsa-p256)))))))
+ 
+ ;;;
++(define exit-status (test-runner-fail-count (test-runner-current)))
+ 
+ (test-end "key")
+ 
+-(exit (= (test-runner-fail-count (test-runner-current)) 0))
++(exit (= 0 exit-status))
+ 
+ ;;; key.scm ends here.
+diff --git a/tests/log.scm b/tests/log.scm
+index f547202..d528251 100644
+--- a/tests/log.scm
++++ b/tests/log.scm
+@@ -64,8 +64,11 @@
+   (get-log-verbosity))
+ 
+ 
++(define exit-status (test-runner-fail-count (test-runner-current)))
++
+ (test-end "log")
+ 
+-(exit (= (test-runner-fail-count (test-runner-current)) 0))
++(exit (= 0 exit-status))
++
+ 
+ ;;; log.scm ends here
+diff --git a/tests/popen.scm b/tests/popen.scm
+index e063e0b..fe77108 100644
+--- a/tests/popen.scm
++++ b/tests/popen.scm
+@@ -129,8 +129,10 @@
+           (format-log/scm 'nolog "open-remote-output-pipe"  "channel: ~A" channel)
+           (output-only? channel)))))))
+ 
++(define exit-status (test-runner-fail-count (test-runner-current)))
++
+ (test-end "popen")
+ 
+-(exit (= (test-runner-fail-count (test-runner-current)) 0))
++(exit (= 0 exit-status))
+ 
+ ;;; popen.scm ends here.
+diff --git a/tests/server-client.scm b/tests/server-client.scm
+index 920aa22..b6ed3eb 100644
+--- a/tests/server-client.scm
++++ b/tests/server-client.scm
+@@ -148,8 +148,10 @@
+          (equal? x session))))))
+ 
+ 
++(define exit-status (test-runner-fail-count (test-runner-current)))
++
+ (test-end "server-client")
+ 
+-(exit (= (test-runner-fail-count (test-runner-current)) 0))
++(exit (= 0 exit-status))
+ 
+ ;;; server-client.scm ends here.
+diff --git a/tests/server.scm b/tests/server.scm
+index c7f8b6c..1a6daea 100644
+--- a/tests/server.scm
++++ b/tests/server.scm
+@@ -157,9 +157,11 @@
+     (server-listen server)
+     #t))
+ 
++(define exit-status (test-runner-fail-count (test-runner-current)))
++
+ (test-end "server")
+ 
+-(exit (= (test-runner-fail-count (test-runner-current)) 0))
++(exit (= 0 exit-status))
+ 
+ ;;; server.scm ends here.
+ 
+diff --git a/tests/session.scm b/tests/session.scm
+index 8caa039..7310647 100644
+--- a/tests/session.scm
++++ b/tests/session.scm
+@@ -210,8 +210,10 @@
+   (let ((session (%make-session)))
+     (not (connected? session))))
+ 
++(define exit-status (test-runner-fail-count (test-runner-current)))
++
+ (test-end "session")
+ 
+-(exit (= (test-runner-fail-count (test-runner-current)) 0))
++(exit (= 0 exit-status))
+ 
+ ;;; session.scm ends here.
+diff --git a/tests/shell.scm b/tests/shell.scm
+index 7d613fb..e36e661 100644
+--- a/tests/shell.scm
++++ b/tests/shell.scm
+@@ -113,9 +113,10 @@
+ 
+ 
+ ;;;
++(define exit-status (test-runner-fail-count (test-runner-current)))
+ 
+ (test-end "shell")
+ 
+-(exit (= (test-runner-fail-count (test-runner-current)) 0))
++(exit (= 0 exit-status))
+ 
+ ;;; shell.scm ends here.
+diff --git a/tests/sssh-ssshd.scm b/tests/sssh-ssshd.scm
+index 2fe23db..edb53fc 100644
+--- a/tests/sssh-ssshd.scm
++++ b/tests/sssh-ssshd.scm
+@@ -118,8 +118,10 @@
+       result)))
+ 
+ 
++(define exit-status (test-runner-fail-count (test-runner-current)))
++
+ (test-end "sssh-ssshd")
+ 
+-(exit (= (test-runner-fail-count (test-runner-current)) 0))
++(exit (= 0 exit-status))
+ 
+ ;;; sssh-ssshd.scm ends here.
+diff --git a/tests/tunnel.scm b/tests/tunnel.scm
+index ef5a568..d6453b7 100644
+--- a/tests/tunnel.scm
++++ b/tests/tunnel.scm
+@@ -191,8 +191,10 @@
+                   (= pnum portnum)))
+            (eq? (channel-cancel-forward session "localhost" portnum) 'ok))))))))
+ 
++(define exit-status (test-runner-fail-count (test-runner-current)))
++
+ (test-end "tunnel")
+ 
+-(exit (= (test-runner-fail-count (test-runner-current)) 0))
++(exit (= 0 exit-status))
+ 
+ ;;; tunnel.scm ends here.
+-- 
+2.30.0
+
diff --git a/gnu/packages/patches/guile-ssh-read-error.patch b/gnu/packages/patches/guile-ssh-read-error.patch
new file mode 100644
index 0000000000..9cc6b048a0
--- /dev/null
+++ b/gnu/packages/patches/guile-ssh-read-error.patch
@@ -0,0 +1,18 @@
+This patch adjusts to slightly different 'read-error' in Guile 3.0.6
+compared to earlier versions:
+
+  https://github.com/artyom-poptsov/guile-ssh/issues/28
+
+--- a/tests/dist.scm
++++ b/tests/dist.scm
+@@ -183,8 +183,8 @@ Unbound variable: e"
+    rrepl-get-result))
+ 
+ (test-error-with-log/= "rrepl-get-result, unknown # object error"
+-  'node-repl-error "Reader error: scm_lreadr: #<unknown port>:1:3: \
+-Unknown # object: (#\\<): scheme@(guile-user)> \
++  'node-repl-error "Reader error: #f: #<unknown port>:1:3: \
++Unknown # object: (\"#<\"): scheme@(guile-user)> \
+ $4 = #<session #<undefined>@#<undefined>:22 (disconnected) 453fff>"
+   (call-with-input-string
+    (string-append  "scheme@(guile-user)> $4 = "
diff --git a/gnu/packages/patches/gvfs-add-support-for-libplist-2.2.patch b/gnu/packages/patches/gvfs-add-support-for-libplist-2.2.patch
deleted file mode 100644
index 250eef2c8b..0000000000
--- a/gnu/packages/patches/gvfs-add-support-for-libplist-2.2.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-Source: https://gitlab.gnome.org/GNOME/gvfs/-/commit/13551f3f40d41f1357126ac5a26d0fa012cd8123
-
-Note: This change should be incorporated into stable version 1.46.x of gvfs.
-
-From 13551f3f40d41f1357126ac5a26d0fa012cd8123 Mon Sep 17 00:00:00 2001
-From: Bastien Nocera <hadess@hadess.net>
-Date: Tue, 16 Jun 2020 13:28:35 +0200
-Subject: [PATCH] afc: Add support for libplist-2.2
-
-Which changed name from libplist to libplist-2.0 to embed its API
-version number in the library name.
----
- meson.build | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
-
-diff --git a/meson.build b/meson.build
-index 1750f65ca..187bfd55f 100644
---- a/meson.build
-+++ b/meson.build
-@@ -357,7 +357,10 @@ config_h.set('HAVE_LOGIND', enable_logind)
- enable_afc = get_option('afc')
- if enable_afc
-   libimobiledevice_dep = dependency('libimobiledevice-1.0', version: '>= 1.2')
--  libplist_dep = dependency('libplist', version: '>= 0.15')
-+  libplist_dep = dependency('libplist-2.0', required: false)
-+  if not libplist_dep.found()
-+    libplist_dep = dependency('libplist', version: '>= 0.15')
-+  endif
- endif
- 
- # *** Check if we should build with GOA volume monitor ***
--- 
-GitLab
-
diff --git a/gnu/packages/patches/hedgewars-network-bsd.patch b/gnu/packages/patches/hedgewars-network-bsd.patch
new file mode 100644
index 0000000000..311ce8bf09
--- /dev/null
+++ b/gnu/packages/patches/hedgewars-network-bsd.patch
@@ -0,0 +1,150 @@
+From f813f3d5b63bb5be1b5e0b44930e77656c547aad Mon Sep 17 00:00:00 2001
+From: Jens Petersen <none@none>
+Date: Wed, 8 Jul 2020 17:02:45 +0300
+Subject: [PATCH] update server network
+
+---
+ gameServer/Actions.hs                | 2 +-
+ gameServer/CMakeLists.txt            | 3 ++-
+ gameServer/ClientIO.hs               | 4 ++--
+ gameServer/CoreTypes.hs              | 2 +-
+ gameServer/OfficialServer/checker.hs | 5 ++---
+ gameServer/Utils.hs                  | 6 +-----
+ gameServer/hedgewars-server.cabal    | 3 ++-
+ gameServer/hedgewars-server.hs       | 5 +++--
+ 8 files changed, 14 insertions(+), 16 deletions(-)
+
+diff --git a/gameServer/Actions.hs b/gameServer/Actions.hs
+index 125d6ea832..c42d17b9a9 100644
+--- a/gameServer/Actions.hs
++++ b/gameServer/Actions.hs
+@@ -709,7 +709,7 @@ processAction RestartServer = do
+         args <- gets (runArgs . serverInfo)
+         io $ do
+             noticeM "Core" "Closing listening socket"
+-            sClose sock
++            close sock
+             noticeM "Core" "Spawning new server"
+             _ <- createProcess (proc "./hedgewars-server" args)
+             return ()
+diff --git a/gameServer/CMakeLists.txt b/gameServer/CMakeLists.txt
+index 5f2c882563..e71650c70c 100644
+--- a/gameServer/CMakeLists.txt
++++ b/gameServer/CMakeLists.txt
+@@ -9,7 +9,8 @@ check_haskell_package_exists(base "Control.Exception" mask 1)
+ check_haskell_package_exists(containers "Data.Map" size 1)
+ check_haskell_package_exists(vector "Data.Vector" length 1)
+ check_haskell_package_exists(bytestring "Data.ByteString" pack 1)
+-check_haskell_package_exists(network "Network.BSD" getHostName 0)
++check_haskell_package_exists(network "Network.Socket" defaultHints 0)
++check_haskell_package_exists(network-bsd "Network.BSD" getHostName 0)
+ check_haskell_package_exists(time "Data.Time" getCurrentTime 0)
+ check_haskell_package_exists(mtl "Control.Monad.State" fix 1)
+ check_haskell_package_exists(sandi "Codec.Binary.Base64" encode 1)
+diff --git a/gameServer/ClientIO.hs b/gameServer/ClientIO.hs
+index 46dd40ed9f..0c97bde932 100644
+--- a/gameServer/ClientIO.hs
++++ b/gameServer/ClientIO.hs
+@@ -23,7 +23,7 @@ import qualified Control.Exception as Exception
+ import Control.Monad.State
+ import Control.Concurrent.Chan
+ import Control.Concurrent
+-import Network
++import Network.Socket hiding (recv)
+ import Network.Socket.ByteString
+ import qualified Data.ByteString.Char8 as B
+ ----------------
+@@ -90,7 +90,7 @@ clientSendLoop s tId chan ci = do
+             sendAll s $ B.unlines answer `B.snoc` '\n'
+ 
+     if isQuit answer then
+-        sClose s
++        close s
+         else
+         clientSendLoop s tId chan ci
+ 
+diff --git a/gameServer/CoreTypes.hs b/gameServer/CoreTypes.hs
+index f547df483a..72f35807e3 100644
+--- a/gameServer/CoreTypes.hs
++++ b/gameServer/CoreTypes.hs
+@@ -23,7 +23,7 @@ import Control.Concurrent
+ import Data.Word
+ import qualified Data.Map as Map
+ import Data.Time
+-import Network
++import Network.Socket
+ import Data.Function
+ import Data.ByteString.Char8 as B
+ import Data.Unique
+diff --git a/gameServer/OfficialServer/checker.hs b/gameServer/OfficialServer/checker.hs
+index 37df3208b9..b4ecb8fc57 100644
+--- a/gameServer/OfficialServer/checker.hs
++++ b/gameServer/OfficialServer/checker.hs
+@@ -28,8 +28,7 @@ import System.Directory
+ import Control.Monad.State
+ import Control.Concurrent.Chan
+ import Control.Concurrent
+-import Network
+-import Network.BSD
++import Network.BSD hiding (recv)
+ import Network.Socket hiding (recv, sClose)
+ import Network.Socket.ByteString
+ import qualified Data.ByteString.Char8 as B
+@@ -207,7 +206,7 @@ main = withSocketsDo . forever $ do
+ 
+     Exception.bracket
+         setupConnection
+-        (\s -> noticeM "Core" "Shutting down" >> sClose s)
++        (\s -> noticeM "Core" "Shutting down" >> close s)
+         (session login password (d ++ "/.hedgewars") exeFullname dataPrefix)
+     where
+         setupConnection = do
+diff --git a/gameServer/Utils.hs b/gameServer/Utils.hs
+index 3d81b7f7c6..9fd80c01ba 100644
+--- a/gameServer/Utils.hs
++++ b/gameServer/Utils.hs
+@@ -41,11 +41,7 @@ import CoreTypes
+ 
+ 
+ sockAddr2String :: SockAddr -> IO B.ByteString
+-sockAddr2String (SockAddrInet _ hostAddr) = liftM B.pack $ inet_ntoa hostAddr
+-sockAddr2String (SockAddrInet6 _ _ (a, b, c, d) _) =
+-    return $ B.pack $ (foldr1 (.)
+-        $ List.intersperse (':':)
+-        $ concatMap (\n -> (\(a0, a1) -> [showHex a0, showHex a1]) $ divMod n 65536) [a, b, c, d]) []
++sockAddr2String = liftM (B.pack . fromJust . fst) . getNameInfo [] True False
+ 
+ maybeRead :: Read a => String -> Maybe a
+ maybeRead s = case reads s of
+diff --git a/gameServer/hedgewars-server.cabal b/gameServer/hedgewars-server.cabal
+index 3c7f2418c9..9f764fd997 100644
+--- a/gameServer/hedgewars-server.cabal
++++ b/gameServer/hedgewars-server.cabal
+@@ -57,7 +57,8 @@ Executable checker
+     containers,
+     vector,
+     bytestring,
+-    network >= 2.3 && < 3.0,
++    network >= 2.3,
++    network-bsd,
+     mtl >= 2,
+     sandi,
+     hslogger,
+diff --git a/gameServer/hedgewars-server.hs b/gameServer/hedgewars-server.hs
+index e47ae2891d..7e6ab8fa38 100644
+--- a/gameServer/hedgewars-server.hs
++++ b/gameServer/hedgewars-server.hs
+@@ -50,10 +50,11 @@ server si = do
+     proto <- getProtocolNumber "tcp"
+     E.bracket
+         (socket AF_INET Stream proto)
+-        sClose
++        close
+         (\sock -> do
+             setSocketOption sock ReuseAddr 1
+-            bindSocket sock (SockAddrInet (listenPort si) iNADDR_ANY)
++            iNADDR_ANY <- addrAddress . head <$> getAddrInfo Nothing (Just "0") (Just (show (listenPort si)))
++            bind sock iNADDR_ANY
+             listen sock maxListenQueue
+             startServer si{serverSocket = Just sock}
+         )
diff --git a/gnu/packages/patches/helm-fix-gcc-9-build.patch b/gnu/packages/patches/helm-fix-gcc-9-build.patch
new file mode 100644
index 0000000000..f623fef203
--- /dev/null
+++ b/gnu/packages/patches/helm-fix-gcc-9-build.patch
@@ -0,0 +1,140 @@
+From cb611a80bd5a36d31bfc31212ebbf79aa86c6f08 Mon Sep 17 00:00:00 2001
+From: jikstra <jikstra@disroot.org>
+Date: Tue, 20 Aug 2019 03:00:51 +0200
+Subject: [PATCH] Backport
+ https://github.com/WeAreROLI/JUCE/commit/4e0adb2af8b424c43d22bd431011c9a6c57d36b6
+ to the bundled JUCE framework to make helm compile on gcc 9.1 again
+
+---
+ .../juce_graphics/colour/juce_PixelFormats.h  | 25 +---------
+ .../native/juce_RenderingHelpers.h            | 48 +------------------
+ 2 files changed, 4 insertions(+), 69 deletions(-)
+
+diff --git a/JUCE/modules/juce_graphics/colour/juce_PixelFormats.h b/JUCE/modules/juce_graphics/colour/juce_PixelFormats.h
+index 9be9ba09c..3535eab80 100644
+--- a/JUCE/modules/juce_graphics/colour/juce_PixelFormats.h
++++ b/JUCE/modules/juce_graphics/colour/juce_PixelFormats.h
+@@ -105,23 +105,9 @@ class JUCE_API  PixelARGB
+ 

+     //==============================================================================

+     forcedinline uint8 getAlpha() const noexcept      { return components.a; }

+-    forcedinline uint8 getRed() const noexcept        { return components.r; }

++    forcedinline uint8 getRed()   const noexcept      { return components.r; }

+     forcedinline uint8 getGreen() const noexcept      { return components.g; }

+-    forcedinline uint8 getBlue() const noexcept       { return components.b; }

+-

+-   #if JUCE_GCC

+-    // NB these are here as a workaround because GCC refuses to bind to packed values.

+-    forcedinline uint8& getAlpha() noexcept           { return comps [indexA]; }

+-    forcedinline uint8& getRed() noexcept             { return comps [indexR]; }

+-    forcedinline uint8& getGreen() noexcept           { return comps [indexG]; }

+-    forcedinline uint8& getBlue() noexcept            { return comps [indexB]; }

+-   #else

+-    forcedinline uint8& getAlpha() noexcept           { return components.a; }

+-    forcedinline uint8& getRed() noexcept             { return components.r; }

+-    forcedinline uint8& getGreen() noexcept           { return components.g; }

+-    forcedinline uint8& getBlue() noexcept            { return components.b; }

+-   #endif

+-

++    forcedinline uint8 getBlue()  const noexcept      { return components.b; }

+     //==============================================================================

+     /** Copies another pixel colour over this one.

+ 

+@@ -340,9 +326,6 @@ class JUCE_API  PixelARGB
+     {

+         uint32 internal;

+         Components components;

+-       #if JUCE_GCC

+-        uint8 comps[4];  // helper struct needed because gcc does not allow references to packed union members

+-       #endif

+     };

+ }

+ #ifndef DOXYGEN

+@@ -429,10 +412,6 @@ class JUCE_API  PixelRGB
+     forcedinline uint8 getGreen() const noexcept    { return g; }

+     forcedinline uint8 getBlue() const noexcept     { return b; }

+ 

+-    forcedinline uint8& getRed() noexcept           { return r; }

+-    forcedinline uint8& getGreen() noexcept         { return g; }

+-    forcedinline uint8& getBlue() noexcept          { return b; }

+-

+     //==============================================================================

+     /** Copies another pixel colour over this one.

+ 

+diff --git a/JUCE/modules/juce_graphics/native/juce_RenderingHelpers.h b/JUCE/modules/juce_graphics/native/juce_RenderingHelpers.h
+index 1c4cd31ef..29519cb5a 100644
+--- a/JUCE/modules/juce_graphics/native/juce_RenderingHelpers.h
++++ b/JUCE/modules/juce_graphics/native/juce_RenderingHelpers.h
+@@ -581,18 +581,10 @@ namespace EdgeTableFillers
+             : destData (image), sourceColour (colour)

+         {

+             if (sizeof (PixelType) == 3 && destData.pixelStride == sizeof (PixelType))

+-            {

+                 areRGBComponentsEqual = sourceColour.getRed() == sourceColour.getGreen()

+                                             && sourceColour.getGreen() == sourceColour.getBlue();

+-                filler[0].set (sourceColour);

+-                filler[1].set (sourceColour);

+-                filler[2].set (sourceColour);

+-                filler[3].set (sourceColour);

+-            }

+             else

+-            {

+                 areRGBComponentsEqual = false;

+-            }

+         }

+ 

+         forcedinline void setEdgeTableYPos (const int y) noexcept

+@@ -643,7 +635,6 @@ namespace EdgeTableFillers
+         const Image::BitmapData& destData;

+         PixelType* linePixels;

+         PixelARGB sourceColour;

+-        PixelRGB filler [4];

+         bool areRGBComponentsEqual;

+ 

+         forcedinline PixelType* getPixel (const int x) const noexcept

+@@ -658,43 +649,8 @@ namespace EdgeTableFillers
+ 

+         forcedinline void replaceLine (PixelRGB* dest, const PixelARGB colour, int width) const noexcept

+         {

+-            if (destData.pixelStride == sizeof (*dest))

+-            {

+-                if (areRGBComponentsEqual)  // if all the component values are the same, we can cheat..

+-                {

+-                    memset (dest, colour.getRed(), (size_t) width * 3);

+-                }

+-                else

+-                {

+-                    if (width >> 5)

+-                    {

+-                        const int* const intFiller = reinterpret_cast<const int*> (filler);

+-

+-                        while (width > 8 && (((pointer_sized_int) dest) & 7) != 0)

+-                        {

+-                            dest->set (colour);

+-                            ++dest;

+-                            --width;

+-                        }

+-

+-                        while (width > 4)

+-                        {

+-                            int* d = reinterpret_cast<int*> (dest);

+-                            *d++ = intFiller[0];

+-                            *d++ = intFiller[1];

+-                            *d++ = intFiller[2];

+-                            dest = reinterpret_cast<PixelRGB*> (d);

+-                            width -= 4;

+-                        }

+-                    }

+-

+-                    while (--width >= 0)

+-                    {

+-                        dest->set (colour);

+-                        ++dest;

+-                    }

+-                }

+-            }

++            if ((size_t) destData.pixelStride == sizeof (*dest) && areRGBComponentsEqual)

++                memset ((void*) dest, colour.getRed(), (size_t) width * 3);   // if all the component values are the same, we can cheat..

+             else

+             {

+                 JUCE_PERFORM_PIXEL_OP_LOOP (set (colour))

diff --git a/gnu/packages/patches/hexchat-add-libera-chat.patch b/gnu/packages/patches/hexchat-add-libera-chat.patch
deleted file mode 100644
index 2bbb3137ba..0000000000
--- a/gnu/packages/patches/hexchat-add-libera-chat.patch
+++ /dev/null
@@ -1,76 +0,0 @@
-Add libera.chat to the list of available networks and make it the
-default.
-
-Patches copied from upstream source repository:
-
-https://github.com/hexchat/hexchat/commit/a25f2381689d2c2279a0e43b33f6c0ec8305a096
-https://github.com/hexchat/hexchat/commit/d3545f37cd5f551ed8bc0ab7b20e5c8140adc0a6
-
-From a25f2381689d2c2279a0e43b33f6c0ec8305a096 Mon Sep 17 00:00:00 2001
-From: Panagiotis Vasilopoulos <hello@alwayslivid.com>
-Date: Wed, 19 May 2021 16:25:16 +0300
-Subject: [PATCH] Add Libera Chat to network list
-
----
- src/common/servlist.c | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/src/common/servlist.c b/src/common/servlist.c
-index e44a3f2df..33bd80f2d 100644
---- a/src/common/servlist.c
-+++ b/src/common/servlist.c
-@@ -239,6 +239,9 @@ static const struct defaultserver def[] =
- 	/* Self signed */
- 	{0,			"irc.librairc.net"},
- 
-+	{"Libera Chat", 0, 0, 0, LOGIN_SASL, 0, TRUE},
-+	{0,			"irc.libera.chat"},
-+
- #ifdef USE_OPENSSL
- 	{"LinkNet",	0},
- 	{0,			"irc.link-net.org/+7000"},
-From d3545f37cd5f551ed8bc0ab7b20e5c8140adc0a6 Mon Sep 17 00:00:00 2001
-From: Patrick Griffis <pgriffis@igalia.com>
-Date: Sun, 23 May 2021 21:15:43 -0500
-Subject: [PATCH] Change default network to Libera.Chat
-
----
- src/common/servlist.c | 4 ++--
- src/fe-gtk/joind.c    | 2 +-
- 2 files changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/src/common/servlist.c b/src/common/servlist.c
-index de75c8b9a..93557f975 100644
---- a/src/common/servlist.c
-+++ b/src/common/servlist.c
-@@ -240,7 +240,7 @@ static const struct defaultserver def[] =
- 	/* Self signed */
- 	{0,			"irc.librairc.net"},
- 
--	{"Libera Chat", 0, 0, 0, LOGIN_SASL, 0, TRUE},
-+	{"Libera.Chat", 0, 0, 0, LOGIN_SASL, 0, TRUE},
- 	{0,			"irc.libera.chat"},
- 
- #ifdef USE_OPENSSL
-@@ -942,7 +942,7 @@ servlist_load_defaults (void)
- {
- 	int i = 0, j = 0;
- 	ircnet *net = NULL;
--	guint def_hash = g_str_hash ("freenode");
-+	guint def_hash = g_str_hash ("Libera.Chat");
- 
- 	while (1)
- 	{
-diff --git a/src/fe-gtk/joind.c b/src/fe-gtk/joind.c
-index f1d3da504..ce3cbcaec 100644
---- a/src/fe-gtk/joind.c
-+++ b/src/fe-gtk/joind.c
-@@ -247,7 +247,7 @@ joind_show_dialog (server *serv)
- 							G_CALLBACK (joind_ok_cb), serv);
- 							
- 	if (serv->network)
--		if (g_ascii_strcasecmp(((ircnet*)serv->network)->name, "freenode") == 0)
-+		if (g_ascii_strcasecmp(((ircnet*)serv->network)->name, "Libera.Chat") == 0)
- 		{
- 			gtk_entry_set_text (GTK_ENTRY (entry1), "#hexchat");
- 		}
diff --git a/gnu/packages/patches/htslib-for-stringtie.patch b/gnu/packages/patches/htslib-for-stringtie.patch
new file mode 100644
index 0000000000..3e6cd5bb63
--- /dev/null
+++ b/gnu/packages/patches/htslib-for-stringtie.patch
@@ -0,0 +1,26 @@
+These changes are commits d7e357946ead219b81cc1becbe0de8a99d96ca84 and
+8ed0daa39bc662defa99507f926815431056543a in
+https://github.com/samtools/htscodecs.  The stringtie package expects these
+changes to have been applied.
+
+diff -ru htslib-1.12/htscodecs/htscodecs/tokenise_name3.c stringtie-2.2.0/htslib/htscodecs/htscodecs/tokenise_name3.c
+--- a/htscodecs/htscodecs/tokenise_name3.c	2021-02-22 13:07:06.000000000 +0100
++++ b/htscodecs/htscodecs/tokenise_name3.c	2021-12-04 19:27:39.000000000 +0100
+@@ -211,7 +211,7 @@
+ 	if (!ctx) return NULL;
+ 	ctx->max_names = max_names;
+ 	pthread_setspecific(tok_key, ctx);
+-    } else if (ctx->max_names < max_names) {
++    } else if (ctx->max_names < max_names+1) {
+ 	ctx = realloc(ctx, sizeof(*ctx) + ++max_names*sizeof(*ctx->lc));
+ 	if (!ctx) return NULL;
+ 	ctx->max_names = max_names;
+@@ -1058,6 +1058,8 @@
+ 	tok = decode_token_type(ctx, ntok);
+ 	//fprintf(stderr, "Tok %d = %d\n", ntok, tok);
+ 
++	ctx->lc[cnum].last_ntok = 0;
++
+ 	switch (tok) {
+ 	case N_CHAR:
+ 	    if (len+1 >= name_len) return -1;
\ No newline at end of file
diff --git a/gnu/packages/patches/hueplusplus-mbedtls.patch b/gnu/packages/patches/hueplusplus-mbedtls.patch
new file mode 100644
index 0000000000..894590af8d
--- /dev/null
+++ b/gnu/packages/patches/hueplusplus-mbedtls.patch
@@ -0,0 +1,20 @@
+Remove references to bundled mbedtls library to use the one from inputs.
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 1e27d21..f0eb1a5 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -85,13 +85,6 @@ endif()
+ 
+ set(USE_STATIC_MBEDTLS_LIBRARY ON)
+ set(USE_SHARED_MBEDTLS_LIBRARY OFF)
+-add_subdirectory("lib/mbedtls" EXCLUDE_FROM_ALL)
+-
+-# Compile the mbedtls library as a static with position independent code,
+-# because we need it for both a shared and static library
+-set_property(TARGET mbedtls PROPERTY POSITION_INDEPENDENT_CODE ON)
+-set_property(TARGET mbedcrypto PROPERTY POSITION_INDEPENDENT_CODE ON)
+-set_property(TARGET mbedx509 PROPERTY POSITION_INDEPENDENT_CODE ON)
+ 
+ add_subdirectory(src)
+ 
diff --git a/gnu/packages/patches/i3status-rust-enable-unstable-features.patch b/gnu/packages/patches/i3status-rust-enable-unstable-features.patch
new file mode 100644
index 0000000000..535b45d865
--- /dev/null
+++ b/gnu/packages/patches/i3status-rust-enable-unstable-features.patch
@@ -0,0 +1,20 @@
+From 3006390c0058f06c255d9850327163aebcdc3b40 Mon Sep 17 00:00:00 2001
+From: Petr Hodina <phodina@protonmail.com>
+Date: Mon, 11 Oct 2021 22:35:39 +0200
+Subject: [PATCH] Enable unstable features.
+
+
+diff --git a/src/main.rs b/src/main.rs
+index d9e964b..820e22e 100644
+--- a/src/main.rs
++++ b/src/main.rs
+@@ -1,3 +1,6 @@
++#![feature(bool_to_option)]
++#![feature(clamp)]
++
+ #[macro_use]
+ mod de;
+ #[macro_use]
+--
+2.33.0
+
diff --git a/gnu/packages/patches/i7z-gcc-10.patch b/gnu/packages/patches/i7z-gcc-10.patch
new file mode 100644
index 0000000000..407e17a995
--- /dev/null
+++ b/gnu/packages/patches/i7z-gcc-10.patch
@@ -0,0 +1,23 @@
+From: Tobias Geerinckx-Rice <me@tobias.gr>
+Date: Sat, 11 Dec 2021 19:22:49 +0100
+Subject: [PATCH] gnu: i7z: Build with GCC 10.
+
+Patch from Debian, modified to apply to our i7z sources in src/.
+
+Author: Andreas Beckmann <anbe@debian.org>
+Description: fix FTBFS with gcc-10
+ gcc-10 defaults to -fno-common
+ see https://gcc.gnu.org/gcc-10/porting_to.html
+Bug-Debian: https://bugs.debian.org/957351
+
+--- a/src/i7z_Dual_Socket.c
++++ b/src/i7z_Dual_Socket.c
+@@ -37,7 +37,7 @@ float Read_Voltage_CPU(int cpu_num);
+ extern struct program_options prog_options;
+ FILE *fp_log_file;
+ 
+-struct timespec global_ts;
++extern struct timespec global_ts;
+ extern FILE *fp_log_file_freq_1, *fp_log_file_freq_2;
+ 
+ extern char* CPU_FREQUENCY_LOGGING_FILE_single;
diff --git a/gnu/packages/patches/icecat-makeicecat.patch b/gnu/packages/patches/icecat-makeicecat.patch
index edd1ced257..c46cb27ff6 100644
--- a/gnu/packages/patches/icecat-makeicecat.patch
+++ b/gnu/packages/patches/icecat-makeicecat.patch
@@ -3,108 +3,49 @@ in a snippet without network access.  After this patch is applied, some
 additional changes will be made using 'substitute*'.
 
 diff --git a/makeicecat b/makeicecat
-index 8be2362..48716f2 100755
+index bf2b7a6..bc3b19b 100755
 --- a/makeicecat
 +++ b/makeicecat
-@@ -31,55 +31,55 @@ SOURCEDIR=icecat-$FFVERSION
+@@ -58,7 +58,7 @@ readonly SOURCEDIR=icecat-${FFVERSION}
+ # debug/shell options
+ readonly DEVEL=0
+ set -euo pipefail
+-(( DEVEL )) && set -x
++set -x
  
- DATA="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/data
  
--mkdir -p output
--cd output
-+# mkdir -p output
-+# cd output
- 
- ###############################################################################
- # Retrieve FF source code
  ###############################################################################
+@@ -459,7 +459,7 @@ configure_search()
+     sed 's|ddg@|ddg-html@|' -i browser/components/search/extensions/ddg-html/manifest.json
  
--rm mozilla-esr${FFMAJOR} $SOURCEDIR -rf
--
--wget -N https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${FFVERSION}esr/source/firefox-${FFVERSION}esr.source.tar.xz
--wget -N https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${FFVERSION}esr/source/firefox-${FFVERSION}esr.source.tar.xz.asc
--gpg --recv-keys --keyserver keyserver.ubuntu.com 14F26682D0916CDD81E37B6D61B7B526D98F0353
--gpg --verify firefox-${FFVERSION}esr.source.tar.xz.asc
--echo -n 1aa041db28cd742e93d663a9da8defd33040b38d8b9470350538473251621643 firefox-${FFVERSION}esr.source.tar.xz |sha256sum -c -
--
--echo Extracting Firefox tarball
--tar -xf firefox-${FFVERSION}esr.source.tar.xz
--
--mv firefox-${FFVERSION} $SOURCEDIR
-+# rm mozilla-esr${FFMAJOR} $SOURCEDIR -rf
-+# 
-+# wget -N https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${FFVERSION}esr/source/firefox-${FFVERSION}esr.source.tar.xz
-+# wget -N https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${FFVERSION}esr/source/firefox-${FFVERSION}esr.source.tar.xz.asc
-+# gpg --recv-keys --keyserver keyserver.ubuntu.com 14F26682D0916CDD81E37B6D61B7B526D98F0353
-+# gpg --verify firefox-${FFVERSION}esr.source.tar.xz.asc
-+# echo -n 1aa041db28cd742e93d663a9da8defd33040b38d8b9470350538473251621643 firefox-${FFVERSION}esr.source.tar.xz |sha256sum -c -
-+# 
-+# echo Extracting Firefox tarball
-+# tar -xf firefox-${FFVERSION}esr.source.tar.xz
-+# 
-+# mv firefox-${FFVERSION} $SOURCEDIR
+     # Process various JSON pre-configuration dumps.
+-    python3 ../../tools/process-json-files.py . browser/components/extensions/schemas/
++    python3 "${DATADIR}"/../tools/process-json-files.py . browser/components/extensions/schemas/
+ }
  
+ configure_mobile()
+@@ -855,12 +855,12 @@ finalize_sourceball()
+ # entry point
  ###############################################################################
- # Retrieve l10n
- ###############################################################################
- 
--mkdir l10n
--cd l10n
--while read line;do
--    line=$(echo $line |cut -d' ' -f1)
--    #[ $line = "es-ES" ] || continue # To speed up testing
--    [ $line = "en-US" ] && continue
--    hg clone https://hg.mozilla.org/l10n-central/$line
--    mkdir -p $line/browser/chrome/browser/preferences
--    touch $line/browser/chrome/browser/preferences/advanced-scripts.dtd
--    rm -rf $line/.hg*
--done < ../$SOURCEDIR/browser/locales/shipped-locales
--cd ..
--
--mv l10n $SOURCEDIR
--
--hg clone https://hg.mozilla.org/l10n/compare-locales/
--cd compare-locales/
--hg checkout RELEASE_8_0_0
--cd ..
--rm compare-locales/.hg* compare-locales/.git* -rf
--mv compare-locales $SOURCEDIR/l10n
-+# mkdir l10n
-+# cd l10n
-+# while read line;do
-+#     line=$(echo $line |cut -d' ' -f1)
-+#     #[ $line = "es-ES" ] || continue # To speed up testing
-+#     [ $line = "en-US" ] && continue
-+#     hg clone https://hg.mozilla.org/l10n-central/$line
-+#     mkdir -p $line/browser/chrome/browser/preferences
-+#     touch $line/browser/chrome/browser/preferences/advanced-scripts.dtd
-+#     rm -rf $line/.hg*
-+# done < ../$SOURCEDIR/browser/locales/shipped-locales
-+# cd ..
-+# 
-+# mv l10n $SOURCEDIR
-+# 
-+# hg clone https://hg.mozilla.org/l10n/compare-locales/
-+# cd compare-locales/
-+# hg checkout RELEASE_8_0_0
-+# cd ..
-+# rm compare-locales/.hg* compare-locales/.git* -rf
-+# mv compare-locales $SOURCEDIR/l10n
- 
- #######################################################
- 
--cd $SOURCEDIR
-+# cd $SOURCEDIR
- 
- shopt -s nullglob
- for patch in $DATA/patches/*.patch; do
-@@ -598,6 +598,6 @@ sed 's/777/755/;' -i toolkit/crashreporter/google-breakpad/Makefile.in
- # Fix CVE-2012-3386
- /bin/sed 's/chmod a+w/chmod u+w/' -i ./js/src/ctypes/libffi/Makefile.in ./toolkit/crashreporter/google-breakpad/Makefile.in ./toolkit/crashreporter/google-breakpad/src/third_party/glog/Makefile.in || true
  
--cd ..
--echo Packaging tarball
--tar cfj icecat-$ICECATVERSION.tar.bz2 $SOURCEDIR
-+# cd ..
-+# echo Packaging tarball
-+# tar cfj icecat-$ICECATVERSION.tar.bz2 $SOURCEDIR
+-validate_env || exit 1
+-prepare_env
+-fetch_source
+-verify_sources
+-extract_sources
+-fetch_l10n
++# validate_env || exit 1
++# prepare_env
++# fetch_source
++# verify_sources
++# extract_sources
++# fetch_l10n
+ apply_patches
+ configure
+ configure_search
+@@ -872,4 +872,4 @@ prepare_macos_packaging
+ configure_extensions
+ configure_onboarding
+ apply_bugfixes
+-finalize_sourceball
++# finalize_sourceball
diff --git a/gnu/packages/patches/icedtea-6-extend-hotspot-aarch64-support.patch b/gnu/packages/patches/icedtea-6-extend-hotspot-aarch64-support.patch
deleted file mode 100644
index 9dc112a344..0000000000
--- a/gnu/packages/patches/icedtea-6-extend-hotspot-aarch64-support.patch
+++ /dev/null
@@ -1,1831 +0,0 @@
-From d51cb8c0f7966ac0b870e90e421cc8a796d98abf Mon Sep 17 00:00:00 2001
-From: Simon South <simon@simonsouth.net>
-Date: Tue, 9 Jun 2020 13:48:42 -0400
-Subject: [PATCH] Extend AArch64 support
-
-This adds to IcedTea 6 a patch that extends the support for AArch64 in
-its version of HotSpot, allowing the portable Zero virtual machine to
-be built for that platform.
-
-The patch added is a backport of the one prepared for JDK 9 by the
-OpenJDK AArch64 Porting Project, available (as of 11 June 2020) for
-download from https://openjdk.java.net/jeps/237.
----
- Makefile.am                                   |    3 +-
- Makefile.in                                   |   12 +-
- .../hs23/aarch64-extended-support.patch       | 1766 +++++++++++++++++
- 3 files changed, 1775 insertions(+), 6 deletions(-)
- create mode 100644 patches/hotspot/hs23/aarch64-extended-support.patch
-
-diff --git a/Makefile.am b/Makefile.am
-index 97dac85..f5c917b 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -621,7 +621,8 @@ ICEDTEA_PATCHES = \
- 	patches/openjdk/6260348-pr3068.patch \
- 	patches/openjdk/6961123-pr2975.patch \
- 	patches/pr2800-missing_resources.patch \
--	patches/pr3213-conditional_arm32jit.patch
-+	patches/pr3213-conditional_arm32jit.patch \
-+	patches/hotspot/hs23/aarch64-extended-support.patch
- 
- if WITH_RHINO
- ICEDTEA_PATCHES += \
-diff --git a/Makefile.in b/Makefile.in
-index aced7c2..e3545ee 100644
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -1049,11 +1049,13 @@ ICEDTEA_PATCHES = $(DROP_PATCHES) $(SECURITY_PATCHES) \
- 	patches/openjdk/6260348-pr3068.patch \
- 	patches/openjdk/6961123-pr2975.patch \
- 	patches/pr2800-missing_resources.patch \
--	patches/pr3213-conditional_arm32jit.patch $(am__append_21) \
--	$(am__append_22) $(am__append_23) $(am__append_24) \
--	$(am__append_25) $(am__append_26) $(am__append_27) \
--	$(am__append_28) $(am__append_29) $(am__append_30) \
--	$(am__append_31) $(am__append_32) $(DISTRIBUTION_PATCHES)
-+	patches/pr3213-conditional_arm32jit.patch \
-+	patches/hotspot/hs23/aarch64-extended-support.patch \
-+	$(am__append_21) $(am__append_22) $(am__append_23) \
-+	$(am__append_24) $(am__append_25) $(am__append_26) \
-+	$(am__append_27) $(am__append_28) $(am__append_29) \
-+	$(am__append_30) $(am__append_31) $(am__append_32) \
-+	$(DISTRIBUTION_PATCHES)
- @ENABLE_NSS_FALSE@NSS_PATCHES = patches/nss-not-enabled-config.patch
- @ENABLE_NSS_TRUE@NSS_PATCHES = patches/nss-config.patch
- 
-diff --git a/patches/hotspot/hs23/aarch64-extended-support.patch b/patches/hotspot/hs23/aarch64-extended-support.patch
-new file mode 100644
-index 0000000..7817f4d
---- /dev/null
-+++ b/patches/hotspot/hs23/aarch64-extended-support.patch
-@@ -0,0 +1,1766 @@
-+diff --git openjdk.orig/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c openjdk/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c
-+index 5771fdd..b23cc17 100644
-+--- openjdk.orig/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c
-++++ openjdk/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c
-+@@ -304,6 +304,9 @@ JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLo
-+ #ifdef amd64
-+ #define NPRGREG sun_jvm_hotspot_debugger_amd64_AMD64ThreadContext_NPRGREG
-+ #endif
-++#ifdef aarch64
-++#define NPRGREG 32
-++#endif
-+ #if defined(sparc) || defined(sparcv9)
-+ #define NPRGREG sun_jvm_hotspot_debugger_sparc_SPARCThreadContext_NPRGREG
-+ #endif
-+@@ -406,6 +409,12 @@ JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLo
-+   regs[REG_INDEX(R_O7)]  = gregs.u_regs[14];
-+ #endif /* sparc */
-+ 
-++#if defined(aarch64)
-++
-++#define REG_INDEX(reg) sun_jvm_hotspot_debugger_aarch64_AARCH64ThreadContext_##reg
-++
-++#endif /* aarch64 */
-++
-+ 
-+   (*env)->ReleaseLongArrayElements(env, array, regs, JNI_COMMIT);
-+   return array;
-+diff --git openjdk.orig/hotspot/agent/src/os/linux/libproc.h openjdk/hotspot/agent/src/os/linux/libproc.h
-+index e4d77f7..c02b841 100644
-+--- openjdk.orig/hotspot/agent/src/os/linux/libproc.h
-++++ openjdk/hotspot/agent/src/os/linux/libproc.h
-+@@ -54,6 +54,10 @@ struct pt_regs {
-+ 
-+ #endif //sparc or sparcv9
-+ 
-++#if defined(aarch64)
-++#include "asm/ptrace.h"
-++#endif
-++
-+ /************************************************************************************
-+ 
-+ 0. This is very minimal subset of Solaris libproc just enough for current application.
-+@@ -97,6 +101,9 @@ unsigned long   regs[IA64_REG_COUNT];     /* integer and fp regs */
-+ #if defined(sparc)  || defined(sparcv9)
-+ #define user_regs_struct  pt_regs
-+ #endif
-++#if defined(aarch64)
-++#define user_regs_struct user_pt_regs
-++#endif
-+ 
-+ // This C bool type must be int for compatibility with Linux calls and
-+ // it would be a mistake to equivalence it to C++ bool on many platforms
-+diff --git openjdk.orig/hotspot/make/defs.make openjdk/hotspot/make/defs.make
-+index 44f21f8..4e8d00b 100644
-+--- openjdk.orig/hotspot/make/defs.make
-++++ openjdk/hotspot/make/defs.make
-+@@ -232,7 +232,7 @@ ifneq ($(OSNAME),windows)
-+ 
-+   # Use uname output for SRCARCH, but deal with platform differences. If ARCH
-+   # is not explicitly listed below, it is treated as x86. 
-+-  SRCARCH     = $(ARCH/$(filter sparc sparc64 ia64 amd64 x86_64 arm ppc zero,$(ARCH)))
-++  SRCARCH     = $(ARCH/$(filter sparc sparc64 ia64 amd64 x86_64 arm ppc aarch64 zero,$(ARCH)))
-+   ARCH/       = x86
-+   ARCH/sparc  = sparc
-+   ARCH/sparc64= sparc
-+@@ -242,6 +242,7 @@ ifneq ($(OSNAME),windows)
-+   ARCH/ppc64  = ppc
-+   ARCH/ppc    = ppc
-+   ARCH/arm    = arm
-++  ARCH/aarch64= aarch64
-+   ARCH/zero   = zero
-+ 
-+   # BUILDARCH is usually the same as SRCARCH, except for sparcv9
-+@@ -267,11 +268,12 @@ ifneq ($(OSNAME),windows)
-+   LIBARCH/sparcv9 = sparcv9
-+   LIBARCH/ia64    = ia64
-+   LIBARCH/ppc64   = ppc
-++  LIBARCH/aarch64 = aarch64
-+   LIBARCH/ppc     = ppc
-+   LIBARCH/arm     = arm
-+   LIBARCH/zero    = $(ZERO_LIBARCH)
-+ 
-+-  LP64_ARCH = sparcv9 amd64 ia64 zero
-++  LP64_ARCH = sparcv9 amd64 ia64 aarch64 zero
-+ endif
-+ 
-+ # Required make macro settings for all platforms
-+diff --git openjdk.orig/hotspot/make/linux/makefiles/buildtree.make openjdk/hotspot/make/linux/makefiles/buildtree.make
-+index 7c3d4f9..3bc7e8a 100644
-+--- openjdk.orig/hotspot/make/linux/makefiles/buildtree.make
-++++ openjdk/hotspot/make/linux/makefiles/buildtree.make
-+@@ -385,6 +385,7 @@ DATA_MODE/sparc   = 32
-+ DATA_MODE/sparcv9 = 64
-+ DATA_MODE/amd64   = 64
-+ DATA_MODE/ia64    = 64
-++DATA_MODE/aarch64 = 64
-+ DATA_MODE/zero    = $(ARCH_DATA_MODEL)
-+ 
-+ JAVA_FLAG/32 = -d32
-+diff --git openjdk.orig/hotspot/make/linux/makefiles/defs.make openjdk/hotspot/make/linux/makefiles/defs.make
-+index 7bb3149..39ffda4 100644
-+--- openjdk.orig/hotspot/make/linux/makefiles/defs.make
-++++ openjdk/hotspot/make/linux/makefiles/defs.make
-+@@ -118,6 +118,15 @@ ifeq ($(ARCH), ppc)
-+   HS_ARCH          = ppc
-+ endif
-+ 
-++# AARCH64
-++ifeq ($(ARCH), aarch64)
-++  ARCH_DATA_MODEL  = 64
-++  MAKE_ARGS        += LP64=1
-++  PLATFORM         = linux-aarch64
-++  VM_PLATFORM      = linux_aarch64
-++  HS_ARCH          = aarch64
-++endif
-++
-+ # determine if HotSpot is being built in JDK6 or earlier version
-+ JDK6_OR_EARLIER=0
-+ ifeq "$(shell expr \( '$(JDK_MAJOR_VERSION)' != '' \& '$(JDK_MINOR_VERSION)' != '' \& '$(JDK_MICRO_VERSION)' != '' \))" "1"
-+diff --git openjdk.orig/hotspot/make/linux/makefiles/gcc.make openjdk/hotspot/make/linux/makefiles/gcc.make
-+index 897e3a6..44f1673 100644
-+--- openjdk.orig/hotspot/make/linux/makefiles/gcc.make
-++++ openjdk/hotspot/make/linux/makefiles/gcc.make
-+@@ -104,6 +104,7 @@ endif
-+ ARCHFLAG = $(ARCHFLAG/$(BUILDARCH))
-+ ARCHFLAG/i486    = -m32 -march=i586
-+ ARCHFLAG/amd64   = -m64
-++ARCHFLAG/aarch64 =
-+ ARCHFLAG/ia64    =
-+ ARCHFLAG/sparc   = -m32 -mcpu=v9
-+ ARCHFLAG/sparcv9 = -m64 -mcpu=v9
-+diff --git openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp openjdk/hotspot/src/os/linux/vm/os_linux.cpp
-+index c1b0e5c..9f7cda0 100644
-+--- openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp
-++++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp
-+@@ -296,6 +296,8 @@ static char cpu_arch[] = "sparcv9";
-+ #  else
-+ static char cpu_arch[] = "sparc";
-+ #  endif
-++#elif defined(AARCH64)
-++static char cpu_arch[] = "aarch64";
-+ #else
-+ #error Add appropriate cpu_arch setting
-+ #endif
-+@@ -1442,7 +1444,7 @@ void os::Linux::clock_init() {
-+ #ifndef SYS_clock_getres
-+ 
-+ #if defined(IA32) || defined(AMD64)
-+-#define SYS_clock_getres IA32_ONLY(266)  AMD64_ONLY(229)
-++#define SYS_clock_getres IA32_ONLY(266)  AMD64_ONLY(229) AARCH64_ONLY(114)
-+ #define sys_clock_getres(x,y)  ::syscall(SYS_clock_getres, x, y)
-+ #else
-+ #warning "SYS_clock_getres not defined for this platform, disabling fast_thread_cpu_time"
-+@@ -1930,7 +1932,7 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen)
-+     static  Elf32_Half running_arch_code=EM_AARCH64;
-+   #else
-+     #error Method os::dll_load requires that one of following is defined:\
-+-         IA32, AMD64, IA64, __sparc, __powerpc__, ARM, S390, ALPHA, MIPS, MIPSEL, PARISC, M68K, SH
-++      IA32, AMD64, IA64, __sparc, __powerpc__, ARM, S390, ALPHA, MIPS, MIPSEL, PARISC, M68K, SH, AARCH64
-+   #endif
-+ 
-+   // Identify compatability class for VM's architecture and library's architecture
-+@@ -3056,7 +3058,7 @@ void os::large_page_init() {
-+ 
-+ #ifndef ZERO
-+     _large_page_size = IA32_ONLY(4 * M) AMD64_ONLY(2 * M) IA64_ONLY(256 * M) SPARC_ONLY(4 * M)
-+-                       ARM_ONLY(2 * M) PPC_ONLY(4 * M);
-++                       ARM_ONLY(2 * M) PPC_ONLY(4 * M) AARCH64_ONLY(2 * M);
-+ #endif // ZERO
-+ 
-+     FILE *fp = fopen("/proc/meminfo", "r");
-+@@ -5378,11 +5380,11 @@ void Parker::unpark() {
-+ extern char** environ;
-+ 
-+ #ifndef __NR_fork
-+-#define __NR_fork IA32_ONLY(2) IA64_ONLY(not defined) AMD64_ONLY(57)
-++#define __NR_fork IA32_ONLY(2) IA64_ONLY(not defined) AMD64_ONLY(57) AARCH64_ONLY(1079)
-+ #endif
-+ 
-+ #ifndef __NR_execve
-+-#define __NR_execve IA32_ONLY(11) IA64_ONLY(1033) AMD64_ONLY(59)
-++#define __NR_execve IA32_ONLY(11) IA64_ONLY(1033) AMD64_ONLY(59) AARCH64_ONLY(221)
-+ #endif
-+ 
-+ // Run the specified command in a separate process. Return its exit value,
-+diff --git openjdk.orig/hotspot/src/share/vm/adlc/main.cpp openjdk/hotspot/src/share/vm/adlc/main.cpp
-+index 47e207a..b93504e 100644
-+--- openjdk.orig/hotspot/src/share/vm/adlc/main.cpp
-++++ openjdk/hotspot/src/share/vm/adlc/main.cpp
-+@@ -244,6 +244,11 @@ int main(int argc, char *argv[])
-+   AD.addInclude(AD._CPP_file, "assembler_arm.inline.hpp");
-+   AD.addInclude(AD._CPP_file, "nativeInst_arm.hpp");
-+   AD.addInclude(AD._CPP_file, "vmreg_arm.inline.hpp");
-++#endif
-++#ifdef TARGET_ARCH_aarch64
-++  AD.addInclude(AD._CPP_file, "assembler_aarch64.inline.hpp");
-++  AD.addInclude(AD._CPP_file, "nativeInst_aarch64.hpp");
-++  AD.addInclude(AD._CPP_file, "vmreg_aarch64.inline.hpp");
-+ #endif
-+   AD.addInclude(AD._HPP_file, "memory/allocation.hpp");
-+   AD.addInclude(AD._HPP_file, "opto/machnode.hpp");
-+diff --git openjdk.orig/hotspot/src/share/vm/asm/assembler.cpp openjdk/hotspot/src/share/vm/asm/assembler.cpp
-+index 2bcdcbc..57787ac 100644
-+--- openjdk.orig/hotspot/src/share/vm/asm/assembler.cpp
-++++ openjdk/hotspot/src/share/vm/asm/assembler.cpp
-+@@ -43,6 +43,9 @@
-+ #ifdef TARGET_ARCH_ppc
-+ # include "assembler_ppc.inline.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "assembler_aarch64.inline.hpp"
-++#endif
-+ 
-+ 
-+ // Implementation of AbstractAssembler
-+diff --git openjdk.orig/hotspot/src/share/vm/asm/assembler.hpp openjdk/hotspot/src/share/vm/asm/assembler.hpp
-+index c25aa3f..4f77825 100644
-+--- openjdk.orig/hotspot/src/share/vm/asm/assembler.hpp
-++++ openjdk/hotspot/src/share/vm/asm/assembler.hpp
-+@@ -51,6 +51,10 @@
-+ # include "register_ppc.hpp"
-+ # include "vm_version_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "register_aarch64.hpp"
-++# include "vm_version_aarch64.hpp"
-++#endif
-+ 
-+ // This file contains platform-independent assembler declarations.
-+ 
-+@@ -459,6 +463,9 @@ class AbstractAssembler : public ResourceObj  {
-+ #ifdef TARGET_ARCH_ppc
-+ # include "assembler_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "assembler_aarch64.hpp"
-++#endif
-+ 
-+ 
-+ #endif // SHARE_VM_ASM_ASSEMBLER_HPP
-+diff --git openjdk.orig/hotspot/src/share/vm/asm/codeBuffer.hpp openjdk/hotspot/src/share/vm/asm/codeBuffer.hpp
-+index 685297a..002faef 100644
-+--- openjdk.orig/hotspot/src/share/vm/asm/codeBuffer.hpp
-++++ openjdk/hotspot/src/share/vm/asm/codeBuffer.hpp
-+@@ -573,6 +573,9 @@ class CodeBuffer: public StackObj {
-+ #ifdef TARGET_ARCH_ppc
-+ # include "codeBuffer_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "codeBuffer_aarch64.hpp"
-++#endif
-+ 
-+ };
-+ 
-+diff --git openjdk.orig/hotspot/src/share/vm/c1/c1_Canonicalizer.cpp openjdk/hotspot/src/share/vm/c1/c1_Canonicalizer.cpp
-+index c95a23c..2ec31e5 100644
-+--- openjdk.orig/hotspot/src/share/vm/c1/c1_Canonicalizer.cpp
-++++ openjdk/hotspot/src/share/vm/c1/c1_Canonicalizer.cpp
-+@@ -877,6 +877,13 @@ static bool match(UnsafeRawOp* x,
-+     return false;
-+   }
-+ 
-++// AARCH64 cannot handle shifts which are not either 0, or log2 of the type size
-++#ifdef AARCH64
-++  if (*log2_scale != 0 &&
-++	(1 << *log2_scale) != type2aelembytes(x->basic_type(), true))
-++    return false;
-++#endif
-++
-+   // If the value is pinned then it will be always be computed so
-+   // there's no profit to reshaping the expression.
-+   return !root->is_pinned();
-+diff --git openjdk.orig/hotspot/src/share/vm/c1/c1_Defs.hpp openjdk/hotspot/src/share/vm/c1/c1_Defs.hpp
-+index bebb3b0..ddaceb7 100644
-+--- openjdk.orig/hotspot/src/share/vm/c1/c1_Defs.hpp
-++++ openjdk/hotspot/src/share/vm/c1/c1_Defs.hpp
-+@@ -41,6 +41,9 @@
-+ #ifdef TARGET_ARCH_ppc
-+ # include "register_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "register_aarch64.hpp"
-++#endif
-+ 
-+ // set frame size and return address offset to these values in blobs
-+ // (if the compiled frame uses ebp as link pointer on IA; otherwise,
-+@@ -62,6 +65,9 @@ enum {
-+ #ifdef TARGET_ARCH_ppc
-+ # include "c1_Defs_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "c1_Defs_aarch64.hpp"
-++#endif
-+ 
-+ 
-+ // native word offsets from memory address
-+diff --git openjdk.orig/hotspot/src/share/vm/c1/c1_FpuStackSim.hpp openjdk/hotspot/src/share/vm/c1/c1_FpuStackSim.hpp
-+index a1e4c38..491b064 100644
-+--- openjdk.orig/hotspot/src/share/vm/c1/c1_FpuStackSim.hpp
-++++ openjdk/hotspot/src/share/vm/c1/c1_FpuStackSim.hpp
-+@@ -44,6 +44,9 @@ class FpuStackSim;
-+ #ifdef TARGET_ARCH_ppc
-+ # include "c1_FpuStackSim_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "c1_FpuStackSim_aarch64.hpp"
-++#endif
-+ 
-+ 
-+ #endif // SHARE_VM_C1_C1_FPUSTACKSIM_HPP
-+diff --git openjdk.orig/hotspot/src/share/vm/c1/c1_FrameMap.cpp openjdk/hotspot/src/share/vm/c1/c1_FrameMap.cpp
-+index ea50b27..6a3dc63 100644
-+--- openjdk.orig/hotspot/src/share/vm/c1/c1_FrameMap.cpp
-++++ openjdk/hotspot/src/share/vm/c1/c1_FrameMap.cpp
-+@@ -41,6 +41,9 @@
-+ #ifdef TARGET_ARCH_ppc
-+ # include "vmreg_ppc.inline.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "vmreg_aarch64.inline.hpp"
-++#endif
-+ 
-+ 
-+ 
-+diff --git openjdk.orig/hotspot/src/share/vm/c1/c1_FrameMap.hpp openjdk/hotspot/src/share/vm/c1/c1_FrameMap.hpp
-+index 288fc5c..e9a0250 100644
-+--- openjdk.orig/hotspot/src/share/vm/c1/c1_FrameMap.hpp
-++++ openjdk/hotspot/src/share/vm/c1/c1_FrameMap.hpp
-+@@ -93,6 +93,9 @@ class FrameMap : public CompilationResourceObj {
-+ #endif
-+ #ifdef TARGET_ARCH_ppc
-+ # include "c1_FrameMap_ppc.hpp"
-++#endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "c1_FrameMap_aarch64.hpp"
-+ #endif
-+ 
-+ 
-+diff --git openjdk.orig/hotspot/src/share/vm/c1/c1_LIR.cpp openjdk/hotspot/src/share/vm/c1/c1_LIR.cpp
-+index 776a6a3..6e1a362 100644
-+--- openjdk.orig/hotspot/src/share/vm/c1/c1_LIR.cpp
-++++ openjdk/hotspot/src/share/vm/c1/c1_LIR.cpp
-+@@ -67,7 +67,7 @@ FloatRegister LIR_OprDesc::as_double_reg() const {
-+ 
-+ #endif
-+ 
-+-#ifdef ARM
-++#if defined(ARM) || defined (TARGET_ARCH_aarch64)
-+ 
-+ FloatRegister LIR_OprDesc::as_float_reg() const {
-+   return as_FloatRegister(fpu_regnr());
-+@@ -147,7 +147,11 @@ void LIR_Address::verify() const {
-+ #endif
-+ #ifdef _LP64
-+   assert(base()->is_cpu_register(), "wrong base operand");
-++#ifndef TARGET_ARCH_aarch64
-+   assert(index()->is_illegal() || index()->is_double_cpu(), "wrong index operand");
-++#else
-++  assert(index()->is_illegal() || index()->is_double_cpu() || index()->is_single_cpu(), "wrong index operand");
-++#endif
-+   assert(base()->type() == T_OBJECT || base()->type() == T_LONG,
-+          "wrong type for addresses");
-+ #else
-+@@ -545,7 +549,7 @@ void LIR_OpVisitState::visit(LIR_Op* op) {
-+       assert(opConvert->_info == NULL, "must be");
-+       if (opConvert->_opr->is_valid())       do_input(opConvert->_opr);
-+       if (opConvert->_result->is_valid())    do_output(opConvert->_result);
-+-#ifdef PPC
-++#if defined(PPC) || defined(TARGET_ARCH_aarch64)
-+       if (opConvert->_tmp1->is_valid())      do_temp(opConvert->_tmp1);
-+       if (opConvert->_tmp2->is_valid())      do_temp(opConvert->_tmp2);
-+ #endif
-+@@ -1468,6 +1472,11 @@ void LIR_OprDesc::print(outputStream* out) const {
-+     out->print("fpu%d", fpu_regnr());
-+   } else if (is_double_fpu()) {
-+     out->print("fpu%d", fpu_regnrLo());
-++#elif defined(AARCH64)
-++  } else if (is_single_fpu()) {
-++    out->print("fpu%d", fpu_regnr());
-++  } else if (is_double_fpu()) {
-++    out->print("fpu%d", fpu_regnrLo());
-+ #elif defined(ARM)
-+   } else if (is_single_fpu()) {
-+     out->print("s%d", fpu_regnr());
-+@@ -1836,7 +1845,7 @@ void LIR_OpConvert::print_instr(outputStream* out) const {
-+   print_bytecode(out, bytecode());
-+   in_opr()->print(out);                  out->print(" ");
-+   result_opr()->print(out);              out->print(" ");
-+-#ifdef PPC
-++#if defined(PPC) || defined(TARGET_ARCH_aarch64)
-+   if(tmp1()->is_valid()) {
-+     tmp1()->print(out); out->print(" ");
-+     tmp2()->print(out); out->print(" ");
-+diff --git openjdk.orig/hotspot/src/share/vm/c1/c1_LIR.hpp openjdk/hotspot/src/share/vm/c1/c1_LIR.hpp
-+index f8589c3..eb3383f 100644
-+--- openjdk.orig/hotspot/src/share/vm/c1/c1_LIR.hpp
-++++ openjdk/hotspot/src/share/vm/c1/c1_LIR.hpp
-+@@ -437,8 +437,8 @@ class LIR_OprDesc: public CompilationResourceObj {
-+   XMMRegister as_xmm_double_reg() const;
-+   // for compatibility with RInfo
-+   int fpu () const                                  { return lo_reg_half(); }
-+-#endif // X86
-+-#if defined(SPARC) || defined(ARM) || defined(PPC)
-++#endif
-++#if defined(SPARC) || defined(ARM) || defined(PPC) || defined(AARCH64)
-+   FloatRegister as_float_reg   () const;
-+   FloatRegister as_double_reg  () const;
-+ #endif
-+@@ -526,7 +526,7 @@ class LIR_Address: public LIR_OprPtr {
-+      , _type(type)
-+      , _disp(0) { verify(); }
-+ 
-+-#if defined(X86) || defined(ARM)
-++#if defined(X86) || defined(ARM) || defined(AARCH64)
-+   LIR_Address(LIR_Opr base, LIR_Opr index, Scale scale, intx disp, BasicType type):
-+        _base(base)
-+      , _index(index)
-+@@ -601,7 +601,7 @@ class LIR_OprFact: public AllStatic {
-+                                                                              LIR_OprDesc::fpu_register         |
-+                                                                              LIR_OprDesc::double_size); }
-+ #endif
-+-#ifdef X86
-++#if defined(X86) || defined(AARCH64)
-+   static LIR_Opr double_fpu(int reg)            { return (LIR_Opr)(intptr_t)((reg  << LIR_OprDesc::reg1_shift) |
-+                                                                              (reg  << LIR_OprDesc::reg2_shift) |
-+                                                                              LIR_OprDesc::double_type          |
-+@@ -1398,7 +1398,7 @@ class LIR_OpConvert: public LIR_Op1 {
-+  private:
-+    Bytecodes::Code _bytecode;
-+    ConversionStub* _stub;
-+-#ifdef PPC
-++#if defined(PPC) || defined(TARGET_ARCH_aarch64)
-+   LIR_Opr _tmp1;
-+   LIR_Opr _tmp2;
-+ #endif
-+@@ -1413,7 +1413,7 @@ class LIR_OpConvert: public LIR_Op1 {
-+ #endif
-+      , _bytecode(code)                           {}
-+ 
-+-#ifdef PPC
-++#if defined(PPC) || defined(TARGET_ARCH_aarch64)
-+    LIR_OpConvert(Bytecodes::Code code, LIR_Opr opr, LIR_Opr result, ConversionStub* stub
-+                  ,LIR_Opr tmp1, LIR_Opr tmp2)
-+      : LIR_Op1(lir_convert, opr, result)
-+@@ -1425,7 +1425,7 @@ class LIR_OpConvert: public LIR_Op1 {
-+ 
-+   Bytecodes::Code bytecode() const               { return _bytecode; }
-+   ConversionStub* stub() const                   { return _stub; }
-+-#ifdef PPC
-++#if defined(PPC) || defined(TARGET_ARCH_aarch64)
-+   LIR_Opr tmp1() const                           { return _tmp1; }
-+   LIR_Opr tmp2() const                           { return _tmp2; }
-+ #endif
-+@@ -1973,7 +1973,14 @@ class LIR_List: public CompilationResourceObj {
-+ #ifdef PPC
-+   void convert(Bytecodes::Code code, LIR_Opr left, LIR_Opr dst, LIR_Opr tmp1, LIR_Opr tmp2) { append(new LIR_OpConvert(code, left, dst, NULL, tmp1, tmp2)); }
-+ #endif
-++#if defined (TARGET_ARCH_aarch64)
-++  void convert(Bytecodes::Code code, LIR_Opr left, LIR_Opr dst,
-++	       ConversionStub* stub = NULL, LIR_Opr tmp1 = LIR_OprDesc::illegalOpr()) {
-++    append(new LIR_OpConvert(code, left, dst, stub, tmp1, LIR_OprDesc::illegalOpr()));
-++  }
-++#else
-+   void convert(Bytecodes::Code code, LIR_Opr left, LIR_Opr dst, ConversionStub* stub = NULL/*, bool is_32bit = false*/) { append(new LIR_OpConvert(code, left, dst, stub)); }
-++#endif
-+ 
-+   void logical_and (LIR_Opr left, LIR_Opr right, LIR_Opr dst) { append(new LIR_Op2(lir_logic_and,  left, right, dst)); }
-+   void logical_or  (LIR_Opr left, LIR_Opr right, LIR_Opr dst) { append(new LIR_Op2(lir_logic_or,   left, right, dst)); }
-+diff --git openjdk.orig/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp openjdk/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp
-+index 528f21e..4d83fca 100644
-+--- openjdk.orig/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp
-++++ openjdk/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp
-+@@ -50,6 +50,10 @@
-+ # include "nativeInst_ppc.hpp"
-+ # include "vmreg_ppc.inline.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "nativeInst_aarch64.hpp"
-++# include "vmreg_aarch64.inline.hpp"
-++#endif
-+ 
-+ 
-+ void LIR_Assembler::patching_epilog(PatchingStub* patch, LIR_PatchCode patch_code, Register obj, CodeEmitInfo* info) {
-+diff --git openjdk.orig/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp openjdk/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp
-+index 58adf59..f4a49b3 100644
-+--- openjdk.orig/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp
-++++ openjdk/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp
-+@@ -261,6 +261,9 @@ class LIR_Assembler: public CompilationResourceObj {
-+ #ifdef TARGET_ARCH_ppc
-+ # include "c1_LIRAssembler_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "c1_LIRAssembler_aarch64.hpp"
-++#endif
-+ 
-+ };
-+ 
-+diff --git openjdk.orig/hotspot/src/share/vm/c1/c1_LinearScan.cpp openjdk/hotspot/src/share/vm/c1/c1_LinearScan.cpp
-+index aaae71d..93f9f5f 100644
-+--- openjdk.orig/hotspot/src/share/vm/c1/c1_LinearScan.cpp
-++++ openjdk/hotspot/src/share/vm/c1/c1_LinearScan.cpp
-+@@ -47,6 +47,9 @@
-+ #ifdef TARGET_ARCH_ppc
-+ # include "vmreg_ppc.inline.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "vmreg_aarch64.inline.hpp"
-++#endif
-+ 
-+ 
-+ #ifndef PRODUCT
-+@@ -2190,7 +2193,7 @@ LIR_Opr LinearScan::color_lir_opr(LIR_Opr opr, int op_id, LIR_OpVisitState::OprM
-+ 
-+   LIR_Opr res = operand_for_interval(interval);
-+ 
-+-#ifdef X86
-++#if defined(X86) || defined(AARCH64)
-+   // new semantic for is_last_use: not only set on definite end of interval,
-+   // but also before hole
-+   // This may still miss some cases (e.g. for dead values), but it is not necessary that the
-+diff --git openjdk.orig/hotspot/src/share/vm/c1/c1_LinearScan.hpp openjdk/hotspot/src/share/vm/c1/c1_LinearScan.hpp
-+index 0c06f1b..a152328 100644
-+--- openjdk.orig/hotspot/src/share/vm/c1/c1_LinearScan.hpp
-++++ openjdk/hotspot/src/share/vm/c1/c1_LinearScan.hpp
-+@@ -985,6 +985,9 @@ class LinearScanTimers : public StackObj {
-+ #ifdef TARGET_ARCH_ppc
-+ # include "c1_LinearScan_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "c1_LinearScan_aarch64.hpp"
-++#endif
-+ 
-+ 
-+ #endif // SHARE_VM_C1_C1_LINEARSCAN_HPP
-+diff --git openjdk.orig/hotspot/src/share/vm/c1/c1_MacroAssembler.hpp openjdk/hotspot/src/share/vm/c1/c1_MacroAssembler.hpp
-+index 55d9803..eda2174 100644
-+--- openjdk.orig/hotspot/src/share/vm/c1/c1_MacroAssembler.hpp
-++++ openjdk/hotspot/src/share/vm/c1/c1_MacroAssembler.hpp
-+@@ -41,6 +41,9 @@
-+ #ifdef TARGET_ARCH_ppc
-+ # include "assembler_ppc.inline.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "assembler_aarch64.inline.hpp"
-++#endif
-+ 
-+ class CodeEmitInfo;
-+ 
-+@@ -73,6 +76,9 @@ class C1_MacroAssembler: public MacroAssembler {
-+ #ifdef TARGET_ARCH_ppc
-+ # include "c1_MacroAssembler_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "c1_MacroAssembler_aarch64.hpp"
-++#endif
-+ 
-+ };
-+ 
-+diff --git openjdk.orig/hotspot/src/share/vm/c1/c1_Runtime1.cpp openjdk/hotspot/src/share/vm/c1/c1_Runtime1.cpp
-+index 765dec4..f0b3aae 100644
-+--- openjdk.orig/hotspot/src/share/vm/c1/c1_Runtime1.cpp
-++++ openjdk/hotspot/src/share/vm/c1/c1_Runtime1.cpp
-+@@ -1103,6 +1103,7 @@ JRT_END
-+ // completes we can check for deoptimization. This simplifies the
-+ // assembly code in the cpu directories.
-+ //
-++#ifndef TARGET_ARCH_aarch64
-+ int Runtime1::move_klass_patching(JavaThread* thread) {
-+ //
-+ // NOTE: we are still in Java
-+@@ -1150,6 +1151,7 @@ int Runtime1::access_field_patching(JavaThread* thread) {
-+ 
-+   return caller_is_deopted();
-+ JRT_END
-++#endif
-+ 
-+ 
-+ JRT_LEAF(void, Runtime1::trace_block_entry(jint block_id))
-+diff --git openjdk.orig/hotspot/src/share/vm/c1/c1_Runtime1.hpp openjdk/hotspot/src/share/vm/c1/c1_Runtime1.hpp
-+index 2032564..19261be 100644
-+--- openjdk.orig/hotspot/src/share/vm/c1/c1_Runtime1.hpp
-++++ openjdk/hotspot/src/share/vm/c1/c1_Runtime1.hpp
-+@@ -159,6 +159,9 @@ class Runtime1: public AllStatic {
-+   static int move_klass_patching(JavaThread* thread);
-+ 
-+   static void patch_code(JavaThread* thread, StubID stub_id);
-++#ifdef TARGET_ARCH_aarch64
-++  static void patch_code_aarch64(JavaThread* thread, StubID stub_id);
-++#endif
-+ 
-+  public:
-+   // initialization
-+diff --git openjdk.orig/hotspot/src/share/vm/c1/c1_globals.hpp openjdk/hotspot/src/share/vm/c1/c1_globals.hpp
-+index 15f3cc1..4143a87 100644
-+--- openjdk.orig/hotspot/src/share/vm/c1/c1_globals.hpp
-++++ openjdk/hotspot/src/share/vm/c1/c1_globals.hpp
-+@@ -38,6 +38,9 @@
-+ #ifdef TARGET_ARCH_ppc
-+ # include "c1_globals_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "c1_globals_aarch64.hpp"
-++#endif
-+ #ifdef TARGET_OS_FAMILY_linux
-+ # include "c1_globals_linux.hpp"
-+ #endif
-+diff --git openjdk.orig/hotspot/src/share/vm/classfile/classFileStream.hpp openjdk/hotspot/src/share/vm/classfile/classFileStream.hpp
-+index cf6f0e5..b128b3a 100644
-+--- openjdk.orig/hotspot/src/share/vm/classfile/classFileStream.hpp
-++++ openjdk/hotspot/src/share/vm/classfile/classFileStream.hpp
-+@@ -41,6 +41,9 @@
-+ #ifdef TARGET_ARCH_ppc
-+ # include "bytes_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "bytes_aarch64.hpp"
-++#endif
-+ 
-+ // Input stream for reading .class file
-+ //
-+diff --git openjdk.orig/hotspot/src/share/vm/classfile/stackMapTable.hpp openjdk/hotspot/src/share/vm/classfile/stackMapTable.hpp
-+index f876029..ac415b6 100644
-+--- openjdk.orig/hotspot/src/share/vm/classfile/stackMapTable.hpp
-++++ openjdk/hotspot/src/share/vm/classfile/stackMapTable.hpp
-+@@ -46,6 +46,9 @@
-+ #ifdef TARGET_ARCH_ppc
-+ # include "bytes_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "bytes_aarch64.hpp"
-++#endif
-+ 
-+ class StackMapReader;
-+ 
-+diff --git openjdk.orig/hotspot/src/share/vm/classfile/verifier.cpp openjdk/hotspot/src/share/vm/classfile/verifier.cpp
-+index c5c5e11..9c22a21 100644
-+--- openjdk.orig/hotspot/src/share/vm/classfile/verifier.cpp
-++++ openjdk/hotspot/src/share/vm/classfile/verifier.cpp
-+@@ -60,6 +60,9 @@
-+ #ifdef TARGET_ARCH_ppc
-+ # include "bytes_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "bytes_aarch64.hpp"
-++#endif
-+ 
-+ #define NOFAILOVER_MAJOR_VERSION 51
-+ 
-+diff --git openjdk.orig/hotspot/src/share/vm/code/codeBlob.cpp openjdk/hotspot/src/share/vm/code/codeBlob.cpp
-+index 244c320..429e0be 100644
-+--- openjdk.orig/hotspot/src/share/vm/code/codeBlob.cpp
-++++ openjdk/hotspot/src/share/vm/code/codeBlob.cpp
-+@@ -54,6 +54,9 @@
-+ #ifdef TARGET_ARCH_ppc
-+ # include "nativeInst_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "nativeInst_aarch64.hpp"
-++#endif
-+ #ifdef COMPILER1
-+ #include "c1/c1_Runtime1.hpp"
-+ #endif
-+diff --git openjdk.orig/hotspot/src/share/vm/code/compiledIC.hpp openjdk/hotspot/src/share/vm/code/compiledIC.hpp
-+index fe1cfb3..c9f6a2e 100644
-+--- openjdk.orig/hotspot/src/share/vm/code/compiledIC.hpp
-++++ openjdk/hotspot/src/share/vm/code/compiledIC.hpp
-+@@ -44,6 +44,9 @@
-+ #ifdef TARGET_ARCH_ppc
-+ # include "nativeInst_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "nativeInst_aarch64.hpp"
-++#endif
-+ 
-+ //-----------------------------------------------------------------------------
-+ // The CompiledIC represents a compiled inline cache.
-+diff --git openjdk.orig/hotspot/src/share/vm/code/icBuffer.cpp openjdk/hotspot/src/share/vm/code/icBuffer.cpp
-+index ed70457..d022482 100644
-+--- openjdk.orig/hotspot/src/share/vm/code/icBuffer.cpp
-++++ openjdk/hotspot/src/share/vm/code/icBuffer.cpp
-+@@ -52,6 +52,9 @@
-+ #ifdef TARGET_ARCH_ppc
-+ # include "assembler_ppc.inline.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "assembler_aarch64.inline.hpp"
-++#endif
-+ 
-+ 
-+ DEF_STUB_INTERFACE(ICStub);
-+diff --git openjdk.orig/hotspot/src/share/vm/code/relocInfo.cpp openjdk/hotspot/src/share/vm/code/relocInfo.cpp
-+index 4fd82df..78310e6 100644
-+--- openjdk.orig/hotspot/src/share/vm/code/relocInfo.cpp
-++++ openjdk/hotspot/src/share/vm/code/relocInfo.cpp
-+@@ -49,6 +49,10 @@
-+ # include "assembler_ppc.inline.hpp"
-+ # include "nativeInst_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "assembler_aarch64.inline.hpp"
-++# include "nativeInst_aarch64.hpp"
-++#endif
-+ 
-+ 
-+ const RelocationHolder RelocationHolder::none; // its type is relocInfo::none
-+diff --git openjdk.orig/hotspot/src/share/vm/code/relocInfo.hpp openjdk/hotspot/src/share/vm/code/relocInfo.hpp
-+index 1d14b44..3823889 100644
-+--- openjdk.orig/hotspot/src/share/vm/code/relocInfo.hpp
-++++ openjdk/hotspot/src/share/vm/code/relocInfo.hpp
-+@@ -435,6 +435,9 @@ class relocInfo VALUE_OBJ_CLASS_SPEC {
-+ #endif
-+ #ifdef TARGET_ARCH_ppc
-+ # include "relocInfo_ppc.hpp"
-++#endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "relocInfo_aarch64.hpp"
-+ #endif
-+ 
-+ 
-+diff --git openjdk.orig/hotspot/src/share/vm/code/vmreg.hpp openjdk/hotspot/src/share/vm/code/vmreg.hpp
-+index d57e6f8..1c18e47 100644
-+--- openjdk.orig/hotspot/src/share/vm/code/vmreg.hpp
-++++ openjdk/hotspot/src/share/vm/code/vmreg.hpp
-+@@ -42,6 +42,9 @@
-+ #ifdef TARGET_ARCH_ppc
-+ # include "register_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "register_aarch64.hpp"
-++#endif
-+ #ifdef COMPILER2
-+ #include "opto/adlcVMDeps.hpp"
-+ #include "utilities/ostream.hpp"
-+@@ -63,6 +66,9 @@
-+ #ifdef TARGET_ARCH_MODEL_ppc
-+ # include "adfiles/adGlobals_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_MODEL_aarch64
-++# include "adfiles/adGlobals_aarch64.hpp"
-++#endif
-+ #endif
-+ 
-+ //------------------------------VMReg------------------------------------------
-+@@ -182,6 +188,9 @@ public:
-+ #ifdef TARGET_ARCH_ppc
-+ # include "vmreg_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "vmreg_aarch64.hpp"
-++#endif
-+ 
-+ 
-+ };
-+diff --git openjdk.orig/hotspot/src/share/vm/compiler/disassembler.cpp openjdk/hotspot/src/share/vm/compiler/disassembler.cpp
-+index 9603e86..3a67259 100644
-+--- openjdk.orig/hotspot/src/share/vm/compiler/disassembler.cpp
-++++ openjdk/hotspot/src/share/vm/compiler/disassembler.cpp
-+@@ -47,6 +47,9 @@
-+ #ifdef TARGET_ARCH_ppc
-+ # include "depChecker_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "depChecker_aarch64.hpp"
-++#endif
-+ #ifdef SHARK
-+ #include "shark/sharkEntry.hpp"
-+ #endif
-+diff --git openjdk.orig/hotspot/src/share/vm/compiler/disassembler.hpp openjdk/hotspot/src/share/vm/compiler/disassembler.hpp
-+index a70b8cc..4c90c9a 100644
-+--- openjdk.orig/hotspot/src/share/vm/compiler/disassembler.hpp
-++++ openjdk/hotspot/src/share/vm/compiler/disassembler.hpp
-+@@ -78,6 +78,9 @@ class Disassembler {
-+ #endif
-+ #ifdef TARGET_ARCH_ppc
-+ # include "disassembler_ppc.hpp"
-++#endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "disassembler_aarch64.hpp"
-+ #endif
-+ 
-+ 
-+diff --git openjdk.orig/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp openjdk/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp
-+index d23f37a..24ca30e 100644
-+--- openjdk.orig/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp
-++++ openjdk/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp
-+@@ -44,6 +44,9 @@
-+ #ifdef TARGET_ARCH_MODEL_ppc
-+ # include "interp_masm_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_MODEL_aarch64
-++# include "interp_masm_aarch64.hpp"
-++#endif
-+ #ifdef TARGET_OS_FAMILY_linux
-+ # include "thread_linux.inline.hpp"
-+ #endif
-+diff --git openjdk.orig/hotspot/src/share/vm/interpreter/bytecode.hpp openjdk/hotspot/src/share/vm/interpreter/bytecode.hpp
-+index 107161a..205d0f7 100644
-+--- openjdk.orig/hotspot/src/share/vm/interpreter/bytecode.hpp
-++++ openjdk/hotspot/src/share/vm/interpreter/bytecode.hpp
-+@@ -43,6 +43,9 @@
-+ #ifdef TARGET_ARCH_ppc
-+ # include "bytes_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "bytes_aarch64.hpp"
-++#endif
-+ 
-+ class ciBytecodeStream;
-+ 
-+diff --git openjdk.orig/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp openjdk/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp
-+index e637414..308ad3b 100644
-+--- openjdk.orig/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp
-++++ openjdk/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp
-+@@ -47,6 +47,9 @@
-+ #ifdef TARGET_ARCH_ppc
-+ # include "bytes_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "bytes_aarch64.hpp"
-++#endif
-+ 
-+ #ifdef CC_INTERP
-+ 
-+@@ -618,6 +621,9 @@ void print();
-+ #ifdef TARGET_ARCH_ppc
-+ # include "bytecodeInterpreter_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "bytecodeInterpreter_aarch64.hpp"
-++#endif
-+ 
-+ 
-+ }; // BytecodeInterpreter
-+diff --git openjdk.orig/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp openjdk/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp
-+index 3715a52..0d6a8aa 100644
-+--- openjdk.orig/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp
-++++ openjdk/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp
-+@@ -58,6 +58,9 @@
-+ #ifdef TARGET_ARCH_ppc
-+ # include "bytecodeInterpreter_ppc.inline.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "bytecodeInterpreter_aarch64.inline.hpp"
-++#endif
-+ 
-+ #endif // CC_INTERP
-+ 
-+diff --git openjdk.orig/hotspot/src/share/vm/interpreter/bytecodeStream.hpp openjdk/hotspot/src/share/vm/interpreter/bytecodeStream.hpp
-+index 6106eac..f3dee0a 100644
-+--- openjdk.orig/hotspot/src/share/vm/interpreter/bytecodeStream.hpp
-++++ openjdk/hotspot/src/share/vm/interpreter/bytecodeStream.hpp
-+@@ -43,6 +43,9 @@
-+ #ifdef TARGET_ARCH_ppc
-+ # include "bytes_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "bytes_aarch64.hpp"
-++#endif
-+ 
-+ // A BytecodeStream is used for fast iteration over the bytecodes
-+ // of a methodOop.
-+diff --git openjdk.orig/hotspot/src/share/vm/interpreter/bytecodes.cpp openjdk/hotspot/src/share/vm/interpreter/bytecodes.cpp
-+index 04f3f64..48ef30e 100644
-+--- openjdk.orig/hotspot/src/share/vm/interpreter/bytecodes.cpp
-++++ openjdk/hotspot/src/share/vm/interpreter/bytecodes.cpp
-+@@ -41,6 +41,9 @@
-+ #ifdef TARGET_ARCH_ppc
-+ # include "bytes_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "bytes_aarch64.hpp"
-++#endif
-+ 
-+ 
-+ #if defined(WIN32) && (defined(_MSC_VER) && (_MSC_VER < 1600))
-+diff --git openjdk.orig/hotspot/src/share/vm/interpreter/cppInterpreter.hpp openjdk/hotspot/src/share/vm/interpreter/cppInterpreter.hpp
-+index e3a9f2e..8347473 100644
-+--- openjdk.orig/hotspot/src/share/vm/interpreter/cppInterpreter.hpp
-++++ openjdk/hotspot/src/share/vm/interpreter/cppInterpreter.hpp
-+@@ -101,6 +101,9 @@ class CppInterpreter: public AbstractInterpreter {
-+ #ifdef TARGET_ARCH_ppc
-+ # include "cppInterpreter_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "cppInterpreter_aarch64.hpp"
-++#endif
-+ 
-+ 
-+ };
-+diff --git openjdk.orig/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp openjdk/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp
-+index c27805e..272f6e8 100644
-+--- openjdk.orig/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp
-++++ openjdk/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp
-+@@ -59,6 +59,9 @@ class CppInterpreterGenerator: public AbstractInterpreterGenerator {
-+ #ifdef TARGET_ARCH_ppc
-+ # include "cppInterpreterGenerator_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "cppInterpreterGenerator_aarch64.hpp"
-++#endif
-+ 
-+ };
-+ 
-+diff --git openjdk.orig/hotspot/src/share/vm/interpreter/interpreter.hpp openjdk/hotspot/src/share/vm/interpreter/interpreter.hpp
-+index 0ab0be7..6a6822f 100644
-+--- openjdk.orig/hotspot/src/share/vm/interpreter/interpreter.hpp
-++++ openjdk/hotspot/src/share/vm/interpreter/interpreter.hpp
-+@@ -158,6 +158,9 @@ class Interpreter: public CC_INTERP_ONLY(CppInterpreter) NOT_CC_INTERP(TemplateI
-+ #ifdef TARGET_ARCH_ppc
-+ # include "interpreter_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "interpreter_aarch64.hpp"
-++#endif
-+ 
-+ };
-+ 
-+diff --git openjdk.orig/hotspot/src/share/vm/interpreter/interpreterGenerator.hpp openjdk/hotspot/src/share/vm/interpreter/interpreterGenerator.hpp
-+index 7bc43ec..0434ca3 100644
-+--- openjdk.orig/hotspot/src/share/vm/interpreter/interpreterGenerator.hpp
-++++ openjdk/hotspot/src/share/vm/interpreter/interpreterGenerator.hpp
-+@@ -56,6 +56,9 @@ InterpreterGenerator(StubQueue* _code);
-+ #ifdef TARGET_ARCH_ppc
-+ # include "interpreterGenerator_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "interpreterGenerator_aarch64.hpp"
-++#endif
-+ 
-+ 
-+ };
-+diff --git openjdk.orig/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp openjdk/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp
-+index e451c04..37700fb 100644
-+--- openjdk.orig/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp
-++++ openjdk/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp
-+@@ -71,6 +71,9 @@
-+ #ifdef TARGET_ARCH_ppc
-+ # include "vm_version_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "vm_version_aarch64.hpp"
-++#endif
-+ #ifdef COMPILER2
-+ #include "opto/runtime.hpp"
-+ #endif
-+diff --git openjdk.orig/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp openjdk/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp
-+index 93c1a9e..425400e 100644
-+--- openjdk.orig/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp
-++++ openjdk/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp
-+@@ -164,6 +164,9 @@ class InterpreterRuntime: AllStatic {
-+ #endif
-+ #ifdef TARGET_ARCH_ppc
-+ # include "interpreterRT_ppc.hpp"
-++#endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "interpreterRT_aarch64.hpp"
-+ #endif
-+ 
-+ 
-+diff --git openjdk.orig/hotspot/src/share/vm/interpreter/templateInterpreter.hpp openjdk/hotspot/src/share/vm/interpreter/templateInterpreter.hpp
-+index 25d74f7..f78a16e 100644
-+--- openjdk.orig/hotspot/src/share/vm/interpreter/templateInterpreter.hpp
-++++ openjdk/hotspot/src/share/vm/interpreter/templateInterpreter.hpp
-+@@ -198,6 +198,9 @@ class TemplateInterpreter: public AbstractInterpreter {
-+ #ifdef TARGET_ARCH_ppc
-+ # include "templateInterpreter_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "templateInterpreter_aarch64.hpp"
-++#endif
-+ 
-+ 
-+ };
-+diff --git openjdk.orig/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp openjdk/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp
-+index fb7bdc5..6007630 100644
-+--- openjdk.orig/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp
-++++ openjdk/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp
-+@@ -101,6 +101,9 @@ class TemplateInterpreterGenerator: public AbstractInterpreterGenerator {
-+ #ifdef TARGET_ARCH_ppc
-+ # include "templateInterpreterGenerator_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "templateInterpreterGenerator_aarch64.hpp"
-++#endif
-+ 
-+ 
-+ };
-+diff --git openjdk.orig/hotspot/src/share/vm/interpreter/templateTable.hpp openjdk/hotspot/src/share/vm/interpreter/templateTable.hpp
-+index 5d2a7e8..c5e0f0a 100644
-+--- openjdk.orig/hotspot/src/share/vm/interpreter/templateTable.hpp
-++++ openjdk/hotspot/src/share/vm/interpreter/templateTable.hpp
-+@@ -43,6 +43,9 @@
-+ #ifdef TARGET_ARCH_MODEL_ppc
-+ # include "interp_masm_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_MODEL_aarch64
-++# include "interp_masm_aarch64.hpp"
-++#endif
-+ 
-+ #ifndef CC_INTERP
-+ // All the necessary definitions used for (bytecode) template generation. Instead of
-+@@ -373,6 +376,9 @@ class TemplateTable: AllStatic {
-+ #ifdef TARGET_ARCH_MODEL_ppc
-+ # include "templateTable_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_MODEL_aarch64
-++# include "templateTable_aarch64.hpp"
-++#endif
-+ 
-+ };
-+ #endif /* !CC_INTERP */
-+diff --git openjdk.orig/hotspot/src/share/vm/oops/constantPoolOop.hpp openjdk/hotspot/src/share/vm/oops/constantPoolOop.hpp
-+index c2f985d..3d0d0fc 100644
-+--- openjdk.orig/hotspot/src/share/vm/oops/constantPoolOop.hpp
-++++ openjdk/hotspot/src/share/vm/oops/constantPoolOop.hpp
-+@@ -45,6 +45,9 @@
-+ #ifdef TARGET_ARCH_ppc
-+ # include "bytes_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "bytes_aarch64.hpp"
-++#endif
-+ 
-+ // A constantPool is an array containing class constants as described in the
-+ // class file.
-+diff --git openjdk.orig/hotspot/src/share/vm/oops/oop.inline.hpp openjdk/hotspot/src/share/vm/oops/oop.inline.hpp
-+index db14b2e..c8b326f 100644
-+--- openjdk.orig/hotspot/src/share/vm/oops/oop.inline.hpp
-++++ openjdk/hotspot/src/share/vm/oops/oop.inline.hpp
-+@@ -58,6 +58,9 @@
-+ #ifdef TARGET_ARCH_ppc
-+ # include "bytes_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "bytes_aarch64.hpp"
-++#endif
-+ 
-+ // Implementation of all inlined member functions defined in oop.hpp
-+ // We need a separate file to avoid circular references
-+diff --git openjdk.orig/hotspot/src/share/vm/opto/buildOopMap.cpp openjdk/hotspot/src/share/vm/opto/buildOopMap.cpp
-+index fc73160..2c5ec41 100644
-+--- openjdk.orig/hotspot/src/share/vm/opto/buildOopMap.cpp
-++++ openjdk/hotspot/src/share/vm/opto/buildOopMap.cpp
-+@@ -47,6 +47,9 @@
-+ #ifdef TARGET_ARCH_ppc
-+ # include "vmreg_ppc.inline.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "vmreg_aarch64.inline.hpp"
-++#endif
-+ 
-+ // The functions in this file builds OopMaps after all scheduling is done.
-+ //
-+diff --git openjdk.orig/hotspot/src/share/vm/opto/c2_globals.hpp openjdk/hotspot/src/share/vm/opto/c2_globals.hpp
-+index f73dcbd..462c875 100644
-+--- openjdk.orig/hotspot/src/share/vm/opto/c2_globals.hpp
-++++ openjdk/hotspot/src/share/vm/opto/c2_globals.hpp
-+@@ -35,6 +35,9 @@
-+ #ifdef TARGET_ARCH_arm
-+ # include "c2_globals_arm.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "c2_globals_aarch64.hpp"
-++#endif
-+ #ifdef TARGET_OS_FAMILY_linux
-+ # include "c2_globals_linux.hpp"
-+ #endif
-+diff --git openjdk.orig/hotspot/src/share/vm/opto/c2compiler.cpp openjdk/hotspot/src/share/vm/opto/c2compiler.cpp
-+index 713e3f1..948e447 100644
-+--- openjdk.orig/hotspot/src/share/vm/opto/c2compiler.cpp
-++++ openjdk/hotspot/src/share/vm/opto/c2compiler.cpp
-+@@ -43,6 +43,9 @@
-+ #ifdef TARGET_ARCH_MODEL_ppc
-+ # include "adfiles/ad_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_MODEL_aarch64
-++# include "adfiles/ad_aarch64.hpp"
-++#endif
-+ 
-+ 
-+ volatile int C2Compiler::_runtimes = uninitialized;
-+diff --git openjdk.orig/hotspot/src/share/vm/opto/compile.cpp openjdk/hotspot/src/share/vm/opto/compile.cpp
-+index a7ee07a..91dc290 100644
-+--- openjdk.orig/hotspot/src/share/vm/opto/compile.cpp
-++++ openjdk/hotspot/src/share/vm/opto/compile.cpp
-+@@ -80,6 +80,9 @@
-+ #ifdef TARGET_ARCH_MODEL_ppc
-+ # include "adfiles/ad_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_MODEL_aarch64
-++# include "adfiles/ad_aarch64.hpp"
-++#endif
-+ 
-+ 
-+ // -------------------- Compile::mach_constant_base_node -----------------------
-+diff --git openjdk.orig/hotspot/src/share/vm/opto/gcm.cpp openjdk/hotspot/src/share/vm/opto/gcm.cpp
-+index 8b8f311..4deb0b4 100644
-+--- openjdk.orig/hotspot/src/share/vm/opto/gcm.cpp
-++++ openjdk/hotspot/src/share/vm/opto/gcm.cpp
-+@@ -53,6 +53,9 @@
-+ #ifdef TARGET_ARCH_MODEL_ppc
-+ # include "adfiles/ad_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_MODEL_aarch64
-++# include "adfiles/ad_aarch64.hpp"
-++#endif
-+ 
-+ // Portions of code courtesy of Clifford Click
-+ 
-+diff --git openjdk.orig/hotspot/src/share/vm/opto/lcm.cpp openjdk/hotspot/src/share/vm/opto/lcm.cpp
-+index aee6123..4b9aaed 100644
-+--- openjdk.orig/hotspot/src/share/vm/opto/lcm.cpp
-++++ openjdk/hotspot/src/share/vm/opto/lcm.cpp
-+@@ -48,6 +48,9 @@
-+ #ifdef TARGET_ARCH_MODEL_ppc
-+ # include "adfiles/ad_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_MODEL_aarch64
-++# include "adfiles/ad_aarch64.hpp"
-++#endif
-+ 
-+ // Optimization - Graph Style
-+ 
-+diff --git openjdk.orig/hotspot/src/share/vm/opto/locknode.hpp openjdk/hotspot/src/share/vm/opto/locknode.hpp
-+index 91b99bc..665594f 100644
-+--- openjdk.orig/hotspot/src/share/vm/opto/locknode.hpp
-++++ openjdk/hotspot/src/share/vm/opto/locknode.hpp
-+@@ -46,6 +46,9 @@
-+ #ifdef TARGET_ARCH_MODEL_ppc
-+ # include "adfiles/ad_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_MODEL_aarch64
-++# include "adfiles/ad_aarch64.hpp"
-++#endif
-+ 
-+ //------------------------------BoxLockNode------------------------------------
-+ class BoxLockNode : public Node {
-+diff --git openjdk.orig/hotspot/src/share/vm/opto/matcher.cpp openjdk/hotspot/src/share/vm/opto/matcher.cpp
-+index ca2d4e3..d0f55c5 100644
-+--- openjdk.orig/hotspot/src/share/vm/opto/matcher.cpp
-++++ openjdk/hotspot/src/share/vm/opto/matcher.cpp
-+@@ -55,6 +55,9 @@
-+ #ifdef TARGET_ARCH_MODEL_ppc
-+ # include "adfiles/ad_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_MODEL_aarch64
-++# include "adfiles/ad_aarch64.hpp"
-++#endif
-+ 
-+ OptoReg::Name OptoReg::c_frame_pointer;
-+ 
-+diff --git openjdk.orig/hotspot/src/share/vm/opto/output.hpp openjdk/hotspot/src/share/vm/opto/output.hpp
-+index 50b6e76..6a920b2 100644
-+--- openjdk.orig/hotspot/src/share/vm/opto/output.hpp
-++++ openjdk/hotspot/src/share/vm/opto/output.hpp
-+@@ -45,6 +45,9 @@
-+ #ifdef TARGET_ARCH_MODEL_ppc
-+ # include "adfiles/ad_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_MODEL_aarch64
-++# include "adfiles/ad_aarch64.hpp"
-++#endif
-+ 
-+ class Arena;
-+ class Bundle;
-+diff --git openjdk.orig/hotspot/src/share/vm/opto/regmask.cpp openjdk/hotspot/src/share/vm/opto/regmask.cpp
-+index ce220f0..20c6028 100644
-+--- openjdk.orig/hotspot/src/share/vm/opto/regmask.cpp
-++++ openjdk/hotspot/src/share/vm/opto/regmask.cpp
-+@@ -43,6 +43,9 @@
-+ #ifdef TARGET_ARCH_MODEL_ppc
-+ # include "adfiles/ad_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_MODEL_aarch64
-++# include "adfiles/ad_aarch64.hpp"
-++#endif
-+ 
-+ #define RM_SIZE _RM_SIZE /* a constant private to the class RegMask */
-+ 
-+diff --git openjdk.orig/hotspot/src/share/vm/opto/regmask.hpp openjdk/hotspot/src/share/vm/opto/regmask.hpp
-+index e50ff84..26c6854 100644
-+--- openjdk.orig/hotspot/src/share/vm/opto/regmask.hpp
-++++ openjdk/hotspot/src/share/vm/opto/regmask.hpp
-+@@ -46,6 +46,9 @@
-+ #ifdef TARGET_ARCH_MODEL_ppc
-+ # include "adfiles/adGlobals_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_MODEL_aarch64
-++# include "adfiles/adGlobals_aarch64.hpp"
-++#endif
-+ 
-+ // Some fun naming (textual) substitutions:
-+ //
-+diff --git openjdk.orig/hotspot/src/share/vm/opto/runtime.cpp openjdk/hotspot/src/share/vm/opto/runtime.cpp
-+index d315f10..11a58b1 100644
-+--- openjdk.orig/hotspot/src/share/vm/opto/runtime.cpp
-++++ openjdk/hotspot/src/share/vm/opto/runtime.cpp
-+@@ -86,6 +86,9 @@
-+ #ifdef TARGET_ARCH_MODEL_ppc
-+ # include "adfiles/ad_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_MODEL_aarch64
-++# include "adfiles/ad_aarch64.hpp"
-++#endif
-+ 
-+ 
-+ // For debugging purposes:
-+diff --git openjdk.orig/hotspot/src/share/vm/prims/jniCheck.cpp openjdk/hotspot/src/share/vm/prims/jniCheck.cpp
-+index 3bf4ecd..2ad9014 100644
-+--- openjdk.orig/hotspot/src/share/vm/prims/jniCheck.cpp
-++++ openjdk/hotspot/src/share/vm/prims/jniCheck.cpp
-+@@ -51,6 +51,9 @@
-+ #ifdef TARGET_ARCH_ppc
-+ # include "jniTypes_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "jniTypes_aarch64.hpp"
-++#endif
-+ 
-+ 
-+ // Heap objects are allowed to be directly referenced only in VM code,
-+diff --git openjdk.orig/hotspot/src/share/vm/prims/jni_md.h openjdk/hotspot/src/share/vm/prims/jni_md.h
-+index 7fa5829..3bd4e31 100644
-+--- openjdk.orig/hotspot/src/share/vm/prims/jni_md.h
-++++ openjdk/hotspot/src/share/vm/prims/jni_md.h
-+@@ -39,6 +39,9 @@
-+ #ifdef TARGET_ARCH_ppc
-+ # include "jni_ppc.h"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "jni_aarch64.h"
-++#endif
-+ 
-+ 
-+ /*
-+diff --git openjdk.orig/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp openjdk/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp
-+index 97dd154..fd1fa43 100644
-+--- openjdk.orig/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp
-++++ openjdk/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp
-+@@ -43,6 +43,9 @@
-+ #ifdef TARGET_ARCH_ppc
-+ # include "bytes_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "bytes_aarch64.hpp"
-++#endif
-+ // FIXME: add Deprecated, LVTT attributes
-+ // FIXME: fix Synthetic attribute
-+ // FIXME: per Serguei, add error return handling for constantPoolOopDesc::copy_cpool_bytes()
-+diff --git openjdk.orig/hotspot/src/share/vm/prims/methodHandles.hpp openjdk/hotspot/src/share/vm/prims/methodHandles.hpp
-+index 514ba6a..ea747d0 100644
-+--- openjdk.orig/hotspot/src/share/vm/prims/methodHandles.hpp
-++++ openjdk/hotspot/src/share/vm/prims/methodHandles.hpp
-+@@ -738,6 +738,9 @@ public:
-+ #ifdef TARGET_ARCH_ppc
-+ # include "methodHandles_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "methodHandles_aarch64.hpp"
-++#endif
-+ };
-+ 
-+ 
-+diff --git openjdk.orig/hotspot/src/share/vm/runtime/atomic.cpp openjdk/hotspot/src/share/vm/runtime/atomic.cpp
-+index 80780d7..5a34f15 100644
-+--- openjdk.orig/hotspot/src/share/vm/runtime/atomic.cpp
-++++ openjdk/hotspot/src/share/vm/runtime/atomic.cpp
-+@@ -60,6 +60,9 @@
-+ #ifdef TARGET_OS_ARCH_linux_ppc
-+ # include "atomic_linux_ppc.inline.hpp"
-+ #endif
-++#ifdef TARGET_OS_ARCH_linux_aarch64
-++# include "atomic_linux_aarch64.inline.hpp"
-++#endif
-+ #ifdef TARGET_OS_ARCH_bsd_x86
-+ # include "atomic_bsd_x86.inline.hpp"
-+ #endif
-+diff --git openjdk.orig/hotspot/src/share/vm/runtime/deoptimization.cpp openjdk/hotspot/src/share/vm/runtime/deoptimization.cpp
-+index 4735588..4e7958a 100644
-+--- openjdk.orig/hotspot/src/share/vm/runtime/deoptimization.cpp
-++++ openjdk/hotspot/src/share/vm/runtime/deoptimization.cpp
-+@@ -65,6 +65,9 @@
-+ #ifdef TARGET_ARCH_ppc
-+ # include "vmreg_ppc.inline.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "vmreg_aarch64.inline.hpp"
-++#endif
-+ #ifdef COMPILER2
-+ #ifdef TARGET_ARCH_MODEL_x86_32
-+ # include "adfiles/ad_x86_32.hpp"
-+@@ -84,6 +87,9 @@
-+ #ifdef TARGET_ARCH_MODEL_ppc
-+ # include "adfiles/ad_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_MODEL_aarch64
-++# include "adfiles/ad_aarch64.hpp"
-++#endif
-+ #endif
-+ 
-+ bool DeoptimizationMarker::_is_active = false;
-+diff --git openjdk.orig/hotspot/src/share/vm/runtime/dtraceJSDT.hpp openjdk/hotspot/src/share/vm/runtime/dtraceJSDT.hpp
-+index bff4310..1129cd6 100644
-+--- openjdk.orig/hotspot/src/share/vm/runtime/dtraceJSDT.hpp
-++++ openjdk/hotspot/src/share/vm/runtime/dtraceJSDT.hpp
-+@@ -41,6 +41,9 @@
-+ #ifdef TARGET_ARCH_ppc
-+ # include "nativeInst_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "nativeInst_aarch64.hpp"
-++#endif
-+ 
-+ class RegisteredProbes;
-+ typedef jlong OpaqueProbes;
-+diff --git openjdk.orig/hotspot/src/share/vm/runtime/frame.cpp openjdk/hotspot/src/share/vm/runtime/frame.cpp
-+index 7ae9aa8..6654714 100644
-+--- openjdk.orig/hotspot/src/share/vm/runtime/frame.cpp
-++++ openjdk/hotspot/src/share/vm/runtime/frame.cpp
-+@@ -59,6 +59,9 @@
-+ #ifdef TARGET_ARCH_ppc
-+ # include "nativeInst_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "nativeInst_aarch64.hpp"
-++#endif
-+ 
-+ RegisterMap::RegisterMap(JavaThread *thread, bool update_map) {
-+   _thread         = thread;
-+diff --git openjdk.orig/hotspot/src/share/vm/runtime/frame.hpp openjdk/hotspot/src/share/vm/runtime/frame.hpp
-+index c55380e..c13caae 100644
-+--- openjdk.orig/hotspot/src/share/vm/runtime/frame.hpp
-++++ openjdk/hotspot/src/share/vm/runtime/frame.hpp
-+@@ -50,6 +50,9 @@
-+ #ifdef TARGET_ARCH_MODEL_ppc
-+ # include "adfiles/adGlobals_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_MODEL_aarch64
-++# include "adfiles/adGlobals_aarch64.hpp"
-++#endif
-+ #endif
-+ #ifdef ZERO
-+ #ifdef TARGET_ARCH_zero
-+@@ -491,6 +494,9 @@ class frame VALUE_OBJ_CLASS_SPEC {
-+ #ifdef TARGET_ARCH_ppc
-+ # include "frame_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "frame_aarch64.hpp"
-++#endif
-+ 
-+ };
-+ 
-+diff --git openjdk.orig/hotspot/src/share/vm/runtime/frame.inline.hpp openjdk/hotspot/src/share/vm/runtime/frame.inline.hpp
-+index b80b042..f6e1b0e 100644
-+--- openjdk.orig/hotspot/src/share/vm/runtime/frame.inline.hpp
-++++ openjdk/hotspot/src/share/vm/runtime/frame.inline.hpp
-+@@ -46,6 +46,9 @@
-+ #ifdef TARGET_ARCH_ppc
-+ # include "jniTypes_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "jniTypes_aarch64.hpp"
-++#endif
-+ #ifdef ZERO
-+ #ifdef TARGET_ARCH_zero
-+ # include "entryFrame_zero.hpp"
-+@@ -100,6 +103,9 @@ inline bool frame::is_first_frame() const {
-+ #ifdef TARGET_ARCH_ppc
-+ # include "frame_ppc.inline.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "frame_aarch64.inline.hpp"
-++#endif
-+ 
-+ 
-+ #endif // SHARE_VM_RUNTIME_FRAME_INLINE_HPP
-+diff --git openjdk.orig/hotspot/src/share/vm/runtime/globals.hpp openjdk/hotspot/src/share/vm/runtime/globals.hpp
-+index 10d74cd..4cc5dfb 100644
-+--- openjdk.orig/hotspot/src/share/vm/runtime/globals.hpp
-++++ openjdk/hotspot/src/share/vm/runtime/globals.hpp
-+@@ -52,6 +52,9 @@
-+ #ifdef TARGET_ARCH_ppc
-+ # include "globals_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "globals_aarch64.hpp"
-++#endif
-+ #ifdef TARGET_OS_FAMILY_linux
-+ # include "globals_linux.hpp"
-+ #endif
-+@@ -88,6 +91,9 @@
-+ #ifdef TARGET_OS_ARCH_linux_ppc
-+ # include "globals_linux_ppc.hpp"
-+ #endif
-++#ifdef TARGET_OS_ARCH_linux_aarch64
-++# include "globals_linux_aarch64.hpp"
-++#endif
-+ #ifdef TARGET_OS_ARCH_bsd_x86
-+ # include "globals_bsd_x86.hpp"
-+ #endif
-+@@ -107,6 +113,9 @@
-+ #ifdef TARGET_ARCH_ppc
-+ # include "c1_globals_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "c1_globals_aarch64.hpp"
-++#endif
-+ #ifdef TARGET_OS_FAMILY_linux
-+ # include "c1_globals_linux.hpp"
-+ #endif
-+@@ -130,6 +139,9 @@
-+ #ifdef TARGET_ARCH_arm
-+ # include "c2_globals_arm.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "c2_globals_aarch64.hpp"
-++#endif
-+ #ifdef TARGET_OS_FAMILY_linux
-+ # include "c2_globals_linux.hpp"
-+ #endif
-+diff --git openjdk.orig/hotspot/src/share/vm/runtime/icache.hpp openjdk/hotspot/src/share/vm/runtime/icache.hpp
-+index d460a0f..9a3b9c8 100644
-+--- openjdk.orig/hotspot/src/share/vm/runtime/icache.hpp
-++++ openjdk/hotspot/src/share/vm/runtime/icache.hpp
-+@@ -83,6 +83,9 @@ class AbstractICache : AllStatic {
-+ #ifdef TARGET_ARCH_ppc
-+ # include "icache_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "icache_aarch64.hpp"
-++#endif
-+ 
-+ 
-+ 
-+diff --git openjdk.orig/hotspot/src/share/vm/runtime/java.cpp openjdk/hotspot/src/share/vm/runtime/java.cpp
-+index fc3b67a..46794b0 100644
-+--- openjdk.orig/hotspot/src/share/vm/runtime/java.cpp
-++++ openjdk/hotspot/src/share/vm/runtime/java.cpp
-+@@ -78,6 +78,9 @@
-+ #ifdef TARGET_ARCH_ppc
-+ # include "vm_version_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "vm_version_aarch64.hpp"
-++#endif
-+ #ifdef TARGET_OS_FAMILY_linux
-+ # include "thread_linux.inline.hpp"
-+ #endif
-+diff --git openjdk.orig/hotspot/src/share/vm/runtime/javaCalls.hpp openjdk/hotspot/src/share/vm/runtime/javaCalls.hpp
-+index d4f8595..bc2ca9b 100644
-+--- openjdk.orig/hotspot/src/share/vm/runtime/javaCalls.hpp
-++++ openjdk/hotspot/src/share/vm/runtime/javaCalls.hpp
-+@@ -45,6 +45,9 @@
-+ #ifdef TARGET_ARCH_ppc
-+ # include "jniTypes_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "jniTypes_aarch64.hpp"
-++#endif
-+ #ifdef TARGET_OS_FAMILY_linux
-+ # include "thread_linux.inline.hpp"
-+ #endif
-+diff --git openjdk.orig/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp openjdk/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp
-+index 8374aa2..6be5f79 100644
-+--- openjdk.orig/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp
-++++ openjdk/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp
-+@@ -47,6 +47,9 @@
-+ #ifdef TARGET_OS_ARCH_linux_arm
-+ # include "orderAccess_linux_arm.inline.hpp"
-+ #endif
-++#ifdef TARGET_OS_ARCH_linux_aarch64
-++# include "orderAccess_linux_aarch64.inline.hpp"
-++#endif
-+ #ifdef TARGET_OS_ARCH_linux_ppc
-+ # include "orderAccess_linux_ppc.inline.hpp"
-+ #endif
-+@@ -121,6 +124,9 @@ friend class JavaCallWrapper;
-+ #ifdef TARGET_ARCH_ppc
-+ # include "javaFrameAnchor_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "javaFrameAnchor_aarch64.hpp"
-++#endif
-+ 
-+ 
-+ public:
-+diff --git openjdk.orig/hotspot/src/share/vm/runtime/os.hpp openjdk/hotspot/src/share/vm/runtime/os.hpp
-+index 5867deb..0f1fbb4 100644
-+--- openjdk.orig/hotspot/src/share/vm/runtime/os.hpp
-++++ openjdk/hotspot/src/share/vm/runtime/os.hpp
-+@@ -719,6 +719,9 @@ class os: AllStatic {
-+ #ifdef TARGET_OS_ARCH_linux_ppc
-+ # include "os_linux_ppc.hpp"
-+ #endif
-++#ifdef TARGET_OS_ARCH_linux_aarch64
-++# include "os_linux_aarch64.hpp"
-++#endif
-+ #ifdef TARGET_OS_ARCH_bsd_x86
-+ # include "os_bsd_x86.hpp"
-+ #endif
-+diff --git openjdk.orig/hotspot/src/share/vm/runtime/registerMap.hpp openjdk/hotspot/src/share/vm/runtime/registerMap.hpp
-+index 5dd677a..7bd425f 100644
-+--- openjdk.orig/hotspot/src/share/vm/runtime/registerMap.hpp
-++++ openjdk/hotspot/src/share/vm/runtime/registerMap.hpp
-+@@ -42,6 +42,9 @@
-+ #ifdef TARGET_ARCH_ppc
-+ # include "register_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "register_aarch64.hpp"
-++#endif
-+ 
-+ class JavaThread;
-+ 
-+@@ -150,6 +153,9 @@ class RegisterMap : public StackObj {
-+ #ifdef TARGET_ARCH_ppc
-+ # include "registerMap_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "registerMap_aarch64.hpp"
-++#endif
-+ 
-+ };
-+ 
-+diff --git openjdk.orig/hotspot/src/share/vm/runtime/relocator.hpp openjdk/hotspot/src/share/vm/runtime/relocator.hpp
-+index c34866f..790bd80 100644
-+--- openjdk.orig/hotspot/src/share/vm/runtime/relocator.hpp
-++++ openjdk/hotspot/src/share/vm/runtime/relocator.hpp
-+@@ -42,6 +42,9 @@
-+ #ifdef TARGET_ARCH_ppc
-+ # include "bytes_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "bytes_aarch64.hpp"
-++#endif
-+ 
-+ // This code has been converted from the 1.1E java virtual machine
-+ // Thanks to the JavaTopics group for using the code
-+diff --git openjdk.orig/hotspot/src/share/vm/runtime/safepoint.cpp openjdk/hotspot/src/share/vm/runtime/safepoint.cpp
-+index c29d257..a842bb3 100644
-+--- openjdk.orig/hotspot/src/share/vm/runtime/safepoint.cpp
-++++ openjdk/hotspot/src/share/vm/runtime/safepoint.cpp
-+@@ -70,6 +70,10 @@
-+ # include "nativeInst_ppc.hpp"
-+ # include "vmreg_ppc.inline.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "nativeInst_aarch64.hpp"
-++# include "vmreg_aarch64.inline.hpp"
-++#endif
-+ #ifdef TARGET_OS_FAMILY_linux
-+ # include "thread_linux.inline.hpp"
-+ #endif
-+diff --git openjdk.orig/hotspot/src/share/vm/runtime/sharedRuntime.cpp openjdk/hotspot/src/share/vm/runtime/sharedRuntime.cpp
-+index c25dcfe..aa7caff 100644
-+--- openjdk.orig/hotspot/src/share/vm/runtime/sharedRuntime.cpp
-++++ openjdk/hotspot/src/share/vm/runtime/sharedRuntime.cpp
-+@@ -76,6 +76,10 @@
-+ # include "nativeInst_ppc.hpp"
-+ # include "vmreg_ppc.inline.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "nativeInst_aarch64.hpp"
-++# include "vmreg_aarch64.inline.hpp"
-++#endif
-+ #ifdef COMPILER1
-+ #include "c1/c1_Runtime1.hpp"
-+ #endif
-+diff --git openjdk.orig/hotspot/src/share/vm/runtime/stackValueCollection.cpp openjdk/hotspot/src/share/vm/runtime/stackValueCollection.cpp
-+index 110f712..779f994 100644
-+--- openjdk.orig/hotspot/src/share/vm/runtime/stackValueCollection.cpp
-++++ openjdk/hotspot/src/share/vm/runtime/stackValueCollection.cpp
-+@@ -39,6 +39,9 @@
-+ #ifdef TARGET_ARCH_ppc
-+ # include "jniTypes_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "jniTypes_aarch64.hpp"
-++#endif
-+ 
-+ jint StackValueCollection::int_at(int slot) const {
-+   intptr_t val =  at(slot)->get_int();
-+diff --git openjdk.orig/hotspot/src/share/vm/runtime/statSampler.cpp openjdk/hotspot/src/share/vm/runtime/statSampler.cpp
-+index 0b24def..c82a214 100644
-+--- openjdk.orig/hotspot/src/share/vm/runtime/statSampler.cpp
-++++ openjdk/hotspot/src/share/vm/runtime/statSampler.cpp
-+@@ -48,6 +48,9 @@
-+ #ifdef TARGET_ARCH_ppc
-+ # include "vm_version_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "vm_version_aarch64.hpp"
-++#endif
-+ 
-+ // --------------------------------------------------------
-+ // StatSamplerTask
-+diff --git openjdk.orig/hotspot/src/share/vm/runtime/stubCodeGenerator.cpp openjdk/hotspot/src/share/vm/runtime/stubCodeGenerator.cpp
-+index b6068a5..4ef7e38 100644
-+--- openjdk.orig/hotspot/src/share/vm/runtime/stubCodeGenerator.cpp
-++++ openjdk/hotspot/src/share/vm/runtime/stubCodeGenerator.cpp
-+@@ -42,6 +42,9 @@
-+ #ifdef TARGET_ARCH_ppc
-+ # include "assembler_ppc.inline.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "assembler_aarch64.inline.hpp"
-++#endif
-+ 
-+ 
-+ // Implementation of StubCodeDesc
-+diff --git openjdk.orig/hotspot/src/share/vm/runtime/stubRoutines.hpp openjdk/hotspot/src/share/vm/runtime/stubRoutines.hpp
-+index 8481dce..f233b56 100644
-+--- openjdk.orig/hotspot/src/share/vm/runtime/stubRoutines.hpp
-++++ openjdk/hotspot/src/share/vm/runtime/stubRoutines.hpp
-+@@ -46,6 +46,9 @@
-+ #ifdef TARGET_ARCH_ppc
-+ # include "nativeInst_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "nativeInst_aarch64.hpp"
-++#endif
-+ 
-+ // StubRoutines provides entry points to assembly routines used by
-+ // compiled code and the run-time system. Platform-specific entry
-+@@ -116,6 +119,9 @@ class StubRoutines: AllStatic {
-+ #endif
-+ #ifdef TARGET_ARCH_MODEL_ppc
-+ # include "stubRoutines_ppc.hpp"
-++#endif
-++#ifdef TARGET_ARCH_MODEL_aarch64
-++# include "stubRoutines_aarch64.hpp"
-+ #endif
-+ 
-+ 
-+diff --git openjdk.orig/hotspot/src/share/vm/runtime/thread.hpp openjdk/hotspot/src/share/vm/runtime/thread.hpp
-+index 7846cc0..6964c22 100644
-+--- openjdk.orig/hotspot/src/share/vm/runtime/thread.hpp
-++++ openjdk/hotspot/src/share/vm/runtime/thread.hpp
-+@@ -1651,6 +1651,9 @@ public:
-+ #ifdef TARGET_OS_ARCH_linux_ppc
-+ # include "thread_linux_ppc.hpp"
-+ #endif
-++#ifdef TARGET_OS_ARCH_linux_aarch64
-++# include "thread_linux_aarch64.hpp"
-++#endif
-+ #ifdef TARGET_OS_ARCH_bsd_x86
-+ # include "thread_bsd_x86.hpp"
-+ #endif
-+diff --git openjdk.orig/hotspot/src/share/vm/runtime/threadLocalStorage.hpp openjdk/hotspot/src/share/vm/runtime/threadLocalStorage.hpp
-+index c2f7a9e..26ef559 100644
-+--- openjdk.orig/hotspot/src/share/vm/runtime/threadLocalStorage.hpp
-++++ openjdk/hotspot/src/share/vm/runtime/threadLocalStorage.hpp
-+@@ -68,6 +68,9 @@ class ThreadLocalStorage : AllStatic {
-+ #ifdef TARGET_OS_ARCH_linux_ppc
-+ # include "threadLS_linux_ppc.hpp"
-+ #endif
-++#ifdef TARGET_OS_ARCH_linux_aarch64
-++# include "threadLS_linux_aarch64.hpp"
-++#endif
-+ #ifdef TARGET_OS_ARCH_bsd_x86
-+ # include "threadLS_bsd_x86.hpp"
-+ #endif
-+diff --git openjdk.orig/hotspot/src/share/vm/runtime/vmStructs.cpp openjdk/hotspot/src/share/vm/runtime/vmStructs.cpp
-+index 8afd933..359f9fc 100644
-+--- openjdk.orig/hotspot/src/share/vm/runtime/vmStructs.cpp
-++++ openjdk/hotspot/src/share/vm/runtime/vmStructs.cpp
-+@@ -125,6 +125,9 @@
-+ #ifdef TARGET_ARCH_ppc
-+ # include "vmStructs_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "vmStructs_aarch64.hpp"
-++#endif
-+ #ifdef TARGET_OS_FAMILY_linux
-+ # include "thread_linux.inline.hpp"
-+ #endif
-+@@ -161,6 +164,9 @@
-+ #ifdef TARGET_OS_ARCH_linux_ppc
-+ # include "vmStructs_linux_ppc.hpp"
-+ #endif
-++#ifdef TARGET_OS_ARCH_linux_aarch64
-++# include "vmStructs_linux_aarch64.hpp"
-++#endif
-+ #ifdef TARGET_OS_ARCH_bsd_x86
-+ # include "vmStructs_bsd_x86.hpp"
-+ #endif
-+@@ -221,6 +227,9 @@
-+ #ifdef TARGET_ARCH_MODEL_ppc
-+ # include "adfiles/adGlobals_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_MODEL_aarch64
-++# include "adfiles/adGlobals_aarch64.hpp"
-++#endif
-+ #endif
-+ 
-+ // Note: the cross-product of (c1, c2, product, nonproduct, ...),
-+diff --git openjdk.orig/hotspot/src/share/vm/runtime/vm_version.cpp openjdk/hotspot/src/share/vm/runtime/vm_version.cpp
-+index 2d51b67..bba9b01 100644
-+--- openjdk.orig/hotspot/src/share/vm/runtime/vm_version.cpp
-++++ openjdk/hotspot/src/share/vm/runtime/vm_version.cpp
-+@@ -41,6 +41,9 @@
-+ #ifdef TARGET_ARCH_ppc
-+ # include "vm_version_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "vm_version_aarch64.hpp"
-++#endif
-+ 
-+ const char* Abstract_VM_Version::_s_vm_release = Abstract_VM_Version::vm_release();
-+ const char* Abstract_VM_Version::_s_internal_vm_info_string = Abstract_VM_Version::internal_vm_info_string();
-+@@ -185,6 +188,7 @@ const char* Abstract_VM_Version::jre_release_version() {
-+                  AMD64_ONLY("amd64")             \
-+                  ARM_ONLY("arm")                 \
-+                  PPC_ONLY("ppc")                 \
-++                 AARCH64_ONLY("aarch64")         \
-+                  SPARC_ONLY("sparc")
-+ #endif // ZERO
-+ 
-+diff --git openjdk.orig/hotspot/src/share/vm/utilities/copy.hpp openjdk/hotspot/src/share/vm/utilities/copy.hpp
-+index 3dcbfee..198590f 100644
-+--- openjdk.orig/hotspot/src/share/vm/utilities/copy.hpp
-++++ openjdk/hotspot/src/share/vm/utilities/copy.hpp
-+@@ -337,6 +337,9 @@ class Copy : AllStatic {
-+ #ifdef TARGET_ARCH_ppc
-+ # include "copy_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "copy_aarch64.hpp"
-++#endif
-+ 
-+ };
-+ 
-+diff --git openjdk.orig/hotspot/src/share/vm/utilities/globalDefinitions.hpp openjdk/hotspot/src/share/vm/utilities/globalDefinitions.hpp
-+index b55b0ac..5d11e26 100644
-+--- openjdk.orig/hotspot/src/share/vm/utilities/globalDefinitions.hpp
-++++ openjdk/hotspot/src/share/vm/utilities/globalDefinitions.hpp
-+@@ -346,6 +346,9 @@ extern int LogMinObjAlignmentInBytes;
-+ #ifdef TARGET_ARCH_ppc
-+ # include "globalDefinitions_ppc.hpp"
-+ #endif
-++#ifdef TARGET_ARCH_aarch64
-++# include "globalDefinitions_aarch64.hpp"
-++#endif
-+ 
-+ 
-+ // The byte alignment to be used by Arena::Amalloc.  See bugid 4169348.
-+diff --git openjdk.orig/hotspot/src/share/vm/utilities/macros.hpp openjdk/hotspot/src/share/vm/utilities/macros.hpp
-+index 003f2af..2aa7f87 100644
-+--- openjdk.orig/hotspot/src/share/vm/utilities/macros.hpp
-++++ openjdk/hotspot/src/share/vm/utilities/macros.hpp
-+@@ -261,6 +261,14 @@
-+ #define NOT_ARM(code) code
-+ #endif
-+ 
-++#ifdef AARCH64
-++#define AARCH64_ONLY(code) code
-++#define NOT_AARCH64(code)
-++#else
-++#define AARCH64_ONLY(code)
-++#define NOT_AARCH64(code) code
-++#endif
-++
-+ #ifdef JAVASE_EMBEDDED
-+ #define EMBEDDED_ONLY(code) code
-+ #define NOT_EMBEDDED(code)
--- 
-2.26.2
-
diff --git a/gnu/packages/patches/icu4c-CVE-2020-10531.patch b/gnu/packages/patches/icu4c-CVE-2020-10531.patch
deleted file mode 100644
index c2ab923bdc..0000000000
--- a/gnu/packages/patches/icu4c-CVE-2020-10531.patch
+++ /dev/null
@@ -1,127 +0,0 @@
-Fix CVE-2020-10531:
-
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-10531
-
-Patch copied from upstream source repository (changes to the test suite
-are commented out):
-
-https://github.com/unicode-org/icu/commit/b7d08bc04a4296982fcef8b6b8a354a9e4e7afca
-
-From b7d08bc04a4296982fcef8b6b8a354a9e4e7afca Mon Sep 17 00:00:00 2001
-From: Frank Tang <ftang@chromium.org>
-Date: Sat, 1 Feb 2020 02:39:04 +0000
-Subject: [PATCH] ICU-20958 Prevent SEGV_MAPERR in append
-
-See #971
----
- icu4c/source/common/unistr.cpp          |  6 ++-
- icu4c/source/test/intltest/ustrtest.cpp | 62 +++++++++++++++++++++++++
- icu4c/source/test/intltest/ustrtest.h   |  1 +
- 3 files changed, 68 insertions(+), 1 deletion(-)
-
-diff --git a/icu4c/source/common/unistr.cpp b/icu4c/source/common/unistr.cpp
-index 901bb3358ba..077b4d6ef20 100644
---- a/icu4c/source/common/unistr.cpp
-+++ b/icu4c/source/common/unistr.cpp
-@@ -1563,7 +1563,11 @@ UnicodeString::doAppend(const UChar *srcChars, int32_t srcStart, int32_t srcLeng
-   }
- 
-   int32_t oldLength = length();
--  int32_t newLength = oldLength + srcLength;
-+  int32_t newLength;
-+  if (uprv_add32_overflow(oldLength, srcLength, &newLength)) {
-+    setToBogus();
-+    return *this;
-+  }
- 
-   // Check for append onto ourself
-   const UChar* oldArray = getArrayStart();
-#diff --git a/icu4c/source/test/intltest/ustrtest.cpp b/icu4c/source/test/intltest/ustrtest.cpp
-#index b6515ea813c..ad38bdf53a3 100644
-#--- a/icu4c/source/test/intltest/ustrtest.cpp
-#+++ b/icu4c/source/test/intltest/ustrtest.cpp
-#@@ -67,6 +67,7 @@ void UnicodeStringTest::runIndexedTest( int32_t index, UBool exec, const char* &
-#     TESTCASE_AUTO(TestWCharPointers);
-#     TESTCASE_AUTO(TestNullPointers);
-#     TESTCASE_AUTO(TestUnicodeStringInsertAppendToSelf);
-#+    TESTCASE_AUTO(TestLargeAppend);
-#     TESTCASE_AUTO_END;
-# }
-# 
-#@@ -2310,3 +2311,64 @@ void UnicodeStringTest::TestUnicodeStringInsertAppendToSelf() {
-#     str.insert(2, sub);
-#     assertEquals("", u"abbcdcde", str);
-# }
-#+
-#+void UnicodeStringTest::TestLargeAppend() {
-#+    if(quick) return;
-#+
-#+    IcuTestErrorCode status(*this, "TestLargeAppend");
-#+    // Make a large UnicodeString
-#+    int32_t len = 0xAFFFFFF;
-#+    UnicodeString str;
-#+    char16_t *buf = str.getBuffer(len);
-#+    // A fast way to set buffer to valid Unicode.
-#+    // 4E4E is a valid unicode character
-#+    uprv_memset(buf, 0x4e, len * 2);
-#+    str.releaseBuffer(len);
-#+    UnicodeString dest;
-#+    // Append it 16 times
-#+    // 0xAFFFFFF times 16 is 0xA4FFFFF1,
-#+    // which is greater than INT32_MAX, which is 0x7FFFFFFF.
-#+    int64_t total = 0;
-#+    for (int32_t i = 0; i < 16; i++) {
-#+        dest.append(str);
-#+        total += len;
-#+        if (total <= INT32_MAX) {
-#+            assertFalse("dest is not bogus", dest.isBogus());
-#+        } else {
-#+            assertTrue("dest should be bogus", dest.isBogus());
-#+        }
-#+    }
-#+    dest.remove();
-#+    total = 0;
-#+    for (int32_t i = 0; i < 16; i++) {
-#+        dest.append(str);
-#+        total += len;
-#+        if (total + len <= INT32_MAX) {
-#+            assertFalse("dest is not bogus", dest.isBogus());
-#+        } else if (total <= INT32_MAX) {
-#+            // Check that a string of exactly the maximum size works
-#+            UnicodeString str2;
-#+            int32_t remain = INT32_MAX - total;
-#+            char16_t *buf2 = str2.getBuffer(remain);
-#+            if (buf2 == nullptr) {
-#+                // if somehow memory allocation fail, return the test
-#+                return;
-#+            }
-#+            uprv_memset(buf2, 0x4e, remain * 2);
-#+            str2.releaseBuffer(remain);
-#+            dest.append(str2);
-#+            total += remain;
-#+            assertEquals("When a string of exactly the maximum size works", (int64_t)INT32_MAX, total);
-#+            assertEquals("When a string of exactly the maximum size works", INT32_MAX, dest.length());
-#+            assertFalse("dest is not bogus", dest.isBogus());
-#+
-#+            // Check that a string size+1 goes bogus
-#+            str2.truncate(1);
-#+            dest.append(str2);
-#+            total++;
-#+            assertTrue("dest should be bogus", dest.isBogus());
-#+        } else {
-#+            assertTrue("dest should be bogus", dest.isBogus());
-#+        }
-#+    }
-#+}
-#diff --git a/icu4c/source/test/intltest/ustrtest.h b/icu4c/source/test/intltest/ustrtest.h
-#index 218befdcc68..4a356a92c7a 100644
-#--- a/icu4c/source/test/intltest/ustrtest.h
-#+++ b/icu4c/source/test/intltest/ustrtest.h
-#@@ -97,6 +97,7 @@ class UnicodeStringTest: public IntlTest {
-#     void TestWCharPointers();
-#     void TestNullPointers();
-#     void TestUnicodeStringInsertAppendToSelf();
-#+    void TestLargeAppend();
-# };
-# 
-# #endif
diff --git a/gnu/packages/patches/idris-build-with-haskeline-0.8.patch b/gnu/packages/patches/idris-build-with-haskeline-0.8.patch
new file mode 100644
index 0000000000..5d1fec2409
--- /dev/null
+++ b/gnu/packages/patches/idris-build-with-haskeline-0.8.patch
@@ -0,0 +1,85 @@
+From 89a87cf666eb8b27190c779e72d0d76eadc1bc14 Mon Sep 17 00:00:00 2001
+From: Niklas Larsson <niklas@mm.st>
+Date: Sat, 6 Jun 2020 15:29:45 +0200
+Subject: [PATCH] Fix to unblock haskeline-0.8
+
+---
+Taken from <https://github.com/idris-lang/Idris-dev/pull/4871>
+
+ idris.cabal         |  2 +-
+ src/Idris/Output.hs |  8 --------
+ src/Idris/REPL.hs   | 12 +++++-------
+ 3 files changed, 6 insertions(+), 16 deletions(-)
+
+diff --git a/idris.cabal b/idris.cabal
+index 38359019a9..bc9e265023 100644
+--- a/idris.cabal
++++ b/idris.cabal
+@@ -336,7 +336,7 @@ Library
+                 , directory >= 1.2.2.0 && < 1.2.3.0 || > 1.2.3.0
+                 , filepath < 1.5
+                 , fingertree >= 0.1.4.1 && < 0.2
+-                , haskeline >= 0.7 && < 0.8
++                , haskeline >= 0.8 && < 0.9
+                 , ieee754 >= 0.7 && < 0.9
+                 , megaparsec >= 7.0.4 && < 9
+                 , mtl >= 2.1 && < 2.3
+diff --git a/src/Idris/Output.hs b/src/Idris/Output.hs
+index 70b4d48a30..6b5d59948c 100644
+--- a/src/Idris/Output.hs
++++ b/src/Idris/Output.hs
+@@ -37,21 +37,13 @@ import Prelude hiding ((<$>))
+ #endif
+ 
+ import Control.Arrow (first)
+-import Control.Monad.Trans.Except (ExceptT(ExceptT), runExceptT)
+ import Data.List (intersperse, nub)
+ import Data.Maybe (fromJust, fromMaybe, isJust, listToMaybe)
+ import qualified Data.Set as S
+-import System.Console.Haskeline.MonadException (MonadException(controlIO),
+-                                                RunIO(RunIO))
+ import System.FilePath (replaceExtension)
+ import System.IO (Handle, hPutStr, hPutStrLn)
+ import System.IO.Error (tryIOError)
+ 
+-instance MonadException m => MonadException (ExceptT Err m) where
+-    controlIO f = ExceptT $ controlIO $ \(RunIO run) -> let
+-                    run' = RunIO (fmap ExceptT . run . runExceptT)
+-                    in fmap runExceptT $ f run'
+-
+ pshow :: IState -> Err -> String
+ pshow ist err = displayDecorated (consoleDecorate ist) .
+                 renderPretty 1.0 80 .
+diff --git a/src/Idris/REPL.hs b/src/Idris/REPL.hs
+index 05587d9672..5e0dc21089 100644
+--- a/src/Idris/REPL.hs
++++ b/src/Idris/REPL.hs
+@@ -122,23 +122,21 @@ repl orig mods efile
+                              (if colour && not isWindows
+                                 then colourisePrompt theme str
+                                 else str) ++ " "
+-        x <- H.catch (H.withInterrupt $ getInputLine prompt)
+-                     (ctrlC (return $ Just ""))
++        x <- H.handleInterrupt (ctrlC (return $ Just "")) (H.withInterrupt $ getInputLine prompt)
+         case x of
+             Nothing -> do lift $ when (not quiet) (iputStrLn "Bye bye")
+                           return ()
+             Just input -> -- H.catch
+-                do ms <- H.catch (H.withInterrupt $ lift $ processInput input orig mods efile)
+-                                 (ctrlC (return (Just mods)))
++                do ms <- H.handleInterrupt (ctrlC (return (Just mods))) (H.withInterrupt $ lift $ processInput input orig mods efile)
+                    case ms of
+                         Just mods -> let efile' = fromMaybe efile (listToMaybe mods)
+                                      in repl orig mods efile'
+                         Nothing -> return ()
+ --                             ctrlC)
+ --       ctrlC
+-   where ctrlC :: InputT Idris a -> SomeException -> InputT Idris a
+-         ctrlC act e = do lift $ iputStrLn (show e)
+-                          act -- repl orig mods
++   where ctrlC :: InputT Idris a -> InputT Idris a
++         ctrlC act = do lift $ iputStrLn "Interrupted"
++                        act -- repl orig mods
+ 
+          showMVs c thm [] = ""
+          showMVs c thm ms = "Holes: " ++
diff --git a/gnu/packages/patches/idris-build-with-megaparsec-9.patch b/gnu/packages/patches/idris-build-with-megaparsec-9.patch
new file mode 100644
index 0000000000..6d7ff1d713
--- /dev/null
+++ b/gnu/packages/patches/idris-build-with-megaparsec-9.patch
@@ -0,0 +1,27 @@
+From 6ea9bc913877d765048d7cdb7fc5aec60b196fac Mon Sep 17 00:00:00 2001
+From: Felix Yan <felixonmars@archlinux.org>
+Date: Wed, 16 Dec 2020 21:48:32 +0800
+Subject: [PATCH] Fix compatibility with megaparsec 9
+
+---
+Taken from <https://github.com/idris-lang/Idris-dev/pull/4892>
+
+ src/Idris/Parser/Stack.hs | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/Idris/Parser/Stack.hs b/src/Idris/Parser/Stack.hs
+index fb7b611440..879786f4d2 100644
+--- a/src/Idris/Parser/Stack.hs
++++ b/src/Idris/Parser/Stack.hs
+@@ -84,7 +84,11 @@ instance Message ParseError where
+       (pos, _) = P.reachOffsetNoLine (parseErrorOffset err) (parseErrorPosState err)
+ #endif
+   messageText = PP.text . init . P.parseErrorTextPretty . parseError
++#if MIN_VERSION_megaparsec(9,0,0)
++  messageSource err = sline
++#else
+   messageSource err = Just sline
++#endif
+     where
+ #if MIN_VERSION_megaparsec(8,0,0)
+       (sline, _) = P.reachOffset (parseErrorOffset err) (parseErrorPosState err)
diff --git a/gnu/packages/patches/inetutils-hurd.patch b/gnu/packages/patches/inetutils-hurd.patch
deleted file mode 100644
index bd65c4feb1..0000000000
--- a/gnu/packages/patches/inetutils-hurd.patch
+++ /dev/null
@@ -1,583 +0,0 @@
-Support compiling on the Hurd.
-
-Taken from https://git.hadrons.org/cgit/debian/pkgs/inetutils.git/tree/debian/patches/0002-ifconfig-Improve-the-support-for-GNU-Hurd.patch
-
-From 9a90d9b9119906df23cb2db1503cb0f099942dd9 Mon Sep 17 00:00:00 2001
-From: Mats Erik Andersson <gnu@gisladisker.se>
-Date: Sat, 18 Jul 2015 01:12:41 +0200
-Subject: [PATCH 02/35] ifconfig: Improve the support for GNU/Hurd.
-
-Use system specific code instead of generic code.
-This provides abilities similar to other systems.
----
- ChangeLog                   |  17 +++
- ifconfig/system.c           |  10 +-
- ifconfig/system.h           |   2 +
- ifconfig/system/Makefile.am |   4 +-
- ifconfig/system/generic.c   |  14 +-
- ifconfig/system/hurd.c      | 292 ++++++++++++++++++++++++++++++++++++
- ifconfig/system/hurd.h      |  50 ++++++
- 7 files changed, 381 insertions(+), 8 deletions(-)
- create mode 100644 ifconfig/system/hurd.c
- create mode 100644 ifconfig/system/hurd.h
-
-diff --git a/ifconfig/system.c b/ifconfig/system.c
-index 30677e41..e108dc2e 100644
---- a/ifconfig/system.c
-+++ b/ifconfig/system.c
-@@ -25,10 +25,12 @@
- # include "system/solaris.c"
- #elif defined __QNX__
- # include "system/qnx.c"
--# elif defined __DragonFly__ || defined __FreeBSD__ || \
--       defined __FreeBSD_kernel__ || \
--       defined __NetBSD__ || defined __OpenBSD__
--#  include "system/bsd.c"
-+#elif defined __DragonFly__ || defined __FreeBSD__ || \
-+      defined __FreeBSD_kernel__ || \
-+      defined __NetBSD__ || defined __OpenBSD__
-+# include "system/bsd.c"
-+#elif defined __GNU__
-+# include "system/hurd.c"
- #else
- # include "system/generic.c"
- #endif
-diff --git a/ifconfig/system.h b/ifconfig/system.h
-index 8521ad95..66878d3a 100644
---- a/ifconfig/system.h
-+++ b/ifconfig/system.h
-@@ -97,6 +97,8 @@ extern struct if_nameindex* (*system_if_nameindex) (void);
-        defined __FreeBSD_kernel__ || \
-        defined __NetBSD__ || defined __OpenBSD__
- #  include "system/bsd.h"
-+# elif defined __GNU__
-+#  include "system/hurd.h"
- # else
- #  include "system/generic.h"
- # endif
-diff --git a/ifconfig/system/Makefile.am b/ifconfig/system/Makefile.am
-index 954c6774..62a9f1c4 100644
---- a/ifconfig/system/Makefile.am
-+++ b/ifconfig/system/Makefile.am
-@@ -26,8 +26,10 @@ noinst_HEADERS = \
- 	linux.h \
- 	solaris.h \
- 	qnx.h \
-+	hurd.h \
- 	bsd.c \
- 	generic.c \
- 	linux.c \
- 	solaris.c \
--	qnx.c
-+	qnx.c \
-+	hurd.c
-diff --git a/ifconfig/system/generic.c b/ifconfig/system/generic.c
-index 9a2bda55..20a78bde 100644
---- a/ifconfig/system/generic.c
-+++ b/ifconfig/system/generic.c
-@@ -22,6 +22,8 @@
- #include <config.h>
- 
- #include "../ifconfig.h"
-+
-+#include <unused-parameter.h>
- 
- 
- /* Output format stuff.  */
-@@ -36,19 +38,25 @@ const char *system_help;
- struct argp_child system_argp_child;
- 
- int
--system_parse_opt (struct ifconfig **ifp, char option, char *optarg)
-+system_parse_opt (struct ifconfig **ifp _GL_UNUSED_PARAMETER,
-+		  char option _GL_UNUSED_PARAMETER,
-+		  char *optarg _GL_UNUSED_PARAMETER)
- {
-   return 0;
- }
- 
- int
--system_parse_opt_rest (struct ifconfig **ifp, int argc, char *argv[])
-+system_parse_opt_rest (struct ifconfig **ifp _GL_UNUSED_PARAMETER,
-+		       int argc _GL_UNUSED_PARAMETER,
-+		       char *argv[] _GL_UNUSED_PARAMETER)
- {
-   return 0;
- }
- 
- int
--system_configure (int sfd, struct ifreq *ifr, struct system_ifconfig *ifs)
-+system_configure (int sfd _GL_UNUSED_PARAMETER,
-+		  struct ifreq *ifr _GL_UNUSED_PARAMETER,
-+		  struct system_ifconfig *ifs _GL_UNUSED_PARAMETER)
- {
-   return 0;
- }
-diff --git a/ifconfig/system/hurd.c b/ifconfig/system/hurd.c
-new file mode 100644
-index 00000000..3bd19775
---- /dev/null
-+++ b/ifconfig/system/hurd.c
-@@ -0,0 +1,292 @@
-+/* hurd.c -- Code for ifconfig specific to GNU/Hurd.
-+  Copyright (C) 2015 Free Software Foundation, Inc.
-+
-+  This file is part of GNU Inetutils.
-+
-+  GNU Inetutils is free software: you can redistribute it and/or modify
-+  it under the terms of the GNU General Public License as published by
-+  the Free Software Foundation, either version 3 of the License, or (at
-+  your option) any later version.
-+
-+  GNU Inetutils is distributed in the hope that it will be useful, but
-+  WITHOUT ANY WARRANTY; without even the implied warranty of
-+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+  General Public License for more details.
-+
-+  You should have received a copy of the GNU General Public License
-+  along with this program.  If not, see `http://www.gnu.org/licenses/'. */
-+
-+/* Mostly written by Marcus Brinkmann.
-+   Adaptions to GNU/Hurd by Mats Erik Andersson.  */
-+
-+#include <config.h>
-+
-+#include <stdlib.h>
-+#include <sys/ioctl.h>
-+#include <net/if_arp.h>
-+#include "../ifconfig.h"
-+
-+#include <unused-parameter.h>
-+
-+
-+/* Output format stuff.  */
-+
-+const char *system_default_format = "gnu";
-+
-+
-+/* Argument parsing stuff.  */
-+
-+const char *system_help = "NAME [ADDR]\
-+ [broadcast BRDADDR] [netmask MASK]\
-+ [mtu N] [up|down] [FLAGS]";
-+
-+struct argp_child system_argp_child;
-+
-+int
-+system_parse_opt (struct ifconfig **ifp _GL_UNUSED_PARAMETER,
-+		  char option _GL_UNUSED_PARAMETER,
-+		  char *optarg _GL_UNUSED_PARAMETER)
-+{
-+  return 0;
-+}
-+
-+int
-+system_parse_opt_rest (struct ifconfig **ifp, int argc, char *argv[])
-+{
-+  int i = 0, mask, rev;
-+  enum {
-+    EXPECT_NOTHING,
-+    EXPECT_AF,
-+    EXPECT_BROADCAST,
-+    EXPECT_NETMASK,
-+    EXPECT_METRIC,
-+    EXPECT_MTU
-+  } expect = EXPECT_AF;
-+
-+  *ifp = parse_opt_new_ifs (argv[0]);
-+
-+  while (++i < argc)
-+    {
-+      switch (expect)
-+	{
-+	case EXPECT_BROADCAST:
-+	  parse_opt_set_brdaddr (*ifp, argv[i]);
-+	  break;
-+
-+	case EXPECT_NETMASK:
-+	  parse_opt_set_netmask (*ifp, argv[i]);
-+	  break;
-+
-+	case EXPECT_MTU:
-+	  parse_opt_set_mtu (*ifp, argv[i]);
-+	  break;
-+
-+	/* XXX: 2015-07-18, GNU/Hurd does not yet support
-+		ioctl(SIOCSIFMETRIC), but we let the code
-+		handle this standard ability anyway!
-+	 */
-+	case EXPECT_METRIC:
-+	  parse_opt_set_metric (*ifp, argv[i]);
-+	  break;
-+
-+	case EXPECT_AF:
-+	  expect = EXPECT_NOTHING;
-+	  if (!strcmp (argv[i], "inet"))
-+	    continue;
-+	  else if (!strcmp (argv[i], "inet6"))
-+	    {
-+	      error (0, 0, "%s is not a supported address family", argv[i]);
-+	      return 0;
-+	    }
-+	  break;
-+
-+	case EXPECT_NOTHING:
-+	  break;
-+	}
-+
-+      if (expect != EXPECT_NOTHING)
-+	expect = EXPECT_NOTHING;
-+      else if (!strcmp (argv[i], "broadcast"))
-+	expect = EXPECT_BROADCAST;
-+      else if (!strcmp (argv[i], "netmask"))
-+	expect = EXPECT_NETMASK;
-+      else if (!strcmp (argv[i], "metric"))
-+	expect = EXPECT_METRIC;
-+      else if (!strcmp (argv[i], "mtu"))
-+	expect = EXPECT_MTU;
-+      else if (!strcmp (argv[i], "up"))
-+	parse_opt_set_flag (*ifp, IFF_UP | IFF_RUNNING, 0);
-+      else if (!strcmp (argv[i], "down"))
-+	parse_opt_set_flag (*ifp, IFF_UP, 1);
-+      else if (((mask = if_nameztoflag (argv[i], &rev))
-+		& ~IU_IFF_CANTCHANGE) != 0)
-+	parse_opt_set_flag (*ifp, mask, rev);
-+      else
-+	{
-+	  if (!((*ifp)->valid & IF_VALID_ADDR))
-+	    parse_opt_set_address (*ifp, argv[i]);
-+	  else if (!((*ifp)->valid & IF_VALID_DSTADDR))
-+	    parse_opt_set_dstaddr (*ifp, argv[i]);
-+	}
-+    }
-+
-+  switch (expect)
-+    {
-+    case EXPECT_BROADCAST:
-+      error (0, 0, "option `broadcast' requires an argument");
-+      break;
-+
-+    case EXPECT_NETMASK:
-+      error (0, 0, "option `netmask' requires an argument");
-+      break;
-+
-+    case EXPECT_METRIC:
-+      error (0, 0, "option `metric' requires an argument");
-+      break;
-+
-+    case EXPECT_MTU:
-+      error (0, 0, "option `mtu' requires an argument");
-+      break;
-+
-+    case EXPECT_AF:
-+    case EXPECT_NOTHING:
-+      return 1;
-+    }
-+
-+  return 0;
-+}
-+
-+int
-+system_configure (int sfd _GL_UNUSED_PARAMETER,
-+		  struct ifreq *ifr _GL_UNUSED_PARAMETER,
-+		  struct system_ifconfig *ifs _GL_UNUSED_PARAMETER)
-+{
-+  return 0;
-+}
-+
-+struct if_nameindex* (*system_if_nameindex) (void) = if_nameindex;
-+
-+static void
-+print_hwaddr_ether (format_data_t form _GL_UNUSED_PARAMETER,
-+		    unsigned char *data)
-+{
-+  *column += printf ("%02X:%02X:%02X:%02X:%02X:%02X",
-+		     data[0], data[1], data[2], data[3], data[4], data[5]);
-+  had_output = 1;
-+}
-+
-+struct arphrd_symbol
-+{
-+  const char *name;
-+  const char *title;
-+  int value;
-+  void (*print_hwaddr) (format_data_t form, unsigned char *data);
-+} arphrd_symbols[] =
-+  {
-+#ifdef ARPHRD_ETHER		/* Ethernet 10/100Mbps.  */
-+    { "ETHER", "Ethernet", ARPHRD_ETHER, print_hwaddr_ether},
-+#endif
-+#ifdef ARPHRD_LOOPBACK		/* Loopback device.  */
-+    { "LOOPBACK", "Local Loopback", ARPHRD_LOOPBACK, NULL},
-+#endif
-+    /* XXX: The image debian-hurd-20150424 returns the value 4
-+	    instead of expected ARPHRD_LOOPBACK.  This has been
-+	    discussed in the list debian-hurd, where I was asked
-+	    to resist the temptation of a work around!
-+     */
-+    { NULL, NULL, 0, NULL}
-+  };
-+
-+struct arphrd_symbol *
-+arphrd_findvalue (int value)
-+{
-+  struct arphrd_symbol *arp = arphrd_symbols;
-+  while (arp->name != NULL)
-+    {
-+      if (arp->value == value)
-+	break;
-+      arp++;
-+    }
-+  if (arp->name)
-+    return arp;
-+  else
-+    return NULL;
-+}
-+
-+void
-+system_fh_hwaddr_query (format_data_t form, int argc, char *argv[])
-+{
-+#ifdef SIOCGIFHWADDR
-+  struct arphrd_symbol *arp;
-+
-+  if (ioctl (form->sfd, SIOCGIFHWADDR, form->ifr) < 0)
-+    select_arg (form, argc, argv, 1);
-+
-+  arp = arphrd_findvalue (form->ifr->ifr_hwaddr.sa_family);
-+  select_arg (form, argc, argv, (arp && arp->print_hwaddr) ? 0 : 1);
-+#else
-+  select_arg (form, argc, argv, 1);
-+#endif
-+}
-+
-+void
-+system_fh_hwaddr (format_data_t form, int argc _GL_UNUSED_PARAMETER,
-+		  char *argv[] _GL_UNUSED_PARAMETER)
-+{
-+#ifdef SIOCGIFHWADDR
-+  if (ioctl (form->sfd, SIOCGIFHWADDR, form->ifr) < 0)
-+    error (EXIT_FAILURE, errno,
-+	   "SIOCGIFHWADDR failed for interface `%s'",
-+	   form->ifr->ifr_name);
-+  else
-+    {
-+      struct arphrd_symbol *arp;
-+
-+      arp = arphrd_findvalue (form->ifr->ifr_hwaddr.sa_family);
-+      if (arp && arp->print_hwaddr)
-+	arp->print_hwaddr (form,
-+			   (unsigned char *) form->ifr->ifr_hwaddr.sa_data);
-+      else
-+	put_string (form, "(hwaddr unknown)");
-+    }
-+#else
-+  *column += printf ("(not available)");
-+  had_output = 1;
-+#endif
-+}
-+
-+void
-+system_fh_hwtype_query (format_data_t form, int argc, char *argv[])
-+{
-+#ifdef SIOCGIFHWADDR
-+  if (ioctl (form->sfd, SIOCGIFHWADDR, form->ifr) >= 0)
-+    select_arg (form, argc, argv, 0);
-+  else
-+#endif
-+    select_arg (form, argc, argv, 1);
-+}
-+
-+void
-+system_fh_hwtype (format_data_t form, int argc _GL_UNUSED_PARAMETER,
-+		  char *argv[] _GL_UNUSED_PARAMETER)
-+{
-+#ifdef SIOCGIFHWADDR
-+  if (ioctl (form->sfd, SIOCGIFHWADDR, form->ifr) < 0)
-+    error (EXIT_FAILURE, errno,
-+	   "SIOCGIFHWADDR failed for interface `%s'",
-+	   form->ifr->ifr_name);
-+  else
-+    {
-+      struct arphrd_symbol *arp;
-+
-+      arp = arphrd_findvalue (form->ifr->ifr_hwaddr.sa_family);
-+      if (arp)
-+	put_string (form, arp->title);
-+      else
-+	put_string (form, "(hwtype unknown)");
-+    }
-+#else
-+  *column += printf ("(not available)");
-+  had_output = 1;
-+#endif
-+}
-diff --git a/ifconfig/system/hurd.h b/ifconfig/system/hurd.h
-new file mode 100644
-index 00000000..bab14565
---- /dev/null
-+++ b/ifconfig/system/hurd.h
-@@ -0,0 +1,50 @@
-+/*
-+  Copyright (C) 2015 Free Software Foundation, Inc.
-+
-+  This file is part of GNU Inetutils.
-+
-+  GNU Inetutils is free software: you can redistribute it and/or modify
-+  it under the terms of the GNU General Public License as published by
-+  the Free Software Foundation, either version 3 of the License, or (at
-+  your option) any later version.
-+
-+  GNU Inetutils is distributed in the hope that it will be useful, but
-+  WITHOUT ANY WARRANTY; without even the implied warranty of
-+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+  General Public License for more details.
-+
-+  You should have received a copy of the GNU General Public License
-+  along with this program.  If not, see `http://www.gnu.org/licenses/'. */
-+
-+/* Written by Mats Erik Andersson.  */
-+
-+#ifndef IFCONFIG_SYSTEM_HURD_H
-+# define IFCONFIG_SYSTEM_HURD_H
-+
-+# include "../printif.h"
-+# include "../options.h"
-+
-+
-+/* Option support.  */
-+
-+struct system_ifconfig
-+{
-+  int valid;
-+};
-+
-+
-+/* Output format support.  */
-+
-+# define SYSTEM_FORMAT_HANDLER \
-+  { "hurd", fh_nothing}, \
-+  { "hwaddr?", system_fh_hwaddr_query}, \
-+  { "hwaddr", system_fh_hwaddr}, \
-+  { "hwtype?", system_fh_hwtype_query}, \
-+  { "hwtype", system_fh_hwtype},
-+
-+void system_fh_hwaddr_query (format_data_t form, int argc, char *argv[]);
-+void system_fh_hwaddr (format_data_t form, int argc, char *argv[]);
-+void system_fh_hwtype_query (format_data_t form, int argc, char *argv[]);
-+void system_fh_hwtype (format_data_t form, int argc, char *argv[]);
-+
-+#endif /* !IFCONFIG_SYSTEM_HURD_H */
--- 
-2.23.0.rc1.170.gbd704faa3e
-
-From 589dab9c7d3119da82837dabae34c8a3d16cbe49 Mon Sep 17 00:00:00 2001
-From: Mats Erik Andersson <gnu@gisladisker.se>
-Date: Thu, 30 Jul 2015 01:06:42 +0200
-Subject: [PATCH 07/35] ifconfig: Hardware detection in GNU/Hurd.
-
-A work-around needed to distinguish hardware type.
----
- ChangeLog              | 10 ++++++++++
- ifconfig/system/hurd.c | 19 ++++++++++++-------
- 2 files changed, 22 insertions(+), 7 deletions(-)
-
-diff --git a/ifconfig/system/hurd.c b/ifconfig/system/hurd.c
-index 3bd19775..b6261a00 100644
---- a/ifconfig/system/hurd.c
-+++ b/ifconfig/system/hurd.c
-@@ -175,6 +175,16 @@ print_hwaddr_ether (format_data_t form _GL_UNUSED_PARAMETER,
-   had_output = 1;
- }
- 
-+/* GNU/Hurd and Mach are using a mixture of BSD definitions
-+ * and GNU/Linux interface headers, which in this situation
-+ * means that sa_family_t is an unsigned char, from BSD, while
-+ * all ARPHRD_* come from GNU/Linux and are thus 16 bits wide.
-+ * We must account for this.  The following bitmask will
-+ * adapt to any future change!
-+ */
-+
-+#define _ARP_MASK ((sizeof (sa_family_t) == 1) ? 0xff : 0xffff)
-+
- struct arphrd_symbol
- {
-   const char *name;
-@@ -184,16 +194,11 @@ struct arphrd_symbol
- } arphrd_symbols[] =
-   {
- #ifdef ARPHRD_ETHER		/* Ethernet 10/100Mbps.  */
--    { "ETHER", "Ethernet", ARPHRD_ETHER, print_hwaddr_ether},
-+    { "ETHER", "Ethernet", ARPHRD_ETHER & _ARP_MASK, print_hwaddr_ether},
- #endif
- #ifdef ARPHRD_LOOPBACK		/* Loopback device.  */
--    { "LOOPBACK", "Local Loopback", ARPHRD_LOOPBACK, NULL},
-+    { "LOOPBACK", "Local Loopback", ARPHRD_LOOPBACK & _ARP_MASK, NULL},
- #endif
--    /* XXX: The image debian-hurd-20150424 returns the value 4
--	    instead of expected ARPHRD_LOOPBACK.  This has been
--	    discussed in the list debian-hurd, where I was asked
--	    to resist the temptation of a work around!
--     */
-     { NULL, NULL, 0, NULL}
-   };
- 
--- 
-2.23.0.rc1.170.gbd704faa3e
-
-From d379784b4461d17b2536effd1b52bae21cd28a32 Mon Sep 17 00:00:00 2001
-From: Guillem Jover <guillem@hadrons.org>
-Date: Fri, 16 Aug 2019 00:34:03 +0200
-Subject: [PATCH 35/35] telnet: Several ioctls have been disabled in the Hurd's
- glibc
-
-But not the related option macros. inetutils uses those macros to decide
-whether the ioctls are available, so it is FTBFS now. The Hurd's glibc
-is being fixed, but we'll use this for now to get the builds going.
----
- telnet/sys_bsd.c | 7 ++++++-
- 1 file changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/telnet/sys_bsd.c b/telnet/sys_bsd.c
-index 662536ab..5eb35cb5 100644
---- a/telnet/sys_bsd.c
-+++ b/telnet/sys_bsd.c
-@@ -63,6 +63,7 @@
- #include <errno.h>
- #include <arpa/telnet.h>
- #include <sys/select.h>
-+#include <sys/ioctl.h>
- #include <unused-parameter.h>
- 
- #include "ring.h"
-@@ -157,7 +158,7 @@ TerminalRead (char *buf, int n)
- int
- TerminalAutoFlush (void)
- {
--#if defined LNOFLSH
-+#if defined TIOCLGET && defined LNOFLSH
-   int flush;
- 
-   ioctl (0, TIOCLGET, (char *) &flush);
-@@ -260,7 +261,9 @@ TerminalSaveState (void)
-   ioctl (0, TIOCGETP, (char *) &ottyb);
-   ioctl (0, TIOCGETC, (char *) &otc);
-   ioctl (0, TIOCGLTC, (char *) &oltc);
-+#ifdef TIOCLGET
-   ioctl (0, TIOCLGET, (char *) &olmode);
-+#endif
- 
-   ntc = otc;
-   nltc = oltc;
-@@ -755,7 +758,9 @@ TerminalNewMode (register int f)
- #endif
-     }
- #ifndef USE_TERMIO
-+#ifdef TIOCLSET
-   ioctl (tin, TIOCLSET, (char *) &lmode);
-+#endif
-   ioctl (tin, TIOCSLTC, (char *) &ltc);
-   ioctl (tin, TIOCSETC, (char *) &tc);
-   ioctl (tin, TIOCSETN, (char *) &sb);
--- 
-2.23.0.rc1.170.gbd704faa3e
-
diff --git a/gnu/packages/patches/inkscape-1.1-fix-build-witch-gcc7.5.patch b/gnu/packages/patches/inkscape-1.1-fix-build-witch-gcc7.5.patch
deleted file mode 100644
index bd7b01f856..0000000000
--- a/gnu/packages/patches/inkscape-1.1-fix-build-witch-gcc7.5.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From 0ae15d7e89b984f72780ff7afa8e57dd6ae7765a Mon Sep 17 00:00:00 2001
-From: "Boris A. Dekshteyn" <boris.dekshteyn@gmail.com>
-Date: Mon, 14 Jun 2021 23:52:16 +1200
-Subject: [PATCH] Fix build witch GCC@7.5.
-
----
- src/object/sp-use-reference.h | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/object/sp-use-reference.h b/src/object/sp-use-reference.h
-index 5958632059..f07c2a3721 100644
---- a/src/object/sp-use-reference.h
-+++ b/src/object/sp-use-reference.h
-@@ -14,6 +14,7 @@
- 
- #include "sp-item.h"
- #include "uri-references.h"
-+#include "display/curve.h"
- 
- #include <memory>
- 
--- 
-2.32.0
-
diff --git a/gnu/packages/patches/jacal-fix-texinfo.patch b/gnu/packages/patches/jacal-fix-texinfo.patch
deleted file mode 100644
index 83e44a3164..0000000000
--- a/gnu/packages/patches/jacal-fix-texinfo.patch
+++ /dev/null
@@ -1,92 +0,0 @@
-Fix the broken Texinfo in the Jacal package documentation
-
---- jacal/jacal.texi,orig	2017-02-23 20:35:55.303980444 +0100
-+++ jacal/jacal.texi	2017-02-23 20:53:14.539024674 +0100
-@@ -343,7 +343,7 @@
- 
- With the standard input grammar, the precedence of @samp{-} as a prefix
- behaves strangely.  @code{a^-b*c} becomes @code{a^(-b*c)} while
--@code{@result{a^b*c} (a^b)*c}.
-+@code{a^b*c @result{} (a^b)*c}.
- 
- Using @code{divide} to divide a polynomial by an integer does not work.
- 
-@@ -675,8 +675,9 @@
- e1: ---------
-         a
- @end example
-+@end deffn
- 
--@deffnx Command suchthat var exp
-+@deffn Command suchthat var exp
- 
- If an expression rather than an equation is given to @code{suchthat}, it
- is as though the equation @code{@var{exp}=0} was given.
-@@ -688,8 +689,9 @@
- e2: ---------
-         a
- @end example
-+@end deffn
- 
--@deffnx Operator | var exp_or_eqn
-+@deffn Operator | var exp_or_eqn
- 
- An alternative infix notation is also available for @code{suchthat}.
- 
-@@ -857,8 +859,9 @@
- 
- Returns the degree of polynomial or equation @var{poly} in variable
- @var{var}.
-+@end deffn
- 
--@deffnx Operator degree poly
-+@deffn Operator degree poly
- 
- Returns the total-degree, the degree of its highest degree monomial,
- of polynomial or equation @var{poly}.
-@@ -1016,10 +1019,12 @@
- Returns @var{poly1} reduced with respect to @var{poly2} (or @var{eqn})
- and @var{var}.  If @var{poly2} is univariate, the third argument is not
- needed.
-+@end deffn
- 
--@deffnx Command mod poly1 n
-+@deffn Command mod poly1 n
- Returns @var{poly1} with all the coefficients taken modulo @var{n}.
--@deffnx Command mod poly1
-+@end deffn
-+@deffn Command mod poly1
- Returns @var{poly1} with all the coefficients taken modulo the
- current modulus.
- 
-@@ -1220,8 +1225,9 @@
- e1: -1 2  3 5
- @end group
- @end example
-+@end deffn
- 
--@deffnx Command factor polyratio
-+@deffn Command factor polyratio
- Given a univariate ratio of polynomials @var{polyratio}, returns a
- matrix of factors and exponents.
- 
-@@ -2028,7 +2034,7 @@
- formed from the pair-wise products of components of the inputs.  For
- example, for the input tensors @code{x[a,b]} and @code{y[c]}
- @example
--@result{z:tmult(x,y);} z[a,b,c] = x[a,b]*y[c]
-+z:tmult(x,y); @result{} z[a,b,c] = x[a,b]*y[c]
- @end example
- 
- With an additional argument, @code{tmult} will produce the inner product
-@@ -2464,8 +2470,9 @@
- If you do not wish to return to Jacal but really want to terminate the
- session and return to the operating system, then after typing
- @code{qed();}, type @code{(slib:exit)} or use @code{quit}.
-+@end deffn
- 
--@deffnx Command quit
-+@deffn Command quit
- Exit directly from Jacal to the operating system.  You will not be able
- to continue your Jacal session.
- 
diff --git a/gnu/packages/patches/jami-fix-crash-on-quit.patch b/gnu/packages/patches/jami-fix-crash-on-quit.patch
new file mode 100644
index 0000000000..c25bce588a
--- /dev/null
+++ b/gnu/packages/patches/jami-fix-crash-on-quit.patch
@@ -0,0 +1,34 @@
+Retrieved from:
+https://git.jami.net/savoirfairelinux/jami-client-qt/-/commit/83f68573324a453a6d26e025fd6439f175a79d1b.diff.
+
+With the 'client-qt' prefix added to match the file hierarchy of the release tarball.
+
+diff --git a/client-qt/src/mainapplication.cpp b/client-qt/src/mainapplication.cpp
+index 0c3209fc6fa7c528bec197f1cf9332758170441c..278f19287b86dd2c916935ab0930cbe0abb35d26 100644
+--- a/client-qt/src/mainapplication.cpp
++++ b/client-qt/src/mainapplication.cpp
+@@ -155,7 +155,11 @@ MainApplication::MainApplication(int& argc, char** argv)
+     QObject::connect(this, &QApplication::aboutToQuit, [this] { cleanup(); });
+ }
+ 
+-MainApplication::~MainApplication() {}
++MainApplication::~MainApplication()
++{
++    engine_.reset();
++    lrcInstance_.reset();
++}
+ 
+ bool
+ MainApplication::init()
+diff --git a/src/mainapplication.h b/src/mainapplication.h
+index 51306be829478b9fbc1c61a08aeb96938be26dac..4047e3abb3cfd3e6250387a37fa5a896e9bc4161 100644
+--- a/client-qt/src/mainapplication.h
++++ b/client-qt/src/mainapplication.h
+@@ -80,7 +80,6 @@ private:
+ private:
+     QScopedPointer<QFile> debugFile_;
+     QScopedPointer<QQmlApplicationEngine> engine_;
+-
+     QScopedPointer<LRCInstance> lrcInstance_;
+ 
+     QScopedPointer<ConnectivityMonitor> connectivityMonitor_;
diff --git a/gnu/packages/patches/jsoncpp-fix-inverted-case.patch b/gnu/packages/patches/jsoncpp-fix-inverted-case.patch
deleted file mode 100644
index e4897de1b8..0000000000
--- a/gnu/packages/patches/jsoncpp-fix-inverted-case.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-This patch fixes a bug and related test failure on platforms where 'char'
-is unsigned.
-
-Taken from upstream:
-https://github.com/open-source-parsers/jsoncpp/commit/f11611c8785082ead760494cba06196f14a06dcb
-
-diff --git a/src/lib_json/json_writer.cpp b/src/lib_json/json_writer.cpp
-index 8e06cca2..56195dc1 100644
---- a/src/lib_json/json_writer.cpp
-+++ b/src/lib_json/json_writer.cpp
-@@ -178,8 +178,9 @@ static bool isAnyCharRequiredQuoting(char const* s, size_t n) {
- 
-   char const* const end = s + n;
-   for (char const* cur = s; cur < end; ++cur) {
--    if (*cur == '\\' || *cur == '\"' || *cur < ' ' ||
--        static_cast<unsigned char>(*cur) < 0x80)
-+    if (*cur == '\\' || *cur == '\"' ||
-+        static_cast<unsigned char>(*cur) < ' ' ||
-+        static_cast<unsigned char>(*cur) >= 0x80)
-       return true;
-   }
-   return false;
diff --git a/gnu/packages/patches/jsoncpp-pkg-config-version.patch b/gnu/packages/patches/jsoncpp-pkg-config-version.patch
new file mode 100644
index 0000000000..3983cc300c
--- /dev/null
+++ b/gnu/packages/patches/jsoncpp-pkg-config-version.patch
@@ -0,0 +1,24 @@
+Taken from upstream: https://github.com/open-source-parsers/jsoncpp/issues/1235.
+
+From ac2870298ed5b5a96a688d9df07461b31f83e906 Mon Sep 17 00:00:00 2001
+From: Derick Vigne <derickvigne@me.com>
+Date: Tue, 26 Jan 2021 14:59:12 -0500
+Subject: [PATCH] Fixed pkg-config Version
+
+---
+ pkg-config/jsoncpp.pc.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/pkg-config/jsoncpp.pc.in b/pkg-config/jsoncpp.pc.in
+index 632a377f5..2a2221069 100644
+--- a/pkg-config/jsoncpp.pc.in
++++ b/pkg-config/jsoncpp.pc.in
+@@ -5,7 +5,7 @@ includedir=@includedir_for_pc_file@
+ 
+ Name: jsoncpp
+ Description: A C++ library for interacting with JSON
+-Version: @JSONCPP_VERSION@
++Version: @PROJECT_VERSION@
+ URL: https://github.com/open-source-parsers/jsoncpp
+ Libs: -L${libdir} -ljsoncpp
+ Cflags: -I${includedir}
diff --git a/gnu/packages/patches/julia-allow-parallel-build.patch b/gnu/packages/patches/julia-allow-parallel-build.patch
new file mode 100644
index 0000000000..cc1d42fee4
--- /dev/null
+++ b/gnu/packages/patches/julia-allow-parallel-build.patch
@@ -0,0 +1,32 @@
+Allow parallel tests with isolated environment.
+
+See https://github.com/JuliaLang/julia/issues/43205 and
+https://github.com/JuliaLang/julia/pull/43211.
+
+diff --git a/test/runtests.jl b/test/runtests.jl
+index 2f9cd058bb..150395e78c 100644
+--- a/test/runtests.jl
++++ b/test/runtests.jl
+@@ -4,7 +4,7 @@ using Test
+ using Distributed
+ using Dates
+ import REPL
+-using Printf: @sprintf
++using Printf: @sprintf, @printf
+ using Base: Experimental
+ 
+ include("choosetests.jl")
+@@ -83,11 +83,12 @@ prepend!(tests, linalg_tests)
+ import LinearAlgebra
+ cd(@__DIR__) do
+     n = 1
+-    if net_on
++    if net_on || haskey(ENV, "JULIA_CPU_THREADS")
+         n = min(Sys.CPU_THREADS, length(tests))
+         n > 1 && addprocs_with_testenv(n)
+         LinearAlgebra.BLAS.set_num_threads(1)
+     end
++    @printf("Number of threads: %i\n", n)
+     skipped = 0
+ 
+     @everywhere include("testdefs.jl")
diff --git a/gnu/packages/patches/lcms-CVE-2018-16435.patch b/gnu/packages/patches/lcms-CVE-2018-16435.patch
deleted file mode 100644
index 60228e73af..0000000000
--- a/gnu/packages/patches/lcms-CVE-2018-16435.patch
+++ /dev/null
@@ -1,171 +0,0 @@
-https://github.com/mm2/Little-CMS/commit/768f70ca405cd3159d990e962d54456773bb8cf8.patch
-
-From 768f70ca405cd3159d990e962d54456773bb8cf8 Mon Sep 17 00:00:00 2001
-From: Marti Maria <info@littlecms.com>
-Date: Wed, 15 Aug 2018 20:07:56 +0200
-Subject: [PATCH] Upgrade Visual studio 2017 15.8
-
-- Upgrade to 15.8
-- Add check on CGATS memory allocation (thanks to Quang Nguyen for
-pointing out this)
----
- Projects/VC2017/jpegicc/jpegicc.vcxproj           |  1 +
- Projects/VC2017/lcms2_DLL/lcms2_DLL.vcxproj       |  2 +-
- Projects/VC2017/lcms2_static/lcms2_static.vcxproj |  2 +-
- Projects/VC2017/linkicc/linkicc.vcxproj           |  2 +-
- Projects/VC2017/psicc/psicc.vcxproj               |  2 +-
- Projects/VC2017/testbed/testbed.vcxproj           |  2 +-
- Projects/VC2017/tiffdiff/tiffdiff.vcxproj         |  2 +-
- Projects/VC2017/tifficc/tifficc.vcxproj           |  2 +-
- Projects/VC2017/transicc/transicc.vcxproj         |  1 +
- src/cmscgats.c                                    | 14 ++++++++++----
- 10 files changed, 19 insertions(+), 11 deletions(-)
-
-diff --git a/Projects/VC2017/jpegicc/jpegicc.vcxproj b/Projects/VC2017/jpegicc/jpegicc.vcxproj
-index ab26a53..39cfd00 100644
---- a/Projects/VC2017/jpegicc/jpegicc.vcxproj
-+++ b/Projects/VC2017/jpegicc/jpegicc.vcxproj
-@@ -22,6 +22,7 @@
-     <ProjectGuid>{62812507-F926-4968-96A9-17678460AD90}</ProjectGuid>
-     <RootNamespace>jpegicc</RootNamespace>
-     <Keyword>Win32Proj</Keyword>
-+    <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
-   </PropertyGroup>
-   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-diff --git a/Projects/VC2017/lcms2_DLL/lcms2_DLL.vcxproj b/Projects/VC2017/lcms2_DLL/lcms2_DLL.vcxproj
-index 4c8aa3f..d1bf3eb 100644
---- a/Projects/VC2017/lcms2_DLL/lcms2_DLL.vcxproj
-+++ b/Projects/VC2017/lcms2_DLL/lcms2_DLL.vcxproj
-@@ -22,7 +22,7 @@
-     <ProjectGuid>{8C51BE48-ADB8-4089-A9EC-F6BF993A0548}</ProjectGuid>
-     <RootNamespace>lcms2_DLL</RootNamespace>
-     <Keyword>Win32Proj</Keyword>
--    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
-+    <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
-   </PropertyGroup>
-   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-diff --git a/Projects/VC2017/lcms2_static/lcms2_static.vcxproj b/Projects/VC2017/lcms2_static/lcms2_static.vcxproj
-index 2a9988a..9fc05ce 100644
---- a/Projects/VC2017/lcms2_static/lcms2_static.vcxproj
-+++ b/Projects/VC2017/lcms2_static/lcms2_static.vcxproj
-@@ -22,7 +22,7 @@
-     <ProjectGuid>{71DEDE59-3F1E-486B-A899-4283000F76B5}</ProjectGuid>
-     <RootNamespace>lcms2_static</RootNamespace>
-     <Keyword>Win32Proj</Keyword>
--    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
-+    <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
-   </PropertyGroup>
-   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-diff --git a/Projects/VC2017/linkicc/linkicc.vcxproj b/Projects/VC2017/linkicc/linkicc.vcxproj
-index 30c2b4e..51586dd 100644
---- a/Projects/VC2017/linkicc/linkicc.vcxproj
-+++ b/Projects/VC2017/linkicc/linkicc.vcxproj
-@@ -22,7 +22,7 @@
-     <ProjectGuid>{FBFBE1DC-DB84-4BA1-9552-B4780F457849}</ProjectGuid>
-     <RootNamespace>linkicc</RootNamespace>
-     <Keyword>Win32Proj</Keyword>
--    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
-+    <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
-   </PropertyGroup>
-   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-diff --git a/Projects/VC2017/psicc/psicc.vcxproj b/Projects/VC2017/psicc/psicc.vcxproj
-index 9dcf89a..8f26e12 100644
---- a/Projects/VC2017/psicc/psicc.vcxproj
-+++ b/Projects/VC2017/psicc/psicc.vcxproj
-@@ -22,7 +22,7 @@
-     <ProjectGuid>{EF6A8851-65FE-46F5-B9EF-14F0B671F693}</ProjectGuid>
-     <RootNamespace>psicc</RootNamespace>
-     <Keyword>Win32Proj</Keyword>
--    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
-+    <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
-   </PropertyGroup>
-   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-diff --git a/Projects/VC2017/testbed/testbed.vcxproj b/Projects/VC2017/testbed/testbed.vcxproj
-index 0af3762..3f6aea3 100644
---- a/Projects/VC2017/testbed/testbed.vcxproj
-+++ b/Projects/VC2017/testbed/testbed.vcxproj
-@@ -22,7 +22,7 @@
-     <ProjectGuid>{928A3A2B-46EF-4279-959C-513B3652FF0E}</ProjectGuid>
-     <RootNamespace>testbed</RootNamespace>
-     <Keyword>Win32Proj</Keyword>
--    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
-+    <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
-   </PropertyGroup>
-   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-diff --git a/Projects/VC2017/tiffdiff/tiffdiff.vcxproj b/Projects/VC2017/tiffdiff/tiffdiff.vcxproj
-index 7edfe28..3a6d837 100644
---- a/Projects/VC2017/tiffdiff/tiffdiff.vcxproj
-+++ b/Projects/VC2017/tiffdiff/tiffdiff.vcxproj
-@@ -22,7 +22,7 @@
-     <ProjectGuid>{75B91835-CCD7-48BE-A606-A9C997D5DBEE}</ProjectGuid>
-     <RootNamespace>tiffdiff</RootNamespace>
-     <Keyword>Win32Proj</Keyword>
--    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
-+    <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
-   </PropertyGroup>
-   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-diff --git a/Projects/VC2017/tifficc/tifficc.vcxproj b/Projects/VC2017/tifficc/tifficc.vcxproj
-index cd9f04c..5ef954f 100644
---- a/Projects/VC2017/tifficc/tifficc.vcxproj
-+++ b/Projects/VC2017/tifficc/tifficc.vcxproj
-@@ -22,7 +22,7 @@
-     <ProjectGuid>{2256DE16-ED92-4A6F-9C54-F65BB61E64A2}</ProjectGuid>
-     <RootNamespace>tifficc</RootNamespace>
-     <Keyword>Win32Proj</Keyword>
--    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
-+    <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
-   </PropertyGroup>
-   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-diff --git a/Projects/VC2017/transicc/transicc.vcxproj b/Projects/VC2017/transicc/transicc.vcxproj
-index d9b77c6..b3173d8 100644
---- a/Projects/VC2017/transicc/transicc.vcxproj
-+++ b/Projects/VC2017/transicc/transicc.vcxproj
-@@ -22,6 +22,7 @@
-     <ProjectGuid>{9EE22D66-C849-474C-9ED5-C3E141DAB160}</ProjectGuid>
-     <RootNamespace>transicc</RootNamespace>
-     <Keyword>Win32Proj</Keyword>
-+    <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
-   </PropertyGroup>
-   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-diff --git a/src/cmscgats.c b/src/cmscgats.c
-index 1a87613..8c3e96d 100644
---- a/src/cmscgats.c
-+++ b/src/cmscgats.c
-@@ -1,7 +1,7 @@
- //---------------------------------------------------------------------------------
- //
- //  Little Color Management System
--//  Copyright (c) 1998-2017 Marti Maria Saguer
-+//  Copyright (c) 1998-2018 Marti Maria Saguer
- //
- // Permission is hereby granted, free of charge, to any person obtaining
- // a copy of this software and associated documentation files (the "Software"),
-@@ -1506,10 +1506,16 @@ void AllocateDataSet(cmsIT8* it8)
-     t-> nSamples   = atoi(cmsIT8GetProperty(it8, "NUMBER_OF_FIELDS"));
-     t-> nPatches   = atoi(cmsIT8GetProperty(it8, "NUMBER_OF_SETS"));
- 
--    t-> Data = (char**)AllocChunk (it8, ((cmsUInt32Number) t->nSamples + 1) * ((cmsUInt32Number) t->nPatches + 1) *sizeof (char*));
--    if (t->Data == NULL) {
-+    if (t -> nSamples < 0 || t->nSamples > 0x7ffe || t->nPatches < 0 || t->nPatches > 0x7ffe)
-+    {
-+        SynError(it8, "AllocateDataSet: too much data");
-+    }
-+    else {
-+        t->Data = (char**)AllocChunk(it8, ((cmsUInt32Number)t->nSamples + 1) * ((cmsUInt32Number)t->nPatches + 1) * sizeof(char*));
-+        if (t->Data == NULL) {
- 
--        SynError(it8, "AllocateDataSet: Unable to allocate data array");
-+            SynError(it8, "AllocateDataSet: Unable to allocate data array");
-+        }
-     }
- 
- }
diff --git a/gnu/packages/patches/ldc-bootstrap-disable-tests.patch b/gnu/packages/patches/ldc-bootstrap-disable-tests.patch
deleted file mode 100644
index d2e40b8016..0000000000
--- a/gnu/packages/patches/ldc-bootstrap-disable-tests.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-This patch fixes a failing unit test by feeding buildNormalizedPath to the
-tzdata properly.  Three other tests are disabled, one assumes /root and the
-two others use networking.  Not bad out of almost 700 tests!
-
-by Pjotr Prins <pjotr.guix@thebird.nl>
-
---- a/std/datetime.d.orig      2016-11-24 01:13:52.584495545 +0100
-+++ b/std/datetime.d   2016-11-24 01:17:09.655306728 +0100
-@@ -28081,22 +28081,24 @@
-         import std.range : retro;
-         import std.format : format;
-
--        name = strip(name);
--
-         enforce(tzDatabaseDir.exists(), new DateTimeException(format("Directory %s does not exist.", tzDatabaseDir)));
-         enforce(tzDatabaseDir.isDir, new DateTimeException(format("%s is not a directory.", tzDatabaseDir)));
-
-         version(Android)
-         {
-+            name = strip(name);
-             auto tzfileOffset = name in tzdataIndex(tzDatabaseDir);
-             enforce(tzfileOffset, new DateTimeException(format("The time zone %s is not listed.", name)));
-             string tzFilename = separate_index ? "zoneinfo.dat" : "tzdata";
-             immutable file = buildNormalizedPath(tzDatabaseDir, tzFilename);
-         }
-         else
--            immutable file = buildNormalizedPath(tzDatabaseDir, name);
-+        {
-+            auto filename = "./" ~ strip(name); // make sure the prefix is not stripped
-+            immutable file = buildNormalizedPath(tzDatabaseDir, filename);
-+        }
-
--        enforce(file.exists(), new DateTimeException(format("File %s does not exist.", file)));
-+        enforce(file.exists(), new DateTimeException(format("File %s does not exist in %s.", file, tzDatabaseDir)));
-         enforce(file.isFile, new DateTimeException(format("%s is not a file.", file)));
-
-         auto tzFile = File(file);
-diff --git a/std/path.d b/std/path.d
-index 254d8f0..b0fc04d 100644
---- a/std/path.d
-+++ b/std/path.d
-@@ -3080,8 +3080,11 @@ unittest
-         }
-         else
-         {
-+            pragma(msg, "test disabled on GNU Guix");
-+/*
-             assert(expandTilde("~root") == "/root", expandTilde("~root"));
-             assert(expandTilde("~root/") == "/root/", expandTilde("~root/"));
-+*/
-         }
-         assert(expandTilde("~Idontexist/hey") == "~Idontexist/hey");
-     }
-diff --git a/std/socket.d b/std/socket.d
-index b85d1c9..7fbf346 100644
---- a/std/socket.d
-+++ b/std/socket.d
-@@ -859,6 +862,8 @@ class InternetHost
-
- unittest
- {
-+    pragma(msg, "test disabled on GNU Guix");
-+    /*
-     InternetHost ih = new InternetHost;
-
-     ih.getHostByAddr(0x7F_00_00_01);
-@@ -889,6 +894,7 @@ unittest
-         //      writefln("aliases[%d] = %s", i, s);
-         // }
-     });
-+    */
- }
diff --git a/gnu/packages/patches/ldc-disable-phobos-tests.patch b/gnu/packages/patches/ldc-disable-phobos-tests.patch
deleted file mode 100644
index f8a9743d59..0000000000
--- a/gnu/packages/patches/ldc-disable-phobos-tests.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff --git a/std/socket.d b/std/socket.d
-index 111cd17..6d23da9 100644
---- a/std/socket.d
-+++ b/std/socket.d
-@@ -448,7 +448,7 @@ class Protocol
- // Skip this test on Android because getprotobyname/number are
- // unimplemented in bionic.
- version(CRuntime_Bionic) {} else
--@safe unittest
-+@safe version(hasNetwork) unittest
- {
-     // import std.stdio : writefln;
-     softUnittest({
-@@ -770,7 +770,7 @@ class InternetHost
- }
- 
- ///
--@safe unittest
-+@safe version(hasNetwork) unittest
- {
-     InternetHost ih = new InternetHost;
- 
diff --git a/gnu/packages/patches/libblockdev-glib-compat.patch b/gnu/packages/patches/libblockdev-glib-compat.patch
deleted file mode 100644
index bb25d5d963..0000000000
--- a/gnu/packages/patches/libblockdev-glib-compat.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-Don't use g_memdup() which is removed in newer versions of GLib.
-
-See <https://github.com/storaged-project/libblockdev/pull/623>.
-
-Taken from upstream:
-https://github.com/storaged-project/libblockdev/commit/5528baef6ccc835a06c45f9db34a2c9c3f2dd940
-
-diff --git a/src/lib/plugin_apis/vdo.api b/src/lib/plugin_apis/vdo.api
---- a/src/lib/plugin_apis/vdo.api
-+++ b/src/lib/plugin_apis/vdo.api
-@@ -170,7 +170,22 @@ void bd_vdo_stats_free (BDVDOStats *stats) {
-  * Deprecated: 2.24: Use LVM-VDO integration instead.
-  */
- BDVDOStats* bd_vdo_stats_copy (BDVDOStats *stats) {
--    return g_memdup (stats, sizeof (BDVDOStats));
-+    if (stats == NULL)
-+        return NULL;
-+
-+    BDVDOStats *new_stats = g_new0 (BDVDOStats, 1);
-+
-+    new_stats->block_size = stats->block_size;
-+    new_stats->logical_block_size = stats->logical_block_size;
-+    new_stats->physical_blocks = stats->physical_blocks;
-+    new_stats->data_blocks_used = stats->data_blocks_used;
-+    new_stats->overhead_blocks_used = stats->overhead_blocks_used;
-+    new_stats->logical_blocks_used = stats->logical_blocks_used;
-+    new_stats->used_percent = stats->used_percent;
-+    new_stats->saving_percent = stats->saving_percent;
-+    new_stats->write_amplification_ratio = stats->write_amplification_ratio;
-+
-+    return new_stats;
- }
- 
- GType bd_vdo_stats_get_type () {
-diff --git a/src/plugins/vdo.c b/src/plugins/vdo.c
---- a/src/plugins/vdo.c
-+++ b/src/plugins/vdo.c
-@@ -81,7 +81,22 @@ void bd_vdo_stats_free (BDVDOStats *stats) {
- }
- 
- BDVDOStats* bd_vdo_stats_copy (BDVDOStats *stats) {
--    return g_memdup (stats, sizeof (BDVDOStats));
-+    if (stats == NULL)
-+        return NULL;
-+
-+    BDVDOStats *new_stats = g_new0 (BDVDOStats, 1);
-+
-+    new_stats->block_size = stats->block_size;
-+    new_stats->logical_block_size = stats->logical_block_size;
-+    new_stats->physical_blocks = stats->physical_blocks;
-+    new_stats->data_blocks_used = stats->data_blocks_used;
-+    new_stats->overhead_blocks_used = stats->overhead_blocks_used;
-+    new_stats->logical_blocks_used = stats->logical_blocks_used;
-+    new_stats->used_percent = stats->used_percent;
-+    new_stats->saving_percent = stats->saving_percent;
-+    new_stats->write_amplification_ratio = stats->write_amplification_ratio;
-+
-+    return new_stats;
- }
- 
- 
diff --git a/gnu/packages/patches/libcacard-unknown-variable.patch b/gnu/packages/patches/libcacard-unknown-variable.patch
deleted file mode 100644
index 830a3ee8c0..0000000000
--- a/gnu/packages/patches/libcacard-unknown-variable.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-Fix Meson error when test dependencies are missing.
-
-Based on this upstream commit, with some adjustments to apply on 2.8.0:
-https://gitlab.freedesktop.org/spice/libcacard/-/commit/cf6121deb47e437aa566cfeb29a03da93c432394
-
-diff --git a/tests/meson.build b/tests/meson.build
-index 87945a2..baefaf5 100644
---- a/tests/meson.build
-+++ b/tests/meson.build
-@@ -9,15 +9,6 @@ modutil_dep = find_program('modutil', required: false)
- openssl_dep = find_program('openssl', required: false)
- softhsm_util_dep = find_program('softhsm2-util', required: false)
- 
--if pkcs11_tool_dep.found() and p11tool_dep.found() and modutil_dep.found() and openssl_dep.found() and softhsm_util_dep.found()
--  softhsm = custom_target(
--    'softhsm2.conf',
--    command: find_program('setup-softhsm2.sh'),
--    capture: true,
--    output: 'setup-softhsm2.log',
--  )
--endif
--
- libcacard_test = executable(
-   'libcacard',
-   ['libcacard.c', 'common.c'],
-@@ -64,9 +55,18 @@ hwtests_test = executable(
-   dependencies: [libcacard_dep],
- )
- 
--test(
--  'hwtests',
--  hwtests_test,
--  depends: [softhsm],
--  env: env,
--)
-+if pkcs11_tool_dep.found() and p11tool_dep.found() and modutil_dep.found() and openssl_dep.found() and softhsm_util_dep.found()
-+  softhsm = custom_target(
-+    'softhsm2.conf',
-+    command: find_program('setup-softhsm2.sh'),
-+    capture: true,
-+    output: 'setup-softhsm2.log',
-+  )
-+
-+  test(
-+    'hwtests',
-+    hwtests_test,
-+    depends: [softhsm],
-+    env: env,
-+  )
-+endif
diff --git a/gnu/packages/patches/libmicrohttpd-0.9.73-test-ssl3.patch b/gnu/packages/patches/libmicrohttpd-0.9.73-test-ssl3.patch
new file mode 100644
index 0000000000..e8d5dce0ed
--- /dev/null
+++ b/gnu/packages/patches/libmicrohttpd-0.9.73-test-ssl3.patch
@@ -0,0 +1,35 @@
+ Disable usage of SSLv3 in testing
+
+ Integrated uptream version 0.9.74
+
+
+diff --git a/src/testcurl/https/test_tls_options.c b/src/testcurl/https/test_tls_options.c
+
+--- a/src/testcurl/https/test_tls_options.c
++++ b/src/testcurl/https/test_tls_options.c
+@@ -119,11 +119,6 @@ main (int argc, char *const *argv)
+     fprintf (stderr, "Curl does not support SSL.  Cannot run the test.\n");
+     return 77;
+   }
+-  if (0 != strncmp (ssl_version, "GnuTLS", 6))
+-  {
+-    fprintf (stderr, "This test can be run only with libcurl-gnutls.\n");
+-    return 77;
+-  }
+ 
+   if (! testsuite_curl_global_init ())
+     return 99;
+@@ -152,10 +147,10 @@ main (int argc, char *const *argv)
+   fprintf (stderr,
+            "The following handshake should fail (and print an error message)...\n");
+   if (0 !=
+-      test_wrap ("TLS1.0 vs SSL3",
++      test_wrap ("TLS1.1 vs TLS1.0",
+                  &test_unmatching_ssl_version, NULL, port, daemon_flags,
+                  aes256_sha,
+-                 CURL_SSLVERSION_SSLv3,
++                 CURL_SSLVERSION_TLSv1_1,
+                  MHD_OPTION_HTTPS_MEM_KEY, srv_key_pem,
+                  MHD_OPTION_HTTPS_MEM_CERT, srv_self_signed_cert_pem,
+                  MHD_OPTION_HTTPS_PRIORITIES,
+
diff --git a/gnu/packages/patches/librime-fix-build-with-gcc10.patch b/gnu/packages/patches/librime-fix-build-with-gcc10.patch
new file mode 100644
index 0000000000..49ad011b57
--- /dev/null
+++ b/gnu/packages/patches/librime-fix-build-with-gcc10.patch
@@ -0,0 +1,41 @@
+From: Felix Gruber <felgru@posteo.net>
+Date: Mon, 6 Sep 2021 19:38:17 +0200
+Subject: [PATCH] Add missing <cmath> includes
+
+Fix a build failure with GCC 10 that manifests like this:
+
+------
+/tmp/guix-build-librime-1.7.3.drv-0/source/src/rime/gear/script_translator.cc: In member function ‘void rime::ScriptTranslation::PrepareCandidate()’:
+/tmp/guix-build-librime-1.7.3.drv-0/source/src/rime/gear/script_translator.cc:490:23: error: ‘exp’ was not declared in this scope
+  490 |     cand->set_quality(exp(entry->weight) +
+      |                       ^~~
+/tmp/guix-build-librime-1.7.3.drv-0/source/src/rime/gear/script_translator.cc:504:23: error: ‘exp’ was not declared in this scope
+  504 |     cand->set_quality(exp(entry->weight) +
+      |                       ^~~
+make[2]: *** [src/CMakeFiles/rime.dir/build.make:1241: src/CMakeFiles/rime.dir/rime/gear/script_translator.cc.o] Error 1
+------
+
+diff --git a/src/rime/gear/script_translator.cc b/src/rime/gear/script_translator.cc
+index 4a45f05..515c8db 100644
+--- a/src/rime/gear/script_translator.cc
++++ b/src/rime/gear/script_translator.cc
+@@ -7,6 +7,7 @@
+ // 2011-07-10 GONG Chen <chen.sst@gmail.com>
+ //
+ #include <algorithm>
++#include <cmath>
+ #include <stack>
+ #include <boost/algorithm/string/join.hpp>
+ #include <boost/range/adaptor/reversed.hpp>
+diff --git a/src/rime/gear/table_translator.cc b/src/rime/gear/table_translator.cc
+index 162ac02..dbea76a 100644
+--- a/src/rime/gear/table_translator.cc
++++ b/src/rime/gear/table_translator.cc
+@@ -4,6 +4,7 @@
+ //
+ // 2011-07-10 GONG Chen <chen.sst@gmail.com>
+ //
++#include <cmath>
+ #include <boost/algorithm/string.hpp>
+ #include <boost/range/adaptor/reversed.hpp>
+ #include <utf8.h>
diff --git a/gnu/packages/patches/libsequoia-fix-ffi-Makefile.patch b/gnu/packages/patches/libsequoia-fix-ffi-Makefile.patch
new file mode 100644
index 0000000000..21f5a1e4df
--- /dev/null
+++ b/gnu/packages/patches/libsequoia-fix-ffi-Makefile.patch
@@ -0,0 +1,32 @@
+From ed641d2048d131e077f54043764741b7e7b7fe03 Mon Sep 17 00:00:00 2001
+From: Hartmut Goebel <hartmut.goebel@pep.security>
+Date: Tue, 7 Dec 2021 16:42:43 +0100
+Subject: [PATCH] ffi: Update Makefile, remove rule remaining from store
+ removal.
+
+---
+ ffi/Makefile | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/ffi/Makefile b/ffi/Makefile
+index a5540db3..07328589 100644
+--- a/ffi/Makefile
++++ b/ffi/Makefile
+@@ -62,7 +62,6 @@ build-release:
+ 	    $(CARGO) build $(CARGO_FLAGS) --release --package sequoia-ffi
+ 	$(MAKE) -Clang/python build-release
+ 	$(call sequoia_pc,$(CARGO_TARGET_DIR)/release,true)
+-	$(MAKE) -C../store build-release
+ 
+ .PHONY: install
+ install: build-release
+@@ -82,7 +82,6 @@ install: build-release
+ 		$(DESTDIR)$(PREFIX)/lib/libsequoia_ffi.$(_SEQ_LIB_EXT)
+ 	$(INSTALL) $(CARGO_TARGET_DIR)/release/libsequoia_ffi.a \
+ 		$(DESTDIR)$(PREFIX)/lib/libsequoia_ffi.a
+-	$(MAKE) -C../store install
+ 	# Now the bindings.
+ 	$(MAKE) -Clang/python install
+ 
+-- 
+
diff --git a/gnu/packages/patches/libsequoia-remove-store.patch b/gnu/packages/patches/libsequoia-remove-store.patch
new file mode 100644
index 0000000000..e7e1a91ee3
--- /dev/null
+++ b/gnu/packages/patches/libsequoia-remove-store.patch
@@ -0,0 +1,432 @@
+Shortend version of
+From 351ad5e5e2dd67f427b7eb2e4d5d0b35d90ffaf7 Mon Sep 17 00:00:00 2001
+From: Justus Winter <justus@sequoia-pgp.org>
+Date: Wed, 24 Nov 2021 15:09:34 +0100
+Subject: [PATCH] store: Drop crate.
+
+  - The store has never been really used, and never reached a maturity
+    where it was useful.  And, we're on the verge of replacing it with
+    the Shared PGP Certificate Directory.
+---
+ Cargo.toml                               |    1 -
+ ffi/Cargo.toml                           |    4 +-
+ ffi/include/sequoia.h                    |    1 -
+ ffi/include/sequoia/store.h              |  409 ------
+ ffi/lang/python/sequoia/__init__.py      |    1 -
+ ffi/lang/python/sequoia/prelude.py       |    1 -
+ ffi/lang/python/sequoia/sequoia_build.py |    3 +-
+ ffi/lang/python/sequoia/store.py         |  246 ----
+ ffi/lang/python/tests/test_store.py      |   47 -
+ ffi/src/lib.rs                           |    2 -
+ ffi/src/store.rs                         |  659 ----------
+ 25 files changed, 3 insertions(+), 5064 deletions(-)
+ delete mode 100644 ffi/include/sequoia/store.h
+ delete mode 100644 ffi/lang/python/sequoia/store.py
+ delete mode 100644 ffi/lang/python/tests/test_store.py
+ delete mode 100644 ffi/src/store.rs
+
+diff --git a/Cargo.toml b/Cargo.toml
+index a4f48520..a573ddbf 100644
+--- a/Cargo.toml
++++ b/Cargo.toml
+@@ -10,7 +10,6 @@ members = [
+     "openpgp",
+     "openpgp-ffi",
+     "sq",
+-    "store",
+ ]
+ 
+ [profile.release]
+diff --git a/ffi/Cargo.toml b/ffi/Cargo.toml
+index 53ddaf68..2ec84e6e 100644
+--- a/ffi/Cargo.toml
++++ b/ffi/Cargo.toml
+@@ -24,7 +24,6 @@ maintenance = { status = "actively-developed" }
+ [dependencies]
+ sequoia-ffi-macros = { path = "../ffi-macros", version = "0.22" }
+ sequoia-openpgp = { path = "../openpgp", version = "1.0.0", default-features = false }
+-sequoia-store = { path = "../store", version = "0.22", default-features = false }
+ sequoia-net = { path = "../net", version = "0.23", default-features = false }
+ sequoia-ipc = { path = "../ipc", version = "0.26", default-features = false }
+ anyhow = "1.0.18"
+@@ -42,10 +41,9 @@ crate-type = ["cdylib", "staticlib"]
+ bench = false
+ 
+ [features]
+-default = ["sequoia-openpgp/default", "sequoia-store/default"]
++default = ["sequoia-openpgp/default"]
+ crypto-nettle = ["sequoia-openpgp/crypto-nettle"]
+ crypto-cng = ["sequoia-openpgp/crypto-cng"]
+ compression = ["sequoia-openpgp/compression"]
+ compression-deflate = ["sequoia-openpgp/compression-deflate"]
+ compression-bzip2 = ["sequoia-openpgp/compression-bzip2"]
+-background-services = ["sequoia-store/background-services"]
+diff --git a/ffi/include/sequoia.h b/ffi/include/sequoia.h
+index 8c62ba8f..c32a2f3e 100644
+--- a/ffi/include/sequoia.h
++++ b/ffi/include/sequoia.h
+@@ -5,6 +5,5 @@
+ #include <sequoia/core.h>
+ #include <sequoia/openpgp.h>
+ #include <sequoia/net.h>
+-#include <sequoia/store.h>
+ 
+ #endif
+diff --git a/ffi/lang/python/sequoia/__init__.py b/ffi/lang/python/sequoia/__init__.py
+index 4f84346e..fc170e20 100644
+--- a/ffi/lang/python/sequoia/__init__.py
++++ b/ffi/lang/python/sequoia/__init__.py
+@@ -4,5 +4,4 @@ from . import (
+     openpgp,
+     core,
+     net,
+-    store,
+ )
+diff --git a/ffi/lang/python/sequoia/prelude.py b/ffi/lang/python/sequoia/prelude.py
+index 42b0156a..61efbab0 100644
+--- a/ffi/lang/python/sequoia/prelude.py
++++ b/ffi/lang/python/sequoia/prelude.py
+@@ -3,4 +3,3 @@ from .error import *
+ from .openpgp import *
+ from .core import *
+ from .net import *
+-from .store import *
+diff --git a/ffi/lang/python/sequoia/sequoia_build.py b/ffi/lang/python/sequoia/sequoia_build.py
+index a3ce2786..058f1380 100644
+--- a/ffi/lang/python/sequoia/sequoia_build.py
++++ b/ffi/lang/python/sequoia/sequoia_build.py
+@@ -14,8 +14,7 @@ defs = "".join(l
+                               open(join(pgp_inc, "openpgp/serialize.h")).readlines(),
+                               open(join(pgp_inc, "openpgp.h")).readlines(),
+                               open(join(sq_inc, "core.h")).readlines(),
+-                              open(join(sq_inc, "net.h")).readlines(),
+-                              open(join(sq_inc, "store.h")).readlines())
++                              open(join(sq_inc, "net.h")).readlines())
+                if not l.startswith('#'))
+ 
+ defs = defs.replace("INT_MAX", "{}".format(1<<31))
+diff --git a/ffi/lang/python/sequoia/store.py b/ffi/lang/python/sequoia/store.py
+deleted file mode 100644
+index 57d1b18f..00000000
+--- a/ffi/lang/python/sequoia/store.py
++++ /dev/null
+@@ -1,246 +0,0 @@
+-from _sequoia import ffi, lib
+-
+-from .error import Error
+-from .glue import _str, _static_str, SQObject, sq_iterator, sq_time
+-from .net import NetworkPolicy
+-from .openpgp import Fingerprint, Cert
+-
+-class Store(object):
+-    @classmethod
+-    def log(cls, ctx):
+-        yield from sq_iterator(
+-            ffi.gc(
+-                lib.sq_store_server_log(ctx.ref()),
+-                lib.sq_log_iter_free),
+-            lib.sq_log_iter_next,
+-            lambda x: Log(x, context=ctx))
+-
+-    @classmethod
+-    def list_keys(cls, ctx):
+-        def next_fn(i):
+-            fpp = ffi.new("pgp_fingerprint_t[1]")
+-            key = lib.sq_key_iter_next(i, fpp)
+-            if key == ffi.NULL:
+-                return ffi.NULL
+-            else:
+-                return (Fingerprint(fpp[0], ctx),
+-                        Key(key, ctx))
+-
+-        yield from sq_iterator(
+-            ffi.gc(
+-                lib.sq_store_list_keys(ctx.ref()),
+-                lib.sq_key_iter_free),
+-            next_fn)
+-
+-class Mapping(SQObject):
+-    _del = lib.sq_mapping_free
+-
+-    # Keys used for communications.
+-    REALM_CONTACTS = _static_str(lib.SQ_REALM_CONTACTS)
+-
+-    # Keys used for signing software updates.
+-    REALM_SOFTWARE_UPDATES = _static_str(lib.SQ_REALM_SOFTWARE_UPDATES)
+-
+-    @classmethod
+-    def open(cls, ctx, network_policy=NetworkPolicy.Encrypted, realm=REALM_CONTACTS, name="default"):
+-        return Mapping(lib.sq_mapping_open(ctx.ref(), network_policy.value,
+-                                        realm.encode(), name.encode()),
+-                        context=ctx)
+-
+-
+-    def add(self, label, fingerprint):
+-        return Binding(lib.sq_mapping_add(self.context().ref(), self.ref(),
+-                                        label.encode(), fingerprint.ref()),
+-                       context=self.context())
+-
+-    def import_(self, label, cert):
+-        return Cert(lib.sq_mapping_import(self.context().ref(), self.ref(),
+-                                       label.encode(), cert.ref()),
+-                   context=self.context())
+-
+-    def lookup(self, label):
+-        return Binding(lib.sq_mapping_lookup(self.context().ref(), self.ref(),
+-                                           label.encode()),
+-                       self.context())
+-
+-    def delete(self):
+-        if lib.sq_mapping_delete(self.ref()):
+-            raise Error._last(self.context())
+-        super(Mapping, self)._delete(skip_free=True)
+-
+-    def iter(self):
+-        def next_fn(i):
+-            labelp = ffi.new("char *[1]")
+-            fpp = ffi.new("pgp_fingerprint_t[1]")
+-            binding = lib.sq_binding_iter_next(i, labelp, fpp)
+-            if binding == ffi.NULL:
+-                return ffi.NULL
+-            else:
+-                return (_str(labelp[0]),
+-                        Fingerprint(fpp[0], self.context()),
+-                        Binding(binding, self.context()))
+-
+-        yield from sq_iterator(
+-            ffi.gc(
+-                lib.sq_mapping_iter(self.context().ref(), self.ref()),
+-                lib.sq_binding_iter_free),
+-            next_fn)
+-
+-    def log(self):
+-        yield from sq_iterator(
+-            ffi.gc(
+-                lib.sq_mapping_log(self.context().ref(), self.ref()),
+-                lib.sq_log_iter_free),
+-            lib.sq_log_iter_next,
+-            lambda x: Log(x, context=self.context()))
+-
+-class Binding(SQObject):
+-    _del = lib.sq_binding_free
+-
+-    def stats(self):
+-        return Stats(lib.sq_binding_stats(self.context().ref(), self.ref()),
+-                     self.context())
+-
+-    def key(self):
+-        return Key(lib.sq_binding_key(self.context().ref(), self.ref()),
+-                   self.context())
+-
+-    def cert(self):
+-        return Cert(lib.sq_binding_cert(self.context().ref(), self.ref()),
+-                   self.context())
+-
+-    def import_(self, cert):
+-        return Cert(lib.sq_binding_import(self.context().ref(), self.ref(), cert),
+-                   self.context())
+-
+-    def rotate(self, cert):
+-        return Cert(lib.sq_binding_rotate(self.context().ref(), self.ref(), cert),
+-                   self.context())
+-
+-    def delete(self):
+-        if lib.sq_binding_delete(self.ref()):
+-            raise Error._last(self.context())
+-        super(Binding, self)._delete(skip_free=True)
+-
+-    def log(self):
+-        yield from sq_iterator(
+-            ffi.gc(
+-                lib.sq_binding_log(self.context().ref(), self.ref()),
+-                lib.sq_log_iter_free),
+-            lib.sq_log_iter_next,
+-            lambda x: Log(x, context=self.context()))
+-
+-class Key(SQObject):
+-    _del = lib.sq_key_free
+-
+-    def stats(self):
+-        return Stats(lib.sq_key_stats(self.context().ref(), self.ref()),
+-                     self.context())
+-
+-    def cert(self):
+-        return Cert(lib.sq_key_cert(self.context().ref(), self.ref()),
+-                   self.context())
+-
+-    def import_(self, cert):
+-        return Cert(lib.sq_key_import(self.context().ref(), self.ref(), cert),
+-                   self.context())
+-
+-    def log(self):
+-        yield from sq_iterator(
+-            ffi.gc(
+-                lib.sq_key_log(self.context().ref(), self.ref()),
+-                lib.sq_log_iter_free),
+-            lib.sq_log_iter_next)
+-
+-
+-class Stats(SQObject):
+-    _del = lib.sq_stats_free
+-    def __init__(self, o, context=None):
+-        super(Stats, self).__init__(o, context=context)
+-        self.encryption = Stamps(ffi.addressof(o, "encryption"))
+-        self.verification = Stamps(ffi.addressof(o, "verification"))
+-
+-    @property
+-    def created(self):
+-        return sq_time(self.ref().created)
+-
+-    @property
+-    def updated(self):
+-        return sq_time(self.ref().updated)
+-
+-    def __str__(self):
+-        return \
+-            "Stats{{created={}, updated={}, encryption={}, verification={}}}" \
+-            .format(self.created, self.updated, self.encryption,
+-                    self.verification)
+-
+-class Stamps(SQObject):
+-    @property
+-    def count(self):
+-        return self.ref().count
+-
+-    @property
+-    def first(self):
+-        return sq_time(self.ref().first)
+-
+-    @property
+-    def last(self):
+-        return sq_time(self.ref().last)
+-
+-    def __str__(self):
+-        return "Stamps{{count={}, first={}, last={}}}".format(
+-            self.count, self.first, self.last)
+-
+-class Log(SQObject):
+-    _del = lib.sq_log_free
+-
+-    @property
+-    def timestamp(self):
+-        return sq_time(self.ref().timestamp)
+-
+-    @property
+-    def store(self):
+-        if self.ref().store == ffi.NULL:
+-            return None
+-        else:
+-            return Store(self.ref().store, context=self.context(),
+-                         owner=self)
+-
+-    @property
+-    def binding(self):
+-        if self.ref().binding == ffi.NULL:
+-            return None
+-        else:
+-            return Binding(self.ref().binding, context=self.context(),
+-                           owner=self)
+-
+-    @property
+-    def key(self):
+-        if self.ref().key == ffi.NULL:
+-            return None
+-        else:
+-            return Key(self.ref().key, context=self.context(),
+-                       owner=self)
+-
+-    @property
+-    def slug(self):
+-        return ffi.string(self.ref().slug).decode()
+-
+-    @property
+-    def status(self):
+-        return ffi.string(self.ref().status).decode()
+-
+-    @property
+-    def error(self):
+-        if self.ref().error == ffi.NULL:
+-            return None
+-        else:
+-            return ffi.string(self.ref().error).decode()
+-
+-    def __str__(self):
+-        if self.error:
+-            return "{}: {}: {}: {}".format(
+-                self.timestamp, self.slug, self.status, self.error)
+-        else:
+-            return "{}: {}: {}".format(
+-                self.timestamp, self.slug, self.status)
+diff --git a/ffi/lang/python/tests/test_store.py b/ffi/lang/python/tests/test_store.py
+deleted file mode 100644
+index 7b06cc1a..00000000
+--- a/ffi/lang/python/tests/test_store.py
++++ /dev/null
+@@ -1,47 +0,0 @@
+-from sequoia.prelude import Context, Store, Mapping, Fingerprint
+-
+-def test_open():
+-    c = Context(ephemeral=True)
+-    Mapping.open(c)
+-
+-def test_add():
+-    c = Context(ephemeral=True)
+-    s = Mapping.open(c)
+-    fp = Fingerprint.from_hex("7DCA58B54EB143169DDEE15F247F6DABC84914FE")
+-    s.add("Ἀριστοτέλης", fp)
+-
+-def test_iterate():
+-    c = Context(ephemeral=True)
+-    s = Mapping.open(c)
+-    fp = Fingerprint.from_hex("7DCA58B54EB143169DDEE15F247F6DABC84914FE")
+-    s.add("Ἀριστοτέλης", fp)
+-    l = list(s.iter())
+-    assert len(l) == 1
+-    l = list(Store.list_keys(c))
+-    assert len(l) == 1
+-    fpi, key = l[0]
+-    assert fpi == fp
+-
+-def test_logs():
+-    c = Context(ephemeral=True)
+-    s = Mapping.open(c)
+-    fp = Fingerprint.from_hex("7DCA58B54EB143169DDEE15F247F6DABC84914FE")
+-    b = s.add("Ἀριστοτέλης", fp)
+-    l = list(s.iter())
+-    assert len(l) == 1
+-
+-    # global logs
+-    logs = list(Store.log(c))
+-    assert len(logs) > 0
+-
+-    # per store logs
+-    logs = list(s.log())
+-    assert len(logs) > 0
+-
+-    # per binding logs
+-    logs = list(b.log())
+-    assert len(logs) > 0
+-
+-    # per key logs
+-    logs = list(b.key().log())
+-    assert len(logs) > 0
+diff --git a/ffi/src/lib.rs b/ffi/src/lib.rs
+index 40e3672e..9b4577eb 100644
+--- a/ffi/src/lib.rs
++++ b/ffi/src/lib.rs
+@@ -130,7 +130,6 @@ pub(crate) use crate::openpgp::{
+     MoveResultIntoRaw,
+     Maybe,
+     maybe_time,
+-    to_time_t,
+ };
+ 
+ /* Error handling with implicit context.  */
+@@ -146,5 +145,4 @@ macro_rules! ffi_make_fry_from_ctx {
+ pub mod core;
+ pub mod error;
+ pub mod net;
+-pub mod store;
+ 
+GitLab
+
diff --git a/gnu/packages/patches/libsigrokdecode-python3.9-fix.patch b/gnu/packages/patches/libsigrokdecode-python3.9-fix.patch
new file mode 100644
index 0000000000..4a6e1223ec
--- /dev/null
+++ b/gnu/packages/patches/libsigrokdecode-python3.9-fix.patch
@@ -0,0 +1,19 @@
+From: Dan Horák <dan@danny.cz>
+Subject: Add support for Python 3.9
+
+Origin: upstream, https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=commitdiff;h=9b0ad5177bd692f7556a4756bdbd2da81d9c34ce
+Bug-Debian: https://bugs.debian.org/972769
+
+diff --git a/configure.ac b/configure.ac
+index f9958b3..2917cb3 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -100,7 +100,7 @@ SR_PKG_CHECK_SUMMARY([srd_pkglibs_summary])
+ # first, since usually only that variant will add "-lpython3.8".
+ # https://docs.python.org/3/whatsnew/3.8.html#debug-build-uses-the-same-abi-as-release-build
+ SR_PKG_CHECK([python3], [SRD_PKGLIBS],
+-	[python-3.8-embed], [python-3.8 >= 3.8], [python-3.7 >= 3.7], [python-3.6 >= 3.6], [python-3.5 >= 3.5], [python-3.4 >= 3.4], [python-3.3 >= 3.3], [python-3.2 >= 3.2], [python3 >= 3.2])
++	[python-3.9-embed], [python-3.8-embed], [python-3.8 >= 3.8], [python-3.7 >= 3.7], [python-3.6 >= 3.6], [python-3.5 >= 3.5], [python-3.4 >= 3.4], [python-3.3 >= 3.3], [python-3.2 >= 3.2], [python3 >= 3.2])
+ AS_IF([test "x$sr_have_python3" = xno],
+ 	[AC_MSG_ERROR([Cannot find Python 3 development headers.])])
+ 
diff --git a/gnu/packages/patches/libtirpc-hurd-client.patch b/gnu/packages/patches/libtirpc-hurd-client.patch
deleted file mode 100644
index 526ad262d2..0000000000
--- a/gnu/packages/patches/libtirpc-hurd-client.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-Taken from https://salsa.debian.org/debian/libtirpc/-/raw/master/debian/patches/06-hurd-client-port.diff
-
-Description: Fix client code for hurd, avoiding malloc overflow
- When trying to setup a inet connection, it happens the following:
- - in libtirp, src/clnt_vc.c, clnt_vc_create gets called
- - when trying to allocate vc_fd_locks, __rpc_dtbsize() is used as size
-   for that array of fd locks
- - __rpc_dtbsize(), in src/rpc_generic.c, queries using rlimit the
-   maximum (rlim_max) number of file descriptors (RLIMIT_NOFILE):
-   - on Linux, the default is { rlim_cur = 1024, rlim_max = 4096 }
-   - on kFreeBSD, the default is { rlim_cur = 1024, rlim_max = 1024 }
-   - on Hurd, the default is { rlim_cur = 1024, rlim_max = RLIM_INFINITY }
-  meaning that on Hurd the memory allocation fails (as
-  __rpc_dtbsize() * sizeof(int) overflows and is negative)
-
- Change libtiprc so __rpc_dtbsize falls back on rlim_cur if rlim_max
- is unlimited.
-
- This patch fixes the client connection using inet sockets; local unix
- sockets are not working, for two reasons so far:
- - getpeername on them gives EOPNOTSUPP
- - SO_REUSEADDR is not implemented for them
-Author: Pino Toscano <pino@debian.org>
-
-Bug-Debian: http://bugs.debian.org/739674
-Forwarded: no
-Reviewed-By: Petter Reinholdtsen
-Last-Update: 2014-03-03
-
---- a/src/rpc_generic.c
-+++ b/src/rpc_generic.c
-@@ -107,12 +107,17 @@
- {
- 	static int tbsize;
- 	struct rlimit rl;
-+	rlim_t lim;
- 
- 	if (tbsize) {
- 		return (tbsize);
- 	}
- 	if (getrlimit(RLIMIT_NOFILE, &rl) == 0) {
--		return (tbsize = (int)rl.rlim_max);
-+		lim = rl.rlim_max;
-+		if (lim == RLIM_INFINITY) {
-+			lim = rl.rlim_cur;
-+		}
-+		return (tbsize = (int)lim);
- 	}
- 	/*
- 	 * Something wrong.  I'll try to save face by returning a
diff --git a/gnu/packages/patches/libtool-skip-tests2.patch b/gnu/packages/patches/libtool-skip-tests2.patch
index c9d61e3b41..3f86191b4f 100644
--- a/gnu/packages/patches/libtool-skip-tests2.patch
+++ b/gnu/packages/patches/libtool-skip-tests2.patch
@@ -1,4 +1,4 @@
-Skip the nopic test on ARM and MIPS systems.
+Skip the nopic test on ARM, MIPS and RISC-V systems.
 
 --- libtool-2.4.6/tests/demo.at.orig	2015-01-16 13:52:04.000000000 -0500
 +++ libtool-2.4.6/tests/demo.at	2015-02-16 10:48:51.435851966 -0500
@@ -7,7 +7,7 @@ Skip the nopic test on ARM and MIPS systems.
  
  AT_CHECK([case $host in
 -hppa*|x86_64*|s390*)
-+hppa*|x86_64*|s390*|arm*|mips*)
++hppa*|x86_64*|s390*|arm*|mips*|riscv*)
    # These hosts cannot use non-PIC shared libs
    exit 77 ;;
  *-solaris*|*-sunos*)
@@ -18,7 +18,7 @@ Skip the nopic test on ARM and MIPS systems.
  { set +x
  $as_echo "$at_srcdir/demo.at:535: case \$host in
 -hppa*|x86_64*|s390*)
-+hppa*|x86_64*|s390*|arm*|mips*)
++hppa*|x86_64*|s390*|arm*|mips*|riscv*)
    # These hosts cannot use non-PIC shared libs
    exit 77 ;;
  *-solaris*|*-sunos*)
@@ -27,7 +27,7 @@ Skip the nopic test on ARM and MIPS systems.
  at_fn_check_prepare_notrace 'a `...` command substitution' "demo.at:535"
  ( $at_check_trace; case $host in
 -hppa*|x86_64*|s390*)
-+hppa*|x86_64*|s390*|arm*|mips*)
++hppa*|x86_64*|s390*|arm*|mips*|riscv*)
    # These hosts cannot use non-PIC shared libs
    exit 77 ;;
  *-solaris*|*-sunos*)
diff --git a/gnu/packages/patches/libunwind-julia-fix-GCC10-fno-common.patch b/gnu/packages/patches/libunwind-julia-fix-GCC10-fno-common.patch
new file mode 100644
index 0000000000..8ef4b111e4
--- /dev/null
+++ b/gnu/packages/patches/libunwind-julia-fix-GCC10-fno-common.patch
@@ -0,0 +1,40 @@
+Fix compilation with -fno-common.
+
+Borrowed from upstream 29e17d8d2ccbca07c423e3089a6d5ae8a1c9cb6e.
+Author:     Yichao Yu <yyc1992@gmail.com>
+AuthorDate: Tue Mar 31 00:43:32 2020 -0400
+Commit:     Dave Watson <dade.watson@gmail.com>
+CommitDate: Tue Mar 31 08:06:29 2020 -0700
+
+diff --git a/src/x86/Ginit.c b/src/x86/Ginit.c
+index f6b8dc2..9550efa 100644
+--- a/src/x86/Ginit.c
++++ b/src/x86/Ginit.c
+@@ -54,13 +54,6 @@ tdep_uc_addr (ucontext_t *uc, int reg)
+ 
+ # endif /* UNW_LOCAL_ONLY */
+ 
+-HIDDEN unw_dyn_info_list_t _U_dyn_info_list;
+-
+-/* XXX fix me: there is currently no way to locate the dyn-info list
+-       by a remote unwinder.  On ia64, this is done via a special
+-       unwind-table entry.  Perhaps something similar can be done with
+-       DWARF2 unwind info.  */
+-
+ static void
+ put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg)
+ {
+@@ -71,7 +64,12 @@ static int
+ get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr,
+                         void *arg)
+ {
+-  *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list;
++#ifndef UNW_LOCAL_ONLY
++# pragma weak _U_dyn_info_list_addr
++  if (!_U_dyn_info_list_addr)
++    return -UNW_ENOINFO;
++#endif
++  *dyn_info_list_addr = _U_dyn_info_list_addr ();
+   return 0;
+ }
+ 
diff --git a/gnu/packages/patches/libxml2-parent-pointers.patch b/gnu/packages/patches/libxml2-parent-pointers.patch
new file mode 100644
index 0000000000..1f0615c512
--- /dev/null
+++ b/gnu/packages/patches/libxml2-parent-pointers.patch
@@ -0,0 +1,228 @@
+Fix a regression in 2.9.12 where some corrupt XML structures were handled
+incorrectly:
+
+  https://gitlab.gnome.org/GNOME/libxml2/-/issues/255
+
+This is an amalgamation of these upstream commits:
+
+  https://gitlab.gnome.org/GNOME/libxml2/-/commit/85b1792e37b131e7a51af98a37f92472e8de5f3f
+  https://gitlab.gnome.org/GNOME/libxml2/-/commit/13ad8736d294536da4cbcd70a96b0a2fbf47070c
+
+diff --git a/HTMLtree.c b/HTMLtree.c
+--- a/HTMLtree.c
++++ b/HTMLtree.c
+@@ -744,7 +744,7 @@ void
+ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
+ 	                 xmlNodePtr cur, const char *encoding ATTRIBUTE_UNUSED,
+                          int format) {
+-    xmlNodePtr root;
++    xmlNodePtr root, parent;
+     xmlAttrPtr attr;
+     const htmlElemDesc * info;
+ 
+@@ -755,6 +755,7 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
+     }
+ 
+     root = cur;
++    parent = cur->parent;
+     while (1) {
+         switch (cur->type) {
+         case XML_HTML_DOCUMENT_NODE:
+@@ -762,13 +763,25 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
+             if (((xmlDocPtr) cur)->intSubset != NULL) {
+                 htmlDtdDumpOutput(buf, (xmlDocPtr) cur, NULL);
+             }
+-            if (cur->children != NULL) {
++            /* Always validate cur->parent when descending. */
++            if ((cur->parent == parent) && (cur->children != NULL)) {
++                parent = cur;
+                 cur = cur->children;
+                 continue;
+             }
+             break;
+ 
+         case XML_ELEMENT_NODE:
++            /*
++             * Some users like lxml are known to pass nodes with a corrupted
++             * tree structure. Fall back to a recursive call to handle this
++             * case.
++             */
++            if ((cur->parent != parent) && (cur->children != NULL)) {
++                htmlNodeDumpFormatOutput(buf, doc, cur, encoding, format);
++                break;
++            }
++
+             /*
+              * Get specific HTML info for that node.
+              */
+@@ -817,6 +830,7 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
+                     (cur->name != NULL) &&
+                     (cur->name[0] != 'p')) /* p, pre, param */
+                     xmlOutputBufferWriteString(buf, "\n");
++                parent = cur;
+                 cur = cur->children;
+                 continue;
+             }
+@@ -825,9 +839,9 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
+                 (info != NULL) && (!info->isinline)) {
+                 if ((cur->next->type != HTML_TEXT_NODE) &&
+                     (cur->next->type != HTML_ENTITY_REF_NODE) &&
+-                    (cur->parent != NULL) &&
+-                    (cur->parent->name != NULL) &&
+-                    (cur->parent->name[0] != 'p')) /* p, pre, param */
++                    (parent != NULL) &&
++                    (parent->name != NULL) &&
++                    (parent->name[0] != 'p')) /* p, pre, param */
+                     xmlOutputBufferWriteString(buf, "\n");
+             }
+ 
+@@ -842,9 +856,9 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
+                 break;
+             if (((cur->name == (const xmlChar *)xmlStringText) ||
+                  (cur->name != (const xmlChar *)xmlStringTextNoenc)) &&
+-                ((cur->parent == NULL) ||
+-                 ((xmlStrcasecmp(cur->parent->name, BAD_CAST "script")) &&
+-                  (xmlStrcasecmp(cur->parent->name, BAD_CAST "style"))))) {
++                ((parent == NULL) ||
++                 ((xmlStrcasecmp(parent->name, BAD_CAST "script")) &&
++                  (xmlStrcasecmp(parent->name, BAD_CAST "style"))))) {
+                 xmlChar *buffer;
+ 
+                 buffer = xmlEncodeEntitiesReentrant(doc, cur->content);
+@@ -902,13 +916,9 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
+                 break;
+             }
+ 
+-            /*
+-             * The parent should never be NULL here but we want to handle
+-             * corrupted documents gracefully.
+-             */
+-            if (cur->parent == NULL)
+-                return;
+-            cur = cur->parent;
++            cur = parent;
++            /* cur->parent was validated when descending. */
++            parent = cur->parent;
+ 
+             if ((cur->type == XML_HTML_DOCUMENT_NODE) ||
+                 (cur->type == XML_DOCUMENT_NODE)) {
+@@ -939,9 +949,9 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
+                     (cur->next != NULL)) {
+                     if ((cur->next->type != HTML_TEXT_NODE) &&
+                         (cur->next->type != HTML_ENTITY_REF_NODE) &&
+-                        (cur->parent != NULL) &&
+-                        (cur->parent->name != NULL) &&
+-                        (cur->parent->name[0] != 'p')) /* p, pre, param */
++                        (parent != NULL) &&
++                        (parent->name != NULL) &&
++                        (parent->name[0] != 'p')) /* p, pre, param */
+                         xmlOutputBufferWriteString(buf, "\n");
+                 }
+             }
+diff --git a/xmlsave.c b/xmlsave.c
+--- a/xmlsave.c
++++ b/xmlsave.c
+@@ -847,7 +847,7 @@ htmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
+ static void
+ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
+     int format = ctxt->format;
+-    xmlNodePtr tmp, root, unformattedNode = NULL;
++    xmlNodePtr tmp, root, unformattedNode = NULL, parent;
+     xmlAttrPtr attr;
+     xmlChar *start, *end;
+     xmlOutputBufferPtr buf;
+@@ -856,6 +856,7 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
+     buf = ctxt->buf;
+ 
+     root = cur;
++    parent = cur->parent;
+     while (1) {
+         switch (cur->type) {
+         case XML_DOCUMENT_NODE:
+@@ -868,7 +869,9 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
+             break;
+ 
+         case XML_DOCUMENT_FRAG_NODE:
+-            if (cur->children != NULL) {
++            /* Always validate cur->parent when descending. */
++            if ((cur->parent == parent) && (cur->children != NULL)) {
++                parent = cur;
+                 cur = cur->children;
+                 continue;
+             }
+@@ -887,7 +890,18 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
+             break;
+ 
+         case XML_ELEMENT_NODE:
+-	    if ((cur != root) && (ctxt->format == 1) && (xmlIndentTreeOutput))
++            /*
++             * Some users like lxml are known to pass nodes with a corrupted
++             * tree structure. Fall back to a recursive call to handle this
++             * case.
++             */
++            if ((cur->parent != parent) && (cur->children != NULL)) {
++                xmlNodeDumpOutputInternal(ctxt, cur);
++                break;
++            }
++
++	    if ((ctxt->level > 0) && (ctxt->format == 1) &&
++                (xmlIndentTreeOutput))
+ 		xmlOutputBufferWrite(buf, ctxt->indent_size *
+ 				     (ctxt->level > ctxt->indent_nr ?
+ 				      ctxt->indent_nr : ctxt->level),
+@@ -942,6 +956,7 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
+                 xmlOutputBufferWrite(buf, 1, ">");
+                 if (ctxt->format == 1) xmlOutputBufferWrite(buf, 1, "\n");
+                 if (ctxt->level >= 0) ctxt->level++;
++                parent = cur;
+                 cur = cur->children;
+                 continue;
+             }
+@@ -1058,13 +1073,9 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
+                 break;
+             }
+ 
+-            /*
+-             * The parent should never be NULL here but we want to handle
+-             * corrupted documents gracefully.
+-             */
+-            if (cur->parent == NULL)
+-                return;
+-            cur = cur->parent;
++            cur = parent;
++            /* cur->parent was validated when descending. */
++            parent = cur->parent;
+ 
+             if (cur->type == XML_ELEMENT_NODE) {
+                 if (ctxt->level > 0) ctxt->level--;
+diff --git a/xmlsave.c b/xmlsave.c
+--- a/xmlsave.c
++++ b/xmlsave.c
+@@ -890,6 +890,13 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
+             break;
+ 
+         case XML_ELEMENT_NODE:
++	    if ((cur != root) && (ctxt->format == 1) &&
++                (xmlIndentTreeOutput))
++		xmlOutputBufferWrite(buf, ctxt->indent_size *
++				     (ctxt->level > ctxt->indent_nr ?
++				      ctxt->indent_nr : ctxt->level),
++				     ctxt->indent);
++
+             /*
+              * Some users like lxml are known to pass nodes with a corrupted
+              * tree structure. Fall back to a recursive call to handle this
+@@ -900,13 +907,6 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
+                 break;
+             }
+ 
+-	    if ((ctxt->level > 0) && (ctxt->format == 1) &&
+-                (xmlIndentTreeOutput))
+-		xmlOutputBufferWrite(buf, ctxt->indent_size *
+-				     (ctxt->level > ctxt->indent_nr ?
+-				      ctxt->indent_nr : ctxt->level),
+-				     ctxt->indent);
+-
+             xmlOutputBufferWrite(buf, 1, "<");
+             if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
+                 xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
diff --git a/gnu/packages/patches/libxml2-terminating-newline.patch b/gnu/packages/patches/libxml2-terminating-newline.patch
new file mode 100644
index 0000000000..3f5c88dd4e
--- /dev/null
+++ b/gnu/packages/patches/libxml2-terminating-newline.patch
@@ -0,0 +1,33 @@
+Fix a regression in 2.9.12 where serializing empty HTML documents would
+not add a terminating newline.
+
+  https://gitlab.gnome.org/GNOME/libxml2/-/issues/266
+
+Taken from upstream:
+
+  https://gitlab.gnome.org/GNOME/libxml2/-/commit/92d9ab4c28842a09ca2b76d3ff2f933e01b6cd6f
+
+diff --git a/HTMLtree.c b/HTMLtree.c
+--- a/HTMLtree.c
++++ b/HTMLtree.c
+@@ -763,11 +763,15 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
+             if (((xmlDocPtr) cur)->intSubset != NULL) {
+                 htmlDtdDumpOutput(buf, (xmlDocPtr) cur, NULL);
+             }
+-            /* Always validate cur->parent when descending. */
+-            if ((cur->parent == parent) && (cur->children != NULL)) {
+-                parent = cur;
+-                cur = cur->children;
+-                continue;
++            if (cur->children != NULL) {
++                /* Always validate cur->parent when descending. */
++                if (cur->parent == parent) {
++                    parent = cur;
++                    cur = cur->children;
++                    continue;
++                }
++            } else {
++                xmlOutputBufferWriteString(buf, "\n");
+             }
+             break;
+ 
diff --git a/gnu/packages/patches/libxml2-xpath-recursion-limit.patch b/gnu/packages/patches/libxml2-xpath-recursion-limit.patch
new file mode 100644
index 0000000000..051196c635
--- /dev/null
+++ b/gnu/packages/patches/libxml2-xpath-recursion-limit.patch
@@ -0,0 +1,20 @@
+Fix recursion accounting in XPath expressions:
+
+  https://gitlab.gnome.org/GNOME/libxml2/-/issues/264
+
+Taken from upstream:
+
+  https://gitlab.gnome.org/GNOME/libxml2/-/commit/3e1aad4fe584747fd7d17cc7b2863a78e2d21a77
+
+diff --git a/xpath.c b/xpath.c
+--- a/xpath.c
++++ b/xpath.c
+@@ -10983,7 +10983,7 @@ xmlXPathCompileExpr(xmlXPathParserContextPtr ctxt, int sort) {
+     }
+ 
+     if (xpctxt != NULL)
+-        xpctxt->depth -= 1;
++        xpctxt->depth -= 10;
+ }
+ 
+ /**
diff --git a/gnu/packages/patches/libxt-guix-search-paths.patch b/gnu/packages/patches/libxt-guix-search-paths.patch
index 5419edd1bd..61022d232a 100644
--- a/gnu/packages/patches/libxt-guix-search-paths.patch
+++ b/gnu/packages/patches/libxt-guix-search-paths.patch
@@ -1,13 +1,9 @@
 diff --git a/src/Intrinsic.c b/src/Intrinsic.c
-index c9624ec..addcdba 100644
 --- a/src/Intrinsic.c
 +++ b/src/Intrinsic.c
-@@ -1312,21 +1312,101 @@ static void FillInLangSubs(
-     } else (void) strcpy(*rest, string);
+@@ -1345,21 +1345,99 @@ FillInLangSubs(Substitution subs, XtPerDisplay pd)
  }
  
-+
-+
  /*
 - * default path used if environment variable XFILESEARCHPATH
 - * is not defined.  Also substitued for %D.
@@ -24,8 +20,9 @@ index c9624ec..addcdba 100644
 +   These values provide the default paths where Guix/GuixSD can expect
 +   to find resources for installed packages.
   */
--static const char *implementation_default_path(void)
-+static const char *guix_default_path(void)
+ static const char *
+-implementation_default_path(void)
++guix_default_path(void)
  {
 -#if defined(WIN32)
 -    static char xfilesearchpath[] = "";
@@ -115,7 +112,7 @@ index c9624ec..addcdba 100644
  }
  
  
-@@ -1354,7 +1434,7 @@ _XtString XtResolvePathname(
+@@ -1388,7 +1466,7 @@ XtResolvePathname(Display *dpy,
  {
      XtPerDisplay pd;
      static const char *defaultPath = NULL;
diff --git a/gnu/packages/patches/linuxdcpp-openssl-1.1.patch b/gnu/packages/patches/linuxdcpp-openssl-1.1.patch
new file mode 100644
index 0000000000..6f9912afd8
--- /dev/null
+++ b/gnu/packages/patches/linuxdcpp-openssl-1.1.patch
@@ -0,0 +1,26 @@
+--- a/dcpp/CryptoManager.cpp.orig	2011-04-17 17:57:09 UTC
++++ b/dcpp/CryptoManager.cpp
+@@ -107,12 +107,20 @@ CryptoManager::CryptoManager()
+                 };
+ 
+ 		if(dh) {
+-			dh->p = BN_bin2bn(dh4096_p, sizeof(dh4096_p), 0);
+-			dh->g = BN_bin2bn(dh4096_g, sizeof(dh4096_g), 0);
++			BIGNUM *p, *g;
+ 
+-			if (!dh->p || !dh->g) {
++			p = BN_bin2bn(dh4096_p, sizeof(dh4096_p), 0);
++			g = BN_bin2bn(dh4096_g, sizeof(dh4096_g), 0);
++
++			if (!p || !g) {
+ 				dh.reset();
+ 			} else {
++#if OPENSSL_VERSION_NUMBER < 0x10100005L
++				dh->p = p;
++				dh->g = g;
++#else
++				DH_set0_pqg(dh, p, NULL, g);
++#endif
+ 				SSL_CTX_set_options(serverContext, SSL_OP_SINGLE_DH_USE);
+ 				SSL_CTX_set_options(serverVerContext, SSL_OP_SINGLE_DH_USE);
+ 				SSL_CTX_set_tmp_dh(serverContext, (DH*)dh);
diff --git a/gnu/packages/patches/llvm-3.6-fix-build-with-gcc-10.patch b/gnu/packages/patches/llvm-3.6-fix-build-with-gcc-10.patch
new file mode 100644
index 0000000000..4982587d15
--- /dev/null
+++ b/gnu/packages/patches/llvm-3.6-fix-build-with-gcc-10.patch
@@ -0,0 +1,13 @@
+Adapted from https://github.com/digego/extempore/pull/322/files
+
+--- a/include/llvm/IR/ValueMap.h	2015-08-04 00:30:24.000000000 +0200
++++ b/include/llvm/IR/ValueMap.h	2018-07-14 21:09:09.769502736 +0200
+@@ -99,7 +99,7 @@
+   explicit ValueMap(const ExtraData &Data, unsigned NumInitBuckets = 64)
+       : Map(NumInitBuckets), Data(Data) {}
+
+-  bool hasMD() const { return MDMap; }
++  bool hasMD() const { return static_cast<bool>(MDMap); }
+   MDMapT &MD() {
+     if (!MDMap)
+       MDMap.reset(new MDMapT);
diff --git a/gnu/packages/patches/lua-5.4-liblua-so.patch b/gnu/packages/patches/lua-5.4-liblua-so.patch
new file mode 100644
index 0000000000..93dd011143
--- /dev/null
+++ b/gnu/packages/patches/lua-5.4-liblua-so.patch
@@ -0,0 +1,33 @@
+Patch the makefile to create liblua.so.
+
+--- a/src/Makefile	2021-02-09 18:47:17.000000000 +0000
++++ b/src/Makefile	2022-01-03 11:30:36.964501941 +0000
+@@ -33,6 +33,7 @@
+ PLATS= guess aix bsd c89 freebsd generic linux linux-readline macosx mingw posix solaris
+ 
+ LUA_A=	liblua.a
++LUA_SO= liblua.so
+ CORE_O=	lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o
+ LIB_O=	lauxlib.o lbaselib.o lcorolib.o ldblib.o liolib.o lmathlib.o loadlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o linit.o
+ BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS)
+@@ -44,7 +45,7 @@
+ LUAC_O=	luac.o
+ 
+ ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)
+-ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
++ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) $(LUA_SO)
+ ALL_A= $(LUA_A)
+ 
+ # Targets start here.
+@@ -56,6 +57,11 @@
+ 
+ a:	$(ALL_A)
+ 
++$(LUA_SO): $(CORE_O) $(LIB_O)
++	$(CC) -shared -ldl -Wl,-soname,$(LUA_SO).$(V) -o $@.$(R) $? -lm $(MYLDFLAGS)
++	ln -sf $(LUA_SO).$(R) $(LUA_SO).$(V)
++	ln -sf $(LUA_SO).$(R) $(LUA_SO)
++
+ $(LUA_A): $(BASE_O)
+ 	$(AR) $@ $(BASE_O)
+ 	$(RANLIB) $@
diff --git a/gnu/packages/patches/lua-5.4-pkgconfig.patch b/gnu/packages/patches/lua-5.4-pkgconfig.patch
new file mode 100644
index 0000000000..eb42633585
--- /dev/null
+++ b/gnu/packages/patches/lua-5.4-pkgconfig.patch
@@ -0,0 +1,110 @@
+Enables generating Lua's pkg-config file.
+
+http://lua-users.org/lists/lua-l/2015-03/msg00338.html
+
+--- a/Makefile	2022-01-03 12:06:37.760402709 +0000
++++ b/Makefile	2022-01-03 12:06:49.568402167 +0000
+@@ -14,6 +14,7 @@
+ INSTALL_BIN= $(INSTALL_TOP)/bin
+ INSTALL_INC= $(INSTALL_TOP)/include
+ INSTALL_LIB= $(INSTALL_TOP)/lib
++INSTALL_PC= $(INSTALL_LIB)/pkgconfig
+ INSTALL_MAN= $(INSTALL_TOP)/man/man1
+ INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V
+ INSTALL_CMOD= $(INSTALL_TOP)/lib/lua/$V
+@@ -39,9 +40,12 @@
+ PLATS= guess aix bsd c89 freebsd generic linux linux-readline macosx mingw posix solaris
+ 
+ # What to install.
+-TO_BIN= lua luac
++INTERPRETER= lua
++COMPILER= luac
++TO_BIN= $(INTERPRETER) $(COMPILER)
+ TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp
+-TO_LIB= liblua.a
++TO_LIB= liblua.a liblua.so liblua.so.${V}
++TO_PC=  lua-$(V).pc
+ TO_MAN= lua.1 luac.1
+ 
+ # Lua version and release.
+@@ -51,20 +55,26 @@
+ # Targets start here.
+ all:	$(PLAT)
+ 
+-$(PLATS) help test clean:
+-	@cd src && $(MAKE) $@
++$(PLATS):
++	@cd src && $(MAKE) $@ V=$(V) R=$(R)
+ 
+-install: dummy
+-	cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD)
++clean:
++	cd src && $(MAKE) $@
++	$(RM) $(TO_PC)
++	
++install: dummy $(TO_PC)
++	cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_PC) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD)
+ 	cd src && $(INSTALL_EXEC) $(TO_BIN) $(INSTALL_BIN)
+ 	cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
+-	cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB)
++	cd src && $(INSTALL_EXEC) $(TO_LIB) $(INSTALL_LIB)
++	cd src && $(INSTALL_DATA) ../$(TO_PC) $(INSTALL_PC)
+ 	cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN)
+ 
+ uninstall:
+ 	cd src && cd $(INSTALL_BIN) && $(RM) $(TO_BIN)
+ 	cd src && cd $(INSTALL_INC) && $(RM) $(TO_INC)
+ 	cd src && cd $(INSTALL_LIB) && $(RM) $(TO_LIB)
++	cd src && cd $(INSTALL_PC)  && $(RM) $(TO_PC)
+ 	cd doc && cd $(INSTALL_MAN) && $(RM) $(TO_MAN)
+ 
+ local:
+@@ -82,11 +92,13 @@
+ 	@echo "TO_BIN= $(TO_BIN)"
+ 	@echo "TO_INC= $(TO_INC)"
+ 	@echo "TO_LIB= $(TO_LIB)"
++	@echo "TO_PC= $(TO_PC)"
+ 	@echo "TO_MAN= $(TO_MAN)"
+ 	@echo "INSTALL_TOP= $(INSTALL_TOP)"
+ 	@echo "INSTALL_BIN= $(INSTALL_BIN)"
+ 	@echo "INSTALL_INC= $(INSTALL_INC)"
+ 	@echo "INSTALL_LIB= $(INSTALL_LIB)"
++	@echo "INSTALL_PC= $(INSTALL_PC)"
+ 	@echo "INSTALL_MAN= $(INSTALL_MAN)"
+ 	@echo "INSTALL_LMOD= $(INSTALL_LMOD)"
+ 	@echo "INSTALL_CMOD= $(INSTALL_CMOD)"
+@@ -95,12 +107,29 @@
+ 
+ # Echo pkg-config data.
+ pc:
+-	@echo "version=$R"
+-	@echo "prefix=$(INSTALL_TOP)"
+-	@echo "libdir=$(INSTALL_LIB)"
+-	@echo "includedir=$(INSTALL_INC)"
++	@echo 'prefix=$(INSTALL_TOP)'
++	@echo 'libdir=$(INSTALL_LIB)'
++	@echo 'includedir=$(INSTALL_INC)'
++	@echo 'bindir=$(INSTALL_BIN)'
++	@echo
++	@echo 'INSTALL_LMOD=$(INSTALL_LMOD)'
++	@echo 'INSTALL_CMOD=$(INSTALL_CMOD)'
++	@echo 'INTERPRETER=$${bindir}/$(INTERPRETER)'
++	@echo 'COMPILER=$${bindir}/$(COMPILER)'
++	@echo
++	@echo 'Name: Lua'
++	@echo 'Description: A powerful, fast, lightweight, embeddable scripting language'
++	@echo 'Version: $(R)'
++	@echo
++	@echo 'Libs: -L$${libdir} -llua -lm'
++	@echo 'Cflags: -I$${includedir}'
++
++pkg-config: $(TO_PC)
++$(TO_PC):
++	@$(MAKE) -s pc > $@
++	
+ 
+ # Targets that do not create files (not all makes understand .PHONY).
+-.PHONY: all $(PLATS) help test clean install uninstall local dummy echo pc
++.PHONY: all $(PLATS) help test clean install uninstall local dummy echo pc pkg-config
+ 
+ # (end of Makefile)
diff --git a/gnu/packages/patches/mariadb-CVE-2021-27928.patch b/gnu/packages/patches/mariadb-CVE-2021-27928.patch
deleted file mode 100644
index 39a023c159..0000000000
--- a/gnu/packages/patches/mariadb-CVE-2021-27928.patch
+++ /dev/null
@@ -1,642 +0,0 @@
-From 7580701e6279900fec40822952a3b874732289cf Mon Sep 17 00:00:00 2001
-From: Sergei Golubchik <serg@mariadb.org>
-Date: Thu, 18 Feb 2021 14:20:48 +0100
-Subject: [PATCH] make @@wsrep_provider and @@wsrep_notify_cmd read-only
-
-this should simplify run-time cluster management
----
- mysql-test/suite/galera/disabled.def          |  2 +
- .../galera/include/galera_load_provider.inc   | 19 --------
- .../galera/include/galera_unload_provider.inc |  3 +-
- .../suite/galera/r/galera_ist_rsync.result    |  2 +-
- .../galera/r/galera_sst_mysqldump.result      |  2 +-
- .../suite/galera/r/mysql-wsrep#33.result      |  2 +-
- .../suite/sys_vars/r/sysvars_wsrep.result     |  4 +-
- .../sys_vars/r/wsrep_notify_cmd_basic.result  | 47 -------------------
- .../sys_vars/r/wsrep_provider_basic.result    | 40 ----------------
- .../r/wsrep_provider_options_basic.result     | 46 ------------------
- .../sys_vars/t/wsrep_notify_cmd_basic.test    | 43 -----------------
- .../sys_vars/t/wsrep_provider_basic.test      | 39 ---------------
- .../t/wsrep_provider_options_basic.test       | 41 ----------------
- mysql-test/suite/wsrep/disabled.def           |  2 +
- mysql-test/suite/wsrep/r/variables.result     | 12 ++---
- mysql-test/suite/wsrep/t/variables.test       | 32 +++----------
- sql/sys_vars.cc                               |  8 ++--
- 17 files changed, 25 insertions(+), 319 deletions(-)
- delete mode 100644 mysql-test/suite/sys_vars/r/wsrep_notify_cmd_basic.result
- delete mode 100644 mysql-test/suite/sys_vars/r/wsrep_provider_basic.result
- delete mode 100644 mysql-test/suite/sys_vars/r/wsrep_provider_options_basic.result
- delete mode 100644 mysql-test/suite/sys_vars/t/wsrep_notify_cmd_basic.test
- delete mode 100644 mysql-test/suite/sys_vars/t/wsrep_provider_basic.test
- delete mode 100644 mysql-test/suite/sys_vars/t/wsrep_provider_options_basic.test
-
-diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def
-index d940c702d54..83f26e81636 100644
---- a/mysql-test/suite/galera/disabled.def
-+++ b/mysql-test/suite/galera/disabled.def
-@@ -49,3 +49,5 @@ partition : MDEV-19958 Galera test failure on galera.partition
- query_cache: MDEV-15805 Test failure on galera.query_cache
- sql_log_bin : MDEV-21491 galera.sql_log_bin
- versioning_trx_id : MDEV-18590 galera.versioning_trx_id
-+galera_wsrep_provider_unset_set: wsrep_provider is read-only for security reasons
-+pxc-421: wsrep_provider is read-only for security reasons
-diff --git a/mysql-test/suite/galera/include/galera_load_provider.inc b/mysql-test/suite/galera/include/galera_load_provider.inc
-index 0f843597d9c..28010cc5b71 100644
---- a/mysql-test/suite/galera/include/galera_load_provider.inc
-+++ b/mysql-test/suite/galera/include/galera_load_provider.inc
-@@ -1,25 +1,6 @@
- --echo Loading wsrep provider ...
- 
- --disable_query_log
----eval SET GLOBAL wsrep_provider = '$wsrep_provider_orig';
--
--#
--# count occurences of successful node starts in error log
--#
--perl;
--  use strict;
--   my $test_log=$ENV{'LOG_FILE'} or die "LOG_FILE not set";
--   my $test_log_copy=$test_log . '.copy';
--   if (-e $test_log_copy) {
--      unlink $test_log_copy;
--   }
--
--EOF
----copy_file $LOG_FILE $LOG_FILE.copy
--
--#
--#  now join to the cluster
--#
- --eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_orig';
- 
- --enable_query_log
-diff --git a/mysql-test/suite/galera/include/galera_unload_provider.inc b/mysql-test/suite/galera/include/galera_unload_provider.inc
-index cd841f51fbc..ed7e9bc41f0 100644
---- a/mysql-test/suite/galera/include/galera_unload_provider.inc
-+++ b/mysql-test/suite/galera/include/galera_unload_provider.inc
-@@ -1,7 +1,6 @@
- --echo Unloading wsrep provider ...
- 
- --let $wsrep_cluster_address_orig = `SELECT @@wsrep_cluster_address`
----let $wsrep_provider_orig = `SELECT @@wsrep_provider`
- --let $wsrep_provider_options_orig = `SELECT @@wsrep_provider_options`
- --let $wsrep_error_log_orig = `SELECT @@log_error`
- if(!$wsrep_log_error_orig)
-@@ -12,4 +11,4 @@ if(!$wsrep_log_error_orig)
- }
- --let LOG_FILE= $wsrep_log_error_orig
- 
--SET GLOBAL wsrep_provider = 'none';
-+SET GLOBAL wsrep_cluster_address = '';
-diff --git a/mysql-test/suite/galera/r/galera_ist_rsync.result b/mysql-test/suite/galera/r/galera_ist_rsync.result
-index 13f7d898a59..70a87c73df7 100644
---- a/mysql-test/suite/galera/r/galera_ist_rsync.result
-+++ b/mysql-test/suite/galera/r/galera_ist_rsync.result
-@@ -23,7 +23,7 @@ INSERT INTO t1 VALUES ('node2_committed_before');
- INSERT INTO t1 VALUES ('node2_committed_before');
- COMMIT;
- Unloading wsrep provider ...
--SET GLOBAL wsrep_provider = 'none';
-+SET GLOBAL wsrep_cluster_address = '';
- connection node_1;
- SET AUTOCOMMIT=OFF;
- START TRANSACTION;
-diff --git a/mysql-test/suite/galera/r/galera_sst_mysqldump.result b/mysql-test/suite/galera/r/galera_sst_mysqldump.result
-index 4ed679ba477..145b3a94775 100644
---- a/mysql-test/suite/galera/r/galera_sst_mysqldump.result
-+++ b/mysql-test/suite/galera/r/galera_sst_mysqldump.result
-@@ -30,7 +30,7 @@ INSERT INTO t1 VALUES ('node2_committed_before');
- INSERT INTO t1 VALUES ('node2_committed_before');
- COMMIT;
- Unloading wsrep provider ...
--SET GLOBAL wsrep_provider = 'none';
-+SET GLOBAL wsrep_cluster_address = '';
- connection node_1;
- SET AUTOCOMMIT=OFF;
- START TRANSACTION;
-diff --git a/mysql-test/suite/galera/r/mysql-wsrep#33.result b/mysql-test/suite/galera/r/mysql-wsrep#33.result
-index fb0b593cc96..45c6a3f660a 100644
---- a/mysql-test/suite/galera/r/mysql-wsrep#33.result
-+++ b/mysql-test/suite/galera/r/mysql-wsrep#33.result
-@@ -32,7 +32,7 @@ INSERT INTO t1 VALUES ('node2_committed_before');
- INSERT INTO t1 VALUES ('node2_committed_before');
- COMMIT;
- Unloading wsrep provider ...
--SET GLOBAL wsrep_provider = 'none';
-+SET GLOBAL wsrep_cluster_address = '';
- connection node_1;
- SET AUTOCOMMIT=OFF;
- START TRANSACTION;
-diff --git a/mysql-test/suite/sys_vars/r/sysvars_wsrep.result b/mysql-test/suite/sys_vars/r/sysvars_wsrep.result
-index 4b6abf85434..f73bfbd13e7 100644
---- a/mysql-test/suite/sys_vars/r/sysvars_wsrep.result
-+++ b/mysql-test/suite/sys_vars/r/sysvars_wsrep.result
-@@ -403,7 +403,7 @@ NUMERIC_MIN_VALUE	NULL
- NUMERIC_MAX_VALUE	NULL
- NUMERIC_BLOCK_SIZE	NULL
- ENUM_VALUE_LIST	NULL
--READ_ONLY	NO
-+READ_ONLY	YES
- COMMAND_LINE_ARGUMENT	REQUIRED
- GLOBAL_VALUE_PATH	NULL
- VARIABLE_NAME	WSREP_ON
-@@ -463,7 +463,7 @@ NUMERIC_MIN_VALUE	NULL
- NUMERIC_MAX_VALUE	NULL
- NUMERIC_BLOCK_SIZE	NULL
- ENUM_VALUE_LIST	NULL
--READ_ONLY	NO
-+READ_ONLY	YES
- COMMAND_LINE_ARGUMENT	REQUIRED
- GLOBAL_VALUE_PATH	NULL
- VARIABLE_NAME	WSREP_PROVIDER_OPTIONS
-diff --git a/mysql-test/suite/sys_vars/r/wsrep_notify_cmd_basic.result b/mysql-test/suite/sys_vars/r/wsrep_notify_cmd_basic.result
-deleted file mode 100644
-index 056ff8c817b..00000000000
---- a/mysql-test/suite/sys_vars/r/wsrep_notify_cmd_basic.result
-+++ /dev/null
-@@ -1,47 +0,0 @@
--#
--# wsrep_notify_cmd
--#
--call mtr.add_suppression("WSREP: Failed to get provider options");
--# save the initial value
--SET @wsrep_notify_cmd_global_saved = @@global.wsrep_notify_cmd;
--# default
--SELECT @@global.wsrep_notify_cmd;
--@@global.wsrep_notify_cmd
--
--
--# scope
--SELECT @@session.wsrep_notify_cmd;
--ERROR HY000: Variable 'wsrep_notify_cmd' is a GLOBAL variable
--SET @@global.wsrep_notify_cmd='notify_cmd';
--SELECT @@global.wsrep_notify_cmd;
--@@global.wsrep_notify_cmd
--notify_cmd
--
--# valid values
--SET @@global.wsrep_notify_cmd='command';
--SELECT @@global.wsrep_notify_cmd;
--@@global.wsrep_notify_cmd
--command
--SET @@global.wsrep_notify_cmd='hyphenated-command';
--SELECT @@global.wsrep_notify_cmd;
--@@global.wsrep_notify_cmd
--hyphenated-command
--SET @@global.wsrep_notify_cmd=default;
--SELECT @@global.wsrep_notify_cmd;
--@@global.wsrep_notify_cmd
--
--SET @@global.wsrep_notify_cmd=NULL;
--SELECT @@global.wsrep_notify_cmd;
--@@global.wsrep_notify_cmd
--NULL
--
--# invalid values
--SET @@global.wsrep_notify_cmd=1;
--ERROR 42000: Incorrect argument type to variable 'wsrep_notify_cmd'
--SELECT @@global.wsrep_notify_cmd;
--@@global.wsrep_notify_cmd
--NULL
--
--# restore the initial value
--SET @@global.wsrep_notify_cmd = @wsrep_notify_cmd_global_saved;
--# End of test
-diff --git a/mysql-test/suite/sys_vars/r/wsrep_provider_basic.result b/mysql-test/suite/sys_vars/r/wsrep_provider_basic.result
-deleted file mode 100644
-index 3e4ac8ca883..00000000000
---- a/mysql-test/suite/sys_vars/r/wsrep_provider_basic.result
-+++ /dev/null
-@@ -1,40 +0,0 @@
--#
--# wsrep_provider
--#
--# save the initial value
--SET @wsrep_provider_global_saved = @@global.wsrep_provider;
--# default
--SELECT @@global.wsrep_provider;
--@@global.wsrep_provider
--none
--
--# scope
--SELECT @@session.wsrep_provider;
--ERROR HY000: Variable 'wsrep_provider' is a GLOBAL variable
--SELECT @@global.wsrep_provider;
--@@global.wsrep_provider
--none
--
--# valid values
--SET @@global.wsrep_provider=default;
--SELECT @@global.wsrep_provider;
--@@global.wsrep_provider
--none
--
--# invalid values
--SET @@global.wsrep_provider='/invalid/libgalera_smm.so';
--ERROR 42000: Variable 'wsrep_provider' can't be set to the value of '/invalid/libgalera_smm.so'
--SET @@global.wsrep_provider=NULL;
--ERROR 42000: Variable 'wsrep_provider' can't be set to the value of 'NULL'
--SELECT @@global.wsrep_provider;
--@@global.wsrep_provider
--none
--SET @@global.wsrep_provider=1;
--ERROR 42000: Incorrect argument type to variable 'wsrep_provider'
--SELECT @@global.wsrep_provider;
--@@global.wsrep_provider
--none
--
--# restore the initial value
--SET @@global.wsrep_provider = @wsrep_provider_global_saved;
--# End of test
-diff --git a/mysql-test/suite/sys_vars/r/wsrep_provider_options_basic.result b/mysql-test/suite/sys_vars/r/wsrep_provider_options_basic.result
-deleted file mode 100644
-index 15949a14e39..00000000000
---- a/mysql-test/suite/sys_vars/r/wsrep_provider_options_basic.result
-+++ /dev/null
-@@ -1,46 +0,0 @@
--#
--# wsrep_provider_options
--#
--call mtr.add_suppression("WSREP: Failed to get provider options");
--# default
--SELECT @@global.wsrep_provider_options;
--@@global.wsrep_provider_options
--
--
--# scope
--SELECT @@session.wsrep_provider_options;
--ERROR HY000: Variable 'wsrep_provider_options' is a GLOBAL variable
--SET @@global.wsrep_provider_options='option1';
--SELECT @@global.wsrep_provider_options;
--@@global.wsrep_provider_options
--
--
--# valid values
--SET @@global.wsrep_provider_options='name1=value1;name2=value2';
--ERROR HY000: WSREP (galera) not started
--SELECT @@global.wsrep_provider_options;
--@@global.wsrep_provider_options
--
--SET @@global.wsrep_provider_options='hyphenated-name:value';
--ERROR HY000: WSREP (galera) not started
--SELECT @@global.wsrep_provider_options;
--@@global.wsrep_provider_options
--
--SET @@global.wsrep_provider_options=default;
--ERROR HY000: WSREP (galera) not started
--SELECT @@global.wsrep_provider_options;
--@@global.wsrep_provider_options
--
--
--# invalid values
--SET @@global.wsrep_provider_options=1;
--ERROR 42000: Incorrect argument type to variable 'wsrep_provider_options'
--SELECT @@global.wsrep_provider_options;
--@@global.wsrep_provider_options
--
--SET @@global.wsrep_provider_options=NULL;
--Got one of the listed errors
--SELECT @@global.wsrep_provider_options;
--@@global.wsrep_provider_options
--
--# End of test
-diff --git a/mysql-test/suite/sys_vars/t/wsrep_notify_cmd_basic.test b/mysql-test/suite/sys_vars/t/wsrep_notify_cmd_basic.test
-deleted file mode 100644
-index 6d1535ba148..00000000000
---- a/mysql-test/suite/sys_vars/t/wsrep_notify_cmd_basic.test
-+++ /dev/null
-@@ -1,43 +0,0 @@
----source include/have_wsrep.inc
--
----echo #
----echo # wsrep_notify_cmd
----echo #
--
--call mtr.add_suppression("WSREP: Failed to get provider options");
--
----echo # save the initial value
--SET @wsrep_notify_cmd_global_saved = @@global.wsrep_notify_cmd;
--
----echo # default
--SELECT @@global.wsrep_notify_cmd;
--
----echo
----echo # scope
----error ER_INCORRECT_GLOBAL_LOCAL_VAR
--SELECT @@session.wsrep_notify_cmd;
--SET @@global.wsrep_notify_cmd='notify_cmd';
--SELECT @@global.wsrep_notify_cmd;
--
----echo
----echo # valid values
--SET @@global.wsrep_notify_cmd='command';
--SELECT @@global.wsrep_notify_cmd;
--SET @@global.wsrep_notify_cmd='hyphenated-command';
--SELECT @@global.wsrep_notify_cmd;
--SET @@global.wsrep_notify_cmd=default;
--SELECT @@global.wsrep_notify_cmd;
--SET @@global.wsrep_notify_cmd=NULL;
--SELECT @@global.wsrep_notify_cmd;
--
----echo
----echo # invalid values
----error ER_WRONG_TYPE_FOR_VAR
--SET @@global.wsrep_notify_cmd=1;
--SELECT @@global.wsrep_notify_cmd;
--
----echo
----echo # restore the initial value
--SET @@global.wsrep_notify_cmd = @wsrep_notify_cmd_global_saved;
--
----echo # End of test
-diff --git a/mysql-test/suite/sys_vars/t/wsrep_provider_basic.test b/mysql-test/suite/sys_vars/t/wsrep_provider_basic.test
-deleted file mode 100644
-index 1190ab41bb0..00000000000
---- a/mysql-test/suite/sys_vars/t/wsrep_provider_basic.test
-+++ /dev/null
-@@ -1,39 +0,0 @@
----source include/have_wsrep.inc
--
----echo #
----echo # wsrep_provider
----echo #
--
----echo # save the initial value
--SET @wsrep_provider_global_saved = @@global.wsrep_provider;
--
----echo # default
--SELECT @@global.wsrep_provider;
--
----echo
----echo # scope
----error ER_INCORRECT_GLOBAL_LOCAL_VAR
--SELECT @@session.wsrep_provider;
--SELECT @@global.wsrep_provider;
--
----echo
----echo # valid values
--SET @@global.wsrep_provider=default;
--SELECT @@global.wsrep_provider;
--
----echo
----echo # invalid values
----error ER_WRONG_VALUE_FOR_VAR
--SET @@global.wsrep_provider='/invalid/libgalera_smm.so';
----error ER_WRONG_VALUE_FOR_VAR
--SET @@global.wsrep_provider=NULL;
--SELECT @@global.wsrep_provider;
----error ER_WRONG_TYPE_FOR_VAR
--SET @@global.wsrep_provider=1;
--SELECT @@global.wsrep_provider;
--
----echo
----echo # restore the initial value
--SET @@global.wsrep_provider = @wsrep_provider_global_saved;
--
----echo # End of test
-diff --git a/mysql-test/suite/sys_vars/t/wsrep_provider_options_basic.test b/mysql-test/suite/sys_vars/t/wsrep_provider_options_basic.test
-deleted file mode 100644
-index 6eb3a94b6a4..00000000000
---- a/mysql-test/suite/sys_vars/t/wsrep_provider_options_basic.test
-+++ /dev/null
-@@ -1,41 +0,0 @@
----source include/have_wsrep.inc
--
----echo #
----echo # wsrep_provider_options
----echo #
--
--call mtr.add_suppression("WSREP: Failed to get provider options");
--
----echo # default
--SELECT @@global.wsrep_provider_options;
--
----echo
----echo # scope
----error ER_INCORRECT_GLOBAL_LOCAL_VAR
--SELECT @@session.wsrep_provider_options;
----error 0,ER_WRONG_ARGUMENTS
--SET @@global.wsrep_provider_options='option1';
--SELECT @@global.wsrep_provider_options;
--
----echo
----echo # valid values
----error ER_WRONG_ARGUMENTS
--SET @@global.wsrep_provider_options='name1=value1;name2=value2';
--SELECT @@global.wsrep_provider_options;
----error ER_WRONG_ARGUMENTS
--SET @@global.wsrep_provider_options='hyphenated-name:value';
--SELECT @@global.wsrep_provider_options;
----error ER_WRONG_ARGUMENTS
--SET @@global.wsrep_provider_options=default;
--SELECT @@global.wsrep_provider_options;
--
----echo
----echo # invalid values
----error ER_WRONG_TYPE_FOR_VAR
--SET @@global.wsrep_provider_options=1;
--SELECT @@global.wsrep_provider_options;
----error ER_WRONG_ARGUMENTS,ER_WRONG_ARGUMENTS
--SET @@global.wsrep_provider_options=NULL;
--SELECT @@global.wsrep_provider_options;
--
----echo # End of test
-diff --git a/mysql-test/suite/wsrep/disabled.def b/mysql-test/suite/wsrep/disabled.def
-index 11577bfe8b0..3d204db6945 100644
---- a/mysql-test/suite/wsrep/disabled.def
-+++ b/mysql-test/suite/wsrep/disabled.def
-@@ -10,3 +10,5 @@
- #
- ##############################################################################
- 
-+
-+mdev_6832: wsrep_provider is read-only for security reasons
-diff --git a/mysql-test/suite/wsrep/r/variables.result b/mysql-test/suite/wsrep/r/variables.result
-index a9988fd1628..e57440125ee 100644
---- a/mysql-test/suite/wsrep/r/variables.result
-+++ b/mysql-test/suite/wsrep/r/variables.result
-@@ -14,7 +14,6 @@ SET SESSION wsrep_replicate_myisam= ON;
- ERROR HY000: Variable 'wsrep_replicate_myisam' is a GLOBAL variable and should be set with SET GLOBAL
- SET GLOBAL wsrep_replicate_myisam= ON;
- SET GLOBAL wsrep_replicate_myisam= OFF;
--SET GLOBAL wsrep_provider=none;
- #
- # MDEV#5790: SHOW GLOBAL STATUS LIKE does not show the correct list of
- # variables when using "_"
-@@ -151,7 +150,6 @@ wsrep_local_state_comment	#
- # Should show nothing.
- SHOW STATUS LIKE 'x';
- Variable_name	Value
--SET GLOBAL wsrep_provider=none;
- 
- SHOW STATUS LIKE 'wsrep_local_state_uuid';
- Variable_name	Value
-@@ -160,7 +158,6 @@ wsrep_local_state_uuid	#
- SHOW STATUS LIKE 'wsrep_last_committed';
- Variable_name	Value
- wsrep_last_committed	#
--SET GLOBAL wsrep_provider=none;
- 
- #
- # MDEV#6206: wsrep_slave_threads subtracts from max_connections
-@@ -174,7 +171,7 @@ SELECT @@global.wsrep_slave_threads;
- 1
- SELECT @@global.wsrep_cluster_address;
- @@global.wsrep_cluster_address
--
-+gcomm://
- SELECT @@global.wsrep_on;
- @@global.wsrep_on
- 1
-@@ -183,14 +180,14 @@ Variable_name	Value
- Threads_connected	1
- SHOW STATUS LIKE 'wsrep_thread_count';
- Variable_name	Value
--wsrep_thread_count	0
-+wsrep_thread_count	2
- 
- SELECT @@global.wsrep_provider;
- @@global.wsrep_provider
- libgalera_smm.so
- SELECT @@global.wsrep_cluster_address;
- @@global.wsrep_cluster_address
--
-+gcomm://
- SELECT @@global.wsrep_on;
- @@global.wsrep_on
- 1
-@@ -199,11 +196,10 @@ Variable_name	Value
- Threads_connected	1
- SHOW STATUS LIKE 'wsrep_thread_count';
- Variable_name	Value
--wsrep_thread_count	0
-+wsrep_thread_count	2
- 
- # Setting wsrep_cluster_address triggers the creation of
- # applier/rollbacker threads.
--SET GLOBAL wsrep_cluster_address= 'gcomm://';
- # Wait for applier thread to get created 1.
- # Wait for applier thread to get created 2.
- SELECT VARIABLE_VALUE AS EXPECT_1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
-diff --git a/mysql-test/suite/wsrep/t/variables.test b/mysql-test/suite/wsrep/t/variables.test
-index f2c3a0a3b78..fd352b61a3a 100644
---- a/mysql-test/suite/wsrep/t/variables.test
-+++ b/mysql-test/suite/wsrep/t/variables.test
-@@ -23,7 +23,7 @@ SET GLOBAL wsrep_replicate_myisam= ON;
- 
- # Reset it back.
- SET GLOBAL wsrep_replicate_myisam= OFF;
--SET GLOBAL wsrep_provider=none;
-+#SET GLOBAL wsrep_provider=none;
- 
- --echo #
- --echo # MDEV#5790: SHOW GLOBAL STATUS LIKE does not show the correct list of
-@@ -32,9 +32,6 @@ SET GLOBAL wsrep_provider=none;
- 
- CALL mtr.add_suppression("WSREP: Could not open saved state file for reading.*");
- 
----disable_query_log
--eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER';
----enable_query_log
- 
- --replace_column 2 #
- SHOW GLOBAL STATUS LIKE 'wsrep%';
-@@ -50,11 +47,9 @@ SHOW GLOBAL STATUS LIKE 'wsrep_local_state_comment';
- SHOW STATUS LIKE 'x';
- 
- # Reset it back.
--SET GLOBAL wsrep_provider=none;
-+#SET GLOBAL wsrep_provider=none;
- 
----disable_query_log
--eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER';
----enable_query_log
-+#evalp SET GLOBAL wsrep_provider= '$WSREP_PROVIDER';
- 
- # The following 2 variables are used by mariabackup
- # SST.
-@@ -66,7 +61,7 @@ SHOW STATUS LIKE 'wsrep_local_state_uuid';
- SHOW STATUS LIKE 'wsrep_last_committed';
- 
- # Reset it back.
--SET GLOBAL wsrep_provider=none;
-+#SET GLOBAL wsrep_provider=none;
- 
- --echo
- --echo #
-@@ -74,9 +69,7 @@ SET GLOBAL wsrep_provider=none;
- --echo #
- call mtr.add_suppression("WSREP: Failed to get provider options");
- 
----disable_query_log
--eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER';
----enable_query_log
-+#evalp SET GLOBAL wsrep_provider= '$WSREP_PROVIDER';
- 
- --replace_regex /.*libgalera_smm.*/libgalera_smm.so/
- SELECT @@global.wsrep_provider;
-@@ -87,9 +80,7 @@ SHOW STATUS LIKE 'threads_connected';
- SHOW STATUS LIKE 'wsrep_thread_count';
- --echo
- 
----disable_query_log
--eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER';
----enable_query_log
-+#evalp SET GLOBAL wsrep_provider= '$WSREP_PROVIDER';
- 
- --replace_regex /.*libgalera_smm.*/libgalera_smm.so/
- SELECT @@global.wsrep_provider;
-@@ -101,7 +92,7 @@ SHOW STATUS LIKE 'wsrep_thread_count';
- 
- --echo # Setting wsrep_cluster_address triggers the creation of
- --echo # applier/rollbacker threads.
--SET GLOBAL wsrep_cluster_address= 'gcomm://';
-+#SET GLOBAL wsrep_cluster_address= 'gcomm://';
- 
- --echo # Wait for applier thread to get created 1.
- --let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
-@@ -162,15 +153,6 @@ SET @@global.wsrep_sst_auth= NULL;
- SELECT @@global.wsrep_sst_auth;
- SET @@global.wsrep_sst_auth= @wsrep_sst_auth_saved;
- 
--# Reset (for mtr internal checks)
--
----disable_query_log
--SET GLOBAL wsrep_slave_threads= @wsrep_slave_threads_saved;
--eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER';
--SET GLOBAL wsrep_cluster_address= @wsrep_cluster_address_saved;
--SET GLOBAL wsrep_provider_options= @wsrep_provider_options_saved;
----enable_query_log
--
- --source include/galera_wait_ready.inc
- 
- --echo # End of test.
-diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
-index 64040243df0..8c67a4d432a 100644
---- a/sql/sys_vars.cc
-+++ b/sql/sys_vars.cc
-@@ -5669,8 +5669,8 @@ static Sys_var_tz Sys_time_zone(
- 
- static Sys_var_charptr_fscs Sys_wsrep_provider(
-        "wsrep_provider", "Path to replication provider library",
--       PREALLOCATED GLOBAL_VAR(wsrep_provider), CMD_LINE(REQUIRED_ARG),
--       DEFAULT(WSREP_NONE),
-+       PREALLOCATED READ_ONLY GLOBAL_VAR(wsrep_provider), CMD_LINE(REQUIRED_ARG),
-+       DEFAULT(WSREP_NONE),
-        NO_MUTEX_GUARD, NOT_IN_BINLOG,
-        ON_CHECK(wsrep_provider_check), ON_UPDATE(wsrep_provider_update));
- 
-@@ -5886,8 +5886,8 @@ static Sys_var_ulong Sys_wsrep_max_ws_rows (
- 
- static Sys_var_charptr Sys_wsrep_notify_cmd(
-        "wsrep_notify_cmd", "",
--       GLOBAL_VAR(wsrep_notify_cmd),CMD_LINE(REQUIRED_ARG),
--       DEFAULT(""));
-+       READ_ONLY GLOBAL_VAR(wsrep_notify_cmd), CMD_LINE(REQUIRED_ARG),
-+       DEFAULT(""));
- 
- static Sys_var_mybool Sys_wsrep_certify_nonPK(
-        "wsrep_certify_nonPK", "Certify tables with no primary key",
--- 
-2.31.0
-
diff --git a/gnu/packages/patches/mathjax-disable-webpack.patch b/gnu/packages/patches/mathjax-disable-webpack.patch
new file mode 100644
index 0000000000..7e3d705c15
--- /dev/null
+++ b/gnu/packages/patches/mathjax-disable-webpack.patch
@@ -0,0 +1,23 @@
+commit 0cfd5b23aed8767f2bcf9583c1feaf4c9a64703a
+Author: Lars-Dominik Braun <lars@6xq.net>
+Date:   Wed Dec 1 14:27:33 2021 +0100
+
+    guix: Disable webpack
+    
+    Guix uses esbuild to “link” the files. We only need the build step.
+
+diff --git a/components/bin/makeAll b/components/bin/makeAll
+index 3e7a8914..5dae9b9b 100755
+--- a/components/bin/makeAll
++++ b/components/bin/makeAll
+@@ -61,8 +61,8 @@ function processList(dirs) {
+   for (const dir of dirs) {
+     const fulldir = path.resolve(dir);
+     processDir(fulldir, buildLib);
+-    processDir(fulldir, webpackLib);
+-    processDir(fulldir, copyLib);
++    //processDir(fulldir, webpackLib);
++    //processDir(fulldir, copyLib);
+   }
+ }
+ 
diff --git a/gnu/packages/patches/mathjax-no-a11y.patch b/gnu/packages/patches/mathjax-no-a11y.patch
new file mode 100644
index 0000000000..40fb514b5a
--- /dev/null
+++ b/gnu/packages/patches/mathjax-no-a11y.patch
@@ -0,0 +1,286 @@
+commit 9bb6f1e11264fb075bfa70fa3684f10a32414594
+Author: Lars-Dominik Braun <lars@6xq.net>
+Date:   Wed Dec 1 14:28:06 2021 +0100
+
+    guix: Remove accessibility.
+    
+    We cannot build speech-rule-engine from source and thus all dependents
+    must be removed. This affects all a11y modules and menu items, which
+    may try to load components.
+
+diff --git a/components/src/dependencies.js b/components/src/dependencies.js
+index f9be6f93..822f8fb6 100644
+--- a/components/src/dependencies.js
++++ b/components/src/dependencies.js
+@@ -16,9 +16,6 @@
+  */
+ 
+ export const dependencies = {
+-  'a11y/semantic-enrich': ['input/mml', '[sre]'],
+-  'a11y/complexity': ['a11y/semantic-enrich'],
+-  'a11y/explorer': ['a11y/semantic-enrich', 'ui/menu'],
+   '[mml]/mml3': ['input/mml'],
+   '[tex]/all-packages': ['input/tex-base'],
+   '[tex]/action': ['input/tex-base', '[tex]/newcommand'],
+@@ -58,7 +55,6 @@ export const dependencies = {
+ export const paths = {
+   tex: '[mathjax]/input/tex/extensions',
+   mml: '[mathjax]/input/mml/extensions',
+-  sre: '[mathjax]/sre/' + (typeof window === 'undefined' ? 'sre-node' : 'sre_browser')
+ };
+ 
+ const allPackages = [
+diff --git a/components/src/mml-chtml/mml-chtml.js b/components/src/mml-chtml/mml-chtml.js
+index c0bd18ee..a283a1ab 100644
+--- a/components/src/mml-chtml/mml-chtml.js
++++ b/components/src/mml-chtml/mml-chtml.js
+@@ -5,5 +5,4 @@ import '../input/mml/mml.js';
+ import '../output/chtml/chtml.js';
+ import '../output/chtml/fonts/tex/tex.js';
+ import '../ui/menu/menu.js';
+-import '../a11y/assistive-mml/assistive-mml.js';
+ import '../startup/startup.js';
+diff --git a/components/src/mml-chtml/preload.js b/components/src/mml-chtml/preload.js
+index e3f202f7..3699570e 100644
+--- a/components/src/mml-chtml/preload.js
++++ b/components/src/mml-chtml/preload.js
+@@ -5,5 +5,5 @@ Loader.preLoad(
+   'core',
+   'input/mml',
+   'output/chtml', 'output/chtml/fonts/tex.js',
+-  'ui/menu', 'a11y/assistive-mml'
++  'ui/menu'
+ );
+diff --git a/components/src/mml-svg/mml-svg.js b/components/src/mml-svg/mml-svg.js
+index 172b2433..23b66e69 100644
+--- a/components/src/mml-svg/mml-svg.js
++++ b/components/src/mml-svg/mml-svg.js
+@@ -5,5 +5,4 @@ import '../input/mml/mml.js';
+ import '../output/svg/svg.js';
+ import '../output/svg/fonts/tex/tex.js';
+ import '../ui/menu/menu.js';
+-import '../a11y/assistive-mml/assistive-mml.js';
+ import '../startup/startup.js';
+diff --git a/components/src/mml-svg/preload.js b/components/src/mml-svg/preload.js
+index 3cb47d42..89f6b9f9 100644
+--- a/components/src/mml-svg/preload.js
++++ b/components/src/mml-svg/preload.js
+@@ -5,5 +5,5 @@ Loader.preLoad(
+   'core',
+   'input/mml',
+   'output/svg', 'output/svg/fonts/tex.js',
+-  'ui/menu', 'a11y/assistive-mml'
++  'ui/menu'
+ );
+diff --git a/components/src/source.js b/components/src/source.js
+index ba6d6835..02ecf18d 100644
+--- a/components/src/source.js
++++ b/components/src/source.js
+@@ -62,12 +62,6 @@ export const source = {
+   'output/chtml/fonts/tex': `${src}/output/chtml/fonts/tex/tex.js`,
+   'output/svg': `${src}/output/svg/svg.js`,
+   'output/svg/fonts/tex': `${src}/output/svg/fonts/tex/tex.js`,
+-  'a11y/assistive-mml': `${src}/a11y/assistive-mml/assistive-mml.js`,
+-  'a11y/semantic-enrich': `${src}/a11y/semantic-enrich/semantic-enrich.js`,
+-  'a11y/complexity': `${src}/a11y/complexity/complexity.js`,
+-  'a11y/explorer': `${src}/a11y/explorer/explorer.js`,
+-  '[sre]': (typeof window === 'undefined' ? `${src}/../../js/a11y/sre-node.js` :
+-            `${src}/../../node_modules/speech-rule-engine/lib/sre_browser.js`),
+   'ui/lazy': `${src}/ui/lazy/lazy.js`,
+   'ui/menu': `${src}/ui/menu/menu.js`,
+   'ui/safe': `${src}/ui/safe/safe.js`,
+diff --git a/components/src/tex-chtml-full/preload.js b/components/src/tex-chtml-full/preload.js
+index 76c81c92..0eb3a8e2 100644
+--- a/components/src/tex-chtml-full/preload.js
++++ b/components/src/tex-chtml-full/preload.js
+@@ -5,5 +5,5 @@ Loader.preLoad(
+   'core',
+   'input/tex-full',
+   'output/chtml', 'output/chtml/fonts/tex.js',
+-  'ui/menu', 'a11y/assistive-mml'
++  'ui/menu'
+ );
+diff --git a/components/src/tex-chtml-full/tex-chtml-full.js b/components/src/tex-chtml-full/tex-chtml-full.js
+index 12291be9..c3f59e6b 100644
+--- a/components/src/tex-chtml-full/tex-chtml-full.js
++++ b/components/src/tex-chtml-full/tex-chtml-full.js
+@@ -5,5 +5,4 @@ import '../input/tex-full/tex-full.js';
+ import '../output/chtml/chtml.js';
+ import '../output/chtml/fonts/tex/tex.js';
+ import '../ui/menu/menu.js';
+-import '../a11y/assistive-mml/assistive-mml.js';
+ import '../startup/startup.js';
+diff --git a/components/src/tex-chtml/preload.js b/components/src/tex-chtml/preload.js
+index 89f110c5..5dae092f 100644
+--- a/components/src/tex-chtml/preload.js
++++ b/components/src/tex-chtml/preload.js
+@@ -5,5 +5,5 @@ Loader.preLoad(
+   'core',
+   'input/tex',
+   'output/chtml', 'output/chtml/fonts/tex.js',
+-  'ui/menu', 'a11y/assistive-mml'
++  'ui/menu'
+ );
+diff --git a/components/src/tex-chtml/tex-chtml.js b/components/src/tex-chtml/tex-chtml.js
+index 8d98865e..4d100a48 100644
+--- a/components/src/tex-chtml/tex-chtml.js
++++ b/components/src/tex-chtml/tex-chtml.js
+@@ -5,5 +5,4 @@ import '../input/tex/tex.js';
+ import '../output/chtml/chtml.js';
+ import '../output/chtml/fonts/tex/tex.js';
+ import '../ui/menu/menu.js';
+-import '../a11y/assistive-mml/assistive-mml.js';
+ import '../startup/startup.js';
+diff --git a/components/src/tex-mml-chtml/preload.js b/components/src/tex-mml-chtml/preload.js
+index 7adb6a3b..3945370f 100644
+--- a/components/src/tex-mml-chtml/preload.js
++++ b/components/src/tex-mml-chtml/preload.js
+@@ -5,5 +5,5 @@ Loader.preLoad(
+   'core',
+   'input/tex', 'input/mml',
+   'output/chtml', 'output/chtml/fonts/tex.js',
+-  'ui/menu', 'a11y/assistive-mml'
++  'ui/menu'
+ );
+diff --git a/components/src/tex-mml-chtml/tex-mml-chtml.js b/components/src/tex-mml-chtml/tex-mml-chtml.js
+index 4167bd59..0b068dc6 100644
+--- a/components/src/tex-mml-chtml/tex-mml-chtml.js
++++ b/components/src/tex-mml-chtml/tex-mml-chtml.js
+@@ -6,5 +6,4 @@ import '../input/mml/mml.js';
+ import '../output/chtml/chtml.js';
+ import '../output/chtml/fonts/tex/tex.js';
+ import '../ui/menu/menu.js';
+-import '../a11y/assistive-mml/assistive-mml.js';
+ import '../startup/startup.js';
+diff --git a/components/src/tex-mml-svg/preload.js b/components/src/tex-mml-svg/preload.js
+index 69d6a2c5..bad39af1 100644
+--- a/components/src/tex-mml-svg/preload.js
++++ b/components/src/tex-mml-svg/preload.js
+@@ -5,5 +5,5 @@ Loader.preLoad(
+   'core',
+   'input/tex', 'input/mml',
+   'output/svg', 'output/svg/fonts/tex.js',
+-  'ui/menu', 'a11y/assistive-mml'
++  'ui/menu'
+ );
+diff --git a/components/src/tex-mml-svg/tex-mml-svg.js b/components/src/tex-mml-svg/tex-mml-svg.js
+index acff78dd..3ca4e6cf 100644
+--- a/components/src/tex-mml-svg/tex-mml-svg.js
++++ b/components/src/tex-mml-svg/tex-mml-svg.js
+@@ -6,5 +6,4 @@ import '../input/mml/mml.js';
+ import '../output/svg/svg.js';
+ import '../output/svg/fonts/tex/tex.js';
+ import '../ui/menu/menu.js';
+-import '../a11y/assistive-mml/assistive-mml.js';
+ import '../startup/startup.js';
+diff --git a/components/src/tex-svg-full/preload.js b/components/src/tex-svg-full/preload.js
+index d4165cf8..8871781a 100644
+--- a/components/src/tex-svg-full/preload.js
++++ b/components/src/tex-svg-full/preload.js
+@@ -5,5 +5,5 @@ Loader.preLoad(
+   'core',
+   'input/tex-full',
+   'output/svg', 'output/svg/fonts/tex.js',
+-  'ui/menu', 'a11y/assistive-mml'
++  'ui/menu'
+ );
+diff --git a/components/src/tex-svg-full/tex-svg-full.js b/components/src/tex-svg-full/tex-svg-full.js
+index 55ce32f2..09c7e65c 100644
+--- a/components/src/tex-svg-full/tex-svg-full.js
++++ b/components/src/tex-svg-full/tex-svg-full.js
+@@ -5,5 +5,4 @@ import '../input/tex-full/tex-full.js';
+ import '../output/svg/svg.js';
+ import '../output/svg/fonts/tex/tex.js';
+ import '../ui/menu/menu.js';
+-import '../a11y/assistive-mml/assistive-mml.js';
+ import '../startup/startup.js';
+diff --git a/components/src/tex-svg/preload.js b/components/src/tex-svg/preload.js
+index 284ce317..3eb02665 100644
+--- a/components/src/tex-svg/preload.js
++++ b/components/src/tex-svg/preload.js
+@@ -5,5 +5,5 @@ Loader.preLoad(
+   'core',
+   'input/tex',
+   'output/svg', 'output/svg/fonts/tex.js',
+-  'ui/menu', 'a11y/assistive-mml'
++  'ui/menu'
+ );
+diff --git a/components/src/tex-svg/tex-svg.js b/components/src/tex-svg/tex-svg.js
+index f4ce644e..5d8caa5c 100644
+--- a/components/src/tex-svg/tex-svg.js
++++ b/components/src/tex-svg/tex-svg.js
+@@ -5,5 +5,4 @@ import '../input/tex/tex.js';
+ import '../output/svg/svg.js';
+ import '../output/svg/fonts/tex/tex.js';
+ import '../ui/menu/menu.js';
+-import '../a11y/assistive-mml/assistive-mml.js';
+ import '../startup/startup.js';
+diff --git a/ts/ui/menu/Menu.ts b/ts/ui/menu/Menu.ts
+index 7553aafc..ca0b9780 100644
+--- a/ts/ui/menu/Menu.ts
++++ b/ts/ui/menu/Menu.ts
+@@ -135,7 +135,7 @@ export class Menu {
+       autocollapse: false,
+       collapsible: false,
+       inTabOrder: true,
+-      assistiveMml: true,
++      assistiveMml: false,
+       explorer: false
+     },
+     jax: {
+@@ -475,7 +475,7 @@ export class Menu {
+           this.command('Reset', 'Reset to defaults', () => this.resetDefaults())
+         ]),
+         this.submenu('Accessibility', 'Accessibility', [
+-          this.checkbox('Activate', 'Activate', 'explorer'),
++          this.checkbox('Activate', 'Activate', 'explorer', {disabled: true}),
+           this.submenu('Speech', 'Speech', [
+             this.checkbox('Speech', 'Speech Output', 'speech'),
+             this.checkbox('Subtitles', 'Speech Subtitles', 'subtitles'),
+@@ -534,11 +534,11 @@ export class Menu {
+             this.checkbox('Prefix', 'Prefix', 'infoPrefix')
+           ], true),
+           this.rule(),
+-          this.checkbox('Collapsible', 'Collapsible Math', 'collapsible'),
++          this.checkbox('Collapsible', 'Collapsible Math', 'collapsible', {disabled: true}),
+           this.checkbox('AutoCollapse', 'Auto Collapse', 'autocollapse', {disabled: true}),
+           this.rule(),
+           this.checkbox('InTabOrder', 'Include in Tab Order', 'inTabOrder'),
+-          this.checkbox('AssistiveMml', 'Include Hidden MathML', 'assistiveMml')
++          this.checkbox('AssistiveMml', 'Include Hidden MathML', 'assistiveMml', {disabled: true})
+         ]),
+         this.submenu('Language', 'Language'),
+         this.rule(),
+@@ -722,6 +722,7 @@ export class Menu {
+    * @param {boolean} mml   True to output hidden Mathml, false to not
+    */
+   protected setAssistiveMml(mml: boolean) {
++    mml = false;
+     this.document.options.enableAssistiveMml = mml;
+     if (!mml || (MathJax._.a11y && MathJax._.a11y['assistive-mml'])) {
+       this.rerender();
+@@ -734,6 +735,7 @@ export class Menu {
+    * @param {boolean} explore   True to enable the explorer, false to not
+    */
+   protected setExplorer(explore: boolean) {
++    explore = false;
+     this.enableExplorerItems(explore);
+     this.document.options.enableExplorer = explore;
+     if (!explore || (MathJax._.a11y && MathJax._.a11y.explorer)) {
+@@ -747,6 +749,7 @@ export class Menu {
+    * @param {boolean} collapse   True to enable collapsible math, false to not
+    */
+   protected setCollapsible(collapse: boolean) {
++    collapse = false;
+     this.document.options.enableComplexity = collapse;
+     if (!collapse || (MathJax._.a11y && MathJax._.a11y.complexity)) {
+       this.rerender(STATE.COMPILED);
+@@ -845,6 +848,8 @@ export class Menu {
+    * @param {string} component   The name of the a11y component to load
+    */
+   public loadA11y(component: string) {
++    console.log ('ignoring load for', component);
++    return;
+     const noEnrich = !STATE.ENRICHED;
+     this.loadComponent('a11y/' + component, () => {
+       const startup = MathJax.startup;
diff --git a/gnu/packages/patches/mesa-opencl-all-targets.patch b/gnu/packages/patches/mesa-opencl-all-targets.patch
new file mode 100644
index 0000000000..99d4abcea4
--- /dev/null
+++ b/gnu/packages/patches/mesa-opencl-all-targets.patch
@@ -0,0 +1,25 @@
+This patch restores LLVM targets needed for OpenCL, *reverting* this
+upstream commit:
+
+  From 80817b6e344258ac9b955f824ebf9019a0fc1610 Mon Sep 17 00:00:00 2001
+  From: Jesse Natalie <jenatali@microsoft.com>
+  Date: Wed, 18 Nov 2020 18:30:30 -0800
+  Subject: [PATCH] meson: Adjust Clover's required LLVM modules
+
+diff --git a/meson.build b/meson.build
+index 6d1607c35a3..f828eb80faa 100644
+--- b/meson.build
++++ a/meson.build
+@@ -1479,10 +1479,9 @@
+ endif
+ if with_gallium_opencl
+   llvm_modules += [
+-    'linker', 'coverage', 'instrumentation', 'ipo', 'irreader',
+-    'lto', 'option', 'objcarcopts', 'profiledata'
++    'all-targets', 'linker', 'coverage', 'instrumentation', 'ipo', 'irreader',
++    'lto', 'option', 'objcarcopts', 'profiledata',
+   ]
+-  llvm_optional_modules += ['frontendopenmp']
+ endif
+ if with_microsoft_clc
+   llvm_modules += ['target', 'linker', 'irreader', 'option', 'libdriver']
diff --git a/gnu/packages/patches/mesa-skip-tests.patch b/gnu/packages/patches/mesa-skip-tests.patch
index 2622d5d312..7ff571dcf5 100644
--- a/gnu/packages/patches/mesa-skip-tests.patch
+++ b/gnu/packages/patches/mesa-skip-tests.patch
@@ -1,23 +1,3 @@
-disk_cache_create() here looks up the users home directory from <pwd.h>
-which resolves to "/" in the build environment. I could not find an easy
-way to set the home directory to something else, so we disable this test
-for now.
-
---- a/src/compiler/glsl/tests/cache_test.c
-+++ b/src/compiler/glsl/tests/cache_test.c
-@@ -170,11 +170,6 @@
-    unsetenv("MESA_GLSL_CACHE_DIR");
-    unsetenv("XDG_CACHE_HOME");
- 
--   cache = disk_cache_create("test", "make_check", 0);
--   expect_non_null(cache, "disk_cache_create with no environment variables");
--
--   disk_cache_destroy(cache);
--
-    /* Test with XDG_CACHE_HOME set */
-    setenv("XDG_CACHE_HOME", CACHE_TEST_TMP "/xdg-cache-home", 1);
-    cache = disk_cache_create("test", "make_check", 0);
-
 This test fails on i686-linux. I couldn't come up with a regex that
 could be used to disable it just on i686-linux, so we disable it
 completely with this patch:
@@ -25,25 +5,15 @@ completely with this patch:
 https://gitlab.freedesktop.org/mesa/mesa/-/issues/4091
 
 diff --git a/src/util/meson.build b/src/util/meson.build
-index 0893f64..909b3e0 100644
+index 319b22d9bf7..93790c72675 100644
 --- a/src/util/meson.build
 +++ b/src/util/meson.build
-@@ -289,18 +289,6 @@ if with_tests
-      suite : ['util'],
-   )   
+@@ -344,7 +344,7 @@ if with_tests
+     )
+   endif
  
--  test(
--    'u_debug_stack',
--    executable(
--      'u_debug_stack_test',
--      files('u_debug_stack_test.cpp'),
--      include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
--      dependencies : [idep_mesautil, idep_gtest],
--      c_args : [c_msvc_compat_args],
--    ),
--     suite : ['util'],
--  )
--
-   process_test_exe = executable(
-     'process_test',
-     files('process_test.c'),
+-  foreach t: ['bitset', 'register_allocate', 'u_debug_stack', 'u_qsort']
++  foreach t: ['bitset', 'register_allocate', 'u_qsort']
+     test(
+       t,
+       executable(
diff --git a/gnu/packages/patches/meson-allow-dirs-outside-of-prefix.patch b/gnu/packages/patches/meson-allow-dirs-outside-of-prefix.patch
new file mode 100644
index 0000000000..f16daa8009
--- /dev/null
+++ b/gnu/packages/patches/meson-allow-dirs-outside-of-prefix.patch
@@ -0,0 +1,20 @@
+Source: https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/development/tools/build-managers/meson/allow-dirs-outside-of-prefix.patch
+--- a/mesonbuild/coredata.py
++++ b/mesonbuild/coredata.py
+@@ -506,7 +506,6 @@ class CoreData:
+             return value
+         if option.name.endswith('dir') and value.is_absolute() and \
+            option not in BULITIN_DIR_NOPREFIX_OPTIONS:
+-            # Value must be a subdir of the prefix
+             # commonpath will always return a path in the native format, so we
+             # must use pathlib.PurePath to do the same conversion before
+             # comparing.
+@@ -518,7 +517,7 @@ class CoreData:
+             try:
+                 value = value.relative_to(prefix)
+             except ValueError:
+-                raise MesonException(msg.format(option, value, prefix))
++                pass
+             if '..' in str(value):
+                 raise MesonException(msg.format(option, value, prefix))
+         return value.as_posix()
diff --git a/gnu/packages/patches/meson-for-build-rpath.patch b/gnu/packages/patches/meson-for-build-rpath.patch
deleted file mode 100644
index ef9a73f07c..0000000000
--- a/gnu/packages/patches/meson-for-build-rpath.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-This patch removes a part of meson that clears the rpath upon installation.
-This will only be applied to a special version of meson, used for the
-meson-build-system.
-
-Original patch for Meson 0.42.0 by Peter Mikkelsen <petermikkelsen10@gmail.com>
-
---- meson-0.47.1/mesonbuild/minstall.py.old	2018-08-10 11:01:27.812327013 +0200
-+++ meson-0.47.1/mesonbuild/minstall.py	2018-08-10 11:01:51.940368505 +0200
-@@ -436,15 +436,6 @@
-                         print("Symlink creation does not work on this platform. "
-                               "Skipping all symlinking.")
-                         printed_symlink_error = True
--            if os.path.isfile(outname):
--                try:
--                    depfixer.fix_rpath(outname, install_rpath, final_path,
--                                       install_name_mappings, verbose=False)
--                except SystemExit as e:
--                    if isinstance(e.code, int) and e.code == 0:
--                        pass
--                    else:
--                        raise
- 
- def run(args):
-     parser = buildparser()
diff --git a/gnu/packages/patches/metabat-fix-compilation.patch b/gnu/packages/patches/metabat-fix-compilation.patch
deleted file mode 100644
index 7086a96e86..0000000000
--- a/gnu/packages/patches/metabat-fix-compilation.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-This patch changes metabat so that (1) it is not build statically, (2) it uses
-shared libraries rather than static libraries where possible.
-
-diff --git a/SConstruct b/SConstruct
-index 69cdc0a..ac99bcb 100644
---- a/SConstruct
-+++ b/SConstruct
-@@ -26,8 +26,6 @@ debug = ARGUMENTS.get('DEBUG', None)
- build_flags = ['-Wall', '-g', '-std=c++11', '-fopenmp']
- link_flags = ['-lstdc++', '-lm', '-fopenmp']
- 
--if platform.platform(True, True).find('Darwin') == -1:
--    link_flags.extend(['-static', '-static-libgcc', '-static-libstdc++'])
- 
- if debug is None:
-     build_flags.extend(['-O3', '-DNDEBUG', '-Wno-unknown-pragmas', '-Wno-deprecated-declarations', '-Wno-overflow', '-Wno-unused-variable'])
-@@ -110,17 +108,17 @@ def findStaticOrShared( lib, testPaths, static_source_list, link_flag_list, stat
-     for path in testPaths:
-         if not os.path.isdir(path):
-             continue
-+        for testfile in ('%s/lib%s.so' % (path, lib), '%s/lib%s.dylib' % (path, lib)):
-+            if os.path.isfile(testfile):
-+                print "Found shared library %s as %s" % (lib, testfile)
-+                link_flag_list.extend( ["-L%s" % (path), "-l%s" % (lib) ] )
-+                return
-         for suffix in staticSuffixes:
-             testfile = '%s/lib%s%s' % (path, lib, suffix)
-             if os.path.isfile(testfile):
-                 static_source_list.append(testfile)
-                 print "Found static library %s as %s" % (lib, testfile)
-                 return
--        for testfile in ('%s/lib%s.so' % (path, lib), '%s/lib%s.dylib' % (path, lib)):
--            if os.path.isfile(testfile):
--                print "Found shared library %s as %s" % (lib, testfile)
--                link_flag_list.extend( ["-L%s" % (path), "-l%s" % (lib) ] )
--                return
-     print "Could not find library for %s!!! Looked in %s" % (lib, testPaths)
-     return
- 
diff --git a/gnu/packages/patches/mit-krb5-hurd.patch b/gnu/packages/patches/mit-krb5-hurd.patch
index d4962b1e60..449320cea4 100644
--- a/gnu/packages/patches/mit-krb5-hurd.patch
+++ b/gnu/packages/patches/mit-krb5-hurd.patch
@@ -148,18 +148,3 @@ index 7e981d4..d83b3b6 100644
 +# define MAXPATHLEN 4096
 +#endif
  #endif /* _DB_INT_H_ */
-diff --git a/src/tests/resolve/resolve.c b/src/tests/resolve/resolve.c
-index 7339d21..38f7253 100644
---- a/src/tests/resolve/resolve.c
-+++ b/src/tests/resolve/resolve.c
-@@ -73,6 +73,10 @@ char *strchr();
- #include <netinet/in.h>
- #include <netdb.h>
- 
-+#ifndef MAXHOSTNAMELEN
-+# define MAXHOSTNAMELEN 256
-+#endif
-+
- int
- main(argc, argv)
-     int argc;
diff --git a/gnu/packages/patches/mit-krb5-qualify-short-hostnames.patch b/gnu/packages/patches/mit-krb5-qualify-short-hostnames.patch
deleted file mode 100644
index 491a358731..0000000000
--- a/gnu/packages/patches/mit-krb5-qualify-short-hostnames.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-Fix a null pointer dereference when no DNS search path is configured.
-This showed up as a segfault while running the gsasl test suite.
-
-Taken from upstream:
-https://github.com/krb5/krb5/commit/cd82bf377e7fad2409c76bf8b241920692f34fda
-
-diff --git a/src/lib/krb5/os/dnsglue.c b/src/lib/krb5/os/dnsglue.c
-index e35ca9d76c..0cd213fdd7 100644
---- a/src/lib/krb5/os/dnsglue.c
-+++ b/src/lib/krb5/os/dnsglue.c
-@@ -91,7 +91,7 @@ static int initparse(struct krb5int_dns_state *);
- #define DECLARE_HANDLE(h) struct __res_state h
- #define INIT_HANDLE(h) (memset(&h, 0, sizeof(h)), res_ninit(&h) == 0)
- #define SEARCH(h, n, c, t, a, l) res_nsearch(&h, n, c, t, a, l)
--#define PRIMARY_DOMAIN(h) strdup(h.dnsrch[0])
-+#define PRIMARY_DOMAIN(h) ((h.dnsrch[0] == NULL) ? NULL : strdup(h.dnsrch[0]))
- #if HAVE_RES_NDESTROY
- #define DESTROY_HANDLE(h) res_ndestroy(&h)
- #else
-@@ -104,7 +104,8 @@ static int initparse(struct krb5int_dns_state *);
- #define DECLARE_HANDLE(h)
- #define INIT_HANDLE(h) (res_init() == 0)
- #define SEARCH(h, n, c, t, a, l) res_search(n, c, t, a, l)
--#define PRIMARY_DOMAIN(h) strdup(_res.defdname)
-+#define PRIMARY_DOMAIN(h) \
-+    ((_res.defdname == NULL) ? NULL : strdup(_res.defdname))
- #define DESTROY_HANDLE(h)
- 
- #endif
diff --git a/gnu/packages/patches/mixxx-link-qtscriptbytearray-qtscript.patch b/gnu/packages/patches/mixxx-link-qtscriptbytearray-qtscript.patch
new file mode 100644
index 0000000000..d7cd1c0d28
--- /dev/null
+++ b/gnu/packages/patches/mixxx-link-qtscriptbytearray-qtscript.patch
@@ -0,0 +1,25 @@
+From 7554aefc886d4ebc4b4c139a5cddcab6163cf72f Mon Sep 17 00:00:00 2001
+From: Vinicius Monego <monego@posteo.net>
+Date: Thu, 30 Sep 2021 23:37:29 -0300
+Subject: [PATCH] Link QtScriptByteArray with QtScript.
+
+---
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 492ccae..05fec08 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -2077,7 +2077,7 @@ add_library(QtScriptByteArray STATIC EXCLUDE_FROM_ALL
+   lib/qtscript-bytearray/bytearrayprototype.cpp
+ )
+ set_target_properties(QtScriptByteArray PROPERTIES AUTOMOC ON)
+-target_link_libraries(QtScriptByteArray Qt5::Core)
++target_link_libraries(QtScriptByteArray Qt5::Core Qt5::Script)
+ target_include_directories(mixxx-lib SYSTEM PUBLIC lib/qtscript-bytearray)
+ target_link_libraries(mixxx-lib PRIVATE QtScriptByteArray)
+ 
+-- 
+2.30.2
+
diff --git a/gnu/packages/patches/mixxx-system-googletest-benchmark.patch b/gnu/packages/patches/mixxx-system-googletest-benchmark.patch
new file mode 100644
index 0000000000..7adbe66208
--- /dev/null
+++ b/gnu/packages/patches/mixxx-system-googletest-benchmark.patch
@@ -0,0 +1,43 @@
+From eb2079d467f8658eea13e2ed86cc69d864632866 Mon Sep 17 00:00:00 2001
+From: Vinicius Monego <monego@posteo.net>
+Date: Wed, 29 Sep 2021 19:07:35 -0300
+Subject: [PATCH] Use system googletest and benchmark.
+
+---
+ CMakeLists.txt | 13 +++----------
+ 1 file changed, 3 insertions(+), 10 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 10e9b0a..492ccae 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1467,12 +1467,7 @@ set(gtest_force_shared_crt ON CACHE BOOL "Pass Mixxx compiler/linker options to
+ # Prevent installation of GoogleTest libraries
+ set(INSTALL_GTEST OFF CACHE BOOL "Disable installation of GoogleTest" FORCE)
+ 
+-# Add googletest directly to our build. This adds the following targets:
+-# gtest, gtest_main, gmock and gmock_main
+-add_subdirectory(
+-  "${CMAKE_CURRENT_SOURCE_DIR}/lib/googletest"
+-  "${CMAKE_CURRENT_BINARY_DIR}/lib/googletest"
+-)
++find_package(GTest CONFIG REQUIRED)
+ 
+ add_executable(mixxx-test
+   src/test/analyserwaveformtest.cpp
+@@ -1582,10 +1577,8 @@ set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "" FORCE)
+ # Prevent installation of google/benchmark artifacts
+ set(BENCHMARK_ENABLE_INSTALL OFF CACHE BOOL "Disable installation of google/benchmark" FORCE)
+ 
+-add_subdirectory(
+-  "${CMAKE_CURRENT_SOURCE_DIR}/lib/benchmark"
+-  "${CMAKE_CURRENT_BINARY_DIR}/lib/benchmark"
+-)
++find_package(benchmark CONFIG REQUIRED)
++
+ target_link_libraries(mixxx-test PRIVATE benchmark)
+ 
+ # Test Suite
+-- 
+2.30.2
+
diff --git a/gnu/packages/patches/monero-use-system-miniupnpc.patch b/gnu/packages/patches/monero-use-system-miniupnpc.patch
index c5d376d793..2bd179946f 100644
--- a/gnu/packages/patches/monero-use-system-miniupnpc.patch
+++ b/gnu/packages/patches/monero-use-system-miniupnpc.patch
@@ -1,14 +1,16 @@
 diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt
-index 7553f87e..8e865c6c 100644
+index 5b7f69a56..3a353a0f3 100644
 --- a/external/CMakeLists.txt
 +++ b/external/CMakeLists.txt
-@@ -37,19 +37,7 @@
+@@ -37,21 +37,7 @@
  
  find_package(Miniupnpc REQUIRED)
  
 -message(STATUS "Using in-tree miniupnpc")
+-set(UPNPC_NO_INSTALL TRUE CACHE BOOL "Disable miniupnp installation" FORCE)
 -add_subdirectory(miniupnp/miniupnpc)
 -set_property(TARGET libminiupnpc-static PROPERTY FOLDER "external")
+-set_property(TARGET libminiupnpc-static PROPERTY POSITION_INDEPENDENT_CODE ON)
 -if(MSVC)
 -  set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -wd4244 -wd4267")
 -elseif(NOT MSVC)
@@ -24,12 +26,12 @@ index 7553f87e..8e865c6c 100644
  find_package(Unbound)
  
 diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl
-index 74924e4f..3554dd0d 100644
+index d4b39869c..13071d898 100644
 --- a/src/p2p/net_node.inl
 +++ b/src/p2p/net_node.inl
-@@ -49,9 +49,9 @@
- #include "storages/levin_abstract_invoke2.h"
+@@ -61,9 +61,9 @@
  #include "cryptonote_core/cryptonote_core.h"
+ #include "net/parse.h"
  
 -#include <miniupnp/miniupnpc/miniupnpc.h>
 -#include <miniupnp/miniupnpc/upnpcommands.h>
diff --git a/gnu/packages/patches/mpg321-gcc-10.patch b/gnu/packages/patches/mpg321-gcc-10.patch
new file mode 100644
index 0000000000..8966d9f7c8
--- /dev/null
+++ b/gnu/packages/patches/mpg321-gcc-10.patch
@@ -0,0 +1,83 @@
+From f930c3b81bdf9c05152fb005562b3869f6e36f34 Mon Sep 17 00:00:00 2001
+From: "Azamat H. Hackimov" <azamat.hackimov@gmail.com>
+Date: Thu, 4 Jun 2020 20:41:25 +0300
+Subject: [PATCH] Fix GCC10 compilation
+
+---
+ mpg321.c |  8 ++++++++
+ mpg321.h | 16 ++++++++--------
+ 2 files changed, 16 insertions(+), 8 deletions(-)
+
+diff --git a/mpg321.c b/mpg321.c
+index 19282bb..663882e 100644
+--- a/mpg321.c
++++ b/mpg321.c
+@@ -63,6 +63,14 @@
+ #include <pthread.h>
+ #include <semaphore.h>
+ 
++output_frame *Output_Queue;
++decoded_frames *Decoded_Frames;
++int semarray;
++int mad_decoder_position;
++int output_buffer_position;
++double real[FFT_BUFFER_SIZE];
++double imag[FFT_BUFFER_SIZE];
++int loop_remaining;
+ 
+ int pflag = 0;
+ int volume = 0;
+diff --git a/mpg321.h b/mpg321.h
+index 798bff0..235cf4a 100644
+--- a/mpg321.h
++++ b/mpg321.h
+@@ -116,7 +116,7 @@ extern char *playlist_file;
+ extern int quit_now;
+ extern char remote_input_buf[PATH_MAX + 5];
+ extern int file_change;
+-int loop_remaining;
++extern int loop_remaining;
+ 
+ extern int status;
+ extern int scrobbler_time;
+@@ -233,8 +233,8 @@ RETSIGTYPE handle_sigchld(int sig);
+ #define FFT_BUFFER_SIZE_LOG 9
+ #define FFT_BUFFER_SIZE (1 << FFT_BUFFER_SIZE_LOG) /* 512 */
+ /*Temporary data stores to perform FFT in */
+-double real[FFT_BUFFER_SIZE];
+-double imag[FFT_BUFFER_SIZE];
++extern double real[FFT_BUFFER_SIZE];
++extern double imag[FFT_BUFFER_SIZE];
+ 
+ typedef struct {
+ 	double real[FFT_BUFFER_SIZE];
+@@ -258,10 +258,10 @@ fft_state *fft_init(void);
+ /* Output buffer process */
+ void frame_buffer_p();
+ /* Semaphore array */
+-int semarray;
++extern int semarray;
+ /* Input/Output buffer position */
+-int mad_decoder_position;
+-int output_buffer_position;
++extern int mad_decoder_position;
++extern int output_buffer_position;
+ /* Output Frame including needed information */
+ typedef struct {
+ 	unsigned char data[4*1152];
+@@ -285,10 +285,10 @@ typedef struct {
+ } decoded_frames;
+ 
+ /* Output frame queue pointer */
+-output_frame *Output_Queue;
++extern output_frame *Output_Queue;
+ 
+ /* Shared total decoded frames */
+-decoded_frames *Decoded_Frames;
++extern decoded_frames *Decoded_Frames;
+ 
+ #if defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)
+ /* */
+-- 
+2.26.2
+
diff --git a/gnu/packages/patches/mupdf-CVE-2021-3407.patch b/gnu/packages/patches/mupdf-CVE-2021-3407.patch
deleted file mode 100644
index 9f901517c5..0000000000
--- a/gnu/packages/patches/mupdf-CVE-2021-3407.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-This patch came from https://git.ghostscript.com/?p=mupdf.git;a=patch;h=cee7cefc610d42fd383b3c80c12cbc675443176a
-and fixes CVE-2021-3407.
-
-From cee7cefc610d42fd383b3c80c12cbc675443176a Mon Sep 17 00:00:00 2001
-From: Robin Watts <Robin.Watts@artifex.com>
-Date: Fri, 22 Jan 2021 17:05:15 +0000
-Subject: [PATCH] Bug 703366: Fix double free of object during linearization.
-
-This appears to happen because we parse an illegal object from
-a broken file and assign it to object 0, which is defined to
-be free.
-
-Here, we fix the parsing code so this can't happen.
----
- source/pdf/pdf-parse.c | 6 ++++++
- source/pdf/pdf-xref.c  | 2 ++
- 2 files changed, 8 insertions(+)
-
-diff --git a/source/pdf/pdf-parse.c b/source/pdf/pdf-parse.c
-index 7abc8c3d4..5761c3351 100644
---- a/source/pdf/pdf-parse.c
-+++ b/source/pdf/pdf-parse.c
-@@ -749,6 +749,12 @@ pdf_parse_ind_obj(fz_context *ctx, pdf_document *doc,
- 		fz_throw(ctx, FZ_ERROR_SYNTAX, "expected generation number (%d ? obj)", num);
- 	}
- 	gen = buf->i;
-+	if (gen < 0 || gen >= 65536)
-+	{
-+		if (try_repair)
-+			*try_repair = 1;
-+		fz_throw(ctx, FZ_ERROR_SYNTAX, "invalid generation number (%d)", gen);
-+	}
- 
- 	tok = pdf_lex(ctx, file, buf);
- 	if (tok != PDF_TOK_OBJ)
-diff --git a/source/pdf/pdf-xref.c b/source/pdf/pdf-xref.c
-index 1b2bdcd59..30197b4b8 100644
---- a/source/pdf/pdf-xref.c
-+++ b/source/pdf/pdf-xref.c
-@@ -1190,6 +1190,8 @@ pdf_read_new_xref(fz_context *ctx, pdf_document *doc, pdf_lexbuf *buf)
- 	{
- 		ofs = fz_tell(ctx, doc->file);
- 		trailer = pdf_parse_ind_obj(ctx, doc, doc->file, buf, &num, &gen, &stm_ofs, NULL);
-+		if (num == 0)
-+			fz_throw(ctx, FZ_ERROR_GENERIC, "Trailer object number cannot be 0\n");
- 	}
- 	fz_catch(ctx)
- 	{
--- 
-2.17.1
-
diff --git a/gnu/packages/patches/mupdf-fix-linkage.patch b/gnu/packages/patches/mupdf-fix-linkage.patch
deleted file mode 100644
index 4ffd1c6a77..0000000000
--- a/gnu/packages/patches/mupdf-fix-linkage.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From: Tobias Geerinckx-Rice <me@tobias.gr>
-Date: Tue, 24 Nov 2020 10:29:28 +0000
-Subject: [PATCH] gnu: mupdf: Fix linkage.
-
-Replace broken linkage to ‘build/shared-release/libmupdf.so’ with the
-proper ‘-L$(libdir) -lmupdf’ incantation, and fix libmupdf.so's mode.
-
---- mupdf-1.18.0-source.org/Makefile
-+++ mupdf-1.18.0-source/Makefile
-@@ -61,7 +61,7 @@
- ifdef RANLIB
-   RANLIB_CMD = $(QUIET_RANLIB) $(RANLIB) $@
- endif
--LINK_CMD = $(QUIET_LINK) $(MKTGTDIR) ; $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
-+LINK_CMD = $(QUIET_LINK) $(MKTGTDIR) ; $(CC) $(LDFLAGS) -o $@ $(subst $(MUPDF_LIB),-L$(libdir) -L$(OUT) -lmupdf,$^) $(LIBS)
- TAGS_CMD = $(QUIET_TAGS) ctags -R --c-kinds=+p
- WINDRES_CMD = $(QUIET_WINDRES) $(MKTGTDIR) ; $(WINDRES) $< $@
- OBJCOPY_CMD = $(QUIET_OBJCOPY) $(MKTGTDIR) ; $(LD) -r -b binary -z noexecstack -o $@ $<
-@@ -364,7 +364,7 @@ install: libs apps
- 	install -m 644 include/mupdf/pdf/*.h $(DESTDIR)$(incdir)/mupdf/pdf
- 
- 	install -d $(DESTDIR)$(libdir)
--	install -m 644 $(INSTALL_LIBS) $(DESTDIR)$(libdir)
-+	install -m 755 $(INSTALL_LIBS) $(DESTDIR)$(libdir)
- 
- 	install -d $(DESTDIR)$(bindir)
- 	install -m 755 $(TOOL_APPS) $(VIEW_APPS) $(DESTDIR)$(bindir)
diff --git a/gnu/packages/patches/nautilus-add-libportal-gtk3.patch b/gnu/packages/patches/nautilus-add-libportal-gtk3.patch
new file mode 100644
index 0000000000..cefa47cc64
--- /dev/null
+++ b/gnu/packages/patches/nautilus-add-libportal-gtk3.patch
@@ -0,0 +1,61 @@
+From 55cfd66ccca391fc144f5863ff6bfc1f3b137e2d Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ant=C3=B3nio=20Fernandes?= <antoniojpfernandes@gmail.com>
+Date: Tue, 21 Dec 2021 17:42:27 +0000
+Subject: [PATCH] general: Add libportal-gtk3 dependency
+
+The portal-gtk3.h header has been moved into a separate library which
+binds gtk3 explicitly.
+
+https://github.com/flatpak/libportal/pull/53
+---
+ build-aux/flatpak/org.gnome.Nautilus.json | 5 +++--  ;; Changes removed in Guix
+ build-aux/flatpak/org.gnome.Nautilus.yml  | 3 ++-    ;; Changes removed in Guix
+ meson.build                               | 4 +++-
+ src/meson.build                           | 1 +
+ src/nautilus-files-view.c                 | 2 +-
+ 5 files changed, 10 insertions(+), 5 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index 927216636..4626fa0bb 100644
+--- a/meson.build
++++ b/meson.build
+@@ -122,8 +122,10 @@ gnome_desktop = dependency('gnome-desktop-3.0', version: '>= 3.0.0')
+ gtk = dependency('gtk+-3.0', version: '>= 3.22.27')
+ libhandy = dependency('libhandy-1', version: '>= 1.1.90')
+ libportal = []
++libportal_gtk3 = []
+ if get_option('libportal')
+-  libportal = dependency('libportal', version: '>= 0.3')
++  libportal = dependency('libportal', version: '>= 0.5')
++  libportal_gtk3 = dependency('libportal-gtk3', version: '>= 0.5')
+ endif
+ selinux = []
+ if get_option('selinux')
+diff --git a/src/meson.build b/src/meson.build
+index 682d6f3a3..d7fb76d53 100644
+--- a/src/meson.build
++++ b/src/meson.build
+@@ -285,6 +285,7 @@ nautilus_deps = [
+   libgd_dep,
+   libhandy,
+   libportal,
++  libportal_gtk3,
+   nautilus_extension,
+   selinux,
+   tracker_sparql,
+diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
+index dfb7fb26c..a24005a11 100644
+--- a/src/nautilus-files-view.c
++++ b/src/nautilus-files-view.c
+@@ -93,7 +93,7 @@
+ 
+ #ifdef HAVE_LIBPORTAL
+ #include <libportal/portal.h>
+-#include <libportal/portal-gtk3.h>
++#include <libportal-gtk3/portal-gtk3.h>
+ #endif
+ 
+ /* Minimum starting update inverval */
+-- 
+GitLab
+
diff --git a/gnu/packages/patches/network-manager-meson.patch b/gnu/packages/patches/network-manager-meson.patch
new file mode 100644
index 0000000000..1056d40ede
--- /dev/null
+++ b/gnu/packages/patches/network-manager-meson.patch
@@ -0,0 +1,21 @@
+Since libnm-wwan.so is not just a loadable module but also a shared library
+that some plugin links against, build it as a shared library while avoiding
+'-Wl,--no-undefined':
+
+  https://github.com/mesonbuild/meson/issues/9492#issuecomment-973117289
+
+diff --git a/src/core/devices/wwan/meson.build b/src/core/devices/wwan/meson.build
+index 37ef738..18ac54f 100644
+--- a/src/core/devices/wwan/meson.build
++++ b/src/core/devices/wwan/meson.build
+@@ -4,8 +4,9 @@ wwan_inc = include_directories('.')
+ 
+ linker_script = join_paths(meson.current_source_dir(), 'libnm-wwan.ver')
+ 
+-libnm_wwan = shared_module(
++libnm_wwan = shared_library(
+   'nm-wwan',
++  override_options: ['b_lundef=false'],
+   sources: files(
+   'nm-service-providers.c',
+   'nm-modem-broadband.c',
diff --git a/gnu/packages/patches/network-manager-plugin-path.patch b/gnu/packages/patches/network-manager-plugin-path.patch
index 505ae31534..ec6767aaac 100644
--- a/gnu/packages/patches/network-manager-plugin-path.patch
+++ b/gnu/packages/patches/network-manager-plugin-path.patch
@@ -3,49 +3,40 @@ From: =?UTF-8?q?Tom=C3=A1=C5=A1=20=C4=8Cech?= <sleep_walker@gnu.org>
 Date: Wed, 3 Jul 2019 13:31:54 +0200
 Subject: [PATCH] respect NM_VPN_PLUGIN_DIR
 
----
- src/vpn/nm-vpn-manager.c | 14 ++++++++++++++
- 1 file changed, 14 insertions(+)
-
-diff --git a/src/vpn/nm-vpn-manager.c b/src/vpn/nm-vpn-manager.c
-index d063916..d779166 100644
---- a/src/vpn/nm-vpn-manager.c
-+++ b/src/vpn/nm-vpn-manager.c
-@@ -223,6 +223,7 @@ nm_vpn_manager_init (NMVpnManager *self)
- 	GSList *infos, *info;
- 	const char *conf_dir_etc = _nm_vpn_plugin_info_get_default_dir_etc ();
- 	const char *conf_dir_lib = _nm_vpn_plugin_info_get_default_dir_lib ();
-+	const char *conf_dir_user = _nm_vpn_plugin_info_get_default_dir_user ();
+--- a/src/core/vpn/nm-vpn-manager.c	2021-10-29 13:20:01.062917840 -0400
++++ b/src/core/vpn/nm-vpn-manager.c	2021-10-29 13:26:46.094397018 -0400
+@@ -211,6 +211,7 @@
+     GSList *             infos, *info;
+     const char *         conf_dir_etc = _nm_vpn_plugin_info_get_default_dir_etc();
+     const char *         conf_dir_lib = _nm_vpn_plugin_info_get_default_dir_lib();
++    const char *         conf_dir_user = _nm_vpn_plugin_info_get_default_dir_user ();
  
- 	/* Watch the VPN directory for changes */
- 	file = g_file_new_for_path (conf_dir_lib);
-@@ -241,6 +242,14 @@ nm_vpn_manager_init (NMVpnManager *self)
- 		                                         G_CALLBACK (vpn_dir_changed), self);
- 	}
+     /* Watch the VPN directory for changes */
+     file              = g_file_new_for_path(conf_dir_lib);
+@@ -229,6 +230,14 @@
+             g_signal_connect(priv->monitor_etc, "changed", G_CALLBACK(vpn_dir_changed), self);
+     }
  
-+	file = g_file_new_for_path (conf_dir_user);
-+	priv->monitor_etc = g_file_monitor_directory (file, G_FILE_MONITOR_NONE, NULL, NULL);
-+	g_object_unref (file);
-+	if (priv->monitor_etc) {
-+		priv->monitor_id_etc = g_signal_connect (priv->monitor_etc, "changed",
-+		                                         G_CALLBACK (vpn_dir_changed), self);
-+	}
++    file              = g_file_new_for_path (conf_dir_user);
++    priv->monitor_etc = g_file_monitor_directory (file, G_FILE_MONITOR_NONE, NULL, NULL);
++    g_object_unref (file);
++    if (priv->monitor_etc) {
++        priv->monitor_id_etc =
++            g_signal_connect (priv->monitor_etc, "changed", G_CALLBACK (vpn_dir_changed), self);
++    }
 +
- 	/* first read conf_dir_lib. The name files are not really user configuration, but
- 	 * plugin configuration. Hence we expect ~newer~ plugins to install their files
- 	 * in /usr/lib/NetworkManager. We want to prefer those files.
-@@ -255,6 +264,11 @@ nm_vpn_manager_init (NMVpnManager *self)
- 		try_add_plugin (self, info->data);
- 	g_slist_free_full (infos, g_object_unref);
+     /* first read conf_dir_lib. The name files are not really user configuration, but
+      * plugin configuration. Hence we expect ~newer~ plugins to install their files
+      * in /usr/lib/NetworkManager. We want to prefer those files.
+@@ -243,6 +252,11 @@
+         try_add_plugin(self, info->data);
+     g_slist_free_full(infos, g_object_unref);
  
-+	infos = _nm_vpn_plugin_info_list_load_dir (conf_dir_user, TRUE, 0, NULL, NULL);
-+	for (info = infos; info; info = info->next)
-+		try_add_plugin (self, info->data);
-+	g_slist_free_full (infos, g_object_unref);
++    infos = _nm_vpn_plugin_info_list_load_dir(conf_dir_user, TRUE, 0, NULL, NULL);
++    for (info = infos; info; info = info->next)
++            try_add_plugin (self, info->data);
++    g_slist_free_full (infos, g_object_unref);
 +
- 	priv->active_services = g_hash_table_new_full (nm_str_hash, g_str_equal, g_free, NULL);
+     priv->active_services = g_hash_table_new_full(nm_str_hash, g_str_equal, g_free, NULL);
  }
  
--- 
-2.22.0
-
diff --git a/gnu/packages/patches/ngless-unliftio.patch b/gnu/packages/patches/ngless-unliftio.patch
new file mode 100644
index 0000000000..87f5e79fcf
--- /dev/null
+++ b/gnu/packages/patches/ngless-unliftio.patch
@@ -0,0 +1,66 @@
+From 919565adc1216b9d3108b3043e8d307292b37393 Mon Sep 17 00:00:00 2001
+From: Luis Pedro Coelho <luis@luispedro.org>
+Date: Fri, 7 May 2021 11:42:56 +0800
+Subject: [PATCH] BLD Update to LTS-17.10
+
+- Updates the GHC version
+- Requires `extra-deps` for `diagrams` package
+- Simplifies code for NGLessIO monad as UnliftIO can now be auto-derived
+---
+ NGLess/NGLess/NGError.hs |  8 ++------
+ stack.yaml               | 11 ++++++++---
+ 2 files changed, 10 insertions(+), 9 deletions(-)
+
+diff --git a/NGLess/NGLess/NGError.hs b/NGLess/NGLess/NGError.hs
+index a22e557f..c7eddf5b 100644
+--- a/NGLess/NGLess/NGError.hs
++++ b/NGLess/NGLess/NGError.hs
+@@ -50,7 +50,8 @@ type NGLess = Either NGError
+ 
+ newtype NGLessIO a = NGLessIO { unwrapNGLessIO :: ResourceT IO a }
+                         deriving (Functor, Applicative, Monad, MonadIO,
+-                        MonadResource, MonadThrow, MonadCatch, MonadMask)
++                        MonadResource, MonadThrow, MonadCatch, MonadMask,
++                        MonadUnliftIO)
+ 
+ 
+ instance MonadError NGError NGLessIO where
+@@ -62,11 +63,6 @@ instance PrimMonad NGLessIO where
+     primitive act = NGLessIO (primitive act)
+     {-# INLINE primitive #-}
+ 
+-instance MonadUnliftIO NGLessIO where
+-    askUnliftIO = NGLessIO $ do
+-        u <- askUnliftIO
+-        return $ UnliftIO (\(NGLessIO act) -> unliftIO u act)
+-
+ instance MonadFail NGLessIO where
+     fail err = throwShouldNotOccur err
+ 
+diff --git a/stack.yaml b/stack.yaml
+index 051d973d..11b65887 100644
+--- a/stack.yaml
++++ b/stack.yaml
+@@ -1,14 +1,19 @@
+ # For more information, see: https://github.com/commercialhaskell/stack/blob/release/doc/yaml_configuration.md
+ 
+-resolver: lts-14.20
++resolver: lts-17.10
+ compiler-check: newer-minor
+ 
+ # Packages to be pulled from upstream that are not in the resolver (e.g., acme-missiles-0.3)
+ extra-deps:
+   - git: "https://github.com/ngless-toolkit/interval-to-int"
+     commit: "78289f6b48d41f7cc48169520ec9b77b050a0029"
+-
+-
++  - diagrams-core-1.4.2@sha256:47de45658e8a805b7cb7f535e7b093daf7e861604fa3c70e25bd4ef481bf1571,2997
++  - diagrams-lib-1.4.3@sha256:04f77778d4b550d3c8e54440800685f88467bef91075e82e009a8a6f45c51033,8232
++  - diagrams-svg-1.4.3@sha256:36708b0b4cf35507ccf689f1a25f6f81b8f41c2c4c2900793de820f66d4e241c,3181
++  - active-0.2.0.14@sha256:e618aba4a7881eb85dc1585e0a01230af6b4fbab6693931e4a5d0d3a5b184406,1823
++  - dual-tree-0.2.2.1@sha256:9ff31e461d873ae74ba51d93b454c0c4094726d7cb78a0c454394c965e83539d,2830
++  - monoid-extras-0.5.1@sha256:438dbfd7b4dce47d8f0ca577f56caf94bd1e21391afa545cad09fe7cf2e5793d,2333
++  - svg-builder-0.1.1@sha256:22de54d326a6b6912e461e1302edb9108b02aac0b6a6368fcdc3c4a224d487fd,1440
+ allow-newer: true
+ 
+ # Override default flag values for local packages and extra-deps
diff --git a/gnu/packages/patches/nix-dont-build-html-doc.diff b/gnu/packages/patches/nix-dont-build-html-doc.diff
new file mode 100644
index 0000000000..79142bc215
--- /dev/null
+++ b/gnu/packages/patches/nix-dont-build-html-doc.diff
@@ -0,0 +1,26 @@
+"--enable-doc-gen" configure flag will enable HTML document generation that requires mdbook.
+We can't simply disable it because we need manpages.
+
+Author: Zhu Zihao <all_but_last@163.com>
+
+diff --git a/doc/manual/local.mk b/doc/manual/local.mk
+index e43d9f2fb..c323d1847 100644
+--- a/doc/manual/local.mk
++++ b/doc/manual/local.mk
+@@ -69,8 +69,6 @@ $(d)/builtins.json: $(bindir)/nix
+ 	$(trace-gen) $(dummy-env) NIX_PATH=nix/corepkgs=corepkgs $(bindir)/nix __dump-builtins > $@.tmp
+ 	@mv $@.tmp $@
+ 
+-# Generate the HTML manual.
+-install: $(docdir)/manual/index.html
+ 
+ # Generate 'nix' manpages.
+ install: $(mandir)/man1/nix3-manpages
+@@ -94,7 +92,5 @@ doc/manual/generated/man1/nix3-manpages: $(d)/src/command-ref/new-cli
+ 	done
+ 	@touch $@
+ 
+-$(docdir)/manual/index.html: $(MANUAL_SRCS) $(d)/book.toml $(d)/custom.css $(d)/src/SUMMARY.md $(d)/src/command-ref/new-cli $(d)/src/command-ref/conf-file.md $(d)/src/expressions/builtins.md $(call rwildcard, $(d)/src, *.md)
+-	$(trace-gen) RUST_LOG=warn mdbook build doc/manual -d $(DESTDIR)$(docdir)/manual
+ 
+ endif
diff --git a/gnu/packages/patches/nss-getcwd-nonnull.patch b/gnu/packages/patches/nss-getcwd-nonnull.patch
new file mode 100644
index 0000000000..37c1b1c539
--- /dev/null
+++ b/gnu/packages/patches/nss-getcwd-nonnull.patch
@@ -0,0 +1,30 @@
+Disable -Werror=nonnull on getcwd(0, 4096) because GCC incorrectly warns that
+the second argument should be NULL with recent glibc.  See:
+
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96832
+https://sourceware.org/bugzilla/show_bug.cgi?id=26545
+
+diff --git a/nss/coreconf/nsinstall/nsinstall.c b/nss/coreconf/nsinstall/nsinstall.c
+--- a/nss/coreconf/nsinstall/nsinstall.c
++++ b/nss/coreconf/nsinstall/nsinstall.c
+@@ -236,14 +236,20 @@ main(int argc, char **argv)
+ 	return 0;
+ 
+     if (!cwd) {
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Wnonnull"
+ 	cwd = GETCWD(0, PATH_MAX);
++#pragma GCC diagnostic pop
+ 	if (!cwd)
+ 	    fail("could not get CWD");
+     }
+ 
+     /* make sure we can get into todir. */
+     xchdir(todir);
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Wnonnull"
+     todir = GETCWD(0, PATH_MAX);
++#pragma GCC diagnostic pop
+     if (!todir)
+ 	fail("could not get CWD in todir");
+     tdlen = strlen(todir);
diff --git a/gnu/packages/patches/ocaml-4.09-multiple-definitions.patch b/gnu/packages/patches/ocaml-4.09-multiple-definitions.patch
new file mode 100644
index 0000000000..b2661f822c
--- /dev/null
+++ b/gnu/packages/patches/ocaml-4.09-multiple-definitions.patch
@@ -0,0 +1,41 @@
+Avoid multiply-defined symbols that lead to link errors such as:
+
+  ld: libcamlrund.a(backtrace_bd.o):/tmp/guix-build-ocaml-4.09.0.drv-0/ocaml-4.09.0/runtime/backtrace.c:31: multiple definition of `caml_debug_info'; libcamlrund.a(backtrace_byt_bd.o):/tmp/guix-build-ocaml-4.09.0.drv-0/ocaml-4.09.0/runtime/backtrace_byt.c:47: first defined here
+
+diff --git a/runtime/backtrace.c b/runtime/backtrace.c
+index a3c2c08..f57c81c 100644
+--- a/runtime/backtrace.c
++++ b/runtime/backtrace.c
+@@ -28,7 +28,7 @@
+ #include "caml/fail.h"
+ 
+ /* The table of debug information fragments */
+-struct ext_table caml_debug_info;
++static struct ext_table caml_debug_info;
+ 
+ CAMLexport int32_t caml_backtrace_active = 0;
+ CAMLexport int32_t caml_backtrace_pos = 0;
+diff --git a/runtime/backtrace_byt.c b/runtime/backtrace_byt.c
+index b913dac..b5ec926 100644
+--- a/runtime/backtrace_byt.c
++++ b/runtime/backtrace_byt.c
+@@ -44,7 +44,7 @@
+ #include "caml/backtrace_prim.h"
+ 
+ /* The table of debug information fragments */
+-struct ext_table caml_debug_info;
++static struct ext_table caml_debug_info;
+ 
+ CAMLexport char_os * caml_cds_file = NULL;
+ 
+diff --git a/runtime/startup_nat.c b/runtime/startup_nat.c
+index b4e6bc4..7eca5fa 100644
+--- a/runtime/startup_nat.c
++++ b/runtime/startup_nat.c
+@@ -44,6 +44,5 @@
+ #endif
+ 
+ extern int caml_parser_trace;
+-CAMLexport header_t caml_atom_table[256];
+ char * caml_code_area_start, * caml_code_area_end;
+ struct ext_table caml_code_fragments_table;
diff --git a/gnu/packages/patches/ocaml-cairo2-caml_ba_array-fix.patch b/gnu/packages/patches/ocaml-cairo2-caml_ba_array-fix.patch
deleted file mode 100644
index 1ebde1997f..0000000000
--- a/gnu/packages/patches/ocaml-cairo2-caml_ba_array-fix.patch
+++ /dev/null
@@ -1,68 +0,0 @@
-From 3c70f2ff18650c4794556049cd4ea22a58cc719e Mon Sep 17 00:00:00 2001
-From: Christophe Troestler <Christophe.Troestler@umons.ac.be>
-Date: Sun, 27 Sep 2020 23:20:52 +0200
-Subject: [PATCH] Do not store the Caml_ba_array_val pointer during surface
- creation
-
-Extracted from Cairo git-tree on November 22, 2020 by
-Brett Gilio <brettg@gnu.org>
----
- src/cairo_stubs.c     | 3 ++-
- tests/image_create.ml | 5 +++--
- 2 files changed, 5 insertions(+), 3 deletions(-)
-
-diff --git a/src/cairo_stubs.c b/src/cairo_stubs.c
-index 641ee2c..200abf3 100644
---- a/src/cairo_stubs.c
-+++ b/src/cairo_stubs.c
-@@ -1580,6 +1580,7 @@ static cairo_status_t caml_cairo_image_bigarray_attach_proxy
-                                      caml_cairo_image_bigarray_finalize);
- }
- 
-+#define b (Caml_ba_array_val(vb))
- #define SURFACE_CREATE_DATA(name)                                       \
-   CAMLexport value caml_cairo_image_surface_create_for_##name           \
-   (value vb, value vformat, value vwidth, value vheight, value vstride) \
-@@ -1588,7 +1589,6 @@ static cairo_status_t caml_cairo_image_bigarray_attach_proxy
-     CAMLlocal1(vsurf);                                                  \
-     cairo_surface_t* surf;                                              \
-     const int width =  Int_val(vwidth);                                 \
--    struct caml_ba_array *b = Caml_ba_array_val(vb);                    \
-     cairo_status_t status;                                              \
-                                                                         \
-     if ((b->flags & CAML_BA_MANAGED_MASK) == CAML_BA_MAPPED_FILE)       \
-@@ -1610,6 +1610,7 @@ static cairo_status_t caml_cairo_image_bigarray_attach_proxy
- 
- SURFACE_CREATE_DATA(data8)
- SURFACE_CREATE_DATA(data32)
-+#undef b
- 
- #define SURFACE_GET_DATA(type, num_dims, dims ...)                      \
-   CAMLexport value caml_cairo_image_surface_get_##type(value vsurf)     \
-diff --git a/tests/image_create.ml b/tests/image_create.ml
-index eec98d6..b13c206 100644
---- a/tests/image_create.ml
-+++ b/tests/image_create.ml
-@@ -10,6 +10,7 @@ let create() =
- 
- let () =
-   let cr = create() in
-+  printf "With Cairo handle:\n%!";
-   set_source_rgb cr 1. 1. 1.;
-   rectangle cr 0. 0. ~w:300. ~h:300.;
-   fill cr;
-@@ -21,9 +22,9 @@ let () =
-   show_text cr "Hello";
-   Gc.compact();  Gc.compact();
- 
--  eprintf "Write image\n%!";
-+  eprintf "- Write image\n%!";
-   PNG.write (get_target cr) "test_image.png";
--  eprintf "Finish surface\n%!";
-+  eprintf "- Finish surface\n%!";
-   Surface.finish (get_target cr);
-   Gc.compact()
- 
--- 
-2.29.2
-
diff --git a/gnu/packages/patches/ocaml-multiple-definitions.patch b/gnu/packages/patches/ocaml-multiple-definitions.patch
new file mode 100644
index 0000000000..e8678f4f64
--- /dev/null
+++ b/gnu/packages/patches/ocaml-multiple-definitions.patch
@@ -0,0 +1,43 @@
+Avoid multiply-defined symbols that lead to link errors such as:
+
+  gcc -O2 -fno-strict-aliasing -fwrapv -Wall -fno-tree-vrp  -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE  -Wl,-E -o ocamlruni prims.o libcamlruni.a -lm  -ldl -lpthread 
+  ld: libcamlruni.a(backtrace.i.o):/tmp/guix-build-ocaml-4.07.1.drv-0/ocaml-4.07.1/byterun/backtrace.c:31: multiple definition of `caml_debug_info'; libcamlruni.a(backtrace_prim.i.o):/tmp/guix-build-ocaml-4.07.1.drv-0/ocaml-4.07.1/byterun/backtrace_prim.c:47: first defined here
+
+diff --git a/asmrun/startup.c b/asmrun/startup.c
+index 070f0c6..cf8a56f 100644
+--- a/asmrun/startup.c
++++ b/asmrun/startup.c
+@@ -44,7 +44,6 @@
+ #endif
+ 
+ extern int caml_parser_trace;
+-CAMLexport header_t caml_atom_table[256];
+ char * caml_code_area_start, * caml_code_area_end;
+ struct ext_table caml_code_fragments_table;
+ 
+diff --git a/byterun/backtrace.c b/byterun/backtrace.c
+index 8dfe9b7..9cc9e72 100644
+--- a/byterun/backtrace.c
++++ b/byterun/backtrace.c
+@@ -28,7 +28,7 @@
+ #include "caml/fail.h"
+ 
+ /* The table of debug information fragments */
+-struct ext_table caml_debug_info;
++static struct ext_table caml_debug_info;
+ 
+ CAMLexport int32_t caml_backtrace_active = 0;
+ CAMLexport int32_t caml_backtrace_pos = 0;
+diff --git a/byterun/backtrace_prim.c b/byterun/backtrace_prim.c
+index e69b256..d794f73 100644
+--- a/byterun/backtrace_prim.c
++++ b/byterun/backtrace_prim.c
+@@ -44,7 +44,7 @@
+ #include "caml/backtrace_prim.h"
+ 
+ /* The table of debug information fragments */
+-struct ext_table caml_debug_info;
++static struct ext_table caml_debug_info;
+ 
+ CAMLexport char_os * caml_cds_file = NULL;
+ 
diff --git a/gnu/packages/patches/ocaml-ppx-variants-ppxlib-api-change.patch b/gnu/packages/patches/ocaml-ppx-variants-ppxlib-api-change.patch
deleted file mode 100644
index b437bfb061..0000000000
--- a/gnu/packages/patches/ocaml-ppx-variants-ppxlib-api-change.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 6103f6fc56f978c847ba7c1f2d9f38ee93a5e337 Mon Sep 17 00:00:00 2001
-From: Sonja Heinze <sonjaleaheinze@gmail.com>
-Date: Tue, 9 Mar 2021 12:57:47 +0100
-Subject: [PATCH] Adapt to Ppxlib's API change
-
-Ppxlib is removing Lexer.keyword_table from the API in exchange for
-the more lightweight Keyword.is_keyword.
-
-Signed-off-by: Sonja Heinze <sonjaleaheinze@gmail.com>
----
-Patch from <https://github.com/janestreet/ppx_variants_conv/pull/9>.
-
- ppx_variants_conv.opam   | 2 +-
- src/ppx_variants_conv.ml | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/ppx_variants_conv.opam b/ppx_variants_conv.opam
-index 7e7148d..b56040f 100644
---- a/ppx_variants_conv.opam
-+++ b/ppx_variants_conv.opam
-@@ -15,7 +15,7 @@ depends: [
-   "base"        {>= "v0.14" & < "v0.15"}
-   "variantslib" {>= "v0.14" & < "v0.15"}
-   "dune"        {>= "2.0.0"}
--  "ppxlib"      {>= "0.14.0"}
-+  "ppxlib"      {>= "0.23.0"}
- ]
- synopsis: "Generation of accessor and iteration functions for ocaml variant types"
- description: "
-diff --git a/src/ppx_variants_conv.ml b/src/ppx_variants_conv.ml
-index 8d60086..112fc78 100644
---- a/src/ppx_variants_conv.ml
-+++ b/src/ppx_variants_conv.ml
-@@ -66,7 +66,7 @@ end
- 
- let variant_name_to_string v =
-   let s = String.lowercase v in
--  if Caml.Hashtbl.mem Lexer.keyword_table s
-+  if Keyword.is_keyword s
-   then s ^ "_"
-   else s
- 
diff --git a/gnu/packages/patches/ocaml-qcheck-fix-test-whitespace.patch b/gnu/packages/patches/ocaml-qcheck-fix-test-whitespace.patch
new file mode 100644
index 0000000000..012f5de31c
--- /dev/null
+++ b/gnu/packages/patches/ocaml-qcheck-fix-test-whitespace.patch
@@ -0,0 +1,24 @@
+From 0cb666fffcbeb78c8c14d271b3ba65ea514bfc44 Mon Sep 17 00:00:00 2001
+From: Julien Lepiller <julien@lepiller.eu>
+Date: Fri, 19 Nov 2021 03:03:21 +0100
+Subject: [PATCH] Fix whitespace issue in test
+
+---
+ example/alcotest/output.txt.expected | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/example/alcotest/output.txt.expected b/example/alcotest/output.txt.expected
+index bde0b83..9f1417c 100644
+--- a/example/alcotest/output.txt.expected
++++ b/example/alcotest/output.txt.expected
+@@ -16,7 +16,6 @@ test `fail_sort_id` failed on ≥ 1 cases: [1; 0] (after 20 shrink steps)
+ [exception] test `fail_sort_id` failed on ≥ 1 cases: [1; 0] (after 20 shrink steps)
+                                            
+             
+-
+  ──────────────────────────────────────────────────────────────────────────────
+ 
+ 3 failures! 5 tests run.
+-- 
+2.33.1
+
diff --git a/gnu/packages/patches/opencv-fix-build-of-grfmt_jpeg2000.cpp.patch b/gnu/packages/patches/opencv-fix-build-of-grfmt_jpeg2000.cpp.patch
deleted file mode 100644
index 8deb60296a..0000000000
--- a/gnu/packages/patches/opencv-fix-build-of-grfmt_jpeg2000.cpp.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From: Tobias Geerinckx-Rice <me@tobias.gr>
-Date: Thu, 13 Aug 2020 15:21:30 +0200
-Subject: [PATCH] gnu: opencv: Fix build with Jasper 2.0.19.
-
-Taken verbatim from upstream: <https://github.com/opencv/opencv/issues/17984>.
-
-From f66fc199a20882c546fa31142e9c0f5a8b3cf983 Mon Sep 17 00:00:00 2001
-From: Florian Jung <flo@windfis.ch>
-Date: Wed, 29 Jul 2020 18:51:55 +0200
-Subject: [PATCH] Fix build of grfmt_jpeg2000.cpp
-
-libjasper has recently changed `jas_matrix_get` from a macro to an inline function
-(389951d071 in https://github.com/jasper-software/jasper), causing the build to fail.
----
- modules/imgcodecs/src/grfmt_jpeg2000.cpp | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/modules/imgcodecs/src/grfmt_jpeg2000.cpp b/modules/imgcodecs/src/grfmt_jpeg2000.cpp
-index fe69f80c86f..0f4d28d6f4d 100644
---- a/modules/imgcodecs/src/grfmt_jpeg2000.cpp
-+++ b/modules/imgcodecs/src/grfmt_jpeg2000.cpp
-@@ -377,7 +377,7 @@ bool  Jpeg2KDecoder::readComponent8u( uchar *data, void *_buffer,
- 
-     for( y = 0; y < yend - ystart; )
-     {
--        jas_seqent_t* pix_row = &jas_matrix_get( buffer, y / ystep, 0 );
-+        jas_seqent_t* pix_row = jas_matrix_getref( buffer, y / ystep, 0 );
-         uchar* dst = data + (y - yoffset) * step - xoffset;
- 
-         if( xstep == 1 )
-@@ -443,7 +443,7 @@ bool  Jpeg2KDecoder::readComponent16u( unsigned short *data, void *_buffer,
- 
-     for( y = 0; y < yend - ystart; )
-     {
--        jas_seqent_t* pix_row = &jas_matrix_get( buffer, y / ystep, 0 );
-+        jas_seqent_t* pix_row = jas_matrix_getref( buffer, y / ystep, 0 );
-         ushort* dst = data + (y - yoffset) * step - xoffset;
- 
-         if( xstep == 1 )
diff --git a/gnu/packages/patches/opencv-rgbd-aarch64-test-fix.patch b/gnu/packages/patches/opencv-rgbd-aarch64-test-fix.patch
deleted file mode 100644
index 7792f8d1bf..0000000000
--- a/gnu/packages/patches/opencv-rgbd-aarch64-test-fix.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-https://github.com/opencv/opencv_contrib/commit/8aaa91c3dc835690477d7777e66948dbf5a87edc.patch
-
-From 8aaa91c3dc835690477d7777e66948dbf5a87edc Mon Sep 17 00:00:00 2001
-From: Tomoaki Teshima <tomoaki.teshima@gmail.com>
-Date: Mon, 5 Nov 2018 20:32:23 +0900
-Subject: [PATCH] avoid test failing on Aarch64   * loosen the threshold in
- Rgbd_Normals.compute   * make the minimum tvec larger in
- RGBD_Odometry_Rgbd.algorithmic
-
----
- modules/rgbd/test/test_normal.cpp   | 2 +-
- modules/rgbd/test/test_odometry.cpp | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/modules/rgbd/test/test_normal.cpp b/modules/rgbd/test/test_normal.cpp
-index f2233553a7..ed54f2cd98 100644
---- a/modules/rgbd/test/test_normal.cpp
-+++ b/modules/rgbd/test/test_normal.cpp
-@@ -211,7 +211,7 @@ class CV_RgbdNormalsTest: public cvtest::BaseTest
-             std::cout << std::endl << "*** FALS" << std::endl;
-             errors[0][0] = 0.006f;
-             errors[0][1] = 0.03f;
--            errors[1][0] = 0.00008f;
-+            errors[1][0] = 0.0001f;
-             errors[1][1] = 0.02f;
-             break;
-           case 1:
-diff --git a/modules/rgbd/test/test_odometry.cpp b/modules/rgbd/test/test_odometry.cpp
-index 62b654a1ec..f5a2084504 100644
---- a/modules/rgbd/test/test_odometry.cpp
-+++ b/modules/rgbd/test/test_odometry.cpp
-@@ -213,7 +213,7 @@ void CV_OdometryTest::generateRandomTransformation(Mat& rvec, Mat& tvec)
-     normalize(rvec, rvec, rng.uniform(0.007f, maxRotation));
- 
-     randu(tvec, Scalar(-1000), Scalar(1000));
--    normalize(tvec, tvec, rng.uniform(0.007f, maxTranslation));
-+    normalize(tvec, tvec, rng.uniform(0.008f, maxTranslation));
- }
- 
- void CV_OdometryTest::run(int)
diff --git a/gnu/packages/patches/openrgb-unbundle-hueplusplus.patch b/gnu/packages/patches/openrgb-unbundle-hueplusplus.patch
new file mode 100644
index 0000000000..7454e1efbe
--- /dev/null
+++ b/gnu/packages/patches/openrgb-unbundle-hueplusplus.patch
@@ -0,0 +1,58 @@
+Remove references to hueplusplus in order to unbundle and use the input package.
+
+diff --git a/OpenRGB.pro b/OpenRGB.pro
+index 61758892..8702d998 100644
+--- a/OpenRGB.pro
++++ b/OpenRGB.pro
+@@ -493,35 +493,6 @@ SOURCES +=
+     dependencies/Swatches/swatches.cpp                                                          \
+     dependencies/dmiinfo.cpp                                                                    \
+     dependencies/ColorWheel/ColorWheel.cpp                                                      \
+-    dependencies/hueplusplus-1.0.0/src/Action.cpp                                               \
+-    dependencies/hueplusplus-1.0.0/src/APICache.cpp                                             \
+-    dependencies/hueplusplus-1.0.0/src/BaseDevice.cpp                                           \
+-    dependencies/hueplusplus-1.0.0/src/BaseHttpHandler.cpp                                      \
+-    dependencies/hueplusplus-1.0.0/src/Bridge.cpp                                               \
+-    dependencies/hueplusplus-1.0.0/src/BridgeConfig.cpp                                         \
+-    dependencies/hueplusplus-1.0.0/src/CLIPSensors.cpp                                          \
+-    dependencies/hueplusplus-1.0.0/src/ColorUnits.cpp                                           \
+-    dependencies/hueplusplus-1.0.0/src/EntertainmentMode.cpp                                    \
+-    dependencies/hueplusplus-1.0.0/src/ExtendedColorHueStrategy.cpp                             \
+-    dependencies/hueplusplus-1.0.0/src/ExtendedColorTemperatureStrategy.cpp                     \
+-    dependencies/hueplusplus-1.0.0/src/Group.cpp                                                \
+-    dependencies/hueplusplus-1.0.0/src/HueCommandAPI.cpp                                        \
+-    dependencies/hueplusplus-1.0.0/src/HueDeviceTypes.cpp                                       \
+-    dependencies/hueplusplus-1.0.0/src/HueException.cpp                                         \
+-    dependencies/hueplusplus-1.0.0/src/Light.cpp                                                \
+-    dependencies/hueplusplus-1.0.0/src/ModelPictures.cpp                                        \
+-    dependencies/hueplusplus-1.0.0/src/NewDeviceList.cpp                                        \
+-    dependencies/hueplusplus-1.0.0/src/Scene.cpp                                                \
+-    dependencies/hueplusplus-1.0.0/src/Schedule.cpp                                             \
+-    dependencies/hueplusplus-1.0.0/src/Sensor.cpp                                               \
+-    dependencies/hueplusplus-1.0.0/src/SimpleBrightnessStrategy.cpp                             \
+-    dependencies/hueplusplus-1.0.0/src/SimpleColorHueStrategy.cpp                               \
+-    dependencies/hueplusplus-1.0.0/src/SimpleColorTemperatureStrategy.cpp                       \
+-    dependencies/hueplusplus-1.0.0/src/StateTransaction.cpp                                     \
+-    dependencies/hueplusplus-1.0.0/src/TimePattern.cpp                                          \
+-    dependencies/hueplusplus-1.0.0/src/UPnP.cpp                                                 \
+-    dependencies/hueplusplus-1.0.0/src/Utils.cpp                                                \
+-    dependencies/hueplusplus-1.0.0/src/ZLLSensors.cpp                                           \
+     dependencies/libe131/src/e131.c                                                             \
+     dependencies/libcmmk/src/libcmmk.c                                                          \
+     main.cpp                                                                                    \
+@@ -1188,6 +1159,7 @@ unix:!macx {
+     -lmbedx509                                                                                  \
+     -lmbedtls                                                                                   \
+     -lmbedcrypto                                                                                \
++    -lhueplusplusshared                                                                         \
+ 
+     COMPILER_VERSION = $$system($$QMAKE_CXX " -dumpversion")
+     if (!versionAtLeast(COMPILER_VERSION, "9")) {
+@@ -1218,7 +1190,6 @@ unix:!macx {
+     }
+ 
+     SOURCES +=                                                                                  \
+-    dependencies/hueplusplus-1.0.0/src/LinHttpHandler.cpp                                       \
+     i2c_smbus/i2c_smbus_linux.cpp                                                               \
+     serial_port/find_usb_serial_port_linux.cpp                                                  \
+     AutoStart/AutoStart-Linux.cpp                                                               \
diff --git a/gnu/packages/patches/p11-kit-hurd.patch b/gnu/packages/patches/p11-kit-hurd.patch
new file mode 100644
index 0000000000..01699882c4
--- /dev/null
+++ b/gnu/packages/patches/p11-kit-hurd.patch
@@ -0,0 +1,46 @@
+Taken from: https://groups.google.com/g/linux.debian.bugs.dist/c/mX4GpUJih4k.
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -132,6 +132,16 @@ if test "$os_unix" = "yes"; then
+ 	AC_CHECK_FUNCS([getpeereid])
+ 	AC_CHECK_FUNCS([getpeerucred])
+ 	AC_CHECK_FUNCS([issetugid])
++	case "$host_os" in
++	kfreebsd*-gnu | gnu*)
++		have_getpeereid=no
++		AC_CHECK_LIB(bsd, getpeereid, have_getpeereid=yes)
++		if test "x$have_getpeereid" = "xyes"; then
++			AC_DEFINE([HAVE_GETPEEREID], [1], [have getpeereid])
++			AC_SEARCH_LIBS([getpeereid], [bsd])
++		fi
++	;;
++	esac
+ 
+ 	AC_CACHE_CHECK([for thread-local storage class],
+ 		[ac_cv_tls_keyword],
+
+--- a/common/unix-peer.c
++++ b/common/unix-peer.c
+@@ -47,6 +47,11 @@
+ #  include <ucred.h>
+ #endif
+ 
++#ifdef HAVE_GETPEEREID
++/* Declare getpeereid from /usr/include/bsd/unistd.h */
++extern int getpeereid(int s, uid_t *euid, gid_t *egid);
++#endif
++
+ /* Returns the unix domain socket peer information.
+  * Returns zero on success.
+  */
+@@ -73,7 +78,8 @@ p11_get_upeer_id (int cfd, uid_t *uid, u
+ 		*pid = cr.pid;
+ 
+ #elif defined(HAVE_GETPEEREID)
+-	/* *BSD/MacOSX */
++	/* *BSD/MacOSX/kFreeBSD/Hurd */
++
+ 	uid_t euid;
+ 	gid_t egid;
+ 
\ No newline at end of file
diff --git a/gnu/packages/patches/password-store-tree-compat.patch b/gnu/packages/patches/password-store-tree-compat.patch
new file mode 100644
index 0000000000..ce8de8f27c
--- /dev/null
+++ b/gnu/packages/patches/password-store-tree-compat.patch
@@ -0,0 +1,29 @@
+Tree 2.0 and later will unconditionally ignore all options and write
+JSON data on file descriptor 3 when available, which causes problems
+for the test harness and other scripts that use FD 3.  Work around by
+closing descriptor 3 for the 'tree' command.
+
+Taken from upstream:
+  https://git.zx2c4.com/password-store/commit/?id=eea24967a002a2a81ae9b97a1fe972b5287f3a09
+
+diff --git a/src/password-store.sh b/src/password-store.sh
+--- a/src/password-store.sh
++++ b/src/password-store.sh
+@@ -402,7 +402,7 @@ cmd_show() {
+ 		else
+ 			echo "${path%\/}"
+ 		fi
+-		tree -N -C -l --noreport "$PREFIX/$path" | tail -n +2 | sed -E 's/\.gpg(\x1B\[[0-9]+m)?( ->|$)/\1\2/g' # remove .gpg at end of line, but keep colors
++		tree -N -C -l --noreport "$PREFIX/$path" 3>&- | tail -n +2 | sed -E 's/\.gpg(\x1B\[[0-9]+m)?( ->|$)/\1\2/g' # remove .gpg at end of line, but keep colors
+ 	elif [[ -z $path ]]; then
+ 		die "Error: password store is empty. Try \"pass init\"."
+ 	else
+@@ -414,7 +414,7 @@ cmd_find() {
+ 	[[ $# -eq 0 ]] && die "Usage: $PROGRAM $COMMAND pass-names..."
+ 	IFS="," eval 'echo "Search Terms: $*"'
+ 	local terms="*$(printf '%s*|*' "$@")"
+-	tree -N -C -l --noreport -P "${terms%|*}" --prune --matchdirs --ignore-case "$PREFIX" | tail -n +2 | sed -E 's/\.gpg(\x1B\[[0-9]+m)?( ->|$)/\1\2/g'
++	tree -N -C -l --noreport -P "${terms%|*}" --prune --matchdirs --ignore-case "$PREFIX" 3>&- | tail -n +2 | sed -E 's/\.gpg(\x1B\[[0-9]+m)?( ->|$)/\1\2/g'
+ }
+ 
+ cmd_grep() {
diff --git a/gnu/packages/patches/passwordsafe-meson-remove-extra-argument.patch b/gnu/packages/patches/passwordsafe-meson-remove-extra-argument.patch
new file mode 100644
index 0000000000..3cb61a364a
--- /dev/null
+++ b/gnu/packages/patches/passwordsafe-meson-remove-extra-argument.patch
@@ -0,0 +1,20 @@
+diff --git a/data/meson.build b/data/meson.build
+index 46f6373..26a2c18 100644
+--- a/data/meson.build
++++ b/data/meson.build
+@@ -35,7 +35,6 @@ if get_option('profile') == 'development'
+ endif
+ desktop_conf.set('ICON', application_id)
+ desktop = i18n.merge_file(
+-  'desktop',
+   input: configure_file(
+     input: files('org.gnome.PasswordSafe.desktop.in.in'),
+     output: 'org.gnome.PasswordSafe.desktop.in',
+@@ -65,7 +64,6 @@ if get_option('profile') == 'development'
+ endif
+ appdata_conf.set('APPID', application_id)
+ appdata = i18n.merge_file(
+-  'appdata',
+   input: configure_file(
+     input: files('org.gnome.PasswordSafe.appdata.xml.in.in'),
+     output: 'org.gnome.PasswordSafe.appdata.xml.in',
diff --git a/gnu/packages/patches/perl-cross.patch b/gnu/packages/patches/perl-cross.patch
deleted file mode 100644
index a7d10b4e1f..0000000000
--- a/gnu/packages/patches/perl-cross.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-Submitted upstream.
-
-From 4c3eb19a11dfe5c88c902481a8294c4f675fcd03 Mon Sep 17 00:00:00 2001
-From: "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org>
-Date: Sun, 19 Apr 2020 23:33:28 +0200
-Subject: [PATCH] Support cross-compiling to the Hurd.
-
-* cnf/hints/gnu: New file.
-* cnf/configure_tool.sh: Guess it.
----
- cnf/configure_tool.sh |  4 ++++
- cnf/hints/gnu         | 21 +++++++++++++++++++++
- 2 files changed, 25 insertions(+)
- create mode 100644 cnf/hints/gnu
-
-diff --git a/cnf/configure_tool.sh b/cnf/configure_tool.sh
-index 32201c0..7b0baa4 100644
---- a/cnf/configure_tool.sh
-+++ b/cnf/configure_tool.sh
-@@ -266,6 +266,10 @@ if not hinted 'osname'; then
- 			define osname "bsd"
- 			result "BSD"
- 			;;
-+		*-gnu*)
-+			define osname "gnu"
-+			result "GNU"
-+			;;
- 		*)
- 			result "no"
- 			;;
-diff --git a/cnf/hints/gnu b/cnf/hints/gnu
-new file mode 100644
-index 0000000..a0583a2
---- /dev/null
-+++ b/cnf/hints/gnu
-@@ -0,0 +1,21 @@
-+# Hurd syscalls
-+d_voidsig='define'
-+d_nanosleep='undef'
-+d_clock_gettime='define'
-+d_clock_getres='define'
-+d_clock_nanosleep='define'
-+d_clock='define'
-+
-+# From the original linux.sh
-+usemallocwrap='define'
-+
-+# libraries to test
-+libswanted='m crypt pthread nm ndbm gdbm dbm db dl gdbm_compat'
-+
-+d_procselfexe='undef'
-+procselfexe='"undef"'
-+
-+st_ino_sign=1
-+st_ino_size=8
-+
-+d_fcntl_can_lock='define'
--- 
-2.26.0
-
diff --git a/gnu/packages/patches/perl-deterministic-ordering.patch b/gnu/packages/patches/perl-deterministic-ordering.patch
deleted file mode 100644
index be63d5cde3..0000000000
--- a/gnu/packages/patches/perl-deterministic-ordering.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From <https://bugs.debian.org/801523>.
-
-From c01f602d1926b0671fd2c8d91f7e52c4e4c9fb24 Mon Sep 17 00:00:00 2001
-From: Niko Tyni <ntyni@debian.org>
-Date: Sun, 11 Oct 2015 19:27:56 +0300
-Subject: [PATCH] Sort the list of XS code files when generating RealPPPort.xs
-
-all_files_in_dir() uses readdir() ordering to make the list of
-input files. This can vary between build systems, breaking build
-reproducibility.
----
- cpan/Devel-PPPort/PPPort_xs.PL | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/dist/Devel-PPPort/PPPort_xs.PL b/dist/Devel-PPPort/PPPort_xs.PL
-index 5f18940..149f2fe 100644
---- a/dist/Devel-PPPort/PPPort_xs.PL
-+++ b/dist/Devel-PPPort/PPPort_xs.PL
-@@ -38,7 +38,7 @@ END
- my $file;
- my $sec;
- 
--for $file (all_files_in_dir('parts/inc')) {
-+for $file (sort(all_files_in_dir('parts/inc'))) {
-   my $spec = parse_partspec($file);
- 
-   my $msg = 0;
--- 
-2.5.1
diff --git a/gnu/packages/patches/perl-io-socket-ssl-openssl-1.0.2f-fix.patch b/gnu/packages/patches/perl-io-socket-ssl-openssl-1.0.2f-fix.patch
deleted file mode 100644
index f2166aebfd..0000000000
--- a/gnu/packages/patches/perl-io-socket-ssl-openssl-1.0.2f-fix.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-Work around a problem arising from the update to OpenSSL 1.0.2f, based on the
-following upstream commit:
-
-  https://github.com/noxxi/p5-io-socket-ssl/commit/6e23ee4a433f83f1065bd2467255eba5ee9b1ddd
-
-Attempting to update to IO-Socket-SSL-2.023, which includes this commit,
-caused other test failures.  See:
-
-  https://lists.gnu.org/archive/html/guix-devel/2016-01/msg01032.html
-
-Description from the upstream commit:
-
-  OpenSSL 1.0.2f changed the behavior of SSL shutdown in case the TLS connection
-  was not fully established (commit: f73c737c7ac908c5d6407c419769123392a3b0a9).
-  This somehow resulted in Net::SSLeay::shutdown returning 0 (i.e. keep trying)
-  which caused an endless loop. It will now ignore this result in case the TLS
-  connection was not yet established and consider the TLS connection closed
-  instead.
-
---- IO-Socket-SSL-2.002/lib/IO/Socket/SSL.pm.orig	2014-10-21 16:51:16.000000000 -0400
-+++ IO-Socket-SSL-2.002/lib/IO/Socket/SSL.pm	2016-01-31 15:07:14.971099894 -0500
-@@ -1213,6 +1213,11 @@
- 		    # shutdown complete
- 		    last;
- 		}
-+		if ((${*$self}{'_SSL_opened'}||0) <= 0) {
-+		    # not really open, thus don't expect shutdown to return
-+		    # something meaningful
-+		    last;
-+		}
- 
- 		# initiate or complete shutdown
- 		local $SIG{PIPE} = 'IGNORE';
diff --git a/gnu/packages/patches/perl-no-sys-dirs.patch b/gnu/packages/patches/perl-no-sys-dirs.patch
index 2269d715c7..14d634cac9 100644
--- a/gnu/packages/patches/perl-no-sys-dirs.patch
+++ b/gnu/packages/patches/perl-no-sys-dirs.patch
@@ -6,7 +6,7 @@ Patch adapted from Nixpkgs, originally by Eelco Dolstra
 diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/Configure perl-5.20.0/Configure
 --- perl-5.20.0-orig/Configure	2014-05-26 15:34:18.000000000 +0200
 +++ perl-5.20.0/Configure	2014-06-25 10:43:35.368285986 +0200
-@@ -106,15 +106,7 @@
+@@ -108,15 +108,7 @@
  fi
  
  : Proper PATH setting
@@ -23,8 +23,8 @@ diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/Configure perl-5.20.0/Configure
  
  for p in $paths
  do
-@@ -1337,8 +1329,7 @@
- archname=''
+@@ -1435,8 +1427,7 @@
+ i_whoami=''
  : Possible local include directories to search.
  : Set locincpth to "" in a hint file to defeat local include searches.
 -locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
@@ -33,8 +33,8 @@ diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/Configure perl-5.20.0/Configure
  :
  : no include file wanted by default
  inclwanted=''
-@@ -1349,17 +1340,12 @@
- 
+@@ -1450,17 +1441,12 @@
+ archobjs=''
  libnames=''
  : change the next line if compiling for Xenix/286 on Xenix/386
 -xlibpth='/usr/lib/386 /lib/386'
@@ -54,8 +54,8 @@ diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/Configure perl-5.20.0/Configure
  
  : Private path used by Configure to find libraries.  Its value
  : is prepended to libpth. This variable takes care of special
-@@ -1391,8 +1377,6 @@
- libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
+@@ -1495,8 +1481,6 @@
+ libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD"
  : We probably want to search /usr/shlib before most other libraries.
  : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
 -glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
@@ -63,7 +63,7 @@ diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/Configure perl-5.20.0/Configure
  : Do not use vfork unless overridden by a hint file.
  usevfork=false
  
-@@ -2446,7 +2430,6 @@
+@@ -2553,7 +2537,6 @@
  zip
  "
  pth=`echo $PATH | sed -e "s/$p_/ /g"`
@@ -71,7 +71,7 @@ diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/Configure perl-5.20.0/Configure
  for file in $loclist; do
  	eval xxx=\$$file
  	case "$xxx" in
-@@ -4936,7 +4919,7 @@
+@@ -5049,7 +5033,7 @@
  : Set private lib path
  case "$plibpth" in
  '') if ./mips; then
@@ -80,7 +80,7 @@ diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/Configure perl-5.20.0/Configure
      fi;;
  esac
  case "$libpth" in
-@@ -8600,13 +8583,8 @@
+@@ -8877,13 +8861,8 @@
  echo " "
  case "$sysman" in
  '')
@@ -96,7 +96,7 @@ diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/Configure perl-5.20.0/Configure
  	;;
  esac
  if $test -d "$sysman"; then
-@@ -19900,9 +19878,10 @@
+@@ -21027,9 +21006,10 @@
  case "$full_ar" in
  '') full_ar=$ar ;;
  esac
@@ -169,7 +169,7 @@ diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/hints/freebsd.sh perl-5.20.0/hints/
 diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/hints/linux.sh perl-5.20.0/hints/linux.sh
 --- perl-5.20.0-orig/hints/linux.sh	2014-05-26 15:34:20.000000000 +0200
 +++ perl-5.20.0/hints/linux.sh	2014-06-25 10:33:47.354883843 +0200
-@@ -150,25 +150,6 @@
+@@ -150,28 +150,6 @@
      ;;
  esac
  
@@ -188,6 +188,9 @@ diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/hints/linux.sh perl-5.20.0/hints/li
 -# plibpth to bypass this check.
 -if [ -x /usr/bin/gcc ] ; then
 -    gcc=/usr/bin/gcc
+-# clang also provides -print-search-dirs
+-elif ${cc:-cc} --version 2>/dev/null | grep -q '^clang ' ; then
+-    gcc=${cc:-cc}
 -else
 -    gcc=gcc
 -fi
@@ -195,7 +198,40 @@ diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/hints/linux.sh perl-5.20.0/hints/li
  case "$plibpth" in
  '') plibpth=`LANG=C LC_ALL=C $gcc $ccflags $ldflags -print-search-dirs | grep libraries |
  	cut -f2- -d= | tr ':' $trnl | grep -v 'gcc' | sed -e 's:/$::'`
-@@ -367,33 +322,6 @@
+@@ -208,32 +186,6 @@
+   ;;
+ esac
+ 
+-case "$libc" in
+-'')
+-# If you have glibc, then report the version for ./myconfig bug reporting.
+-# (Configure doesn't need to know the specific version since it just uses
+-# gcc to load the library for all tests.)
+-# We don't use __GLIBC__ and  __GLIBC_MINOR__ because they
+-# are insufficiently precise to distinguish things like
+-# libc-2.0.6 and libc-2.0.7.
+-    for p in $plibpth
+-    do
+-        for trylib in libc.so.6 libc.so
+-        do
+-            if $test -e $p/$trylib; then
+-                libc=`ls -l $p/$trylib | awk '{print $NF}'`
+-                if $test "X$libc" != X; then
+-                    break
+-                fi
+-            fi
+-        done
+-        if $test "X$libc" != X; then
+-            break
+-        fi
+-    done
+-    ;;
+-esac
+-
+ if ${sh:-/bin/sh} -c exit; then
+   echo ''
+   echo 'You appear to have a working bash.  Good.'
+@@ -311,33 +263,6 @@
  	;;
  esac
  
@@ -229,40 +265,3 @@ diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/hints/linux.sh perl-5.20.0/hints/li
  # Linux on Synology.
  if [ -f /etc/synoinfo.conf -a -d /usr/syno ]; then
      # Tested on Synology DS213 and DS413
-diff --git a/hints/linux.sh b/hints/linux.sh
-index 3f38ea0..97aed11 100644
---- a/hints/linux.sh
-+++ b/hints/linux.sh
-@@ -195,32 +195,6 @@ case "$usequadmath" in
-   ;;
- esac
- 
--case "$libc" in
--'')
--# If you have glibc, then report the version for ./myconfig bug reporting.
--# (Configure doesn't need to know the specific version since it just uses
--# gcc to load the library for all tests.)
--# We don't use __GLIBC__ and  __GLIBC_MINOR__ because they
--# are insufficiently precise to distinguish things like
--# libc-2.0.6 and libc-2.0.7.
--    for p in $plibpth
--    do
--        for trylib in libc.so.6 libc.so
--        do
--            if $test -e $p/$trylib; then
--                libc=`ls -l $p/$trylib | awk '{print $NF}'`
--                if $test "X$libc" != X; then
--                    break
--                fi
--            fi
--        done
--        if $test "X$libc" != X; then
--            break
--        fi
--    done
--    ;;
--esac
--
- if ${sh:-/bin/sh} -c exit; then
-   echo ''
-   echo 'You appear to have a working bash.  Good.'
diff --git a/gnu/packages/patches/php-bug-74093-test.patch b/gnu/packages/patches/php-bug-74093-test.patch
new file mode 100644
index 0000000000..07b1949cef
--- /dev/null
+++ b/gnu/packages/patches/php-bug-74093-test.patch
@@ -0,0 +1,48 @@
+From c641825c64e42627a2c9cac969b371ed532e0b57 Mon Sep 17 00:00:00 2001
+From: Ryan Sundberg <ryan@arctype.co>
+Date: Mon, 4 Oct 2021 20:12:25 -0700
+Subject: [PATCH] Zend/tests/bug74093.phpt: Fix failing test case
+
+This test case fails (on non-Windows hosts, where it is enabled) due
+to mismatching output in the error log language. This fixes the
+expectation, and also rewrites the test procedure in a more stable
+fashion.
+
+The objective of the test case is to run a program that exceeds
+the max_execution_time and verify that the process was aborted. The
+previous implementation tested this using a loop on array_intersect with
+large enough inputs to "probably" take enough time to trigger
+max_execution_time to abort it. With faster CPUs, over time this test
+can become flaky. Instead we simply spin a loop until enough
+wall clock time has passed to check our assertion.
+---
+ Zend/tests/bug74093.phpt | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/Zend/tests/bug74093.phpt b/Zend/tests/bug74093.phpt
+index 7f20285805..32eb445ddc 100644
+--- a/Zend/tests/bug74093.phpt
++++ b/Zend/tests/bug74093.phpt
+@@ -1,5 +1,5 @@
+ --TEST--
+-Bug #74093 (Maximum execution time of n+2 seconds exceed not written in error_log)
++Bug #74093 (Maximum execution time exceeded not written in error_log)
+ --SKIPIF--
+ <?php
+ if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
+@@ -12,9 +12,9 @@ max_execution_time=1
+ hard_timeout=1
+ --FILE--
+ <?php
+-$a1 = range(1, 1000000);
+-$a2 = range(100000, 1999999);
+-array_intersect($a1, $a2);
++$start = time();
++while (time() - $start < 5);
++die("Failed to interrupt execution");
+ ?>
+ --EXPECTF--
+-Fatal error: Maximum execution time of 1+1 seconds exceeded %s
++Fatal error: Maximum execution time of 1 second exceeded in %s
+--
+2.31.1
diff --git a/gnu/packages/patches/php-openssl_x509_checkpurpose_basic.patch b/gnu/packages/patches/php-openssl_x509_checkpurpose_basic.patch
new file mode 100644
index 0000000000..427965f231
--- /dev/null
+++ b/gnu/packages/patches/php-openssl_x509_checkpurpose_basic.patch
@@ -0,0 +1,108 @@
+From 98175fc7f1623873ceb2e9a017a319d19bfb3912 Mon Sep 17 00:00:00 2001
+From: "Christoph M. Becker" <cmbecker69@gmx.de>
+Date: Sun, 12 Dec 2021 13:41:37 +0100
+Subject: [PATCH] Fix openssl_x509_checkpurpose_basic.phpt
+
+This test fails because san-cert.pem and san-ca.pem have expired.  We
+fix that by using the CertificateGenerator to generate temporary certs
+during the test run.  Since san-cert.pem and san-ca.pem have been
+identical, we only generate one certificate.
+
+Closes GH-7763.
+---
+ .../openssl_x509_checkpurpose_basic.phpt      | 10 +++++-
+ ext/openssl/tests/san-ca.pem                  | 15 ---------
+ ext/openssl/tests/san-cert.pem                | 31 -------------------
+ 3 files changed, 9 insertions(+), 47 deletions(-)
+ delete mode 100644 ext/openssl/tests/san-ca.pem
+ delete mode 100644 ext/openssl/tests/san-cert.pem
+
+diff --git a/ext/openssl/tests/openssl_x509_checkpurpose_basic.phpt b/ext/openssl/tests/openssl_x509_checkpurpose_basic.phpt
+index 99b4f0bdff31..35629bd93626 100644
+--- a/ext/openssl/tests/openssl_x509_checkpurpose_basic.phpt
++++ b/ext/openssl/tests/openssl_x509_checkpurpose_basic.phpt
+@@ -8,10 +8,14 @@ if (OPENSSL_VERSION_NUMBER < 0x10000000) die("skip Output requires OpenSSL 1.0")
+ ?>
+ --FILE--
+ <?php
++include 'CertificateGenerator.inc';
++$certificateGenerator = new CertificateGenerator();
++$certificateGenerator->saveCaCert(__DIR__ . "/san-cert.pem");
++
+ $cert = "file://" . __DIR__ . "/cert.crt";
+ $bert = "file://" . __DIR__ . "/bug41033.pem";
+ $sert = "file://" . __DIR__ . "/san-cert.pem";
+-$cpca = __DIR__ . "/san-ca.pem";
++$cpca = __DIR__ . "/san-cert.pem";
+ $utfl = __DIR__ . "/sni_server_uk.pem";
+ $rcrt = openssl_x509_read($cert);
+ 
+@@ -84,6 +88,10 @@ var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_SMIME_ENCRYPT, array($cpc
+ var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_CRL_SIGN, array($cpca), $utfl));
+ var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_ANY, array($cpca), $utfl));
+ ?>
++--CLEAN--
++<?php
++@unlink(__DIR__ . "/san-cert.pem");
++?>
+ --EXPECT--
+ bool(false)
+ bool(false)
+diff --git a/ext/openssl/tests/san-ca.pem b/ext/openssl/tests/san-ca.pem
+deleted file mode 100644
+index 88682ba2dcf6..000000000000
+--- a/ext/openssl/tests/san-ca.pem
++++ /dev/null
+@@ -1,15 +0,0 @@
+------BEGIN CERTIFICATE-----
+-MIICYTCCAcqgAwIBAgIJAIaqxtY5dwjtMA0GCSqGSIb3DQEBBQUAMFMxCzAJBgNV
+-BAYTAlVTMQswCQYDVQQIEwJNTjEUMBIGA1UEBxMLTWlubmVhcG9saXMxITAfBgNV
+-BAsTGERvbWFpbiBDb250cm9sIFZhbGlkYXRlZDAeFw0xMzA5MjQwODA1NTFaFw0y
+-MTEyMTEwODA1NTFaMFMxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJNTjEUMBIGA1UE
+-BxMLTWlubmVhcG9saXMxITAfBgNVBAsTGERvbWFpbiBDb250cm9sIFZhbGlkYXRl
+-ZDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAsFGqfbU/8D+KjroQl4XMyt9m
+-dcSP7iZtqphOu9nVZxYAAqfaqj8FnC/pwYV3TU6ZHndLTQAllwYT3sQBQPPGmZQ9
+-clSIMEL003t3pi4ZVXkttG6Vvr+Z9PBcHhlKLQ7WMHnn4qctllWXTSoyTQpkETF3
+-Fc3mrG5G37BhoUno7NECAwEAAaM9MDswOQYDVR0RBDIwMIILZXhhbXBsZS5vcmeC
+-D3d3dy5leGFtcGxlLm9yZ4IQdGVzdC5leGFtcGxlLm9yZzANBgkqhkiG9w0BAQUF
+-AAOBgQBf/FZhzheIcQJ+dyTk8xQ/nJLvpmBhbd1LNtfwk/MsC9UHsz4QXs9sBw1k
+-rH0FjoqgM6avj7zKHJFTj6q7Rd+OX5V4HynYPhX67sWbN3KWEHffL98nGGd/bo3X
+-pSjNk5vnyKYiwdUUe11Ac9csh0HcSBbhOYjy0T/i9AlQcKbuCg==
+------END CERTIFICATE-----
+diff --git a/ext/openssl/tests/san-cert.pem b/ext/openssl/tests/san-cert.pem
+deleted file mode 100644
+index 923d490e72fd..000000000000
+--- a/ext/openssl/tests/san-cert.pem
++++ /dev/null
+@@ -1,31 +0,0 @@
+------BEGIN CERTIFICATE-----
+-MIICYTCCAcqgAwIBAgIJAIaqxtY5dwjtMA0GCSqGSIb3DQEBBQUAMFMxCzAJBgNV
+-BAYTAlVTMQswCQYDVQQIEwJNTjEUMBIGA1UEBxMLTWlubmVhcG9saXMxITAfBgNV
+-BAsTGERvbWFpbiBDb250cm9sIFZhbGlkYXRlZDAeFw0xMzA5MjQwODA1NTFaFw0y
+-MTEyMTEwODA1NTFaMFMxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJNTjEUMBIGA1UE
+-BxMLTWlubmVhcG9saXMxITAfBgNVBAsTGERvbWFpbiBDb250cm9sIFZhbGlkYXRl
+-ZDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAsFGqfbU/8D+KjroQl4XMyt9m
+-dcSP7iZtqphOu9nVZxYAAqfaqj8FnC/pwYV3TU6ZHndLTQAllwYT3sQBQPPGmZQ9
+-clSIMEL003t3pi4ZVXkttG6Vvr+Z9PBcHhlKLQ7WMHnn4qctllWXTSoyTQpkETF3
+-Fc3mrG5G37BhoUno7NECAwEAAaM9MDswOQYDVR0RBDIwMIILZXhhbXBsZS5vcmeC
+-D3d3dy5leGFtcGxlLm9yZ4IQdGVzdC5leGFtcGxlLm9yZzANBgkqhkiG9w0BAQUF
+-AAOBgQBf/FZhzheIcQJ+dyTk8xQ/nJLvpmBhbd1LNtfwk/MsC9UHsz4QXs9sBw1k
+-rH0FjoqgM6avj7zKHJFTj6q7Rd+OX5V4HynYPhX67sWbN3KWEHffL98nGGd/bo3X
+-pSjNk5vnyKYiwdUUe11Ac9csh0HcSBbhOYjy0T/i9AlQcKbuCg==
+------END CERTIFICATE-----
+------BEGIN PRIVATE KEY-----
+-MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBALBRqn21P/A/io66
+-EJeFzMrfZnXEj+4mbaqYTrvZ1WcWAAKn2qo/BZwv6cGFd01OmR53S00AJZcGE97E
+-AUDzxpmUPXJUiDBC9NN7d6YuGVV5LbRulb6/mfTwXB4ZSi0O1jB55+KnLZZVl00q
+-Mk0KZBExdxXN5qxuRt+wYaFJ6OzRAgMBAAECgYB11e5iWvqjPmQEZRdnnJU0VD8u
+-n7ItT+Nk6qtb4gY8Abj6DWIW+01th5vqqJ8FvGyartFVYa69kuM+srG/zevAZWeu
+-fGZtwiwZR4DRSyRcPp4rnNiksK3dkAZA6UewmRDPv8uyHJlXc5i+Ft1ILJ5Q5jgn
+-UkC4z3EJP5Se9KZywQJBAOO4lRq42wLsYr2SDrQDSs4leie3FKc2bgvjF7Djosh1
+-ZYbf55F5b9w1zgnccmni2HkqOnyFu4SKarmXyCsYxrkCQQDGNvnUh7/zZswrdWZ/
+-PMp9zVDTh/5Oc2B4ByNLw1ERDwYhjchKgPRlQvn4cp3Pwf3UYPQ/8XGXzzEJey3A
+-r0rZAkBf/tDEOgcBPXsGZQrTscuYCU5sbY5ESvqrAilbhSp7DJom+D5bIfEYyIm5
+-uHd20Yzlzvpmwc1huyPwZt6X5FLpAkATDReoGMAXSesXxjnqwtIHk2NQYYLM0YQV
+-JUJ8NrKk/Bevw+vbVVeoH+7ctU97t36JGiR/vNoZKD3jVmaIXZDJAkEA4wJbwzIo
+-L32mu9VmZa7wjmfkraQEmXTPaA5D9lNC0AwRTgkj+x2Qe1vawNblNK9PPLBDdplQ
+-L//53ADq/wv5rA==
+------END PRIVATE KEY-----
diff --git a/gnu/packages/patches/pigx-bsseq-no-citeproc.patch b/gnu/packages/patches/pigx-bsseq-no-citeproc.patch
new file mode 100644
index 0000000000..882e660fe4
--- /dev/null
+++ b/gnu/packages/patches/pigx-bsseq-no-citeproc.patch
@@ -0,0 +1,33 @@
+diff -Naur pigx_bsseq-0.1.5/configure.ac pigx_bsseq-0.1.5.patched/configure.ac
+--- pigx_bsseq-0.1.5/configure.ac	2021-06-08 15:28:08.000000000 +0200
++++ pigx_bsseq-0.1.5.patched/configure.ac	2021-10-05 14:43:56.806529137 +0200
+@@ -38,7 +38,6 @@
+ find_or_override_prog([GNUBASH],         [bash])
+ find_or_override_prog([SNAKEMAKE],       [snakemake])
+ find_or_override_prog([PANDOC],          [pandoc])
+-find_or_override_prog([PANDOC_CITEPROC], [pandoc-citeproc])
+ find_or_override_prog([FASTQC],          [fastqc])
+ find_or_override_prog([MULTIQC],         [multiqc])
+ find_or_override_prog([TRIMGALORE],      [trim_galore])
+diff -Naur pigx_bsseq-0.1.5/Makefile.in pigx_bsseq-0.1.5.patched/Makefile.in
+--- pigx_bsseq-0.1.5/Makefile.in	2021-06-08 16:17:03.000000000 +0200
++++ pigx_bsseq-0.1.5.patched/Makefile.in	2021-10-05 14:43:34.635876855 +0200
+@@ -408,7 +408,6 @@
+ PACKAGE_URL = @PACKAGE_URL@
+ PACKAGE_VERSION = @PACKAGE_VERSION@
+ PANDOC = @PANDOC@
+-PANDOC_CITEPROC = @PANDOC_CITEPROC@
+ PATH_SEPARATOR = @PATH_SEPARATOR@
+ PYTHON = @PYTHON@
+ PYTHONPATH = @PYTHONPATH@
+diff -Naur pigx_bsseq-0.1.5/pigx-common/common/pigx-runner.in pigx_bsseq-0.1.5.patched/pigx-common/common/pigx-runner.in
+--- pigx_bsseq-0.1.5/pigx-common/common/pigx-runner.in	2021-06-08 10:14:29.000000000 +0200
++++ pigx_bsseq-0.1.5.patched/pigx-common/common/pigx-runner.in	2021-10-05 14:43:44.296161069 +0200
+@@ -375,7 +375,6 @@
+     if path.exists(bin): shutil.rmtree(bin)
+     os.makedirs(bin, exist_ok=True)
+     os.symlink('@PANDOC@', path.join(bin, "pandoc"))
+-    os.symlink('@PANDOC_CITEPROC@', path.join(bin, "pandoc-citeproc"))
+     os.symlink('@RSCRIPT@', path.join(bin, "Rscript"))
+     os.environ['PATH'] = path.abspath(bin) + ":" + os.environ['PATH']
+     os.environ['PIGX_PATH'] = path.abspath(bin) + ":" + os.environ['PATH']
diff --git a/gnu/packages/patches/pigx-chipseq-no-citeproc.patch b/gnu/packages/patches/pigx-chipseq-no-citeproc.patch
new file mode 100644
index 0000000000..b01820f110
--- /dev/null
+++ b/gnu/packages/patches/pigx-chipseq-no-citeproc.patch
@@ -0,0 +1,33 @@
+diff -Naur pigx_chipseq-0.0.53/configure.ac pigx_chipseq-0.0.53.patched/configure.ac
+--- pigx_chipseq-0.0.53/configure.ac	2021-09-28 11:14:12.000000000 +0200
++++ pigx_chipseq-0.0.53.patched/configure.ac	2021-10-07 14:48:53.034054327 +0200
+@@ -52,7 +52,6 @@
+ find_or_override_prog([MACS2],           [macs2])
+ find_or_override_prog([SNAKEMAKE],       [snakemake])
+ find_or_override_prog([PANDOC],          [pandoc])
+-find_or_override_prog([PANDOC_CITEPROC], [pandoc-citeproc])
+ find_or_override_prog([FASTQC],          [fastqc])
+ find_or_override_prog([BOWTIE2],         [bowtie2])
+ find_or_override_prog([BOWTIE2_BUILD],   [bowtie2-build])
+diff -Naur pigx_chipseq-0.0.53/Makefile.in pigx_chipseq-0.0.53.patched/Makefile.in
+--- pigx_chipseq-0.0.53/Makefile.in	2021-09-28 11:55:05.000000000 +0200
++++ pigx_chipseq-0.0.53.patched/Makefile.in	2021-10-07 14:48:37.195577143 +0200
+@@ -407,7 +407,6 @@
+ PACKAGE_URL = @PACKAGE_URL@
+ PACKAGE_VERSION = @PACKAGE_VERSION@
+ PANDOC = @PANDOC@
+-PANDOC_CITEPROC = @PANDOC_CITEPROC@
+ PATH_SEPARATOR = @PATH_SEPARATOR@
+ PERL = @PERL@
+ PYTHON = @PYTHON@
+diff -Naur pigx_chipseq-0.0.53/pigx-common/common/pigx-runner.in pigx_chipseq-0.0.53.patched/pigx-common/common/pigx-runner.in
+--- pigx_chipseq-0.0.53/pigx-common/common/pigx-runner.in	2021-09-27 18:16:42.000000000 +0200
++++ pigx_chipseq-0.0.53.patched/pigx-common/common/pigx-runner.in	2021-10-07 14:48:44.200788218 +0200
+@@ -379,7 +379,6 @@
+     if path.exists(bin): shutil.rmtree(bin)
+     os.makedirs(bin, exist_ok=True)
+     os.symlink('@PANDOC@', path.join(bin, "pandoc"))
+-    os.symlink('@PANDOC_CITEPROC@', path.join(bin, "pandoc-citeproc"))
+     os.symlink('@RSCRIPT@', path.join(bin, "Rscript"))
+     os.environ['PATH'] = path.abspath(bin) + ":" + os.environ['PATH']
+     os.environ['PIGX_PATH'] = path.abspath(bin) + ":" + os.environ['PATH']
diff --git a/gnu/packages/patches/pigx-rnaseq-no-citeproc.patch b/gnu/packages/patches/pigx-rnaseq-no-citeproc.patch
new file mode 100644
index 0000000000..366ae3890a
--- /dev/null
+++ b/gnu/packages/patches/pigx-rnaseq-no-citeproc.patch
@@ -0,0 +1,33 @@
+diff -Naur pigx_rnaseq-0.0.19/configure.ac pigx_rnaseq-0.0.19.patched/configure.ac
+--- pigx_rnaseq-0.0.19/configure.ac	2021-07-23 14:01:00.304391428 +0200
++++ pigx_rnaseq-0.0.19.patched/configure.ac	2021-10-06 13:51:29.512960106 +0200
+@@ -38,7 +38,6 @@
+ find_or_override_prog([GNUBASH],         [bash])
+ find_or_override_prog([SNAKEMAKE],       [snakemake])
+ find_or_override_prog([PANDOC],          [pandoc])
+-find_or_override_prog([PANDOC_CITEPROC], [pandoc-citeproc])
+ find_or_override_prog([STAR],            [STAR])
+ find_or_override_prog([HISAT2],          [hisat2])
+ find_or_override_prog([HISAT2_BUILD],    [hisat2-build])
+diff -Naur pigx_rnaseq-0.0.19/Makefile.in pigx_rnaseq-0.0.19.patched/Makefile.in
+--- pigx_rnaseq-0.0.19/Makefile.in	2021-08-13 13:40:10.402922844 +0200
++++ pigx_rnaseq-0.0.19.patched/Makefile.in	2021-10-06 13:51:04.052247524 +0200
+@@ -410,7 +410,6 @@
+ PACKAGE_URL = @PACKAGE_URL@
+ PACKAGE_VERSION = @PACKAGE_VERSION@
+ PANDOC = @PANDOC@
+-PANDOC_CITEPROC = @PANDOC_CITEPROC@
+ PATH_SEPARATOR = @PATH_SEPARATOR@
+ PYTHON = @PYTHON@
+ PYTHONPATH = @PYTHONPATH@
+diff -Naur pigx_rnaseq-0.0.19/pigx-common/common/pigx-runner.in pigx_rnaseq-0.0.19.patched/pigx-common/common/pigx-runner.in
+--- pigx_rnaseq-0.0.19/pigx-common/common/pigx-runner.in	2021-08-13 13:27:50.494352532 +0200
++++ pigx_rnaseq-0.0.19.patched/pigx-common/common/pigx-runner.in	2021-10-06 13:51:38.798220108 +0200
+@@ -379,7 +379,6 @@
+     if path.exists(bin): shutil.rmtree(bin)
+     os.makedirs(bin, exist_ok=True)
+     os.symlink('@PANDOC@', path.join(bin, "pandoc"))
+-    os.symlink('@PANDOC_CITEPROC@', path.join(bin, "pandoc-citeproc"))
+     os.symlink('@RSCRIPT@', path.join(bin, "Rscript"))
+     os.environ['PATH'] = path.abspath(bin) + ":" + os.environ['PATH']
+     os.environ['PIGX_PATH'] = path.abspath(bin) + ":" + os.environ['PATH']
diff --git a/gnu/packages/patches/pigx-sars-cov2-ww-no-citeproc.patch b/gnu/packages/patches/pigx-sars-cov2-ww-no-citeproc.patch
new file mode 100644
index 0000000000..3f34bca6b2
--- /dev/null
+++ b/gnu/packages/patches/pigx-sars-cov2-ww-no-citeproc.patch
@@ -0,0 +1,33 @@
+diff -Naur pigx_sars-cov2-ww-0.0.3/configure.ac pigx_sars-cov2-ww-0.0.3.patched/configure.ac
+--- pigx_sars-cov2-ww-0.0.3/configure.ac	2021-06-10 10:12:00.552889984 +0200
++++ pigx_sars-cov2-ww-0.0.3.patched/configure.ac	2021-10-05 14:52:32.318695129 +0200
+@@ -50,7 +50,6 @@
+ find_or_override_prog([MULTIQC],         [multiqc])
+ find_or_override_prog([WGET],            [wget])
+ find_or_override_prog([PANDOC],          [pandoc])
+-find_or_override_prog([PANDOC_CITEPROC], [pandoc-citeproc])
+ 
+ AC_ARG_ENABLE([r-packages-check],
+   AS_HELP_STRING([--disable-r-packages-check], [Do not check any R packages.]),
+diff -Naur pigx_sars-cov2-ww-0.0.3/Makefile.in pigx_sars-cov2-ww-0.0.3.patched/Makefile.in
+--- pigx_sars-cov2-ww-0.0.3/Makefile.in	2021-08-05 16:33:59.164123383 +0200
++++ pigx_sars-cov2-ww-0.0.3.patched/Makefile.in	2021-10-05 14:52:41.272958547 +0200
+@@ -402,7 +402,6 @@
+ PACKAGE_URL = @PACKAGE_URL@
+ PACKAGE_VERSION = @PACKAGE_VERSION@
+ PANDOC = @PANDOC@
+-PANDOC_CITEPROC = @PANDOC_CITEPROC@
+ PATH_SEPARATOR = @PATH_SEPARATOR@
+ PRINSEQ = @PRINSEQ@
+ PYTHON = @PYTHON@
+diff -Naur pigx_sars-cov2-ww-0.0.3/pigx-common/common/pigx-runner.in pigx_sars-cov2-ww-0.0.3.patched/pigx-common/common/pigx-runner.in
+--- pigx_sars-cov2-ww-0.0.3/pigx-common/common/pigx-runner.in	2021-07-30 11:10:17.913115902 +0200
++++ pigx_sars-cov2-ww-0.0.3.patched/pigx-common/common/pigx-runner.in	2021-10-05 14:52:23.602438714 +0200
+@@ -379,7 +379,6 @@
+     if path.exists(bin): shutil.rmtree(bin)
+     os.makedirs(bin, exist_ok=True)
+     os.symlink('@PANDOC@', path.join(bin, "pandoc"))
+-    os.symlink('@PANDOC_CITEPROC@', path.join(bin, "pandoc-citeproc"))
+     os.symlink('@RSCRIPT@', path.join(bin, "Rscript"))
+     os.environ['PATH'] = path.abspath(bin) + ":" + os.environ['PATH']
+     os.environ['PIGX_PATH'] = path.abspath(bin) + ":" + os.environ['PATH']
diff --git a/gnu/packages/patches/pigx-scrnaseq-no-citeproc.patch b/gnu/packages/patches/pigx-scrnaseq-no-citeproc.patch
new file mode 100644
index 0000000000..4cce33fb01
--- /dev/null
+++ b/gnu/packages/patches/pigx-scrnaseq-no-citeproc.patch
@@ -0,0 +1,33 @@
+diff -Naur pigx_scrnaseq-1.1.7/configure.ac pigx_scrnaseq-1.1.7.patched/configure.ac
+--- pigx_scrnaseq-1.1.7/configure.ac	2020-03-17 14:37:46.000000000 +0100
++++ pigx_scrnaseq-1.1.7.patched/configure.ac	2021-10-06 13:55:49.779271317 +0200
+@@ -43,7 +43,6 @@
+ find_or_override_prog([GNUBASH],         [bash])
+ find_or_override_prog([SNAKEMAKE],       [snakemake])
+ find_or_override_prog([PANDOC],          [pandoc])
+-find_or_override_prog([PANDOC_CITEPROC], [pandoc-citeproc])
+ find_or_override_prog([FASTQC],          [fastqc])
+ find_or_override_prog([STAR],            [STAR])
+ find_or_override_prog([SAMTOOLS],        [samtools])
+diff -Naur pigx_scrnaseq-1.1.7/Makefile.in pigx_scrnaseq-1.1.7.patched/Makefile.in
+--- pigx_scrnaseq-1.1.7/Makefile.in	2020-11-30 16:55:48.000000000 +0100
++++ pigx_scrnaseq-1.1.7.patched/Makefile.in	2021-10-06 13:55:52.224340194 +0200
+@@ -395,7 +395,6 @@
+ PACKAGE_URL = @PACKAGE_URL@
+ PACKAGE_VERSION = @PACKAGE_VERSION@
+ PANDOC = @PANDOC@
+-PANDOC_CITEPROC = @PANDOC_CITEPROC@
+ PATH_SEPARATOR = @PATH_SEPARATOR@
+ PERL = @PERL@
+ PYTHON = @PYTHON@
+diff -Naur pigx_scrnaseq-1.1.7/pigx-scrnaseq.in pigx_scrnaseq-1.1.7.patched/pigx-scrnaseq.in
+--- pigx_scrnaseq-1.1.7/pigx-scrnaseq.in	2020-11-30 16:08:55.000000000 +0100
++++ pigx_scrnaseq-1.1.7.patched/pigx-scrnaseq.in	2021-10-06 13:55:47.889218079 +0200
+@@ -274,7 +274,6 @@
+     if path.exists(bin): shutil.rmtree(bin)
+     os.makedirs(bin, exist_ok=True)
+     os.symlink('@PANDOC@', path.join(bin, "pandoc"))
+-    os.symlink('@PANDOC_CITEPROC@', path.join(bin, "pandoc-citeproc"))
+     os.symlink('@RSCRIPT@', path.join(bin, "Rscript"))
+     os.environ['PATH'] = path.abspath(bin) + ":" + os.environ['PATH']
+     os.environ['PIGX_PATH'] = path.abspath(bin) + ":" + os.environ['PATH']
diff --git a/gnu/packages/patches/pipewire-0.2.7-fno-common.patch b/gnu/packages/patches/pipewire-0.2.7-fno-common.patch
new file mode 100644
index 0000000000..f7d9b25932
--- /dev/null
+++ b/gnu/packages/patches/pipewire-0.2.7-fno-common.patch
@@ -0,0 +1,51 @@
+Fixes 'multiple definition errors' when building with GCC 10+
+
+From: https://bugs.gentoo.org/710796
+Originally from: https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/a62e41e
+and https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/7a976c7
+
+--- a/spa/plugins/bluez5/a2dp-codecs.h
++++ b/spa/plugins/bluez5/a2dp-codecs.h
+@@ -284,15 +284,15 @@
+         }
+ }
+ 
+-const a2dp_sbc_t bluez_a2dp_sbc;
++extern const a2dp_sbc_t bluez_a2dp_sbc;
+ #if ENABLE_MP3
+-const a2dp_mpeg_t bluez_a2dp_mpeg;
++extern const a2dp_mpeg_t bluez_a2dp_mpeg;
+ #endif
+ #if ENABLE_AAC
+-const a2dp_aac_t bluez_a2dp_aac;
++extern const a2dp_aac_t bluez_a2dp_aac;
+ #endif
+ #if ENABLE_APTX
+-const a2dp_aptx_t bluez_a2dp_aptx;
++extern const a2dp_aptx_t bluez_a2dp_aptx;
+ #endif
+ 
+ #endif
+--- a/spa/plugins/bluez5/bluez5-monitor.c
++++ b/spa/plugins/bluez5/bluez5-monitor.c
+@@ -75,7 +75,7 @@
+ 	struct spa_list transport_list;
+ };
+ 
+-struct spa_handle_factory spa_a2dp_sink_factory;
++extern struct spa_handle_factory spa_a2dp_sink_factory;
+ 
+ static void fill_item(struct spa_bt_monitor *this, struct spa_bt_transport *transport,
+ 		struct spa_pod **result, struct spa_pod_builder *builder)
+--- a/spa/plugins/bluez5/meson.build
++++ b/spa/plugins/bluez5/meson.build
+@@ -1,7 +1,8 @@
+ 
+ bluez5_sources = ['plugin.c',
+ 		  'a2dp-sink.c',
+-                  'bluez5-monitor.c']
++		  'a2dp-codecs.c',
++		  'bluez5-monitor.c']
+ 
+ bluez5lib = shared_library('spa-bluez5',
+ 	bluez5_sources,
diff --git a/gnu/packages/patches/pitivi-fix-build-with-meson-0.60.patch b/gnu/packages/patches/pitivi-fix-build-with-meson-0.60.patch
new file mode 100644
index 0000000000..652a86bff7
--- /dev/null
+++ b/gnu/packages/patches/pitivi-fix-build-with-meson-0.60.patch
@@ -0,0 +1,46 @@
+From b54da52289f9578d7021f466d731cfd48330e5fe Mon Sep 17 00:00:00 2001
+From: Leo Famulari <leo@famulari.name>
+Date: Thu, 25 Nov 2021 18:56:44 -0500
+Subject: [PATCH] Fix build with Meson 0.60.
+
+https://gitlab.gnome.org/GNOME/pitivi/-/issues/2593
+
+* data/meson.build: Adjust to changes in Meson 0.60.
+---
+ data/meson.build | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/data/meson.build b/data/meson.build
+index 2ea82cf..60d2316 100644
+--- a/data/meson.build
++++ b/data/meson.build
+@@ -6,7 +6,7 @@ install_subdir('audiopresets', install_dir: pkgdatadir)
+ install_subdir('videopresets', install_dir: pkgdatadir)
+ install_subdir('gstpresets', install_dir: pkgdatadir)
+ 
+-desktop_file = i18n.merge_file('org.pitivi.Pitivi.desktop',
++desktop_file = i18n.merge_file(
+     type: 'desktop',
+     output : 'org.pitivi.Pitivi.desktop',
+     input : 'org.pitivi.Pitivi.desktop.in',
+@@ -25,7 +25,7 @@ if desktop_file_validate.found()
+   )
+ endif
+ 
+-appdata_file = i18n.merge_file('org.pitivi.Pitivi.appdata.xml',
++appdata_file = i18n.merge_file(
+     type: 'xml',
+     output : 'org.pitivi.Pitivi.appdata.xml',
+     input : 'org.pitivi.Pitivi.appdata.xml.in',
+@@ -43,7 +43,7 @@ if appstream_util.found()
+   )
+ endif
+ 
+-i18n.merge_file('org.pitivi.Pitivi-mime.xml',
++i18n.merge_file(
+     output : 'org.pitivi.Pitivi-mime.xml',
+     input : 'org.pitivi.Pitivi-mime.xml.in',
+     po_dir: podir,
+-- 
+2.33.1
+
diff --git a/gnu/packages/patches/pjproject-correct-the-cflags-field.patch b/gnu/packages/patches/pjproject-correct-the-cflags-field.patch
deleted file mode 100644
index 8bc503580d..0000000000
--- a/gnu/packages/patches/pjproject-correct-the-cflags-field.patch
+++ /dev/null
@@ -1,121 +0,0 @@
-From 44f8f6c1c71bec6bf00269b075a2dc801ae6fd45 Mon Sep 17 00:00:00 2001
-From: Vladimir Stoiakin <VStoiakin@lavabit.com>
-Date: Thu, 23 Apr 2020 14:06:40 +0300
-Subject: [PATCH 1/2] libpjproject.pc: correct the field 'cflags'
-
----
- Makefile           | 6 ++----
- aconfigure         | 4 ++++
- aconfigure.ac      | 3 +++
- build.mak.in       | 7 +++----
- libpjproject.pc.in | 4 ++--
- 5 files changed, 14 insertions(+), 10 deletions(-)
-
-diff --git a/Makefile b/Makefile
-index ffaf638dd..3fd5cab40 100644
---- a/Makefile
-+++ b/Makefile
-@@ -132,10 +132,8 @@ install:
- 		sed -e "s!@INCLUDEDIR@!$(includedir)!" | \
- 		sed -e "s!@LIBDIR@!$(libdir)!" | \
- 		sed -e "s/@PJ_VERSION@/$(PJ_VERSION)/" | \
--		sed -e "s!@PJ_LDLIBS@!!" | \
--		sed -e "s!@PJ_LDXXLIBS@!$(PJ_LDXXLIBS)!" | \
--		sed -e "s!@PJ_INSTALL_CFLAGS@!!" | \
--		sed -e "s!@PJ_INSTALL_CXXFLAGS@!$(PJ_INSTALL_CXXFLAGS)!" > $(DESTDIR)/$(libdir)/pkgconfig/libpjproject.pc
-+		sed -e "s!@PJ_INSTALL_LDFLAGS@!$(PJ_INSTALL_LDFLAGS)!" | \
-+		sed -e "s!@PJ_INSTALL_CFLAGS@!$(PJ_INSTALL_CFLAGS)!" > $(DESTDIR)/$(libdir)/pkgconfig/libpjproject.pc
- 
- uninstall:
- 	$(RM) $(DESTDIR)$(libdir)/pkgconfig/libpjproject.pc
-diff --git a/aconfigure b/aconfigure
-index 2abbcf533..1ab932bda 100755
---- a/aconfigure
-+++ b/aconfigure
-@@ -706,6 +706,7 @@ GREP
- CPP
- ac_cross_compile
- ac_shlib_suffix
-+ac_cflags
- ac_build_mak_vars
- ac_pjdir
- CC_CFLAGS
-@@ -3952,6 +3953,7 @@ if test "$CC_CFLAGS" = ""; then CC_CFLAGS="-Wall"; fi
- 
- 
- 
-+
- case $host in
-     *mingw* | *cygw* | *win32* | *w32* )
- 	if pwd -W 2&> /dev/null; then
-@@ -5138,8 +5140,10 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
- 
- if test "x$ac_cv_c_bigendian" = "xyes"; then
-   CFLAGS="$CFLAGS -DPJ_IS_BIG_ENDIAN=1 -DPJ_IS_LITTLE_ENDIAN=0"
-+  ac_cflags="$ac_cflags -DPJ_IS_BIG_ENDIAN=1 -DPJ_IS_LITTLE_ENDIAN=0"
- else
-   CFLAGS="$CFLAGS -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1"
-+  ac_cflags="$ac_cflags -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1"
- fi
- 
- 
-diff --git a/aconfigure.ac b/aconfigure.ac
-index 83d3559ed..b1d493c08 100644
---- a/aconfigure.ac
-+++ b/aconfigure.ac
-@@ -71,6 +71,7 @@ AC_SUBST(CC_CFLAGS)
- 
- AC_SUBST(ac_pjdir)
- AC_SUBST(ac_build_mak_vars)
-+AC_SUBST(ac_cflags)
- 
- case $host in 
-     *mingw* | *cygw* | *win32* | *w32* )
-@@ -144,8 +145,10 @@ AC_C_BIGENDIAN
- 
- if test "x$ac_cv_c_bigendian" = "xyes"; then
-   CFLAGS="$CFLAGS -DPJ_IS_BIG_ENDIAN=1 -DPJ_IS_LITTLE_ENDIAN=0"
-+  ac_cflags="$ac_cflags -DPJ_IS_BIG_ENDIAN=1 -DPJ_IS_LITTLE_ENDIAN=0"
- else
-   CFLAGS="$CFLAGS -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1"
-+  ac_cflags="$ac_cflags -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1"
- fi
- 
- dnl
-diff --git a/build.mak.in b/build.mak.in
-index abc0c4fa0..a9078bb25 100644
---- a/build.mak.in
-+++ b/build.mak.in
-@@ -299,7 +299,7 @@ export APP_LDXXLIBS := $(PJSUA2_LIB_LDLIB) \
- 	-lstdc++ \
- 	$(APP_LDLIBS)
- 
--# Here are the variabels to use if application is using the library
-+# Here are the variables to use if application is using the library
- # from within the source distribution
- export PJ_CC := $(APP_CC)
- export PJ_CXX := $(APP_CXX)
-@@ -317,6 +317,5 @@ export PJ_LIBXX_FILES := $(APP_LIBXX_FILES)
- export PJ_INSTALL_DIR := @prefix@
- export PJ_INSTALL_INC_DIR := @includedir@
- export PJ_INSTALL_LIB_DIR := @libdir@
--export PJ_INSTALL_CFLAGS := -I$(PJ_INSTALL_INC_DIR) -DPJ_AUTOCONF=1 @CFLAGS@
--export PJ_INSTALL_CXXFLAGS := @CXXFLAGS@ $(PJ_INSTALL_CFLAGS)
--export PJ_INSTALL_LDFLAGS := -L$(PJ_INSTALL_LIB_DIR) $(APP_LDLIBS)
-+export PJ_INSTALL_CFLAGS := -I$(PJ_INSTALL_INC_DIR) -DPJ_AUTOCONF=1 @ac_cflags@
-+export PJ_INSTALL_LDFLAGS := -L$(PJ_INSTALL_LIB_DIR) $(APP_LDXXLIBS)
-diff --git a/libpjproject.pc.in b/libpjproject.pc.in
-index fa8d39114..30ea05c07 100644
---- a/libpjproject.pc.in
-+++ b/libpjproject.pc.in
-@@ -9,5 +9,5 @@ Name: libpjproject
- Description: Multimedia communication library
- URL: http://www.pjsip.org
- Version: @PJ_VERSION@
--Libs: -L${libdir} @PJ_LDXXLIBS@
--Cflags: -I${includedir} @PJ_INSTALL_CXXFLAGS@
-+Libs: @PJ_INSTALL_LDFLAGS@
-+Cflags: @PJ_INSTALL_CFLAGS@
--- 
-2.27.0
-
diff --git a/gnu/packages/patches/pjproject-fix-pkg-config-ldflags.patch b/gnu/packages/patches/pjproject-fix-pkg-config-ldflags.patch
deleted file mode 100644
index 1199d82f1e..0000000000
--- a/gnu/packages/patches/pjproject-fix-pkg-config-ldflags.patch
+++ /dev/null
@@ -1,79 +0,0 @@
-From 9bcba7fb28055550961b134e517b695a8cd05b2a Mon Sep 17 00:00:00 2001
-From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
-Date: Mon, 3 Aug 2020 17:43:19 -0400
-Subject: [PATCH] libpjproject.pc: Move external libraries to Libs.private.
-
-This is done so users of a shared pjproject library do not get link
-directives (provided via pkg-config file of pjproject) to link against
-pjproject's own library dependencies.
-
-Static linking with pjproject is preserved by moving the external
-libraries link directives to the Libs.private field, which is
-specifically intended for this purpose, via for example:
-
-  $ pkg-config --static --libs libpjproject
-
-* build.mak.in (PJ_INSTALL_LDFLAGS_PRIVATE): New variable.
-(PJ_INSTALL_LDFLAGS): Filter out PJ_INSTALL_LDFLAGS_PRIVATE entries.
-* libpjproject.pc.in (Libs.private): New field.
-* Makefile: Substitute PJ_INSTALL_LDFLAGS_PRIVATE as the value for the
-Libs.private field.
----
- Makefile           | 5 +++--
- build.mak.in       | 3 ++-
- libpjproject.pc.in | 1 +
- 3 files changed, 6 insertions(+), 3 deletions(-)
-
-diff --git a/Makefile b/Makefile
-index 3fd5cab40..d67badfa4 100644
---- a/Makefile
-+++ b/Makefile
-@@ -54,14 +54,14 @@ doc:
- 		    exit 1; \
- 		fi; \
- 	done
--	
-+
- LIBS = 	pjlib/lib/libpj-$(TARGET_NAME).a \
- 	pjlib-util/lib/libpjlib-util-$(TARGET_NAME).a \
- 	pjnath/lib/libpjnath-$(TARGET_NAME).a \
- 	pjmedia/lib/libpjmedia-$(TARGET_NAME).a \
- 	pjmedia/lib/libpjmedia-audiodev-$(TARGET_NAME).a \
- 	pjmedia/lib/libpjmedia-codec-$(TARGET_NAME).a \
--    	pjsip/lib/libpjsip-$(TARGET_NAME).a \
-+	pjsip/lib/libpjsip-$(TARGET_NAME).a \
- 	pjsip/lib/libpjsip-ua-$(TARGET_NAME).a \
- 	pjsip/lib/libpjsip-simple-$(TARGET_NAME).a \
- 	pjsip/lib/libpjsua-$(TARGET_NAME).a
-@@ -133,6 +133,7 @@ install:
- 		sed -e "s!@LIBDIR@!$(libdir)!" | \
- 		sed -e "s/@PJ_VERSION@/$(PJ_VERSION)/" | \
- 		sed -e "s!@PJ_INSTALL_LDFLAGS@!$(PJ_INSTALL_LDFLAGS)!" | \
-+		sed -e "s!@PJ_INSTALL_LDFLAGS_PRIVATE@!$(PJ_INSTALL_LDFLAGS_PRIVATE)!" | \
- 		sed -e "s!@PJ_INSTALL_CFLAGS@!$(PJ_INSTALL_CFLAGS)!" > $(DESTDIR)/$(libdir)/pkgconfig/libpjproject.pc
- 
- uninstall:
-diff --git a/build.mak.in b/build.mak.in
-index a9078bb25..1a18a8513 100644
---- a/build.mak.in
-+++ b/build.mak.in
-@@ -318,4 +318,5 @@ export PJ_INSTALL_DIR := @prefix@
- export PJ_INSTALL_INC_DIR := @includedir@
- export PJ_INSTALL_LIB_DIR := @libdir@
- export PJ_INSTALL_CFLAGS := -I$(PJ_INSTALL_INC_DIR) -DPJ_AUTOCONF=1 @ac_cflags@
--export PJ_INSTALL_LDFLAGS := -L$(PJ_INSTALL_LIB_DIR) $(APP_LDXXLIBS)
-+export PJ_INSTALL_LDFLAGS_PRIVATE := $(APP_THIRD_PARTY_LIBS) $(APP_THIRD_PARTY_EXT) @LIBS@
-+export PJ_INSTALL_LDFLAGS := -L$(PJ_INSTALL_LIB_DIR) $(filter-out $(PJ_INSTALL_LDFLAGS_PRIVATE),$(APP_LDXXLIBS))
-diff --git a/libpjproject.pc.in b/libpjproject.pc.in
-index 30ea05c07..4372d5016 100644
---- a/libpjproject.pc.in
-+++ b/libpjproject.pc.in
-@@ -10,4 +10,5 @@ Description: Multimedia communication library
- URL: http://www.pjsip.org
- Version: @PJ_VERSION@
- Libs: @PJ_INSTALL_LDFLAGS@
-+Libs.private: @PJ_INSTALL_LDFLAGS_PRIVATE@
- Cflags: @PJ_INSTALL_CFLAGS@
--- 
-2.27.0
-
diff --git a/gnu/packages/patches/pjproject-install-libpjsua2.patch b/gnu/packages/patches/pjproject-install-libpjsua2.patch
new file mode 100644
index 0000000000..ef9b0de91f
--- /dev/null
+++ b/gnu/packages/patches/pjproject-install-libpjsua2.patch
@@ -0,0 +1,19 @@
+# Retrieved from upstream:
+# https://github.com/pjsip/pjproject/commit/742f7dc252ded778a8b677937791c02e2fbc0dde
+diff --git a/Makefile b/Makefile
+index 31a6d39d4..74e246a44 100644
+--- a/Makefile
++++ b/Makefile
+@@ -121,9 +121,10 @@ cmp_wav:
+ 
+ install:
+ 	mkdir -p $(DESTDIR)$(libdir)/
+-	cp -af $(APP_LIB_FILES) $(DESTDIR)$(libdir)/
+ 	if [ "$(PJ_EXCLUDE_PJSUA2)x" = "x" ] ; then \
+-	    cp -af $(PJ_DIR)/pjsip/lib/libpjsua2-$(LIB_SUFFIX) $(DESTDIR)$(libdir)/; \
++	    cp -af $(APP_LIBXX_FILES) $(DESTDIR)$(libdir)/; \
++	else \
++	    cp -af $(APP_LIB_FILES) $(DESTDIR)$(libdir)/; \
+ 	fi
+ 	mkdir -p $(DESTDIR)$(includedir)/
+ 	for d in pjlib pjlib-util pjnath pjmedia pjsip; do \
diff --git a/gnu/packages/patches/polkit-configure-elogind.patch b/gnu/packages/patches/polkit-configure-elogind.patch
new file mode 100644
index 0000000000..8fefb7a0c2
--- /dev/null
+++ b/gnu/packages/patches/polkit-configure-elogind.patch
@@ -0,0 +1,15 @@
+Even when the polkit configure script detects elogind, it does not use
+it.  This patch ensures that elogind is used when it is detected.
+
+diff -ruN a/configure b/configure
+--- a/configure	1969-12-31 19:00:01.000000000 -0500
++++ b/configure	2021-11-19 00:04:55.581385020 -0500
+@@ -20390,7 +20390,7 @@
+ 
+ 
+ 
+- if test "$have_libsystemd" = "yes"; then
++ if test "$have_libsystemd" = "yes" || test "$have_libelogind" = "yes"; then
+   HAVE_LIBSYSTEMD_TRUE=
+   HAVE_LIBSYSTEMD_FALSE='#'
+ else
diff --git a/gnu/packages/patches/polkit-use-duktape.patch b/gnu/packages/patches/polkit-use-duktape.patch
new file mode 100644
index 0000000000..4eaa7963c2
--- /dev/null
+++ b/gnu/packages/patches/polkit-use-duktape.patch
@@ -0,0 +1,5030 @@
+From 4f66a9549a393e4d74b93eb85301a04ea94bc750 Mon Sep 17 00:00:00 2001
+From: Wu Xiaotian <yetist@gmail.com>
+Date: Wed, 24 Jul 2019 15:55:17 +0800
+Subject: [PATCH 01/16] Add duktape as javascript engine.
+
+Signed-off-by: Gustavo Lima Chaves <gustavo.chaves@microsoft.com>
+---
+ configure.ac                                  |   28 +-
+ src/polkitbackend/Makefile.am                 |   14 +-
+ .../polkitbackendduktapeauthority.c           | 1402 +++++++++++++++++
+ 3 files changed, 1436 insertions(+), 8 deletions(-)
+ create mode 100644 src/polkitbackend/polkitbackendduktapeauthority.c
+
+diff --git a/configure.ac b/configure.ac
+index e434ca2..5a03593 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -80,11 +80,22 @@ PKG_CHECK_MODULES(GLIB, [gmodule-2.0 gio-unix-2.0 >= 2.30.0])
+ AC_SUBST(GLIB_CFLAGS)
+ AC_SUBST(GLIB_LIBS)
+ 
+-PKG_CHECK_MODULES(LIBJS, [mozjs-78])
+-
+-AC_SUBST(LIBJS_CFLAGS)
+-AC_SUBST(LIBJS_CXXFLAGS)
+-AC_SUBST(LIBJS_LIBS)
++dnl ---------------------------------------------------------------------------
++dnl - Check javascript backend
++dnl ---------------------------------------------------------------------------
++AC_ARG_WITH(duktape, AS_HELP_STRING([--with-duktape],[Use Duktape as javascript backend]),with_duktape=yes,with_duktape=no)
++AS_IF([test x${with_duktape} == xyes], [
++  PKG_CHECK_MODULES(LIBJS, [duktape >= 2.0.0 ])
++  AC_SUBST(LIBJS_CFLAGS)
++  AC_SUBST(LIBJS_LIBS)
++], [
++  PKG_CHECK_MODULES(LIBJS, [mozjs-78])
++
++  AC_SUBST(LIBJS_CFLAGS)
++  AC_SUBST(LIBJS_CXXFLAGS)
++  AC_SUBST(LIBJS_LIBS)
++])
++AM_CONDITIONAL(USE_DUKTAPE, [test x$with_duktape == xyes], [Using duktape as javascript engine library])
+ 
+ EXPAT_LIB=""
+ AC_ARG_WITH(expat, [  --with-expat=<dir>      Use expat from here],
+@@ -585,6 +596,13 @@ echo "
+         PAM support:                ${have_pam}
+         systemdsystemunitdir:       ${systemdsystemunitdir}
+         polkitd user:               ${POLKITD_USER}"
++if test "x${with_duktape}" = xyes; then
++echo "
++        Javascript engine:          Duktape"
++else
++echo "
++        Javascript engine:          Mozjs"
++fi
+ 
+ if test "$have_pam" = yes ; then
+ echo "
+diff --git a/src/polkitbackend/Makefile.am b/src/polkitbackend/Makefile.am
+index 7e3c080..abcbc6f 100644
+--- a/src/polkitbackend/Makefile.am
++++ b/src/polkitbackend/Makefile.am
+@@ -33,7 +33,7 @@ libpolkit_backend_1_la_SOURCES =                                   			\
+ 	polkitbackendprivate.h								\
+ 	polkitbackendauthority.h		polkitbackendauthority.c		\
+ 	polkitbackendinteractiveauthority.h	polkitbackendinteractiveauthority.c	\
+-	polkitbackendjsauthority.h		polkitbackendjsauthority.cpp		\
++	polkitbackendjsauthority.h				\
+ 	polkitbackendactionpool.h		polkitbackendactionpool.c		\
+ 	polkitbackendactionlookup.h		polkitbackendactionlookup.c		\
+         $(NULL)
+@@ -51,19 +51,27 @@ libpolkit_backend_1_la_CFLAGS =                                        	\
+         -D_POLKIT_BACKEND_COMPILATION                                  	\
+         $(GLIB_CFLAGS)							\
+ 	$(LIBSYSTEMD_CFLAGS)						\
+-	$(LIBJS_CFLAGS)							\
++	$(LIBJS_CFLAGS)						\
+         $(NULL)
+ 
+ libpolkit_backend_1_la_CXXFLAGS = $(libpolkit_backend_1_la_CFLAGS)
+ 
+ libpolkit_backend_1_la_LIBADD =                               		\
+         $(GLIB_LIBS)							\
++        $(DUKTAPE_LIBS)							\
+ 	$(LIBSYSTEMD_LIBS)						\
+ 	$(top_builddir)/src/polkit/libpolkit-gobject-1.la		\
+ 	$(EXPAT_LIBS)							\
+-	$(LIBJS_LIBS)							\
++	$(LIBJS_LIBS)                                                   \
+         $(NULL)
+ 
++if USE_DUKTAPE
++libpolkit_backend_1_la_SOURCES += polkitbackendduktapeauthority.c
++libpolkit_backend_1_la_LIBADD += -lm
++else
++libpolkit_backend_1_la_SOURCES += polkitbackendjsauthority.cpp
++endif
++
+ rulesdir = $(sysconfdir)/polkit-1/rules.d
+ rules_DATA = 50-default.rules
+ 
+diff --git a/src/polkitbackend/polkitbackendduktapeauthority.c b/src/polkitbackend/polkitbackendduktapeauthority.c
+new file mode 100644
+index 0000000..ae98453
+--- /dev/null
++++ b/src/polkitbackend/polkitbackendduktapeauthority.c
+@@ -0,0 +1,1402 @@
++/*
++ * Copyright (C) 2008-2012 Red Hat, Inc.
++ * Copyright (C) 2015 Tangent Space <jstpierre@mecheye.net>
++ * Copyright (C) 2019 Wu Xiaotian <yetist@gmail.com>
++ *
++ * This library is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License as published by the Free Software Foundation; either
++ * version 2 of the License, or (at your option) any later version.
++ *
++ * This library is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General
++ * Public License along with this library; if not, write to the
++ * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
++ * Boston, MA 02111-1307, USA.
++ *
++ * Author: David Zeuthen <davidz@redhat.com>
++ */
++
++#include "config.h"
++#include <sys/wait.h>
++#include <errno.h>
++#include <pwd.h>
++#include <grp.h>
++#include <netdb.h>
++#include <string.h>
++#include <glib/gstdio.h>
++#include <locale.h>
++#include <glib/gi18n-lib.h>
++
++#include <polkit/polkit.h>
++#include "polkitbackendjsauthority.h"
++
++#include <polkit/polkitprivate.h>
++
++#ifdef HAVE_LIBSYSTEMD
++#include <systemd/sd-login.h>
++#endif /* HAVE_LIBSYSTEMD */
++
++#include "initjs.h" /* init.js */
++#include "duktape.h"
++
++/**
++ * SECTION:polkitbackendjsauthority
++ * @title: PolkitBackendJsAuthority
++ * @short_description: JS Authority
++ * @stability: Unstable
++ *
++ * An implementation of #PolkitBackendAuthority that reads and
++ * evalates Javascript files and supports interaction with
++ * authentication agents (virtue of being based on
++ * #PolkitBackendInteractiveAuthority).
++ */
++
++/* ---------------------------------------------------------------------------------------------------- */
++
++struct _PolkitBackendJsAuthorityPrivate
++{
++  gchar **rules_dirs;
++  GFileMonitor **dir_monitors; /* NULL-terminated array of GFileMonitor instances */
++  duk_context *cx;
++};
++
++#define WATCHDOG_TIMEOUT (15 * G_TIME_SPAN_SECOND)
++
++static void utils_spawn (const gchar *const  *argv,
++                         guint                timeout_seconds,
++                         GCancellable        *cancellable,
++                         GAsyncReadyCallback  callback,
++                         gpointer             user_data);
++
++gboolean utils_spawn_finish (GAsyncResult   *res,
++                             gint           *out_exit_status,
++                             gchar         **out_standard_output,
++                             gchar         **out_standard_error,
++                             GError        **error);
++
++static void on_dir_monitor_changed (GFileMonitor     *monitor,
++                                    GFile            *file,
++                                    GFile            *other_file,
++                                    GFileMonitorEvent event_type,
++                                    gpointer          user_data);
++
++/* ---------------------------------------------------------------------------------------------------- */
++
++enum
++{
++  PROP_0,
++  PROP_RULES_DIRS,
++};
++
++/* ---------------------------------------------------------------------------------------------------- */
++
++static GList *polkit_backend_js_authority_get_admin_auth_identities (PolkitBackendInteractiveAuthority *authority,
++                                                                     PolkitSubject                     *caller,
++                                                                     PolkitSubject                     *subject,
++                                                                     PolkitIdentity                    *user_for_subject,
++                                                                     gboolean                           subject_is_local,
++                                                                     gboolean                           subject_is_active,
++                                                                     const gchar                       *action_id,
++                                                                     PolkitDetails                     *details);
++
++static PolkitImplicitAuthorization polkit_backend_js_authority_check_authorization_sync (
++                                                          PolkitBackendInteractiveAuthority *authority,
++                                                          PolkitSubject                     *caller,
++                                                          PolkitSubject                     *subject,
++                                                          PolkitIdentity                    *user_for_subject,
++                                                          gboolean                           subject_is_local,
++                                                          gboolean                           subject_is_active,
++                                                          const gchar                       *action_id,
++                                                          PolkitDetails                     *details,
++                                                          PolkitImplicitAuthorization        implicit);
++
++G_DEFINE_TYPE (PolkitBackendJsAuthority, polkit_backend_js_authority, POLKIT_BACKEND_TYPE_INTERACTIVE_AUTHORITY);
++
++/* ---------------------------------------------------------------------------------------------------- */
++
++/* ---------------------------------------------------------------------------------------------------- */
++
++static void
++polkit_backend_js_authority_init (PolkitBackendJsAuthority *authority)
++{
++  authority->priv = G_TYPE_INSTANCE_GET_PRIVATE (authority,
++                                                 POLKIT_BACKEND_TYPE_JS_AUTHORITY,
++                                                 PolkitBackendJsAuthorityPrivate);
++}
++
++static gint
++rules_file_name_cmp (const gchar *a,
++                     const gchar *b)
++{
++  gint ret;
++  const gchar *a_base;
++  const gchar *b_base;
++
++  a_base = strrchr (a, '/');
++  b_base = strrchr (b, '/');
++
++  g_assert (a_base != NULL);
++  g_assert (b_base != NULL);
++  a_base += 1;
++  b_base += 1;
++
++  ret = g_strcmp0 (a_base, b_base);
++  if (ret == 0)
++    {
++      /* /etc wins over /usr */
++      ret = g_strcmp0 (a, b);
++      g_assert (ret != 0);
++    }
++
++  return ret;
++}
++
++static void
++load_scripts (PolkitBackendJsAuthority  *authority)
++{
++  duk_context *cx = authority->priv->cx;
++  GList *files = NULL;
++  GList *l;
++  guint num_scripts = 0;
++  GError *error = NULL;
++  guint n;
++
++  files = NULL;
++
++  for (n = 0; authority->priv->rules_dirs != NULL && authority->priv->rules_dirs[n] != NULL; n++)
++    {
++      const gchar *dir_name = authority->priv->rules_dirs[n];
++      GDir *dir = NULL;
++
++      polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority),
++                                    "Loading rules from directory %s",
++                                    dir_name);
++
++      dir = g_dir_open (dir_name,
++                        0,
++                        &error);
++      if (dir == NULL)
++        {
++          polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority),
++                                        "Error opening rules directory: %s (%s, %d)",
++                                        error->message, g_quark_to_string (error->domain), error->code);
++          g_clear_error (&error);
++        }
++      else
++        {
++          const gchar *name;
++          while ((name = g_dir_read_name (dir)) != NULL)
++            {
++              if (g_str_has_suffix (name, ".rules"))
++                files = g_list_prepend (files, g_strdup_printf ("%s/%s", dir_name, name));
++            }
++          g_dir_close (dir);
++        }
++    }
++
++  files = g_list_sort (files, (GCompareFunc) rules_file_name_cmp);
++
++  for (l = files; l != NULL; l = l->next)
++    {
++      const gchar *filename = l->data;
++
++#if (DUK_VERSION >= 20000)
++      gchar *contents;
++      gsize length;
++      GError *error = NULL;
++      if (!g_file_get_contents (filename, &contents, &length, &error)){
++        g_warning("Error when file contents of %s: %s\n", filename, error->message);
++        g_error_free (error);
++        continue;
++      }
++      if (duk_peval_lstring_noresult(cx, contents,length) != 0)
++#else
++      if (duk_peval_file_noresult (cx, filename) != 0)
++#endif
++        {
++          polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority),
++                                        "Error compiling script %s: %s",
++                                        filename, duk_safe_to_string (authority->priv->cx, -1));
++#if (DUK_VERSION >= 20000)
++          g_free (contents);
++#endif
++          continue;
++        }
++#if (DUK_VERSION >= 20000)
++      g_free (contents);
++#endif
++      num_scripts++;
++    }
++
++  polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority),
++                                "Finished loading, compiling and executing %d rules",
++                                num_scripts);
++  g_list_free_full (files, g_free);
++}
++
++static void
++reload_scripts (PolkitBackendJsAuthority *authority)
++{
++  duk_context *cx = authority->priv->cx;
++
++  duk_set_top (cx, 0);
++  duk_get_global_string (cx, "polkit");
++  duk_push_string (cx, "_deleteRules");
++
++  duk_call_prop (cx, 0, 0);
++
++  polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority),
++                                "Collecting garbage unconditionally...");
++
++  load_scripts (authority);
++
++  /* Let applications know we have new rules... */
++  g_signal_emit_by_name (authority, "changed");
++}
++
++static void
++on_dir_monitor_changed (GFileMonitor     *monitor,
++                        GFile            *file,
++                        GFile            *other_file,
++                        GFileMonitorEvent event_type,
++                        gpointer          user_data)
++{
++  PolkitBackendJsAuthority *authority = POLKIT_BACKEND_JS_AUTHORITY (user_data);
++
++  /* TODO: maybe rate-limit so storms of events are collapsed into one with a 500ms resolution?
++   *       Because when editing a file with emacs we get 4-8 events..
++   */
++
++  if (file != NULL)
++    {
++      gchar *name;
++
++      name = g_file_get_basename (file);
++
++      /* g_print ("event_type=%d file=%p name=%s\n", event_type, file, name); */
++      if (!g_str_has_prefix (name, ".") &&
++          !g_str_has_prefix (name, "#") &&
++          g_str_has_suffix (name, ".rules") &&
++          (event_type == G_FILE_MONITOR_EVENT_CREATED ||
++           event_type == G_FILE_MONITOR_EVENT_DELETED ||
++           event_type == G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT))
++        {
++          polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority),
++                                        "Reloading rules");
++          reload_scripts (authority);
++        }
++      g_free (name);
++    }
++}
++
++
++static void
++setup_file_monitors (PolkitBackendJsAuthority *authority)
++{
++  guint n;
++  GPtrArray *p;
++
++  p = g_ptr_array_new ();
++  for (n = 0; authority->priv->rules_dirs != NULL && authority->priv->rules_dirs[n] != NULL; n++)
++    {
++      GFile *file;
++      GError *error;
++      GFileMonitor *monitor;
++
++      file = g_file_new_for_path (authority->priv->rules_dirs[n]);
++      error = NULL;
++      monitor = g_file_monitor_directory (file,
++                                          G_FILE_MONITOR_NONE,
++                                          NULL,
++                                          &error);
++      g_object_unref (file);
++      if (monitor == NULL)
++        {
++          g_warning ("Error monitoring directory %s: %s",
++                     authority->priv->rules_dirs[n],
++                     error->message);
++          g_clear_error (&error);
++        }
++      else
++        {
++          g_signal_connect (monitor,
++                            "changed",
++                            G_CALLBACK (on_dir_monitor_changed),
++                            authority);
++          g_ptr_array_add (p, monitor);
++        }
++    }
++  g_ptr_array_add (p, NULL);
++  authority->priv->dir_monitors = (GFileMonitor**) g_ptr_array_free (p, FALSE);
++}
++
++static duk_ret_t js_polkit_log (duk_context *cx);
++static duk_ret_t js_polkit_spawn (duk_context *cx);
++static duk_ret_t js_polkit_user_is_in_netgroup (duk_context *cx);
++
++static const duk_function_list_entry js_polkit_functions[] =
++{
++  { "log", js_polkit_log, 1 },
++  { "spawn", js_polkit_spawn, 1 },
++  { "_userIsInNetGroup", js_polkit_user_is_in_netgroup, 2 },
++  { NULL, NULL, 0 },
++};
++
++static void
++polkit_backend_js_authority_constructed (GObject *object)
++{
++  PolkitBackendJsAuthority *authority = POLKIT_BACKEND_JS_AUTHORITY (object);
++  duk_context *cx;
++
++  cx = duk_create_heap (NULL, NULL, NULL, authority, NULL);
++  if (cx == NULL)
++    goto fail;
++
++  authority->priv->cx = cx;
++
++  duk_push_global_object (cx);
++  duk_push_object (cx);
++  duk_put_function_list (cx, -1, js_polkit_functions);
++  duk_put_prop_string (cx, -2, "polkit");
++
++  duk_eval_string (cx, init_js);
++
++  if (authority->priv->rules_dirs == NULL)
++    {
++      authority->priv->rules_dirs = g_new0 (gchar *, 3);
++      authority->priv->rules_dirs[0] = g_strdup (PACKAGE_SYSCONF_DIR "/polkit-1/rules.d");
++      authority->priv->rules_dirs[1] = g_strdup (PACKAGE_DATA_DIR "/polkit-1/rules.d");
++    }
++
++  setup_file_monitors (authority);
++  load_scripts (authority);
++
++  G_OBJECT_CLASS (polkit_backend_js_authority_parent_class)->constructed (object);
++  return;
++
++ fail:
++  g_critical ("Error initializing JavaScript environment");
++  g_assert_not_reached ();
++}
++
++static void
++polkit_backend_js_authority_finalize (GObject *object)
++{
++  PolkitBackendJsAuthority *authority = POLKIT_BACKEND_JS_AUTHORITY (object);
++  guint n;
++
++  for (n = 0; authority->priv->dir_monitors != NULL && authority->priv->dir_monitors[n] != NULL; n++)
++    {
++      GFileMonitor *monitor = authority->priv->dir_monitors[n];
++      g_signal_handlers_disconnect_by_func (monitor,
++                                            G_CALLBACK (on_dir_monitor_changed),
++                                            authority);
++      g_object_unref (monitor);
++    }
++  g_free (authority->priv->dir_monitors);
++  g_strfreev (authority->priv->rules_dirs);
++
++  duk_destroy_heap (authority->priv->cx);
++
++  G_OBJECT_CLASS (polkit_backend_js_authority_parent_class)->finalize (object);
++}
++
++static void
++polkit_backend_js_authority_set_property (GObject      *object,
++                                          guint         property_id,
++                                          const GValue *value,
++                                          GParamSpec   *pspec)
++{
++  PolkitBackendJsAuthority *authority = POLKIT_BACKEND_JS_AUTHORITY (object);
++
++  switch (property_id)
++    {
++      case PROP_RULES_DIRS:
++        g_assert (authority->priv->rules_dirs == NULL);
++        authority->priv->rules_dirs = (gchar **) g_value_dup_boxed (value);
++        break;
++
++      default:
++        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
++        break;
++    }
++}
++
++static const gchar *
++polkit_backend_js_authority_get_name (PolkitBackendAuthority *authority)
++{
++  return "js";
++}
++
++static const gchar *
++polkit_backend_js_authority_get_version (PolkitBackendAuthority *authority)
++{
++  return PACKAGE_VERSION;
++}
++
++static PolkitAuthorityFeatures
++polkit_backend_js_authority_get_features (PolkitBackendAuthority *authority)
++{
++  return POLKIT_AUTHORITY_FEATURES_TEMPORARY_AUTHORIZATION;
++}
++
++static void
++polkit_backend_js_authority_class_init (PolkitBackendJsAuthorityClass *klass)
++{
++  GObjectClass *gobject_class;
++  PolkitBackendAuthorityClass *authority_class;
++  PolkitBackendInteractiveAuthorityClass *interactive_authority_class;
++
++
++  gobject_class = G_OBJECT_CLASS (klass);
++  gobject_class->finalize                               = polkit_backend_js_authority_finalize;
++  gobject_class->set_property                           = polkit_backend_js_authority_set_property;
++  gobject_class->constructed                            = polkit_backend_js_authority_constructed;
++
++  authority_class = POLKIT_BACKEND_AUTHORITY_CLASS (klass);
++  authority_class->get_name                             = polkit_backend_js_authority_get_name;
++  authority_class->get_version                          = polkit_backend_js_authority_get_version;
++  authority_class->get_features                         = polkit_backend_js_authority_get_features;
++
++  interactive_authority_class = POLKIT_BACKEND_INTERACTIVE_AUTHORITY_CLASS (klass);
++  interactive_authority_class->get_admin_identities     = polkit_backend_js_authority_get_admin_auth_identities;
++  interactive_authority_class->check_authorization_sync = polkit_backend_js_authority_check_authorization_sync;
++
++  g_object_class_install_property (gobject_class,
++                                   PROP_RULES_DIRS,
++                                   g_param_spec_boxed ("rules-dirs",
++                                                       NULL,
++                                                       NULL,
++                                                       G_TYPE_STRV,
++                                                       G_PARAM_CONSTRUCT_ONLY | G_PARAM_WRITABLE));
++
++
++  g_type_class_add_private (klass, sizeof (PolkitBackendJsAuthorityPrivate));
++}
++
++/* ---------------------------------------------------------------------------------------------------- */
++
++static void
++set_property_str (duk_context *cx,
++                  const gchar *name,
++                  const gchar *value)
++{
++  duk_push_string (cx, value);
++  duk_put_prop_string (cx, -2, name);
++}
++
++static void
++set_property_strv (duk_context *cx,
++                   const gchar *name,
++                   GPtrArray   *value)
++{
++  guint n;
++  duk_push_array (cx);
++  for (n = 0; n < value->len; n++)
++    {
++      duk_push_string (cx, g_ptr_array_index (value, n));
++      duk_put_prop_index (cx, -2, n);
++    }
++  duk_put_prop_string (cx, -2, name);
++}
++
++static void
++set_property_int32 (duk_context *cx,
++                    const gchar *name,
++                    gint32       value)
++{
++  duk_push_int (cx, value);
++  duk_put_prop_string (cx, -2, name);
++}
++
++static void
++set_property_bool (duk_context *cx,
++                   const char  *name,
++                   gboolean     value)
++{
++  duk_push_boolean (cx, value);
++  duk_put_prop_string (cx, -2, name);
++}
++
++/* ---------------------------------------------------------------------------------------------------- */
++
++static gboolean
++push_subject (duk_context               *cx,
++              PolkitSubject             *subject,
++              PolkitIdentity            *user_for_subject,
++              gboolean                   subject_is_local,
++              gboolean                   subject_is_active,
++              GError                   **error)
++{
++  gboolean ret = FALSE;
++  pid_t pid;
++  uid_t uid;
++  gchar *user_name = NULL;
++  GPtrArray *groups = NULL;
++  struct passwd *passwd;
++  char *seat_str = NULL;
++  char *session_str = NULL;
++
++  duk_get_global_string (cx, "Subject");
++  duk_new (cx, 0);
++
++  if (POLKIT_IS_UNIX_PROCESS (subject))
++    {
++      pid = polkit_unix_process_get_pid (POLKIT_UNIX_PROCESS (subject));
++    }
++  else if (POLKIT_IS_SYSTEM_BUS_NAME (subject))
++    {
++      PolkitSubject *process;
++      process = polkit_system_bus_name_get_process_sync (POLKIT_SYSTEM_BUS_NAME (subject), NULL, error);
++      if (process == NULL)
++        goto out;
++      pid = polkit_unix_process_get_pid (POLKIT_UNIX_PROCESS (process));
++      g_object_unref (process);
++    }
++  else
++    {
++      g_assert_not_reached ();
++    }
++
++#ifdef HAVE_LIBSYSTEMD
++  if (sd_pid_get_session (pid, &session_str) == 0)
++    {
++      if (sd_session_get_seat (session_str, &seat_str) == 0)
++        {
++          /* do nothing */
++        }
++    }
++#endif /* HAVE_LIBSYSTEMD */
++
++  g_assert (POLKIT_IS_UNIX_USER (user_for_subject));
++  uid = polkit_unix_user_get_uid (POLKIT_UNIX_USER (user_for_subject));
++
++  groups = g_ptr_array_new_with_free_func (g_free);
++
++  passwd = getpwuid (uid);
++  if (passwd == NULL)
++    {
++      user_name = g_strdup_printf ("%d", (gint) uid);
++      g_warning ("Error looking up info for uid %d: %m", (gint) uid);
++    }
++  else
++    {
++      gid_t gids[512];
++      int num_gids = 512;
++
++      user_name = g_strdup (passwd->pw_name);
++
++      if (getgrouplist (passwd->pw_name,
++                        passwd->pw_gid,
++                        gids,
++                        &num_gids) < 0)
++        {
++          g_warning ("Error looking up groups for uid %d: %m", (gint) uid);
++        }
++      else
++        {
++          gint n;
++          for (n = 0; n < num_gids; n++)
++            {
++              struct group *group;
++              group = getgrgid (gids[n]);
++              if (group == NULL)
++                {
++                  g_ptr_array_add (groups, g_strdup_printf ("%d", (gint) gids[n]));
++                }
++              else
++                {
++                  g_ptr_array_add (groups, g_strdup (group->gr_name));
++                }
++            }
++        }
++    }
++
++  set_property_int32 (cx, "pid", pid);
++  set_property_str (cx, "user", user_name);
++  set_property_strv (cx, "groups", groups);
++  set_property_str (cx, "seat", seat_str);
++  set_property_str (cx, "session", session_str);
++  set_property_bool (cx, "local", subject_is_local);
++  set_property_bool (cx, "active", subject_is_active);
++
++  ret = TRUE;
++
++ out:
++  free (session_str);
++  free (seat_str);
++  g_free (user_name);
++  if (groups != NULL)
++    g_ptr_array_unref (groups);
++
++  return ret;
++}
++
++/* ---------------------------------------------------------------------------------------------------- */
++
++static gboolean
++push_action_and_details (duk_context               *cx,
++                         const gchar               *action_id,
++                         PolkitDetails             *details,
++                         GError                   **error)
++{
++  gchar **keys;
++  guint n;
++
++  duk_get_global_string (cx, "Action");
++  duk_new (cx, 0);
++
++  set_property_str (cx, "id", action_id);
++
++  keys = polkit_details_get_keys (details);
++  for (n = 0; keys != NULL && keys[n] != NULL; n++)
++    {
++      gchar *key;
++      const gchar *value;
++      key = g_strdup_printf ("_detail_%s", keys[n]);
++      value = polkit_details_lookup (details, keys[n]);
++      set_property_str (cx, key, value);
++      g_free (key);
++    }
++  g_strfreev (keys);
++
++  return TRUE;
++}
++
++/* ---------------------------------------------------------------------------------------------------- */
++
++/* ---------------------------------------------------------------------------------------------------- */
++
++static GList *
++polkit_backend_js_authority_get_admin_auth_identities (PolkitBackendInteractiveAuthority *_authority,
++                                                       PolkitSubject                     *caller,
++                                                       PolkitSubject                     *subject,
++                                                       PolkitIdentity                    *user_for_subject,
++                                                       gboolean                           subject_is_local,
++                                                       gboolean                           subject_is_active,
++                                                       const gchar                       *action_id,
++                                                       PolkitDetails                     *details)
++{
++  PolkitBackendJsAuthority *authority = POLKIT_BACKEND_JS_AUTHORITY (_authority);
++  GList *ret = NULL;
++  guint n;
++  GError *error = NULL;
++  const char *ret_str = NULL;
++  gchar **ret_strs = NULL;
++  duk_context *cx = authority->priv->cx;
++
++  duk_set_top (cx, 0);
++  duk_get_global_string (cx, "polkit");
++  duk_push_string (cx, "_runAdminRules");
++
++  if (!push_action_and_details (cx, action_id, details, &error))
++    {
++      polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority),
++                                    "Error converting action and details to JS object: %s",
++                                    error->message);
++      g_clear_error (&error);
++      goto out;
++    }
++
++  if (!push_subject (cx, subject, user_for_subject, subject_is_local, subject_is_active, &error))
++    {
++      polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority),
++                                    "Error converting subject to JS object: %s",
++                                    error->message);
++      g_clear_error (&error);
++      goto out;
++    }
++
++  if (duk_pcall_prop (cx, 0, 2) != DUK_ERR_NONE)
++    {
++      polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority),
++                                    "Error evaluating admin rules: ",
++                                    duk_safe_to_string (cx, -1));
++      goto out;
++    }
++
++  ret_str = duk_require_string (cx, -1);
++
++  ret_strs = g_strsplit (ret_str, ",", -1);
++  for (n = 0; ret_strs != NULL && ret_strs[n] != NULL; n++)
++    {
++      const gchar *identity_str = ret_strs[n];
++      PolkitIdentity *identity;
++
++      error = NULL;
++      identity = polkit_identity_from_string (identity_str, &error);
++      if (identity == NULL)
++        {
++          polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority),
++                                        "Identity `%s' is not valid, ignoring: %s",
++                                        identity_str, error->message);
++          g_clear_error (&error);
++        }
++      else
++        {
++          ret = g_list_prepend (ret, identity);
++        }
++    }
++  ret = g_list_reverse (ret);
++
++ out:
++  g_strfreev (ret_strs);
++  /* fallback to root password auth */
++  if (ret == NULL)
++    ret = g_list_prepend (ret, polkit_unix_user_new (0));
++
++  return ret;
++}
++
++/* ---------------------------------------------------------------------------------------------------- */
++
++static PolkitImplicitAuthorization
++polkit_backend_js_authority_check_authorization_sync (PolkitBackendInteractiveAuthority *_authority,
++                                                      PolkitSubject                     *caller,
++                                                      PolkitSubject                     *subject,
++                                                      PolkitIdentity                    *user_for_subject,
++                                                      gboolean                           subject_is_local,
++                                                      gboolean                           subject_is_active,
++                                                      const gchar                       *action_id,
++                                                      PolkitDetails                     *details,
++                                                      PolkitImplicitAuthorization        implicit)
++{
++  PolkitBackendJsAuthority *authority = POLKIT_BACKEND_JS_AUTHORITY (_authority);
++  PolkitImplicitAuthorization ret = implicit;
++  GError *error = NULL;
++  gchar *ret_str = NULL;
++  gboolean good = FALSE;
++  duk_context *cx = authority->priv->cx;
++
++  duk_set_top (cx, 0);
++  duk_get_global_string (cx, "polkit");
++  duk_push_string (cx, "_runRules");
++
++  if (!push_action_and_details (cx, action_id, details, &error))
++    {
++      polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority),
++                                    "Error converting action and details to JS object: %s",
++                                    error->message);
++      g_clear_error (&error);
++      goto out;
++    }
++
++  if (!push_subject (cx, subject, user_for_subject, subject_is_local, subject_is_active, &error))
++    {
++      polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority),
++                                    "Error converting subject to JS object: %s",
++                                    error->message);
++      g_clear_error (&error);
++      goto out;
++    }
++
++  if (duk_pcall_prop (cx, 0, 2) != DUK_ERR_NONE)
++  {
++      polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority),
++                                    "Error evaluating authorization rules: ",
++                                    duk_safe_to_string (cx, -1));
++      goto out;
++  }
++
++  if (duk_is_null(cx, -1)) {
++    good = TRUE;
++    goto out;
++  }
++  ret_str = g_strdup (duk_require_string (cx, -1));
++  if (!polkit_implicit_authorization_from_string (ret_str, &ret))
++    {
++      polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority),
++                                    "Returned result `%s' is not valid",
++                                    ret_str);
++      goto out;
++    }
++
++  good = TRUE;
++
++ out:
++  if (!good)
++    ret = POLKIT_IMPLICIT_AUTHORIZATION_NOT_AUTHORIZED;
++  g_free (ret_str);
++
++  return ret;
++}
++
++/* ---------------------------------------------------------------------------------------------------- */
++
++static duk_ret_t
++js_polkit_log (duk_context *cx)
++{
++  const char *str = duk_require_string (cx, 0);
++  fprintf (stderr, "%s\n", str);
++  return 0;
++}
++
++/* ---------------------------------------------------------------------------------------------------- */
++
++static const gchar *
++get_signal_name (gint signal_number)
++{
++  switch (signal_number)
++    {
++#define _HANDLE_SIG(sig) case sig: return #sig;
++    _HANDLE_SIG (SIGHUP);
++    _HANDLE_SIG (SIGINT);
++    _HANDLE_SIG (SIGQUIT);
++    _HANDLE_SIG (SIGILL);
++    _HANDLE_SIG (SIGABRT);
++    _HANDLE_SIG (SIGFPE);
++    _HANDLE_SIG (SIGKILL);
++    _HANDLE_SIG (SIGSEGV);
++    _HANDLE_SIG (SIGPIPE);
++    _HANDLE_SIG (SIGALRM);
++    _HANDLE_SIG (SIGTERM);
++    _HANDLE_SIG (SIGUSR1);
++    _HANDLE_SIG (SIGUSR2);
++    _HANDLE_SIG (SIGCHLD);
++    _HANDLE_SIG (SIGCONT);
++    _HANDLE_SIG (SIGSTOP);
++    _HANDLE_SIG (SIGTSTP);
++    _HANDLE_SIG (SIGTTIN);
++    _HANDLE_SIG (SIGTTOU);
++    _HANDLE_SIG (SIGBUS);
++#ifdef SIGPOLL
++    _HANDLE_SIG (SIGPOLL);
++#endif
++    _HANDLE_SIG (SIGPROF);
++    _HANDLE_SIG (SIGSYS);
++    _HANDLE_SIG (SIGTRAP);
++    _HANDLE_SIG (SIGURG);
++    _HANDLE_SIG (SIGVTALRM);
++    _HANDLE_SIG (SIGXCPU);
++    _HANDLE_SIG (SIGXFSZ);
++#undef _HANDLE_SIG
++    default:
++      break;
++    }
++  return "UNKNOWN_SIGNAL";
++}
++
++typedef struct
++{
++  GMainLoop *loop;
++  GAsyncResult *res;
++} SpawnData;
++
++static void
++spawn_cb (GObject       *source_object,
++          GAsyncResult  *res,
++          gpointer       user_data)
++{
++  SpawnData *data = user_data;
++  data->res = g_object_ref (res);
++  g_main_loop_quit (data->loop);
++}
++
++static duk_ret_t
++js_polkit_spawn (duk_context *cx)
++{
++#if (DUK_VERSION >= 20000)
++  duk_ret_t ret = DUK_RET_ERROR;
++#else
++  duk_ret_t ret = DUK_RET_INTERNAL_ERROR;
++#endif
++  gchar *standard_output = NULL;
++  gchar *standard_error = NULL;
++  gint exit_status;
++  GError *error = NULL;
++  guint32 array_len;
++  gchar **argv = NULL;
++  GMainContext *context = NULL;
++  GMainLoop *loop = NULL;
++  SpawnData data = {0};
++  char *err_str = NULL;
++  guint n;
++
++  if (!duk_is_array (cx, 0))
++    goto out;
++
++  array_len = duk_get_length (cx, 0);
++
++  argv = g_new0 (gchar*, array_len + 1);
++  for (n = 0; n < array_len; n++)
++    {
++      duk_get_prop_index (cx, 0, n);
++      argv[n] = g_strdup (duk_to_string (cx, -1));
++      duk_pop (cx);
++    }
++
++  context = g_main_context_new ();
++  loop = g_main_loop_new (context, FALSE);
++
++  g_main_context_push_thread_default (context);
++
++  data.loop = loop;
++  utils_spawn ((const gchar *const *) argv,
++               10, /* timeout_seconds */
++               NULL, /* cancellable */
++               spawn_cb,
++               &data);
++
++  g_main_loop_run (loop);
++
++  g_main_context_pop_thread_default (context);
++
++  if (!utils_spawn_finish (data.res,
++                           &exit_status,
++                           &standard_output,
++                           &standard_error,
++                           &error))
++    {
++      err_str = g_strdup_printf ("Error spawning helper: %s (%s, %d)",
++                                 error->message, g_quark_to_string (error->domain), error->code);
++      g_clear_error (&error);
++      goto out;
++    }
++
++  if (!(WIFEXITED (exit_status) && WEXITSTATUS (exit_status) == 0))
++    {
++      GString *gstr;
++      gstr = g_string_new (NULL);
++      if (WIFEXITED (exit_status))
++        {
++          g_string_append_printf (gstr,
++                                  "Helper exited with non-zero exit status %d",
++                                  WEXITSTATUS (exit_status));
++        }
++      else if (WIFSIGNALED (exit_status))
++        {
++          g_string_append_printf (gstr,
++                                  "Helper was signaled with signal %s (%d)",
++                                  get_signal_name (WTERMSIG (exit_status)),
++                                  WTERMSIG (exit_status));
++        }
++      g_string_append_printf (gstr, ", stdout=`%s', stderr=`%s'",
++                              standard_output, standard_error);
++      err_str = g_string_free (gstr, FALSE);
++      goto out;
++    }
++
++  duk_push_string (cx, standard_output);
++  ret = 1;
++
++ out:
++  g_strfreev (argv);
++  g_free (standard_output);
++  g_free (standard_error);
++  g_clear_object (&data.res);
++  if (loop != NULL)
++    g_main_loop_unref (loop);
++  if (context != NULL)
++    g_main_context_unref (context);
++
++  if (err_str)
++    duk_error (cx, DUK_ERR_ERROR, err_str);
++
++  return ret;
++}
++
++/* ---------------------------------------------------------------------------------------------------- */
++
++
++static duk_ret_t
++js_polkit_user_is_in_netgroup (duk_context *cx)
++{
++  const char *user;
++  const char *netgroup;
++  gboolean is_in_netgroup = FALSE;
++
++  user = duk_require_string (cx, 0);
++  netgroup = duk_require_string (cx, 1);
++
++  if (innetgr (netgroup,
++               NULL,  /* host */
++               user,
++               NULL)) /* domain */
++    {
++      is_in_netgroup = TRUE;
++    }
++
++  duk_push_boolean (cx, is_in_netgroup);
++  return 1;
++}
++
++/* ---------------------------------------------------------------------------------------------------- */
++
++typedef struct
++{
++  GSimpleAsyncResult *simple; /* borrowed reference */
++  GMainContext *main_context; /* may be NULL */
++
++  GCancellable *cancellable;  /* may be NULL */
++  gulong cancellable_handler_id;
++
++  GPid child_pid;
++  gint child_stdout_fd;
++  gint child_stderr_fd;
++
++  GIOChannel *child_stdout_channel;
++  GIOChannel *child_stderr_channel;
++
++  GSource *child_watch_source;
++  GSource *child_stdout_source;
++  GSource *child_stderr_source;
++
++  guint timeout_seconds;
++  gboolean timed_out;
++  GSource *timeout_source;
++
++  GString *child_stdout;
++  GString *child_stderr;
++
++  gint exit_status;
++} UtilsSpawnData;
++
++static void
++utils_child_watch_from_release_cb (GPid     pid,
++                                   gint     status,
++                                   gpointer user_data)
++{
++}
++
++static void
++utils_spawn_data_free (UtilsSpawnData *data)
++{
++  if (data->timeout_source != NULL)
++    {
++      g_source_destroy (data->timeout_source);
++      data->timeout_source = NULL;
++    }
++
++  /* Nuke the child, if necessary */
++  if (data->child_watch_source != NULL)
++    {
++      g_source_destroy (data->child_watch_source);
++      data->child_watch_source = NULL;
++    }
++
++  if (data->child_pid != 0)
++    {
++      GSource *source;
++      kill (data->child_pid, SIGTERM);
++      /* OK, we need to reap for the child ourselves - we don't want
++       * to use waitpid() because that might block the calling
++       * thread (the child might handle SIGTERM and use several
++       * seconds for cleanup/rollback).
++       *
++       * So we use GChildWatch instead.
++       *
++       * Avoid taking a references to ourselves. but note that we need
++       * to pass the GSource so we can nuke it once handled.
++       */
++      source = g_child_watch_source_new (data->child_pid);
++      g_source_set_callback (source,
++                             (GSourceFunc) utils_child_watch_from_release_cb,
++                             source,
++                             (GDestroyNotify) g_source_destroy);
++      g_source_attach (source, data->main_context);
++      g_source_unref (source);
++      data->child_pid = 0;
++    }
++
++  if (data->child_stdout != NULL)
++    {
++      g_string_free (data->child_stdout, TRUE);
++      data->child_stdout = NULL;
++    }
++
++  if (data->child_stderr != NULL)
++    {
++      g_string_free (data->child_stderr, TRUE);
++      data->child_stderr = NULL;
++    }
++
++  if (data->child_stdout_channel != NULL)
++    {
++      g_io_channel_unref (data->child_stdout_channel);
++      data->child_stdout_channel = NULL;
++    }
++  if (data->child_stderr_channel != NULL)
++    {
++      g_io_channel_unref (data->child_stderr_channel);
++      data->child_stderr_channel = NULL;
++    }
++
++  if (data->child_stdout_source != NULL)
++    {
++      g_source_destroy (data->child_stdout_source);
++      data->child_stdout_source = NULL;
++    }
++  if (data->child_stderr_source != NULL)
++    {
++      g_source_destroy (data->child_stderr_source);
++      data->child_stderr_source = NULL;
++    }
++
++  if (data->child_stdout_fd != -1)
++    {
++      g_warn_if_fail (close (data->child_stdout_fd) == 0);
++      data->child_stdout_fd = -1;
++    }
++  if (data->child_stderr_fd != -1)
++    {
++      g_warn_if_fail (close (data->child_stderr_fd) == 0);
++      data->child_stderr_fd = -1;
++    }
++
++  if (data->cancellable_handler_id > 0)
++    {
++      g_cancellable_disconnect (data->cancellable, data->cancellable_handler_id);
++      data->cancellable_handler_id = 0;
++    }
++
++  if (data->main_context != NULL)
++    g_main_context_unref (data->main_context);
++
++  if (data->cancellable != NULL)
++    g_object_unref (data->cancellable);
++
++  g_slice_free (UtilsSpawnData, data);
++}
++
++/* called in the thread where @cancellable was cancelled */
++static void
++utils_on_cancelled (GCancellable *cancellable,
++                    gpointer      user_data)
++{
++  UtilsSpawnData *data = user_data;
++  GError *error;
++
++  error = NULL;
++  g_warn_if_fail (g_cancellable_set_error_if_cancelled (cancellable, &error));
++  g_simple_async_result_take_error (data->simple, error);
++  g_simple_async_result_complete_in_idle (data->simple);
++  g_object_unref (data->simple);
++}
++
++static gboolean
++utils_read_child_stderr (GIOChannel *channel,
++                         GIOCondition condition,
++                         gpointer user_data)
++{
++  UtilsSpawnData *data = user_data;
++  gchar buf[1024];
++  gsize bytes_read;
++
++  g_io_channel_read_chars (channel, buf, sizeof buf, &bytes_read, NULL);
++  g_string_append_len (data->child_stderr, buf, bytes_read);
++  return TRUE;
++}
++
++static gboolean
++utils_read_child_stdout (GIOChannel *channel,
++                         GIOCondition condition,
++                         gpointer user_data)
++{
++  UtilsSpawnData *data = user_data;
++  gchar buf[1024];
++  gsize bytes_read;
++
++  g_io_channel_read_chars (channel, buf, sizeof buf, &bytes_read, NULL);
++  g_string_append_len (data->child_stdout, buf, bytes_read);
++  return TRUE;
++}
++
++static void
++utils_child_watch_cb (GPid     pid,
++                      gint     status,
++                      gpointer user_data)
++{
++  UtilsSpawnData *data = user_data;
++  gchar *buf;
++  gsize buf_size;
++
++  if (g_io_channel_read_to_end (data->child_stdout_channel, &buf, &buf_size, NULL) == G_IO_STATUS_NORMAL)
++    {
++      g_string_append_len (data->child_stdout, buf, buf_size);
++      g_free (buf);
++    }
++  if (g_io_channel_read_to_end (data->child_stderr_channel, &buf, &buf_size, NULL) == G_IO_STATUS_NORMAL)
++    {
++      g_string_append_len (data->child_stderr, buf, buf_size);
++      g_free (buf);
++    }
++
++  data->exit_status = status;
++
++  /* ok, child watch is history, make sure we don't free it in spawn_data_free() */
++  data->child_pid = 0;
++  data->child_watch_source = NULL;
++
++  /* we're done */
++  g_simple_async_result_complete_in_idle (data->simple);
++  g_object_unref (data->simple);
++}
++
++static gboolean
++utils_timeout_cb (gpointer user_data)
++{
++  UtilsSpawnData *data = user_data;
++
++  data->timed_out = TRUE;
++
++  /* ok, timeout is history, make sure we don't free it in spawn_data_free() */
++  data->timeout_source = NULL;
++
++  /* we're done */
++  g_simple_async_result_complete_in_idle (data->simple);
++  g_object_unref (data->simple);
++
++  return FALSE; /* remove source */
++}
++
++static void
++utils_spawn (const gchar *const  *argv,
++             guint                timeout_seconds,
++             GCancellable        *cancellable,
++             GAsyncReadyCallback  callback,
++             gpointer             user_data)
++{
++  UtilsSpawnData *data;
++  GError *error;
++
++  data = g_slice_new0 (UtilsSpawnData);
++  data->timeout_seconds = timeout_seconds;
++  data->simple = g_simple_async_result_new (NULL,
++                                            callback,
++                                            user_data,
++                                            utils_spawn);
++  data->main_context = g_main_context_get_thread_default ();
++  if (data->main_context != NULL)
++    g_main_context_ref (data->main_context);
++
++  data->cancellable = cancellable != NULL ? g_object_ref (cancellable) : NULL;
++
++  data->child_stdout = g_string_new (NULL);
++  data->child_stderr = g_string_new (NULL);
++  data->child_stdout_fd = -1;
++  data->child_stderr_fd = -1;
++
++  /* the life-cycle of UtilsSpawnData is tied to its GSimpleAsyncResult */
++  g_simple_async_result_set_op_res_gpointer (data->simple, data, (GDestroyNotify) utils_spawn_data_free);
++
++  error = NULL;
++  if (data->cancellable != NULL)
++    {
++      /* could already be cancelled */
++      error = NULL;
++      if (g_cancellable_set_error_if_cancelled (data->cancellable, &error))
++        {
++          g_simple_async_result_take_error (data->simple, error);
++          g_simple_async_result_complete_in_idle (data->simple);
++          g_object_unref (data->simple);
++          goto out;
++        }
++
++      data->cancellable_handler_id = g_cancellable_connect (data->cancellable,
++                                                            G_CALLBACK (utils_on_cancelled),
++                                                            data,
++                                                            NULL);
++    }
++
++  error = NULL;
++  if (!g_spawn_async_with_pipes (NULL, /* working directory */
++                                 (gchar **) argv,
++                                 NULL, /* envp */
++                                 G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD,
++                                 NULL, /* child_setup */
++                                 NULL, /* child_setup's user_data */
++                                 &(data->child_pid),
++                                 NULL, /* gint *stdin_fd */
++                                 &(data->child_stdout_fd),
++                                 &(data->child_stderr_fd),
++                                 &error))
++    {
++      g_prefix_error (&error, "Error spawning: ");
++      g_simple_async_result_take_error (data->simple, error);
++      g_simple_async_result_complete_in_idle (data->simple);
++      g_object_unref (data->simple);
++      goto out;
++    }
++
++  if (timeout_seconds > 0)
++    {
++      data->timeout_source = g_timeout_source_new_seconds (timeout_seconds);
++      g_source_set_priority (data->timeout_source, G_PRIORITY_DEFAULT);
++      g_source_set_callback (data->timeout_source, utils_timeout_cb, data, NULL);
++      g_source_attach (data->timeout_source, data->main_context);
++      g_source_unref (data->timeout_source);
++    }
++
++  data->child_watch_source = g_child_watch_source_new (data->child_pid);
++  g_source_set_callback (data->child_watch_source, (GSourceFunc) utils_child_watch_cb, data, NULL);
++  g_source_attach (data->child_watch_source, data->main_context);
++  g_source_unref (data->child_watch_source);
++
++  data->child_stdout_channel = g_io_channel_unix_new (data->child_stdout_fd);
++  g_io_channel_set_flags (data->child_stdout_channel, G_IO_FLAG_NONBLOCK, NULL);
++  data->child_stdout_source = g_io_create_watch (data->child_stdout_channel, G_IO_IN);
++  g_source_set_callback (data->child_stdout_source, (GSourceFunc) utils_read_child_stdout, data, NULL);
++  g_source_attach (data->child_stdout_source, data->main_context);
++  g_source_unref (data->child_stdout_source);
++
++  data->child_stderr_channel = g_io_channel_unix_new (data->child_stderr_fd);
++  g_io_channel_set_flags (data->child_stderr_channel, G_IO_FLAG_NONBLOCK, NULL);
++  data->child_stderr_source = g_io_create_watch (data->child_stderr_channel, G_IO_IN);
++  g_source_set_callback (data->child_stderr_source, (GSourceFunc) utils_read_child_stderr, data, NULL);
++  g_source_attach (data->child_stderr_source, data->main_context);
++  g_source_unref (data->child_stderr_source);
++
++ out:
++  ;
++}
++
++gboolean
++utils_spawn_finish (GAsyncResult   *res,
++                    gint           *out_exit_status,
++                    gchar         **out_standard_output,
++                    gchar         **out_standard_error,
++                    GError        **error)
++{
++  GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
++  UtilsSpawnData *data;
++  gboolean ret = FALSE;
++
++  g_return_val_if_fail (G_IS_ASYNC_RESULT (res), FALSE);
++  g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
++
++  g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == utils_spawn);
++
++  if (g_simple_async_result_propagate_error (simple, error))
++    goto out;
++
++  data = g_simple_async_result_get_op_res_gpointer (simple);
++
++  if (data->timed_out)
++    {
++      g_set_error (error,
++                   G_IO_ERROR,
++                   G_IO_ERROR_TIMED_OUT,
++                   "Timed out after %d seconds",
++                   data->timeout_seconds);
++      goto out;
++    }
++
++  if (out_exit_status != NULL)
++    *out_exit_status = data->exit_status;
++
++  if (out_standard_output != NULL)
++    *out_standard_output = g_strdup (data->child_stdout->str);
++
++  if (out_standard_error != NULL)
++    *out_standard_error = g_strdup (data->child_stderr->str);
++
++  ret = TRUE;
++
++ out:
++  return ret;
++}
+-- 
+GitLab
+
+
+From d74aad8152a7c51999fffa9abe28e4306a052399 Mon Sep 17 00:00:00 2001
+From: Wu Xiaotian <yetist@gmail.com>
+Date: Sun, 22 Nov 2020 13:15:17 +0800
+Subject: [PATCH 02/16] check netgroup.h header file
+
+Signed-off-by: Gustavo Lima Chaves <gustavo.chaves@microsoft.com>
+---
+ src/polkitbackend/polkitbackendduktapeauthority.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/polkitbackend/polkitbackendduktapeauthority.c b/src/polkitbackend/polkitbackendduktapeauthority.c
+index ae98453..543d6fd 100644
+--- a/src/polkitbackend/polkitbackendduktapeauthority.c
++++ b/src/polkitbackend/polkitbackendduktapeauthority.c
+@@ -26,7 +26,11 @@
+ #include <errno.h>
+ #include <pwd.h>
+ #include <grp.h>
++#ifdef HAVE_NETGROUP_H
++#include <netgroup.h>
++#else
+ #include <netdb.h>
++#endif
+ #include <string.h>
+ #include <glib/gstdio.h>
+ #include <locale.h>
+-- 
+GitLab
+
+
+From 69c761506cbe458807e4ae2742c9e05bc60dad3d Mon Sep 17 00:00:00 2001
+From: Wu Xiaotian <yetist@gmail.com>
+Date: Sun, 22 Nov 2020 10:59:03 +0800
+Subject: [PATCH 03/16] check return value
+
+Signed-off-by: Gustavo Lima Chaves <gustavo.chaves@microsoft.com>
+---
+ src/polkitbackend/polkitbackendduktapeauthority.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/src/polkitbackend/polkitbackendduktapeauthority.c b/src/polkitbackend/polkitbackendduktapeauthority.c
+index 543d6fd..a54ed5b 100644
+--- a/src/polkitbackend/polkitbackendduktapeauthority.c
++++ b/src/polkitbackend/polkitbackendduktapeauthority.c
+@@ -249,7 +249,11 @@ reload_scripts (PolkitBackendJsAuthority *authority)
+   duk_context *cx = authority->priv->cx;
+ 
+   duk_set_top (cx, 0);
+-  duk_get_global_string (cx, "polkit");
++  if (!duk_get_global_string (cx, "polkit")) {
++      polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority),
++                                    "Error deleting old rules, not loading new ones");
++      return;
++  }
+   duk_push_string (cx, "_deleteRules");
+ 
+   duk_call_prop (cx, 0, 0);
+-- 
+GitLab
+
+
+From f1536c4899934fd3c8243fda2d084a472fe57d2e Mon Sep 17 00:00:00 2001
+From: Wu Xiaotian <yetist@gmail.com>
+Date: Sun, 22 Nov 2020 11:22:39 +0800
+Subject: [PATCH 04/16] check return value
+
+Signed-off-by: Gustavo Lima Chaves <gustavo.chaves@microsoft.com>
+---
+ src/polkitbackend/polkitbackendduktapeauthority.c | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/src/polkitbackend/polkitbackendduktapeauthority.c b/src/polkitbackend/polkitbackendduktapeauthority.c
+index a54ed5b..1a7e6d3 100644
+--- a/src/polkitbackend/polkitbackendduktapeauthority.c
++++ b/src/polkitbackend/polkitbackendduktapeauthority.c
+@@ -656,7 +656,10 @@ push_action_and_details (duk_context               *cx,
+   gchar **keys;
+   guint n;
+ 
+-  duk_get_global_string (cx, "Action");
++  if (!duk_get_global_string (cx, "Action")) {
++    return FALSE;
++  }
++
+   duk_new (cx, 0);
+ 
+   set_property_str (cx, "id", action_id);
+@@ -699,7 +702,12 @@ polkit_backend_js_authority_get_admin_auth_identities (PolkitBackendInteractiveA
+   duk_context *cx = authority->priv->cx;
+ 
+   duk_set_top (cx, 0);
+-  duk_get_global_string (cx, "polkit");
++  if (!duk_get_global_string (cx, "polkit")) {
++      polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority),
++                                    "Error deleting old rules, not loading new ones");
++      goto out;
++  }
++
+   duk_push_string (cx, "_runAdminRules");
+ 
+   if (!push_action_and_details (cx, action_id, details, &error))
+-- 
+GitLab
+
+
+From ca15eecf5dc7755947515c1bfc651fd8770aaf8f Mon Sep 17 00:00:00 2001
+From: Wu Xiaotian <yetist@gmail.com>
+Date: Sun, 22 Nov 2020 13:17:16 +0800
+Subject: [PATCH 05/16] check return value
+
+Signed-off-by: Gustavo Lima Chaves <gustavo.chaves@microsoft.com>
+---
+ src/polkitbackend/polkitbackendduktapeauthority.c | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/src/polkitbackend/polkitbackendduktapeauthority.c b/src/polkitbackend/polkitbackendduktapeauthority.c
+index 1a7e6d3..3f1b32d 100644
+--- a/src/polkitbackend/polkitbackendduktapeauthority.c
++++ b/src/polkitbackend/polkitbackendduktapeauthority.c
+@@ -550,7 +550,10 @@ push_subject (duk_context               *cx,
+   char *seat_str = NULL;
+   char *session_str = NULL;
+ 
+-  duk_get_global_string (cx, "Subject");
++  if (!duk_get_global_string (cx, "Subject")) {
++    return FALSE;
++  }
++
+   duk_new (cx, 0);
+ 
+   if (POLKIT_IS_UNIX_PROCESS (subject))
+@@ -789,8 +792,11 @@ polkit_backend_js_authority_check_authorization_sync (PolkitBackendInteractiveAu
+   gboolean good = FALSE;
+   duk_context *cx = authority->priv->cx;
+ 
++  if (!duk_get_global_string (cx, "polkit")) {
++      goto out;
++  }
++
+   duk_set_top (cx, 0);
+-  duk_get_global_string (cx, "polkit");
+   duk_push_string (cx, "_runRules");
+ 
+   if (!push_action_and_details (cx, action_id, details, &error))
+-- 
+GitLab
+
+
+From 870348365cc0166e14f28e0d144ed552bba4d794 Mon Sep 17 00:00:00 2001
+From: Wu Xiaotian <yetist@gmail.com>
+Date: Sun, 22 Nov 2020 13:18:13 +0800
+Subject: [PATCH 06/16] check return value
+
+Signed-off-by: Gustavo Lima Chaves <gustavo.chaves@microsoft.com>
+---
+ src/polkitbackend/polkitbackendduktapeauthority.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/polkitbackend/polkitbackendduktapeauthority.c b/src/polkitbackend/polkitbackendduktapeauthority.c
+index 3f1b32d..6294ad9 100644
+--- a/src/polkitbackend/polkitbackendduktapeauthority.c
++++ b/src/polkitbackend/polkitbackendduktapeauthority.c
+@@ -843,7 +843,8 @@ polkit_backend_js_authority_check_authorization_sync (PolkitBackendInteractiveAu
+  out:
+   if (!good)
+     ret = POLKIT_IMPLICIT_AUTHORIZATION_NOT_AUTHORIZED;
+-  g_free (ret_str);
++  if (ret_str != NULL)
++      g_free (ret_str);
+ 
+   return ret;
+ }
+-- 
+GitLab
+
+
+From 81c916ff08fdcee3c7340c4b2d4632086b89666c Mon Sep 17 00:00:00 2001
+From: Wu Xiaotian <yetist@gmail.com>
+Date: Sun, 22 Nov 2020 11:23:04 +0800
+Subject: [PATCH 07/16] fix typecase
+
+Signed-off-by: Gustavo Lima Chaves <gustavo.chaves@microsoft.com>
+---
+ src/polkitbackend/polkitbackendduktapeauthority.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/src/polkitbackend/polkitbackendduktapeauthority.c b/src/polkitbackend/polkitbackendduktapeauthority.c
+index 6294ad9..d466c9d 100644
+--- a/src/polkitbackend/polkitbackendduktapeauthority.c
++++ b/src/polkitbackend/polkitbackendduktapeauthority.c
+@@ -1191,7 +1191,7 @@ static void
+ utils_on_cancelled (GCancellable *cancellable,
+                     gpointer      user_data)
+ {
+-  UtilsSpawnData *data = user_data;
++  UtilsSpawnData *data = (UtilsSpawnData *)user_data;
+   GError *error;
+ 
+   error = NULL;
+@@ -1206,7 +1206,7 @@ utils_read_child_stderr (GIOChannel *channel,
+                          GIOCondition condition,
+                          gpointer user_data)
+ {
+-  UtilsSpawnData *data = user_data;
++  UtilsSpawnData *data = (UtilsSpawnData *)user_data;
+   gchar buf[1024];
+   gsize bytes_read;
+ 
+@@ -1220,7 +1220,7 @@ utils_read_child_stdout (GIOChannel *channel,
+                          GIOCondition condition,
+                          gpointer user_data)
+ {
+-  UtilsSpawnData *data = user_data;
++  UtilsSpawnData *data = (UtilsSpawnData *)user_data;
+   gchar buf[1024];
+   gsize bytes_read;
+ 
+@@ -1234,7 +1234,7 @@ utils_child_watch_cb (GPid     pid,
+                       gint     status,
+                       gpointer user_data)
+ {
+-  UtilsSpawnData *data = user_data;
++  UtilsSpawnData *data = (UtilsSpawnData *)user_data;
+   gchar *buf;
+   gsize buf_size;
+ 
+@@ -1263,7 +1263,7 @@ utils_child_watch_cb (GPid     pid,
+ static gboolean
+ utils_timeout_cb (gpointer user_data)
+ {
+-  UtilsSpawnData *data = user_data;
++  UtilsSpawnData *data = (UtilsSpawnData *)user_data;
+ 
+   data->timed_out = TRUE;
+ 
+-- 
+GitLab
+
+
+From acb956bf52f0a78bf7aaf925876f96e97a146995 Mon Sep 17 00:00:00 2001
+From: Wu Xiaotian <yetist@gmail.com>
+Date: Sun, 22 Nov 2020 18:04:27 +0800
+Subject: [PATCH 08/16] typecase
+
+Signed-off-by: Gustavo Lima Chaves <gustavo.chaves@microsoft.com>
+---
+ src/polkitbackend/polkitbackendduktapeauthority.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/src/polkitbackend/polkitbackendduktapeauthority.c b/src/polkitbackend/polkitbackendduktapeauthority.c
+index d466c9d..237b1ad 100644
+--- a/src/polkitbackend/polkitbackendduktapeauthority.c
++++ b/src/polkitbackend/polkitbackendduktapeauthority.c
+@@ -915,8 +915,8 @@ spawn_cb (GObject       *source_object,
+           GAsyncResult  *res,
+           gpointer       user_data)
+ {
+-  SpawnData *data = user_data;
+-  data->res = g_object_ref (res);
++  SpawnData *data = (SpawnData *)user_data;
++  data->res = (GAsyncResult*)g_object_ref (res);
+   g_main_loop_quit (data->loop);
+ }
+ 
+@@ -1292,12 +1292,12 @@ utils_spawn (const gchar *const  *argv,
+   data->simple = g_simple_async_result_new (NULL,
+                                             callback,
+                                             user_data,
+-                                            utils_spawn);
++                                            (gpointer*)utils_spawn);
+   data->main_context = g_main_context_get_thread_default ();
+   if (data->main_context != NULL)
+     g_main_context_ref (data->main_context);
+ 
+-  data->cancellable = cancellable != NULL ? g_object_ref (cancellable) : NULL;
++  data->cancellable = cancellable != NULL ? (GCancellable*)g_object_ref (cancellable) : NULL;
+ 
+   data->child_stdout = g_string_new (NULL);
+   data->child_stderr = g_string_new (NULL);
+@@ -1397,7 +1397,7 @@ utils_spawn_finish (GAsyncResult   *res,
+   if (g_simple_async_result_propagate_error (simple, error))
+     goto out;
+ 
+-  data = g_simple_async_result_get_op_res_gpointer (simple);
++  data = (UtilsSpawnData*)g_simple_async_result_get_op_res_gpointer (simple);
+ 
+   if (data->timed_out)
+     {
+-- 
+GitLab
+
+
+From be060e4d48aceb09af34868b555b6c73c7afdabb Mon Sep 17 00:00:00 2001
+From: Wu Xiaotian <yetist@gmail.com>
+Date: Sun, 22 Nov 2020 13:53:23 +0800
+Subject: [PATCH 09/16] some change
+
+Signed-off-by: Gustavo Lima Chaves <gustavo.chaves@microsoft.com>
+---
+ .../polkitbackendduktapeauthority.c           | 26 +++++++++++--------
+ 1 file changed, 15 insertions(+), 11 deletions(-)
+
+diff --git a/src/polkitbackend/polkitbackendduktapeauthority.c b/src/polkitbackend/polkitbackendduktapeauthority.c
+index 237b1ad..fad9017 100644
+--- a/src/polkitbackend/polkitbackendduktapeauthority.c
++++ b/src/polkitbackend/polkitbackendduktapeauthority.c
+@@ -207,18 +207,22 @@ load_scripts (PolkitBackendJsAuthority  *authority)
+ 
+   for (l = files; l != NULL; l = l->next)
+     {
+-      const gchar *filename = l->data;
+-
++      const gchar *filename = (gchar *)l->data;
+ #if (DUK_VERSION >= 20000)
+-      gchar *contents;
+-      gsize length;
+-      GError *error = NULL;
+-      if (!g_file_get_contents (filename, &contents, &length, &error)){
+-        g_warning("Error when file contents of %s: %s\n", filename, error->message);
+-        g_error_free (error);
+-        continue;
+-      }
+-      if (duk_peval_lstring_noresult(cx, contents,length) != 0)
++      GFile *file = g_file_new_for_path (filename);
++      char *contents;
++      gsize len;
++      if (!g_file_load_contents (file, NULL, &contents, &len, NULL, NULL))
++        {
++          polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority),
++                                        "Error compiling script %s",
++                                        filename);
++          g_object_unref (file);
++          continue;
++        }
++
++      g_object_unref (file);
++      if (duk_peval_lstring_noresult(cx, contents,len) != 0)
+ #else
+       if (duk_peval_file_noresult (cx, filename) != 0)
+ #endif
+-- 
+GitLab
+
+
+From 2ffb62048a5ebedfe3bb053feb7385c7270ede28 Mon Sep 17 00:00:00 2001
+From: Wu Xiaotian <yetist@gmail.com>
+Date: Sun, 22 Nov 2020 15:25:45 +0800
+Subject: [PATCH 10/16] some change
+
+Signed-off-by: Gustavo Lima Chaves <gustavo.chaves@microsoft.com>
+---
+ .../polkitbackendduktapeauthority.c           | 24 +++++++++----------
+ 1 file changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/src/polkitbackend/polkitbackendduktapeauthority.c b/src/polkitbackend/polkitbackendduktapeauthority.c
+index fad9017..6fac3be 100644
+--- a/src/polkitbackend/polkitbackendduktapeauthority.c
++++ b/src/polkitbackend/polkitbackendduktapeauthority.c
+@@ -125,6 +125,18 @@ G_DEFINE_TYPE (PolkitBackendJsAuthority, polkit_backend_js_authority, POLKIT_BAC
+ 
+ /* ---------------------------------------------------------------------------------------------------- */
+ 
++static duk_ret_t js_polkit_log (duk_context *cx);
++static duk_ret_t js_polkit_spawn (duk_context *cx);
++static duk_ret_t js_polkit_user_is_in_netgroup (duk_context *cx);
++
++static const duk_function_list_entry js_polkit_functions[] =
++{
++  { "log", js_polkit_log, 1 },
++  { "spawn", js_polkit_spawn, 1 },
++  { "_userIsInNetGroup", js_polkit_user_is_in_netgroup, 2 },
++  { NULL, NULL, 0 },
++};
++
+ static void
+ polkit_backend_js_authority_init (PolkitBackendJsAuthority *authority)
+ {
+@@ -347,18 +359,6 @@ setup_file_monitors (PolkitBackendJsAuthority *authority)
+   authority->priv->dir_monitors = (GFileMonitor**) g_ptr_array_free (p, FALSE);
+ }
+ 
+-static duk_ret_t js_polkit_log (duk_context *cx);
+-static duk_ret_t js_polkit_spawn (duk_context *cx);
+-static duk_ret_t js_polkit_user_is_in_netgroup (duk_context *cx);
+-
+-static const duk_function_list_entry js_polkit_functions[] =
+-{
+-  { "log", js_polkit_log, 1 },
+-  { "spawn", js_polkit_spawn, 1 },
+-  { "_userIsInNetGroup", js_polkit_user_is_in_netgroup, 2 },
+-  { NULL, NULL, 0 },
+-};
+-
+ static void
+ polkit_backend_js_authority_constructed (GObject *object)
+ {
+-- 
+GitLab
+
+
+From edb70ef69eed3275f5654510d135e680eb46c85d Mon Sep 17 00:00:00 2001
+From: Wu Xiaotian <yetist@gmail.com>
+Date: Sun, 22 Nov 2020 15:25:35 +0800
+Subject: [PATCH 11/16] remove WATCHDOG_TIMEOUT define
+
+Signed-off-by: Gustavo Lima Chaves <gustavo.chaves@microsoft.com>
+---
+ src/polkitbackend/polkitbackendduktapeauthority.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/src/polkitbackend/polkitbackendduktapeauthority.c b/src/polkitbackend/polkitbackendduktapeauthority.c
+index 6fac3be..51e03fd 100644
+--- a/src/polkitbackend/polkitbackendduktapeauthority.c
++++ b/src/polkitbackend/polkitbackendduktapeauthority.c
+@@ -69,7 +69,6 @@ struct _PolkitBackendJsAuthorityPrivate
+   duk_context *cx;
+ };
+ 
+-#define WATCHDOG_TIMEOUT (15 * G_TIME_SPAN_SECOND)
+ 
+ static void utils_spawn (const gchar *const  *argv,
+                          guint                timeout_seconds,
+-- 
+GitLab
+
+
+From 906ae404f29f15ef8c529b999bf091b5d18ed7ac Mon Sep 17 00:00:00 2001
+From: Wu Xiaotian <yetist@gmail.com>
+Date: Sun, 22 Nov 2020 12:46:40 +0800
+Subject: [PATCH 12/16] add meson build system support
+
+Signed-off-by: Gustavo Lima Chaves <gustavo.chaves@microsoft.com>
+---
+ meson.build                   | 11 ++++++++++-
+ meson_options.txt             |  1 +
+ src/polkitbackend/meson.build | 10 ++++++++--
+ 3 files changed, 19 insertions(+), 3 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index 858078d..4e44723 100644
+--- a/meson.build
++++ b/meson.build
+@@ -133,7 +133,13 @@ expat_dep = dependency('expat')
+ assert(cc.has_header('expat.h', dependencies: expat_dep), 'Can\'t find expat.h. Please install expat.')
+ assert(cc.has_function('XML_ParserCreate', dependencies: expat_dep), 'Can\'t find expat library. Please install expat.')
+ 
+-mozjs_dep = dependency('mozjs-78')
++js_engine = get_option('js_engine')
++if js_engine == 'duktape'
++  js_dep = dependency('duktape')
++  libm_dep = cc.find_library('m')
++elif js_engine == 'mozjs'
++  js_dep = dependency('mozjs-78')
++endif
+ 
+ dbus_dep = dependency('dbus-1', required: false)
+ dbus_policydir = pk_prefix / pk_datadir / 'dbus-1/system.d'
+@@ -361,6 +367,9 @@ if enable_logind
+   output += '        systemdsystemunitdir:     ' + systemd_systemdsystemunitdir + '\n'
+ endif
+ output += '        polkitd user:             ' + polkitd_user + ' \n'
++output += '        Javascript engine:        ' + js_engine + '\n'
++if enable_logind
++endif
+ output += '        PAM support:              ' + enable_pam.to_string() + '\n\n'
+ if enable_pam
+   output += '        PAM file auth:            ' + pam_conf['PAM_FILE_INCLUDE_AUTH'] + '\n'
+diff --git a/meson_options.txt b/meson_options.txt
+index 25e3e77..76aa311 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -16,3 +16,4 @@ option('introspection', type: 'boolean', value: true, description: 'Enable intro
+ 
+ option('gtk_doc', type: 'boolean', value: false, description: 'use gtk-doc to build documentation')
+ option('man', type: 'boolean', value: false, description: 'build manual pages')
++option('js_engine', type: 'combo', choices: ['mozjs', 'duktape'], value: 'duktape', description: 'javascript engine')
+diff --git a/src/polkitbackend/meson.build b/src/polkitbackend/meson.build
+index 64f0e4a..489897d 100644
+--- a/src/polkitbackend/meson.build
++++ b/src/polkitbackend/meson.build
+@@ -5,7 +5,6 @@ sources = files(
+   'polkitbackendactionpool.c',
+   'polkitbackendauthority.c',
+   'polkitbackendinteractiveauthority.c',
+-  'polkitbackendjsauthority.cpp',
+ )
+ 
+ output = 'initjs.h'
+@@ -21,7 +20,7 @@ sources += custom_target(
+ deps = [
+   expat_dep,
+   libpolkit_gobject_dep,
+-  mozjs_dep,
++  js_dep,
+ ]
+ 
+ c_flags = [
+@@ -31,6 +30,13 @@ c_flags = [
+   '-DPACKAGE_SYSCONF_DIR="@0@"'.format(pk_prefix / pk_sysconfdir),
+ ]
+ 
++if js_engine == 'duktape'
++  sources += files('polkitbackendduktapeauthority.c')
++  deps += libm_dep
++elif js_engine == 'mozjs'
++  sources += files('polkitbackendjsauthority.cpp')
++endif
++
+ if enable_logind
+   sources += files('polkitbackendsessionmonitor-systemd.c')
+ 
+-- 
+GitLab
+
+
+From 1380b505c25be4aebe54b1b4223a570d64af83cc Mon Sep 17 00:00:00 2001
+From: Wu Xiaotian <yetist@gmail.com>
+Date: Sun, 22 Nov 2020 18:49:14 +0800
+Subject: [PATCH 13/16] fix run error
+
+Signed-off-by: Gustavo Lima Chaves <gustavo.chaves@microsoft.com>
+---
+ src/polkitbackend/polkitbackendduktapeauthority.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/polkitbackend/polkitbackendduktapeauthority.c b/src/polkitbackend/polkitbackendduktapeauthority.c
+index 51e03fd..4b4f8fd 100644
+--- a/src/polkitbackend/polkitbackendduktapeauthority.c
++++ b/src/polkitbackend/polkitbackendduktapeauthority.c
+@@ -795,11 +795,11 @@ polkit_backend_js_authority_check_authorization_sync (PolkitBackendInteractiveAu
+   gboolean good = FALSE;
+   duk_context *cx = authority->priv->cx;
+ 
++  duk_set_top (cx, 0);
+   if (!duk_get_global_string (cx, "polkit")) {
+       goto out;
+   }
+ 
+-  duk_set_top (cx, 0);
+   duk_push_string (cx, "_runRules");
+ 
+   if (!push_action_and_details (cx, action_id, details, &error))
+-- 
+GitLab
+
+
+From 6856a704b70378948ef5f66e9b09555d97d4070b Mon Sep 17 00:00:00 2001
+From: Gustavo Lima Chaves <gustavo.chaves@microsoft.com>
+Date: Fri, 10 Sep 2021 15:17:58 -0700
+Subject: [PATCH 14/16] Deduplicate code for "Add duktape as JS engine backend"
+ effort/MR
+
+This leverages Wu Xiaotian (@yetist)'s original MR
+(https://gitlab.freedesktop.org/polkit/polkit/-/merge_requests/35), in
+an effort to complete said work.
+
+This is the first of the requests from maintainers--to reduce
+eliminate code duplication.
+
+The runaway-killer missing functionality will come in the sequence.
+
+Signed-off-by: Gustavo Lima Chaves <gustavo.chaves@microsoft.com>
+---
+ src/polkitbackend/Makefile.am                 |   1 +
+ src/polkitbackend/meson.build                 |   1 +
+ src/polkitbackend/polkitbackendcommon.c       | 530 +++++++++++++
+ src/polkitbackend/polkitbackendcommon.h       | 156 ++++
+ .../polkitbackendduktapeauthority.c           | 714 ++----------------
+ .../polkitbackendjsauthority.cpp              | 711 ++---------------
+ 6 files changed, 790 insertions(+), 1323 deletions(-)
+ create mode 100644 src/polkitbackend/polkitbackendcommon.c
+ create mode 100644 src/polkitbackend/polkitbackendcommon.h
+
+diff --git a/src/polkitbackend/Makefile.am b/src/polkitbackend/Makefile.am
+index abcbc6f..6a8b4ae 100644
+--- a/src/polkitbackend/Makefile.am
++++ b/src/polkitbackend/Makefile.am
+@@ -31,6 +31,7 @@ libpolkit_backend_1_la_SOURCES =                                   			\
+         polkitbackend.h									\
+ 	polkitbackendtypes.h								\
+ 	polkitbackendprivate.h								\
++	polkitbackendcommon.h			polkitbackendcommon.c			\
+ 	polkitbackendauthority.h		polkitbackendauthority.c		\
+ 	polkitbackendinteractiveauthority.h	polkitbackendinteractiveauthority.c	\
+ 	polkitbackendjsauthority.h				\
+diff --git a/src/polkitbackend/meson.build b/src/polkitbackend/meson.build
+index 489897d..9ec01b2 100644
+--- a/src/polkitbackend/meson.build
++++ b/src/polkitbackend/meson.build
+@@ -4,6 +4,7 @@ sources = files(
+   'polkitbackendactionlookup.c',
+   'polkitbackendactionpool.c',
+   'polkitbackendauthority.c',
++  'polkitbackendcommon.c',
+   'polkitbackendinteractiveauthority.c',
+ )
+ 
+diff --git a/src/polkitbackend/polkitbackendcommon.c b/src/polkitbackend/polkitbackendcommon.c
+new file mode 100644
+index 0000000..6783dff
+--- /dev/null
++++ b/src/polkitbackend/polkitbackendcommon.c
+@@ -0,0 +1,530 @@
++/*
++ * Copyright (C) 2008 Red Hat, Inc.
++ *
++ * This library is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License as published by the Free Software Foundation; either
++ * version 2 of the License, or (at your option) any later version.
++ *
++ * This library is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General
++ * Public License along with this library; if not, write to the
++ * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
++ * Boston, MA 02111-1307, USA.
++ *
++ * Author: David Zeuthen <davidz@redhat.com>
++ */
++
++#include "polkitbackendcommon.h"
++
++static void
++utils_child_watch_from_release_cb (GPid     pid,
++                                   gint     status,
++                                   gpointer user_data)
++{
++}
++
++static void
++utils_spawn_data_free (UtilsSpawnData *data)
++{
++  if (data->timeout_source != NULL)
++    {
++      g_source_destroy (data->timeout_source);
++      data->timeout_source = NULL;
++    }
++
++  /* Nuke the child, if necessary */
++  if (data->child_watch_source != NULL)
++    {
++      g_source_destroy (data->child_watch_source);
++      data->child_watch_source = NULL;
++    }
++
++  if (data->child_pid != 0)
++    {
++      GSource *source;
++      kill (data->child_pid, SIGTERM);
++      /* OK, we need to reap for the child ourselves - we don't want
++       * to use waitpid() because that might block the calling
++       * thread (the child might handle SIGTERM and use several
++       * seconds for cleanup/rollback).
++       *
++       * So we use GChildWatch instead.
++       *
++       * Avoid taking a references to ourselves. but note that we need
++       * to pass the GSource so we can nuke it once handled.
++       */
++      source = g_child_watch_source_new (data->child_pid);
++      g_source_set_callback (source,
++                             (GSourceFunc) utils_child_watch_from_release_cb,
++                             source,
++                             (GDestroyNotify) g_source_destroy);
++      g_source_attach (source, data->main_context);
++      g_source_unref (source);
++      data->child_pid = 0;
++    }
++
++  if (data->child_stdout != NULL)
++    {
++      g_string_free (data->child_stdout, TRUE);
++      data->child_stdout = NULL;
++    }
++
++  if (data->child_stderr != NULL)
++    {
++      g_string_free (data->child_stderr, TRUE);
++      data->child_stderr = NULL;
++    }
++
++  if (data->child_stdout_channel != NULL)
++    {
++      g_io_channel_unref (data->child_stdout_channel);
++      data->child_stdout_channel = NULL;
++    }
++  if (data->child_stderr_channel != NULL)
++    {
++      g_io_channel_unref (data->child_stderr_channel);
++      data->child_stderr_channel = NULL;
++    }
++
++  if (data->child_stdout_source != NULL)
++    {
++      g_source_destroy (data->child_stdout_source);
++      data->child_stdout_source = NULL;
++    }
++  if (data->child_stderr_source != NULL)
++    {
++      g_source_destroy (data->child_stderr_source);
++      data->child_stderr_source = NULL;
++    }
++
++  if (data->child_stdout_fd != -1)
++    {
++      g_warn_if_fail (close (data->child_stdout_fd) == 0);
++      data->child_stdout_fd = -1;
++    }
++  if (data->child_stderr_fd != -1)
++    {
++      g_warn_if_fail (close (data->child_stderr_fd) == 0);
++      data->child_stderr_fd = -1;
++    }
++
++  if (data->cancellable_handler_id > 0)
++    {
++      g_cancellable_disconnect (data->cancellable, data->cancellable_handler_id);
++      data->cancellable_handler_id = 0;
++    }
++
++  if (data->main_context != NULL)
++    g_main_context_unref (data->main_context);
++
++  if (data->cancellable != NULL)
++    g_object_unref (data->cancellable);
++
++  g_slice_free (UtilsSpawnData, data);
++}
++
++/* called in the thread where @cancellable was cancelled */
++static void
++utils_on_cancelled (GCancellable *cancellable,
++                    gpointer      user_data)
++{
++  UtilsSpawnData *data = (UtilsSpawnData *)user_data;
++  GError *error;
++
++  error = NULL;
++  g_warn_if_fail (g_cancellable_set_error_if_cancelled (cancellable, &error));
++  g_simple_async_result_take_error (data->simple, error);
++  g_simple_async_result_complete_in_idle (data->simple);
++  g_object_unref (data->simple);
++}
++
++static gboolean
++utils_timeout_cb (gpointer user_data)
++{
++  UtilsSpawnData *data = (UtilsSpawnData *)user_data;
++
++  data->timed_out = TRUE;
++
++  /* ok, timeout is history, make sure we don't free it in spawn_data_free() */
++  data->timeout_source = NULL;
++
++  /* we're done */
++  g_simple_async_result_complete_in_idle (data->simple);
++  g_object_unref (data->simple);
++
++  return FALSE; /* remove source */
++}
++
++static void
++utils_child_watch_cb (GPid     pid,
++                      gint     status,
++                      gpointer user_data)
++{
++  UtilsSpawnData *data = (UtilsSpawnData *)user_data;
++  gchar *buf;
++  gsize buf_size;
++
++  if (g_io_channel_read_to_end (data->child_stdout_channel, &buf, &buf_size, NULL) == G_IO_STATUS_NORMAL)
++    {
++      g_string_append_len (data->child_stdout, buf, buf_size);
++      g_free (buf);
++    }
++  if (g_io_channel_read_to_end (data->child_stderr_channel, &buf, &buf_size, NULL) == G_IO_STATUS_NORMAL)
++    {
++      g_string_append_len (data->child_stderr, buf, buf_size);
++      g_free (buf);
++    }
++
++  data->exit_status = status;
++
++  /* ok, child watch is history, make sure we don't free it in spawn_data_free() */
++  data->child_pid = 0;
++  data->child_watch_source = NULL;
++
++  /* we're done */
++  g_simple_async_result_complete_in_idle (data->simple);
++  g_object_unref (data->simple);
++}
++
++static gboolean
++utils_read_child_stderr (GIOChannel *channel,
++                         GIOCondition condition,
++                         gpointer user_data)
++{
++  UtilsSpawnData *data = (UtilsSpawnData *)user_data;
++  gchar buf[1024];
++  gsize bytes_read;
++
++  g_io_channel_read_chars (channel, buf, sizeof buf, &bytes_read, NULL);
++  g_string_append_len (data->child_stderr, buf, bytes_read);
++  return TRUE;
++}
++
++static gboolean
++utils_read_child_stdout (GIOChannel *channel,
++                         GIOCondition condition,
++                         gpointer user_data)
++{
++  UtilsSpawnData *data = (UtilsSpawnData *)user_data;
++  gchar buf[1024];
++  gsize bytes_read;
++
++  g_io_channel_read_chars (channel, buf, sizeof buf, &bytes_read, NULL);
++  g_string_append_len (data->child_stdout, buf, bytes_read);
++  return TRUE;
++}
++
++void
++polkit_backend_common_spawn (const gchar *const  *argv,
++                             guint                timeout_seconds,
++                             GCancellable        *cancellable,
++                             GAsyncReadyCallback  callback,
++                             gpointer             user_data)
++{
++  UtilsSpawnData *data;
++  GError *error;
++
++  data = g_slice_new0 (UtilsSpawnData);
++  data->timeout_seconds = timeout_seconds;
++  data->simple = g_simple_async_result_new (NULL,
++                                            callback,
++                                            user_data,
++                                            (gpointer*)polkit_backend_common_spawn);
++  data->main_context = g_main_context_get_thread_default ();
++  if (data->main_context != NULL)
++    g_main_context_ref (data->main_context);
++
++  data->cancellable = cancellable != NULL ? (GCancellable*)g_object_ref (cancellable) : NULL;
++
++  data->child_stdout = g_string_new (NULL);
++  data->child_stderr = g_string_new (NULL);
++  data->child_stdout_fd = -1;
++  data->child_stderr_fd = -1;
++
++  /* the life-cycle of UtilsSpawnData is tied to its GSimpleAsyncResult */
++  g_simple_async_result_set_op_res_gpointer (data->simple, data, (GDestroyNotify) utils_spawn_data_free);
++
++  error = NULL;
++  if (data->cancellable != NULL)
++    {
++      /* could already be cancelled */
++      error = NULL;
++      if (g_cancellable_set_error_if_cancelled (data->cancellable, &error))
++        {
++          g_simple_async_result_take_error (data->simple, error);
++          g_simple_async_result_complete_in_idle (data->simple);
++          g_object_unref (data->simple);
++          goto out;
++        }
++
++      data->cancellable_handler_id = g_cancellable_connect (data->cancellable,
++                                                            G_CALLBACK (utils_on_cancelled),
++                                                            data,
++                                                            NULL);
++    }
++
++  error = NULL;
++  if (!g_spawn_async_with_pipes (NULL, /* working directory */
++                                 (gchar **) argv,
++                                 NULL, /* envp */
++                                 G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD,
++                                 NULL, /* child_setup */
++                                 NULL, /* child_setup's user_data */
++                                 &(data->child_pid),
++                                 NULL, /* gint *stdin_fd */
++                                 &(data->child_stdout_fd),
++                                 &(data->child_stderr_fd),
++                                 &error))
++    {
++      g_prefix_error (&error, "Error spawning: ");
++      g_simple_async_result_take_error (data->simple, error);
++      g_simple_async_result_complete_in_idle (data->simple);
++      g_object_unref (data->simple);
++      goto out;
++    }
++
++  if (timeout_seconds > 0)
++    {
++      data->timeout_source = g_timeout_source_new_seconds (timeout_seconds);
++      g_source_set_priority (data->timeout_source, G_PRIORITY_DEFAULT);
++      g_source_set_callback (data->timeout_source, utils_timeout_cb, data, NULL);
++      g_source_attach (data->timeout_source, data->main_context);
++      g_source_unref (data->timeout_source);
++    }
++
++  data->child_watch_source = g_child_watch_source_new (data->child_pid);
++  g_source_set_callback (data->child_watch_source, (GSourceFunc) utils_child_watch_cb, data, NULL);
++  g_source_attach (data->child_watch_source, data->main_context);
++  g_source_unref (data->child_watch_source);
++
++  data->child_stdout_channel = g_io_channel_unix_new (data->child_stdout_fd);
++  g_io_channel_set_flags (data->child_stdout_channel, G_IO_FLAG_NONBLOCK, NULL);
++  data->child_stdout_source = g_io_create_watch (data->child_stdout_channel, G_IO_IN);
++  g_source_set_callback (data->child_stdout_source, (GSourceFunc) utils_read_child_stdout, data, NULL);
++  g_source_attach (data->child_stdout_source, data->main_context);
++  g_source_unref (data->child_stdout_source);
++
++  data->child_stderr_channel = g_io_channel_unix_new (data->child_stderr_fd);
++  g_io_channel_set_flags (data->child_stderr_channel, G_IO_FLAG_NONBLOCK, NULL);
++  data->child_stderr_source = g_io_create_watch (data->child_stderr_channel, G_IO_IN);
++  g_source_set_callback (data->child_stderr_source, (GSourceFunc) utils_read_child_stderr, data, NULL);
++  g_source_attach (data->child_stderr_source, data->main_context);
++  g_source_unref (data->child_stderr_source);
++
++ out:
++  ;
++}
++
++void
++polkit_backend_common_on_dir_monitor_changed (GFileMonitor     *monitor,
++                                              GFile            *file,
++                                              GFile            *other_file,
++                                              GFileMonitorEvent event_type,
++                                              gpointer          user_data)
++{
++  PolkitBackendJsAuthority *authority = POLKIT_BACKEND_JS_AUTHORITY (user_data);
++
++  /* TODO: maybe rate-limit so storms of events are collapsed into one with a 500ms resolution?
++   *       Because when editing a file with emacs we get 4-8 events..
++   */
++
++  if (file != NULL)
++    {
++      gchar *name;
++
++      name = g_file_get_basename (file);
++
++      /* g_print ("event_type=%d file=%p name=%s\n", event_type, file, name); */
++      if (!g_str_has_prefix (name, ".") &&
++          !g_str_has_prefix (name, "#") &&
++          g_str_has_suffix (name, ".rules") &&
++          (event_type == G_FILE_MONITOR_EVENT_CREATED ||
++           event_type == G_FILE_MONITOR_EVENT_DELETED ||
++           event_type == G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT))
++        {
++          polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority),
++                                        "Reloading rules");
++          polkit_backend_common_reload_scripts (authority);
++        }
++      g_free (name);
++    }
++}
++
++gboolean
++polkit_backend_common_spawn_finish (GAsyncResult   *res,
++                                    gint           *out_exit_status,
++                                    gchar         **out_standard_output,
++                                    gchar         **out_standard_error,
++                                    GError        **error)
++{
++  GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
++  UtilsSpawnData *data;
++  gboolean ret = FALSE;
++
++  g_return_val_if_fail (G_IS_ASYNC_RESULT (res), FALSE);
++  g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
++
++  g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == polkit_backend_common_spawn);
++
++  if (g_simple_async_result_propagate_error (simple, error))
++    goto out;
++
++  data = (UtilsSpawnData*)g_simple_async_result_get_op_res_gpointer (simple);
++
++  if (data->timed_out)
++    {
++      g_set_error (error,
++                   G_IO_ERROR,
++                   G_IO_ERROR_TIMED_OUT,
++                   "Timed out after %d seconds",
++                   data->timeout_seconds);
++      goto out;
++    }
++
++  if (out_exit_status != NULL)
++    *out_exit_status = data->exit_status;
++
++  if (out_standard_output != NULL)
++    *out_standard_output = g_strdup (data->child_stdout->str);
++
++  if (out_standard_error != NULL)
++    *out_standard_error = g_strdup (data->child_stderr->str);
++
++  ret = TRUE;
++
++ out:
++  return ret;
++}
++
++static const gchar *
++polkit_backend_js_authority_get_name (PolkitBackendAuthority *authority)
++{
++  return "js";
++}
++
++static const gchar *
++polkit_backend_js_authority_get_version (PolkitBackendAuthority *authority)
++{
++  return PACKAGE_VERSION;
++}
++
++static PolkitAuthorityFeatures
++polkit_backend_js_authority_get_features (PolkitBackendAuthority *authority)
++{
++  return POLKIT_AUTHORITY_FEATURES_TEMPORARY_AUTHORIZATION;
++}
++
++void
++polkit_backend_common_js_authority_class_init_common (PolkitBackendJsAuthorityClass *klass)
++{
++  GObjectClass *gobject_class;
++  PolkitBackendAuthorityClass *authority_class;
++  PolkitBackendInteractiveAuthorityClass *interactive_authority_class;
++
++  gobject_class = G_OBJECT_CLASS (klass);
++  gobject_class->finalize                               = polkit_backend_common_js_authority_finalize;
++  gobject_class->set_property                           = polkit_backend_common_js_authority_set_property;
++  gobject_class->constructed                            = polkit_backend_common_js_authority_constructed;
++
++  authority_class = POLKIT_BACKEND_AUTHORITY_CLASS (klass);
++  authority_class->get_name                             = polkit_backend_js_authority_get_name;
++  authority_class->get_version                          = polkit_backend_js_authority_get_version;
++  authority_class->get_features                         = polkit_backend_js_authority_get_features;
++
++  interactive_authority_class = POLKIT_BACKEND_INTERACTIVE_AUTHORITY_CLASS (klass);
++  interactive_authority_class->get_admin_identities     = polkit_backend_common_js_authority_get_admin_auth_identities;
++  interactive_authority_class->check_authorization_sync = polkit_backend_common_js_authority_check_authorization_sync;
++
++  g_object_class_install_property (gobject_class,
++                                   PROP_RULES_DIRS,
++                                   g_param_spec_boxed ("rules-dirs",
++                                                       NULL,
++                                                       NULL,
++                                                       G_TYPE_STRV,
++                                                       G_PARAM_CONSTRUCT_ONLY | G_PARAM_WRITABLE));
++}
++
++gint
++polkit_backend_common_rules_file_name_cmp (const gchar *a,
++                                           const gchar *b)
++{
++  gint ret;
++  const gchar *a_base;
++  const gchar *b_base;
++
++  a_base = strrchr (a, '/');
++  b_base = strrchr (b, '/');
++
++  g_assert (a_base != NULL);
++  g_assert (b_base != NULL);
++  a_base += 1;
++  b_base += 1;
++
++  ret = g_strcmp0 (a_base, b_base);
++  if (ret == 0)
++    {
++      /* /etc wins over /usr */
++      ret = g_strcmp0 (a, b);
++      g_assert (ret != 0);
++    }
++
++  return ret;
++}
++
++const gchar *
++polkit_backend_common_get_signal_name (gint signal_number)
++{
++  switch (signal_number)
++    {
++#define _HANDLE_SIG(sig) case sig: return #sig;
++    _HANDLE_SIG (SIGHUP);
++    _HANDLE_SIG (SIGINT);
++    _HANDLE_SIG (SIGQUIT);
++    _HANDLE_SIG (SIGILL);
++    _HANDLE_SIG (SIGABRT);
++    _HANDLE_SIG (SIGFPE);
++    _HANDLE_SIG (SIGKILL);
++    _HANDLE_SIG (SIGSEGV);
++    _HANDLE_SIG (SIGPIPE);
++    _HANDLE_SIG (SIGALRM);
++    _HANDLE_SIG (SIGTERM);
++    _HANDLE_SIG (SIGUSR1);
++    _HANDLE_SIG (SIGUSR2);
++    _HANDLE_SIG (SIGCHLD);
++    _HANDLE_SIG (SIGCONT);
++    _HANDLE_SIG (SIGSTOP);
++    _HANDLE_SIG (SIGTSTP);
++    _HANDLE_SIG (SIGTTIN);
++    _HANDLE_SIG (SIGTTOU);
++    _HANDLE_SIG (SIGBUS);
++#ifdef SIGPOLL
++    _HANDLE_SIG (SIGPOLL);
++#endif
++    _HANDLE_SIG (SIGPROF);
++    _HANDLE_SIG (SIGSYS);
++    _HANDLE_SIG (SIGTRAP);
++    _HANDLE_SIG (SIGURG);
++    _HANDLE_SIG (SIGVTALRM);
++    _HANDLE_SIG (SIGXCPU);
++    _HANDLE_SIG (SIGXFSZ);
++#undef _HANDLE_SIG
++    default:
++      break;
++    }
++  return "UNKNOWN_SIGNAL";
++}
++
++void
++polkit_backend_common_spawn_cb (GObject       *source_object,
++                                GAsyncResult  *res,
++                                gpointer       user_data)
++{
++  SpawnData *data = (SpawnData *)user_data;
++  data->res = (GAsyncResult*)g_object_ref (res);
++  g_main_loop_quit (data->loop);
++}
+diff --git a/src/polkitbackend/polkitbackendcommon.h b/src/polkitbackend/polkitbackendcommon.h
+new file mode 100644
+index 0000000..6d0d267
+--- /dev/null
++++ b/src/polkitbackend/polkitbackendcommon.h
+@@ -0,0 +1,156 @@
++/*
++ * Copyright (C) 2008 Red Hat, Inc.
++ *
++ * This library is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License as published by the Free Software Foundation; either
++ * version 2 of the License, or (at your option) any later version.
++ *
++ * This library is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General
++ * Public License along with this library; if not, write to the
++ * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
++ * Boston, MA 02111-1307, USA.
++ *
++ * Author: David Zeuthen <davidz@redhat.com>
++ */
++
++#if !defined (_POLKIT_BACKEND_COMPILATION) && !defined(_POLKIT_BACKEND_INSIDE_POLKIT_BACKEND_H)
++#error "Only <polkitbackend/polkitbackend.h> can be included directly, this file may disappear or change contents."
++#endif
++
++#ifndef __POLKIT_BACKEND_COMMON_H
++#define __POLKIT_BACKEND_COMMON_H
++
++#include "config.h"
++#include <sys/wait.h>
++#include <errno.h>
++#include <pwd.h>
++#include <grp.h>
++#ifdef HAVE_NETGROUP_H
++#include <netgroup.h>
++#else
++#include <netdb.h>
++#endif
++#include <string.h>
++#include <glib/gstdio.h>
++#include <locale.h>
++#include <glib/gi18n-lib.h> //here, all things glib via glib.h (including -> gspawn.h)
++
++#include <polkit/polkit.h>
++#include "polkitbackendjsauthority.h"
++
++#include <polkit/polkitprivate.h>
++
++#ifdef HAVE_LIBSYSTEMD
++#include <systemd/sd-login.h>
++#endif /* HAVE_LIBSYSTEMD */
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++enum
++{
++  PROP_0,
++  PROP_RULES_DIRS,
++};
++
++typedef struct
++{
++  GSimpleAsyncResult *simple; /* borrowed reference */
++  GMainContext *main_context; /* may be NULL */
++
++  GCancellable *cancellable;  /* may be NULL */
++  gulong cancellable_handler_id;
++
++  GPid child_pid;
++  gint child_stdout_fd;
++  gint child_stderr_fd;
++
++  GIOChannel *child_stdout_channel;
++  GIOChannel *child_stderr_channel;
++
++  GSource *child_watch_source;
++  GSource *child_stdout_source;
++  GSource *child_stderr_source;
++
++  guint timeout_seconds;
++  gboolean timed_out;
++  GSource *timeout_source;
++
++  GString *child_stdout;
++  GString *child_stderr;
++
++  gint exit_status;
++} UtilsSpawnData;
++
++typedef struct
++{
++  GMainLoop *loop;
++  GAsyncResult *res;
++} SpawnData;
++
++void polkit_backend_common_spawn (const gchar *const  *argv,
++                                  guint                timeout_seconds,
++                                  GCancellable        *cancellable,
++                                  GAsyncReadyCallback  callback,
++                                  gpointer             user_data);
++void polkit_backend_common_spawn_cb (GObject       *source_object,
++                                     GAsyncResult  *res,
++                                     gpointer       user_data);
++gboolean polkit_backend_common_spawn_finish (GAsyncResult   *res,
++                                             gint           *out_exit_status,
++                                             gchar         **out_standard_output,
++                                             gchar         **out_standard_error,
++                                             GError        **error);
++
++void polkit_backend_common_on_dir_monitor_changed (GFileMonitor     *monitor,
++                                                   GFile            *file,
++                                                   GFile            *other_file,
++                                                   GFileMonitorEvent event_type,
++                                                   gpointer          user_data);
++
++void polkit_backend_common_js_authority_class_init_common (PolkitBackendJsAuthorityClass *klass);
++
++gint polkit_backend_common_rules_file_name_cmp (const gchar *a,
++                                                const gchar *b);
++
++const gchar *polkit_backend_common_get_signal_name (gint signal_number);
++
++/* To be provided by each JS backend, from here onwards  ---------------------------------------------- */
++
++void polkit_backend_common_reload_scripts (PolkitBackendJsAuthority *authority);
++void polkit_backend_common_js_authority_finalize (GObject *object);
++void polkit_backend_common_js_authority_constructed (GObject *object);
++GList *polkit_backend_common_js_authority_get_admin_auth_identities (PolkitBackendInteractiveAuthority *_authority,
++                                                                     PolkitSubject                     *caller,
++                                                                     PolkitSubject                     *subject,
++                                                                     PolkitIdentity                    *user_for_subject,
++                                                                     gboolean                           subject_is_local,
++                                                                     gboolean                           subject_is_active,
++                                                                     const gchar                       *action_id,
++                                                                     PolkitDetails                     *details);
++void polkit_backend_common_js_authority_set_property (GObject      *object,
++                                                      guint         property_id,
++                                                      const GValue *value,
++                                                      GParamSpec   *pspec);
++PolkitImplicitAuthorization polkit_backend_common_js_authority_check_authorization_sync (PolkitBackendInteractiveAuthority *_authority,
++                                                                                         PolkitSubject                     *caller,
++                                                                                         PolkitSubject                     *subject,
++                                                                                         PolkitIdentity                    *user_for_subject,
++                                                                                         gboolean                           subject_is_local,
++                                                                                         gboolean                           subject_is_active,
++                                                                                         const gchar                       *action_id,
++                                                                                         PolkitDetails                     *details,
++                                                                                         PolkitImplicitAuthorization        implicit);
++#ifdef __cplusplus
++}
++#endif
++
++#endif /* __POLKIT_BACKEND_COMMON_H */
++
+diff --git a/src/polkitbackend/polkitbackendduktapeauthority.c b/src/polkitbackend/polkitbackendduktapeauthority.c
+index 4b4f8fd..a2b4420 100644
+--- a/src/polkitbackend/polkitbackendduktapeauthority.c
++++ b/src/polkitbackend/polkitbackendduktapeauthority.c
+@@ -21,32 +21,12 @@
+  * Author: David Zeuthen <davidz@redhat.com>
+  */
+ 
+-#include "config.h"
+-#include <sys/wait.h>
+-#include <errno.h>
+-#include <pwd.h>
+-#include <grp.h>
+-#ifdef HAVE_NETGROUP_H
+-#include <netgroup.h>
+-#else
+-#include <netdb.h>
+-#endif
+-#include <string.h>
+-#include <glib/gstdio.h>
+-#include <locale.h>
+-#include <glib/gi18n-lib.h>
+-
+-#include <polkit/polkit.h>
+-#include "polkitbackendjsauthority.h"
+-
+-#include <polkit/polkitprivate.h>
++#include "polkitbackendcommon.h"
+ 
+-#ifdef HAVE_LIBSYSTEMD
+-#include <systemd/sd-login.h>
+-#endif /* HAVE_LIBSYSTEMD */
++#include "duktape.h"
+ 
++/* Built source and not too big to worry about deduplication */
+ #include "initjs.h" /* init.js */
+-#include "duktape.h"
+ 
+ /**
+  * SECTION:polkitbackendjsauthority
+@@ -54,10 +34,9 @@
+  * @short_description: JS Authority
+  * @stability: Unstable
+  *
+- * An implementation of #PolkitBackendAuthority that reads and
+- * evalates Javascript files and supports interaction with
+- * authentication agents (virtue of being based on
+- * #PolkitBackendInteractiveAuthority).
++ * An (Duktape-based) implementation of #PolkitBackendAuthority that reads and
++ * evaluates Javascript files and supports interaction with authentication
++ * agents (virtue of being based on #PolkitBackendInteractiveAuthority).
+  */
+ 
+ /* ---------------------------------------------------------------------------------------------------- */
+@@ -66,64 +45,16 @@ struct _PolkitBackendJsAuthorityPrivate
+ {
+   gchar **rules_dirs;
+   GFileMonitor **dir_monitors; /* NULL-terminated array of GFileMonitor instances */
+-  duk_context *cx;
+-};
+-
+-
+-static void utils_spawn (const gchar *const  *argv,
+-                         guint                timeout_seconds,
+-                         GCancellable        *cancellable,
+-                         GAsyncReadyCallback  callback,
+-                         gpointer             user_data);
+-
+-gboolean utils_spawn_finish (GAsyncResult   *res,
+-                             gint           *out_exit_status,
+-                             gchar         **out_standard_output,
+-                             gchar         **out_standard_error,
+-                             GError        **error);
+ 
+-static void on_dir_monitor_changed (GFileMonitor     *monitor,
+-                                    GFile            *file,
+-                                    GFile            *other_file,
+-                                    GFileMonitorEvent event_type,
+-                                    gpointer          user_data);
+-
+-/* ---------------------------------------------------------------------------------------------------- */
+-
+-enum
+-{
+-  PROP_0,
+-  PROP_RULES_DIRS,
++  duk_context *cx;
+ };
+ 
+ /* ---------------------------------------------------------------------------------------------------- */
+ 
+-static GList *polkit_backend_js_authority_get_admin_auth_identities (PolkitBackendInteractiveAuthority *authority,
+-                                                                     PolkitSubject                     *caller,
+-                                                                     PolkitSubject                     *subject,
+-                                                                     PolkitIdentity                    *user_for_subject,
+-                                                                     gboolean                           subject_is_local,
+-                                                                     gboolean                           subject_is_active,
+-                                                                     const gchar                       *action_id,
+-                                                                     PolkitDetails                     *details);
+-
+-static PolkitImplicitAuthorization polkit_backend_js_authority_check_authorization_sync (
+-                                                          PolkitBackendInteractiveAuthority *authority,
+-                                                          PolkitSubject                     *caller,
+-                                                          PolkitSubject                     *subject,
+-                                                          PolkitIdentity                    *user_for_subject,
+-                                                          gboolean                           subject_is_local,
+-                                                          gboolean                           subject_is_active,
+-                                                          const gchar                       *action_id,
+-                                                          PolkitDetails                     *details,
+-                                                          PolkitImplicitAuthorization        implicit);
+-
+ G_DEFINE_TYPE (PolkitBackendJsAuthority, polkit_backend_js_authority, POLKIT_BACKEND_TYPE_INTERACTIVE_AUTHORITY);
+ 
+ /* ---------------------------------------------------------------------------------------------------- */
+ 
+-/* ---------------------------------------------------------------------------------------------------- */
+-
+ static duk_ret_t js_polkit_log (duk_context *cx);
+ static duk_ret_t js_polkit_spawn (duk_context *cx);
+ static duk_ret_t js_polkit_user_is_in_netgroup (duk_context *cx);
+@@ -144,33 +75,6 @@ polkit_backend_js_authority_init (PolkitBackendJsAuthority *authority)
+                                                  PolkitBackendJsAuthorityPrivate);
+ }
+ 
+-static gint
+-rules_file_name_cmp (const gchar *a,
+-                     const gchar *b)
+-{
+-  gint ret;
+-  const gchar *a_base;
+-  const gchar *b_base;
+-
+-  a_base = strrchr (a, '/');
+-  b_base = strrchr (b, '/');
+-
+-  g_assert (a_base != NULL);
+-  g_assert (b_base != NULL);
+-  a_base += 1;
+-  b_base += 1;
+-
+-  ret = g_strcmp0 (a_base, b_base);
+-  if (ret == 0)
+-    {
+-      /* /etc wins over /usr */
+-      ret = g_strcmp0 (a, b);
+-      g_assert (ret != 0);
+-    }
+-
+-  return ret;
+-}
+-
+ static void
+ load_scripts (PolkitBackendJsAuthority  *authority)
+ {
+@@ -214,7 +118,7 @@ load_scripts (PolkitBackendJsAuthority  *authority)
+         }
+     }
+ 
+-  files = g_list_sort (files, (GCompareFunc) rules_file_name_cmp);
++  files = g_list_sort (files, (GCompareFunc) polkit_backend_common_rules_file_name_cmp);
+ 
+   for (l = files; l != NULL; l = l->next)
+     {
+@@ -258,8 +162,8 @@ load_scripts (PolkitBackendJsAuthority  *authority)
+   g_list_free_full (files, g_free);
+ }
+ 
+-static void
+-reload_scripts (PolkitBackendJsAuthority *authority)
++void
++polkit_backend_common_reload_scripts (PolkitBackendJsAuthority *authority)
+ {
+   duk_context *cx = authority->priv->cx;
+ 
+@@ -282,42 +186,6 @@ reload_scripts (PolkitBackendJsAuthority *authority)
+   g_signal_emit_by_name (authority, "changed");
+ }
+ 
+-static void
+-on_dir_monitor_changed (GFileMonitor     *monitor,
+-                        GFile            *file,
+-                        GFile            *other_file,
+-                        GFileMonitorEvent event_type,
+-                        gpointer          user_data)
+-{
+-  PolkitBackendJsAuthority *authority = POLKIT_BACKEND_JS_AUTHORITY (user_data);
+-
+-  /* TODO: maybe rate-limit so storms of events are collapsed into one with a 500ms resolution?
+-   *       Because when editing a file with emacs we get 4-8 events..
+-   */
+-
+-  if (file != NULL)
+-    {
+-      gchar *name;
+-
+-      name = g_file_get_basename (file);
+-
+-      /* g_print ("event_type=%d file=%p name=%s\n", event_type, file, name); */
+-      if (!g_str_has_prefix (name, ".") &&
+-          !g_str_has_prefix (name, "#") &&
+-          g_str_has_suffix (name, ".rules") &&
+-          (event_type == G_FILE_MONITOR_EVENT_CREATED ||
+-           event_type == G_FILE_MONITOR_EVENT_DELETED ||
+-           event_type == G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT))
+-        {
+-          polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority),
+-                                        "Reloading rules");
+-          reload_scripts (authority);
+-        }
+-      g_free (name);
+-    }
+-}
+-
+-
+ static void
+ setup_file_monitors (PolkitBackendJsAuthority *authority)
+ {
+@@ -349,7 +217,7 @@ setup_file_monitors (PolkitBackendJsAuthority *authority)
+         {
+           g_signal_connect (monitor,
+                             "changed",
+-                            G_CALLBACK (on_dir_monitor_changed),
++                            G_CALLBACK (polkit_backend_common_on_dir_monitor_changed),
+                             authority);
+           g_ptr_array_add (p, monitor);
+         }
+@@ -358,8 +226,8 @@ setup_file_monitors (PolkitBackendJsAuthority *authority)
+   authority->priv->dir_monitors = (GFileMonitor**) g_ptr_array_free (p, FALSE);
+ }
+ 
+-static void
+-polkit_backend_js_authority_constructed (GObject *object)
++void
++polkit_backend_common_js_authority_constructed (GObject *object)
+ {
+   PolkitBackendJsAuthority *authority = POLKIT_BACKEND_JS_AUTHORITY (object);
+   duk_context *cx;
+@@ -395,8 +263,8 @@ polkit_backend_js_authority_constructed (GObject *object)
+   g_assert_not_reached ();
+ }
+ 
+-static void
+-polkit_backend_js_authority_finalize (GObject *object)
++void
++polkit_backend_common_js_authority_finalize (GObject *object)
+ {
+   PolkitBackendJsAuthority *authority = POLKIT_BACKEND_JS_AUTHORITY (object);
+   guint n;
+@@ -405,7 +273,7 @@ polkit_backend_js_authority_finalize (GObject *object)
+     {
+       GFileMonitor *monitor = authority->priv->dir_monitors[n];
+       g_signal_handlers_disconnect_by_func (monitor,
+-                                            G_CALLBACK (on_dir_monitor_changed),
++                                            G_CALLBACK (polkit_backend_common_on_dir_monitor_changed),
+                                             authority);
+       g_object_unref (monitor);
+     }
+@@ -417,11 +285,11 @@ polkit_backend_js_authority_finalize (GObject *object)
+   G_OBJECT_CLASS (polkit_backend_js_authority_parent_class)->finalize (object);
+ }
+ 
+-static void
+-polkit_backend_js_authority_set_property (GObject      *object,
+-                                          guint         property_id,
+-                                          const GValue *value,
+-                                          GParamSpec   *pspec)
++void
++polkit_backend_common_js_authority_set_property (GObject      *object,
++                                                 guint         property_id,
++                                                 const GValue *value,
++                                                 GParamSpec   *pspec)
+ {
+   PolkitBackendJsAuthority *authority = POLKIT_BACKEND_JS_AUTHORITY (object);
+ 
+@@ -438,55 +306,10 @@ polkit_backend_js_authority_set_property (GObject      *object,
+     }
+ }
+ 
+-static const gchar *
+-polkit_backend_js_authority_get_name (PolkitBackendAuthority *authority)
+-{
+-  return "js";
+-}
+-
+-static const gchar *
+-polkit_backend_js_authority_get_version (PolkitBackendAuthority *authority)
+-{
+-  return PACKAGE_VERSION;
+-}
+-
+-static PolkitAuthorityFeatures
+-polkit_backend_js_authority_get_features (PolkitBackendAuthority *authority)
+-{
+-  return POLKIT_AUTHORITY_FEATURES_TEMPORARY_AUTHORIZATION;
+-}
+-
+ static void
+ polkit_backend_js_authority_class_init (PolkitBackendJsAuthorityClass *klass)
+ {
+-  GObjectClass *gobject_class;
+-  PolkitBackendAuthorityClass *authority_class;
+-  PolkitBackendInteractiveAuthorityClass *interactive_authority_class;
+-
+-
+-  gobject_class = G_OBJECT_CLASS (klass);
+-  gobject_class->finalize                               = polkit_backend_js_authority_finalize;
+-  gobject_class->set_property                           = polkit_backend_js_authority_set_property;
+-  gobject_class->constructed                            = polkit_backend_js_authority_constructed;
+-
+-  authority_class = POLKIT_BACKEND_AUTHORITY_CLASS (klass);
+-  authority_class->get_name                             = polkit_backend_js_authority_get_name;
+-  authority_class->get_version                          = polkit_backend_js_authority_get_version;
+-  authority_class->get_features                         = polkit_backend_js_authority_get_features;
+-
+-  interactive_authority_class = POLKIT_BACKEND_INTERACTIVE_AUTHORITY_CLASS (klass);
+-  interactive_authority_class->get_admin_identities     = polkit_backend_js_authority_get_admin_auth_identities;
+-  interactive_authority_class->check_authorization_sync = polkit_backend_js_authority_check_authorization_sync;
+-
+-  g_object_class_install_property (gobject_class,
+-                                   PROP_RULES_DIRS,
+-                                   g_param_spec_boxed ("rules-dirs",
+-                                                       NULL,
+-                                                       NULL,
+-                                                       G_TYPE_STRV,
+-                                                       G_PARAM_CONSTRUCT_ONLY | G_PARAM_WRITABLE));
+-
+-
++  polkit_backend_common_js_authority_class_init_common (klass);
+   g_type_class_add_private (klass, sizeof (PolkitBackendJsAuthorityPrivate));
+ }
+ 
+@@ -689,15 +512,15 @@ push_action_and_details (duk_context               *cx,
+ 
+ /* ---------------------------------------------------------------------------------------------------- */
+ 
+-static GList *
+-polkit_backend_js_authority_get_admin_auth_identities (PolkitBackendInteractiveAuthority *_authority,
+-                                                       PolkitSubject                     *caller,
+-                                                       PolkitSubject                     *subject,
+-                                                       PolkitIdentity                    *user_for_subject,
+-                                                       gboolean                           subject_is_local,
+-                                                       gboolean                           subject_is_active,
+-                                                       const gchar                       *action_id,
+-                                                       PolkitDetails                     *details)
++GList *
++polkit_backend_common_js_authority_get_admin_auth_identities (PolkitBackendInteractiveAuthority *_authority,
++                                                              PolkitSubject                     *caller,
++                                                              PolkitSubject                     *subject,
++                                                              PolkitIdentity                    *user_for_subject,
++                                                              gboolean                           subject_is_local,
++                                                              gboolean                           subject_is_active,
++                                                              const gchar                       *action_id,
++                                                              PolkitDetails                     *details)
+ {
+   PolkitBackendJsAuthority *authority = POLKIT_BACKEND_JS_AUTHORITY (_authority);
+   GList *ret = NULL;
+@@ -777,16 +600,16 @@ polkit_backend_js_authority_get_admin_auth_identities (PolkitBackendInteractiveA
+ 
+ /* ---------------------------------------------------------------------------------------------------- */
+ 
+-static PolkitImplicitAuthorization
+-polkit_backend_js_authority_check_authorization_sync (PolkitBackendInteractiveAuthority *_authority,
+-                                                      PolkitSubject                     *caller,
+-                                                      PolkitSubject                     *subject,
+-                                                      PolkitIdentity                    *user_for_subject,
+-                                                      gboolean                           subject_is_local,
+-                                                      gboolean                           subject_is_active,
+-                                                      const gchar                       *action_id,
+-                                                      PolkitDetails                     *details,
+-                                                      PolkitImplicitAuthorization        implicit)
++PolkitImplicitAuthorization
++polkit_backend_common_js_authority_check_authorization_sync (PolkitBackendInteractiveAuthority *_authority,
++                                                             PolkitSubject                     *caller,
++                                                             PolkitSubject                     *subject,
++                                                             PolkitIdentity                    *user_for_subject,
++                                                             gboolean                           subject_is_local,
++                                                             gboolean                           subject_is_active,
++                                                             const gchar                       *action_id,
++                                                             PolkitDetails                     *details,
++                                                             PolkitImplicitAuthorization        implicit)
+ {
+   PolkitBackendJsAuthority *authority = POLKIT_BACKEND_JS_AUTHORITY (_authority);
+   PolkitImplicitAuthorization ret = implicit;
+@@ -864,65 +687,6 @@ js_polkit_log (duk_context *cx)
+ 
+ /* ---------------------------------------------------------------------------------------------------- */
+ 
+-static const gchar *
+-get_signal_name (gint signal_number)
+-{
+-  switch (signal_number)
+-    {
+-#define _HANDLE_SIG(sig) case sig: return #sig;
+-    _HANDLE_SIG (SIGHUP);
+-    _HANDLE_SIG (SIGINT);
+-    _HANDLE_SIG (SIGQUIT);
+-    _HANDLE_SIG (SIGILL);
+-    _HANDLE_SIG (SIGABRT);
+-    _HANDLE_SIG (SIGFPE);
+-    _HANDLE_SIG (SIGKILL);
+-    _HANDLE_SIG (SIGSEGV);
+-    _HANDLE_SIG (SIGPIPE);
+-    _HANDLE_SIG (SIGALRM);
+-    _HANDLE_SIG (SIGTERM);
+-    _HANDLE_SIG (SIGUSR1);
+-    _HANDLE_SIG (SIGUSR2);
+-    _HANDLE_SIG (SIGCHLD);
+-    _HANDLE_SIG (SIGCONT);
+-    _HANDLE_SIG (SIGSTOP);
+-    _HANDLE_SIG (SIGTSTP);
+-    _HANDLE_SIG (SIGTTIN);
+-    _HANDLE_SIG (SIGTTOU);
+-    _HANDLE_SIG (SIGBUS);
+-#ifdef SIGPOLL
+-    _HANDLE_SIG (SIGPOLL);
+-#endif
+-    _HANDLE_SIG (SIGPROF);
+-    _HANDLE_SIG (SIGSYS);
+-    _HANDLE_SIG (SIGTRAP);
+-    _HANDLE_SIG (SIGURG);
+-    _HANDLE_SIG (SIGVTALRM);
+-    _HANDLE_SIG (SIGXCPU);
+-    _HANDLE_SIG (SIGXFSZ);
+-#undef _HANDLE_SIG
+-    default:
+-      break;
+-    }
+-  return "UNKNOWN_SIGNAL";
+-}
+-
+-typedef struct
+-{
+-  GMainLoop *loop;
+-  GAsyncResult *res;
+-} SpawnData;
+-
+-static void
+-spawn_cb (GObject       *source_object,
+-          GAsyncResult  *res,
+-          gpointer       user_data)
+-{
+-  SpawnData *data = (SpawnData *)user_data;
+-  data->res = (GAsyncResult*)g_object_ref (res);
+-  g_main_loop_quit (data->loop);
+-}
+-
+ static duk_ret_t
+ js_polkit_spawn (duk_context *cx)
+ {
+@@ -962,21 +726,21 @@ js_polkit_spawn (duk_context *cx)
+   g_main_context_push_thread_default (context);
+ 
+   data.loop = loop;
+-  utils_spawn ((const gchar *const *) argv,
+-               10, /* timeout_seconds */
+-               NULL, /* cancellable */
+-               spawn_cb,
+-               &data);
++  polkit_backend_common_spawn ((const gchar *const *) argv,
++                               10, /* timeout_seconds */
++                               NULL, /* cancellable */
++                               polkit_backend_common_spawn_cb,
++                               &data);
+ 
+   g_main_loop_run (loop);
+ 
+   g_main_context_pop_thread_default (context);
+ 
+-  if (!utils_spawn_finish (data.res,
+-                           &exit_status,
+-                           &standard_output,
+-                           &standard_error,
+-                           &error))
++  if (!polkit_backend_common_spawn_finish (data.res,
++                                           &exit_status,
++                                           &standard_output,
++                                           &standard_error,
++                                           &error))
+     {
+       err_str = g_strdup_printf ("Error spawning helper: %s (%s, %d)",
+                                  error->message, g_quark_to_string (error->domain), error->code);
+@@ -998,7 +762,7 @@ js_polkit_spawn (duk_context *cx)
+         {
+           g_string_append_printf (gstr,
+                                   "Helper was signaled with signal %s (%d)",
+-                                  get_signal_name (WTERMSIG (exit_status)),
++                                  polkit_backend_common_get_signal_name (WTERMSIG (exit_status)),
+                                   WTERMSIG (exit_status));
+         }
+       g_string_append_printf (gstr, ", stdout=`%s', stderr=`%s'",
+@@ -1052,377 +816,3 @@ js_polkit_user_is_in_netgroup (duk_context *cx)
+ }
+ 
+ /* ---------------------------------------------------------------------------------------------------- */
+-
+-typedef struct
+-{
+-  GSimpleAsyncResult *simple; /* borrowed reference */
+-  GMainContext *main_context; /* may be NULL */
+-
+-  GCancellable *cancellable;  /* may be NULL */
+-  gulong cancellable_handler_id;
+-
+-  GPid child_pid;
+-  gint child_stdout_fd;
+-  gint child_stderr_fd;
+-
+-  GIOChannel *child_stdout_channel;
+-  GIOChannel *child_stderr_channel;
+-
+-  GSource *child_watch_source;
+-  GSource *child_stdout_source;
+-  GSource *child_stderr_source;
+-
+-  guint timeout_seconds;
+-  gboolean timed_out;
+-  GSource *timeout_source;
+-
+-  GString *child_stdout;
+-  GString *child_stderr;
+-
+-  gint exit_status;
+-} UtilsSpawnData;
+-
+-static void
+-utils_child_watch_from_release_cb (GPid     pid,
+-                                   gint     status,
+-                                   gpointer user_data)
+-{
+-}
+-
+-static void
+-utils_spawn_data_free (UtilsSpawnData *data)
+-{
+-  if (data->timeout_source != NULL)
+-    {
+-      g_source_destroy (data->timeout_source);
+-      data->timeout_source = NULL;
+-    }
+-
+-  /* Nuke the child, if necessary */
+-  if (data->child_watch_source != NULL)
+-    {
+-      g_source_destroy (data->child_watch_source);
+-      data->child_watch_source = NULL;
+-    }
+-
+-  if (data->child_pid != 0)
+-    {
+-      GSource *source;
+-      kill (data->child_pid, SIGTERM);
+-      /* OK, we need to reap for the child ourselves - we don't want
+-       * to use waitpid() because that might block the calling
+-       * thread (the child might handle SIGTERM and use several
+-       * seconds for cleanup/rollback).
+-       *
+-       * So we use GChildWatch instead.
+-       *
+-       * Avoid taking a references to ourselves. but note that we need
+-       * to pass the GSource so we can nuke it once handled.
+-       */
+-      source = g_child_watch_source_new (data->child_pid);
+-      g_source_set_callback (source,
+-                             (GSourceFunc) utils_child_watch_from_release_cb,
+-                             source,
+-                             (GDestroyNotify) g_source_destroy);
+-      g_source_attach (source, data->main_context);
+-      g_source_unref (source);
+-      data->child_pid = 0;
+-    }
+-
+-  if (data->child_stdout != NULL)
+-    {
+-      g_string_free (data->child_stdout, TRUE);
+-      data->child_stdout = NULL;
+-    }
+-
+-  if (data->child_stderr != NULL)
+-    {
+-      g_string_free (data->child_stderr, TRUE);
+-      data->child_stderr = NULL;
+-    }
+-
+-  if (data->child_stdout_channel != NULL)
+-    {
+-      g_io_channel_unref (data->child_stdout_channel);
+-      data->child_stdout_channel = NULL;
+-    }
+-  if (data->child_stderr_channel != NULL)
+-    {
+-      g_io_channel_unref (data->child_stderr_channel);
+-      data->child_stderr_channel = NULL;
+-    }
+-
+-  if (data->child_stdout_source != NULL)
+-    {
+-      g_source_destroy (data->child_stdout_source);
+-      data->child_stdout_source = NULL;
+-    }
+-  if (data->child_stderr_source != NULL)
+-    {
+-      g_source_destroy (data->child_stderr_source);
+-      data->child_stderr_source = NULL;
+-    }
+-
+-  if (data->child_stdout_fd != -1)
+-    {
+-      g_warn_if_fail (close (data->child_stdout_fd) == 0);
+-      data->child_stdout_fd = -1;
+-    }
+-  if (data->child_stderr_fd != -1)
+-    {
+-      g_warn_if_fail (close (data->child_stderr_fd) == 0);
+-      data->child_stderr_fd = -1;
+-    }
+-
+-  if (data->cancellable_handler_id > 0)
+-    {
+-      g_cancellable_disconnect (data->cancellable, data->cancellable_handler_id);
+-      data->cancellable_handler_id = 0;
+-    }
+-
+-  if (data->main_context != NULL)
+-    g_main_context_unref (data->main_context);
+-
+-  if (data->cancellable != NULL)
+-    g_object_unref (data->cancellable);
+-
+-  g_slice_free (UtilsSpawnData, data);
+-}
+-
+-/* called in the thread where @cancellable was cancelled */
+-static void
+-utils_on_cancelled (GCancellable *cancellable,
+-                    gpointer      user_data)
+-{
+-  UtilsSpawnData *data = (UtilsSpawnData *)user_data;
+-  GError *error;
+-
+-  error = NULL;
+-  g_warn_if_fail (g_cancellable_set_error_if_cancelled (cancellable, &error));
+-  g_simple_async_result_take_error (data->simple, error);
+-  g_simple_async_result_complete_in_idle (data->simple);
+-  g_object_unref (data->simple);
+-}
+-
+-static gboolean
+-utils_read_child_stderr (GIOChannel *channel,
+-                         GIOCondition condition,
+-                         gpointer user_data)
+-{
+-  UtilsSpawnData *data = (UtilsSpawnData *)user_data;
+-  gchar buf[1024];
+-  gsize bytes_read;
+-
+-  g_io_channel_read_chars (channel, buf, sizeof buf, &bytes_read, NULL);
+-  g_string_append_len (data->child_stderr, buf, bytes_read);
+-  return TRUE;
+-}
+-
+-static gboolean
+-utils_read_child_stdout (GIOChannel *channel,
+-                         GIOCondition condition,
+-                         gpointer user_data)
+-{
+-  UtilsSpawnData *data = (UtilsSpawnData *)user_data;
+-  gchar buf[1024];
+-  gsize bytes_read;
+-
+-  g_io_channel_read_chars (channel, buf, sizeof buf, &bytes_read, NULL);
+-  g_string_append_len (data->child_stdout, buf, bytes_read);
+-  return TRUE;
+-}
+-
+-static void
+-utils_child_watch_cb (GPid     pid,
+-                      gint     status,
+-                      gpointer user_data)
+-{
+-  UtilsSpawnData *data = (UtilsSpawnData *)user_data;
+-  gchar *buf;
+-  gsize buf_size;
+-
+-  if (g_io_channel_read_to_end (data->child_stdout_channel, &buf, &buf_size, NULL) == G_IO_STATUS_NORMAL)
+-    {
+-      g_string_append_len (data->child_stdout, buf, buf_size);
+-      g_free (buf);
+-    }
+-  if (g_io_channel_read_to_end (data->child_stderr_channel, &buf, &buf_size, NULL) == G_IO_STATUS_NORMAL)
+-    {
+-      g_string_append_len (data->child_stderr, buf, buf_size);
+-      g_free (buf);
+-    }
+-
+-  data->exit_status = status;
+-
+-  /* ok, child watch is history, make sure we don't free it in spawn_data_free() */
+-  data->child_pid = 0;
+-  data->child_watch_source = NULL;
+-
+-  /* we're done */
+-  g_simple_async_result_complete_in_idle (data->simple);
+-  g_object_unref (data->simple);
+-}
+-
+-static gboolean
+-utils_timeout_cb (gpointer user_data)
+-{
+-  UtilsSpawnData *data = (UtilsSpawnData *)user_data;
+-
+-  data->timed_out = TRUE;
+-
+-  /* ok, timeout is history, make sure we don't free it in spawn_data_free() */
+-  data->timeout_source = NULL;
+-
+-  /* we're done */
+-  g_simple_async_result_complete_in_idle (data->simple);
+-  g_object_unref (data->simple);
+-
+-  return FALSE; /* remove source */
+-}
+-
+-static void
+-utils_spawn (const gchar *const  *argv,
+-             guint                timeout_seconds,
+-             GCancellable        *cancellable,
+-             GAsyncReadyCallback  callback,
+-             gpointer             user_data)
+-{
+-  UtilsSpawnData *data;
+-  GError *error;
+-
+-  data = g_slice_new0 (UtilsSpawnData);
+-  data->timeout_seconds = timeout_seconds;
+-  data->simple = g_simple_async_result_new (NULL,
+-                                            callback,
+-                                            user_data,
+-                                            (gpointer*)utils_spawn);
+-  data->main_context = g_main_context_get_thread_default ();
+-  if (data->main_context != NULL)
+-    g_main_context_ref (data->main_context);
+-
+-  data->cancellable = cancellable != NULL ? (GCancellable*)g_object_ref (cancellable) : NULL;
+-
+-  data->child_stdout = g_string_new (NULL);
+-  data->child_stderr = g_string_new (NULL);
+-  data->child_stdout_fd = -1;
+-  data->child_stderr_fd = -1;
+-
+-  /* the life-cycle of UtilsSpawnData is tied to its GSimpleAsyncResult */
+-  g_simple_async_result_set_op_res_gpointer (data->simple, data, (GDestroyNotify) utils_spawn_data_free);
+-
+-  error = NULL;
+-  if (data->cancellable != NULL)
+-    {
+-      /* could already be cancelled */
+-      error = NULL;
+-      if (g_cancellable_set_error_if_cancelled (data->cancellable, &error))
+-        {
+-          g_simple_async_result_take_error (data->simple, error);
+-          g_simple_async_result_complete_in_idle (data->simple);
+-          g_object_unref (data->simple);
+-          goto out;
+-        }
+-
+-      data->cancellable_handler_id = g_cancellable_connect (data->cancellable,
+-                                                            G_CALLBACK (utils_on_cancelled),
+-                                                            data,
+-                                                            NULL);
+-    }
+-
+-  error = NULL;
+-  if (!g_spawn_async_with_pipes (NULL, /* working directory */
+-                                 (gchar **) argv,
+-                                 NULL, /* envp */
+-                                 G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD,
+-                                 NULL, /* child_setup */
+-                                 NULL, /* child_setup's user_data */
+-                                 &(data->child_pid),
+-                                 NULL, /* gint *stdin_fd */
+-                                 &(data->child_stdout_fd),
+-                                 &(data->child_stderr_fd),
+-                                 &error))
+-    {
+-      g_prefix_error (&error, "Error spawning: ");
+-      g_simple_async_result_take_error (data->simple, error);
+-      g_simple_async_result_complete_in_idle (data->simple);
+-      g_object_unref (data->simple);
+-      goto out;
+-    }
+-
+-  if (timeout_seconds > 0)
+-    {
+-      data->timeout_source = g_timeout_source_new_seconds (timeout_seconds);
+-      g_source_set_priority (data->timeout_source, G_PRIORITY_DEFAULT);
+-      g_source_set_callback (data->timeout_source, utils_timeout_cb, data, NULL);
+-      g_source_attach (data->timeout_source, data->main_context);
+-      g_source_unref (data->timeout_source);
+-    }
+-
+-  data->child_watch_source = g_child_watch_source_new (data->child_pid);
+-  g_source_set_callback (data->child_watch_source, (GSourceFunc) utils_child_watch_cb, data, NULL);
+-  g_source_attach (data->child_watch_source, data->main_context);
+-  g_source_unref (data->child_watch_source);
+-
+-  data->child_stdout_channel = g_io_channel_unix_new (data->child_stdout_fd);
+-  g_io_channel_set_flags (data->child_stdout_channel, G_IO_FLAG_NONBLOCK, NULL);
+-  data->child_stdout_source = g_io_create_watch (data->child_stdout_channel, G_IO_IN);
+-  g_source_set_callback (data->child_stdout_source, (GSourceFunc) utils_read_child_stdout, data, NULL);
+-  g_source_attach (data->child_stdout_source, data->main_context);
+-  g_source_unref (data->child_stdout_source);
+-
+-  data->child_stderr_channel = g_io_channel_unix_new (data->child_stderr_fd);
+-  g_io_channel_set_flags (data->child_stderr_channel, G_IO_FLAG_NONBLOCK, NULL);
+-  data->child_stderr_source = g_io_create_watch (data->child_stderr_channel, G_IO_IN);
+-  g_source_set_callback (data->child_stderr_source, (GSourceFunc) utils_read_child_stderr, data, NULL);
+-  g_source_attach (data->child_stderr_source, data->main_context);
+-  g_source_unref (data->child_stderr_source);
+-
+- out:
+-  ;
+-}
+-
+-gboolean
+-utils_spawn_finish (GAsyncResult   *res,
+-                    gint           *out_exit_status,
+-                    gchar         **out_standard_output,
+-                    gchar         **out_standard_error,
+-                    GError        **error)
+-{
+-  GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
+-  UtilsSpawnData *data;
+-  gboolean ret = FALSE;
+-
+-  g_return_val_if_fail (G_IS_ASYNC_RESULT (res), FALSE);
+-  g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+-
+-  g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == utils_spawn);
+-
+-  if (g_simple_async_result_propagate_error (simple, error))
+-    goto out;
+-
+-  data = (UtilsSpawnData*)g_simple_async_result_get_op_res_gpointer (simple);
+-
+-  if (data->timed_out)
+-    {
+-      g_set_error (error,
+-                   G_IO_ERROR,
+-                   G_IO_ERROR_TIMED_OUT,
+-                   "Timed out after %d seconds",
+-                   data->timeout_seconds);
+-      goto out;
+-    }
+-
+-  if (out_exit_status != NULL)
+-    *out_exit_status = data->exit_status;
+-
+-  if (out_standard_output != NULL)
+-    *out_standard_output = g_strdup (data->child_stdout->str);
+-
+-  if (out_standard_error != NULL)
+-    *out_standard_error = g_strdup (data->child_stderr->str);
+-
+-  ret = TRUE;
+-
+- out:
+-  return ret;
+-}
+diff --git a/src/polkitbackend/polkitbackendjsauthority.cpp b/src/polkitbackend/polkitbackendjsauthority.cpp
+index ca17108..e28091d 100644
+--- a/src/polkitbackend/polkitbackendjsauthority.cpp
++++ b/src/polkitbackend/polkitbackendjsauthority.cpp
+@@ -19,29 +19,7 @@
+  * Author: David Zeuthen <davidz@redhat.com>
+  */
+ 
+-#include "config.h"
+-#include <sys/wait.h>
+-#include <errno.h>
+-#include <pwd.h>
+-#include <grp.h>
+-#ifdef HAVE_NETGROUP_H
+-#include <netgroup.h>
+-#else
+-#include <netdb.h>
+-#endif
+-#include <string.h>
+-#include <glib/gstdio.h>
+-#include <locale.h>
+-#include <glib/gi18n-lib.h>
+-
+-#include <polkit/polkit.h>
+-#include "polkitbackendjsauthority.h"
+-
+-#include <polkit/polkitprivate.h>
+-
+-#ifdef HAVE_LIBSYSTEMD
+-#include <systemd/sd-login.h>
+-#endif /* HAVE_LIBSYSTEMD */
++#include "polkitbackendcommon.h"
+ 
+ #include <js/CompilationAndEvaluation.h>
+ #include <js/ContextOptions.h>
+@@ -52,6 +30,7 @@
+ #include <js/Array.h>
+ #include <jsapi.h>
+ 
++/* Built source and not too big to worry about deduplication */
+ #include "initjs.h" /* init.js */
+ 
+ #ifdef JSGC_USE_EXACT_ROOTING
+@@ -67,10 +46,9 @@
+  * @short_description: JS Authority
+  * @stability: Unstable
+  *
+- * An implementation of #PolkitBackendAuthority that reads and
+- * evalates Javascript files and supports interaction with
+- * authentication agents (virtue of being based on
+- * #PolkitBackendInteractiveAuthority).
++ * An (SpiderMonkey-based) implementation of #PolkitBackendAuthority that reads
++ * and evaluates Javascript files and supports interaction with authentication
++ * agents (virtue of being based on #PolkitBackendInteractiveAuthority).
+  */
+ 
+ /* ---------------------------------------------------------------------------------------------------- */
+@@ -100,57 +78,11 @@ static bool execute_script_with_runaway_killer (PolkitBackendJsAuthority *author
+                                     JS::HandleScript                 script,
+                                     JS::MutableHandleValue           rval);
+ 
+-static void utils_spawn (const gchar *const  *argv,
+-                         guint                timeout_seconds,
+-                         GCancellable        *cancellable,
+-                         GAsyncReadyCallback  callback,
+-                         gpointer             user_data);
+-
+-gboolean utils_spawn_finish (GAsyncResult   *res,
+-                             gint           *out_exit_status,
+-                             gchar         **out_standard_output,
+-                             gchar         **out_standard_error,
+-                             GError        **error);
+-
+-static void on_dir_monitor_changed (GFileMonitor     *monitor,
+-                                    GFile            *file,
+-                                    GFile            *other_file,
+-                                    GFileMonitorEvent event_type,
+-                                    gpointer          user_data);
+-
+-/* ---------------------------------------------------------------------------------------------------- */
+-
+-enum
+-{
+-  PROP_0,
+-  PROP_RULES_DIRS,
+-};
+-
+ /* ---------------------------------------------------------------------------------------------------- */
+ 
+ static gpointer runaway_killer_thread_func (gpointer user_data);
+ static void runaway_killer_terminate (PolkitBackendJsAuthority *authority);
+ 
+-static GList *polkit_backend_js_authority_get_admin_auth_identities (PolkitBackendInteractiveAuthority *authority,
+-                                                                     PolkitSubject                     *caller,
+-                                                                     PolkitSubject                     *subject,
+-                                                                     PolkitIdentity                    *user_for_subject,
+-                                                                     gboolean                           subject_is_local,
+-                                                                     gboolean                           subject_is_active,
+-                                                                     const gchar                       *action_id,
+-                                                                     PolkitDetails                     *details);
+-
+-static PolkitImplicitAuthorization polkit_backend_js_authority_check_authorization_sync (
+-                                                          PolkitBackendInteractiveAuthority *authority,
+-                                                          PolkitSubject                     *caller,
+-                                                          PolkitSubject                     *subject,
+-                                                          PolkitIdentity                    *user_for_subject,
+-                                                          gboolean                           subject_is_local,
+-                                                          gboolean                           subject_is_active,
+-                                                          const gchar                       *action_id,
+-                                                          PolkitDetails                     *details,
+-                                                          PolkitImplicitAuthorization        implicit);
+-
+ G_DEFINE_TYPE (PolkitBackendJsAuthority, polkit_backend_js_authority, POLKIT_BACKEND_TYPE_INTERACTIVE_AUTHORITY);
+ 
+ /* ---------------------------------------------------------------------------------------------------- */
+@@ -229,33 +161,6 @@ polkit_backend_js_authority_init (PolkitBackendJsAuthority *authority)
+                                                  PolkitBackendJsAuthorityPrivate);
+ }
+ 
+-static gint
+-rules_file_name_cmp (const gchar *a,
+-                     const gchar *b)
+-{
+-  gint ret;
+-  const gchar *a_base;
+-  const gchar *b_base;
+-
+-  a_base = strrchr (a, '/');
+-  b_base = strrchr (b, '/');
+-
+-  g_assert (a_base != NULL);
+-  g_assert (b_base != NULL);
+-  a_base += 1;
+-  b_base += 1;
+-
+-  ret = g_strcmp0 (a_base, b_base);
+-  if (ret == 0)
+-    {
+-      /* /etc wins over /usr */
+-      ret = g_strcmp0 (a, b);
+-      g_assert (ret != 0);
+-    }
+-
+-  return ret;
+-}
+-
+ /* authority->priv->cx must be within a request */
+ static void
+ load_scripts (PolkitBackendJsAuthority  *authority)
+@@ -299,7 +204,7 @@ load_scripts (PolkitBackendJsAuthority  *authority)
+         }
+     }
+ 
+-  files = g_list_sort (files, (GCompareFunc) rules_file_name_cmp);
++  files = g_list_sort (files, (GCompareFunc) polkit_backend_common_rules_file_name_cmp);
+ 
+   for (l = files; l != NULL; l = l->next)
+     {
+@@ -365,8 +270,8 @@ load_scripts (PolkitBackendJsAuthority  *authority)
+   g_list_free_full (files, g_free);
+ }
+ 
+-static void
+-reload_scripts (PolkitBackendJsAuthority *authority)
++void
++polkit_backend_common_reload_scripts (PolkitBackendJsAuthority *authority)
+ {
+   JS::RootedValueArray<1> args(authority->priv->cx);
+   JS::RootedValue rval(authority->priv->cx);
+@@ -395,42 +300,6 @@ reload_scripts (PolkitBackendJsAuthority *authority)
+   g_signal_emit_by_name (authority, "changed");
+ }
+ 
+-static void
+-on_dir_monitor_changed (GFileMonitor     *monitor,
+-                        GFile            *file,
+-                        GFile            *other_file,
+-                        GFileMonitorEvent event_type,
+-                        gpointer          user_data)
+-{
+-  PolkitBackendJsAuthority *authority = POLKIT_BACKEND_JS_AUTHORITY (user_data);
+-
+-  /* TODO: maybe rate-limit so storms of events are collapsed into one with a 500ms resolution?
+-   *       Because when editing a file with emacs we get 4-8 events..
+-   */
+-
+-  if (file != NULL)
+-    {
+-      gchar *name;
+-
+-      name = g_file_get_basename (file);
+-
+-      /* g_print ("event_type=%d file=%p name=%s\n", event_type, file, name); */
+-      if (!g_str_has_prefix (name, ".") &&
+-          !g_str_has_prefix (name, "#") &&
+-          g_str_has_suffix (name, ".rules") &&
+-          (event_type == G_FILE_MONITOR_EVENT_CREATED ||
+-           event_type == G_FILE_MONITOR_EVENT_DELETED ||
+-           event_type == G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT))
+-        {
+-          polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority),
+-                                        "Reloading rules");
+-          reload_scripts (authority);
+-        }
+-      g_free (name);
+-    }
+-}
+-
+-
+ static void
+ setup_file_monitors (PolkitBackendJsAuthority *authority)
+ {
+@@ -462,7 +331,7 @@ setup_file_monitors (PolkitBackendJsAuthority *authority)
+         {
+           g_signal_connect (monitor,
+                             "changed",
+-                            G_CALLBACK (on_dir_monitor_changed),
++                            G_CALLBACK (polkit_backend_common_on_dir_monitor_changed),
+                             authority);
+           g_ptr_array_add (p, monitor);
+         }
+@@ -471,8 +340,8 @@ setup_file_monitors (PolkitBackendJsAuthority *authority)
+   authority->priv->dir_monitors = (GFileMonitor**) g_ptr_array_free (p, FALSE);
+ }
+ 
+-static void
+-polkit_backend_js_authority_constructed (GObject *object)
++void
++polkit_backend_common_js_authority_constructed (GObject *object)
+ {
+   PolkitBackendJsAuthority *authority = POLKIT_BACKEND_JS_AUTHORITY (object);
+ 
+@@ -561,8 +430,8 @@ polkit_backend_js_authority_constructed (GObject *object)
+   g_assert_not_reached ();
+ }
+ 
+-static void
+-polkit_backend_js_authority_finalize (GObject *object)
++void
++polkit_backend_common_js_authority_finalize (GObject *object)
+ {
+   PolkitBackendJsAuthority *authority = POLKIT_BACKEND_JS_AUTHORITY (object);
+   guint n;
+@@ -577,7 +446,7 @@ polkit_backend_js_authority_finalize (GObject *object)
+     {
+       GFileMonitor *monitor = authority->priv->dir_monitors[n];
+       g_signal_handlers_disconnect_by_func (monitor,
+-                                            (gpointer*)G_CALLBACK (on_dir_monitor_changed),
++                                            (gpointer*)G_CALLBACK (polkit_backend_common_on_dir_monitor_changed),
+                                             authority);
+       g_object_unref (monitor);
+     }
+@@ -594,11 +463,11 @@ polkit_backend_js_authority_finalize (GObject *object)
+   G_OBJECT_CLASS (polkit_backend_js_authority_parent_class)->finalize (object);
+ }
+ 
+-static void
+-polkit_backend_js_authority_set_property (GObject      *object,
+-                                          guint         property_id,
+-                                          const GValue *value,
+-                                          GParamSpec   *pspec)
++void
++polkit_backend_common_js_authority_set_property (GObject      *object,
++                                                 guint         property_id,
++                                                 const GValue *value,
++                                                 GParamSpec   *pspec)
+ {
+   PolkitBackendJsAuthority *authority = POLKIT_BACKEND_JS_AUTHORITY (object);
+ 
+@@ -615,57 +484,12 @@ polkit_backend_js_authority_set_property (GObject      *object,
+     }
+ }
+ 
+-static const gchar *
+-polkit_backend_js_authority_get_name (PolkitBackendAuthority *authority)
+-{
+-  return "js";
+-}
+-
+-static const gchar *
+-polkit_backend_js_authority_get_version (PolkitBackendAuthority *authority)
+-{
+-  return PACKAGE_VERSION;
+-}
+-
+-static PolkitAuthorityFeatures
+-polkit_backend_js_authority_get_features (PolkitBackendAuthority *authority)
+-{
+-  return POLKIT_AUTHORITY_FEATURES_TEMPORARY_AUTHORIZATION;
+-}
+-
+ static void
+ polkit_backend_js_authority_class_init (PolkitBackendJsAuthorityClass *klass)
+ {
+-  GObjectClass *gobject_class;
+-  PolkitBackendAuthorityClass *authority_class;
+-  PolkitBackendInteractiveAuthorityClass *interactive_authority_class;
+-
+-
+-  gobject_class = G_OBJECT_CLASS (klass);
+-  gobject_class->finalize                               = polkit_backend_js_authority_finalize;
+-  gobject_class->set_property                           = polkit_backend_js_authority_set_property;
+-  gobject_class->constructed                            = polkit_backend_js_authority_constructed;
+-
+-  authority_class = POLKIT_BACKEND_AUTHORITY_CLASS (klass);
+-  authority_class->get_name                             = polkit_backend_js_authority_get_name;
+-  authority_class->get_version                          = polkit_backend_js_authority_get_version;
+-  authority_class->get_features                         = polkit_backend_js_authority_get_features;
+-
+-  interactive_authority_class = POLKIT_BACKEND_INTERACTIVE_AUTHORITY_CLASS (klass);
+-  interactive_authority_class->get_admin_identities     = polkit_backend_js_authority_get_admin_auth_identities;
+-  interactive_authority_class->check_authorization_sync = polkit_backend_js_authority_check_authorization_sync;
+-
+-  g_object_class_install_property (gobject_class,
+-                                   PROP_RULES_DIRS,
+-                                   g_param_spec_boxed ("rules-dirs",
+-                                                       NULL,
+-                                                       NULL,
+-                                                       G_TYPE_STRV,
+-                                                       GParamFlags(G_PARAM_CONSTRUCT_ONLY | G_PARAM_WRITABLE)));
+-
++  polkit_backend_common_js_authority_class_init_common (klass);
+ 
+   g_type_class_add_private (klass, sizeof (PolkitBackendJsAuthorityPrivate));
+-
+   JS_Init ();
+ }
+ 
+@@ -1099,15 +923,15 @@ call_js_function_with_runaway_killer (PolkitBackendJsAuthority *authority,
+ 
+ /* ---------------------------------------------------------------------------------------------------- */
+ 
+-static GList *
+-polkit_backend_js_authority_get_admin_auth_identities (PolkitBackendInteractiveAuthority *_authority,
+-                                                       PolkitSubject                     *caller,
+-                                                       PolkitSubject                     *subject,
+-                                                       PolkitIdentity                    *user_for_subject,
+-                                                       gboolean                           subject_is_local,
+-                                                       gboolean                           subject_is_active,
+-                                                       const gchar                       *action_id,
+-                                                       PolkitDetails                     *details)
++GList *
++polkit_backend_common_js_authority_get_admin_auth_identities (PolkitBackendInteractiveAuthority *_authority,
++                                                              PolkitSubject                     *caller,
++                                                              PolkitSubject                     *subject,
++                                                              PolkitIdentity                    *user_for_subject,
++                                                              gboolean                           subject_is_local,
++                                                              gboolean                           subject_is_active,
++                                                              const gchar                       *action_id,
++                                                              PolkitDetails                     *details)
+ {
+   PolkitBackendJsAuthority *authority = POLKIT_BACKEND_JS_AUTHORITY (_authority);
+   GList *ret = NULL;
+@@ -1202,16 +1026,16 @@ polkit_backend_js_authority_get_admin_auth_identities (PolkitBackendInteractiveA
+ 
+ /* ---------------------------------------------------------------------------------------------------- */
+ 
+-static PolkitImplicitAuthorization
+-polkit_backend_js_authority_check_authorization_sync (PolkitBackendInteractiveAuthority *_authority,
+-                                                      PolkitSubject                     *caller,
+-                                                      PolkitSubject                     *subject,
+-                                                      PolkitIdentity                    *user_for_subject,
+-                                                      gboolean                           subject_is_local,
+-                                                      gboolean                           subject_is_active,
+-                                                      const gchar                       *action_id,
+-                                                      PolkitDetails                     *details,
+-                                                      PolkitImplicitAuthorization        implicit)
++PolkitImplicitAuthorization
++polkit_backend_common_js_authority_check_authorization_sync (PolkitBackendInteractiveAuthority *_authority,
++                                                             PolkitSubject                     *caller,
++                                                             PolkitSubject                     *subject,
++                                                             PolkitIdentity                    *user_for_subject,
++                                                             gboolean                           subject_is_local,
++                                                             gboolean                           subject_is_active,
++                                                             const gchar                       *action_id,
++                                                             PolkitDetails                     *details,
++                                                             PolkitImplicitAuthorization        implicit)
+ {
+   PolkitBackendJsAuthority *authority = POLKIT_BACKEND_JS_AUTHORITY (_authority);
+   PolkitImplicitAuthorization ret = implicit;
+@@ -1324,65 +1148,6 @@ js_polkit_log (JSContext  *cx,
+ 
+ /* ---------------------------------------------------------------------------------------------------- */
+ 
+-static const gchar *
+-get_signal_name (gint signal_number)
+-{
+-  switch (signal_number)
+-    {
+-#define _HANDLE_SIG(sig) case sig: return #sig;
+-    _HANDLE_SIG (SIGHUP);
+-    _HANDLE_SIG (SIGINT);
+-    _HANDLE_SIG (SIGQUIT);
+-    _HANDLE_SIG (SIGILL);
+-    _HANDLE_SIG (SIGABRT);
+-    _HANDLE_SIG (SIGFPE);
+-    _HANDLE_SIG (SIGKILL);
+-    _HANDLE_SIG (SIGSEGV);
+-    _HANDLE_SIG (SIGPIPE);
+-    _HANDLE_SIG (SIGALRM);
+-    _HANDLE_SIG (SIGTERM);
+-    _HANDLE_SIG (SIGUSR1);
+-    _HANDLE_SIG (SIGUSR2);
+-    _HANDLE_SIG (SIGCHLD);
+-    _HANDLE_SIG (SIGCONT);
+-    _HANDLE_SIG (SIGSTOP);
+-    _HANDLE_SIG (SIGTSTP);
+-    _HANDLE_SIG (SIGTTIN);
+-    _HANDLE_SIG (SIGTTOU);
+-    _HANDLE_SIG (SIGBUS);
+-#ifdef SIGPOLL
+-    _HANDLE_SIG (SIGPOLL);
+-#endif
+-    _HANDLE_SIG (SIGPROF);
+-    _HANDLE_SIG (SIGSYS);
+-    _HANDLE_SIG (SIGTRAP);
+-    _HANDLE_SIG (SIGURG);
+-    _HANDLE_SIG (SIGVTALRM);
+-    _HANDLE_SIG (SIGXCPU);
+-    _HANDLE_SIG (SIGXFSZ);
+-#undef _HANDLE_SIG
+-    default:
+-      break;
+-    }
+-  return "UNKNOWN_SIGNAL";
+-}
+-
+-typedef struct
+-{
+-  GMainLoop *loop;
+-  GAsyncResult *res;
+-} SpawnData;
+-
+-static void
+-spawn_cb (GObject       *source_object,
+-          GAsyncResult  *res,
+-          gpointer       user_data)
+-{
+-  SpawnData *data = (SpawnData *)user_data;
+-  data->res = (GAsyncResult*)g_object_ref (res);
+-  g_main_loop_quit (data->loop);
+-}
+-
+ static bool
+ js_polkit_spawn (JSContext  *cx,
+                  unsigned    js_argc,
+@@ -1440,21 +1205,21 @@ js_polkit_spawn (JSContext  *cx,
+   g_main_context_push_thread_default (context);
+ 
+   data.loop = loop;
+-  utils_spawn ((const gchar *const *) argv,
+-               10, /* timeout_seconds */
+-               NULL, /* cancellable */
+-               spawn_cb,
+-               &data);
++  polkit_backend_common_spawn ((const gchar *const *) argv,
++                               10, /* timeout_seconds */
++                               NULL, /* cancellable */
++                               polkit_backend_common_spawn_cb,
++                               &data);
+ 
+   g_main_loop_run (loop);
+ 
+   g_main_context_pop_thread_default (context);
+ 
+-  if (!utils_spawn_finish (data.res,
+-                           &exit_status,
+-                           &standard_output,
+-                           &standard_error,
+-                           &error))
++  if (!polkit_backend_common_spawn_finish (data.res,
++                                           &exit_status,
++                                           &standard_output,
++                                           &standard_error,
++                                           &error))
+     {
+       JS_ReportErrorUTF8 (cx,
+                       "Error spawning helper: %s (%s, %d)",
+@@ -1477,7 +1242,7 @@ js_polkit_spawn (JSContext  *cx,
+         {
+           g_string_append_printf (gstr,
+                                   "Helper was signaled with signal %s (%d)",
+-                                  get_signal_name (WTERMSIG (exit_status)),
++                                  polkit_backend_common_get_signal_name (WTERMSIG (exit_status)),
+                                   WTERMSIG (exit_status));
+         }
+       g_string_append_printf (gstr, ", stdout=`%s', stderr=`%s'",
+@@ -1542,381 +1307,5 @@ js_polkit_user_is_in_netgroup (JSContext  *cx,
+   return ret;
+ }
+ 
+-
+-
+ /* ---------------------------------------------------------------------------------------------------- */
+ 
+-typedef struct
+-{
+-  GSimpleAsyncResult *simple; /* borrowed reference */
+-  GMainContext *main_context; /* may be NULL */
+-
+-  GCancellable *cancellable;  /* may be NULL */
+-  gulong cancellable_handler_id;
+-
+-  GPid child_pid;
+-  gint child_stdout_fd;
+-  gint child_stderr_fd;
+-
+-  GIOChannel *child_stdout_channel;
+-  GIOChannel *child_stderr_channel;
+-
+-  GSource *child_watch_source;
+-  GSource *child_stdout_source;
+-  GSource *child_stderr_source;
+-
+-  guint timeout_seconds;
+-  gboolean timed_out;
+-  GSource *timeout_source;
+-
+-  GString *child_stdout;
+-  GString *child_stderr;
+-
+-  gint exit_status;
+-} UtilsSpawnData;
+-
+-static void
+-utils_child_watch_from_release_cb (GPid     pid,
+-                                   gint     status,
+-                                   gpointer user_data)
+-{
+-}
+-
+-static void
+-utils_spawn_data_free (UtilsSpawnData *data)
+-{
+-  if (data->timeout_source != NULL)
+-    {
+-      g_source_destroy (data->timeout_source);
+-      data->timeout_source = NULL;
+-    }
+-
+-  /* Nuke the child, if necessary */
+-  if (data->child_watch_source != NULL)
+-    {
+-      g_source_destroy (data->child_watch_source);
+-      data->child_watch_source = NULL;
+-    }
+-
+-  if (data->child_pid != 0)
+-    {
+-      GSource *source;
+-      kill (data->child_pid, SIGTERM);
+-      /* OK, we need to reap for the child ourselves - we don't want
+-       * to use waitpid() because that might block the calling
+-       * thread (the child might handle SIGTERM and use several
+-       * seconds for cleanup/rollback).
+-       *
+-       * So we use GChildWatch instead.
+-       *
+-       * Avoid taking a references to ourselves. but note that we need
+-       * to pass the GSource so we can nuke it once handled.
+-       */
+-      source = g_child_watch_source_new (data->child_pid);
+-      g_source_set_callback (source,
+-                             (GSourceFunc) utils_child_watch_from_release_cb,
+-                             source,
+-                             (GDestroyNotify) g_source_destroy);
+-      /* attach source to the global default main context */
+-      g_source_attach (source, NULL);
+-      g_source_unref (source);
+-      data->child_pid = 0;
+-    }
+-
+-  if (data->child_stdout != NULL)
+-    {
+-      g_string_free (data->child_stdout, TRUE);
+-      data->child_stdout = NULL;
+-    }
+-
+-  if (data->child_stderr != NULL)
+-    {
+-      g_string_free (data->child_stderr, TRUE);
+-      data->child_stderr = NULL;
+-    }
+-
+-  if (data->child_stdout_channel != NULL)
+-    {
+-      g_io_channel_unref (data->child_stdout_channel);
+-      data->child_stdout_channel = NULL;
+-    }
+-  if (data->child_stderr_channel != NULL)
+-    {
+-      g_io_channel_unref (data->child_stderr_channel);
+-      data->child_stderr_channel = NULL;
+-    }
+-
+-  if (data->child_stdout_source != NULL)
+-    {
+-      g_source_destroy (data->child_stdout_source);
+-      data->child_stdout_source = NULL;
+-    }
+-  if (data->child_stderr_source != NULL)
+-    {
+-      g_source_destroy (data->child_stderr_source);
+-      data->child_stderr_source = NULL;
+-    }
+-
+-  if (data->child_stdout_fd != -1)
+-    {
+-      g_warn_if_fail (close (data->child_stdout_fd) == 0);
+-      data->child_stdout_fd = -1;
+-    }
+-  if (data->child_stderr_fd != -1)
+-    {
+-      g_warn_if_fail (close (data->child_stderr_fd) == 0);
+-      data->child_stderr_fd = -1;
+-    }
+-
+-  if (data->cancellable_handler_id > 0)
+-    {
+-      g_cancellable_disconnect (data->cancellable, data->cancellable_handler_id);
+-      data->cancellable_handler_id = 0;
+-    }
+-
+-  if (data->main_context != NULL)
+-    g_main_context_unref (data->main_context);
+-
+-  if (data->cancellable != NULL)
+-    g_object_unref (data->cancellable);
+-
+-  g_slice_free (UtilsSpawnData, data);
+-}
+-
+-/* called in the thread where @cancellable was cancelled */
+-static void
+-utils_on_cancelled (GCancellable *cancellable,
+-                    gpointer      user_data)
+-{
+-  UtilsSpawnData *data = (UtilsSpawnData *)user_data;
+-  GError *error;
+-
+-  error = NULL;
+-  g_warn_if_fail (g_cancellable_set_error_if_cancelled (cancellable, &error));
+-  g_simple_async_result_take_error (data->simple, error);
+-  g_simple_async_result_complete_in_idle (data->simple);
+-  g_object_unref (data->simple);
+-}
+-
+-static gboolean
+-utils_read_child_stderr (GIOChannel *channel,
+-                         GIOCondition condition,
+-                         gpointer user_data)
+-{
+-  UtilsSpawnData *data = (UtilsSpawnData *)user_data;
+-  gchar buf[1024];
+-  gsize bytes_read;
+-
+-  g_io_channel_read_chars (channel, buf, sizeof buf, &bytes_read, NULL);
+-  g_string_append_len (data->child_stderr, buf, bytes_read);
+-  return TRUE;
+-}
+-
+-static gboolean
+-utils_read_child_stdout (GIOChannel *channel,
+-                         GIOCondition condition,
+-                         gpointer user_data)
+-{
+-  UtilsSpawnData *data = (UtilsSpawnData *)user_data;
+-  gchar buf[1024];
+-  gsize bytes_read;
+-
+-  g_io_channel_read_chars (channel, buf, sizeof buf, &bytes_read, NULL);
+-  g_string_append_len (data->child_stdout, buf, bytes_read);
+-  return TRUE;
+-}
+-
+-static void
+-utils_child_watch_cb (GPid     pid,
+-                      gint     status,
+-                      gpointer user_data)
+-{
+-  UtilsSpawnData *data = (UtilsSpawnData *)user_data;
+-  gchar *buf;
+-  gsize buf_size;
+-
+-  if (g_io_channel_read_to_end (data->child_stdout_channel, &buf, &buf_size, NULL) == G_IO_STATUS_NORMAL)
+-    {
+-      g_string_append_len (data->child_stdout, buf, buf_size);
+-      g_free (buf);
+-    }
+-  if (g_io_channel_read_to_end (data->child_stderr_channel, &buf, &buf_size, NULL) == G_IO_STATUS_NORMAL)
+-    {
+-      g_string_append_len (data->child_stderr, buf, buf_size);
+-      g_free (buf);
+-    }
+-
+-  data->exit_status = status;
+-
+-  /* ok, child watch is history, make sure we don't free it in spawn_data_free() */
+-  data->child_pid = 0;
+-  data->child_watch_source = NULL;
+-
+-  /* we're done */
+-  g_simple_async_result_complete_in_idle (data->simple);
+-  g_object_unref (data->simple);
+-}
+-
+-static gboolean
+-utils_timeout_cb (gpointer user_data)
+-{
+-  UtilsSpawnData *data = (UtilsSpawnData *)user_data;
+-
+-  data->timed_out = TRUE;
+-
+-  /* ok, timeout is history, make sure we don't free it in spawn_data_free() */
+-  data->timeout_source = NULL;
+-
+-  /* we're done */
+-  g_simple_async_result_complete_in_idle (data->simple);
+-  g_object_unref (data->simple);
+-
+-  return FALSE; /* remove source */
+-}
+-
+-static void
+-utils_spawn (const gchar *const  *argv,
+-             guint                timeout_seconds,
+-             GCancellable        *cancellable,
+-             GAsyncReadyCallback  callback,
+-             gpointer             user_data)
+-{
+-  UtilsSpawnData *data;
+-  GError *error;
+-
+-  data = g_slice_new0 (UtilsSpawnData);
+-  data->timeout_seconds = timeout_seconds;
+-  data->simple = g_simple_async_result_new (NULL,
+-                                            callback,
+-                                            user_data,
+-                                            (gpointer*)utils_spawn);
+-  data->main_context = g_main_context_get_thread_default ();
+-  if (data->main_context != NULL)
+-    g_main_context_ref (data->main_context);
+-
+-  data->cancellable = cancellable != NULL ? (GCancellable*)g_object_ref (cancellable) : NULL;
+-
+-  data->child_stdout = g_string_new (NULL);
+-  data->child_stderr = g_string_new (NULL);
+-  data->child_stdout_fd = -1;
+-  data->child_stderr_fd = -1;
+-
+-  /* the life-cycle of UtilsSpawnData is tied to its GSimpleAsyncResult */
+-  g_simple_async_result_set_op_res_gpointer (data->simple, data, (GDestroyNotify) utils_spawn_data_free);
+-
+-  error = NULL;
+-  if (data->cancellable != NULL)
+-    {
+-      /* could already be cancelled */
+-      error = NULL;
+-      if (g_cancellable_set_error_if_cancelled (data->cancellable, &error))
+-        {
+-          g_simple_async_result_take_error (data->simple, error);
+-          g_simple_async_result_complete_in_idle (data->simple);
+-          g_object_unref (data->simple);
+-          goto out;
+-        }
+-
+-      data->cancellable_handler_id = g_cancellable_connect (data->cancellable,
+-                                                            G_CALLBACK (utils_on_cancelled),
+-                                                            data,
+-                                                            NULL);
+-    }
+-
+-  error = NULL;
+-  if (!g_spawn_async_with_pipes (NULL, /* working directory */
+-                                 (gchar **) argv,
+-                                 NULL, /* envp */
+-                                 GSpawnFlags(G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD),
+-                                 NULL, /* child_setup */
+-                                 NULL, /* child_setup's user_data */
+-                                 &(data->child_pid),
+-                                 NULL, /* gint *stdin_fd */
+-                                 &(data->child_stdout_fd),
+-                                 &(data->child_stderr_fd),
+-                                 &error))
+-    {
+-      g_prefix_error (&error, "Error spawning: ");
+-      g_simple_async_result_take_error (data->simple, error);
+-      g_simple_async_result_complete_in_idle (data->simple);
+-      g_object_unref (data->simple);
+-      goto out;
+-    }
+-
+-  if (timeout_seconds > 0)
+-    {
+-      data->timeout_source = g_timeout_source_new_seconds (timeout_seconds);
+-      g_source_set_priority (data->timeout_source, G_PRIORITY_DEFAULT);
+-      g_source_set_callback (data->timeout_source, utils_timeout_cb, data, NULL);
+-      g_source_attach (data->timeout_source, data->main_context);
+-      g_source_unref (data->timeout_source);
+-    }
+-
+-  data->child_watch_source = g_child_watch_source_new (data->child_pid);
+-  g_source_set_callback (data->child_watch_source, (GSourceFunc) utils_child_watch_cb, data, NULL);
+-  g_source_attach (data->child_watch_source, data->main_context);
+-  g_source_unref (data->child_watch_source);
+-
+-  data->child_stdout_channel = g_io_channel_unix_new (data->child_stdout_fd);
+-  g_io_channel_set_flags (data->child_stdout_channel, G_IO_FLAG_NONBLOCK, NULL);
+-  data->child_stdout_source = g_io_create_watch (data->child_stdout_channel, G_IO_IN);
+-  g_source_set_callback (data->child_stdout_source, (GSourceFunc) utils_read_child_stdout, data, NULL);
+-  g_source_attach (data->child_stdout_source, data->main_context);
+-  g_source_unref (data->child_stdout_source);
+-
+-  data->child_stderr_channel = g_io_channel_unix_new (data->child_stderr_fd);
+-  g_io_channel_set_flags (data->child_stderr_channel, G_IO_FLAG_NONBLOCK, NULL);
+-  data->child_stderr_source = g_io_create_watch (data->child_stderr_channel, G_IO_IN);
+-  g_source_set_callback (data->child_stderr_source, (GSourceFunc) utils_read_child_stderr, data, NULL);
+-  g_source_attach (data->child_stderr_source, data->main_context);
+-  g_source_unref (data->child_stderr_source);
+-
+- out:
+-  ;
+-}
+-
+-gboolean
+-utils_spawn_finish (GAsyncResult   *res,
+-                    gint           *out_exit_status,
+-                    gchar         **out_standard_output,
+-                    gchar         **out_standard_error,
+-                    GError        **error)
+-{
+-  GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
+-  UtilsSpawnData *data;
+-  gboolean ret = FALSE;
+-
+-  g_return_val_if_fail (G_IS_ASYNC_RESULT (res), FALSE);
+-  g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+-
+-  g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == utils_spawn);
+-
+-  if (g_simple_async_result_propagate_error (simple, error))
+-    goto out;
+-
+-  data = (UtilsSpawnData*)g_simple_async_result_get_op_res_gpointer (simple);
+-
+-  if (data->timed_out)
+-    {
+-      g_set_error (error,
+-                   G_IO_ERROR,
+-                   G_IO_ERROR_TIMED_OUT,
+-                   "Timed out after %d seconds",
+-                   data->timeout_seconds);
+-      goto out;
+-    }
+-
+-  if (out_exit_status != NULL)
+-    *out_exit_status = data->exit_status;
+-
+-  if (out_standard_output != NULL)
+-    *out_standard_output = g_strdup (data->child_stdout->str);
+-
+-  if (out_standard_error != NULL)
+-    *out_standard_error = g_strdup (data->child_stderr->str);
+-
+-  ret = TRUE;
+-
+- out:
+-  return ret;
+-}
+-- 
+GitLab
+
+
+From 4858128107be9c3ab11828ee8f35c5e26efd36ce Mon Sep 17 00:00:00 2001
+From: Gustavo Lima Chaves <gustavo.chaves@microsoft.com>
+Date: Tue, 14 Sep 2021 14:38:15 -0700
+Subject: [PATCH 15/16] Gitlab CI: add duktape pkgconfig dependency
+
+Make way for the CI to be able to build with duktape too
+
+Signed-off-by: Gustavo Lima Chaves <gustavo.chaves@microsoft.com>
+---
+ .gitlab-ci.yml | 1 +
+ 1 file changed, 1 insertion(+)
+
+GitLab
+
+
+From cd5d6da837fce95f8831a355dad88c83347c7337 Mon Sep 17 00:00:00 2001
+From: Gustavo Lima Chaves <gustavo.chaves@microsoft.com>
+Date: Mon, 20 Sep 2021 17:17:26 -0700
+Subject: [PATCH 16/16] duktape: implement runaway scripts killer timeout
+
+This was missing on Duktape's JS backend proposal, now in. As
+discussed in
+https://gitlab.freedesktop.org/polkit/polkit/-/merge_requests/35 and
+verified by the commit author, Duktape has no interrupt injection
+mechanism (it has no thread-safe API entry whatsoever, even). Using
+DUK_USE_EXEC_TIMEOUT_CHECK is also not feasible, because:
+
+  i) It must be enabled at build time and shared object builds of the
+  lib on distros go with the default options, something we cannot
+  change/control
+
+  ii) That does not account for non-ECMAScript explicit execution
+  contexts, like regex execution, native C calls, etc.
+
+It has been agreed, on that thread, that pthread_cond_timedwait()-ing
+and having proper Duktape evaluation/execution calls take place in a
+separate thread, to be killed after the runaway script killer's
+accorded timeout value, a reasonable approach. We have considered
+using glib wrappers for direct pthread usage, but that way would make
+it impossible to issue
+pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, ...) and we want to
+be paranoid in that regard.
+
+On Duktape, we don't get to err from the JS context (to be captured by
+the offending script), but to be forcibly killed on timeout scenarios,
+leading to null returns, thus polkit negation, by definition. It's a
+reasonable design/compromise.
+
+A fatal error handler routine, for the Duktape context, has also been
+added, using the polkit_backend_authority_log() logging infra to
+better assist users on what went wrong.
+
+Finally, the script evaluation routine has been made to use
+duk_peval_lstring() (previously using _noresult variant), so to able
+to present the user with proper error messages, should any occur.
+
+The original runaway script killer test has been adjusted to please
+both JS backends.
+
+Signed-off-by: Gustavo Lima Chaves <gustavo.chaves@microsoft.com>
+---
+ meson.build                                   |   1 +
+ src/polkitbackend/meson.build                 |   1 +
+ src/polkitbackend/polkitbackendcommon.h       |   2 +
+ .../polkitbackendduktapeauthority.c           | 236 ++++++++++++++----
+ .../polkitbackendjsauthority.cpp              |  10 +-
+ .../etc/polkit-1/rules.d/10-testing.rules     |   6 +-
+ .../test-polkitbackendjsauthority.c           |   2 +-
+ 7 files changed, 209 insertions(+), 49 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index 4e44723..46956e3 100644
+--- a/meson.build
++++ b/meson.build
+@@ -137,6 +137,7 @@ js_engine = get_option('js_engine')
+ if js_engine == 'duktape'
+   js_dep = dependency('duktape')
+   libm_dep = cc.find_library('m')
++  libpthread_dep = cc.find_library('pthread')
+ elif js_engine == 'mozjs'
+   js_dep = dependency('mozjs-78')
+ endif
+diff --git a/src/polkitbackend/meson.build b/src/polkitbackend/meson.build
+index 9ec01b2..4dfea39 100644
+--- a/src/polkitbackend/meson.build
++++ b/src/polkitbackend/meson.build
+@@ -34,6 +34,7 @@ c_flags = [
+ if js_engine == 'duktape'
+   sources += files('polkitbackendduktapeauthority.c')
+   deps += libm_dep
++  deps += libpthread_dep
+ elif js_engine == 'mozjs'
+   sources += files('polkitbackendjsauthority.cpp')
+ endif
+diff --git a/src/polkitbackend/polkitbackendcommon.h b/src/polkitbackend/polkitbackendcommon.h
+index 6d0d267..dd700fc 100644
+--- a/src/polkitbackend/polkitbackendcommon.h
++++ b/src/polkitbackend/polkitbackendcommon.h
+@@ -50,6 +50,8 @@
+ #include <systemd/sd-login.h>
+ #endif /* HAVE_LIBSYSTEMD */
+ 
++#define RUNAWAY_KILLER_TIMEOUT (15)
++
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+diff --git a/src/polkitbackend/polkitbackendduktapeauthority.c b/src/polkitbackend/polkitbackendduktapeauthority.c
+index a2b4420..80f1976 100644
+--- a/src/polkitbackend/polkitbackendduktapeauthority.c
++++ b/src/polkitbackend/polkitbackendduktapeauthority.c
+@@ -47,8 +47,20 @@ struct _PolkitBackendJsAuthorityPrivate
+   GFileMonitor **dir_monitors; /* NULL-terminated array of GFileMonitor instances */
+ 
+   duk_context *cx;
++
++  pthread_t runaway_killer_thread;
++};
++
++enum
++{
++  RUNAWAY_KILLER_THREAD_EXIT_STATUS_UNSET,
++  RUNAWAY_KILLER_THREAD_EXIT_STATUS_SUCCESS,
++  RUNAWAY_KILLER_THREAD_EXIT_STATUS_FAILURE,
+ };
+ 
++static gboolean execute_script_with_runaway_killer(PolkitBackendJsAuthority *authority,
++                                                   const gchar *filename);
++
+ /* ---------------------------------------------------------------------------------------------------- */
+ 
+ G_DEFINE_TYPE (PolkitBackendJsAuthority, polkit_backend_js_authority, POLKIT_BACKEND_TYPE_INTERACTIVE_AUTHORITY);
+@@ -67,6 +79,15 @@ static const duk_function_list_entry js_polkit_functions[] =
+   { NULL, NULL, 0 },
+ };
+ 
++static void report_error (void     *udata,
++                          const char *msg)
++{
++    PolkitBackendJsAuthority *authority = udata;
++    polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority),
++                                  "fatal Duktape JS backend error: %s",
++                                  (msg ? msg : "no message"));
++}
++
+ static void
+ polkit_backend_js_authority_init (PolkitBackendJsAuthority *authority)
+ {
+@@ -78,7 +99,6 @@ polkit_backend_js_authority_init (PolkitBackendJsAuthority *authority)
+ static void
+ load_scripts (PolkitBackendJsAuthority  *authority)
+ {
+-  duk_context *cx = authority->priv->cx;
+   GList *files = NULL;
+   GList *l;
+   guint num_scripts = 0;
+@@ -123,36 +143,9 @@ load_scripts (PolkitBackendJsAuthority  *authority)
+   for (l = files; l != NULL; l = l->next)
+     {
+       const gchar *filename = (gchar *)l->data;
+-#if (DUK_VERSION >= 20000)
+-      GFile *file = g_file_new_for_path (filename);
+-      char *contents;
+-      gsize len;
+-      if (!g_file_load_contents (file, NULL, &contents, &len, NULL, NULL))
+-        {
+-          polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority),
+-                                        "Error compiling script %s",
+-                                        filename);
+-          g_object_unref (file);
+-          continue;
+-        }
+ 
+-      g_object_unref (file);
+-      if (duk_peval_lstring_noresult(cx, contents,len) != 0)
+-#else
+-      if (duk_peval_file_noresult (cx, filename) != 0)
+-#endif
+-        {
+-          polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority),
+-                                        "Error compiling script %s: %s",
+-                                        filename, duk_safe_to_string (authority->priv->cx, -1));
+-#if (DUK_VERSION >= 20000)
+-          g_free (contents);
+-#endif
++      if (!execute_script_with_runaway_killer(authority, filename))
+           continue;
+-        }
+-#if (DUK_VERSION >= 20000)
+-      g_free (contents);
+-#endif
+       num_scripts++;
+     }
+ 
+@@ -232,7 +225,7 @@ polkit_backend_common_js_authority_constructed (GObject *object)
+   PolkitBackendJsAuthority *authority = POLKIT_BACKEND_JS_AUTHORITY (object);
+   duk_context *cx;
+ 
+-  cx = duk_create_heap (NULL, NULL, NULL, authority, NULL);
++  cx = duk_create_heap (NULL, NULL, NULL, authority, report_error);
+   if (cx == NULL)
+     goto fail;
+ 
+@@ -243,6 +236,9 @@ polkit_backend_common_js_authority_constructed (GObject *object)
+   duk_put_function_list (cx, -1, js_polkit_functions);
+   duk_put_prop_string (cx, -2, "polkit");
+ 
++  /* load polkit objects/functions into JS context (e.g. addRule(),
++   * _deleteRules(), _runRules() et al)
++   */
+   duk_eval_string (cx, init_js);
+ 
+   if (authority->priv->rules_dirs == NULL)
+@@ -510,6 +506,167 @@ push_action_and_details (duk_context               *cx,
+ 
+ /* ---------------------------------------------------------------------------------------------------- */
+ 
++typedef struct {
++  PolkitBackendJsAuthority *authority;
++  const gchar *filename;
++  pthread_cond_t cond;
++  pthread_mutex_t mutex;
++  gint ret;
++} RunawayKillerCtx;
++
++static gpointer
++runaway_killer_thread_execute_js (gpointer user_data)
++{
++  RunawayKillerCtx *ctx = user_data;
++  duk_context *cx = ctx->authority->priv->cx;
++
++  int oldtype;
++
++  pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldtype);
++
++#if (DUK_VERSION >= 20000)
++  GFile *file = g_file_new_for_path(ctx->filename);
++  char *contents;
++  gsize len;
++
++  if (!g_file_load_contents(file, NULL, &contents, &len, NULL, NULL)) {
++    polkit_backend_authority_log(POLKIT_BACKEND_AUTHORITY(ctx->authority),
++                                 "Error compiling script %s", ctx->filename);
++    g_object_unref(file);
++    goto err;
++  }
++
++  g_object_unref(file);
++
++  /* evaluate the script, trying to print context in any syntax errors
++     found */
++  if (duk_peval_lstring(cx, contents, len) != 0)
++#else
++  if (duk_peval_file(cx, ctx->filename) != 0)
++#endif
++  {
++    polkit_backend_authority_log(POLKIT_BACKEND_AUTHORITY(ctx->authority),
++                                 "Error compiling script %s: %s", ctx->filename,
++                                 duk_safe_to_string(cx, -1));
++    duk_pop(cx);
++    goto free_err;
++  }
++#if (DUK_VERSION >= 20000)
++  g_free(contents);
++#endif
++
++  ctx->ret = RUNAWAY_KILLER_THREAD_EXIT_STATUS_SUCCESS;
++  goto end;
++
++free_err:
++#if (DUK_VERSION >= 20000)
++  g_free(contents);
++#endif
++err:
++  ctx->ret = RUNAWAY_KILLER_THREAD_EXIT_STATUS_FAILURE;
++end:
++  pthread_cond_signal(&ctx->cond);
++  return NULL;
++}
++
++static gpointer
++runaway_killer_thread_call_js (gpointer user_data)
++{
++  RunawayKillerCtx *ctx = user_data;
++  duk_context *cx = ctx->authority->priv->cx;
++  int oldtype;
++
++  pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldtype);
++
++  if (duk_pcall_prop (cx, 0, 2) != DUK_EXEC_SUCCESS)
++    {
++      polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (ctx->authority),
++                                    "Error evaluating admin rules: ",
++                                    duk_safe_to_string (cx, -1));
++      goto err;
++    }
++
++  ctx->ret = RUNAWAY_KILLER_THREAD_EXIT_STATUS_SUCCESS;
++  goto end;
++
++err:
++  ctx->ret = RUNAWAY_KILLER_THREAD_EXIT_STATUS_FAILURE;
++end:
++  pthread_cond_signal(&ctx->cond);
++  return NULL;
++}
++
++/* Blocking for at most for RUNAWAY_KILLER_TIMEOUT */
++static gboolean
++execute_script_with_runaway_killer(PolkitBackendJsAuthority *authority,
++                                   const gchar *filename)
++{
++  gint64 end_time;
++  gboolean cancel = FALSE;
++  RunawayKillerCtx ctx = {.authority = authority, .filename = filename,
++                          .ret = RUNAWAY_KILLER_THREAD_EXIT_STATUS_UNSET,
++                          .mutex = PTHREAD_MUTEX_INITIALIZER,
++                          .cond = PTHREAD_COND_INITIALIZER};
++  struct timespec abs_time;
++
++  pthread_mutex_lock(&ctx.mutex);
++
++  clock_gettime(CLOCK_REALTIME, &abs_time);
++  abs_time.tv_sec += RUNAWAY_KILLER_TIMEOUT;
++
++  pthread_create(&authority->priv->runaway_killer_thread, NULL, runaway_killer_thread_execute_js, &ctx);
++
++  while (ctx.ret == RUNAWAY_KILLER_THREAD_EXIT_STATUS_UNSET) /* loop to treat spurious wakeups */
++    if (pthread_cond_timedwait(&ctx.cond, &ctx.mutex, &abs_time) == ETIMEDOUT) {
++      cancel = TRUE;
++      break;
++    }
++
++  pthread_mutex_unlock(&ctx.mutex);
++
++  if (cancel)
++    pthread_cancel (authority->priv->runaway_killer_thread);
++  pthread_join (authority->priv->runaway_killer_thread, NULL);
++
++  return ctx.ret == RUNAWAY_KILLER_THREAD_EXIT_STATUS_SUCCESS;
++}
++
++/* Calls already stacked function and args. Blocking for at most for
++ * RUNAWAY_KILLER_TIMEOUT
++ */
++static gboolean
++call_js_function_with_runaway_killer(PolkitBackendJsAuthority *authority)
++{
++  gint64 end_time;
++  gboolean cancel = FALSE;
++  RunawayKillerCtx ctx = {.authority = authority,
++                          .ret = RUNAWAY_KILLER_THREAD_EXIT_STATUS_UNSET,
++                          .mutex = PTHREAD_MUTEX_INITIALIZER,
++                          .cond = PTHREAD_COND_INITIALIZER};
++  struct timespec abs_time;
++
++  pthread_mutex_lock(&ctx.mutex);
++
++  clock_gettime(CLOCK_REALTIME, &abs_time);
++  abs_time.tv_sec += RUNAWAY_KILLER_TIMEOUT;
++
++  pthread_create(&authority->priv->runaway_killer_thread, NULL, runaway_killer_thread_call_js, &ctx);
++
++  while (ctx.ret == RUNAWAY_KILLER_THREAD_EXIT_STATUS_UNSET) /* loop to treat spurious wakeups */
++    if (pthread_cond_timedwait(&ctx.cond, &ctx.mutex, &abs_time) == ETIMEDOUT) {
++      cancel = TRUE;
++      break;
++    }
++
++  pthread_mutex_unlock(&ctx.mutex);
++
++  if (cancel)
++    pthread_cancel (authority->priv->runaway_killer_thread);
++  pthread_join (authority->priv->runaway_killer_thread, NULL);
++
++  return ctx.ret == RUNAWAY_KILLER_THREAD_EXIT_STATUS_SUCCESS;
++}
++
+ /* ---------------------------------------------------------------------------------------------------- */
+ 
+ GList *
+@@ -557,13 +714,8 @@ polkit_backend_common_js_authority_get_admin_auth_identities (PolkitBackendInter
+       goto out;
+     }
+ 
+-  if (duk_pcall_prop (cx, 0, 2) != DUK_ERR_NONE)
+-    {
+-      polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority),
+-                                    "Error evaluating admin rules: ",
+-                                    duk_safe_to_string (cx, -1));
+-      goto out;
+-    }
++  if (!call_js_function_with_runaway_killer (authority))
++    goto out;
+ 
+   ret_str = duk_require_string (cx, -1);
+ 
+@@ -643,15 +795,11 @@ polkit_backend_common_js_authority_check_authorization_sync (PolkitBackendIntera
+       goto out;
+     }
+ 
+-  if (duk_pcall_prop (cx, 0, 2) != DUK_ERR_NONE)
+-  {
+-      polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority),
+-                                    "Error evaluating authorization rules: ",
+-                                    duk_safe_to_string (cx, -1));
+-      goto out;
+-  }
++  if (!call_js_function_with_runaway_killer (authority))
++    goto out;
+ 
+   if (duk_is_null(cx, -1)) {
++    /* this fine, means there was no match, use implicit authorizations */
+     good = TRUE;
+     goto out;
+   }
+diff --git a/src/polkitbackend/polkitbackendjsauthority.cpp b/src/polkitbackend/polkitbackendjsauthority.cpp
+index e28091d..11e91c0 100644
+--- a/src/polkitbackend/polkitbackendjsauthority.cpp
++++ b/src/polkitbackend/polkitbackendjsauthority.cpp
+@@ -829,11 +829,14 @@ runaway_killer_setup (PolkitBackendJsAuthority *authority)
+ {
+   g_assert (authority->priv->rkt_source == NULL);
+ 
+-  /* set-up timer for runaway scripts, will be executed in runaway_killer_thread */
++  /* set-up timer for runaway scripts, will be executed in
++     runaway_killer_thread, that is one, permanent thread running a glib
++     mainloop (rkt_loop) whose context (rkt_context) has a timeout source
++     (rkt_source) */
+   g_mutex_lock (&authority->priv->rkt_timeout_pending_mutex);
+   authority->priv->rkt_timeout_pending = FALSE;
+   g_mutex_unlock (&authority->priv->rkt_timeout_pending_mutex);
+-  authority->priv->rkt_source = g_timeout_source_new_seconds (15);
++  authority->priv->rkt_source = g_timeout_source_new_seconds (RUNAWAY_KILLER_TIMEOUT);
+   g_source_set_callback (authority->priv->rkt_source, rkt_on_timeout, authority, NULL);
+   g_source_attach (authority->priv->rkt_source, authority->priv->rkt_context);
+ 
+@@ -893,6 +896,9 @@ execute_script_with_runaway_killer (PolkitBackendJsAuthority *authority,
+ {
+   bool ret;
+ 
++  // tries to JS_ExecuteScript(), may hang for > RUNAWAY_KILLER_TIMEOUT,
++  // runaway_killer_thread makes sure the call returns, due to exception
++  // injection
+   runaway_killer_setup (authority);
+   ret = JS_ExecuteScript (authority->priv->cx,
+                           script,
+diff --git a/test/data/etc/polkit-1/rules.d/10-testing.rules b/test/data/etc/polkit-1/rules.d/10-testing.rules
+index 98bf062..e346b5d 100644
+--- a/test/data/etc/polkit-1/rules.d/10-testing.rules
++++ b/test/data/etc/polkit-1/rules.d/10-testing.rules
+@@ -189,8 +189,10 @@ polkit.addRule(function(action, subject) {
+                 ;
+         } catch (error) {
+             if (error == "Terminating runaway script")
+-                return polkit.Result.YES;
+-            return polkit.Result.NO;
++                // Inverted logic to accomodate Duktape's model as well, which
++                // will always fail with negation, on timeouts
++                return polkit.Result.NO;
++            return polkit.Result.YES;
+         }
+     }
+ });
+diff --git a/test/polkitbackend/test-polkitbackendjsauthority.c b/test/polkitbackend/test-polkitbackendjsauthority.c
+index f97e0e0..2103b17 100644
+--- a/test/polkitbackend/test-polkitbackendjsauthority.c
++++ b/test/polkitbackend/test-polkitbackendjsauthority.c
+@@ -328,7 +328,7 @@ static const RulesTestCase rules_test_cases[] = {
+     "net.company.run_away_script",
+     "unix-user:root",
+     NULL,
+-    POLKIT_IMPLICIT_AUTHORIZATION_AUTHORIZED,
++    POLKIT_IMPLICIT_AUTHORIZATION_NOT_AUTHORIZED,
+   },
+ 
+   {
+-- 
+GitLab
+
diff --git a/gnu/packages/patches/ppsspp-disable-upgrade-and-gold.patch b/gnu/packages/patches/ppsspp-disable-upgrade-and-gold.patch
index 3a5ae1a2cd..93996b52a7 100644
--- a/gnu/packages/patches/ppsspp-disable-upgrade-and-gold.patch
+++ b/gnu/packages/patches/ppsspp-disable-upgrade-and-gold.patch
@@ -1,4 +1,4 @@
-From 942730ce7148cd54a30d4a606ce71a2654c8a2e0 Mon Sep 17 00:00:00 2001
+From debc32a287209e1d1bb6fedb479bd923fd016399 Mon Sep 17 00:00:00 2001
 From: Liliana Marie Prikler <liliana.prikler@gmail.com>
 Date: Sat, 5 Jun 2021 22:47:00 -0400
 Subject: [PATCH] ppsspp: Remove upgrade code and gold support.
@@ -6,27 +6,46 @@ Subject: [PATCH] ppsspp: Remove upgrade code and gold support.
 Original patch from Liliana Marie Prikler.
 Rebased on master (commit 69fa20744958aef8da9ca052ba7675fdc1636e46) by
 Maxim Cournoyer.
+Revised once again by Liliana Marie Prikler for version 1.12.3.
 ---
- Core/Config.cpp             | 11 ------
+ Common/System/System.h      |  1 -
+ Core/Config.cpp             | 12 -------
  Core/Config.h               |  2 --
  Qt/QtMain.cpp               |  6 ----
+ Qt/mainwindow.cpp           |  6 ----
+ Qt/mainwindow.h             |  1 -
  SDL/SDLMain.cpp             |  6 ----
  UI/DevScreens.cpp           |  3 --
- UI/GameSettingsScreen.cpp   |  2 --
+ UI/GameSettingsScreen.cpp   |  4 +--
  UI/MainScreen.cpp           | 70 +------------------------------------
+ UI/MemStickScreen.cpp       |  8 -----
  UI/MiscScreens.cpp          | 31 ++--------------
  UWP/PPSSPP_UWPMain.cpp      |  6 ----
- Windows/MainWindowMenu.cpp  |  2 +-
+ Windows/MainWindowMenu.cpp  |  8 +----
+ Windows/WindowsHost.cpp     |  4 ---
  Windows/main.cpp            |  6 ----
+ Windows/resource.h          |  1 -
  android/jni/app-android.cpp |  6 ----
  ios/main.mm                 |  6 ----
- 13 files changed, 5 insertions(+), 152 deletions(-)
+ 19 files changed, 6 insertions(+), 181 deletions(-)
 
+diff --git a/Common/System/System.h b/Common/System/System.h
+index 09560191e..5df68a120 100644
+--- a/Common/System/System.h
++++ b/Common/System/System.h
+@@ -83,7 +83,6 @@ enum SystemProperty {
+ 	SYSPROP_DISPLAY_SAFE_INSET_BOTTOM,
+ 
+ 	SYSPROP_DEVICE_TYPE,
+-	SYSPROP_APP_GOLD,  // To avoid having #ifdef GOLD other than in main.cpp and similar.
+ 
+ 	// Exposed on Android. Choosing the optimal sample rate for audio
+ 	// will result in lower latencies. Buffer size is automatically matched
 diff --git a/Core/Config.cpp b/Core/Config.cpp
-index 74be99d75..b14aa22c7 100644
+index 305098f47..9c28a3315 100644
 --- a/Core/Config.cpp
 +++ b/Core/Config.cpp
-@@ -467,7 +467,6 @@ static ConfigSetting generalSettings[] = {
+@@ -512,7 +512,6 @@ static ConfigSetting generalSettings[] = {
  	ConfigSetting("IgnoreBadMemAccess", &g_Config.bIgnoreBadMemAccess, true, true),
  	ConfigSetting("CurrentDirectory", &g_Config.currentDirectory, ""),
  	ConfigSetting("ShowDebuggerOnLoad", &g_Config.bShowDebuggerOnLoad, false),
@@ -34,7 +53,7 @@ index 74be99d75..b14aa22c7 100644
  	ConfigSetting("Language", &g_Config.sLanguageIni, &DefaultLangRegion),
  	ConfigSetting("ForceLagSync2", &g_Config.bForceLagSync, false, true, true),
  	ConfigSetting("DiscordPresence", &g_Config.bDiscordPresence, true, true, false),  // Or maybe it makes sense to have it per-game? Race conditions abound...
-@@ -1323,16 +1322,6 @@ void Config::Load(const char *iniFileName, const char *controllerIniFilename) {
+@@ -1395,17 +1394,6 @@ void Config::Load(const char *iniFileName, const char *controllerIniFilename) {
  		upgradeMessage = "";
  	}
  
@@ -43,8 +62,9 @@ index 74be99d75..b14aa22c7 100644
 -	// splash screen quickly), but then we'll just show the notification next time instead, we store the
 -	// upgrade number in the ini.
 -	if (iRunCount % 10 == 0 && bCheckForNewVersion) {
--		std::shared_ptr<http::Download> dl = g_DownloadManager.StartDownloadWithCallback(
--			"http://www.ppsspp.org/version.json", Path(), &DownloadCompletedCallback);
+-		const char *versionUrl = "http://www.ppsspp.org/version.json";
+-		const char *acceptMime = "application/json, text/*; q=0.9, */*; q=0.8";
+-		auto dl = g_DownloadManager.StartDownloadWithCallback(versionUrl, Path(), &DownloadCompletedCallback, acceptMime);
 -		dl->SetHidden(true);
 -	}
 -
@@ -52,10 +72,10 @@ index 74be99d75..b14aa22c7 100644
  	bSaveSettings = true;
  
 diff --git a/Core/Config.h b/Core/Config.h
-index 79323eefc..d47bec0c7 100644
+index 7bbbf2798..1bc1c2296 100644
 --- a/Core/Config.h
 +++ b/Core/Config.h
-@@ -103,7 +103,6 @@ struct Config {
+@@ -109,7 +109,6 @@ struct Config {
  
  	bool bFastMemory;
  	int iCpuCore;
@@ -63,7 +83,7 @@ index 79323eefc..d47bec0c7 100644
  	bool bForceLagSync;
  	bool bFuncReplacements;
  	bool bHideSlowWarnings;
-@@ -542,4 +541,3 @@ std::string CreateRandMAC();
+@@ -562,4 +561,3 @@ std::string CreateRandMAC();
  // TODO: Find a better place for this.
  extern http::Downloader g_DownloadManager;
  extern Config g_Config;
@@ -85,6 +105,42 @@ index b642f7442..a880d7c94 100644
  	case SYSPROP_CAN_JIT:
  		return true;
  	default:
+diff --git a/Qt/mainwindow.cpp b/Qt/mainwindow.cpp
+index 1f56e0e76..0b7680427 100644
+--- a/Qt/mainwindow.cpp
++++ b/Qt/mainwindow.cpp
+@@ -413,11 +413,6 @@ void MainWindow::forumAct()
+ 	QDesktopServices::openUrl(QUrl("https://forums.ppsspp.org/"));
+ }
+ 
+-void MainWindow::goldAct()
+-{
+-	QDesktopServices::openUrl(QUrl("https://central.ppsspp.org/buygold"));
+-}
+-
+ void MainWindow::gitAct()
+ {
+ 	QDesktopServices::openUrl(QUrl("https://github.com/hrydgard/ppsspp/"));
+@@ -666,7 +661,6 @@ void MainWindow::createMenus()
+ 	MenuTree* helpMenu = new MenuTree(this, menuBar(),    QT_TR_NOOP("&Help"));
+ 	helpMenu->add(new MenuAction(this, SLOT(websiteAct()),    QT_TR_NOOP("Visit www.&ppsspp.org")));
+ 	helpMenu->add(new MenuAction(this, SLOT(forumAct()),      QT_TR_NOOP("PPSSPP &forums")));
+-	helpMenu->add(new MenuAction(this, SLOT(goldAct()),       QT_TR_NOOP("Buy &Gold")));
+ 	helpMenu->add(new MenuAction(this, SLOT(gitAct()),        QT_TR_NOOP("Git&Hub")));
+ 	helpMenu->add(new MenuAction(this, SLOT(discordAct()),      QT_TR_NOOP("Discord")));
+ 	helpMenu->addSeparator();
+diff --git a/Qt/mainwindow.h b/Qt/mainwindow.h
+index 99c9fc3ad..8cd6cbf79 100644
+--- a/Qt/mainwindow.h
++++ b/Qt/mainwindow.h
+@@ -197,7 +197,6 @@ private slots:
+ 	// Help
+ 	void websiteAct();
+ 	void forumAct();
+-	void goldAct();
+ 	void gitAct();
+ 	void discordAct();
+ 	void aboutAct();
 diff --git a/SDL/SDLMain.cpp b/SDL/SDLMain.cpp
 index f0f74f979..f963f36e9 100644
 --- a/SDL/SDLMain.cpp
@@ -103,10 +159,10 @@ index f0f74f979..f963f36e9 100644
  		return true;
  	default:
 diff --git a/UI/DevScreens.cpp b/UI/DevScreens.cpp
-index 29baf2f2e..926692363 100644
+index 389fdf096..8442ee8c6 100644
 --- a/UI/DevScreens.cpp
 +++ b/UI/DevScreens.cpp
-@@ -635,9 +635,6 @@ void SystemInfoScreen::CreateViews() {
+@@ -649,9 +649,6 @@ void SystemInfoScreen::CreateViews() {
  #ifdef _M_SSE
  	buildConfig->Add(new InfoItem("_M_SSE", StringFromFormat("0x%x", _M_SSE)));
  #endif
@@ -117,23 +173,32 @@ index 29baf2f2e..926692363 100644
  	ViewGroup *cpuExtensionsScroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, FILL_PARENT));
  	cpuExtensionsScroll->SetTag("DevSystemInfoCPUExt");
 diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp
-index 393e33cd9..d07d00d45 100644
+index 99fb151b9..90f26d5dc 100644
 --- a/UI/GameSettingsScreen.cpp
 +++ b/UI/GameSettingsScreen.cpp
-@@ -922,8 +922,6 @@ void GameSettingsScreen::CreateViews() {
+@@ -1023,7 +1023,6 @@ void GameSettingsScreen::CreateViews() {
  		}
  	}
  #endif
 -	systemSettings->Add(new CheckBox(&g_Config.bCheckForNewVersion, sy->T("VersionCheck", "Check for new versions of PPSSPP")));
--
+ 
  	systemSettings->Add(new Choice(sy->T("Restore Default Settings")))->OnClick.Handle(this, &GameSettingsScreen::OnRestoreDefaultSettings);
  	systemSettings->Add(new CheckBox(&g_Config.bEnableStateUndo, sy->T("Savestate slot backups")));
- 	static const char *autoLoadSaveStateChoices[] = { "Off", "Oldest Save", "Newest Save", "Slot 1", "Slot 2", "Slot 3", "Slot 4", "Slot 5" };
+@@ -2076,8 +2075,7 @@ void GestureMappingScreen::CreateViews() {
+ 	vert->Add(new PopupMultiChoice(&g_Config.iSwipeRight, mc->T("Swipe Right"), gestureButton, 0, ARRAY_SIZE(gestureButton), mc->GetName(), screenManager()))->SetEnabledPtr(&g_Config.bGestureControlEnabled);
+ 	vert->Add(new PopupSliderChoiceFloat(&g_Config.fSwipeSensitivity, 0.01f, 1.0f, co->T("Swipe sensitivity"), 0.01f, screenManager(), "x"))->SetEnabledPtr(&g_Config.bGestureControlEnabled);
+ 	vert->Add(new PopupSliderChoiceFloat(&g_Config.fSwipeSmoothing, 0.0f, 0.95f, co->T("Swipe smoothing"), 0.05f, screenManager(), "x"))->SetEnabledPtr(&g_Config.bGestureControlEnabled);
+-	
++
+ 	vert->Add(new ItemHeader(co->T("Double tap")));
+ 	vert->Add(new PopupMultiChoice(&g_Config.iDoubleTapGesture, mc->T("Double tap button"), gestureButton, 0, ARRAY_SIZE(gestureButton), mc->GetName(), screenManager()))->SetEnabledPtr(&g_Config.bGestureControlEnabled);
+ }
+-
 diff --git a/UI/MainScreen.cpp b/UI/MainScreen.cpp
-index f88509276..51b21b640 100644
+index 4e86ac1ab..be49c3add 100644
 --- a/UI/MainScreen.cpp
 +++ b/UI/MainScreen.cpp
-@@ -1080,11 +1080,7 @@ void MainScreen::CreateViews() {
+@@ -1100,11 +1100,7 @@ void MainScreen::CreateViews() {
  	sprintf(versionString, "%s", PPSSPP_GIT_VERSION);
  	rightColumnItems->SetSpacing(0.0f);
  	AnchorLayout *logos = new AnchorLayout(new AnchorLayoutParams(FILL_PARENT, 60.0f, false));
@@ -146,19 +211,19 @@ index f88509276..51b21b640 100644
  	logos->Add(new ImageView(ImageID("I_LOGO"), "PPSSPP", IS_DEFAULT, new AnchorLayoutParams(180, 64, 64, -5.0f, NONE, NONE, false)));
  
  #if !defined(MOBILE_DEVICE)
-@@ -1107,11 +1103,6 @@ void MainScreen::CreateViews() {
+@@ -1127,11 +1123,6 @@ void MainScreen::CreateViews() {
  	rightColumnItems->Add(new Choice(mm->T("Game Settings", "Settings")))->OnClick.Handle(this, &MainScreen::OnGameSettings);
  	rightColumnItems->Add(new Choice(mm->T("Credits")))->OnClick.Handle(this, &MainScreen::OnCredits);
  	rightColumnItems->Add(new Choice(mm->T("www.ppsspp.org")))->OnClick.Handle(this, &MainScreen::OnPPSSPPOrg);
 -	if (!System_GetPropertyBool(SYSPROP_APP_GOLD)) {
 -		Choice *gold = rightColumnItems->Add(new Choice(mm->T("Buy PPSSPP Gold")));
 -		gold->OnClick.Handle(this, &MainScreen::OnSupport);
--		gold->SetIcon(ImageID("I_ICONGOLD"));
+-		gold->SetIcon(ImageID("I_ICONGOLD"), 0.5f);
 -	}
  
  #if !PPSSPP_PLATFORM(UWP)
  	// Having an exit button is against UWP guidelines.
-@@ -1136,32 +1127,6 @@ void MainScreen::CreateViews() {
+@@ -1156,32 +1147,6 @@ void MainScreen::CreateViews() {
  	} else if (tabHolder_->GetVisibility() != V_GONE) {
  		root_->SetDefaultFocusView(tabHolder_);
  	}
@@ -191,7 +256,7 @@ index f88509276..51b21b640 100644
  }
  
  UI::EventReturn MainScreen::OnAllowStorage(UI::EventParams &e) {
-@@ -1169,30 +1134,6 @@ UI::EventReturn MainScreen::OnAllowStorage(UI::EventParams &e) {
+@@ -1189,30 +1154,6 @@ UI::EventReturn MainScreen::OnAllowStorage(UI::EventParams &e) {
  	return UI::EVENT_DONE;
  }
  
@@ -222,7 +287,7 @@ index f88509276..51b21b640 100644
  void MainScreen::sendMessage(const char *message, const char *value) {
  	// Always call the base class method first to handle the most common messages.
  	UIScreenWithBackground::sendMessage(message, value);
-@@ -1396,15 +1337,6 @@ UI::EventReturn MainScreen::OnCredits(UI::EventParams &e) {
+@@ -1386,15 +1327,6 @@ UI::EventReturn MainScreen::OnCredits(UI::EventParams &e) {
  	return UI::EVENT_DONE;
  }
  
@@ -238,11 +303,47 @@ index f88509276..51b21b640 100644
  UI::EventReturn MainScreen::OnPPSSPPOrg(UI::EventParams &e) {
  	LaunchBrowser("https://www.ppsspp.org");
  	return UI::EVENT_DONE;
+diff --git a/UI/MemStickScreen.cpp b/UI/MemStickScreen.cpp
+index ef617c5b5..664614c62 100644
+--- a/UI/MemStickScreen.cpp
++++ b/UI/MemStickScreen.cpp
+@@ -157,23 +157,16 @@ static void AddExplanation(UI::ViewGroup *viewGroup, MemStickScreen::Choice choi
+ 	case MemStickScreen::CHOICE_STORAGE_ROOT:
+ 		// Old school choice
+ 		holder->Add(new TextView(iz->T("DataWillStay", "Data will stay even if you uninstall PPSSPP"), flags, false))->SetBullet(true);
+-		holder->Add(new TextView(iz->T("DataCanBeShared", "Data can be shared between PPSSPP regular/Gold"), flags, false))->SetBullet(true);
+ 		holder->Add(new TextView(iz->T("EasyUSBAccess", "Easy USB access"), flags, false))->SetBullet(true);
+ 		break;
+ 	case MemStickScreen::CHOICE_BROWSE_FOLDER:
+ 		holder->Add(new TextView(iz->T("DataWillStay", "Data will stay even if you uninstall PPSSPP"), flags, false))->SetBullet(true);
+-		holder->Add(new TextView(iz->T("DataCanBeShared", "Data can be shared between PPSSPP regular/Gold"), flags, false))->SetBullet(true);
+ 		holder->Add(new TextView(iz->T("EasyUSBAccess", "Easy USB access"), flags, false))->SetBullet(true);
+ 		break;
+ 	case MemStickScreen::CHOICE_PRIVATE_DIRECTORY:
+ 		// Consider https://www.compart.com/en/unicode/U+26A0 (unicode warning sign?)? or a graphic?
+ 		holder->Add(new TextView(iz->T("DataWillBeLostOnUninstall", "Warning! Data will be lost when you uninstall PPSSPP!"), flags, false))->SetBullet(true);
+-		holder->Add(new TextView(iz->T("DataCannotBeShared", "Data CANNOT be shared between PPSSPP regular/Gold!"), flags, false))->SetBullet(true);
+-#if GOLD
+-		holder->Add(new TextView(iz->T("USBAccessThroughGold", "USB access through Android/data/org.ppsspp.ppssppgold/files"), flags, false))->SetBullet(true);
+-#else
+ 		holder->Add(new TextView(iz->T("USBAccessThrough", "USB access through Android/data/org.ppsspp.ppsspp/files"), flags, false))->SetBullet(true);
+-#endif
+ 		break;
+ 	case MemStickScreen::CHOICE_SET_MANUAL:
+ 	default:
+@@ -243,7 +236,6 @@ void MemStickScreen::CreateViews() {
+ 	} else {
+ 		leftColumn->Add(new RadioButton(&choice_, CHOICE_SET_MANUAL, iz->T("Manually specify PSP folder")))->OnClick.Handle(this, &MemStickScreen::OnChoiceClick);
+ 		leftColumn->Add(new TextView(iz->T("DataWillStay", "Data will stay even if you uninstall PPSSPP.")))->SetBullet(true);
+-		leftColumn->Add(new TextView(iz->T("DataCanBeShared", "Data can be shared between PPSSPP regular/Gold.")))->SetBullet(true);
+ 		// TODO: Show current folder here if we have one set.
+ 	}
+ 	if (choice_ == CHOICE_BROWSE_FOLDER || choice_ == CHOICE_SET_MANUAL) {
 diff --git a/UI/MiscScreens.cpp b/UI/MiscScreens.cpp
-index 901a5fb09..9d067aee6 100644
+index 04e5df6c3..fb6c29725 100644
 --- a/UI/MiscScreens.cpp
 +++ b/UI/MiscScreens.cpp
-@@ -661,11 +661,7 @@ void LogoScreen::render() {
+@@ -769,11 +769,7 @@ void LogoScreen::render() {
  	char temp[256];
  	// Manually formatting UTF-8 is fun.  \xXX doesn't work everywhere.
  	snprintf(temp, sizeof(temp), "%s Henrik Rydg%c%crd", cr->T("created", "Created by"), 0xC3, 0xA5);
@@ -255,7 +356,7 @@ index 901a5fb09..9d067aee6 100644
  	dc.Draw()->DrawImage(ImageID("I_LOGO"), bounds.centerX() + 40, bounds.centerY() - 30, 1.5f, textColor, ALIGN_CENTER);
  	//dc.Draw()->DrawTextShadow(UBUNTU48, "PPSSPP", bounds.w / 2, bounds.h / 2 - 30, textColor, ALIGN_CENTER);
  	dc.SetFontScale(1.0f, 1.0f);
-@@ -701,10 +697,6 @@ void CreditsScreen::CreateViews() {
+@@ -809,10 +805,6 @@ void CreditsScreen::CreateViews() {
  	// Really need to redo this whole layout with some linear layouts...
  
  	int rightYOffset = 0;
@@ -266,7 +367,7 @@ index 901a5fb09..9d067aee6 100644
  	root_->Add(new Button(cr->T("PPSSPP Forums"), new AnchorLayoutParams(260, 64, 10, NONE, NONE, 158, false)))->OnClick.Handle(this, &CreditsScreen::OnForums);
  	root_->Add(new Button(cr->T("Discord"), new AnchorLayoutParams(260, 64, 10, NONE, NONE, 232, false)))->OnClick.Handle(this, &CreditsScreen::OnDiscord);
  	root_->Add(new Button("www.ppsspp.org", new AnchorLayoutParams(260, 64, 10, NONE, NONE, 10, false)))->OnClick.Handle(this, &CreditsScreen::OnPPSSPPOrg);
-@@ -713,20 +705,7 @@ void CreditsScreen::CreateViews() {
+@@ -821,20 +813,7 @@ void CreditsScreen::CreateViews() {
  #if PPSSPP_PLATFORM(ANDROID) || PPSSPP_PLATFORM(IOS)
  	root_->Add(new Button(cr->T("Share PPSSPP"), new AnchorLayoutParams(260, 64, NONE, NONE, 10, rightYOffset + 158, false)))->OnClick.Handle(this, &CreditsScreen::OnShare);
  #endif
@@ -288,7 +389,7 @@ index 901a5fb09..9d067aee6 100644
  }
  
  UI::EventReturn CreditsScreen::OnTwitter(UI::EventParams &e) {
-@@ -916,11 +895,7 @@ void CreditsScreen::render() {
+@@ -1024,11 +1003,7 @@ void CreditsScreen::render() {
  
  	// TODO: This is kinda ugly, done on every frame...
  	char temp[256];
@@ -319,10 +420,37 @@ index 29afda806..b7028fc0c 100644
  		return true;
  	default:
 diff --git a/Windows/MainWindowMenu.cpp b/Windows/MainWindowMenu.cpp
-index c0d790e06..e8de4f956 100644
+index 006fed4f4..4761171ff 100644
 --- a/Windows/MainWindowMenu.cpp
 +++ b/Windows/MainWindowMenu.cpp
-@@ -1395,7 +1395,7 @@ namespace MainWindow {
+@@ -136,7 +136,6 @@ namespace MainWindow {
+ 
+ 		const std::wstring visitMainWebsite = ConvertUTF8ToWString(des->T("www.ppsspp.org"));
+ 		const std::wstring visitForum = ConvertUTF8ToWString(des->T("PPSSPP Forums"));
+-		const std::wstring buyGold = ConvertUTF8ToWString(des->T("Buy Gold"));
+ 		const std::wstring gitHub = ConvertUTF8ToWString(des->T("GitHub"));
+ 		const std::wstring discord = ConvertUTF8ToWString(des->T("Discord"));
+ 		const std::wstring aboutPPSSPP = ConvertUTF8ToWString(des->T("About PPSSPP..."));
+@@ -147,7 +146,6 @@ namespace MainWindow {
+ 		AppendMenu(helpMenu, MF_STRING | MF_BYCOMMAND, ID_HELP_OPENWEBSITE, visitMainWebsite.c_str());
+ 		AppendMenu(helpMenu, MF_STRING | MF_BYCOMMAND, ID_HELP_OPENFORUM, visitForum.c_str());
+ 		// Repeat the process for other languages, if necessary.
+-		AppendMenu(helpMenu, MF_STRING | MF_BYCOMMAND, ID_HELP_BUYGOLD, buyGold.c_str());
+ 		AppendMenu(helpMenu, MF_STRING | MF_BYCOMMAND, ID_HELP_GITHUB, gitHub.c_str());
+ 		AppendMenu(helpMenu, MF_STRING | MF_BYCOMMAND, ID_HELP_DISCORD, discord.c_str());
+ 		AppendMenu(helpMenu, MF_SEPARATOR, 0, 0);
+@@ -1015,10 +1013,6 @@ namespace MainWindow {
+ 			ShellExecute(NULL, L"open", L"https://www.ppsspp.org/", NULL, NULL, SW_SHOWNORMAL);
+ 			break;
+ 
+-		case ID_HELP_BUYGOLD:
+-			ShellExecute(NULL, L"open", L"https://central.ppsspp.org/buygold", NULL, NULL, SW_SHOWNORMAL);
+-			break;
+-
+ 		case ID_HELP_OPENFORUM:
+ 			ShellExecute(NULL, L"open", L"https://forums.ppsspp.org/", NULL, NULL, SW_SHOWNORMAL);
+ 			break;
+@@ -1397,7 +1391,7 @@ namespace MainWindow {
  		{
  			W32Util::CenterWindow(hDlg);
  			HWND versionBox = GetDlgItem(hDlg, IDC_VERSION);
@@ -331,8 +459,24 @@ index c0d790e06..e8de4f956 100644
  			windowText.append(PPSSPP_GIT_VERSION);
  			SetWindowText(versionBox, ConvertUTF8ToWString(windowText).c_str());
  		}
+diff --git a/Windows/WindowsHost.cpp b/Windows/WindowsHost.cpp
+index 610b79890..3d5926fce 100644
+--- a/Windows/WindowsHost.cpp
++++ b/Windows/WindowsHost.cpp
+@@ -155,11 +155,7 @@ void WindowsHost::ShutdownGraphics() {
+ }
+ 
+ void WindowsHost::SetWindowTitle(const char *message) {
+-#ifdef GOLD
+-	const char *name = "PPSSPP Gold ";
+-#else
+ 	const char *name = "PPSSPP ";
+-#endif
+ 	std::wstring winTitle = ConvertUTF8ToWString(std::string(name) + PPSSPP_GIT_VERSION);
+ 	if (message != nullptr) {
+ 		winTitle.append(ConvertUTF8ToWString(" - "));
 diff --git a/Windows/main.cpp b/Windows/main.cpp
-index ecfe18fa4..3261151d2 100644
+index 9395233e2..90abec570 100644
 --- a/Windows/main.cpp
 +++ b/Windows/main.cpp
 @@ -304,12 +304,6 @@ bool System_GetPropertyBool(SystemProperty prop) {
@@ -348,13 +492,25 @@ index ecfe18fa4..3261151d2 100644
  	case SYSPROP_CAN_JIT:
  		return true;
  	default:
+diff --git a/Windows/resource.h b/Windows/resource.h
+index ce21b3a85..1f8002c10 100644
+--- a/Windows/resource.h
++++ b/Windows/resource.h
+@@ -322,7 +322,6 @@
+ // Dummy option to let the buffered rendering hotkey cycle through all the options.
+ #define ID_OPTIONS_BUFFEREDRENDERINGDUMMY 40500
+ #define IDC_STEPOUT                       40501
+-#define ID_HELP_BUYGOLD                   40502
+ 
+ #define IDC_STATIC                      -1
+ 
 diff --git a/android/jni/app-android.cpp b/android/jni/app-android.cpp
-index 2fad16224..8ed6dd9cd 100644
+index df395e304..cebdf5804 100644
 --- a/android/jni/app-android.cpp
 +++ b/android/jni/app-android.cpp
-@@ -490,12 +490,6 @@ bool System_GetPropertyBool(SystemProperty prop) {
- 	case SYSPROP_HAS_FOLDER_BROWSER:
- 		// Uses OPEN_DOCUMENT_TREE to let you select a folder.
+@@ -458,12 +458,6 @@ bool System_GetPropertyBool(SystemProperty prop) {
+ 		// Doesn't actually mean it's usable though, in many early versions of Android
+ 		// this dialog is complete garbage and only lets you select subfolders of the Downloads folder.
  		return androidVersion >= 21;  // when ACTION_OPEN_DOCUMENT_TREE was added
 -	case SYSPROP_APP_GOLD:
 -#ifdef GOLD
@@ -383,5 +539,5 @@ index e53b7c7ab..fe69647ed 100644
  			return g_jitAvailable;
  
 -- 
-2.31.1
+2.34.0
 
diff --git a/gnu/packages/patches/pulseview-glib-2.68.patch b/gnu/packages/patches/pulseview-glib-2.68.patch
new file mode 100644
index 0000000000..bb49b3656f
--- /dev/null
+++ b/gnu/packages/patches/pulseview-glib-2.68.patch
@@ -0,0 +1,54 @@
+Taken from upstream:
+https://github.com/sigrokproject/pulseview/pull/39/commits/fb89dd11f2a4a08b73c498869789e38677181a8d.
+
+From fb89dd11f2a4a08b73c498869789e38677181a8d Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
+Date: Wed, 28 Apr 2021 02:14:47 +0200
+Subject: [PATCH] Fix broken build due to C++ template behind C linkage
+
+glib/gatomic.h since 2.68 includes type_traits, which causes a compilation
+error:
+In file included from /usr/include/glib-2.0/glib/gatomic.h:31,
+                 from /usr/include/glib-2.0/glib/gthread.h:32,
+                 from /usr/include/glib-2.0/glib/gasyncqueue.h:32,
+                 from /usr/include/glib-2.0/glib.h:32,
+                 from /usr/include/libsigrokdecode/libsigrokdecode.h:25,
+                 from /home/abuild/rpmbuild/BUILD/pulseview-0.4.2/pv/data/decode/annotation.cpp:21:
+/usr/include/c++/10/type_traits:2308:3: error: template with C linkage
+2308 |   template<typename _CTp, typename _Rp>
+
+As libsigrokdecode.h declares extern C linkage itself where necessary,
+remove it from pulseviews include statements from the last two occasions.
+---
+ pv/data/decode/annotation.cpp  | 2 --
+ pv/views/trace/decodetrace.cpp | 2 --
+ 2 files changed, 4 deletions(-)
+
+diff --git a/pv/data/decode/annotation.cpp b/pv/data/decode/annotation.cpp
+index 7f233478..f8a5c47b 100644
+--- a/pv/data/decode/annotation.cpp
++++ b/pv/data/decode/annotation.cpp
+@@ -17,9 +17,7 @@
+  * along with this program; if not, see <http://www.gnu.org/licenses/>.
+  */
+ 
+-extern "C" {
+ #include <libsigrokdecode/libsigrokdecode.h>
+-}
+ 
+ #include <cassert>
+ #include <vector>
+diff --git a/pv/views/trace/decodetrace.cpp b/pv/views/trace/decodetrace.cpp
+index 409f1d28..888064d0 100644
+--- a/pv/views/trace/decodetrace.cpp
++++ b/pv/views/trace/decodetrace.cpp
+@@ -17,9 +17,7 @@
+  * along with this program; if not, see <http://www.gnu.org/licenses/>.
+  */
+ 
+-extern "C" {
+ #include <libsigrokdecode/libsigrokdecode.h>
+-}
+ 
+ #include <limits>
+ #include <mutex>
diff --git a/gnu/packages/patches/purescript-relax-dependencies.patch b/gnu/packages/patches/purescript-relax-dependencies.patch
deleted file mode 100644
index 6ab4716fc4..0000000000
--- a/gnu/packages/patches/purescript-relax-dependencies.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-Allow the purescript dependencies to better match the available packages in
-Guix.
-
---- purescript-0.13.8/purescript.cabal
-+++ purescript-0.13.8/purescript.cabal.orig
-@@ -1091 +1091 @@ library
--        Glob ==0.9.*,
-+        Glob ==0.10.*,
-@@ -1095 +1095 @@ library
--        ansi-terminal >=0.7.1 && <0.9,
-+        ansi-terminal ==0.9.*,
-@@ -1105 +1105 @@ library
--        clock <0.8,
-+        clock ==0.8.*,
-@@ -1173 +1173 @@ executable purs
--        Glob ==0.9.*,
-+        Glob ==0.10.*,
-@@ -1177 +1177 @@ executable purs
--        ansi-terminal >=0.7.1 && <0.9,
-+        ansi-terminal ==0.9.*,
-@@ -1188 +1188 @@ executable purs
--        clock <0.8,
-+        clock ==0.8.*,
-@@ -1209 +1209 @@ executable purs
--        network >=3.0.1.1 && <3.1,
-+        network >=2.8 && <3.1,
-@@ -1288 +1288 @@ test-suite tests
--        Glob ==0.9.*,
-+        Glob ==0.10.*,
-@@ -1293 +1293 @@ test-suite tests
--        ansi-terminal >=0.7.1 && <0.9,
-+        ansi-terminal ==0.9.*,
-@@ -1303 +1303 @@ test-suite tests
--        clock <0.8,
-+        clock ==0.8.*,
-@@ -1315,2 +1315,2 @@ test-suite tests
--        hspec <2.7,
--        hspec-discover <2.7,
-+        hspec ==2.7.*,
-+        hspec-discover ==2.7.*,
diff --git a/gnu/packages/patches/python-2.7-no-static-lib.patch b/gnu/packages/patches/python-2.7-no-static-lib.patch
new file mode 100644
index 0000000000..02529989be
--- /dev/null
+++ b/gnu/packages/patches/python-2.7-no-static-lib.patch
@@ -0,0 +1,70 @@
+From 92e2dcace7a3c02289b314238c5f18caec659ff1 Mon Sep 17 00:00:00 2001
+From: Julien Lepiller <julien@lepiller.eu>
+Date: Sat, 5 Jun 2021 12:41:47 +0200
+Subject: [PATCH] No static lib.
+
+This patch is adapted from Fedora. The original patch did not apply
+because of whitespace changes.
+
+00111 #
+Patch the Makefile.pre.in so that the generated Makefile doesn't try to build
+a libpythonMAJOR.MINOR.a (bug 550692):
+Downstream only: not appropriate for upstream
+---
+ Makefile.pre.in | 26 +-------------------------
+ 1 file changed, 1 insertion(+), 25 deletions(-)
+
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index 6239fc3..948f196 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -486,7 +486,7 @@ coverage-report: regen-grammar
+ 
+ 
+ # Build the interpreter
+-$(BUILDPYTHON):	Modules/python.o $(LIBRARY) $(LDLIBRARY)
++$(BUILDPYTHON):	Modules/python.o $(LDLIBRARY)
+ 		$(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
+ 			Modules/python.o \
+ 			$(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
+@@ -527,18 +527,6 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o
+ 		_TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
+ 		$(PY_BUILD_ENVIRON) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
+ 
+-# Build static library
+-# avoid long command lines, same as LIBRARY_OBJS
+-$(LIBRARY): $(LIBRARY_OBJS)
+-	-rm -f $@
+-	$(AR) $(ARFLAGS) $@ Modules/getbuildinfo.o
+-	$(AR) $(ARFLAGS) $@ $(PARSER_OBJS)
+-	$(AR) $(ARFLAGS) $@ $(OBJECT_OBJS)
+-	$(AR) $(ARFLAGS) $@ $(PYTHON_OBJS)
+-	$(AR) $(ARFLAGS) $@ $(MODULE_OBJS) $(SIGNAL_OBJS)
+-	$(AR) $(ARFLAGS) $@ $(MODOBJS)
+-	$(RANLIB) $@
+-
+ libpython$(VERSION).so: $(LIBRARY_OBJS)
+ 	if test $(INSTSONAME) != $(LDLIBRARY); then \
+ 		$(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
+@@ -1216,18 +1204,6 @@ libainstall:	@DEF_MAKE_RULE@ python-config
+ 		else	true; \
+ 		fi; \
+ 	done
+-	@if test -d $(LIBRARY); then :; else \
+-		if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
+-			if test "$(SO)" = .dll; then \
+-				$(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \
+-			else \
+-				$(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
+-				$(RANLIB) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
+-			fi; \
+-		else \
+-			echo Skip install of $(LIBRARY) - use make frameworkinstall; \
+-		fi; \
+-	fi
+ 	$(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c
+ 	$(INSTALL_DATA) Modules/python.o $(DESTDIR)$(LIBPL)/python.o
+ 	$(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in
+-- 
+2.31.1
+
diff --git a/gnu/packages/patches/python-3-fix-tests.patch b/gnu/packages/patches/python-3-fix-tests.patch
index e13790bd41..b44e743c71 100644
--- a/gnu/packages/patches/python-3-fix-tests.patch
+++ b/gnu/packages/patches/python-3-fix-tests.patch
@@ -1,10 +1,39 @@
-See the discussion about the issues fixed here at:
-http://bugs.python.org/issue20868 .
+From f0698133e7d6c353a3e6ae0fc62e57ba558a9bc0 Mon Sep 17 00:00:00 2001
+From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
+Date: Wed, 28 Oct 2020 22:55:05 -0400
+Subject: [PATCH] Skip problematic Python 3 tests in Guix.
+
+A subset of the hunks in this patch is tracked upstream at
+https://bugs.python.org/issue38845, which was contributed by Tanguy Le
+Carrour <tanguy@bioneland.org>.
+---
+ Lib/ctypes/test/test_callbacks.py         | 3 +++
+ Lib/ctypes/test/test_find.py              | 1 +
+ Lib/ctypes/test/test_libc.py              | 3 +++
+ Lib/distutils/tests/test_archive_util.py  | 2 ++
+ Lib/distutils/tests/test_sdist.py         | 1 +
+ Lib/test/_test_multiprocessing.py         | 2 ++
+ Lib/test/test_asyncio/test_base_events.py | 2 ++
+ Lib/test/test_generators.py               | 1 +
+ Lib/test/test_pathlib.py                  | 3 +--
+ Lib/test/test_pdb.py                      | 4 ++--
+ Lib/test/test_regrtest.py                 | 2 ++
+ Lib/test/test_resource.py                 | 1 +
+ Lib/test/test_shutil.py                   | 2 ++
+ Lib/test/test_signal.py                   | 4 ++++
+ Lib/test/test_socket.py                   | 8 ++++++++
+ Lib/test/test_spwd.py                     | 6 ++----
+ Lib/test/test_tarfile.py                  | 9 ++++++---
+ Lib/test/test_threading.py                | 3 +++
+ Lib/test/test_unicodedata.py              | 1 +
+ Tools/scripts/run_tests.py                | 2 +-
+ 20 files changed, 48 insertions(+), 12 deletions(-)
 
 diff --git a/Lib/ctypes/test/test_callbacks.py b/Lib/ctypes/test/test_callbacks.py
+index d8e9c5a760..94fc5929c9 100644
 --- a/Lib/ctypes/test/test_callbacks.py
 +++ b/Lib/ctypes/test/test_callbacks.py
-@@ -3,6 +3,7 @@ import unittest
+@@ -5,6 +5,7 @@ from test import support
  from ctypes import *
  from ctypes.test import need_symbol
  import _ctypes_test
@@ -12,7 +41,7 @@ diff --git a/Lib/ctypes/test/test_callbacks.py b/Lib/ctypes/test/test_callbacks.
  
  class Callbacks(unittest.TestCase):
      functype = CFUNCTYPE
-@@ -176,6 +177,8 @@ class SampleCallbacksTestCase(unittest.TestCase):
+@@ -178,6 +179,8 @@ class SampleCallbacksTestCase(unittest.TestCase):
  
          self.assertLess(diff, 0.01, "%s not less than 0.01" % diff)
  
@@ -21,7 +50,20 @@ diff --git a/Lib/ctypes/test/test_callbacks.py b/Lib/ctypes/test/test_callbacks.
      def test_issue_8959_a(self):
          from ctypes.util import find_library
          libc_path = find_library("c")
+diff --git a/Lib/ctypes/test/test_find.py b/Lib/ctypes/test/test_find.py
+index 92ac1840ad..c8eb75dedd 100644
+--- a/Lib/ctypes/test/test_find.py
++++ b/Lib/ctypes/test/test_find.py
+@@ -116,6 +116,7 @@ class FindLibraryLinux(unittest.TestCase):
+         with unittest.mock.patch("ctypes.util._findSoname_ldconfig", lambda *args: None):
+             self.assertNotEqual(find_library('c'), None)
+ 
++    @unittest.skipIf(True, "ldconfig is not used on Guix")
+     def test_find_library_with_ld(self):
+         with unittest.mock.patch("ctypes.util._findSoname_ldconfig", lambda *args: None), \
+              unittest.mock.patch("ctypes.util._findLib_gcc", lambda *args: None):
 diff --git a/Lib/ctypes/test/test_libc.py b/Lib/ctypes/test/test_libc.py
+index 56285b5ff8..c088ab3db8 100644
 --- a/Lib/ctypes/test/test_libc.py
 +++ b/Lib/ctypes/test/test_libc.py
 @@ -2,6 +2,7 @@ import unittest
@@ -42,6 +84,7 @@ diff --git a/Lib/ctypes/test/test_libc.py b/Lib/ctypes/test/test_libc.py
          comparefunc = CFUNCTYPE(c_int, POINTER(c_char), POINTER(c_char))
          lib.my_qsort.argtypes = c_void_p, c_size_t, c_size_t, comparefunc
 diff --git a/Lib/distutils/tests/test_archive_util.py b/Lib/distutils/tests/test_archive_util.py
+index e9aad0e40f..8bbaa51ee5 100644
 --- a/Lib/distutils/tests/test_archive_util.py
 +++ b/Lib/distutils/tests/test_archive_util.py
 @@ -333,6 +333,7 @@ class ArchiveUtilTestCase(support.TempdirManager,
@@ -61,6 +104,7 @@ diff --git a/Lib/distutils/tests/test_archive_util.py b/Lib/distutils/tests/test
          tmpdir =  self._create_files()
          base_name = os.path.join(self.mkdtemp(), 'archive')
 diff --git a/Lib/distutils/tests/test_sdist.py b/Lib/distutils/tests/test_sdist.py
+index 23db126959..6e2329df7d 100644
 --- a/Lib/distutils/tests/test_sdist.py
 +++ b/Lib/distutils/tests/test_sdist.py
 @@ -443,6 +443,7 @@ class SDistTestCase(BasePyPIRCCommandTestCase):
@@ -72,9 +116,10 @@ diff --git a/Lib/distutils/tests/test_sdist.py b/Lib/distutils/tests/test_sdist.
          # now building a sdist
          dist, cmd = self.get_cmd()
 diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
+index e47905c863..31a5a9c308 100644
 --- a/Lib/test/_test_multiprocessing.py
 +++ b/Lib/test/_test_multiprocessing.py
-@@ -1473,6 +1473,7 @@ class _TestCondition(BaseTestCase):
+@@ -1577,6 +1577,7 @@ class _TestCondition(BaseTestCase):
          if pid is not None:
              os.kill(pid, signal.SIGINT)
  
@@ -82,10 +127,19 @@ diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.
      def test_wait_result(self):
          if isinstance(self, ProcessesMixin) and sys.platform != 'win32':
              pid = os.getpid()
+@@ -3905,6 +3906,7 @@ class _TestSharedMemory(BaseTestCase):
+         sms.close()
+ 
+     @unittest.skipIf(os.name != "posix", "not feasible in non-posix platforms")
++    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
+     def test_shared_memory_SharedMemoryServer_ignores_sigint(self):
+         # bpo-36368: protect SharedMemoryManager server process from
+         # KeyboardInterrupt signals.
 diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py
+index 533d5cc7f5..c4f860cc3b 100644
 --- a/Lib/test/test_asyncio/test_base_events.py
 +++ b/Lib/test/test_asyncio/test_base_events.py
-@@ -1323,6 +1323,8 @@ class BaseEventLoopWithSelectorTests(test_utils.TestCase):
+@@ -1341,6 +1341,8 @@ class BaseEventLoopWithSelectorTests(test_utils.TestCase):
          self._test_create_connection_ip_addr(m_socket, False)
  
      @patch_socket
@@ -95,9 +149,10 @@ diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/t
          m_socket.getaddrinfo = socket.getaddrinfo
          sock = m_socket.socket.return_value
 diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py
+index 3bf1522808..04bac8a7db 100644
 --- a/Lib/test/test_generators.py
 +++ b/Lib/test/test_generators.py
-@@ -34,6 +34,7 @@ class SignalAndYieldFromTest(unittest.TestCase):
+@@ -33,6 +33,7 @@ class SignalAndYieldFromTest(unittest.TestCase):
          else:
              return "FAILED"
  
@@ -105,30 +160,11 @@ diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py
      def test_raise_and_yield_from(self):
          gen = self.generator1()
          gen.send(None)
-diff --git a/Lib/test/test_normalization.py b/Lib/test/test_normalization.py
---- a/Lib/test/test_normalization.py
-+++ b/Lib/test/test_normalization.py
-@@ -2,6 +2,7 @@ from test.support import open_urlresource
- import unittest
- 
- from http.client import HTTPException
-+from urllib.error import URLError
- import sys
- from unicodedata import normalize, unidata_version
- 
-@@ -43,6 +44,8 @@ class NormalizationTest(unittest.TestCase):
-         except PermissionError:
-             self.skipTest(f"Permission error when downloading {TESTDATAURL} "
-                           f"into the test data directory")
-+        except URLError:
-+            self.skipTest("DNS lookups are not enabled.")
-         except (OSError, HTTPException):
-             self.fail(f"Could not retrieve {TESTDATAURL}")
- 
 diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py
+index 3da35710b9..5404f9193d 100644
 --- a/Lib/test/test_pathlib.py
 +++ b/Lib/test/test_pathlib.py
-@@ -2134,8 +2134,7 @@ class PosixPathTest(_BasePathTest, unittest.TestCase):
+@@ -2408,8 +2408,7 @@ class PosixPathTest(_BasePathTest, unittest.TestCase):
          self.assertEqual(given, expect)
          self.assertEqual(set(p.rglob("FILEd*")), set())
  
@@ -139,9 +175,10 @@ diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py
          P = self.cls
          support.import_module('pwd')
 diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py
+index 8016f81e5a..10190486b4 100644
 --- a/Lib/test/test_pdb.py
 +++ b/Lib/test/test_pdb.py
-@@ -1150,11 +1150,11 @@ def test_pdb_issue_20766():
+@@ -1219,11 +1219,11 @@ def test_pdb_issue_20766():
      > <doctest test.test_pdb.test_pdb_issue_20766[0]>(6)test_function()
      -> print('pdb %d: %s' % (i, sess._previous_sigint_handler))
      (Pdb) continue
@@ -156,9 +193,10 @@ diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py
  
  
 diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py
+index a77638b10a..2069b349a8 100644
 --- a/Lib/test/test_regrtest.py
 +++ b/Lib/test/test_regrtest.py
-@@ -762,6 +762,7 @@ class ArgsTestCase(BaseTestCase):
+@@ -811,6 +811,7 @@ class ArgsTestCase(BaseTestCase):
          output = self.run_tests('--fromfile', filename)
          self.check_executed_tests(output, tests)
  
@@ -166,7 +204,7 @@ diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py
      def test_interrupted(self):
          code = TEST_INTERRUPTED
          test = self.create_test('sigint', code=code)
-@@ -779,6 +780,7 @@ class ArgsTestCase(BaseTestCase):
+@@ -828,6 +829,7 @@ class ArgsTestCase(BaseTestCase):
                   % (self.TESTNAME_REGEX, len(tests)))
          self.check_line(output, regex)
  
@@ -175,9 +213,10 @@ diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py
          # Issue #25373: test --slowest with an interrupted test
          code = TEST_INTERRUPTED
 diff --git a/Lib/test/test_resource.py b/Lib/test/test_resource.py
+index e5ece5284c..5299e54507 100644
 --- a/Lib/test/test_resource.py
 +++ b/Lib/test/test_resource.py
-@@ -145,6 +145,7 @@ class ResourceTest(unittest.TestCase):
+@@ -148,6 +148,7 @@ class ResourceTest(unittest.TestCase):
  
      @unittest.skipUnless(hasattr(resource, 'prlimit'), 'no prlimit')
      @support.requires_linux_version(2, 6, 36)
@@ -186,37 +225,75 @@ diff --git a/Lib/test/test_resource.py b/Lib/test/test_resource.py
          self.assertRaises(TypeError, resource.prlimit)
          self.assertRaises(ProcessLookupError, resource.prlimit,
 diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py
+index e19af64be0..1b893df6fa 100644
 --- a/Lib/test/test_shutil.py
 +++ b/Lib/test/test_shutil.py
-@@ -1143,6 +1143,7 @@ class TestShutil(unittest.TestCase):
+@@ -1427,6 +1427,7 @@ class TestArchives(BaseTest, unittest.TestCase):
+         base_name = os.path.join(tmpdir, 'archive')
          self.assertRaises(ValueError, make_archive, base_name, 'xxx')
  
-     @support.requires_zlib
-+    @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix")
++    @unittest.skipIf(True, "The Guix build container has no root user")
+     @support.requires_zlib()
      def test_make_archive_owner_group(self):
          # testing make_archive with owner and group, with various combinations
-         # this works even if there's not gid/uid support
-@@ -1171,6 +1172,7 @@ class TestShutil(unittest.TestCase):
+@@ -1455,6 +1456,7 @@ class TestArchives(BaseTest, unittest.TestCase):
+         self.assertTrue(os.path.isfile(res))
  
  
-     @support.requires_zlib
-+    @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix")
++    @unittest.skipIf(True, "The Guix build container has no root user")
+     @support.requires_zlib()
      @unittest.skipUnless(UID_GID_SUPPORT, "Requires grp and pwd support")
      def test_tarfile_root_owner(self):
-         root_dir, base_dir = self._create_files()
+diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py
+index 45553a6a42..55623f01a3 100644
+--- a/Lib/test/test_signal.py
++++ b/Lib/test/test_signal.py
+@@ -78,6 +78,7 @@ class PosixTests(unittest.TestCase):
+         self.assertLess(len(s), signal.NSIG)
+ 
+     @unittest.skipUnless(sys.executable, "sys.executable required.")
++    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
+     def test_keyboard_interrupt_exit_code(self):
+         """KeyboardInterrupt triggers exit via SIGINT."""
+         process = subprocess.run(
+@@ -128,6 +129,7 @@ class WindowsSignalTests(unittest.TestCase):
+             signal.signal(7, handler)
+ 
+     @unittest.skipUnless(sys.executable, "sys.executable required.")
++    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
+     def test_keyboard_interrupt_exit_code(self):
+         """KeyboardInterrupt triggers an exit using STATUS_CONTROL_C_EXIT."""
+         # We don't test via os.kill(os.getpid(), signal.CTRL_C_EVENT) here
+@@ -1245,6 +1247,7 @@ class StressTest(unittest.TestCase):
+ 
+ class RaiseSignalTest(unittest.TestCase):
+ 
++    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
+     def test_sigint(self):
+         with self.assertRaises(KeyboardInterrupt):
+             signal.raise_signal(signal.SIGINT)
+@@ -1275,6 +1278,7 @@ class RaiseSignalTest(unittest.TestCase):
+ 
+ class PidfdSignalTest(unittest.TestCase):
+ 
++    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
+     @unittest.skipUnless(
+         hasattr(signal, "pidfd_send_signal"),
+         "pidfd support not built in",
 diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
+index aefba4f397..6c89f558d5 100755
 --- a/Lib/test/test_socket.py
 +++ b/Lib/test/test_socket.py
-@@ -875,6 +875,8 @@ class GeneralModuleTests(unittest.TestCase):
+@@ -1009,6 +1009,8 @@ class GeneralModuleTests(unittest.TestCase):
          if not fqhn in all_host_names:
              self.fail("Error testing host resolution mechanisms. (fqdn: %s, all: %s)" % (fqhn, repr(all_host_names)))
  
 +    @unittest.skipUnless(support.is_resource_enabled('network'),
 +                         'network is not enabled')
      def test_host_resolution(self):
-         for addr in [support.HOSTv4, '10.0.0.1', '255.255.255.255']:
+         for addr in [socket_helper.HOSTv4, '10.0.0.1', '255.255.255.255']:
              self.assertEqual(socket.gethostbyname(addr), addr)
-@@ -1004,6 +1006,8 @@ class GeneralModuleTests(unittest.TestCase):
+@@ -1140,6 +1142,8 @@ class GeneralModuleTests(unittest.TestCase):
              self.assertWarns(DeprecationWarning, socket.ntohs, k)
              self.assertWarns(DeprecationWarning, socket.htons, k)
  
@@ -225,7 +302,7 @@ diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
      def testGetServBy(self):
          eq = self.assertEqual
          # Find one service that exists, then check all the related interfaces.
-@@ -1358,6 +1362,8 @@ class GeneralModuleTests(unittest.TestCase):
+@@ -1489,6 +1493,8 @@ class GeneralModuleTests(unittest.TestCase):
              raise
          self.assertRaises(TypeError, s.ioctl, socket.SIO_LOOPBACK_FAST_PATH, None)
  
@@ -234,7 +311,7 @@ diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
      def testGetaddrinfo(self):
          try:
              socket.getaddrinfo('localhost', 80)
-@@ -1440,6 +1446,8 @@ class GeneralModuleTests(unittest.TestCase):
+@@ -1571,6 +1577,8 @@ class GeneralModuleTests(unittest.TestCase):
          # only IP addresses are allowed
          self.assertRaises(OSError, socket.getnameinfo, ('mail.python.org',0), 0)
  
@@ -244,6 +321,7 @@ diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
                           'network is not enabled')
      def test_idna(self):
 diff --git a/Lib/test/test_spwd.py b/Lib/test/test_spwd.py
+index 07793c84c8..fec672bcbe 100644
 --- a/Lib/test/test_spwd.py
 +++ b/Lib/test/test_spwd.py
 @@ -5,8 +5,7 @@ from test import support
@@ -267,9 +345,10 @@ diff --git a/Lib/test/test_spwd.py b/Lib/test/test_spwd.py
  
      def test_getspnam_exception(self):
 diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
+index 29cde91bf7..8d0f20e8bf 100644
 --- a/Lib/test/test_tarfile.py
 +++ b/Lib/test/test_tarfile.py
-@@ -2509,9 +2509,12 @@ def root_is_uid_gid_0():
+@@ -2607,9 +2607,12 @@ def root_is_uid_gid_0():
          import pwd, grp
      except ImportError:
          return False
@@ -286,9 +365,10 @@ diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
      return True
  
 diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
+index c21cdf8eb7..6c9d575032 100644
 --- a/Lib/test/test_threading.py
 +++ b/Lib/test/test_threading.py
-@@ -1249,6 +1249,7 @@ class MiscTestCase(unittest.TestCase):
+@@ -1398,6 +1398,7 @@ class MiscTestCase(unittest.TestCase):
  
  
  class InterruptMainTests(unittest.TestCase):
@@ -296,7 +376,7 @@ diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
      def test_interrupt_main_subthread(self):
          # Calling start_new_thread with a function that executes interrupt_main
          # should raise KeyboardInterrupt upon completion.
-@@ -1260,6 +1261,8 @@ class InterruptMainTests(unittest.TestCase):
+@@ -1409,6 +1410,8 @@ class InterruptMainTests(unittest.TestCase):
              t.join()
          t.join()
  
@@ -305,10 +385,23 @@ diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
      def test_interrupt_main_mainthread(self):
          # Make sure that if interrupt_main is called in main thread that
          # KeyboardInterrupt is raised instantly.
+diff --git a/Lib/test/test_unicodedata.py b/Lib/test/test_unicodedata.py
+index b552d2bd17..28b1144e15 100644
+--- a/Lib/test/test_unicodedata.py
++++ b/Lib/test/test_unicodedata.py
+@@ -309,6 +309,7 @@ class UnicodeMiscTest(UnicodeDatabaseTest):
+                 self.assertEqual(len(lines), 1,
+                                  r"\u%.4x should not be a linebreak" % i)
+ 
++@requires_resource('network')
+ class NormalizationTest(unittest.TestCase):
+     @staticmethod
+     def check_version(testfile):
 diff --git a/Tools/scripts/run_tests.py b/Tools/scripts/run_tests.py
+index bcfa5e943b..1f2484971b 100644
 --- a/Tools/scripts/run_tests.py
 +++ b/Tools/scripts/run_tests.py
-@@ -39,7 +39,7 @@ def main(regrtest_args):
+@@ -41,7 +41,7 @@ def main(regrtest_args):
      if not any(is_multiprocess_flag(arg) for arg in regrtest_args):
          args.extend(['-j', '0'])  # Use all CPU cores
      if not any(is_resource_use_flag(arg) for arg in regrtest_args):
@@ -317,3 +410,6 @@ diff --git a/Tools/scripts/run_tests.py b/Tools/scripts/run_tests.py
      args.extend(regrtest_args)
      print(' '.join(args))
      if sys.platform == 'win32':
+-- 
+2.29.2
+
diff --git a/gnu/packages/patches/python-3-hurd-configure.patch b/gnu/packages/patches/python-3-hurd-configure.patch
new file mode 100644
index 0000000000..aa25a401c5
--- /dev/null
+++ b/gnu/packages/patches/python-3-hurd-configure.patch
@@ -0,0 +1,27 @@
+Upstream status: Not upstreamed.
+
+The build system refuses to cross-compile for unknown targets
+even though it works fine.  Add GNU/Hurd target.
+
+--- Python-3.8.5/configure.orig	2020-10-26 14:06:09.665423525 +0100
++++ Python-3.8.5/configure	2020-10-26 14:08:30.987765738 +0100
+@@ -3278,6 +3278,9 @@
+ 	*-*-vxworks*)
+ 	    ac_sys_system=VxWorks
+ 	    ;;
++	*-*-gnu)
++	    ac_sys_system=GNU
++	    ;;
+ 	*)
+ 		# for now, limit cross builds to known configurations
+ 		MACHDEP="unknown"
+@@ -3328,6 +3331,9 @@
+ 	*-*-vxworks*)
+ 		_host_cpu=$host_cpu
+ 		;;
++	*-*-gnu)
++		_host_cpu=$host_cpu
++	    ;;
+ 	*)
+ 		# for now, limit cross builds to known configurations
+ 		MACHDEP="unknown"
diff --git a/gnu/packages/patches/python-3-no-static-lib.patch b/gnu/packages/patches/python-3-no-static-lib.patch
new file mode 100644
index 0000000000..b44dbc976c
--- /dev/null
+++ b/gnu/packages/patches/python-3-no-static-lib.patch
@@ -0,0 +1,75 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: David Malcolm <dmalcolm@redhat.com>
+Date: Mon, 18 Jan 2010 17:59:07 +0000
+Subject: [PATCH] 00111: Don't try to build a libpythonMAJOR.MINOR.a
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Downstream only: not appropriate for upstream.
+
+See https://bugzilla.redhat.com/show_bug.cgi?id=556092
+
+Co-authored-by: David Malcolm <dmalcolm@redhat.com>
+Co-authored-by: Bohuslav Kabrda <bkabrda@redhat.com>
+Co-authored-by: Matej Stuchlik <mstuchli@redhat.com>
+Co-authored-by: Robert Kuska <rkuska@redhat.com>
+Co-authored-by: Charalampos Stratakis <cstratak@redhat.com>
+Co-authored-by: Miro Hrončok <miro@hroncok.cz>
+---
+ Makefile.pre.in | 21 ++-------------------
+ 1 file changed, 2 insertions(+), 19 deletions(-)
+
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index 0c3981c132..5587422ec7 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -589,7 +589,7 @@ clinic: check-clean-src $(srcdir)/Modules/_blake2/blake2s_impl.c
+ 	$(PYTHON_FOR_REGEN) $(srcdir)/Tools/clinic/clinic.py --make --srcdir $(srcdir)
+ 
+ # Build the interpreter
+-$(BUILDPYTHON):	Programs/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) $(EXPORTSYMS)
++$(BUILDPYTHON):	Programs/python.o $(LDLIBRARY) $(PY3LIBRARY) $(EXPORTSYMS)
+ 	$(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS)
+ 
+ platform: $(BUILDPYTHON) pybuilddir.txt
+@@ -637,12 +637,6 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o
+ 		_TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
+ 		$(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
+ 
+-
+-# Build static library
+-$(LIBRARY): $(LIBRARY_OBJS)
+-	-rm -f $@
+-	$(AR) $(ARFLAGS) $@ $(LIBRARY_OBJS)
+-
+ libpython$(LDVERSION).so: $(LIBRARY_OBJS) $(DTRACE_OBJS)
+ 	if test $(INSTSONAME) != $(LDLIBRARY); then \
+ 		$(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM); \
+@@ -724,7 +718,7 @@ Makefile Modules/config.c: Makefile.pre \
+ 	@echo "The Makefile was updated, you may need to re-run make."
+ 
+ 
+-Programs/_testembed: Programs/_testembed.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) $(EXPORTSYMS)
++Programs/_testembed: Programs/_testembed.o $(LDLIBRARY) $(PY3LIBRARY) $(EXPORTSYMS)
+ 	$(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/_testembed.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS)
+ 
+ ############################################################################
+@@ -1652,17 +1646,6 @@ libainstall:	@DEF_MAKE_RULE@ python-config
+ 		else	true; \
+ 		fi; \
+ 	done
+-	@if test -d $(LIBRARY); then :; else \
+-		if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
+-			if test "$(SHLIB_SUFFIX)" = .dll; then \
+-				$(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \
+-			else \
+-				$(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
+-			fi; \
+-		else \
+-			echo Skip install of $(LIBRARY) - use make frameworkinstall; \
+-		fi; \
+-	fi
+ 	$(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c
+ 	$(INSTALL_DATA) Programs/python.o $(DESTDIR)$(LIBPL)/python.o
+ 	$(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in
diff --git a/gnu/packages/patches/python-3.8-CVE-2021-3177.patch b/gnu/packages/patches/python-3.8-CVE-2021-3177.patch
deleted file mode 100644
index 01f6b52865..0000000000
--- a/gnu/packages/patches/python-3.8-CVE-2021-3177.patch
+++ /dev/null
@@ -1,194 +0,0 @@
-Fix CVE-2021-3177 for Python 3.8:
-
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-3177
-
-Patch copied from upstream source repository:
-
-https://github.com/python/cpython/commit/ece5dfd403dac211f8d3c72701fe7ba7b7aa5b5f
-
-From ece5dfd403dac211f8d3c72701fe7ba7b7aa5b5f Mon Sep 17 00:00:00 2001
-From: "Miss Islington (bot)"
- <31488909+miss-islington@users.noreply.github.com>
-Date: Mon, 18 Jan 2021 13:28:52 -0800
-Subject: [PATCH] closes bpo-42938: Replace snprintf with Python unicode
- formatting in ctypes param reprs. (GH-24248)
-
-(cherry picked from commit 916610ef90a0d0761f08747f7b0905541f0977c7)
-
-Co-authored-by: Benjamin Peterson <benjamin@python.org>
-
-Co-authored-by: Benjamin Peterson <benjamin@python.org>
----
- Lib/ctypes/test/test_parameters.py            | 43 ++++++++++++++++
- .../2021-01-18-09-27-31.bpo-42938.4Zn4Mp.rst  |  2 +
- Modules/_ctypes/callproc.c                    | 51 +++++++------------
- 3 files changed, 64 insertions(+), 32 deletions(-)
- create mode 100644 Misc/NEWS.d/next/Security/2021-01-18-09-27-31.bpo-42938.4Zn4Mp.rst
-
-diff --git a/Lib/ctypes/test/test_parameters.py b/Lib/ctypes/test/test_parameters.py
-index e4c25fd880cef..531894fdec838 100644
---- a/Lib/ctypes/test/test_parameters.py
-+++ b/Lib/ctypes/test/test_parameters.py
-@@ -201,6 +201,49 @@ def __dict__(self):
-         with self.assertRaises(ZeroDivisionError):
-             WorseStruct().__setstate__({}, b'foo')
- 
-+    def test_parameter_repr(self):
-+        from ctypes import (
-+            c_bool,
-+            c_char,
-+            c_wchar,
-+            c_byte,
-+            c_ubyte,
-+            c_short,
-+            c_ushort,
-+            c_int,
-+            c_uint,
-+            c_long,
-+            c_ulong,
-+            c_longlong,
-+            c_ulonglong,
-+            c_float,
-+            c_double,
-+            c_longdouble,
-+            c_char_p,
-+            c_wchar_p,
-+            c_void_p,
-+        )
-+        self.assertRegex(repr(c_bool.from_param(True)), r"^<cparam '\?' at 0x[A-Fa-f0-9]+>$")
-+        self.assertEqual(repr(c_char.from_param(97)), "<cparam 'c' ('a')>")
-+        self.assertRegex(repr(c_wchar.from_param('a')), r"^<cparam 'u' at 0x[A-Fa-f0-9]+>$")
-+        self.assertEqual(repr(c_byte.from_param(98)), "<cparam 'b' (98)>")
-+        self.assertEqual(repr(c_ubyte.from_param(98)), "<cparam 'B' (98)>")
-+        self.assertEqual(repr(c_short.from_param(511)), "<cparam 'h' (511)>")
-+        self.assertEqual(repr(c_ushort.from_param(511)), "<cparam 'H' (511)>")
-+        self.assertRegex(repr(c_int.from_param(20000)), r"^<cparam '[li]' \(20000\)>$")
-+        self.assertRegex(repr(c_uint.from_param(20000)), r"^<cparam '[LI]' \(20000\)>$")
-+        self.assertRegex(repr(c_long.from_param(20000)), r"^<cparam '[li]' \(20000\)>$")
-+        self.assertRegex(repr(c_ulong.from_param(20000)), r"^<cparam '[LI]' \(20000\)>$")
-+        self.assertRegex(repr(c_longlong.from_param(20000)), r"^<cparam '[liq]' \(20000\)>$")
-+        self.assertRegex(repr(c_ulonglong.from_param(20000)), r"^<cparam '[LIQ]' \(20000\)>$")
-+        self.assertEqual(repr(c_float.from_param(1.5)), "<cparam 'f' (1.5)>")
-+        self.assertEqual(repr(c_double.from_param(1.5)), "<cparam 'd' (1.5)>")
-+        self.assertEqual(repr(c_double.from_param(1e300)), "<cparam 'd' (1e+300)>")
-+        self.assertRegex(repr(c_longdouble.from_param(1.5)), r"^<cparam ('d' \(1.5\)|'g' at 0x[A-Fa-f0-9]+)>$")
-+        self.assertRegex(repr(c_char_p.from_param(b'hihi')), "^<cparam 'z' \(0x[A-Fa-f0-9]+\)>$")
-+        self.assertRegex(repr(c_wchar_p.from_param('hihi')), "^<cparam 'Z' \(0x[A-Fa-f0-9]+\)>$")
-+        self.assertRegex(repr(c_void_p.from_param(0x12)), r"^<cparam 'P' \(0x0*12\)>$")
-+
- ################################################################
- 
- if __name__ == '__main__':
-#diff --git a/Misc/NEWS.d/next/Security/2021-01-18-09-27-31.bpo-42938.4Zn4Mp.rst b/Misc/NEWS.d/next/Security/2021-01-18-09-27-31.bpo-42938.4Zn4Mp.rst
-#new file mode 100644
-#index 0000000000000..7df65a156feab
-#--- /dev/null
-#+++ b/Misc/NEWS.d/next/Security/2021-01-18-09-27-31.bpo-42938.4Zn4Mp.rst
-#@@ -0,0 +1,2 @@
-#+Avoid static buffers when computing the repr of :class:`ctypes.c_double` and
-#+:class:`ctypes.c_longdouble` values.
-diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c
-index a9b8675cd951b..de75918d49f37 100644
---- a/Modules/_ctypes/callproc.c
-+++ b/Modules/_ctypes/callproc.c
-@@ -484,58 +484,47 @@ is_literal_char(unsigned char c)
- static PyObject *
- PyCArg_repr(PyCArgObject *self)
- {
--    char buffer[256];
-     switch(self->tag) {
-     case 'b':
-     case 'B':
--        sprintf(buffer, "<cparam '%c' (%d)>",
-+        return PyUnicode_FromFormat("<cparam '%c' (%d)>",
-             self->tag, self->value.b);
--        break;
-     case 'h':
-     case 'H':
--        sprintf(buffer, "<cparam '%c' (%d)>",
-+        return PyUnicode_FromFormat("<cparam '%c' (%d)>",
-             self->tag, self->value.h);
--        break;
-     case 'i':
-     case 'I':
--        sprintf(buffer, "<cparam '%c' (%d)>",
-+        return PyUnicode_FromFormat("<cparam '%c' (%d)>",
-             self->tag, self->value.i);
--        break;
-     case 'l':
-     case 'L':
--        sprintf(buffer, "<cparam '%c' (%ld)>",
-+        return PyUnicode_FromFormat("<cparam '%c' (%ld)>",
-             self->tag, self->value.l);
--        break;
- 
-     case 'q':
-     case 'Q':
--        sprintf(buffer,
--#ifdef MS_WIN32
--            "<cparam '%c' (%I64d)>",
--#else
--            "<cparam '%c' (%lld)>",
--#endif
-+        return PyUnicode_FromFormat("<cparam '%c' (%lld)>",
-             self->tag, self->value.q);
--        break;
-     case 'd':
--        sprintf(buffer, "<cparam '%c' (%f)>",
--            self->tag, self->value.d);
--        break;
--    case 'f':
--        sprintf(buffer, "<cparam '%c' (%f)>",
--            self->tag, self->value.f);
--        break;
--
-+    case 'f': {
-+        PyObject *f = PyFloat_FromDouble((self->tag == 'f') ? self->value.f : self->value.d);
-+        if (f == NULL) {
-+            return NULL;
-+        }
-+        PyObject *result = PyUnicode_FromFormat("<cparam '%c' (%R)>", self->tag, f);
-+        Py_DECREF(f);
-+        return result;
-+    }
-     case 'c':
-         if (is_literal_char((unsigned char)self->value.c)) {
--            sprintf(buffer, "<cparam '%c' ('%c')>",
-+            return PyUnicode_FromFormat("<cparam '%c' ('%c')>",
-                 self->tag, self->value.c);
-         }
-         else {
--            sprintf(buffer, "<cparam '%c' ('\\x%02x')>",
-+            return PyUnicode_FromFormat("<cparam '%c' ('\\x%02x')>",
-                 self->tag, (unsigned char)self->value.c);
-         }
--        break;
- 
- /* Hm, are these 'z' and 'Z' codes useful at all?
-    Shouldn't they be replaced by the functionality of c_string
-@@ -544,22 +533,20 @@ PyCArg_repr(PyCArgObject *self)
-     case 'z':
-     case 'Z':
-     case 'P':
--        sprintf(buffer, "<cparam '%c' (%p)>",
-+        return PyUnicode_FromFormat("<cparam '%c' (%p)>",
-             self->tag, self->value.p);
-         break;
- 
-     default:
-         if (is_literal_char((unsigned char)self->tag)) {
--            sprintf(buffer, "<cparam '%c' at %p>",
-+            return PyUnicode_FromFormat("<cparam '%c' at %p>",
-                 (unsigned char)self->tag, (void *)self);
-         }
-         else {
--            sprintf(buffer, "<cparam 0x%02x at %p>",
-+            return PyUnicode_FromFormat("<cparam 0x%02x at %p>",
-                 (unsigned char)self->tag, (void *)self);
-         }
--        break;
-     }
--    return PyUnicode_FromString(buffer);
- }
- 
- static PyMemberDef PyCArgType_members[] = {
diff --git a/gnu/packages/patches/python-3.8-fix-tests.patch b/gnu/packages/patches/python-3.8-fix-tests.patch
deleted file mode 100644
index 4fbdd444c7..0000000000
--- a/gnu/packages/patches/python-3.8-fix-tests.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
-index 1474624..887f8ee 100644
---- a/Lib/test/_test_multiprocessing.py
-+++ b/Lib/test/_test_multiprocessing.py
-@@ -3801,6 +3801,7 @@ class _TestSharedMemory(BaseTestCase):
-         sms.close()
-
-     @unittest.skipIf(os.name != "posix", "not feasible in non-posix platforms")
-+    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
-     def test_shared_memory_SharedMemoryServer_ignores_sigint(self):
-         # bpo-36368: protect SharedMemoryManager server process from
-         # KeyboardInterrupt signals.
-diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py
-index d41e94b..a1c15e7 100644
---- a/Lib/test/test_signal.py
-+++ b/Lib/test/test_signal.py
-@@ -78,6 +78,7 @@ class PosixTests(unittest.TestCase):
-         self.assertLess(len(s), signal.NSIG)
-
-     @unittest.skipUnless(sys.executable, "sys.executable required.")
-+    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
-     def test_keyboard_interrupt_exit_code(self):
-         """KeyboardInterrupt triggers exit via SIGINT."""
-         process = subprocess.run(
-@@ -128,6 +129,7 @@ class WindowsSignalTests(unittest.TestCase):
-             signal.signal(7, handler)
-
-     @unittest.skipUnless(sys.executable, "sys.executable required.")
-+    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
-     def test_keyboard_interrupt_exit_code(self):
-         """KeyboardInterrupt triggers an exit using STATUS_CONTROL_C_EXIT."""
-         # We don't test via os.kill(os.getpid(), signal.CTRL_C_EVENT) here
-@@ -1245,6 +1247,7 @@ class StressTest(unittest.TestCase):
-
- class RaiseSignalTest(unittest.TestCase):
-
-+    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
-     def test_sigint(self):
-         with self.assertRaises(KeyboardInterrupt):
-             signal.raise_signal(signal.SIGINT)
---
-2.23.0
diff --git a/gnu/packages/patches/python-3.9-fix-tests.patch b/gnu/packages/patches/python-3.9-fix-tests.patch
deleted file mode 100644
index dc6b8c4cc8..0000000000
--- a/gnu/packages/patches/python-3.9-fix-tests.patch
+++ /dev/null
@@ -1,370 +0,0 @@
-See the discussion about the issues fixed here at:
-http://bugs.python.org/issue20868 .
-
-diff --git a/Lib/ctypes/test/test_callbacks.py b/Lib/ctypes/test/test_callbacks.py
---- a/Lib/ctypes/test/test_callbacks.py
-+++ b/Lib/ctypes/test/test_callbacks.py
-@@ -3,6 +3,7 @@ import unittest
- from ctypes import *
- from ctypes.test import need_symbol
- import _ctypes_test
-+import platform
-
- class Callbacks(unittest.TestCase):
-     functype = CFUNCTYPE
-@@ -176,6 +177,8 @@ class SampleCallbacksTestCase(unittest.TestCase):
-
-         self.assertLess(diff, 0.01, "%s not less than 0.01" % diff)
-
-+    @unittest.skipIf(platform.machine() in ['mips64'],
-+                     "This test fails on this platform")
-     def test_issue_8959_a(self):
-         from ctypes.util import find_library
-         libc_path = find_library("c")
-diff --git a/Lib/ctypes/test/test_libc.py b/Lib/ctypes/test/test_libc.py
---- a/Lib/ctypes/test/test_libc.py
-+++ b/Lib/ctypes/test/test_libc.py
-@@ -2,6 +2,7 @@ import unittest
-
- from ctypes import *
- import _ctypes_test
-+import platform
-
- lib = CDLL(_ctypes_test.__file__)
-
-@@ -17,6 +18,8 @@ class LibTest(unittest.TestCase):
-         import math
-         self.assertEqual(lib.my_sqrt(2.0), math.sqrt(2.0))
-
-+    @unittest.skipIf(platform.machine() in ['mips64'],
-+                     "This test fails on this platform")
-     def test_qsort(self):
-         comparefunc = CFUNCTYPE(c_int, POINTER(c_char), POINTER(c_char))
-         lib.my_qsort.argtypes = c_void_p, c_size_t, c_size_t, comparefunc
-diff --git a/Lib/distutils/tests/test_archive_util.py b/Lib/distutils/tests/test_archive_util.py
---- a/Lib/distutils/tests/test_archive_util.py
-+++ b/Lib/distutils/tests/test_archive_util.py
-@@ -333,6 +333,7 @@ class ArchiveUtilTestCase(support.TempdirManager,
-         self.assertEqual(os.path.basename(res), 'archive.tar.xz')
-         self.assertEqual(self._tarinfo(res), self._created_files)
-
-+    @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix")
-     def test_make_archive_owner_group(self):
-         # testing make_archive with owner and group, with various combinations
-         # this works even if there's not gid/uid support
-@@ -362,6 +363,7 @@ class ArchiveUtilTestCase(support.TempdirManager,
-
-     @unittest.skipUnless(ZLIB_SUPPORT, "Requires zlib")
-     @unittest.skipUnless(UID_GID_SUPPORT, "Requires grp and pwd support")
-+    @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix")
-     def test_tarfile_root_owner(self):
-         tmpdir =  self._create_files()
-         base_name = os.path.join(self.mkdtemp(), 'archive')
-diff --git a/Lib/distutils/tests/test_sdist.py b/Lib/distutils/tests/test_sdist.py
---- a/Lib/distutils/tests/test_sdist.py
-+++ b/Lib/distutils/tests/test_sdist.py
-@@ -443,6 +443,7 @@ class SDistTestCase(BasePyPIRCCommandTestCase):
-                      "The tar command is not found")
-     @unittest.skipIf(find_executable('gzip') is None,
-                      "The gzip command is not found")
-+    @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix")
-     def test_make_distribution_owner_group(self):
-         # now building a sdist
-         dist, cmd = self.get_cmd()
-diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
---- a/Lib/test/_test_multiprocessing.py
-+++ b/Lib/test/_test_multiprocessing.py
-@@ -1473,6 +1473,7 @@ class _TestCondition(BaseTestCase):
-         if pid is not None:
-             os.kill(pid, signal.SIGINT)
-
-+    @unittest.skipIf(True, "This fails for unknown reasons on Guix")
-     def test_wait_result(self):
-         if isinstance(self, ProcessesMixin) and sys.platform != 'win32':
-             pid = os.getpid()
-diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py
---- a/Lib/test/test_asyncio/test_base_events.py
-+++ b/Lib/test/test_asyncio/test_base_events.py
-@@ -1323,6 +1323,8 @@ class BaseEventLoopWithSelectorTests(test_utils.TestCase):
-         self._test_create_connection_ip_addr(m_socket, False)
-
-     @patch_socket
-+    @unittest.skipUnless(support.is_resource_enabled('network'),
-+                         'network is not enabled')
-     def test_create_connection_service_name(self, m_socket):
-         m_socket.getaddrinfo = socket.getaddrinfo
-         sock = m_socket.socket.return_value
-diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py
---- a/Lib/test/test_generators.py
-+++ b/Lib/test/test_generators.py
-@@ -34,6 +34,7 @@ class SignalAndYieldFromTest(unittest.TestCase):
-         else:
-             return "FAILED"
-
-+    @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build environment')
-     def test_raise_and_yield_from(self):
-         gen = self.generator1()
-         gen.send(None)
-diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py
---- a/Lib/test/test_pathlib.py
-+++ b/Lib/test/test_pathlib.py
-@@ -2134,8 +2134,7 @@ class PosixPathTest(_BasePathTest, unittest.TestCase):
-         self.assertEqual(given, expect)
-         self.assertEqual(set(p.rglob("FILEd*")), set())
-
--    @unittest.skipUnless(hasattr(pwd, 'getpwall'),
--                         'pwd module does not expose getpwall()')
-+    @unittest.skipIf(True, "Guix builder home is '/' which causes trouble for these tests")
-     def test_expanduser(self):
-         P = self.cls
-         support.import_module('pwd')
-diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py
---- a/Lib/test/test_pdb.py
-+++ b/Lib/test/test_pdb.py
-@@ -1150,11 +1150,11 @@ def test_pdb_issue_20766():
-     > <doctest test.test_pdb.test_pdb_issue_20766[0]>(6)test_function()
-     -> print('pdb %d: %s' % (i, sess._previous_sigint_handler))
-     (Pdb) continue
--    pdb 1: <built-in function default_int_handler>
-+    pdb 1: Handlers.SIG_IGN
-     > <doctest test.test_pdb.test_pdb_issue_20766[0]>(5)test_function()
-     -> sess.set_trace(sys._getframe())
-     (Pdb) continue
--    pdb 2: <built-in function default_int_handler>
-+    pdb 2: Handlers.SIG_IGN
-     """
-
-
-diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py
---- a/Lib/test/test_regrtest.py
-+++ b/Lib/test/test_regrtest.py
-@@ -762,6 +762,7 @@ class ArgsTestCase(BaseTestCase):
-         output = self.run_tests('--fromfile', filename)
-         self.check_executed_tests(output, tests)
-
-+    @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build environment.')
-     def test_interrupted(self):
-         code = TEST_INTERRUPTED
-         test = self.create_test('sigint', code=code)
-@@ -779,6 +780,7 @@ class ArgsTestCase(BaseTestCase):
-                  % (self.TESTNAME_REGEX, len(tests)))
-         self.check_line(output, regex)
-
-+    @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build environment.')
-     def test_slowest_interrupted(self):
-         # Issue #25373: test --slowest with an interrupted test
-         code = TEST_INTERRUPTED
-diff --git a/Lib/test/test_resource.py b/Lib/test/test_resource.py
---- a/Lib/test/test_resource.py
-+++ b/Lib/test/test_resource.py
-@@ -145,6 +145,7 @@ class ResourceTest(unittest.TestCase):
-
-     @unittest.skipUnless(hasattr(resource, 'prlimit'), 'no prlimit')
-     @support.requires_linux_version(2, 6, 36)
-+    @unittest.skipIf(True, "Bug: the PermissionError is not raised")
-     def test_prlimit(self):
-         self.assertRaises(TypeError, resource.prlimit)
-         self.assertRaises(ProcessLookupError, resource.prlimit,
-diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py
---- a/Lib/test/test_shutil.py
-+++ b/Lib/test/test_shutil.py
-@@ -1428,6 +1428,7 @@ class TestArchives(BaseTest, unittest.TestCase):
-         self.assertRaises(ValueError, make_archive, base_name, 'xxx')
-
-     @support.requires_zlib()
-+    @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix")
-     def test_make_archive_owner_group(self):
-         # testing make_archive with owner and group, with various combinations
-         # this works even if there's not gid/uid support
-@@ -1456,6 +1457,7 @@ class TestArchives(BaseTest, unittest.TestCase):
-
-
-     @support.requires_zlib()
-+    @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix")
-     @unittest.skipUnless(UID_GID_SUPPORT, "Requires grp and pwd support")
-     def test_tarfile_root_owner(self):
-         root_dir, base_dir = self._create_files()
-diff --git a/Lib/test/test_unicodedata.py b/Lib/test/test_unicodedata.py
---- a/Lib/test/test_unicodedata.py
-+++ b/Lib/test/test_unicodedata.py
-@@ -320,6 +320,7 @@ class NormalizationTest(unittest.TestCase):
-         data = [int(x, 16) for x in data.split(" ")]
-         return "".join([chr(x) for x in data])
-
-+    @unittest.skipIf(True, 'Network is not available in the Guix build environment')
-     def test_normalization(self):
-         TESTDATAFILE = "NormalizationTest.txt"
-         TESTDATAURL = f"http://www.pythontest.net/unicode/{unicodedata.unidata_version}/{TESTDATAFILE}"
-diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
---- a/Lib/test/test_socket.py
-+++ b/Lib/test/test_socket.py
-@@ -875,6 +875,8 @@ class GeneralModuleTests(unittest.TestCase):
-         if not fqhn in all_host_names:
-             self.fail("Error testing host resolution mechanisms. (fqdn: %s, all: %s)" % (fqhn, repr(all_host_names)))
-
-+    @unittest.skipUnless(support.is_resource_enabled('network'),
-+                         'network is not enabled')
-     def test_host_resolution(self):
-         for addr in [support.HOSTv4, '10.0.0.1', '255.255.255.255']:
-             self.assertEqual(socket.gethostbyname(addr), addr)
-@@ -1004,6 +1006,8 @@ class GeneralModuleTests(unittest.TestCase):
-             self.assertWarns(DeprecationWarning, socket.ntohs, k)
-             self.assertWarns(DeprecationWarning, socket.htons, k)
-
-+    @unittest.skipUnless(os.path.exists("/etc/services"),
-+                         "getservbyname uses /etc/services, which is not in the chroot")
-     def testGetServBy(self):
-         eq = self.assertEqual
-         # Find one service that exists, then check all the related interfaces.
-@@ -1358,6 +1362,8 @@ class GeneralModuleTests(unittest.TestCase):
-             raise
-         self.assertRaises(TypeError, s.ioctl, socket.SIO_LOOPBACK_FAST_PATH, None)
-
-+    @unittest.skipUnless(os.path.exists("/etc/gai.conf"),
-+                         "getaddrinfo() will fail")
-     def testGetaddrinfo(self):
-         try:
-             socket.getaddrinfo('localhost', 80)
-@@ -1440,6 +1446,8 @@ class GeneralModuleTests(unittest.TestCase):
-         # only IP addresses are allowed
-         self.assertRaises(OSError, socket.getnameinfo, ('mail.python.org',0), 0)
-
-+    @unittest.skipUnless(os.path.exists("/etc/gai.conf"),
-+                         "getaddrinfo() will fail")
-     @unittest.skipUnless(support.is_resource_enabled('network'),
-                          'network is not enabled')
-     def test_idna(self):
-diff --git a/Lib/test/test_spwd.py b/Lib/test/test_spwd.py
---- a/Lib/test/test_spwd.py
-+++ b/Lib/test/test_spwd.py
-@@ -5,8 +5,7 @@ from test import support
- spwd = support.import_module('spwd')
-
-
--@unittest.skipUnless(hasattr(os, 'geteuid') and os.geteuid() == 0,
--                     'root privileges required')
-+@unittest.skipUnless(os.path.exists("/etc/shadow"), 'spwd tests require /etc/shadow')
- class TestSpwdRoot(unittest.TestCase):
-
-     def test_getspall(self):
-@@ -56,8 +55,7 @@ class TestSpwdRoot(unittest.TestCase):
-             self.assertRaises(TypeError, spwd.getspnam, bytes_name)
-
-
--@unittest.skipUnless(hasattr(os, 'geteuid') and os.geteuid() != 0,
--                     'non-root user required')
-+@unittest.skipUnless(os.path.exists("/etc/shadow"), 'spwd tests require /etc/shadow')
- class TestSpwdNonRoot(unittest.TestCase):
-
-     def test_getspnam_exception(self):
-diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
---- a/Lib/test/test_tarfile.py
-+++ b/Lib/test/test_tarfile.py
-@@ -2509,9 +2509,12 @@ def root_is_uid_gid_0():
-         import pwd, grp
-     except ImportError:
-         return False
--    if pwd.getpwuid(0)[0] != 'root':
--        return False
--    if grp.getgrgid(0)[0] != 'root':
-+    try:
-+        if pwd.getpwuid(0)[0] != 'root':
-+            return False
-+        if grp.getgrgid(0)[0] != 'root':
-+            return False
-+    except KeyError:
-         return False
-     return True
-
-diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
---- a/Lib/test/test_threading.py
-+++ b/Lib/test/test_threading.py
-@@ -1249,6 +1249,7 @@ class MiscTestCase(unittest.TestCase):
-
-
- class InterruptMainTests(unittest.TestCase):
-+    @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build container.')
-     def test_interrupt_main_subthread(self):
-         # Calling start_new_thread with a function that executes interrupt_main
-         # should raise KeyboardInterrupt upon completion.
-@@ -1260,6 +1261,8 @@ class InterruptMainTests(unittest.TestCase):
-             t.join()
-         t.join()
-
-+
-+    @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build container.')
-     def test_interrupt_main_mainthread(self):
-         # Make sure that if interrupt_main is called in main thread that
-         # KeyboardInterrupt is raised instantly.
-diff --git a/Tools/scripts/run_tests.py b/Tools/scripts/run_tests.py
---- a/Tools/scripts/run_tests.py
-+++ b/Tools/scripts/run_tests.py
-@@ -39,7 +39,7 @@ def main(regrtest_args):
-     if not any(is_multiprocess_flag(arg) for arg in regrtest_args):
-         args.extend(['-j', '0'])  # Use all CPU cores
-     if not any(is_resource_use_flag(arg) for arg in regrtest_args):
--        args.extend(['-u', 'all,-largefile,-audio,-gui'])
-+        args.extend(['-u', 'all,-largefile,-audio,-gui,-network'])
-     args.extend(regrtest_args)
-     print(' '.join(args))
-     if sys.platform == 'win32':
-diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
-index 1474624..887f8ee 100644
---- a/Lib/test/_test_multiprocessing.py
-+++ b/Lib/test/_test_multiprocessing.py
-@@ -3801,6 +3801,7 @@ class _TestSharedMemory(BaseTestCase):
-         sms.close()
-
-     @unittest.skipIf(os.name != "posix", "not feasible in non-posix platforms")
-+    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
-     def test_shared_memory_SharedMemoryServer_ignores_sigint(self):
-         # bpo-36368: protect SharedMemoryManager server process from
-         # KeyboardInterrupt signals.
-diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py
-index d41e94b..a1c15e7 100644
---- a/Lib/test/test_signal.py
-+++ b/Lib/test/test_signal.py
-@@ -78,6 +78,7 @@ class PosixTests(unittest.TestCase):
-         self.assertLess(len(s), signal.NSIG)
-
-     @unittest.skipUnless(sys.executable, "sys.executable required.")
-+    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
-     def test_keyboard_interrupt_exit_code(self):
-         """KeyboardInterrupt triggers exit via SIGINT."""
-         process = subprocess.run(
-@@ -128,6 +129,7 @@ class WindowsSignalTests(unittest.TestCase):
-             signal.signal(7, handler)
-
-     @unittest.skipUnless(sys.executable, "sys.executable required.")
-+    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
-     def test_keyboard_interrupt_exit_code(self):
-         """KeyboardInterrupt triggers an exit using STATUS_CONTROL_C_EXIT."""
-         # We don't test via os.kill(os.getpid(), signal.CTRL_C_EVENT) here
-@@ -1245,6 +1247,7 @@ class StressTest(unittest.TestCase):
-
- class RaiseSignalTest(unittest.TestCase):
-
-+    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
-     def test_sigint(self):
-         with self.assertRaises(KeyboardInterrupt):
-             signal.raise_signal(signal.SIGINT)
-@@ -1279,6 +1279,7 @@ class PidfdSignalTest(unittest.TestCase):
-         hasattr(signal, "pidfd_send_signal"),
-         "pidfd support not built in",
-     )
-+    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
-     def test_pidfd_send_signal(self):
-         with self.assertRaises(OSError) as cm:
-             signal.pidfd_send_signal(0, signal.SIGINT)
-diff --git a/Lib/ctypes/test/test_find.py b/Lib/ctypes/test/test_find.py
-index 92ac184..49eec2c 100644
---- a/Lib/ctypes/test/test_find.py
-+++ b/Lib/ctypes/test/test_find.py
-@@ -116,6 +116,7 @@ class FindLibraryLinux(unittest.TestCase):
-         with unittest.mock.patch("ctypes.util._findSoname_ldconfig", lambda *args: None):
-             self.assertNotEqual(find_library('c'), None)
-
-+    @unittest.skipIf(True, "This fails for unknown reasons on Guix")
-     def test_find_library_with_ld(self):
-         with unittest.mock.patch("ctypes.util._findSoname_ldconfig", lambda *args: None), \
-              unittest.mock.patch("ctypes.util._findLib_gcc", lambda *args: None):
diff --git a/gnu/packages/patches/python-babel-fix-parse-future-test.patch b/gnu/packages/patches/python-babel-fix-parse-future-test.patch
new file mode 100644
index 0000000000..8a90166ec5
--- /dev/null
+++ b/gnu/packages/patches/python-babel-fix-parse-future-test.patch
@@ -0,0 +1,68 @@
+From 7bdaa28a55e8d8228d5434effa4b1473ab7b3669 Mon Sep 17 00:00:00 2001
+From: Felix Schwarz <felix.schwarz@oss.schwarz.eu>
+Date: Tue, 5 May 2020 08:05:56 +0000
+Subject: [PATCH] fix tests when using Python 3.9a6
+
+In Python 3.9a6 integer values for future flags were changed to prevent
+collision with compiler flags. We need to retrieve these at runtime so
+the test suite works with Python <= 3.8 as well as Python 3.9.
+---
+ tests/test_util.py | 17 ++++++++++++-----
+ 1 file changed, 12 insertions(+), 5 deletions(-)
+
+diff --git a/tests/test_util.py b/tests/test_util.py
+index a6a4450c..b9343aaa 100644
+--- a/tests/test_util.py
++++ b/tests/test_util.py
+@@ -11,6 +11,7 @@
+ # individuals. For the exact contribution history, see the revision
+ # history and logs, available at http://babel.edgewall.org/log/.
+ 
++import __future__
+ import unittest
+ 
+ import pytest
+@@ -20,6 +21,12 @@
+ from babel.util import parse_future_flags
+ 
+ 
++class _FF:
++    division         = __future__.division.compiler_flag
++    print_function   = __future__.print_function.compiler_flag
++    with_statement   = __future__.with_statement.compiler_flag
++    unicode_literals = __future__.unicode_literals.compiler_flag
++
+ def test_distinct():
+     assert list(util.distinct([1, 2, 1, 3, 4, 4])) == [1, 2, 3, 4]
+     assert list(util.distinct('foobar')) == ['f', 'o', 'b', 'a', 'r']
+@@ -70,25 +77,25 @@ def test_parse_encoding_non_ascii():
+ from __future__ import print_function,
+     division, with_statement,
+     unicode_literals
+-''', 0x10000 | 0x2000 | 0x8000 | 0x20000),
++''', _FF.print_function | _FF.division | _FF.with_statement | _FF.unicode_literals),
+     ('''
+ from __future__ import print_function, division
+ print('hello')
+-''', 0x10000 | 0x2000),
++''', _FF.print_function | _FF.division),
+     ('''
+ from __future__ import print_function, division, unknown,,,,,
+ print 'hello'
+-''', 0x10000 | 0x2000),
++''', _FF.print_function | _FF.division),
+     ('''
+ from __future__ import (
+     print_function,
+     division)
+-''', 0x10000 | 0x2000),
++''', _FF.print_function | _FF.division),
+     ('''
+ from __future__ import \\
+     print_function, \\
+     division
+-''', 0x10000 | 0x2000),
++''', _FF.print_function | _FF.division),
+ ])
+ def test_parse_future(source, result):
+     fp = BytesIO(source.encode('latin-1'))
diff --git a/gnu/packages/patches/python-chai-drop-python2.patch b/gnu/packages/patches/python-chai-drop-python2.patch
new file mode 100644
index 0000000000..0eb980e5db
--- /dev/null
+++ b/gnu/packages/patches/python-chai-drop-python2.patch
@@ -0,0 +1,32 @@
+Patch copied from Gentoo removing obsolete Python2 code.
+
+--- a/chai/chai.py
++++ b/chai/chai.py
+@@ -62,11 +62,6 @@
+             try:
+                 func(self, *args, **kwargs)
+             except UnexpectedCall as e:
+-                # if this is not python3, use python2 syntax
+-                if not hasattr(e, '__traceback__'):
+-                    from .python2 import reraise
+-                    reraise(
+-                        AssertionError, '\n\n' + str(e), sys.exc_info()[-1])
+                 exc = AssertionError('\n\n' + str(e))
+                 setattr(exc, '__traceback__', sys.exc_info()[-1])
+                 raise exc
+--- a/chai/python2.py
++++ b/chai/python2.py
+@@ -1,3 +0,0 @@
+-
+-def reraise(exc, msg, traceback):
+-    raise exc, msg, traceback
+--- a/chai.egg-info/SOURCES.txt
++++ b/chai.egg-info/SOURCES.txt
+@@ -10,7 +10,6 @@
+ chai/exception.py
+ chai/expectation.py
+ chai/mock.py
+-chai/python2.py
+ chai/spy.py
+ chai/stub.py
+ chai.egg-info/PKG-INFO
diff --git a/gnu/packages/patches/python-docopt-pytest6-compat.patch b/gnu/packages/patches/python-docopt-pytest6-compat.patch
new file mode 100644
index 0000000000..acd4955778
--- /dev/null
+++ b/gnu/packages/patches/python-docopt-pytest6-compat.patch
@@ -0,0 +1,29 @@
+https://sources.debian.org/data/main/d/docopt/0.6.2-3/debian/patches/pytest6
+
+From: Michael R. Crusoe <crusoe@debian.org>
+Subject: fix for pytest 6.x comptability
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=979285
+
+--- docopt.orig/conftest.py
++++ docopt/conftest.py
+@@ -11,6 +11,8 @@
+ 
+ def pytest_collect_file(path, parent):
+     if path.ext == ".docopt" and path.basename.startswith("test"):
++        if hasattr(DocoptTestFile, "from_parent"):
++            return DocoptTestFile.from_parent(parent, fspath=path)
+         return DocoptTestFile(path, parent)
+ 
+ 
+@@ -41,7 +43,10 @@
+         for name, doc, cases in parse_test(raw):
+             name = self.fspath.purebasename
+             for case in cases:
+-                yield DocoptTestItem("%s(%d)" % (name, index), self, doc, case)
++                if hasattr(DocoptTestItem, "from_parent"):
++                    yield DocoptTestItem.from_parent(self, name="%s(%d)" % (name, index), doc=doc, case=case)
++                else:
++                    yield DocoptTestItem("%s(%d)" % (name, index), self, doc, case)
+                 index += 1
+ 
+ 
diff --git a/gnu/packages/patches/python-fixtures-remove-monkeypatch-test.patch b/gnu/packages/patches/python-fixtures-remove-monkeypatch-test.patch
new file mode 100644
index 0000000000..4ffe9b373d
--- /dev/null
+++ b/gnu/packages/patches/python-fixtures-remove-monkeypatch-test.patch
@@ -0,0 +1,59 @@
+https://sources.debian.org/data/main/p/python-fixtures/3.0.0-4/debian/patches/remove-broken-monkey-patch-test.patch
+
+The last release was May 2016. This can be removed when the next release happens.
+
+Description: Remove broken monkey patch tests
+Author: Thomas Goirand <zigo@debian.org>
+Bug-Debian: https://bugs.debian.org/973239
+Forwarded: no
+Last-Update: 2020-11-12
+
+--- python-fixtures-3.0.0.orig/fixtures/tests/_fixtures/test_monkeypatch.py
++++ python-fixtures-3.0.0/fixtures/tests/_fixtures/test_monkeypatch.py
+@@ -181,22 +181,6 @@ class TestMonkeyPatch(testtools.TestCase
+         self._check_restored_static_or_class_method(oldmethod, oldmethod_inst,
+                 C, 'foo_cls')
+ 
+-    def test_patch_classmethod_with_classmethod(self):
+-        oldmethod = C.foo_cls
+-        oldmethod_inst = C().foo_cls
+-        fixture = MonkeyPatch(
+-            'fixtures.tests._fixtures.test_monkeypatch.C.foo_cls',
+-            D.bar_cls_args)
+-        with fixture:
+-            cls, target_class = C.foo_cls()
+-            self.expectThat(cls, Is(D))
+-            self.expectThat(target_class, Is(C))
+-            cls, target_class = C().foo_cls()
+-            self.expectThat(cls, Is(D))
+-            self.expectThat(target_class, Is(C))
+-        self._check_restored_static_or_class_method(oldmethod, oldmethod_inst,
+-                C, 'foo_cls')
+-
+     def test_patch_classmethod_with_function(self):
+         oldmethod = C.foo_cls
+         oldmethod_inst = C().foo_cls
+@@ -212,23 +196,6 @@ class TestMonkeyPatch(testtools.TestCase
+         self._check_restored_static_or_class_method(oldmethod, oldmethod_inst,
+                 C, 'foo_cls')
+ 
+-    def test_patch_classmethod_with_boundmethod(self):
+-        oldmethod = C.foo_cls
+-        oldmethod_inst = C().foo_cls
+-        d = D()
+-        fixture = MonkeyPatch(
+-            'fixtures.tests._fixtures.test_monkeypatch.C.foo_cls',
+-            d.bar_two_args)
+-        with fixture:
+-            slf, cls = C.foo_cls()
+-            self.expectThat(slf, Is(d))
+-            self.expectThat(cls, Is(C))
+-            slf, cls = C().foo_cls()
+-            self.expectThat(slf, Is(d))
+-            self.expectThat(cls, Is(C))
+-        self._check_restored_static_or_class_method(oldmethod, oldmethod_inst,
+-                C, 'foo_cls')
+-
+     def test_patch_function_with_staticmethod(self):
+         oldmethod = fake_no_args
+         fixture = MonkeyPatch(
diff --git a/gnu/packages/patches/python-magic-python-bytecode.patch b/gnu/packages/patches/python-magic-python-bytecode.patch
new file mode 100644
index 0000000000..997fb4ee5a
--- /dev/null
+++ b/gnu/packages/patches/python-magic-python-bytecode.patch
@@ -0,0 +1,19 @@
+File 5.41 changed the MIME type of Python bytecode; adjust accordingly.
+
+Taken from upstream:
+
+  https://github.com/ahupp/python-magic/commit/0ae7e7ceac0e80e03adc75c858bb378c0427331a
+
+diff --git a/test/test.py b/test/test.py
+index 0c4621c..e443b84 100755
+--- a/test/test.py
++++ b/test/test.py
+@@ -90,7 +90,7 @@ def test_mime_types(self):
+         try:
+             m = magic.Magic(mime=True)
+             self.assert_values(m, {
+-                'magic._pyc_': ('application/octet-stream', 'text/x-bytecode.python'),
++                'magic._pyc_': ('application/octet-stream', 'text/x-bytecode.python', 'application/x-bytecode.python'),
+                 'test.pdf': 'application/pdf',
+                 'test.gz': ('application/gzip', 'application/x-gzip'),
+                 'test.snappy.parquet': 'application/octet-stream',
diff --git a/gnu/packages/patches/python-pdoc3-tests.patch b/gnu/packages/patches/python-pdoc3-tests.patch
new file mode 100644
index 0000000000..a411b300ee
--- /dev/null
+++ b/gnu/packages/patches/python-pdoc3-tests.patch
@@ -0,0 +1,42 @@
+Taken from upstream: https://github.com/pdoc3/pdoc/commit/4aa70de2221a34a3003a7e5f52a9b91965f0e359.patch.
+
+From 4aa70de2221a34a3003a7e5f52a9b91965f0e359 Mon Sep 17 00:00:00 2001
+From: Spencer Baugh <sbaugh@catern.com>
+Date: Thu, 23 Sep 2021 09:00:25 -0400
+Subject: [PATCH] TST: use explicit ClassWithNew instead of typing.Generic
+
+typing.Generic doesn't have a __new__ method in 3.9.
+
+Fixes https://github.com/pdoc3/pdoc/issues/355
+---
+ pdoc/test/__init__.py | 10 +++++++---
+ 1 file changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/pdoc/test/__init__.py b/pdoc/test/__init__.py
+index e8c3d94..8b67ab7 100644
+--- a/pdoc/test/__init__.py
++++ b/pdoc/test/__init__.py
+@@ -1043,16 +1043,20 @@ class C2:
+ 
+         self.assertEqual(pdoc.Class('C2', mod, C2).params(), ['a', 'b', 'c=None', '*', 'd=1', 'e'])
+ 
+-        class G(typing.Generic[T]):
++        class ClassWithNew:
++            def __new__(self, arg):
++                pass
++
++        class G(ClassWithNew):
+             def __init__(self, a, b, c=100):
+                 pass
+ 
+         self.assertEqual(pdoc.Class('G', mod, G).params(), ['a', 'b', 'c=100'])
+ 
+-        class G2(typing.Generic[T]):
++        class G2(ClassWithNew):
+             pass
+ 
+-        self.assertEqual(pdoc.Class('G2', mod, G2).params(), ['*args', '**kwds'])
++        self.assertEqual(pdoc.Class('G2', mod, G2).params(), ['arg'])
+ 
+     def test_url(self):
+         mod = pdoc.Module(EXAMPLE_MODULE)
diff --git a/gnu/packages/patches/python-peachpy-determinism.patch b/gnu/packages/patches/python-peachpy-determinism.patch
new file mode 100644
index 0000000000..f326a4b6b0
--- /dev/null
+++ b/gnu/packages/patches/python-peachpy-determinism.patch
@@ -0,0 +1,25 @@
+Make PeachPy processes deterministic:
+
+  https://github.com/Maratyszcza/PeachPy/issues/88
+  https://issues.guix.gnu.org/50672
+
+diff --git a/peachpy/name.py b/peachpy/name.py
+index b6a03dc..412079d 100644
+--- a/peachpy/name.py
++++ b/peachpy/name.py
+@@ -86,13 +86,13 @@ def add_scoped_name(self, scoped_name):
+                 self.names[scope_name.name] = scope
+         else:
+             assert scope_name.name is None
+-            self.prenames.setdefault(scope_name.prename, set())
++            self.prenames.setdefault(scope_name.prename, {})
+             if subscoped_name:
+                 for subscope in iter(self.prenames[scope_name.prename]):
+                     if isinstance(subscope, Namespace) and subscope.scope_name is scope_name:
+                         subscope.add_scoped_name(subscoped_name)
+                         return
+-            self.prenames[scope_name.prename].add(scope)
++            self.prenames[scope_name.prename][scope] = None
+ 
+     def assign_names(self):
+         # Step 1: assign names to symbols with prenames with no conflicts
diff --git a/gnu/packages/patches/python-piexif-fix-tests-with-pillow-7.2.patch b/gnu/packages/patches/python-piexif-fix-tests-with-pillow-7.2.patch
new file mode 100644
index 0000000000..874264dc25
--- /dev/null
+++ b/gnu/packages/patches/python-piexif-fix-tests-with-pillow-7.2.patch
@@ -0,0 +1,44 @@
+From 5209b53e9689ce28dcd045f384633378d619718f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jan=20Wi=C5=9Bniewski?= <vuko@vuko.pl>
+Date: Thu, 5 Nov 2020 16:18:52 +0100
+Subject: [PATCH] convert IFDRational to tuples in tests
+
+This fixes tests with Pillow version >= 7.2.0
+---
+ tests/s_test.py | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/tests/s_test.py b/tests/s_test.py
+index 5d105de..a7cad54 100644
+--- a/tests/s_test.py
++++ b/tests/s_test.py
+***************
+*** 9,14 ****
+--- 9,15 ----
+  import time

+  import unittest

+  

++ import PIL

+  from PIL import Image

+  import piexif

+  from piexif import _common, ImageIFD, ExifIFD, GPSIFD, TAGS, InvalidImageDataError

+***************
+*** 580,585 ****
+--- 581,597 ----
+  # test utility methods----------------------------------------------

+  

+      def _compare_value(self, v1, v2):

++         if isinstance(v2, PIL.TiffImagePlugin.IFDRational):

++             v2 = (v2.numerator, v2.denominator)

++         if isinstance(v2, tuple):

++             converted_v2 = []

++             for el in v2:

++                 if isinstance(el, PIL.TiffImagePlugin.IFDRational):

++                     converted_v2.append((el.numerator, el.denominator))

++                 else:

++                     converted_v2.append(el)

++             v2 = tuple(converted_v2)

++ 

+          if type(v1) != type(v2):

+              if isinstance(v1, tuple):

+                  self.assertEqual(pack_byte(*v1), v2)

diff --git a/gnu/packages/patches/python-poppler-qt5-fix-build.patch b/gnu/packages/patches/python-poppler-qt5-fix-build.patch
new file mode 100644
index 0000000000..099bb86d2f
--- /dev/null
+++ b/gnu/packages/patches/python-poppler-qt5-fix-build.patch
@@ -0,0 +1,116 @@
+Patch taken from the upstream repository
+https://github.com/frescobaldi/python-poppler-qt5/issues/43
+
+From 92e5962ec3751ab051d0b655fd61afc7a1cf709e Mon Sep 17 00:00:00 2001
+From: Ben Greiner <code@bnavigator.de>
+Date: Thu, 4 Mar 2021 17:02:51 +0100
+Subject: [PATCH] map type QVector< QPair<TYPE, TYPE> > for
+ FormFieldChoice::choicesWithExportValues() (#45)
+
+---
+ types.sip | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 93 insertions(+)
+
+diff --git a/types.sip b/types.sip
+index 239b8c9..81cb283 100644
+--- a/types.sip
++++ b/types.sip
+@@ -331,5 +331,98 @@ template <TYPE>
+ };
+ 
+ 
++/**
++ * Convert QVector< QPair<TYPE, TYPE> >
++ * from and to a Python list of a 2-item tuple
++ */
++
++template<TYPE>
++%MappedType QVector< QPair<TYPE, TYPE> >
++{
++%TypeHeaderCode
++#include <qvector.h>
++#include <qpair.h>
++%End
++
++%ConvertFromTypeCode
++  // Create the list.
++  PyObject *l;
++
++  if ((l = PyList_New(sipCpp->size())) == NULL)
++      return NULL;
++
++  // Set the list elements.
++  for (int i = 0; i < sipCpp->size(); ++i)
++  {
++    QPair<TYPE, TYPE>* p = new QPair<TYPE, TYPE>(sipCpp->at(i));
++    PyObject *ptuple = PyTuple_New(2);
++    PyObject *pfirst;
++    PyObject *psecond;
++
++    TYPE *sfirst = new TYPE(p->first);
++    if ((pfirst = sipConvertFromType(sfirst, sipType_TYPE, sipTransferObj)) == NULL)
++    {
++      Py_DECREF(l);
++      Py_DECREF(ptuple);
++      return NULL;
++    }
++    PyTuple_SET_ITEM(ptuple, 0, pfirst);
++
++    TYPE *ssecond = new TYPE(p->second);
++    if ((psecond = sipConvertFromType(ssecond, sipType_TYPE, sipTransferObj)) == NULL)
++    {
++      Py_DECREF(l);
++      Py_DECREF(ptuple);
++      Py_DECREF(pfirst);
++      return NULL;
++    }
++    PyTuple_SET_ITEM(ptuple, 1, psecond);
++
++    PyList_SET_ITEM(l, i, ptuple);
++  }
++
++  return l;
++%End
++
++%ConvertToTypeCode
++  const sipTypeDef* qpair_type = sipFindType("QPair<TYPE, TYPE>");
++
++  // Check the type if that is all that is required.
++  if (sipIsErr == NULL)
++  {
++    if (!PySequence_Check(sipPy))
++      return 0;
++
++    for (int i = 0; i < PySequence_Size(sipPy); ++i)
++      if (!sipCanConvertToType(PySequence_ITEM(sipPy, i), qpair_type, SIP_NOT_NONE))
++        return 0;
++
++    return 1;
++  }
++
++
++  QVector< QPair<TYPE, TYPE> > *qv = new QVector< QPair<TYPE, TYPE> >;
++
++  for (int i = 0; i < PySequence_Size(sipPy); ++i)
++  {
++    int state;
++    QPair<TYPE, TYPE> * p = reinterpret_cast< QPair<TYPE, TYPE> * >(sipConvertToType(PySequence_ITEM(sipPy, i), qpair_type, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr));
++
++    if (*sipIsErr)
++    {
++      sipReleaseType(p, qpair_type, state);
++      delete qv;
++      return 0;
++    }
++    qv->append(*p);
++    sipReleaseType(p, qpair_type, state);
++  }
++
++  *sipCppPtr = qv;
++  return sipGetState(sipTransferObj);
++%End
++
++};
++
+ 
+ /* kate: indent-width 4; space-indent on; hl c++; indent-mode cstyle; */
diff --git a/gnu/packages/patches/python-pydot-regression-test.patch b/gnu/packages/patches/python-pydot-regression-test.patch
deleted file mode 100644
index d2f0f5996e..0000000000
--- a/gnu/packages/patches/python-pydot-regression-test.patch
+++ /dev/null
@@ -1,79 +0,0 @@
-This patch is taken from the upstream repository
-https://github.com/pydot/pydot/commit/a10ced4d132361027a545a471af4541dea8c5cf5.patch
-It should be included in the 1.4.2 release.
-
-
-From a10ced4d132361027a545a471af4541dea8c5cf5 Mon Sep 17 00:00:00 2001
-From: Peter Nowee <peter@peternowee.com>
-Date: Wed, 26 Jun 2019 15:43:38 +0800
-Subject: [PATCH] Fix multi.dot Graphviz regression test
-
-Commit d6602ad of 2018-12-01 fixed the regression test broken by commit
-2d55978 of 2016-07-01. This revealed that `test/graphs/multi.dot` was
-failing.
-
-`multi.dot` was introduced in commit 2b3f088 of 2010-11-07 together
-with many of the other tests still here today. It has not been touched
-since. It is a DOT-file containing two digraphs. The regression test
-compares the JPEG images rendered from the DOT-file by pydot with those
-rendered by Graphviz's dot directly.
-
-Commit 66734d2 of 2016-07-01 is the actual cause of the failure. It
-changed one of the render methods of the regression test,
-`_render_with_pydot`, from calculating a single hash for all the JPEG
-images to calculating separate hashes for each JPEG image and then
-concatenating those hashes in one long string. The other render method,
-`_render_with_graphviz`, still calculates a single hash over all data.
-For DOT-files that generate only one image the end result is the same,
-but because `multi.dot` has two graphs, it produces two images and this
-leads to comparing a string of two hashes with one single hash.
-
-I do not think the change in generating the hash was intentional, for
-the following reasons:
-- Commit 66734d2 states that its purpose was to adapt the test to an
-  API change in pydot. It does not mention a deliberate choice to
-  change the testing method.
-- There was no effort to change `_render_with_graphviz` to also produce
-  multiple hashes.
-- Except for easier debugging in case of a failing test with multiple
-  images (AFAICT, only `multi.dot`), I do not see much added benefit in
-  checking a concatenation of the hashes of all images vs. checking one
-  hash of all images together: In both cases the test will fail if one
-  or more images is rendered differently.
-- Given that there were many commits authored that same hour, including
-  commit 2d55978 which broke the regression tests, I suspect the author
-  did not run the tests for each individual commit, but only at the end
-  of that batch, and was therefore also not alerted of this change by
-  the test suite.
-
-Assuming that the change was not intended, this commit will now revert
-`_render_with_pydot` to the old behavior of calculating a single hash
-from all JPEG image data.
-
-Tested with Debian 9.9, Graphviz 2.38.0-17, Python 2.7.13-2 and 3.5.3-1.
-
-Fixes https://github.com/pydot/pydot/issues/204.
----
- test/pydot_unittest.py | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/test/pydot_unittest.py b/test/pydot_unittest.py
-index 881ee16..64aa856 100644
---- a/test/pydot_unittest.py
-+++ b/test/pydot_unittest.py
-@@ -194,11 +194,11 @@ def _render_with_graphviz(self, filename, encoding):
- 
-     def _render_with_pydot(self, filename, encoding):
-         c = pydot.graph_from_dot_file(filename, encoding=encoding)
--        sha = ''
-+        jpe_data = bytearray()
-         for g in c:
--            jpe_data = g.create(prog=TEST_PROGRAM, format='jpe', encoding=encoding)
--            sha += sha256(jpe_data).hexdigest()
--        return sha
-+            jpe_data.extend(g.create(prog=TEST_PROGRAM, format='jpe',
-+                                     encoding=encoding))
-+        return sha256(jpe_data).hexdigest()
- 
-     def test_my_regression_tests(self):
-         path = os.path.join(test_dir, TESTS_DIR_1)
diff --git a/gnu/packages/patches/python-pyflakes-test-location.patch b/gnu/packages/patches/python-pyflakes-test-location.patch
new file mode 100644
index 0000000000..ea2c50c82e
--- /dev/null
+++ b/gnu/packages/patches/python-pyflakes-test-location.patch
@@ -0,0 +1,42 @@
+This patch fixes test failure related to reported source code locations.
+It is a backport of this patch:
+
+  commit 6a5f38b5ab12260fde8a0463acd433bc2d34dbcf
+  Author: Louis Sautier <sautier.louis@gmail.com>
+  Date:   Sat Oct 3 02:37:53 2020 +0200
+
+      Fix tests with Python 3.9, closes #549 (#586)
+
+      Stop allowing failures on Python nightly.
+
+diff --git a/pyflakes/test/test_api.py b/pyflakes/test/test_api.py
+index 128aa69..b728e65 100644
+--- a/pyflakes/test/test_api.py
++++ b/pyflakes/test/test_api.py
+@@ -515,6 +515,8 @@ def foo(bar=baz, bax):
+             if ERROR_HAS_LAST_LINE:
+                 if PYPY and sys.version_info >= (3,):
+                     column = 7
++                elif sys.version_info >= (3, 9):
++                    column = 21
+                 elif sys.version_info >= (3, 8):
+                     column = 9
+                 else:
+@@ -543,6 +545,8 @@ foo(bar=baz, bax)
+             if ERROR_HAS_LAST_LINE:
+                 if PYPY and sys.version_info >= (3,):
+                     column = 12
++                elif sys.version_info >= (3, 9):
++                    column = 17
+                 elif sys.version_info >= (3, 8):
+                     column = 14
+                 else:
+@@ -577,6 +581,8 @@ foo(bar=baz, bax)
+                 position_end = 1
+                 if PYPY:
+                     column = 6
++                elif ver >= (3, 9):
++                    column = 13
+                 else:
+                     column = 7
+                     # Column has been "fixed" since 3.2.4 and 3.3.1
diff --git a/gnu/packages/patches/python-pytorch-system-libraries.patch b/gnu/packages/patches/python-pytorch-system-libraries.patch
index 76c06520f0..ae872cfd84 100644
--- a/gnu/packages/patches/python-pytorch-system-libraries.patch
+++ b/gnu/packages/patches/python-pytorch-system-libraries.patch
@@ -1,37 +1,11 @@
 Use our own googletest rather than the bundled one.
 Get NNPACK to use our own PeachPy rather than the bundled one.
 
-diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
-index 5d57b9ca78..620cca4e60 100644
---- a/cmake/Dependencies.cmake
-+++ b/cmake/Dependencies.cmake
-@@ -644,11 +644,6 @@ if(BUILD_TEST OR BUILD_MOBILE_BENCHMARK OR BUILD_MOBILE_TEST)
-   # this shouldn't be necessary anymore.
-   get_property(INC_DIR_temp DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
-   set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES "")
--  add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest)
--  set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES ${INC_DIR_temp})
--
--  include_directories(BEFORE SYSTEM ${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest/googletest/include)
--  include_directories(BEFORE SYSTEM ${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest/googlemock/include)
- 
-   # We will not need to test benchmark lib itself.
-   set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "Disable benchmark testing as we don't need it.")
-@@ -1485,7 +1480,7 @@ if(CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO AND NOT INTERN_DISABLE_ONNX)
-     endif()
-     set_property(TARGET onnx_proto PROPERTY IMPORTED_LOCATION ${ONNX_PROTO_LIBRARY})
-     message("-- Found onnx: ${ONNX_LIBRARY} ${ONNX_PROTO_LIBRARY}")
--    list(APPEND Caffe2_DEPENDENCY_LIBS onnx_proto onnx)
-+    list(APPEND Caffe2_DEPENDENCY_LIBS onnx_proto onnx onnx_optimizer)
-   endif()
-   include_directories(${FOXI_INCLUDE_DIRS})
-   list(APPEND Caffe2_DEPENDENCY_LIBS foxi_loader)
-
 diff --git a/caffe2/CMakeLists.txt b/caffe2/CMakeLists.txt
-index 50ebb224ce..5953d9ddf7 100644
+index 26210cb5..18b6df27 100644
 --- a/caffe2/CMakeLists.txt
 +++ b/caffe2/CMakeLists.txt
-@@ -1632,7 +1632,7 @@ if(BUILD_TEST)
+@@ -1723,7 +1723,7 @@ if(BUILD_TEST)
          if(NOT MSVC)
            add_executable(${test_name}_${CPU_CAPABILITY} "${test_src}" ../aten/src/ATen/native/quantized/affine_quantizer_base.cpp)
            # TODO: Get rid of c10 dependency (which is only needed for the implementation of AT_ERROR)
@@ -40,16 +14,16 @@ index 50ebb224ce..5953d9ddf7 100644
            if(USE_FBGEMM)
              target_link_libraries(${test_name}_${CPU_CAPABILITY} fbgemm)
            endif()
-@@ -1655,7 +1655,7 @@ if(BUILD_TEST)
+@@ -1746,7 +1746,7 @@ if(BUILD_TEST)
    foreach(test_src ${Caffe2_CPU_TEST_SRCS})
      get_filename_component(test_name ${test_src} NAME_WE)
      add_executable(${test_name} "${test_src}")
 -    target_link_libraries(${test_name} torch_library gtest_main)
 +    target_link_libraries(${test_name} torch_library gtest_main gtest)
-     target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
-     target_include_directories(${test_name} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
-     target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
-@@ -1673,7 +1673,7 @@ if(BUILD_TEST)
+     if(USE_OPENMP)
+       # -fopenmp is a compile time flag and as result not guaranteed
+       # to link executable against OpenMP runtime library
+@@ -1769,7 +1769,7 @@ if(BUILD_TEST)
      foreach(test_src ${Caffe2_GPU_TEST_SRCS})
        get_filename_component(test_name ${test_src} NAME_WE)
        cuda_add_executable(${test_name} "${test_src}")
@@ -58,7 +32,7 @@ index 50ebb224ce..5953d9ddf7 100644
        target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
        target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
        add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
-@@ -1691,7 +1691,7 @@ if(BUILD_TEST)
+@@ -1787,7 +1787,7 @@ if(BUILD_TEST)
      foreach(test_src ${Caffe2_VULKAN_TEST_SRCS})
        get_filename_component(test_name ${test_src} NAME_WE)
        add_executable(${test_name} "${test_src}")
@@ -67,7 +41,7 @@ index 50ebb224ce..5953d9ddf7 100644
        target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
        target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
        add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
-@@ -1709,7 +1709,7 @@ if(BUILD_TEST)
+@@ -1805,7 +1805,7 @@ if(BUILD_TEST)
      foreach(test_src ${Caffe2_HIP_TEST_SRCS})
        get_filename_component(test_name ${test_src} NAME_WE)
        add_executable(${test_name} "${test_src}")
@@ -76,47 +50,33 @@ index 50ebb224ce..5953d9ddf7 100644
        target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
        target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE} ${Caffe2_HIP_INCLUDE})
        target_compile_options(${test_name} PRIVATE ${HIP_CXX_FLAGS})
-
-diff --git a/torch/lib/c10d/test/CMakeLists.txt b/torch/lib/c10d/test/CMakeLists.txt
-index b74d4b65f7..fc7c207505 100644
---- a/torch/lib/c10d/test/CMakeLists.txt
-+++ b/torch/lib/c10d/test/CMakeLists.txt
-@@ -16,24 +16,24 @@ function(c10d_add_test test_src)
-   add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
- endfunction()
- 
--c10d_add_test(FileStoreTest.cpp c10d gtest_main)
--c10d_add_test(TCPStoreTest.cpp c10d gtest_main)
-+c10d_add_test(FileStoreTest.cpp c10d gtest_main gtest)
-+c10d_add_test(TCPStoreTest.cpp c10d gtest_main gtest)
- if(NOT WIN32)
--  c10d_add_test(HashStoreTest.cpp c10d gtest_main)
-+  c10d_add_test(HashStoreTest.cpp c10d gtest_main gtest)
- endif()
+diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
+index ca560288..c0696e53 100644
+--- a/cmake/Dependencies.cmake
++++ b/cmake/Dependencies.cmake
+@@ -684,11 +684,6 @@ if(BUILD_TEST OR BUILD_MOBILE_BENCHMARK OR BUILD_MOBILE_TEST)
+   # this shouldn't be necessary anymore.
+   get_property(INC_DIR_temp DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
+   set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES "")
+-  add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest)
+-  set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES ${INC_DIR_temp})
+-
+-  include_directories(BEFORE SYSTEM ${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest/googletest/include)
+-  include_directories(BEFORE SYSTEM ${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest/googlemock/include)
  
- if(USE_CUDA)
-   if(USE_C10D_GLOO)
--    c10d_add_test(ProcessGroupGlooTest.cpp c10d c10d_cuda_test gtest_main)
--    c10d_add_test(ProcessGroupGlooAsyncTest.cpp c10d c10d_cuda_test gtest_main)
-+    c10d_add_test(ProcessGroupGlooTest.cpp c10d c10d_cuda_test gtest_main gtest)
-+    c10d_add_test(ProcessGroupGlooAsyncTest.cpp c10d c10d_cuda_test gtest_main gtest)
-   endif()
-   if(USE_C10D_NCCL)
--    c10d_add_test(ProcessGroupNCCLTest.cpp c10d c10d_cuda_test gtest_main)
-+    c10d_add_test(ProcessGroupNCCLTest.cpp c10d c10d_cuda_test gtest_main gtest)
-     c10d_add_test(ProcessGroupNCCLErrorsTest.cpp c10d c10d_cuda_test
--        gtest_main)
-+        gtest_main gtest)
-   endif()
- else()
-   if(USE_C10D_GLOO)
--    c10d_add_test(ProcessGroupGlooTest.cpp c10d gtest_main)
-+    c10d_add_test(ProcessGroupGlooTest.cpp c10d gtest_main gtest)
+   # We will not need to test benchmark lib itself.
+   set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "Disable benchmark testing as we don't need it.")
+@@ -1537,7 +1532,7 @@ if(CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO AND NOT INTERN_DISABLE_ONNX)
+     endif()
+     set_property(TARGET onnx_proto PROPERTY IMPORTED_LOCATION ${ONNX_PROTO_LIBRARY})
+     message("-- Found onnx: ${ONNX_LIBRARY} ${ONNX_PROTO_LIBRARY}")
+-    list(APPEND Caffe2_DEPENDENCY_LIBS onnx_proto onnx)
++    list(APPEND Caffe2_DEPENDENCY_LIBS onnx_proto onnx onnx_optimizer)
    endif()
- endif()
-
+   include_directories(${FOXI_INCLUDE_DIRS})
+   list(APPEND Caffe2_DEPENDENCY_LIBS foxi_loader)
 diff --git a/cmake/External/nnpack.cmake b/cmake/External/nnpack.cmake
-index a41343cbb5..6075bdd0a4 100644
+index a41343cb..6075bdd0 100644
 --- a/cmake/External/nnpack.cmake
 +++ b/cmake/External/nnpack.cmake
 @@ -40,7 +40,7 @@ endif()
@@ -137,3 +97,61 @@ index a41343cbb5..6075bdd0a4 100644
 -set(USE_NNPACK OFF)
 +set(NNPACK_FOUND TRUE)
 +set(USE_NNPACK ON)
+diff --git a/test/cpp/c10d/CMakeLists.txt b/test/cpp/c10d/CMakeLists.txt
+index 2e48773a..a70506ce 100644
+--- a/test/cpp/c10d/CMakeLists.txt
++++ b/test/cpp/c10d/CMakeLists.txt
+@@ -17,14 +17,14 @@ function(c10d_add_test test_src)
+   add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
+ endfunction()
+ 
+-c10d_add_test(FileStoreTest.cpp torch_cpu gtest_main)
+-c10d_add_test(TCPStoreTest.cpp torch_cpu gtest_main)
++c10d_add_test(FileStoreTest.cpp torch_cpu gtest_main gtest)
++c10d_add_test(TCPStoreTest.cpp torch_cpu gtest_main gtest)
+ if(INSTALL_TEST)
+   install(TARGETS FileStoreTest DESTINATION bin)
+   install(TARGETS TCPStoreTest DESTINATION bin)
+ endif()
+ if(NOT WIN32)
+-  c10d_add_test(HashStoreTest.cpp torch_cpu gtest_main)
++  c10d_add_test(HashStoreTest.cpp torch_cpu gtest_main gtest)
+   if(INSTALL_TEST)
+     install(TARGETS HashStoreTest DESTINATION bin)
+   endif()
+@@ -32,11 +32,11 @@ endif()
+ 
+ if(USE_CUDA)
+   if(USE_GLOO AND USE_C10D_GLOO)
+-    c10d_add_test(ProcessGroupGlooTest.cpp torch_cpu c10d_cuda_test gtest_main)
++    c10d_add_test(ProcessGroupGlooTest.cpp torch_cpu c10d_cuda_test gtest_main gtest)
+     if(INSTALL_TEST)
+       install(TARGETS ProcessGroupGlooTest DESTINATION bin)
+     endif()
+-    c10d_add_test(ProcessGroupGlooAsyncTest.cpp torch_cpu c10d_cuda_test gtest_main)
++    c10d_add_test(ProcessGroupGlooAsyncTest.cpp torch_cpu c10d_cuda_test gtest_main gtest)
+   endif()
+   if(USE_NCCL AND USE_C10D_NCCL)
+     # NCCL is a private dependency of libtorch, but the tests include some
+@@ -57,7 +57,7 @@ if(USE_CUDA)
+   endif()
+ else()
+   if(USE_GLOO AND USE_C10D_GLOO)
+-    c10d_add_test(ProcessGroupGlooTest.cpp torch_cpu gtest_main)
++    c10d_add_test(ProcessGroupGlooTest.cpp torch_cpu gtest_main gtest)
+   endif()
+ endif()
+ 
+diff --git a/test/cpp/tensorexpr/CMakeLists.txt b/test/cpp/tensorexpr/CMakeLists.txt
+index 213e99bd..ecaae840 100644
+--- a/test/cpp/tensorexpr/CMakeLists.txt
++++ b/test/cpp/tensorexpr/CMakeLists.txt
+@@ -46,7 +46,7 @@ target_include_directories(tutorial_tensorexpr PRIVATE ${ATen_CPU_INCLUDE})
+ # pthreadpool header. For some build environment we need add the dependency
+ # explicitly.
+ if(USE_PTHREADPOOL)
+-  target_link_libraries(test_tensorexpr PRIVATE pthreadpool_interface)
++  target_link_libraries(test_tensorexpr PRIVATE pthreadpool)
+ endif()
+ if(USE_CUDA)
+   target_link_libraries(test_tensorexpr PRIVATE
diff --git a/gnu/packages/patches/python-random2-getrandbits-test.patch b/gnu/packages/patches/python-random2-getrandbits-test.patch
new file mode 100644
index 0000000000..4f6c56027a
--- /dev/null
+++ b/gnu/packages/patches/python-random2-getrandbits-test.patch
@@ -0,0 +1,23 @@
+From 1bac6355d9c65de847cc445d782c466778b94fbd Mon Sep 17 00:00:00 2001
+From: "Robert T. McGibbon" <rmcgibbo@gmail.com>
+Date: Sun, 9 May 2021 11:18:23 -0400
+Subject: [PATCH] Update tests for python3.9
+
+---
+ src/tests.py | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/tests.py b/src/tests.py
+index d918891..4f2c3de 100644
+--- a/src/tests.py
++++ b/src/tests.py
+@@ -448,7 +448,8 @@ def test_genrandbits(self):
+         self.assertRaises(TypeError, self.gen.getrandbits)
+         self.assertRaises(TypeError, self.gen.getrandbits, 'a')
+         self.assertRaises(TypeError, self.gen.getrandbits, 1, 2)
+-        self.assertRaises(ValueError, self.gen.getrandbits, 0)
++        if sys.version_info < (3, 9):
++            self.assertRaises(ValueError, self.gen.getrandbits, 0)
+         self.assertRaises(ValueError, self.gen.getrandbits, -1)
+ 
+     def test_randbelow_logic(self, _log=log, int=int):
diff --git a/gnu/packages/patches/python-testtools.patch b/gnu/packages/patches/python-testtools.patch
deleted file mode 100644
index 42536e50f9..0000000000
--- a/gnu/packages/patches/python-testtools.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-https://github.com/testing-cabal/testtools/commit/29004731f9c480b7c44a9c2605513d50d372898f.patch
-Should be fixed in the next release
-
-From 29004731f9c480b7c44a9c2605513d50d372898f Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
-Date: Thu, 17 May 2018 17:52:26 +0200
-Subject: [PATCH] Fix the tests on Python 3.7
-
-Exception's repr got changed not to include trailing comma
-
-Fixes https://github.com/testing-cabal/testtools/issues/270
----
- .travis.yml                                |  1 +
- testtools/tests/matchers/test_exception.py | 11 +++++++++--
- 2 files changed, 10 insertions(+), 2 deletions(-)
-
-diff --git a/.travis.yml b/.travis.yml
-index 7f1f4db7..784608e0 100644
---- a/.travis.yml
-+++ b/.travis.yml
-@@ -5,6 +5,7 @@ python:
-   - "3.4"
-   - "3.5"
-   - "3.6"
-+  - "3.7-dev"
-   - "pypy"
- 
- install:
-diff --git a/testtools/tests/matchers/test_exception.py b/testtools/tests/matchers/test_exception.py
-index 6cd80af1..acd39252 100644
---- a/testtools/tests/matchers/test_exception.py
-+++ b/testtools/tests/matchers/test_exception.py
-@@ -32,15 +32,22 @@ class TestMatchesExceptionInstanceInterface(TestCase, TestMatchersInterface):
-     matches_matches = [error_foo]
-     matches_mismatches = [error_bar, error_base_foo]
- 
-+    if sys.version_info >= (3, 7):
-+        # exception's repr has changed
-+        _e = ''
-+    else:
-+        _e = ','
-+
-     str_examples = [
--        ("MatchesException(Exception('foo',))",
-+        ("MatchesException(Exception('foo'%s))" % _e,
-          MatchesException(Exception('foo')))
-         ]
-     describe_examples = [
-         ("%r is not a %r" % (Exception, ValueError),
-          error_base_foo,
-          MatchesException(ValueError("foo"))),
--        ("ValueError('bar',) has different arguments to ValueError('foo',).",
-+        ("ValueError('bar'%s) has different arguments to ValueError('foo'%s)."
-+         % (_e, _e),
-          error_bar,
-          MatchesException(ValueError("foo"))),
-         ]
diff --git a/gnu/packages/patches/python-typing-inspect-fix.patch b/gnu/packages/patches/python-typing-inspect-fix.patch
new file mode 100644
index 0000000000..e6e28981b7
--- /dev/null
+++ b/gnu/packages/patches/python-typing-inspect-fix.patch
@@ -0,0 +1,38 @@
+From 16919e21936179e53df2f376c8b59b5fc44bd2dd Mon Sep 17 00:00:00 2001
+From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
+Date: Fri, 15 Jan 2021 09:22:52 -0500
+Subject: [PATCH] Fix for Python 3.9+.
+
+Fixes <https://github.com/ilevkivskyi/typing_inspect/issues/60>.
+
+Based on an idea in
+https://github.com/ilevkivskyi/typing_inspect/issues/60#issuecomment-683187584.
+---
+ typing_inspect.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/typing_inspect.py b/typing_inspect.py
+index 1ca68ed..31d05ee 100644
+--- a/typing_inspect.py
++++ b/typing_inspect.py
+@@ -21,7 +21,7 @@ LEGACY_TYPING = False
+ 
+ if NEW_TYPING:
+     from typing import (
+-        Generic, Callable, Union, TypeVar, ClassVar, Tuple, _GenericAlias, ForwardRef
++        Generic, Callable, Union, TypeVar, ClassVar, Tuple, _GenericAlias, _SpecialGenericAlias, ForwardRef
+     )
+     from typing_extensions import Literal
+ else:
+@@ -75,7 +75,7 @@ def is_generic_type(tp):
+     """
+     if NEW_TYPING:
+         return (isinstance(tp, type) and issubclass(tp, Generic) or
+-                isinstance(tp, _GenericAlias) and
++                (isinstance(tp, _GenericAlias) or isinstance(tp, _SpecialGenericAlias)) and
+                 tp.__origin__ not in (Union, tuple, ClassVar, collections.abc.Callable))
+     return (isinstance(tp, GenericMeta) and not
+             isinstance(tp, (CallableMeta, TupleMeta)))
+-- 
+2.29.2
+
diff --git a/gnu/packages/patches/python-versioneer-guix-support.patch b/gnu/packages/patches/python-versioneer-guix-support.patch
new file mode 100644
index 0000000000..336020bc5e
--- /dev/null
+++ b/gnu/packages/patches/python-versioneer-guix-support.patch
@@ -0,0 +1,35 @@
+Versioneer does not work in the Guix build container because:
+
+* VCS information is unavailable
+* the build directory does not have the supported "$name-$version" format
+* as of 0.21, versioneer has no way to override the discovered values
+
+This patch adds support for extracting version from the
+'/tmp/guix-build-foo-0.1.drv-0' style directories created by the daemon.
+
+diff --git a/src/from_parentdir.py b/src/from_parentdir.py
+index 69ada9a..e0fac8f 100644
+--- a/src/from_parentdir.py
++++ b/src/from_parentdir.py
+@@ -15,6 +15,21 @@ def versions_from_parentdir(parentdir_prefix, root, verbose):
+             return {"version": dirname[len(parentdir_prefix):],
+                     "full-revisionid": None,
+                     "dirty": False, "error": None, "date": None}
++        # Guix specific patch: try extracting the version from the build
++        # directory.
++        elif dirname.startswith("guix-build-"):
++            delimiter = dirname.rindex(".drv-")
++            name_and_version = dirname[11:delimiter]
++            if name_and_version.startswith(parentdir_prefix):
++                guix_version = name_and_version[len(parentdir_prefix):]
++            elif name_and_version.startswith("python-{}".format(parentdir_prefix)):
++                guix_version = name_and_version[(7 + len(parentdir_prefix)):]
++            else:
++                break
++            return {"version": guix_version,
++                    "full-revisionid": None,
++                    "dirty": False, "error": None, "date": None}
++
+         rootdirs.append(root)
+         root = os.path.dirname(root)  # up a level
+ 
diff --git a/gnu/packages/patches/python-werkzeug-tests.patch b/gnu/packages/patches/python-werkzeug-tests.patch
new file mode 100644
index 0000000000..4eca53f30c
--- /dev/null
+++ b/gnu/packages/patches/python-werkzeug-tests.patch
@@ -0,0 +1,58 @@
+Do not leave open files behind as this triggers 'ResourceWarning' and leads
+these tests to fail.
+
+--- Werkzeug-1.0.1/tests/test_datastructures.py	2020-03-31 19:48:06.000000000 +0200
++++ Werkzeug-1.0.1/tests/test_datastructures.py	2021-11-21 18:19:11.304369878 +0100
+@@ -1238,9 +1238,10 @@
+     def test_save_to_pathlib_dst(self, tmp_path):
+         src = tmp_path / "src.txt"
+         src.write_text(u"test")
+-        storage = self.storage_class(src.open("rb"))
+-        dst = tmp_path / "dst.txt"
+-        storage.save(dst)
++        with src.open("rb") as input:
++            storage = self.storage_class(input)
++            dst = tmp_path / "dst.txt"
++            storage.save(dst)
+         assert dst.read_text() == "test"
+ 
+     def test_save_to_bytes_io(self):
+@@ -1251,11 +1252,12 @@
+ 
+     def test_save_to_file(self, tmp_path):
+         path = tmp_path / "file.data"
+-        storage = self.storage_class(io.BytesIO(b"one\ntwo"))
+-        with path.open("wb") as dst:
+-            storage.save(dst)
+-        with path.open("rb") as src:
+-            assert src.read() == b"one\ntwo"
++        with io.BytesIO(b"one\ntwo") as input:
++            storage = self.storage_class(input)
++            with path.open("wb") as dst:
++                storage.save(dst)
++            with path.open("rb") as src:
++                assert src.read() == b"one\ntwo"
+ 
+ 
+ @pytest.mark.parametrize("ranges", ([(0, 1), (-5, None)], [(5, None)]))
+--- Werkzeug-1.0.1/tests/test_formparser.py	2020-03-31 19:48:06.000000000 +0200
++++ Werkzeug-1.0.1/tests/test_formparser.py	2021-11-21 22:11:43.654622751 +0100
+@@ -27,7 +27,7 @@
+ from werkzeug.test import create_environ
+ from werkzeug.wrappers import Request
+ from werkzeug.wrappers import Response
+-
++import warnings
+ 
+ @Request.application
+ def form_data_consumer(request):
+@@ -242,6 +244,9 @@
+ 
+ class TestMultiPart(object):
+     def test_basic(self):
++        # Ignore leaked file descriptor of unknown origin.
++        warnings.filterwarnings(action="ignore", message="unclosed", category=ResourceWarning)
++
+         resources = join(dirname(__file__), "multipart")
+         client = Client(form_data_consumer, Response)
+ 
diff --git a/gnu/packages/patches/qemu-CVE-2021-20203.patch b/gnu/packages/patches/qemu-CVE-2021-20203.patch
deleted file mode 100644
index 9d2ceaa649..0000000000
--- a/gnu/packages/patches/qemu-CVE-2021-20203.patch
+++ /dev/null
@@ -1,172 +0,0 @@
-From mboxrd@z Thu Jan  1 00:00:00 1970
-Return-Path: <SRS0=i+5i=HB=nongnu.org=qemu-devel-bounces+qemu-devel=archiver.kernel.org@kernel.org>
-X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on
-	aws-us-west-2-korg-lkml-1.web.codeaurora.org
-X-Spam-Level: 
-X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIM_INVALID,
-	DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH,
-	MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY,
-	URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0
-Received: from mail.kernel.org (mail.kernel.org [198.145.29.99])
-	by smtp.lore.kernel.org (Postfix) with ESMTP id 87556C433E0
-	for <qemu-devel@archiver.kernel.org>; Sat, 30 Jan 2021 13:20:40 +0000 (UTC)
-Received: from lists.gnu.org (lists.gnu.org [209.51.188.17])
-	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
-	(No client certificate requested)
-	by mail.kernel.org (Postfix) with ESMTPS id EF26964DE1
-	for <qemu-devel@archiver.kernel.org>; Sat, 30 Jan 2021 13:20:39 +0000 (UTC)
-DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EF26964DE1
-Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com
-Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org
-Received: from localhost ([::1]:42488 helo=lists1p.gnu.org)
-	by lists.gnu.org with esmtp (Exim 4.90_1)
-	(envelope-from <qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org>)
-	id 1l5qB3-0008CX-02
-	for qemu-devel@archiver.kernel.org; Sat, 30 Jan 2021 08:20:37 -0500
-Received: from eggs.gnu.org ([2001:470:142:3::10]:45174)
- by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
- (Exim 4.90_1) (envelope-from <ppandit@redhat.com>)
- id 1l5q9q-0007ld-1c
- for qemu-devel@nongnu.org; Sat, 30 Jan 2021 08:19:22 -0500
-Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:42898)
- by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256)
- (Exim 4.90_1) (envelope-from <ppandit@redhat.com>)
- id 1l5q9k-0007Ia-TV
- for qemu-devel@nongnu.org; Sat, 30 Jan 2021 08:19:21 -0500
-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
- s=mimecast20190719; t=1612012753;
- h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
- to:to:cc:cc:mime-version:mime-version:content-type:content-type:
- content-transfer-encoding:content-transfer-encoding;
- bh=7vu4z8M+bFjhFzEuAYsQG4i3APx7aMqv7tFxRRO5+8Q=;
- b=egCsTdgVBnRlHnVN84HsSpNOUl/NkqEnGuv9rRdG2AZ1Fee5ZatpJm5zJ7YUW2HvzB4rtO
- EaDIKaN1wzf/yHf0CsJ60TPGG3DqQSC/EsTSr2l/GNGq4prDYTXVrS3rXFu9ofByUVvzwU
- q9Iy1X1Bh3S21m7jXY0AYx4Tu9Ikq9w=
-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com
- [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id
- us-mta-588-1JF7mzMfP1KpRpNKj4cAWQ-1; Sat, 30 Jan 2021 08:19:08 -0500
-X-MC-Unique: 1JF7mzMfP1KpRpNKj4cAWQ-1
-Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com
- [10.5.11.22])
- (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
- (No client certificate requested)
- by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8F0F439380;
- Sat, 30 Jan 2021 13:19:07 +0000 (UTC)
-Received: from localhost.localdomain (unknown [10.33.36.2])
- by smtp.corp.redhat.com (Postfix) with ESMTPS id 17D581002C11;
- Sat, 30 Jan 2021 13:19:04 +0000 (UTC)
-From: P J P <ppandit@redhat.com>
-To: Dmitry Fleytman <dmitry.fleytman@gmail.com>
-Subject: [PATCH] net: vmxnet3: validate configuration values during activate
- (CVE-2021-20203)
-Date: Sat, 30 Jan 2021 18:46:52 +0530
-Message-Id: <20210130131652.954143-1-ppandit@redhat.com>
-MIME-Version: 1.0
-X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22
-Authentication-Results: relay.mimecast.com;
- auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ppandit@redhat.com
-X-Mimecast-Spam-Score: 0
-X-Mimecast-Originator: redhat.com
-Content-Transfer-Encoding: 8bit
-Content-Type: text/plain; charset="US-ASCII"
-Received-SPF: pass client-ip=63.128.21.124; envelope-from=ppandit@redhat.com;
- helo=us-smtp-delivery-124.mimecast.com
-X-Spam_score_int: -30
-X-Spam_score: -3.1
-X-Spam_bar: ---
-X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.255,
- DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
- RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001,
- SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
-X-Spam_action: no action
-X-BeenThere: qemu-devel@nongnu.org
-X-Mailman-Version: 2.1.23
-Precedence: list
-List-Id: <qemu-devel.nongnu.org>
-List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>,
- <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>
-List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel>
-List-Post: <mailto:qemu-devel@nongnu.org>
-List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help>
-List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>,
- <mailto:qemu-devel-request@nongnu.org?subject=subscribe>
-Cc: Gaoning Pan <pgn@zju.edu.cn>, QEMU Developers <qemu-devel@nongnu.org>,
- Prasad J Pandit <pjp@fedoraproject.org>
-Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org
-Sender: "Qemu-devel"
- <qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org>
-Archived-At: <https://lore.kernel.org/qemu-devel/20210130131652.954143-1-ppandit@redhat.com/>
-List-Archive: <https://lore.kernel.org/qemu-devel/>
-
-From: Prasad J Pandit <pjp@fedoraproject.org>
-
-While activating device in vmxnet3_acticate_device(), it does not
-validate guest supplied configuration values against predefined
-minimum - maximum limits. This may lead to integer overflow or
-OOB access issues. Add checks to avoid it.
-
-Fixes: CVE-2021-20203
-Buglink: https://bugs.launchpad.net/qemu/+bug/1913873
-Reported-by: Gaoning Pan <pgn@zju.edu.cn>
-Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
----
- hw/net/vmxnet3.c | 13 +++++++++++++
- 1 file changed, 13 insertions(+)
-
-diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c
-index eff299f629..4a910ca971 100644
---- a/hw/net/vmxnet3.c
-+++ b/hw/net/vmxnet3.c
-@@ -1420,6 +1420,7 @@ static void vmxnet3_activate_device(VMXNET3State *s)
-     vmxnet3_setup_rx_filtering(s);
-     /* Cache fields from shared memory */
-     s->mtu = VMXNET3_READ_DRV_SHARED32(d, s->drv_shmem, devRead.misc.mtu);
-+    assert(VMXNET3_MIN_MTU <= s->mtu && s->mtu < VMXNET3_MAX_MTU);
-     VMW_CFPRN("MTU is %u", s->mtu);
- 
-     s->max_rx_frags =
-@@ -1473,6 +1474,9 @@ static void vmxnet3_activate_device(VMXNET3State *s)
-         /* Read rings memory locations for TX queues */
-         pa = VMXNET3_READ_TX_QUEUE_DESCR64(d, qdescr_pa, conf.txRingBasePA);
-         size = VMXNET3_READ_TX_QUEUE_DESCR32(d, qdescr_pa, conf.txRingSize);
-+        if (size > VMXNET3_TX_RING_MAX_SIZE) {
-+            size = VMXNET3_TX_RING_MAX_SIZE;
-+        }
- 
-         vmxnet3_ring_init(d, &s->txq_descr[i].tx_ring, pa, size,
-                           sizeof(struct Vmxnet3_TxDesc), false);
-@@ -1483,6 +1487,9 @@ static void vmxnet3_activate_device(VMXNET3State *s)
-         /* TXC ring */
-         pa = VMXNET3_READ_TX_QUEUE_DESCR64(d, qdescr_pa, conf.compRingBasePA);
-         size = VMXNET3_READ_TX_QUEUE_DESCR32(d, qdescr_pa, conf.compRingSize);
-+        if (size > VMXNET3_TC_RING_MAX_SIZE) {
-+            size = VMXNET3_TC_RING_MAX_SIZE;
-+        }
-         vmxnet3_ring_init(d, &s->txq_descr[i].comp_ring, pa, size,
-                           sizeof(struct Vmxnet3_TxCompDesc), true);
-         VMXNET3_RING_DUMP(VMW_CFPRN, "TXC", i, &s->txq_descr[i].comp_ring);
-@@ -1524,6 +1531,9 @@ static void vmxnet3_activate_device(VMXNET3State *s)
-             /* RX rings */
-             pa = VMXNET3_READ_RX_QUEUE_DESCR64(d, qd_pa, conf.rxRingBasePA[j]);
-             size = VMXNET3_READ_RX_QUEUE_DESCR32(d, qd_pa, conf.rxRingSize[j]);
-+            if (size > VMXNET3_RX_RING_MAX_SIZE) {
-+                size = VMXNET3_RX_RING_MAX_SIZE;
-+            }
-             vmxnet3_ring_init(d, &s->rxq_descr[i].rx_ring[j], pa, size,
-                               sizeof(struct Vmxnet3_RxDesc), false);
-             VMW_CFPRN("RX queue %d:%d: Base: %" PRIx64 ", Size: %d",
-@@ -1533,6 +1543,9 @@ static void vmxnet3_activate_device(VMXNET3State *s)
-         /* RXC ring */
-         pa = VMXNET3_READ_RX_QUEUE_DESCR64(d, qd_pa, conf.compRingBasePA);
-         size = VMXNET3_READ_RX_QUEUE_DESCR32(d, qd_pa, conf.compRingSize);
-+        if (size > VMXNET3_RC_RING_MAX_SIZE) {
-+            size = VMXNET3_RC_RING_MAX_SIZE;
-+        }
-         vmxnet3_ring_init(d, &s->rxq_descr[i].comp_ring, pa, size,
-                           sizeof(struct Vmxnet3_RxCompDesc), true);
-         VMW_CFPRN("RXC queue %d: Base: %" PRIx64 ", Size: %d", i, pa, size);
--- 
-2.29.2
-
-
-
diff --git a/gnu/packages/patches/qemu-fix-agent-paths.patch b/gnu/packages/patches/qemu-fix-agent-paths.patch
new file mode 100644
index 0000000000..bae62fadbf
--- /dev/null
+++ b/gnu/packages/patches/qemu-fix-agent-paths.patch
@@ -0,0 +1,66 @@
+Allow a QEMU host to set the time and shutdown Guix guests.  Styled
+after the patch from the Nix package:
+
+https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/virtualization/qemu/fix-qemu-ga.patch
+
+diff --git a/qga/commands-posix.c b/qga/commands-posix.c
+index 75dbaab..b416b03 100644
+--- a/qga/commands-posix.c
++++ b/qga/commands-posix.c
+@@ -84,6 +84,7 @@ static void ga_wait_child(pid_t pid, int *status, Error **errp)
+ void qmp_guest_shutdown(bool has_mode, const char *mode, Error **errp)
+ {
+     const char *shutdown_flag;
++    const char *command;
+     Error *local_err = NULL;
+     pid_t pid;
+     int status;
+@@ -91,10 +92,13 @@ void qmp_guest_shutdown(bool has_mode, const char *mode, Error **errp)
+     slog("guest-shutdown called, mode: %s", mode);
+     if (!has_mode || strcmp(mode, "powerdown") == 0) {
+         shutdown_flag = "-P";
++        command = "shutdown";
+     } else if (strcmp(mode, "halt") == 0) {
+         shutdown_flag = "-H";
++        command = "halt";
+     } else if (strcmp(mode, "reboot") == 0) {
+         shutdown_flag = "-r";
++        command = "reboot";
+     } else {
+         error_setg(errp,
+                    "mode is invalid (valid values are: halt|powerdown|reboot");
+@@ -109,6 +113,11 @@ void qmp_guest_shutdown(bool has_mode, const char *mode, Error **errp)
+         reopen_fd_to_null(1);
+         reopen_fd_to_null(2);
+ 
++        /* try Guix’s shutdown/halt/reboot first */
++        char *path = g_strdup_printf("/run/current-system/profile/sbin/%s", command);
++        execle(path, command, (char *)NULL, environ);
++        g_free(path);
++
+         execle("/sbin/shutdown", "shutdown", "-h", shutdown_flag, "+0",
+                "hypervisor initiated shutdown", (char *)NULL, environ);
+         _exit(EXIT_FAILURE);
+@@ -158,10 +167,12 @@ void qmp_guest_set_time(bool has_time, int64_t time_ns, Error **errp)
+     Error *local_err = NULL;
+     struct timeval tv;
+     static const char hwclock_path[] = "/sbin/hwclock";
++    static const char hwclock_path_guix[] = "/run/current-system/profile/sbin/hwclock";
+     static int hwclock_available = -1;
+ 
+     if (hwclock_available < 0) {
+-        hwclock_available = (access(hwclock_path, X_OK) == 0);
++        hwclock_available = (access(hwclock_path_guix, X_OK) == 0) ||
++                            (access(hwclock_path, X_OK) == 0);
+     }
+ 
+     if (!hwclock_available) {
+@@ -207,6 +218,8 @@ void qmp_guest_set_time(bool has_time, int64_t time_ns, Error **errp)
+ 
+         /* Use '/sbin/hwclock -w' to set RTC from the system time,
+          * or '/sbin/hwclock -s' to set the system time from RTC. */
++        execle(hwclock_path_guix, "hwclock", has_time ? "-w" : "-s",
++               NULL, environ);
+         execle(hwclock_path, "hwclock", has_time ? "-w" : "-s",
+                NULL, environ);
+         _exit(EXIT_FAILURE);
diff --git a/gnu/packages/patches/qemu-meson-compat.patch b/gnu/packages/patches/qemu-meson-compat.patch
deleted file mode 100644
index e6968c57dc..0000000000
--- a/gnu/packages/patches/qemu-meson-compat.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Fix a build failure that occurs with newer versions of Meson when
-gdbus-codegen is unavailable.
-
-Taken from upstream:
-https://gitlab.com/qemu-project/qemu/-/commit/5ecfb76ccc056eb6127e44268e475827ae73b9e0
-
-diff --git a/configure b/configure
---- a/configure
-+++ b/configure
-@@ -3341,7 +3341,7 @@ if ! test "$gio" = "no"; then
-         gio_cflags=$($pkg_config --cflags gio-2.0)
-         gio_libs=$($pkg_config --libs gio-2.0)
-         gdbus_codegen=$($pkg_config --variable=gdbus_codegen gio-2.0)
--        if [ ! -x "$gdbus_codegen" ]; then
-+        if ! has "$gdbus_codegen"; then
-             gdbus_codegen=
-         fi
-         # Check that the libraries actually work -- Ubuntu 18.04 ships
-@@ -5704,6 +5704,8 @@ if test "$gio" = "yes" ; then
-     echo "CONFIG_GIO=y" >> $config_host_mak
-     echo "GIO_CFLAGS=$gio_cflags" >> $config_host_mak
-     echo "GIO_LIBS=$gio_libs" >> $config_host_mak
-+fi
-+if test "$gdbus_codegen" != "" ; then
-     echo "GDBUS_CODEGEN=$gdbus_codegen" >> $config_host_mak
- fi
- echo "CONFIG_TLS_PRIORITY=\"$tls_priority\"" >> $config_host_mak
diff --git a/gnu/packages/patches/qemu-sphinx-compat.patch b/gnu/packages/patches/qemu-sphinx-compat.patch
deleted file mode 100644
index 7342ebee4e..0000000000
--- a/gnu/packages/patches/qemu-sphinx-compat.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-Prevent Sphinx 4 and later from creating subdirectories, which
-the build scripts are not equipped to deal with.
-
-Taken from upstream:
-https://gitlab.com/qemu-project/qemu/-/issues/256
-https://gitlab.com/qemu-project/qemu/-/commit/269a7e97865cb863c9ca19e5f2e6a40ac9eddf82
-
-diff --git a/docs/conf.py b/docs/conf.py
---- a/docs/conf.py
-+++ b/docs/conf.py
-@@ -279,6 +279,7 @@
-      ['Stefan Hajnoczi <stefanha@redhat.com>',
-       'Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>'], 1),
- ]
-+man_make_section_directory = False
- 
- # -- Options for Texinfo output -------------------------------------------
- 
diff --git a/gnu/packages/patches/qtwebkit-fix-building-with-bison-3.7.patch b/gnu/packages/patches/qtwebkit-fix-building-with-bison-3.7.patch
new file mode 100644
index 0000000000..ddaf8e2849
--- /dev/null
+++ b/gnu/packages/patches/qtwebkit-fix-building-with-bison-3.7.patch
@@ -0,0 +1,54 @@
+Fix build with Bison 3.7
+
+https://bugs.gentoo.org/736499
+
+Patch copied from upstream source repository:
+
+https://github.com/qtwebkit/qtwebkit/commit/d92b11fea65364fefa700249bd3340e0cd4c5b31
+
+From d92b11fea65364fefa700249bd3340e0cd4c5b31 Mon Sep 17 00:00:00 2001
+From: Dmitry Shachnev <mitya57@gmail.com>
+Date: Tue, 4 Aug 2020 21:04:06 +0300
+Subject: [PATCH] Let Bison generate the header directly, to fix build with
+ Bison 3.7
+
+Starting with Bison 3.7, the generated C++ file #include's the header
+by default, instead of duplicating it. So we should not delete it.
+
+Remove the code to add #ifdef guards to the header, since Bison adds
+them itself since version 2.6.3.
+---
+ Source/WebCore/css/makegrammar.pl | 21 +--------------------
+ 1 file changed, 1 insertion(+), 20 deletions(-)
+
+diff --git a/Source/WebCore/css/makegrammar.pl b/Source/WebCore/css/makegrammar.pl
+index 5d63b08102eb5..9435701c70612 100644
+--- a/Source/WebCore/css/makegrammar.pl
++++ b/Source/WebCore/css/makegrammar.pl
+@@ -73,25 +73,6 @@
+ }
+ 
+ my $fileBase = File::Spec->join($outputDir, $filename);
+-my @bisonCommand = ($bison, "-d", "-p", $symbolsPrefix, $grammarFilePath, "-o", "$fileBase.cpp");
++my @bisonCommand = ($bison, "--defines=$fileBase.h", "-p", $symbolsPrefix, $grammarFilePath, "-o", "$fileBase.cpp");
+ push @bisonCommand, "--no-lines" if $^O eq "MSWin32"; # Work around bug in bison >= 3.0 on Windows where it puts backslashes into #line directives.
+ system(@bisonCommand) == 0 or die;
+-
+-open HEADER, ">$fileBase.h" or die;
+-print HEADER << "EOF";
+-#ifndef CSSGRAMMAR_H
+-#define CSSGRAMMAR_H
+-EOF
+-
+-open HPP, "<$fileBase.cpp.h" or open HPP, "<$fileBase.hpp" or die;
+-while (<HPP>) {
+-    print HEADER;
+-}
+-close HPP;
+-
+-print HEADER "#endif\n";
+-close HEADER;
+-
+-unlink("$fileBase.cpp.h");
+-unlink("$fileBase.hpp");
+-
diff --git a/gnu/packages/patches/qtwebkit-fix-building-with-glib-2.68.patch b/gnu/packages/patches/qtwebkit-fix-building-with-glib-2.68.patch
new file mode 100644
index 0000000000..63840f4bbc
--- /dev/null
+++ b/gnu/packages/patches/qtwebkit-fix-building-with-glib-2.68.patch
@@ -0,0 +1,21 @@
+Fix building with glib 2.68:
+
+https://github.com/qtwebkit/qtwebkit/issues/1057
+
+Patch copied from upstream pull request:
+
+https://github.com/qtwebkit/qtwebkit/pull/1058/commits/5b698ba3faffd4e198a45be9fe74f53307395e4b
+
+diff -aurN qtwebkit-5.212.0-alpha4/Source/WTF/wtf/glib/GRefPtr.h qtwebkit-5.212.0-alpha4-mod/Source/WTF/wtf/glib/GRefPtr.h
+--- qtwebkit-5.212.0-alpha4/Source/WTF/wtf/glib/GRefPtr.h	2020-03-04 18:16:37.000000000 +0100
++++ qtwebkit-5.212.0-alpha4-mod/Source/WTF/wtf/glib/GRefPtr.h	2021-04-05 06:58:44.763328636 +0200
+@@ -29,9 +29,6 @@
+ #include <wtf/RefPtr.h>
+ #include <algorithm>
+ 
+-extern "C" void g_object_unref(gpointer);
+-extern "C" gpointer g_object_ref_sink(gpointer);
+-
+ namespace WTF {
+ 
+ enum GRefPtrAdoptType { GRefPtrAdopt };
diff --git a/gnu/packages/patches/qtwebkit-fix-building-with-icu-68.patch b/gnu/packages/patches/qtwebkit-fix-building-with-icu-68.patch
new file mode 100644
index 0000000000..acbfc4c4c8
--- /dev/null
+++ b/gnu/packages/patches/qtwebkit-fix-building-with-icu-68.patch
@@ -0,0 +1,152 @@
+Fix building with ICU > 68.
+
+https://bugs.gentoo.org/753260
+
+Patch adapted from Gentoo:
+
+https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=335f29d266c5b169ff1e781f9851a3a203f3198c
+
+From 335f29d266c5b169ff1e781f9851a3a203f3198c Mon Sep 17 00:00:00 2001
+From: Andreas Sturmlechner <asturm@gentoo.org>
+Date: Fri, 6 Nov 2020 09:22:15 +0100
+Subject: dev-qt/qtwebkit: Fix build with ICU-68
+
+Thanks-to: Lars Wendler <polynomial-c@gentoo.org>
+Closes: https://bugs.gentoo.org/753260
+Package-Manager: Portage-3.0.9, Repoman-3.0.2
+Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
+---
+ .../qtwebkit-5.212.0_pre20200309-icu-68.patch      | 120 +++++++++++++++++++++
+ 1 file changed, 120 insertions(+)
+ create mode 100644 dev-qt/qtwebkit/files/qtwebkit-5.212.0_pre20200309-icu-68.patch
+
+(limited to 'dev-qt/qtwebkit/files/qtwebkit-5.212.0_pre20200309-icu-68.patch')
+
+diff --git a/Source/WebCore/platform/text/TextCodecICU.cpp b/Source/WebCore/platform/text/TextCodecICU.cpp
+index dd6ff06..e0f4bd7 100644
+--- a/Source/WebCore/platform/text/TextCodecICU.cpp
++++ b/Source/WebCore/platform/text/TextCodecICU.cpp
+@@ -308,7 +308,7 @@ void TextCodecICU::createICUConverter() const
+     m_converterICU = ucnv_open(m_canonicalConverterName, &err);
+     ASSERT(U_SUCCESS(err));
+     if (m_converterICU)
+-        ucnv_setFallback(m_converterICU, TRUE);
++        ucnv_setFallback(m_converterICU, true);
+ }
+ 
+ int TextCodecICU::decodeToBuffer(UChar* target, UChar* targetLimit, const char*& source, const char* sourceLimit, int32_t* offsets, bool flush, UErrorCode& err)
+diff --git a/Source/WebCore/platform/text/icu/UTextProvider.h b/Source/WebCore/platform/text/icu/UTextProvider.h
+index c254fc4..6d1e1cb 100644
+--- a/Source/WebCore/platform/text/icu/UTextProvider.h
++++ b/Source/WebCore/platform/text/icu/UTextProvider.h
+@@ -80,12 +80,12 @@ inline bool uTextAccessInChunkOrOutOfRange(UText* text, int64_t nativeIndex, int
+             // Ensure chunk offset is well formed if computed offset exceeds int32_t range.
+             ASSERT(offset < std::numeric_limits<int32_t>::max());
+             text->chunkOffset = offset < std::numeric_limits<int32_t>::max() ? static_cast<int32_t>(offset) : 0;
+-            isAccessible = TRUE;
++            isAccessible = true;
+             return true;
+         }
+         if (nativeIndex >= nativeLength && text->chunkNativeLimit == nativeLength) {
+             text->chunkOffset = text->chunkLength;
+-            isAccessible = FALSE;
++            isAccessible = false;
+             return true;
+         }
+     } else {
+@@ -94,12 +94,12 @@ inline bool uTextAccessInChunkOrOutOfRange(UText* text, int64_t nativeIndex, int
+             // Ensure chunk offset is well formed if computed offset exceeds int32_t range.
+             ASSERT(offset < std::numeric_limits<int32_t>::max());
+             text->chunkOffset = offset < std::numeric_limits<int32_t>::max() ? static_cast<int32_t>(offset) : 0;
+-            isAccessible = TRUE;
++            isAccessible = true;
+             return true;
+         }
+         if (nativeIndex <= 0 && !text->chunkNativeStart) {
+             text->chunkOffset = 0;
+-            isAccessible = FALSE;
++            isAccessible = false;
+             return true;
+         }
+     }
+diff --git a/Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp b/Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp
+index cd6852c..6a864b1 100644
+--- a/Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp
++++ b/Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp
+@@ -100,23 +100,23 @@ static UBool uTextLatin1Access(UText* uText, int64_t index, UBool forward)
+         if (index < uText->chunkNativeLimit && index >= uText->chunkNativeStart) {
+             // Already inside the buffer. Set the new offset.
+             uText->chunkOffset = static_cast<int32_t>(index - uText->chunkNativeStart);
+-            return TRUE;
++            return true;
+         }
+         if (index >= length && uText->chunkNativeLimit == length) {
+             // Off the end of the buffer, but we can't get it.
+             uText->chunkOffset = static_cast<int32_t>(index - uText->chunkNativeStart);
+-            return FALSE;
++            return false;
+         }
+     } else {
+         if (index <= uText->chunkNativeLimit && index > uText->chunkNativeStart) {
+             // Already inside the buffer. Set the new offset.
+             uText->chunkOffset = static_cast<int32_t>(index - uText->chunkNativeStart);
+-            return TRUE;
++            return true;
+         }
+         if (!index && !uText->chunkNativeStart) {
+             // Already at the beginning; can't go any farther.
+             uText->chunkOffset = 0;
+-            return FALSE;
++            return false;
+         }
+     }
+     
+@@ -144,7 +144,7 @@ static UBool uTextLatin1Access(UText* uText, int64_t index, UBool forward)
+ 
+     uText->nativeIndexingLimit = uText->chunkLength;
+ 
+-    return TRUE;
++    return true;
+ }
+ 
+ static int32_t uTextLatin1Extract(UText* uText, int64_t start, int64_t limit, UChar* dest, int32_t destCapacity, UErrorCode* status)
+@@ -336,7 +336,7 @@ static int64_t uTextLatin1ContextAwareNativeLength(UText* text)
+ static UBool uTextLatin1ContextAwareAccess(UText* text, int64_t nativeIndex, UBool forward)
+ {
+     if (!text->context)
+-        return FALSE;
++        return false;
+     int64_t nativeLength = uTextLatin1ContextAwareNativeLength(text);
+     UBool isAccessible;
+     if (uTextAccessInChunkOrOutOfRange(text, nativeIndex, nativeLength, forward, isAccessible))
+@@ -356,7 +356,7 @@ static UBool uTextLatin1ContextAwareAccess(UText* text, int64_t nativeIndex, UBo
+         ASSERT(newContext == UTextProviderContext::PriorContext);
+         textLatin1ContextAwareSwitchToPriorContext(text, nativeIndex, nativeLength, forward);
+     }
+-    return TRUE;
++    return true;
+ }
+ 
+ static int32_t uTextLatin1ContextAwareExtract(UText*, int64_t, int64_t, UChar*, int32_t, UErrorCode* errorCode)
+diff --git a/Source/WebCore/platform/text/icu/UTextProviderUTF16.cpp b/Source/WebCore/platform/text/icu/UTextProviderUTF16.cpp
+index 7aaac48..9ae0d36 100644
+--- a/Source/WebCore/platform/text/icu/UTextProviderUTF16.cpp
++++ b/Source/WebCore/platform/text/icu/UTextProviderUTF16.cpp
+@@ -125,7 +125,7 @@ static inline int64_t uTextUTF16ContextAwareNativeLength(UText* text)
+ static UBool uTextUTF16ContextAwareAccess(UText* text, int64_t nativeIndex, UBool forward)
+ {
+     if (!text->context)
+-        return FALSE;
++        return false;
+     int64_t nativeLength = uTextUTF16ContextAwareNativeLength(text);
+     UBool isAccessible;
+     if (uTextAccessInChunkOrOutOfRange(text, nativeIndex, nativeLength, forward, isAccessible))
+@@ -145,7 +145,7 @@ static UBool uTextUTF16ContextAwareAccess(UText* text, int64_t nativeIndex, UBoo
+         ASSERT(newContext == UTextProviderContext::PriorContext);
+         textUTF16ContextAwareSwitchToPriorContext(text, nativeIndex, nativeLength, forward);
+     }
+-    return TRUE;
++    return true;
+ }
+ 
+ static int32_t uTextUTF16ContextAwareExtract(UText*, int64_t, int64_t, UChar*, int32_t, UErrorCode* errorCode)
diff --git a/gnu/packages/patches/qtwebkit-fix-building-with-python-3.9.patch b/gnu/packages/patches/qtwebkit-fix-building-with-python-3.9.patch
new file mode 100644
index 0000000000..9f9674de33
--- /dev/null
+++ b/gnu/packages/patches/qtwebkit-fix-building-with-python-3.9.patch
@@ -0,0 +1,35 @@
+Fix building with Python 3.9:
+
+https://github.com/qtwebkit/qtwebkit/issues/993
+
+Patch copied from upstream source repository:
+
+https://github.com/qtwebkit/qtwebkit/commit/78360c01c796b6260bf828bc9c8a0ef73c5132fd
+
+From 78360c01c796b6260bf828bc9c8a0ef73c5132fd Mon Sep 17 00:00:00 2001
+From: Konstantin Tokarev <annulen@yandex.ru>
+Date: Wed, 3 Jun 2020 15:01:42 +0300
+Subject: [PATCH] Fix compilation with Python 3.9: avoid passing encoding to
+ json.load()
+
+In Python 2.7 UTF-8 is assumed by default, while in Python 3 this argument
+is not supported.
+
+Change-Id: Ic459d60a6b20bc1838d8771bc36ac41614fe61a9
+---
+ Source/JavaScriptCore/generate-bytecode-files | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Source/JavaScriptCore/generate-bytecode-files b/Source/JavaScriptCore/generate-bytecode-files
+index c5dab429c7b0f..af3431275ecf9 100644
+--- a/Source/JavaScriptCore/generate-bytecode-files
++++ b/Source/JavaScriptCore/generate-bytecode-files
+@@ -163,7 +163,7 @@ if __name__ == "__main__":
+         initBytecodesFile = openOrExit(initASMFileName, "w")
+ 
+     try:
+-        bytecodeSections = json.load(bytecodeFile, encoding = "utf-8")
++        bytecodeSections = json.load(bytecodeFile)
+     except:
+         print("Unexpected error parsing {0}: {1}".format(bytecodeJSONFile, sys.exc_info()))
+ 
diff --git a/gnu/packages/patches/quassel-qt-514-compat.patch b/gnu/packages/patches/quassel-qt-514-compat.patch
deleted file mode 100644
index 7a0c42e8aa..0000000000
--- a/gnu/packages/patches/quassel-qt-514-compat.patch
+++ /dev/null
@@ -1,130 +0,0 @@
-https://github.com/quassel/quassel/commit/579e559a6322209df7cd51c34801fecff5fe734b.patch
-
-Based on the above patch, with some changes due to how the code has changed
-in the time since 0.13.1 was released.
-
-https://git.archlinux.org/svntogit/community.git/plain/trunk/quassel-0.13.1-qt5.14.patch?h=packages/quassel
-
-From 579e559a6322209df7cd51c34801fecff5fe734b Mon Sep 17 00:00:00 2001
-From: Manuel Nickschas <sputnick@quassel-irc.org>
-Date: Tue, 7 Jan 2020 18:34:54 +0100
-Subject: [PATCH] common: Disable enum type stream operators for Qt >= 5.14
-
-Starting from version 5.14, Qt provides stream operators for enum
-types, which collide with the ones we ship in types.h. Disable
-Quassel's stream operators when compiling against Qt 5.14 or later.
-
-Add a unit test that ensures that enum serialization honors the width
-of the underlying type.
----
- src/common/types.h          |  2 +
- tests/common/CMakeLists.txt |  2 +
- tests/common/typestest.cpp  | 79 +++++++++++++++++++++++++++++++++++++
- 3 files changed, 83 insertions(+)
- create mode 100644 tests/common/typestest.cpp
-
-diff --git a/src/common/types.h b/src/common/types.h
-index d3742b788..e2a9aab5e 100644
---- a/src/common/types.h
-+++ b/src/common/types.h
-@@ -140,6 +140,7 @@ Q_DECLARE_METATYPE(QHostAddress)
- typedef QList<MsgId> MsgIdList;
- typedef QList<BufferId> BufferIdList;
-
-+#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
- /**
-   * Catch-all stream serialization operator for enum types.
-   *
-@@ -169,6 +170,7 @@ QDataStream &operator>>(QDataStream &in, T &value) {
-     value = static_cast<T>(v);
-     return in;
- }
-+#endif
-
- // Exceptions
-
-diff --git a/tests/common/typestest.cpp b/tests/common/typestest.cpp
-new file mode 100644
-index 000000000..04031c299
---- /dev/null
-+++ b/tests/common/typestest.cpp
-@@ -0,0 +1,79 @@
-+/***************************************************************************
-+ *   Copyright (C) 2005-2020 by the Quassel Project                        *
-+ *   devel@quassel-irc.org                                                 *
-+ *                                                                         *
-+ *   This program is free software; you can redistribute it and/or modify  *
-+ *   it under the terms of the GNU General Public License as published by  *
-+ *   the Free Software Foundation; either version 2 of the License, or     *
-+ *   (at your option) version 3.                                           *
-+ *                                                                         *
-+ *   This program is distributed in the hope that it will be useful,       *
-+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
-+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
-+ *   GNU General Public License for more details.                          *
-+ *                                                                         *
-+ *   You should have received a copy of the GNU General Public License     *
-+ *   along with this program; if not, write to the                         *
-+ *   Free Software Foundation, Inc.,                                       *
-+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
-+ ***************************************************************************/
-+
-+#include <cstdint>
-+
-+#include <QByteArray>
-+#include <QDataStream>
-+#include <QObject>
-+
-+#include "testglobal.h"
-+#include "types.h"
-+
-+using namespace ::testing;
-+
-+class EnumHolder
-+{
-+    Q_GADGET
-+
-+public:
-+    enum class Enum16 : uint16_t {};
-+    enum class Enum32 : uint32_t {};
-+
-+    enum class EnumQt16 : uint16_t {};
-+    Q_ENUM(EnumQt16)
-+    enum class EnumQt32 : uint32_t {};
-+    Q_ENUM(EnumQt32)
-+};
-+
-+// Verify that enums are (de)serialized as their underlying type
-+TEST(TypesTest, enumSerialization)
-+{
-+    QByteArray data;
-+    QDataStream out(&data, QIODevice::WriteOnly);
-+
-+    // Serialize
-+    out << EnumHolder::Enum16(0xabcd);
-+    ASSERT_THAT(data.size(), Eq(2));
-+    out << EnumHolder::Enum32(0x123456);
-+    ASSERT_THAT(data.size(), Eq(6));
-+    out << EnumHolder::EnumQt16(0x4321);
-+    ASSERT_THAT(data.size(), Eq(8));
-+    out << EnumHolder::Enum32(0xfedcba);
-+    ASSERT_THAT(data.size(), Eq(12));
-+    ASSERT_THAT(out.status(), Eq(QDataStream::Status::Ok));
-+
-+    // Deserialize
-+    QDataStream in(data);
-+    EnumHolder::Enum16 enum16;
-+    EnumHolder::Enum32 enum32;
-+    EnumHolder::EnumQt16 enumQt16;
-+    EnumHolder::EnumQt32 enumQt32;
-+    in >> enum16  >> enum32 >> enumQt16 >> enumQt32;
-+    ASSERT_THAT(in.status(), Eq(QDataStream::Status::Ok));
-+    EXPECT_TRUE(in.atEnd());
-+
-+    EXPECT_THAT((int)enum16, Eq(0xabcd));
-+    EXPECT_THAT((int)enum32, Eq(0x123456));
-+    EXPECT_THAT((int)enumQt16, Eq(0x4321));
-+    EXPECT_THAT((int)enumQt32, Eq(0xfedcba));
-+}
-+
-+#include "typestest.moc"
diff --git a/gnu/packages/patches/r-httpuv-1.5.5-unvendor-libuv.patch b/gnu/packages/patches/r-httpuv-1.5.5-unvendor-libuv.patch
index 0947718059..30c6425477 100644
--- a/gnu/packages/patches/r-httpuv-1.5.5-unvendor-libuv.patch
+++ b/gnu/packages/patches/r-httpuv-1.5.5-unvendor-libuv.patch
@@ -20,7 +20,7 @@ Removes references to bundled libuv.
  
  # To avoid spurious warnings from `R CMD check --as-cran`, about compiler
  # warning flags like -Werror.
-@@ -43,35 +43,5 @@
+@@ -43,49 +43,5 @@
  # PKG_CPPFLAGS += -D_GLIBCXX_ASSERTIONS
  
  
@@ -32,10 +32,18 @@ Removes references to bundled libuv.
 -libuv/m4/lt~obsolete.m4: libuv/m4/lt_obsolete.m4
 -	cp -p -f libuv/m4/lt_obsolete.m4 libuv/m4/lt~obsolete.m4
 -
--# Run ./configure. We need to touch various autotools-related files to avoid
--# it trying to run autotools programs again. We also need to make sure
--# configure is executable, because on some platforms, calling unzip() in R
--# does not preserve the executable bit.
+-# Run ./configure to create the Makefile.
+-#
+-# On systems that do _not_ have automake installed, we need to make sure that
+-# configure does not try to run automake, because it will fail. To do that, we
+-# we need to touch various autotools-related files so it doesn't try to run
+-# autotools programs again. We also need to make sure configure is executable,
+-# because on some platforms, calling unzip() in R does not preserve the
+-# executable bit.
+-#
+-# If the system does have automake, then we'll run autogen.sh before configure,
+-# as per the official build instructions for libuv. autogen.sh will in turn run
+-# aclocal, autoconf, and automake.
 -#
 -# It's VERY IMPORTANT that mtime(aclocal.m4) <= mtime(configure), and also
 -# mtime(aclocal.m4) <= mtime(Makefile.in). On some platforms, passing multiple
@@ -45,11 +53,17 @@ Removes references to bundled libuv.
 -# use "-r aclocal.m4" to ensure that all three files are guaranteed to have
 -# precisely the same timestamp value.
 -libuv/Makefile: libuv/m4/lt~obsolete.m4
--	(cd libuv \
--		&& touch aclocal.m4 \
--		&& touch -r aclocal.m4 configure Makefile.in \
--		&& chmod +x configure \
--		&& CC="$(CC)" CFLAGS="$(CFLAGS) $(CPICFLAGS) $(C_VISIBILITY)" AR="$(AR)" RANLIB="$(RANLIB)" LDFLAGS="$(LDFLAGS)" ./configure $(CONFIGURE_FLAGS))
+-	cd libuv; \
+-	if ! command -v automake >/dev/null 2>&1 ; then \
+-		echo "automake not found. Touching files so configure will not try to run automake."; \
+-		touch aclocal.m4; \
+-		touch -r aclocal.m4 configure Makefile.in; \
+-	else \
+-		echo "automake found. Running autogen.sh."; \
+-		sh autogen.sh; \
+-	fi; \
+-	chmod +x configure; \
+-	CC="$(CC)" CFLAGS="$(CFLAGS) $(CPICFLAGS) $(C_VISIBILITY)" AR="$(AR)" RANLIB="$(RANLIB)" LDFLAGS="$(LDFLAGS)" ./configure $(CONFIGURE_FLAGS)
 -
 -libuv/.libs/libuv.a: libuv/Makefile
 -	$(MAKE) --directory=libuv \
diff --git a/gnu/packages/patches/racket-minimal-backport-1629887.patch b/gnu/packages/patches/racket-minimal-backport-1629887.patch
deleted file mode 100644
index aa060ef5aa..0000000000
--- a/gnu/packages/patches/racket-minimal-backport-1629887.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From fb1a6ab205fd63a46669a463931af473e2ac0c87 Mon Sep 17 00:00:00 2001
-From: Matthew Flatt <mflatt@racket-lang.org>
-Date: Sat, 21 Aug 2021 15:29:59 -0600
-Subject: [PATCH] setup/variant: recognize starter executables
-
-Related to #3969
-
-(cherry picked from commit 1629887071fe3cc8fe8af0a7aa0d3912509cb058)
----
- racket/collects/setup/variant.rkt | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/racket/collects/setup/variant.rkt b/racket/collects/setup/variant.rkt
-index 81da6f5701..b23131e481 100644
---- a/racket/collects/setup/variant.rkt
-+++ b/racket/collects/setup/variant.rkt
-@@ -25,7 +25,7 @@
-         (and (file-exists? f)
-              (with-input-from-file f
-                (lambda ()
--                 (define m (regexp-match #rx#"bINARy tYPe:..(.)"
-+                 (define m (regexp-match #rx#"bINARy tYPe:e?..(.)"
-                                          (current-input-port)))
-                  (cond
-                    [(not m) '3m]
--- 
-2.30.2
-
diff --git a/gnu/packages/patches/ragel-char-signedness.patch b/gnu/packages/patches/ragel-char-signedness.patch
new file mode 100644
index 0000000000..b3b2bf958a
--- /dev/null
+++ b/gnu/packages/patches/ragel-char-signedness.patch
@@ -0,0 +1,42 @@
+From 2e638fccd81e96ce09841adc4b295b5ce694ea73 Mon Sep 17 00:00:00 2001
+From: Adrian Thurston <thurston@colm.net>
+Date: Sat, 6 Nov 2021 12:20:05 -0700
+Subject: [PATCH] C char type: decide signedness of char based on CHAR_MIN
+
+Previously had char fixed to signed char, this is not useful on ARM as it does
+not align with the host type. Instead, decide at runtime (or probably compile
+time) if char is signed or not.
+---
+ ragel/common.cpp | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/ragel/common.cpp b/ragel/common.cpp
+index 8e9f8ed0..55875c06 100644
+--- a/ragel/common.cpp
++++ b/ragel/common.cpp
+@@ -27,14 +27,14 @@
+ 
+ HostType hostTypesC[] =
+ {
+-	{ "char",     0,       "char",    true,   true,  false,  CHAR_MIN,  CHAR_MAX,   0, 0,              sizeof(char) },
+-	{ "unsigned", "char",  "uchar",   false,  true,  false,  0, 0,                  0,     UCHAR_MAX,  sizeof(unsigned char) },
+-	{ "short",    0,       "short",   true,   true,  false,  SHRT_MIN,  SHRT_MAX,   0, 0,              sizeof(short) },
+-	{ "unsigned", "short", "ushort",  false,  true,  false,  0, 0,                  0,     USHRT_MAX,  sizeof(unsigned short) },
+-	{ "int",      0,       "int",     true,   true,  false,  INT_MIN,   INT_MAX,    0, 0,              sizeof(int) },
+-	{ "unsigned", "int",   "uint",    false,  true,  false,  0, 0,                  0,     UINT_MAX,   sizeof(unsigned int) },
+-	{ "long",     0,       "long",    true,   true,  false,  LONG_MIN,  LONG_MAX,   0, 0,              sizeof(long) },
+-	{ "unsigned", "long",  "ulong",   false,  true,  false,  0, 0,                  0,     ULONG_MAX,  sizeof(unsigned long) }
++	{ "char",     0,       "char",    (CHAR_MIN != 0), true,  false,  SCHAR_MIN, SCHAR_MAX,  0, UCHAR_MAX, sizeof(char) },
++	{ "unsigned", "char",  "uchar",   false,           true,  false,  0, 0,                  0, UCHAR_MAX, sizeof(unsigned char) },
++	{ "short",    0,       "short",   true,            true,  false,  SHRT_MIN,  SHRT_MAX,   0, 0,         sizeof(short) },
++	{ "unsigned", "short", "ushort",  false,           true,  false,  0, 0,                  0, USHRT_MAX, sizeof(unsigned short) },
++	{ "int",      0,       "int",     true,            true,  false,  INT_MIN,   INT_MAX,    0, 0,         sizeof(int) },
++	{ "unsigned", "int",   "uint",    false,           true,  false,  0, 0,                  0, UINT_MAX,  sizeof(unsigned int) },
++	{ "long",     0,       "long",    true,            true,  false,  LONG_MIN,  LONG_MAX,   0, 0,         sizeof(long) },
++	{ "unsigned", "long",  "ulong",   false,           true,  false,  0, 0,                  0, ULONG_MAX, sizeof(unsigned long) }
+ };
+ 
+ #define S8BIT_MIN  -128
+-- 
+2.33.1
+
diff --git a/gnu/packages/patches/range-v3-build-with-gcc10.patch b/gnu/packages/patches/range-v3-build-with-gcc10.patch
new file mode 100644
index 0000000000..a5d5b33523
--- /dev/null
+++ b/gnu/packages/patches/range-v3-build-with-gcc10.patch
@@ -0,0 +1,122 @@
+From 0487cca29e352e8f16bbd91fda38e76e39a0ed28 Mon Sep 17 00:00:00 2001
+From: Louis Dionne <ldionne.2@gmail.com>
+Date: Tue, 15 Jun 2021 14:40:01 -0400
+Subject: [PATCH] Work around broken integration with latest libc++. (#1635)
+
+* Work around broken integration with latest libc++.
+
+In newer versions of libc++, the base template of std::iterator_traits
+provides a member typedef called __primary_template which is an alias
+to the std::iterator_traits specialization itself. This fix works with
+both the old version of libc++ and the new one.
+
+Fixes issue #1633.
+
+* Fix is_std_iterator_traits_specialized_v on MSVC
+
+It used to pretend that std::iterator_traits<T*> is a user-defined
+specialization, which isn't the case. This is due to MSVC's
+iterator_traits<T*> specialization not posing as the base template.
+---
+ include/std/detail/associated_types.hpp | 22 +++++++++++-----
+ test/CMakeLists.txt                     |  1 +
+ test/bug1633.cpp                        | 34 +++++++++++++++++++++++++
+ 3 files changed, 51 insertions(+), 6 deletions(-)
+ create mode 100644 test/bug1633.cpp
+
+diff --git a/include/std/detail/associated_types.hpp b/include/std/detail/associated_types.hpp
+index b642166d4..449a3f91c 100644
+--- a/include/std/detail/associated_types.hpp
++++ b/include/std/detail/associated_types.hpp
+@@ -265,11 +265,22 @@ namespace ranges
+         template<typename I>
+         char is_std_iterator_traits_specialized_impl_(void *);
+ #elif defined(_LIBCPP_VERSION)
+-        template<typename I, bool B>
+-        char (
+-            &is_std_iterator_traits_specialized_impl_(std::__iterator_traits<I, B> *))[2];
++        // In older versions of libc++, the base template inherits from std::__iterator_traits<typename, bool>.
++        template<template<typename, bool> class IteratorTraitsBase, typename I, bool B>
++        char (&libcpp_iterator_traits_base_impl(IteratorTraitsBase<I, B> *))[2];
++        template<template<typename, bool> class IteratorTraitsBase, typename I>
++        char libcpp_iterator_traits_base_impl(void *);
++
++        // In newer versions, the base template has only one template parameter and provides the
++        // __primary_template typedef which aliases the iterator_traits specialization.
++        template<template<typename> class, typename I>
++        char (&libcpp_iterator_traits_base_impl(typename std::iterator_traits<I>::__primary_template *))[2];
++        template<template<typename> class, typename I>
++        char libcpp_iterator_traits_base_impl(void *);
++
+         template<typename I>
+-        char is_std_iterator_traits_specialized_impl_(void *);
++        auto is_std_iterator_traits_specialized_impl_(std::iterator_traits<I>* traits)
++            -> decltype(libcpp_iterator_traits_base_impl<std::__iterator_traits, I>(traits));
+ #elif defined(_MSVC_STL_VERSION)
+         template<typename I>
+         char (&is_std_iterator_traits_specialized_impl_(
+@@ -287,14 +298,13 @@ namespace ranges
+         RANGES_INLINE_VAR constexpr bool is_std_iterator_traits_specialized_v =
+             1 == sizeof(is_std_iterator_traits_specialized_impl_<I>(
+                      static_cast<std::iterator_traits<I> *>(nullptr)));
+-
++#endif
+         // The standard iterator_traits<T *> specialization(s) do not count
+         // as user-specialized. This will no longer be necessary in C++20.
+         // This helps with `T volatile*` and `void *`.
+         template<typename T>
+         RANGES_INLINE_VAR constexpr bool is_std_iterator_traits_specialized_v<T *> =
+             false;
+-#endif
+     } // namespace detail
+     /// \endcond
+ } // namespace ranges
+diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
+index 889f314af..2c2b7c09c 100644
+--- a/test/CMakeLists.txt
++++ b/test/CMakeLists.txt
+@@ -19,3 +19,4 @@ rv3_add_test(test.bug474 bug474 bug474.cpp)
+ rv3_add_test(test.bug566 bug566 bug566.cpp)
+ rv3_add_test(test.bug1322 bug1322 bug1322.cpp)
+ rv3_add_test(test.bug1335 bug1335 bug1335.cpp)
++rv3_add_test(test.bug1633 bug1633 bug1633.cpp)
+diff --git a/test/bug1633.cpp b/test/bug1633.cpp
+new file mode 100644
+index 000000000..be52420ad
+--- /dev/null
++++ b/test/bug1633.cpp
+@@ -0,0 +1,34 @@
++// Range v3 library
++//
++//  Use, modification and distribution is subject to the
++//  Boost Software License, Version 1.0. (See accompanying
++//  file LICENSE_1_0.txt or copy at
++//  http://www.boost.org/LICENSE_1_0.txt)
++//
++// Project home: https://github.com/ericniebler/range-v3
++
++#include <cstddef>
++#include <iterator>
++#include <range/v3/iterator.hpp>
++
++struct X { };
++
++namespace std {
++    template<> struct iterator_traits<X> { };
++}
++
++struct Y {
++    using difference_type = std::ptrdiff_t;
++    using value_type = int;
++    using pointer = int*;
++    using reference = int&;
++    using iterator_category = std::forward_iterator_tag;
++};
++
++static_assert(ranges::detail::is_std_iterator_traits_specialized_v<X>, "");
++static_assert(!ranges::detail::is_std_iterator_traits_specialized_v<Y>, "");
++static_assert(!ranges::detail::is_std_iterator_traits_specialized_v<int*>, "");
++
++int main()
++{
++}
diff --git a/gnu/packages/patches/retroarch-LIBRETRO_DIRECTORY.patch b/gnu/packages/patches/retroarch-LIBRETRO_DIRECTORY.patch
index 30515cbe48..ffa75918b8 100644
--- a/gnu/packages/patches/retroarch-LIBRETRO_DIRECTORY.patch
+++ b/gnu/packages/patches/retroarch-LIBRETRO_DIRECTORY.patch
@@ -1,32 +1,36 @@
-From f308dc91660954ab88bb41868c0b9809592923e6 Mon Sep 17 00:00:00 2001
+From 4c02c080475c9d08dbed98dd64ecca337aa359ae Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= <iyzsong@member.fsf.org>
 Date: Sat, 20 Feb 2021 20:37:39 +0800
 Subject: [PATCH] Allow set libretro_directory via environment variable
 
 ---
- retroarch.c | 9 +++++++++
- 1 file changed, 9 insertions(+)
+ retroarch.c | 13 ++++++++++++-
+ 1 file changed, 12 insertions(+), 1 deletion(-)
 
 diff --git a/retroarch.c b/retroarch.c
-index 6a88c3108e..6807c12b5b 100644
+index 8a0461c816..cbf11d8b6a 100644
 --- a/retroarch.c
 +++ b/retroarch.c
-@@ -36038,6 +36038,15 @@ static void retroarch_parse_input_and_config(
- #endif
-       config_load(&p_rarch->g_extern);
- 
+@@ -17603,7 +17603,18 @@ static bool retroarch_parse_input_and_config(
+             p_rarch->configuration_settings->bools.log_to_file,
+             p_rarch->configuration_settings->bools.log_to_file_timestamp,
+             p_rarch->configuration_settings->paths.log_dir);
+-            
++
 +   /* Override settings via environment variables */
-+   if (getenv("LIBRETRO_DIRECTORY")) {
++   {
 +      settings_t *settings = p_rarch->configuration_settings;
-+      retroarch_override_setting_set(RARCH_OVERRIDE_SETTING_LIBRETRO_DIRECTORY, NULL);
-+      configuration_set_string(settings,
-+            settings->paths.directory_libretro,
-+            getenv("LIBRETRO_DIRECTORY"));
++      char *value = getenv("LIBRETRO_DIRECTORY");
++      if (value != NULL)
++      {
++         retroarch_override_setting_set(RARCH_OVERRIDE_SETTING_LIBRETRO_DIRECTORY, NULL);
++         configuration_set_string(settings, settings->paths.directory_libretro, value);
++      }
 +   }
 +
     /* Second pass: All other arguments override the config file */
     optind = 1;
  
 -- 
-2.30.0
+2.33.0
 
diff --git a/gnu/packages/patches/rust-1.19-mrustc.patch b/gnu/packages/patches/rust-1.19-mrustc.patch
deleted file mode 100644
index 261162172e..0000000000
--- a/gnu/packages/patches/rust-1.19-mrustc.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-See https://github.com/thepowersgang/mrustc/archive/v0.8.0.tar.gz
-
---- rustc-1.19.0-src-orig/src/libcore/intrinsics.rs
-+++ rustc-1.19.0-src/src/libcore/intrinsics.rs
-@@ -678,5 +678,9 @@
-     pub fn min_align_of_val<T: ?Sized>(_: &T) -> usize;
- 
-+    /// Obtain the length of a slice pointer
-+    #[cfg(rust_compiler="mrustc")]
-+    pub fn mrustc_slice_len<T>(pointer: *const [T]) -> usize;
-+
-     /// Gets a static string slice containing the name of a type.
-     pub fn type_name<T: ?Sized>() -> &'static str;
-
---- rustc-1.19.0-src-orig/src/libcore/slice/mod.rs
-+++ rustc-1.19.0-src/src/libcore/slice/mod.rs
-@@ -413,6 +413,8 @@
-     #[inline]
-     fn len(&self) -> usize {
--        unsafe {
--            mem::transmute::<&[T], Repr<T>>(self).len
--        }
-+        #[cfg(not(rust_compiler="mrustc"))]
-+        let rv = unsafe { mem::transmute::<&[T], Repr<T>>(self).len };
-+        #[cfg(rust_compiler="mrustc")]
-+        let rv = unsafe { ::intrinsics::mrustc_slice_len(self) };
-+        rv
-     }
diff --git a/gnu/packages/patches/rust-1.25-accept-more-detailed-gdb-lines.patch b/gnu/packages/patches/rust-1.25-accept-more-detailed-gdb-lines.patch
deleted file mode 100644
index a2bad55117..0000000000
--- a/gnu/packages/patches/rust-1.25-accept-more-detailed-gdb-lines.patch
+++ /dev/null
@@ -1,111 +0,0 @@
-GDB responds with some overly detailed lines - which makes the tests fail.
-Patch rust to accept those instead.
-See <https://github.com/rust-lang/rust/issues/54178>.
-diff -ur orig/rustc-1.25.0-src/src/test/debuginfo/generic-enum-with-different-disr-sizes.rs rustc-1.25.0-src/src/test/debuginfo/generic-enum-with-different-disr-sizes.rs
---- orig/rustc-1.25.0-src/src/test/debuginfo/generic-enum-with-different-disr-sizes.rs	2018-09-13 10:24:33.775565159 +0200
-+++ rustc-1.25.0-src/src/test/debuginfo/generic-enum-with-different-disr-sizes.rs	2018-09-13 10:25:56.322513658 +0200
-@@ -19,36 +19,36 @@
- 
- // gdb-command:print eight_bytes1
- // gdbg-check:$1 = {{RUST$ENUM$DISR = Variant1, __0 = 100}, {RUST$ENUM$DISR = Variant1, __0 = 100}}
--// gdbr-check:$1 = generic_enum_with_different_disr_sizes::Enum::Variant1(100)
-+// gdbr-check:$1 = generic_enum_with_different_disr_sizes::Enum<f64>::Variant1(100)
- 
- // gdb-command:print four_bytes1
- // gdbg-check:$2 = {{RUST$ENUM$DISR = Variant1, __0 = 101}, {RUST$ENUM$DISR = Variant1, __0 = 101}}
--// gdbr-check:$2 = generic_enum_with_different_disr_sizes::Enum::Variant1(101)
-+// gdbr-check:$2 = generic_enum_with_different_disr_sizes::Enum<i32>::Variant1(101)
- 
- // gdb-command:print two_bytes1
- // gdbg-check:$3 = {{RUST$ENUM$DISR = Variant1, __0 = 102}, {RUST$ENUM$DISR = Variant1, __0 = 102}}
--// gdbr-check:$3 = generic_enum_with_different_disr_sizes::Enum::Variant1(102)
-+// gdbr-check:$3 = generic_enum_with_different_disr_sizes::Enum<i16>::Variant1(102)
- 
- // gdb-command:print one_byte1
- // gdbg-check:$4 = {{RUST$ENUM$DISR = Variant1, __0 = 65 'A'}, {RUST$ENUM$DISR = Variant1, __0 = 65 'A'}}
--// gdbr-check:$4 = generic_enum_with_different_disr_sizes::Enum::Variant1(65)
-+// gdbr-check:$4 = generic_enum_with_different_disr_sizes::Enum<u8>::Variant1(65)
- 
- 
- // gdb-command:print eight_bytes2
- // gdbg-check:$5 = {{RUST$ENUM$DISR = Variant2, __0 = 100}, {RUST$ENUM$DISR = Variant2, __0 = 100}}
--// gdbr-check:$5 = generic_enum_with_different_disr_sizes::Enum::Variant2(100)
-+// gdbr-check:$5 = generic_enum_with_different_disr_sizes::Enum<f64>::Variant2(100)
- 
- // gdb-command:print four_bytes2
- // gdbg-check:$6 = {{RUST$ENUM$DISR = Variant2, __0 = 101}, {RUST$ENUM$DISR = Variant2, __0 = 101}}
--// gdbr-check:$6 = generic_enum_with_different_disr_sizes::Enum::Variant2(101)
-+// gdbr-check:$6 = generic_enum_with_different_disr_sizes::Enum<i32>::Variant2(101)
- 
- // gdb-command:print two_bytes2
- // gdbg-check:$7 = {{RUST$ENUM$DISR = Variant2, __0 = 102}, {RUST$ENUM$DISR = Variant2, __0 = 102}}
--// gdbr-check:$7 = generic_enum_with_different_disr_sizes::Enum::Variant2(102)
-+// gdbr-check:$7 = generic_enum_with_different_disr_sizes::Enum<i16>::Variant2(102)
- 
- // gdb-command:print one_byte2
- // gdbg-check:$8 = {{RUST$ENUM$DISR = Variant2, __0 = 65 'A'}, {RUST$ENUM$DISR = Variant2, __0 = 65 'A'}}
--// gdbr-check:$8 = generic_enum_with_different_disr_sizes::Enum::Variant2(65)
-+// gdbr-check:$8 = generic_enum_with_different_disr_sizes::Enum<u8>::Variant2(65)
- 
- // gdb-command:continue
- 
-diff -ur orig/rustc-1.25.0-src/src/test/debuginfo/generic-struct-style-enum.rs rustc-1.25.0-src/src/test/debuginfo/generic-struct-style-enum.rs
---- orig/rustc-1.25.0-src/src/test/debuginfo/generic-struct-style-enum.rs	2018-09-13 10:24:33.775565159 +0200
-+++ rustc-1.25.0-src/src/test/debuginfo/generic-struct-style-enum.rs	2018-09-13 10:27:43.353108111 +0200
-@@ -19,15 +19,15 @@
- 
- // gdb-command:print case1
- // gdbg-check:$1 = {{RUST$ENUM$DISR = Case1, a = 0, b = 31868, c = 31868, d = 31868, e = 31868}, {RUST$ENUM$DISR = Case1, [...]}, {RUST$ENUM$DISR = Case1, [...]}}
--// gdbr-check:$1 = generic_struct_style_enum::Regular::Case1{a: 0, b: 31868, c: 31868, d: 31868, e: 31868}
-+// gdbr-check:$1 = generic_struct_style_enum::Regular<u16, u32, i64>::Case1{a: 0, b: 31868, c: 31868, d: 31868, e: 31868}
- 
- // gdb-command:print case2
- // gdbg-check:$2 = {{RUST$ENUM$DISR = Case2, [...]}, {RUST$ENUM$DISR = Case2, a = 0, b = 286331153, c = 286331153}, {RUST$ENUM$DISR = Case2, [...]}}
--// gdbr-check:$2 = generic_struct_style_enum::Regular::Case2{a: 0, b: 286331153, c: 286331153}
-+// gdbr-check:$2 = generic_struct_style_enum::Regular<i16, u32, i64>::Case2{a: 0, b: 286331153, c: 286331153}
- 
- // gdb-command:print case3
- // gdbg-check:$3 = {{RUST$ENUM$DISR = Case3, [...]}, {RUST$ENUM$DISR = Case3, [...]}, {RUST$ENUM$DISR = Case3, a = 0, b = 6438275382588823897}}
--// gdbr-check:$3 = generic_struct_style_enum::Regular::Case3{a: 0, b: 6438275382588823897}
-+// gdbr-check:$3 = generic_struct_style_enum::Regular<u16, i32, u64>::Case3{a: 0, b: 6438275382588823897}
- 
- // gdb-command:print univariant
- // gdbg-check:$4 = {{a = -1}}
-diff -ur orig/rustc-1.25.0-src/src/test/debuginfo/generic-tuple-style-enum.rs rustc-1.25.0-src/src/test/debuginfo/generic-tuple-style-enum.rs
---- orig/rustc-1.25.0-src/src/test/debuginfo/generic-tuple-style-enum.rs	2018-09-13 10:24:33.775565159 +0200
-+++ rustc-1.25.0-src/src/test/debuginfo/generic-tuple-style-enum.rs	2018-09-13 10:28:26.328546298 +0200
-@@ -21,15 +21,15 @@
- 
- // gdb-command:print case1
- // gdbg-check:$1 = {{RUST$ENUM$DISR = Case1, __0 = 0, __1 = 31868, __2 = 31868, __3 = 31868, __4 = 31868}, {RUST$ENUM$DISR = Case1, [...]}, {RUST$ENUM$DISR = Case1, [...]}}
--// gdbr-check:$1 = generic_tuple_style_enum::Regular::Case1(0, 31868, 31868, 31868, 31868)
-+// gdbr-check:$1 = generic_tuple_style_enum::Regular<u16, u32, u64>::Case1(0, 31868, 31868, 31868, 31868)
- 
- // gdb-command:print case2
- // gdbg-check:$2 = {{RUST$ENUM$DISR = Case2, [...]}, {RUST$ENUM$DISR = Case2, __0 = 0, __1 = 286331153, __2 = 286331153}, {RUST$ENUM$DISR = Case2, [...]}}
--// gdbr-check:$2 = generic_tuple_style_enum::Regular::Case2(0, 286331153, 286331153)
-+// gdbr-check:$2 = generic_tuple_style_enum::Regular<i16, i32, i64>::Case2(0, 286331153, 286331153)
- 
- // gdb-command:print case3
- // gdbg-check:$3 = {{RUST$ENUM$DISR = Case3, [...]}, {RUST$ENUM$DISR = Case3, [...]}, {RUST$ENUM$DISR = Case3, __0 = 0, __1 = 6438275382588823897}}
--// gdbr-check:$3 = generic_tuple_style_enum::Regular::Case3(0, 6438275382588823897)
-+// gdbr-check:$3 = generic_tuple_style_enum::Regular<i16, i32, i64>::Case3(0, 6438275382588823897)
- 
- // gdb-command:print univariant
- // gdbg-check:$4 = {{__0 = -1}}
---- orig/rustc-1.25.0-src/src/test/debuginfo/nil-enum.rs	2018-09-13 10:24:33.783565071 +0200
-+++ rustc-1.25.0-src/src/test/debuginfo/nil-enum.rs	2018-10-26 18:19:20.404564587 +0200
-@@ -17,11 +17,11 @@
- 
- // gdb-command:print first
- // gdbg-check:$1 = {<No data fields>}
--// gdbr-check:$1 = <error reading variable>
-+// gdbr-check:$1 = nil_enum::ANilEnum
- 
- // gdb-command:print second
- // gdbg-check:$2 = {<No data fields>}
--// gdbr-check:$2 = <error reading variable>
-+// gdbr-check:$2 = nil_enum::AnotherNilEnum
- 
- #![allow(unused_variables)]
- #![feature(omit_gdb_pretty_printer_section)]
diff --git a/gnu/packages/patches/rust-1.30-gdb-llvm.patch b/gnu/packages/patches/rust-1.30-gdb-llvm.patch
deleted file mode 100644
index e8f0acc8b4..0000000000
--- a/gnu/packages/patches/rust-1.30-gdb-llvm.patch
+++ /dev/null
@@ -1,89 +0,0 @@
-Tweak some gdb tests which were broken during LLVM upgrades.
-This has been subsequently fixed upstream in later rustc versions,
-but still needed to bootstrap some earlier versions of the compiler.
-
-diff -r -u rustc-1.30.1-src-orig/src/test/debuginfo/borrowed-c-style-enum.rs rustc-1.30.1-src/src/test/debuginfo/borrowed-c-style-enum.rs
---- rustc-1.30.1-src-orig/src/test/debuginfo/borrowed-c-style-enum.rs	2019-02-04 12:49:34.055483896 -0800
-+++ rustc-1.30.1-src/src/test/debuginfo/borrowed-c-style-enum.rs	2019-02-04 13:01:10.915950356 -0800
-@@ -18,15 +18,15 @@
- 
- // gdb-command:print *the_a_ref
- // gdbg-check:$1 = TheA
--// gdbr-check:$1 = borrowed_c_style_enum::ABC::TheA
-+// gdbr-check:$1 = borrowed_c_style_enum::TheA
- 
- // gdb-command:print *the_b_ref
- // gdbg-check:$2 = TheB
--// gdbr-check:$2 = borrowed_c_style_enum::ABC::TheB
-+// gdbr-check:$2 = borrowed_c_style_enum::TheB
- 
- // gdb-command:print *the_c_ref
- // gdbg-check:$3 = TheC
--// gdbr-check:$3 = borrowed_c_style_enum::ABC::TheC
-+// gdbr-check:$3 = borrowed_c_style_enum::TheC
- 
- 
- // === LLDB TESTS ==================================================================================
-diff -r -u rustc-1.30.1-src-orig/src/test/debuginfo/c-style-enum-in-composite.rs rustc-1.30.1-src/src/test/debuginfo/c-style-enum-in-composite.rs
---- rustc-1.30.1-src-orig/src/test/debuginfo/c-style-enum-in-composite.rs	2019-02-04 12:49:34.051483727 -0800
-+++ rustc-1.30.1-src/src/test/debuginfo/c-style-enum-in-composite.rs	2019-02-04 13:02:00.981997525 -0800
-@@ -19,31 +19,31 @@
- 
- // gdb-command:print tuple_interior_padding
- // gdbg-check:$1 = {__0 = 0, __1 = OneHundred}
--// gdbr-check:$1 = (0, c_style_enum_in_composite::AnEnum::OneHundred)
-+// gdbr-check:$1 = (0, c_style_enum_in_composite::OneHundred)
- 
- // gdb-command:print tuple_padding_at_end
- // gdbg-check:$2 = {__0 = {__0 = 1, __1 = OneThousand}, __1 = 2}
--// gdbr-check:$2 = ((1, c_style_enum_in_composite::AnEnum::OneThousand), 2)
-+// gdbr-check:$2 = ((1, c_style_enum_in_composite::OneThousand), 2)
- 
- // gdb-command:print tuple_different_enums
- // gdbg-check:$3 = {__0 = OneThousand, __1 = MountainView, __2 = OneMillion, __3 = Vienna}
--// gdbr-check:$3 = (c_style_enum_in_composite::AnEnum::OneThousand, c_style_enum_in_composite::AnotherEnum::MountainView, c_style_enum_in_composite::AnEnum::OneMillion, c_style_enum_in_composite::AnotherEnum::Vienna)
-+// gdbr-check:$3 = (c_style_enum_in_composite::OneThousand, c_style_enum_in_composite::MountainView, c_style_enum_in_composite::OneMillion, c_style_enum_in_composite::Vienna)
- 
- // gdb-command:print padded_struct
- // gdbg-check:$4 = {a = 3, b = OneMillion, c = 4, d = Toronto, e = 5}
--// gdbr-check:$4 = c_style_enum_in_composite::PaddedStruct {a: 3, b: c_style_enum_in_composite::AnEnum::OneMillion, c: 4, d: c_style_enum_in_composite::AnotherEnum::Toronto, e: 5}
-+// gdbr-check:$4 = c_style_enum_in_composite::PaddedStruct {a: 3, b: c_style_enum_in_composite::OneMillion, c: 4, d: c_style_enum_in_composite::Toronto, e: 5}
- 
- // gdb-command:print packed_struct
- // gdbg-check:$5 = {a = 6, b = OneHundred, c = 7, d = Vienna, e = 8}
--// gdbr-check:$5 = c_style_enum_in_composite::PackedStruct {a: 6, b: c_style_enum_in_composite::AnEnum::OneHundred, c: 7, d: c_style_enum_in_composite::AnotherEnum::Vienna, e: 8}
-+// gdbr-check:$5 = c_style_enum_in_composite::PackedStruct {a: 6, b: c_style_enum_in_composite::OneHundred, c: 7, d: c_style_enum_in_composite::Vienna, e: 8}
- 
- // gdb-command:print non_padded_struct
- // gdbg-check:$6 = {a = OneMillion, b = MountainView, c = OneThousand, d = Toronto}
--// gdbr-check:$6 = c_style_enum_in_composite::NonPaddedStruct {a: c_style_enum_in_composite::AnEnum::OneMillion, b: c_style_enum_in_composite::AnotherEnum::MountainView, c: c_style_enum_in_composite::AnEnum::OneThousand, d: c_style_enum_in_composite::AnotherEnum::Toronto}
-+// gdbr-check:$6 = c_style_enum_in_composite::NonPaddedStruct {a: c_style_enum_in_composite::OneMillion, b: c_style_enum_in_composite::MountainView, c: c_style_enum_in_composite::OneThousand, d: c_style_enum_in_composite::Toronto}
- 
- // gdb-command:print struct_with_drop
- // gdbg-check:$7 = {__0 = {a = OneHundred, b = Vienna}, __1 = 9}
--// gdbr-check:$7 = (c_style_enum_in_composite::StructWithDrop {a: c_style_enum_in_composite::AnEnum::OneHundred, b: c_style_enum_in_composite::AnotherEnum::Vienna}, 9)
-+// gdbr-check:$7 = (c_style_enum_in_composite::StructWithDrop {a: c_style_enum_in_composite::OneHundred, b: c_style_enum_in_composite::Vienna}, 9)
- 
- // === LLDB TESTS ==================================================================================
- 
-diff -r -u rustc-1.30.1-src-orig/src/test/debuginfo/gdb-pretty-struct-and-enums-pre-gdb-7-7.rs rustc-1.30.1-src/src/test/debuginfo/gdb-pretty-struct-and-enums-pre-gdb-7-7.rs
---- rustc-1.30.1-src-orig/src/test/debuginfo/gdb-pretty-struct-and-enums-pre-gdb-7-7.rs	2019-02-04 12:49:34.043483393 -0800
-+++ rustc-1.30.1-src/src/test/debuginfo/gdb-pretty-struct-and-enums-pre-gdb-7-7.rs	2019-02-04 13:02:17.954691634 -0800
-@@ -27,15 +27,15 @@
- 
- // gdb-command: print c_style_enum1
- // gdbg-check:$3 = CStyleEnumVar1
--// gdbr-check:$3 = gdb_pretty_struct_and_enums_pre_gdb_7_7::CStyleEnum::CStyleEnumVar1
-+// gdbr-check:$3 = gdb_pretty_struct_and_enums_pre_gdb_7_7::CStyleEnumVar1
- 
- // gdb-command: print c_style_enum2
- // gdbg-check:$4 = CStyleEnumVar2
--// gdbr-check:$4 = gdb_pretty_struct_and_enums_pre_gdb_7_7::CStyleEnum::CStyleEnumVar2
-+// gdbr-check:$4 = gdb_pretty_struct_and_enums_pre_gdb_7_7::CStyleEnumVar2
- 
- // gdb-command: print c_style_enum3
- // gdbg-check:$5 = CStyleEnumVar3
--// gdbr-check:$5 = gdb_pretty_struct_and_enums_pre_gdb_7_7::CStyleEnum::CStyleEnumVar3
-+// gdbr-check:$5 = gdb_pretty_struct_and_enums_pre_gdb_7_7::CStyleEnumVar3
- 
- #![allow(dead_code, unused_variables)]
diff --git a/gnu/packages/patches/rust-1.45-linker-locale.patch b/gnu/packages/patches/rust-1.45-linker-locale.patch
deleted file mode 100644
index 40220e8e77..0000000000
--- a/gnu/packages/patches/rust-1.45-linker-locale.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-Patch will be included upstream in 1.47: https://github.com/rust-lang/rust/pull/74416
-diff --git a/src/librustc_codegen_ssa/back/linker.rs b/src/librustc_codegen_ssa/back/linker.rs
-index e64aafa599f..12575ac4358 100644
---- a/src/librustc_codegen_ssa/back/linker.rs
-+++ b/src/librustc_codegen_ssa/back/linker.rs
-@@ -28,7 +28,7 @@ use rustc_target::spec::{LinkOutputKind, LinkerFlavor, LldFlavor};
- pub fn disable_localization(linker: &mut Command) {
-     // No harm in setting both env vars simultaneously.
-     // Unix-style linkers.
--    linker.env("LC_ALL", "C");
-+    linker.env("LC_ALL", "en_US.UTF-8");
-     // MSVC's `link.exe`.
-     linker.env("VSLANG", "1033");
- }
diff --git a/gnu/packages/patches/rust-1.48-linker-locale.patch b/gnu/packages/patches/rust-1.48-linker-locale.patch
deleted file mode 100644
index d06dcbe682..0000000000
--- a/gnu/packages/patches/rust-1.48-linker-locale.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-https://github.com/rust-lang/rust/pull/74416
-diff --git a/compiler/rustc_codegen_ssa/src/back/linker.rs b/compiler/rustc_codegen_ssa/src/back/linker.rs
-index 3df956c465e..f45fee45be4 100644
---- a/compiler/rustc_codegen_ssa/src/back/linker.rs
-+++ b/compiler/rustc_codegen_ssa/src/back/linker.rs
-@@ -28,7 +28,7 @@
- pub fn disable_localization(linker: &mut Command) {
-     // No harm in setting both env vars simultaneously.
-     // Unix-style linkers.
--    linker.env("LC_ALL", "C");
-+    linker.env("LC_ALL", "en_US.UTF-8");
-     // MSVC's `link.exe`.
-     linker.env("VSLANG", "1033");
- }
diff --git a/gnu/packages/patches/rust-adblock-ignore-live-tests.patch b/gnu/packages/patches/rust-adblock-ignore-live-tests.patch
new file mode 100644
index 0000000000..fc7f2858ff
--- /dev/null
+++ b/gnu/packages/patches/rust-adblock-ignore-live-tests.patch
@@ -0,0 +1,69 @@
+From b83b5b453d3f7883ef4c12f84a7045486957c709 Mon Sep 17 00:00:00 2001
+From: Petr Hodina <phodina@protonmail.com>
+Date: Tue, 9 Nov 2021 17:02:54 +0100
+Subject: [PATCH] Ignore live tests.
+
+
+diff --git a/tests/live.rs b/tests/live.rs
+index b1a19fc..6bd4685 100644
+--- a/tests/live.rs
++++ b/tests/live.rs
+@@ -140,6 +140,7 @@ fn get_blocker_engine_deserialized_ios() -> Engine {
+ }
+
+ #[test]
++#[ignore]
+ fn check_live_specific_urls() {
+     let mut engine = get_blocker_engine();
+     {
+@@ -176,6 +177,7 @@ fn check_live_specific_urls() {
+ }
+
+ #[test]
++#[ignore]
+ fn check_live_deserialized_specific_urls() {
+     let mut engine = get_blocker_engine_deserialized();
+     {
+@@ -201,6 +203,7 @@ fn check_live_deserialized_specific_urls() {
+ }
+
+ #[test]
++#[ignore]
+ fn check_live_from_filterlists() {
+     let engine = get_blocker_engine();
+     let requests = load_requests();
+@@ -214,6 +217,7 @@ fn check_live_from_filterlists() {
+ }
+
+ #[test]
++#[ignore]
+ fn check_live_deserialized_file() {
+     let engine = get_blocker_engine_deserialized();
+     let requests = load_requests();
+@@ -243,6 +247,7 @@ fn check_live_deserialized_ios() {
+
+ #[cfg(feature = "resource_assembler")]
+ #[test]
++#[ignore]
+ fn check_live_redirects() {
+     use adblock::resources::resource_assembler::assemble_web_accessible_resources;
+
+@@ -278,6 +283,7 @@ fn check_live_redirects() {
+ }
+
+ #[test]
++#[ignore]
+ /// Ensure that two different engines loaded from the same textual filter set serialize to
+ /// identical buffers.
+ fn stable_serialization() {
+@@ -291,6 +297,7 @@ fn stable_serialization() {
+ }
+
+ #[test]
++#[ignore]
+ /// Ensure that one engine's serialization result can be exactly reproduced by another engine after
+ /// deserializing from it.
+ fn stable_serialization_through_load() {
+--
+2.33.1
+
diff --git a/gnu/packages/patches/rust-bootstrap-stage0-test.patch b/gnu/packages/patches/rust-bootstrap-stage0-test.patch
deleted file mode 100644
index e8484903e5..0000000000
--- a/gnu/packages/patches/rust-bootstrap-stage0-test.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-Bootstrap tests failed with local stage0 cargo and rustc
-Backported changes from https://github.com/rust-lang/rust/pull/51977
-
-From 0834d9d771e912f51deca6c25699e44734624546 Mon Sep 17 00:00:00 2001
-From: Nikolai Merinov <nikolai.merinov@member.fsf.org>
-Date: Mon, 2 Jul 2018 01:45:35 +0500
-Subject: [PATCH] bootstrap: tests should use rustc from config.toml
-
-Tests should always use "rustc" and "cargo" from config.toml instead
-of assuming that stage0 binaries was downloaded to build directory.
----
- src/bootstrap/bootstrap.py | 2 ++
- src/bootstrap/config.rs    | 6 ++----
- 2 files changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py
-index 487440becf..1701f7b83a 100644
---- a/src/bootstrap/bootstrap.py
-+++ b/src/bootstrap/bootstrap.py
-@@ -788,6 +788,8 @@ def bootstrap(help_triggered):
-     env["BOOTSTRAP_PARENT_ID"] = str(os.getpid())
-     env["BOOTSTRAP_PYTHON"] = sys.executable
-     env["BUILD_DIR"] = build.build_dir
-+    env["CARGO"] = build.cargo()
-+    env["RUSTC"] = build.rustc()
-     run(args, env=env, verbose=build.verbose)
- 
- 
-diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs
-index 6dd6291be2..d1a0deb583 100644
---- a/src/bootstrap/config.rs
-+++ b/src/bootstrap/config.rs
-@@ -23,7 +23,6 @@ use std::cmp;
- 
- use num_cpus;
- use toml;
--use util::exe;
- use cache::{INTERNER, Interned};
- use flags::Flags;
- pub use flags::Subcommand;
-@@ -362,9 +361,8 @@ impl Config {
-         config.src = Config::path_from_python("SRC");
-         config.out = Config::path_from_python("BUILD_DIR");
- 
--        let stage0_root = config.out.join(&config.build).join("stage0/bin");
--        config.initial_rustc = stage0_root.join(exe("rustc", &config.build));
--        config.initial_cargo = stage0_root.join(exe("cargo", &config.build));
-+        config.initial_rustc = Config::path_from_python("RUSTC");
-+        config.initial_cargo = Config::path_from_python("CARGO");
- 
-         config
-     }
--- 
-2.17.1
-
diff --git a/gnu/packages/patches/rust-openssl-sys-no-vendor.patch b/gnu/packages/patches/rust-openssl-sys-no-vendor.patch
index 78a6b5e3f7..9855faf8b2 100644
--- a/gnu/packages/patches/rust-openssl-sys-no-vendor.patch
+++ b/gnu/packages/patches/rust-openssl-sys-no-vendor.patch
@@ -2,6 +2,8 @@ https://sources.debian.org/data/main/r/rust-openssl-sys/0.9.53-1/debian/patches/
 "MIT" licensed according to debian/copyright file
 slightly modified to only change the vendored openssl-src dependency
 
+Starting from rust-openssl-sys@0.9.69 Cargo.toml starts searching for openssl-3.0.
+
 --- a/Cargo.toml
 +++ b/Cargo.toml
 @@ -31,14 +31,11 @@
diff --git a/gnu/packages/patches/rust-reproducible-builds.patch b/gnu/packages/patches/rust-reproducible-builds.patch
deleted file mode 100644
index ef7bf53b5d..0000000000
--- a/gnu/packages/patches/rust-reproducible-builds.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From b9ca108fcae2b738ca3f0c88c84ae5dc5a6f843f Mon Sep 17 00:00:00 2001
-From: Tim Ryan <id@timryan.org>
-Date: Mon, 14 May 2018 06:22:21 -0400
-Subject: [PATCH] Support reproducible builds by forcing window.search to use
- stable key ordering. (#692)
-See <https://github.com/rust-lang-nursery/mdBook/pull/692>
----
- src/vendor/mdbook/src/renderer/html_handlebars/search.rs | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/src/vendor/mdbook/src/renderer/html_handlebars/search.rs b/src/vendor/mdbook/src/renderer/html_handlebars/search.rs
-index d49772f8b..1ee66a511 100644
---- a/src/vendor/mdbook/src/renderer/html_handlebars/search.rs
-+++ b/src/vendor/mdbook/src/renderer/html_handlebars/search.rs
-@@ -205,6 +205,10 @@ fn write_to_js(index: Index, search_config: &Search) -> Result<String> {
-         searchoptions,
-         index,
-     };
-+
-+    // By converting to serde_json::Value as an intermediary, we use a
-+    // BTreeMap internally and can force a stable ordering of map keys.
-+    let json_contents = serde_json::to_value(&json_contents)?;
-     let json_contents = serde_json::to_string(&json_contents)?;
- 
-     Ok(format!("window.search = {};", json_contents))
diff --git a/gnu/packages/patches/rust-shell2batch-lint-fix.patch b/gnu/packages/patches/rust-shell2batch-lint-fix.patch
new file mode 100644
index 0000000000..7c160b6cca
--- /dev/null
+++ b/gnu/packages/patches/rust-shell2batch-lint-fix.patch
@@ -0,0 +1,25 @@
+Resolves the following error that was most likely introduced in new version of
+rust as this package is from 2019:
+
+error: unnecessary parentheses around type
+   --> src/converter.rs:108:61
+    |
+108 | fn add_arguments(arguments: &str, additional_arguments: Vec<(String)>, pre: bool) -> String {
+    |                                                             ^^^^^^^^ help: remove these parentheses
+
+Reported upstream at https://github.com/sagiegurari/shell2batch/issues/17.
+
+diff --git a/src/converter.rs b/src/converter.rs
+index fc87d68..af309d2 100644
+--- a/src/converter.rs
++++ b/src/converter.rs
+@@ -105,7 +105,7 @@ fn replace_vars(arguments: &str) -> String {
+     updated_arguments
+ }
+ 
+-fn add_arguments(arguments: &str, additional_arguments: Vec<(String)>, pre: bool) -> String {
++fn add_arguments(arguments: &str, additional_arguments: Vec<String>, pre: bool) -> String {
+     let mut windows_arguments = if pre {
+         "".to_string()
+     } else {
+
diff --git a/gnu/packages/patches/rust-wl-clipboard-rs-newer-wl.patch b/gnu/packages/patches/rust-wl-clipboard-rs-newer-wl.patch
new file mode 100644
index 0000000000..9fb692e9a6
--- /dev/null
+++ b/gnu/packages/patches/rust-wl-clipboard-rs-newer-wl.patch
@@ -0,0 +1,26 @@
+diff --git a/Cargo.toml b/Cargo.toml
+index 7b975e0..313cb63 100644
+--- a/Cargo.toml
++++ b/Cargo.toml.new
+@@ -75,17 +75,17 @@ version = "3"
+ version = "0.2"
+ 
+ [dependencies.wayland-client]
+-version = "0.27"
++version = "0.28"
+ 
+ [dependencies.wayland-protocols]
+-version = "0.27"
++version = "0.28"
+ features = ["client", "unstable_protocols"]
+ [dev-dependencies.wayland-protocols]
+-version = "0.27"
++version = "0.28"
+ features = ["server", "unstable_protocols"]
+ 
+ [dev-dependencies.wayland-server]
+-version = "0.27"
++version = "0.28"
+ 
+ [features]
+ dlopen = ["native_lib", "wayland-client/dlopen", "wayland-server/dlopen"]
diff --git a/gnu/packages/patches/rustc-1.39.0-src.patch b/gnu/packages/patches/rustc-1.39.0-src.patch
new file mode 100644
index 0000000000..7859bd44d5
--- /dev/null
+++ b/gnu/packages/patches/rustc-1.39.0-src.patch
@@ -0,0 +1,99 @@
+# This modified patch is to disable the hunk applying to LLVM, unbundled in Guix.
+
+# Add mrustc slice length intrinsics
+--- src/libcore/intrinsics.rs
++++ src/libcore/intrinsics.rs
+@@ -685,4 +685,8 @@
+     pub fn min_align_of_val<T: ?Sized>(_: &T) -> usize;
+ 
++    /// Obtain the length of a slice pointer
++    #[cfg(rust_compiler="mrustc")]
++    pub fn mrustc_slice_len<T>(pointer: *const [T]) -> usize;
++
+     /// Gets a static string slice containing the name of a type.
+     pub fn type_name<T: ?Sized>() -> &'static str;
+
+--- src/libcore/slice/mod.rs
++++ src/libcore/slice/mod.rs
+@@ -68,5 +68,8 @@
+     pub const fn len(&self) -> usize {
+-        unsafe {
+-            crate::ptr::Repr { rust: self }.raw.len
+-        }
++        #[cfg(not(rust_compiler="mrustc"))]
++        #[cfg_attr(not(bootstrap), allow_internal_unstable(const_fn_union))]
++        const fn len_inner<T>(s: &[T]) -> usize { unsafe { crate::ptr::Repr { rust: s }.raw.len } };
++        #[cfg(rust_compiler="mrustc")]
++        const fn len_inner<T>(s: &[T]) -> usize { unsafe { crate::intrinsics::mrustc_slice_len(s) } }
++        len_inner(self)
+     }
+#
+# Static-link rustc_codegen_llvm so the generated rustc is standalone
+# > Note: Interacts with `rustc-1.39.0-overrides.toml`
+#
+--- src/librustc_interface/util.rs
++++ src/librustc_interface/util.rs
+@@ -421,2 +421,4 @@
+ pub fn get_codegen_sysroot(backend_name: &str) -> fn() -> Box<dyn CodegenBackend> {
++    #[cfg(rust_compiler="mrustc")]
++    { if(backend_name == "llvm") { extern "Rust" { fn __rustc_codegen_backend() -> Box<dyn CodegenBackend>; } return || unsafe { __rustc_codegen_backend() } } }
+     // For now we only allow this function to be called once as it'll dlopen a
+# Disable most architecture intrinsics
+--- src/stdarch/crates/std_detect/src/detect/mod.rs
++++ src/stdarch/crates/std_detect/src/detect/mod.rs
+@@ -74,4 +74,7 @@
+         // this run-time detection logic is never called.
+         #[path = "os/other.rs"]
+         mod os;
++    } else if #[cfg(rust_compiler="mrustc")] {
++        #[path = "os/other.rs"]
++        mod os;
+     } else if #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] {
+--- vendor/ppv-lite86/src/lib.rs
++++ vendor/ppv-lite86/src/lib.rs
+@@ -12,10 +12,10 @@
+-#[cfg(all(feature = "simd", target_arch = "x86_64", not(miri)))]
++#[cfg(all(feature = "simd", target_arch = "x86_64", not(miri), not(rust_compiler="mrustc")))]
+ pub mod x86_64;
+-#[cfg(all(feature = "simd", target_arch = "x86_64", not(miri)))]
++#[cfg(all(feature = "simd", target_arch = "x86_64", not(miri), not(rust_compiler="mrustc")))]
+ use self::x86_64 as arch;
+
+-#[cfg(any(miri, not(all(feature = "simd", any(target_arch = "x86_64")))))]
++#[cfg(any(miri, rust_compiler="mrustc", not(all(feature = "simd", any(target_arch = "x86_64")))))]
+ pub mod generic;
+-#[cfg(any(miri, not(all(feature = "simd", any(target_arch = "x86_64")))))]
++#[cfg(any(miri, rust_compiler="mrustc", not(all(feature = "simd", any(target_arch = "x86_64")))))]
+ use self::generic as arch;
+
+# diff --git a/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h b/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h
+# index da9d9d5bfdc0..3d47471f0ef0 100644
+# --- src/llvm-project/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h
+# +++ src/llvm-project/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h
+# @@ -16,6 +16,8 @@
+#  #include "llvm/Demangle/DemangleConfig.h"
+#  #include "llvm/Demangle/StringView.h"
+#  #include <array>
+# +#include <cstdint>
+# +#include <string>
+
+#  namespace llvm {
+#  namespace itanium_demangle {
+##
+## gcc (used by mrustc) has 16-byte uint128_t alignment, while rustc uses 8
+##
+#--- src/libsyntax/ast.rs
+#+++ src/libsyntax/ast.rs
+#@@ -986,2 +986,2 @@
+#-#[cfg(target_arch = "x86_64")]
+#-static_assert_size!(Expr, 96);
+#+//#[cfg(target_arch = "x86_64")]
+#+//static_assert_size!(Expr, 96);
+#--- src/librustc/ty/sty.rs
+#+++ src/librustc/ty/sty.rs
+#@@ -2258,2 +2258,2 @@
+#-#[cfg(target_arch = "x86_64")]
+#-static_assert_size!(Const<'_>, 40);
+#+//#[cfg(target_arch = "x86_64")]
+#+//static_assert_size!(Const<'_>, 40);
+
diff --git a/gnu/packages/patches/sbcl-aserve-add-HTML-5-elements.patch b/gnu/packages/patches/sbcl-aserve-add-HTML-5-elements.patch
new file mode 100644
index 0000000000..93962e10ec
--- /dev/null
+++ b/gnu/packages/patches/sbcl-aserve-add-HTML-5-elements.patch
@@ -0,0 +1,63 @@
+From 940679fb75073a59186099e3dd7fb381e727db6b Mon Sep 17 00:00:00 2001
+From: Kevin Layer <layer@franz.com>
+Date: Thu, 31 Oct 2013 04:27:29 -0700
+Subject: [PATCH 1/2] rfe12668: add HTML 5 elements to htmlgen
+
+Add the new elements listed here:
+  http://www.w3.org/TR/html5-diff/#new-elements
+
+Change-Id: I7f64363751130644caf90ecdd65c13175d77ae97
+---
+ aserve/htmlgen/htmlgen.cl | 38 ++++++++++++++++++++++++++++++++++++--
+ 1 file changed, 36 insertions(+), 2 deletions(-)
+
+diff --git a/aserve/htmlgen/htmlgen.cl b/aserve/htmlgen/htmlgen.cl
+index 59248ef..0c0d6e8 100644
+--- a/aserve/htmlgen/htmlgen.cl
++++ b/aserve/htmlgen/htmlgen.cl
+@@ -747,6 +747,40 @@
+ 
+ (def-std-html :var 	t nil)
+ 
+-(def-std-html :wbr  	nil nil)
+-
+ (def-std-html :xmp 	t nil)
++
++;; html 5
++
++(def-std-html :section		t nil)
++(def-std-html :article		t nil)
++(def-std-html :main		t nil)
++(def-std-html :aside		t nil)
++(def-std-html :hgroup		t nil)
++(def-std-html :header		t nil)
++(def-std-html :footer		t nil)
++(def-std-html :nav		t nil)
++(def-std-html :figure		t nil)
++(def-std-html :figcaption 	t nil)
++
++(def-std-html :video	 	t nil)
++(def-std-html :audio	 	t nil)
++(def-std-html :source	 	t nil)
++(def-std-html :track	 	t nil)
++(def-std-html :embed	 	t nil)
++(def-std-html :mark	 	t nil)
++(def-std-html :progress	 	t nil)
++(def-std-html :meter	 	t nil)
++(def-std-html :time	 	t nil)
++(def-std-html :data	 	t nil)
++(def-std-html :dialog	 	t nil)
++(def-std-html :ruby	 	t nil)
++(def-std-html :rt	 	t nil)
++(def-std-html :rp	 	t nil)
++(def-std-html :bdi	 	t nil)
++(def-std-html :wbr		nil nil)
++(def-std-html :canvas	 	t nil)
++(def-std-html :menuitem	 	t nil)
++(def-std-html :details	 	t nil)
++(def-std-html :datalist	 	t nil)
++(def-std-html :keygen	 	t nil)
++(def-std-html :output	 	t nil)
+-- 
+2.25.1
+
diff --git a/gnu/packages/patches/sbcl-aserve-fix-rfe12668.patch b/gnu/packages/patches/sbcl-aserve-fix-rfe12668.patch
new file mode 100644
index 0000000000..c7a8e05aae
--- /dev/null
+++ b/gnu/packages/patches/sbcl-aserve-fix-rfe12668.patch
@@ -0,0 +1,43 @@
+From 8110ebd55d5bf659cd40dab2df59d80dafdb367a Mon Sep 17 00:00:00 2001
+From: Kevin Layer <layer@franz.com>
+Date: Mon, 10 Feb 2014 11:10:42 -0800
+Subject: [PATCH 2/2] fix bugs in rfe12668 implementation
+
+The previous commit added :embed and :keygen but they were already
+there.  Resolve this issue.
+
+Change-Id: Ieb962a12880394e67d973835945005446833fab7
+---
+ aserve/htmlgen/htmlgen.cl | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/aserve/htmlgen/htmlgen.cl b/aserve/htmlgen/htmlgen.cl
+index 0c0d6e8..f77d6de 100644
+--- a/aserve/htmlgen/htmlgen.cl
++++ b/aserve/htmlgen/htmlgen.cl
+@@ -658,7 +658,6 @@
+ (def-std-html :dt        t nil)
+ 
+ (def-std-html :em        t nil)
+-(def-std-html :embed     t nil)
+ 
+ (def-std-html :fieldset        t nil)
+ (def-std-html :font        t nil)
+@@ -685,7 +684,6 @@
+ (def-std-html :isindex    nil nil)
+ 
+ (def-std-html :kbd  	t nil)
+-(def-std-html :keygen  	nil nil)
+ 
+ (def-std-html :label  	t nil)
+ (def-std-html :layer  	t nil)
+@@ -782,5 +780,5 @@
+ (def-std-html :menuitem	 	t nil)
+ (def-std-html :details	 	t nil)
+ (def-std-html :datalist	 	t nil)
+-(def-std-html :keygen	 	t nil)
++(def-std-html :keygen	 	nil nil)
+ (def-std-html :output	 	t nil)
+-- 
+2.25.1
+
diff --git a/gnu/packages/patches/scalapack-blacs-mpi-deprecations.patch b/gnu/packages/patches/scalapack-blacs-mpi-deprecations.patch
deleted file mode 100644
index 6ec1b8f21f..0000000000
--- a/gnu/packages/patches/scalapack-blacs-mpi-deprecations.patch
+++ /dev/null
@@ -1,170 +0,0 @@
-From f11c3f094ed5ca727ec819983425b6641db8227c Mon Sep 17 00:00:00 2001
-From: Eric Bavier <bavier@member.fsf.org>
-Date: Wed, 13 Feb 2019 09:32:11 -0600
-Subject: [PATCH] BLACS: Remove use of long-deprecated MPI1 functions.
-
-* BLACS/SRC/blacs_get_.c: 'MPI_Attr_get' -> 'MPI_Comm_get_attr'.
-* BLACS/SRC/cgamn2d_.c, BLACS/SRC/cgamx2d_.c, BLACS/SRC/dgamn2d_.c,
-BLACS/SRC/dgamx2d_.c, BLACS/SRC/igamn2d_.c, BLACS/SRC/igamx2d_.c,
-BLACS/SRC/sgamn2d_.c, BLACS/SRC/sgamx2d_.c, BLACS/SRC/zgamn2d_.c,
-BLACS/SRC/zgamx2d_.c: 'MPI_Type_struct' -> 'MPI_Type_create_struct'.
----
- BLACS/SRC/blacs_get_.c | 2 +-
- BLACS/SRC/cgamn2d_.c   | 2 +-
- BLACS/SRC/cgamx2d_.c   | 2 +-
- BLACS/SRC/dgamn2d_.c   | 2 +-
- BLACS/SRC/dgamx2d_.c   | 2 +-
- BLACS/SRC/igamn2d_.c   | 2 +-
- BLACS/SRC/igamx2d_.c   | 2 +-
- BLACS/SRC/sgamn2d_.c   | 2 +-
- BLACS/SRC/sgamx2d_.c   | 2 +-
- BLACS/SRC/zgamn2d_.c   | 2 +-
- BLACS/SRC/zgamx2d_.c   | 2 +-
- 11 files changed, 11 insertions(+), 11 deletions(-)
-
-diff --git a/BLACS/SRC/blacs_get_.c b/BLACS/SRC/blacs_get_.c
-index e979767..d4b04cf 100644
---- a/BLACS/SRC/blacs_get_.c
-+++ b/BLACS/SRC/blacs_get_.c
-@@ -23,7 +23,7 @@ F_VOID_FUNC blacs_get_(int *ConTxt, int *what, int *val)
-    case SGET_MSGIDS:
-       if (BI_COMM_WORLD == NULL) Cblacs_pinfo(val, &val[1]);
-       iptr = &val[1];
--      ierr=MPI_Attr_get(MPI_COMM_WORLD, MPI_TAG_UB, (BVOID **) &iptr,val);
-+      ierr=MPI_Comm_get_attr(MPI_COMM_WORLD, MPI_TAG_UB, (BVOID **) &iptr,val);
-       val[0] = 0;
-       val[1] = *iptr;
-       break;
-diff --git a/BLACS/SRC/cgamn2d_.c b/BLACS/SRC/cgamn2d_.c
-index 2db6ccb..6958f32 100644
---- a/BLACS/SRC/cgamn2d_.c
-+++ b/BLACS/SRC/cgamn2d_.c
-@@ -221,7 +221,7 @@ F_VOID_FUNC cgamn2d_(int *ConTxt, F_CHAR scope, F_CHAR top, int *m, int *n,
-       {
- #endif
-       i = 2;
--      ierr=MPI_Type_struct(i, len, disp, dtypes, &MyType);
-+      ierr=MPI_Type_create_struct(i, len, disp, dtypes, &MyType);
-       ierr=MPI_Type_commit(&MyType);
-       bp->N = bp2->N = 1;
-       bp->dtype = bp2->dtype = MyType;
-diff --git a/BLACS/SRC/cgamx2d_.c b/BLACS/SRC/cgamx2d_.c
-index 707c0b6..f802d01 100644
---- a/BLACS/SRC/cgamx2d_.c
-+++ b/BLACS/SRC/cgamx2d_.c
-@@ -221,7 +221,7 @@ F_VOID_FUNC cgamx2d_(int *ConTxt, F_CHAR scope, F_CHAR top, int *m, int *n,
-       {
- #endif
-       i = 2;
--      ierr=MPI_Type_struct(i, len, disp, dtypes, &MyType);
-+      ierr=MPI_Type_create_struct(i, len, disp, dtypes, &MyType);
-       ierr=MPI_Type_commit(&MyType);
-       bp->N = bp2->N = 1;
-       bp->dtype = bp2->dtype = MyType;
-diff --git a/BLACS/SRC/dgamn2d_.c b/BLACS/SRC/dgamn2d_.c
-index dff23b4..a2627ac 100644
---- a/BLACS/SRC/dgamn2d_.c
-+++ b/BLACS/SRC/dgamn2d_.c
-@@ -221,7 +221,7 @@ F_VOID_FUNC dgamn2d_(int *ConTxt, F_CHAR scope, F_CHAR top, int *m, int *n,
-       {
- #endif
-       i = 2;
--      ierr=MPI_Type_struct(i, len, disp, dtypes, &MyType);
-+      ierr=MPI_Type_create_struct(i, len, disp, dtypes, &MyType);
-       ierr=MPI_Type_commit(&MyType);
-       bp->N = bp2->N = 1;
-       bp->dtype = bp2->dtype = MyType;
-diff --git a/BLACS/SRC/dgamx2d_.c b/BLACS/SRC/dgamx2d_.c
-index a51f731..2a644d0 100644
---- a/BLACS/SRC/dgamx2d_.c
-+++ b/BLACS/SRC/dgamx2d_.c
-@@ -221,7 +221,7 @@ F_VOID_FUNC dgamx2d_(int *ConTxt, F_CHAR scope, F_CHAR top, int *m, int *n,
-       {
- #endif
-       i = 2;
--      ierr=MPI_Type_struct(i, len, disp, dtypes, &MyType);
-+      ierr=MPI_Type_create_struct(i, len, disp, dtypes, &MyType);
-       ierr=MPI_Type_commit(&MyType);
-       bp->N = bp2->N = 1;
-       bp->dtype = bp2->dtype = MyType;
-diff --git a/BLACS/SRC/igamn2d_.c b/BLACS/SRC/igamn2d_.c
-index 16bc003..f6a7859 100644
---- a/BLACS/SRC/igamn2d_.c
-+++ b/BLACS/SRC/igamn2d_.c
-@@ -218,7 +218,7 @@ F_VOID_FUNC igamn2d_(int *ConTxt, F_CHAR scope, F_CHAR top, int *m, int *n,
-       {
- #endif
-       i = 2;
--      ierr=MPI_Type_struct(i, len, disp, dtypes, &MyType);
-+      ierr=MPI_Type_create_struct(i, len, disp, dtypes, &MyType);
-       ierr=MPI_Type_commit(&MyType);
-       bp->N = bp2->N = 1;
-       bp->dtype = bp2->dtype = MyType;
-diff --git a/BLACS/SRC/igamx2d_.c b/BLACS/SRC/igamx2d_.c
-index 8165cbe..a7cfcc6 100644
---- a/BLACS/SRC/igamx2d_.c
-+++ b/BLACS/SRC/igamx2d_.c
-@@ -218,7 +218,7 @@ F_VOID_FUNC igamx2d_(int *ConTxt, F_CHAR scope, F_CHAR top, int *m, int *n,
-       {
- #endif
-       i = 2;
--      ierr=MPI_Type_struct(i, len, disp, dtypes, &MyType);
-+      ierr=MPI_Type_create_struct(i, len, disp, dtypes, &MyType);
-       ierr=MPI_Type_commit(&MyType);
-       bp->N = bp2->N = 1;
-       bp->dtype = bp2->dtype = MyType;
-diff --git a/BLACS/SRC/sgamn2d_.c b/BLACS/SRC/sgamn2d_.c
-index d6c95e5..569c797 100644
---- a/BLACS/SRC/sgamn2d_.c
-+++ b/BLACS/SRC/sgamn2d_.c
-@@ -221,7 +221,7 @@ F_VOID_FUNC sgamn2d_(int *ConTxt, F_CHAR scope, F_CHAR top, int *m, int *n,
-       {
- #endif
-       i = 2;
--      ierr=MPI_Type_struct(i, len, disp, dtypes, &MyType);
-+      ierr=MPI_Type_create_struct(i, len, disp, dtypes, &MyType);
-       ierr=MPI_Type_commit(&MyType);
-       bp->N = bp2->N = 1;
-       bp->dtype = bp2->dtype = MyType;
-diff --git a/BLACS/SRC/sgamx2d_.c b/BLACS/SRC/sgamx2d_.c
-index 4b0af6f..8897ece 100644
---- a/BLACS/SRC/sgamx2d_.c
-+++ b/BLACS/SRC/sgamx2d_.c
-@@ -221,7 +221,7 @@ F_VOID_FUNC sgamx2d_(int *ConTxt, F_CHAR scope, F_CHAR top, int *m, int *n,
-       {
- #endif
-       i = 2;
--      ierr=MPI_Type_struct(i, len, disp, dtypes, &MyType);
-+      ierr=MPI_Type_create_struct(i, len, disp, dtypes, &MyType);
-       ierr=MPI_Type_commit(&MyType);
-       bp->N = bp2->N = 1;
-       bp->dtype = bp2->dtype = MyType;
-diff --git a/BLACS/SRC/zgamn2d_.c b/BLACS/SRC/zgamn2d_.c
-index 9de2b23..37897df 100644
---- a/BLACS/SRC/zgamn2d_.c
-+++ b/BLACS/SRC/zgamn2d_.c
-@@ -221,7 +221,7 @@ F_VOID_FUNC zgamn2d_(int *ConTxt, F_CHAR scope, F_CHAR top, int *m, int *n,
-       {
- #endif
-       i = 2;
--      ierr=MPI_Type_struct(i, len, disp, dtypes, &MyType);
-+      ierr=MPI_Type_create_struct(i, len, disp, dtypes, &MyType);
-       ierr=MPI_Type_commit(&MyType);
-       bp->N = bp2->N = 1;
-       bp->dtype = bp2->dtype = MyType;
-diff --git a/BLACS/SRC/zgamx2d_.c b/BLACS/SRC/zgamx2d_.c
-index 414c381..0e9d474 100644
---- a/BLACS/SRC/zgamx2d_.c
-+++ b/BLACS/SRC/zgamx2d_.c
-@@ -221,7 +221,7 @@ F_VOID_FUNC zgamx2d_(int *ConTxt, F_CHAR scope, F_CHAR top, int *m, int *n,
-       {
- #endif
-       i = 2;
--      ierr=MPI_Type_struct(i, len, disp, dtypes, &MyType);
-+      ierr=MPI_Type_create_struct(i, len, disp, dtypes, &MyType);
-       ierr=MPI_Type_commit(&MyType);
-       bp->N = bp2->N = 1;
-       bp->dtype = bp2->dtype = MyType;
--- 
-2.20.1
-
diff --git a/gnu/packages/patches/scalapack-gcc-10-compilation.patch b/gnu/packages/patches/scalapack-gcc-10-compilation.patch
new file mode 100644
index 0000000000..cd6fb61cdf
--- /dev/null
+++ b/gnu/packages/patches/scalapack-gcc-10-compilation.patch
@@ -0,0 +1,5684 @@
+Fix Scalapack compilation with GCC 10+.
+
+Patches from <https://github.com/Reference-ScaLAPACK/scalapack/pull/26>.
+
+From 9c909f06cf51a3d00252323ce52aba46cc64ab41 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Tiziano=20M=C3=BCller?= <tiziano.mueller@chem.uzh.ch>
+Date: Thu, 25 Jun 2020 18:36:46 +0200
+Subject: [PATCH] fix argument mismatches in the SRC
+
+---
+ SRC/pclarf.f   |  80 +++++++++++++++++-----------------
+ SRC/pclarfc.f  |  88 ++++++++++++++++++-------------------
+ SRC/pclarz.f   | 111 ++++++++++++++++++++++++-----------------------
+ SRC/pclarzc.f  | 115 +++++++++++++++++++++++++------------------------
+ SRC/pclattrs.f |  55 +++++++++++------------
+ SRC/pclawil.f  |  53 +++++++++++------------
+ SRC/pctrevc.f  |  20 +++++----
+ SRC/pdhseqr.f  |  36 ++++++++--------
+ SRC/pdlacon.f  |  36 ++++++++--------
+ SRC/pdlarf.f   |  80 +++++++++++++++++-----------------
+ SRC/pdlarz.f   | 100 +++++++++++++++++++++---------------------
+ SRC/pdlawil.f  |  48 ++++++++++-----------
+ SRC/pdstebz.f  |  20 ++++-----
+ SRC/pdtrord.f  |  43 +++++++++++-------
+ SRC/pdtrsen.f  |  24 ++++++-----
+ SRC/pshseqr.f  |  36 ++++++++--------
+ SRC/pslacon.f  |  36 +++++++++-------
+ SRC/pslarf.f   |  80 +++++++++++++++++-----------------
+ SRC/pslarz.f   | 100 +++++++++++++++++++++---------------------
+ SRC/pslawil.f  |  50 +++++++++++----------
+ SRC/psstebz.f  |  20 ++++-----
+ SRC/pstrord.f  |  45 +++++++++++--------
+ SRC/pstrsen.f  |  22 ++++++----
+ SRC/pzlarf.f   |  80 +++++++++++++++++-----------------
+ SRC/pzlarfc.f  |  88 ++++++++++++++++++-------------------
+ SRC/pzlarz.f   | 103 +++++++++++++++++++++----------------------
+ SRC/pzlarzc.f  | 111 ++++++++++++++++++++++++-----------------------
+ SRC/pzlattrs.f |  55 +++++++++++------------
+ SRC/pzlawil.f  |  49 +++++++++++----------
+ SRC/pztrevc.f  |  20 +++++----
+ 30 files changed, 927 insertions(+), 877 deletions(-)
+
+diff --git a/SRC/pclarf.f b/SRC/pclarf.f
+index f941e46..371f710 100644
+--- a/SRC/pclarf.f
++++ b/SRC/pclarf.f
+@@ -242,7 +242,7 @@ SUBROUTINE PCLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+      $                   IOFFV, IPW, IROFF, IVCOL, IVROW, JJC, JJV, LDC,
+      $                   LDV, MYCOL, MYROW, MP, NCC, NCV, NPCOL, NPROW,
+      $                   NQ, RDEST
+-      COMPLEX            TAULOC
++      COMPLEX            TAULOC( 1 )
+ *     ..
+ *     .. External Subroutines ..
+       EXTERNAL           BLACS_GRIDINFO, CCOPY, CGEBR2D, CGEBS2D,
+@@ -336,7 +336,7 @@ SUBROUTINE PCLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                      CALL CGEBS2D( ICTXT, 'Columnwise', ' ', 1, 1,
+      $                             TAU( IIV ), 1 )
+-                     TAULOC = TAU( IIV )
++                     TAULOC( 1 ) = TAU( IIV )
+ *
+                   ELSE
+ *
+@@ -345,7 +345,7 @@ SUBROUTINE PCLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                   END IF
+ *
+-                  IF( TAULOC.NE.ZERO ) THEN
++                  IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                    w := sub( C )' * v
+ *
+@@ -363,8 +363,8 @@ SUBROUTINE PCLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+ *                    sub( C ) := sub( C ) - v * w'
+ *
+-                     CALL CGERC( MP, NQ, -TAULOC, WORK, 1, WORK( IPW ),
+-     $                           1, C( IOFFC ), LDC )
++                     CALL CGERC( MP, NQ, -TAULOC( 1 ), WORK, 1,
++     $                           WORK( IPW ), 1, C( IOFFC ), LDC )
+                   END IF
+ *
+                END IF
+@@ -379,9 +379,9 @@ SUBROUTINE PCLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                   IF( MYCOL.EQ.ICCOL ) THEN
+ *
+-                     TAULOC = TAU( JJV )
++                     TAULOC( 1 ) = TAU( JJV )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C )' * v
+ *
+@@ -398,7 +398,7 @@ SUBROUTINE PCLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+ *                       sub( C ) := sub( C ) - v * w'
+ *
+-                        CALL CGERC( MP, NQ, -TAULOC, V( IOFFV ), 1,
++                        CALL CGERC( MP, NQ, -TAULOC( 1 ), V( IOFFV ), 1,
+      $                              WORK, 1, C( IOFFC ), LDC )
+                      END IF
+ *
+@@ -421,9 +421,9 @@ SUBROUTINE PCLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+                      IPW = MP+1
+                      CALL CGERV2D( ICTXT, IPW, 1, WORK, IPW, MYROW,
+      $                             IVCOL )
+-                     TAULOC = WORK( IPW )
++                     TAULOC( 1 ) = WORK( IPW )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C )' * v
+ *
+@@ -441,7 +441,7 @@ SUBROUTINE PCLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+ *                       sub( C ) := sub( C ) - v * w'
+ *
+-                        CALL CGERC( MP, NQ, -TAULOC, WORK, 1,
++                        CALL CGERC( MP, NQ, -TAULOC( 1 ), WORK, 1,
+      $                              WORK( IPW ), 1, C( IOFFC ), LDC )
+                      END IF
+ *
+@@ -471,7 +471,7 @@ SUBROUTINE PCLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                   CALL CGEBS2D( ICTXT, 'Columnwise', ' ', 1, 1,
+      $                          TAU( IIV ), 1 )
+-                  TAULOC = TAU( IIV )
++                  TAULOC( 1 ) = TAU( IIV )
+ *
+                ELSE
+ *
+@@ -480,7 +480,7 @@ SUBROUTINE PCLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C )' * v
+ *
+@@ -500,8 +500,8 @@ SUBROUTINE PCLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *                 sub( C ) := sub( C ) - v * w'
+ *
+                   IF( IOFFC.GT.0 )
+-     $               CALL CGERC( MP, NQ, -TAULOC, WORK, 1, WORK( IPW ),
+-     $                           1, C( IOFFC ), LDC )
++     $               CALL CGERC( MP, NQ, -TAULOC( 1 ), WORK, 1,
++     $                           WORK( IPW ), 1, C( IOFFC ), LDC )
+                END IF
+ *
+             ELSE
+@@ -516,18 +516,18 @@ SUBROUTINE PCLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+                   WORK(IPW) = TAU( JJV )
+                   CALL CGEBS2D( ICTXT, 'Rowwise', ROWBTOP, IPW, 1,
+      $                          WORK, IPW )
+-                  TAULOC = TAU( JJV )
++                  TAULOC( 1 ) = TAU( JJV )
+ *
+                ELSE
+ *
+                   IPW = MP+1
+                   CALL CGEBR2D( ICTXT, 'Rowwise', ROWBTOP, IPW, 1, WORK,
+      $                          IPW, MYROW, IVCOL )
+-                  TAULOC = WORK( IPW )
++                  TAULOC( 1 ) = WORK( IPW )
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C )' * v
+ *
+@@ -547,8 +547,8 @@ SUBROUTINE PCLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *                 sub( C ) := sub( C ) - v * w'
+ *
+                   IF( IOFFC.GT.0 )
+-     $               CALL CGERC( MP, NQ, -TAULOC, WORK, 1, WORK( IPW ),
+-     $                           1, C( IOFFC ), LDC )
++     $               CALL CGERC( MP, NQ, -TAULOC( 1 ), WORK, 1,
++     $                           WORK( IPW ), 1, C( IOFFC ), LDC )
+                END IF
+ *
+             END IF
+@@ -577,9 +577,9 @@ SUBROUTINE PCLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                   IF( MYROW.EQ.ICROW ) THEN
+ *
+-                     TAULOC = TAU( IIV )
++                     TAULOC( 1 ) = TAU( IIV )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C ) * v
+ *
+@@ -597,7 +597,7 @@ SUBROUTINE PCLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *                       sub( C ) := sub( C ) - w * v'
+ *
+                         IF( IOFFV.GT.0 .AND. IOFFC.GT.0 )
+-     $                     CALL CGERC( MP, NQ, -TAULOC, WORK, 1,
++     $                     CALL CGERC( MP, NQ, -TAULOC( 1 ), WORK, 1,
+      $                                 V( IOFFV ), LDV, C( IOFFC ),
+      $                                 LDC )
+                      END IF
+@@ -621,9 +621,9 @@ SUBROUTINE PCLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+                      IPW = NQ+1
+                      CALL CGERV2D( ICTXT, IPW, 1, WORK, IPW, IVROW,
+      $                             MYCOL )
+-                     TAULOC = WORK( IPW )
++                     TAULOC( 1 ) = WORK( IPW )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C ) * v
+ *
+@@ -641,8 +641,8 @@ SUBROUTINE PCLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+ *                       sub( C ) := sub( C ) - w * v'
+ *
+-                        CALL CGERC( MP, NQ, -TAULOC, WORK( IPW ), 1,
+-     $                              WORK, 1, C( IOFFC ), LDC )
++                        CALL CGERC( MP, NQ, -TAULOC( 1 ), WORK( IPW ),
++     $                              1, WORK, 1, C( IOFFC ), LDC )
+                      END IF
+ *
+                   END IF
+@@ -667,7 +667,7 @@ SUBROUTINE PCLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                      CALL CGEBS2D( ICTXT, 'Rowwise', ' ', 1, 1,
+      $                             TAU( JJV ), 1 )
+-                     TAULOC = TAU( JJV )
++                     TAULOC( 1 ) = TAU( JJV )
+ *
+                   ELSE
+ *
+@@ -676,7 +676,7 @@ SUBROUTINE PCLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                   END IF
+ *
+-                  IF( TAULOC.NE.ZERO ) THEN
++                  IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                    w := sub( C ) * v
+ *
+@@ -694,8 +694,8 @@ SUBROUTINE PCLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+ *                    sub( C ) := sub( C ) - w * v'
+ *
+-                     CALL CGERC( MP, NQ, -TAULOC, WORK( IPW ), 1, WORK,
+-     $                           1, C( IOFFC ), LDC )
++                     CALL CGERC( MP, NQ, -TAULOC( 1 ), WORK( IPW ), 1,
++     $                           WORK, 1, C( IOFFC ), LDC )
+                   END IF
+ *
+                END IF
+@@ -720,18 +720,18 @@ SUBROUTINE PCLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+                   WORK(IPW) = TAU( IIV )
+                   CALL CGEBS2D( ICTXT, 'Columnwise', COLBTOP, IPW, 1,
+      $                          WORK, IPW )
+-                  TAULOC = TAU( IIV )
++                  TAULOC( 1 ) = TAU( IIV )
+ *
+                ELSE
+ *
+                   IPW = NQ+1
+                   CALL CGEBR2D( ICTXT, 'Columnwise', COLBTOP, IPW, 1,
+      $                          WORK, IPW, IVROW, MYCOL )
+-                  TAULOC = WORK( IPW )
++                  TAULOC( 1 ) = WORK( IPW )
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C ) * v
+ *
+@@ -750,8 +750,8 @@ SUBROUTINE PCLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *                 sub( C ) := sub( C ) - w * v'
+ *
+                   IF( IOFFC.GT.0 )
+-     $               CALL CGERC( MP, NQ, -TAULOC, WORK( IPW ), 1, WORK,
+-     $                           1, C( IOFFC ), LDC )
++     $               CALL CGERC( MP, NQ, -TAULOC( 1 ), WORK( IPW ), 1,
++     $                           WORK, 1, C( IOFFC ), LDC )
+                END IF
+ *
+             ELSE
+@@ -770,7 +770,7 @@ SUBROUTINE PCLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                   CALL CGEBS2D( ICTXT, 'Rowwise', ' ', 1, 1, TAU( JJV ),
+      $                          1 )
+-                  TAULOC = TAU( JJV )
++                  TAULOC( 1 ) = TAU( JJV )
+ *
+                ELSE
+ *
+@@ -779,7 +779,7 @@ SUBROUTINE PCLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C ) * v
+ *
+@@ -797,8 +797,8 @@ SUBROUTINE PCLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+ *                 sub( C ) := sub( C ) - w * v'
+ *
+-                  CALL CGERC( MP, NQ, -TAULOC, WORK( IPW ), 1, WORK, 1,
+-     $                        C( IOFFC ), LDC )
++                  CALL CGERC( MP, NQ, -TAULOC( 1 ), WORK( IPW ), 1,
++     $                        WORK, 1, C( IOFFC ), LDC )
+                END IF
+ *
+             END IF
+diff --git a/SRC/pclarfc.f b/SRC/pclarfc.f
+index d6a2d3b..f84c493 100644
+--- a/SRC/pclarfc.f
++++ b/SRC/pclarfc.f
+@@ -242,7 +242,7 @@ SUBROUTINE PCLARFC( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+      $                   IOFFV, IPW, IROFF, IVCOL, IVROW, JJC, JJV, LDC,
+      $                   LDV, MYCOL, MYROW, MP, NCC, NCV, NPCOL, NPROW,
+      $                   NQ, RDEST
+-      COMPLEX            TAULOC
++      COMPLEX            TAULOC( 1 )
+ *     ..
+ *     .. External Subroutines ..
+       EXTERNAL           BLACS_GRIDINFO, CCOPY, CGEBR2D, CGEBS2D,
+@@ -336,17 +336,17 @@ SUBROUTINE PCLARFC( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                      CALL CGEBS2D( ICTXT, 'Columnwise', ' ', 1, 1,
+      $                             TAU( IIV ), 1 )
+-                     TAULOC = CONJG( TAU( IIV ) )
++                     TAULOC( 1 ) = CONJG( TAU( IIV ) )
+ *
+                   ELSE
+ *
+                      CALL CGEBR2D( ICTXT, 'Columnwise', ' ', 1, 1,
+      $                             TAULOC, 1, IVROW, MYCOL )
+-                     TAULOC = CONJG( TAULOC )
++                     TAULOC( 1 ) = CONJG( TAULOC( 1 ) )
+ *
+                   END IF
+ *
+-                  IF( TAULOC.NE.ZERO ) THEN
++                  IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                    w := sub( C )' * v
+ *
+@@ -364,8 +364,8 @@ SUBROUTINE PCLARFC( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+ *                    sub( C ) := sub( C ) - v * w'
+ *
+-                     CALL CGERC( MP, NQ, -TAULOC, WORK, 1, WORK( IPW ),
+-     $                           1, C( IOFFC ), LDC )
++                     CALL CGERC( MP, NQ, -TAULOC( 1 ), WORK, 1,
++     $                           WORK( IPW ), 1, C( IOFFC ), LDC )
+                   END IF
+ *
+                END IF
+@@ -380,9 +380,9 @@ SUBROUTINE PCLARFC( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                   IF( MYCOL.EQ.ICCOL ) THEN
+ *
+-                     TAULOC = CONJG( TAU( JJV ) )
++                     TAULOC( 1 ) = CONJG( TAU( JJV ) )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C )' * v
+ *
+@@ -399,7 +399,7 @@ SUBROUTINE PCLARFC( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+ *                       sub( C ) := sub( C ) - v * w'
+ *
+-                        CALL CGERC( MP, NQ, -TAULOC, V( IOFFV ), 1,
++                        CALL CGERC( MP, NQ, -TAULOC( 1 ), V( IOFFV ), 1,
+      $                              WORK, 1, C( IOFFC ), LDC )
+                      END IF
+ *
+@@ -422,9 +422,9 @@ SUBROUTINE PCLARFC( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+                      IPW = MP+1
+                      CALL CGERV2D( ICTXT, IPW, 1, WORK, IPW, MYROW,
+      $                             IVCOL )
+-                     TAULOC = CONJG( WORK( IPW ) )
++                     TAULOC( 1 ) = CONJG( WORK( IPW ) )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C )' * v
+ *
+@@ -442,7 +442,7 @@ SUBROUTINE PCLARFC( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+ *                       sub( C ) := sub( C ) - v * w'
+ *
+-                        CALL CGERC( MP, NQ, -TAULOC, WORK, 1,
++                        CALL CGERC( MP, NQ, -TAULOC( 1 ), WORK, 1,
+      $                              WORK( IPW ), 1, C( IOFFC ), LDC )
+                      END IF
+ *
+@@ -472,17 +472,17 @@ SUBROUTINE PCLARFC( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                   CALL CGEBS2D( ICTXT, 'Columnwise', ' ', 1, 1,
+      $                          TAU( IIV ), 1 )
+-                  TAULOC = CONJG( TAU( IIV ) )
++                  TAULOC( 1 ) = CONJG( TAU( IIV ) )
+ *
+                ELSE
+ *
+                   CALL CGEBR2D( ICTXT, 'Columnwise', ' ', 1, 1, TAULOC,
+      $                          1, IVROW, MYCOL )
+-                  TAULOC = CONJG( TAULOC )
++                  TAULOC( 1 ) = CONJG( TAULOC( 1 ) )
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C )' * v
+ *
+@@ -500,8 +500,8 @@ SUBROUTINE PCLARFC( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+ *                 sub( C ) := sub( C ) - v * w'
+ *
+-                  CALL CGERC( MP, NQ, -TAULOC, WORK, 1, WORK( IPW ), 1,
+-     $                        C( IOFFC ), LDC )
++                  CALL CGERC( MP, NQ, -TAULOC( 1 ), WORK, 1,
++     $                        WORK( IPW ), 1, C( IOFFC ), LDC )
+                END IF
+ *
+             ELSE
+@@ -516,18 +516,18 @@ SUBROUTINE PCLARFC( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+                   WORK(IPW) = TAU( JJV )
+                   CALL CGEBS2D( ICTXT, 'Rowwise', ROWBTOP, IPW, 1,
+      $                          WORK, IPW )
+-                  TAULOC = CONJG( TAU( JJV ) )
++                  TAULOC( 1 ) = CONJG( TAU( JJV ) )
+ *
+                ELSE
+ *
+                   IPW = MP+1
+                   CALL CGEBR2D( ICTXT, 'Rowwise', ROWBTOP, IPW, 1, WORK,
+      $                          IPW, MYROW, IVCOL )
+-                  TAULOC = CONJG( WORK( IPW ) )
++                  TAULOC( 1 ) = CONJG( WORK( IPW ) )
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C )' * v
+ *
+@@ -545,8 +545,8 @@ SUBROUTINE PCLARFC( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+ *                 sub( C ) := sub( C ) - v * w'
+ *
+-                  CALL CGERC( MP, NQ, -TAULOC, WORK, 1, WORK( IPW ), 1,
+-     $                        C( IOFFC ), LDC )
++                  CALL CGERC( MP, NQ, -TAULOC( 1 ), WORK, 1,
++     $                        WORK( IPW ), 1, C( IOFFC ), LDC )
+                END IF
+ *
+             END IF
+@@ -575,9 +575,9 @@ SUBROUTINE PCLARFC( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                   IF( MYROW.EQ.ICROW ) THEN
+ *
+-                     TAULOC = CONJG( TAU( IIV ) )
++                     TAULOC( 1 ) = CONJG( TAU( IIV ) )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C ) * v
+ *
+@@ -594,7 +594,7 @@ SUBROUTINE PCLARFC( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+ *                       sub( C ) := sub( C ) - w * v'
+ *
+-                        CALL CGERC( MP, NQ, -TAULOC, WORK, 1,
++                        CALL CGERC( MP, NQ, -TAULOC( 1 ), WORK, 1,
+      $                              V( IOFFV ), LDV, C( IOFFC ), LDC )
+                      END IF
+ *
+@@ -617,9 +617,9 @@ SUBROUTINE PCLARFC( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+                      IPW = NQ+1
+                      CALL CGERV2D( ICTXT, IPW, 1, WORK, IPW, IVROW,
+      $                             MYCOL )
+-                     TAULOC = CONJG( WORK( IPW ) )
++                     TAULOC( 1 ) = CONJG( WORK( IPW ) )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C ) * v
+ *
+@@ -637,8 +637,8 @@ SUBROUTINE PCLARFC( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+ *                       sub( C ) := sub( C ) - w * v'
+ *
+-                        CALL CGERC( MP, NQ, -TAULOC, WORK( IPW ), 1,
+-     $                              WORK, 1, C( IOFFC ), LDC )
++                        CALL CGERC( MP, NQ, -TAULOC( 1 ), WORK( IPW ),
++     $                              1, WORK, 1, C( IOFFC ), LDC )
+                      END IF
+ *
+                   END IF
+@@ -663,17 +663,17 @@ SUBROUTINE PCLARFC( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                      CALL CGEBS2D( ICTXT, 'Rowwise', ' ', 1, 1,
+      $                             TAU( JJV ), 1 )
+-                     TAULOC = CONJG( TAU( JJV ) )
++                     TAULOC( 1 ) = CONJG( TAU( JJV ) )
+ *
+                   ELSE
+ *
+                      CALL CGEBR2D( ICTXT, 'Rowwise', ' ', 1, 1, TAULOC,
+      $                             1, MYROW, IVCOL )
+-                     TAULOC = CONJG( TAULOC )
++                     TAULOC( 1 ) = CONJG( TAULOC( 1 ) )
+ *
+                   END IF
+ *
+-                  IF( TAULOC.NE.ZERO ) THEN
++                  IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                    w := sub( C ) * v
+ *
+@@ -691,8 +691,8 @@ SUBROUTINE PCLARFC( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+ *                    sub( C ) := sub( C ) - w * v'
+ *
+-                     CALL CGERC( MP, NQ, -TAULOC, WORK( IPW ), 1, WORK,
+-     $                           1, C( IOFFC ), LDC )
++                     CALL CGERC( MP, NQ, -TAULOC( 1 ), WORK( IPW ), 1,
++     $                           WORK, 1, C( IOFFC ), LDC )
+                   END IF
+ *
+                END IF
+@@ -716,18 +716,18 @@ SUBROUTINE PCLARFC( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+                   WORK(IPW) = TAU( IIV )
+                   CALL CGEBS2D( ICTXT, 'Columnwise', COLBTOP, IPW, 1,
+      $                          WORK, IPW )
+-                  TAULOC = CONJG( TAU( IIV ) )
++                  TAULOC( 1 ) = CONJG( TAU( IIV ) )
+ *
+                ELSE
+ *
+                   IPW = NQ+1
+                   CALL CGEBR2D( ICTXT, 'Columnwise', COLBTOP, IPW, 1,
+      $                          WORK, IPW, IVROW, MYCOL )
+-                  TAULOC = CONJG( WORK( IPW ) )
++                  TAULOC( 1 ) = CONJG( WORK( IPW ) )
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C ) * v
+ *
+@@ -745,8 +745,8 @@ SUBROUTINE PCLARFC( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+ *                 sub( C ) := sub( C ) - w * v'
+ *
+-                  CALL CGERC( MP, NQ, -TAULOC, WORK( IPW ), 1, WORK, 1,
+-     $                        C( IOFFC ), LDC )
++                  CALL CGERC( MP, NQ, -TAULOC( 1 ), WORK( IPW ), 1,
++     $                        WORK, 1, C( IOFFC ), LDC )
+                END IF
+ *
+             ELSE
+@@ -765,17 +765,17 @@ SUBROUTINE PCLARFC( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                   CALL CGEBS2D( ICTXT, 'Rowwise', ' ', 1, 1, TAU( JJV ),
+      $                          1 )
+-                  TAULOC = CONJG( TAU( JJV ) )
++                  TAULOC( 1 ) = CONJG( TAU( JJV ) )
+ *
+                ELSE
+ *
+                   CALL CGEBR2D( ICTXT, 'Rowwise', ' ', 1, 1, TAULOC, 1,
+      $                          MYROW, IVCOL )
+-                  TAULOC = CONJG( TAULOC )
++                  TAULOC( 1 ) = CONJG( TAULOC( 1 ) )
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C ) * v
+ *
+@@ -793,8 +793,8 @@ SUBROUTINE PCLARFC( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+ *                 sub( C ) := sub( C ) - w * v'
+ *
+-                  CALL CGERC( MP, NQ, -TAULOC, WORK( IPW ), 1, WORK, 1,
+-     $                        C( IOFFC ), LDC )
++                  CALL CGERC( MP, NQ, -TAULOC( 1 ), WORK( IPW ), 1,
++     $                        WORK, 1, C( IOFFC ), LDC )
+                END IF
+ *
+             END IF
+diff --git a/SRC/pclarz.f b/SRC/pclarz.f
+index 9ba730c..673860a 100644
+--- a/SRC/pclarz.f
++++ b/SRC/pclarz.f
+@@ -251,7 +251,7 @@ SUBROUTINE PCLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+      $                   IVCOL, IVROW, JJC1, JJC2, JJV, LDC, LDV, MPC2,
+      $                   MPV, MYCOL, MYROW, NCC, NCV, NPCOL, NPROW,
+      $                   NQC2, NQV, RDEST
+-      COMPLEX            TAULOC
++      COMPLEX            TAULOC( 1 )
+ *     ..
+ *     .. External Subroutines ..
+       EXTERNAL           BLACS_GRIDINFO, CAXPY, CCOPY, CGEBR2D,
+@@ -370,7 +370,7 @@ SUBROUTINE PCLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                      CALL CGEBS2D( ICTXT, 'Columnwise', ' ', 1, 1,
+      $                             TAU( IIV ), 1 )
+-                     TAULOC = TAU( IIV )
++                     TAULOC( 1 ) = TAU( IIV )
+ *
+                   ELSE
+ *
+@@ -379,7 +379,7 @@ SUBROUTINE PCLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                   END IF
+ *
+-                  IF( TAULOC.NE.ZERO ) THEN
++                  IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                    w := sub( C )' * v
+ *
+@@ -402,9 +402,9 @@ SUBROUTINE PCLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *                    sub( C ) := sub( C ) - v * w'
+ *
+                      IF( MYROW.EQ.ICROW1 )
+-     $                  CALL CAXPY( NQC2, -TAULOC, WORK( IPW ),
++     $                  CALL CAXPY( NQC2, -TAULOC( 1 ), WORK( IPW ),
+      $                              MAX( 1, NQC2 ), C( IOFFC1 ), LDC )
+-                     CALL CGERC( MPV, NQC2, -TAULOC, WORK, 1,
++                     CALL CGERC( MPV, NQC2, -TAULOC( 1 ), WORK, 1,
+      $                           WORK( IPW ), 1, C( IOFFC2 ), LDC )
+                   END IF
+ *
+@@ -420,9 +420,9 @@ SUBROUTINE PCLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                   IF( MYCOL.EQ.ICCOL2 ) THEN
+ *
+-                     TAULOC = TAU( JJV )
++                     TAULOC( 1 ) = TAU( JJV )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C )' * v
+ *
+@@ -445,11 +445,11 @@ SUBROUTINE PCLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *                       sub( C ) := sub( C ) - v * w'
+ *
+                         IF( MYROW.EQ.ICROW1 )
+-     $                     CALL CAXPY( NQC2, -TAULOC, WORK,
++     $                     CALL CAXPY( NQC2, -TAULOC( 1 ), WORK,
+      $                                 MAX( 1, NQC2 ), C( IOFFC1 ),
+      $                                 LDC )
+-                        CALL CGERC( MPV, NQC2, -TAULOC, V( IOFFV ), 1,
+-     $                              WORK, 1, C( IOFFC2 ), LDC )
++                        CALL CGERC( MPV, NQC2, -TAULOC( 1 ), V( IOFFV ),
++     $                              1, WORK, 1, C( IOFFC2 ), LDC )
+                      END IF
+ *
+                   END IF
+@@ -471,9 +471,9 @@ SUBROUTINE PCLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+                      IPW = MPV+1
+                      CALL CGERV2D( ICTXT, IPW, 1, WORK, IPW, MYROW,
+      $                             IVCOL )
+-                     TAULOC = WORK( IPW )
++                     TAULOC( 1 ) = WORK( IPW )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C )' * v
+ *
+@@ -496,10 +496,10 @@ SUBROUTINE PCLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *                       sub( C ) := sub( C ) - v * w'
+ *
+                         IF( MYROW.EQ.ICROW1 )
+-     $                     CALL CAXPY( NQC2, -TAULOC, WORK( IPW ),
++     $                     CALL CAXPY( NQC2, -TAULOC( 1 ), WORK( IPW ),
+      $                                 MAX( 1, NQC2 ), C( IOFFC1 ),
+      $                                 LDC )
+-                        CALL CGERC( MPV, NQC2, -TAULOC, WORK, 1,
++                        CALL CGERC( MPV, NQC2, -TAULOC( 1 ), WORK, 1,
+      $                              WORK( IPW ), 1, C( IOFFC2 ), LDC )
+                      END IF
+ *
+@@ -530,16 +530,16 @@ SUBROUTINE PCLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                   CALL CGEBS2D( ICTXT, 'Columnwise', ' ', 1, 1,
+      $                          TAU( IIV ), 1 )
+-                  TAULOC = TAU( IIV )
++                  TAULOC( 1 ) = TAU( IIV )
+ *
+                ELSE
+ *
+-                  CALL CGEBR2D( ICTXT, 'Columnwise', ' ', 1, 1, TAULOC,
+-     $                          1, IVROW, MYCOL )
++                  CALL CGEBR2D( ICTXT, 'Columnwise', ' ', 1, 1,
++     $                          TAULOC( 1 ), 1, IVROW, MYCOL )
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C )' * v
+ *
+@@ -562,10 +562,10 @@ SUBROUTINE PCLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *                 sub( C ) := sub( C ) - v * w'
+ *
+                   IF( MYROW.EQ.ICROW1 )
+-     $               CALL CAXPY( NQC2, -TAULOC, WORK( IPW ),
++     $               CALL CAXPY( NQC2, -TAULOC( 1 ), WORK( IPW ),
+      $                           MAX( 1, NQC2 ), C( IOFFC1 ), LDC )
+-                  CALL CGERC( MPV, NQC2, -TAULOC, WORK, 1, WORK( IPW ),
+-     $                        1, C( IOFFC2 ), LDC )
++                  CALL CGERC( MPV, NQC2, -TAULOC( 1 ), WORK, 1,
++     $                        WORK( IPW ), 1, C( IOFFC2 ), LDC )
+                END IF
+ *
+             ELSE
+@@ -580,18 +580,18 @@ SUBROUTINE PCLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+                   WORK( IPW ) = TAU( JJV )
+                   CALL CGEBS2D( ICTXT, 'Rowwise', ROWBTOP, IPW, 1,
+      $                          WORK, IPW )
+-                  TAULOC = TAU( JJV )
++                  TAULOC( 1 ) = TAU( JJV )
+ *
+                ELSE
+ *
+                   IPW = MPV+1
+                   CALL CGEBR2D( ICTXT, 'Rowwise', ROWBTOP, IPW, 1, WORK,
+      $                          IPW, MYROW, IVCOL )
+-                  TAULOC = WORK( IPW )
++                  TAULOC( 1 ) = WORK( IPW )
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C )' * v
+ *
+@@ -614,10 +614,10 @@ SUBROUTINE PCLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *                 sub( C ) := sub( C ) - v * w'
+ *
+                   IF( MYROW.EQ.ICROW1 )
+-     $               CALL CAXPY( NQC2, -TAULOC, WORK( IPW ),
++     $               CALL CAXPY( NQC2, -TAULOC( 1 ), WORK( IPW ),
+      $                           MAX( 1, NQC2 ), C( IOFFC1 ), LDC )
+-                  CALL CGERC( MPV, NQC2, -TAULOC, WORK, 1, WORK( IPW ),
+-     $                        1, C( IOFFC2 ), LDC )
++                  CALL CGERC( MPV, NQC2, -TAULOC( 1 ), WORK, 1,
++     $                        WORK( IPW ), 1, C( IOFFC2 ), LDC )
+                END IF
+ *
+             END IF
+@@ -646,9 +646,9 @@ SUBROUTINE PCLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                   IF( MYROW.EQ.ICROW2 ) THEN
+ *
+-                     TAULOC = TAU( IIV )
++                     TAULOC( 1 ) = TAU( IIV )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C ) * v
+ *
+@@ -669,13 +669,13 @@ SUBROUTINE PCLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+      $                               ICCOL2 )
+ *
+                         IF( MYCOL.EQ.ICCOL1 )
+-     $                     CALL CAXPY( MPC2, -TAULOC, WORK, 1,
++     $                     CALL CAXPY( MPC2, -TAULOC( 1 ), WORK, 1,
+      $                                 C( IOFFC1 ), 1 )
+ *
+ *                       sub( C ) := sub( C ) - w * v'
+ *
+                         IF( MPC2.GT.0 .AND. NQV.GT.0 )
+-     $                     CALL CGERC( MPC2, NQV, -TAULOC, WORK, 1,
++     $                     CALL CGERC( MPC2, NQV, -TAULOC( 1 ), WORK, 1,
+      $                                 V( IOFFV ), LDV, C( IOFFC2 ),
+      $                                 LDC )
+                      END IF
+@@ -699,9 +699,9 @@ SUBROUTINE PCLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+                      IPW = NQV+1
+                      CALL CGERV2D( ICTXT, IPW, 1, WORK, IPW, IVROW,
+      $                             MYCOL )
+-                     TAULOC = WORK( IPW )
++                     TAULOC( 1 ) = WORK( IPW )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C ) * v
+ *
+@@ -720,13 +720,14 @@ SUBROUTINE PCLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+      $                                WORK( IPW ), MAX( 1, MPC2 ),
+      $                                RDEST, ICCOL2 )
+                         IF( MYCOL.EQ.ICCOL1 )
+-     $                     CALL CAXPY( MPC2, -TAULOC, WORK( IPW ), 1,
+-     $                                 C( IOFFC1 ), 1 )
++     $                     CALL CAXPY( MPC2, -TAULOC( 1 ), WORK( IPW ),
++     $                                 1, C( IOFFC1 ), 1 )
+ *
+ *                       sub( C ) := sub( C ) - w * v'
+ *
+-                        CALL CGERC( MPC2, NQV, -TAULOC, WORK( IPW ), 1,
+-     $                              WORK, 1, C( IOFFC2 ), LDC )
++                        CALL CGERC( MPC2, NQV, -TAULOC( 1 ),
++     $                              WORK( IPW ), 1, WORK, 1,
++     $                              C( IOFFC2 ), LDC )
+                      END IF
+ *
+                   END IF
+@@ -751,16 +752,16 @@ SUBROUTINE PCLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                      CALL CGEBS2D( ICTXT, 'Rowwise', ' ', 1, 1,
+      $                             TAU( JJV ), 1 )
+-                     TAULOC = TAU( JJV )
++                     TAULOC( 1 ) = TAU( JJV )
+ *
+                   ELSE
+ *
+-                     CALL CGEBR2D( ICTXT, 'Rowwise', ' ', 1, 1, TAULOC,
+-     $                             1, MYROW, IVCOL )
++                     CALL CGEBR2D( ICTXT, 'Rowwise', ' ', 1, 1,
++     $                             TAULOC( 1 ), 1, MYROW, IVCOL )
+ *
+                   END IF
+ *
+-                  IF( TAULOC.NE.ZERO ) THEN
++                  IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                    w := sub( C ) * v
+ *
+@@ -779,13 +780,13 @@ SUBROUTINE PCLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+      $                             WORK( IPW ), MAX( 1, MPC2 ), RDEST,
+      $                             ICCOL2 )
+                      IF( MYCOL.EQ.ICCOL1 )
+-     $                  CALL CAXPY( MPC2, -TAULOC, WORK( IPW ), 1,
++     $                  CALL CAXPY( MPC2, -TAULOC( 1 ), WORK( IPW ), 1,
+      $                              C( IOFFC1 ), 1 )
+ *
+ *                    sub( C ) := sub( C ) - w * v'
+ *
+-                     CALL CGERC( MPC2, NQV, -TAULOC, WORK( IPW ), 1,
+-     $                           WORK, 1, C( IOFFC2 ), LDC )
++                     CALL CGERC( MPC2, NQV, -TAULOC( 1 ), WORK( IPW ),
++     $                           1, WORK, 1, C( IOFFC2 ), LDC )
+                   END IF
+ *
+                END IF
+@@ -809,18 +810,18 @@ SUBROUTINE PCLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+                   WORK( IPW ) = TAU( IIV )
+                   CALL CGEBS2D( ICTXT, 'Columnwise', COLBTOP, IPW, 1,
+      $                          WORK, IPW )
+-                  TAULOC = TAU( IIV )
++                  TAULOC( 1 ) = TAU( IIV )
+ *
+                ELSE
+ *
+                   IPW = NQV+1
+                   CALL CGEBR2D( ICTXT, 'Columnwise', COLBTOP, IPW, 1,
+      $                          WORK, IPW, IVROW, MYCOL )
+-                  TAULOC = WORK( IPW )
++                  TAULOC( 1 ) = WORK( IPW )
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C ) * v
+ *
+@@ -840,13 +841,13 @@ SUBROUTINE PCLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+      $                          WORK( IPW ), MAX( 1, MPC2 ), RDEST,
+      $                          ICCOL2 )
+                   IF( MYCOL.EQ.ICCOL1 )
+-     $               CALL CAXPY( MPC2, -TAULOC, WORK( IPW ), 1,
++     $               CALL CAXPY( MPC2, -TAULOC( 1 ), WORK( IPW ), 1,
+      $                           C( IOFFC1 ), 1 )
+ *
+ *                 sub( C ) := sub( C ) - w * v'
+ *
+-                  CALL CGERC( MPC2, NQV, -TAULOC, WORK( IPW ), 1, WORK,
+-     $                        1, C( IOFFC2 ), LDC )
++                  CALL CGERC( MPC2, NQV, -TAULOC( 1 ), WORK( IPW ), 1,
++     $                        WORK, 1, C( IOFFC2 ), LDC )
+                END IF
+ *
+             ELSE
+@@ -865,7 +866,7 @@ SUBROUTINE PCLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                   CALL CGEBS2D( ICTXT, 'Rowwise', ' ', 1, 1, TAU( JJV ),
+      $                          1 )
+-                  TAULOC = TAU( JJV )
++                  TAULOC( 1 ) = TAU( JJV )
+ *
+                ELSE
+ *
+@@ -874,7 +875,7 @@ SUBROUTINE PCLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C ) * v
+ *
+@@ -893,13 +894,13 @@ SUBROUTINE PCLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+      $                          WORK( IPW ), MAX( 1, MPC2 ), RDEST,
+      $                          ICCOL2 )
+                   IF( MYCOL.EQ.ICCOL1 )
+-     $               CALL CAXPY( MPC2, -TAULOC, WORK( IPW ), 1,
++     $               CALL CAXPY( MPC2, -TAULOC( 1 ), WORK( IPW ), 1,
+      $                           C( IOFFC1 ), 1 )
+ *
+ *                 sub( C ) := sub( C ) - w * v'
+ *
+-                  CALL CGERC( MPC2, NQV, -TAULOC, WORK( IPW ), 1, WORK,
+-     $                        1, C( IOFFC2 ), LDC )
++                  CALL CGERC( MPC2, NQV, -TAULOC( 1 ), WORK( IPW ), 1,
++     $                        WORK, 1, C( IOFFC2 ), LDC )
+                END IF
+ *
+             END IF
+diff --git a/SRC/pclarzc.f b/SRC/pclarzc.f
+index f1bc21e..b6d3b6d 100644
+--- a/SRC/pclarzc.f
++++ b/SRC/pclarzc.f
+@@ -251,7 +251,7 @@ SUBROUTINE PCLARZC( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+      $                   IVCOL, IVROW, JJC1, JJC2, JJV, LDC, LDV, MPC2,
+      $                   MPV, MYCOL, MYROW, NCC, NCV, NPCOL, NPROW,
+      $                   NQC2, NQV, RDEST
+-      COMPLEX            TAULOC
++      COMPLEX            TAULOC( 1 )
+ *     ..
+ *     .. External Subroutines ..
+       EXTERNAL           BLACS_GRIDINFO, CAXPY, CCOPY, CGEBR2D,
+@@ -370,17 +370,17 @@ SUBROUTINE PCLARZC( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                      CALL CGEBS2D( ICTXT, 'Columnwise', ' ', 1, 1,
+      $                             TAU( IIV ), 1 )
+-                     TAULOC = CONJG( TAU( IIV ) )
++                     TAULOC( 1 ) = CONJG( TAU( IIV ) )
+ *
+                   ELSE
+ *
+                      CALL CGEBR2D( ICTXT, 'Columnwise', ' ', 1, 1,
+      $                             TAULOC, 1, IVROW, MYCOL )
+-                     TAULOC = CONJG( TAULOC )
++                     TAULOC( 1 ) = CONJG( TAULOC( 1 ) )
+ *
+                   END IF
+ *
+-                  IF( TAULOC.NE.ZERO ) THEN
++                  IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                    w := sub( C )' * v
+ *
+@@ -403,9 +403,9 @@ SUBROUTINE PCLARZC( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *                    sub( C ) := sub( C ) - v * w'
+ *
+                      IF( MYROW.EQ.ICROW1 )
+-     $                  CALL CAXPY( NQC2, -TAULOC, WORK( IPW ),
++     $                  CALL CAXPY( NQC2, -TAULOC( 1 ), WORK( IPW ),
+      $                              MAX( 1, NQC2 ), C( IOFFC1 ), LDC )
+-                     CALL CGERC( MPV, NQC2, -TAULOC, WORK, 1,
++                     CALL CGERC( MPV, NQC2, -TAULOC( 1 ), WORK, 1,
+      $                           WORK( IPW ), 1, C( IOFFC2 ), LDC )
+                   END IF
+ *
+@@ -421,9 +421,9 @@ SUBROUTINE PCLARZC( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                   IF( MYCOL.EQ.ICCOL2 ) THEN
+ *
+-                     TAULOC = CONJG( TAU( JJV ) )
++                     TAULOC( 1 ) = CONJG( TAU( JJV ) )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C )' * v
+ *
+@@ -446,11 +446,11 @@ SUBROUTINE PCLARZC( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *                       sub( C ) := sub( C ) - v * w'
+ *
+                         IF( MYROW.EQ.ICROW1 )
+-     $                     CALL CAXPY( NQC2, -TAULOC, WORK,
++     $                     CALL CAXPY( NQC2, -TAULOC( 1 ), WORK,
+      $                                 MAX( 1, NQC2 ), C( IOFFC1 ),
+      $                                 LDC )
+-                        CALL CGERC( MPV, NQC2, -TAULOC, V( IOFFV ), 1,
+-     $                              WORK, 1, C( IOFFC2 ), LDC )
++                        CALL CGERC( MPV, NQC2, -TAULOC( 1 ), V( IOFFV ),
++     $                              1, WORK, 1, C( IOFFC2 ), LDC )
+                      END IF
+ *
+                   END IF
+@@ -472,9 +472,9 @@ SUBROUTINE PCLARZC( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+                      IPW = MPV+1
+                      CALL CGERV2D( ICTXT, IPW, 1, WORK, IPW, MYROW,
+      $                             IVCOL )
+-                     TAULOC = CONJG( WORK( IPW ) )
++                     TAULOC( 1 ) = CONJG( WORK( IPW ) )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C )' * v
+ *
+@@ -497,10 +497,10 @@ SUBROUTINE PCLARZC( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *                       sub( C ) := sub( C ) - v * w'
+ *
+                         IF( MYROW.EQ.ICROW1 )
+-     $                     CALL CAXPY( NQC2, -TAULOC, WORK( IPW ),
++     $                     CALL CAXPY( NQC2, -TAULOC( 1 ), WORK( IPW ),
+      $                                 MAX( 1, NQC2 ), C( IOFFC1 ),
+      $                                 LDC )
+-                        CALL CGERC( MPV, NQC2, -TAULOC, WORK, 1,
++                        CALL CGERC( MPV, NQC2, -TAULOC( 1 ), WORK, 1,
+      $                              WORK( IPW ), 1, C( IOFFC2 ), LDC )
+                      END IF
+ *
+@@ -531,17 +531,17 @@ SUBROUTINE PCLARZC( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                   CALL CGEBS2D( ICTXT, 'Columnwise', ' ', 1, 1,
+      $                          TAU( IIV ), 1 )
+-                  TAULOC = CONJG( TAU( IIV ) )
++                  TAULOC( 1 ) = CONJG( TAU( IIV ) )
+ *
+                ELSE
+ *
+                   CALL CGEBR2D( ICTXT, 'Columnwise', ' ', 1, 1, TAULOC,
+      $                          1, IVROW, MYCOL )
+-                  TAULOC = CONJG( TAULOC )
++                  TAULOC( 1 ) = CONJG( TAULOC( 1 ) )
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C )' * v
+ *
+@@ -564,10 +564,10 @@ SUBROUTINE PCLARZC( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *                 sub( C ) := sub( C ) - v * w'
+ *
+                   IF( MYROW.EQ.ICROW1 )
+-     $               CALL CAXPY( NQC2, -TAULOC, WORK( IPW ),
++     $               CALL CAXPY( NQC2, -TAULOC( 1 ), WORK( IPW ),
+      $                           MAX( 1, NQC2 ), C( IOFFC1 ), LDC )
+-                  CALL CGERC( MPV, NQC2, -TAULOC, WORK, 1, WORK( IPW ),
+-     $                        1, C( IOFFC2 ), LDC )
++                  CALL CGERC( MPV, NQC2, -TAULOC( 1 ), WORK, 1,
++     $                        WORK( IPW ), 1, C( IOFFC2 ), LDC )
+                END IF
+ *
+             ELSE
+@@ -582,18 +582,18 @@ SUBROUTINE PCLARZC( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+                   WORK( IPW ) = TAU( JJV )
+                   CALL CGEBS2D( ICTXT, 'Rowwise', ROWBTOP, IPW, 1,
+      $                          WORK, IPW )
+-                  TAULOC = CONJG( TAU( JJV ) )
++                  TAULOC( 1 ) = CONJG( TAU( JJV ) )
+ *
+                ELSE
+ *
+                   IPW = MPV+1
+                   CALL CGEBR2D( ICTXT, 'Rowwise', ROWBTOP, IPW, 1, WORK,
+      $                          IPW, MYROW, IVCOL )
+-                  TAULOC = CONJG( WORK( IPW ) )
++                  TAULOC( 1 ) = CONJG( WORK( IPW ) )
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C )' * v
+ *
+@@ -616,10 +616,10 @@ SUBROUTINE PCLARZC( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *                 sub( C ) := sub( C ) - v * w'
+ *
+                   IF( MYROW.EQ.ICROW1 )
+-     $               CALL CAXPY( NQC2, -TAULOC, WORK( IPW ),
++     $               CALL CAXPY( NQC2, -TAULOC( 1 ), WORK( IPW ),
+      $                           MAX( 1, NQC2 ), C( IOFFC1 ), LDC )
+-                  CALL CGERC( MPV, NQC2, -TAULOC, WORK, 1, WORK( IPW ),
+-     $                        1, C( IOFFC2 ), LDC )
++                  CALL CGERC( MPV, NQC2, -TAULOC( 1 ), WORK, 1,
++     $                        WORK( IPW ), 1, C( IOFFC2 ), LDC )
+                END IF
+ *
+             END IF
+@@ -648,9 +648,9 @@ SUBROUTINE PCLARZC( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                   IF( MYROW.EQ.ICROW2 ) THEN
+ *
+-                     TAULOC = CONJG( TAU( IIV ) )
++                     TAULOC( 1 ) = CONJG( TAU( IIV ) )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C ) * v
+ *
+@@ -671,12 +671,12 @@ SUBROUTINE PCLARZC( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+      $                               ICCOL2 )
+ *
+                         IF( MYCOL.EQ.ICCOL1 )
+-     $                     CALL CAXPY( MPC2, -TAULOC, WORK, 1,
++     $                     CALL CAXPY( MPC2, -TAULOC( 1 ), WORK, 1,
+      $                                 C( IOFFC1 ), 1 )
+ *
+ *                       sub( C ) := sub( C ) - w * v'
+ *
+-                        CALL CGERC( MPC2, NQV, -TAULOC, WORK, 1,
++                        CALL CGERC( MPC2, NQV, -TAULOC( 1 ), WORK, 1,
+      $                              V( IOFFV ), LDV, C( IOFFC2 ), LDC )
+                      END IF
+ *
+@@ -699,9 +699,9 @@ SUBROUTINE PCLARZC( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+                      IPW = NQV+1
+                      CALL CGERV2D( ICTXT, IPW, 1, WORK, IPW, IVROW,
+      $                             MYCOL )
+-                     TAULOC = CONJG( WORK( IPW ) )
++                     TAULOC( 1 ) = CONJG( WORK( IPW ) )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C ) * v
+ *
+@@ -720,13 +720,14 @@ SUBROUTINE PCLARZC( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+      $                                WORK( IPW ), MAX( 1, MPC2 ),
+      $                                RDEST, ICCOL2 )
+                         IF( MYCOL.EQ.ICCOL1 )
+-     $                     CALL CAXPY( MPC2, -TAULOC, WORK( IPW ), 1,
+-     $                                 C( IOFFC1 ), 1 )
++     $                     CALL CAXPY( MPC2, -TAULOC( 1 ), WORK( IPW ),
++     $                                 1, C( IOFFC1 ), 1 )
+ *
+ *                       sub( C ) := sub( C ) - w * v'
+ *
+-                        CALL CGERC( MPC2, NQV, -TAULOC, WORK( IPW ), 1,
+-     $                              WORK, 1, C( IOFFC2 ), LDC )
++                        CALL CGERC( MPC2, NQV, -TAULOC( 1 ),
++     $                              WORK( IPW ), 1, WORK, 1,
++     $                              C( IOFFC2 ), LDC )
+                      END IF
+ *
+                   END IF
+@@ -751,17 +752,17 @@ SUBROUTINE PCLARZC( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                      CALL CGEBS2D( ICTXT, 'Rowwise', ' ', 1, 1,
+      $                             TAU( JJV ), 1 )
+-                     TAULOC = CONJG( TAU( JJV ) )
++                     TAULOC( 1 ) = CONJG( TAU( JJV ) )
+ *
+                   ELSE
+ *
+                      CALL CGEBR2D( ICTXT, 'Rowwise', ' ', 1, 1, TAULOC,
+      $                             1, MYROW, IVCOL )
+-                     TAULOC = CONJG( TAULOC )
++                     TAULOC( 1 ) = CONJG( TAULOC( 1 ) )
+ *
+                   END IF
+ *
+-                  IF( TAULOC.NE.ZERO ) THEN
++                  IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                    w := sub( C ) * v
+ *
+@@ -780,13 +781,13 @@ SUBROUTINE PCLARZC( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+      $                             WORK( IPW ), MAX( 1, MPC2 ), RDEST,
+      $                             ICCOL2 )
+                      IF( MYCOL.EQ.ICCOL1 )
+-     $                  CALL CAXPY( MPC2, -TAULOC, WORK( IPW ), 1,
++     $                  CALL CAXPY( MPC2, -TAULOC( 1 ), WORK( IPW ), 1,
+      $                              C( IOFFC1 ), 1 )
+ *
+ *                    sub( C ) := sub( C ) - w * v'
+ *
+-                     CALL CGERC( MPC2, NQV, -TAULOC, WORK( IPW ), 1,
+-     $                           WORK, 1, C( IOFFC2 ), LDC )
++                     CALL CGERC( MPC2, NQV, -TAULOC( 1 ), WORK( IPW ),
++     $                           1, WORK, 1, C( IOFFC2 ), LDC )
+                   END IF
+ *
+                END IF
+@@ -810,18 +811,18 @@ SUBROUTINE PCLARZC( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+                   WORK( IPW ) = TAU( IIV )
+                   CALL CGEBS2D( ICTXT, 'Columnwise', COLBTOP, IPW, 1,
+      $                          WORK, IPW )
+-                  TAULOC = CONJG( TAU( IIV ) )
++                  TAULOC( 1 ) = CONJG( TAU( IIV ) )
+ *
+                ELSE
+ *
+                   IPW = NQV+1
+                   CALL CGEBR2D( ICTXT, 'Columnwise', COLBTOP, IPW, 1,
+      $                          WORK, IPW, IVROW, MYCOL )
+-                  TAULOC = CONJG( WORK( IPW ) )
++                  TAULOC( 1 ) = CONJG( WORK( IPW ) )
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C ) * v
+ *
+@@ -841,13 +842,13 @@ SUBROUTINE PCLARZC( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+      $                          WORK( IPW ), MAX( 1, MPC2 ), RDEST,
+      $                          ICCOL2 )
+                   IF( MYCOL.EQ.ICCOL1 )
+-     $               CALL CAXPY( MPC2, -TAULOC, WORK( IPW ), 1,
++     $               CALL CAXPY( MPC2, -TAULOC( 1 ), WORK( IPW ), 1,
+      $                           C( IOFFC1 ), 1 )
+ *
+ *                 sub( C ) := sub( C ) - w * v'
+ *
+-                  CALL CGERC( MPC2, NQV, -TAULOC, WORK( IPW ), 1, WORK,
+-     $                        1, C( IOFFC2 ), LDC )
++                  CALL CGERC( MPC2, NQV, -TAULOC( 1 ), WORK( IPW ), 1,
++     $                        WORK, 1, C( IOFFC2 ), LDC )
+                END IF
+ *
+             ELSE
+@@ -866,17 +867,17 @@ SUBROUTINE PCLARZC( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                   CALL CGEBS2D( ICTXT, 'Rowwise', ' ', 1, 1, TAU( JJV ),
+      $                          1 )
+-                  TAULOC = CONJG( TAU( JJV ) )
++                  TAULOC( 1 ) = CONJG( TAU( JJV ) )
+ *
+                ELSE
+ *
+-                  CALL CGEBR2D( ICTXT, 'Rowwise', ' ', 1, 1, TAULOC, 1,
+-     $                          MYROW, IVCOL )
+-                  TAULOC = CONJG( TAULOC )
++                  CALL CGEBR2D( ICTXT, 'Rowwise', ' ', 1, 1,
++     $                          TAULOC( 1 ), 1, MYROW, IVCOL )
++                  TAULOC( 1 ) = CONJG( TAULOC( 1 ) )
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C ) * v
+ *
+@@ -895,13 +896,13 @@ SUBROUTINE PCLARZC( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+      $                          WORK( IPW ), MAX( 1, MPC2 ), RDEST,
+      $                          ICCOL2 )
+                   IF( MYCOL.EQ.ICCOL1 )
+-     $               CALL CAXPY( MPC2, -TAULOC, WORK( IPW ), 1,
++     $               CALL CAXPY( MPC2, -TAULOC( 1 ), WORK( IPW ), 1,
+      $                           C( IOFFC1 ), 1 )
+ *
+ *                 sub( C ) := sub( C ) - w * v'
+ *
+-                  CALL CGERC( MPC2, NQV, -TAULOC, WORK( IPW ), 1, WORK,
+-     $                        1, C( IOFFC2 ), LDC )
++                  CALL CGERC( MPC2, NQV, -TAULOC( 1 ), WORK( IPW ), 1,
++     $                        WORK, 1, C( IOFFC2 ), LDC )
+                END IF
+ *
+             END IF
+diff --git a/SRC/pclattrs.f b/SRC/pclattrs.f
+index c744aea..0d12a8b 100644
+--- a/SRC/pclattrs.f
++++ b/SRC/pclattrs.f
+@@ -271,7 +271,8 @@ SUBROUTINE PCLATTRS( UPLO, TRANS, DIAG, NORMIN, N, A, IA, JA,
+      $                   JINC, JLAST, LDA, LDX, MB, MYCOL, MYROW, NB,
+      $                   NPCOL, NPROW, RSRC
+       REAL               BIGNUM, GROW, REC, SMLNUM, TJJ, TMAX, TSCAL,
+-     $                   XBND, XJ, XMAX
++     $                   XBND, XJ
++      REAL               XMAX( 1 )
+       COMPLEX            CSUMJ, TJJS, USCAL, XJTMP, ZDUM
+ *     ..
+ *     .. External Functions ..
+@@ -391,11 +392,11 @@ SUBROUTINE PCLATTRS( UPLO, TRANS, DIAG, NORMIN, N, A, IA, JA,
+ *     Compute a bound on the computed solution vector to see if the
+ *     Level 2 PBLAS routine PCTRSV can be used.
+ *
+-      XMAX = ZERO
++      XMAX( 1 ) = ZERO
+       CALL PCAMAX( N, ZDUM, IMAX, X, IX, JX, DESCX, 1 )
+-      XMAX = CABS2( ZDUM )
++      XMAX( 1 ) = CABS2( ZDUM )
+       CALL SGSUM2D( CONTXT, 'Row', ' ', 1, 1, XMAX, 1, -1, -1 )
+-      XBND = XMAX
++      XBND = XMAX( 1 )
+ *
+       IF( NOTRAN ) THEN
+ *
+@@ -590,16 +591,16 @@ SUBROUTINE PCLATTRS( UPLO, TRANS, DIAG, NORMIN, N, A, IA, JA,
+ *
+ *        Use a Level 1 PBLAS solve, scaling intermediate results.
+ *
+-         IF( XMAX.GT.BIGNUM*HALF ) THEN
++         IF( XMAX( 1 ).GT.BIGNUM*HALF ) THEN
+ *
+ *           Scale X so that its components are less than or equal to
+ *           BIGNUM in absolute value.
+ *
+-            SCALE = ( BIGNUM*HALF ) / XMAX
++            SCALE = ( BIGNUM*HALF ) / XMAX( 1 )
+             CALL PCSSCAL( N, SCALE, X, IX, JX, DESCX, 1 )
+-            XMAX = BIGNUM
++            XMAX( 1 ) = BIGNUM
+          ELSE
+-            XMAX = XMAX*TWO
++            XMAX( 1 ) = XMAX( 1 )*TWO
+          END IF
+ *
+          IF( NOTRAN ) THEN
+@@ -651,7 +652,7 @@ SUBROUTINE PCLATTRS( UPLO, TRANS, DIAG, NORMIN, N, A, IA, JA,
+                         CALL PCSSCAL( N, REC, X, IX, JX, DESCX, 1 )
+                         XJTMP = XJTMP*REC
+                         SCALE = SCALE*REC
+-                        XMAX = XMAX*REC
++                        XMAX( 1 ) = XMAX( 1 )*REC
+                      END IF
+                   END IF
+ *                 X( J ) = CLADIV( X( J ), TJJS )
+@@ -682,7 +683,7 @@ SUBROUTINE PCLATTRS( UPLO, TRANS, DIAG, NORMIN, N, A, IA, JA,
+                      CALL PCSSCAL( N, REC, X, IX, JX, DESCX, 1 )
+                      XJTMP = XJTMP*REC
+                      SCALE = SCALE*REC
+-                     XMAX = XMAX*REC
++                     XMAX( 1 ) = XMAX( 1 )*REC
+                   END IF
+ *                 X( J ) = CLADIV( X( J ), TJJS )
+ *                 XJ = CABS1( X( J ) )
+@@ -706,7 +707,7 @@ SUBROUTINE PCLATTRS( UPLO, TRANS, DIAG, NORMIN, N, A, IA, JA,
+                   XJTMP = CONE
+                   XJ = ONE
+                   SCALE = ZERO
+-                  XMAX = ZERO
++                  XMAX( 1 ) = ZERO
+                END IF
+    90          CONTINUE
+ *
+@@ -715,7 +716,7 @@ SUBROUTINE PCLATTRS( UPLO, TRANS, DIAG, NORMIN, N, A, IA, JA,
+ *
+                IF( XJ.GT.ONE ) THEN
+                   REC = ONE / XJ
+-                  IF( CNORM( J ).GT.( BIGNUM-XMAX )*REC ) THEN
++                  IF( CNORM( J ).GT.( BIGNUM-XMAX( 1 ) )*REC ) THEN
+ *
+ *                    Scale x by 1/(2*abs(x(j))).
+ *
+@@ -724,7 +725,7 @@ SUBROUTINE PCLATTRS( UPLO, TRANS, DIAG, NORMIN, N, A, IA, JA,
+                      XJTMP = XJTMP*REC
+                      SCALE = SCALE*REC
+                   END IF
+-               ELSE IF( XJ*CNORM( J ).GT.( BIGNUM-XMAX ) ) THEN
++               ELSE IF( XJ*CNORM( J ).GT.( BIGNUM-XMAX( 1 ) ) ) THEN
+ *
+ *                 Scale x by 1/2.
+ *
+@@ -743,7 +744,7 @@ SUBROUTINE PCLATTRS( UPLO, TRANS, DIAG, NORMIN, N, A, IA, JA,
+                      CALL PCAXPY( J-1, ZDUM, A, IA, JA+J-1, DESCA, 1, X,
+      $                            IX, JX, DESCX, 1 )
+                      CALL PCAMAX( J-1, ZDUM, IMAX, X, IX, JX, DESCX, 1 )
+-                     XMAX = CABS1( ZDUM )
++                     XMAX( 1 ) = CABS1( ZDUM )
+                      CALL SGSUM2D( CONTXT, 'Row', ' ', 1, 1, XMAX, 1,
+      $                             -1, -1 )
+                   END IF
+@@ -757,7 +758,7 @@ SUBROUTINE PCLATTRS( UPLO, TRANS, DIAG, NORMIN, N, A, IA, JA,
+                      CALL PCAXPY( N-J, ZDUM, A, IA+J, JA+J-1, DESCA, 1,
+      $                            X, IX+J, JX, DESCX, 1 )
+                      CALL PCAMAX( N-J, ZDUM, I, X, IX+J, JX, DESCX, 1 )
+-                     XMAX = CABS1( ZDUM )
++                     XMAX( 1 ) = CABS1( ZDUM )
+                      CALL SGSUM2D( CONTXT, 'Row', ' ', 1, 1, XMAX, 1,
+      $                             -1, -1 )
+                   END IF
+@@ -785,7 +786,7 @@ SUBROUTINE PCLATTRS( UPLO, TRANS, DIAG, NORMIN, N, A, IA, JA,
+                END IF
+                XJ = CABS1( XJTMP )
+                USCAL = CMPLX( TSCAL )
+-               REC = ONE / MAX( XMAX, ONE )
++               REC = ONE / MAX( XMAX( 1 ), ONE )
+                IF( CNORM( J ).GT.( BIGNUM-XJ )*REC ) THEN
+ *
+ *                 If x(j) could overflow, scale x by 1/(2*XMAX).
+@@ -820,7 +821,7 @@ SUBROUTINE PCLATTRS( UPLO, TRANS, DIAG, NORMIN, N, A, IA, JA,
+                      CALL PCSSCAL( N, REC, X, IX, JX, DESCX, 1 )
+                      XJTMP = XJTMP*REC
+                      SCALE = SCALE*REC
+-                     XMAX = XMAX*REC
++                     XMAX( 1 ) = XMAX( 1 )*REC
+                   END IF
+                END IF
+ *
+@@ -924,7 +925,7 @@ SUBROUTINE PCLATTRS( UPLO, TRANS, DIAG, NORMIN, N, A, IA, JA,
+                            CALL PCSSCAL( N, REC, X, IX, JX, DESCX, 1 )
+                            XJTMP = XJTMP*REC
+                            SCALE = SCALE*REC
+-                           XMAX = XMAX*REC
++                           XMAX( 1 ) = XMAX( 1 )*REC
+                         END IF
+                      END IF
+ *                    X( J ) = CLADIV( X( J ), TJJS )
+@@ -945,7 +946,7 @@ SUBROUTINE PCLATTRS( UPLO, TRANS, DIAG, NORMIN, N, A, IA, JA,
+                         CALL PCSSCAL( N, REC, X, IX, JX, DESCX, 1 )
+                         XJTMP = XJTMP*REC
+                         SCALE = SCALE*REC
+-                        XMAX = XMAX*REC
++                        XMAX( 1 ) = XMAX( 1 )*REC
+                      END IF
+ *                    X( J ) = CLADIV( X( J ), TJJS )
+                      XJTMP = CLADIV( XJTMP, TJJS )
+@@ -966,7 +967,7 @@ SUBROUTINE PCLATTRS( UPLO, TRANS, DIAG, NORMIN, N, A, IA, JA,
+                      END IF
+                      XJTMP = CONE
+                      SCALE = ZERO
+-                     XMAX = ZERO
++                     XMAX( 1 ) = ZERO
+                   END IF
+   110             CONTINUE
+                ELSE
+@@ -981,7 +982,7 @@ SUBROUTINE PCLATTRS( UPLO, TRANS, DIAG, NORMIN, N, A, IA, JA,
+                      X( IROWX ) = XJTMP
+                   END IF
+                END IF
+-               XMAX = MAX( XMAX, CABS1( XJTMP ) )
++               XMAX( 1 ) = MAX( XMAX( 1 ), CABS1( XJTMP ) )
+   120       CONTINUE
+ *
+          ELSE
+@@ -1004,7 +1005,7 @@ SUBROUTINE PCLATTRS( UPLO, TRANS, DIAG, NORMIN, N, A, IA, JA,
+                END IF
+                XJ = CABS1( XJTMP )
+                USCAL = TSCAL
+-               REC = ONE / MAX( XMAX, ONE )
++               REC = ONE / MAX( XMAX( 1 ), ONE )
+                IF( CNORM( J ).GT.( BIGNUM-XJ )*REC ) THEN
+ *
+ *                 If x(j) could overflow, scale x by 1/(2*XMAX).
+@@ -1039,7 +1040,7 @@ SUBROUTINE PCLATTRS( UPLO, TRANS, DIAG, NORMIN, N, A, IA, JA,
+                      CALL PCSSCAL( N, REC, X, IX, JX, DESCX, 1 )
+                      XJTMP = XJTMP*REC
+                      SCALE = SCALE*REC
+-                     XMAX = XMAX*REC
++                     XMAX( 1 ) = XMAX( 1 )*REC
+                   END IF
+                END IF
+ *
+@@ -1145,7 +1146,7 @@ SUBROUTINE PCLATTRS( UPLO, TRANS, DIAG, NORMIN, N, A, IA, JA,
+                            CALL PCSSCAL( N, REC, X, IX, JX, DESCX, 1 )
+                            XJTMP = XJTMP*REC
+                            SCALE = SCALE*REC
+-                           XMAX = XMAX*REC
++                           XMAX( 1 ) = XMAX( 1 )*REC
+                         END IF
+                      END IF
+ *                    X( J ) = CLADIV( X( J ), TJJS )
+@@ -1164,7 +1165,7 @@ SUBROUTINE PCLATTRS( UPLO, TRANS, DIAG, NORMIN, N, A, IA, JA,
+                         CALL PCSSCAL( N, REC, X, IX, JX, DESCX, 1 )
+                         XJTMP = XJTMP*REC
+                         SCALE = SCALE*REC
+-                        XMAX = XMAX*REC
++                        XMAX( 1 ) = XMAX( 1 )*REC
+                      END IF
+ *                    X( J ) = CLADIV( X( J ), TJJS )
+                      XJTMP = CLADIV( XJTMP, TJJS )
+@@ -1181,7 +1182,7 @@ SUBROUTINE PCLATTRS( UPLO, TRANS, DIAG, NORMIN, N, A, IA, JA,
+      $                  X( IROWX ) = CONE
+                      XJTMP = CONE
+                      SCALE = ZERO
+-                     XMAX = ZERO
++                     XMAX( 1 ) = ZERO
+                   END IF
+   130             CONTINUE
+                ELSE
+@@ -1194,7 +1195,7 @@ SUBROUTINE PCLATTRS( UPLO, TRANS, DIAG, NORMIN, N, A, IA, JA,
+                   IF( ( MYROW.EQ.ITMP1X ) .AND. ( MYCOL.EQ.ITMP2X ) )
+      $               X( IROWX ) = XJTMP
+                END IF
+-               XMAX = MAX( XMAX, CABS1( XJTMP ) )
++               XMAX( 1 ) = MAX( XMAX( 1 ), CABS1( XJTMP ) )
+   140       CONTINUE
+          END IF
+          SCALE = SCALE / TSCAL
+diff --git a/SRC/pclawil.f b/SRC/pclawil.f
+index 24a49b9..b33b3b1 100644
+--- a/SRC/pclawil.f
++++ b/SRC/pclawil.f
+@@ -124,11 +124,10 @@ SUBROUTINE PCLAWIL( II, JJ, M, A, DESCA, H44, H33, H43H34, V )
+      $                   MODKM1, MYCOL, MYROW, NPCOL, NPROW, NUM, RIGHT,
+      $                   RSRC, UP
+       REAL               S
+-      COMPLEX            CDUM, H11, H12, H21, H22, H33S, H44S, V1, V2,
+-     $                   V3
++      COMPLEX            CDUM, H22, H33S, H44S, V1, V2
+ *     ..
+ *     .. Local Arrays ..
+-      COMPLEX            BUF( 4 )
++      COMPLEX            BUF( 4 ), V3( 1 ), H11( 1 ), H12( 1 ), H21( 1 )
+ *     ..
+ *     .. External Subroutines ..
+       EXTERNAL           BLACS_GRIDINFO, INFOG2L, CGERV2D, CGESD2D
+@@ -181,18 +180,18 @@ SUBROUTINE PCLAWIL( II, JJ, M, A, DESCA, H44, H33, H43H34, V )
+             IF( NPCOL.GT.1 ) THEN
+                CALL CGERV2D( CONTXT, 1, 1, V3, 1, MYROW, LEFT )
+             ELSE
+-               V3 = A( ( ICOL-2 )*LDA+IROW )
++               V3( 1 ) = A( ( ICOL-2 )*LDA+IROW )
+             END IF
+             IF( NUM.GT.1 ) THEN
+                CALL CGERV2D( CONTXT, 4, 1, BUF, 4, UP, LEFT )
+-               H11 = BUF( 1 )
+-               H21 = BUF( 2 )
+-               H12 = BUF( 3 )
++               H11( 1 ) = BUF( 1 )
++               H21( 1 ) = BUF( 2 )
++               H12( 1 ) = BUF( 3 )
+                H22 = BUF( 4 )
+             ELSE
+-               H11 = A( ( ICOL-3 )*LDA+IROW-2 )
+-               H21 = A( ( ICOL-3 )*LDA+IROW-1 )
+-               H12 = A( ( ICOL-2 )*LDA+IROW-2 )
++               H11( 1 ) = A( ( ICOL-3 )*LDA+IROW-2 )
++               H21( 1 ) = A( ( ICOL-3 )*LDA+IROW-1 )
++               H12( 1 ) = A( ( ICOL-2 )*LDA+IROW-2 )
+                H22 = A( ( ICOL-2 )*LDA+IROW-1 )
+             END IF
+          END IF
+@@ -223,22 +222,22 @@ SUBROUTINE PCLAWIL( II, JJ, M, A, DESCA, H44, H33, H43H34, V )
+             CALL INFOG2L( M+2, M+2, DESCA, NPROW, NPCOL, MYROW, MYCOL,
+      $                    IROW, ICOL, RSRC, JSRC )
+             IF( NUM.GT.1 ) THEN
+-               CALL CGERV2D( CONTXT, 1, 1, H11, 1, UP, LEFT )
++               CALL CGERV2D( CONTXT, 1, 1, H11( 1 ), 1, UP, LEFT )
+             ELSE
+-               H11 = A( ( ICOL-3 )*LDA+IROW-2 )
++               H11( 1 ) = A( ( ICOL-3 )*LDA+IROW-2 )
+             END IF
+             IF( NPROW.GT.1 ) THEN
+                CALL CGERV2D( CONTXT, 1, 1, H12, 1, UP, MYCOL )
+             ELSE
+-               H12 = A( ( ICOL-2 )*LDA+IROW-2 )
++               H12( 1 ) = A( ( ICOL-2 )*LDA+IROW-2 )
+             END IF
+             IF( NPCOL.GT.1 ) THEN
+-               CALL CGERV2D( CONTXT, 1, 1, H21, 1, MYROW, LEFT )
++               CALL CGERV2D( CONTXT, 1, 1, H21( 1 ), 1, MYROW, LEFT )
+             ELSE
+-               H21 = A( ( ICOL-3 )*LDA+IROW-1 )
++               H21( 1 ) = A( ( ICOL-3 )*LDA+IROW-1 )
+             END IF
+             H22 = A( ( ICOL-2 )*LDA+IROW-1 )
+-            V3 = A( ( ICOL-2 )*LDA+IROW )
++            V3( 1 ) = A( ( ICOL-2 )*LDA+IROW )
+          END IF
+       END IF
+       IF( ( MYROW.NE.II ) .OR. ( MYCOL.NE.JJ ) )
+@@ -247,24 +246,24 @@ SUBROUTINE PCLAWIL( II, JJ, M, A, DESCA, H44, H33, H43H34, V )
+       IF( MODKM1.GT.1 ) THEN
+          CALL INFOG2L( M+2, M+2, DESCA, NPROW, NPCOL, MYROW, MYCOL,
+      $                 IROW, ICOL, RSRC, JSRC )
+-         H11 = A( ( ICOL-3 )*LDA+IROW-2 )
+-         H21 = A( ( ICOL-3 )*LDA+IROW-1 )
+-         H12 = A( ( ICOL-2 )*LDA+IROW-2 )
++         H11( 1 ) = A( ( ICOL-3 )*LDA+IROW-2 )
++         H21( 1 ) = A( ( ICOL-3 )*LDA+IROW-1 )
++         H12( 1 ) = A( ( ICOL-2 )*LDA+IROW-2 )
+          H22 = A( ( ICOL-2 )*LDA+IROW-1 )
+-         V3 = A( ( ICOL-2 )*LDA+IROW )
++         V3( 1 ) = A( ( ICOL-2 )*LDA+IROW )
+       END IF
+ *
+-      H44S = H44 - H11
+-      H33S = H33 - H11
+-      V1 = ( H33S*H44S-H43H34 ) / H21 + H12
+-      V2 = H22 - H11 - H33S - H44S
+-      S = CABS1( V1 ) + CABS1( V2 ) + CABS1( V3 )
++      H44S = H44 - H11( 1 )
++      H33S = H33 - H11( 1 )
++      V1 = ( H33S*H44S-H43H34 ) / H21( 1 ) + H12( 1 )
++      V2 = H22 - H11( 1 ) - H33S - H44S
++      S = CABS1( V1 ) + CABS1( V2 ) + CABS1( V3( 1 ) )
+       V1 = V1 / S
+       V2 = V2 / S
+-      V3 = V3 / S
++      V3( 1 ) = V3( 1 ) / S
+       V( 1 ) = V1
+       V( 2 ) = V2
+-      V( 3 ) = V3
++      V( 3 ) = V3( 1 )
+ *
+       RETURN
+ *
+diff --git a/SRC/pctrevc.f b/SRC/pctrevc.f
+index d0a3043..bf6c52b 100644
+--- a/SRC/pctrevc.f
++++ b/SRC/pctrevc.f
+@@ -218,11 +218,12 @@ SUBROUTINE PCTREVC( SIDE, HOWMNY, SELECT, N, T, DESCT, VL, DESCVL,
+      $                   ITMP2, J, K, KI, LDT, LDVL, LDVR, LDW, MB,
+      $                   MYCOL, MYROW, NB, NPCOL, NPROW, RSRC
+       REAL               SELF
+-      REAL               OVFL, REMAXD, SCALE, SMIN, SMLNUM, ULP, UNFL
++      REAL               OVFL, REMAXD, SCALE, SMLNUM, ULP, UNFL
+       COMPLEX            CDUM, REMAXC, SHIFT
+ *     ..
+ *     .. Local Arrays ..
+       INTEGER            DESCW( DLEN_ )
++      REAL               SMIN( 1 )
+ *     ..
+ *     .. External Functions ..
+       LOGICAL            LSAME
+@@ -355,13 +356,13 @@ SUBROUTINE PCTREVC( SIDE, HOWMNY, SELECT, N, T, DESCT, VL, DESCVL,
+      $            GO TO 70
+             END IF
+ *
+-            SMIN = ZERO
++            SMIN( 1 ) = ZERO
+             SHIFT = CZERO
+             CALL INFOG2L( KI, KI, DESCT, NPROW, NPCOL, MYROW, MYCOL,
+      $                    IROW, ICOL, ITMP1, ITMP2 )
+             IF( ( MYROW.EQ.ITMP1 ) .AND. ( MYCOL.EQ.ITMP2 ) ) THEN
+                SHIFT = T( ( ICOL-1 )*LDT+IROW )
+-               SMIN = MAX( ULP*( CABS1( SHIFT ) ), SMLNUM )
++               SMIN( 1 ) = MAX( ULP*( CABS1( SHIFT ) ), SMLNUM )
+             END IF
+             CALL SGSUM2D( CONTXT, 'ALL', ' ', 1, 1, SMIN, 1, -1, -1 )
+             CALL CGSUM2D( CONTXT, 'ALL', ' ', 1, 1, SHIFT, 1, -1, -1 )
+@@ -396,8 +397,9 @@ SUBROUTINE PCTREVC( SIDE, HOWMNY, SELECT, N, T, DESCT, VL, DESCVL,
+                IF( ( MYROW.EQ.ITMP1 ) .AND. ( MYCOL.EQ.ITMP2 ) ) THEN
+                   T( ( ICOL-1 )*LDT+IROW ) = T( ( ICOL-1 )*LDT+IROW ) -
+      $               SHIFT
+-                  IF( CABS1( T( ( ICOL-1 )*LDT+IROW ) ).LT.SMIN ) THEN
+-                     T( ( ICOL-1 )*LDT+IROW ) = CMPLX( SMIN )
++                  IF( CABS1( T( ( ICOL-1 )*LDT+IROW ) ).LT.SMIN( 1 ) )
++     $            THEN
++                     T( ( ICOL-1 )*LDT+IROW ) = CMPLX( SMIN( 1 ) )
+                   END IF
+                END IF
+    50       CONTINUE
+@@ -467,13 +469,13 @@ SUBROUTINE PCTREVC( SIDE, HOWMNY, SELECT, N, T, DESCT, VL, DESCVL,
+      $            GO TO 110
+             END IF
+ *
+-            SMIN = ZERO
++            SMIN( 1 ) = ZERO
+             SHIFT = CZERO
+             CALL INFOG2L( KI, KI, DESCT, NPROW, NPCOL, MYROW, MYCOL,
+      $                    IROW, ICOL, ITMP1, ITMP2 )
+             IF( ( MYROW.EQ.ITMP1 ) .AND. ( MYCOL.EQ.ITMP2 ) ) THEN
+                SHIFT = T( ( ICOL-1 )*LDT+IROW )
+-               SMIN = MAX( ULP*( CABS1( SHIFT ) ), SMLNUM )
++               SMIN( 1 ) = MAX( ULP*( CABS1( SHIFT ) ), SMLNUM )
+             END IF
+             CALL SGSUM2D( CONTXT, 'ALL', ' ', 1, 1, SMIN, 1, -1, -1 )
+             CALL CGSUM2D( CONTXT, 'ALL', ' ', 1, 1, SHIFT, 1, -1, -1 )
+@@ -507,8 +509,8 @@ SUBROUTINE PCTREVC( SIDE, HOWMNY, SELECT, N, T, DESCT, VL, DESCVL,
+                IF( ( MYROW.EQ.ITMP1 ) .AND. ( MYCOL.EQ.ITMP2 ) ) THEN
+                   T( ( ICOL-1 )*LDT+IROW ) = T( ( ICOL-1 )*LDT+IROW ) -
+      $               SHIFT
+-                  IF( CABS1( T( ( ICOL-1 )*LDT+IROW ) ).LT.SMIN )
+-     $               T( ( ICOL-1 )*LDT+IROW ) = CMPLX( SMIN )
++                  IF( CABS1( T( ( ICOL-1 )*LDT+IROW ) ).LT.SMIN( 1 ) )
++     $               T( ( ICOL-1 )*LDT+IROW ) = CMPLX( SMIN( 1 ) )
+                END IF
+    90       CONTINUE
+ *
+diff --git a/SRC/pdhseqr.f b/SRC/pdhseqr.f
+index ffc3652..6e0f751 100644
+--- a/SRC/pdhseqr.f
++++ b/SRC/pdhseqr.f
+@@ -259,11 +259,12 @@ SUBROUTINE PDHSEQR( JOB, COMPZ, N, ILO, IHI, H, DESCH, WR, WI, Z,
+      $                   HRSRC4, HCSRC4, LIWKOPT
+       LOGICAL            INITZ, LQUERY, WANTT, WANTZ, PAIR, BORDER
+       DOUBLE PRECISION   TMP1, TMP2, TMP3, TMP4, DUM1, DUM2, DUM3,
+-     $                   DUM4, ELEM1, ELEM2, ELEM3, ELEM4,
++     $                   DUM4, ELEM1, ELEM4,
+      $                   CS, SN, ELEM5, TMP, LWKOPT
+ *     ..
+ *     .. Local Arrays ..
+       INTEGER            DESCH2( DLEN_ )
++      DOUBLE PRECISION   ELEM2( 1 ), ELEM3( 1 )
+ *     ..
+ *     .. External Functions ..
+       INTEGER            PILAENVX, NUMROC, ICEIL
+@@ -566,28 +567,28 @@ SUBROUTINE PDHSEQR( JOB, COMPZ, N, ILO, IHI, H, DESCH, WR, WI, Z,
+                   IF( MYROW.EQ.HRSRC1 .AND. MYCOL.EQ.HCSRC1 ) THEN
+                      ELEM1 = H((JLOC1-1)*LLDH+ILOC1)
+                      IF( K.LT.N ) THEN
+-                        ELEM3 = H((JLOC1-1)*LLDH+ILOC1+1)
++                        ELEM3( 1 ) = H((JLOC1-1)*LLDH+ILOC1+1)
+                      ELSE
+-                        ELEM3 = ZERO
++                        ELEM3( 1 ) = ZERO
+                      END IF
+-                     IF( ELEM3.NE.ZERO ) THEN
+-                        ELEM2 = H((JLOC1)*LLDH+ILOC1)
++                     IF( ELEM3( 1 ).NE.ZERO ) THEN
++                        ELEM2( 1 ) = H((JLOC1)*LLDH+ILOC1)
+                         ELEM4 = H((JLOC1)*LLDH+ILOC1+1)
+-                        CALL DLANV2( ELEM1, ELEM2, ELEM3, ELEM4,
+-     $                       WR( K ), WI( K ), WR( K+1 ), WI( K+1 ),
+-     $                       SN, CS )
++                        CALL DLANV2( ELEM1, ELEM2( 1 ), ELEM3( 1 ),
++     $                       ELEM4, WR( K ), WI( K ), WR( K+1 ),
++     $                       WI( K+1 ), SN, CS )
+                         PAIR = .TRUE.
+                      ELSE
+                         IF( K.GT.1 ) THEN
+                            TMP = H((JLOC1-2)*LLDH+ILOC1)
+                            IF( TMP.NE.ZERO ) THEN
+                               ELEM1 = H((JLOC1-2)*LLDH+ILOC1-1)
+-                              ELEM2 = H((JLOC1-1)*LLDH+ILOC1-1)
+-                              ELEM3 = H((JLOC1-2)*LLDH+ILOC1)
++                              ELEM2( 1 ) = H((JLOC1-1)*LLDH+ILOC1-1)
++                              ELEM3( 1 ) = H((JLOC1-2)*LLDH+ILOC1)
+                               ELEM4 = H((JLOC1-1)*LLDH+ILOC1)
+-                              CALL DLANV2( ELEM1, ELEM2, ELEM3,
+-     $                             ELEM4, WR( K-1 ), WI( K-1 ),
+-     $                             WR( K ), WI( K ), SN, CS )
++                              CALL DLANV2( ELEM1, ELEM2( 1 ),
++     $                             ELEM3( 1 ), ELEM4, WR( K-1 ),
++     $                             WI( K-1 ), WR( K ), WI( K ), SN, CS )
+                            ELSE
+                               WR( K ) = ELEM1
+                            END IF
+@@ -620,12 +621,12 @@ SUBROUTINE PDHSEQR( JOB, COMPZ, N, ILO, IHI, H, DESCH, WR, WI, Z,
+             CALL INFOG2L( K+1, K+1, DESCH, NPROW, NPCOL, MYROW, MYCOL,
+      $           ILOC4, JLOC4, HRSRC4, HCSRC4 )
+             IF( MYROW.EQ.HRSRC2 .AND. MYCOL.EQ.HCSRC2 ) THEN
+-               ELEM2 = H((JLOC2-1)*LLDH+ILOC2)
++               ELEM2( 1 ) = H((JLOC2-1)*LLDH+ILOC2)
+                IF( HRSRC1.NE.HRSRC2 .OR. HCSRC1.NE.HCSRC2 )
+      $            CALL DGESD2D( ICTXT, 1, 1, ELEM2, 1, HRSRC1, HCSRC1)
+             END IF
+             IF( MYROW.EQ.HRSRC3 .AND. MYCOL.EQ.HCSRC3 ) THEN
+-               ELEM3 = H((JLOC3-1)*LLDH+ILOC3)
++               ELEM3( 1 ) = H((JLOC3-1)*LLDH+ILOC3)
+                IF( HRSRC1.NE.HRSRC3 .OR. HCSRC1.NE.HCSRC3 )
+      $            CALL DGESD2D( ICTXT, 1, 1, ELEM3, 1, HRSRC1, HCSRC1)
+             END IF
+@@ -651,8 +652,9 @@ SUBROUTINE PDHSEQR( JOB, COMPZ, N, ILO, IHI, H, DESCH, WR, WI, Z,
+                ELEM5 = WORK(2)
+                IF( ELEM5.EQ.ZERO ) THEN
+                   IF( WR( K ).EQ.ZERO .AND. WI( K ).EQ.ZERO ) THEN
+-                     CALL DLANV2( ELEM1, ELEM2, ELEM3, ELEM4, WR( K ),
+-     $                    WI( K ), WR( K+1 ), WI( K+1 ), SN, CS )
++                     CALL DLANV2( ELEM1, ELEM2( 1 ), ELEM3( 1 ), ELEM4,
++     $                    WR( K ), WI( K ), WR( K+1 ), WI( K+1 ), SN,
++     $                    CS )
+                   ELSEIF( WR( K+1 ).EQ.ZERO .AND. WI( K+1 ).EQ.ZERO )
+      $                 THEN
+                      WR( K+1 ) = ELEM4
+diff --git a/SRC/pdlacon.f b/SRC/pdlacon.f
+index b625d97..74b9eab 100644
+--- a/SRC/pdlacon.f
++++ b/SRC/pdlacon.f
+@@ -160,10 +160,10 @@ SUBROUTINE PDLACON( N, V, IV, JV, DESCV, X, IX, JX, DESCX, ISGN,
+       INTEGER            I, ICTXT, IFLAG, IIVX, IMAXROW, IOFFVX, IROFF,
+      $                   ITER, IVXCOL, IVXROW, J, JLAST, JJVX, JUMP,
+      $                   K, MYCOL, MYROW, NP, NPCOL, NPROW
+-      DOUBLE PRECISION   ALTSGN, ESTOLD, JLMAX, TEMP, XMAX
++      DOUBLE PRECISION   ALTSGN, ESTOLD, JLMAX, XMAX
+ *     ..
+ *     .. Local Arrays ..
+-      DOUBLE PRECISION   WORK( 2 )
++      DOUBLE PRECISION   ESTWORK( 1 ), TEMP( 1 ), WORK( 2 )
+ *     ..
+ *     .. External Subroutines ..
+       EXTERNAL           BLACS_GRIDINFO, DCOPY, DGEBR2D, DGEBS2D,
+@@ -184,6 +184,7 @@ SUBROUTINE PDLACON( N, V, IV, JV, DESCV, X, IX, JX, DESCX, ISGN,
+ *
+ *     Get grid parameters.
+ *
++      ESTWORK( 1 ) = EST
+       ICTXT = DESCX( CTXT_ )
+       CALL BLACS_GRIDINFO( ICTXT, NPROW, NPCOL, MYROW, MYCOL )
+ *
+@@ -215,21 +216,21 @@ SUBROUTINE PDLACON( N, V, IV, JV, DESCV, X, IX, JX, DESCX, ISGN,
+       IF( N.EQ.1 ) THEN
+          IF( MYROW.EQ.IVXROW ) THEN
+             V( IOFFVX ) = X( IOFFVX )
+-            EST = ABS( V( IOFFVX ) )
+-            CALL DGEBS2D( ICTXT, 'Columnwise', ' ', 1, 1, EST, 1 )
++            ESTWORK( 1 ) = ABS( V( IOFFVX ) )
++            CALL DGEBS2D( ICTXT, 'Columnwise', ' ', 1, 1, ESTWORK, 1 )
+          ELSE
+-            CALL DGEBR2D( ICTXT, 'Columnwise', ' ', 1, 1, EST, 1,
++            CALL DGEBR2D( ICTXT, 'Columnwise', ' ', 1, 1, ESTWORK, 1,
+      $                    IVXROW, MYCOL )
+          END IF
+ *        ... QUIT
+          GO TO 150
+       END IF
+-      CALL PDASUM( N, EST, X, IX, JX, DESCX, 1 )
++      CALL PDASUM( N, ESTWORK( 1 ), X, IX, JX, DESCX, 1 )
+       IF( DESCX( M_ ).EQ.1 .AND. N.EQ.1 ) THEN
+          IF( MYROW.EQ.IVXROW ) THEN
+-            CALL DGEBS2D( ICTXT, 'Columnwise', ' ', 1, 1, EST, 1 )
++            CALL DGEBS2D( ICTXT, 'Columnwise', ' ', 1, 1, ESTWORK, 1 )
+          ELSE
+-            CALL DGEBR2D( ICTXT, 'Columnwise', ' ', 1, 1, EST, 1,
++            CALL DGEBR2D( ICTXT, 'Columnwise', ' ', 1, 1, ESTWORK, 1,
+      $                    IVXROW, MYCOL )
+          END IF
+       END IF
+@@ -281,13 +282,13 @@ SUBROUTINE PDLACON( N, V, IV, JV, DESCV, X, IX, JX, DESCX, ISGN,
+ *
+    70 CONTINUE
+       CALL DCOPY( NP, X( IOFFVX ), 1, V( IOFFVX ), 1 )
+-      ESTOLD = EST
+-      CALL PDASUM( N, EST, V, IV, JV, DESCV, 1 )
++      ESTOLD = ESTWORK( 1 )
++      CALL PDASUM( N, ESTWORK( 1 ), V, IV, JV, DESCV, 1 )
+       IF( DESCV( M_ ).EQ.1 .AND. N.EQ.1 ) THEN
+          IF( MYROW.EQ.IVXROW ) THEN
+-            CALL DGEBS2D( ICTXT, 'Columnwise', ' ', 1, 1, EST, 1 )
++            CALL DGEBS2D( ICTXT, 'Columnwise', ' ', 1, 1, ESTWORK, 1 )
+          ELSE
+-            CALL DGEBR2D( ICTXT, 'Columnwise', ' ', 1, 1, EST, 1,
++            CALL DGEBR2D( ICTXT, 'Columnwise', ' ', 1, 1, ESTWORK, 1,
+      $                    IVXROW, MYCOL )
+          END IF
+       END IF
+@@ -305,7 +306,7 @@ SUBROUTINE PDLACON( N, V, IV, JV, DESCV, X, IX, JX, DESCX, ISGN,
+ *     REPEATED SIGN VECTOR DETECTED, HENCE ALGORITHM HAS CONVERGED.
+ *     ALONG WITH IT, TEST FOR CYCLING.
+ *
+-      IF( IFLAG.EQ.0 .OR. EST.LE.ESTOLD )
++      IF( IFLAG.EQ.0 .OR. ESTWORK( 1 ).LE.ESTOLD )
+      $   GO TO 120
+ *
+       DO 100 I = IOFFVX, IOFFVX+NP-1
+@@ -361,7 +362,7 @@ SUBROUTINE PDLACON( N, V, IV, JV, DESCV, X, IX, JX, DESCX, ISGN,
+ *     X HAS BEEN OVERWRITTEN BY A*X
+ *
+   140 CONTINUE
+-      CALL PDASUM( N, TEMP, X, IX, JX, DESCX, 1 )
++      CALL PDASUM( N, TEMP( 1 ), X, IX, JX, DESCX, 1 )
+       IF( DESCX( M_ ).EQ.1 .AND. N.EQ.1 ) THEN
+          IF( MYROW.EQ.IVXROW ) THEN
+             CALL DGEBS2D( ICTXT, 'Columnwise', ' ', 1, 1, TEMP, 1 )
+@@ -370,15 +371,16 @@ SUBROUTINE PDLACON( N, V, IV, JV, DESCV, X, IX, JX, DESCX, ISGN,
+      $                    IVXROW, MYCOL )
+          END IF
+       END IF
+-      TEMP = TWO*( TEMP / DBLE( 3*N ) )
+-      IF( TEMP.GT.EST ) THEN
++      TEMP( 1 ) = TWO*( TEMP( 1 ) / DBLE( 3*N ) )
++      IF( TEMP( 1 ).GT.ESTWORK( 1 ) ) THEN
+          CALL DCOPY( NP, X( IOFFVX ), 1, V( IOFFVX ), 1 )
+-         EST = TEMP
++         ESTWORK( 1 ) = TEMP( 1 )
+       END IF
+ *
+   150 CONTINUE
+       KASE = 0
+ *
++      EST = ESTWORK( 1 )
+       RETURN
+ *
+ *     End of PDLACON
+diff --git a/SRC/pdlarf.f b/SRC/pdlarf.f
+index 29da1ac..41368d6 100644
+--- a/SRC/pdlarf.f
++++ b/SRC/pdlarf.f
+@@ -241,7 +241,7 @@ SUBROUTINE PDLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+      $                   IOFFV, IPW, IROFF, IVCOL, IVROW, JJC, JJV, LDC,
+      $                   LDV, MYCOL, MYROW, MP, NCC, NCV, NPCOL, NPROW,
+      $                   NQ, RDEST
+-      DOUBLE PRECISION   TAULOC
++      DOUBLE PRECISION   TAULOC( 1 )
+ *     ..
+ *     .. External Subroutines ..
+       EXTERNAL           BLACS_GRIDINFO, DCOPY, DGEBR2D, DGEBS2D,
+@@ -335,7 +335,7 @@ SUBROUTINE PDLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                      CALL DGEBS2D( ICTXT, 'Columnwise', ' ', 1, 1,
+      $                             TAU( IIV ), 1 )
+-                     TAULOC = TAU( IIV )
++                     TAULOC( 1 ) = TAU( IIV )
+ *
+                   ELSE
+ *
+@@ -344,7 +344,7 @@ SUBROUTINE PDLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                   END IF
+ *
+-                  IF( TAULOC.NE.ZERO ) THEN
++                  IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                    w := sub( C )' * v
+ *
+@@ -362,8 +362,8 @@ SUBROUTINE PDLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+ *                    sub( C ) := sub( C ) - v * w'
+ *
+-                     CALL DGER( MP, NQ, -TAULOC, WORK, 1, WORK( IPW ),
+-     $                          1, C( IOFFC ), LDC )
++                     CALL DGER( MP, NQ, -TAULOC( 1 ), WORK, 1,
++     $                          WORK( IPW ), 1, C( IOFFC ), LDC )
+                   END IF
+ *
+                END IF
+@@ -378,9 +378,9 @@ SUBROUTINE PDLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                   IF( MYCOL.EQ.ICCOL ) THEN
+ *
+-                     TAULOC = TAU( JJV )
++                     TAULOC( 1 ) = TAU( JJV )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C )' * v
+ *
+@@ -397,8 +397,8 @@ SUBROUTINE PDLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+ *                       sub( C ) := sub( C ) - v * w'
+ *
+-                        CALL DGER( MP, NQ, -TAULOC, V( IOFFV ), 1, WORK,
+-     $                             1, C( IOFFC ), LDC )
++                        CALL DGER( MP, NQ, -TAULOC( 1 ), V( IOFFV ), 1,
++     $                             WORK, 1, C( IOFFC ), LDC )
+                      END IF
+ *
+                   END IF
+@@ -420,9 +420,9 @@ SUBROUTINE PDLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+                      IPW = MP+1
+                      CALL DGERV2D( ICTXT, IPW, 1, WORK, IPW, MYROW,
+      $                             IVCOL )
+-                     TAULOC = WORK( IPW )
++                     TAULOC( 1 ) = WORK( IPW )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C )' * v
+ *
+@@ -440,7 +440,7 @@ SUBROUTINE PDLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+ *                       sub( C ) := sub( C ) - v * w'
+ *
+-                        CALL DGER( MP, NQ, -TAULOC, WORK, 1,
++                        CALL DGER( MP, NQ, -TAULOC( 1 ), WORK, 1,
+      $                             WORK( IPW ), 1, C( IOFFC ), LDC )
+                      END IF
+ *
+@@ -470,7 +470,7 @@ SUBROUTINE PDLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                   CALL DGEBS2D( ICTXT, 'Columnwise', ' ', 1, 1,
+      $                          TAU( IIV ), 1 )
+-                  TAULOC = TAU( IIV )
++                  TAULOC( 1 ) = TAU( IIV )
+ *
+                ELSE
+ *
+@@ -479,7 +479,7 @@ SUBROUTINE PDLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C )' * v
+ *
+@@ -499,8 +499,8 @@ SUBROUTINE PDLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *                 sub( C ) := sub( C ) - v * w'
+ *
+                   IF( IOFFC.GT.0 )
+-     $               CALL DGER( MP, NQ, -TAULOC, WORK, 1, WORK( IPW ),
+-     $                          1, C( IOFFC ), LDC )
++     $               CALL DGER( MP, NQ, -TAULOC( 1 ), WORK, 1,
++     $                          WORK( IPW ), 1, C( IOFFC ), LDC )
+                END IF
+ *
+             ELSE
+@@ -515,18 +515,18 @@ SUBROUTINE PDLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+                   WORK(IPW) = TAU( JJV )
+                   CALL DGEBS2D( ICTXT, 'Rowwise', ROWBTOP, IPW, 1,
+      $                          WORK, IPW )
+-                  TAULOC = TAU( JJV )
++                  TAULOC( 1 ) = TAU( JJV )
+ *
+                ELSE
+ *
+                   IPW = MP+1
+                   CALL DGEBR2D( ICTXT, 'Rowwise', ROWBTOP, IPW, 1, WORK,
+      $                          IPW, MYROW, IVCOL )
+-                  TAULOC = WORK( IPW )
++                  TAULOC( 1 ) = WORK( IPW )
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C )' * v
+ *
+@@ -546,8 +546,8 @@ SUBROUTINE PDLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *                 sub( C ) := sub( C ) - v * w'
+ *
+                   IF( IOFFC.GT.0 )
+-     $               CALL DGER( MP, NQ, -TAULOC, WORK, 1, WORK( IPW ),
+-     $                          1, C( IOFFC ), LDC )
++     $               CALL DGER( MP, NQ, -TAULOC( 1 ), WORK, 1,
++     $                          WORK( IPW ), 1, C( IOFFC ), LDC )
+                END IF
+ *
+             END IF
+@@ -576,9 +576,9 @@ SUBROUTINE PDLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                   IF( MYROW.EQ.ICROW ) THEN
+ *
+-                     TAULOC = TAU( IIV )
++                     TAULOC( 1 ) = TAU( IIV )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C ) * v
+ *
+@@ -596,7 +596,7 @@ SUBROUTINE PDLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *                       sub( C ) := sub( C ) - w * v'
+ *
+                         IF( IOFFV.GT.0 .AND. IOFFC.GT.0 )
+-     $                     CALL DGER( MP, NQ, -TAULOC, WORK, 1,
++     $                     CALL DGER( MP, NQ, -TAULOC( 1 ), WORK, 1,
+      $                                V( IOFFV ), LDV, C( IOFFC ), LDC )
+                      END IF
+ *
+@@ -619,9 +619,9 @@ SUBROUTINE PDLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+                      IPW = NQ+1
+                      CALL DGERV2D( ICTXT, IPW, 1, WORK, IPW, IVROW,
+      $                             MYCOL )
+-                     TAULOC = WORK( IPW )
++                     TAULOC( 1 ) = WORK( IPW )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C ) * v
+ *
+@@ -639,7 +639,7 @@ SUBROUTINE PDLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+ *                       sub( C ) := sub( C ) - w * v'
+ *
+-                        CALL DGER( MP, NQ, -TAULOC, WORK( IPW ), 1,
++                        CALL DGER( MP, NQ, -TAULOC( 1 ), WORK( IPW ), 1,
+      $                             WORK, 1, C( IOFFC ), LDC )
+                      END IF
+ *
+@@ -665,7 +665,7 @@ SUBROUTINE PDLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                      CALL DGEBS2D( ICTXT, 'Rowwise', ' ', 1, 1,
+      $                             TAU( JJV ), 1 )
+-                     TAULOC = TAU( JJV )
++                     TAULOC( 1 ) = TAU( JJV )
+ *
+                   ELSE
+ *
+@@ -674,7 +674,7 @@ SUBROUTINE PDLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                   END IF
+ *
+-                  IF( TAULOC.NE.ZERO ) THEN
++                  IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                    w := sub( C ) * v
+ *
+@@ -692,8 +692,8 @@ SUBROUTINE PDLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+ *                    sub( C ) := sub( C ) - w * v'
+ *
+-                     CALL DGER( MP, NQ, -TAULOC, WORK( IPW ), 1, WORK,
+-     $                          1, C( IOFFC ), LDC )
++                     CALL DGER( MP, NQ, -TAULOC( 1 ), WORK( IPW ), 1,
++     $                          WORK, 1, C( IOFFC ), LDC )
+                   END IF
+ *
+                END IF
+@@ -718,18 +718,18 @@ SUBROUTINE PDLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+                   WORK(IPW) = TAU( IIV )
+                   CALL DGEBS2D( ICTXT, 'Columnwise', COLBTOP, IPW, 1,
+      $                          WORK, IPW )
+-                  TAULOC = TAU( IIV )
++                  TAULOC( 1 ) = TAU( IIV )
+ *
+                ELSE
+ *
+                   IPW = NQ+1
+                   CALL DGEBR2D( ICTXT, 'Columnwise', COLBTOP, IPW, 1,
+      $                          WORK, IPW, IVROW, MYCOL )
+-                  TAULOC = WORK( IPW )
++                  TAULOC( 1 ) = WORK( IPW )
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C ) * v
+ *
+@@ -748,8 +748,8 @@ SUBROUTINE PDLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *                 sub( C ) := sub( C ) - w * v'
+ *
+                   IF( IOFFC.GT.0 )
+-     $               CALL DGER( MP, NQ, -TAULOC, WORK( IPW ), 1, WORK,
+-     $                          1, C( IOFFC ), LDC )
++     $               CALL DGER( MP, NQ, -TAULOC( 1 ), WORK( IPW ), 1,
++     $                          WORK, 1, C( IOFFC ), LDC )
+                END IF
+ *
+             ELSE
+@@ -768,7 +768,7 @@ SUBROUTINE PDLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                   CALL DGEBS2D( ICTXT, 'Rowwise', ' ', 1, 1, TAU( JJV ),
+      $                          1 )
+-                  TAULOC = TAU( JJV )
++                  TAULOC( 1 ) = TAU( JJV )
+ *
+                ELSE
+ *
+@@ -777,7 +777,7 @@ SUBROUTINE PDLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C ) * v
+ *
+@@ -795,8 +795,8 @@ SUBROUTINE PDLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+ *                 sub( C ) := sub( C ) - w * v'
+ *
+-                  CALL DGER( MP, NQ, -TAULOC, WORK( IPW ), 1, WORK, 1,
+-     $                       C( IOFFC ), LDC )
++                  CALL DGER( MP, NQ, -TAULOC( 1 ), WORK( IPW ), 1, WORK,
++     $                       1, C( IOFFC ), LDC )
+                END IF
+ *
+             END IF
+diff --git a/SRC/pdlarz.f b/SRC/pdlarz.f
+index b91282c..f45c137 100644
+--- a/SRC/pdlarz.f
++++ b/SRC/pdlarz.f
+@@ -250,7 +250,7 @@ SUBROUTINE PDLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+      $                   IVCOL, IVROW, JJC1, JJC2, JJV, LDC, LDV, MPC2,
+      $                   MPV, MYCOL, MYROW, NCC, NCV, NPCOL, NPROW,
+      $                   NQC2, NQV, RDEST
+-      DOUBLE PRECISION   TAULOC
++      DOUBLE PRECISION   TAULOC( 1 )
+ *     ..
+ *     .. External Subroutines ..
+       EXTERNAL           BLACS_GRIDINFO, DAXPY, DCOPY, DGEBR2D,
+@@ -369,7 +369,7 @@ SUBROUTINE PDLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                      CALL DGEBS2D( ICTXT, 'Columnwise', ' ', 1, 1,
+      $                             TAU( IIV ), 1 )
+-                     TAULOC = TAU( IIV )
++                     TAULOC( 1 ) = TAU( IIV )
+ *
+                   ELSE
+ *
+@@ -378,7 +378,7 @@ SUBROUTINE PDLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                   END IF
+ *
+-                  IF( TAULOC.NE.ZERO ) THEN
++                  IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                    w := sub( C )' * v
+ *
+@@ -401,9 +401,9 @@ SUBROUTINE PDLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *                    sub( C ) := sub( C ) - v * w'
+ *
+                      IF( MYROW.EQ.ICROW1 )
+-     $                  CALL DAXPY( NQC2, -TAULOC, WORK( IPW ),
++     $                  CALL DAXPY( NQC2, -TAULOC( 1 ), WORK( IPW ),
+      $                              MAX( 1, NQC2 ), C( IOFFC1 ), LDC )
+-                     CALL DGER( MPV, NQC2, -TAULOC, WORK, 1,
++                     CALL DGER( MPV, NQC2, -TAULOC( 1 ), WORK, 1,
+      $                          WORK( IPW ), 1, C( IOFFC2 ), LDC )
+                   END IF
+ *
+@@ -419,9 +419,9 @@ SUBROUTINE PDLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                   IF( MYCOL.EQ.ICCOL2 ) THEN
+ *
+-                     TAULOC = TAU( JJV )
++                     TAULOC( 1 ) = TAU( JJV )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C )' * v
+ *
+@@ -444,11 +444,11 @@ SUBROUTINE PDLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *                       sub( C ) := sub( C ) - v * w'
+ *
+                         IF( MYROW.EQ.ICROW1 )
+-     $                     CALL DAXPY( NQC2, -TAULOC, WORK,
++     $                     CALL DAXPY( NQC2, -TAULOC( 1 ), WORK,
+      $                                 MAX( 1, NQC2 ), C( IOFFC1 ),
+      $                                 LDC )
+-                        CALL DGER( MPV, NQC2, -TAULOC, V( IOFFV ), 1,
+-     $                             WORK, 1, C( IOFFC2 ), LDC )
++                        CALL DGER( MPV, NQC2, -TAULOC( 1 ), V( IOFFV ),
++     $                             1, WORK, 1, C( IOFFC2 ), LDC )
+                      END IF
+ *
+                   END IF
+@@ -470,9 +470,9 @@ SUBROUTINE PDLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+                      IPW = MPV+1
+                      CALL DGERV2D( ICTXT, IPW, 1, WORK, IPW, MYROW,
+      $                             IVCOL )
+-                     TAULOC = WORK( IPW )
++                     TAULOC( 1 ) = WORK( IPW )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C )' * v
+ *
+@@ -495,10 +495,10 @@ SUBROUTINE PDLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *                       sub( C ) := sub( C ) - v * w'
+ *
+                         IF( MYROW.EQ.ICROW1 )
+-     $                     CALL DAXPY( NQC2, -TAULOC, WORK( IPW ),
++     $                     CALL DAXPY( NQC2, -TAULOC( 1 ), WORK( IPW ),
+      $                                 MAX( 1, NQC2 ), C( IOFFC1 ),
+      $                                 LDC )
+-                        CALL DGER( MPV, NQC2, -TAULOC, WORK, 1,
++                        CALL DGER( MPV, NQC2, -TAULOC( 1 ), WORK, 1,
+      $                             WORK( IPW ), 1, C( IOFFC2 ), LDC )
+                      END IF
+ *
+@@ -529,7 +529,7 @@ SUBROUTINE PDLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                   CALL DGEBS2D( ICTXT, 'Columnwise', ' ', 1, 1,
+      $                          TAU( IIV ), 1 )
+-                  TAULOC = TAU( IIV )
++                  TAULOC( 1 ) = TAU( IIV )
+ *
+                ELSE
+ *
+@@ -538,7 +538,7 @@ SUBROUTINE PDLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C )' * v
+ *
+@@ -561,10 +561,10 @@ SUBROUTINE PDLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *                 sub( C ) := sub( C ) - v * w'
+ *
+                   IF( MYROW.EQ.ICROW1 )
+-     $               CALL DAXPY( NQC2, -TAULOC, WORK( IPW ),
++     $               CALL DAXPY( NQC2, -TAULOC( 1 ), WORK( IPW ),
+      $                           MAX( 1, NQC2 ), C( IOFFC1 ), LDC )
+-                  CALL DGER( MPV, NQC2, -TAULOC, WORK, 1, WORK( IPW ),
+-     $                       1, C( IOFFC2 ), LDC )
++                  CALL DGER( MPV, NQC2, -TAULOC( 1 ), WORK, 1,
++     $                       WORK( IPW ), 1, C( IOFFC2 ), LDC )
+                END IF
+ *
+             ELSE
+@@ -579,18 +579,18 @@ SUBROUTINE PDLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+                   WORK( IPW ) = TAU( JJV )
+                   CALL DGEBS2D( ICTXT, 'Rowwise', ROWBTOP, IPW, 1,
+      $                          WORK, IPW )
+-                  TAULOC = TAU( JJV )
++                  TAULOC( 1 ) = TAU( JJV )
+ *
+                ELSE
+ *
+                   IPW = MPV+1
+                   CALL DGEBR2D( ICTXT, 'Rowwise', ROWBTOP, IPW, 1, WORK,
+      $                          IPW, MYROW, IVCOL )
+-                  TAULOC = WORK( IPW )
++                  TAULOC( 1 ) = WORK( IPW )
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C )' * v
+ *
+@@ -613,10 +613,10 @@ SUBROUTINE PDLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *                 sub( C ) := sub( C ) - v * w'
+ *
+                   IF( MYROW.EQ.ICROW1 )
+-     $               CALL DAXPY( NQC2, -TAULOC, WORK( IPW ),
++     $               CALL DAXPY( NQC2, -TAULOC( 1 ), WORK( IPW ),
+      $                           MAX( 1, NQC2 ), C( IOFFC1 ), LDC )
+-                  CALL DGER( MPV, NQC2, -TAULOC, WORK, 1, WORK( IPW ),
+-     $                       1, C( IOFFC2 ), LDC )
++                  CALL DGER( MPV, NQC2, -TAULOC( 1 ), WORK, 1,
++     $                       WORK( IPW ), 1, C( IOFFC2 ), LDC )
+                END IF
+ *
+             END IF
+@@ -645,9 +645,9 @@ SUBROUTINE PDLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                   IF( MYROW.EQ.ICROW2 ) THEN
+ *
+-                     TAULOC = TAU( IIV )
++                     TAULOC( 1 ) = TAU( IIV )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C ) * v
+ *
+@@ -668,13 +668,13 @@ SUBROUTINE PDLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+      $                               ICCOL2 )
+ *
+                         IF( MYCOL.EQ.ICCOL1 )
+-     $                     CALL DAXPY( MPC2, -TAULOC, WORK, 1,
++     $                     CALL DAXPY( MPC2, -TAULOC( 1 ), WORK, 1,
+      $                                 C( IOFFC1 ), 1 )
+ *
+ *                       sub( C ) := sub( C ) - w * v'
+ *
+                         IF( MPC2.GT.0 .AND. NQV.GT.0 )
+-     $                     CALL DGER( MPC2, NQV, -TAULOC, WORK, 1,
++     $                     CALL DGER( MPC2, NQV, -TAULOC( 1 ), WORK, 1,
+      $                                V( IOFFV ), LDV, C( IOFFC2 ),
+      $                                LDC )
+                      END IF
+@@ -698,9 +698,9 @@ SUBROUTINE PDLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+                      IPW = NQV+1
+                      CALL DGERV2D( ICTXT, IPW, 1, WORK, IPW, IVROW,
+      $                             MYCOL )
+-                     TAULOC = WORK( IPW )
++                     TAULOC( 1 ) = WORK( IPW )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C ) * v
+ *
+@@ -719,13 +719,13 @@ SUBROUTINE PDLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+      $                                WORK( IPW ), MAX( 1, MPC2 ),
+      $                                RDEST, ICCOL2 )
+                         IF( MYCOL.EQ.ICCOL1 )
+-     $                     CALL DAXPY( MPC2, -TAULOC, WORK( IPW ), 1,
+-     $                                 C( IOFFC1 ), 1 )
++     $                     CALL DAXPY( MPC2, -TAULOC( 1 ), WORK( IPW ),
++     $                                 1, C( IOFFC1 ), 1 )
+ *
+ *                       sub( C ) := sub( C ) - w * v'
+ *
+-                        CALL DGER( MPC2, NQV, -TAULOC, WORK( IPW ), 1,
+-     $                             WORK, 1, C( IOFFC2 ), LDC )
++                        CALL DGER( MPC2, NQV, -TAULOC( 1 ), WORK( IPW ),
++     $                             1, WORK, 1, C( IOFFC2 ), LDC )
+                      END IF
+ *
+                   END IF
+@@ -750,7 +750,7 @@ SUBROUTINE PDLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                      CALL DGEBS2D( ICTXT, 'Rowwise', ' ', 1, 1,
+      $                             TAU( JJV ), 1 )
+-                     TAULOC = TAU( JJV )
++                     TAULOC( 1 ) = TAU( JJV )
+ *
+                   ELSE
+ *
+@@ -759,7 +759,7 @@ SUBROUTINE PDLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                   END IF
+ *
+-                  IF( TAULOC.NE.ZERO ) THEN
++                  IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                    w := sub( C ) * v
+ *
+@@ -778,12 +778,12 @@ SUBROUTINE PDLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+      $                             WORK( IPW ), MAX( 1, MPC2 ), RDEST,
+      $                             ICCOL2 )
+                      IF( MYCOL.EQ.ICCOL1 )
+-     $                  CALL DAXPY( MPC2, -TAULOC, WORK( IPW ), 1,
++     $                  CALL DAXPY( MPC2, -TAULOC( 1 ), WORK( IPW ), 1,
+      $                              C( IOFFC1 ), 1 )
+ *
+ *                    sub( C ) := sub( C ) - w * v'
+ *
+-                     CALL DGER( MPC2, NQV, -TAULOC, WORK( IPW ), 1,
++                     CALL DGER( MPC2, NQV, -TAULOC( 1 ), WORK( IPW ), 1,
+      $                          WORK, 1, C( IOFFC2 ), LDC )
+                   END IF
+ *
+@@ -808,18 +808,18 @@ SUBROUTINE PDLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+                   WORK( IPW ) = TAU( IIV )
+                   CALL DGEBS2D( ICTXT, 'Columnwise', COLBTOP, IPW, 1,
+      $                          WORK, IPW )
+-                  TAULOC = TAU( IIV )
++                  TAULOC( 1 ) = TAU( IIV )
+ *
+                ELSE
+ *
+                   IPW = NQV+1
+                   CALL DGEBR2D( ICTXT, 'Columnwise', COLBTOP, IPW, 1,
+      $                          WORK, IPW, IVROW, MYCOL )
+-                  TAULOC = WORK( IPW )
++                  TAULOC( 1 ) = WORK( IPW )
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C ) * v
+ *
+@@ -839,13 +839,13 @@ SUBROUTINE PDLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+      $                          WORK( IPW ), MAX( 1, MPC2 ), RDEST,
+      $                          ICCOL2 )
+                   IF( MYCOL.EQ.ICCOL1 )
+-     $               CALL DAXPY( MPC2, -TAULOC, WORK( IPW ), 1,
++     $               CALL DAXPY( MPC2, -TAULOC( 1 ), WORK( IPW ), 1,
+      $                           C( IOFFC1 ), 1 )
+ *
+ *                 sub( C ) := sub( C ) - w * v'
+ *
+-                  CALL DGER( MPC2, NQV, -TAULOC, WORK( IPW ), 1, WORK,
+-     $                       1, C( IOFFC2 ), LDC )
++                  CALL DGER( MPC2, NQV, -TAULOC( 1 ), WORK( IPW ), 1,
++     $                       WORK, 1, C( IOFFC2 ), LDC )
+                END IF
+ *
+             ELSE
+@@ -864,7 +864,7 @@ SUBROUTINE PDLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                   CALL DGEBS2D( ICTXT, 'Rowwise', ' ', 1, 1, TAU( JJV ),
+      $                          1 )
+-                  TAULOC = TAU( JJV )
++                  TAULOC( 1 ) = TAU( JJV )
+ *
+                ELSE
+ *
+@@ -873,7 +873,7 @@ SUBROUTINE PDLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C ) * v
+ *
+@@ -892,13 +892,13 @@ SUBROUTINE PDLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+      $                          WORK( IPW ), MAX( 1, MPC2 ), RDEST,
+      $                          ICCOL2 )
+                   IF( MYCOL.EQ.ICCOL1 )
+-     $               CALL DAXPY( MPC2, -TAULOC, WORK( IPW ), 1,
++     $               CALL DAXPY( MPC2, -TAULOC( 1 ), WORK( IPW ), 1,
+      $                           C( IOFFC1 ), 1 )
+ *
+ *                 sub( C ) := sub( C ) - w * v'
+ *
+-                  CALL DGER( MPC2, NQV, -TAULOC, WORK( IPW ), 1, WORK,
+-     $                       1, C( IOFFC2 ), LDC )
++                  CALL DGER( MPC2, NQV, -TAULOC( 1 ), WORK( IPW ), 1,
++     $                       WORK, 1, C( IOFFC2 ), LDC )
+                END IF
+ *
+             END IF
+diff --git a/SRC/pdlawil.f b/SRC/pdlawil.f
+index 90a4d74..e8bc3a0 100644
+--- a/SRC/pdlawil.f
++++ b/SRC/pdlawil.f
+@@ -120,10 +120,10 @@ SUBROUTINE PDLAWIL( II, JJ, M, A, DESCA, H44, H33, H43H34, V )
+       INTEGER            CONTXT, DOWN, HBL, ICOL, IROW, JSRC, LDA, LEFT,
+      $                   MODKM1, MYCOL, MYROW, NPCOL, NPROW, NUM, RIGHT,
+      $                   RSRC, UP
+-      DOUBLE PRECISION   H11, H12, H21, H22, H33S, H44S, S, V1, V2, V3
++      DOUBLE PRECISION   H22, H33S, H44S, S, V1, V2
+ *     ..
+ *     .. Local Arrays ..
+-      DOUBLE PRECISION   BUF( 4 )
++      DOUBLE PRECISION   BUF( 4 ), H11( 1 ), H12( 1 ), H21( 1 ), V3( 1 )
+ *     ..
+ *     .. External Subroutines ..
+       EXTERNAL           BLACS_GRIDINFO, DGERV2D, DGESD2D, INFOG2L
+@@ -170,18 +170,18 @@ SUBROUTINE PDLAWIL( II, JJ, M, A, DESCA, H44, H33, H43H34, V )
+             IF( NPCOL.GT.1 ) THEN
+                CALL DGERV2D( CONTXT, 1, 1, V3, 1, MYROW, LEFT )
+             ELSE
+-               V3 = A( ( ICOL-2 )*LDA+IROW )
++               V3( 1 ) = A( ( ICOL-2 )*LDA+IROW )
+             END IF
+             IF( NUM.GT.1 ) THEN
+                CALL DGERV2D( CONTXT, 4, 1, BUF, 4, UP, LEFT )
+-               H11 = BUF( 1 )
+-               H21 = BUF( 2 )
+-               H12 = BUF( 3 )
++               H11( 1 ) = BUF( 1 )
++               H21( 1 ) = BUF( 2 )
++               H12( 1 ) = BUF( 3 )
+                H22 = BUF( 4 )
+             ELSE
+-               H11 = A( ( ICOL-3 )*LDA+IROW-2 )
+-               H21 = A( ( ICOL-3 )*LDA+IROW-1 )
+-               H12 = A( ( ICOL-2 )*LDA+IROW-2 )
++               H11( 1 ) = A( ( ICOL-3 )*LDA+IROW-2 )
++               H21( 1 ) = A( ( ICOL-3 )*LDA+IROW-1 )
++               H12( 1 ) = A( ( ICOL-2 )*LDA+IROW-2 )
+                H22 = A( ( ICOL-2 )*LDA+IROW-1 )
+             END IF
+          END IF
+@@ -214,20 +214,20 @@ SUBROUTINE PDLAWIL( II, JJ, M, A, DESCA, H44, H33, H43H34, V )
+             IF( NUM.GT.1 ) THEN
+                CALL DGERV2D( CONTXT, 1, 1, H11, 1, UP, LEFT )
+             ELSE
+-               H11 = A( ( ICOL-3 )*LDA+IROW-2 )
++               H11( 1 ) = A( ( ICOL-3 )*LDA+IROW-2 )
+             END IF
+             IF( NPROW.GT.1 ) THEN
+                CALL DGERV2D( CONTXT, 1, 1, H12, 1, UP, MYCOL )
+             ELSE
+-               H12 = A( ( ICOL-2 )*LDA+IROW-2 )
++               H12( 1 ) = A( ( ICOL-2 )*LDA+IROW-2 )
+             END IF
+             IF( NPCOL.GT.1 ) THEN
+                CALL DGERV2D( CONTXT, 1, 1, H21, 1, MYROW, LEFT )
+             ELSE
+-               H21 = A( ( ICOL-3 )*LDA+IROW-1 )
++               H21( 1 ) = A( ( ICOL-3 )*LDA+IROW-1 )
+             END IF
+             H22 = A( ( ICOL-2 )*LDA+IROW-1 )
+-            V3 = A( ( ICOL-2 )*LDA+IROW )
++            V3( 1 ) = A( ( ICOL-2 )*LDA+IROW )
+          END IF
+       END IF
+       IF( ( MYROW.NE.II ) .OR. ( MYCOL.NE.JJ ) )
+@@ -236,24 +236,24 @@ SUBROUTINE PDLAWIL( II, JJ, M, A, DESCA, H44, H33, H43H34, V )
+       IF( MODKM1.GT.1 ) THEN
+          CALL INFOG2L( M+2, M+2, DESCA, NPROW, NPCOL, MYROW, MYCOL,
+      $                 IROW, ICOL, RSRC, JSRC )
+-         H11 = A( ( ICOL-3 )*LDA+IROW-2 )
+-         H21 = A( ( ICOL-3 )*LDA+IROW-1 )
+-         H12 = A( ( ICOL-2 )*LDA+IROW-2 )
++         H11( 1 ) = A( ( ICOL-3 )*LDA+IROW-2 )
++         H21( 1 ) = A( ( ICOL-3 )*LDA+IROW-1 )
++         H12( 1 ) = A( ( ICOL-2 )*LDA+IROW-2 )
+          H22 = A( ( ICOL-2 )*LDA+IROW-1 )
+-         V3 = A( ( ICOL-2 )*LDA+IROW )
++         V3( 1 ) = A( ( ICOL-2 )*LDA+IROW )
+       END IF
+ *
+-      H44S = H44 - H11
+-      H33S = H33 - H11
+-      V1 = ( H33S*H44S-H43H34 ) / H21 + H12
+-      V2 = H22 - H11 - H33S - H44S
+-      S = ABS( V1 ) + ABS( V2 ) + ABS( V3 )
++      H44S = H44 - H11( 1 )
++      H33S = H33 - H11( 1 )
++      V1 = ( H33S*H44S-H43H34 ) / H21( 1 ) + H12( 1 )
++      V2 = H22 - H11( 1 ) - H33S - H44S
++      S = ABS( V1 ) + ABS( V2 ) + ABS( V3( 1 ) )
+       V1 = V1 / S
+       V2 = V2 / S
+-      V3 = V3 / S
++      V3( 1 ) = V3( 1 ) / S
+       V( 1 ) = V1
+       V( 2 ) = V2
+-      V( 3 ) = V3
++      V( 3 ) = V3( 1 )
+ *
+       RETURN
+ *
+diff --git a/SRC/pdstebz.f b/SRC/pdstebz.f
+index e7006f9..bf4dacc 100644
+--- a/SRC/pdstebz.f
++++ b/SRC/pdstebz.f
+@@ -246,14 +246,14 @@ SUBROUTINE PDSTEBZ( ICTXT, RANGE, ORDER, N, VL, VU, IL, IU,
+      $                   ITMP2, J, JB, K, LAST, LEXTRA, LREQ, MYCOL,
+      $                   MYROW, NALPHA, NBETA, NCMP, NEIGINT, NEXT, NGL,
+      $                   NGLOB, NGU, NINT, NPCOL, NPROW, OFFSET,
+-     $                   ONEDCONTEXT, P, PREV, REXTRA, RREQ, SELF,
+-     $                   TORECV
++     $                   ONEDCONTEXT, P, PREV, REXTRA, RREQ, SELF
+       DOUBLE PRECISION   ALPHA, ATOLI, BETA, BNORM, DRECV, DSEND, GL,
+      $                   GU, INITVL, INITVU, LSAVE, MID, PIVMIN, RELTOL,
+      $                   SAFEMN, TMP1, TMP2, TNORM, ULP
+ *     ..
+ *     .. Local Arrays ..
+       INTEGER            IDUM( 5, 2 )
++      INTEGER            TORECV( 1, 1 )
+ *     ..
+ *     .. Executable Statements ..
+ *       This is just to keep ftnchek happy
+@@ -784,14 +784,14 @@ SUBROUTINE PDSTEBZ( ICTXT, RANGE, ORDER, N, VL, VU, IL, IU,
+          ELSE
+             CALL IGEBR2D( ONEDCONTEXT, 'ALL', ' ', 1, 1, TORECV, 1, 0,
+      $                    I-1 )
+-            IF( TORECV.NE.0 ) THEN
+-               CALL IGEBR2D( ONEDCONTEXT, 'ALL', ' ', TORECV, 1, IWORK,
+-     $                       TORECV, 0, I-1 )
+-               CALL DGEBR2D( ONEDCONTEXT, 'ALL', ' ', TORECV, 1, WORK,
+-     $                       TORECV, 0, I-1 )
+-               CALL IGEBR2D( ONEDCONTEXT, 'ALL', ' ', TORECV, 1,
+-     $                       IWORK( N+1 ), TORECV, 0, I-1 )
+-               DO 120 J = 1, TORECV
++            IF( TORECV( 1, 1 ).NE.0 ) THEN
++               CALL IGEBR2D( ONEDCONTEXT, 'ALL', ' ', TORECV( 1, 1 ), 1,
++     $                       IWORK, TORECV( 1, 1 ), 0, I-1 )
++               CALL DGEBR2D( ONEDCONTEXT, 'ALL', ' ', TORECV( 1, 1 ), 1,
++     $                       WORK, TORECV( 1, 1 ), 0, I-1 )
++               CALL IGEBR2D( ONEDCONTEXT, 'ALL', ' ', TORECV( 1, 1 ), 1,
++     $                       IWORK( N+1 ), TORECV( 1, 1 ), 0, I-1 )
++               DO 120 J = 1, TORECV( 1, 1 )
+                   W( IWORK( J ) ) = WORK( J )
+                   IBLOCK( IWORK( J ) ) = IWORK( N+J )
+   120          CONTINUE
+diff --git a/SRC/pdtrord.f b/SRC/pdtrord.f
+index 1f37d8e..3870574 100644
+--- a/SRC/pdtrord.f
++++ b/SRC/pdtrord.f
+@@ -328,12 +328,13 @@ SUBROUTINE PDTRORD( COMPQ, SELECT, PARA, N, T, IT, JT,
+      $                   EAST, WEST, ILOC4, SOUTH, NORTH, INDXS,
+      $                   ITT, JTT, ILEN, DLEN, INDXE, TRSRC1, TCSRC1,
+      $                   TRSRC2, TCSRC2, ILOS, DIR, TLIHI, TLILO, TLSEL,
+-     $                   ROUND, LAST, WIN0S, WIN0E, WINE, MMAX, MMIN
++     $                   ROUND, LAST, WIN0S, WIN0E, WINE
+       DOUBLE PRECISION   ELEM, ELEM1, ELEM2, ELEM3, ELEM4, SN, CS, TMP,
+      $                   ELEM5
+ *     ..
+ *     .. Local Arrays ..
+-      INTEGER            IBUFF( 8 ), IDUM1( 1 ), IDUM2( 1 )
++      INTEGER            IBUFF( 8 ), IDUM1( 1 ), IDUM2( 1 ), MMAX( 1 ),
++     $                   MMIN( 1 ), INFODUM( 1 )
+ *     ..
+ *     .. External Functions ..
+       LOGICAL            LSAME
+@@ -483,16 +484,16 @@ SUBROUTINE PDTRORD( COMPQ, SELECT, PARA, N, T, IT, JT,
+                END IF
+                IF( SELECT(K).NE.0 ) M = M + 1
+  10         CONTINUE
+-            MMAX = M
+-            MMIN = M
++            MMAX( 1 ) = M
++            MMIN( 1 ) = M
+             IF( NPROCS.GT.1 )
+      $         CALL IGAMX2D( ICTXT, 'All', TOP, 1, 1, MMAX, 1, -1,
+      $              -1, -1, -1, -1 )
+             IF( NPROCS.GT.1 )
+      $         CALL IGAMN2D( ICTXT, 'All', TOP, 1, 1, MMIN, 1, -1,
+      $              -1, -1, -1, -1 )
+-            IF( MMAX.GT.MMIN ) THEN
+-               M = MMAX
++            IF( MMAX( 1 ).GT.MMIN( 1 ) ) THEN
++               M = MMAX( 1 )
+                IF( NPROCS.GT.1 )
+      $            CALL IGAMX2D( ICTXT, 'All', TOP, N, 1, SELECT, N,
+      $                 -1, -1, -1, -1, -1 )
+@@ -520,9 +521,11 @@ SUBROUTINE PDTRORD( COMPQ, SELECT, PARA, N, T, IT, JT,
+ *
+ *     Global maximum on info.
+ *
+-      IF( NPROCS.GT.1 )
+-     $   CALL IGAMX2D( ICTXT, 'All', TOP, 1, 1, INFO, 1, -1, -1, -1,
++      IF( NPROCS.GT.1 ) THEN
++         CALL IGAMX2D( ICTXT, 'All', TOP, 1, 1, INFODUM, 1, -1, -1, -1,
+      $        -1, -1 )
++         INFO = INFODUM( 1 )
++      END IF
+ *
+ *     Return if some argument is incorrect.
+ *
+@@ -1576,9 +1579,11 @@ SUBROUTINE PDTRORD( COMPQ, SELECT, PARA, N, T, IT, JT,
+ *        experienced a failure in the reordering.
+ *
+          MYIERR = IERR
+-         IF( NPROCS.GT.1 )
+-     $      CALL IGAMX2D( ICTXT, 'All', TOP, 1, 1, IERR, 1, -1,
++         IF( NPROCS.GT.1 ) THEN
++            CALL IGAMX2D( ICTXT, 'All', TOP, 1, 1, INFODUM, 1, -1,
+      $           -1, -1, -1, -1 )
++            IERR = INFODUM( 1 )
++         END IF
+ *
+          IF( IERR.NE.0 ) THEN
+ *
+@@ -1586,9 +1591,11 @@ SUBROUTINE PDTRORD( COMPQ, SELECT, PARA, N, T, IT, JT,
+ *           to swap.
+ *
+             IF( MYIERR.NE.0 ) INFO = MAX(1,I+KKS-1)
+-            IF( NPROCS.GT.1 )
+-     $         CALL IGAMX2D( ICTXT, 'All', TOP, 1, 1, INFO, 1, -1,
++            IF( NPROCS.GT.1 ) THEN
++               CALL IGAMX2D( ICTXT, 'All', TOP, 1, 1, INFODUM, 1, -1,
+      $              -1, -1, -1, -1 )
++               INFO = INFODUM( 1 )
++            END IF
+             GO TO 300
+          END IF
+ *
+@@ -3245,9 +3252,11 @@ SUBROUTINE PDTRORD( COMPQ, SELECT, PARA, N, T, IT, JT,
+ *        experienced a failure in the reordering.
+ *
+          MYIERR = IERR
+-         IF( NPROCS.GT.1 )
+-     $      CALL IGAMX2D( ICTXT, 'All', TOP, 1, 1, IERR, 1, -1,
++         IF( NPROCS.GT.1 ) THEN
++            CALL IGAMX2D( ICTXT, 'All', TOP, 1, 1, INFODUM, 1, -1,
+      $           -1, -1, -1, -1 )
++            IERR = INFODUM( 1 )
++         END IF
+ *
+          IF( IERR.NE.0 ) THEN
+ *
+@@ -3255,9 +3264,11 @@ SUBROUTINE PDTRORD( COMPQ, SELECT, PARA, N, T, IT, JT,
+ *           to swap.
+ *
+             IF( MYIERR.NE.0 ) INFO = MAX(1,I+KKS-1)
+-            IF( NPROCS.GT.1 )
+-     $         CALL IGAMX2D( ICTXT, 'All', TOP, 1, 1, INFO, 1, -1,
++            IF( NPROCS.GT.1 ) THEN
++               CALL IGAMX2D( ICTXT, 'All', TOP, 1, 1, INFODUM, 1, -1,
+      $              -1, -1, -1, -1 )
++               IERR = INFODUM( 1 )
++            END IF
+             GO TO 300
+          END IF
+ *
+diff --git a/SRC/pdtrsen.f b/SRC/pdtrsen.f
+index 78c5599..c65ea91 100644
+--- a/SRC/pdtrsen.f
++++ b/SRC/pdtrsen.f
+@@ -354,13 +354,15 @@ SUBROUTINE PDTRSEN( JOB, COMPQ, SELECT, PARA, N, T, IT, JT,
+       LOGICAL            LQUERY, WANTBH, WANTQ, WANTS, WANTSP
+       INTEGER            ICOFFT12, ICTXT, IDUM1, IDUM2, IERR, ILOC1,
+      $                   IPW1, ITER, ITT, JLOC1, JTT, K, LIWMIN, LLDT,
+-     $                   LLDQ, LWMIN, MMAX, MMIN, MYROW, MYCOL, N1, N2,
++     $                   LLDQ, LWMIN, MYROW, MYCOL, N1, N2,
+      $                   NB, NOEXSY, NPCOL, NPROCS, NPROW, SPACE,
+      $                   T12ROWS, T12COLS, TCOLS, TCSRC, TROWS, TRSRC,
+      $                   WRK1, IWRK1, WRK2, IWRK2, WRK3, IWRK3
+-      DOUBLE PRECISION   DPDUM1, ELEM, EST, SCALE, RNORM
++      DOUBLE PRECISION   ELEM, EST, SCALE, RNORM
+ *     .. Local Arrays ..
+-      INTEGER            DESCT12( DLEN_ ), MBNB2( 2 )
++      INTEGER            DESCT12( DLEN_ ), MBNB2( 2 ), MMAX( 1 ),
++     $                   MMIN( 1 )
++      DOUBLE PRECISION   DPDUM1( 1 )
+ *     ..
+ *     .. External Functions ..
+       LOGICAL            LSAME
+@@ -521,16 +523,16 @@ SUBROUTINE PDTRSEN( JOB, COMPQ, SELECT, PARA, N, T, IT, JT,
+                END IF
+                IF( SELECT(K) ) M = M + 1
+  10         CONTINUE
+-            MMAX = M
+-            MMIN = M
++            MMAX( 1 ) = M
++            MMIN( 1 ) = M
+             IF( NPROCS.GT.1 )
+-     $           CALL IGAMX2D( ICTXT, 'All', TOP, 1, 1, MMAX, 1, -1,
+-     $                -1, -1, -1, -1 )
++     $           CALL IGAMX2D( ICTXT, 'All', TOP, 1, 1, MMAX( 1 ), 1,
++     $                -1, -1, -1, -1, -1 )
+             IF( NPROCS.GT.1 )
+-     $           CALL IGAMN2D( ICTXT, 'All', TOP, 1, 1, MMIN, 1, -1,
+-     $                -1, -1, -1, -1 )
+-            IF( MMAX.GT.MMIN ) THEN
+-               M = MMAX
++     $           CALL IGAMN2D( ICTXT, 'All', TOP, 1, 1, MMIN( 1 ), 1,
++     $                -1, -1, -1, -1, -1 )
++            IF( MMAX( 1 ).GT.MMIN( 1 ) ) THEN
++               M = MMAX( 1 )
+                IF( NPROCS.GT.1 )
+      $              CALL IGAMX2D( ICTXT, 'All', TOP, N, 1, IWORK, N,
+      $                   -1, -1, -1, -1, -1 )
+diff --git a/SRC/pshseqr.f b/SRC/pshseqr.f
+index 10eb24a..e8ecea9 100644
+--- a/SRC/pshseqr.f
++++ b/SRC/pshseqr.f
+@@ -259,11 +259,12 @@ SUBROUTINE PSHSEQR( JOB, COMPZ, N, ILO, IHI, H, DESCH, WR, WI, Z,
+      $                   HRSRC4, HCSRC4, LIWKOPT
+       LOGICAL            INITZ, LQUERY, WANTT, WANTZ, PAIR, BORDER
+       REAL               TMP1, TMP2, TMP3, TMP4, DUM1, DUM2, DUM3,
+-     $                   DUM4, ELEM1, ELEM2, ELEM3, ELEM4,
++     $                   DUM4, ELEM1, ELEM4,
+      $                   CS, SN, ELEM5, TMP, LWKOPT
+ *     ..
+ *     .. Local Arrays ..
+       INTEGER            DESCH2( DLEN_ )
++      REAL               ELEM2( 1 ), ELEM3( 1 )
+ *     ..
+ *     .. External Functions ..
+       INTEGER            PILAENVX, NUMROC, ICEIL
+@@ -566,28 +567,28 @@ SUBROUTINE PSHSEQR( JOB, COMPZ, N, ILO, IHI, H, DESCH, WR, WI, Z,
+                   IF( MYROW.EQ.HRSRC1 .AND. MYCOL.EQ.HCSRC1 ) THEN
+                      ELEM1 = H((JLOC1-1)*LLDH+ILOC1)
+                      IF( K.LT.N ) THEN
+-                        ELEM3 = H((JLOC1-1)*LLDH+ILOC1+1)
++                        ELEM3( 1 ) = H((JLOC1-1)*LLDH+ILOC1+1)
+                      ELSE
+-                        ELEM3 = ZERO
++                        ELEM3( 1 ) = ZERO
+                      END IF
+-                     IF( ELEM3.NE.ZERO ) THEN
+-                        ELEM2 = H((JLOC1)*LLDH+ILOC1)
++                     IF( ELEM3( 1 ).NE.ZERO ) THEN
++                        ELEM2( 1 ) = H((JLOC1)*LLDH+ILOC1)
+                         ELEM4 = H((JLOC1)*LLDH+ILOC1+1)
+-                        CALL SLANV2( ELEM1, ELEM2, ELEM3, ELEM4,
+-     $                       WR( K ), WI( K ), WR( K+1 ), WI( K+1 ),
+-     $                       SN, CS )
++                        CALL SLANV2( ELEM1, ELEM2( 1 ), ELEM3( 1 ),
++     $                       ELEM4, WR( K ), WI( K ), WR( K+1 ),
++     $                       WI( K+1 ), SN, CS )
+                         PAIR = .TRUE.
+                      ELSE
+                         IF( K.GT.1 ) THEN
+                            TMP = H((JLOC1-2)*LLDH+ILOC1)
+                            IF( TMP.NE.ZERO ) THEN
+                               ELEM1 = H((JLOC1-2)*LLDH+ILOC1-1)
+-                              ELEM2 = H((JLOC1-1)*LLDH+ILOC1-1)
+-                              ELEM3 = H((JLOC1-2)*LLDH+ILOC1)
++                              ELEM2( 1 ) = H((JLOC1-1)*LLDH+ILOC1-1)
++                              ELEM3( 1 ) = H((JLOC1-2)*LLDH+ILOC1)
+                               ELEM4 = H((JLOC1-1)*LLDH+ILOC1)
+-                              CALL SLANV2( ELEM1, ELEM2, ELEM3,
+-     $                             ELEM4, WR( K-1 ), WI( K-1 ),
+-     $                             WR( K ), WI( K ), SN, CS )
++                              CALL SLANV2( ELEM1, ELEM2( 1 ),
++     $                             ELEM3( 1 ), ELEM4, WR( K-1 ),
++     $                             WI( K-1 ), WR( K ), WI( K ), SN, CS )
+                            ELSE
+                               WR( K ) = ELEM1
+                            END IF
+@@ -620,12 +621,12 @@ SUBROUTINE PSHSEQR( JOB, COMPZ, N, ILO, IHI, H, DESCH, WR, WI, Z,
+             CALL INFOG2L( K+1, K+1, DESCH, NPROW, NPCOL, MYROW, MYCOL,
+      $           ILOC4, JLOC4, HRSRC4, HCSRC4 )
+             IF( MYROW.EQ.HRSRC2 .AND. MYCOL.EQ.HCSRC2 ) THEN
+-               ELEM2 = H((JLOC2-1)*LLDH+ILOC2)
++               ELEM2( 1 ) = H((JLOC2-1)*LLDH+ILOC2)
+                IF( HRSRC1.NE.HRSRC2 .OR. HCSRC1.NE.HCSRC2 )
+      $            CALL SGESD2D( ICTXT, 1, 1, ELEM2, 1, HRSRC1, HCSRC1)
+             END IF
+             IF( MYROW.EQ.HRSRC3 .AND. MYCOL.EQ.HCSRC3 ) THEN
+-               ELEM3 = H((JLOC3-1)*LLDH+ILOC3)
++               ELEM3( 1 ) = H((JLOC3-1)*LLDH+ILOC3)
+                IF( HRSRC1.NE.HRSRC3 .OR. HCSRC1.NE.HCSRC3 )
+      $            CALL SGESD2D( ICTXT, 1, 1, ELEM3, 1, HRSRC1, HCSRC1)
+             END IF
+@@ -651,8 +652,9 @@ SUBROUTINE PSHSEQR( JOB, COMPZ, N, ILO, IHI, H, DESCH, WR, WI, Z,
+                ELEM5 = WORK(2)
+                IF( ELEM5.EQ.ZERO ) THEN
+                   IF( WR( K ).EQ.ZERO .AND. WI( K ).EQ.ZERO ) THEN
+-                     CALL SLANV2( ELEM1, ELEM2, ELEM3, ELEM4, WR( K ),
+-     $                    WI( K ), WR( K+1 ), WI( K+1 ), SN, CS )
++                     CALL SLANV2( ELEM1, ELEM2( 1 ), ELEM3( 1 ), ELEM4,
++     $                    WR( K ), WI( K ), WR( K+1 ), WI( K+1 ), SN,
++     $                    CS )
+                   ELSEIF( WR( K+1 ).EQ.ZERO .AND. WI( K+1 ).EQ.ZERO )
+      $                 THEN
+                      WR( K+1 ) = ELEM4
+diff --git a/SRC/pslacon.f b/SRC/pslacon.f
+index 20d27ff..673bf1a 100644
+--- a/SRC/pslacon.f
++++ b/SRC/pslacon.f
+@@ -160,10 +160,12 @@ SUBROUTINE PSLACON( N, V, IV, JV, DESCV, X, IX, JX, DESCX, ISGN,
+       INTEGER            I, ICTXT, IFLAG, IIVX, IMAXROW, IOFFVX, IROFF,
+      $                   ITER, IVXCOL, IVXROW, J, JLAST, JJVX, JUMP,
+      $                   K, MYCOL, MYROW, NP, NPCOL, NPROW
+-      REAL               ALTSGN, ESTOLD, JLMAX, TEMP, XMAX
++      REAL               ALTSGN, ESTOLD, JLMAX, XMAX
+ *     ..
+ *     .. Local Arrays ..
+       REAL               WORK( 2 )
++      REAL               ESTWORK( 1 )
++      REAL               TEMP( 1 )
+ *     ..
+ *     .. External Subroutines ..
+       EXTERNAL           BLACS_GRIDINFO, IGSUM2D, INFOG2L, PSAMAX,
+@@ -184,6 +186,7 @@ SUBROUTINE PSLACON( N, V, IV, JV, DESCV, X, IX, JX, DESCX, ISGN,
+ *
+ *     Get grid parameters.
+ *
++      ESTWORK( 1 ) = EST
+       ICTXT = DESCX( CTXT_ )
+       CALL BLACS_GRIDINFO( ICTXT, NPROW, NPCOL, MYROW, MYCOL )
+ *
+@@ -215,21 +218,21 @@ SUBROUTINE PSLACON( N, V, IV, JV, DESCV, X, IX, JX, DESCX, ISGN,
+       IF( N.EQ.1 ) THEN
+          IF( MYROW.EQ.IVXROW ) THEN
+             V( IOFFVX ) = X( IOFFVX )
+-            EST = ABS( V( IOFFVX ) )
+-            CALL SGEBS2D( ICTXT, 'Columnwise', ' ', 1, 1, EST, 1 )
++            ESTWORK( 1 ) = ABS( V( IOFFVX ) )
++            CALL SGEBS2D( ICTXT, 'Columnwise', ' ', 1, 1, ESTWORK, 1 )
+          ELSE
+-            CALL SGEBR2D( ICTXT, 'Columnwise', ' ', 1, 1, EST, 1,
++            CALL SGEBR2D( ICTXT, 'Columnwise', ' ', 1, 1, ESTWORK, 1,
+      $                    IVXROW, MYCOL )
+          END IF
+ *        ... QUIT
+          GO TO 150
+       END IF
+-      CALL PSASUM( N, EST, X, IX, JX, DESCX, 1 )
++      CALL PSASUM( N, ESTWORK( 1 ), X, IX, JX, DESCX, 1 )
+       IF( DESCX( M_ ).EQ.1 .AND. N.EQ.1 ) THEN
+          IF( MYROW.EQ.IVXROW ) THEN
+-            CALL SGEBS2D( ICTXT, 'Columnwise', ' ', 1, 1, EST, 1 )
++            CALL SGEBS2D( ICTXT, 'Columnwise', ' ', 1, 1, ESTWORK, 1 )
+          ELSE
+-            CALL SGEBR2D( ICTXT, 'Columnwise', ' ', 1, 1, EST, 1,
++            CALL SGEBR2D( ICTXT, 'Columnwise', ' ', 1, 1, ESTWORK, 1,
+      $                    IVXROW, MYCOL )
+          END IF
+       END IF
+@@ -281,13 +284,13 @@ SUBROUTINE PSLACON( N, V, IV, JV, DESCV, X, IX, JX, DESCX, ISGN,
+ *
+    70 CONTINUE
+       CALL SCOPY( NP, X( IOFFVX ), 1, V( IOFFVX ), 1 )
+-      ESTOLD = EST
+-      CALL PSASUM( N, EST, V, IV, JV, DESCV, 1 )
++      ESTOLD = ESTWORK( 1 )
++      CALL PSASUM( N, ESTWORK( 1 ), V, IV, JV, DESCV, 1 )
+       IF( DESCV( M_ ).EQ.1 .AND. N.EQ.1 ) THEN
+          IF( MYROW.EQ.IVXROW ) THEN
+-            CALL SGEBS2D( ICTXT, 'Columnwise', ' ', 1, 1, EST, 1 )
++            CALL SGEBS2D( ICTXT, 'Columnwise', ' ', 1, 1, ESTWORK, 1 )
+          ELSE
+-            CALL SGEBR2D( ICTXT, 'Columnwise', ' ', 1, 1, EST, 1,
++            CALL SGEBR2D( ICTXT, 'Columnwise', ' ', 1, 1, ESTWORK, 1,
+      $                    IVXROW, MYCOL )
+          END IF
+       END IF
+@@ -305,7 +308,7 @@ SUBROUTINE PSLACON( N, V, IV, JV, DESCV, X, IX, JX, DESCX, ISGN,
+ *     REPEATED SIGN VECTOR DETECTED, HENCE ALGORITHM HAS CONVERGED.
+ *     ALONG WITH IT, TEST FOR CYCLING.
+ *
+-      IF( IFLAG.EQ.0 .OR. EST.LE.ESTOLD )
++      IF( IFLAG.EQ.0 .OR. ESTWORK( 1 ).LE.ESTOLD )
+      $   GO TO 120
+ *
+       DO 100 I = IOFFVX, IOFFVX+NP-1
+@@ -361,7 +364,7 @@ SUBROUTINE PSLACON( N, V, IV, JV, DESCV, X, IX, JX, DESCX, ISGN,
+ *     X HAS BEEN OVERWRITTEN BY A*X
+ *
+   140 CONTINUE
+-      CALL PSASUM( N, TEMP, X, IX, JX, DESCX, 1 )
++      CALL PSASUM( N, TEMP( 1 ), X, IX, JX, DESCX, 1 )
+       IF( DESCX( M_ ).EQ.1 .AND. N.EQ.1 ) THEN
+          IF( MYROW.EQ.IVXROW ) THEN
+             CALL SGEBS2D( ICTXT, 'Columnwise', ' ', 1, 1, TEMP, 1 )
+@@ -370,15 +373,16 @@ SUBROUTINE PSLACON( N, V, IV, JV, DESCV, X, IX, JX, DESCX, ISGN,
+      $                    IVXROW, MYCOL )
+          END IF
+       END IF
+-      TEMP = TWO*( TEMP / REAL( 3*N ) )
+-      IF( TEMP.GT.EST ) THEN
++      TEMP( 1 ) = TWO*( TEMP( 1 ) / REAL( 3*N ) )
++      IF( TEMP( 1 ).GT.ESTWORK( 1 ) ) THEN
+          CALL SCOPY( NP, X( IOFFVX ), 1, V( IOFFVX ), 1 )
+-         EST = TEMP
++         ESTWORK( 1 ) = TEMP( 1 )
+       END IF
+ *
+   150 CONTINUE
+       KASE = 0
+ *
++      EST = ESTWORK( 1 )
+       RETURN
+ *
+ *     End of PSLACON
+diff --git a/SRC/pslarf.f b/SRC/pslarf.f
+index c1d3a15..39de0ed 100644
+--- a/SRC/pslarf.f
++++ b/SRC/pslarf.f
+@@ -241,7 +241,7 @@ SUBROUTINE PSLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+      $                   IOFFV, IPW, IROFF, IVCOL, IVROW, JJC, JJV, LDC,
+      $                   LDV, MYCOL, MYROW, MP, NCC, NCV, NPCOL, NPROW,
+      $                   NQ, RDEST
+-      REAL               TAULOC
++      REAL               TAULOC( 1 )
+ *     ..
+ *     .. External Subroutines ..
+       EXTERNAL           BLACS_GRIDINFO, INFOG2L, PB_TOPGET, PBSTRNV,
+@@ -335,7 +335,7 @@ SUBROUTINE PSLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                      CALL SGEBS2D( ICTXT, 'Columnwise', ' ', 1, 1,
+      $                             TAU( IIV ), 1 )
+-                     TAULOC = TAU( IIV )
++                     TAULOC( 1 ) = TAU( IIV )
+ *
+                   ELSE
+ *
+@@ -344,7 +344,7 @@ SUBROUTINE PSLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                   END IF
+ *
+-                  IF( TAULOC.NE.ZERO ) THEN
++                  IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                    w := sub( C )' * v
+ *
+@@ -362,8 +362,8 @@ SUBROUTINE PSLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+ *                    sub( C ) := sub( C ) - v * w'
+ *
+-                     CALL SGER( MP, NQ, -TAULOC, WORK, 1, WORK( IPW ),
+-     $                          1, C( IOFFC ), LDC )
++                     CALL SGER( MP, NQ, -TAULOC( 1 ), WORK, 1,
++     $                          WORK( IPW ), 1, C( IOFFC ), LDC )
+                   END IF
+ *
+                END IF
+@@ -378,9 +378,9 @@ SUBROUTINE PSLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                   IF( MYCOL.EQ.ICCOL ) THEN
+ *
+-                     TAULOC = TAU( JJV )
++                     TAULOC( 1 ) = TAU( JJV )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C )' * v
+ *
+@@ -397,8 +397,8 @@ SUBROUTINE PSLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+ *                       sub( C ) := sub( C ) - v * w'
+ *
+-                        CALL SGER( MP, NQ, -TAULOC, V( IOFFV ), 1, WORK,
+-     $                             1, C( IOFFC ), LDC )
++                        CALL SGER( MP, NQ, -TAULOC( 1 ), V( IOFFV ), 1,
++     $                             WORK, 1, C( IOFFC ), LDC )
+                      END IF
+ *
+                   END IF
+@@ -420,9 +420,9 @@ SUBROUTINE PSLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+                      IPW = MP+1
+                      CALL SGERV2D( ICTXT, IPW, 1, WORK, IPW, MYROW,
+      $                             IVCOL )
+-                     TAULOC = WORK( IPW )
++                     TAULOC( 1 ) = WORK( IPW )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C )' * v
+ *
+@@ -440,7 +440,7 @@ SUBROUTINE PSLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+ *                       sub( C ) := sub( C ) - v * w'
+ *
+-                        CALL SGER( MP, NQ, -TAULOC, WORK, 1,
++                        CALL SGER( MP, NQ, -TAULOC( 1 ), WORK, 1,
+      $                             WORK( IPW ), 1, C( IOFFC ), LDC )
+                      END IF
+ *
+@@ -470,7 +470,7 @@ SUBROUTINE PSLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                   CALL SGEBS2D( ICTXT, 'Columnwise', ' ', 1, 1,
+      $                          TAU( IIV ), 1 )
+-                  TAULOC = TAU( IIV )
++                  TAULOC( 1 ) = TAU( IIV )
+ *
+                ELSE
+ *
+@@ -479,7 +479,7 @@ SUBROUTINE PSLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C )' * v
+ *
+@@ -499,8 +499,8 @@ SUBROUTINE PSLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *                 sub( C ) := sub( C ) - v * w'
+ *
+                   IF( IOFFC.GT.0 )
+-     $               CALL SGER( MP, NQ, -TAULOC, WORK, 1, WORK( IPW ),
+-     $                          1, C( IOFFC ), LDC )
++     $               CALL SGER( MP, NQ, -TAULOC( 1 ), WORK, 1,
++     $                          WORK( IPW ), 1, C( IOFFC ), LDC )
+                END IF
+ *
+             ELSE
+@@ -515,18 +515,18 @@ SUBROUTINE PSLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+                   WORK(IPW) = TAU( JJV )
+                   CALL SGEBS2D( ICTXT, 'Rowwise', ROWBTOP, IPW, 1,
+      $                          WORK, IPW )
+-                  TAULOC = TAU( JJV )
++                  TAULOC( 1 ) = TAU( JJV )
+ *
+                ELSE
+ *
+                   IPW = MP+1
+                   CALL SGEBR2D( ICTXT, 'Rowwise', ROWBTOP, IPW, 1, WORK,
+      $                          IPW, MYROW, IVCOL )
+-                  TAULOC = WORK( IPW )
++                  TAULOC( 1 ) = WORK( IPW )
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C )' * v
+ *
+@@ -546,8 +546,8 @@ SUBROUTINE PSLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *                 sub( C ) := sub( C ) - v * w'
+ *
+                   IF( IOFFC.GT.0 )
+-     $               CALL SGER( MP, NQ, -TAULOC, WORK, 1, WORK( IPW ),
+-     $                          1, C( IOFFC ), LDC )
++     $               CALL SGER( MP, NQ, -TAULOC( 1 ), WORK, 1,
++     $                          WORK( IPW ), 1, C( IOFFC ), LDC )
+                END IF
+ *
+             END IF
+@@ -576,9 +576,9 @@ SUBROUTINE PSLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                   IF( MYROW.EQ.ICROW ) THEN
+ *
+-                     TAULOC = TAU( IIV )
++                     TAULOC( 1 ) = TAU( IIV )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C ) * v
+ *
+@@ -596,7 +596,7 @@ SUBROUTINE PSLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *                       sub( C ) := sub( C ) - w * v'
+ *
+                         IF( IOFFV.GT.0 .AND. IOFFC.GT.0 )
+-     $                     CALL SGER( MP, NQ, -TAULOC, WORK, 1,
++     $                     CALL SGER( MP, NQ, -TAULOC( 1 ), WORK, 1,
+      $                                V( IOFFV ), LDV, C( IOFFC ), LDC )
+                      END IF
+ *
+@@ -619,9 +619,9 @@ SUBROUTINE PSLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+                      IPW = NQ+1
+                      CALL SGERV2D( ICTXT, IPW, 1, WORK, IPW, IVROW,
+      $                             MYCOL )
+-                     TAULOC = WORK( IPW )
++                     TAULOC( 1 ) = WORK( IPW )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C ) * v
+ *
+@@ -639,7 +639,7 @@ SUBROUTINE PSLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+ *                       sub( C ) := sub( C ) - w * v'
+ *
+-                        CALL SGER( MP, NQ, -TAULOC, WORK( IPW ), 1,
++                        CALL SGER( MP, NQ, -TAULOC( 1 ), WORK( IPW ), 1,
+      $                             WORK, 1, C( IOFFC ), LDC )
+                      END IF
+ *
+@@ -665,7 +665,7 @@ SUBROUTINE PSLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                      CALL SGEBS2D( ICTXT, 'Rowwise', ' ', 1, 1,
+      $                             TAU( JJV ), 1 )
+-                     TAULOC = TAU( JJV )
++                     TAULOC( 1 ) = TAU( JJV )
+ *
+                   ELSE
+ *
+@@ -674,7 +674,7 @@ SUBROUTINE PSLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                   END IF
+ *
+-                  IF( TAULOC.NE.ZERO ) THEN
++                  IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                    w := sub( C ) * v
+ *
+@@ -692,8 +692,8 @@ SUBROUTINE PSLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+ *                    sub( C ) := sub( C ) - w * v'
+ *
+-                     CALL SGER( MP, NQ, -TAULOC, WORK( IPW ), 1, WORK,
+-     $                          1, C( IOFFC ), LDC )
++                     CALL SGER( MP, NQ, -TAULOC( 1 ), WORK( IPW ), 1
++     $                         , WORK, 1, C( IOFFC ), LDC )
+                   END IF
+ *
+                END IF
+@@ -718,18 +718,18 @@ SUBROUTINE PSLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+                   WORK(IPW) = TAU( IIV )
+                   CALL SGEBS2D( ICTXT, 'Columnwise', COLBTOP, IPW, 1,
+      $                          WORK, IPW )
+-                  TAULOC = TAU( IIV )
++                  TAULOC( 1 ) = TAU( IIV )
+ *
+                ELSE
+ *
+                   IPW = NQ+1
+                   CALL SGEBR2D( ICTXT, 'Columnwise', COLBTOP, IPW, 1,
+      $                          WORK, IPW, IVROW, MYCOL )
+-                  TAULOC = WORK( IPW )
++                  TAULOC( 1 ) = WORK( IPW )
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C ) * v
+ *
+@@ -748,8 +748,8 @@ SUBROUTINE PSLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *                 sub( C ) := sub( C ) - w * v'
+ *
+                   IF( IOFFC.GT.0 )
+-     $               CALL SGER( MP, NQ, -TAULOC, WORK( IPW ), 1, WORK,
+-     $                          1, C( IOFFC ), LDC )
++     $               CALL SGER( MP, NQ, -TAULOC( 1 ), WORK( IPW ), 1,
++     $                          WORK, 1, C( IOFFC ), LDC )
+                END IF
+ *
+             ELSE
+@@ -768,7 +768,7 @@ SUBROUTINE PSLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                   CALL SGEBS2D( ICTXT, 'Rowwise', ' ', 1, 1, TAU( JJV ),
+      $                          1 )
+-                  TAULOC = TAU( JJV )
++                  TAULOC( 1 ) = TAU( JJV )
+ *
+                ELSE
+ *
+@@ -777,7 +777,7 @@ SUBROUTINE PSLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C ) * v
+ *
+@@ -795,8 +795,8 @@ SUBROUTINE PSLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+ *                 sub( C ) := sub( C ) - w * v'
+ *
+-                  CALL SGER( MP, NQ, -TAULOC, WORK( IPW ), 1, WORK, 1,
+-     $                       C( IOFFC ), LDC )
++                  CALL SGER( MP, NQ, -TAULOC( 1 ), WORK( IPW ), 1, WORK,
++     $                       1, C( IOFFC ), LDC )
+                END IF
+ *
+             END IF
+diff --git a/SRC/pslarz.f b/SRC/pslarz.f
+index aa70db7..8901530 100644
+--- a/SRC/pslarz.f
++++ b/SRC/pslarz.f
+@@ -250,7 +250,7 @@ SUBROUTINE PSLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+      $                   IVCOL, IVROW, JJC1, JJC2, JJV, LDC, LDV, MPC2,
+      $                   MPV, MYCOL, MYROW, NCC, NCV, NPCOL, NPROW,
+      $                   NQC2, NQV, RDEST
+-      REAL               TAULOC
++      REAL               TAULOC( 1 )
+ *     ..
+ *     .. External Subroutines ..
+       EXTERNAL           BLACS_GRIDINFO, INFOG2L, PB_TOPGET, PBSTRNV,
+@@ -369,7 +369,7 @@ SUBROUTINE PSLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                      CALL SGEBS2D( ICTXT, 'Columnwise', ' ', 1, 1,
+      $                             TAU( IIV ), 1 )
+-                     TAULOC = TAU( IIV )
++                     TAULOC( 1 ) = TAU( IIV )
+ *
+                   ELSE
+ *
+@@ -378,7 +378,7 @@ SUBROUTINE PSLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                   END IF
+ *
+-                  IF( TAULOC.NE.ZERO ) THEN
++                  IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                    w := sub( C )' * v
+ *
+@@ -401,9 +401,9 @@ SUBROUTINE PSLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *                    sub( C ) := sub( C ) - v * w'
+ *
+                      IF( MYROW.EQ.ICROW1 )
+-     $                  CALL SAXPY( NQC2, -TAULOC, WORK( IPW ),
++     $                  CALL SAXPY( NQC2, -TAULOC( 1 ), WORK( IPW ),
+      $                              MAX( 1, NQC2 ), C( IOFFC1 ), LDC )
+-                     CALL SGER( MPV, NQC2, -TAULOC, WORK, 1,
++                     CALL SGER( MPV, NQC2, -TAULOC( 1 ), WORK, 1,
+      $                          WORK( IPW ), 1, C( IOFFC2 ), LDC )
+                   END IF
+ *
+@@ -419,9 +419,9 @@ SUBROUTINE PSLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                   IF( MYCOL.EQ.ICCOL2 ) THEN
+ *
+-                     TAULOC = TAU( JJV )
++                     TAULOC( 1 ) = TAU( JJV )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C )' * v
+ *
+@@ -444,11 +444,11 @@ SUBROUTINE PSLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *                       sub( C ) := sub( C ) - v * w'
+ *
+                         IF( MYROW.EQ.ICROW1 )
+-     $                     CALL SAXPY( NQC2, -TAULOC, WORK,
++     $                     CALL SAXPY( NQC2, -TAULOC( 1 ), WORK,
+      $                                 MAX( 1, NQC2 ), C( IOFFC1 ),
+      $                                 LDC )
+-                        CALL SGER( MPV, NQC2, -TAULOC, V( IOFFV ), 1,
+-     $                             WORK, 1, C( IOFFC2 ), LDC )
++                        CALL SGER( MPV, NQC2, -TAULOC( 1 ), V( IOFFV ),
++     $                             1, WORK, 1, C( IOFFC2 ), LDC )
+                      END IF
+ *
+                   END IF
+@@ -470,9 +470,9 @@ SUBROUTINE PSLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+                      IPW = MPV+1
+                      CALL SGERV2D( ICTXT, IPW, 1, WORK, IPW, MYROW,
+      $                             IVCOL )
+-                     TAULOC = WORK( IPW )
++                     TAULOC( 1 ) = WORK( IPW )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C )' * v
+ *
+@@ -495,10 +495,10 @@ SUBROUTINE PSLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *                       sub( C ) := sub( C ) - v * w'
+ *
+                         IF( MYROW.EQ.ICROW1 )
+-     $                     CALL SAXPY( NQC2, -TAULOC, WORK( IPW ),
++     $                     CALL SAXPY( NQC2, -TAULOC( 1 ), WORK( IPW ),
+      $                                 MAX( 1, NQC2 ), C( IOFFC1 ),
+      $                                 LDC )
+-                        CALL SGER( MPV, NQC2, -TAULOC, WORK, 1,
++                        CALL SGER( MPV, NQC2, -TAULOC( 1 ), WORK, 1,
+      $                             WORK( IPW ), 1, C( IOFFC2 ), LDC )
+                      END IF
+ *
+@@ -529,7 +529,7 @@ SUBROUTINE PSLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                   CALL SGEBS2D( ICTXT, 'Columnwise', ' ', 1, 1,
+      $                          TAU( IIV ), 1 )
+-                  TAULOC = TAU( IIV )
++                  TAULOC( 1 ) = TAU( IIV )
+ *
+                ELSE
+ *
+@@ -538,7 +538,7 @@ SUBROUTINE PSLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C )' * v
+ *
+@@ -561,10 +561,10 @@ SUBROUTINE PSLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *                 sub( C ) := sub( C ) - v * w'
+ *
+                   IF( MYROW.EQ.ICROW1 )
+-     $               CALL SAXPY( NQC2, -TAULOC, WORK( IPW ),
++     $               CALL SAXPY( NQC2, -TAULOC( 1 ), WORK( IPW ),
+      $                           MAX( 1, NQC2 ), C( IOFFC1 ), LDC )
+-                  CALL SGER( MPV, NQC2, -TAULOC, WORK, 1, WORK( IPW ),
+-     $                       1, C( IOFFC2 ), LDC )
++                  CALL SGER( MPV, NQC2, -TAULOC( 1 ), WORK, 1,
++     $                       WORK( IPW ), 1, C( IOFFC2 ), LDC )
+                END IF
+ *
+             ELSE
+@@ -579,18 +579,18 @@ SUBROUTINE PSLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+                   WORK( IPW ) = TAU( JJV )
+                   CALL SGEBS2D( ICTXT, 'Rowwise', ROWBTOP, IPW, 1,
+      $                          WORK, IPW )
+-                  TAULOC = TAU( JJV )
++                  TAULOC( 1 ) = TAU( JJV )
+ *
+                ELSE
+ *
+                   IPW = MPV+1
+                   CALL SGEBR2D( ICTXT, 'Rowwise', ROWBTOP, IPW, 1, WORK,
+      $                          IPW, MYROW, IVCOL )
+-                  TAULOC = WORK( IPW )
++                  TAULOC( 1 ) = WORK( IPW )
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C )' * v
+ *
+@@ -613,10 +613,10 @@ SUBROUTINE PSLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *                 sub( C ) := sub( C ) - v * w'
+ *
+                   IF( MYROW.EQ.ICROW1 )
+-     $               CALL SAXPY( NQC2, -TAULOC, WORK( IPW ),
++     $               CALL SAXPY( NQC2, -TAULOC( 1 ), WORK( IPW ),
+      $                           MAX( 1, NQC2 ), C( IOFFC1 ), LDC )
+-                  CALL SGER( MPV, NQC2, -TAULOC, WORK, 1, WORK( IPW ),
+-     $                       1, C( IOFFC2 ), LDC )
++                  CALL SGER( MPV, NQC2, -TAULOC( 1 ), WORK, 1,
++     $                       WORK( IPW ), 1, C( IOFFC2 ), LDC )
+                END IF
+ *
+             END IF
+@@ -645,9 +645,9 @@ SUBROUTINE PSLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                   IF( MYROW.EQ.ICROW2 ) THEN
+ *
+-                     TAULOC = TAU( IIV )
++                     TAULOC( 1 ) = TAU( IIV )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C ) * v
+ *
+@@ -668,13 +668,13 @@ SUBROUTINE PSLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+      $                               ICCOL2 )
+ *
+                         IF( MYCOL.EQ.ICCOL1 )
+-     $                     CALL SAXPY( MPC2, -TAULOC, WORK, 1,
++     $                     CALL SAXPY( MPC2, -TAULOC( 1 ), WORK, 1,
+      $                                 C( IOFFC1 ), 1 )
+ *
+ *                       sub( C ) := sub( C ) - w * v'
+ *
+                         IF( MPC2.GT.0 .AND. NQV.GT.0 )
+-     $                     CALL SGER( MPC2, NQV, -TAULOC, WORK, 1,
++     $                     CALL SGER( MPC2, NQV, -TAULOC( 1 ), WORK, 1,
+      $                                V( IOFFV ), LDV, C( IOFFC2 ),
+      $                                LDC )
+                      END IF
+@@ -698,9 +698,9 @@ SUBROUTINE PSLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+                      IPW = NQV+1
+                      CALL SGERV2D( ICTXT, IPW, 1, WORK, IPW, IVROW,
+      $                             MYCOL )
+-                     TAULOC = WORK( IPW )
++                     TAULOC( 1 ) = WORK( IPW )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C ) * v
+ *
+@@ -719,13 +719,13 @@ SUBROUTINE PSLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+      $                                WORK( IPW ), MAX( 1, MPC2 ),
+      $                                RDEST, ICCOL2 )
+                         IF( MYCOL.EQ.ICCOL1 )
+-     $                     CALL SAXPY( MPC2, -TAULOC, WORK( IPW ), 1,
+-     $                                 C( IOFFC1 ), 1 )
++     $                     CALL SAXPY( MPC2, -TAULOC( 1 ), WORK( IPW ),
++     $                                 1, C( IOFFC1 ), 1 )
+ *
+ *                       sub( C ) := sub( C ) - w * v'
+ *
+-                        CALL SGER( MPC2, NQV, -TAULOC, WORK( IPW ), 1,
+-     $                             WORK, 1, C( IOFFC2 ), LDC )
++                        CALL SGER( MPC2, NQV, -TAULOC( 1 ), WORK( IPW ),
++     $                             1, WORK, 1, C( IOFFC2 ), LDC )
+                      END IF
+ *
+                   END IF
+@@ -750,7 +750,7 @@ SUBROUTINE PSLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                      CALL SGEBS2D( ICTXT, 'Rowwise', ' ', 1, 1,
+      $                             TAU( JJV ), 1 )
+-                     TAULOC = TAU( JJV )
++                     TAULOC( 1 ) = TAU( JJV )
+ *
+                   ELSE
+ *
+@@ -759,7 +759,7 @@ SUBROUTINE PSLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                   END IF
+ *
+-                  IF( TAULOC.NE.ZERO ) THEN
++                  IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                    w := sub( C ) * v
+ *
+@@ -778,12 +778,12 @@ SUBROUTINE PSLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+      $                             WORK( IPW ), MAX( 1, MPC2 ), RDEST,
+      $                             ICCOL2 )
+                      IF( MYCOL.EQ.ICCOL1 )
+-     $                  CALL SAXPY( MPC2, -TAULOC, WORK( IPW ), 1,
++     $                  CALL SAXPY( MPC2, -TAULOC( 1 ), WORK( IPW ), 1,
+      $                              C( IOFFC1 ), 1 )
+ *
+ *                    sub( C ) := sub( C ) - w * v'
+ *
+-                     CALL SGER( MPC2, NQV, -TAULOC, WORK( IPW ), 1,
++                     CALL SGER( MPC2, NQV, -TAULOC( 1 ), WORK( IPW ), 1,
+      $                          WORK, 1, C( IOFFC2 ), LDC )
+                   END IF
+ *
+@@ -808,18 +808,18 @@ SUBROUTINE PSLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+                   WORK( IPW ) = TAU( IIV )
+                   CALL SGEBS2D( ICTXT, 'Columnwise', COLBTOP, IPW, 1,
+      $                          WORK, IPW )
+-                  TAULOC = TAU( IIV )
++                  TAULOC( 1 ) = TAU( IIV )
+ *
+                ELSE
+ *
+                   IPW = NQV+1
+                   CALL SGEBR2D( ICTXT, 'Columnwise', COLBTOP, IPW, 1,
+      $                          WORK, IPW, IVROW, MYCOL )
+-                  TAULOC = WORK( IPW )
++                  TAULOC( 1 ) = WORK( IPW )
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C ) * v
+ *
+@@ -839,13 +839,13 @@ SUBROUTINE PSLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+      $                          WORK( IPW ), MAX( 1, MPC2 ), RDEST,
+      $                          ICCOL2 )
+                   IF( MYCOL.EQ.ICCOL1 )
+-     $               CALL SAXPY( MPC2, -TAULOC, WORK( IPW ), 1,
++     $               CALL SAXPY( MPC2, -TAULOC( 1 ), WORK( IPW ), 1,
+      $                           C( IOFFC1 ), 1 )
+ *
+ *                 sub( C ) := sub( C ) - w * v'
+ *
+-                  CALL SGER( MPC2, NQV, -TAULOC, WORK( IPW ), 1, WORK,
+-     $                       1, C( IOFFC2 ), LDC )
++                  CALL SGER( MPC2, NQV, -TAULOC( 1 ), WORK( IPW ), 1,
++     $                       WORK, 1, C( IOFFC2 ), LDC )
+                END IF
+ *
+             ELSE
+@@ -864,7 +864,7 @@ SUBROUTINE PSLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                   CALL SGEBS2D( ICTXT, 'Rowwise', ' ', 1, 1, TAU( JJV ),
+      $                          1 )
+-                  TAULOC = TAU( JJV )
++                  TAULOC( 1 ) = TAU( JJV )
+ *
+                ELSE
+ *
+@@ -873,7 +873,7 @@ SUBROUTINE PSLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C ) * v
+ *
+@@ -892,13 +892,13 @@ SUBROUTINE PSLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+      $                          WORK( IPW ), MAX( 1, MPC2 ), RDEST,
+      $                          ICCOL2 )
+                   IF( MYCOL.EQ.ICCOL1 )
+-     $               CALL SAXPY( MPC2, -TAULOC, WORK( IPW ), 1,
++     $               CALL SAXPY( MPC2, -TAULOC( 1 ), WORK( IPW ), 1,
+      $                           C( IOFFC1 ), 1 )
+ *
+ *                 sub( C ) := sub( C ) - w * v'
+ *
+-                  CALL SGER( MPC2, NQV, -TAULOC, WORK( IPW ), 1, WORK,
+-     $                       1, C( IOFFC2 ), LDC )
++                  CALL SGER( MPC2, NQV, -TAULOC( 1 ), WORK( IPW ), 1,
++     $                       WORK, 1, C( IOFFC2 ), LDC )
+                END IF
+ *
+             END IF
+diff --git a/SRC/pslawil.f b/SRC/pslawil.f
+index e04c16b..671e08e 100644
+--- a/SRC/pslawil.f
++++ b/SRC/pslawil.f
+@@ -120,10 +120,14 @@ SUBROUTINE PSLAWIL( II, JJ, M, A, DESCA, H44, H33, H43H34, V )
+       INTEGER            CONTXT, DOWN, HBL, ICOL, IROW, JSRC, LDA, LEFT,
+      $                   MODKM1, MYCOL, MYROW, NPCOL, NPROW, NUM, RIGHT,
+      $                   RSRC, UP
+-      REAL               H11, H12, H21, H22, H33S, H44S, S, V1, V2, V3
++      REAL               H22, H33S, H44S, S, V1, V2
+ *     ..
+ *     .. Local Arrays ..
+       REAL               BUF( 4 )
++      REAL               H11( 1 )
++      REAL               H12( 1 )
++      REAL               H21( 1 )
++      REAL               V3( 1 )
+ *     ..
+ *     .. External Subroutines ..
+       EXTERNAL           BLACS_GRIDINFO, SGERV2D, SGESD2D, INFOG2L
+@@ -170,18 +174,18 @@ SUBROUTINE PSLAWIL( II, JJ, M, A, DESCA, H44, H33, H43H34, V )
+             IF( NPCOL.GT.1 ) THEN
+                CALL SGERV2D( CONTXT, 1, 1, V3, 1, MYROW, LEFT )
+             ELSE
+-               V3 = A( ( ICOL-2 )*LDA+IROW )
++               V3( 1 ) = A( ( ICOL-2 )*LDA+IROW )
+             END IF
+             IF( NUM.GT.1 ) THEN
+                CALL SGERV2D( CONTXT, 4, 1, BUF, 4, UP, LEFT )
+-               H11 = BUF( 1 )
+-               H21 = BUF( 2 )
+-               H12 = BUF( 3 )
++               H11( 1 ) = BUF( 1 )
++               H21( 1 ) = BUF( 2 )
++               H12( 1 ) = BUF( 3 )
+                H22 = BUF( 4 )
+             ELSE
+-               H11 = A( ( ICOL-3 )*LDA+IROW-2 )
+-               H21 = A( ( ICOL-3 )*LDA+IROW-1 )
+-               H12 = A( ( ICOL-2 )*LDA+IROW-2 )
++               H11( 1 ) = A( ( ICOL-3 )*LDA+IROW-2 )
++               H21( 1 ) = A( ( ICOL-3 )*LDA+IROW-1 )
++               H12( 1 ) = A( ( ICOL-2 )*LDA+IROW-2 )
+                H22 = A( ( ICOL-2 )*LDA+IROW-1 )
+             END IF
+          END IF
+@@ -214,20 +218,20 @@ SUBROUTINE PSLAWIL( II, JJ, M, A, DESCA, H44, H33, H43H34, V )
+             IF( NUM.GT.1 ) THEN
+                CALL SGERV2D( CONTXT, 1, 1, H11, 1, UP, LEFT )
+             ELSE
+-               H11 = A( ( ICOL-3 )*LDA+IROW-2 )
++               H11( 1 ) = A( ( ICOL-3 )*LDA+IROW-2 )
+             END IF
+             IF( NPROW.GT.1 ) THEN
+                CALL SGERV2D( CONTXT, 1, 1, H12, 1, UP, MYCOL )
+             ELSE
+-               H12 = A( ( ICOL-2 )*LDA+IROW-2 )
++               H12( 1 ) = A( ( ICOL-2 )*LDA+IROW-2 )
+             END IF
+             IF( NPCOL.GT.1 ) THEN
+                CALL SGERV2D( CONTXT, 1, 1, H21, 1, MYROW, LEFT )
+             ELSE
+-               H21 = A( ( ICOL-3 )*LDA+IROW-1 )
++               H21( 1 ) = A( ( ICOL-3 )*LDA+IROW-1 )
+             END IF
+             H22 = A( ( ICOL-2 )*LDA+IROW-1 )
+-            V3 = A( ( ICOL-2 )*LDA+IROW )
++            V3( 1 ) = A( ( ICOL-2 )*LDA+IROW )
+          END IF
+       END IF
+       IF( ( MYROW.NE.II ) .OR. ( MYCOL.NE.JJ ) )
+@@ -236,24 +240,24 @@ SUBROUTINE PSLAWIL( II, JJ, M, A, DESCA, H44, H33, H43H34, V )
+       IF( MODKM1.GT.1 ) THEN
+          CALL INFOG2L( M+2, M+2, DESCA, NPROW, NPCOL, MYROW, MYCOL,
+      $                 IROW, ICOL, RSRC, JSRC )
+-         H11 = A( ( ICOL-3 )*LDA+IROW-2 )
+-         H21 = A( ( ICOL-3 )*LDA+IROW-1 )
+-         H12 = A( ( ICOL-2 )*LDA+IROW-2 )
++         H11( 1 ) = A( ( ICOL-3 )*LDA+IROW-2 )
++         H21( 1 ) = A( ( ICOL-3 )*LDA+IROW-1 )
++         H12( 1 ) = A( ( ICOL-2 )*LDA+IROW-2 )
+          H22 = A( ( ICOL-2 )*LDA+IROW-1 )
+-         V3 = A( ( ICOL-2 )*LDA+IROW )
++         V3( 1 ) = A( ( ICOL-2 )*LDA+IROW )
+       END IF
+ *
+-      H44S = H44 - H11
+-      H33S = H33 - H11
+-      V1 = ( H33S*H44S-H43H34 ) / H21 + H12
+-      V2 = H22 - H11 - H33S - H44S
+-      S = ABS( V1 ) + ABS( V2 ) + ABS( V3 )
++      H44S = H44 - H11( 1 )
++      H33S = H33 - H11( 1 )
++      V1 = ( H33S*H44S-H43H34 ) / H21( 1 ) + H12( 1 )
++      V2 = H22 - H11( 1 ) - H33S - H44S
++      S = ABS( V1 ) + ABS( V2 ) + ABS( V3( 1 ) )
+       V1 = V1 / S
+       V2 = V2 / S
+-      V3 = V3 / S
++      V3( 1 ) = V3( 1 ) / S
+       V( 1 ) = V1
+       V( 2 ) = V2
+-      V( 3 ) = V3
++      V( 3 ) = V3( 1 )
+ *
+       RETURN
+ *
+diff --git a/SRC/psstebz.f b/SRC/psstebz.f
+index a8a2496..7e588a9 100644
+--- a/SRC/psstebz.f
++++ b/SRC/psstebz.f
+@@ -244,14 +244,14 @@ SUBROUTINE PSSTEBZ( ICTXT, RANGE, ORDER, N, VL, VU, IL, IU,
+      $                   ITMP2, J, JB, K, LAST, LEXTRA, LREQ, MYCOL,
+      $                   MYROW, NALPHA, NBETA, NCMP, NEIGINT, NEXT, NGL,
+      $                   NGLOB, NGU, NINT, NPCOL, NPROW, OFFSET,
+-     $                   ONEDCONTEXT, P, PREV, REXTRA, RREQ, SELF,
+-     $                   TORECV
++     $                   ONEDCONTEXT, P, PREV, REXTRA, RREQ, SELF
+       REAL               ALPHA, ATOLI, BETA, BNORM, DRECV, DSEND, GL,
+      $                   GU, INITVL, INITVU, LSAVE, MID, PIVMIN, RELTOL,
+      $                   SAFEMN, TMP1, TMP2, TNORM, ULP
+ *     ..
+ *     .. Local Arrays ..
+       INTEGER            IDUM( 5, 2 )
++      INTEGER            TORECV( 1, 1 )
+ *     ..
+ *     .. Executable Statements ..
+ *       This is just to keep ftnchek happy
+@@ -774,14 +774,14 @@ SUBROUTINE PSSTEBZ( ICTXT, RANGE, ORDER, N, VL, VU, IL, IU,
+          ELSE
+             CALL IGEBR2D( ONEDCONTEXT, 'ALL', ' ', 1, 1, TORECV, 1, 0,
+      $                    I-1 )
+-            IF( TORECV.NE.0 ) THEN
+-               CALL IGEBR2D( ONEDCONTEXT, 'ALL', ' ', TORECV, 1, IWORK,
+-     $                       TORECV, 0, I-1 )
+-               CALL SGEBR2D( ONEDCONTEXT, 'ALL', ' ', TORECV, 1, WORK,
+-     $                       TORECV, 0, I-1 )
+-               CALL IGEBR2D( ONEDCONTEXT, 'ALL', ' ', TORECV, 1,
+-     $                       IWORK( N+1 ), TORECV, 0, I-1 )
+-               DO 120 J = 1, TORECV
++            IF( TORECV( 1, 1 ).NE.0 ) THEN
++               CALL IGEBR2D( ONEDCONTEXT, 'ALL', ' ', TORECV( 1, 1 ), 1,
++     $                       IWORK, TORECV( 1, 1 ), 0, I-1 )
++               CALL SGEBR2D( ONEDCONTEXT, 'ALL', ' ', TORECV( 1, 1 ), 1,
++     $                       WORK, TORECV( 1, 1 ), 0, I-1 )
++               CALL IGEBR2D( ONEDCONTEXT, 'ALL', ' ', TORECV( 1, 1 ), 1,
++     $                       IWORK( N+1 ), TORECV( 1, 1 ), 0, I-1 )
++               DO 120 J = 1, TORECV( 1, 1 )
+                   W( IWORK( J ) ) = WORK( J )
+                   IBLOCK( IWORK( J ) ) = IWORK( N+J )
+   120          CONTINUE
+diff --git a/SRC/pstrord.f b/SRC/pstrord.f
+index 3562242..5cdb549 100644
+--- a/SRC/pstrord.f
++++ b/SRC/pstrord.f
+@@ -328,12 +328,13 @@ SUBROUTINE PSTRORD( COMPQ, SELECT, PARA, N, T, IT, JT,
+      $                   EAST, WEST, ILOC4, SOUTH, NORTH, INDXS,
+      $                   ITT, JTT, ILEN, DLEN, INDXE, TRSRC1, TCSRC1,
+      $                   TRSRC2, TCSRC2, ILOS, DIR, TLIHI, TLILO, TLSEL,
+-     $                   ROUND, LAST, WIN0S, WIN0E, WINE, MMAX, MMIN
++     $                   ROUND, LAST, WIN0S, WIN0E, WINE
+       REAL               ELEM, ELEM1, ELEM2, ELEM3, ELEM4, SN, CS, TMP,
+      $                   ELEM5
+ *     ..
+ *     .. Local Arrays ..
+-      INTEGER            IBUFF( 8 ), IDUM1( 1 ), IDUM2( 1 )
++      INTEGER            IBUFF( 8 ), IDUM1( 1 ), IDUM2( 1 ), MMAX( 1 ),
++     $                    MMIN( 1 ), INFODUM( 1 )
+ *     ..
+ *     .. External Functions ..
+       LOGICAL            LSAME
+@@ -483,16 +484,16 @@ SUBROUTINE PSTRORD( COMPQ, SELECT, PARA, N, T, IT, JT,
+                END IF
+                IF( SELECT(K).NE.0 ) M = M + 1
+  10         CONTINUE
+-            MMAX = M
+-            MMIN = M
++            MMAX( 1 ) = M
++            MMIN( 1 ) = M
+             IF( NPROCS.GT.1 )
+      $         CALL IGAMX2D( ICTXT, 'All', TOP, 1, 1, MMAX, 1, -1,
+      $              -1, -1, -1, -1 )
+             IF( NPROCS.GT.1 )
+      $         CALL IGAMN2D( ICTXT, 'All', TOP, 1, 1, MMIN, 1, -1,
+      $              -1, -1, -1, -1 )
+-            IF( MMAX.GT.MMIN ) THEN
+-               M = MMAX
++            IF( MMAX( 1 ).GT.MMIN( 1 ) ) THEN
++               M = MMAX( 1 )
+                IF( NPROCS.GT.1 )
+      $            CALL IGAMX2D( ICTXT, 'All', TOP, N, 1, SELECT, N,
+      $                 -1, -1, -1, -1, -1 )
+@@ -520,9 +521,11 @@ SUBROUTINE PSTRORD( COMPQ, SELECT, PARA, N, T, IT, JT,
+ *
+ *     Global maximum on info.
+ *
+-      IF( NPROCS.GT.1 )
+-     $   CALL IGAMX2D( ICTXT, 'All', TOP, 1, 1, INFO, 1, -1, -1, -1,
+-     $        -1, -1 )
++      IF( NPROCS.GT.1 ) THEN
++            CALL IGAMX2D( ICTXT, 'All', TOP, 1, 1, INFODUM, 1, -1, -1,
++     $        -1, -1, -1 )
++            INFO = INFODUM( 1 )
++      END IF
+ *
+ *     Return if some argument is incorrect.
+ *
+@@ -1576,9 +1579,11 @@ SUBROUTINE PSTRORD( COMPQ, SELECT, PARA, N, T, IT, JT,
+ *        experienced a failure in the reordering.
+ *
+          MYIERR = IERR
+-         IF( NPROCS.GT.1 )
+-     $      CALL IGAMX2D( ICTXT, 'All', TOP, 1, 1, IERR, 1, -1,
++         IF( NPROCS.GT.1 ) THEN
++            CALL IGAMX2D( ICTXT, 'All', TOP, 1, 1, INFODUM, 1, -1,
+      $           -1, -1, -1, -1 )
++            IERR = INFODUM( 1 )
++         END IF
+ *
+          IF( IERR.NE.0 ) THEN
+ *
+@@ -1586,9 +1591,11 @@ SUBROUTINE PSTRORD( COMPQ, SELECT, PARA, N, T, IT, JT,
+ *           to swap.
+ *
+             IF( MYIERR.NE.0 ) INFO = MAX(1,I+KKS-1)
+-            IF( NPROCS.GT.1 )
+-     $         CALL IGAMX2D( ICTXT, 'All', TOP, 1, 1, INFO, 1, -1,
++            IF( NPROCS.GT.1 ) THEN
++               CALL IGAMX2D( ICTXT, 'All', TOP, 1, 1, INFODUM, 1, -1,
+      $              -1, -1, -1, -1 )
++               INFO = INFODUM( 1 )
++            END IF
+             GO TO 300
+          END IF
+ *
+@@ -3245,9 +3252,11 @@ SUBROUTINE PSTRORD( COMPQ, SELECT, PARA, N, T, IT, JT,
+ *        experienced a failure in the reordering.
+ *
+          MYIERR = IERR
+-         IF( NPROCS.GT.1 )
+-     $      CALL IGAMX2D( ICTXT, 'All', TOP, 1, 1, IERR, 1, -1,
++         IF( NPROCS.GT.1 ) THEN
++            CALL IGAMX2D( ICTXT, 'All', TOP, 1, 1, INFODUM, 1, -1,
+      $           -1, -1, -1, -1 )
++            IERR = INFODUM( 1 )
++         END IF
+ *
+          IF( IERR.NE.0 ) THEN
+ *
+@@ -3255,9 +3264,11 @@ SUBROUTINE PSTRORD( COMPQ, SELECT, PARA, N, T, IT, JT,
+ *           to swap.
+ *
+             IF( MYIERR.NE.0 ) INFO = MAX(1,I+KKS-1)
+-            IF( NPROCS.GT.1 )
+-     $         CALL IGAMX2D( ICTXT, 'All', TOP, 1, 1, INFO, 1, -1,
++            IF( NPROCS.GT.1 ) THEN
++               CALL IGAMX2D( ICTXT, 'All', TOP, 1, 1, INFODUM, 1, -1,
+      $              -1, -1, -1, -1 )
++               INFO = INFODUM( 1 )
++            END IF
+             GO TO 300
+          END IF
+ *
+diff --git a/SRC/pstrsen.f b/SRC/pstrsen.f
+index 6219bdb..1922e8f 100644
+--- a/SRC/pstrsen.f
++++ b/SRC/pstrsen.f
+@@ -354,13 +354,15 @@ SUBROUTINE PSTRSEN( JOB, COMPQ, SELECT, PARA, N, T, IT, JT,
+       LOGICAL            LQUERY, WANTBH, WANTQ, WANTS, WANTSP
+       INTEGER            ICOFFT12, ICTXT, IDUM1, IDUM2, IERR, ILOC1,
+      $                   IPW1, ITER, ITT, JLOC1, JTT, K, LIWMIN, LLDT,
+-     $                   LLDQ, LWMIN, MMAX, MMIN, MYROW, MYCOL, N1, N2,
++     $                   LLDQ, LWMIN, MYROW, MYCOL, N1, N2,
+      $                   NB, NOEXSY, NPCOL, NPROCS, NPROW, SPACE,
+      $                   T12ROWS, T12COLS, TCOLS, TCSRC, TROWS, TRSRC,
+      $                   WRK1, IWRK1, WRK2, IWRK2, WRK3, IWRK3
+-      REAL               DPDUM1, ELEM, EST, SCALE, RNORM
++      REAL               ELEM, EST, SCALE, RNORM
+ *     .. Local Arrays ..
+-      INTEGER            DESCT12( DLEN_ ), MBNB2( 2 )
++      INTEGER            DESCT12( DLEN_ ), MBNB2( 2 ), MMAX( 1 ),
++     $                   MMIN( 1 ), INFODUM( 1 )
++      REAL               DPDUM1( 1 )
+ *     ..
+ *     .. External Functions ..
+       LOGICAL            LSAME
+@@ -521,16 +523,16 @@ SUBROUTINE PSTRSEN( JOB, COMPQ, SELECT, PARA, N, T, IT, JT,
+                END IF
+                IF( SELECT(K) ) M = M + 1
+  10         CONTINUE
+-            MMAX = M
+-            MMIN = M
++            MMAX( 1 ) = M
++            MMIN( 1 ) = M
+             IF( NPROCS.GT.1 )
+      $           CALL IGAMX2D( ICTXT, 'All', TOP, 1, 1, MMAX, 1, -1,
+      $                -1, -1, -1, -1 )
+             IF( NPROCS.GT.1 )
+      $           CALL IGAMN2D( ICTXT, 'All', TOP, 1, 1, MMIN, 1, -1,
+      $                -1, -1, -1, -1 )
+-            IF( MMAX.GT.MMIN ) THEN
+-               M = MMAX
++            IF( MMAX( 1 ).GT.MMIN( 1 ) ) THEN
++               M = MMAX( 1 )
+                IF( NPROCS.GT.1 )
+      $              CALL IGAMX2D( ICTXT, 'All', TOP, N, 1, IWORK, N,
+      $                   -1, -1, -1, -1, -1 )
+@@ -602,9 +604,11 @@ SUBROUTINE PSTRSEN( JOB, COMPQ, SELECT, PARA, N, T, IT, JT,
+ *
+ *     Global maximum on info
+ *
+-      IF( NPROCS.GT.1 )
+-     $     CALL IGAMX2D( ICTXT, 'All', TOP, 1, 1, INFO, 1, -1, -1, -1,
++      IF( NPROCS.GT.1 ) THEN
++         CALL IGAMX2D( ICTXT, 'All', TOP, 1, 1, INFODUM, 1, -1, -1, -1,
+      $          -1, -1 )
++         INFO = INFODUM( 1 )
++      END IF
+ *
+ *     Return if some argument is incorrect
+ *
+diff --git a/SRC/pzlarf.f b/SRC/pzlarf.f
+index df65912..7bff287 100644
+--- a/SRC/pzlarf.f
++++ b/SRC/pzlarf.f
+@@ -242,7 +242,7 @@ SUBROUTINE PZLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+      $                   IOFFV, IPW, IROFF, IVCOL, IVROW, JJC, JJV, LDC,
+      $                   LDV, MYCOL, MYROW, MP, NCC, NCV, NPCOL, NPROW,
+      $                   NQ, RDEST
+-      COMPLEX*16         TAULOC
++      COMPLEX*16         TAULOC( 1 )
+ *     ..
+ *     .. External Subroutines ..
+       EXTERNAL           BLACS_GRIDINFO, INFOG2L, PB_TOPGET, PBZTRNV,
+@@ -336,7 +336,7 @@ SUBROUTINE PZLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                      CALL ZGEBS2D( ICTXT, 'Columnwise', ' ', 1, 1,
+      $                             TAU( IIV ), 1 )
+-                     TAULOC = TAU( IIV )
++                     TAULOC( 1 ) = TAU( IIV )
+ *
+                   ELSE
+ *
+@@ -345,7 +345,7 @@ SUBROUTINE PZLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                   END IF
+ *
+-                  IF( TAULOC.NE.ZERO ) THEN
++                  IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                    w := sub( C )' * v
+ *
+@@ -363,8 +363,8 @@ SUBROUTINE PZLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+ *                    sub( C ) := sub( C ) - v * w'
+ *
+-                     CALL ZGERC( MP, NQ, -TAULOC, WORK, 1, WORK( IPW ),
+-     $                           1, C( IOFFC ), LDC )
++                     CALL ZGERC( MP, NQ, -TAULOC( 1 ), WORK, 1,
++     $                           WORK( IPW ), 1, C( IOFFC ), LDC )
+                   END IF
+ *
+                END IF
+@@ -379,9 +379,9 @@ SUBROUTINE PZLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                   IF( MYCOL.EQ.ICCOL ) THEN
+ *
+-                     TAULOC = TAU( JJV )
++                     TAULOC( 1 ) = TAU( JJV )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C )' * v
+ *
+@@ -398,7 +398,7 @@ SUBROUTINE PZLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+ *                       sub( C ) := sub( C ) - v * w'
+ *
+-                        CALL ZGERC( MP, NQ, -TAULOC, V( IOFFV ), 1,
++                        CALL ZGERC( MP, NQ, -TAULOC( 1 ), V( IOFFV ), 1,
+      $                              WORK, 1, C( IOFFC ), LDC )
+                      END IF
+ *
+@@ -421,9 +421,9 @@ SUBROUTINE PZLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+                      IPW = MP+1
+                      CALL ZGERV2D( ICTXT, IPW, 1, WORK, IPW, MYROW,
+      $                             IVCOL )
+-                     TAULOC = WORK( IPW )
++                     TAULOC( 1 ) = WORK( IPW )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C )' * v
+ *
+@@ -441,7 +441,7 @@ SUBROUTINE PZLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+ *                       sub( C ) := sub( C ) - v * w'
+ *
+-                        CALL ZGERC( MP, NQ, -TAULOC, WORK, 1,
++                        CALL ZGERC( MP, NQ, -TAULOC( 1 ), WORK, 1,
+      $                              WORK( IPW ), 1, C( IOFFC ), LDC )
+                      END IF
+ *
+@@ -471,7 +471,7 @@ SUBROUTINE PZLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                   CALL ZGEBS2D( ICTXT, 'Columnwise', ' ', 1, 1,
+      $                          TAU( IIV ), 1 )
+-                  TAULOC = TAU( IIV )
++                  TAULOC( 1 ) = TAU( IIV )
+ *
+                ELSE
+ *
+@@ -480,7 +480,7 @@ SUBROUTINE PZLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C )' * v
+ *
+@@ -500,8 +500,8 @@ SUBROUTINE PZLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *                 sub( C ) := sub( C ) - v * w'
+ *
+                   IF( IOFFC.GT.0 )
+-     $               CALL ZGERC( MP, NQ, -TAULOC, WORK, 1, WORK( IPW ),
+-     $                           1, C( IOFFC ), LDC )
++     $               CALL ZGERC( MP, NQ, -TAULOC( 1 ), WORK, 1,
++     $                           WORK( IPW ), 1, C( IOFFC ), LDC )
+                END IF
+ *
+             ELSE
+@@ -516,18 +516,18 @@ SUBROUTINE PZLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+                   WORK(IPW) = TAU( JJV )
+                   CALL ZGEBS2D( ICTXT, 'Rowwise', ROWBTOP, IPW, 1,
+      $                          WORK, IPW )
+-                  TAULOC = TAU( JJV )
++                  TAULOC( 1 ) = TAU( JJV )
+ *
+                ELSE
+ *
+                   IPW = MP+1
+                   CALL ZGEBR2D( ICTXT, 'Rowwise', ROWBTOP, IPW, 1, WORK,
+      $                          IPW, MYROW, IVCOL )
+-                  TAULOC = WORK( IPW )
++                  TAULOC( 1 ) = WORK( IPW )
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C )' * v
+ *
+@@ -547,8 +547,8 @@ SUBROUTINE PZLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *                 sub( C ) := sub( C ) - v * w'
+ *
+                   IF( IOFFC.GT.0 )
+-     $               CALL ZGERC( MP, NQ, -TAULOC, WORK, 1, WORK( IPW ),
+-     $                           1, C( IOFFC ), LDC )
++     $               CALL ZGERC( MP, NQ, -TAULOC( 1 ), WORK, 1,
++     $                           WORK( IPW ), 1, C( IOFFC ), LDC )
+                END IF
+ *
+             END IF
+@@ -577,9 +577,9 @@ SUBROUTINE PZLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                   IF( MYROW.EQ.ICROW ) THEN
+ *
+-                     TAULOC = TAU( IIV )
++                     TAULOC( 1 ) = TAU( IIV )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C ) * v
+ *
+@@ -597,7 +597,7 @@ SUBROUTINE PZLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *                       sub( C ) := sub( C ) - w * v'
+ *
+                         IF( IOFFV.GT.0 .AND. IOFFC.GT.0 )
+-     $                     CALL ZGERC( MP, NQ, -TAULOC, WORK, 1,
++     $                     CALL ZGERC( MP, NQ, -TAULOC( 1 ), WORK, 1,
+      $                                 V( IOFFV ), LDV, C( IOFFC ),
+      $                                 LDC )
+                      END IF
+@@ -621,9 +621,9 @@ SUBROUTINE PZLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+                      IPW = NQ+1
+                      CALL ZGERV2D( ICTXT, IPW, 1, WORK, IPW, IVROW,
+      $                             MYCOL )
+-                     TAULOC = WORK( IPW )
++                     TAULOC( 1 ) = WORK( IPW )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C ) * v
+ *
+@@ -641,8 +641,8 @@ SUBROUTINE PZLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+ *                       sub( C ) := sub( C ) - w * v'
+ *
+-                        CALL ZGERC( MP, NQ, -TAULOC, WORK( IPW ), 1,
+-     $                              WORK, 1, C( IOFFC ), LDC )
++                        CALL ZGERC( MP, NQ, -TAULOC( 1 ), WORK( IPW ),
++     $                              1, WORK, 1, C( IOFFC ), LDC )
+                      END IF
+ *
+                   END IF
+@@ -667,7 +667,7 @@ SUBROUTINE PZLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                      CALL ZGEBS2D( ICTXT, 'Rowwise', ' ', 1, 1,
+      $                             TAU( JJV ), 1 )
+-                     TAULOC = TAU( JJV )
++                     TAULOC( 1 ) = TAU( JJV )
+ *
+                   ELSE
+ *
+@@ -676,7 +676,7 @@ SUBROUTINE PZLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                   END IF
+ *
+-                  IF( TAULOC.NE.ZERO ) THEN
++                  IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                    w := sub( C ) * v
+ *
+@@ -694,8 +694,8 @@ SUBROUTINE PZLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+ *                    sub( C ) := sub( C ) - w * v'
+ *
+-                     CALL ZGERC( MP, NQ, -TAULOC, WORK( IPW ), 1, WORK,
+-     $                           1, C( IOFFC ), LDC )
++                     CALL ZGERC( MP, NQ, -TAULOC( 1 ), WORK( IPW ), 1,
++     $                           WORK, 1, C( IOFFC ), LDC )
+                   END IF
+ *
+                END IF
+@@ -720,18 +720,18 @@ SUBROUTINE PZLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+                   WORK(IPW) = TAU( IIV )
+                   CALL ZGEBS2D( ICTXT, 'Columnwise', COLBTOP, IPW, 1,
+      $                          WORK, IPW )
+-                  TAULOC = TAU( IIV )
++                  TAULOC( 1 ) = TAU( IIV )
+ *
+                ELSE
+ *
+                   IPW = NQ+1
+                   CALL ZGEBR2D( ICTXT, 'Columnwise', COLBTOP, IPW, 1,
+      $                          WORK, IPW, IVROW, MYCOL )
+-                  TAULOC = WORK( IPW )
++                  TAULOC( 1 ) = WORK( IPW )
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C ) * v
+ *
+@@ -750,8 +750,8 @@ SUBROUTINE PZLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *                 sub( C ) := sub( C ) - w * v'
+ *
+                   IF( IOFFC.GT.0 )
+-     $               CALL ZGERC( MP, NQ, -TAULOC, WORK( IPW ), 1, WORK,
+-     $                           1, C( IOFFC ), LDC )
++     $               CALL ZGERC( MP, NQ, -TAULOC( 1 ), WORK( IPW ), 1,
++     $                           WORK, 1, C( IOFFC ), LDC )
+                END IF
+ *
+             ELSE
+@@ -770,7 +770,7 @@ SUBROUTINE PZLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                   CALL ZGEBS2D( ICTXT, 'Rowwise', ' ', 1, 1, TAU( JJV ),
+      $                          1 )
+-                  TAULOC = TAU( JJV )
++                  TAULOC( 1 ) = TAU( JJV )
+ *
+                ELSE
+ *
+@@ -779,7 +779,7 @@ SUBROUTINE PZLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C ) * v
+ *
+@@ -797,8 +797,8 @@ SUBROUTINE PZLARF( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+ *                 sub( C ) := sub( C ) - w * v'
+ *
+-                  CALL ZGERC( MP, NQ, -TAULOC, WORK( IPW ), 1, WORK, 1,
+-     $                        C( IOFFC ), LDC )
++                  CALL ZGERC( MP, NQ, -TAULOC( 1 ), WORK( IPW ), 1,
++     $                        WORK, 1, C( IOFFC ), LDC )
+                END IF
+ *
+             END IF
+diff --git a/SRC/pzlarfc.f b/SRC/pzlarfc.f
+index eb469fc..ddd7ec6 100644
+--- a/SRC/pzlarfc.f
++++ b/SRC/pzlarfc.f
+@@ -242,7 +242,7 @@ SUBROUTINE PZLARFC( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+      $                   IOFFV, IPW, IROFF, IVCOL, IVROW, JJC, JJV, LDC,
+      $                   LDV, MYCOL, MYROW, MP, NCC, NCV, NPCOL, NPROW,
+      $                   NQ, RDEST
+-      COMPLEX*16         TAULOC
++      COMPLEX*16         TAULOC( 1 )
+ *     ..
+ *     .. External Subroutines ..
+       EXTERNAL           BLACS_GRIDINFO, INFOG2L, PB_TOPGET, PBZTRNV,
+@@ -336,17 +336,17 @@ SUBROUTINE PZLARFC( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                      CALL ZGEBS2D( ICTXT, 'Columnwise', ' ', 1, 1,
+      $                             TAU( IIV ), 1 )
+-                     TAULOC = DCONJG( TAU( IIV ) )
++                     TAULOC( 1 ) = DCONJG( TAU( IIV ) )
+ *
+                   ELSE
+ *
+                      CALL ZGEBR2D( ICTXT, 'Columnwise', ' ', 1, 1,
+      $                             TAULOC, 1, IVROW, MYCOL )
+-                     TAULOC = DCONJG( TAULOC )
++                     TAULOC( 1 ) = DCONJG( TAULOC( 1 ) )
+ *
+                   END IF
+ *
+-                  IF( TAULOC.NE.ZERO ) THEN
++                  IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                    w := sub( C )' * v
+ *
+@@ -364,8 +364,8 @@ SUBROUTINE PZLARFC( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+ *                    sub( C ) := sub( C ) - v * w'
+ *
+-                     CALL ZGERC( MP, NQ, -TAULOC, WORK, 1, WORK( IPW ),
+-     $                           1, C( IOFFC ), LDC )
++                     CALL ZGERC( MP, NQ, -TAULOC( 1 ), WORK, 1,
++     $                           WORK( IPW ), 1, C( IOFFC ), LDC )
+                   END IF
+ *
+                END IF
+@@ -380,9 +380,9 @@ SUBROUTINE PZLARFC( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                   IF( MYCOL.EQ.ICCOL ) THEN
+ *
+-                     TAULOC = DCONJG( TAU( JJV ) )
++                     TAULOC( 1 ) = DCONJG( TAU( JJV ) )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C )' * v
+ *
+@@ -399,7 +399,7 @@ SUBROUTINE PZLARFC( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+ *                       sub( C ) := sub( C ) - v * w'
+ *
+-                        CALL ZGERC( MP, NQ, -TAULOC, V( IOFFV ), 1,
++                        CALL ZGERC( MP, NQ, -TAULOC( 1 ), V( IOFFV ), 1,
+      $                              WORK, 1, C( IOFFC ), LDC )
+                      END IF
+ *
+@@ -422,9 +422,9 @@ SUBROUTINE PZLARFC( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+                      IPW = MP+1
+                      CALL ZGERV2D( ICTXT, IPW, 1, WORK, IPW, MYROW,
+      $                             IVCOL )
+-                     TAULOC = DCONJG( WORK( IPW ) )
++                     TAULOC( 1 ) = DCONJG( WORK( IPW ) )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C )' * v
+ *
+@@ -442,7 +442,7 @@ SUBROUTINE PZLARFC( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+ *                       sub( C ) := sub( C ) - v * w'
+ *
+-                        CALL ZGERC( MP, NQ, -TAULOC, WORK, 1,
++                        CALL ZGERC( MP, NQ, -TAULOC( 1 ), WORK, 1,
+      $                              WORK( IPW ), 1, C( IOFFC ), LDC )
+                      END IF
+ *
+@@ -472,17 +472,17 @@ SUBROUTINE PZLARFC( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                   CALL ZGEBS2D( ICTXT, 'Columnwise', ' ', 1, 1,
+      $                          TAU( IIV ), 1 )
+-                  TAULOC = DCONJG( TAU( IIV ) )
++                  TAULOC( 1 ) = DCONJG( TAU( IIV ) )
+ *
+                ELSE
+ *
+                   CALL ZGEBR2D( ICTXT, 'Columnwise', ' ', 1, 1, TAULOC,
+      $                          1, IVROW, MYCOL )
+-                  TAULOC = DCONJG( TAULOC )
++                  TAULOC( 1 ) = DCONJG( TAULOC( 1 ) )
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C )' * v
+ *
+@@ -500,8 +500,8 @@ SUBROUTINE PZLARFC( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+ *                 sub( C ) := sub( C ) - v * w'
+ *
+-                  CALL ZGERC( MP, NQ, -TAULOC, WORK, 1, WORK( IPW ), 1,
+-     $                        C( IOFFC ), LDC )
++                  CALL ZGERC( MP, NQ, -TAULOC( 1 ), WORK, 1,
++     $                        WORK( IPW ), 1, C( IOFFC ), LDC )
+                END IF
+ *
+             ELSE
+@@ -516,18 +516,18 @@ SUBROUTINE PZLARFC( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+                   WORK(IPW) = TAU( JJV )
+                   CALL ZGEBS2D( ICTXT, 'Rowwise', ROWBTOP, IPW, 1,
+      $                          WORK, IPW )
+-                  TAULOC = DCONJG( TAU( JJV ) )
++                  TAULOC( 1 ) = DCONJG( TAU( JJV ) )
+ *
+                ELSE
+ *
+                   IPW = MP+1
+                   CALL ZGEBR2D( ICTXT, 'Rowwise', ROWBTOP, IPW, 1, WORK,
+      $                          IPW, MYROW, IVCOL )
+-                  TAULOC = DCONJG( WORK( IPW ) )
++                  TAULOC( 1 ) = DCONJG( WORK( IPW ) )
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C )' * v
+ *
+@@ -545,8 +545,8 @@ SUBROUTINE PZLARFC( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+ *                 sub( C ) := sub( C ) - v * w'
+ *
+-                  CALL ZGERC( MP, NQ, -TAULOC, WORK, 1, WORK( IPW ), 1,
+-     $                        C( IOFFC ), LDC )
++                  CALL ZGERC( MP, NQ, -TAULOC( 1 ), WORK, 1,
++     $                        WORK( IPW ), 1, C( IOFFC ), LDC )
+                END IF
+ *
+             END IF
+@@ -575,9 +575,9 @@ SUBROUTINE PZLARFC( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                   IF( MYROW.EQ.ICROW ) THEN
+ *
+-                     TAULOC = DCONJG( TAU( IIV ) )
++                     TAULOC( 1 ) = DCONJG( TAU( IIV ) )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C ) * v
+ *
+@@ -594,7 +594,7 @@ SUBROUTINE PZLARFC( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+ *                       sub( C ) := sub( C ) - w * v'
+ *
+-                        CALL ZGERC( MP, NQ, -TAULOC, WORK, 1,
++                        CALL ZGERC( MP, NQ, -TAULOC( 1 ), WORK, 1,
+      $                              V( IOFFV ), LDV, C( IOFFC ), LDC )
+                      END IF
+ *
+@@ -617,9 +617,9 @@ SUBROUTINE PZLARFC( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+                      IPW = NQ+1
+                      CALL ZGERV2D( ICTXT, IPW, 1, WORK, IPW, IVROW,
+      $                             MYCOL )
+-                     TAULOC = DCONJG( WORK( IPW ) )
++                     TAULOC( 1 ) = DCONJG( WORK( IPW ) )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C ) * v
+ *
+@@ -637,8 +637,8 @@ SUBROUTINE PZLARFC( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+ *                       sub( C ) := sub( C ) - w * v'
+ *
+-                        CALL ZGERC( MP, NQ, -TAULOC, WORK( IPW ), 1,
+-     $                              WORK, 1, C( IOFFC ), LDC )
++                        CALL ZGERC( MP, NQ, -TAULOC( 1 ), WORK( IPW ),
++     $                              1, WORK, 1, C( IOFFC ), LDC )
+                      END IF
+ *
+                   END IF
+@@ -663,17 +663,17 @@ SUBROUTINE PZLARFC( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                      CALL ZGEBS2D( ICTXT, 'Rowwise', ' ', 1, 1,
+      $                             TAU( JJV ), 1 )
+-                     TAULOC = DCONJG( TAU( JJV ) )
++                     TAULOC( 1 ) = DCONJG( TAU( JJV ) )
+ *
+                   ELSE
+ *
+                      CALL ZGEBR2D( ICTXT, 'Rowwise', ' ', 1, 1, TAULOC,
+      $                             1, MYROW, IVCOL )
+-                     TAULOC = DCONJG( TAULOC )
++                     TAULOC( 1 ) = DCONJG( TAULOC( 1 ) )
+ *
+                   END IF
+ *
+-                  IF( TAULOC.NE.ZERO ) THEN
++                  IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                    w := sub( C ) * v
+ *
+@@ -691,8 +691,8 @@ SUBROUTINE PZLARFC( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+ *                    sub( C ) := sub( C ) - w * v'
+ *
+-                     CALL ZGERC( MP, NQ, -TAULOC, WORK( IPW ), 1, WORK,
+-     $                           1, C( IOFFC ), LDC )
++                     CALL ZGERC( MP, NQ, -TAULOC( 1 ), WORK( IPW ), 1,
++     $                           WORK, 1, C( IOFFC ), LDC )
+                   END IF
+ *
+                END IF
+@@ -716,18 +716,18 @@ SUBROUTINE PZLARFC( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+                   WORK(IPW) = TAU( IIV )
+                   CALL ZGEBS2D( ICTXT, 'Columnwise', COLBTOP, IPW, 1,
+      $                          WORK, IPW )
+-                  TAULOC = DCONJG( TAU( IIV ) )
++                  TAULOC( 1 ) = DCONJG( TAU( IIV ) )
+ *
+                ELSE
+ *
+                   IPW = NQ+1
+                   CALL ZGEBR2D( ICTXT, 'Columnwise', COLBTOP, IPW, 1,
+      $                          WORK, IPW, IVROW, MYCOL )
+-                  TAULOC = DCONJG( WORK( IPW ) )
++                  TAULOC( 1 ) = DCONJG( WORK( IPW ) )
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C ) * v
+ *
+@@ -745,8 +745,8 @@ SUBROUTINE PZLARFC( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+ *                 sub( C ) := sub( C ) - w * v'
+ *
+-                  CALL ZGERC( MP, NQ, -TAULOC, WORK( IPW ), 1, WORK, 1,
+-     $                        C( IOFFC ), LDC )
++                  CALL ZGERC( MP, NQ, -TAULOC( 1 ), WORK( IPW ), 1,
++     $                        WORK, 1, C( IOFFC ), LDC )
+                END IF
+ *
+             ELSE
+@@ -765,17 +765,17 @@ SUBROUTINE PZLARFC( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+                   CALL ZGEBS2D( ICTXT, 'Rowwise', ' ', 1, 1, TAU( JJV ),
+      $                          1 )
+-                  TAULOC = DCONJG( TAU( JJV ) )
++                  TAULOC( 1 ) = DCONJG( TAU( JJV ) )
+ *
+                ELSE
+ *
+                   CALL ZGEBR2D( ICTXT, 'Rowwise', ' ', 1, 1, TAULOC, 1,
+      $                          MYROW, IVCOL )
+-                  TAULOC = DCONJG( TAULOC )
++                  TAULOC( 1 ) = DCONJG( TAULOC( 1 ) )
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C ) * v
+ *
+@@ -793,8 +793,8 @@ SUBROUTINE PZLARFC( SIDE, M, N, V, IV, JV, DESCV, INCV, TAU,
+ *
+ *                 sub( C ) := sub( C ) - w * v'
+ *
+-                  CALL ZGERC( MP, NQ, -TAULOC, WORK( IPW ), 1, WORK, 1,
+-     $                        C( IOFFC ), LDC )
++                  CALL ZGERC( MP, NQ, -TAULOC( 1 ), WORK( IPW ), 1,
++     $                        WORK, 1, C( IOFFC ), LDC )
+                END IF
+ *
+             END IF
+diff --git a/SRC/pzlarz.f b/SRC/pzlarz.f
+index fefc133..abf6288 100644
+--- a/SRC/pzlarz.f
++++ b/SRC/pzlarz.f
+@@ -251,7 +251,7 @@ SUBROUTINE PZLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+      $                   IVCOL, IVROW, JJC1, JJC2, JJV, LDC, LDV, MPC2,
+      $                   MPV, MYCOL, MYROW, NCC, NCV, NPCOL, NPROW,
+      $                   NQC2, NQV, RDEST
+-      COMPLEX*16         TAULOC
++      COMPLEX*16         TAULOC( 1 )
+ *     ..
+ *     .. External Subroutines ..
+       EXTERNAL           BLACS_GRIDINFO, INFOG2L, PB_TOPGET, PBZTRNV,
+@@ -370,7 +370,7 @@ SUBROUTINE PZLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                      CALL ZGEBS2D( ICTXT, 'Columnwise', ' ', 1, 1,
+      $                             TAU( IIV ), 1 )
+-                     TAULOC = TAU( IIV )
++                     TAULOC( 1 ) = TAU( IIV )
+ *
+                   ELSE
+ *
+@@ -379,7 +379,7 @@ SUBROUTINE PZLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                   END IF
+ *
+-                  IF( TAULOC.NE.ZERO ) THEN
++                  IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                    w := sub( C )' * v
+ *
+@@ -402,9 +402,9 @@ SUBROUTINE PZLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *                    sub( C ) := sub( C ) - v * w'
+ *
+                      IF( MYROW.EQ.ICROW1 )
+-     $                  CALL ZAXPY( NQC2, -TAULOC, WORK( IPW ),
++     $                  CALL ZAXPY( NQC2, -TAULOC( 1 ), WORK( IPW ),
+      $                              MAX( 1, NQC2 ), C( IOFFC1 ), LDC )
+-                     CALL ZGERC( MPV, NQC2, -TAULOC, WORK, 1,
++                     CALL ZGERC( MPV, NQC2, -TAULOC( 1 ), WORK, 1,
+      $                           WORK( IPW ), 1, C( IOFFC2 ), LDC )
+                   END IF
+ *
+@@ -420,9 +420,9 @@ SUBROUTINE PZLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                   IF( MYCOL.EQ.ICCOL2 ) THEN
+ *
+-                     TAULOC = TAU( JJV )
++                     TAULOC( 1 ) = TAU( JJV )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C )' * v
+ *
+@@ -445,11 +445,11 @@ SUBROUTINE PZLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *                       sub( C ) := sub( C ) - v * w'
+ *
+                         IF( MYROW.EQ.ICROW1 )
+-     $                     CALL ZAXPY( NQC2, -TAULOC, WORK,
++     $                     CALL ZAXPY( NQC2, -TAULOC( 1 ), WORK,
+      $                                 MAX( 1, NQC2 ), C( IOFFC1 ),
+      $                                 LDC )
+-                        CALL ZGERC( MPV, NQC2, -TAULOC, V( IOFFV ), 1,
+-     $                              WORK, 1, C( IOFFC2 ), LDC )
++                        CALL ZGERC( MPV, NQC2, -TAULOC( 1 ), V( IOFFV ),
++     $                              1, WORK, 1, C( IOFFC2 ), LDC )
+                      END IF
+ *
+                   END IF
+@@ -471,9 +471,9 @@ SUBROUTINE PZLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+                      IPW = MPV+1
+                      CALL ZGERV2D( ICTXT, IPW, 1, WORK, IPW, MYROW,
+      $                             IVCOL )
+-                     TAULOC = WORK( IPW )
++                     TAULOC( 1 ) = WORK( IPW )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C )' * v
+ *
+@@ -496,10 +496,10 @@ SUBROUTINE PZLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *                       sub( C ) := sub( C ) - v * w'
+ *
+                         IF( MYROW.EQ.ICROW1 )
+-     $                     CALL ZAXPY( NQC2, -TAULOC, WORK( IPW ),
++     $                     CALL ZAXPY( NQC2, -TAULOC( 1 ), WORK( IPW ),
+      $                                 MAX( 1, NQC2 ), C( IOFFC1 ),
+      $                                 LDC )
+-                        CALL ZGERC( MPV, NQC2, -TAULOC, WORK, 1,
++                        CALL ZGERC( MPV, NQC2, -TAULOC( 1 ), WORK, 1,
+      $                              WORK( IPW ), 1, C( IOFFC2 ), LDC )
+                      END IF
+ *
+@@ -530,7 +530,7 @@ SUBROUTINE PZLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                   CALL ZGEBS2D( ICTXT, 'Columnwise', ' ', 1, 1,
+      $                          TAU( IIV ), 1 )
+-                  TAULOC = TAU( IIV )
++                  TAULOC( 1 ) = TAU( IIV )
+ *
+                ELSE
+ *
+@@ -539,7 +539,7 @@ SUBROUTINE PZLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C )' * v
+ *
+@@ -562,10 +562,10 @@ SUBROUTINE PZLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *                 sub( C ) := sub( C ) - v * w'
+ *
+                   IF( MYROW.EQ.ICROW1 )
+-     $               CALL ZAXPY( NQC2, -TAULOC, WORK( IPW ),
++     $               CALL ZAXPY( NQC2, -TAULOC( 1 ), WORK( IPW ),
+      $                           MAX( 1, NQC2 ), C( IOFFC1 ), LDC )
+-                  CALL ZGERC( MPV, NQC2, -TAULOC, WORK, 1, WORK( IPW ),
+-     $                        1, C( IOFFC2 ), LDC )
++                  CALL ZGERC( MPV, NQC2, -TAULOC( 1 ), WORK, 1,
++     $                        WORK( IPW ), 1, C( IOFFC2 ), LDC )
+                END IF
+ *
+             ELSE
+@@ -580,18 +580,18 @@ SUBROUTINE PZLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+                   WORK( IPW ) = TAU( JJV )
+                   CALL ZGEBS2D( ICTXT, 'Rowwise', ROWBTOP, IPW, 1,
+      $                          WORK, IPW )
+-                  TAULOC = TAU( JJV )
++                  TAULOC( 1 ) = TAU( JJV )
+ *
+                ELSE
+ *
+                   IPW = MPV+1
+                   CALL ZGEBR2D( ICTXT, 'Rowwise', ROWBTOP, IPW, 1, WORK,
+      $                          IPW, MYROW, IVCOL )
+-                  TAULOC = WORK( IPW )
++                  TAULOC( 1 ) = WORK( IPW )
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C )' * v
+ *
+@@ -614,10 +614,10 @@ SUBROUTINE PZLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *                 sub( C ) := sub( C ) - v * w'
+ *
+                   IF( MYROW.EQ.ICROW1 )
+-     $               CALL ZAXPY( NQC2, -TAULOC, WORK( IPW ),
++     $               CALL ZAXPY( NQC2, -TAULOC( 1 ), WORK( IPW ),
+      $                           MAX( 1, NQC2 ), C( IOFFC1 ), LDC )
+-                  CALL ZGERC( MPV, NQC2, -TAULOC, WORK, 1, WORK( IPW ),
+-     $                        1, C( IOFFC2 ), LDC )
++                  CALL ZGERC( MPV, NQC2, -TAULOC( 1 ), WORK, 1,
++     $                        WORK( IPW ), 1, C( IOFFC2 ), LDC )
+                END IF
+ *
+             END IF
+@@ -646,9 +646,9 @@ SUBROUTINE PZLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                   IF( MYROW.EQ.ICROW2 ) THEN
+ *
+-                     TAULOC = TAU( IIV )
++                     TAULOC( 1 ) = TAU( IIV )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C ) * v
+ *
+@@ -669,13 +669,13 @@ SUBROUTINE PZLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+      $                               ICCOL2 )
+ *
+                         IF( MYCOL.EQ.ICCOL1 )
+-     $                     CALL ZAXPY( MPC2, -TAULOC, WORK, 1,
++     $                     CALL ZAXPY( MPC2, -TAULOC( 1 ), WORK, 1,
+      $                                 C( IOFFC1 ), 1 )
+ *
+ *                       sub( C ) := sub( C ) - w * v'
+ *
+                         IF( MPC2.GT.0 .AND. NQV.GT.0 )
+-     $                     CALL ZGERC( MPC2, NQV, -TAULOC, WORK, 1,
++     $                     CALL ZGERC( MPC2, NQV, -TAULOC( 1 ), WORK, 1,
+      $                                 V( IOFFV ), LDV, C( IOFFC2 ),
+      $                                 LDC )
+                      END IF
+@@ -699,9 +699,9 @@ SUBROUTINE PZLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+                      IPW = NQV+1
+                      CALL ZGERV2D( ICTXT, IPW, 1, WORK, IPW, IVROW,
+      $                             MYCOL )
+-                     TAULOC = WORK( IPW )
++                     TAULOC( 1 ) = WORK( IPW )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C ) * v
+ *
+@@ -720,13 +720,14 @@ SUBROUTINE PZLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+      $                                WORK( IPW ), MAX( 1, MPC2 ),
+      $                                RDEST, ICCOL2 )
+                         IF( MYCOL.EQ.ICCOL1 )
+-     $                     CALL ZAXPY( MPC2, -TAULOC, WORK( IPW ), 1,
+-     $                                 C( IOFFC1 ), 1 )
++     $                     CALL ZAXPY( MPC2, -TAULOC( 1 ), WORK( IPW ),
++     $                                 1, C( IOFFC1 ), 1 )
+ *
+ *                       sub( C ) := sub( C ) - w * v'
+ *
+-                        CALL ZGERC( MPC2, NQV, -TAULOC, WORK( IPW ), 1,
+-     $                              WORK, 1, C( IOFFC2 ), LDC )
++                        CALL ZGERC( MPC2, NQV, -TAULOC( 1 ),
++     $                              WORK( IPW ), 1, WORK, 1,
++     $                              C( IOFFC2 ), LDC )
+                      END IF
+ *
+                   END IF
+@@ -751,7 +752,7 @@ SUBROUTINE PZLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                      CALL ZGEBS2D( ICTXT, 'Rowwise', ' ', 1, 1,
+      $                             TAU( JJV ), 1 )
+-                     TAULOC = TAU( JJV )
++                     TAULOC( 1 ) = TAU( JJV )
+ *
+                   ELSE
+ *
+@@ -760,7 +761,7 @@ SUBROUTINE PZLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                   END IF
+ *
+-                  IF( TAULOC.NE.ZERO ) THEN
++                  IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                    w := sub( C ) * v
+ *
+@@ -779,13 +780,13 @@ SUBROUTINE PZLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+      $                             WORK( IPW ), MAX( 1, MPC2 ), RDEST,
+      $                             ICCOL2 )
+                      IF( MYCOL.EQ.ICCOL1 )
+-     $                  CALL ZAXPY( MPC2, -TAULOC, WORK( IPW ), 1,
++     $                  CALL ZAXPY( MPC2, -TAULOC( 1 ), WORK( IPW ), 1,
+      $                              C( IOFFC1 ), 1 )
+ *
+ *                    sub( C ) := sub( C ) - w * v'
+ *
+-                     CALL ZGERC( MPC2, NQV, -TAULOC, WORK( IPW ), 1,
+-     $                           WORK, 1, C( IOFFC2 ), LDC )
++                     CALL ZGERC( MPC2, NQV, -TAULOC( 1 ), WORK( IPW ),
++     $                           1, WORK, 1, C( IOFFC2 ), LDC )
+                   END IF
+ *
+                END IF
+@@ -809,18 +810,18 @@ SUBROUTINE PZLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+                   WORK( IPW ) = TAU( IIV )
+                   CALL ZGEBS2D( ICTXT, 'Columnwise', COLBTOP, IPW, 1,
+      $                          WORK, IPW )
+-                  TAULOC = TAU( IIV )
++                  TAULOC( 1 ) = TAU( IIV )
+ *
+                ELSE
+ *
+                   IPW = NQV+1
+                   CALL ZGEBR2D( ICTXT, 'Columnwise', COLBTOP, IPW, 1,
+      $                          WORK, IPW, IVROW, MYCOL )
+-                  TAULOC = WORK( IPW )
++                  TAULOC( 1 ) = WORK( IPW )
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C ) * v
+ *
+@@ -840,13 +841,13 @@ SUBROUTINE PZLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+      $                          WORK( IPW ), MAX( 1, MPC2 ), RDEST,
+      $                          ICCOL2 )
+                   IF( MYCOL.EQ.ICCOL1 )
+-     $               CALL ZAXPY( MPC2, -TAULOC, WORK( IPW ), 1,
++     $               CALL ZAXPY( MPC2, -TAULOC( 1 ), WORK( IPW ), 1,
+      $                           C( IOFFC1 ), 1 )
+ *
+ *                 sub( C ) := sub( C ) - w * v'
+ *
+-                  CALL ZGERC( MPC2, NQV, -TAULOC, WORK( IPW ), 1, WORK,
+-     $                        1, C( IOFFC2 ), LDC )
++                  CALL ZGERC( MPC2, NQV, -TAULOC( 1 ), WORK( IPW ), 1,
++     $                        WORK, 1, C( IOFFC2 ), LDC )
+                END IF
+ *
+             ELSE
+@@ -865,7 +866,7 @@ SUBROUTINE PZLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                   CALL ZGEBS2D( ICTXT, 'Rowwise', ' ', 1, 1, TAU( JJV ),
+      $                          1 )
+-                  TAULOC = TAU( JJV )
++                  TAULOC( 1 ) = TAU( JJV )
+ *
+                ELSE
+ *
+@@ -874,7 +875,7 @@ SUBROUTINE PZLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C ) * v
+ *
+@@ -893,13 +894,13 @@ SUBROUTINE PZLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+      $                          WORK( IPW ), MAX( 1, MPC2 ), RDEST,
+      $                          ICCOL2 )
+                   IF( MYCOL.EQ.ICCOL1 )
+-     $               CALL ZAXPY( MPC2, -TAULOC, WORK( IPW ), 1,
++     $               CALL ZAXPY( MPC2, -TAULOC( 1 ), WORK( IPW ), 1,
+      $                           C( IOFFC1 ), 1 )
+ *
+ *                 sub( C ) := sub( C ) - w * v'
+ *
+-                  CALL ZGERC( MPC2, NQV, -TAULOC, WORK( IPW ), 1, WORK,
+-     $                        1, C( IOFFC2 ), LDC )
++                  CALL ZGERC( MPC2, NQV, -TAULOC( 1 ), WORK( IPW ), 1,
++     $                        WORK, 1, C( IOFFC2 ), LDC )
+                END IF
+ *
+             END IF
+diff --git a/SRC/pzlarzc.f b/SRC/pzlarzc.f
+index 936caec..2c574ff 100644
+--- a/SRC/pzlarzc.f
++++ b/SRC/pzlarzc.f
+@@ -251,7 +251,7 @@ SUBROUTINE PZLARZC( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+      $                   IVCOL, IVROW, JJC1, JJC2, JJV, LDC, LDV, MPC2,
+      $                   MPV, MYCOL, MYROW, NCC, NCV, NPCOL, NPROW,
+      $                   NQC2, NQV, RDEST
+-      COMPLEX*16         TAULOC
++      COMPLEX*16         TAULOC( 1 )
+ *     ..
+ *     .. External Subroutines ..
+       EXTERNAL           BLACS_GRIDINFO, INFOG2L, PB_TOPGET, PBZTRNV,
+@@ -370,17 +370,17 @@ SUBROUTINE PZLARZC( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                      CALL ZGEBS2D( ICTXT, 'Columnwise', ' ', 1, 1,
+      $                             TAU( IIV ), 1 )
+-                     TAULOC = DCONJG( TAU( IIV ) )
++                     TAULOC( 1 ) = DCONJG( TAU( IIV ) )
+ *
+                   ELSE
+ *
+                      CALL ZGEBR2D( ICTXT, 'Columnwise', ' ', 1, 1,
+      $                             TAULOC, 1, IVROW, MYCOL )
+-                     TAULOC = DCONJG( TAULOC )
++                     TAULOC( 1 ) = DCONJG( TAULOC( 1 ) )
+ *
+                   END IF
+ *
+-                  IF( TAULOC.NE.ZERO ) THEN
++                  IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                    w := sub( C )' * v
+ *
+@@ -403,9 +403,9 @@ SUBROUTINE PZLARZC( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *                    sub( C ) := sub( C ) - v * w'
+ *
+                      IF( MYROW.EQ.ICROW1 )
+-     $                  CALL ZAXPY( NQC2, -TAULOC, WORK( IPW ),
++     $                  CALL ZAXPY( NQC2, -TAULOC( 1 ), WORK( IPW ),
+      $                              MAX( 1, NQC2 ), C( IOFFC1 ), LDC )
+-                     CALL ZGERC( MPV, NQC2, -TAULOC, WORK, 1,
++                     CALL ZGERC( MPV, NQC2, -TAULOC( 1 ), WORK, 1,
+      $                           WORK( IPW ), 1, C( IOFFC2 ), LDC )
+                   END IF
+ *
+@@ -421,9 +421,9 @@ SUBROUTINE PZLARZC( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                   IF( MYCOL.EQ.ICCOL2 ) THEN
+ *
+-                     TAULOC = DCONJG( TAU( JJV ) )
++                     TAULOC( 1 ) = DCONJG( TAU( JJV ) )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C )' * v
+ *
+@@ -446,11 +446,11 @@ SUBROUTINE PZLARZC( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *                       sub( C ) := sub( C ) - v * w'
+ *
+                         IF( MYROW.EQ.ICROW1 )
+-     $                     CALL ZAXPY( NQC2, -TAULOC, WORK,
++     $                     CALL ZAXPY( NQC2, -TAULOC( 1 ), WORK,
+      $                                 MAX( 1, NQC2 ), C( IOFFC1 ),
+      $                                 LDC )
+-                        CALL ZGERC( MPV, NQC2, -TAULOC, V( IOFFV ), 1,
+-     $                              WORK, 1, C( IOFFC2 ), LDC )
++                        CALL ZGERC( MPV, NQC2, -TAULOC( 1 ), V( IOFFV ),
++     $                              1, WORK, 1, C( IOFFC2 ), LDC )
+                      END IF
+ *
+                   END IF
+@@ -472,9 +472,9 @@ SUBROUTINE PZLARZC( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+                      IPW = MPV+1
+                      CALL ZGERV2D( ICTXT, IPW, 1, WORK, IPW, MYROW,
+      $                             IVCOL )
+-                     TAULOC = DCONJG( WORK( IPW ) )
++                     TAULOC( 1 ) = DCONJG( WORK( IPW ) )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C )' * v
+ *
+@@ -497,10 +497,10 @@ SUBROUTINE PZLARZC( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *                       sub( C ) := sub( C ) - v * w'
+ *
+                         IF( MYROW.EQ.ICROW1 )
+-     $                     CALL ZAXPY( NQC2, -TAULOC, WORK( IPW ),
++     $                     CALL ZAXPY( NQC2, -TAULOC( 1 ), WORK( IPW ),
+      $                                 MAX( 1, NQC2 ), C( IOFFC1 ),
+      $                                 LDC )
+-                        CALL ZGERC( MPV, NQC2, -TAULOC, WORK, 1,
++                        CALL ZGERC( MPV, NQC2, -TAULOC( 1 ), WORK, 1,
+      $                              WORK( IPW ), 1, C( IOFFC2 ), LDC )
+                      END IF
+ *
+@@ -531,17 +531,17 @@ SUBROUTINE PZLARZC( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                   CALL ZGEBS2D( ICTXT, 'Columnwise', ' ', 1, 1,
+      $                          TAU( IIV ), 1 )
+-                  TAULOC = DCONJG( TAU( IIV ) )
++                  TAULOC( 1 ) = DCONJG( TAU( IIV ) )
+ *
+                ELSE
+ *
+                   CALL ZGEBR2D( ICTXT, 'Columnwise', ' ', 1, 1, TAULOC,
+      $                          1, IVROW, MYCOL )
+-                  TAULOC = DCONJG( TAULOC )
++                  TAULOC( 1 ) = DCONJG( TAULOC( 1 ) )
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C )' * v
+ *
+@@ -564,10 +564,10 @@ SUBROUTINE PZLARZC( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *                 sub( C ) := sub( C ) - v * w'
+ *
+                   IF( MYROW.EQ.ICROW1 )
+-     $               CALL ZAXPY( NQC2, -TAULOC, WORK( IPW ),
++     $               CALL ZAXPY( NQC2, -TAULOC( 1 ), WORK( IPW ),
+      $                           MAX( 1, NQC2 ), C( IOFFC1 ), LDC )
+-                  CALL ZGERC( MPV, NQC2, -TAULOC, WORK, 1, WORK( IPW ),
+-     $                        1, C( IOFFC2 ), LDC )
++                  CALL ZGERC( MPV, NQC2, -TAULOC( 1 ), WORK, 1,
++     $                        WORK( IPW ), 1, C( IOFFC2 ), LDC )
+                END IF
+ *
+             ELSE
+@@ -582,18 +582,18 @@ SUBROUTINE PZLARZC( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+                   WORK( IPW ) = TAU( JJV )
+                   CALL ZGEBS2D( ICTXT, 'Rowwise', ROWBTOP, IPW, 1,
+      $                          WORK, IPW )
+-                  TAULOC = DCONJG( TAU( JJV ) )
++                  TAULOC( 1 ) = DCONJG( TAU( JJV ) )
+ *
+                ELSE
+ *
+                   IPW = MPV+1
+                   CALL ZGEBR2D( ICTXT, 'Rowwise', ROWBTOP, IPW, 1, WORK,
+      $                          IPW, MYROW, IVCOL )
+-                  TAULOC = DCONJG( WORK( IPW ) )
++                  TAULOC( 1 ) = DCONJG( WORK( IPW ) )
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C )' * v
+ *
+@@ -616,10 +616,10 @@ SUBROUTINE PZLARZC( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *                 sub( C ) := sub( C ) - v * w'
+ *
+                   IF( MYROW.EQ.ICROW1 )
+-     $               CALL ZAXPY( NQC2, -TAULOC, WORK( IPW ),
++     $               CALL ZAXPY( NQC2, -TAULOC( 1 ), WORK( IPW ),
+      $                           MAX( 1, NQC2 ), C( IOFFC1 ), LDC )
+-                  CALL ZGERC( MPV, NQC2, -TAULOC, WORK, 1, WORK( IPW ),
+-     $                        1, C( IOFFC2 ), LDC )
++                  CALL ZGERC( MPV, NQC2, -TAULOC( 1 ), WORK, 1,
++     $                        WORK( IPW ), 1, C( IOFFC2 ), LDC )
+                END IF
+ *
+             END IF
+@@ -648,9 +648,9 @@ SUBROUTINE PZLARZC( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                   IF( MYROW.EQ.ICROW2 ) THEN
+ *
+-                     TAULOC = DCONJG( TAU( IIV ) )
++                     TAULOC( 1 ) = DCONJG( TAU( IIV ) )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C ) * v
+ *
+@@ -671,12 +671,12 @@ SUBROUTINE PZLARZC( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+      $                               ICCOL2 )
+ *
+                         IF( MYCOL.EQ.ICCOL1 )
+-     $                     CALL ZAXPY( MPC2, -TAULOC, WORK, 1,
++     $                     CALL ZAXPY( MPC2, -TAULOC( 1 ), WORK, 1,
+      $                                 C( IOFFC1 ), 1 )
+ *
+ *                       sub( C ) := sub( C ) - w * v'
+ *
+-                        CALL ZGERC( MPC2, NQV, -TAULOC, WORK, 1,
++                        CALL ZGERC( MPC2, NQV, -TAULOC( 1 ), WORK, 1,
+      $                              V( IOFFV ), LDV, C( IOFFC2 ), LDC )
+                      END IF
+ *
+@@ -699,9 +699,9 @@ SUBROUTINE PZLARZC( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+                      IPW = NQV+1
+                      CALL ZGERV2D( ICTXT, IPW, 1, WORK, IPW, IVROW,
+      $                             MYCOL )
+-                     TAULOC = DCONJG( WORK( IPW ) )
++                     TAULOC( 1 ) = DCONJG( WORK( IPW ) )
+ *
+-                     IF( TAULOC.NE.ZERO ) THEN
++                     IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                       w := sub( C ) * v
+ *
+@@ -720,13 +720,14 @@ SUBROUTINE PZLARZC( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+      $                                WORK( IPW ), MAX( 1, MPC2 ),
+      $                                RDEST, ICCOL2 )
+                         IF( MYCOL.EQ.ICCOL1 )
+-     $                     CALL ZAXPY( MPC2, -TAULOC, WORK( IPW ), 1,
+-     $                                 C( IOFFC1 ), 1 )
++     $                     CALL ZAXPY( MPC2, -TAULOC( 1 ), WORK( IPW ),
++     $                                 1, C( IOFFC1 ), 1 )
+ *
+ *                       sub( C ) := sub( C ) - w * v'
+ *
+-                        CALL ZGERC( MPC2, NQV, -TAULOC, WORK( IPW ), 1,
+-     $                              WORK, 1, C( IOFFC2 ), LDC )
++                        CALL ZGERC( MPC2, NQV, -TAULOC( 1 ),
++     $                              WORK( IPW ), 1, WORK, 1,
++     $                              C( IOFFC2 ), LDC )
+                      END IF
+ *
+                   END IF
+@@ -751,17 +752,17 @@ SUBROUTINE PZLARZC( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                      CALL ZGEBS2D( ICTXT, 'Rowwise', ' ', 1, 1,
+      $                             TAU( JJV ), 1 )
+-                     TAULOC = DCONJG( TAU( JJV ) )
++                     TAULOC( 1 ) = DCONJG( TAU( JJV ) )
+ *
+                   ELSE
+ *
+                      CALL ZGEBR2D( ICTXT, 'Rowwise', ' ', 1, 1, TAULOC,
+      $                             1, MYROW, IVCOL )
+-                     TAULOC = DCONJG( TAULOC )
++                     TAULOC( 1 ) = DCONJG( TAULOC( 1 ) )
+ *
+                   END IF
+ *
+-                  IF( TAULOC.NE.ZERO ) THEN
++                  IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                    w := sub( C ) * v
+ *
+@@ -780,13 +781,13 @@ SUBROUTINE PZLARZC( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+      $                             WORK( IPW ), MAX( 1, MPC2 ), RDEST,
+      $                             ICCOL2 )
+                      IF( MYCOL.EQ.ICCOL1 )
+-     $                  CALL ZAXPY( MPC2, -TAULOC, WORK( IPW ), 1,
++     $                  CALL ZAXPY( MPC2, -TAULOC( 1 ), WORK( IPW ), 1,
+      $                              C( IOFFC1 ), 1 )
+ *
+ *                    sub( C ) := sub( C ) - w * v'
+ *
+-                     CALL ZGERC( MPC2, NQV, -TAULOC, WORK( IPW ), 1,
+-     $                           WORK, 1, C( IOFFC2 ), LDC )
++                     CALL ZGERC( MPC2, NQV, -TAULOC( 1 ), WORK( IPW ),
++     $                           1, WORK, 1, C( IOFFC2 ), LDC )
+                   END IF
+ *
+                END IF
+@@ -810,18 +811,18 @@ SUBROUTINE PZLARZC( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+                   WORK( IPW ) = TAU( IIV )
+                   CALL ZGEBS2D( ICTXT, 'Columnwise', COLBTOP, IPW, 1,
+      $                          WORK, IPW )
+-                  TAULOC = DCONJG( TAU( IIV ) )
++                  TAULOC( 1 ) = DCONJG( TAU( IIV ) )
+ *
+                ELSE
+ *
+                   IPW = NQV+1
+                   CALL ZGEBR2D( ICTXT, 'Columnwise', COLBTOP, IPW, 1,
+      $                          WORK, IPW, IVROW, MYCOL )
+-                  TAULOC = DCONJG( WORK( IPW ) )
++                  TAULOC( 1 ) = DCONJG( WORK( IPW ) )
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C ) * v
+ *
+@@ -841,13 +842,13 @@ SUBROUTINE PZLARZC( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+      $                          WORK( IPW ), MAX( 1, MPC2 ), RDEST,
+      $                          ICCOL2 )
+                   IF( MYCOL.EQ.ICCOL1 )
+-     $               CALL ZAXPY( MPC2, -TAULOC, WORK( IPW ), 1,
++     $               CALL ZAXPY( MPC2, -TAULOC( 1 ), WORK( IPW ), 1,
+      $                           C( IOFFC1 ), 1 )
+ *
+ *                 sub( C ) := sub( C ) - w * v'
+ *
+-                  CALL ZGERC( MPC2, NQV, -TAULOC, WORK( IPW ), 1, WORK,
+-     $                        1, C( IOFFC2 ), LDC )
++                  CALL ZGERC( MPC2, NQV, -TAULOC( 1 ), WORK( IPW ), 1,
++     $                        WORK, 1, C( IOFFC2 ), LDC )
+                END IF
+ *
+             ELSE
+@@ -866,17 +867,17 @@ SUBROUTINE PZLARZC( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+ *
+                   CALL ZGEBS2D( ICTXT, 'Rowwise', ' ', 1, 1, TAU( JJV ),
+      $                          1 )
+-                  TAULOC = DCONJG( TAU( JJV ) )
++                  TAULOC( 1 ) = DCONJG( TAU( JJV ) )
+ *
+                ELSE
+ *
+                   CALL ZGEBR2D( ICTXT, 'Rowwise', ' ', 1, 1, TAULOC, 1,
+      $                          MYROW, IVCOL )
+-                  TAULOC = DCONJG( TAULOC )
++                  TAULOC( 1 ) = DCONJG( TAULOC( 1 ) )
+ *
+                END IF
+ *
+-               IF( TAULOC.NE.ZERO ) THEN
++               IF( TAULOC( 1 ).NE.ZERO ) THEN
+ *
+ *                 w := sub( C ) * v
+ *
+@@ -895,13 +896,13 @@ SUBROUTINE PZLARZC( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C,
+      $                          WORK( IPW ), MAX( 1, MPC2 ), RDEST,
+      $                          ICCOL2 )
+                   IF( MYCOL.EQ.ICCOL1 )
+-     $               CALL ZAXPY( MPC2, -TAULOC, WORK( IPW ), 1,
++     $               CALL ZAXPY( MPC2, -TAULOC( 1 ), WORK( IPW ), 1,
+      $                           C( IOFFC1 ), 1 )
+ *
+ *                 sub( C ) := sub( C ) - w * v'
+ *
+-                  CALL ZGERC( MPC2, NQV, -TAULOC, WORK( IPW ), 1, WORK,
+-     $                        1, C( IOFFC2 ), LDC )
++                  CALL ZGERC( MPC2, NQV, -TAULOC( 1 ), WORK( IPW ), 1,
++     $                        WORK, 1, C( IOFFC2 ), LDC )
+                END IF
+ *
+             END IF
+diff --git a/SRC/pzlattrs.f b/SRC/pzlattrs.f
+index 819e476..5a54209 100644
+--- a/SRC/pzlattrs.f
++++ b/SRC/pzlattrs.f
+@@ -271,8 +271,9 @@ SUBROUTINE PZLATTRS( UPLO, TRANS, DIAG, NORMIN, N, A, IA, JA,
+      $                   JINC, JLAST, LDA, LDX, MB, MYCOL, MYROW, NB,
+      $                   NPCOL, NPROW, RSRC
+       DOUBLE PRECISION   BIGNUM, GROW, REC, SMLNUM, TJJ, TMAX, TSCAL,
+-     $                   XBND, XJ, XMAX
++     $                   XBND, XJ
+       COMPLEX*16         CSUMJ, TJJS, USCAL, XJTMP, ZDUM
++      DOUBLE PRECISION   XMAX( 1 )
+ *     ..
+ *     .. External Functions ..
+       LOGICAL            LSAME
+@@ -391,11 +392,11 @@ SUBROUTINE PZLATTRS( UPLO, TRANS, DIAG, NORMIN, N, A, IA, JA,
+ *     Compute a bound on the computed solution vector to see if the
+ *     Level 2 PBLAS routine PZTRSV can be used.
+ *
+-      XMAX = ZERO
++      XMAX( 1 ) = ZERO
+       CALL PZAMAX( N, ZDUM, IMAX, X, IX, JX, DESCX, 1 )
+-      XMAX = CABS2( ZDUM )
++      XMAX( 1 ) = CABS2( ZDUM )
+       CALL DGSUM2D( CONTXT, 'Row', ' ', 1, 1, XMAX, 1, -1, -1 )
+-      XBND = XMAX
++      XBND = XMAX( 1 )
+ *
+       IF( NOTRAN ) THEN
+ *
+@@ -590,16 +591,16 @@ SUBROUTINE PZLATTRS( UPLO, TRANS, DIAG, NORMIN, N, A, IA, JA,
+ *
+ *        Use a Level 1 PBLAS solve, scaling intermediate results.
+ *
+-         IF( XMAX.GT.BIGNUM*HALF ) THEN
++         IF( XMAX( 1 ).GT.BIGNUM*HALF ) THEN
+ *
+ *           Scale X so that its components are less than or equal to
+ *           BIGNUM in absolute value.
+ *
+-            SCALE = ( BIGNUM*HALF ) / XMAX
++            SCALE = ( BIGNUM*HALF ) / XMAX( 1 )
+             CALL PZDSCAL( N, SCALE, X, IX, JX, DESCX, 1 )
+-            XMAX = BIGNUM
++            XMAX( 1 ) = BIGNUM
+          ELSE
+-            XMAX = XMAX*TWO
++            XMAX( 1 ) = XMAX( 1 )*TWO
+          END IF
+ *
+          IF( NOTRAN ) THEN
+@@ -651,7 +652,7 @@ SUBROUTINE PZLATTRS( UPLO, TRANS, DIAG, NORMIN, N, A, IA, JA,
+                         CALL PZDSCAL( N, REC, X, IX, JX, DESCX, 1 )
+                         XJTMP = XJTMP*REC
+                         SCALE = SCALE*REC
+-                        XMAX = XMAX*REC
++                        XMAX( 1 ) = XMAX( 1 )*REC
+                      END IF
+                   END IF
+ *                 X( J ) = ZLADIV( X( J ), TJJS )
+@@ -682,7 +683,7 @@ SUBROUTINE PZLATTRS( UPLO, TRANS, DIAG, NORMIN, N, A, IA, JA,
+                      CALL PZDSCAL( N, REC, X, IX, JX, DESCX, 1 )
+                      XJTMP = XJTMP*REC
+                      SCALE = SCALE*REC
+-                     XMAX = XMAX*REC
++                     XMAX( 1 ) = XMAX( 1 )*REC
+                   END IF
+ *                 X( J ) = ZLADIV( X( J ), TJJS )
+ *                 XJ = CABS1( X( J ) )
+@@ -706,7 +707,7 @@ SUBROUTINE PZLATTRS( UPLO, TRANS, DIAG, NORMIN, N, A, IA, JA,
+                   XJTMP = CONE
+                   XJ = ONE
+                   SCALE = ZERO
+-                  XMAX = ZERO
++                  XMAX( 1 ) = ZERO
+                END IF
+    90          CONTINUE
+ *
+@@ -715,7 +716,7 @@ SUBROUTINE PZLATTRS( UPLO, TRANS, DIAG, NORMIN, N, A, IA, JA,
+ *
+                IF( XJ.GT.ONE ) THEN
+                   REC = ONE / XJ
+-                  IF( CNORM( J ).GT.( BIGNUM-XMAX )*REC ) THEN
++                  IF( CNORM( J ).GT.( BIGNUM-XMAX( 1 ) )*REC ) THEN
+ *
+ *                    Scale x by 1/(2*abs(x(j))).
+ *
+@@ -724,7 +725,7 @@ SUBROUTINE PZLATTRS( UPLO, TRANS, DIAG, NORMIN, N, A, IA, JA,
+                      XJTMP = XJTMP*REC
+                      SCALE = SCALE*REC
+                   END IF
+-               ELSE IF( XJ*CNORM( J ).GT.( BIGNUM-XMAX ) ) THEN
++               ELSE IF( XJ*CNORM( J ).GT.( BIGNUM-XMAX( 1 ) ) ) THEN
+ *
+ *                 Scale x by 1/2.
+ *
+@@ -743,7 +744,7 @@ SUBROUTINE PZLATTRS( UPLO, TRANS, DIAG, NORMIN, N, A, IA, JA,
+                      CALL PZAXPY( J-1, ZDUM, A, IA, JA+J-1, DESCA, 1, X,
+      $                            IX, JX, DESCX, 1 )
+                      CALL PZAMAX( J-1, ZDUM, IMAX, X, IX, JX, DESCX, 1 )
+-                     XMAX = CABS1( ZDUM )
++                     XMAX( 1 ) = CABS1( ZDUM )
+                      CALL DGSUM2D( CONTXT, 'Row', ' ', 1, 1, XMAX, 1,
+      $                             -1, -1 )
+                   END IF
+@@ -757,7 +758,7 @@ SUBROUTINE PZLATTRS( UPLO, TRANS, DIAG, NORMIN, N, A, IA, JA,
+                      CALL PZAXPY( N-J, ZDUM, A, IA+J, JA+J-1, DESCA, 1,
+      $                            X, IX+J, JX, DESCX, 1 )
+                      CALL PZAMAX( N-J, ZDUM, I, X, IX+J, JX, DESCX, 1 )
+-                     XMAX = CABS1( ZDUM )
++                     XMAX( 1 ) = CABS1( ZDUM )
+                      CALL DGSUM2D( CONTXT, 'Row', ' ', 1, 1, XMAX, 1,
+      $                             -1, -1 )
+                   END IF
+@@ -785,7 +786,7 @@ SUBROUTINE PZLATTRS( UPLO, TRANS, DIAG, NORMIN, N, A, IA, JA,
+                END IF
+                XJ = CABS1( XJTMP )
+                USCAL = DCMPLX( TSCAL )
+-               REC = ONE / MAX( XMAX, ONE )
++               REC = ONE / MAX( XMAX( 1 ), ONE )
+                IF( CNORM( J ).GT.( BIGNUM-XJ )*REC ) THEN
+ *
+ *                 If x(j) could overflow, scale x by 1/(2*XMAX).
+@@ -820,7 +821,7 @@ SUBROUTINE PZLATTRS( UPLO, TRANS, DIAG, NORMIN, N, A, IA, JA,
+                      CALL PZDSCAL( N, REC, X, IX, JX, DESCX, 1 )
+                      XJTMP = XJTMP*REC
+                      SCALE = SCALE*REC
+-                     XMAX = XMAX*REC
++                     XMAX( 1 ) = XMAX( 1 )*REC
+                   END IF
+                END IF
+ *
+@@ -924,7 +925,7 @@ SUBROUTINE PZLATTRS( UPLO, TRANS, DIAG, NORMIN, N, A, IA, JA,
+                            CALL PZDSCAL( N, REC, X, IX, JX, DESCX, 1 )
+                            XJTMP = XJTMP*REC
+                            SCALE = SCALE*REC
+-                           XMAX = XMAX*REC
++                           XMAX( 1 ) = XMAX( 1 )*REC
+                         END IF
+                      END IF
+ *                    X( J ) = ZLADIV( X( J ), TJJS )
+@@ -945,7 +946,7 @@ SUBROUTINE PZLATTRS( UPLO, TRANS, DIAG, NORMIN, N, A, IA, JA,
+                         CALL PZDSCAL( N, REC, X, IX, JX, DESCX, 1 )
+                         XJTMP = XJTMP*REC
+                         SCALE = SCALE*REC
+-                        XMAX = XMAX*REC
++                        XMAX( 1 ) = XMAX( 1 )*REC
+                      END IF
+ *                    X( J ) = ZLADIV( X( J ), TJJS )
+                      XJTMP = ZLADIV( XJTMP, TJJS )
+@@ -966,7 +967,7 @@ SUBROUTINE PZLATTRS( UPLO, TRANS, DIAG, NORMIN, N, A, IA, JA,
+                      END IF
+                      XJTMP = CONE
+                      SCALE = ZERO
+-                     XMAX = ZERO
++                     XMAX( 1 ) = ZERO
+                   END IF
+   110             CONTINUE
+                ELSE
+@@ -981,7 +982,7 @@ SUBROUTINE PZLATTRS( UPLO, TRANS, DIAG, NORMIN, N, A, IA, JA,
+                      X( IROWX ) = XJTMP
+                   END IF
+                END IF
+-               XMAX = MAX( XMAX, CABS1( XJTMP ) )
++               XMAX( 1 ) = MAX( XMAX( 1 ), CABS1( XJTMP ) )
+   120       CONTINUE
+ *
+          ELSE
+@@ -1004,7 +1005,7 @@ SUBROUTINE PZLATTRS( UPLO, TRANS, DIAG, NORMIN, N, A, IA, JA,
+                END IF
+                XJ = CABS1( XJTMP )
+                USCAL = TSCAL
+-               REC = ONE / MAX( XMAX, ONE )
++               REC = ONE / MAX( XMAX( 1 ), ONE )
+                IF( CNORM( J ).GT.( BIGNUM-XJ )*REC ) THEN
+ *
+ *                 If x(j) could overflow, scale x by 1/(2*XMAX).
+@@ -1039,7 +1040,7 @@ SUBROUTINE PZLATTRS( UPLO, TRANS, DIAG, NORMIN, N, A, IA, JA,
+                      CALL PZDSCAL( N, REC, X, IX, JX, DESCX, 1 )
+                      XJTMP = XJTMP*REC
+                      SCALE = SCALE*REC
+-                     XMAX = XMAX*REC
++                     XMAX( 1 ) = XMAX( 1 )*REC
+                   END IF
+                END IF
+ *
+@@ -1145,7 +1146,7 @@ SUBROUTINE PZLATTRS( UPLO, TRANS, DIAG, NORMIN, N, A, IA, JA,
+                            CALL PZDSCAL( N, REC, X, IX, JX, DESCX, 1 )
+                            XJTMP = XJTMP*REC
+                            SCALE = SCALE*REC
+-                           XMAX = XMAX*REC
++                           XMAX( 1 ) = XMAX( 1 )*REC
+                         END IF
+                      END IF
+ *                    X( J ) = ZLADIV( X( J ), TJJS )
+@@ -1164,7 +1165,7 @@ SUBROUTINE PZLATTRS( UPLO, TRANS, DIAG, NORMIN, N, A, IA, JA,
+                         CALL PZDSCAL( N, REC, X, IX, JX, DESCX, 1 )
+                         XJTMP = XJTMP*REC
+                         SCALE = SCALE*REC
+-                        XMAX = XMAX*REC
++                        XMAX( 1 ) = XMAX( 1 )*REC
+                      END IF
+ *                    X( J ) = ZLADIV( X( J ), TJJS )
+                      XJTMP = ZLADIV( XJTMP, TJJS )
+@@ -1181,7 +1182,7 @@ SUBROUTINE PZLATTRS( UPLO, TRANS, DIAG, NORMIN, N, A, IA, JA,
+      $                  X( IROWX ) = CONE
+                      XJTMP = CONE
+                      SCALE = ZERO
+-                     XMAX = ZERO
++                     XMAX( 1 ) = ZERO
+                   END IF
+   130             CONTINUE
+                ELSE
+@@ -1194,7 +1195,7 @@ SUBROUTINE PZLATTRS( UPLO, TRANS, DIAG, NORMIN, N, A, IA, JA,
+                   IF( ( MYROW.EQ.ITMP1X ) .AND. ( MYCOL.EQ.ITMP2X ) )
+      $               X( IROWX ) = XJTMP
+                END IF
+-               XMAX = MAX( XMAX, CABS1( XJTMP ) )
++               XMAX( 1 ) = MAX( XMAX( 1 ), CABS1( XJTMP ) )
+   140       CONTINUE
+          END IF
+          SCALE = SCALE / TSCAL
+diff --git a/SRC/pzlawil.f b/SRC/pzlawil.f
+index e89a9a3..7e502ef 100644
+--- a/SRC/pzlawil.f
++++ b/SRC/pzlawil.f
+@@ -124,11 +124,10 @@ SUBROUTINE PZLAWIL( II, JJ, M, A, DESCA, H44, H33, H43H34, V )
+      $                   MODKM1, MYCOL, MYROW, NPCOL, NPROW, NUM, RIGHT,
+      $                   RSRC, UP
+       DOUBLE PRECISION   S
+-      COMPLEX*16         CDUM, H11, H12, H21, H22, H33S, H44S, V1, V2,
+-     $                   V3
++      COMPLEX*16         CDUM, H22, H33S, H44S, V1, V2
+ *     ..
+ *     .. Local Arrays ..
+-      COMPLEX*16         BUF( 4 )
++      COMPLEX*16         BUF( 4 ), H11( 1 ), H12( 1 ), H21( 1 ), V3( 1 )
+ *     ..
+ *     .. External Subroutines ..
+       EXTERNAL           BLACS_GRIDINFO, INFOG2L, ZGERV2D, ZGESD2D
+@@ -181,18 +180,18 @@ SUBROUTINE PZLAWIL( II, JJ, M, A, DESCA, H44, H33, H43H34, V )
+             IF( NPCOL.GT.1 ) THEN
+                CALL ZGERV2D( CONTXT, 1, 1, V3, 1, MYROW, LEFT )
+             ELSE
+-               V3 = A( ( ICOL-2 )*LDA+IROW )
++               V3( 1 ) = A( ( ICOL-2 )*LDA+IROW )
+             END IF
+             IF( NUM.GT.1 ) THEN
+                CALL ZGERV2D( CONTXT, 4, 1, BUF, 4, UP, LEFT )
+-               H11 = BUF( 1 )
+-               H21 = BUF( 2 )
+-               H12 = BUF( 3 )
++               H11( 1 ) = BUF( 1 )
++               H21( 1 ) = BUF( 2 )
++               H12( 1 ) = BUF( 3 )
+                H22 = BUF( 4 )
+             ELSE
+-               H11 = A( ( ICOL-3 )*LDA+IROW-2 )
+-               H21 = A( ( ICOL-3 )*LDA+IROW-1 )
+-               H12 = A( ( ICOL-2 )*LDA+IROW-2 )
++               H11( 1 ) = A( ( ICOL-3 )*LDA+IROW-2 )
++               H21( 1 ) = A( ( ICOL-3 )*LDA+IROW-1 )
++               H12( 1 ) = A( ( ICOL-2 )*LDA+IROW-2 )
+                H22 = A( ( ICOL-2 )*LDA+IROW-1 )
+             END IF
+          END IF
+@@ -225,20 +224,20 @@ SUBROUTINE PZLAWIL( II, JJ, M, A, DESCA, H44, H33, H43H34, V )
+             IF( NUM.GT.1 ) THEN
+                CALL ZGERV2D( CONTXT, 1, 1, H11, 1, UP, LEFT )
+             ELSE
+-               H11 = A( ( ICOL-3 )*LDA+IROW-2 )
++               H11( 1 ) = A( ( ICOL-3 )*LDA+IROW-2 )
+             END IF
+             IF( NPROW.GT.1 ) THEN
+                CALL ZGERV2D( CONTXT, 1, 1, H12, 1, UP, MYCOL )
+             ELSE
+-               H12 = A( ( ICOL-2 )*LDA+IROW-2 )
++               H12( 1 ) = A( ( ICOL-2 )*LDA+IROW-2 )
+             END IF
+             IF( NPCOL.GT.1 ) THEN
+                CALL ZGERV2D( CONTXT, 1, 1, H21, 1, MYROW, LEFT )
+             ELSE
+-               H21 = A( ( ICOL-3 )*LDA+IROW-1 )
++               H21( 1 ) = A( ( ICOL-3 )*LDA+IROW-1 )
+             END IF
+             H22 = A( ( ICOL-2 )*LDA+IROW-1 )
+-            V3 = A( ( ICOL-2 )*LDA+IROW )
++            V3( 1 ) = A( ( ICOL-2 )*LDA+IROW )
+          END IF
+       END IF
+       IF( ( MYROW.NE.II ) .OR. ( MYCOL.NE.JJ ) )
+@@ -247,24 +246,24 @@ SUBROUTINE PZLAWIL( II, JJ, M, A, DESCA, H44, H33, H43H34, V )
+       IF( MODKM1.GT.1 ) THEN
+          CALL INFOG2L( M+2, M+2, DESCA, NPROW, NPCOL, MYROW, MYCOL,
+      $                 IROW, ICOL, RSRC, JSRC )
+-         H11 = A( ( ICOL-3 )*LDA+IROW-2 )
+-         H21 = A( ( ICOL-3 )*LDA+IROW-1 )
+-         H12 = A( ( ICOL-2 )*LDA+IROW-2 )
++         H11( 1 ) = A( ( ICOL-3 )*LDA+IROW-2 )
++         H21( 1 ) = A( ( ICOL-3 )*LDA+IROW-1 )
++         H12( 1 ) = A( ( ICOL-2 )*LDA+IROW-2 )
+          H22 = A( ( ICOL-2 )*LDA+IROW-1 )
+-         V3 = A( ( ICOL-2 )*LDA+IROW )
++         V3( 1 ) = A( ( ICOL-2 )*LDA+IROW )
+       END IF
+ *
+-      H44S = H44 - H11
+-      H33S = H33 - H11
+-      V1 = ( H33S*H44S-H43H34 ) / H21 + H12
+-      V2 = H22 - H11 - H33S - H44S
+-      S = CABS1( V1 ) + CABS1( V2 ) + CABS1( V3 )
++      H44S = H44 - H11( 1 )
++      H33S = H33 - H11( 1 )
++      V1 = ( H33S*H44S-H43H34 ) / H21( 1 ) + H12( 1 )
++      V2 = H22 - H11( 1 ) - H33S - H44S
++      S = CABS1( V1 ) + CABS1( V2 ) + CABS1( V3( 1 ) )
+       V1 = V1 / S
+       V2 = V2 / S
+-      V3 = V3 / S
++      V3( 1 ) = V3( 1 ) / S
+       V( 1 ) = V1
+       V( 2 ) = V2
+-      V( 3 ) = V3
++      V( 3 ) = V3( 1 )
+ *
+       RETURN
+ *
+diff --git a/SRC/pztrevc.f b/SRC/pztrevc.f
+index 0536475..3b27286 100644
+--- a/SRC/pztrevc.f
++++ b/SRC/pztrevc.f
+@@ -218,11 +218,12 @@ SUBROUTINE PZTREVC( SIDE, HOWMNY, SELECT, N, T, DESCT, VL, DESCVL,
+      $                   ITMP2, J, K, KI, LDT, LDVL, LDVR, LDW, MB,
+      $                   MYCOL, MYROW, NB, NPCOL, NPROW, RSRC
+       REAL               SELF
+-      DOUBLE PRECISION   OVFL, REMAXD, SCALE, SMIN, SMLNUM, ULP, UNFL
++      DOUBLE PRECISION   OVFL, REMAXD, SCALE, SMLNUM, ULP, UNFL
+       COMPLEX*16         CDUM, REMAXC, SHIFT
+ *     ..
+ *     .. Local Arrays ..
+       INTEGER            DESCW( DLEN_ )
++      DOUBLE PRECISION   SMIN( 1 )
+ *     ..
+ *     .. External Functions ..
+       LOGICAL            LSAME
+@@ -355,13 +356,13 @@ SUBROUTINE PZTREVC( SIDE, HOWMNY, SELECT, N, T, DESCT, VL, DESCVL,
+      $            GO TO 70
+             END IF
+ *
+-            SMIN = ZERO
++            SMIN( 1 ) = ZERO
+             SHIFT = CZERO
+             CALL INFOG2L( KI, KI, DESCT, NPROW, NPCOL, MYROW, MYCOL,
+      $                    IROW, ICOL, ITMP1, ITMP2 )
+             IF( ( MYROW.EQ.ITMP1 ) .AND. ( MYCOL.EQ.ITMP2 ) ) THEN
+                SHIFT = T( ( ICOL-1 )*LDT+IROW )
+-               SMIN = MAX( ULP*( CABS1( SHIFT ) ), SMLNUM )
++               SMIN( 1 ) = MAX( ULP*( CABS1( SHIFT ) ), SMLNUM )
+             END IF
+             CALL DGSUM2D( CONTXT, 'ALL', ' ', 1, 1, SMIN, 1, -1, -1 )
+             CALL ZGSUM2D( CONTXT, 'ALL', ' ', 1, 1, SHIFT, 1, -1, -1 )
+@@ -396,8 +397,9 @@ SUBROUTINE PZTREVC( SIDE, HOWMNY, SELECT, N, T, DESCT, VL, DESCVL,
+                IF( ( MYROW.EQ.ITMP1 ) .AND. ( MYCOL.EQ.ITMP2 ) ) THEN
+                   T( ( ICOL-1 )*LDT+IROW ) = T( ( ICOL-1 )*LDT+IROW ) -
+      $               SHIFT
+-                  IF( CABS1( T( ( ICOL-1 )*LDT+IROW ) ).LT.SMIN ) THEN
+-                     T( ( ICOL-1 )*LDT+IROW ) = DCMPLX( SMIN )
++                  IF( CABS1( T( ( ICOL-1 )*LDT+IROW ) ).LT.SMIN( 1 ) )
++     $            THEN
++                     T( ( ICOL-1 )*LDT+IROW ) = DCMPLX( SMIN( 1 ) )
+                   END IF
+                END IF
+    50       CONTINUE
+@@ -467,13 +469,13 @@ SUBROUTINE PZTREVC( SIDE, HOWMNY, SELECT, N, T, DESCT, VL, DESCVL,
+      $            GO TO 110
+             END IF
+ *
+-            SMIN = ZERO
++            SMIN( 1 ) = ZERO
+             SHIFT = CZERO
+             CALL INFOG2L( KI, KI, DESCT, NPROW, NPCOL, MYROW, MYCOL,
+      $                    IROW, ICOL, ITMP1, ITMP2 )
+             IF( ( MYROW.EQ.ITMP1 ) .AND. ( MYCOL.EQ.ITMP2 ) ) THEN
+                SHIFT = T( ( ICOL-1 )*LDT+IROW )
+-               SMIN = MAX( ULP*( CABS1( SHIFT ) ), SMLNUM )
++               SMIN( 1 ) = MAX( ULP*( CABS1( SHIFT ) ), SMLNUM )
+             END IF
+             CALL DGSUM2D( CONTXT, 'ALL', ' ', 1, 1, SMIN, 1, -1, -1 )
+             CALL ZGSUM2D( CONTXT, 'ALL', ' ', 1, 1, SHIFT, 1, -1, -1 )
+@@ -507,8 +509,8 @@ SUBROUTINE PZTREVC( SIDE, HOWMNY, SELECT, N, T, DESCT, VL, DESCVL,
+                IF( ( MYROW.EQ.ITMP1 ) .AND. ( MYCOL.EQ.ITMP2 ) ) THEN
+                   T( ( ICOL-1 )*LDT+IROW ) = T( ( ICOL-1 )*LDT+IROW ) -
+      $               SHIFT
+-                  IF( CABS1( T( ( ICOL-1 )*LDT+IROW ) ).LT.SMIN )
+-     $               T( ( ICOL-1 )*LDT+IROW ) = DCMPLX( SMIN )
++                  IF( CABS1( T( ( ICOL-1 )*LDT+IROW ) ).LT.SMIN( 1 ) )
++     $               T( ( ICOL-1 )*LDT+IROW ) = DCMPLX( SMIN( 1 ) )
+                END IF
+    90       CONTINUE
+ *
+
+From 189c84001bcd564296a475c5c757afc9f337e828 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Tiziano=20M=C3=BCller?= <tiziano.mueller@chem.uzh.ch>
+Date: Thu, 25 Jun 2020 18:37:34 +0200
+Subject: [PATCH] use -std=legacy for tests with GCC-10+
+
+---
+ BLACS/TESTING/CMakeLists.txt | 10 +++++++---
+ PBLAS/TESTING/CMakeLists.txt |  7 ++++---
+ PBLAS/TIMING/CMakeLists.txt  |  5 +++--
+ TESTING/EIG/CMakeLists.txt   |  3 +++
+ TESTING/LIN/CMakeLists.txt   |  4 ++++
+ 5 files changed, 21 insertions(+), 8 deletions(-)
+
+diff --git a/BLACS/TESTING/CMakeLists.txt b/BLACS/TESTING/CMakeLists.txt
+index d8846b5..4e91ac2 100644
+--- a/BLACS/TESTING/CMakeLists.txt
++++ b/BLACS/TESTING/CMakeLists.txt
+@@ -1,10 +1,14 @@
+-set(FTestObj  
++set(FTestObj
+    blacstest.f btprim.f tools.f)
+ 
++if ("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL 10)
++    set_source_files_properties(blacstest.f PROPERTIES COMPILE_FLAGS "-std=legacy")
++endif()
++
+ add_executable(xFbtest ${FTestObj})
+ target_link_libraries(xFbtest scalapack)
+ 
+-set(CTestObj  
++set(CTestObj
+    Cbt.c)
+ 
+ set_property(
+@@ -46,4 +50,4 @@ add_test(xFbtest
+     -DRUNTIMEDIR=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
+     -DSOURCEDIR=${CMAKE_CURRENT_SOURCE_DIR}
+     -P ${CMAKE_CURRENT_SOURCE_DIR}/runtest.cmake
+-    )
+\ No newline at end of file
++    )
+diff --git a/PBLAS/TESTING/CMakeLists.txt b/PBLAS/TESTING/CMakeLists.txt
+index e60f5e4..ee77091 100644
+--- a/PBLAS/TESTING/CMakeLists.txt
++++ b/PBLAS/TESTING/CMakeLists.txt
+@@ -10,7 +10,7 @@ set (zpbtcom pzblastst.f dlamch.f ${pbtcom})
+ 
+ set_property(
+    SOURCE ${PblasErrorHandler}
+-   APPEND PROPERTY COMPILE_DEFINITIONS TestingPblas 
++   APPEND PROPERTY COMPILE_DEFINITIONS TestingPblas
+    )
+ 
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${SCALAPACK_BINARY_DIR}/PBLAS/TESTING)
+@@ -74,5 +74,6 @@ add_test(dpb3tst ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} 4 ./dpb3tst)
+ add_test(cpb3tst ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} 4 ./cpb3tst)
+ add_test(zpb3tst ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} 4 ./zpb3tst)
+ 
+-
+-
++if ("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL 10)
++    set( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -std=legacy" )  # local to this directory
++endif()
+diff --git a/PBLAS/TIMING/CMakeLists.txt b/PBLAS/TIMING/CMakeLists.txt
+index 763330f..208bbc3 100644
+--- a/PBLAS/TIMING/CMakeLists.txt
++++ b/PBLAS/TIMING/CMakeLists.txt
+@@ -74,5 +74,6 @@ add_test(dpb3tim ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} 4 ./dpb3tim)
+ add_test(cpb3tim ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} 4 ./cpb3tim)
+ add_test(zpb3tim ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} 4 ./zpb3tim)
+ 
+-
+-
++if ("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL 10)
++    set( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -std=legacy" )  # local to this directory
++endif()
+diff --git a/TESTING/EIG/CMakeLists.txt b/TESTING/EIG/CMakeLists.txt
+index 97c7036..19a1f34 100644
+--- a/TESTING/EIG/CMakeLists.txt
++++ b/TESTING/EIG/CMakeLists.txt
+@@ -97,3 +97,6 @@ target_link_libraries(xzheevr scalapack ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES})
+ target_link_libraries(xshseqr scalapack ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES})
+ target_link_libraries(xdhseqr scalapack ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES})
+ 
++if ("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL 10)
++    set( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -std=legacy" )  # local to this directory
++endif()
+diff --git a/TESTING/LIN/CMakeLists.txt b/TESTING/LIN/CMakeLists.txt
+index 55a53e9..65f169b 100644
+--- a/TESTING/LIN/CMakeLists.txt
++++ b/TESTING/LIN/CMakeLists.txt
+@@ -110,3 +110,7 @@ target_link_libraries(xsls scalapack ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES})
+ target_link_libraries(xdls scalapack ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES})
+ target_link_libraries(xcls scalapack ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES})
+ target_link_libraries(xzls scalapack ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES})
++
++if ("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL 10)
++    set( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -std=legacy" )  # local to this directory
++endif()
diff --git a/gnu/packages/patches/sendgmail-accept-ignored-gsuite-flag.patch b/gnu/packages/patches/sendgmail-accept-ignored-gsuite-flag.patch
new file mode 100644
index 0000000000..8405ff4e42
--- /dev/null
+++ b/gnu/packages/patches/sendgmail-accept-ignored-gsuite-flag.patch
@@ -0,0 +1,39 @@
+From 854490dc4a8a6a661b4750730c3ff749519f6e36 Mon Sep 17 00:00:00 2001
+From: Philip McGrath <philip@philipmcgrath.com>
+Date: Sun, 14 Nov 2021 10:14:24 -0500
+Subject: [PATCH] sendgmail: accept and ignore a "-gsuite" flag
+
+Accepting a "-gsuite" flag provides compatability with
+https://github.com/Flameeyes/gmail-oauth2-tools/commit/eabb456
+so users do not have to change their scripts or config files.
+
+Full hash of original: eabb45608ff4ce04045ff4ea92d05450e789ac81
+
+Related to https://github.com/google/gmail-oauth2-tools/pull/17
+---
+ go/sendgmail/main.go | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/go/sendgmail/main.go b/go/sendgmail/main.go
+index 405aa1b..5cfd0c1 100644
+--- a/go/sendgmail/main.go
++++ b/go/sendgmail/main.go
+@@ -40,6 +40,7 @@ var (
+ 	setUp  bool
+ 	dummyF string
+ 	dummyI bool
++	gsuite bool
+ )
+ 
+ func init() {
+@@ -47,6 +48,7 @@ func init() {
+ 	flag.BoolVar(&setUp, "setup", false, "If true, sendgmail sets up the sender's OAuth2 token and then exits.")
+ 	flag.StringVar(&dummyF, "f", "", "Dummy flag for compatibility with sendmail.")
+ 	flag.BoolVar(&dummyI, "i", true, "Dummy flag for compatibility with sendmail.")
++	flag.BoolVar(&gsuite, "gsuite", true, "Dummy flag for compatibility with other forks of sendgmail.")
+ }
+ 
+ func main() {
+-- 
+2.32.0
+
diff --git a/gnu/packages/patches/sendgmail-remove-domain-restriction.patch b/gnu/packages/patches/sendgmail-remove-domain-restriction.patch
new file mode 100644
index 0000000000..d23af33375
--- /dev/null
+++ b/gnu/packages/patches/sendgmail-remove-domain-restriction.patch
@@ -0,0 +1,34 @@
+From a5ecd1b2302d0def2f6f8349747022a615a9f017 Mon Sep 17 00:00:00 2001
+From: Tamas K Lengyel <tamas@tklengyel.com>
+Date: Tue, 26 May 2020 13:27:50 -0600
+Subject: [PATCH] Don't limit to email with @gmail.com
+
+---
+ go/sendgmail/main.go | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/go/sendgmail/main.go b/go/sendgmail/main.go
+index b35ef23..405aa1b 100644
+--- a/go/sendgmail/main.go
++++ b/go/sendgmail/main.go
+@@ -30,7 +30,6 @@ import (
+ 	"log"
+ 	"net/smtp"
+ 	"os"
+-	"strings"
+ 
+ 	"golang.org/x/oauth2"
+ 	googleOAuth2 "golang.org/x/oauth2/google"
+@@ -52,9 +51,6 @@ func init() {
+ 
+ func main() {
+ 	flag.Parse()
+-	if atDomain := "@gmail.com"; !strings.HasSuffix(sender, atDomain) {
+-		log.Fatalf("-sender must specify an %v email address.", atDomain)
+-	}
+ 	config := getConfig()
+ 	tokenPath := fmt.Sprintf("%v/.sendgmail.%v.json", os.Getenv("HOME"), sender)
+ 	if setUp {
+-- 
+2.32.0
+
diff --git a/gnu/packages/patches/shadow-hurd-pctrl.patch b/gnu/packages/patches/shadow-hurd-pctrl.patch
deleted file mode 100644
index 2e376e19a9..0000000000
--- a/gnu/packages/patches/shadow-hurd-pctrl.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-Avoid including sys/prctl.h on the Hurd.
-
-Upstream status: Not submitted.
-
---- shadow-4.8.1/libmisc/idmapping.c.orig	2020-03-07 16:32:05.000000000 -0500
-+++ shadow-4.8.1/libmisc/idmapping.c	2020-03-07 16:32:27.000000000 -0500
-@@ -36,8 +36,8 @@
- #include <stdio.h>
- #include "prototypes.h"
- #include "idmapping.h"
--#include <sys/prctl.h>
- #if HAVE_SYS_CAPABILITY_H
-+#include <sys/prctl.h>
- #include <sys/capability.h>
- #endif
- 
diff --git a/gnu/packages/patches/spice-vdagent-glib-2.68.patch b/gnu/packages/patches/spice-vdagent-glib-2.68.patch
new file mode 100644
index 0000000000..cd5f13a909
--- /dev/null
+++ b/gnu/packages/patches/spice-vdagent-glib-2.68.patch
@@ -0,0 +1,112 @@
+From 8348ef3c6121247e2b8be0641bbf3df3d55d9bff Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com>
+Date: Tue, 4 May 2021 13:20:47 +0400
+Subject: [PATCH] Fix g_memdup deprecation warning with glib >= 2.68
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Related to:
+https://bugzilla.redhat.com/show_bug.cgi?id=1943059
+
+Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
+---
+ configure.ac            | 4 ++++
+ src/vdagent/vdagent.c   | 4 ++--
+ src/vdagent/x11-randr.c | 2 +-
+ src/vdagentd/vdagentd.c | 8 ++++----
+ 4 files changed, 11 insertions(+), 7 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 7b2a99c..3de9b9b 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -124,6 +124,10 @@ PKG_CHECK_MODULES(ALSA, [alsa >= 1.0.22])
+ PKG_CHECK_MODULES([DBUS], [dbus-1])
+ PKG_CHECK_MODULES([DRM], [libdrm])
+ 
++PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.68], [], [
++    AC_DEFINE(g_memdup2, g_memdup, [GLib2 < 2.68 compatibility])
++])
++
+ if test "$with_session_info" = "auto" || test "$with_session_info" = "systemd"; then
+     PKG_CHECK_MODULES([LIBSYSTEMD_LOGIN],
+                       [libsystemd >= 209],
+diff --git a/src/vdagent/vdagent.c b/src/vdagent/vdagent.c
+index 0c69907..fd08522 100644
+--- a/src/vdagent/vdagent.c
++++ b/src/vdagent/vdagent.c
+@@ -228,7 +228,7 @@ static void daemon_read_complete(UdscsConnection *conn,
+         break;
+     case VDAGENTD_AUDIO_VOLUME_SYNC: {
+         VDAgentAudioVolumeSync *avs = (VDAgentAudioVolumeSync *)data;
+-        uint16_t *volume = g_memdup(avs->volume, sizeof(uint16_t) * avs->nchannels);
++        uint16_t *volume = g_memdup2(avs->volume, sizeof(uint16_t) * avs->nchannels);
+ 
+         if (avs->is_playback) {
+             vdagent_audio_playback_sync(avs->mute, avs->nchannels, volume);
+@@ -414,7 +414,7 @@ int main(int argc, char *argv[])
+     GOptionContext *context;
+     GError *error = NULL;
+     VDAgent *agent;
+-    char **orig_argv = g_memdup(argv, sizeof(char*) * (argc+1));
++    char **orig_argv = g_memdup2(argv, sizeof(char*) * (argc+1));
+     orig_argv[argc] = NULL; /* To avoid clang analyzer false-positive */
+ 
+     context = g_option_context_new(NULL);
+diff --git a/src/vdagent/x11-randr.c b/src/vdagent/x11-randr.c
+index 27404a1..037aded 100644
+--- a/src/vdagent/x11-randr.c
++++ b/src/vdagent/x11-randr.c
+@@ -982,7 +982,7 @@ void vdagent_x11_set_monitor_config(struct vdagent_x11 *x11,
+                    fullscreen it will keep sending the failing config. */
+                 g_free(x11->randr.failed_conf);
+                 x11->randr.failed_conf =
+-                    g_memdup(mon_config, config_size(mon_config->num_of_monitors));
++                    g_memdup2(mon_config, config_size(mon_config->num_of_monitors));
+                 return;
+             }
+         }
+diff --git a/src/vdagentd/vdagentd.c b/src/vdagentd/vdagentd.c
+index 78378aa..3e59331 100644
+--- a/src/vdagentd/vdagentd.c
++++ b/src/vdagentd/vdagentd.c
+@@ -216,7 +216,7 @@ static void do_client_monitors(VirtioPort *vport, int port_nr,
+     vdagentd_write_xorg_conf(new_monitors);
+ 
+     g_free(mon_config);
+-    mon_config = g_memdup(new_monitors, size);
++    mon_config = g_memdup2(new_monitors, size);
+ 
+     /* Send monitor config to currently active agent */
+     if (active_session_conn)
+@@ -249,7 +249,7 @@ static void do_client_capabilities(VirtioPort *vport,
+ {
+     capabilities_size = VD_AGENT_CAPS_SIZE_FROM_MSG_SIZE(message_header->size);
+     g_free(capabilities);
+-    capabilities = g_memdup(caps->caps, capabilities_size * sizeof(uint32_t));
++    capabilities = g_memdup2(caps->caps, capabilities_size * sizeof(uint32_t));
+ 
+     if (caps->request) {
+         /* Report the previous client has disconnected. */
+@@ -647,7 +647,7 @@ static void virtio_port_read_complete(
+     case VD_AGENT_GRAPHICS_DEVICE_INFO: {
+         // store device info for re-sending when a session agent reconnects
+         g_free(device_info);
+-        device_info = g_memdup(data, message_header->size);
++        device_info = g_memdup2(data, message_header->size);
+         device_info_size = message_header->size;
+         forward_data_to_session_agent(VDAGENTD_GRAPHICS_DEVICE_INFO, data, message_header->size);
+         break;
+@@ -1090,7 +1090,7 @@ static void do_agent_xorg_resolution(UdscsConnection             *conn,
+     }
+ 
+     g_free(agent_data->screen_info);
+-    agent_data->screen_info = g_memdup(data, header->size);
++    agent_data->screen_info = g_memdup2(data, header->size);
+     agent_data->width  = header->arg1;
+     agent_data->height = header->arg2;
+     agent_data->screen_count = n;
+-- 
+GitLab
+
diff --git a/gnu/packages/patches/sssd-collision-with-external-nss-symbol.patch b/gnu/packages/patches/sssd-collision-with-external-nss-symbol.patch
new file mode 100644
index 0000000000..9d59ae91be
--- /dev/null
+++ b/gnu/packages/patches/sssd-collision-with-external-nss-symbol.patch
@@ -0,0 +1,71 @@
+From fe9eeb51be06059721e873f77092b1e9ba08e6c1 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Michal=20=C5=BDidek?= <mzidek@redhat.com>
+Date: Thu, 27 Feb 2020 06:50:40 +0100
+Subject: [PATCH] nss: Collision with external nss symbol
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+One of our internal static function names started
+to collide with external nss symbol. Additional
+sss_ suffix was added to avoid the collision.
+
+This is needed to unblock Fedora Rawhide's
+SSSD build.
+
+Reviewed-by: Pavel Březina <pbrezina@redhat.com>
+---
+ src/responder/nss/nss_cmd.c | 18 ++++++++++--------
+ 1 file changed, 10 insertions(+), 8 deletions(-)
+
+diff --git a/src/responder/nss/nss_cmd.c b/src/responder/nss/nss_cmd.c
+index 356aea1564..02706c4b94 100644
+--- a/src/responder/nss/nss_cmd.c
++++ b/src/responder/nss/nss_cmd.c
+@@ -731,11 +731,13 @@ static void nss_getent_done(struct tevent_req *subreq)
+     talloc_free(cmd_ctx);
+ }
+ 
+-static void nss_setnetgrent_done(struct tevent_req *subreq);
++static void sss_nss_setnetgrent_done(struct tevent_req *subreq);
+ 
+-static errno_t nss_setnetgrent(struct cli_ctx *cli_ctx,
+-                               enum cache_req_type type,
+-                               nss_protocol_fill_packet_fn fill_fn)
++/* This function's name started to collide with external nss symbol,
++ * so it has additional sss_* prefix unlike other functions here. */
++static errno_t sss_nss_setnetgrent(struct cli_ctx *cli_ctx,
++                                   enum cache_req_type type,
++                                   nss_protocol_fill_packet_fn fill_fn)
+ {
+     struct nss_ctx *nss_ctx;
+     struct nss_state_ctx *state_ctx;
+@@ -777,7 +779,7 @@ static errno_t nss_setnetgrent(struct cli_ctx *cli_ctx,
+         goto done;
+     }
+ 
+-    tevent_req_set_callback(subreq, nss_setnetgrent_done, cmd_ctx);
++    tevent_req_set_callback(subreq, sss_nss_setnetgrent_done, cmd_ctx);
+ 
+     ret = EOK;
+ 
+@@ -790,7 +792,7 @@ static errno_t nss_setnetgrent(struct cli_ctx *cli_ctx,
+     return EOK;
+ }
+ 
+-static void nss_setnetgrent_done(struct tevent_req *subreq)
++static void sss_nss_setnetgrent_done(struct tevent_req *subreq)
+ {
+     struct nss_cmd_ctx *cmd_ctx;
+     errno_t ret;
+@@ -1040,8 +1042,8 @@ static errno_t nss_cmd_initgroups_ex(struct cli_ctx *cli_ctx)
+ 
+ static errno_t nss_cmd_setnetgrent(struct cli_ctx *cli_ctx)
+ {
+-    return nss_setnetgrent(cli_ctx, CACHE_REQ_NETGROUP_BY_NAME,
+-                           nss_protocol_fill_setnetgrent);
++    return sss_nss_setnetgrent(cli_ctx, CACHE_REQ_NETGROUP_BY_NAME,
++                               nss_protocol_fill_setnetgrent);
+ }
+ 
+ static errno_t nss_cmd_getnetgrent(struct cli_ctx *cli_ctx)
diff --git a/gnu/packages/patches/sssd-fix-samba-4.15.3.patch b/gnu/packages/patches/sssd-fix-samba-4.15.3.patch
new file mode 100644
index 0000000000..731daa0ed9
--- /dev/null
+++ b/gnu/packages/patches/sssd-fix-samba-4.15.3.patch
@@ -0,0 +1,523 @@
+From 3ba88c317fd64b69b000adbdf881c88383f325d1 Mon Sep 17 00:00:00 2001
+From: Noel Power <noel.power@suse.com>
+Date: Tue, 24 Mar 2020 13:37:07 +0000
+Subject: [PATCH] Use ndr_pull_steal_switch_value for modern samba versions
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+commit bc56b10aea999284458dcc293b54cf65288e325d attempted to
+fix the build error resulting from removal of 'ndr_pull_get_switch'
+
+This change uses the new replacement method
+'ndr_pull_steal_switch_value' however depending on the samba version
+the ndr_pull_steal_switch_value abi is different.
+
+Note: ndr_pull_steal_switch_value is used since samba 4.10 for
+      the affected methods
+
+Note: the following methods have been refreshed from samba-4.12 generated
+      code;
+
+    o ndr_pull_security_ace_object_type
+    o ndr_pull_security_ace_object_inherited_type
+    o ndr_pull_security_ace_object_ctr
+
+Signed-off-by: Noel Power <noel.power@suse.com>
+
+Reviewed-by: Pavel Březina <pbrezina@redhat.com>
+(cherry picked from commit 1fdd8fa2fded1985fbfc6aa67394eebcdbb6a2fc)
+
+Reviewed-by: Pavel Březina <pbrezina@redhat.com>
+---
+ src/external/samba.m4         |  9 ++++++-
+ src/providers/ad/ad_gpo_ndr.c | 45 ++++++++++++++++++++---------------
+ 2 files changed, 34 insertions(+), 20 deletions(-)
+
+diff --git a/src/external/samba.m4 b/src/external/samba.m4
+index 089f602a60..8e06174ead 100644
+--- a/src/external/samba.m4
++++ b/src/external/samba.m4
+@@ -132,8 +132,15 @@ int main(void)
+         AC_DEFINE_UNQUOTED(SMB_IDMAP_DOMAIN_HAS_DOM_SID, 1,
+                            [Samba's struct idmap_domain has dom_sid member])
+         AC_MSG_NOTICE([Samba's struct idmap_domain has dom_sid member])
++        if test $samba_minor_version -ge 12 ; then
++            AC_DEFINE_UNQUOTED(SMB_HAS_NEW_NDR_PULL_STEAL_SWITCH, 1,
++                               [Samba's new push/pull switch functions])
++            AC_MSG_NOTICE([Samba has support for new ndr_push_steal_switch_value and ndr_pull_steal_switch_value functions])
++        else
++            AC_MSG_NOTICE([Samba supports old ndr_pull_steal_switch_value and ndr_pull_steal_switch_value functions])
++        fi
+     else
+         AC_MSG_NOTICE([Samba's struct idmap_domain does not have dom_sid member])
++        AC_MSG_NOTICE([Samba supports old ndr_pull_steal_switch_value and ndr_pull_steal_switch_value functions])
+     fi
+-
+ fi
+
+ SAVE_CFLAGS=$CFLAGS
+diff --git a/src/providers/ad/ad_gpo_ndr.c b/src/providers/ad/ad_gpo_ndr.c
+index 49c49d71b2..3d389e513d 100644
+--- a/src/providers/ad/ad_gpo_ndr.c
++++ b/src/providers/ad/ad_gpo_ndr.c
+@@ -105,9 +105,14 @@ ndr_pull_security_ace_object_type(struct ndr_pull *ndr,
+                                   union security_ace_object_type *r)
+ {
+     uint32_t level;
+-    level = ndr_token_peek(&ndr->switch_list, r);
+     NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
+     if (ndr_flags & NDR_SCALARS) {
++        /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
++#ifdef SMB_HAS_NEW_NDR_PULL_STEAL_SWITCH
++        NDR_CHECK(ndr_pull_steal_switch_value(ndr, r, &level));
++#else
++        level = ndr_pull_steal_switch_value(ndr, r);
++#endif
+         NDR_CHECK(ndr_pull_union_align(ndr, 4));
+         switch (level) {
+         case SEC_ACE_OBJECT_TYPE_PRESENT: {
+@@ -117,14 +122,6 @@ ndr_pull_security_ace_object_type(struct ndr_pull *ndr,
+             break; }
+         }
+     }
+-    if (ndr_flags & NDR_BUFFERS) {
+-        switch (level) {
+-        case SEC_ACE_OBJECT_TYPE_PRESENT:
+-            break;
+-        default:
+-            break;
+-        }
+-    }
+     return NDR_ERR_SUCCESS;
+ }
+
+@@ -135,9 +132,14 @@ ndr_pull_security_ace_object_inherited_type(struct ndr_pull *ndr,
+                                             union security_ace_object_inherited_type *r)
+ {
+     uint32_t level;
+-    level = ndr_token_peek(&ndr->switch_list, r);
+     NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
+     if (ndr_flags & NDR_SCALARS) {
++        /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
++#ifdef SMB_HAS_NEW_NDR_PULL_STEAL_SWITCH
++        NDR_CHECK(ndr_pull_steal_switch_value(ndr, r, &level));
++#else
++        level = ndr_pull_steal_switch_value(ndr, r);
++#endif
+         NDR_CHECK(ndr_pull_union_align(ndr, 4));
+         switch (level) {
+         case SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT: {
+@@ -149,14 +151,6 @@ ndr_pull_security_ace_object_inherited_type(struct ndr_pull *ndr,
+             break; }
+         }
+     }
+-    if (ndr_flags & NDR_BUFFERS) {
+-        switch (level) {
+-        case SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT:
+-            break;
+-        default:
+-            break;
+-        }
+-    }
+     return NDR_ERR_SUCCESS;
+ }
+
+@@ -198,9 +192,14 @@ ndr_pull_security_ace_object_ctr(struct ndr_pull *ndr,
+                                  union security_ace_object_ctr *r)
+ {
+     uint32_t level;
+-    level = ndr_token_peek(&ndr->switch_list, r);
+     NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
+     if (ndr_flags & NDR_SCALARS) {
++        /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
++#ifdef SMB_HAS_NEW_NDR_PULL_STEAL_SWITCH
++        NDR_CHECK(ndr_pull_steal_switch_value(ndr, r, &level));
++#else
++        level = ndr_pull_steal_switch_value(ndr, r);
++#endif
+         NDR_CHECK(ndr_pull_union_align(ndr, 4));
+         switch (level) {
+         case SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT: {
+@@ -224,6 +223,14 @@ ndr_pull_security_ace_object_ctr(struct ndr_pull *ndr,
+         }
+     }
+     if (ndr_flags & NDR_BUFFERS) {
++        if (!(ndr_flags & NDR_SCALARS)) {
++            /* We didn't get it above, and the token is not needed after this. */
++#ifdef SMB_HAS_NEW_NDR_PULL_STEAL_SWITCH
++            NDR_CHECK(ndr_pull_steal_switch_value(ndr, r, &level));
++#else
++            level = ndr_pull_steal_switch_value(ndr, r);
++#endif
++        }
+         switch (level) {
+         case SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT:
+             NDR_CHECK(ndr_pull_security_ace_object
+From 5285a1896ee19bb8f1ff752380547bc6d7a43334 Mon Sep 17 00:00:00 2001
+From: Noel Power <noel.power@suse.com>
+Date: Tue, 24 Mar 2020 18:14:34 +0000
+Subject: [PATCH] ad_gpo_ndr.c: refresh ndr_ methods from samba-4.12
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Noel Power <noel.power@suse.com>
+
+Reviewed-by: Pavel Březina <pbrezina@redhat.com>
+(cherry picked from commit c031adde4f532f39845a0efd78693600f1f8b2f4)
+
+Reviewed-by: Pavel Březina <pbrezina@redhat.com>
+---
+ src/providers/ad/ad_gpo_ndr.c | 201 ++++++++++++++++++----------------
+ 1 file changed, 106 insertions(+), 95 deletions(-)
+
+diff --git a/src/providers/ad/ad_gpo_ndr.c b/src/providers/ad/ad_gpo_ndr.c
+index 3d389e513d..a64b1a0f84 100644
+--- a/src/providers/ad/ad_gpo_ndr.c
++++ b/src/providers/ad/ad_gpo_ndr.c
+@@ -177,8 +177,16 @@ ndr_pull_security_ace_object(struct ndr_pull *ndr,
+         NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
+     }
+     if (ndr_flags & NDR_BUFFERS) {
++        NDR_CHECK(ndr_pull_set_switch_value
++                  (ndr,
++                   &r->type,
++                   r->flags & SEC_ACE_OBJECT_TYPE_PRESENT));
+         NDR_CHECK(ndr_pull_security_ace_object_type
+                   (ndr, NDR_BUFFERS, &r->type));
++        NDR_CHECK(ndr_pull_set_switch_value
++                  (ndr,
++                   &r->inherited_type,
++                   r->flags & SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT));
+         NDR_CHECK(ndr_pull_security_ace_object_inherited_type
+                   (ndr, NDR_BUFFERS, &r->inherited_type));
+     }
+@@ -342,7 +350,7 @@ ndr_pull_security_acl(struct ndr_pull *ndr,
+                   (ndr, NDR_SCALARS, &r->revision));
+         NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size));
+         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_aces));
+-        if (r->num_aces > 1000) {
++        if (r->num_aces > 2000) {
+             return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
+         }
+         size_aces_0 = r->num_aces;
+@@ -408,107 +416,110 @@ ad_gpo_ndr_pull_security_descriptor(struct ndr_pull *ndr,
+     TALLOC_CTX *_mem_save_sacl_0;
+     uint32_t _ptr_dacl;
+     TALLOC_CTX *_mem_save_dacl_0;
+-    uint32_t _flags_save_STRUCT = ndr->flags;
+-    uint32_t _relative_save_offset;
+-
+-    ndr_set_flags(&ndr->flags, LIBNDR_FLAG_LITTLE_ENDIAN);
+-    NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
+-    if (ndr_flags & NDR_SCALARS) {
+-        NDR_CHECK(ndr_pull_align(ndr, 5));
+-        NDR_CHECK(ndr_pull_security_descriptor_revision(ndr,
++    {
++        uint32_t _flags_save_STRUCT = ndr->flags;
++        ndr_set_flags(&ndr->flags, LIBNDR_FLAG_LITTLE_ENDIAN);
++        NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
++        if (ndr_flags & NDR_SCALARS) {
++            NDR_CHECK(ndr_pull_align(ndr, 5));
++            NDR_CHECK(ndr_pull_security_descriptor_revision(ndr,
++                                                            NDR_SCALARS,
++                                                            &r->revision));
++            NDR_CHECK(ndr_pull_security_descriptor_type(ndr,
+                                                         NDR_SCALARS,
+-                                                        &r->revision));
+-        NDR_CHECK(ndr_pull_security_descriptor_type(ndr,
+-                                                    NDR_SCALARS,
+-                                                    &r->type));
+-        NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_owner_sid));
+-        if (_ptr_owner_sid) {
+-            NDR_PULL_ALLOC(ndr, r->owner_sid);
+-            NDR_CHECK(ndr_pull_relative_ptr1(ndr,
+-                                             r->owner_sid,
+-                                             _ptr_owner_sid));
+-        } else {
+-            r->owner_sid = NULL;
+-        }
+-        NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_group_sid));
+-        if (_ptr_group_sid) {
+-            NDR_PULL_ALLOC(ndr, r->group_sid);
+-            NDR_CHECK(ndr_pull_relative_ptr1(ndr,
+-                                             r->group_sid,
+-                                             _ptr_group_sid));
+-        } else {
+-            r->group_sid = NULL;
+-        }
+-        NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sacl));
+-        if (_ptr_sacl) {
+-            NDR_PULL_ALLOC(ndr, r->sacl);
+-            NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->sacl, _ptr_sacl));
+-        } else {
+-            r->sacl = NULL;
+-        }
+-        NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dacl));
+-        if (_ptr_dacl) {
+-            NDR_PULL_ALLOC(ndr, r->dacl);
+-            NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->dacl, _ptr_dacl));
+-        } else {
+-            r->dacl = NULL;
+-        }
+-        NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
+-    }
+-    if (ndr_flags & NDR_BUFFERS) {
+-        if (r->owner_sid) {
+-            _relative_save_offset = ndr->offset;
+-            NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->owner_sid));
+-            _mem_save_owner_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
+-            NDR_PULL_SET_MEM_CTX(ndr, r->owner_sid, 0);
+-            NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->owner_sid));
+-            NDR_PULL_SET_MEM_CTX(ndr, _mem_save_owner_sid_0, 0);
+-            if (ndr->offset > ndr->relative_highest_offset) {
+-                ndr->relative_highest_offset = ndr->offset;
++                                                        &r->type));
++            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_owner_sid));
++            if (_ptr_owner_sid) {
++                NDR_PULL_ALLOC(ndr, r->owner_sid);
++                NDR_CHECK(ndr_pull_relative_ptr1(ndr,
++                                                 r->owner_sid,
++                                                 _ptr_owner_sid));
++            } else {
++                r->owner_sid = NULL;
+             }
+-            ndr->offset = _relative_save_offset;
+-        }
+-        if (r->group_sid) {
+-            _relative_save_offset = ndr->offset;
+-            NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->group_sid));
+-            _mem_save_group_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
+-            NDR_PULL_SET_MEM_CTX(ndr, r->group_sid, 0);
+-            NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->group_sid));
+-            NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_sid_0, 0);
+-            if (ndr->offset > ndr->relative_highest_offset) {
+-                ndr->relative_highest_offset = ndr->offset;
++            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_group_sid));
++            if (_ptr_group_sid) {
++                NDR_PULL_ALLOC(ndr, r->group_sid);
++                NDR_CHECK(ndr_pull_relative_ptr1(ndr,
++                                                 r->group_sid,
++                                                 _ptr_group_sid));
++            } else {
++                r->group_sid = NULL;
+             }
+-            ndr->offset = _relative_save_offset;
+-        }
+-        if (r->sacl) {
+-            _relative_save_offset = ndr->offset;
+-            NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->sacl));
+-            _mem_save_sacl_0 = NDR_PULL_GET_MEM_CTX(ndr);
+-            NDR_PULL_SET_MEM_CTX(ndr, r->sacl, 0);
+-            NDR_CHECK(ndr_pull_security_acl(ndr,
+-                                            NDR_SCALARS|NDR_BUFFERS,
+-                                            r->sacl));
+-            NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sacl_0, 0);
+-            if (ndr->offset > ndr->relative_highest_offset) {
+-                ndr->relative_highest_offset = ndr->offset;
++            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sacl));
++            if (_ptr_sacl) {
++                NDR_PULL_ALLOC(ndr, r->sacl);
++                NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->sacl, _ptr_sacl));
++            } else {
++                r->sacl = NULL;
+             }
+-            ndr->offset = _relative_save_offset;
++            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dacl));
++            if (_ptr_dacl) {
++                NDR_PULL_ALLOC(ndr, r->dacl);
++                NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->dacl, _ptr_dacl));
++            } else {
++                r->dacl = NULL;
++            }
++            NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
+         }
+-        if (r->dacl) {
+-            _relative_save_offset = ndr->offset;
+-            NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->dacl));
+-            _mem_save_dacl_0 = NDR_PULL_GET_MEM_CTX(ndr);
+-            NDR_PULL_SET_MEM_CTX(ndr, r->dacl, 0);
+-            NDR_CHECK(ndr_pull_security_acl(ndr,
+-                                            NDR_SCALARS|NDR_BUFFERS,
+-                                            r->dacl));
+-            NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dacl_0, 0);
+-            if (ndr->offset > ndr->relative_highest_offset) {
+-                ndr->relative_highest_offset = ndr->offset;
++        if (ndr_flags & NDR_BUFFERS) {
++            if (r->owner_sid) {
++                uint32_t _relative_save_offset;
++                _relative_save_offset = ndr->offset;
++                NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->owner_sid));
++                _mem_save_owner_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
++                NDR_PULL_SET_MEM_CTX(ndr, r->owner_sid, 0);
++                NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->owner_sid));
++                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_owner_sid_0, 0);
++                if (ndr->offset > ndr->relative_highest_offset) {
++                    ndr->relative_highest_offset = ndr->offset;
++                }
++                ndr->offset = _relative_save_offset;
++            }
++            if (r->group_sid) {
++                uint32_t _relative_save_offset;
++                _relative_save_offset = ndr->offset;
++                NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->group_sid));
++                _mem_save_group_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
++                NDR_PULL_SET_MEM_CTX(ndr, r->group_sid, 0);
++                NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->group_sid));
++                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_sid_0, 0);
++                if (ndr->offset > ndr->relative_highest_offset) {
++                    ndr->relative_highest_offset = ndr->offset;
++                }
++                ndr->offset = _relative_save_offset;
++            }
++            if (r->sacl) {
++                uint32_t _relative_save_offset;
++                _relative_save_offset = ndr->offset;
++                NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->sacl));
++                _mem_save_sacl_0 = NDR_PULL_GET_MEM_CTX(ndr);
++                NDR_PULL_SET_MEM_CTX(ndr, r->sacl, 0);
++                NDR_CHECK(ndr_pull_security_acl(ndr,
++                                                NDR_SCALARS|NDR_BUFFERS,
++                                                r->sacl));
++                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sacl_0, 0);
++                if (ndr->offset > ndr->relative_highest_offset) {
++                    ndr->relative_highest_offset = ndr->offset;
++                }
++                ndr->offset = _relative_save_offset;
++            }
++            if (r->dacl) {
++                uint32_t _relative_save_offset;
++                _relative_save_offset = ndr->offset;
++                NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->dacl));
++                _mem_save_dacl_0 = NDR_PULL_GET_MEM_CTX(ndr);
++                NDR_PULL_SET_MEM_CTX(ndr, r->dacl, 0);
++                NDR_CHECK(ndr_pull_security_acl(ndr,
++                                                NDR_SCALARS|NDR_BUFFERS,
++                                                r->dacl));
++                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dacl_0, 0);
++                if (ndr->offset > ndr->relative_highest_offset) {
++                    ndr->relative_highest_offset = ndr->offset;
++                }
++                ndr->offset = _relative_save_offset;
+             }
+-            ndr->offset = _relative_save_offset;
+         }
+-
+         ndr->flags = _flags_save_STRUCT;
+     }
+     return NDR_ERR_SUCCESS;
+From d5809f6f41ec0dc3fd38f9e4ae917a38bf7dfa43 Mon Sep 17 00:00:00 2001
+From: Sumit Bose <sbose@redhat.com>
+Date: Thu, 28 May 2020 15:02:43 +0200
+Subject: [PATCH] ad_gpo_ndr.c: more ndr updates
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This patch add another update to the ndr code which was previously
+updated by commit c031adde4f532f39845a0efd78693600f1f8b2f4 and
+1fdd8fa2fded1985fbfc6aa67394eebcdbb6a2fc.
+
+As missing update in ndr_pull_security_ace() cased
+a failure in ad_gpo_parse_sd(). A unit-test for ad_gpo_parse_sd() was
+added to prevent similar issues in future.
+
+Resolves: https://github.com/SSSD/sssd/issues/5183
+
+Reviewed-by: Pavel Březina <pbrezina@redhat.com>
+(cherry picked from commit a7c755672cd277497da3df4714f6d9457b6ac5ae)
+
+Reviewed-by: Pavel Březina <pbrezina@redhat.com>
+---
+ src/providers/ad/ad_gpo_ndr.c  |  1 +
+ src/tests/cmocka/test_ad_gpo.c | 57 ++++++++++++++++++++++++++++++++++
+ 2 files changed, 58 insertions(+)
+
+diff --git a/src/providers/ad/ad_gpo_ndr.c b/src/providers/ad/ad_gpo_ndr.c
+index a64b1a0f84..9f040dfb03 100644
+--- a/src/providers/ad/ad_gpo_ndr.c
++++ b/src/providers/ad/ad_gpo_ndr.c
+@@ -317,6 +317,7 @@ ndr_pull_security_ace(struct ndr_pull *ndr,
+         ndr->offset += pad;
+     }
+     if (ndr_flags & NDR_BUFFERS) {
++        NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->object, r->type));
+         NDR_CHECK(ndr_pull_security_ace_object_ctr
+                   (ndr, NDR_BUFFERS, &r->object));
+     }
+diff --git a/src/tests/cmocka/test_ad_gpo.c b/src/tests/cmocka/test_ad_gpo.c
+index 0589adcc3d..97dbe01794 100644
+--- a/src/tests/cmocka/test_ad_gpo.c
++++ b/src/tests/cmocka/test_ad_gpo.c
+@@ -329,6 +329,60 @@ void test_ad_gpo_ace_includes_client_sid_false(void **state)
+                                         ace_dom_sid, false);
+ }
+
++uint8_t test_sid_data[] = {
++0x01, 0x00, 0x04, 0x9c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
++0x14, 0x00, 0x00, 0x00, 0x04, 0x00, 0x34, 0x01, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x00,
++0xbd, 0x00, 0x0e, 0x00, 0x01, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x15, 0x00, 0x00, 0x00,
++0xda, 0x0e, 0xba, 0x60, 0x0f, 0xa2, 0xf4, 0x55, 0xb5, 0x57, 0x47, 0xf8, 0x00, 0x02, 0x00, 0x00,
++0x00, 0x0a, 0x24, 0x00, 0xff, 0x00, 0x0f, 0x00, 0x01, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05,
++0x15, 0x00, 0x00, 0x00, 0xda, 0x0e, 0xba, 0x60, 0x0f, 0xa2, 0xf4, 0x55, 0xb5, 0x57, 0x47, 0xf8,
++0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x24, 0x00, 0xbd, 0x00, 0x0e, 0x00, 0x01, 0x05, 0x00, 0x00,
++0x00, 0x00, 0x00, 0x05, 0x15, 0x00, 0x00, 0x00, 0xda, 0x0e, 0xba, 0x60, 0x0f, 0xa2, 0xf4, 0x55,
++0xb5, 0x57, 0x47, 0xf8, 0x07, 0x02, 0x00, 0x00, 0x00, 0x0a, 0x24, 0x00, 0xff, 0x00, 0x0f, 0x00,
++0x01, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x15, 0x00, 0x00, 0x00, 0xda, 0x0e, 0xba, 0x60,
++0x0f, 0xa2, 0xf4, 0x55, 0xb5, 0x57, 0x47, 0xf8, 0x07, 0x02, 0x00, 0x00, 0x00, 0x00, 0x24, 0x00,
++0xbd, 0x00, 0x0e, 0x00, 0x01, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x15, 0x00, 0x00, 0x00,
++0xda, 0x0e, 0xba, 0x60, 0x0f, 0xa2, 0xf4, 0x55, 0xb5, 0x57, 0x47, 0xf8, 0x00, 0x02, 0x00, 0x00,
++0x00, 0x0a, 0x14, 0x00, 0xff, 0x00, 0x0f, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
++0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x14, 0x00, 0xff, 0x00, 0x0f, 0x00, 0x01, 0x01, 0x00, 0x00,
++0x00, 0x00, 0x00, 0x05, 0x12, 0x00, 0x00, 0x00, 0x00, 0x02, 0x14, 0x00, 0x94, 0x00, 0x02, 0x00,
++0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0b, 0x00, 0x00, 0x00, 0x05, 0x02, 0x28, 0x00,
++0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x8f, 0xfd, 0xac, 0xed, 0xb3, 0xff, 0xd1, 0x11,
++0xb4, 0x1d, 0x00, 0xa0, 0xc9, 0x68, 0xf9, 0x39, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05,
++0x0b, 0x00, 0x00, 0x00, 0x00, 0x02, 0x14, 0x00, 0x94, 0x00, 0x02, 0x00, 0x01, 0x01, 0x00, 0x00,
++0x00, 0x00, 0x00, 0x05, 0x09, 0x00, 0x00, 0x00
++};
++
++void test_ad_gpo_parse_sd(void **state)
++{
++    int ret;
++    struct security_descriptor *sd = NULL;
++
++    ret = ad_gpo_parse_sd(test_ctx, NULL, 0, &sd);
++    assert_int_equal(ret, EINVAL);
++
++    ret = ad_gpo_parse_sd(test_ctx, test_sid_data, sizeof(test_sid_data), &sd);
++    assert_int_equal(ret, EOK);
++    assert_non_null(sd);
++    assert_int_equal(sd->revision, 1);
++    assert_int_equal(sd->type, 39940);
++    assert_null(sd->owner_sid);
++    assert_null(sd->group_sid);
++    assert_null(sd->sacl);
++    assert_non_null(sd->dacl);
++    assert_int_equal(sd->dacl->revision, 4);
++    assert_int_equal(sd->dacl->size, 308);
++    assert_int_equal(sd->dacl->num_aces, 10);
++    assert_int_equal(sd->dacl->aces[0].type, 0);
++    assert_int_equal(sd->dacl->aces[0].flags, 0);
++    assert_int_equal(sd->dacl->aces[0].size, 36);
++    assert_int_equal(sd->dacl->aces[0].access_mask, 917693);
++    /* There are more components and ACEs in the security_descriptor struct
++     * which are not checked here. */
++
++    talloc_free(sd);
++}
++
+ int main(int argc, const char *argv[])
+ {
+     poptContext pc;
+@@ -364,6 +418,9 @@ int main(int argc, const char *argv[])
+         cmocka_unit_test_setup_teardown(test_ad_gpo_ace_includes_client_sid_false,
+                                         ad_gpo_test_setup,
+                                         ad_gpo_test_teardown),
++        cmocka_unit_test_setup_teardown(test_ad_gpo_parse_sd,
++                                        ad_gpo_test_setup,
++                                        ad_gpo_test_teardown),
+     };
+
+     /* Set debug level to invalid value so we can decide if -d 0 was used. */
diff --git a/gnu/packages/patches/strace-readlink-tests.patch b/gnu/packages/patches/strace-readlink-tests.patch
new file mode 100644
index 0000000000..dd5ee98703
--- /dev/null
+++ b/gnu/packages/patches/strace-readlink-tests.patch
@@ -0,0 +1,46 @@
+Prevent strace's "readlink" and "readlinkat" tests from failing due to the
+additional system call made by glibc with the patch "glibc-dl-cache.patch"
+applied (introduced in commit 52564e9).
+
+These changes cause strace to report during these tests only system calls on
+files contained in the test directory, effectively filtering out the
+additional readlink/readlinkat call on "/proc/self/exe" and allowing the tests
+to complete as normal.
+
+diff --git a/tests/gen_tests.in b/tests/gen_tests.in
+index 8b4e2e9..cc3ca63 100644
+--- a/tests/gen_tests.in
++++ b/tests/gen_tests.in
+@@ -623,8 +623,8 @@ quotactl-xfs-v	-v -e trace=quotactl
+ read-write	-a15 -eread=0,5 -ewrite=1,4 -e trace=read,write -P read-write-tmpfile -P /dev/zero -P /dev/null
+ readahead	-a1
+ readdir	-a16
+-readlink	-xx
+-readlinkat	-xx
++readlink	-xx --trace-path=test.readlink.link
++readlinkat	-xx --trace-path=test.readlinkat.link
+ reboot		-s 256
+ recv-MSG_TRUNC	-a26 -e trace=recv
+ recvfrom	-a35
+diff --git a/tests/readlink.gen.test b/tests/readlink.gen.test
+index 4263234..418691b 100755
+--- a/tests/readlink.gen.test
++++ b/tests/readlink.gen.test
+@@ -1,4 +1,4 @@
+ #!/bin/sh -efu
+-# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (readlink -xx ); do not edit.
++# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (readlink -xx --trace-path=test.readlink.link); do not edit.
+ . "${srcdir=.}/init.sh"
+-run_strace_match_diff -xx 
++run_strace_match_diff -xx --trace-path=test.readlink.link
+diff --git a/tests/readlinkat.gen.test b/tests/readlinkat.gen.test
+index d7de993..a48d590 100755
+--- a/tests/readlinkat.gen.test
++++ b/tests/readlinkat.gen.test
+@@ -1,4 +1,4 @@
+ #!/bin/sh -efu
+-# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (readlinkat -xx ); do not edit.
++# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (readlinkat -xx --trace-path=test.readlinkat.link); do not edit.
+ . "${srcdir=.}/init.sh"
+-run_strace_match_diff -xx 
++run_strace_match_diff -xx --trace-path=test.readlinkat.link
diff --git a/gnu/packages/patches/supertux-unbundle-squirrel.patch b/gnu/packages/patches/supertux-unbundle-squirrel.patch
index 054183b75f..f504aacfdd 100644
--- a/gnu/packages/patches/supertux-unbundle-squirrel.patch
+++ b/gnu/packages/patches/supertux-unbundle-squirrel.patch
@@ -1,9 +1,8 @@
-diff -ur a/CMakeLists.txt b/CMakeLists.txt
---- a/CMakeLists.txt	2019-05-24 17:58:19.693090158 -0400
-+++ b/CMakeLists.txt	2019-05-24 17:57:43.349473252 -0400
-@@ -375,44 +375,15 @@
- 
- include(ConfigureChecks)
+--- a/CMakeLists.txt	2022-01-05 18:51:17.828392874 +0100
++++ b/CMakeLists.txt	2022-01-05 18:54:50.826717830 +0100
+@@ -487,48 +487,15 @@
+   include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/ppc)
+ endif()
  
 -
 -## Also build external/squirrel
@@ -15,6 +14,9 @@ diff -ur a/CMakeLists.txt b/CMakeLists.txt
  set(SQUIRREL_PREFIX ${CMAKE_BINARY_DIR}/squirrel/ex)
 -ExternalProject_Add(squirrel
 -  SOURCE_DIR "${CMAKE_SOURCE_DIR}/external/squirrel/"
+-  BUILD_BYPRODUCTS
+-  "${SQUIRREL_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}sqstdlib_static${CMAKE_STATIC_LIBRARY_SUFFIX}"
+-  "${SQUIRREL_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}squirrel_static${CMAKE_STATIC_LIBRARY_SUFFIX}"
 -  CMAKE_ARGS
 -  -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
 -  -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
@@ -22,7 +24,8 @@ diff -ur a/CMakeLists.txt b/CMakeLists.txt
 -  -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
 -  -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
 -  -DCMAKE_INSTALL_PREFIX=${SQUIRREL_PREFIX}
--  -DINSTALL_INC_DIR=include)
+-  -DINSTALL_INC_DIR=include
+-  -DCMAKE_POSITION_INDEPENDENT_CODE=ON)
 -
 -if(WIN32)
 -  add_library(squirrel_lib SHARED IMPORTED)
diff --git a/gnu/packages/patches/syslinux-gcc10.patch b/gnu/packages/patches/syslinux-gcc10.patch
new file mode 100644
index 0000000000..8d3750b36e
--- /dev/null
+++ b/gnu/packages/patches/syslinux-gcc10.patch
@@ -0,0 +1,87 @@
+Taken from Gentoo and adapted to fix the build using GCC 10. See:
+https://bugs.gentoo.org/705730.
+
+--- a/mk/com32.mk
++++ b/mk/com32.mk
+@@ -47,6 +47,7 @@ GCCOPT += $(call gcc_ok,-falign-functions=0,-malign-functions=0)
+ GCCOPT += $(call gcc_ok,-falign-jumps=0,-malign-jumps=0)
+ GCCOPT += $(call gcc_ok,-falign-labels=0,-malign-labels=0)
+ GCCOPT += $(call gcc_ok,-falign-loops=0,-malign-loops=0)
++GCCOPT += $(call gcc_ok,-fcommon)
+ 
+ ifeq ($(FWCLASS),EFI)
+ GCCOPT += -mno-red-zone
+--- a/mk/elf.mk
++++ b/mk/elf.mk
+@@ -42,6 +42,7 @@ GCCOPT += $(call gcc_ok,-falign-functions=0,-malign-functions=0)
+ GCCOPT += $(call gcc_ok,-falign-jumps=0,-malign-jumps=0)
+ GCCOPT += $(call gcc_ok,-falign-labels=0,-malign-labels=0)
+ GCCOPT += $(call gcc_ok,-falign-loops=0,-malign-loops=0)
++GCCOPT += $(call gcc_ok,-fcommon)
+ 
+ com32 = $(topdir)/com32
+ core = $(topdir)/core
+--- a/mk/embedded.mk
++++ b/mk/embedded.mk
+@@ -51,6 +51,7 @@ GCCOPT    += $(call gcc_ok,-falign-jumps=0,-malign-jumps=0)
+ GCCOPT    += $(call gcc_ok,-falign-labels=0,-malign-labels=0)
+ GCCOPT    += $(call gcc_ok,-falign-loops=0,-malign-loops=0)
+ GCCOPT    += $(call gcc_ok,-fvisibility=hidden)
++GCCOPT    += $(call gcc_ok,-fcommon)
+ 
+ LIBGCC    := $(shell $(CC) $(GCCOPT) --print-libgcc)
+ 
+--- a/mk/lib.mk
++++ b/mk/lib.mk
+@@ -28,6 +28,7 @@ GCCOPT += $(call gcc_ok,-falign-functions=0,-malign-functions=0)
+ GCCOPT += $(call gcc_ok,-falign-jumps=0,-malign-jumps=0)
+ GCCOPT += $(call gcc_ok,-falign-labels=0,-malign-labels=0)
+ GCCOPT += $(call gcc_ok,-falign-loops=0,-malign-loops=0)
++GCCOPT += $(call gcc_ok,-fcommon)
+ 
+ INCLUDE	= -I$(SRC)
+ STRIP	= strip --strip-all -R .comment -R .note
+--- a/mk/efi.mk
++++ b/mk/efi.mk
+@@ -7,7 +7,7 @@ core = $(topdir)/core
+ # Set up architecture specifics; for cross compilation, set ARCH as apt
+ # gnuefi sets up architecture specifics in ia32 or x86_64 sub directories
+ # set up the LIBDIR and EFIINC for building for the appropriate architecture
+-GCCOPT := $(call gcc_ok,-fno-stack-protector,)
++GCCOPT := $(call gcc_ok,-fno-stack-protector,) $(call gcc_ok,-fcommon)
+ EFIINC = $(objdir)/include/efi
+ LIBDIR  = $(objdir)/lib
+ 
+diff --git a/dos/string.h b/dos/string.h
+index f648de2..a502132 100644
+--- a/dos/string.h
++++ b/dos/string.h
+@@ -5,12 +5,13 @@
+ #ifndef _STRING_H
+ #define _STRING_H
+ 
++#include <stddef.h>
++
+ /* Standard routines */
+ #define memcpy(a,b,c)	__builtin_memcpy(a,b,c)
+ #define memmove(a,b,c)	__builtin_memmove(a,b,c)
+ #define memset(a,b,c)	__builtin_memset(a,b,c)
+ #define strcpy(a,b)	__builtin_strcpy(a,b)
+-#define strlen(a)	__builtin_strlen(a)
+ 
+ /* This only returns true or false */
+ static inline int memcmp(const void *__m1, const void *__m2, unsigned int __n)
+@@ -21,6 +22,13 @@ static inline int memcmp(const void *__m1, const void *__m2, unsigned int __n)
+     return rv;
+ }
+ 
++static inline size_t strlen(const char *s)
++{
++    size_t len = 0;
++    while (*s++) len++;
++    return len;
++}
++
+ extern char *strchr(const char *s, int c);
+ 
+ #endif /* _STRING_H */
\ No newline at end of file
diff --git a/gnu/packages/patches/syslinux-strip-gnu-property.patch b/gnu/packages/patches/syslinux-strip-gnu-property.patch
new file mode 100644
index 0000000000..c656bbeedd
--- /dev/null
+++ b/gnu/packages/patches/syslinux-strip-gnu-property.patch
@@ -0,0 +1,31 @@
+Taken from: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=906414.
+
+Author: Lukas Schwaighofer <lukas@schwaighofer.name>
+Description: Strip the .note.gnu.property section for the mbr. This section is
+ added since binutils Debian version 2.31.1-2 and causes mbr.bin to grow in
+ size beyond what can fit into the master boot record.
+---
+ mbr/i386/mbr.ld   | 1 +
+ mbr/x86_64/mbr.ld | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/mbr/i386/mbr.ld b/mbr/i386/mbr.ld
+index d14ba80..5368346 100644
+--- a/mbr/i386/mbr.ld
++++ b/mbr/i386/mbr.ld
+@@ -70,4 +70,5 @@ SECTIONS
+   .debug_typenames 0 : { *(.debug_typenames) }
+   .debug_varnames  0 : { *(.debug_varnames) }
+   /DISCARD/ : { *(.note.GNU-stack) }
++  /DISCARD/ : { *(.note.gnu.property) }
+ }
+diff --git a/mbr/x86_64/mbr.ld b/mbr/x86_64/mbr.ld
+index ae27d49..b8c0d89 100644
+--- a/mbr/x86_64/mbr.ld
++++ b/mbr/x86_64/mbr.ld
+@@ -69,4 +69,5 @@ SECTIONS
+   .debug_typenames 0 : { *(.debug_typenames) }
+   .debug_varnames  0 : { *(.debug_varnames) }
+   /DISCARD/ : { *(.note.GNU-stack) }
++  /DISCARD/ : { *(.note.gnu.property) }
+ }
diff --git a/gnu/packages/patches/tcl-fix-cross-compilation.patch b/gnu/packages/patches/tcl-fix-cross-compilation.patch
deleted file mode 100644
index 00c36b8f27..0000000000
--- a/gnu/packages/patches/tcl-fix-cross-compilation.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From f7fa48c4c75a1e748dc5071e709c0b62ff739eaa Mon Sep 17 00:00:00 2001
-From: "jan.nijtmans" <nijtmans@users.sourceforge.net>
-Date: Mon, 9 Dec 2019 10:02:20 +0000
-Subject: [PATCH] Fix [abd4abedd2]: Failed to build tk 8.6.10 with cross
- compile
-
-Patch taken from upstream to fix cross-compilation. To be removed on next Tcl release.
-
----
- compat/strtol.c  | 2 +-
- compat/strtoul.c | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/compat/strtol.c b/compat/strtol.c
-index b7f69196ce2..811006a64c3 100644
---- a/compat/strtol.c
-+++ b/compat/strtol.c
-@@ -53,7 +53,7 @@ strtol(
-      */
- 
-     p = string;
--    while (TclIsSpaceProc(*p)) {
-+    while (isspace(UCHAR(*p))) {
- 	p += 1;
-     }
- 
-diff --git a/compat/strtoul.c b/compat/strtoul.c
-index e37eb05f823..15587f1da1a 100644
---- a/compat/strtoul.c
-+++ b/compat/strtoul.c
-@@ -74,7 +74,7 @@ strtoul(
-      */
- 
-     p = string;
--    while (TclIsSpaceProc(*p)) {
-+    while (isspace(UCHAR(*p))) {
- 	p += 1;
-     }
-     if (*p == '-') {
diff --git a/gnu/packages/patches/tcsh-fix-autotest.patch b/gnu/packages/patches/tcsh-fix-autotest.patch
index 200867cb9b..9f5790641b 100644
--- a/gnu/packages/patches/tcsh-fix-autotest.patch
+++ b/gnu/packages/patches/tcsh-fix-autotest.patch
@@ -63,17 +63,6 @@
  
  AT_DATA([comment2.csh],
  [[echo testing...@%:@\
---- tests/subst.at
-+++ tests/subst.at
-@@ -54,7 +54,7 @@ AT_CHECK([export HOME=$(getent passwd $(id -un) | awk -F: '{ print $(NF - 1) }')
- , [1
- ])
- 
--AT_CHECK([export HOME=$(getent passwd $(id -un) | awk -F: '{ print $(NF - 1) }'); echo "echo ~$(id -un)/foo; echo \"\$HOME/foo\"" | tcsh -f | uniq dnl
-+AT_CHECK([export HOME=$(getent passwd $(id -un) | awk -F: '{ print $(NF - 1) }'); echo "echo ~$(id -un)//foo; echo \"\$HOME/foo\"" | tcsh -f | uniq dnl
- 	  | wc -l | tr -d ' \t'], , [1
- ])
- 
 --- tests/variables.at
 +++ tests/variables.at
 @@ -666,7 +666,8 @@ set listflags=(-xA $cwd/args.sh)
diff --git a/gnu/packages/patches/telepathy-glib-channel-memory-leak.patch b/gnu/packages/patches/telepathy-glib-channel-memory-leak.patch
deleted file mode 100644
index fe07548ec0..0000000000
--- a/gnu/packages/patches/telepathy-glib-channel-memory-leak.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-Prevent a memory leak in call-channel, which otherwise would cause a
-test failure in file-transfer-channel.c.
-
-Taken from upstream:
-https://gitlab.freedesktop.org/telepathy/telepathy-glib/commit/2e8b2cc0db09b781d99e3755bb6d01548037fe7b
-
-diff --git a/telepathy-glib/call-channel.c b/telepathy-glib/call-channel.c
-index 8ed76323be32f83c5f4d6045a50bc1698d8093fd..2a1fa203d4be9f0c8b99344225f4ba9900666ffc 100644
---- a/telepathy-glib/call-channel.c
-+++ b/telepathy-glib/call-channel.c
-@@ -525,6 +525,8 @@ update_call_members (TpCallChannel *self,
- 
-   _tp_channel_contacts_queue_prepare_async ((TpChannel *) self,
-       contacts, update_call_members_prepared_cb, data);
-+
-+  g_ptr_array_unref (contacts);
- }
- 
- static void
diff --git a/gnu/packages/patches/tensorflow-c-api-fix.patch b/gnu/packages/patches/tensorflow-c-api-fix.patch
new file mode 100644
index 0000000000..7f39b9f60f
--- /dev/null
+++ b/gnu/packages/patches/tensorflow-c-api-fix.patch
@@ -0,0 +1,312 @@
+From eb61daae91432be0b07bb2f6854887bedfa6fc95 Mon Sep 17 00:00:00 2001
+From: Asim Shankar <ashankar@google.com>
+Date: Tue, 26 Jun 2018 00:57:33 -0700
+Subject: [PATCH] [C API]: Bugfix for TF_AddGradients.
+
+TF_AddGradients could create nodes in the graph with names that conflicted with
+other nodes in the graph. This would most clearly happen if TF_AddGradients()
+was called twice on the same graph, and could also happen if there were other
+nodes in the graph that happened to have "gradients" as a prefix of their name.
+
+Fix that.
+
+The added test in c_api_test.cc would fail in the call to TF_SessionRun() with
+  Node 'gradients/OnesLike' is not unique
+without the changes to c_api.cc and c_api_internal.h
+
+While at it, also fixed a possible name collision bug when using the C++ API
+to constructor graphs (using Scope).
+
+Thanks @karllessard for pointing this out.
+
+PiperOrigin-RevId: 202087996
+---
+ tensorflow/c/c_api.cc                    | 13 ++++-
+ tensorflow/c/c_api_test.cc               | 65 ++++++++++++++++++++++--
+ tensorflow/c/c_test_util.cc              |  7 +++
+ tensorflow/c/c_test_util.h               |  3 ++
+ tensorflow/cc/framework/scope.cc         | 30 ++++++++---
+ tensorflow/cc/framework/scope_internal.h |  3 +-
+ tensorflow/cc/framework/scope_test.cc    | 10 ++++
+ 7 files changed, 116 insertions(+), 15 deletions(-)
+
+diff --git a/tensorflow/c/c_api.cc b/tensorflow/c/c_api.cc
+index 09a03639d6fa3..37c8302e08bc3 100644
+--- a/tensorflow/c/c_api.cc
++++ b/tensorflow/c/c_api.cc
+@@ -2414,7 +2414,18 @@ void TF_AddGradients(TF_Graph* g, TF_Output* y, int ny, TF_Output* x, int nx,
+     for (int i = first_new_node_id; i < g->graph.num_node_ids(); ++i) {
+       Node* n = g->graph.FindNodeId(i);
+       if (n == nullptr) continue;
+-      g->name_map[n->name()] = n;
++      // We have a convoluted scheme here: Using the C++ graph construction API
++      // to add potentially many nodes to the graph without running the checks
++      // (such as uniqueness of the names of nodes) we run with other functions
++      // that add a node to the graph (like TF_FinishOperation).
++      if (!g->name_map.insert(std::make_pair(n->name(), n)).second) {
++        status->status = tensorflow::errors::Internal(
++            "BUG: The API allowed construction of a graph with duplicate node "
++            "names (",
++            n->name(),
++            "). This is a bug. Please file an issue at "
++            "https://github.com/tensorflow/tensorflow/issues.");
++      }
+     }
+   }
+ 
+diff --git a/tensorflow/c/c_api_test.cc b/tensorflow/c/c_api_test.cc
+index 577f10c5e69ea..bc04b53fbb7fa 100644
+--- a/tensorflow/c/c_api_test.cc
++++ b/tensorflow/c/c_api_test.cc
+@@ -1160,7 +1160,7 @@ TEST(CAPI, GetOpDef) {
+ }
+ 
+ void StringVectorToArrays(const std::vector<string>& v,
+-                          std::unique_ptr<const void* []>* ptrs,
++                          std::unique_ptr<const void*[]>* ptrs,
+                           std::unique_ptr<size_t[]>* lens) {
+   ptrs->reset(new const void*[v.size()]);
+   lens->reset(new size_t[v.size()]);
+@@ -1196,7 +1196,7 @@ class CApiColocationTest : public ::testing::Test {
+ 
+   void SetViaStringList(TF_OperationDescription* desc,
+                         const std::vector<string>& list) {
+-    std::unique_ptr<const void* []> list_ptrs;
++    std::unique_ptr<const void*[]> list_ptrs;
+     std::unique_ptr<size_t[]> list_lens;
+     StringVectorToArrays(list, &list_ptrs, &list_lens);
+     TF_SetAttrStringList(desc, tensorflow::kColocationAttrName, list_ptrs.get(),
+@@ -1700,6 +1700,61 @@ TEST_F(CApiGradientsTest, OpWithNoGradientRegistered_NoGradInputs) {
+   TestGradientsError(false);
+ }
+ 
++void ScalarFloatFromTensor(const TF_Tensor* t, float* f) {
++  ASSERT_TRUE(t != nullptr);
++  ASSERT_EQ(TF_FLOAT, TF_TensorType(t));
++  ASSERT_EQ(0, TF_NumDims(t));
++  ASSERT_EQ(4, TF_TensorByteSize(t));
++  float* p = static_cast<float*>(TF_TensorData(t));
++  *f = *p;
++}
++
++TEST_F(CApiGradientsTest, MultipleCallsToAddGradients) {
++  const float X = 3.0f, Y = 7.0f;
++  TF_Operation* x = Placeholder(graph_, s_, "x", TF_FLOAT);
++  TF_Operation* y = Placeholder(graph_, s_, "y", TF_FLOAT);
++  TF_Operation* xy = Mul(x, y, graph_, s_, "xy");
++  TF_Output dxy_dx, dxy_dy;
++
++  TF_Output outputs[1] = {{xy, 0}};
++  TF_Output inputs[1] = {{x, 0}};
++  TF_AddGradients(graph_, outputs, 1, inputs, 1, nullptr, s_, &dxy_dx);
++  ASSERT_EQ(TF_OK, TF_GetCode(s_)) << TF_Message(s_);
++
++  inputs[0] = {y, 0};
++  TF_AddGradients(graph_, outputs, 1, inputs, 1, nullptr, s_, &dxy_dy);
++  ASSERT_EQ(TF_OK, TF_GetCode(s_)) << TF_Message(s_);
++
++  TF_SessionOptions* opts = TF_NewSessionOptions();
++  TF_Session* sess = TF_NewSession(graph_, opts, s_);
++  TF_DeleteSessionOptions(opts);
++  ASSERT_EQ(TF_OK, TF_GetCode(s_)) << TF_Message(s_);
++
++  TF_Output feeds[] = {{x, 0}, {y, 0}};
++  TF_Tensor* feedValues[] = {FloatTensor(X), FloatTensor(Y)};
++  TF_Output fetches[] = {dxy_dx, dxy_dy};
++  TF_Tensor* fetchValues[] = {nullptr, nullptr};
++
++  TF_SessionRun(sess, nullptr /* run_options */, feeds, feedValues, 2, fetches,
++                fetchValues, 2, nullptr /* target_opers */, 0,
++                nullptr /* run_metadata */, s_);
++  TF_DeleteTensor(feedValues[0]);
++  TF_DeleteTensor(feedValues[1]);
++  ASSERT_EQ(TF_OK, TF_GetCode(s_)) << TF_Message(s_);
++  TF_DeleteSession(sess, s_);
++  ASSERT_EQ(TF_OK, TF_GetCode(s_)) << TF_Message(s_);
++
++  float dxy_dxValue = 0.0f, dxy_dyValue = 0.0f;
++  ScalarFloatFromTensor(fetchValues[0], &dxy_dxValue);
++  EXPECT_EQ(Y, dxy_dxValue);
++
++  ScalarFloatFromTensor(fetchValues[1], &dxy_dyValue);
++  EXPECT_EQ(X, dxy_dyValue);
++
++  TF_DeleteTensor(fetchValues[0]);
++  TF_DeleteTensor(fetchValues[1]);
++}
++
+ // REGISTER_OP for CApiAttributesTest test cases.
+ // Registers two ops, each with a single attribute called 'v'.
+ // The attribute in one op will have a type 'type', the other
+@@ -1784,7 +1839,7 @@ TEST_F(CApiAttributesTest, String) {
+ 
+ TEST_F(CApiAttributesTest, StringList) {
+   std::vector<string> list = {"bugs", "bunny", "duck"};
+-  std::unique_ptr<const void* []> list_ptrs;
++  std::unique_ptr<const void*[]> list_ptrs;
+   std::unique_ptr<size_t[]> list_lens;
+   StringVectorToArrays(list, &list_ptrs, &list_lens);
+   int list_total_size = 0;
+@@ -1800,7 +1855,7 @@ TEST_F(CApiAttributesTest, StringList) {
+   ASSERT_EQ(TF_OK, TF_GetCode(s_)) << TF_Message(s_);
+ 
+   EXPECT_TF_META("v", list.size(), TF_ATTR_STRING, list_total_size);
+-  std::unique_ptr<void* []> values(new void*[list.size()]);
++  std::unique_ptr<void*[]> values(new void*[list.size()]);
+   std::unique_ptr<size_t[]> lens(new size_t[list.size()]);
+   std::unique_ptr<char[]> storage(new char[list_total_size]);
+   TF_OperationGetAttrStringList(oper, "v", values.get(), lens.get(),
+@@ -2025,7 +2080,7 @@ TEST_F(CApiAttributesTest, TensorShapeProtoList) {
+   tensorflow::PartialTensorShape(pts2).AsProto(&proto);
+   proto.SerializeToString(&bytes2);
+ 
+-  std::unique_ptr<const void* []> list_ptrs;
++  std::unique_ptr<const void*[]> list_ptrs;
+   std::unique_ptr<size_t[]> list_lens;
+   const std::vector<string> list = {bytes1, bytes2};
+   StringVectorToArrays(list, &list_ptrs, &list_lens);
+diff --git a/tensorflow/c/c_test_util.cc b/tensorflow/c/c_test_util.cc
+index f3b28c1708129..24eb6c069b213 100644
+--- a/tensorflow/c/c_test_util.cc
++++ b/tensorflow/c/c_test_util.cc
+@@ -216,6 +216,13 @@ TF_Operation* Min(TF_Operation* l, TF_Operation* r, TF_Graph* graph,
+   return MinWithDevice(l, r, graph, /*op_device=*/"", s, name);
+ }
+ 
++TF_Operation* Mul(TF_Operation* l, TF_Operation* r, TF_Graph* graph,
++                  TF_Status* s, const char* name) {
++  TF_Operation* op;
++  BinaryOpHelper("Mul", l, r, graph, s, name, &op, "", true);
++  return op;
++}
++
+ TF_Operation* Add(TF_Output l, TF_Output r, TF_Graph* graph, TF_Status* s,
+                   const char* name) {
+   TF_OperationDescription* desc = TF_NewOperation(graph, "AddN", name);
+diff --git a/tensorflow/c/c_test_util.h b/tensorflow/c/c_test_util.h
+index c16aba666ee69..38313d647ca93 100644
+--- a/tensorflow/c/c_test_util.h
++++ b/tensorflow/c/c_test_util.h
+@@ -80,6 +80,9 @@ TF_Operation* Add(TF_Output l, TF_Output r, TF_Graph* graph, TF_Status* s,
+ TF_Operation* Min(TF_Operation* l, TF_Operation* r, TF_Graph* graph,
+                   TF_Status* s, const char* name = "min");
+ 
++TF_Operation* Mul(TF_Operation* l, TF_Operation* r, TF_Graph* graph,
++                  TF_Status* s, const char* name = "mul");
++
+ // If `op_device` is non-empty, set the created op on that device.
+ TF_Operation* MinWithDevice(TF_Operation* l, TF_Operation* r, TF_Graph* graph,
+                             const string& op_device, TF_Status* s,
+diff --git a/tensorflow/cc/framework/scope.cc b/tensorflow/cc/framework/scope.cc
+index 62a889181e787..8c886f31711eb 100644
+--- a/tensorflow/cc/framework/scope.cc
++++ b/tensorflow/cc/framework/scope.cc
+@@ -37,6 +37,11 @@ Scope& Scope::operator=(const Scope& other) {
+   return *this;
+ }
+ 
++namespace {
++const char kScopeSeparator[] = "/";
++const char kSuffixSeparator[] = "_";
++}  // namespace
++
+ Scope::Impl::Impl(Graph* graph, Status* status, NameMap* name_map,
+                   ShapeRefiner* refiner, bool disable_shape_inference)
+     : graph_(graph),
+@@ -308,19 +313,23 @@ string Scope::Impl::GetUniqueName(const string& prefix,
+     return prefix;
+   }
+   auto entry = name_map_->find(prefix);
+-  string unique_name = prefix;
+   if (entry == name_map_->end()) {
+     name_map_->insert({prefix, 0});
+-  } else {
+-    unique_name = strings::StrCat(unique_name, "_", ++entry->second);
++    return prefix;
+   }
++  string unique_name;
++  do {
++    unique_name = strings::StrCat(prefix, kSuffixSeparator, ++entry->second);
++  } while (name_map_->find(unique_name) != name_map_->end());
++  name_map_->insert({unique_name, 0});
+   return unique_name;
+ }
+ 
+ string Scope::Impl::GetNameForOp(const string& default_name) const {
+   const string unique_name =
+       GetUniqueName(default_name, true /* check_single_use */);
+-  const string sep = name_.empty() || unique_name.empty() ? "" : "/";
++  const string sep =
++      name_.empty() || unique_name.empty() ? "" : kScopeSeparator;
+   return strings::StrCat(name_, sep, unique_name);
+ }
+ 
+@@ -345,7 +354,8 @@ Scope Scope::NewSubScope(const string& child_scope_name) const {
+   }
+   const string unique_name =
+       impl()->GetUniqueName(child_scope_name, false /* check_single_use */);
+-  const string sep = impl()->name_.empty() || unique_name.empty() ? "" : "/";
++  const string sep =
++      impl()->name_.empty() || unique_name.empty() ? "" : kScopeSeparator;
+   return Scope(new Impl(*this, Impl::Tags::ScopeName(),
+                         strings::StrCat(impl()->name_, sep, unique_name),
+                         false /* copy_names */));
+@@ -412,7 +422,7 @@ CompositeOpScopes Scope::GetCompositeOpScopes(
+   if (!impl()->single_use_scope()) {
+     Scope child = NewSubScope(impl()->op_name_.empty() ? composite_op_name
+                                                        : impl()->op_name_);
+-    const string child_op_sep = impl()->name_.empty() ? "" : "_";
++    const string child_op_sep = impl()->name_.empty() ? "" : kSuffixSeparator;
+     const string child_name =
+         strings::StrCat(impl()->name_, child_op_sep, child.impl()->name_);
+     return {child,
+@@ -435,7 +445,13 @@ class InternalScope {
+   static Scope NewScope(Graph* graph, Status* status, ShapeRefiner* refiner) {
+     Scope::Impl::NameMap* name_map = new Scope::Impl::NameMap;
+     for (const Node* node : graph->nodes()) {
+-      (*name_map)[node->name()] = 0;
++      const string& name = node->name();
++      (*name_map)[name] = 0;
++      // Add all name prefixes ('/' separated).
++      size_t idx = -1;
++      while ((idx = name.find(kScopeSeparator, idx + 1)) != string::npos) {
++        (*name_map)[name.substr(0, idx)] = 0;
++      }
+     }
+     // We provide null destructors for these shared ptrs (except for name_map)
+     // since the caller owns them and doesn't want the scope to destroy them.
+diff --git a/tensorflow/cc/framework/scope_internal.h b/tensorflow/cc/framework/scope_internal.h
+index 8efcfed20d0b8..58adaef2e942a 100644
+--- a/tensorflow/cc/framework/scope_internal.h
++++ b/tensorflow/cc/framework/scope_internal.h
+@@ -34,8 +34,7 @@ class Scope::Impl {
+   // name that has not been used so far in a scope will get no suffix. Later
+   // uses of the same name will get suffixes _1, _2, _3, etc. Multiple scopes
+   // can share the same NameMap. For instance, a new scope created using
+-  // WithControlDependencies() should would share the same NameMap with the
+-  // parent.
++  // WithControlDependencies() would share the same NameMap with the parent.
+   typedef std::unordered_map<string, int> NameMap;
+ 
+   Impl(const std::shared_ptr<Graph>& graph,
+diff --git a/tensorflow/cc/framework/scope_test.cc b/tensorflow/cc/framework/scope_test.cc
+index 9eca9d3face34..b40b345eb8423 100644
+--- a/tensorflow/cc/framework/scope_test.cc
++++ b/tensorflow/cc/framework/scope_test.cc
+@@ -26,6 +26,16 @@ TEST(ScopeTest, BasicNames) {
+   EXPECT_EQ(root.GetUniqueNameForOp("mul"), "mul");
+ }
+ 
++TEST(ScopeTest, OpAndScopeNameCollision) {
++  Scope root = Scope::NewRootScope();
++  EXPECT_EQ(root.GetUniqueNameForOp("foo"), "foo");
++  EXPECT_EQ(root.GetUniqueNameForOp("foo"), "foo_1");
++  EXPECT_EQ(root.GetUniqueNameForOp("foo_1"), "foo_1_1");
++  EXPECT_EQ(root.GetUniqueNameForOp("foo_2"), "foo_2");
++  EXPECT_EQ(root.GetUniqueNameForOp("foo"), "foo_3");
++  EXPECT_EQ(root.GetUniqueNameForOp("foo_2"), "foo_2_1");
++}
++
+ TEST(ScopeTest, HierarchicalNames) {
+   Scope root = Scope::NewRootScope();
+   Scope child = root.NewSubScope("child");
diff --git a/gnu/packages/patches/texlive-bin-poppler-0.83.patch b/gnu/packages/patches/texlive-bin-poppler-0.83.patch
deleted file mode 100644
index 5e57e3efac..0000000000
--- a/gnu/packages/patches/texlive-bin-poppler-0.83.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-Fix build with Poppler 0.83 and later.
-
-Taken from Arch Linux, but adjusted to patch the versioned Poppler
-files, as upstream applies it after copying them in place.
-https://git.archlinux.org/svntogit/packages.git/tree/trunk/texlive-poppler-0.83.patch?h=packages/texlive-bin
-
-diff -ru texlive-source-orig/texk/web2c/pdftexdir/pdftoepdf-poppler0.76.0.cc texlive-source/texk/web2c/pdftexdir/pdftoepdf-poppler0.76.0.cc
---- texlive-source-orig/texk/web2c/pdftexdir/pdftoepdf-poppler0.76.0.cc
-+++ texlive-source/texk/web2c/pdftexdir/pdftoepdf-poppler0.76.0.cc
-@@ -723,7 +723,7 @@
- #endif
-     // initialize
-     if (!isInit) {
--        globalParams = new GlobalParams();
-+        globalParams.reset(new GlobalParams());
-         globalParams->setErrQuiet(false);
-         isInit = true;
-     }
-@@ -1108,6 +1108,5 @@
-             delete_document(p);
-         }
-         // see above for globalParams
--        delete globalParams;
-     }
- }
-diff -ru texlive-source-orig/texk/web2c/pdftexdir/pdftosrc-poppler0.76.0.cc texlive-source/texk/web2c/pdftexdir/pdftosrc-poppler0.76.0.cc
---- texlive-source-orig/texk/web2c/pdftexdir/pdftosrc-poppler0.76.0.cc
-+++ texlive-source/texk/web2c/pdftexdir/pdftosrc-poppler0.76.0.cc
-@@ -79,7 +79,7 @@
-         exit(1);
-     }
-     fileName = new GString(argv[1]);
--    globalParams = new GlobalParams();
-+    globalParams.reset(new GlobalParams());
-     doc = new PDFDoc(fileName);
-     if (!doc->isOk()) {
-         fprintf(stderr, "Invalid PDF file\n");
-@@ -100,7 +100,7 @@
-     if (objnum == 0) {
-         srcStream = catalogDict.dictLookup("SourceObject");
-         static char const_SourceFile[] = "SourceFile";
--        if (!srcStream.isStream(const_SourceFile)) {
-+        if (!srcStream.isDict(const_SourceFile)) {
-             fprintf(stderr, "No SourceObject found\n");
-             exit(1);
-         }
-@@ -202,5 +202,4 @@
-         fprintf(stderr, "Cross-reference table extracted to %s\n", outname);
-     fclose(outfile);
-     delete doc;
--    delete globalParams;
- }
diff --git a/gnu/packages/patches/texlive-bin-poppler-0.86.patch b/gnu/packages/patches/texlive-bin-poppler-0.86.patch
deleted file mode 100644
index b1adca657b..0000000000
--- a/gnu/packages/patches/texlive-bin-poppler-0.86.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-Fix build with Poppler 0.86 and later.
-
-Taken from Arch Linux, but adjusted to patch the versioned Poppler
-files, as upstream applies it after copying them in place.
-https://git.archlinux.org/svntogit/packages.git/tree/trunk/texlive-poppler-0.86.patch?h=packages/texlive-bin
-
---- a/texk/web2c/pdftexdir/pdftoepdf-poppler0.76.0.cc	2020-03-03 21:11:35.102711802 +0000
-+++ b/texk/web2c/pdftexdir/pdftoepdf-poppler0.76.0.cc	2020-03-03 21:13:13.057420111 +0000
-@@ -757,7 +757,7 @@
-     if (page_name) {
-         // get page by name
-         GString name(page_name);
--        LinkDest *link = pdf_doc->doc->findDest(&name);
-+        LinkDest *link = pdf_doc->doc->findDest(&name).get();
-         if (link == 0 || !link->isOk())
-             pdftex_fail("PDF inclusion: invalid destination <%s>", page_name);
-         Ref ref = link->getPageRef();
diff --git a/gnu/packages/patches/tootle-glib-object-naming.patch b/gnu/packages/patches/tootle-glib-object-naming.patch
new file mode 100644
index 0000000000..08ee23dd8f
--- /dev/null
+++ b/gnu/packages/patches/tootle-glib-object-naming.patch
@@ -0,0 +1,66 @@
+From 0816105028c26965e37c9afc7c598854f3fecde1 Mon Sep 17 00:00:00 2001
+From: Clayton Craft <clayton@craftyguy.net>
+Date: Tue, 26 Oct 2021 15:03:25 -0700
+Subject: [PATCH] Adhere to GLib.Object naming conventions for properties
+
+Vala now validates property names against GLib.Object conventions, this
+fixes a compilation error as a result of this enforcement:
+
+../src/API/Status.vala:27.5-27.23: error: Name `_url' is not valid for a GLib.Object property
+    public string? _url { get; set; }
+    ^^^^^^^^^^^^^^^^^^^
+
+Relevant Vala change:
+https://gitlab.gnome.org/GNOME/vala/-/commit/38d61fbff037687ea4772e6df85c7e22a74b335e
+
+fixes #337
+
+Signed-off-by: Clayton Craft <clayton@craftyguy.net>
+---
+ src/API/Attachment.vala | 6 +++---
+ src/API/Status.vala     | 8 ++++----
+ 2 files changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/src/API/Attachment.vala b/src/API/Attachment.vala
+index 88bc5bb..35c4018 100644
+--- a/src/API/Attachment.vala
++++ b/src/API/Attachment.vala
+@@ -4,10 +4,10 @@ public class Tootle.API.Attachment : Entity, Widgetizable {
+ 	public string kind { get; set; default = "unknown"; }
+ 	public string url { get; set; }
+ 	public string? description { get; set; }
+-	public string? _preview_url { get; set; }
++	private string? t_preview_url { get; set; }
+ 	public string? preview_url {
+-		set { this._preview_url = value; }
+-		get { return (this._preview_url == null || this._preview_url == "") ? url : _preview_url; }
++		set { this.t_preview_url = value; }
++		get { return (this.t_preview_url == null || this.t_preview_url == "") ? url : t_preview_url; }
+ 	}
+ 
+ 	public File? source_file { get; set; }
+diff --git a/src/API/Status.vala b/src/API/Status.vala
+index 4f92cdb..00e8a9f 100644
+--- a/src/API/Status.vala
++++ b/src/API/Status.vala
+@@ -28,16 +28,16 @@ public class Tootle.API.Status : Entity, Widgetizable {
+     public ArrayList<API.Mention>? mentions { get; set; default = null; }
+     public ArrayList<API.Attachment>? media_attachments { get; set; default = null; }
+ 
+-    public string? _url { get; set; }
++    private string? t_url { get; set; }
+     public string url {
+         owned get { return this.get_modified_url (); }
+-        set { this._url = value; }
++        set { this.t_url = value; }
+     }
+     string get_modified_url () {
+-        if (this._url == null) {
++        if (this.t_url == null) {
+             return this.uri.replace ("/activity", "");
+         }
+-        return this._url;
++        return this.t_url;
+     }
+ 
+     public Status formal {
diff --git a/gnu/packages/patches/tootle-reason-phrase.patch b/gnu/packages/patches/tootle-reason-phrase.patch
new file mode 100644
index 0000000000..72a1d1ecfa
--- /dev/null
+++ b/gnu/packages/patches/tootle-reason-phrase.patch
@@ -0,0 +1,48 @@
+From 858ee78fbebe161a4cdd707a469dc0f045211a51 Mon Sep 17 00:00:00 2001
+From: Max Harmathy <harmathy@mailbox.org>
+Date: Wed, 25 Aug 2021 13:05:58 +0200
+Subject: [PATCH] Use reason_phrase instead of get_phrase
+
+---
+ src/Services/Cache.vala   | 2 +-
+ src/Services/Network.vala | 7 +------
+ 2 files changed, 2 insertions(+), 7 deletions(-)
+
+diff --git a/src/Services/Cache.vala b/src/Services/Cache.vala
+index 2251697..2ed314e 100644
+--- a/src/Services/Cache.vala
++++ b/src/Services/Cache.vala
+@@ -88,7 +88,7 @@ public class Tootle.Cache : GLib.Object {
+                 try {
+                     var code = msg.status_code;
+ 					if (code != Soup.Status.OK) {
+-					    var error = network.describe_error (code);
++					    var error = msg.reason_phrase;
+ 					    throw new Oopsie.INSTANCE (@"Server returned $error");
+ 					}
+ 
+diff --git a/src/Services/Network.vala b/src/Services/Network.vala
+index fa2839c..d0143b0 100644
+--- a/src/Services/Network.vala
++++ b/src/Services/Network.vala
+@@ -56,7 +56,7 @@ public class Tootle.Network : GLib.Object {
+                 else if (status == Soup.Status.CANCELLED)
+                     debug ("Message is cancelled. Ignoring callback invocation.");
+                 else
+-                    ecb ((int32) status, describe_error ((int32) status));
++                    ecb ((int32) status, msg.reason_phrase);
+             });
+         }
+         catch (Error e) {
+@@ -65,11 +65,6 @@ public class Tootle.Network : GLib.Object {
+         }
+     }
+ 
+-	public string describe_error (uint code) {
+-	    var reason = Soup.Status.get_phrase (code);
+-		return @"$code: $reason";
+-	}
+-
+     public void on_error (int32 code, string message) {
+         warning (message);
+         app.toast (message);
diff --git a/gnu/packages/patches/tor-sandbox-i686.patch b/gnu/packages/patches/tor-sandbox-i686.patch
new file mode 100644
index 0000000000..34b0a053b1
--- /dev/null
+++ b/gnu/packages/patches/tor-sandbox-i686.patch
@@ -0,0 +1,36 @@
+This patch fixes sandboxing on i686 by allowing 'statx'.  Without this,
+'src/test/test_include.sh' would fail.
+
+Patch adapted from:
+
+  https://gitlab.torproject.org/tpo/core/tor/-/merge_requests/480
+
+From 001d880d1082f5d124e10554e2718e407c7e88c6 Mon Sep 17 00:00:00 2001
+From: Simon South <simon@simonsouth.net>
+Date: Fri, 5 Nov 2021 10:10:10 -0400
+Subject: [PATCH] sandbox: Allow "statx" syscall on i386 for glibc 2.33
+
+glibc versions 2.33 and newer use the modern "statx" system call in their
+implementations of stat() and opendir() for Linux on i386.  Prevent failures in
+the sandbox unit tests by modifying the sandbox to allow this system call
+without restriction on i386 when it is available, and update the test suite to
+skip the "sandbox/stat_filename" test in this case as it is certain to fail.
+---
+ src/lib/sandbox/sandbox.c | 3 +++
+ src/test/test_sandbox.c   | 7 ++++---
+ 2 files changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/src/lib/sandbox/sandbox.c b/src/lib/sandbox/sandbox.c
+index fb02a345ab..a15f99ad76 100644
+--- a/src/lib/sandbox/sandbox.c
++++ b/src/lib/sandbox/sandbox.c
+@@ -252,6 +252,9 @@ static int filter_nopar_gen[] = {
+     SCMP_SYS(sigreturn),
+ #endif
+     SCMP_SYS(stat),
++#if defined(__i386__) && defined(__NR_statx)
++    SCMP_SYS(statx),
++#endif
+     SCMP_SYS(uname),
+     SCMP_SYS(wait4),
+     SCMP_SYS(write),
diff --git a/gnu/packages/patches/transmission-remote-gtk-fix-appstream.patch b/gnu/packages/patches/transmission-remote-gtk-fix-appstream.patch
deleted file mode 100644
index e7d4c8bb86..0000000000
--- a/gnu/packages/patches/transmission-remote-gtk-fix-appstream.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-Fix a bug related to AppStream:
-
-https://github.com/transmission-remote-gtk/transmission-remote-gtk/issues/95
-
-Patch adapted from upstream source repository:
-
-https://github.com/transmission-remote-gtk/transmission-remote-gtk/commit/89259ff90c703c7fe6768b5317803b9aa5b5ab8c
-
-From 89259ff90c703c7fe6768b5317803b9aa5b5ab8c Mon Sep 17 00:00:00 2001
-From: Alan <alan-github@eth0.org.uk>
-Date: Tue, 17 Nov 2020 01:26:22 +0000
-Subject: [PATCH] fix screenshot and add OARS rating so appdata validates
-
----
- README.md                                           | 5 ++---
- data/io.github.TransmissionRemoteGtk.appdata.xml.in | 5 +++--
- 2 files changed, 5 insertions(+), 5 deletions(-)
-
-diff --git a/README.md b/README.md
-index 4306cc7..d38314b 100644
---- a/README.md
-+++ b/README.md
-@@ -6,13 +6,12 @@ the Transmission BitTorrent client, using its HTTP RPC protocol.
- 
- # DEPENDENCIES
- 
--The following packages are required dependencies:
-+The following packages are required dependencies (debian/ubuntu).
- 
- ```bash
--autoconf-archive appstream-glib intltool
-+libgtk-3-dev automake autoconf gcc libgeoip-dev gettext autoconf-archive libappstream-dev appstream-util libcurl4-openssl-dev libjson-glib-dev
- ```
- 
--
- # BUILDING
- 
- Optionally install `libgeoip` and its headers to see the country
-diff --git a/data/io.github.TransmissionRemoteGtk.appdata.xml.in b/data/io.github.TransmissionRemoteGtk.appdata.xml.in
-index fc35a8f..1476c2a 100644
---- a/data/io.github.TransmissionRemoteGtk.appdata.xml.in
-+++ b/data/io.github.TransmissionRemoteGtk.appdata.xml.in
-@@ -7,6 +7,7 @@
-   <translation type="gettext">transmission-remote-gtk</translation>
-   <name>Transmission Remote</name>
-   <developer_name>Transmission Remote Gtk Team</developer_name>
-+  <content_rating type="oars-1.1" />
-   <summary>Remotely manage the Transmission BitTorrent client</summary>
-   <url type="homepage">https://github.com/transmission-remote-gtk/transmission-remote-gtk</url>
-   <url type="bugtracker">https://github.com/transmission-remote-gtk/transmission-remote-gtk/issues</url>
-@@ -23,8 +24,8 @@
-     </ul>
-   </description>
-   <screenshots>
--    <screenshot height="576" width="1024" type="default">
--      <image>http://eth0.org.uk/~alan/transmission-remote-gtk-1.1.1.png</image>
-+    <screenshot height="512" width="973" type="default">
-+      <image>https://community.linuxmint.com/img/screenshots/transmission-remote-gtk.png</image>
-     </screenshot>
-   </screenshots>
-   <releases>
diff --git a/gnu/packages/patches/tremc-fix-decodestring.patch b/gnu/packages/patches/tremc-fix-decodestring.patch
new file mode 100644
index 0000000000..346f65e611
--- /dev/null
+++ b/gnu/packages/patches/tremc-fix-decodestring.patch
@@ -0,0 +1,25 @@
+From 79995bc82e81f0429222aab4d90a03440feef057 Mon Sep 17 00:00:00 2001
+From: Matan Ziv-Av <matan@svgalib.org>
+Date: Mon, 29 Jun 2020 15:18:03 +0300
+Subject: [PATCH] Use base64.decodebytes.
+
+Based on upstream commit 79995bc82e81f0429222aab4d90a03440feef057 which
+confuses several unrelated changes.
+
+---
+ tremc | 29 ++++++++++++++++++++++++++++-
+ 1 file changed, 28 insertions(+), 1 deletion(-)
+
+diff --git a/tremc b/tremc
+index b47f012..c626fde 100755
+--- a/tremc
++++ b/tremc
+@@ -440,7 +443,7 @@ class Transmission(object):
+                 # TAG_TORRENT_DETAILS, but just passing seems to help.(?)
+                 try:
+                     torrent_details = response['arguments']['torrents'][0]
+-                    torrent_details['pieces'] = base64.decodestring(bytes(torrent_details['pieces'], ENCODING))
++                    torrent_details['pieces'] = base64.decodebytes(bytes(torrent_details['pieces'], ENCODING))
+                     self.torrent_details_cache = torrent_details
+                     self.upgrade_peerlist()
+                 except IndexError:
diff --git a/gnu/packages/patches/trytond-add-egg-modules-to-path.patch b/gnu/packages/patches/trytond-add-egg-modules-to-path.patch
new file mode 100644
index 0000000000..1baccfee1c
--- /dev/null
+++ b/gnu/packages/patches/trytond-add-egg-modules-to-path.patch
@@ -0,0 +1,22 @@
+Work around trytond.module not being a real namespace module.
+
+Solution is to add all trytond module's locations to
+trytond.modules._path__. This will make trytond.module behave much
+like a namespace module.
+Adding to __path__ is done in update_egg_modules() to ensure __path__
+is updated whenever the list of egg modules is updated.
+
+*** a/trytond/modules/__init__.py	1970-01-01 01:00:01.000000000 +0100
+--- b/trytond/modules/__init__.py	2021-12-02 18:12:15.385101986 +0100
+***************
+*** 38,43 ****
+--- 38,46 ----
+          import pkg_resources
+          for ep in pkg_resources.iter_entry_points('trytond.modules'):
+              EGG_MODULES[ep.name] = ep
++             path = os.path.join(ep.dist.location, 'trytond', 'modules')
++             if not path in __path__ and os.path.isdir(path):
++                 __path__.append(path)
+      except ImportError:
+          pass
+  
diff --git a/gnu/packages/patches/trytond-add-guix_trytond_path.patch b/gnu/packages/patches/trytond-add-guix_trytond_path.patch
new file mode 100644
index 0000000000..7dc136ec46
--- /dev/null
+++ b/gnu/packages/patches/trytond-add-guix_trytond_path.patch
@@ -0,0 +1,26 @@
+Make trytond add all paths listed in GUIX_TRYTOND_MODULES_PATH to sys.path.
+
+*** a/trytond/modules/__init__.py	1970-01-01 01:00:01.000000000 +0100
+--- b/trytond/modules/__init__.py	2021-12-02 22:17:28.014612267 +0100
+***************
+*** 31,36 ****
+--- 31,48 ----
+  
+  EGG_MODULES = {}
+  
++ def __extend_python_path__():
++     tryton_python_path = os.environ.get("GUIX_TRYTOND_MODULES_PATH")
++     if tryton_python_path:
++         paths = [path[:-16]  # remove "/trytond/modules"
++                  for path in tryton_python_path.split(os.pathsep)]
++         sys.path.extend(paths)
++         # ensure new paths are in the pkg_resources WorkingSet
++         import pkg_resources
++         list(map(pkg_resources.working_set.add_entry, paths))
++ 
++ __extend_python_path__()
++ 
+  
+  def update_egg_modules():
+      global EGG_MODULES
+l
diff --git a/gnu/packages/patches/u-boot-allow-disabling-openssl.patch b/gnu/packages/patches/u-boot-allow-disabling-openssl.patch
new file mode 100644
index 0000000000..e3ec92be84
--- /dev/null
+++ b/gnu/packages/patches/u-boot-allow-disabling-openssl.patch
@@ -0,0 +1,164 @@
+From f060e90d148270307228315e2759a0065ec1d796 Mon Sep 17 00:00:00 2001
+From: Vagrant Cascadian <vagrant@debian.org>
+Date: Fri, 22 Oct 2021 17:34:53 -0700
+Subject: [PATCH] Revert "tools: kwbimage: Do not hide usage of secure header
+ under CONFIG_ARMADA_38X"
+
+This reverts commit b4f3cc2c42d97967a3a3c8796c340f6b07ecccac.
+---
+ tools/Makefile   |  8 ++++++++
+ tools/kwbimage.c | 22 ++++++++++++++++++++++
+ 2 files changed, 30 insertions(+)
+
+diff --git a/tools/Makefile b/tools/Makefile
+index 4a86321f64..9517f203fd 100644
+--- a/tools/Makefile
++++ b/tools/Makefile
+@@ -169,6 +169,14 @@ HOST_EXTRACFLAGS	+= -DCONFIG_FIT_SIGNATURE_MAX_SIZE=0xffffffff
+ HOST_EXTRACFLAGS	+= -DCONFIG_FIT_CIPHER
+ endif
+ 
++ifneq ($(CONFIG_SYS_U_BOOT_OFFS),)
++HOSTCFLAGS_kwbimage.o += -DCONFIG_SYS_U_BOOT_OFFS=$(CONFIG_SYS_U_BOOT_OFFS)
++endif
++
++ifneq ($(CONFIG_ARMADA_38X),)
++HOSTCFLAGS_kwbimage.o += -DCONFIG_KWB_SECURE
++endif
++
+ # MXSImage needs LibSSL
+ ifneq ($(CONFIG_MX23)$(CONFIG_MX28)$(CONFIG_ARMADA_38X)$(CONFIG_TOOLS_LIBCRYPTO),)
+ HOSTCFLAGS_kwbimage.o += \
+diff --git a/tools/kwbimage.c b/tools/kwbimage.c
+index d200ff2425..23d6be3c9a 100644
+--- a/tools/kwbimage.c
++++ b/tools/kwbimage.c
+@@ -14,6 +14,7 @@
+ #include <stdint.h>
+ #include "kwbimage.h"
+ 
++#ifdef CONFIG_KWB_SECURE
+ #include <openssl/bn.h>
+ #include <openssl/rsa.h>
+ #include <openssl/pem.h>
+@@ -39,10 +40,13 @@ void EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx)
+ 	EVP_MD_CTX_reset(ctx);
+ }
+ #endif
++#endif
+ 
+ static struct image_cfg_element *image_cfg;
+ static int cfgn;
++#ifdef CONFIG_KWB_SECURE
+ static int verbose_mode;
++#endif
+ 
+ struct boot_mode {
+ 	unsigned int id;
+@@ -237,6 +241,8 @@ image_count_options(unsigned int optiontype)
+ 	return count;
+ }
+ 
++#if defined(CONFIG_KWB_SECURE)
++
+ static int image_get_csk_index(void)
+ {
+ 	struct image_cfg_element *e;
+@@ -259,6 +265,8 @@ static bool image_get_spezialized_img(void)
+ 	return e->sec_specialized_img;
+ }
+ 
++#endif
++
+ /*
+  * Compute a 8-bit checksum of a memory area. This algorithm follows
+  * the requirements of the Marvell SoC BootROM specifications.
+@@ -353,6 +361,7 @@ static uint8_t baudrate_to_option(unsigned int baudrate)
+ 	}
+ }
+ 
++#if defined(CONFIG_KWB_SECURE)
+ static void kwb_msg(const char *fmt, ...)
+ {
+ 	if (verbose_mode) {
+@@ -847,6 +856,8 @@ done:
+ 	return ret;
+ }
+ 
++#endif
++
+ static void *image_create_v0(size_t *imagesz, struct image_tool_params *params,
+ 			     int payloadsz)
+ {
+@@ -977,11 +988,13 @@ static size_t image_headersz_v1(int *hasext)
+ 			*hasext = 1;
+ 	}
+ 
++#if defined(CONFIG_KWB_SECURE)
+ 	if (image_get_csk_index() >= 0) {
+ 		headersz += sizeof(struct secure_hdr_v1);
+ 		if (hasext)
+ 			*hasext = 1;
+ 	}
++#endif
+ 
+ 	/*
+ 	 * The payload should be aligned on some reasonable
+@@ -1058,6 +1071,8 @@ err_close:
+ 	return -1;
+ }
+ 
++#if defined(CONFIG_KWB_SECURE)
++
+ int export_pub_kak_hash(RSA *kak, struct secure_hdr_v1 *secure_hdr)
+ {
+ 	FILE *hashf;
+@@ -1170,6 +1185,7 @@ int add_secure_header_v1(struct image_tool_params *params, uint8_t *ptr,
+ 
+ 	return 0;
+ }
++#endif
+ 
+ static void *image_create_v1(size_t *imagesz, struct image_tool_params *params,
+ 			     uint8_t *ptr, int payloadsz)
+@@ -1177,7 +1193,9 @@ static void *image_create_v1(size_t *imagesz, struct image_tool_params *params,
+ 	struct image_cfg_element *e;
+ 	struct main_hdr_v1 *main_hdr;
+ 	struct register_set_hdr_v1 *register_set_hdr;
++#if defined(CONFIG_KWB_SECURE)
+ 	struct secure_hdr_v1 *secure_hdr = NULL;
++#endif
+ 	size_t headersz;
+ 	uint8_t *image, *cur;
+ 	int hasext = 0;
+@@ -1253,6 +1271,7 @@ static void *image_create_v1(size_t *imagesz, struct image_tool_params *params,
+ 	if (main_hdr->blockid == IBR_HDR_PEX_ID)
+ 		main_hdr->srcaddr = cpu_to_le32(0xFFFFFFFF);
+ 
++#if defined(CONFIG_KWB_SECURE)
+ 	if (image_get_csk_index() >= 0) {
+ 		/*
+ 		 * only reserve the space here; we fill the header later since
+@@ -1263,6 +1282,7 @@ static void *image_create_v1(size_t *imagesz, struct image_tool_params *params,
+ 		*next_ext = 1;
+ 		next_ext = &secure_hdr->next;
+ 	}
++#endif
+ 
+ 	datai = 0;
+ 	register_set_hdr = (struct register_set_hdr_v1 *)cur;
+@@ -1310,9 +1330,11 @@ static void *image_create_v1(size_t *imagesz, struct image_tool_params *params,
+ 			return NULL;
+ 	}
+ 
++#if defined(CONFIG_KWB_SECURE)
+ 	if (secure_hdr && add_secure_header_v1(params, ptr, payloadsz,
+ 					       headersz, image, secure_hdr))
+ 		return NULL;
++#endif
+ 
+ 	/* Calculate and set the header checksum */
+ 	main_hdr->checksum = image_checksum8(main_hdr, headersz);
+-- 
+2.30.2
+
diff --git a/gnu/packages/patches/u-boot-rk3399-enable-emmc-phy.patch b/gnu/packages/patches/u-boot-rk3399-enable-emmc-phy.patch
new file mode 100644
index 0000000000..f14a9ce104
--- /dev/null
+++ b/gnu/packages/patches/u-boot-rk3399-enable-emmc-phy.patch
@@ -0,0 +1,26 @@
+adapting commit ac804143cf ("mmc: rockchip_sdhci: add phy and clock
+config for rk3399") to fix the issue "Not found emmc phy device".
+
+Signed-off-by: Yifeng Zhao <yifeng.zhao@rock-chips.com>
+---
+
+ arch/arm/dts/rk3399-u-boot.dtsi | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/arch/arm/dts/rk3399-u-boot.dtsi b/arch/arm/dts/rk3399-u-boot.dtsi
+index 73922c328a..716b9a433a 100644
+--- a/arch/arm/dts/rk3399-u-boot.dtsi
++++ b/arch/arm/dts/rk3399-u-boot.dtsi
+@@ -88,6 +88,10 @@
+ 	u-boot,dm-pre-reloc;
+ };
+ 
++&emmc_phy {
++	u-boot,dm-pre-reloc;
++};
++
+ &grf {
+ 	u-boot,dm-pre-reloc;
+ };
+-- 
+2.17.1
diff --git a/gnu/packages/patches/udiskie-no-appindicator.patch b/gnu/packages/patches/udiskie-no-appindicator.patch
deleted file mode 100644
index df3efe104b..0000000000
--- a/gnu/packages/patches/udiskie-no-appindicator.patch
+++ /dev/null
@@ -1,155 +0,0 @@
-Remove the support for Unity's appindicator.
-
-diff -Naur udiskie-2.0.4/completions/zsh/_udiskie udiskie-2.0.4-new/completions/zsh/_udiskie
---- udiskie-2.0.4/completions/zsh/_udiskie	2020-01-21 01:12:40.000000000 +0100
-+++ udiskie-2.0.4-new/completions/zsh/_udiskie	2020-01-23 10:15:46.956141667 +0100
-@@ -18,8 +18,6 @@
-     '(-a)'{-A,--no-automount}"[disable automounting]"
-     '(-N)'{-n,--notify}"[show popup notifications]"
-     '(-n)'{-N,--no-notify}"[disable notifications]"
--    '(--no-appindicator)'--appindicator"[use appindicator for status icon]"
--    '(--appindicator)'--no-appindicator"[don't use appindicator]"
-     '(-T -s)'{-t,--tray}"[show tray icon]"
-     '(-T -t)'{-s,--smart-tray}"[auto hide tray icon]"
-     '(-t -s)'{-T,--no-tray}"[disable tray icon]"
-diff -Naur udiskie-2.0.4/doc/udiskie.8.txt udiskie-2.0.4-new/doc/udiskie.8.txt
---- udiskie-2.0.4/doc/udiskie.8.txt	2020-01-21 01:12:40.000000000 +0100
-+++ udiskie-2.0.4-new/doc/udiskie.8.txt	2020-01-23 10:16:12.636290647 +0100
-@@ -92,12 +92,6 @@
- *--no-terminal*::
- 	Disable terminal action.
- 
--*--appindicator*::
--	Use AppIndicator3 for the status icon. Use this on Ubuntu/Unity if no icon is shown.
--
--*--no-appindicator*::
--	Use Gtk.StatusIcon for the status icon (default).
--
- *--password-cache MINUTES*::
- 	Cache passwords for LUKS partitions and set the timeout.
- 
-diff -Naur udiskie-2.0.4/udiskie/appindicator.py udiskie-2.0.4-new/udiskie/appindicator.py
---- udiskie-2.0.4/udiskie/appindicator.py	2020-01-21 01:12:40.000000000 +0100
-+++ udiskie-2.0.4-new/udiskie/appindicator.py	1970-01-01 01:00:00.000000000 +0100
-@@ -1,61 +0,0 @@
--"""
--Status icon using AppIndicator3.
--"""
--
--from gi.repository import Gtk
--from gi.repository import AppIndicator3
--
--from .async_ import Future
--
--
--class AppIndicatorIcon:
--
--    """
--    Show status icon using AppIndicator as backend. Replaces
--    `udiskie.tray.StatusIcon` on ubuntu/unity.
--    """
--
--    def __init__(self, menumaker, _icons):
--        self._maker = menumaker
--        self._menu = Gtk.Menu()
--        self._indicator = AppIndicator3.Indicator.new(
--            'udiskie',
--            _icons.get_icon_name('media'),
--            AppIndicator3.IndicatorCategory.HARDWARE)
--        self._indicator.set_status(AppIndicator3.IndicatorStatus.PASSIVE)
--        self._indicator.set_menu(self._menu)
--        # Get notified before menu is shown, see:
--        # https://bugs.launchpad.net/screenlets/+bug/522152/comments/15
--        dbusmenuserver = self._indicator.get_property('dbus-menu-server')
--        self._dbusmenuitem = dbusmenuserver.get_property('root-node')
--        self._conn = self._dbusmenuitem.connect('about-to-show', self._on_show)
--        self.task = Future()
--        menumaker._quit_action = self.destroy
--        # Populate menu initially, so libdbusmenu does not ignore the
--        # 'about-to-show':
--        self._maker(self._menu)
--
--    def destroy(self):
--        self.show(False)
--        self._dbusmenuitem.disconnect(self._conn)
--        self.task.set_result(True)
--
--    @property
--    def visible(self):
--        status = self._indicator.get_status()
--        return status == AppIndicator3.IndicatorStatus.ACTIVE
--
--    def show(self, show=True):
--        if show == self.visible:
--            return
--        status = (AppIndicator3.IndicatorStatus.ACTIVE if show else
--                  AppIndicator3.IndicatorStatus.PASSIVE)
--        self._indicator.set_status(status)
--
--    def _on_show(self, menu):
--        # clear menu:
--        for item in self._menu.get_children():
--            self._menu.remove(item)
--        # repopulate:
--        self._maker(self._menu)
--        self._menu.show_all()
-diff -Naur udiskie-2.0.4/udiskie/cli.py udiskie-2.0.4-new/udiskie/cli.py
---- udiskie-2.0.4/udiskie/cli.py	2020-01-21 01:12:40.000000000 +0100
-+++ udiskie-2.0.4-new/udiskie/cli.py	2020-01-23 10:17:13.064810617 +0100
-@@ -287,9 +287,6 @@
-         -T, --no-tray                           Disable tray icon
-         -m MENU, --menu MENU                    Tray menu [flat/nested]
- 
--        --appindicator                          Use appindicator for status icon
--        --no-appindicator                       Don't use appindicator
--
-         --password-cache MINUTES                Set password cache timeout
-         --no-password-cache                     Disable password cache
- 
-@@ -312,7 +309,6 @@
-         'notify': True,
-         'tray': False,
-         'menu': 'flat',
--        'appindicator': False,
-         'file_manager': 'xdg-open',
-         'terminal': '',
-         'password_prompt': 'builtin:gui',
-@@ -328,7 +324,6 @@
-             '--no-tray': False,
-             '--smart-tray': 'auto'}),
-         'menu': Value('--menu'),
--        'appindicator': Switch('appindicator'),
-         'file_manager': OptionalValue('--file-manager'),
-         'password_prompt': OptionalValue('--password-prompt'),
-         'password_cache': OptionalValue('--password-cache'),
-@@ -459,11 +454,7 @@
- 
-         menu_maker = udiskie.tray.UdiskieMenu(self, icons, actions, flat,
-                                               config.quickmenu_actions)
--        if options['appindicator']:
--            import udiskie.appindicator
--            TrayIcon = udiskie.appindicator.AppIndicatorIcon
--        else:
--            TrayIcon = udiskie.tray.TrayIcon
-+        TrayIcon = udiskie.tray.TrayIcon
-         trayicon = TrayIcon(menu_maker, icons)
-         return udiskie.tray.UdiskieStatusIcon(trayicon, menu_maker, smart)
- 
-diff -Naur udiskie-2.0.4/udiskie.egg-info/SOURCES.txt udiskie-2.0.4-new/udiskie.egg-info/SOURCES.txt
---- udiskie-2.0.4/udiskie.egg-info/SOURCES.txt	2020-01-21 01:12:41.000000000 +0100
-+++ udiskie-2.0.4-new/udiskie.egg-info/SOURCES.txt	2020-01-23 10:17:50.657205798 +0100
-@@ -25,7 +25,6 @@
- test/test_cache.py
- test/test_match.py
- udiskie/__init__.py
--udiskie/appindicator.py
- udiskie/async_.py
- udiskie/automount.py
- udiskie/cache.py
-@@ -47,4 +46,4 @@
- udiskie.egg-info/entry_points.txt
- udiskie.egg-info/requires.txt
- udiskie.egg-info/top_level.txt
--udiskie.egg-info/zip-safe
-\ Pas de fin de ligne à la fin du fichier
-+udiskie.egg-info/zip-safe
diff --git a/gnu/packages/patches/ungoogled-chromium-RUNPATH.patch b/gnu/packages/patches/ungoogled-chromium-RUNPATH.patch
new file mode 100644
index 0000000000..379c47ac7e
--- /dev/null
+++ b/gnu/packages/patches/ungoogled-chromium-RUNPATH.patch
@@ -0,0 +1,22 @@
+Use RUNPATH instead of RPATH so that end users can override the library
+search path (and the 'validate-runpath' phase can do its work).
+
+diff --git a/build/config/gcc/BUILD.gn b/build/config/gcc/BUILD.gn
+--- a/build/config/gcc/BUILD.gn
++++ b/build/config/gcc/BUILD.gn
+@@ -99,7 +99,14 @@ config("executable_config") {
+     ]
+   }
+ 
+-  if (!is_android && current_os != "aix") {
++  if (is_linux) {
++    ldflags += [
++      # Set DT_RUNPATH instead of DT_RPATH which is important because the
++      # former can be overridden at runtime, and Guix has support for
++      # verifying that nothing is missing.
++      "-Wl,--enable-new-dtags",
++    ]
++  } else if (!is_android && current_os != "aix") {
+     ldflags += [
+       # TODO(GYP): Do we need a check on the binutils version here?
+       #
diff --git a/gnu/packages/patches/ungoogled-chromium-accelerated-video-decode.patch b/gnu/packages/patches/ungoogled-chromium-accelerated-video-decode.patch
new file mode 100644
index 0000000000..cbab626e59
--- /dev/null
+++ b/gnu/packages/patches/ungoogled-chromium-accelerated-video-decode.patch
@@ -0,0 +1,18 @@
+Upstream Chromium no longer supports hardware accelerated video decoding
+on GNU/Linux, yet it still works fine on many systems.  This patch "unexpires"
+the support.
+
+Taken from Arch Linux:
+https://github.com/archlinux/svntogit-packages/blob/packages/chromium/trunk/unexpire-accelerated-video-decode-flag.patch
+
+--- a/chrome/browser/flag-metadata.json
++++ b/chrome/browser/flag-metadata.json
+@@ -1285,7 +1285,7 @@
+   {
+     "name": "enable-accelerated-video-decode",
+     "owners": [ "media-dev@chromium.org" ],
+-    "expiry_milestone": 93
++    "expiry_milestone": 99
+   },
+   {
+     "name": "enable-accessibility-live-caption",
diff --git a/gnu/packages/patches/ungoogled-chromium-system-ffmpeg.patch b/gnu/packages/patches/ungoogled-chromium-system-ffmpeg.patch
new file mode 100644
index 0000000000..1472206b02
--- /dev/null
+++ b/gnu/packages/patches/ungoogled-chromium-system-ffmpeg.patch
@@ -0,0 +1,18 @@
+Alias the av_stream_get_first_dts definition added by Chromium in
+their bundled fork.
+
+Taken from Arch Linux:
+
+  https://github.com/archlinux/svntogit-packages/blob/38fd5d2f2e0ade932aa7a80b7dea26215fc41854/trunk/unbundle-ffmpeg-av_stream_get_first_dts.patch
+
+diff --git a/build/linux/unbundle/ffmpeg.gn b/build/linux/unbundle/ffmpeg.gn
+--- a/build/linux/unbundle/ffmpeg.gn
++++ b/build/linux/unbundle/ffmpeg.gn
+@@ -12,6 +12,7 @@ pkg_config("system_ffmpeg") {
+     "libavformat",
+     "libavutil",
+   ]
++  defines = [ "av_stream_get_first_dts(stream)=stream->first_dts" ]
+ }
+ 
+ buildflag_header("ffmpeg_features") {
diff --git a/gnu/packages/patches/vigra-python-compat.patch b/gnu/packages/patches/vigra-python-compat.patch
deleted file mode 100644
index 63c6abb326..0000000000
--- a/gnu/packages/patches/vigra-python-compat.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-Fix build with Boost + Python 3.7.
-
-Taken from upstream:
-https://github.com/ukoethe/vigra/commit/a6fa62663c6a6b752ed0707e95f643e25867a0f9
-
-diff --git a/vigranumpy/src/core/vigranumpycore.cxx b/vigranumpy/src/core/vigranumpycore.cxx
-index ec38d3636..c81c6ae52 100644
---- a/vigranumpy/src/core/vigranumpycore.cxx
-+++ b/vigranumpy/src/core/vigranumpycore.cxx
-@@ -61,7 +61,7 @@ UInt32 pychecksum(python::str const & s)
- 	return checksum(data, size);
- #else
- 	Py_ssize_t size = 0;
--	char * data = PyUnicode_AsUTF8AndSize(s.ptr(), &size);
-+	const char * data = PyUnicode_AsUTF8AndSize(s.ptr(), &size);
- 	return checksum(data, size);
- #endif
- }
diff --git a/gnu/packages/patches/widelands-add-missing-map-include.patch b/gnu/packages/patches/widelands-add-missing-map-include.patch
new file mode 100644
index 0000000000..633731bea2
--- /dev/null
+++ b/gnu/packages/patches/widelands-add-missing-map-include.patch
@@ -0,0 +1,28 @@
+From 316eaea209754368a57f445ea4dd016ecf8eded6 Mon Sep 17 00:00:00 2001
+From: matthiakl <t-m.42@mailpost.spdns.org>
+Date: Sat, 14 Aug 2021 19:24:08 +0200
+Subject: [PATCH] Added missing direct incude (#5025)
+
+---
+This patch is from
+https://github.com/widelands/widelands/pull/5025
+which has been merged after the release of Widelands 1.0.
+
+ src/network/bufferedconnection.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/network/bufferedconnection.h b/src/network/bufferedconnection.h
+index fe974b9e..7e1ecf87 100644
+--- a/src/network/bufferedconnection.h
++++ b/src/network/bufferedconnection.h
+@@ -20,6 +20,7 @@
+ #ifndef WL_NETWORK_BUFFEREDCONNECTION_H
+ #define WL_NETWORK_BUFFEREDCONNECTION_H
+ 
++#include <map>
+ #include <memory>
+ #include <mutex>
+ #include <thread>
+-- 
+2.30.2
+
diff --git a/gnu/packages/patches/wpa-supplicant-CVE-2021-27803.patch b/gnu/packages/patches/wpa-supplicant-CVE-2021-27803.patch
deleted file mode 100644
index 1942bb3d55..0000000000
--- a/gnu/packages/patches/wpa-supplicant-CVE-2021-27803.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From 8460e3230988ef2ec13ce6b69b687e941f6cdb32 Mon Sep 17 00:00:00 2001
-From: Jouni Malinen <jouni@codeaurora.org>
-Date: Tue, 8 Dec 2020 23:52:50 +0200
-Subject: [PATCH] P2P: Fix a corner case in peer addition based on PD Request
-
-p2p_add_device() may remove the oldest entry if there is no room in the
-peer table for a new peer. This would result in any pointer to that
-removed entry becoming stale. A corner case with an invalid PD Request
-frame could result in such a case ending up using (read+write) freed
-memory. This could only by triggered when the peer table has reached its
-maximum size and the PD Request frame is received from the P2P Device
-Address of the oldest remaining entry and the frame has incorrect P2P
-Device Address in the payload.
-
-Fix this by fetching the dev pointer again after having called
-p2p_add_device() so that the stale pointer cannot be used.
-
-Fixes: 17bef1e97a50 ("P2P: Add peer entry based on Provision Discovery Request")
-Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
----
- src/p2p/p2p_pd.c | 12 +++++-------
- 1 file changed, 5 insertions(+), 7 deletions(-)
-
-diff --git a/src/p2p/p2p_pd.c b/src/p2p/p2p_pd.c
-index 3994ec03f86b..05fd593494ef 100644
---- a/src/p2p/p2p_pd.c
-+++ b/src/p2p/p2p_pd.c
-@@ -595,14 +595,12 @@ void p2p_process_prov_disc_req(struct p2p_data *p2p, const u8 *sa,
- 			goto out;
- 		}
- 
-+		dev = p2p_get_device(p2p, sa);
- 		if (!dev) {
--			dev = p2p_get_device(p2p, sa);
--			if (!dev) {
--				p2p_dbg(p2p,
--					"Provision Discovery device not found "
--					MACSTR, MAC2STR(sa));
--				goto out;
--			}
-+			p2p_dbg(p2p,
-+				"Provision Discovery device not found "
-+				MACSTR, MAC2STR(sa));
-+			goto out;
- 		}
- 	} else if (msg.wfd_subelems) {
- 		wpabuf_free(dev->info.wfd_subelems);
--- 
-2.25.1
-
diff --git a/gnu/packages/patches/wpa-supplicant-CVE-2021-30004.patch b/gnu/packages/patches/wpa-supplicant-CVE-2021-30004.patch
deleted file mode 100644
index 8c8ba93355..0000000000
--- a/gnu/packages/patches/wpa-supplicant-CVE-2021-30004.patch
+++ /dev/null
@@ -1,115 +0,0 @@
-From a0541334a6394f8237a4393b7372693cd7e96f15 Mon Sep 17 00:00:00 2001
-From: Jouni Malinen <j@w1.fi>
-Date: Sat, 13 Mar 2021 18:19:31 +0200
-Subject: ASN.1: Validate DigestAlgorithmIdentifier parameters
-
-The supported hash algorithms do not use AlgorithmIdentifier parameters.
-However, there are implementations that include NULL parameters in
-addition to ones that omit the parameters. Previous implementation did
-not check the parameters value at all which supported both these cases,
-but did not reject any other unexpected information.
-
-Use strict validation of digest algorithm parameters and reject any
-unexpected value when validating a signature. This is needed to prevent
-potential forging attacks.
-
-Signed-off-by: Jouni Malinen <j@w1.fi>
----
- src/tls/pkcs1.c  | 21 +++++++++++++++++++++
- src/tls/x509v3.c | 20 ++++++++++++++++++++
- 2 files changed, 41 insertions(+)
-
-diff --git a/src/tls/pkcs1.c b/src/tls/pkcs1.c
-index bbdb0d7..5761dfe 100644
---- a/src/tls/pkcs1.c
-+++ b/src/tls/pkcs1.c
-@@ -244,6 +244,8 @@ int pkcs1_v15_sig_ver(struct crypto_public_key *pk,
- 		os_free(decrypted);
- 		return -1;
- 	}
-+	wpa_hexdump(MSG_MSGDUMP, "PKCS #1: DigestInfo",
-+		    hdr.payload, hdr.length);
- 
- 	pos = hdr.payload;
- 	end = pos + hdr.length;
-@@ -265,6 +267,8 @@ int pkcs1_v15_sig_ver(struct crypto_public_key *pk,
- 		os_free(decrypted);
- 		return -1;
- 	}
-+	wpa_hexdump(MSG_MSGDUMP, "PKCS #1: DigestAlgorithmIdentifier",
-+		    hdr.payload, hdr.length);
- 	da_end = hdr.payload + hdr.length;
- 
- 	if (asn1_get_oid(hdr.payload, hdr.length, &oid, &next)) {
-@@ -273,6 +277,23 @@ int pkcs1_v15_sig_ver(struct crypto_public_key *pk,
- 		os_free(decrypted);
- 		return -1;
- 	}
-+	wpa_hexdump(MSG_MSGDUMP, "PKCS #1: Digest algorithm parameters",
-+		    next, da_end - next);
-+
-+	/*
-+	 * RFC 5754: The correct encoding for the SHA2 algorithms would be to
-+	 * omit the parameters, but there are implementation that encode these
-+	 * as a NULL element. Allow these two cases and reject anything else.
-+	 */
-+	if (da_end > next &&
-+	    (asn1_get_next(next, da_end - next, &hdr) < 0 ||
-+	     !asn1_is_null(&hdr) ||
-+	     hdr.payload + hdr.length != da_end)) {
-+		wpa_printf(MSG_DEBUG,
-+			   "PKCS #1: Unexpected digest algorithm parameters");
-+		os_free(decrypted);
-+		return -1;
-+	}
- 
- 	if (!asn1_oid_equal(&oid, hash_alg)) {
- 		char txt[100], txt2[100];
-diff --git a/src/tls/x509v3.c b/src/tls/x509v3.c
-index a8944dd..df337ec 100644
---- a/src/tls/x509v3.c
-+++ b/src/tls/x509v3.c
-@@ -1964,6 +1964,7 @@ int x509_check_signature(struct x509_certificate *issuer,
- 		os_free(data);
- 		return -1;
- 	}
-+	wpa_hexdump(MSG_MSGDUMP, "X509: DigestInfo", hdr.payload, hdr.length);
- 
- 	pos = hdr.payload;
- 	end = pos + hdr.length;
-@@ -1985,6 +1986,8 @@ int x509_check_signature(struct x509_certificate *issuer,
- 		os_free(data);
- 		return -1;
- 	}
-+	wpa_hexdump(MSG_MSGDUMP, "X509: DigestAlgorithmIdentifier",
-+		    hdr.payload, hdr.length);
- 	da_end = hdr.payload + hdr.length;
- 
- 	if (asn1_get_oid(hdr.payload, hdr.length, &oid, &next)) {
-@@ -1992,6 +1995,23 @@ int x509_check_signature(struct x509_certificate *issuer,
- 		os_free(data);
- 		return -1;
- 	}
-+	wpa_hexdump(MSG_MSGDUMP, "X509: Digest algorithm parameters",
-+		    next, da_end - next);
-+
-+	/*
-+	 * RFC 5754: The correct encoding for the SHA2 algorithms would be to
-+	 * omit the parameters, but there are implementation that encode these
-+	 * as a NULL element. Allow these two cases and reject anything else.
-+	 */
-+	if (da_end > next &&
-+	    (asn1_get_next(next, da_end - next, &hdr) < 0 ||
-+	     !asn1_is_null(&hdr) ||
-+	     hdr.payload + hdr.length != da_end)) {
-+		wpa_printf(MSG_DEBUG,
-+			   "X509: Unexpected digest algorithm parameters");
-+		os_free(data);
-+		return -1;
-+	}
- 
- 	if (x509_sha1_oid(&oid)) {
- 		if (signature->oid.oid[6] != 5 /* sha-1WithRSAEncryption */) {
--- 
-cgit v0.12
-
diff --git a/gnu/packages/patches/xdg-desktop-portal-wlr-harcoded-length.patch b/gnu/packages/patches/xdg-desktop-portal-wlr-harcoded-length.patch
new file mode 100644
index 0000000000..b499a039e8
--- /dev/null
+++ b/gnu/packages/patches/xdg-desktop-portal-wlr-harcoded-length.patch
@@ -0,0 +1,28 @@
+From 3121eeb5e68bedd6e2398f35b9bd60b69709a47e Mon Sep 17 00:00:00 2001
+From: Josselin Poiret <dev@jpoiret.xyz>
+Date: Tue, 14 Dec 2021 18:49:54 +0100
+Subject: [PATCH] Replace hardcoded command length
+
+---
+ src/screenshot/screenshot.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/src/screenshot/screenshot.c b/src/screenshot/screenshot.c
+index 9df0ea7..5f27681 100644
+--- a/src/screenshot/screenshot.c
++++ b/src/screenshot/screenshot.c
+@@ -42,8 +42,9 @@ static bool exec_screenshooter_interactive(const char *path) {
+ 		perror("fork");
+ 		return false;
+ 	} else if (pid == 0) {
+-		char cmd[strlen(path) + 25];
+-		snprintf(cmd, sizeof(cmd), "grim -g \"$(slurp)\" -- %s", path);
++		const char cmd_fmt[] = "grim -g \"$(slurp)\" -- %s";
++		char cmd[strlen(path) + sizeof(cmd_fmt)];
++		snprintf(cmd, sizeof(cmd), cmd_fmt, path);
+ 		execl("/bin/sh", "/bin/sh", "-c", cmd, NULL);
+ 		perror("execl");
+ 		exit(127);
+-- 
+2.34.0
+
diff --git a/gnu/packages/patches/xf86-video-mach64-bool-to-boolean.patch b/gnu/packages/patches/xf86-video-mach64-bool-to-boolean.patch
new file mode 100644
index 0000000000..b85acdd401
--- /dev/null
+++ b/gnu/packages/patches/xf86-video-mach64-bool-to-boolean.patch
@@ -0,0 +1,79 @@
+From ff1a69144735298d1a190fa23b3ae5747e914859 Mon Sep 17 00:00:00 2001
+From: Josselin Poiret <dev@jpoiret.xyz>
+Date: Thu, 18 Nov 2021 13:18:25 +0000
+Subject: [PATCH] Rename bool to boolean for OptionInfoRec.
+
+* src/aticonfig.c: Change uses of .value.bool to .value.boolean
+---
+ src/aticonfig.c | 38 +++++++++++++++++++-------------------
+ 1 file changed, 19 insertions(+), 19 deletions(-)
+
+diff --git a/src/aticonfig.c b/src/aticonfig.c
+index 621e79e..8ea0c6e 100644
+--- a/src/aticonfig.c
++++ b/src/aticonfig.c
+@@ -311,42 +311,42 @@ ATIProcessOptions
+ 
+     (void)memcpy(PublicOption, ATIPublicOptions, ATIPublicOptionSize);
+ 
+-#   define ProbeSparse   PublicOption[ATI_OPTION_PROBE_SPARSE].value.bool
+-#   define Accel         PublicOption[ATI_OPTION_ACCEL].value.bool
+-#   define BIOSDisplay   PrivateOption[ATI_OPTION_BIOS_DISPLAY].value.bool
+-#   define Blend         PrivateOption[ATI_OPTION_BLEND].value.bool
+-#   define CRTDisplay    PublicOption[ATI_OPTION_CRT_DISPLAY].value.bool
+-#   define CRTScreen     PrivateOption[ATI_OPTION_CRT_SCREEN].value.bool
+-#   define CSync         PublicOption[ATI_OPTION_CSYNC].value.bool
+-#   define Devel         PrivateOption[ATI_OPTION_DEVEL].value.bool
+-#   define HWCursor      PublicOption[ATI_OPTION_HWCURSOR].value.bool
++#   define ProbeSparse   PublicOption[ATI_OPTION_PROBE_SPARSE].value.boolean
++#   define Accel         PublicOption[ATI_OPTION_ACCEL].value.boolean
++#   define BIOSDisplay   PrivateOption[ATI_OPTION_BIOS_DISPLAY].value.boolean
++#   define Blend         PrivateOption[ATI_OPTION_BLEND].value.boolean
++#   define CRTDisplay    PublicOption[ATI_OPTION_CRT_DISPLAY].value.boolean
++#   define CRTScreen     PrivateOption[ATI_OPTION_CRT_SCREEN].value.boolean
++#   define CSync         PublicOption[ATI_OPTION_CSYNC].value.boolean
++#   define Devel         PrivateOption[ATI_OPTION_DEVEL].value.boolean
++#   define HWCursor      PublicOption[ATI_OPTION_HWCURSOR].value.boolean
+ 
+ #ifdef XF86DRI_DEVEL
+ 
+-#   define IsPCI       PublicOption[ATI_OPTION_IS_PCI].value.bool
++#   define IsPCI       PublicOption[ATI_OPTION_IS_PCI].value.boolean
+ #   define DMAMode     PublicOption[ATI_OPTION_DMA_MODE].value.str
+ #   define AGPMode     PublicOption[ATI_OPTION_AGP_MODE].value.num
+ #   define AGPSize     PublicOption[ATI_OPTION_AGP_SIZE].value.num
+-#   define LocalTex    PublicOption[ATI_OPTION_LOCAL_TEXTURES].value.bool
++#   define LocalTex    PublicOption[ATI_OPTION_LOCAL_TEXTURES].value.boolean
+ #   define BufferSize  PublicOption[ATI_OPTION_BUFFER_SIZE].value.num
+ 
+ #endif /* XF86DRI_DEVEL */
+ 
+ #ifdef TV_OUT
+ 
+-#   define TvOut        PublicOption[ATI_OPTION_TV_OUT].value.bool
++#   define TvOut        PublicOption[ATI_OPTION_TV_OUT].value.boolean
+ #   define TvStd        PublicOption[ATI_OPTION_TV_STD].value.str
+ 
+ #endif /* TV_OUT */
+ 
+-#   define CacheMMIO     PublicOption[ATI_OPTION_MMIO_CACHE].value.bool
+-#   define TestCacheMMIO PublicOption[ATI_OPTION_TEST_MMIO_CACHE].value.bool
+-#   define PanelDisplay  PublicOption[ATI_OPTION_PANEL_DISPLAY].value.bool
+-#   define ShadowFB      PublicOption[ATI_OPTION_SHADOW_FB].value.bool
+-#   define SWCursor      PublicOption[ATI_OPTION_SWCURSOR].value.bool
++#   define CacheMMIO     PublicOption[ATI_OPTION_MMIO_CACHE].value.boolean
++#   define TestCacheMMIO PublicOption[ATI_OPTION_TEST_MMIO_CACHE].value.boolean
++#   define PanelDisplay  PublicOption[ATI_OPTION_PANEL_DISPLAY].value.boolean
++#   define ShadowFB      PublicOption[ATI_OPTION_SHADOW_FB].value.boolean
++#   define SWCursor      PublicOption[ATI_OPTION_SWCURSOR].value.boolean
+ #   define AccelMethod   PublicOption[ATI_OPTION_ACCELMETHOD].value.str
+-#   define RenderAccel   PublicOption[ATI_OPTION_RENDER_ACCEL].value.bool
+-#   define LCDSync       PrivateOption[ATI_OPTION_LCDSYNC].value.bool
++#   define RenderAccel   PublicOption[ATI_OPTION_RENDER_ACCEL].value.boolean
++#   define LCDSync       PrivateOption[ATI_OPTION_LCDSYNC].value.boolean
+ 
+ #   define ReferenceClock \
+         PublicOption[ATI_OPTION_REFERENCE_CLOCK].value.freq.freq
+-- 
+2.33.1
+
diff --git a/gnu/packages/patches/xf86-video-nouveau-fixup-ABI.patch b/gnu/packages/patches/xf86-video-nouveau-fixup-ABI.patch
new file mode 100644
index 0000000000..a18e3f8ab9
--- /dev/null
+++ b/gnu/packages/patches/xf86-video-nouveau-fixup-ABI.patch
@@ -0,0 +1,64 @@
+From e80e73ced69b15662103d0fd6837db4ce6c6eb5b Mon Sep 17 00:00:00 2001
+From: Dave Airlie <airlied@redhat.com>
+Date: Mon, 13 Jul 2020 09:20:15 +1000
+Subject: [PATCH] nouveau: fixup driver for new X server ABI
+
+---
+ src/compat-api.h  | 4 ++++
+ src/nouveau_exa.c | 2 +-
+ src/nv_driver.c   | 6 +++---
+ 3 files changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/src/compat-api.h b/src/compat-api.h
+index fde2f4b..8a1fcf9 100644
+--- a/src/compat-api.h
++++ b/src/compat-api.h
+@@ -102,4 +102,8 @@
+ 
+ #endif
+ 
++#if ABI_VIDEODRV_VERSION < SET_ABI_VERSION(25, 2)
++#define secondary_dst slave_dst
++#endif
++
+ #endif
+diff --git a/src/nouveau_exa.c b/src/nouveau_exa.c
+index 55df6f8..db3b112 100644
+--- a/src/nouveau_exa.c
++++ b/src/nouveau_exa.c
+@@ -157,7 +157,7 @@ nouveau_exa_destroy_pixmap(ScreenPtr pScreen, void *priv)
+ 
+ #ifdef NOUVEAU_PIXMAP_SHARING
+ static Bool
+-nouveau_exa_share_pixmap_backing(PixmapPtr ppix, ScreenPtr slave, void **handle_p)
++nouveau_exa_share_pixmap_backing(PixmapPtr ppix, ScreenPtr secondary, void **handle_p)
+ {
+ 	struct nouveau_bo *bo = nouveau_pixmap_bo(ppix);
+ 	struct nouveau_pixmap *nvpix = nouveau_pixmap(ppix);
+diff --git a/src/nv_driver.c b/src/nv_driver.c
+index e72a6b6..f9ab4af 100644
+--- a/src/nv_driver.c
++++ b/src/nv_driver.c
+@@ -559,16 +559,16 @@ redisplay_dirty(ScreenPtr screen, PixmapDirtyUpdatePtr dirty)
+ {
+ 	RegionRec pixregion;
+ 
+-	PixmapRegionInit(&pixregion, dirty->slave_dst);
++	PixmapRegionInit(&pixregion, dirty->secondary_dst);
+ 
+-	DamageRegionAppend(&dirty->slave_dst->drawable, &pixregion);
++	DamageRegionAppend(&dirty->secondary_dst->drawable, &pixregion);
+ #ifdef HAS_DIRTYTRACKING_ROTATION
+ 	PixmapSyncDirtyHelper(dirty);
+ #else
+ 	PixmapSyncDirtyHelper(dirty, &pixregion);
+ #endif
+ 
+-	DamageRegionProcessPending(&dirty->slave_dst->drawable);
++	DamageRegionProcessPending(&dirty->secondary_dst->drawable);
+ 	RegionUninit(&pixregion);
+ }
+ 
+-- 
+2.33.1
+
diff --git a/gnu/packages/patches/xf86-video-qxl-fix-build.patch b/gnu/packages/patches/xf86-video-qxl-fix-build.patch
new file mode 100644
index 0000000000..9ea50e4c91
--- /dev/null
+++ b/gnu/packages/patches/xf86-video-qxl-fix-build.patch
@@ -0,0 +1,101 @@
+From 4b083ede3c4a827a84295ff223e34ee3c2e581b2 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?=
+ <zboszor@gmail.com>
+Date: Sat, 28 Aug 2021 15:38:40 +0200
+Subject: [PATCH] Fix a build  error with Xorg master
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Use xf86ReturnOptValBool() in get_bool_option() instead of
+options[option_index].value.bool to fix a compiler error with
+current Xorg xserver master branch.
+
+Also use xf86GetOptValInteger() in get_int_option() and
+xf86GetOptValString() in get_str_option() for consistency.
+
+The change causes a slight performance drop during option parsing
+because the passed-in index_value is no longer used as an index
+into the options array.
+
+Instead, it's used as a token now for the standard option getter
+functions which works since the index_value to the get_*_option()
+functions are identical to the value of options[n].token in the
+passed-in OptionInfoRec array.
+
+Also rename "int option_index" to "int token" for clarity in all
+three functions.
+
+Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
+---
+ src/qxl_option_helpers.c | 13 +++++++------
+ src/qxl_option_helpers.h |  6 +++---
+ 2 files changed, 10 insertions(+), 9 deletions(-)
+
+diff --git a/src/qxl_option_helpers.c b/src/qxl_option_helpers.c
+index 2aba677..7707b7c 100644
+--- a/src/qxl_option_helpers.c
++++ b/src/qxl_option_helpers.c
+@@ -10,31 +10,32 @@
+ 
+ #include "qxl_option_helpers.h"
+ 
+-int get_int_option(OptionInfoPtr options, int option_index,
++int get_int_option(OptionInfoPtr options, int token,
+                    const char *env_name)
+ {
++    int value;
+     if (env_name && getenv(env_name)) {
+         return atoi(getenv(env_name));
+     }
+-    return options[option_index].value.num;
++    return xf86GetOptValInteger(options, token, &value) ? value : 0;
+ }
+ 
+-const char *get_str_option(OptionInfoPtr options, int option_index,
++const char *get_str_option(OptionInfoPtr options, int token,
+                            const char *env_name)
+ {
+     if (getenv(env_name)) {
+         return getenv(env_name);
+     }
+-    return options[option_index].value.str;
++    return xf86GetOptValString(options, token);
+ }
+ 
+-int get_bool_option(OptionInfoPtr options, int option_index,
++int get_bool_option(OptionInfoPtr options, int token,
+                      const char *env_name)
+ {
+     const char* value = getenv(env_name);
+ 
+     if (!value) {
+-        return options[option_index].value.bool;
++        return xf86ReturnOptValBool(options, token, FALSE);
+     }
+     if (strcmp(value, "0") == 0 ||
+         strcasecmp(value, "off") == 0 ||
+diff --git a/src/qxl_option_helpers.h b/src/qxl_option_helpers.h
+index 7c54c72..66d0a17 100644
+--- a/src/qxl_option_helpers.h
++++ b/src/qxl_option_helpers.h
+@@ -4,13 +4,13 @@
+ #include <xf86Crtc.h>
+ #include <xf86Opt.h>
+ 
+-int get_int_option(OptionInfoPtr options, int option_index,
++int get_int_option(OptionInfoPtr options, int token,
+                    const char *env_name);
+ 
+-const char *get_str_option(OptionInfoPtr options, int option_index,
++const char *get_str_option(OptionInfoPtr options, int token,
+                            const char *env_name);
+ 
+-int get_bool_option(OptionInfoPtr options, int option_index,
++int get_bool_option(OptionInfoPtr options, int token,
+                      const char *env_name);
+ 
+ #endif // OPTION_HELPERS_H
+-- 
+GitLab
+
diff --git a/gnu/packages/patches/xgboost-use-system-dmlc-core.patch b/gnu/packages/patches/xgboost-use-system-dmlc-core.patch
index c654694fec..6b2a1651a5 100644
--- a/gnu/packages/patches/xgboost-use-system-dmlc-core.patch
+++ b/gnu/packages/patches/xgboost-use-system-dmlc-core.patch
@@ -1,34 +1,35 @@
-From 34167cc105e47589b86b6f62da76e0ab744002dd Mon Sep 17 00:00:00 2001
-From: Vinicius Monego <monego@posteo.net>
-Date: Tue, 11 May 2021 19:35:30 -0300
-Subject: [PATCH] Use dmlc-core from Guix.
-
----
-This patch is a subset of the following Debian patch: https://sources.debian.org/src/xgboost/1.2.1-1/debian/patches/cmake.patch/
-
-Rabit is now developed as part of xgboost, so we don't build it separately.
-
- CMakeLists.txt | 8 +++-----
- 1 file changed, 3 insertions(+), 5 deletions(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 6cc19fbd..3b42bc17 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -150,11 +150,9 @@ endif (USE_OPENMP)
+# This patch was imported from Debian: https://sources.debian.org/src/xgboost/1.5.1-1/debian/patches/cmake-dmlc-core.patch/
 
+Index: xgboost/CMakeLists.txt
+===================================================================
+--- xgboost.orig/CMakeLists.txt
++++ xgboost/CMakeLists.txt
+@@ -164,7 +164,9 @@ endif (USE_NCCL)
+ 
  # dmlc-core
  msvc_use_static_runtime()
 -add_subdirectory(${xgboost_SOURCE_DIR}/dmlc-core)
--set_target_properties(dmlc PROPERTIES
--  CXX_STANDARD 14
--  CXX_STANDARD_REQUIRED ON
--  POSITION_INDEPENDENT_CODE ON)
 +add_library(dmlc SHARED IMPORTED)
 +find_library(DMLC_LIBRARY dmlc)
 +set_property(TARGET dmlc PROPERTY IMPORTED_LOCATION "${DMLC_LIBRARY}")
+ 
  if (MSVC)
-   target_compile_options(dmlc PRIVATE
-                          -D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE)
---
-2.31.1
+   if (TARGET dmlc_unit_tests)
+@@ -222,7 +224,7 @@ set_target_properties(runxgboost PROPERT
+ #-- End CLI for xgboost
+ 
+ # Common setup for all targets
+-foreach(target xgboost objxgboost dmlc runxgboost)
++foreach(target xgboost objxgboost runxgboost)
+   xgboost_target_properties(${target})
+   xgboost_target_link_libraries(${target})
+   xgboost_target_defs(${target})
+@@ -273,7 +275,7 @@ install(DIRECTORY ${xgboost_SOURCE_DIR}/
+ #
+ # https://github.com/dmlc/xgboost/issues/6085
+ if (BUILD_STATIC_LIB)
+-  set(INSTALL_TARGETS xgboost runxgboost objxgboost dmlc)
++  set(INSTALL_TARGETS xgboost runxgboost objxgboost)
+ else (BUILD_STATIC_LIB)
+   set(INSTALL_TARGETS xgboost runxgboost)
+ endif (BUILD_STATIC_LIB)
diff --git a/gnu/packages/patches/xmonad-next-dynamic-linking.patch b/gnu/packages/patches/xmonad-next-dynamic-linking.patch
new file mode 100644
index 0000000000..a1d71825b6
--- /dev/null
+++ b/gnu/packages/patches/xmonad-next-dynamic-linking.patch
@@ -0,0 +1,16 @@
+This patch is required for xmonad to make use of shared libraries.
+Without it, xmonad will not work since we do not (by default) use
+statically linked Haskell libraries.
+
+index 46a0939..5ad4f8f 100644
+--- a/src/XMonad/Core.hs
++++ b/src/XMonad/Core.hs
+@@ -664,6 +664,8 @@ compile dirs method =
+   where
+     ghcArgs = [ "--make"
+               , "xmonad.hs"
++              , "-dynamic"
++              , "-fPIC"
+               , "-i" -- only look in @lib@
+               , "-ilib"
+               , "-fforce-recomp"
diff --git a/gnu/packages/patches/xpra-4.2-install_libs.patch b/gnu/packages/patches/xpra-4.2-install_libs.patch
new file mode 100644
index 0000000000..65d489a3b8
--- /dev/null
+++ b/gnu/packages/patches/xpra-4.2-install_libs.patch
@@ -0,0 +1,29 @@
+This workaround for Gentoo interferes with our use of --no-compile during
+the 'install stage.
+
+--- a/setup.py	2022-01-04 10:10:05.039825000 +0100
++++ b/setup.py	2022-01-06 15:10:31.952656039 +0100
+@@ -589,8 +589,6 @@
+         })
+ 
+ def add_cython_ext(*args, **kwargs):
+-    if "--no-compile" in sys.argv and not ("build" in sys.argv and "install" in sys.argv):
+-        return
+     assert cython_ENABLED, "cython compilation is disabled"
+     if cython_tracing_ENABLED:
+         kwargs["define_macros"] = [
+@@ -1703,14 +1701,6 @@
+             if uinput_ENABLED:
+                 add_data_files("lib/udev/rules.d/", ["fs/lib/udev/rules.d/71-xpra-virtual-pointer.rules"])
+ 
+-    #gentoo does weird things, calls --no-compile with build *and* install
+-    #then expects to find the cython modules!? ie:
+-    #> python2.7 setup.py build -b build-2.7 install --no-compile \
+-    # --root=/var/tmp/portage/x11-wm/xpra-0.7.0/temp/images/2.7
+-    #otherwise we use the flags to skip pkgconfig
+-    if ("--no-compile" in sys.argv or "--skip-build" in sys.argv) and not ("build" in sys.argv and "install" in sys.argv):
+-        pkgconfig = no_pkgconfig
+-
+     if OSX and "py2app" in sys.argv:
+         import py2app    #@UnresolvedImport
+         assert py2app is not None
diff --git a/gnu/packages/patches/xygrib-fix-finding-data.patch b/gnu/packages/patches/xygrib-fix-finding-data.patch
new file mode 100644
index 0000000000..0b718b0eff
--- /dev/null
+++ b/gnu/packages/patches/xygrib-fix-finding-data.patch
@@ -0,0 +1,131 @@
+This is a backport of the commits in PR 235 (“Fixes for packaging on
+linux-like systems”), which was merged upstream:
+
+https://github.com/opengribs/XyGrib/pull/235
+
+It fixes finding resources such as icons, maps and translations installed in
+the data directory.  This patch has been merged upstream and can be removed
+with the next release.
+
+Sightly adapted to find openjpg-2.4.
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 64059ab65dae..00cc5d6aea6f 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -7,6 +7,9 @@ set(VERSION_PATCH 6)
+ set(XYGRIB_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
+ set(XYGRIB_VERSION_DATE "2019-07-05")
+ 
++option(GNU_PACKAGE "Install into GNU standard directories" OFF)
++option(GEN_TRANSLATIONS "Generate translations" ON)
++
+ set(CMAKE_VERBOSE_MAKEFILE ON)
+ 
+ # Find includes in corresponding build directories
+@@ -25,7 +28,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
+ set(CMAKE_CXX_STANDARD 11)
+ #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
+ if(UNIX AND NOT APPLE)
+-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fPIC")
++add_compile_options(-Wall -fPIC)
+ endif()
+ 
+ # Add support for address etc sanitizers, part 1/2 (other half after ADD_EXECUTABLE)
+@@ -108,17 +111,12 @@ find_path(OPENJPEG_INCLUDE_DIR
+      ~/Library/Frameworks/include
+      /Library/Frameworks/include
+      /usr/local/include
+-     /usr/local/include/openjpeg-2.3
+-     /usr/include/openjpeg-2.3
+-     /usr/local/include/openjpeg-2.1
+-     /usr/include/openjpeg-2.1
+-     /usr/local/include/openjpeg-2.2
+-     /usr/include/openjpeg-2.2
+      /usr/include
+      /sw/include # Fink
+      /opt/local/include # DarwinPorts
+      /opt/csw/include # Blastwave
+      /opt/include
++     PATH_SUFFIXES openjpeg-2.4 openjpeg-2.3 openjpeg-2.2 openjpeg-2.1
+      REQUIRED
+  )
+ include_directories(${OPENJPEG_INCLUDE_DIR})
+@@ -212,22 +210,24 @@ include_directories(${PNG_INCLUDE_DIR})
+ configure_file(cmake/Version.h.in ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/include/Version.h)
+ include_directories(${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/include)
+ 
+-if(APPLE)
+-set(PREFIX_BIN ${PROJECT_NAME})
+-set(PREFIX_PKGDATA ${PROJECT_NAME})
+-endif()
+-if(WIN32)
+-set(PREFIX_BIN ".")
+-set(PREFIX_PKGDATA ".")
+-endif()
+-if(UNIX AND NOT APPLE)
+-# This is not exactly a good idea on linux - the code should be changed so that the executable would go to /usr/local/bin and the data to /usr/local/share/XyGrib
+-set(PREFIX_BIN ${PROJECT_NAME})
+-set(PREFIX_PKGDATA ${PROJECT_NAME})
++if(GNU_PACKAGE)
++    include(GNUInstallDirs)
++    set(PREFIX_BIN ${CMAKE_INSTALL_FULL_BINDIR})
++    set(PREFIX_PKGDATA ${CMAKE_INSTALL_FULL_DATADIR}/openGribs/${PROJECT_NAME})
++else()
++    if(WIN32)
++        set(PREFIX_BIN ".")
++        set(PREFIX_PKGDATA ".")
++    else()
++        set(PREFIX_BIN ${PROJECT_NAME})
++        set(PREFIX_PKGDATA ${PROJECT_NAME})
++    endif()
+ endif()
+ 
+ add_subdirectory(src)
+-add_subdirectory(data/tr)
++if(GEN_TRANSLATIONS)
++    add_subdirectory(data/tr)
++endif()
+ 
+ # Installation
+ # macOS bundle parameters
+@@ -241,4 +241,14 @@ set_target_properties(${PROJECT_NAME} PROPERTIES MACOSX_BUNDLE_SHORT_VERSION_STR
+ set_target_properties(${PROJECT_NAME} PROPERTIES MACOSX_BUNDLE_BUNDLE_VERSION "${XYGRIB_VERSION}")
+ set_target_properties(${PROJECT_NAME} PROPERTIES MACOSX_BUNDLE_COPYRIGHT "${PROJECT_NAME} Authors")
+ # Install data
+-install(DIRECTORY data DESTINATION ${PREFIX_PKGDATA})
++install(DIRECTORY data DESTINATION ${PREFIX_PKGDATA}
++        PATTERN "CMakeFiles" EXCLUDE
++        PATTERN "CMakeLists.txt" EXCLUDE
++        PATTERN "Makefile" EXCLUDE
++        PATTERN "cmake_install.cmake" EXCLUDE)
++if(GNU_PACKAGE)
++    install(FILES debian/xygrib.desktop
++            DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/applications)
++    install(FILES debian/xygrib.png
++            DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/pixmaps)
++endif()
+diff --git a/INSTALL.md b/INSTALL.md
+index 2c9d3ab4da03..1190cc780182 100644
+--- a/INSTALL.md
++++ b/INSTALL.md
+@@ -22,7 +22,19 @@ https://gihub.com/opengribs/XyGrib/releases or on https://opengribs.org in the d
+   - openSUSE Tumbleweed: `sudo zypper install gcc git cmake libqt5-qtbase-devel libpng-devel openjpeg2-devel libnova-devel libproj-devel zlib-devel libbz2-devel
+ 
+ ## Build and package
++### Options
+ 
++XyGrib has two CMake options
++- GNU_PACKAGE (DEFAULT: OFF)
++```
++Files will be installed in GNU standard installation directories such as prefix/bin and prefix/share.
++Packagers are recommended to test this option.
++```
++- GEN_TRANSLATION (DEFAULT: ON)
++```
++Create targets to generate translation files.
++Turning this off removes the need for qt-linguist, part of qttools qt5 submodule, during build.
++```
+ ### macOS
+ 
+ - Get the source
diff --git a/gnu/packages/patches/yggdrasil-extra-config.patch b/gnu/packages/patches/yggdrasil-extra-config.patch
index c21ca29a84..bd4bea7b9f 100644
--- a/gnu/packages/patches/yggdrasil-extra-config.patch
+++ b/gnu/packages/patches/yggdrasil-extra-config.patch
@@ -1,27 +1,39 @@
+From 779f980451d20079b34812f7006f2d7230738ad0 Mon Sep 17 00:00:00 2001
+From: csepp <raingloom@riseup.net>
+Date: Wed, 3 Nov 2021 21:14:54 +0100
+Subject: [PATCH] add extra config file option to yggdrasil command
+
+This is useful in Guix and Nix, because one config file can come
+from the world-readable store and another can be placed directly
+into /etc with much stricter permissions.
+---
+ cmd/yggdrasil/main.go | 29 ++++++++++++++++++++++-------
+ 1 file changed, 22 insertions(+), 7 deletions(-)
+
 diff --git a/cmd/yggdrasil/main.go b/cmd/yggdrasil/main.go
-index 813e950..08d35cc 100644
+index 58b8230..b9df98a 100644
 --- a/cmd/yggdrasil/main.go
 +++ b/cmd/yggdrasil/main.go
-@@ -40,11 +40,12 @@ type node struct {
- 	admin     module.Module // admin.AdminSocket
+@@ -43,11 +43,12 @@ type node struct {
+ 	admin     *admin.AdminSocket
  }
  
--func readConfig(useconf *bool, useconffile *string, normaliseconf *bool) *config.NodeConfig {
-+func readConfig(useconf *bool, useconffile *string, extraconffile *string, normaliseconf *bool) *config.NodeConfig {
+-func readConfig(log *log.Logger, useconf bool, useconffile string, normaliseconf bool) *config.NodeConfig {
++func readConfig(log *log.Logger, useconf bool, useconffile string, extraconffile string, normaliseconf bool) *config.NodeConfig {
  	// Use a configuration file. If -useconf, the configuration will be read
  	// from stdin. If -useconffile, the configuration will be read from the
  	// filesystem.
  	var conf []byte
 +	var extraconf []byte
  	var err error
- 	if *useconffile != "" {
+ 	if useconffile != "" {
  		// Read the file from the filesystem
-@@ -56,6 +57,21 @@ func readConfig(useconf *bool, useconffile *string, normaliseconf *bool) *config
+@@ -59,6 +60,21 @@ func readConfig(log *log.Logger, useconf bool, useconffile string, normaliseconf
  	if err != nil {
  		panic(err)
  	}
-+	if *extraconffile != "" {
-+		extraconf, err = ioutil.ReadFile(*extraconffile);
++	if extraconffile != "" {
++		extraconf, err = ioutil.ReadFile(extraconffile);
 +	}
 +	if err != nil {
 +		panic(err)
@@ -30,7 +42,7 @@ index 813e950..08d35cc 100644
 +	// then parse the configuration we loaded above on top of it. The effect
 +	// of this is that any configuration item that is missing from the provided
 +	// configuration will use a sane default.
-+	cfg := config.GenerateConfig()
++	cfg := defaults.GenerateConfig()
 +	var confs [2][]byte
 +	confs[0]=conf
 +	confs[1]=extraconf
@@ -38,7 +50,7 @@ index 813e950..08d35cc 100644
  	// If there's a byte order mark - which Windows 10 is now incredibly fond of
  	// throwing everywhere when it's converting things into UTF-16 for the hell
  	// of it - remove it and decode back down into UTF-8. This is necessary
-@@ -69,11 +85,6 @@ func readConfig(useconf *bool, useconffile *string, normaliseconf *bool) *config
+@@ -72,11 +88,6 @@ func readConfig(log *log.Logger, useconf bool, useconffile string, normaliseconf
  			panic(err)
  		}
  	}
@@ -46,11 +58,11 @@ index 813e950..08d35cc 100644
 -	// then parse the configuration we loaded above on top of it. The effect
 -	// of this is that any configuration item that is missing from the provided
 -	// configuration will use a sane default.
--	cfg := config.GenerateConfig()
+-	cfg := defaults.GenerateConfig()
  	var dat map[string]interface{}
  	if err := hjson.Unmarshal(conf, &dat); err != nil {
  		panic(err)
-@@ -112,6 +123,7 @@ func readConfig(useconf *bool, useconffile *string, normaliseconf *bool) *config
+@@ -136,6 +147,7 @@ func readConfig(log *log.Logger, useconf bool, useconffile string, normaliseconf
  	if err = mapstructure.Decode(dat, &cfg); err != nil {
  		panic(err)
  	}
@@ -58,7 +70,15 @@ index 813e950..08d35cc 100644
  	return cfg
  }
  
-@@ -164,6 +176,7 @@ func main() {
+@@ -192,6 +204,7 @@ type yggArgs struct {
+ 	getaddr       bool
+ 	getsnet       bool
+ 	useconffile   string
++        extraconffile string
+ 	logto         string
+ 	loglevel      string
+ }
+@@ -200,6 +213,7 @@ func getArgs() yggArgs {
  	genconf := flag.Bool("genconf", false, "print a new config to stdout")
  	useconf := flag.Bool("useconf", false, "read HJSON/JSON config from stdin")
  	useconffile := flag.String("useconffile", "", "read HJSON/JSON config from specified file path")
@@ -66,21 +86,23 @@ index 813e950..08d35cc 100644
  	normaliseconf := flag.Bool("normaliseconf", false, "use in combination with either -useconf or -useconffile, outputs your configuration normalised")
  	confjson := flag.Bool("json", false, "print configuration from -genconf or -normaliseconf as JSON instead of HJSON")
  	autoconf := flag.Bool("autoconf", false, "automatic mode (dynamic IP, peer with IPv6 neighbors)")
-@@ -187,7 +200,7 @@ func main() {
- 		cfg = config.GenerateConfig()
- 	case *useconffile != "" || *useconf:
+@@ -213,6 +227,7 @@ func getArgs() yggArgs {
+ 		genconf:       *genconf,
+ 		useconf:       *useconf,
+ 		useconffile:   *useconffile,
++                extraconffile: *extraconffile,
+ 		normaliseconf: *normaliseconf,
+ 		confjson:      *confjson,
+ 		autoconf:      *autoconf,
+@@ -265,7 +280,7 @@ func run(args yggArgs, ctx context.Context, done chan struct{}) {
+ 		cfg = defaults.GenerateConfig()
+ 	case args.useconffile != "" || args.useconf:
  		// Read the configuration from either stdin or from the filesystem
--		cfg = readConfig(useconf, useconffile, normaliseconf)
-+		cfg = readConfig(useconf, useconffile, extraconffile, normaliseconf)
+-		cfg = readConfig(logger, args.useconf, args.useconffile, args.normaliseconf)
++		cfg = readConfig(logger, args.useconf, args.useconffile, args.extraconffile, args.normaliseconf)
  		// If the -normaliseconf option was specified then remarshal the above
  		// configuration and print it back to stdout. This lets the user update
  		// their configuration file with newly mapped names (like above) or to
-@@ -332,7 +345,7 @@ func main() {
- 			goto exit
- 		case _ = <-r:
- 			if *useconffile != "" {
--				cfg = readConfig(useconf, useconffile, normaliseconf)
-+				cfg = readConfig(useconf, useconffile, extraconffile, normaliseconf)
- 				logger.Infoln("Reloading configuration from", *useconffile)
- 				n.core.UpdateConfig(cfg)
- 				n.tuntap.UpdateConfig(cfg)
+-- 
+2.33.1
+
diff --git a/gnu/packages/patches/zig-disable-libc-note-test.patch b/gnu/packages/patches/zig-disable-libc-note-test.patch
new file mode 100644
index 0000000000..4508cee200
--- /dev/null
+++ b/gnu/packages/patches/zig-disable-libc-note-test.patch
@@ -0,0 +1,31 @@
+This test fails with "error.CompilationIncorrectlySucceeded".
+
+diff --git a/test/compile_errors.zig b/test/compile_errors.zig
+index b1eaa0302..621f9db0a 100644
+--- a/test/compile_errors.zig
++++ b/test/compile_errors.zig
+@@ -2943,15 +2943,15 @@ pub fn addCases(ctx: *TestContext) !void {
+             "tmp.zig:3:5: error: dependency on libc must be explicitly specified in the build command",
+         });
+ 
+-        ctx.testErrStage1("libc headers note",
+-            \\const c = @cImport(@cInclude("stdio.h"));
+-            \\export fn entry() void {
+-            \\    _ = c.printf("hello, world!\n");
+-            \\}
+-        , &[_][]const u8{
+-            "tmp.zig:1:11: error: C import failed",
+-            "tmp.zig:1:11: note: libc headers not available; compilation does not link against libc",
+-        });
++        // ctx.testErrStage1("libc headers note",
++        //     \\const c = @cImport(@cInclude("stdio.h"));
++        //     \\export fn entry() void {
++        //     \\    _ = c.printf("hello, world!\n");
++        //     \\}
++        // , &[_][]const u8{
++        //     "tmp.zig:1:11: error: C import failed",
++        //     "tmp.zig:1:11: note: libc headers not available; compilation does not link against libc",
++        // });
+     }
+ 
+     ctx.testErrStage1("comptime vector overflow shows the index",
diff --git a/gnu/packages/patches/zig-use-system-paths.patch b/gnu/packages/patches/zig-use-system-paths.patch
new file mode 100644
index 0000000000..a008beafc2
--- /dev/null
+++ b/gnu/packages/patches/zig-use-system-paths.patch
@@ -0,0 +1,148 @@
+This patch replaces the OS-specific detection mechanism by one that solely
+relies on environment variables.  This has the benefit that said environment
+variables can be used as search paths in Guix.
+
+diff --git a/lib/std/zig/system/NativePaths.zig b/lib/std/zig/system/NativePaths.zig
+index 8e3e46e48..1ed9d3206 100644
+--- a/lib/std/zig/system/NativePaths.zig
++++ b/lib/std/zig/system/NativePaths.zig
+@@ -26,73 +26,42 @@ pub fn detect(allocator: Allocator, native_info: NativeTargetInfo) !NativePaths
+     };
+     errdefer self.deinit();
+ 
+-    var is_nix = false;
+-    if (process.getEnvVarOwned(allocator, "NIX_CFLAGS_COMPILE")) |nix_cflags_compile| {
+-        defer allocator.free(nix_cflags_compile);
+-
+-        is_nix = true;
+-        var it = mem.tokenize(u8, nix_cflags_compile, " ");
++    // TODO: Support cross-compile paths?
++    if (process.getEnvVarOwned(allocator, "C_INCLUDE_PATH")) |c_include_path| {
++        defer allocator.free(c_include_path);
++        var it = mem.tokenize(u8, c_include_path, ":");
+         while (true) {
+-            const word = it.next() orelse break;
+-            if (mem.eql(u8, word, "-isystem")) {
+-                const include_path = it.next() orelse {
+-                    try self.addWarning("Expected argument after -isystem in NIX_CFLAGS_COMPILE");
+-                    break;
+-                };
+-                try self.addIncludeDir(include_path);
+-            } else {
+-                if (mem.startsWith(u8, word, "-frandom-seed=")) {
+-                    continue;
+-                }
+-                try self.addWarningFmt("Unrecognized C flag from NIX_CFLAGS_COMPILE: {s}", .{word});
+-            }
++            const dir = it.next() orelse break;
++            try self.addIncludeDir(dir);
+         }
+     } else |err| switch (err) {
+         error.InvalidUtf8 => {},
+         error.EnvironmentVariableNotFound => {},
+         error.OutOfMemory => |e| return e,
+     }
+-    if (process.getEnvVarOwned(allocator, "NIX_LDFLAGS")) |nix_ldflags| {
+-        defer allocator.free(nix_ldflags);
+-
+-        is_nix = true;
+-        var it = mem.tokenize(u8, nix_ldflags, " ");
++    if (process.getEnvVarOwned(allocator, "CPLUS_INCLUDE_PATH")) |cplus_include_path| {
++        defer allocator.free(cplus_include_path);
++        var it = mem.tokenize(u8, cplus_include_path, ":");
+         while (true) {
+-            const word = it.next() orelse break;
+-            if (mem.eql(u8, word, "-rpath")) {
+-                const rpath = it.next() orelse {
+-                    try self.addWarning("Expected argument after -rpath in NIX_LDFLAGS");
+-                    break;
+-                };
+-                try self.addRPath(rpath);
+-            } else if (word.len > 2 and word[0] == '-' and word[1] == 'L') {
+-                const lib_path = word[2..];
+-                try self.addLibDir(lib_path);
+-            } else {
+-                try self.addWarningFmt("Unrecognized C flag from NIX_LDFLAGS: {s}", .{word});
+-                break;
+-            }
++            const dir = it.next() orelse break;
++            try self.addIncludeDir(dir);
+         }
+     } else |err| switch (err) {
+         error.InvalidUtf8 => {},
+         error.EnvironmentVariableNotFound => {},
+         error.OutOfMemory => |e| return e,
+     }
+-    if (is_nix) {
+-        return self;
+-    }
+-
+-    if (comptime builtin.target.isDarwin()) {
+-        try self.addIncludeDir("/usr/include");
+-        try self.addIncludeDir("/usr/local/include");
+-
+-        try self.addLibDir("/usr/lib");
+-        try self.addLibDir("/usr/local/lib");
+-
+-        try self.addFrameworkDir("/Library/Frameworks");
+-        try self.addFrameworkDir("/System/Library/Frameworks");
+-
+-        return self;
++    if (process.getEnvVarOwned(allocator, "LIBRARY_PATH")) |library_path| {
++        defer allocator.free(library_path);
++        var it = mem.tokenize(u8, library_path, ":");
++        while (true) {
++            const dir = it.next() orelse break;
++            try self.addLibDir(dir);
++        }
++    } else |err| switch (err) {
++        error.InvalidUtf8 => {},
++        error.EnvironmentVariableNotFound => {},
++        error.OutOfMemory => |e| return e,
+     }
+ 
+     if (comptime native_target.os.tag == .solaris) {
+@@ -106,32 +75,17 @@ pub fn detect(allocator: Allocator, native_info: NativeTargetInfo) !NativePaths
+         return self;
+     }
+ 
+-    if (native_target.os.tag != .windows) {
+-        const triple = try native_target.linuxTriple(allocator);
+-        const qual = native_target.cpu.arch.ptrBitWidth();
+-
+-        // TODO: $ ld --verbose | grep SEARCH_DIR
+-        // the output contains some paths that end with lib64, maybe include them too?
+-        // TODO: what is the best possible order of things?
+-        // TODO: some of these are suspect and should only be added on some systems. audit needed.
+-
+-        try self.addIncludeDir("/usr/local/include");
+-        try self.addLibDirFmt("/usr/local/lib{d}", .{qual});
+-        try self.addLibDir("/usr/local/lib");
+-
+-        try self.addIncludeDirFmt("/usr/include/{s}", .{triple});
+-        try self.addLibDirFmt("/usr/lib/{s}", .{triple});
+-
+-        try self.addIncludeDir("/usr/include");
+-        try self.addLibDirFmt("/lib{d}", .{qual});
+-        try self.addLibDir("/lib");
+-        try self.addLibDirFmt("/usr/lib{d}", .{qual});
+-        try self.addLibDir("/usr/lib");
+-
+-        // example: on a 64-bit debian-based linux distro, with zlib installed from apt:
+-        // zlib.h is in /usr/include (added above)
+-        // libz.so.1 is in /lib/x86_64-linux-gnu (added here)
+-        try self.addLibDirFmt("/lib/{s}", .{triple});
++    if (process.getEnvVarOwned(allocator, "DYLD_FRAMEWORK_PATH")) |dyld_framework_path| {
++        defer allocator.free(dyld_framework_path);
++        var it = mem.tokenize(u8, dyld_framework_path, ":");
++        while (true) {
++            const dir = it.next() orelse break;
++            try self.addFrameworkDir(dir);
++        }
++    } else |err| switch (err) {
++        error.InvalidUtf8 => {},
++        error.EnvironmentVariableNotFound => {},
++        error.OutOfMemory => |e| return e,
+     }
+ 
+     return self;
diff --git a/gnu/packages/patches/zstd-CVE-2021-24031_CVE-2021-24032.patch b/gnu/packages/patches/zstd-CVE-2021-24031_CVE-2021-24032.patch
deleted file mode 100644
index 48b5eb18eb..0000000000
--- a/gnu/packages/patches/zstd-CVE-2021-24031_CVE-2021-24032.patch
+++ /dev/null
@@ -1,68 +0,0 @@
-Description: fix race condition allowing attackers to access destination file
- This commit addresses https://github.com/facebook/zstd/issues/2491.
- .
- Note that a downside of this solution is that it is global: `umask()` affects
- all file creation calls in the process. I believe this is safe since
- `fileio.c` functions should only ever be used in the zstd binary, and these
- are (almost) the only files ever created by zstd, and AIUI they're only
- created in a single thread. So we can get away with messing with global state.
- .
- Note that this doesn't change the permissions of files created by `dibio.c`.
- I'm not sure what those should be...
-Author: W. Felix Handte <w@felixhandte.com>
-Origin: upstream
-Bug: https://github.com/facebook/zstd/issues/2491
-Bug-Debian: https://github.com/facebook/zstd/issues/2491
-Applied-Upstream: commit:a774c5797399040af62db21d8a9b9769e005430e
-Reviewed-by: Étienne Mollier <etienne.mollier@mailoo.org>
-Last-Update: 2021-03-03
----
-This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
---- a/programs/fileio.c
-+++ b/programs/fileio.c
-@@ -606,11 +606,11 @@ FIO_openDstFile(FIO_prefs_t* const prefs
-             FIO_remove(dstFileName);
-     }   }
- 
--    {   FILE* const f = fopen( dstFileName, "wb" );
-+    {   const int old_umask = UTIL_umask(0177); /* u-x,go-rwx */
-+        FILE* const f = fopen( dstFileName, "wb" );
-+        UTIL_umask(old_umask);
-         if (f == NULL) {
-             DISPLAYLEVEL(1, "zstd: %s: %s\n", dstFileName, strerror(errno));
--        } else if(srcFileName != NULL && strcmp (srcFileName, stdinmark)) {
--            chmod(dstFileName, 00600);
-         }
-         return f;
-     }
---- a/programs/util.c
-+++ b/programs/util.c
-@@ -54,6 +54,15 @@ int UTIL_getFileStat(const char* infilen
-     return 1;
- }
- 
-+int UTIL_umask(int mode) {
-+#if PLATFORM_POSIX_VERSION > 0
-+    return umask(mode);
-+#else
-+    /* do nothing, fake return value */
-+    return mode;
-+#endif
-+}
-+
- int UTIL_setFileStat(const char *filename, stat_t *statbuf)
- {
-     int res = 0;
---- a/programs/util.h
-+++ b/programs/util.h
-@@ -136,6 +136,10 @@ int UTIL_isSameFile(const char* file1, c
- int UTIL_compareStr(const void *p1, const void *p2);
- int UTIL_isCompressedFile(const char* infilename, const char *extensionList[]);
- const char* UTIL_getFileExtension(const char* infilename);
-+/**
-+ * Wraps umask(). Does nothing when the platform doesn't have that concept.
-+ */
-+int UTIL_umask(int mode);
- 
- #ifndef _MSC_VER
- U32 UTIL_isFIFO(const char* infilename);
diff --git a/gnu/packages/patches/zziplib-CVE-2018-16548.patch b/gnu/packages/patches/zziplib-CVE-2018-16548.patch
deleted file mode 100644
index a17c6a9768..0000000000
--- a/gnu/packages/patches/zziplib-CVE-2018-16548.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-The following 3 patches applied to 0.13.69 in this order, combined:
-https://github.com/gdraheim/zziplib/commit/9411bde3e4a70a81ff3ffd256b71927b2d90dcbb.patch
-https://github.com/gdraheim/zziplib/commit/d2e5d5c53212e54a97ad64b793a4389193fec687.patch
-https://github.com/gdraheim/zziplib/commit/0e1dadb05c1473b9df2d7b8f298dab801778ef99.patch
-
-diff --git a/test/test.zip b/test/test.zip
-index 2c992ea..952d475 100644
-Binary files a/test/test.zip and b/test/test.zip differ
-diff --git a/zzip/zip.c b/zzip/zip.c
-index 14e2e06..f97a40a 100644
---- a/zzip/zip.c
-+++ b/zzip/zip.c
-@@ -472,9 +472,15 @@ __zzip_parse_root_directory(int fd,
-         } else
-         {
-             if (io->fd.seeks(fd, zz_rootseek + zz_offset, SEEK_SET) < 0)
-+	    {
-+	    	free(hdr0);
-                 return ZZIP_DIR_SEEK;
-+	    }
-             if (io->fd.read(fd, &dirent, sizeof(dirent)) < __sizeof(dirent))
-+	    {
-+	    	free(hdr0);
-                 return ZZIP_DIR_READ;
-+	    }
-             d = &dirent;
-         }
- 
-@@ -574,11 +580,18 @@ __zzip_parse_root_directory(int fd,
- 
-         if (hdr_return)
-             *hdr_return = hdr0;
-+	else
-+	{
-+	    /* If it is not assigned to *hdr_return, it will never be free()'d */
-+	    free(hdr0);
-+	}
-     }                           /* else zero (sane) entries */
-+    else
-+        free(hdr0);
- #  ifndef ZZIP_ALLOW_MODULO_ENTRIES
--    return (entries != zz_entries ? ZZIP_CORRUPTED : 0);
-+    return (entries != zz_entries) ? ZZIP_CORRUPTED : 0;
- #  else
--    return ((entries & (unsigned)0xFFFF) != zz_entries ? ZZIP_CORRUPTED : 0);
-+    return ((entries & (unsigned)0xFFFF) != zz_entries) ? ZZIP_CORRUPTED : 0;
- #  endif
- }
-