summaryrefslogtreecommitdiff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
authorMarius Bakke <marius@gnu.org>2020-05-26 22:30:51 +0200
committerMarius Bakke <marius@gnu.org>2020-05-26 22:30:51 +0200
commit9edb3f66fd807b096b48283debdcddccfea34bad (patch)
treecfd86f44ad51df4341a0d48cf4978117e11d7f59 /gnu/packages/patches
parente5f95fd897ad32c93bb48ceae30021976a917979 (diff)
parentb6d18fbdf6ab4a8821a58aa16587676e835001f2 (diff)
Merge branch 'master' into staging
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/ableton-link-system-libraries-debian.patch29
-rw-r--r--gnu/packages/patches/aegisub-make43.patch20
-rw-r--r--gnu/packages/patches/aspell-default-dict-dir.patch24
-rw-r--r--gnu/packages/patches/aspell-gcc-compat.patch31
-rw-r--r--gnu/packages/patches/avahi-CVE-2018-1000845.patch42
-rw-r--r--gnu/packages/patches/bash-linux-pgrp-pipe.patch32
-rw-r--r--gnu/packages/patches/bc-fix-cross-compilation.patch171
-rw-r--r--gnu/packages/patches/behave-skip-a-couple-of-tests.patch462
-rw-r--r--gnu/packages/patches/bitcoin-core-python-compat.patch28
-rw-r--r--gnu/packages/patches/clang-runtime-3.8-libsanitizer-mode-field.patch50
-rw-r--r--gnu/packages/patches/clang-runtime-3.9-libsanitizer-mode-field.patch50
-rw-r--r--gnu/packages/patches/clang-runtime-9-libsanitizer-mode-field.patch60
-rw-r--r--gnu/packages/patches/cmake-curl-certificates.patch10
-rw-r--r--gnu/packages/patches/collectd-5.11.0-noinstallvar.patch21
-rw-r--r--gnu/packages/patches/coreutils-ls.patch117
-rw-r--r--gnu/packages/patches/curl-use-ssl-cert-env.patch64
-rw-r--r--gnu/packages/patches/cyrus-sasl-ac-try-run-fix.patch12
-rw-r--r--gnu/packages/patches/datefudge-gettimeofday.patch13
-rw-r--r--gnu/packages/patches/dconf-meson-0.52.patch19
-rw-r--r--gnu/packages/patches/doxygen-1.8.17-runtests.patch73
-rw-r--r--gnu/packages/patches/doxygen-test.patch38
-rw-r--r--gnu/packages/patches/evolution-data-server-libical-compat.patch16
-rw-r--r--gnu/packages/patches/extempore-unbundle-external-dependencies.patch140
-rw-r--r--gnu/packages/patches/fifengine-swig-compat.patch17
-rw-r--r--gnu/packages/patches/file-CVE-2018-10360.patch27
-rw-r--r--gnu/packages/patches/findutils-gnulib-libio.patch114
-rw-r--r--gnu/packages/patches/findutils-makedev.patch22
-rw-r--r--gnu/packages/patches/findutils-test-rwlock-threads.patch38
-rw-r--r--gnu/packages/patches/findutils-test-xargs.patch22
-rw-r--r--gnu/packages/patches/fontconfig-hurd-path-max.patch17
-rw-r--r--gnu/packages/patches/fribidi-CVE-2019-18397.patch26
-rw-r--r--gnu/packages/patches/gcc-4.9-libsanitizer-mode-size.patch52
-rw-r--r--gnu/packages/patches/gcc-5-hurd.patch63
-rw-r--r--gnu/packages/patches/gcc-6-libsanitizer-mode-size.patch53
-rw-r--r--gnu/packages/patches/gcc-7-cross-toolexeclibdir.patch1041
-rw-r--r--gnu/packages/patches/gcc-7-libsanitizer-mode-size.patch53
-rw-r--r--gnu/packages/patches/gcc-boot-4.6.4.patch (renamed from gnu/packages/patches/gcc-boot-4.7.4.patch)23
-rw-r--r--gnu/packages/patches/gd-CVE-2018-1000222.patch87
-rw-r--r--gnu/packages/patches/gd-CVE-2018-5711.patch61
-rw-r--r--gnu/packages/patches/gd-CVE-2019-6977.patch36
-rw-r--r--gnu/packages/patches/gd-CVE-2019-6978.patch301
-rw-r--r--gnu/packages/patches/gd-brect-bounds.patch63
-rw-r--r--gnu/packages/patches/gd-fix-tests-on-i686.patch2
-rw-r--r--gnu/packages/patches/gd-freetype-test-failure.patch59
-rw-r--r--gnu/packages/patches/gdm-default-session.patch44
-rw-r--r--gnu/packages/patches/ghc-dont-pass-linker-flags-via-response-files.patch27
-rw-r--r--gnu/packages/patches/ghc-testsuite-dlopen-pie.patch54
-rw-r--r--gnu/packages/patches/ghostscript-no-header-id.patch14
-rw-r--r--gnu/packages/patches/ghostscript-no-header-uuid.patch12
-rw-r--r--gnu/packages/patches/giflib-make-reallocarray-private.patch120
-rw-r--r--gnu/packages/patches/git-annex-S3v4.patch77
-rw-r--r--gnu/packages/patches/glibc-2.29-supported-locales.patch33
-rw-r--r--gnu/packages/patches/glibc-CVE-2019-19126.patch22
-rw-r--r--gnu/packages/patches/glibc-bootstrap-system-2.2.5.patch30
-rw-r--r--gnu/packages/patches/glibc-hurd-clock_gettime_monotonic.patch84
-rw-r--r--gnu/packages/patches/glibc-hurd-clock_t_centiseconds.patch90
-rw-r--r--gnu/packages/patches/glibc-hurd-gettyent.patch34
-rw-r--r--gnu/packages/patches/glibc-hurd-mach-print.patch23
-rw-r--r--gnu/packages/patches/glibc-hurd-signal-sa-siginfo.patch637
-rw-r--r--gnu/packages/patches/glibc-supported-locales.patch11
-rw-r--r--gnu/packages/patches/glm-restore-install-target.patch574
-rw-r--r--gnu/packages/patches/gnome-shell-disable-test.patch25
-rw-r--r--gnu/packages/patches/gnome-shell-theme.patch30
-rw-r--r--gnu/packages/patches/gnome-todo-delete-esource-duplicate.patch10
-rw-r--r--gnu/packages/patches/gnutls-cross.patch82
-rw-r--r--gnu/packages/patches/grocsvs-dont-use-admiral.patch69
-rw-r--r--gnu/packages/patches/gromacs-tinyxml2.patch67
-rw-r--r--gnu/packages/patches/grub-verifiers-Blocklist-fallout-cleanup.patch41
-rw-r--r--gnu/packages/patches/gsl-test-i686.patch17
-rw-r--r--gnu/packages/patches/guile-3.0-linux-syscalls.patch345
-rw-r--r--gnu/packages/patches/guile-3.0-relocatable.patch69
-rw-r--r--gnu/packages/patches/guile-relocatable.patch36
-rw-r--r--gnu/packages/patches/guile-sqlite3-fix-cross-compilation.patch55
-rw-r--r--gnu/packages/patches/hurd-cross.patch33
-rw-r--r--gnu/packages/patches/hurd-fix-eth-multiplexer-dependency.patch26
-rw-r--r--gnu/packages/patches/icecat-makeicecat.patch4
-rw-r--r--gnu/packages/patches/icecat-use-older-reveal-hidden-html.patch70
-rw-r--r--gnu/packages/patches/ilmbase-fix-test-arm.patch60
-rw-r--r--gnu/packages/patches/ilmbase-openexr-pkg-config.patch40
-rw-r--r--gnu/packages/patches/inetutils-hurd.patch583
-rw-r--r--gnu/packages/patches/jbig2dec-ignore-testtest.patch16
-rw-r--r--gnu/packages/patches/julia-SOURCE_DATE_EPOCH-mtime.patch48
-rw-r--r--gnu/packages/patches/less-hurd-path-max.patch36
-rw-r--r--gnu/packages/patches/libffi-3.2.1-complex-alpha.patch28
-rw-r--r--gnu/packages/patches/libgpg-error-gawk-compat.patch155
-rw-r--r--gnu/packages/patches/libjpeg-turbo-CVE-2019-2201.patch31
-rw-r--r--gnu/packages/patches/libreoffice-poppler-compat.patch19
-rw-r--r--gnu/packages/patches/libtirpc-hurd-client.patch50
-rw-r--r--gnu/packages/patches/libtirpc-hurd.patch172
-rw-r--r--gnu/packages/patches/libxslt-generated-ids.patch6
-rw-r--r--gnu/packages/patches/linphoneqt-tabbutton.patch96
-rw-r--r--gnu/packages/patches/llvm-for-extempore.patch118
-rw-r--r--gnu/packages/patches/make-glibc-compat.patch52
-rw-r--r--gnu/packages/patches/make-impure-dirs.patch12
-rw-r--r--gnu/packages/patches/mit-krb5-hurd.patch165
-rw-r--r--gnu/packages/patches/mit-krb5-qualify-short-hostnames.patch29
-rw-r--r--gnu/packages/patches/musl-cross-locale.patch20
-rw-r--r--gnu/packages/patches/openldap-CVE-2020-12243.patch125
-rw-r--r--gnu/packages/patches/openresolv-restartcmd-guix.patch34
-rw-r--r--gnu/packages/patches/openssh-hurd.patch30
-rw-r--r--gnu/packages/patches/pango-skip-libthai-test.patch23
-rw-r--r--gnu/packages/patches/pciutils-hurd-configure.patch35
-rw-r--r--gnu/packages/patches/perl-cross.patch60
-rw-r--r--gnu/packages/patches/potrace-tests.patch50
-rw-r--r--gnu/packages/patches/purescript-relax-dependencies.patch42
-rw-r--r--gnu/packages/patches/python-2.7-search-paths.patch12
-rw-r--r--gnu/packages/patches/python-3-arm-alignment.patch21
-rw-r--r--gnu/packages/patches/python-3-search-paths.patch23
-rw-r--r--gnu/packages/patches/python-3.8-search-paths.patch17
-rw-r--r--gnu/packages/patches/python-cffi-x87-stack-clean.patch29
-rw-r--r--gnu/packages/patches/python-cross-compile.patch145
-rw-r--r--gnu/packages/patches/python-gst-fix-build-with-python-3.8.patch36
-rw-r--r--gnu/packages/patches/python-pycrypto-time-clock.patch23
-rw-r--r--gnu/packages/patches/qemu-CVE-2020-1711.patch69
-rw-r--r--gnu/packages/patches/qemu-CVE-2020-7039.patch173
-rw-r--r--gnu/packages/patches/qemu-CVE-2020-7211.patch49
-rw-r--r--gnu/packages/patches/qemu-CVE-2020-8608.patch269
-rw-r--r--gnu/packages/patches/qemu-fix-documentation-build-failure.patch43
-rw-r--r--gnu/packages/patches/qtbase-moc-ignore-gcc-macro.patch17
-rw-r--r--gnu/packages/patches/ruby-rubygems-276-for-ruby24.patch605
-rw-r--r--gnu/packages/patches/rust-nettle-disable-vendor.patch13
-rw-r--r--gnu/packages/patches/rust-nettle-sys-disable-vendor.patch48
-rw-r--r--gnu/packages/patches/screen-hurd-path-max.patch42
-rw-r--r--gnu/packages/patches/scribus-1.5.5-poppler-0.86-build-fix.patch642
-rw-r--r--gnu/packages/patches/seahorse-gkr-use-0-on-empty-flags.patch32
-rw-r--r--gnu/packages/patches/shadow-hurd-pctrl.patch16
-rw-r--r--gnu/packages/patches/swig-guile-gc.patch76
-rw-r--r--gnu/packages/patches/tcl-fix-cross-compilation.patch39
-rw-r--r--gnu/packages/patches/tcsh-fix-autotest.patch45
-rw-r--r--gnu/packages/patches/tcsh-fix-out-of-bounds-read.patch31
-rw-r--r--gnu/packages/patches/telepathy-glib-channel-memory-leak.patch19
-rw-r--r--gnu/packages/patches/texlive-bin-CVE-2018-17407.patch249
-rw-r--r--gnu/packages/patches/texlive-bin-luatex-poppler-compat.patch293
-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/twinkle-bcg729.patch176
-rw-r--r--gnu/packages/patches/vigra-python-compat.patch18
-rw-r--r--gnu/packages/patches/vlc-fix-test_libvlc_slaves.patch35
-rw-r--r--gnu/packages/patches/warsow-qfusion-fix-bool-return-type.patch22
-rw-r--r--gnu/packages/patches/webkitgtk-share-store.patch19
140 files changed, 7735 insertions, 4379 deletions
diff --git a/gnu/packages/patches/ableton-link-system-libraries-debian.patch b/gnu/packages/patches/ableton-link-system-libraries-debian.patch
new file mode 100644
index 0000000000..184896ee61
--- /dev/null
+++ b/gnu/packages/patches/ableton-link-system-libraries-debian.patch
@@ -0,0 +1,29 @@
+This patch was borrowed from Debian's package:
+https://salsa.debian.org/multimedia-team/ableton-link/-/blob/9c65141bf5bba0872811c179af77ac95770352cc/debian/patches/DEBIAN_system_libraries.patch
+Description: Drop dependencies on included 3rd-party libs
+ upstream includes git-submodules for Catch and ASIO (not found in the tarball).
+ on Debian we want to use the system provided libraries.
+Author: IOhannes m zmölnig
+Origin: Debian
+Forwarded: not-needed
+Last-Update: 2016-10-26
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- ableton-link.orig/cmake_include/AsioStandaloneConfig.cmake
++++ ableton-link/cmake_include/AsioStandaloneConfig.cmake
+@@ -1,6 +1,2 @@
+ add_library(AsioStandalone::AsioStandalone IMPORTED INTERFACE)
+
+-set_property(TARGET AsioStandalone::AsioStandalone APPEND PROPERTY
+- INTERFACE_INCLUDE_DIRECTORIES
+- ${CMAKE_CURRENT_LIST_DIR}/../modules/asio-standalone/asio/include
+-)
+--- ableton-link.orig/cmake_include/CatchConfig.cmake
++++ ableton-link/cmake_include/CatchConfig.cmake
+@@ -1,6 +1,2 @@
+ add_library(Catch::Catch IMPORTED INTERFACE)
+
+-set_property(TARGET Catch::Catch APPEND PROPERTY
+- INTERFACE_INCLUDE_DIRECTORIES
+- ${CMAKE_SOURCE_DIR}/third_party/catch
+-)
diff --git a/gnu/packages/patches/aegisub-make43.patch b/gnu/packages/patches/aegisub-make43.patch
new file mode 100644
index 0000000000..32f9d7749c
--- /dev/null
+++ b/gnu/packages/patches/aegisub-make43.patch
@@ -0,0 +1,20 @@
+Fix build with GNU Make 4.3:
+
+https://github.com/Aegisub/Aegisub/issues/171
+
+Patch taken from upstream:
+
+https://github.com/Aegisub/Aegisub/commit/6bd3f4c26b8fc1f76a8b797fcee11e7611d59a39
+
+diff --git a/Makefile.target b/Makefile.target
+--- a/Makefile.target
++++ b/Makefile.target
+@@ -112,7 +112,7 @@ POST_FLAGS = $($@_FLAGS) -c -o $@ $<
+ # Libraries contain all object files they depend on (but they may depend on other files)
+ # Not using libtool on OS X because it has an unsilenceable warning about a
+ # compatibility issue with BSD 4.3 (wtf)
+-lib%.a: $$($$*_OBJ)
++lib%.a: $$($$(*F)_OBJ)
+ @$(BIN_MKDIR_P) $(dir $@)
+ $(BIN_AR) cru $@ $(filter %.o,$^)
+ $(BIN_RANLIB) $@
diff --git a/gnu/packages/patches/aspell-default-dict-dir.patch b/gnu/packages/patches/aspell-default-dict-dir.patch
index 17a6ff606f..5f759a66d9 100644
--- a/gnu/packages/patches/aspell-default-dict-dir.patch
+++ b/gnu/packages/patches/aspell-default-dict-dir.patch
@@ -8,12 +8,34 @@ However it is necessary for applications that use libaspell since
--- a/common/config.cpp
+++ b/common/config.cpp
+@@ -651,7 +651,20 @@ namespace acommon {
+ } else { // sep == '|'
+ assert(replace[0] == '$');
+ const char * env = getenv(replace.c_str()+1);
+- final_str += env ? env : second;
++ if (env) {
++ final_str += env;
++ } else if (second[0] == '$') {
++ // Expand the right-hand side of '|', which starts with a
++ // reference to an environment variable.
++ auto slash = second.find('/');
++ String variable = second.substr(1, slash - 1);
++ const char * env = getenv(variable.c_str());
++ String value = env ? String(env) : "";
++ value += second.substr(slash, second.size() - slash);
++ final_str += value;
++ } else {
++ final_str += second;
++ }
+ }
+ replace = "";
+ in_replace = false;
@@ -1349,6 +1349,9 @@ namespace acommon {
# define REPL ".aspell.<lang>.prepl"
#endif
+#undef DICT_DIR
-+#define DICT_DIR "<$ASPELL_DICT_DIR|home-dir/.guix-profile/lib/aspell>"
++#define DICT_DIR "<$ASPELL_DICT_DIR|$HOME/.guix-profile/lib/aspell>"
+
static const KeyInfo config_keys[] = {
// the description should be under 50 chars
diff --git a/gnu/packages/patches/aspell-gcc-compat.patch b/gnu/packages/patches/aspell-gcc-compat.patch
deleted file mode 100644
index 94c44f8fb6..0000000000
--- a/gnu/packages/patches/aspell-gcc-compat.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-Fix GCC7 warnings.
-
-Taken from upstream:
-https://git.savannah.gnu.org/cgit/aspell.git/commit/?id=8089fa02122fed0a6394eba14bbedcb1d18e2384
-
-diff --git a/modules/filter/tex.cpp b/modules/filter/tex.cpp
-index a979539..19ab63c 100644
---- a/modules/filter/tex.cpp
-+++ b/modules/filter/tex.cpp
-@@ -174,7 +174,7 @@ namespace {
-
- if (c == '{') {
-
-- if (top.in_what == Parm || top.in_what == Opt || top.do_check == '\0')
-+ if (top.in_what == Parm || top.in_what == Opt || *top.do_check == '\0')
- push_command(Parm);
-
- top.in_what = Parm;
-diff --git a/prog/check_funs.cpp b/prog/check_funs.cpp
-index db54f3d..89ee09d 100644
---- a/prog/check_funs.cpp
-+++ b/prog/check_funs.cpp
-@@ -647,7 +647,7 @@ static void print_truncate(FILE * out, const char * word, int width) {
- }
- }
- if (i == width-1) {
-- if (word == '\0')
-+ if (*word == '\0')
- put(out,' ');
- else if (word[len] == '\0')
- put(out, word, len);
diff --git a/gnu/packages/patches/avahi-CVE-2018-1000845.patch b/gnu/packages/patches/avahi-CVE-2018-1000845.patch
deleted file mode 100644
index e5b13e0bee..0000000000
--- a/gnu/packages/patches/avahi-CVE-2018-1000845.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From e111def44a7df4624a4aa3f85fe98054bffb6b4f Mon Sep 17 00:00:00 2001
-From: Trent Lloyd <trent@lloyd.id.au>
-Date: Sat, 22 Dec 2018 09:06:07 +0800
-Subject: [PATCH] Drop legacy unicast queries from address not on local link
-
-When handling legacy unicast queries, ensure that the source IP is
-inside a subnet on the local link, otherwise drop the packet.
-
-Fixes #145
-Fixes #203
-CVE-2017-6519
-CVE-2018-100084
----
- avahi-core/server.c | 8 ++++++++
- 1 file changed, 8 insertions(+)
-
-diff --git a/avahi-core/server.c b/avahi-core/server.c
-index a2cb19a8..a2580e38 100644
---- a/avahi-core/server.c
-+++ b/avahi-core/server.c
-@@ -930,6 +930,7 @@ static void dispatch_packet(AvahiServer *s, AvahiDnsPacket *p, const AvahiAddres
-
- if (avahi_dns_packet_is_query(p)) {
- int legacy_unicast = 0;
-+ char t[AVAHI_ADDRESS_STR_MAX];
-
- /* For queries EDNS0 might allow ARCOUNT != 0. We ignore the
- * AR section completely here, so far. Until the day we add
-@@ -947,6 +948,13 @@ static void dispatch_packet(AvahiServer *s, AvahiDnsPacket *p, const AvahiAddres
- legacy_unicast = 1;
- }
-
-+ if (!is_mdns_mcast_address(dst_address) &&
-+ !avahi_interface_address_on_link(i, src_address)) {
-+
-+ avahi_log_debug("Received non-local unicast query from host %s on interface '%s.%i'.", avahi_address_snprint(t, sizeof(t), src_address), i->hardware->name, i->protocol);
-+ return;
-+ }
-+
- if (legacy_unicast)
- reflect_legacy_unicast_query_packet(s, p, i, src_address, port);
-
diff --git a/gnu/packages/patches/bash-linux-pgrp-pipe.patch b/gnu/packages/patches/bash-linux-pgrp-pipe.patch
new file mode 100644
index 0000000000..234a55e897
--- /dev/null
+++ b/gnu/packages/patches/bash-linux-pgrp-pipe.patch
@@ -0,0 +1,32 @@
+Unconditionally enable PGRP_PIPE on Linux (the kernel), regardless of
+the kernel version in use on the build machine.
+
+--- configure.ac.orig 2019-01-02 09:38:44.000000000 -0500
++++ configure.ac 2019-08-15 16:40:24.271758379 -0400
+@@ -1108,10 +1108,7 @@
+ solaris2*) LOCAL_CFLAGS=-DSOLARIS ;;
+ lynxos*) LOCAL_CFLAGS=-DRECYCLES_PIDS ;;
+ linux*) LOCAL_LDFLAGS=-rdynamic # allow dynamic loading
+- case "`uname -r`" in
+- 1.*|2.[[0123]]*) : ;;
+- *) AC_DEFINE(PGRP_PIPE) ;;
+- esac ;;
++ AC_DEFINE(PGRP_PIPE) ;;
+ netbsd*|openbsd*) LOCAL_CFLAGS="-DDEV_FD_STAT_BROKEN" ;;
+ *qnx[[67]]*) LOCAL_LIBS="-lncurses" ;;
+ *qnx*) LOCAL_CFLAGS="-Dqnx -F -3s" LOCAL_LDFLAGS="-3s" LOCAL_LIBS="-lunix -lncurses" ;;
+--- configure.orig 2019-01-02 09:43:04.000000000 -0500
++++ configure 2019-08-15 16:41:44.440155912 -0400
+@@ -16312,11 +16312,7 @@
+ solaris2*) LOCAL_CFLAGS=-DSOLARIS ;;
+ lynxos*) LOCAL_CFLAGS=-DRECYCLES_PIDS ;;
+ linux*) LOCAL_LDFLAGS=-rdynamic # allow dynamic loading
+- case "`uname -r`" in
+- 1.*|2.[0123]*) : ;;
+- *) $as_echo "#define PGRP_PIPE 1" >>confdefs.h
+- ;;
+- esac ;;
++ $as_echo "#define PGRP_PIPE 1" >>confdefs.h ;;
+ netbsd*|openbsd*) LOCAL_CFLAGS="-DDEV_FD_STAT_BROKEN" ;;
+ *qnx[67]*) LOCAL_LIBS="-lncurses" ;;
+ *qnx*) LOCAL_CFLAGS="-Dqnx -F -3s" LOCAL_LDFLAGS="-3s" LOCAL_LIBS="-lunix -lncurses" ;;
diff --git a/gnu/packages/patches/bc-fix-cross-compilation.patch b/gnu/packages/patches/bc-fix-cross-compilation.patch
new file mode 100644
index 0000000000..14dfecdbde
--- /dev/null
+++ b/gnu/packages/patches/bc-fix-cross-compilation.patch
@@ -0,0 +1,171 @@
+Patch taken from nix.
+
+commit fdda59736ddc048cf38a2c7103f4f5d9eeaf995e
+Author: Ben Gamari <ben@smart-cactus.org>
+Date: Tue Oct 17 10:51:34 2017 -0400
+
+ Try implementing cross-compilation
+
+diff --git a/bc/Makefile.am b/bc/Makefile.am
+index d9d412e..fdef633 100644
+--- a/bc/Makefile.am
++++ b/bc/Makefile.am
+@@ -17,6 +17,7 @@ MAINTAINERCLEANFILES = Makefile.in bc.c bc.h scan.c \
+
+ AM_CPPFLAGS = -I$(srcdir) -I$(srcdir)/../h
+ LIBBC = ../lib/libbc.a
++LIBBC_HOST = ../lib/libbc_host.a
+ LIBL = @LEXLIB@
+ LDADD = $(LIBBC) $(LIBL) @READLINELIB@
+
+@@ -29,12 +30,20 @@ $(PROGRAMS): libmath.h $(LIBBC)
+ scan.o: bc.h
+ global.o: libmath.h
++
++main_host.c : main.c
++ cp $< $@
+
+-fbcOBJ = main.o bc.o scan.o execute.o load.o storage.o util.o warranty.o
++fbcOBJ = $(addsuffix _host,main.o bc.o scan.o execute.o load.o storage.o util.o warranty.o)
++
++%.o_host : CC:=$(CC_FOR_BUILD)
++
++%.o_host : %.c
++ $(COMPILE) -c $(CFLAGS) $(INCLUDES) -o $@ $<
+
+-libmath.h: libmath.b $(fbcOBJ) $(LIBBC)
++libmath.h: libmath.b $(fbcOBJ) $(LIBBC_HOST)
+ echo '{0}' > libmath.h
+- $(MAKE) global.o
+- $(LINK) -o fbc $(fbcOBJ) global.o $(LIBBC) $(LIBL) $(READLINELIB) $(LIBS)
++ $(MAKE) global.o_host
++ $(CC_FOR_BUILD) -o fbc $(fbcOBJ) global.o_host $(LIBBC_HOST) $(LIBL) ${READLINELIB} $(LIBS)
+ ./fbc -c $(srcdir)/libmath.b </dev/null >libmath.h
+ $(srcdir)/fix-libmath_h
+ rm -f ./fbc ./global.o
+diff --git a/configure.ac b/configure.ac
+index fc74573..5cabb73 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -20,6 +20,7 @@ m4_define([dc_version], 1.4.1)
+
+ AC_INIT([bc],[bc_version])
+ AC_CONFIG_SRCDIR(doc/bc.1)
++AC_CONFIG_MACRO_DIR([m4])
+ AM_INIT_AUTOMAKE([dist-bzip2])
+ AC_CONFIG_HEADERS(config.h)
+
+@@ -35,6 +36,7 @@ AC_DEFINE([DC_COPYRIGHT],
+ [Define the dc copyright line.])
+
+ AC_PROG_CC
++AX_CC_FOR_BUILD
+ AC_USE_SYSTEM_EXTENSIONS
+
+ AM_PROG_LEX
+diff --git a/lib/Makefile.am b/lib/Makefile.am
+index ec4bf59..c670f5b 100644
+--- a/lib/Makefile.am
++++ b/lib/Makefile.am
+@@ -1,5 +1,5 @@
+ ## Process this file with automake to produce Makefile.in
+-noinst_LIBRARIES = libbc.a
++noinst_LIBRARIES = libbc.a libbc_host.a
+
+ AM_CPPFLAGS = -I. -I.. -I$(srcdir)/../h
+
+@@ -24,3 +24,11 @@ testmul: testmul.o number.o
+
+ specialnumber: newnumber.o
+ cp newnumber.o number.o
++
++%.o_host : CC:=$(CC_FOR_BUILD)
++%.o_host : %.c
++ $(COMPILE) -c $(CFLAGS) $(INCLUDES) -o $@ $<
++
++libbc_host.a : $(addsuffix _host,$(libbc_a_OBJECTS))
++ ar cru $@ $+
++ ranlib $@
+diff --git a/m4/cc_for_build.m4 b/m4/cc_for_build.m4
+new file mode 100644
+index 0000000..c62ffad
+--- /dev/null
++++ b/m4/cc_for_build.m4
+@@ -0,0 +1,77 @@
++# ===========================================================================
++# https://www.gnu.org/software/autoconf-archive/ax_cc_for_build.html
++# ===========================================================================
++#
++# SYNOPSIS
++#
++# AX_CC_FOR_BUILD
++#
++# DESCRIPTION
++#
++# Find a build-time compiler. Sets CC_FOR_BUILD and EXEEXT_FOR_BUILD.
++#
++# LICENSE
++#
++# Copyright (c) 2010 Reuben Thomas <rrt@sc3d.org>
++# Copyright (c) 1999 Richard Henderson <rth@redhat.com>
++#
++# 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 3 of the License, or (at your
++# option) any later version.
++#
++# 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, see <https://www.gnu.org/licenses/>.
++#
++# As a special exception, the respective Autoconf Macro's copyright owner
++# gives unlimited permission to copy, distribute and modify the configure
++# scripts that are the output of Autoconf when processing the Macro. You
++# need not follow the terms of the GNU General Public License when using
++# or distributing such scripts, even though portions of the text of the
++# Macro appear in them. The GNU General Public License (GPL) does govern
++# all other use of the material that constitutes the Autoconf Macro.
++#
++# This special exception to the GPL applies to versions of the Autoconf
++# Macro released by the Autoconf Archive. When you make and distribute a
++# modified version of the Autoconf Macro, you may extend this special
++# exception to the GPL to apply to your modified version as well.
++
++#serial 3
++
++dnl Get a default for CC_FOR_BUILD to put into Makefile.
++AC_DEFUN([AX_CC_FOR_BUILD],
++[# Put a plausible default for CC_FOR_BUILD in Makefile.
++if test -z "$CC_FOR_BUILD"; then
++ if test "x$cross_compiling" = "xno"; then
++ CC_FOR_BUILD='$(CC)'
++ else
++ CC_FOR_BUILD=gcc
++ fi
++fi
++AC_SUBST(CC_FOR_BUILD)
++# Also set EXEEXT_FOR_BUILD.
++if test "x$cross_compiling" = "xno"; then
++ EXEEXT_FOR_BUILD='$(EXEEXT)'
++else
++ AC_CACHE_CHECK([for build system executable suffix], bfd_cv_build_exeext,
++ [rm -f conftest*
++ echo 'int main () { return 0; }' > conftest.c
++ bfd_cv_build_exeext=
++ ${CC_FOR_BUILD} -o conftest conftest.c 1>&5 2>&5
++ for file in conftest.*; do
++ case $file in
++ *.c | *.o | *.obj | *.ilk | *.pdb) ;;
++ *) bfd_cv_build_exeext=`echo $file | sed -e s/conftest//` ;;
++ esac
++ done
++ rm -f conftest*
++ test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no])
++ EXEEXT_FOR_BUILD=""
++ test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext}
++fi
++AC_SUBST(EXEEXT_FOR_BUILD)])dnl
diff --git a/gnu/packages/patches/behave-skip-a-couple-of-tests.patch b/gnu/packages/patches/behave-skip-a-couple-of-tests.patch
new file mode 100644
index 0000000000..e3d4e15241
--- /dev/null
+++ b/gnu/packages/patches/behave-skip-a-couple-of-tests.patch
@@ -0,0 +1,462 @@
+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/bitcoin-core-python-compat.patch b/gnu/packages/patches/bitcoin-core-python-compat.patch
new file mode 100644
index 0000000000..6bf744124d
--- /dev/null
+++ b/gnu/packages/patches/bitcoin-core-python-compat.patch
@@ -0,0 +1,28 @@
+Get rid of deprecation warning emitted by Python 3.8, which causes a test failure(!).
+
+https://github.com/bitcoin/bitcoin/pull/17931
+
+Taken from upstream:
+
+https://github.com/bitcoin/bitcoin/commit/f117fb00da747147cddfb071c1427a2754c278cd
+
+diff --git a/test/functional/p2p_invalid_messages.py b/test/functional/p2p_invalid_messages.py
+index 20864881c165..07eacf410d88 100755
+--- a/test/functional/p2p_invalid_messages.py
++++ b/test/functional/p2p_invalid_messages.py
+@@ -145,13 +145,13 @@ def run_test(self):
+ def test_magic_bytes(self):
+ conn = self.nodes[0].add_p2p_connection(P2PDataStore())
+
+- def swap_magic_bytes():
++ async def swap_magic_bytes():
+ conn._on_data = lambda: None # Need to ignore all incoming messages from now, since they come with "invalid" magic bytes
+ conn.magic_bytes = b'\x00\x11\x22\x32'
+
+ # Call .result() to block until the atomic swap is complete, otherwise
+ # we might run into races later on
+- asyncio.run_coroutine_threadsafe(asyncio.coroutine(swap_magic_bytes)(), NetworkThread.network_event_loop).result()
++ asyncio.run_coroutine_threadsafe(swap_magic_bytes(), NetworkThread.network_event_loop).result()
+
+ with self.nodes[0].assert_debug_log(['PROCESSMESSAGE: INVALID MESSAGESTART ping']):
+ conn.send_message(messages.msg_ping(nonce=0xff))
diff --git a/gnu/packages/patches/clang-runtime-3.8-libsanitizer-mode-field.patch b/gnu/packages/patches/clang-runtime-3.8-libsanitizer-mode-field.patch
new file mode 100644
index 0000000000..f4bca3ecb1
--- /dev/null
+++ b/gnu/packages/patches/clang-runtime-3.8-libsanitizer-mode-field.patch
@@ -0,0 +1,50 @@
+Adjust libsanitizer to ABI change in glibc 2.31.
+
+Adapted to 3.x from this upstream commit:
+https://github.com/llvm/llvm-project/commit/947f9692440836dcb8d88b74b69dd379d85974ce
+
+diff --git a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
+--- a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
++++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
+@@ -1130,8 +1130,9 @@ CHECK_SIZE_AND_OFFSET(ipc_perm, cgid);
+ #ifndef __GLIBC_PREREQ
+ #define __GLIBC_PREREQ(x, y) 0
+ #endif
+-#if !defined(__aarch64__) || !SANITIZER_LINUX || __GLIBC_PREREQ (2, 21)
+-/* On aarch64 glibc 2.20 and earlier provided incorrect mode field. */
++#if !SANITIZER_LINUX || __GLIBC_PREREQ (2, 31)
++/* glibc 2.30 and earlier provided 16-bit mode field instead of 32-bit
++ on many architectures. */
+ CHECK_SIZE_AND_OFFSET(ipc_perm, mode);
+ #endif
+
+diff --git a/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/lib/sanitizer_common/sanitizer_platform_limits_posix.h
+--- a/lib/sanitizer_common/sanitizer_platform_limits_posix.h
++++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.h
+@@ -188,17 +188,16 @@ namespace __sanitizer {
+ unsigned __seq;
+ u64 __unused1;
+ u64 __unused2;
+-#elif defined(__mips__) || defined(__aarch64__)
+- unsigned int mode;
+- unsigned short __seq;
+- unsigned short __pad1;
+- unsigned long __unused1;
+- unsigned long __unused2;
++#elif defined(__sparc__)
++ unsigned mode;
++ unsigned short __pad2;
++ unsigned short __seq;
++ unsigned long long __unused1;
++ unsigned long long __unused2;
+ #else
+- unsigned short mode;
+- unsigned short __pad1;
+- unsigned short __seq;
+- unsigned short __pad2;
++ unsigned int mode;
++ unsigned short __seq;
++ unsigned short __pad2;
+ #if defined(__x86_64__) && !defined(_LP64)
+ u64 __unused1;
+ u64 __unused2;
diff --git a/gnu/packages/patches/clang-runtime-3.9-libsanitizer-mode-field.patch b/gnu/packages/patches/clang-runtime-3.9-libsanitizer-mode-field.patch
new file mode 100644
index 0000000000..2598a1bdeb
--- /dev/null
+++ b/gnu/packages/patches/clang-runtime-3.9-libsanitizer-mode-field.patch
@@ -0,0 +1,50 @@
+Adjust libsanitizer to ABI change in glibc 2.31.
+
+Adapted to 3.x from this upstream commit:
+https://github.com/llvm/llvm-project/commit/947f9692440836dcb8d88b74b69dd379d85974ce
+
+diff --git a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
+--- a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
++++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
+@@ -1139,8 +1139,9 @@ CHECK_SIZE_AND_OFFSET(ipc_perm, uid);
+ CHECK_SIZE_AND_OFFSET(ipc_perm, gid);
+ CHECK_SIZE_AND_OFFSET(ipc_perm, cuid);
+ CHECK_SIZE_AND_OFFSET(ipc_perm, cgid);
+-#if !defined(__aarch64__) || !SANITIZER_LINUX || __GLIBC_PREREQ (2, 21)
+-/* On aarch64 glibc 2.20 and earlier provided incorrect mode field. */
++#if !SANITIZER_LINUX || __GLIBC_PREREQ (2, 31)
++/* glibc 2.30 and earlier provided 16-bit mode field instead of 32-bit
++ on many architectures. */
+ CHECK_SIZE_AND_OFFSET(ipc_perm, mode);
+ #endif
+
+diff --git a/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
+--- a/lib/sanitizer_common/sanitizer_platform_limits_posix.h
++++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.h
+@@ -194,17 +194,16 @@ namespace __sanitizer {
+ unsigned __seq;
+ u64 __unused1;
+ u64 __unused2;
+-#elif defined(__mips__) || defined(__aarch64__) || defined(__s390x__)
+- unsigned int mode;
+- unsigned short __seq;
+- unsigned short __pad1;
+- unsigned long __unused1;
+- unsigned long __unused2;
++#elif defined(__sparc__)
++ unsigned mode;
++ unsigned short __pad2;
++ unsigned short __seq;
++ unsigned long long __unused1;
++ unsigned long long __unused2;
+ #else
+- unsigned short mode;
+- unsigned short __pad1;
+- unsigned short __seq;
+- unsigned short __pad2;
++ unsigned int mode;
++ unsigned short __seq;
++ unsigned short __pad2;
+ #if defined(__x86_64__) && !defined(_LP64)
+ u64 __unused1;
+ u64 __unused2;
diff --git a/gnu/packages/patches/clang-runtime-9-libsanitizer-mode-field.patch b/gnu/packages/patches/clang-runtime-9-libsanitizer-mode-field.patch
new file mode 100644
index 0000000000..ebb080ed9d
--- /dev/null
+++ b/gnu/packages/patches/clang-runtime-9-libsanitizer-mode-field.patch
@@ -0,0 +1,60 @@
+Adjust libsanitizer to ABI change in glibc 2.31.
+
+Taken from this upstream commit:
+https://github.com/llvm/llvm-project/commit/947f9692440836dcb8d88b74b69dd379d85974ce
+
+diff --git a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
+--- a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
++++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
+@@ -1126,8 +1126,9 @@ CHECK_SIZE_AND_OFFSET(ipc_perm, uid);
+ CHECK_SIZE_AND_OFFSET(ipc_perm, gid);
+ CHECK_SIZE_AND_OFFSET(ipc_perm, cuid);
+ CHECK_SIZE_AND_OFFSET(ipc_perm, cgid);
+-#if !defined(__aarch64__) || !SANITIZER_LINUX || __GLIBC_PREREQ (2, 21)
+-/* On aarch64 glibc 2.20 and earlier provided incorrect mode field. */
++#if !SANITIZER_LINUX || __GLIBC_PREREQ (2, 31)
++/* glibc 2.30 and earlier provided 16-bit mode field instead of 32-bit
++ on many architectures. */
+ CHECK_SIZE_AND_OFFSET(ipc_perm, mode);
+ #endif
+
+diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
+--- a/lib/sanitizer_common/sanitizer_platform_limits_posix.h
++++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.h
+@@ -203,28 +203,15 @@ namespace __sanitizer {
+ u64 __unused1;
+ u64 __unused2;
+ #elif defined(__sparc__)
+-#if defined(__arch64__)
+- unsigned mode;
+- unsigned short __pad1;
+-#else
+- unsigned short __pad1;
+- unsigned short mode;
+- unsigned short __pad2;
+-#endif
+- unsigned short __seq;
+- unsigned long long __unused1;
+- unsigned long long __unused2;
+-#elif defined(__mips__) || defined(__aarch64__) || defined(__s390x__)
+- unsigned int mode;
+- unsigned short __seq;
+- unsigned short __pad1;
+- unsigned long __unused1;
+- unsigned long __unused2;
++ unsigned mode;
++ unsigned short __pad2;
++ unsigned short __seq;
++ unsigned long long __unused1;
++ unsigned long long __unused2;
+ #else
+- unsigned short mode;
+- unsigned short __pad1;
+- unsigned short __seq;
+- unsigned short __pad2;
++ unsigned int mode;
++ unsigned short __seq;
++ unsigned short __pad2;
+ #if defined(__x86_64__) && !defined(_LP64)
+ u64 __unused1;
+ u64 __unused2;
diff --git a/gnu/packages/patches/cmake-curl-certificates.patch b/gnu/packages/patches/cmake-curl-certificates.patch
index 36252083f8..7fe2615271 100644
--- a/gnu/packages/patches/cmake-curl-certificates.patch
+++ b/gnu/packages/patches/cmake-curl-certificates.patch
@@ -6,19 +6,19 @@ as well as /etc/ssl/certs.
--- cmake-3.13.1/Source/cmCurl.cxx 2019-09-10 17:27:36.926907260 +0200
+++ cmake-3.13.1/Source/cmCurl.cxx 2019-09-10 17:52:35.475903919 +0200
-@@ -4,11 +4,8 @@
-
- #include "cmThirdParty.h"
+@@ -2,11 +2,8 @@
+ file Copyright.txt or https://cmake.org/licensing for details. */
+ #include "cmCurl.h"
-#if !defined(CMAKE_USE_SYSTEM_CURL) && !defined(_WIN32) && \
- !defined(__APPLE__) && !defined(CURL_CA_BUNDLE) && !defined(CURL_CA_PATH)
# define CMAKE_FIND_CAFILE
# include "cmSystemTools.h"
-#endif
+ #include "cmStringAlgorithms.h"
// curl versions before 7.21.5 did not provide this error code
- #if defined(LIBCURL_VERSION_NUM) && LIBCURL_VERSION_NUM < 0x071505
-@@ -29,6 +26,19 @@ std::string cmCurlSetCAInfo(::CURL* curl
+@@ -30,6 +27,19 @@
::CURLcode res = ::curl_easy_setopt(curl, CURLOPT_CAINFO, cafile);
check_curl_result(res, "Unable to set TLS/SSL Verify CAINFO: ");
}
diff --git a/gnu/packages/patches/collectd-5.11.0-noinstallvar.patch b/gnu/packages/patches/collectd-5.11.0-noinstallvar.patch
new file mode 100644
index 0000000000..39cd9c763e
--- /dev/null
+++ b/gnu/packages/patches/collectd-5.11.0-noinstallvar.patch
@@ -0,0 +1,21 @@
+Disable creation of /var and /etc
+
+--- a/Makefile.am 2020-03-08 16:57:09.511535600 +0100
++++ b/Makefile.am 2020-04-21 11:36:49.827182272 +0200
+@@ -2376,16 +2376,6 @@
+ endif
+
+ install-exec-hook:
+- $(mkinstalldirs) $(DESTDIR)$(localstatedir)/run
+- $(mkinstalldirs) $(DESTDIR)$(localstatedir)/lib/$(PACKAGE_NAME)
+- $(mkinstalldirs) $(DESTDIR)$(localstatedir)/log
+- $(mkinstalldirs) $(DESTDIR)$(sysconfdir)
+- if test -e $(DESTDIR)$(sysconfdir)/collectd.conf; \
+- then \
+- $(INSTALL) -m 0640 $(builddir)/src/collectd.conf $(DESTDIR)$(sysconfdir)/collectd.conf.pkg-orig; \
+- else \
+- $(INSTALL) -m 0640 $(builddir)/src/collectd.conf $(DESTDIR)$(sysconfdir)/collectd.conf; \
+- fi; \
+ $(mkinstalldirs) $(DESTDIR)$(cpkgdatadir)
+ $(INSTALL) -m 0644 $(srcdir)/src/types.db $(DESTDIR)$(cpkgdatadir)/types.db;
+ $(INSTALL) -m 0644 $(srcdir)/src/postgresql_default.conf \
diff --git a/gnu/packages/patches/coreutils-ls.patch b/gnu/packages/patches/coreutils-ls.patch
new file mode 100644
index 0000000000..59cbbf00b5
--- /dev/null
+++ b/gnu/packages/patches/coreutils-ls.patch
@@ -0,0 +1,117 @@
+Patch taken from upstream to fix cross-compilation for aarch64. This can be
+removed on the next coreutils release.
+
+From 10fcb97bd728f09d4a027eddf8ad2900f0819b0a Mon Sep 17 00:00:00 2001
+From: Paul Eggert <eggert@cs.ucla.edu>
+Date: Thu, 5 Mar 2020 17:25:29 -0800
+Subject: [PATCH] ls: restore 8.31 behavior on removed directories
+
+* NEWS: Mention this.
+* src/ls.c: Do not include <sys/sycall.h>
+(print_dir): Don't worry about whether the directory is removed.
+* tests/ls/removed-directory.sh: Adjust to match new (i.e., old)
+behavior.
+---
+ NEWS | 6 ++++++
+ src/ls.c | 22 ----------------------
+ tests/ls/removed-directory.sh | 10 ++--------
+ 3 files changed, 8 insertions(+), 30 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index fdc8bf5db..653e7178b 100644
+--- a/NEWS
++++ b/NEWS
+@@ -2,6 +2,12 @@ GNU coreutils NEWS -*- outline -*-
+
+ * Noteworthy changes in release ?.? (????-??-??) [?]
+
++** Changes in behavior
++
++ On GNU/Linux systems, ls no longer issues an error message on
++ directory merely because it was removed. This reverts a change
++ that was made in release 8.32.
++
+
+ * Noteworthy changes in release 8.32 (2020-03-05) [stable]
+
+diff --git a/src/ls.c b/src/ls.c
+index 24b983287..4acf5f44d 100644
+--- a/src/ls.c
++++ b/src/ls.c
+@@ -49,10 +49,6 @@
+ # include <sys/ptem.h>
+ #endif
+
+-#ifdef __linux__
+-# include <sys/syscall.h>
+-#endif
+-
+ #include <stdio.h>
+ #include <assert.h>
+ #include <setjmp.h>
+@@ -2896,7 +2892,6 @@ print_dir (char const *name, char const *realname, bool command_line_arg)
+ struct dirent *next;
+ uintmax_t total_blocks = 0;
+ static bool first = true;
+- bool found_any_entries = false;
+
+ errno = 0;
+ dirp = opendir (name);
+@@ -2972,7 +2967,6 @@ print_dir (char const *name, char const *realname, bool command_line_arg)
+ next = readdir (dirp);
+ if (next)
+ {
+- found_any_entries = true;
+ if (! file_ignored (next->d_name))
+ {
+ enum filetype type = unknown;
+@@ -3018,22 +3012,6 @@ print_dir (char const *name, char const *realname, bool command_line_arg)
+ if (errno != EOVERFLOW)
+ break;
+ }
+-#ifdef __linux__
+- else if (! found_any_entries)
+- {
+- /* If readdir finds no directory entries at all, not even "." or
+- "..", then double check that the directory exists. */
+- if (syscall (SYS_getdents, dirfd (dirp), NULL, 0) == -1
+- && errno != EINVAL)
+- {
+- /* We exclude EINVAL as that pertains to buffer handling,
+- and we've passed NULL as the buffer for simplicity.
+- ENOENT is returned if appropriate before buffer handling. */
+- file_failure (command_line_arg, _("reading directory %s"), name);
+- }
+- break;
+- }
+-#endif
+ else
+ break;
+
+diff --git a/tests/ls/removed-directory.sh b/tests/ls/removed-directory.sh
+index e8c835dab..fe8f929a1 100755
+--- a/tests/ls/removed-directory.sh
++++ b/tests/ls/removed-directory.sh
+@@ -26,20 +26,14 @@ case $host_triplet in
+ *) skip_ 'non linux kernel' ;;
+ esac
+
+-LS_FAILURE=2
+-
+-cat <<\EOF >exp-err || framework_failure_
+-ls: reading directory '.': No such file or directory
+-EOF
+-
+ cwd=$(pwd)
+ mkdir d || framework_failure_
+ cd d || framework_failure_
+ rmdir ../d || framework_failure_
+
+-returns_ $LS_FAILURE ls >../out 2>../err || fail=1
++ls >../out 2>../err || fail=1
+ cd "$cwd" || framework_failure_
+ compare /dev/null out || fail=1
+-compare exp-err err || fail=1
++compare /dev/null err || fail=1
+
+ Exit $fail
diff --git a/gnu/packages/patches/curl-use-ssl-cert-env.patch b/gnu/packages/patches/curl-use-ssl-cert-env.patch
new file mode 100644
index 0000000000..c8e80b4445
--- /dev/null
+++ b/gnu/packages/patches/curl-use-ssl-cert-env.patch
@@ -0,0 +1,64 @@
+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_ORIG], 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))
++ 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/cyrus-sasl-ac-try-run-fix.patch b/gnu/packages/patches/cyrus-sasl-ac-try-run-fix.patch
new file mode 100644
index 0000000000..8662e812e9
--- /dev/null
+++ b/gnu/packages/patches/cyrus-sasl-ac-try-run-fix.patch
@@ -0,0 +1,12 @@
+--- a/m4/sasl2.m4 2018-11-18 22:33:29.902625600 +0300
++++ b/m4/sasl2.m4 2018-11-18 22:33:59.828746176 +0300
+@@ -339,7 +339,8 @@
+ ],
+ [ AC_DEFINE(HAVE_GSS_SPNEGO,,[Define if your GSSAPI implementation supports SPNEGO])
+ AC_MSG_RESULT(yes) ],
+- AC_MSG_RESULT(no))
++ AC_MSG_RESULT(no),
++ AC_MSG_RESULT(no))
+ LIBS="$cmu_save_LIBS"
+
+ else
diff --git a/gnu/packages/patches/datefudge-gettimeofday.patch b/gnu/packages/patches/datefudge-gettimeofday.patch
new file mode 100644
index 0000000000..11c7640869
--- /dev/null
+++ b/gnu/packages/patches/datefudge-gettimeofday.patch
@@ -0,0 +1,13 @@
+Add the 'restrict' qualifier to match the 'gettimeofday' declaration found
+in glibc 2.31.
+
+--- datefudge-1.23/datefudge.c 2020-02-17 22:35:21.343341725 +0100
++++ datefudge-1.23/datefudge.c 2020-02-17 22:35:49.619117874 +0100
+@@ -78,6 +78,6 @@
+ return 0;
+ }
+
+-int gettimeofday(struct timeval *x, struct timezone *y) {
++int gettimeofday(struct timeval *restrict x, void *restrict y) {
+ return __gettimeofday(x,y);
+ }
diff --git a/gnu/packages/patches/dconf-meson-0.52.patch b/gnu/packages/patches/dconf-meson-0.52.patch
new file mode 100644
index 0000000000..c636edc108
--- /dev/null
+++ b/gnu/packages/patches/dconf-meson-0.52.patch
@@ -0,0 +1,19 @@
+Fix build failure with Meson 0.52.
+
+Taken from upstream:
+https://gitlab.gnome.org/GNOME/dconf/commit/7ad890fb7a2ec90a777a756a1fa20a615ec7245e
+https://gitlab.gnome.org/GNOME/dconf/merge_requests/54
+
+diff --git a/client/meson.build b/client/meson.build
+index f3b7122cb05bfa7bb481c487e3cd052aa1ad58e5..de6387e2cac2aba12b83f2614c277bada434fd16 100644
+--- a/client/meson.build
++++ b/client/meson.build
+@@ -28,7 +28,7 @@ libdconf_client = static_library(
+
+ libdconf_client_dep = declare_dependency(
+ dependencies: gio_dep,
+- link_whole: libdconf_client,
++ link_with: libdconf_client,
+ )
+
+ libdconf = shared_library(
diff --git a/gnu/packages/patches/doxygen-1.8.17-runtests.patch b/gnu/packages/patches/doxygen-1.8.17-runtests.patch
new file mode 100644
index 0000000000..0340c72448
--- /dev/null
+++ b/gnu/packages/patches/doxygen-1.8.17-runtests.patch
@@ -0,0 +1,73 @@
+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
index 8ccb9ec3c4..1c0d4eb946 100644
--- a/gnu/packages/patches/doxygen-test.patch
+++ b/gnu/packages/patches/doxygen-test.patch
@@ -5,19 +5,40 @@ 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,17 +6,6 @@
+@@ -6,38 +6,6 @@
<briefdescription>
</briefdescription>
<detaileddescription>
- <para>
- <variablelist>
- <varlistentry>
-- <term><anchor id="citelist_1CITEREF_knuth79"/>[1]</term>
+- <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>
@@ -26,13 +47,14 @@ diff -u -r doxygen-1.8.7.orig/testing/012/citelist.xml doxygen-1.8.7/testing/012
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
-@@ -4,7 +4,7 @@
- <compoundname>index</compoundname>
- <title>My Project</title>
+@@ -6,8 +6,8 @@
+ <briefdescription>
+ </briefdescription>
<detaileddescription>
-- <para>See <ref refid="citelist_1CITEREF_knuth79" kindref="member">[1]</ref> for more info. </para>
-+ <para>See knuth79 for more info. </para>
+- <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/evolution-data-server-libical-compat.patch b/gnu/packages/patches/evolution-data-server-libical-compat.patch
index a988519ea0..da4302d42e 100644
--- a/gnu/packages/patches/evolution-data-server-libical-compat.patch
+++ b/gnu/packages/patches/evolution-data-server-libical-compat.patch
@@ -8,29 +8,29 @@ 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
-@@ -108,7 +108,7 @@
+@@ -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_minimum_version 2.0)
-+set(libical_minimum_version 3.0.7)
+-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 7501f2a43dcc3af91e93e89751caf76e77c2ac23..93f4806ba2c5193f746e9fae5bf74d08ad05f8bf 100644
+index 7501f2a43..93f4806ba 100644
--- a/src/calendar/libedata-cal/e-cal-meta-backend.c
+++ b/src/calendar/libedata-cal/e-cal-meta-backend.c
-@@ -3958,9 +3958,8 @@
+@@ -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 = icalattach_new_from_data (base64, NULL, NULL);
-+ new_attach = icalattach_new_from_data (base64, (GFunc) g_free, NULL);
+- 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/extempore-unbundle-external-dependencies.patch b/gnu/packages/patches/extempore-unbundle-external-dependencies.patch
new file mode 100644
index 0000000000..e9484f7994
--- /dev/null
+++ b/gnu/packages/patches/extempore-unbundle-external-dependencies.patch
@@ -0,0 +1,140 @@
+Remove build machinery for bundled dependencies.
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 89e6125e..c5e90750 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -36,7 +36,7 @@ endif()
+ if(PACKAGE)
+ # this needs to be set before project() is called
+ set(CMAKE_OSX_DEPLOYMENT_TARGET 10.12)
+- set(ASSETS ON) # necessary for packaging
++ set(ASSETS OFF) # necessary for packaging
+ message(STATUS "Building Extempore for binary distribution (assets directory will be downloaded)")
+ endif()
+
+@@ -134,71 +134,6 @@ else()
+ message(FATAL_ERROR "Sorry, Extempore isn't supported on this platform - macOS, Linux & Windows only.")
+ endif()
+
+-########
+-# PCRE #
+-########
+-
+-# current in-tree PCRE version: 8.38
+-
+-add_library(pcre STATIC
+- # headers
+- src/pcre/config.h
+- src/pcre/pcre.h
+- src/pcre/ucp.h
+- # source files
+- src/pcre/pcre_chartables.c
+- src/pcre/pcre_compile.c
+- src/pcre/pcre_exec.c
+- src/pcre/pcre_globals.c
+- src/pcre/pcre_internal.h
+- src/pcre/pcre_newline.c
+- src/pcre/pcre_tables.c
+- )
+-
+-target_compile_definitions(pcre
+- PRIVATE -DHAVE_CONFIG_H
+- )
+-
+-if(PACKAGE)
+- target_compile_options(pcre
+- PRIVATE -mtune=generic)
+-endif()
+-
+-#############
+-# portaudio #
+-#############
+-
+-add_library(portaudio STATIC
+- src/portaudio/src/common/pa_allocation.c
+- src/portaudio/src/common/pa_allocation.h
+- src/portaudio/src/common/pa_converters.c
+- src/portaudio/src/common/pa_converters.h
+- src/portaudio/src/common/pa_cpuload.c
+- src/portaudio/src/common/pa_cpuload.h
+- src/portaudio/src/common/pa_debugprint.c
+- src/portaudio/src/common/pa_debugprint.h
+- src/portaudio/src/common/pa_dither.c
+- src/portaudio/src/common/pa_dither.h
+- src/portaudio/src/common/pa_endianness.h
+- src/portaudio/src/common/pa_front.c
+- src/portaudio/src/common/pa_hostapi.h
+- src/portaudio/src/common/pa_memorybarrier.h
+- src/portaudio/src/common/pa_process.c
+- src/portaudio/src/common/pa_process.h
+- src/portaudio/src/common/pa_ringbuffer.c
+- src/portaudio/src/common/pa_ringbuffer.h
+- src/portaudio/src/common/pa_stream.c
+- src/portaudio/src/common/pa_stream.h
+- src/portaudio/src/common/pa_trace.c
+- src/portaudio/src/common/pa_trace.h
+- src/portaudio/src/common/pa_types.h
+- src/portaudio/src/common/pa_util.h
+- )
+-
+-target_include_directories(portaudio
+- PRIVATE src/portaudio/include
+- PRIVATE src/portaudio/src/common)
+-
+ # platform-specific
+
+ if(APPLE)
+@@ -224,25 +159,8 @@ if(APPLE)
+
+ elseif(UNIX AND NOT APPLE)
+ # use ALSA on Linux
+- target_sources(portaudio
+- PRIVATE src/portaudio/src/hostapi/alsa/pa_linux_alsa.c
+- PRIVATE src/portaudio/src/os/unix/pa_unix_hostapis.c
+- PRIVATE src/portaudio/src/os/unix/pa_unix_util.c
+- )
+- target_include_directories(portaudio
+- PRIVATE src/portaudio/src/os/unix)
+- target_compile_definitions(portaudio
+- PRIVATE -DPA_USE_ALSA)
+- target_link_libraries(portaudio
+- PRIVATE asound)
+
+ if(JACK)
+- target_sources(portaudio
+- PRIVATE src/portaudio/src/hostapi/jack/pa_jack.c)
+- target_compile_definitions(portaudio
+- PRIVATE -DPA_USE_JACK)
+- target_link_libraries(portaudio
+- PRIVATE jack)
+ endif()
+
+ elseif(WIN32)
+@@ -292,8 +210,6 @@ if(ASIO)
+ endif()
+
+ if(PACKAGE)
+- target_compile_options(portaudio
+- PRIVATE -mtune=generic)
+ endif()
+
+ ##############
+@@ -411,8 +327,6 @@ endif()
+
+ # dependencies
+
+-add_dependencies(extempore pcre portaudio)
+-
+ if(BUILD_LLVM)
+ if(WIN32)
+ add_dependencies(extempore LLVM-install)
+@@ -553,7 +467,7 @@ else()
+ install(TARGETS extempore
+ RUNTIME
+ DESTINATION ".")
+- install(DIRECTORY assets runtime libs examples tests
++ install(DIRECTORY runtime libs examples
+ DESTINATION "."
+ PATTERN ".DS_Store" EXCLUDE)
+ endif()
diff --git a/gnu/packages/patches/fifengine-swig-compat.patch b/gnu/packages/patches/fifengine-swig-compat.patch
new file mode 100644
index 0000000000..85cd05f835
--- /dev/null
+++ b/gnu/packages/patches/fifengine-swig-compat.patch
@@ -0,0 +1,17 @@
+Fix build failure when using Swig 4.
+
+Taken from upstream:
+https://github.com/fifengine/fifengine/commit/d14f232f4cd9a00b05d6872957070e8c020f515d
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -893,7 +893,7 @@ if(build-python)
+ find_package(PythonLibs ${PYTHON_VERSION_STRING} EXACT)
+ include_directories(${PYTHON_INCLUDE_PATH})
+
+- set(CMAKE_SWIG_FLAGS -modern -fastdispatch -dirvtable -nosafecstrings -noproxydel -fastproxy -fastinit -fastunpack -fastquery -modernargs -nobuildnone -keyword -w511 -w473 -w404 -w314)
++ set(CMAKE_SWIG_FLAGS -modern -fastdispatch -dirvtable -noproxydel -fastproxy -fastinit -fastunpack -fastquery -modernargs -keyword -w511 -w473 -w404 -w314)
+
+ set_source_files_properties("${PROJECT_BINARY_DIR}/fife.i" PROPERTIES CPLUSPLUS ON)
+ set(FIFE_SOURCES ${FIFE_CORE_SRC})
diff --git a/gnu/packages/patches/file-CVE-2018-10360.patch b/gnu/packages/patches/file-CVE-2018-10360.patch
deleted file mode 100644
index 9285611c04..0000000000
--- a/gnu/packages/patches/file-CVE-2018-10360.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-https://github.com/file/file/commit/a642587a9c9e2dd7feacdf513c3643ce26ad3c22.patch
-The leading part of the patch starting at line 27 was trimmed off.
-This patch should be OK to drop with file@5.35.
-
-From a642587a9c9e2dd7feacdf513c3643ce26ad3c22 Mon Sep 17 00:00:00 2001
-From: Christos Zoulas <christos@zoulas.com>
-Date: Sat, 9 Jun 2018 16:00:06 +0000
-Subject: [PATCH] Avoid reading past the end of buffer (Rui Reis)
-
----
- src/readelf.c | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
-
-diff --git a/src/readelf.c b/src/readelf.c
-index 79c83f9f5..1f41b4611 100644
---- a/src/readelf.c
-+++ b/src/readelf.c
-@@ -842,7 +842,8 @@ do_core_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type,
-
- cname = (unsigned char *)
- &nbuf[doff + prpsoffsets(i)];
-- for (cp = cname; *cp && isprint(*cp); cp++)
-+ for (cp = cname; cp < nbuf + size && *cp
-+ && isprint(*cp); cp++)
- continue;
- /*
- * Linux apparently appends a space at the end
diff --git a/gnu/packages/patches/findutils-gnulib-libio.patch b/gnu/packages/patches/findutils-gnulib-libio.patch
deleted file mode 100644
index 79f9fd914d..0000000000
--- a/gnu/packages/patches/findutils-gnulib-libio.patch
+++ /dev/null
@@ -1,114 +0,0 @@
-Adjust to removal of libio interface in glibc 2.28.
-
-Based on this gnulib commit:
-https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=4af4a4a71827c0bc5e0ec67af23edef4f15cee8e
-
-diff --git a/gl/lib/fflush.c b/gl/lib/fflush.c
-index 5ae3e41..7a82470 100644
---- a/gl/lib/fflush.c
-+++ b/gl/lib/fflush.c
-@@ -33,7 +33,7 @@
- #undef fflush
-
-
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-
- /* Clear the stream's ungetc buffer, preserving the value of ftello (fp). */
- static void
-@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
-
- #endif
-
--#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
-+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
-
- # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
- /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
-@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
- if (stream == NULL || ! freading (stream))
- return fflush (stream);
-
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-
- clear_ungetc_buffer_preserving_position (stream);
-
-diff --git a/gl/lib/fpurge.c b/gl/lib/fpurge.c
-index f313b22..ecdf82d 100644
---- a/gl/lib/fpurge.c
-+++ b/gl/lib/fpurge.c
-@@ -62,7 +62,7 @@ fpurge (FILE *fp)
- /* Most systems provide FILE as a struct and the necessary bitmask in
- <stdio.h>, because they need it for implementing getc() and putc() as
- fast macros. */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- fp->_IO_read_end = fp->_IO_read_ptr;
- fp->_IO_write_ptr = fp->_IO_write_base;
- /* Avoid memory leak when there is an active ungetc buffer. */
-diff --git a/gl/lib/freadahead.c b/gl/lib/freadahead.c
-index 094daab..3f8101e 100644
---- a/gl/lib/freadahead.c
-+++ b/gl/lib/freadahead.c
-@@ -25,7 +25,7 @@
- size_t
- freadahead (FILE *fp)
- {
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- if (fp->_IO_write_ptr > fp->_IO_write_base)
- return 0;
- return (fp->_IO_read_end - fp->_IO_read_ptr)
-diff --git a/gl/lib/freading.c b/gl/lib/freading.c
-index 0512b19..8c48fe4 100644
---- a/gl/lib/freading.c
-+++ b/gl/lib/freading.c
-@@ -31,7 +31,7 @@ freading (FILE *fp)
- /* Most systems provide FILE as a struct and the necessary bitmask in
- <stdio.h>, because they need it for implementing getc() and putc() as
- fast macros. */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- return ((fp->_flags & _IO_NO_WRITES) != 0
- || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
- && fp->_IO_read_base != NULL));
-diff --git a/gl/lib/fseeko.c b/gl/lib/fseeko.c
-index 1c65d2a..9026408 100644
---- a/gl/lib/fseeko.c
-+++ b/gl/lib/fseeko.c
-@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence)
- #endif
-
- /* These tests are based on fpurge.c. */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- if (fp->_IO_read_end == fp->_IO_read_ptr
- && fp->_IO_write_ptr == fp->_IO_write_base
- && fp->_IO_save_base == NULL)
-@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence)
- return -1;
- }
-
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- fp->_flags &= ~_IO_EOF_SEEN;
- fp->_offset = pos;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-diff --git a/gl/lib/stdio-impl.h b/gl/lib/stdio-impl.h
-index 502d891..ea38ee2 100644
---- a/gl/lib/stdio-impl.h
-+++ b/gl/lib/stdio-impl.h
-@@ -18,6 +18,12 @@
- the same implementation of stdio extension API, except that some fields
- have different naming conventions, or their access requires some casts. */
-
-+/* Glibc 2.28 made _IO_IN_BACKUP private. For now, work around this
-+ problem by defining it ourselves. FIXME: Do not rely on glibc
-+ internals. */
-+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
-+# define _IO_IN_BACKUP 0x100
-+#endif
-
- /* BSD stdio derived implementations. */
-
diff --git a/gnu/packages/patches/findutils-makedev.patch b/gnu/packages/patches/findutils-makedev.patch
deleted file mode 100644
index 2f16c625d8..0000000000
--- a/gnu/packages/patches/findutils-makedev.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-Include <sys/sysmacros.h> for "makedev".
-
-Taken from this gnulib commit:
-https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=4da63c5881f60f71999a943612da9112232b9161
-
-diff --git a/gl/lib/mountlist.c b/gl/lib/mountlist.c
-index bb4e4ee21..cf4020e2a 100644
---- a/gl/lib/mountlist.c
-+++ b/gl/lib/mountlist.c
-@@ -37,6 +37,12 @@
- # include <sys/param.h>
- #endif
-
-+#if MAJOR_IN_MKDEV
-+# include <sys/mkdev.h>
-+#elif MAJOR_IN_SYSMACROS
-+# include <sys/sysmacros.h>
-+#endif
-+
- #if defined MOUNTED_GETFSSTAT /* OSF_1 and Darwin1.3.x */
- # if HAVE_SYS_UCRED_H
- # include <grp.h> /* needed on OSF V4.0 for definition of NGROUPS,
diff --git a/gnu/packages/patches/findutils-test-rwlock-threads.patch b/gnu/packages/patches/findutils-test-rwlock-threads.patch
new file mode 100644
index 0000000000..3062577c21
--- /dev/null
+++ b/gnu/packages/patches/findutils-test-rwlock-threads.patch
@@ -0,0 +1,38 @@
+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/findutils-test-xargs.patch b/gnu/packages/patches/findutils-test-xargs.patch
deleted file mode 100644
index 10c7bed28d..0000000000
--- a/gnu/packages/patches/findutils-test-xargs.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-This test relies on 'xargs' being available in $PATH, which is not
-the case when we build the initial Findutils doing bootstrapping.
-Reported at <https://savannah.gnu.org/bugs/index.php?46786>.
-
---- findutils-4.6.0/find/testsuite/sv-34976-execdir-fd-leak.sh 2015-12-31 19:37:59.401526288 +0100
-+++ findutils-4.6.0/find/testsuite/sv-34976-execdir-fd-leak.sh 2015-12-31 19:38:36.061770693 +0100
-@@ -50,13 +50,14 @@ die() {
- # Create test files, each 98 in the directories ".", "one" and "two".
- make_test_data() {
- d="$1"
-+ xargs="`cd ../../xargs; pwd -P`/xargs"
- (
- cd "$1" || exit 1
- mkdir one two || exit 1
- for i in ${three_to_hundred} ; do
- printf "./%03d one/%03d two/%03d " $i $i $i
- done \
-- | xargs touch || exit 1
-+ | "$xargs" touch || exit 1
- ) \
- || die "failed to set up the test in ${outdir}"
- }
diff --git a/gnu/packages/patches/fontconfig-hurd-path-max.patch b/gnu/packages/patches/fontconfig-hurd-path-max.patch
new file mode 100644
index 0000000000..f804e6801f
--- /dev/null
+++ b/gnu/packages/patches/fontconfig-hurd-path-max.patch
@@ -0,0 +1,17 @@
+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/fribidi-CVE-2019-18397.patch b/gnu/packages/patches/fribidi-CVE-2019-18397.patch
deleted file mode 100644
index aff1a669b2..0000000000
--- a/gnu/packages/patches/fribidi-CVE-2019-18397.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-https://github.com/fribidi/fribidi/commit/034c6e9a1d296286305f4cfd1e0072b879f52568.patch
-
-From 034c6e9a1d296286305f4cfd1e0072b879f52568 Mon Sep 17 00:00:00 2001
-From: Dov Grobgeld <dov.grobgeld@gmail.com>
-Date: Thu, 24 Oct 2019 09:37:29 +0300
-Subject: [PATCH] Truncate isolate_level to FRIBIDI_BIDI_MAX_EXPLICIT_LEVEL
-
----
- lib/fribidi-bidi.c | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/lib/fribidi-bidi.c b/lib/fribidi-bidi.c
-index 6c84392..d384878 100644
---- a/lib/fribidi-bidi.c
-+++ b/lib/fribidi-bidi.c
-@@ -747,7 +747,9 @@ fribidi_get_par_embedding_levels_ex (
- }
-
- RL_LEVEL (pp) = level;
-- RL_ISOLATE_LEVEL (pp) = isolate_level++;
-+ RL_ISOLATE_LEVEL (pp) = isolate_level;
-+ if (isolate_level < FRIBIDI_BIDI_MAX_EXPLICIT_LEVEL-1)
-+ isolate_level++;
- base_level_per_iso_level[isolate_level] = new_level;
-
- if (!FRIBIDI_IS_NEUTRAL (override))
diff --git a/gnu/packages/patches/gcc-4.9-libsanitizer-mode-size.patch b/gnu/packages/patches/gcc-4.9-libsanitizer-mode-size.patch
new file mode 100644
index 0000000000..7df22c21aa
--- /dev/null
+++ b/gnu/packages/patches/gcc-4.9-libsanitizer-mode-size.patch
@@ -0,0 +1,52 @@
+Fix assertion failure in libsanitizer when using glibc 2.31 and later.
+
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92154
+https://reviews.llvm.org/D69104
+
+Adapted from these upstream revision:
+
+https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=277981
+https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=279653
+
+diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
+index 196eb3b3c64..b588e07e5ab 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
++++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
+@@ -928,7 +928,11 @@ CHECK_SIZE_AND_OFFSET(ipc_perm, uid);
+ CHECK_SIZE_AND_OFFSET(ipc_perm, gid);
+ CHECK_SIZE_AND_OFFSET(ipc_perm, cuid);
+ CHECK_SIZE_AND_OFFSET(ipc_perm, cgid);
++#if !SANITIZER_LINUX || __GLIBC_PREREQ (2, 31)
++/* glibc 2.30 and earlier provided 16-bit mode field instead of 32-bit
++ on many architectures. */
+ CHECK_SIZE_AND_OFFSET(ipc_perm, mode);
++#endif
+ CHECK_SIZE_AND_OFFSET(ipc_perm, __seq);
+
+ CHECK_TYPE_SIZE(shmid_ds);
+diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
+index aec950454b3..6d94fc65c28 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
++++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
+@@ -154,20 +154,13 @@ namespace __sanitizer {
+ u64 __unused1;
+ u64 __unused2;
+ #elif defined(__sparc__)
+-# if defined(__arch64__)
+ unsigned mode;
+- unsigned short __pad1;
+-# else
+- unsigned short __pad1;
+- unsigned short mode;
+ unsigned short __pad2;
+-# endif
+ unsigned short __seq;
+ unsigned long long __unused1;
+ unsigned long long __unused2;
+ #else
+- unsigned short mode;
+- unsigned short __pad1;
++ unsigned int mode;
+ unsigned short __seq;
+ unsigned short __pad2;
+ #if defined(__x86_64__) && !defined(_LP64)
diff --git a/gnu/packages/patches/gcc-5-hurd.patch b/gnu/packages/patches/gcc-5-hurd.patch
new file mode 100644
index 0000000000..ae66424243
--- /dev/null
+++ b/gnu/packages/patches/gcc-5-hurd.patch
@@ -0,0 +1,63 @@
+This patch is needed to build gcc-5.5.0 on the Hurd.
+
+Backported from upstream: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=6cd9cb89ebdc1e1394b81c4a418c2b3b0eb86c57
+
+commit b590b96ebc3f5b42a4829170e069722dd940e2543
+Author: jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Sat May 9 04:50:23 2015 +0000
+
+ * src/c++98/Makefile.am (AM_CXXFLAGS): Add -std=gnu++98.
+ * src/c++98/Makefile.in: Regenerate.
+ * src/Makefile.am (AM_CXXFLAGS): Add -std=gnu++98.
+ * src/Makefile.in: Regenerate.
+
+ git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222964 138bc75d-0d04-0410-961f-82ee72b054a4
+
+diff --git a/libstdc++-v3/src/Makefile.am b/libstdc++-v3/src/Makefile.am
+index a5f48b22c6d..cd07ccd81bc 100644
+--- a/libstdc++-v3/src/Makefile.am
++++ b/libstdc++-v3/src/Makefile.am
+@@ -168,6 +168,7 @@ compatibility-condvar.o: compatibility-condvar.cc
+ # OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
+ # as the occasion calls for it.
+ AM_CXXFLAGS = \
++ -std=gnu++98 \
+ $(glibcxx_compiler_pic_flag) \
+ $(XTEMPLATE_FLAGS) $(VTV_CXXFLAGS) \
+ $(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS)
+diff --git a/libstdc++-v3/src/Makefile.in b/libstdc++-v3/src/Makefile.in
+index 433f9ea121a..31b56282e26 100644
+--- a/libstdc++-v3/src/Makefile.in
++++ b/libstdc++-v3/src/Makefile.in
+@@ -429,6 +429,7 @@ libstdc___la_LINK = $(CXXLINK) $(libstdc___la_LDFLAGS)
+ # OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
+ # as the occasion calls for it.
+ AM_CXXFLAGS = \
++ -std=gnu++98 \
+ $(glibcxx_compiler_pic_flag) \
+ $(XTEMPLATE_FLAGS) $(VTV_CXXFLAGS) \
+ $(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS)
+diff --git a/libstdc++-v3/src/c++98/Makefile.am b/libstdc++-v3/src/c++98/Makefile.am
+index e348dfb1205..a5b68a19a8b 100644
+--- a/libstdc++-v3/src/c++98/Makefile.am
++++ b/libstdc++-v3/src/c++98/Makefile.am
+@@ -215,6 +215,7 @@ parallel_settings.o: parallel_settings.cc
+ # OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
+ # as the occasion calls for it.
+ AM_CXXFLAGS = \
++ -std=gnu++98 \
+ $(glibcxx_lt_pic_flag) $(glibcxx_compiler_shared_flag) \
+ $(XTEMPLATE_FLAGS) $(VTV_CXXFLAGS) \
+ $(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS)
+diff --git a/libstdc++-v3/src/c++98/Makefile.in b/libstdc++-v3/src/c++98/Makefile.in
+index 3c69791bb66..ce86136906b 100644
+--- a/libstdc++-v3/src/c++98/Makefile.in
++++ b/libstdc++-v3/src/c++98/Makefile.in
+@@ -421,6 +421,7 @@ PARALLEL_FLAGS = -D_GLIBCXX_PARALLEL
+ # OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
+ # as the occasion calls for it.
+ AM_CXXFLAGS = \
++ -std=gnu++98 \
+ $(glibcxx_lt_pic_flag) $(glibcxx_compiler_shared_flag) \
+ $(XTEMPLATE_FLAGS) $(VTV_CXXFLAGS) \
+ $(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS)
diff --git a/gnu/packages/patches/gcc-6-libsanitizer-mode-size.patch b/gnu/packages/patches/gcc-6-libsanitizer-mode-size.patch
new file mode 100644
index 0000000000..005e3c4079
--- /dev/null
+++ b/gnu/packages/patches/gcc-6-libsanitizer-mode-size.patch
@@ -0,0 +1,53 @@
+Fix assertion failure in libsanitizer when using glibc 2.31 and later.
+
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92154
+https://reviews.llvm.org/D69104
+
+Adapted from these upstream revision:
+
+https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=277981
+https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=279653
+
+diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
+index 069d8d557de..c49c28c6e07 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
++++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
+@@ -1130,8 +1130,9 @@ CHECK_SIZE_AND_OFFSET(ipc_perm, cgid);
+ #ifndef __GLIBC_PREREQ
+ #define __GLIBC_PREREQ(x, y) 0
+ #endif
+-#if !defined(__aarch64__) || !SANITIZER_LINUX || __GLIBC_PREREQ (2, 21)
+-/* On aarch64 glibc 2.20 and earlier provided incorrect mode field. */
++#if !SANITIZER_LINUX || __GLIBC_PREREQ (2, 31)
++/* glibc 2.30 and earlier provided 16-bit mode field instead of 32-bit
++ on many architectures. */
+ CHECK_SIZE_AND_OFFSET(ipc_perm, mode);
+ #endif
+
+diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
+index 304d04e3935..6dee89c97e1 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
++++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
+@@ -207,20 +207,13 @@ namespace __sanitizer {
+ unsigned long __unused1;
+ unsigned long __unused2;
+ #elif defined(__sparc__)
+-# if defined(__arch64__)
+ unsigned mode;
+- unsigned short __pad1;
+-# else
+- unsigned short __pad1;
+- unsigned short mode;
+ unsigned short __pad2;
+-# endif
+ unsigned short __seq;
+ unsigned long long __unused1;
+ unsigned long long __unused2;
+ #else
+- unsigned short mode;
+- unsigned short __pad1;
++ unsigned int mode;
+ unsigned short __seq;
+ unsigned short __pad2;
+ #if defined(__x86_64__) && !defined(_LP64)
+
diff --git a/gnu/packages/patches/gcc-7-cross-toolexeclibdir.patch b/gnu/packages/patches/gcc-7-cross-toolexeclibdir.patch
new file mode 100644
index 0000000000..49982c3474
--- /dev/null
+++ b/gnu/packages/patches/gcc-7-cross-toolexeclibdir.patch
@@ -0,0 +1,1041 @@
+From 46339bdf619b93dfa05d5f004d062671d3dc26d2 Mon Sep 17 00:00:00 2001
+From: Mathieu Othacehe <m.othacehe@gmail.com>
+Date: Tue, 24 Mar 2020 13:50:56 +0100
+Subject: [PATCH] toolexec
+
+---
+ gcc/doc/install.texi | 4 ++++
+ libatomic/configure | 33 ++++++++++++++++++++++---
+ libffi/configure | 33 ++++++++++++++++++++++---
+ libgcc/configure | 38 +++++++++++++++++++++++++++--
+ libgomp/configure | 33 ++++++++++++++++++++++---
+ libhsail-rt/configure | 33 ++++++++++++++++++++++---
+ libitm/configure | 33 ++++++++++++++++++++++---
+ liboffloadmic/configure | 33 ++++++++++++++++++++++---
+ liboffloadmic/plugin/configure | 33 ++++++++++++++++++++++---
+ libquadmath/configure | 33 ++++++++++++++++++++++---
+ libsanitizer/configure | 33 ++++++++++++++++++++++---
+ libssp/configure | 33 ++++++++++++++++++++++---
+ libstdc++-v3/configure | 44 ++++++++++++++++++++++++++--------
+ 13 files changed, 374 insertions(+), 42 deletions(-)
+
+diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
+index 77ba08d3f21..28cb6d88da8 100644
+--- a/gcc/doc/install.texi
++++ b/gcc/doc/install.texi
+@@ -2083,6 +2083,10 @@ shorthand for
+ The following options only apply to building cross compilers.
+
+ @table @code
++@item --with-toolexeclibdir=@var{dir}
++Specify the installation directory for libraries built with a cross compiler.
++The default is @option{$@{gcc_tooldir@}/lib}.
++
+ @item --with-sysroot
+ @itemx --with-sysroot=@var{dir}
+ Tells GCC to consider @var{dir} as the root of a tree that contains
+diff --git a/libatomic/configure b/libatomic/configure
+index 2ae9b8d40f3..0fa531ec4a3 100755
+--- a/libatomic/configure
++++ b/libatomic/configure
+@@ -755,6 +755,7 @@ enable_option_checking
+ enable_version_specific_runtime_libs
+ enable_generated_files_in_srcdir
+ enable_multilib
++with_toolexeclibdir
+ enable_dependency_tracking
+ enable_shared
+ enable_static
+@@ -1414,6 +1415,9 @@ Optional Features:
+ Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
++ --with-toolexeclibdir=DIR
++ install libraries built with a cross compiler within
++ DIR
+ --with-pic try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
+@@ -3185,6 +3189,22 @@ fi
+ ac_config_commands="$ac_config_commands default-1"
+
+
++
++# Check whether --with-toolexeclibdir was given.
++if test "${with_toolexeclibdir+set}" = set; then :
++ withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in
++ /)
++ ;;
++ */)
++ with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
++ ;;
++esac
++else
++ with_toolexeclibdir=no
++fi
++
++
++
+ # Calculate toolexeclibdir
+ # Also toolexecdir, though it's only used in toolexeclibdir
+ case ${enable_version_specific_runtime_libs} in
+@@ -3200,7 +3220,14 @@ case ${enable_version_specific_runtime_libs} in
+ test x"$with_cross_host" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+- toolexeclibdir='$(toolexecdir)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ toolexeclibdir='$(toolexecdir)/lib'
++ ;;
++ *)
++ toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ toolexeclibdir='$(libdir)'
+@@ -11115,7 +11142,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11118 "configure"
++#line 11145 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -11221,7 +11248,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11224 "configure"
++#line 11251 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+diff --git a/libffi/configure b/libffi/configure
+index 790a291011f..6e37039e84c 100755
+--- a/libffi/configure
++++ b/libffi/configure
+@@ -777,6 +777,7 @@ enable_debug
+ enable_structs
+ enable_raw_api
+ enable_purify_safety
++with_toolexeclibdir
+ enable_symvers
+ with_gcc_major_version_only
+ '
+@@ -1436,6 +1437,9 @@ Optional Packages:
+ --with-pic try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
++ --with-toolexeclibdir=DIR
++ install libraries built with a cross compiler within
++ DIR
+ --with-gcc-major-version-only
+ use only GCC major number in filesystem paths
+
+@@ -11390,7 +11394,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11393 "configure"
++#line 11397 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -11496,7 +11500,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11499 "configure"
++#line 11507 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -16002,10 +16006,33 @@ $as_echo "#define USING_PURIFY 1" >>confdefs.h
+ fi
+
+
++
++# Check whether --with-toolexeclibdir was given.
++if test "${with_toolexeclibdir+set}" = set; then :
++ withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in
++ /)
++ ;;
++ */)
++ with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
++ ;;
++esac
++else
++ with_toolexeclibdir=no
++fi
++
++
++
+ if test -n "$with_cross_host" &&
+ test x"$with_cross_host" != x"no"; then
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+- toolexeclibdir='$(toolexecdir)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ toolexeclibdir='$(toolexecdir)/lib'
++ ;;
++ *)
++ toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ toolexeclibdir='$(libdir)'
+diff --git a/libgcc/configure b/libgcc/configure
+index 441601a1f76..976827dc57e 100644
+--- a/libgcc/configure
++++ b/libgcc/configure
+@@ -669,6 +669,7 @@ enable_shared
+ enable_vtable_verify
+ with_aix_soname
+ enable_version_specific_runtime_libs
++with_toolexeclibdir
+ with_slibdir
+ enable_maintainer_mode
+ with_build_libsubdir
+@@ -1329,6 +1330,9 @@ Optional Packages:
+ --with-aix-soname=aix|svr4|both
+ shared library versioning (aka "SONAME") variant to
+ provide on AIX
++ --with-toolexeclibdir=DIR
++ install libraries built with a cross compiler within
++ DIR
+ --with-slibdir=DIR shared libraries in DIR LIBDIR
+ --with-build-libsubdir=DIR Directory where to find libraries for build system
+ --with-system-libunwind use installed libunwind
+@@ -2403,6 +2407,22 @@ fi
+ $as_echo "$version_specific_libs" >&6; }
+
+
++# Check whether --with-toolexeclibdir was given.
++if test "${with_toolexeclibdir+set}" = set; then :
++ withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in
++ /)
++ ;;
++ */)
++ with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
++ ;;
++esac
++else
++ with_toolexeclibdir=no
++fi
++
++
++
++
+ # Check whether --with-slibdir was given.
+ if test "${with_slibdir+set}" = set; then :
+ withval=$with_slibdir; slibdir="$with_slibdir"
+@@ -2410,7 +2430,14 @@ else
+ if test "${version_specific_libs}" = yes; then
+ slibdir='$(libsubdir)'
+ elif test -n "$with_cross_host" && test x"$with_cross_host" != x"no"; then
+- slibdir='$(exec_prefix)/$(host_noncanonical)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ slibdir='$(exec_prefix)/$(host_noncanonical)/lib'
++ ;;
++ *)
++ slibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ slibdir='$(libdir)'
+ fi
+@@ -2640,7 +2667,14 @@ case ${version_specific_libs} in
+ test x"$with_cross_host" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_noncanonical)'
+- toolexeclibdir='$(toolexecdir)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ toolexeclibdir='$(toolexecdir)/lib'
++ ;;
++ *)
++ toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_noncanonical)'
+ toolexeclibdir='$(libdir)'
+diff --git a/libgomp/configure b/libgomp/configure
+index 06166c66120..6b3beae0f63 100755
+--- a/libgomp/configure
++++ b/libgomp/configure
+@@ -782,6 +782,7 @@ enable_option_checking
+ enable_version_specific_runtime_libs
+ enable_generated_files_in_srcdir
+ enable_multilib
++with_toolexeclibdir
+ enable_dependency_tracking
+ enable_shared
+ enable_static
+@@ -1455,6 +1456,9 @@ Optional Features:
+ Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
++ --with-toolexeclibdir=DIR
++ install libraries built with a cross compiler within
++ DIR
+ --with-pic try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
+@@ -3338,6 +3342,22 @@ fi
+ ac_config_commands="$ac_config_commands default-1"
+
+
++
++# Check whether --with-toolexeclibdir was given.
++if test "${with_toolexeclibdir+set}" = set; then :
++ withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in
++ /)
++ ;;
++ */)
++ with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
++ ;;
++esac
++else
++ with_toolexeclibdir=no
++fi
++
++
++
+ # Calculate toolexeclibdir
+ # Also toolexecdir, though it's only used in toolexeclibdir
+ case ${enable_version_specific_runtime_libs} in
+@@ -3353,7 +3373,14 @@ case ${enable_version_specific_runtime_libs} in
+ test x"$with_cross_host" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+- toolexeclibdir='$(toolexecdir)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ toolexeclibdir='$(toolexecdir)/lib'
++ ;;
++ *)
++ toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ toolexeclibdir='$(libdir)'
+@@ -11155,7 +11182,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11158 "configure"
++#line 11185 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -11261,7 +11288,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11264 "configure"
++#line 11295 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+diff --git a/libhsail-rt/configure b/libhsail-rt/configure
+index a4fcc10c1f9..1b4f2a953d0 100755
+--- a/libhsail-rt/configure
++++ b/libhsail-rt/configure
+@@ -737,6 +737,7 @@ enable_option_checking
+ enable_maintainer_mode
+ enable_dependency_tracking
+ enable_version_specific_runtime_libs
++with_toolexeclibdir
+ enable_shared
+ enable_static
+ with_pic
+@@ -1395,6 +1396,9 @@ Optional Features:
+ Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
++ --with-toolexeclibdir=DIR
++ install libraries built with a cross compiler within
++ DIR
+ --with-pic try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
+@@ -4418,6 +4422,22 @@ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_version_specific_runtime_libs" >&5
+ $as_echo "$enable_version_specific_runtime_libs" >&6; }
+
++
++# Check whether --with-toolexeclibdir was given.
++if test "${with_toolexeclibdir+set}" = set; then :
++ withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in
++ /)
++ ;;
++ */)
++ with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
++ ;;
++esac
++else
++ with_toolexeclibdir=no
++fi
++
++
++
+ # Calculate toolexeclibdir
+ # Also toolexecdir, though it's only used in toolexeclibdir
+ case ${enable_version_specific_runtime_libs} in
+@@ -4433,7 +4453,14 @@ case ${enable_version_specific_runtime_libs} in
+ test x"$with_cross_host" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+- toolexeclibdir='$(toolexecdir)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ toolexeclibdir='$(toolexecdir)/lib'
++ ;;
++ *)
++ toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ toolexeclibdir='$(libdir)'
+@@ -10973,7 +11000,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 10976 "configure"
++#line 11003 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -11079,7 +11106,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11082 "configure"
++#line 11113 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+diff --git a/libitm/configure b/libitm/configure
+index 96c494d4a3f..ed47fab3c83 100644
+--- a/libitm/configure
++++ b/libitm/configure
+@@ -766,6 +766,7 @@ enable_option_checking
+ enable_version_specific_runtime_libs
+ enable_generated_files_in_srcdir
+ enable_multilib
++with_toolexeclibdir
+ enable_dependency_tracking
+ enable_shared
+ enable_static
+@@ -1430,6 +1431,9 @@ Optional Features:
+ Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
++ --with-toolexeclibdir=DIR
++ install libraries built with a cross compiler within
++ DIR
+ --with-pic try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
+@@ -3371,6 +3375,22 @@ fi
+ ac_config_commands="$ac_config_commands default-1"
+
+
++
++# Check whether --with-toolexeclibdir was given.
++if test "${with_toolexeclibdir+set}" = set; then :
++ withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in
++ /)
++ ;;
++ */)
++ with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
++ ;;
++esac
++else
++ with_toolexeclibdir=no
++fi
++
++
++
+ # Calculate toolexeclibdir
+ # Also toolexecdir, though it's only used in toolexeclibdir
+ case ${enable_version_specific_runtime_libs} in
+@@ -3386,7 +3406,14 @@ case ${enable_version_specific_runtime_libs} in
+ test x"$with_cross_host" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+- toolexeclibdir='$(toolexecdir)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ toolexeclibdir='$(toolexecdir)/lib'
++ ;;
++ *)
++ toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ toolexeclibdir='$(libdir)'
+@@ -11794,7 +11821,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11797 "configure"
++#line 11824 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -11900,7 +11927,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11903 "configure"
++#line 11934 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+diff --git a/liboffloadmic/configure b/liboffloadmic/configure
+index f873716991b..6dfe9e37642 100644
+--- a/liboffloadmic/configure
++++ b/liboffloadmic/configure
+@@ -739,6 +739,7 @@ enable_maintainer_mode
+ enable_dependency_tracking
+ enable_multilib
+ enable_version_specific_runtime_libs
++with_toolexeclibdir
+ enable_shared
+ enable_static
+ with_pic
+@@ -1397,6 +1398,9 @@ Optional Features:
+ Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
++ --with-toolexeclibdir=DIR
++ install libraries built with a cross compiler within
++ DIR
+ --with-pic try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
+@@ -5003,6 +5007,22 @@ else
+ fi
+
+
++
++# Check whether --with-toolexeclibdir was given.
++if test "${with_toolexeclibdir+set}" = set; then :
++ withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in
++ /)
++ ;;
++ */)
++ with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
++ ;;
++esac
++else
++ with_toolexeclibdir=no
++fi
++
++
++
+ # Calculate toolexeclibdir.
+ # Also toolexecdir, though it's only used in toolexeclibdir.
+ case ${enable_version_specific_runtime_libs} in
+@@ -5018,7 +5038,14 @@ case ${enable_version_specific_runtime_libs} in
+ test x"$with_cross_host" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+- toolexeclibdir='$(toolexecdir)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ toolexeclibdir='$(toolexecdir)/lib'
++ ;;
++ *)
++ toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ toolexeclibdir='$(libdir)'
+@@ -11108,7 +11135,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11111 "configure"
++#line 11138 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -11214,7 +11241,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11217 "configure"
++#line 11248 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+diff --git a/liboffloadmic/plugin/configure b/liboffloadmic/plugin/configure
+index c031eb3e7fa..570758344b4 100644
+--- a/liboffloadmic/plugin/configure
++++ b/liboffloadmic/plugin/configure
+@@ -735,6 +735,7 @@ enable_maintainer_mode
+ enable_dependency_tracking
+ enable_multilib
+ enable_version_specific_runtime_libs
++with_toolexeclibdir
+ enable_shared
+ enable_static
+ with_pic
+@@ -1394,6 +1395,9 @@ Optional Features:
+ Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
++ --with-toolexeclibdir=DIR
++ install libraries built with a cross compiler within
++ DIR
+ --with-pic try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
+@@ -4311,6 +4315,22 @@ fi
+ $as_echo "$enable_version_specific_runtime_libs" >&6; }
+
+
++
++# Check whether --with-toolexeclibdir was given.
++if test "${with_toolexeclibdir+set}" = set; then :
++ withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in
++ /)
++ ;;
++ */)
++ with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
++ ;;
++esac
++else
++ with_toolexeclibdir=no
++fi
++
++
++
+ # Calculate toolexeclibdir.
+ # Also toolexecdir, though it's only used in toolexeclibdir.
+ case ${enable_version_specific_runtime_libs} in
+@@ -4326,7 +4346,14 @@ case ${enable_version_specific_runtime_libs} in
+ test x"$with_cross_host" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+- toolexeclibdir='$(toolexecdir)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ toolexeclibdir='$(toolexecdir)/lib'
++ ;;
++ *)
++ toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ toolexeclibdir='$(libdir)'
+@@ -10815,7 +10842,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 10818 "configure"
++#line 10845 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -10921,7 +10948,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 10924 "configure"
++#line 10955 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+diff --git a/libquadmath/configure b/libquadmath/configure
+index 76a2c20b7e1..e887071aeb2 100755
+--- a/libquadmath/configure
++++ b/libquadmath/configure
+@@ -749,6 +749,7 @@ enable_fast_install
+ with_gnu_ld
+ enable_libtool_lock
+ enable_maintainer_mode
++with_toolexeclibdir
+ enable_symvers
+ enable_generated_files_in_srcdir
+ with_gcc_major_version_only
+@@ -1408,6 +1409,9 @@ Optional Packages:
+ --with-pic try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
++ --with-toolexeclibdir=DIR
++ install libraries built with a cross compiler within
++ DIR
+ --with-gcc-major-version-only
+ use only GCC major number in filesystem paths
+
+@@ -10572,7 +10576,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 10575 "configure"
++#line 10579 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -10678,7 +10682,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 10681 "configure"
++#line 10689 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -11917,6 +11921,22 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
+ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
++
++# Check whether --with-toolexeclibdir was given.
++if test "${with_toolexeclibdir+set}" = set; then :
++ withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in
++ /)
++ ;;
++ */)
++ with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
++ ;;
++esac
++else
++ with_toolexeclibdir=no
++fi
++
++
++
+ # Calculate toolexeclibdir
+ # Also toolexecdir, though it's only used in toolexeclibdir
+ case ${version_specific_libs} in
+@@ -11932,7 +11952,14 @@ case ${version_specific_libs} in
+ test x"$with_cross_host" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+- toolexeclibdir='$(toolexecdir)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ toolexeclibdir='$(toolexecdir)/lib'
++ ;;
++ *)
++ toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ toolexeclibdir='$(libdir)'
+diff --git a/libsanitizer/configure b/libsanitizer/configure
+index a3a08d635f4..5f4cdcad38d 100755
+--- a/libsanitizer/configure
++++ b/libsanitizer/configure
+@@ -767,6 +767,7 @@ enable_multilib
+ enable_version_specific_runtime_libs
+ enable_dependency_tracking
+ enable_maintainer_mode
++with_toolexeclibdir
+ enable_shared
+ enable_static
+ with_pic
+@@ -1425,6 +1426,9 @@ Optional Features:
+ Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
++ --with-toolexeclibdir=DIR
++ install libraries built with a cross compiler within
++ DIR
+ --with-pic try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
+@@ -4773,6 +4777,22 @@ fi
+
+
+
++
++# Check whether --with-toolexeclibdir was given.
++if test "${with_toolexeclibdir+set}" = set; then :
++ withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in
++ /)
++ ;;
++ */)
++ with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
++ ;;
++esac
++else
++ with_toolexeclibdir=no
++fi
++
++
++
+ # Calculate toolexeclibdir
+ # Also toolexecdir, though it's only used in toolexeclibdir
+ case ${version_specific_libs} in
+@@ -4788,7 +4808,14 @@ case ${version_specific_libs} in
+ test x"$with_cross_host" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+- toolexeclibdir='$(toolexecdir)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ toolexeclibdir='$(toolexecdir)/lib'
++ ;;
++ *)
++ toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ toolexeclibdir='$(libdir)'
+@@ -12032,7 +12059,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 12035 "configure"
++#line 12062 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -12138,7 +12165,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 12141 "configure"
++#line 12168 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+diff --git a/libssp/configure b/libssp/configure
+index ee1751d20db..3273cd40ab1 100755
+--- a/libssp/configure
++++ b/libssp/configure
+@@ -743,6 +743,7 @@ with_pic
+ enable_fast_install
+ with_gnu_ld
+ enable_libtool_lock
++with_toolexeclibdir
+ with_gcc_major_version_only
+ '
+ ac_precious_vars='build_alias
+@@ -1389,6 +1390,9 @@ Optional Packages:
+ --with-pic try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
++ --with-toolexeclibdir=DIR
++ install libraries built with a cross compiler within
++ DIR
+ --with-gcc-major-version-only
+ use only GCC major number in filesystem paths
+
+@@ -10671,7 +10675,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 10674 "configure"
++#line 10678 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -10777,7 +10781,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 10780 "configure"
++#line 10784 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -11039,6 +11043,22 @@ esac
+
+
+
++
++# Check whether --with-toolexeclibdir was given.
++if test "${with_toolexeclibdir+set}" = set; then :
++ withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in
++ /)
++ ;;
++ */)
++ with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
++ ;;
++esac
++else
++ with_toolexeclibdir=no
++fi
++
++
++
+ # Calculate toolexeclibdir
+ # Also toolexecdir, though it's only used in toolexeclibdir
+ case ${version_specific_libs} in
+@@ -11054,7 +11074,14 @@ case ${version_specific_libs} in
+ test x"$with_cross_host" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+- toolexeclibdir='$(toolexecdir)/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ toolexeclibdir='$(toolexecdir)/lib'
++ ;;
++ *)
++ toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ toolexeclibdir='$(libdir)'
+diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
+index de8390703e2..88de3f728d4 100755
+--- a/libstdc++-v3/configure
++++ b/libstdc++-v3/configure
+@@ -903,6 +903,7 @@ enable_libstdcxx_threads
+ enable_libstdcxx_filesystem_ts
+ with_gxx_include_dir
+ enable_version_specific_runtime_libs
++with_toolexeclibdir
+ with_gcc_major_version_only
+ '
+ ac_precious_vars='build_alias
+@@ -1623,6 +1624,9 @@ Optional Packages:
+ set the std::string ABI to use by default
+ --with-gxx-include-dir=DIR
+ installation directory for include files
++ --with-toolexeclibdir=DIR
++ install libraries built with a cross compiler within
++ DIR
+ --with-gcc-major-version-only
+ use only GCC major number in filesystem paths
+
+@@ -11606,7 +11610,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11609 "configure"
++#line 11613 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -11712,7 +11716,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11715 "configure"
++#line 11723 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -15398,7 +15402,7 @@ $as_echo "$glibcxx_cv_atomic_long_long" >&6; }
+ # Fake what AC_TRY_COMPILE does.
+
+ cat > conftest.$ac_ext << EOF
+-#line 15401 "configure"
++#line 15409 "configure"
+ int main()
+ {
+ typedef bool atomic_type;
+@@ -15433,7 +15437,7 @@ $as_echo "$glibcxx_cv_atomic_bool" >&6; }
+ rm -f conftest*
+
+ cat > conftest.$ac_ext << EOF
+-#line 15436 "configure"
++#line 15440 "configure"
+ int main()
+ {
+ typedef short atomic_type;
+@@ -15468,7 +15472,7 @@ $as_echo "$glibcxx_cv_atomic_short" >&6; }
+ rm -f conftest*
+
+ cat > conftest.$ac_ext << EOF
+-#line 15471 "configure"
++#line 15475 "configure"
+ int main()
+ {
+ // NB: _Atomic_word not necessarily int.
+@@ -15504,7 +15508,7 @@ $as_echo "$glibcxx_cv_atomic_int" >&6; }
+ rm -f conftest*
+
+ cat > conftest.$ac_ext << EOF
+-#line 15507 "configure"
++#line 15511 "configure"
+ int main()
+ {
+ typedef long long atomic_type;
+@@ -15585,7 +15589,7 @@ $as_echo "$as_me: WARNING: Performance of certain classes will degrade as a resu
+ # unnecessary for this test.
+
+ cat > conftest.$ac_ext << EOF
+-#line 15588 "configure"
++#line 15592 "configure"
+ int main()
+ {
+ _Decimal32 d1;
+@@ -15627,7 +15631,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+ # unnecessary for this test.
+
+ cat > conftest.$ac_ext << EOF
+-#line 15630 "configure"
++#line 15634 "configure"
+ template<typename T1, typename T2>
+ struct same
+ { typedef T2 type; };
+@@ -15661,7 +15665,7 @@ $as_echo "$enable_int128" >&6; }
+ rm -f conftest*
+
+ cat > conftest.$ac_ext << EOF
+-#line 15664 "configure"
++#line 15668 "configure"
+ template<typename T1, typename T2>
+ struct same
+ { typedef T2 type; };
+@@ -81674,6 +81678,19 @@ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $version_specific_libs" >&5
+ $as_echo "$version_specific_libs" >&6; }
+
++# Check whether --with-toolexeclibdir was given.
++if test "${with_toolexeclibdir+set}" = set; then :
++ withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in
++ /)
++ ;;
++ */)
++ with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'`
++ ;;
++esac
++else
++ with_toolexeclibdir=no
++fi
++
+ # Default case for install directory for include files.
+ if test $version_specific_libs = no && test $gxx_include_dir = no; then
+ gxx_include_dir='include/c++/${gcc_version}'
+@@ -81704,7 +81721,14 @@ $as_echo "$version_specific_libs" >&6; }
+ if test -n "$with_cross_host" &&
+ test x"$with_cross_host" != x"no"; then
+ glibcxx_toolexecdir='${exec_prefix}/${host_alias}'
+- glibcxx_toolexeclibdir='${toolexecdir}/lib'
++ case ${with_toolexeclibdir} in
++ no)
++ glibcxx_toolexeclibdir='${toolexecdir}/lib'
++ ;;
++ *)
++ glibcxx_toolexeclibdir=${with_toolexeclibdir}
++ ;;
++ esac
+ else
+ glibcxx_toolexecdir='${libdir}/gcc/${host_alias}'
+ glibcxx_toolexeclibdir='${libdir}'
+--
+2.24.0
+
diff --git a/gnu/packages/patches/gcc-7-libsanitizer-mode-size.patch b/gnu/packages/patches/gcc-7-libsanitizer-mode-size.patch
new file mode 100644
index 0000000000..41b4a4cac6
--- /dev/null
+++ b/gnu/packages/patches/gcc-7-libsanitizer-mode-size.patch
@@ -0,0 +1,53 @@
+Fix assertion failure in libsanitizer when using glibc 2.31 and later.
+
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92154
+https://reviews.llvm.org/D69104
+
+Adapted from these upstream revision:
+
+https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=277981
+https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=279653
+
+diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
+index 97eae3fc7bc..4089d4695e2 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
++++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
+@@ -1145,8 +1145,9 @@ CHECK_SIZE_AND_OFFSET(ipc_perm, uid);
+ CHECK_SIZE_AND_OFFSET(ipc_perm, gid);
+ CHECK_SIZE_AND_OFFSET(ipc_perm, cuid);
+ CHECK_SIZE_AND_OFFSET(ipc_perm, cgid);
+-#if !defined(__aarch64__) || !SANITIZER_LINUX || __GLIBC_PREREQ (2, 21)
+-/* On aarch64 glibc 2.20 and earlier provided incorrect mode field. */
++#if !SANITIZER_LINUX || __GLIBC_PREREQ (2, 31)
++/* glibc 2.30 and earlier provided 16-bit mode field instead of 32-bit
++ on many architectures. */
+ CHECK_SIZE_AND_OFFSET(ipc_perm, mode);
+ #endif
+
+diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
+index c139322839a..7c3c2d866e5 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
++++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
+@@ -211,20 +211,13 @@ namespace __sanitizer {
+ unsigned long __unused1;
+ unsigned long __unused2;
+ #elif defined(__sparc__)
+-# if defined(__arch64__)
+ unsigned mode;
+- unsigned short __pad1;
+-# else
+- unsigned short __pad1;
+- unsigned short mode;
+ unsigned short __pad2;
+-# endif
+ unsigned short __seq;
+ unsigned long long __unused1;
+ unsigned long long __unused2;
+ #else
+- unsigned short mode;
+- unsigned short __pad1;
++ unsigned int mode;
+ unsigned short __seq;
+ unsigned short __pad2;
+ #if defined(__x86_64__) && !defined(_LP64)
+
diff --git a/gnu/packages/patches/gcc-boot-4.7.4.patch b/gnu/packages/patches/gcc-boot-4.6.4.patch
index 3e51e31fdf..4ab0bf8641 100644
--- a/gnu/packages/patches/gcc-boot-4.7.4.patch
+++ b/gnu/packages/patches/gcc-boot-4.6.4.patch
@@ -1,4 +1,4 @@
-This patch enables building gcc-4.7.4 using gcc-2.95.3 and glibc-2.2.5
+This patch enables building gcc-4.6.4 using gcc-2.95.3 and glibc-2.2.5
* Tweak Makefile to allow overriding NATIVE_SYSTEM_HEADER_DIR using #:makeflags
* Add missing limits.h include.
@@ -14,12 +14,12 @@ diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index f3cc49fdb18..bc5718fc9a6 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
-@@ -458,7 +458,7 @@ LINKER_PLUGIN_API_H = $(srcdir)/../include/plugin-api.h
+@@ -440,7 +440,7 @@ LINKER_PLUGIN_API_H = $(srcdir)/../include/plugin-api.h
LTO_SYMTAB_H = $(srcdir)/../include/lto-symtab.h
# Default native SYSTEM_HEADER_DIR, to be overridden by targets.
--NATIVE_SYSTEM_HEADER_DIR = @NATIVE_SYSTEM_HEADER_DIR@
-+# NATIVE_SYSTEM_HEADER_DIR = @NATIVE_SYSTEM_HEADER_DIR@
+-NATIVE_SYSTEM_HEADER_DIR = /usr/include
++# NATIVE_SYSTEM_HEADER_DIR = /usr/include
# Default cross SYSTEM_HEADER_DIR, to be overridden by targets.
CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@
@@ -40,24 +40,11 @@ index 94b7a0b89a7..ab2baab55ca 100644
/* Linux has a feature called exec-shield-randomize that perturbs the
address of non-fixed mapped segments by a (relatively) small amount.
-diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in
-index c301ff03cae..f86318c3bd5 100644
---- a/libgcc/Makefile.in
-+++ b/libgcc/Makefile.in
-@@ -225,7 +225,7 @@ endif
- LIBGCC2_DEBUG_CFLAGS = -g
- LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) $(HOST_LIBGCC2_CFLAGS) \
- $(LIBGCC2_DEBUG_CFLAGS) -DIN_LIBGCC2 \
-- -fbuilding-libgcc -fno-stack-protector \
-+ -fno-stack-protector \
- $(INHIBIT_LIBC_CFLAGS)
-
- # Additional options to use when compiling libgcc2.a.
diff --git a/libgcc/generic-morestack-thread.c b/libgcc/generic-morestack-thread.c
index bbe6dd12b5a..1d1d48223d7 100644
--- a/libgcc/generic-morestack-thread.c
+++ b/libgcc/generic-morestack-thread.c
-@@ -35,7 +35,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+@@ -34,7 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
will want to define inhibit_libc while building a compiler which
can build glibc. */
diff --git a/gnu/packages/patches/gd-CVE-2018-1000222.patch b/gnu/packages/patches/gd-CVE-2018-1000222.patch
deleted file mode 100644
index 7e94295bb6..0000000000
--- a/gnu/packages/patches/gd-CVE-2018-1000222.patch
+++ /dev/null
@@ -1,87 +0,0 @@
-Fix CVE-2018-1000222:
-
-https://github.com/libgd/libgd/issues/447
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-1000222
-
-Patch copied from upstream source repository:
-
-https://github.com/libgd/libgd/commit/4b1e18a00ce7c4b7e6919c3b3109a034393b805a
-
-From 4b1e18a00ce7c4b7e6919c3b3109a034393b805a Mon Sep 17 00:00:00 2001
-From: Mike Frysinger <vapier@gentoo.org>
-Date: Sat, 14 Jul 2018 13:54:08 -0400
-Subject: [PATCH] bmp: check return value in gdImageBmpPtr
-
-Closes #447.
-
-(cherry picked from commit ac16bdf2d41724b5a65255d4c28fb0ec46bc42f5)
----
- src/gd_bmp.c | 17 ++++++++++++++---
- 1 file changed, 14 insertions(+), 3 deletions(-)
-
-diff --git a/src/gd_bmp.c b/src/gd_bmp.c
-index ccafdcd..d625da1 100644
---- a/src/gd_bmp.c
-+++ b/src/gd_bmp.c
-@@ -48,6 +48,8 @@ static int bmp_read_4bit(gdImagePtr im, gdIOCtxPtr infile, bmp_info_t *info, bmp
- static int bmp_read_8bit(gdImagePtr im, gdIOCtxPtr infile, bmp_info_t *info, bmp_hdr_t *header);
- static int bmp_read_rle(gdImagePtr im, gdIOCtxPtr infile, bmp_info_t *info);
-
-+static int _gdImageBmpCtx(gdImagePtr im, gdIOCtxPtr out, int compression);
-+
- #define BMP_DEBUG(s)
-
- static int gdBMPPutWord(gdIOCtx *out, int w)
-@@ -88,8 +90,10 @@ BGD_DECLARE(void *) gdImageBmpPtr(gdImagePtr im, int *size, int compression)
- void *rv;
- gdIOCtx *out = gdNewDynamicCtx(2048, NULL);
- if (out == NULL) return NULL;
-- gdImageBmpCtx(im, out, compression);
-- rv = gdDPExtractData(out, size);
-+ if (!_gdImageBmpCtx(im, out, compression))
-+ rv = gdDPExtractData(out, size);
-+ else
-+ rv = NULL;
- out->gd_free(out);
- return rv;
- }
-@@ -142,6 +146,11 @@ BGD_DECLARE(void) gdImageBmp(gdImagePtr im, FILE *outFile, int compression)
- compression - whether to apply RLE or not.
- */
- BGD_DECLARE(void) gdImageBmpCtx(gdImagePtr im, gdIOCtxPtr out, int compression)
-+{
-+ _gdImageBmpCtx(im, out, compression);
-+}
-+
-+static int _gdImageBmpCtx(gdImagePtr im, gdIOCtxPtr out, int compression)
- {
- int bitmap_size = 0, info_size, total_size, padding;
- int i, row, xpos, pixel;
-@@ -149,6 +158,7 @@ BGD_DECLARE(void) gdImageBmpCtx(gdImagePtr im, gdIOCtxPtr out, int compression)
- unsigned char *uncompressed_row = NULL, *uncompressed_row_start = NULL;
- FILE *tmpfile_for_compression = NULL;
- gdIOCtxPtr out_original = NULL;
-+ int ret = 1;
-
- /* No compression if its true colour or we don't support seek */
- if (im->trueColor) {
-@@ -326,6 +336,7 @@ BGD_DECLARE(void) gdImageBmpCtx(gdImagePtr im, gdIOCtxPtr out, int compression)
- out_original = NULL;
- }
-
-+ ret = 0;
- cleanup:
- if (tmpfile_for_compression) {
- #ifdef _WIN32
-@@ -339,7 +350,7 @@ cleanup:
- if (out_original) {
- out_original->gd_free(out_original);
- }
-- return;
-+ return ret;
- }
-
- static int compress_row(unsigned char *row, int length)
---
-2.18.0
-
diff --git a/gnu/packages/patches/gd-CVE-2018-5711.patch b/gnu/packages/patches/gd-CVE-2018-5711.patch
deleted file mode 100644
index 83b12cde63..0000000000
--- a/gnu/packages/patches/gd-CVE-2018-5711.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-This patch is adapted from commit a11f47475e6443b7f32d21f2271f28f417e2ac04 and
-fixes CVE-2018-5711.
-
-From a11f47475e6443b7f32d21f2271f28f417e2ac04 Mon Sep 17 00:00:00 2001
-From: "Christoph M. Becker" <cmbecker69@gmx.de>
-Date: Wed, 29 Nov 2017 19:37:38 +0100
-Subject: [PATCH] Fix #420: Potential infinite loop in gdImageCreateFromGifCtx
-
-Due to a signedness confusion in `GetCode_` a corrupt GIF file can
-trigger an infinite loop. Furthermore we make sure that a GIF without
-any palette entries is treated as invalid *after* open palette entries
-have been removed.
-
-CVE-2018-5711
-
-See also https://bugs.php.net/bug.php?id=75571.
----
- src/gd_gif_in.c | 12 ++++++------
- 1 file changed, 38 insertions(+), 6 deletions(-)
-
-diff --git a/src/gd_gif_in.c b/src/gd_gif_in.c
-index daf26e7..0a8bd71 100644
---- a/src/gd_gif_in.c
-+++ b/src/gd_gif_in.c
-@@ -335,11 +335,6 @@ terminated:
- return 0;
- }
-
-- if(!im->colorsTotal) {
-- gdImageDestroy(im);
-- return 0;
-- }
--
- /* Check for open colors at the end, so
- * we can reduce colorsTotal and ultimately
- * BitsPerPixel */
-@@ -351,6 +346,11 @@ terminated:
- }
- }
-
-+ if(!im->colorsTotal) {
-+ gdImageDestroy(im);
-+ return 0;
-+ }
-+
- return im;
- }
-
-@@ -447,7 +447,7 @@ static int
- GetCode_(gdIOCtx *fd, CODE_STATIC_DATA *scd, int code_size, int flag, int *ZeroDataBlockP)
- {
- int i, j, ret;
-- unsigned char count;
-+ int count;
-
- if(flag) {
- scd->curbit = 0;
-
---
-2.13.6
-
diff --git a/gnu/packages/patches/gd-CVE-2019-6977.patch b/gnu/packages/patches/gd-CVE-2019-6977.patch
deleted file mode 100644
index b21a8ac619..0000000000
--- a/gnu/packages/patches/gd-CVE-2019-6977.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-Fix CVE-2019-6977:
-
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-6977
-
-Patch copied from Debian:
-
-https://salsa.debian.org/debian/libgd2/commit/2d7d3b68bb79843e5271a05543e996fd5a3a8cd1
-
-Description: Heap-based buffer overflow in gdImageColorMatch
-Origin: other, https://gist.github.com/cmb69/1f36d285eb297ed326f5c821d7aafced
-Bug-PHP: https://bugs.php.net/bug.php?id=77270
-Bug-Debian: https://bugs.debian.org/920645
-Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2019-6977
-Forwarded: no
-Author: "Christoph M. Becker" <cmbecker69@gmx.de>
-Last-Update: 2019-02-01
-
-At least some of the image reading functions may return images which
-use color indexes greater than or equal to im->colorsTotal. We cater
-to this by always using a buffer size which is sufficient for
-`gdMaxColors` in `gdImageColorMatch()`.
----
-
---- a/src/gd_color_match.c
-+++ b/src/gd_color_match.c
-@@ -31,8 +31,8 @@ BGD_DECLARE(int) gdImageColorMatch (gdIm
- return -4; /* At least 1 color must be allocated */
- }
-
-- buf = (unsigned long *)gdMalloc(sizeof(unsigned long) * 5 * im2->colorsTotal);
-- memset (buf, 0, sizeof(unsigned long) * 5 * im2->colorsTotal );
-+ buf = (unsigned long *)gdMalloc(sizeof(unsigned long) * 5 * gdMaxColors);
-+ memset (buf, 0, sizeof(unsigned long) * 5 * gdMaxColors );
-
- for (x=0; x < im1->sx; x++) {
- for( y=0; y<im1->sy; y++ ) {
diff --git a/gnu/packages/patches/gd-CVE-2019-6978.patch b/gnu/packages/patches/gd-CVE-2019-6978.patch
deleted file mode 100644
index 69fc5056fc..0000000000
--- a/gnu/packages/patches/gd-CVE-2019-6978.patch
+++ /dev/null
@@ -1,301 +0,0 @@
-Fix CVE-2019-6978:
-
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-6978
-
-Patch copied from upstream source repository:
-
-https://github.com/libgd/libgd/commit/553702980ae89c83f2d6e254d62cf82e204956d0
-
-From 553702980ae89c83f2d6e254d62cf82e204956d0 Mon Sep 17 00:00:00 2001
-From: "Christoph M. Becker" <cmbecker69@gmx.de>
-Date: Thu, 17 Jan 2019 11:54:55 +0100
-Subject: [PATCH] Fix #492: Potential double-free in gdImage*Ptr()
-
-Whenever `gdImage*Ptr()` calls `gdImage*Ctx()` and the latter fails, we
-must not call `gdDPExtractData()`; otherwise a double-free would
-happen. Since `gdImage*Ctx()` are void functions, and we can't change
-that for BC reasons, we're introducing static helpers which are used
-internally.
-
-We're adding a regression test for `gdImageJpegPtr()`, but not for
-`gdImageGifPtr()` and `gdImageWbmpPtr()` since we don't know how to
-trigger failure of the respective `gdImage*Ctx()` calls.
-
-This potential security issue has been reported by Solmaz Salimi (aka.
-Rooney).
----
- src/gd_gif_out.c | 18 +++++++++++++++---
- src/gd_jpeg.c | 20 ++++++++++++++++----
- src/gd_wbmp.c | 21 ++++++++++++++++++---
- tests/jpeg/.gitignore | 1 +
- tests/jpeg/CMakeLists.txt | 1 +
- tests/jpeg/Makemodule.am | 3 ++-
- tests/jpeg/jpeg_ptr_double_free.c | 31 +++++++++++++++++++++++++++++++
- 7 files changed, 84 insertions(+), 11 deletions(-)
- create mode 100644 tests/jpeg/jpeg_ptr_double_free.c
-
-diff --git a/src/gd_gif_out.c b/src/gd_gif_out.c
-index 298a581..d5a9534 100644
---- a/src/gd_gif_out.c
-+++ b/src/gd_gif_out.c
-@@ -99,6 +99,7 @@ static void char_init(GifCtx *ctx);
- static void char_out(int c, GifCtx *ctx);
- static void flush_char(GifCtx *ctx);
-
-+static int _gdImageGifCtx(gdImagePtr im, gdIOCtxPtr out);
-
-
-
-@@ -131,8 +132,11 @@ BGD_DECLARE(void *) gdImageGifPtr(gdImagePtr im, int *size)
- void *rv;
- gdIOCtx *out = gdNewDynamicCtx(2048, NULL);
- if (out == NULL) return NULL;
-- gdImageGifCtx(im, out);
-- rv = gdDPExtractData(out, size);
-+ if (!_gdImageGifCtx(im, out)) {
-+ rv = gdDPExtractData(out, size);
-+ } else {
-+ rv = NULL;
-+ }
- out->gd_free(out);
- return rv;
- }
-@@ -220,6 +224,12 @@ BGD_DECLARE(void) gdImageGif(gdImagePtr im, FILE *outFile)
-
- */
- BGD_DECLARE(void) gdImageGifCtx(gdImagePtr im, gdIOCtxPtr out)
-+{
-+ _gdImageGifCtx(im, out);
-+}
-+
-+/* returns 0 on success, 1 on failure */
-+static int _gdImageGifCtx(gdImagePtr im, gdIOCtxPtr out)
- {
- gdImagePtr pim = 0, tim = im;
- int interlace, BitsPerPixel;
-@@ -231,7 +241,7 @@ BGD_DECLARE(void) gdImageGifCtx(gdImagePtr im, gdIOCtxPtr out)
- based temporary image. */
- pim = gdImageCreatePaletteFromTrueColor(im, 1, 256);
- if(!pim) {
-- return;
-+ return 1;
- }
- tim = pim;
- }
-@@ -247,6 +257,8 @@ BGD_DECLARE(void) gdImageGifCtx(gdImagePtr im, gdIOCtxPtr out)
- /* Destroy palette based temporary image. */
- gdImageDestroy( pim);
- }
-+
-+ return 0;
- }
-
-
-diff --git a/src/gd_jpeg.c b/src/gd_jpeg.c
-index fc05842..96ef430 100644
---- a/src/gd_jpeg.c
-+++ b/src/gd_jpeg.c
-@@ -117,6 +117,8 @@ static void fatal_jpeg_error(j_common_ptr cinfo)
- exit(99);
- }
-
-+static int _gdImageJpegCtx(gdImagePtr im, gdIOCtx *outfile, int quality);
-+
- /*
- * Write IM to OUTFILE as a JFIF-formatted JPEG image, using quality
- * QUALITY. If QUALITY is in the range 0-100, increasing values
-@@ -231,8 +233,11 @@ BGD_DECLARE(void *) gdImageJpegPtr(gdImagePtr im, int *size, int quality)
- void *rv;
- gdIOCtx *out = gdNewDynamicCtx(2048, NULL);
- if (out == NULL) return NULL;
-- gdImageJpegCtx(im, out, quality);
-- rv = gdDPExtractData(out, size);
-+ if (!_gdImageJpegCtx(im, out, quality)) {
-+ rv = gdDPExtractData(out, size);
-+ } else {
-+ rv = NULL;
-+ }
- out->gd_free(out);
- return rv;
- }
-@@ -253,6 +258,12 @@ void jpeg_gdIOCtx_dest(j_compress_ptr cinfo, gdIOCtx *outfile);
-
- */
- BGD_DECLARE(void) gdImageJpegCtx(gdImagePtr im, gdIOCtx *outfile, int quality)
-+{
-+ _gdImageJpegCtx(im, outfile, quality);
-+}
-+
-+/* returns 0 on success, 1 on failure */
-+static int _gdImageJpegCtx(gdImagePtr im, gdIOCtx *outfile, int quality)
- {
- struct jpeg_compress_struct cinfo;
- struct jpeg_error_mgr jerr;
-@@ -287,7 +298,7 @@ BGD_DECLARE(void) gdImageJpegCtx(gdImagePtr im, gdIOCtx *outfile, int quality)
- if(row) {
- gdFree(row);
- }
-- return;
-+ return 1;
- }
-
- cinfo.err->emit_message = jpeg_emit_message;
-@@ -328,7 +339,7 @@ BGD_DECLARE(void) gdImageJpegCtx(gdImagePtr im, gdIOCtx *outfile, int quality)
- if(row == 0) {
- gd_error("gd-jpeg: error: unable to allocate JPEG row structure: gdCalloc returns NULL\n");
- jpeg_destroy_compress(&cinfo);
-- return;
-+ return 1;
- }
-
- rowptr[0] = row;
-@@ -405,6 +416,7 @@ BGD_DECLARE(void) gdImageJpegCtx(gdImagePtr im, gdIOCtx *outfile, int quality)
- jpeg_finish_compress(&cinfo);
- jpeg_destroy_compress(&cinfo);
- gdFree(row);
-+ return 0;
- }
-
-
-diff --git a/src/gd_wbmp.c b/src/gd_wbmp.c
-index f19a1c9..a49bdbe 100644
---- a/src/gd_wbmp.c
-+++ b/src/gd_wbmp.c
-@@ -88,6 +88,8 @@ int gd_getin(void *in)
- return (gdGetC((gdIOCtx *)in));
- }
-
-+static int _gdImageWBMPCtx(gdImagePtr image, int fg, gdIOCtx *out);
-+
- /*
- Function: gdImageWBMPCtx
-
-@@ -100,6 +102,12 @@ int gd_getin(void *in)
- out - the stream where to write
- */
- BGD_DECLARE(void) gdImageWBMPCtx(gdImagePtr image, int fg, gdIOCtx *out)
-+{
-+ _gdImageWBMPCtx(image, fg, out);
-+}
-+
-+/* returns 0 on success, 1 on failure */
-+static int _gdImageWBMPCtx(gdImagePtr image, int fg, gdIOCtx *out)
- {
- int x, y, pos;
- Wbmp *wbmp;
-@@ -107,7 +115,7 @@ BGD_DECLARE(void) gdImageWBMPCtx(gdImagePtr image, int fg, gdIOCtx *out)
- /* create the WBMP */
- if((wbmp = createwbmp(gdImageSX(image), gdImageSY(image), WBMP_WHITE)) == NULL) {
- gd_error("Could not create WBMP\n");
-- return;
-+ return 1;
- }
-
- /* fill up the WBMP structure */
-@@ -123,11 +131,15 @@ BGD_DECLARE(void) gdImageWBMPCtx(gdImagePtr image, int fg, gdIOCtx *out)
-
- /* write the WBMP to a gd file descriptor */
- if(writewbmp(wbmp, &gd_putout, out)) {
-+ freewbmp(wbmp);
- gd_error("Could not save WBMP\n");
-+ return 1;
- }
-
- /* des submitted this bugfix: gdFree the memory. */
- freewbmp(wbmp);
-+
-+ return 0;
- }
-
- /*
-@@ -271,8 +283,11 @@ BGD_DECLARE(void *) gdImageWBMPPtr(gdImagePtr im, int *size, int fg)
- void *rv;
- gdIOCtx *out = gdNewDynamicCtx(2048, NULL);
- if (out == NULL) return NULL;
-- gdImageWBMPCtx(im, fg, out);
-- rv = gdDPExtractData(out, size);
-+ if (!_gdImageWBMPCtx(im, fg, out)) {
-+ rv = gdDPExtractData(out, size);
-+ } else {
-+ rv = NULL;
-+ }
- out->gd_free(out);
- return rv;
- }
-#diff --git a/tests/jpeg/.gitignore b/tests/jpeg/.gitignore
-#index c28aa87..13bcf04 100644
-#--- a/tests/jpeg/.gitignore
-#+++ b/tests/jpeg/.gitignore
-#@@ -3,5 +3,6 @@
-# /jpeg_empty_file
-# /jpeg_im2im
-# /jpeg_null
-#+/jpeg_ptr_double_free
-# /jpeg_read
-# /jpeg_resolution
-diff --git a/tests/jpeg/CMakeLists.txt b/tests/jpeg/CMakeLists.txt
-index 19964b0..a8d8162 100644
---- a/tests/jpeg/CMakeLists.txt
-+++ b/tests/jpeg/CMakeLists.txt
-@@ -2,6 +2,7 @@ IF(JPEG_FOUND)
- LIST(APPEND TESTS_FILES
- jpeg_empty_file
- jpeg_im2im
-+ jpeg_ptr_double_free
- jpeg_null
- )
-
-diff --git a/tests/jpeg/Makemodule.am b/tests/jpeg/Makemodule.am
-index 7e5d317..b89e169 100644
---- a/tests/jpeg/Makemodule.am
-+++ b/tests/jpeg/Makemodule.am
-@@ -2,7 +2,8 @@ if HAVE_LIBJPEG
- libgd_test_programs += \
- jpeg/jpeg_empty_file \
- jpeg/jpeg_im2im \
-- jpeg/jpeg_null
-+ jpeg/jpeg_null \
-+ jpeg/jpeg_ptr_double_free
-
- if HAVE_LIBPNG
- libgd_test_programs += \
-diff --git a/tests/jpeg/jpeg_ptr_double_free.c b/tests/jpeg/jpeg_ptr_double_free.c
-new file mode 100644
-index 0000000..df5a510
---- /dev/null
-+++ b/tests/jpeg/jpeg_ptr_double_free.c
-@@ -0,0 +1,31 @@
-+/**
-+ * Test that failure to convert to JPEG returns NULL
-+ *
-+ * We are creating an image, set its width to zero, and pass this image to
-+ * `gdImageJpegPtr()` which is supposed to fail, and as such should return NULL.
-+ *
-+ * See also <https://github.com/libgd/libgd/issues/381>
-+ */
-+
-+
-+#include "gd.h"
-+#include "gdtest.h"
-+
-+
-+int main()
-+{
-+ gdImagePtr src, dst;
-+ int size;
-+
-+ src = gdImageCreateTrueColor(1, 10);
-+ gdTestAssert(src != NULL);
-+
-+ src->sx = 0; /* this hack forces gdImageJpegPtr() to fail */
-+
-+ dst = gdImageJpegPtr(src, &size, 0);
-+ gdTestAssert(dst == NULL);
-+
-+ gdImageDestroy(src);
-+
-+ return gdNumFailures();
-+}
---
-2.20.1
-
diff --git a/gnu/packages/patches/gd-brect-bounds.patch b/gnu/packages/patches/gd-brect-bounds.patch
new file mode 100644
index 0000000000..575e4dc2ad
--- /dev/null
+++ b/gnu/packages/patches/gd-brect-bounds.patch
@@ -0,0 +1,63 @@
+Revert upstream commit 04bb9a08b3c25f8e3c0c235f9cefc0f94df59a5a because it
+causes a test failure on i686 and possibly other architectures.
+
+See <https://github.com/libgd/libgd/issues/613>.
+
+diff --git a/src/gdft.c b/src/gdft.c
+--- a/src/gdft.c
++++ b/src/gdft.c
+@@ -1579,6 +1579,12 @@ BGD_DECLARE(char *) gdImageStringFTEx (gdImage * im, int *brect, int fg, const c
+ double scalex = (double)hdpi / (64 * METRIC_RES);
+ double scaley = (double)vdpi / (64 * METRIC_RES);
+
++ /* increase by 1 pixel to allow for rounding */
++ total_min.x -= METRIC_RES;
++ total_min.y -= METRIC_RES;
++ total_max.x += METRIC_RES;
++ total_max.y += METRIC_RES;
++
+ /* rotate bounding rectangle, scale and round to int pixels, and translate */
+ brect[0] = x + (total_min.x * cos_a + total_max.y * sin_a)*scalex;
+ brect[1] = y - (total_min.x * sin_a - total_max.y * cos_a)*scaley;
+diff --git a/tests/gdimagestringft/gdimagestringft_bbox.c b/tests/gdimagestringft/gdimagestringft_bbox.c
+--- a/tests/gdimagestringft/gdimagestringft_bbox.c
++++ b/tests/gdimagestringft/gdimagestringft_bbox.c
+@@ -8,22 +8,22 @@
+ #define DELTA (PI/8)
+
+ static int EXPECT[16][8] = {
+- {500, 400, 628, 400, 628, 376, 500, 376},
+- {492, 362, 611, 312, 601, 290, 483, 339},
+- {470, 330, 561, 239, 544, 221, 453, 312},
+- {437, 308, 486, 189, 464, 180, 414, 299},
+- {400, 301, 400, 173, 376, 173, 376, 301},
+- {363, 309, 313, 190, 291, 200, 340, 318},
+- {332, 331, 241, 240, 223, 257, 314, 348},
+- {311, 363, 192, 314, 183, 336, 302, 386},
+- {304, 399, 176, 399, 176, 423, 304, 423},
+- {312, 435, 193, 485, 203, 507, 321, 458},
+- {333, 465, 242, 556, 259, 574, 350, 483},
+- {364, 486, 315, 605, 337, 614, 387, 495},
+- {399, 492, 399, 620, 423, 620, 423, 492},
+- {434, 484, 484, 603, 506, 593, 457, 475},
+- {463, 464, 554, 555, 572, 538, 481, 447},
+- {483, 434, 602, 483, 611, 461, 492, 411},
++ {498, 401, 630, 401, 630, 374, 498, 374},
++ {491, 364, 613, 313, 602, 288, 481, 338},
++ {470, 332, 563, 239, 544, 219, 451, 312},
++ {438, 310, 488, 189, 463, 178, 412, 300},
++ {401, 303, 401, 171, 374, 171, 374, 303},
++ {365, 310, 314, 188, 289, 199, 339, 320},
++ {334, 331, 241, 238, 221, 257, 314, 350},
++ {313, 362, 192, 312, 181, 337, 303, 388},
++ {306, 398, 174, 398, 174, 425, 306, 425},
++ {313, 433, 191, 484, 202, 509, 323, 459},
++ {333, 463, 240, 556, 259, 576, 352, 483},
++ {363, 484, 313, 605, 338, 616, 389, 494},
++ {398, 490, 398, 622, 425, 622, 425, 490},
++ {432, 483, 483, 605, 508, 594, 458, 473},
++ {461, 464, 554, 557, 574, 538, 481, 445},
++ {481, 435, 602, 485, 613, 460, 491, 409},
+ };
+
+ int main()
diff --git a/gnu/packages/patches/gd-fix-tests-on-i686.patch b/gnu/packages/patches/gd-fix-tests-on-i686.patch
index 280893c1d4..7ec8e7fee9 100644
--- a/gnu/packages/patches/gd-fix-tests-on-i686.patch
+++ b/gnu/packages/patches/gd-fix-tests-on-i686.patch
@@ -38,7 +38,7 @@ diff -ru libgd-2.2.3.orig/tests/gdimagecopyresampled/bug00201.c libgd-2.2.3/test
@@ -65,7 +66,8 @@
gdImageDestroy(background);
gdImageDestroy(scaled_logo);
-
+
- gdAssertImageEqualsToFile("gdimagecopyresampled/bug00201_exp.png", img);
+ if (FLT_EVAL_METHOD != 2)
+ gdAssertImageEqualsToFile("gdimagecopyresampled/bug00201_exp.png", img);
diff --git a/gnu/packages/patches/gd-freetype-test-failure.patch b/gnu/packages/patches/gd-freetype-test-failure.patch
deleted file mode 100644
index 49c16ca089..0000000000
--- a/gnu/packages/patches/gd-freetype-test-failure.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-Fix a test failure with freetype 2.7:
-
-https://github.com/libgd/libgd/commit/a5570d3ed30ff76c2a8bdd54f4ab1825acca0143
-
-Patch copied from upstream source repository:
-
-https://github.com/libgd/libgd/commit/a5570d3ed30ff76c2a8bdd54f4ab1825acca0143
-
-From a5570d3ed30ff76c2a8bdd54f4ab1825acca0143 Mon Sep 17 00:00:00 2001
-From: "Christoph M. Becker" <cmbecker69@gmx.de>
-Date: Sun, 29 Jan 2017 17:07:50 +0100
-Subject: [PATCH] Fix #302: Test suite fails with freetype 2.7
-
-Actually, the test failures are not necessarily related to freetype
-2.7, but rather are caused by subpixel hinting which is enabled by
-default in freetype 2.7. Subpixel hinting is, however, already
-available in freetype 2.5 and in versions having the "Infinality"
-patch.
-
-To get the expected results in all environments, we have to disable
-subpixel hinting, what is easily done by setting a respective
-environment variable.
-
-See also:
-* https://www.freetype.org/freetype2/docs/subpixel-hinting.html
-* https://www.freetype.org/freetype2/docs/reference/ft2-tt_driver.html
----
- tests/freetype/bug00132.c | 3 +++
- tests/gdimagestringft/gdimagestringft_bbox.c | 3 +++
- 2 files changed, 6 insertions(+)
-
-diff --git a/tests/freetype/bug00132.c b/tests/freetype/bug00132.c
-index 713dd2d..42ed5b1 100644
---- a/tests/freetype/bug00132.c
-+++ b/tests/freetype/bug00132.c
-@@ -11,6 +11,9 @@ int main()
- char *path;
- char *ret = NULL;
-
-+ /* disable subpixel hinting */
-+ putenv("FREETYPE_PROPERTIES=truetype:interpreter-version=35");
-+
- im = gdImageCreateTrueColor(50, 30);
-
- if (!im) {
-diff --git a/tests/gdimagestringft/gdimagestringft_bbox.c b/tests/gdimagestringft/gdimagestringft_bbox.c
-index 0161ec8..1596a9e 100644
---- a/tests/gdimagestringft/gdimagestringft_bbox.c
-+++ b/tests/gdimagestringft/gdimagestringft_bbox.c
-@@ -38,6 +38,9 @@ int main()
- int error = 0;
- FILE *fp;
-
-+ /* disable subpixel hinting */
-+ putenv("FREETYPE_PROPERTIES=truetype:interpreter-version=35");
-+
- path = gdTestFilePath("freetype/DejaVuSans.ttf");
- im = gdImageCreate(800, 800);
- gdImageColorAllocate(im, 0xFF, 0xFF, 0xFF); /* allocate white for background color */
diff --git a/gnu/packages/patches/gdm-default-session.patch b/gnu/packages/patches/gdm-default-session.patch
index 4839a04de4..9ab2829cdb 100644
--- a/gnu/packages/patches/gdm-default-session.patch
+++ b/gnu/packages/patches/gdm-default-session.patch
@@ -5,11 +5,10 @@ and not in the directories listed in $XDG_DATA_DIRS. The latter includes
Fixes <https://bugs.gnu.org/37831>.
-diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
-index 6a116a8..02c1458 100644
---- a/daemon/gdm-session.c
-+++ b/daemon/gdm-session.c
-@@ -348,24 +348,18 @@ get_system_session_dirs (GdmSession *self)
+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 @@
GArray *search_array = NULL;
char **search_dirs;
int i;
@@ -35,7 +34,7 @@ index 6a116a8..02c1458 100644
g_array_append_vals (search_array, x_search_dirs, G_N_ELEMENTS (x_search_dirs));
#ifdef ENABLE_WAYLAND_SUPPORT
-@@ -373,16 +367,7 @@ get_system_session_dirs (GdmSession *self)
+@@ -373,16 +367,7 @@
#ifdef ENABLE_USER_DISPLAY_SERVER
g_array_prepend_val (search_array, wayland_search_dir);
@@ -52,40 +51,39 @@ index 6a116a8..02c1458 100644
g_array_append_val (search_array, wayland_search_dir);
#endif
}
-diff --git a/libgdm/gdm-sessions.c b/libgdm/gdm-sessions.c
-index afbc5c0..bb5e3e6 100644
---- a/libgdm/gdm-sessions.c
-+++ b/libgdm/gdm-sessions.c
-@@ -238,19 +238,11 @@ collect_sessions (void)
+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 @@
"/etc/X11/sessions/",
DMCONFDIR "/Sessions/",
DATADIR "/gdm/BuiltInSessions/",
- DATADIR "/xsessions/",
-- NULL
+ "/run/current-system/profile/share/xsessions/"
};
- xorg_search_array = g_array_new (TRUE, TRUE, sizeof (char *));
+ names_seen_before = g_hash_table_new (g_str_hash, g_str_equal);
+ xorg_search_array = g_ptr_array_new_with_free_func (g_free);
- const gchar * const *system_data_dirs = g_get_system_data_dirs ();
-
- for (i = 0; system_data_dirs[i]; i++) {
- session_dir = g_build_filename (system_data_dirs[i], "xsessions", NULL);
-- g_array_append_val (xorg_search_array, session_dir);
+- g_ptr_array_add (xorg_search_array, session_dir);
- }
-
- g_array_append_vals (xorg_search_array, xorg_search_dirs, G_N_ELEMENTS (xorg_search_dirs));
-
- #ifdef ENABLE_WAYLAND_SUPPORT
-@@ -261,11 +253,6 @@ collect_sessions (void)
+ 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 @@
- wayland_search_array = g_array_new (TRUE, TRUE, sizeof (char *));
+ wayland_search_array = g_ptr_array_new_with_free_func (g_free);
- for (i = 0; system_data_dirs[i]; i++) {
- session_dir = g_build_filename (system_data_dirs[i], "wayland-sessions", NULL);
-- g_array_append_val (wayland_search_array, session_dir);
+- g_ptr_array_add (wayland_search_array, session_dir);
- }
-
- g_array_append_vals (wayland_search_array, wayland_search_dirs, G_N_ELEMENTS (wayland_search_dirs));
- #endif
-
+ for (i = 0; i < G_N_ELEMENTS (wayland_search_dirs); i++) {
+ g_ptr_array_add (wayland_search_array, g_strdup (wayland_search_dirs[i]));
+ }
diff --git a/gnu/packages/patches/ghc-dont-pass-linker-flags-via-response-files.patch b/gnu/packages/patches/ghc-dont-pass-linker-flags-via-response-files.patch
deleted file mode 100644
index 40aae7a9d7..0000000000
--- a/gnu/packages/patches/ghc-dont-pass-linker-flags-via-response-files.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Don’t add linker flags via ‘response files’ since ld-wrapper
-doesn’t handle them.
-See https://github.com/NixOS/nixpkgs/commit/a421e7bd4a28c69bded8b17888325e31554f61a1
-https://gcc.gnu.org/ml/gcc/2016-10/msg00151.html
-
-diff --git a/compiler/main/SysTools.hs.orig b/compiler/main/SysTools.hs
-index 1ab5b13..99270fc 100644
---- a/compiler/main/SysTools.hs.orig
-+++ b/compiler/main/SysTools.hs
-@@ -424,7 +424,7 @@ runCc dflags args = do
- args1 = map Option (getOpts dflags opt_c)
- args2 = args0 ++ args1 ++ args
- mb_env <- getGccEnv args2
-- runSomethingResponseFile dflags cc_filter "C Compiler" p args2 mb_env
-+ runSomethingFiltered dflags cc_filter "C Compiler" p args2 mb_env
- where
- -- discard some harmless warnings from gcc that we can't turn off
- cc_filter = unlines . doFilter . lines
-@@ -945,7 +945,7 @@ runLink dflags args = do
- args1 = map Option (getOpts dflags opt_l)
- args2 = args0 ++ linkargs ++ args1 ++ args
- mb_env <- getGccEnv args2
-- runSomethingResponseFile dflags ld_filter "Linker" p args2 mb_env
-+ runSomethingFiltered dflags ld_filter "Linker" p args2 mb_env
- where
- ld_filter = case (platformOS (targetPlatform dflags)) of
- OSSolaris2 -> sunos_ld_filter
diff --git a/gnu/packages/patches/ghc-testsuite-dlopen-pie.patch b/gnu/packages/patches/ghc-testsuite-dlopen-pie.patch
new file mode 100644
index 0000000000..99ba3ac42f
--- /dev/null
+++ b/gnu/packages/patches/ghc-testsuite-dlopen-pie.patch
@@ -0,0 +1,54 @@
+Do not attempt to dlopen PIE objects, which was disallowed with glibc 2.30.
+
+https://gitlab.haskell.org/ghc/ghc/issues/17952
+https://sourceware.org/bugzilla/show_bug.cgi?id=24323
+
+Patch submitted upstream:
+https://gitlab.haskell.org/ghc/ghc/-/merge_requests/2947
+
+diff --git a/testsuite/tests/dynlibs/Makefile b/testsuite/tests/dynlibs/Makefile
+--- a/testsuite/tests/dynlibs/Makefile
++++ b/testsuite/tests/dynlibs/Makefile
+@@ -60,6 +60,4 @@ T5373:
+ .PHONY: T13702
+ T13702:
+ '$(TEST_HC)' -v0 -dynamic -rdynamic -fPIC -pie T13702.hs
+- '$(TEST_HC)' -v0 -dynamic T13702a.hs
+- ./T13702 # first make sure executable itself works
+- ./T13702a # then try dynamically loading it as library
++ ./T13702
+diff --git a/testsuite/tests/dynlibs/T13702.hs b/testsuite/tests/dynlibs/T13702.hs
+--- a/testsuite/tests/dynlibs/T13702.hs
++++ b/testsuite/tests/dynlibs/T13702.hs
+@@ -2,8 +2,3 @@
+
+ main :: IO ()
+ main = putStrLn "hello world"
+-
+-foreign export ccall "hello" hello :: IO ()
+-
+-hello :: IO ()
+-hello = putStrLn "hello world again"
+diff --git a/testsuite/tests/dynlibs/T13702.stdout b/testsuite/tests/dynlibs/T13702.stdout
+--- a/testsuite/tests/dynlibs/T13702.stdout
++++ b/testsuite/tests/dynlibs/T13702.stdout
+@@ -1,2 +1 @@
+ hello world
+-hello world again
+diff --git a/testsuite/tests/dynlibs/T13702a.hs b/testsuite/tests/dynlibs/T13702a.hs
+deleted file mode 100644
+--- a/testsuite/tests/dynlibs/T13702a.hs
++++ /dev/null
+@@ -1,12 +0,0 @@
+-{-# LANGUAGE ForeignFunctionInterface #-}
+-
+-import Foreign
+-import System.Posix.DynamicLinker
+-
+-main :: IO ()
+-main = do
+- dl <- dlopen "./T13702" [RTLD_NOW]
+- funptr <- dlsym dl "hello" :: IO (FunPtr (IO ()))
+- mkAction funptr
+-
+-foreign import ccall "dynamic" mkAction :: FunPtr (IO ()) -> IO ()
diff --git a/gnu/packages/patches/ghostscript-no-header-id.patch b/gnu/packages/patches/ghostscript-no-header-id.patch
index da1aa5530f..45fc95fd6e 100644
--- a/gnu/packages/patches/ghostscript-no-header-id.patch
+++ b/gnu/packages/patches/ghostscript-no-header-id.patch
@@ -9,10 +9,10 @@ See: https://bugs.ghostscript.com/show_bug.cgi?id=698208
diff -ur orig/gnu-ghostscript-9.14.0/devices/vector/gdevpdf.c gnu-ghostscript-9.14.0/devices/vector/gdevpdf.c
--- orig/gnu-ghostscript-9.14.0/devices/vector/gdevpdf.c 2017-07-09 23:30:28.960479189 +0200
+++ gnu-ghostscript-9.14.0/devices/vector/gdevpdf.c 2017-07-09 23:34:34.306524488 +0200
-@@ -1785,8 +1785,11 @@
+@@ -1810,8 +1810,11 @@
* +1 for the linearisation dict and +1 for the primary hint stream.
*/
- linear_params->FirsttrailerOffset = gp_ftell_64(linear_params->Lin_File.file);
+ linear_params->FirsttrailerOffset = gp_ftell(linear_params->Lin_File.file);
- gs_sprintf(LDict, "\ntrailer\n<</Size %ld/Info %d 0 R/Root %d 0 R/ID[%s%s]/Prev %d>>\nstartxref\r\n0\n%%%%EOF\n \n",
- linear_params->LastResource + 3, pdev->ResourceUsage[linear_params->Info_id].NewObjectNumber, pdev->ResourceUsage[linear_params->Catalog_id].NewObjectNumber, fileID, fileID, 0);
+ gs_sprintf(LDict, "\ntrailer\n<</Size %ld/Info %d 0 R/Root %d 0 R",
@@ -20,10 +20,10 @@ diff -ur orig/gnu-ghostscript-9.14.0/devices/vector/gdevpdf.c gnu-ghostscript-9.
+ if (pdev->OwnerPassword.size > 0 || !(!getenv("GS_GENERATE_UUIDS") || (strcasecmp(getenv("GS_GENERATE_UUIDS"), "0") != 0 && strcasecmp(getenv("GS_GENERATE_UUIDS"), "no") != 0))) /* ID is mandatory when encrypting */
+ gs_sprintf(LDict, "/ID[%s%s]", fileID, fileID);
+ gs_sprintf(LDict, "/Prev %d>>\nstartxref\r\n0\n%%%%EOF\n \n", 0);
- fwrite(LDict, strlen(LDict), 1, linear_params->Lin_File.file);
+ gp_fwrite(LDict, strlen(LDict), 1, linear_params->Lin_File.file);
/* Write document catalog (Part 4) */
-@@ -2321,8 +2324,11 @@
+@@ -2346,8 +2349,11 @@
if (code != 0)
return_error(gs_error_ioerror);
@@ -34,10 +34,10 @@ diff -ur orig/gnu-ghostscript-9.14.0/devices/vector/gdevpdf.c gnu-ghostscript-9.
+ if (pdev->OwnerPassword.size > 0 || !(!getenv("GS_GENERATE_UUIDS") || (strcasecmp(getenv("GS_GENERATE_UUIDS"), "0") != 0 || strcasecmp(getenv("GS_GENERATE_UUIDS"), "no") != 0))) /* ID is mandatory when encrypting */
+ gs_sprintf(LDict, "/ID[%s%s]", fileID, fileID);
+ gs_sprintf(LDict, "/Prev %"PRId64">>\nstartxref\r\n0\n%%%%EOF\n", mainxref);
- fwrite(LDict, strlen(LDict), 1, linear_params->sfile);
+ gp_fwrite(LDict, strlen(LDict), 1, linear_params->sfile);
- code = gp_fseek_64(linear_params->sfile, pdev->ResourceUsage[HintStreamObj].LinearisedOffset, SEEK_SET);
-@@ -3016,10 +3022,12 @@
+ code = gp_fseek(linear_params->sfile, pdev->ResourceUsage[HintStreamObj].LinearisedOffset, SEEK_SET);
+@@ -3012,10 +3018,12 @@
stream_puts(s, "trailer\n");
pprintld3(s, "<< /Size %ld /Root %ld 0 R /Info %ld 0 R\n",
pdev->next_id, Catalog_id, Info_id);
diff --git a/gnu/packages/patches/ghostscript-no-header-uuid.patch b/gnu/packages/patches/ghostscript-no-header-uuid.patch
index 473531220c..f4b55764c8 100644
--- a/gnu/packages/patches/ghostscript-no-header-uuid.patch
+++ b/gnu/packages/patches/ghostscript-no-header-uuid.patch
@@ -11,7 +11,7 @@ See: https://bugs.ghostscript.com/show_bug.cgi?id=698208
diff -ur orig/gnu-ghostscript-9.14.0/devices/vector/gdevpdfe.c aa/gnu-ghostscript-9.14.0/devices/vector/gdevpdfe.c
--- orig/gnu-ghostscript-9.14.0/devices/vector/gdevpdfe.c 2017-07-09 23:30:28.960479189 +0200
+++ gnu-ghostscript-9.14.0/devices/vector/gdevpdfe.c 2017-07-10 01:04:12.252478276 +0200
-@@ -617,7 +617,7 @@
+@@ -620,7 +620,7 @@
return code;
/* PDF/A XMP reference recommends setting UUID to empty. If not empty must be a URI */
@@ -20,13 +20,12 @@ diff -ur orig/gnu-ghostscript-9.14.0/devices/vector/gdevpdfe.c aa/gnu-ghostscrip
instance_uuid[0] = 0x00;
cre_date_time_len = pdf_get_docinfo_item(pdev, "/CreationDate", cre_date_time, sizeof(cre_date_time));
-@@ -719,15 +719,18 @@
+@@ -720,14 +720,17 @@
pdf_xml_tag_close(s, "rdf:Description");
pdf_xml_newline(s);
- pdf_xml_tag_open_beg(s, "rdf:Description");
-- pdf_xml_attribute_name(s, "rdf:about");
-- pdf_xml_attribute_value(s, instance_uuid);
+- pdf_xml_copy(s, " rdf:about=\"\"");
- pdf_xml_attribute_name(s, "xmlns:xapMM");
- pdf_xml_attribute_value(s, "http://ns.adobe.com/xap/1.0/mm/");
- pdf_xml_attribute_name(s, "xapMM:DocumentID");
@@ -36,8 +35,7 @@ diff -ur orig/gnu-ghostscript-9.14.0/devices/vector/gdevpdfe.c aa/gnu-ghostscrip
+ 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, "rdf:Description");
-+ pdf_xml_attribute_name(s, "rdf:about");
-+ pdf_xml_attribute_value(s, instance_uuid);
++ pdf_xml_copy(s, " rdf:about=\"\"");
+ pdf_xml_attribute_name(s, "xmlns:xapMM");
+ pdf_xml_attribute_value(s, "http://ns.adobe.com/xap/1.0/mm/");
+ pdf_xml_attribute_name(s, "xapMM:DocumentID");
@@ -47,4 +45,4 @@ diff -ur orig/gnu-ghostscript-9.14.0/devices/vector/gdevpdfe.c aa/gnu-ghostscrip
+ }
pdf_xml_tag_open_beg(s, "rdf:Description");
- pdf_xml_attribute_name(s, "rdf:about");
+ pdf_xml_copy(s, " rdf:about=\"\"");
diff --git a/gnu/packages/patches/giflib-make-reallocarray-private.patch b/gnu/packages/patches/giflib-make-reallocarray-private.patch
deleted file mode 100644
index 69228c5be8..0000000000
--- a/gnu/packages/patches/giflib-make-reallocarray-private.patch
+++ /dev/null
@@ -1,120 +0,0 @@
-Move the declaration from gif_lib.h to gif_lib_private.h to solve
-conflicts when some .c-file #includes both stdlib.h and gif_lib.h.
-See also https://sourceforge.net/p/giflib/bugs/110/
-
-diff -ur giflib-5.1.4.orig/lib/dgif_lib.c giflib-5.1.4/lib/dgif_lib.c
---- giflib-5.1.4.orig/lib/dgif_lib.c 2018-02-28 20:31:02.294682673 +0100
-+++ giflib-5.1.4/lib/dgif_lib.c 2018-02-28 22:38:11.659126414 +0100
-@@ -396,7 +396,7 @@
-
- if (GifFile->SavedImages) {
- SavedImage* new_saved_images =
-- (SavedImage *)reallocarray(GifFile->SavedImages,
-+ (SavedImage *)giflib_private_reallocarray(GifFile->SavedImages,
- (GifFile->ImageCount + 1), sizeof(SavedImage));
- if (new_saved_images == NULL) {
- GifFile->Error = D_GIF_ERR_NOT_ENOUGH_MEM;
-@@ -1108,7 +1108,7 @@
- if (ImageSize > (SIZE_MAX / sizeof(GifPixelType))) {
- return GIF_ERROR;
- }
-- sp->RasterBits = (unsigned char *)reallocarray(NULL, ImageSize,
-+ sp->RasterBits = (unsigned char *)giflib_private_reallocarray(NULL, ImageSize,
- sizeof(GifPixelType));
-
- if (sp->RasterBits == NULL) {
-diff -ur giflib-5.1.4.orig/lib/gifalloc.c giflib-5.1.4/lib/gifalloc.c
---- giflib-5.1.4.orig/lib/gifalloc.c 2018-02-28 20:31:02.294682673 +0100
-+++ giflib-5.1.4/lib/gifalloc.c 2018-02-28 22:38:11.657126423 +0100
-@@ -8,7 +8,7 @@
- #include <stdio.h>
- #include <string.h>
-
--#include "gif_lib.h"
-+#include "gif_lib_private.h"
-
- #define MAX(x, y) (((x) > (y)) ? (x) : (y))
-
-@@ -188,7 +188,7 @@
-
- /* perhaps we can shrink the map? */
- if (RoundUpTo < ColorUnion->ColorCount) {
-- GifColorType *new_map = (GifColorType *)reallocarray(Map,
-+ GifColorType *new_map = (GifColorType *)giflib_private_reallocarray(Map,
- RoundUpTo, sizeof(GifColorType));
- if( new_map == NULL ) {
- GifFreeMapObject(ColorUnion);
-@@ -232,7 +232,7 @@
- if (*ExtensionBlocks == NULL)
- *ExtensionBlocks=(ExtensionBlock *)malloc(sizeof(ExtensionBlock));
- else {
-- ExtensionBlock* ep_new = (ExtensionBlock *)reallocarray
-+ ExtensionBlock* ep_new = (ExtensionBlock *)giflib_private_reallocarray
- (*ExtensionBlocks, (*ExtensionBlockCount + 1),
- sizeof(ExtensionBlock));
- if( ep_new == NULL )
-@@ -325,7 +325,7 @@
- if (GifFile->SavedImages == NULL)
- GifFile->SavedImages = (SavedImage *)malloc(sizeof(SavedImage));
- else
-- GifFile->SavedImages = (SavedImage *)reallocarray(GifFile->SavedImages,
-+ GifFile->SavedImages = (SavedImage *)giflib_private_reallocarray(GifFile->SavedImages,
- (GifFile->ImageCount + 1), sizeof(SavedImage));
-
- if (GifFile->SavedImages == NULL)
-@@ -355,7 +355,7 @@
- }
-
- /* next, the raster */
-- sp->RasterBits = (unsigned char *)reallocarray(NULL,
-+ sp->RasterBits = (unsigned char *)giflib_private_reallocarray(NULL,
- (CopyFrom->ImageDesc.Height *
- CopyFrom->ImageDesc.Width),
- sizeof(GifPixelType));
-@@ -369,7 +369,7 @@
-
- /* finally, the extension blocks */
- if (sp->ExtensionBlocks != NULL) {
-- sp->ExtensionBlocks = (ExtensionBlock *)reallocarray(NULL,
-+ sp->ExtensionBlocks = (ExtensionBlock *)giflib_private_reallocarray(NULL,
- CopyFrom->ExtensionBlockCount,
- sizeof(ExtensionBlock));
- if (sp->ExtensionBlocks == NULL) {
-diff -ur giflib-5.1.4.orig/lib/gif_lib.h giflib-5.1.4/lib/gif_lib.h
---- giflib-5.1.4.orig/lib/gif_lib.h 2018-02-28 20:31:02.294682673 +0100
-+++ giflib-5.1.4/lib/gif_lib.h 2018-02-28 20:31:43.135716712 +0100
-@@ -244,9 +244,6 @@
- GifPixelType ColorTransIn2[]);
- extern int GifBitSize(int n);
-
--extern void *
--reallocarray(void *optr, size_t nmemb, size_t size);
--
- /******************************************************************************
- Support for the in-core structures allocation (slurp mode).
- ******************************************************************************/
-diff -ur giflib-5.1.4.orig/lib/gif_lib_private.h giflib-5.1.4/lib/gif_lib_private.h
---- giflib-5.1.4.orig/lib/gif_lib_private.h 2018-02-28 20:31:02.294682673 +0100
-+++ giflib-5.1.4/lib/gif_lib_private.h 2018-02-28 22:38:11.657126423 +0100
-@@ -54,6 +54,9 @@
- bool gif89;
- } GifFilePrivateType;
-
-+extern void *
-+giflib_private_reallocarray(void *optr, size_t nmemb, size_t size);
-+
- #endif /* _GIF_LIB_PRIVATE_H */
-
- /* end */
-diff -ur giflib-5.1.4.orig/lib/openbsd-reallocarray.c giflib-5.1.4/lib/openbsd-reallocarray.c
---- giflib-5.1.4.orig/lib/openbsd-reallocarray.c 2018-02-28 20:31:02.295682659 +0100
-+++ giflib-5.1.4/lib/openbsd-reallocarray.c 2018-02-28 22:38:11.656126428 +0100
-@@ -27,7 +27,7 @@
- #define MUL_NO_OVERFLOW ((size_t)1 << (sizeof(size_t) * 4))
-
- void *
--reallocarray(void *optr, size_t nmemb, size_t size)
-+giflib_private_reallocarray(void *optr, size_t nmemb, size_t size)
- {
- if ((nmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) &&
- nmemb > 0 && SIZE_MAX / nmemb < size) {
diff --git a/gnu/packages/patches/git-annex-S3v4.patch b/gnu/packages/patches/git-annex-S3v4.patch
new file mode 100644
index 0000000000..9f7cea329e
--- /dev/null
+++ b/gnu/packages/patches/git-annex-S3v4.patch
@@ -0,0 +1,77 @@
+From the upstream commit, with the changes to CHANGELOG and the docs
+folder removed.
+
+From 1532d67c3ecf452b8c86bcc5928525398755cd01 Mon Sep 17 00:00:00 2001
+From: Joey Hess <joeyh@joeyh.name>
+Date: Thu, 7 May 2020 13:18:11 -0400
+Subject: [PATCH] S3: Support signature=v4
+
+To use S3 Signature Version 4. Some S3 services seem to require v4, while
+others may only support v2, which remains the default.
+
+I'm also not sure if v4 works correctly in all cases, there is this
+upstream bug report: https://github.com/aristidb/aws/issues/262
+I've only tested it against the default S3 endpoint.
+---
+ CHANGELOG | 3 +++
+ Remote/S3.hs | 23 ++++++++++++++++++-
+ ..._3bbdf23c8a4a480f4f6b8e8a2f8ddecd._comment | 13 +++++++++++
+ ..._854390b9a781da82ecb85ad85eecad04._comment | 13 +++++++++++
+ doc/special_remotes/S3.mdwn | 4 ++++
+ ..._cf57e8dbd9fdc7c487565b61808b6bb2._comment | 10 ++++++++
+ 6 files changed, 65 insertions(+), 1 deletion(-)
+ create mode 100644 doc/bugs/S3_special_remote_support_for_DigitalOcean_Spaces/comment_2_3bbdf23c8a4a480f4f6b8e8a2f8ddecd._comment
+ create mode 100644 doc/forum/backblaze_s3/comment_1_854390b9a781da82ecb85ad85eecad04._comment
+ create mode 100644 doc/special_remotes/S3/comment_34_cf57e8dbd9fdc7c487565b61808b6bb2._comment
+
+diff --git a/Remote/S3.hs b/Remote/S3.hs
+index cb345d1f8..e3ea492f2 100644
+--- a/Remote/S3.hs
++++ b/Remote/S3.hs
+@@ -99,6 +99,8 @@ remote = specialRemoteType $ RemoteType
+ (FieldDesc "port to connect to")
+ , optionalStringParser requeststyleField
+ (FieldDesc "for path-style requests, set to \"path\"")
++ , signatureVersionParser signatureField
++ (FieldDesc "S3 signature version")
+ , optionalStringParser mungekeysField HiddenField
+ , optionalStringParser AWS.s3credsField HiddenField
+ ]
+@@ -148,6 +150,22 @@ protocolField = Accepted "protocol"
+ requeststyleField :: RemoteConfigField
+ requeststyleField = Accepted "requeststyle"
+
++signatureField :: RemoteConfigField
++signatureField = Accepted "signature"
++
++newtype SignatureVersion = SignatureVersion Int
++
++signatureVersionParser :: RemoteConfigField -> FieldDesc -> RemoteConfigFieldParser
++signatureVersionParser f fd =
++ genParser go f defver fd
++ (Just (ValueDesc "v2 or v4"))
++ where
++ go "v2" = Just (SignatureVersion 2)
++ go "v4" = Just (SignatureVersion 4)
++ go _ = Nothing
++
++ defver = SignatureVersion 2
++
+ portField :: RemoteConfigField
+ portField = Accepted "port"
+
+@@ -877,7 +895,10 @@ s3Configuration c = cfg
+ Nothing
+ | port == 443 -> AWS.HTTPS
+ | otherwise -> AWS.HTTP
+- cfg = S3.s3 proto endpoint False
++ cfg = case getRemoteConfigValue signatureField c of
++ Just (SignatureVersion 4) ->
++ S3.s3v4 proto endpoint False S3.SignWithEffort
++ _ -> S3.s3 proto endpoint False
+
+ data S3Info = S3Info
+ { bucket :: S3.Bucket
+--
+2.26.2
+
diff --git a/gnu/packages/patches/glibc-2.29-supported-locales.patch b/gnu/packages/patches/glibc-2.29-supported-locales.patch
new file mode 100644
index 0000000000..05865dc7be
--- /dev/null
+++ b/gnu/packages/patches/glibc-2.29-supported-locales.patch
@@ -0,0 +1,33 @@
+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 b/localedata/Makefile
+index 65079f9eb8..14818f84e0 100644
+--- a/localedata/Makefile
++++ b/localedata/Makefile
+@@ -169,7 +169,8 @@ endif
+ # Files to install.
+ install-others := $(addprefix $(inst_i18ndir)/, \
+ $(addsuffix .gz, $(charmaps)) \
+- $(locales))
++ $(locales)) \
++ $(inst_i18ndir)/SUPPORTED
+
+ tests: $(objdir)/iconvdata/gconv-modules
+
+@@ -380,6 +381,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-LOCALE-ARCHIVE=$(addprefix install-archive-, $(SUPPORTED-LOCALES))
+ INSTALL-SUPPORTED-LOCALE-FILES=$(addprefix install-files-, $(SUPPORTED-LOCALES))
+ \ No newline at end of file
diff --git a/gnu/packages/patches/glibc-CVE-2019-19126.patch b/gnu/packages/patches/glibc-CVE-2019-19126.patch
new file mode 100644
index 0000000000..5b9ac58ab7
--- /dev/null
+++ b/gnu/packages/patches/glibc-CVE-2019-19126.patch
@@ -0,0 +1,22 @@
+Fix CVE-2019-19126:
+
+https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-19126
+https://sourceware.org/bugzilla/show_bug.cgi?id=25204
+
+Taken from upstream:
+https://sourceware.org/git/?p=glibc.git;a=commit;h=37c90e117310728a4ad1eb998c0bbe7d79c4a398
+
+diff --git a/sysdeps/unix/sysv/linux/x86_64/64/dl-librecon.h b/sysdeps/unix/sysv/linux/x86_64/64/dl-librecon.h
+index 975cbe2..df2cdfd 100644
+--- a/sysdeps/unix/sysv/linux/x86_64/64/dl-librecon.h
++++ b/sysdeps/unix/sysv/linux/x86_64/64/dl-librecon.h
+@@ -31,7 +31,8 @@
+ environment variable, LD_PREFER_MAP_32BIT_EXEC. */
+ #define EXTRA_LD_ENVVARS \
+ case 21: \
+- if (memcmp (envline, "PREFER_MAP_32BIT_EXEC", 21) == 0) \
++ if (!__libc_enable_secure \
++ && memcmp (envline, "PREFER_MAP_32BIT_EXEC", 21) == 0) \
+ GLRO(dl_x86_cpu_features).feature[index_arch_Prefer_MAP_32BIT_EXEC] \
+ |= bit_arch_Prefer_MAP_32BIT_EXEC; \
+ break;
diff --git a/gnu/packages/patches/glibc-bootstrap-system-2.2.5.patch b/gnu/packages/patches/glibc-bootstrap-system-2.2.5.patch
new file mode 100644
index 0000000000..d11fc00c75
--- /dev/null
+++ b/gnu/packages/patches/glibc-bootstrap-system-2.2.5.patch
@@ -0,0 +1,30 @@
+We want to allow builds in chroots that lack /bin/sh. Thus, system(3)
+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
+@@ -106,8 +106,8 @@ do_system (const char *line)
+ (void) UNBLOCK;
+
+ /* Exec the shell. */
+- (void) __execve (SHELL_PATH, (char *const *) new_argv, __environ);
++ (void) execvp (SHELL_NAME, (char *const *) new_argv);
+ _exit (127);
+ }
+ else if (pid < (pid_t) 0)
+ /* The fork failed. */
+--- a/libio/iopopen.c
++++ b/libio/iopopen.c
+@@ -170,7 +170,7 @@ _IO_new_proc_open (fp, command, mode)
+ for (p = proc_file_chain; p; p = p->next)
+ _IO_close (_IO_fileno ((_IO_FILE *) p));
+
+- _IO_execl ("/bin/sh", "sh", "-c", command, (char *) 0);
++ execlp ("sh", "sh", "-c", command, (char *) 0);
+ _IO__exit (127);
+ }
+ _IO_close (child_end);
+
+
diff --git a/gnu/packages/patches/glibc-hurd-clock_gettime_monotonic.patch b/gnu/packages/patches/glibc-hurd-clock_gettime_monotonic.patch
new file mode 100644
index 0000000000..1c3fe427f9
--- /dev/null
+++ b/gnu/packages/patches/glibc-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-hurd-clock_t_centiseconds.patch b/gnu/packages/patches/glibc-hurd-clock_t_centiseconds.patch
new file mode 100644
index 0000000000..8f9676c873
--- /dev/null
+++ b/gnu/packages/patches/glibc-hurd-clock_t_centiseconds.patch
@@ -0,0 +1,90 @@
+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
+
+ commit d57f2f9b4bd007846af2fb4217486ea572579010
+ Author: Richard Braun <rbraun@sceen.net>
+ Date: Tue Aug 27 11:35:31 2013 +0200
+
+ Express CPU time (clock_t of times(2)) in centiseconds
+
+From 170c292b643fdc1eb56881e6592b07c0c019993e Mon Sep 17 00:00:00 2001
+From: Jan Nieuwenhuizen <janneke@gnu.org>
+Date: Mon, 2 Mar 2020 18:28:54 +0100
+Subject: [PATCH 1/2] Express CPU time (clock_t) in centiseconds
+
+---
+ sysdeps/mach/hurd/clock.c | 8 ++++----
+ sysdeps/mach/hurd/getclktck.c | 5 ++---
+ sysdeps/mach/hurd/setitimer.c | 2 +-
+ sysdeps/mach/hurd/times.c | 2 +-
+ 4 files changed, 8 insertions(+), 9 deletions(-)
+
+diff --git a/sysdeps/mach/hurd/clock.c b/sysdeps/mach/hurd/clock.c
+index 7cb42df786..4db49b579d 100644
+--- a/sysdeps/mach/hurd/clock.c
++++ b/sysdeps/mach/hurd/clock.c
+@@ -44,10 +44,10 @@ clock (void)
+ if (err)
+ return __hurd_fail (err);
+
+- total = bi.user_time.seconds * 1000000 + bi.user_time.microseconds;
+- total += tti.user_time.seconds * 1000000 + tti.user_time.microseconds;
+- total += bi.system_time.seconds * 1000000 + bi.system_time.microseconds;
+- total += tti.system_time.seconds * 1000000 + tti.system_time.microseconds;
++ total = bi.user_time.seconds * 100 + bi.user_time.microseconds / 10000;
++ total += tti.user_time.seconds * 100 + tti.user_time.microseconds / 10000;
++ total += bi.system_time.seconds * 100 + bi.system_time.microseconds / 10000;
++ total += tti.system_time.seconds * 100 + tti.system_time.microseconds / 10000;
+
+ return total;
+ }
+diff --git a/sysdeps/mach/hurd/getclktck.c b/sysdeps/mach/hurd/getclktck.c
+index 943e36e805..5a3cf0930b 100644
+--- a/sysdeps/mach/hurd/getclktck.c
++++ b/sysdeps/mach/hurd/getclktck.c
+@@ -18,12 +18,11 @@
+
+ #include <time.h>
+
+-/* Return frequency of `times'.
+- Since Mach reports CPU times in microseconds, we always use 1 million. */
++/* Return frequency of `times'. */
+ int
+ __getclktck (void)
+ {
+- return 1000000;
++ return 100;
+ }
+
+ /* Before glibc 2.2, the Hurd actually did this differently, so we
+diff --git a/sysdeps/mach/hurd/setitimer.c b/sysdeps/mach/hurd/setitimer.c
+index b16f4ddd5d..8bf1464830 100644
+--- a/sysdeps/mach/hurd/setitimer.c
++++ b/sysdeps/mach/hurd/setitimer.c
+@@ -43,7 +43,7 @@ quantize_timeval (struct timeval *tv)
+ static time_t quantum = -1;
+
+ if (quantum == -1)
+- quantum = 1000000 / __getclktck ();
++ quantum = 100 / __getclktck ();
+
+ tv->tv_usec = ((tv->tv_usec + (quantum - 1)) / quantum) * quantum;
+ if (tv->tv_usec >= 1000000)
+diff --git a/sysdeps/mach/hurd/times.c b/sysdeps/mach/hurd/times.c
+index 23ed992783..cbf6039b19 100644
+--- a/sysdeps/mach/hurd/times.c
++++ b/sysdeps/mach/hurd/times.c
+@@ -29,7 +29,7 @@
+ static inline clock_t
+ clock_from_time_value (const time_value_t *t)
+ {
+- return t->seconds * 1000000 + t->microseconds;
++ return t->seconds * 100 + t->microseconds / 10000;
+ }
+
+ /* Store the CPU time used by this process and all its
+--
+2.24.0
+
diff --git a/gnu/packages/patches/glibc-hurd-gettyent.patch b/gnu/packages/patches/glibc-hurd-gettyent.patch
new file mode 100644
index 0000000000..721a8d4fa8
--- /dev/null
+++ b/gnu/packages/patches/glibc-hurd-gettyent.patch
@@ -0,0 +1,34 @@
+From d6d2caef3e44d0713bb6625f697a1ec615abae70 Mon Sep 17 00:00:00 2001
+From: "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org>
+Date: Sun, 5 Apr 2020 16:29:54 +0200
+Subject: [PATCH 4/4] misc: Choose a longer arbitrary line length.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This allows running specifying a `getty' in the GNU Guix store.
+
+* misc/getttyent.c (MAXLINELENGTH): Use 512 (instead of 100) as
+another "great" arbitrary limit.
+
+Co-Authored-By: Ludovic Courtès <ludo@gnu.org>
+---
+ misc/getttyent.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/misc/getttyent.c b/misc/getttyent.c
+index 92d92b026f..508d296291 100644
+--- a/misc/getttyent.c
++++ b/misc/getttyent.c
+@@ -66,7 +66,7 @@ __getttyent (void)
+ static struct ttyent tty;
+ int c;
+ char *p;
+-#define MAXLINELENGTH 100
++#define MAXLINELENGTH 512
+ static char line[MAXLINELENGTH];
+
+ if (!tf && !__setttyent())
+--
+2.26.0
+
diff --git a/gnu/packages/patches/glibc-hurd-mach-print.patch b/gnu/packages/patches/glibc-hurd-mach-print.patch
new file mode 100644
index 0000000000..7fdf6733d0
--- /dev/null
+++ b/gnu/packages/patches/glibc-hurd-mach-print.patch
@@ -0,0 +1,23 @@
+Provide a 'mach_print' symbol in libc.
+
+--- a/sysdeps/mach/hurd/i386/libc.abilist 2020-04-01 19:22:44.710088821 +0200
++++ b/sysdeps/mach/hurd/i386/libc.abilist 2020-04-01 19:22:52.062051161 +0200
+@@ -338,6 +338,7 @@
+ GLIBC_2.2.6 __mach_port_allocate F
+ GLIBC_2.2.6 __mach_port_deallocate F
+ GLIBC_2.2.6 __mach_port_insert_right F
++GLIBC_2.21 __mach_print F
+ GLIBC_2.2.6 __mach_reply_port F
+ GLIBC_2.2.6 __mach_task_self_ D 0x4
+ GLIBC_2.2.6 __mach_thread_self F
+
+--- a/mach/Versions
++++ b/mach/Versions
+@@ -56,6 +56,7 @@
+ }
+ GLIBC_2.21 {
+ __mach_host_self_;
++ mach_print;
+ }
+
+ HURD_CTHREADS_0.3 {
diff --git a/gnu/packages/patches/glibc-hurd-signal-sa-siginfo.patch b/gnu/packages/patches/glibc-hurd-signal-sa-siginfo.patch
new file mode 100644
index 0000000000..36ea55e188
--- /dev/null
+++ b/gnu/packages/patches/glibc-hurd-signal-sa-siginfo.patch
@@ -0,0 +1,637 @@
+This patch is needed to build e2fsprogs, util-linux.
+
+Taken from https://salsa.debian.org/glibc-team/glibc/-/blob/glibc-2.31/debian/patches/hurd-i386/tg-hurdsig-SA_SIGINFO.diff
+
+From: Jeremie Koenig <jk@jk.fr.eu.org>
+Subject: [PATCH] implement SA_SIGINFO signal handlers.
+
+ 52baaca Hurd signals: Copy bits/sigaction.h
+ 4232c66 Hurd signals: SA_SIGINFO support
+ 1831cfe Hurd signals: Use POSIX sigcodes
+
+---
+ hurd/hurd/signal.h | 5 +
+ hurd/hurdfault.c | 2
+ hurd/hurdinit.c | 2
+ hurd/hurdsig.c | 6 -
+ sysdeps/mach/hurd/bits/sigaction.h | 86 +++++++++++++++++++++
+ sysdeps/mach/hurd/i386/bits/sigcontext.h | 4
+ sysdeps/mach/hurd/i386/exc2signal.c | 123 +++++++++++++++++++-----------
+ sysdeps/mach/hurd/i386/trampoline.c | 125 ++++++++++++++++++++++++++++---
+ sysdeps/mach/hurd/kill.c | 2
+ sysdeps/mach/hurd/setitimer.c | 2
+ 10 files changed, 293 insertions(+), 64 deletions(-)
+
+Index: glibc-2.31/hurd/hurd/signal.h
+===================================================================
+--- glibc-2.31.orig/hurd/hurd/signal.h
++++ glibc-2.31/hurd/hurd/signal.h
+@@ -290,6 +290,11 @@ extern int _hurd_raise_signal (struct hu
+ extern void _hurd_exception2signal (struct hurd_signal_detail *detail,
+ int *signo);
+
++/* Translate a Mach exception into a signal with a legacy sigcode. */
++
++extern void _hurd_exception2signal_legacy (struct hurd_signal_detail *detail,
++ int *signo);
++
+
+ /* Make the thread described by SS take the signal described by SIGNO and
+ DETAIL. If the process is traced, this will in fact stop with a SIGNO
+Index: glibc-2.31/hurd/hurdfault.c
+===================================================================
+--- glibc-2.31.orig/hurd/hurdfault.c
++++ glibc-2.31/hurd/hurdfault.c
+@@ -70,7 +70,7 @@ _hurdsig_fault_catch_exception_raise (ma
+ codes into a signal number and subcode. */
+ _hurd_exception2signal (&d, &signo);
+
+- return HURD_PREEMPT_SIGNAL_P (&_hurdsig_fault_preemptor, signo, d.code)
++ return HURD_PREEMPT_SIGNAL_P (&_hurdsig_fault_preemptor, signo, d.exc_subcode)
+ ? 0 : EGREGIOUS;
+ }
+
+Index: glibc-2.31/hurd/hurdinit.c
+===================================================================
+--- glibc-2.31.orig/hurd/hurdinit.c
++++ glibc-2.31/hurd/hurdinit.c
+@@ -177,7 +177,7 @@ _hurd_new_proc_init (char **argv,
+ /* This process is "traced", meaning it should stop on signals or exec.
+ We are all set up now to handle signals. Stop ourselves, to inform
+ our parent (presumably a debugger) that the exec has completed. */
+- __msg_sig_post (_hurd_msgport, SIGTRAP, 0, __mach_task_self ());
++ __msg_sig_post (_hurd_msgport, SIGTRAP, TRAP_TRACE, __mach_task_self ());
+ }
+
+ #include <shlib-compat.h>
+Index: glibc-2.31/hurd/hurdsig.c
+===================================================================
+--- glibc-2.31.orig/hurd/hurdsig.c
++++ glibc-2.31/hurd/hurdsig.c
+@@ -730,7 +730,7 @@ post_signal (struct hurd_sigstate *ss,
+ { /* PE cannot be null. */
+ do
+ {
+- if (HURD_PREEMPT_SIGNAL_P (pe, signo, detail->code))
++ if (HURD_PREEMPT_SIGNAL_P (pe, signo, detail->exc_subcode))
+ {
+ if (pe->preemptor)
+ {
+@@ -1374,7 +1374,7 @@ _S_msg_sig_post (mach_port_t me,
+ if (err = signal_allowed (signo, refport))
+ return err;
+
+- d.code = sigcode;
++ d.code = d.exc_subcode = sigcode;
+ d.exc = 0;
+
+ /* Post the signal to a global receiver thread (or mark it pending in
+@@ -1403,7 +1403,7 @@ _S_msg_sig_post_untraced (mach_port_t me
+ if (err = signal_allowed (signo, refport))
+ return err;
+
+- d.code = sigcode;
++ d.code = d.exc_subcode = sigcode;
+ d.exc = 0;
+
+ /* Post the signal to the designated signal-receiving thread. This will
+Index: glibc-2.31/sysdeps/mach/hurd/bits/sigaction.h
+===================================================================
+--- /dev/null
++++ glibc-2.31/sysdeps/mach/hurd/bits/sigaction.h
+@@ -0,0 +1,86 @@
++/* Copyright (C) 1991-2015 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, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#ifndef _BITS_SIGACTION_H
++#define _BITS_SIGACTION_H 1
++
++#ifndef _SIGNAL_H
++# error "Never include <bits/sigaction.h> directly; use <signal.h> instead."
++#endif
++
++/* These definitions match those used by the 4.4 BSD kernel.
++ If the operating system has a `sigaction' system call that correctly
++ implements the POSIX.1 behavior, there should be a system-dependent
++ version of this file that defines `struct sigaction' and the `SA_*'
++ constants appropriately. */
++
++/* Structure describing the action to be taken when a signal arrives. */
++struct sigaction
++ {
++ /* Signal handler. */
++#if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED
++ union
++ {
++ /* Used if SA_SIGINFO is not set. */
++ __sighandler_t sa_handler;
++ /* Used if SA_SIGINFO is set. */
++ void (*sa_sigaction) (int, siginfo_t *, void *);
++ }
++ __sigaction_handler;
++# define sa_handler __sigaction_handler.sa_handler
++# define sa_sigaction __sigaction_handler.sa_sigaction
++#else
++ __sighandler_t sa_handler;
++#endif
++
++ /* Additional set of signals to be blocked. */
++ __sigset_t sa_mask;
++
++ /* Special flags. */
++ int sa_flags;
++ };
++
++/* Bits in `sa_flags'. */
++#if defined __USE_XOPEN_EXTENDED || defined __USE_MISC
++# define SA_ONSTACK 0x0001 /* Take signal on signal stack. */
++#endif
++#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
++# define SA_RESTART 0x0002 /* Restart syscall on signal return. */
++# define SA_NODEFER 0x0010 /* Don't automatically block the signal when
++ its handler is being executed. */
++# define SA_RESETHAND 0x0004 /* Reset to SIG_DFL on entry to handler. */
++#endif
++#define SA_NOCLDSTOP 0x0008 /* Don't send SIGCHLD when children stop. */
++#define SA_SIGINFO 0x0040 /* Signal handler with SA_SIGINFO args */
++
++#ifdef __USE_MISC
++# define SA_INTERRUPT 0 /* Historical no-op ("not SA_RESTART"). */
++
++/* Some aliases for the SA_ constants. */
++# define SA_NOMASK SA_NODEFER
++# define SA_ONESHOT SA_RESETHAND
++# define SA_STACK SA_ONSTACK
++#endif
++
++
++/* Values for the HOW argument to `sigprocmask'. */
++#define SIG_BLOCK 1 /* Block signals. */
++#define SIG_UNBLOCK 2 /* Unblock signals. */
++#define SIG_SETMASK 3 /* Set the set of blocked signals. */
++
++#endif
+Index: glibc-2.31/sysdeps/mach/hurd/i386/bits/sigcontext.h
+===================================================================
+--- glibc-2.31.orig/sysdeps/mach/hurd/i386/bits/sigcontext.h
++++ glibc-2.31/sysdeps/mach/hurd/i386/bits/sigcontext.h
+@@ -97,6 +97,10 @@ struct sigcontext
+ #define sc_ps sc_efl
+
+
++/* The deprecated sigcode values below are passed as an extra, non-portable
++ argument to regular signal handlers. You should use SA_SIGINFO handlers
++ instead, which use the standard POSIX signal codes. */
++
+ /* Codes for SIGFPE. */
+ #define FPE_INTOVF_TRAP 0x1 /* integer overflow */
+ #define FPE_INTDIV_FAULT 0x2 /* integer divide by zero */
+Index: glibc-2.31/sysdeps/mach/hurd/i386/exc2signal.c
+===================================================================
+--- glibc-2.31.orig/sysdeps/mach/hurd/i386/exc2signal.c
++++ glibc-2.31/sysdeps/mach/hurd/i386/exc2signal.c
+@@ -23,8 +23,8 @@
+ /* Translate the Mach exception codes, as received in an `exception_raise' RPC,
+ into a signal number and signal subcode. */
+
+-void
+-_hurd_exception2signal (struct hurd_signal_detail *detail, int *signo)
++static void
++exception2signal (struct hurd_signal_detail *detail, int *signo, int posix)
+ {
+ detail->error = 0;
+
+@@ -36,44 +36,62 @@ _hurd_exception2signal (struct hurd_sign
+ break;
+
+ case EXC_BAD_ACCESS:
+- if (detail->exc_code == KERN_INVALID_ADDRESS
+- || detail->exc_code == KERN_PROTECTION_FAILURE
+- || detail->exc_code == KERN_WRITE_PROTECTION_FAILURE)
+- *signo = SIGSEGV;
+- else
+- *signo = SIGBUS;
+- detail->code = detail->exc_subcode;
++ switch (detail->exc_code)
++ {
++ case KERN_INVALID_ADDRESS:
++ case KERN_MEMORY_FAILURE:
++ *signo = SIGSEGV;
++ detail->code = posix ? SEGV_MAPERR : detail->exc_subcode;
++ break;
++
++ case KERN_PROTECTION_FAILURE:
++ case KERN_WRITE_PROTECTION_FAILURE:
++ *signo = SIGSEGV;
++ detail->code = posix ? SEGV_ACCERR : detail->exc_subcode;
++ break;
++
++ default:
++ *signo = SIGBUS;
++ detail->code = posix ? BUS_ADRERR : detail->exc_subcode;
++ break;
++ }
+ detail->error = detail->exc_code;
+ break;
+
+ case EXC_BAD_INSTRUCTION:
+ *signo = SIGILL;
+- if (detail->exc_code == EXC_I386_INVOP)
+- detail->code = ILL_INVOPR_FAULT;
+- else if (detail->exc_code == EXC_I386_STKFLT)
+- detail->code = ILL_STACK_FAULT;
+- else
+- detail->code = 0;
++ switch (detail->exc_code)
++ {
++ case EXC_I386_INVOP:
++ detail->code = posix ? ILL_ILLOPC : ILL_INVOPR_FAULT;
++ break;
++
++ case EXC_I386_STKFLT:
++ detail->code = posix ? ILL_BADSTK : ILL_STACK_FAULT;
++ break;
++
++ default:
++ detail->code = 0;
++ break;
++ }
+ break;
+
+ case EXC_ARITHMETIC:
++ *signo = SIGFPE;
+ switch (detail->exc_code)
+ {
+ case EXC_I386_DIV: /* integer divide by zero */
+- *signo = SIGFPE;
+- detail->code = FPE_INTDIV_FAULT;
++ detail->code = posix ? FPE_INTDIV : FPE_INTDIV_FAULT;
+ break;
+
+ case EXC_I386_INTO: /* integer overflow */
+- *signo = SIGFPE;
+- detail->code = FPE_INTOVF_TRAP;
++ detail->code = posix ? FPE_INTOVF : FPE_INTOVF_TRAP;
+ break;
+
+ /* These aren't anywhere documented or used in Mach 3.0. */
+ case EXC_I386_NOEXT:
+ case EXC_I386_EXTOVR:
+ default:
+- *signo = SIGFPE;
+ detail->code = 0;
+ break;
+
+@@ -82,51 +100,43 @@ _hurd_exception2signal (struct hurd_sign
+ Give an error code corresponding to the first bit set. */
+ if (detail->exc_subcode & FPS_IE)
+ {
+- *signo = SIGILL;
+- detail->code = ILL_FPEOPR_FAULT;
++ /* NB: We used to send SIGILL here but we can't distinguish
++ POSIX vs. legacy with respect to what signal we send. */
++ detail->code = posix ? FPE_FLTINV : 0 /*ILL_FPEOPR_FAULT*/;
+ }
+ else if (detail->exc_subcode & FPS_DE)
+ {
+- *signo = SIGFPE;
+- detail->code = FPE_FLTDNR_FAULT;
++ detail->code = posix ? FPE_FLTUND : FPE_FLTDNR_FAULT;
+ }
+ else if (detail->exc_subcode & FPS_ZE)
+ {
+- *signo = SIGFPE;
+- detail->code = FPE_FLTDIV_FAULT;
++ detail->code = posix ? FPE_FLTDIV : FPE_FLTDIV_FAULT;
+ }
+ else if (detail->exc_subcode & FPS_OE)
+ {
+- *signo = SIGFPE;
+- detail->code = FPE_FLTOVF_FAULT;
++ detail->code = posix ? FPE_FLTOVF : FPE_FLTOVF_FAULT;
+ }
+ else if (detail->exc_subcode & FPS_UE)
+ {
+- *signo = SIGFPE;
+- detail->code = FPE_FLTUND_FAULT;
++ detail->code = posix ? FPE_FLTUND : FPE_FLTUND_FAULT;
+ }
+ else if (detail->exc_subcode & FPS_PE)
+ {
+- *signo = SIGFPE;
+- detail->code = FPE_FLTINX_FAULT;
++ detail->code = posix ? FPE_FLTRES : FPE_FLTINX_FAULT;
+ }
+ else
+ {
+- *signo = SIGFPE;
+ detail->code = 0;
+ }
+ break;
+
+ /* These two can only be arithmetic exceptions if we
+- are in V86 mode, which sounds like emulation to me.
+- (See Mach 3.0 i386/trap.c.) */
++ are in V86 mode. (See Mach 3.0 i386/trap.c.) */
+ case EXC_I386_EMERR:
+- *signo = SIGFPE;
+- detail->code = FPE_EMERR_FAULT;
++ detail->code = posix ? 0 : FPE_EMERR_FAULT;
+ break;
+ case EXC_I386_BOUND:
+- *signo = SIGFPE;
+- detail->code = FPE_EMBND_FAULT;
++ detail->code = posix ? FPE_FLTSUB : FPE_EMBND_FAULT;
+ break;
+ }
+ break;
+@@ -143,7 +153,7 @@ _hurd_exception2signal (struct hurd_sign
+ if (detail->exc_code == EXC_I386_BOUND)
+ {
+ *signo = SIGFPE;
+- detail->code = FPE_SUBRNG_FAULT;
++ detail->code = posix ? FPE_FLTSUB : FPE_SUBRNG_FAULT;
+ }
+ else
+ {
+@@ -154,13 +164,34 @@ _hurd_exception2signal (struct hurd_sign
+
+ case EXC_BREAKPOINT:
+ *signo = SIGTRAP;
+- if (detail->exc_code == EXC_I386_SGL)
+- detail->code = DBG_SINGLE_TRAP;
+- else if (detail->exc_code == EXC_I386_BPT)
+- detail->code = DBG_BRKPNT_FAULT;
+- else
+- detail->code = 0;
++ switch (detail->exc_code)
++ {
++ case EXC_I386_SGL:
++ detail->code = posix ? TRAP_BRKPT : DBG_SINGLE_TRAP;
++ break;
++
++ case EXC_I386_BPT:
++ detail->code = posix ? TRAP_BRKPT : DBG_BRKPNT_FAULT;
++ break;
++
++ default:
++ detail->code = 0;
++ break;
++ }
+ break;
+ }
+ }
+ libc_hidden_def (_hurd_exception2signal)
++
++void
++_hurd_exception2signal (struct hurd_signal_detail *detail, int *signo)
++{
++ exception2signal (detail, signo, 1);
++}
++
++void
++_hurd_exception2signal_legacy (struct hurd_signal_detail *detail, int *signo)
++{
++ exception2signal (detail, signo, 0);
++}
++
+Index: glibc-2.31/sysdeps/mach/hurd/i386/trampoline.c
+===================================================================
+--- glibc-2.31.orig/sysdeps/mach/hurd/i386/trampoline.c
++++ glibc-2.31/sysdeps/mach/hurd/i386/trampoline.c
+@@ -19,13 +19,66 @@
+ #include <hurd/signal.h>
+ #include <hurd/userlink.h>
+ #include <thread_state.h>
++#include <mach/exception.h>
+ #include <mach/machine/eflags.h>
+ #include <assert.h>
+ #include <errno.h>
+ #include "hurdfault.h"
+ #include <intr-msg.h>
++#include <sys/ucontext.h>
+
+
++/* Fill in a siginfo_t structure for SA_SIGINFO-enabled handlers. */
++static void fill_siginfo (siginfo_t *si, int signo,
++ const struct hurd_signal_detail *detail,
++ const struct machine_thread_all_state *state)
++{
++ si->si_signo = signo;
++ si->si_errno = detail->error;
++ si->si_code = detail->code;
++
++ /* XXX We would need a protocol change for sig_post to include
++ * this information. */
++ si->si_pid = -1;
++ si->si_uid = -1;
++
++ /* Address of the faulting instruction or memory access. */
++ if (detail->exc == EXC_BAD_ACCESS)
++ si->si_addr = (void *) detail->exc_subcode;
++ else
++ si->si_addr = (void *) state->basic.eip;
++
++ /* XXX On SIGCHLD, this should be the exit status of the child
++ * process. We would need a protocol change for the proc server
++ * to send this information along with the signal. */
++ si->si_status = 0;
++
++ si->si_band = 0; /* SIGPOLL is not supported yet. */
++ si->si_value.sival_int = 0; /* sigqueue() is not supported yet. */
++}
++
++/* Fill in a ucontext_t structure SA_SIGINFO-enabled handlers. */
++static void fill_ucontext (ucontext_t *uc, const struct sigcontext *sc)
++{
++ uc->uc_flags = 0;
++ uc->uc_link = NULL;
++ uc->uc_sigmask = sc->sc_mask;
++ uc->uc_stack.ss_sp = (__ptr_t) sc->sc_esp;
++ uc->uc_stack.ss_size = 0;
++ uc->uc_stack.ss_flags = 0;
++
++ /* Registers. */
++ memcpy (&uc->uc_mcontext.gregs[REG_GS], &sc->sc_gs,
++ (REG_TRAPNO - REG_GS) * sizeof (int));
++ uc->uc_mcontext.gregs[REG_TRAPNO] = 0;
++ uc->uc_mcontext.gregs[REG_ERR] = 0;
++ memcpy (&uc->uc_mcontext.gregs[REG_EIP], &sc->sc_eip,
++ (NGREG - REG_EIP) * sizeof (int));
++
++ /* XXX FPU state. */
++ memset (&uc->uc_mcontext.fpregs, 0, sizeof (fpregset_t));
++}
++
+ struct sigcontext *
+ _hurd_setup_sighandler (struct hurd_sigstate *ss, __sighandler_t handler,
+ int signo, struct hurd_signal_detail *detail,
+@@ -43,15 +96,38 @@ _hurd_setup_sighandler (struct hurd_sigs
+ struct
+ {
+ int signo;
+- long int sigcode;
+- struct sigcontext *scp; /* Points to ctx, below. */
++ union
++ {
++ /* Extra arguments for traditional signal handlers */
++ struct
++ {
++ long int sigcode;
++ struct sigcontext *scp; /* Points to ctx, below. */
++ } legacy;
++
++ /* Extra arguments for SA_SIGINFO handlers */
++ struct
++ {
++ siginfo_t *siginfop; /* Points to siginfo, below. */
++ ucontext_t *uctxp; /* Points to uctx, below. */
++ } posix;
++ };
+ void *sigreturn_addr;
+ void *sigreturn_returns_here;
+ struct sigcontext *return_scp; /* Same; arg to sigreturn. */
++
++ /* NB: sigreturn assumes link is next to ctx. */
+ struct sigcontext ctx;
+ struct hurd_userlink link;
++ ucontext_t ucontext;
++ siginfo_t siginfo;
+ } *stackframe;
+
++ /* sigaction for preemptors */
++ static const struct sigaction legacy_sigaction = {
++ .sa_flags = SA_RESTART
++ };
++
+ if (ss->context)
+ {
+ /* We have a previous sigcontext that sigreturn was about
+@@ -94,9 +170,13 @@ _hurd_setup_sighandler (struct hurd_sigs
+ the SP on sigreturn. */
+ state->basic.uesp = state->basic.ecx;
+
+- /* XXX what if handler != action->handler (for instance, if a signal
+- * preemptor took over) ? */
+ action = & _hurd_sigstate_actions (ss) [signo];
++ if ( (action->sa_flags & SA_SIGINFO)
++ && handler != (__sighandler_t) action->sa_sigaction
++ || !(action->sa_flags & SA_SIGINFO)
++ && handler != action->sa_handler)
++ /* A signal preemptor took over, use legacy semantic. */
++ action = &legacy_sigaction;
+
+ if ((action->sa_flags & SA_ONSTACK)
+ && !(ss->sigaltstack.ss_flags & (SS_DISABLE|SS_ONSTACK)))
+@@ -140,15 +220,9 @@ _hurd_setup_sighandler (struct hurd_sigs
+ = &stackframe->link.thread.next;
+ ss->active_resources = &stackframe->link;
+
+- /* Set up the arguments for the signal handler. */
+- stackframe->signo = signo;
+- stackframe->sigcode = detail->code;
+- stackframe->scp = stackframe->return_scp = scp = &stackframe->ctx;
+- stackframe->sigreturn_addr = &__sigreturn;
+- stackframe->sigreturn_returns_here = firewall; /* Crash on return. */
+-
+ /* Set up the sigcontext from the current state of the thread. */
+
++ scp = &stackframe->ctx;
+ scp->sc_onstack = ss->sigaltstack.ss_flags & SS_ONSTACK ? 1 : 0;
+
+ /* struct sigcontext is laid out so that starting at sc_gs mimics a
+@@ -162,6 +236,35 @@ _hurd_setup_sighandler (struct hurd_sigs
+ &state->fpu, &scp->sc_i386_float_state,
+ sizeof (state->fpu));
+
++ /* Set up the arguments for the signal handler. */
++ stackframe->signo = signo;
++ if (action->sa_flags & SA_SIGINFO)
++ {
++ stackframe->posix.siginfop = &stackframe->siginfo;
++ stackframe->posix.uctxp = &stackframe->ucontext;
++ fill_siginfo (&stackframe->siginfo, signo, detail, state);
++ fill_ucontext (&stackframe->ucontext, scp);
++ }
++ else
++ {
++ if (detail->exc)
++ {
++ int nsigno;
++ _hurd_exception2signal_legacy (detail, &nsigno);
++ assert (nsigno == signo);
++ }
++ else
++ detail->code = 0;
++
++ stackframe->legacy.sigcode = detail->code;
++ stackframe->legacy.scp = &stackframe->ctx;
++ }
++
++ /* Set up the bottom of the stack. */
++ stackframe->sigreturn_addr = &__sigreturn;
++ stackframe->sigreturn_returns_here = firewall; /* Crash on return. */
++ stackframe->return_scp = &stackframe->ctx;
++
+ _hurdsig_end_catch_fault ();
+
+ if (! ok)
+Index: glibc-2.31/sysdeps/mach/hurd/kill.c
+===================================================================
+--- glibc-2.31.orig/sysdeps/mach/hurd/kill.c
++++ glibc-2.31/sysdeps/mach/hurd/kill.c
+@@ -64,7 +64,7 @@ __kill (pid_t pid, int sig)
+ {
+ if (msgport != MACH_PORT_NULL)
+ /* Send a signal message to his message port. */
+- return __msg_sig_post (msgport, sig, 0, refport);
++ return __msg_sig_post (msgport, sig, SI_USER, refport);
+
+ /* The process has no message port. Perhaps try direct
+ frobnication of the task. */
+Index: glibc-2.31/sysdeps/mach/hurd/setitimer.c
+===================================================================
+--- glibc-2.31.orig/sysdeps/mach/hurd/setitimer.c
++++ glibc-2.31/sysdeps/mach/hurd/setitimer.c
+@@ -105,7 +105,7 @@ timer_thread (void)
+ __msg_sig_post_request (_hurd_msgport,
+ _hurd_itimer_port,
+ MACH_MSG_TYPE_MAKE_SEND_ONCE,
+- SIGALRM, 0, __mach_task_self ());
++ SIGALRM, SI_TIMER, __mach_task_self ());
+ break;
+
+ case MACH_RCV_INTERRUPTED:
+Index: glibc-2.31/sysdeps/mach/hurd/i386/sigcontextinfo.h
+===================================================================
+--- glibc-2.31.orig/sysdeps/mach/hurd/i386/sigcontextinfo.h
++++ glibc-2.31/sysdeps/mach/hurd/i386/sigcontextinfo.h
+@@ -18,11 +18,10 @@
+ #ifndef _SIGCONTEXTINFO_H
+ #define _SIGCONTEXTINFO_H
+
+-#define SIGCONTEXT struct sigcontext
+ static inline uintptr_t
+-sigcontext_get_pc (struct sigcontext ctx)
++sigcontext_get_pc (struct ucontext_t *ctx)
+ {
+- return ctx.sc_eip;
++ return ctx->uc_mcontext.gregs[REG_EIP];
+ }
+
+ #endif
diff --git a/gnu/packages/patches/glibc-supported-locales.patch b/gnu/packages/patches/glibc-supported-locales.patch
index 05865dc7be..28577c75c0 100644
--- a/gnu/packages/patches/glibc-supported-locales.patch
+++ b/gnu/packages/patches/glibc-supported-locales.patch
@@ -3,20 +3,19 @@ It install the localedata/SUPPORTED file of the glibc. This file lists
all the supported locales of the glibc.
diff --git a/localedata/Makefile b/localedata/Makefile
-index 65079f9eb8..14818f84e0 100644
--- a/localedata/Makefile
+++ b/localedata/Makefile
-@@ -169,7 +169,8 @@ endif
- # Files to install.
+@@ -176,7 +176,8 @@
+ else
install-others := $(addprefix $(inst_i18ndir)/, \
$(addsuffix .gz, $(charmaps)) \
- $(locales))
+ $(locales)) \
+ $(inst_i18ndir)/SUPPORTED
+ endif
tests: $(objdir)/iconvdata/gconv-modules
-
-@@ -380,6 +381,14 @@ endif
+@@ -401,6 +402,14 @@
include SUPPORTED
@@ -30,4 +29,4 @@ index 65079f9eb8..14818f84e0 100644
+
INSTALL-SUPPORTED-LOCALE-ARCHIVE=$(addprefix install-archive-, $(SUPPORTED-LOCALES))
INSTALL-SUPPORTED-LOCALE-FILES=$(addprefix install-files-, $(SUPPORTED-LOCALES))
- \ No newline at end of file
+
diff --git a/gnu/packages/patches/glm-restore-install-target.patch b/gnu/packages/patches/glm-restore-install-target.patch
deleted file mode 100644
index a628030f6f..0000000000
--- a/gnu/packages/patches/glm-restore-install-target.patch
+++ /dev/null
@@ -1,574 +0,0 @@
-From: Tobias Geerinckx-Rice <me@tobias.gr>
-Date: Mon, 23 Sep 2019 22:01:17 +0200
-Subject: [PATCH] gnu: glm: Restore ‘install’ target.
-
-It was removed in 0.9.9.6, making installation a tedious manual process
-for no clear reason[0]. Restore it for now.
-
-[0]: https://github.com/g-truc/glm/issues/947
-
-diff -Naur glm/cmake/CMakePackageConfigHelpers.cmake glmn/cmake/CMakePackageConfigHelpers.cmake
---- glm/cmake/CMakePackageConfigHelpers.cmake 1970-01-01 01:00:00.000000000 +0100
-+++ glmn/cmake/CMakePackageConfigHelpers.cmake 2019-09-23 00:11:21.418152249 +0200
-@@ -0,0 +1,227 @@
-+# - CONFIGURE_PACKAGE_CONFIG_FILE(), WRITE_BASIC_PACKAGE_VERSION_FILE()
-+#
-+# CONFIGURE_PACKAGE_CONFIG_FILE(<input> <output> INSTALL_DESTINATION <path>
-+# [PATH_VARS <var1> <var2> ... <varN>]
-+# [NO_SET_AND_CHECK_MACRO]
-+# [NO_CHECK_REQUIRED_COMPONENTS_MACRO])
-+#
-+# CONFIGURE_PACKAGE_CONFIG_FILE() should be used instead of the plain
-+# CONFIGURE_FILE() command when creating the <Name>Config.cmake or <Name>-config.cmake
-+# file for installing a project or library. It helps making the resulting package
-+# relocatable by avoiding hardcoded paths in the installed Config.cmake file.
-+#
-+# In a FooConfig.cmake file there may be code like this to make the
-+# install destinations know to the using project:
-+# set(FOO_INCLUDE_DIR "@CMAKE_INSTALL_FULL_INCLUDEDIR@" )
-+# set(FOO_DATA_DIR "@CMAKE_INSTALL_PREFIX@/@RELATIVE_DATA_INSTALL_DIR@" )
-+# set(FOO_ICONS_DIR "@CMAKE_INSTALL_PREFIX@/share/icons" )
-+# ...logic to determine installedPrefix from the own location...
-+# set(FOO_CONFIG_DIR "${installedPrefix}/@CONFIG_INSTALL_DIR@" )
-+# All 4 options shown above are not sufficient, since the first 3 hardcode
-+# the absolute directory locations, and the 4th case works only if the logic
-+# to determine the installedPrefix is correct, and if CONFIG_INSTALL_DIR contains
-+# a relative path, which in general cannot be guaranteed.
-+# This has the effect that the resulting FooConfig.cmake file would work poorly
-+# under Windows and OSX, where users are used to choose the install location
-+# of a binary package at install time, independent from how CMAKE_INSTALL_PREFIX
-+# was set at build/cmake time.
-+#
-+# Using CONFIGURE_PACKAGE_CONFIG_FILE() helps. If used correctly, it makes the
-+# resulting FooConfig.cmake file relocatable.
-+# Usage:
-+# 1. write a FooConfig.cmake.in file as you are used to
-+# 2. insert a line containing only the string "@PACKAGE_INIT@"
-+# 3. instead of SET(FOO_DIR "@SOME_INSTALL_DIR@"), use SET(FOO_DIR "@PACKAGE_SOME_INSTALL_DIR@")
-+# (this must be after the @PACKAGE_INIT@ line)
-+# 4. instead of using the normal CONFIGURE_FILE(), use CONFIGURE_PACKAGE_CONFIG_FILE()
-+#
-+# The <input> and <output> arguments are the input and output file, the same way
-+# as in CONFIGURE_FILE().
-+#
-+# The <path> given to INSTALL_DESTINATION must be the destination where the FooConfig.cmake
-+# file will be installed to. This can either be a relative or absolute path, both work.
-+#
-+# The variables <var1> to <varN> given as PATH_VARS are the variables which contain
-+# install destinations. For each of them the macro will create a helper variable
-+# PACKAGE_<var...>. These helper variables must be used
-+# in the FooConfig.cmake.in file for setting the installed location. They are calculated
-+# by CONFIGURE_PACKAGE_CONFIG_FILE() so that they are always relative to the
-+# installed location of the package. This works both for relative and also for absolute locations.
-+# For absolute locations it works only if the absolute location is a subdirectory
-+# of CMAKE_INSTALL_PREFIX.
-+#
-+# By default configure_package_config_file() also generates two helper macros,
-+# set_and_check() and check_required_components() into the FooConfig.cmake file.
-+#
-+# set_and_check() should be used instead of the normal set()
-+# command for setting directories and file locations. Additionally to setting the
-+# variable it also checks that the referenced file or directory actually exists
-+# and fails with a FATAL_ERROR otherwise. This makes sure that the created
-+# FooConfig.cmake file does not contain wrong references.
-+# When using the NO_SET_AND_CHECK_MACRO, this macro is not generated into the
-+# FooConfig.cmake file.
-+#
-+# check_required_components(<package_name>) should be called at the end of the
-+# FooConfig.cmake file if the package supports components.
-+# This macro checks whether all requested, non-optional components have been found,
-+# and if this is not the case, sets the Foo_FOUND variable to FALSE, so that the package
-+# is considered to be not found.
-+# It does that by testing the Foo_<Component>_FOUND variables for all requested
-+# required components.
-+# When using the NO_CHECK_REQUIRED_COMPONENTS option, this macro is not generated
-+# into the FooConfig.cmake file.
-+#
-+# For an example see below the documentation for WRITE_BASIC_PACKAGE_VERSION_FILE().
-+#
-+#
-+# WRITE_BASIC_PACKAGE_VERSION_FILE( filename VERSION major.minor.patch COMPATIBILITY (AnyNewerVersion|SameMajorVersion|ExactVersion) )
-+#
-+# Writes a file for use as <package>ConfigVersion.cmake file to <filename>.
-+# See the documentation of FIND_PACKAGE() for details on this.
-+# filename is the output filename, it should be in the build tree.
-+# major.minor.patch is the version number of the project to be installed
-+# The COMPATIBILITY mode AnyNewerVersion means that the installed package version
-+# will be considered compatible if it is newer or exactly the same as the requested version.
-+# This mode should be used for packages which are fully backward compatible,
-+# also across major versions.
-+# If SameMajorVersion is used instead, then the behaviour differs from AnyNewerVersion
-+# in that the major version number must be the same as requested, e.g. version 2.0 will
-+# not be considered compatible if 1.0 is requested.
-+# This mode should be used for packages which guarantee backward compatibility within the
-+# same major version.
-+# If ExactVersion is used, then the package is only considered compatible if the requested
-+# version matches exactly its own version number (not considering the tweak version).
-+# For example, version 1.2.3 of a package is only considered compatible to requested version 1.2.3.
-+# This mode is for packages without compatibility guarantees.
-+# If your project has more elaborated version matching rules, you will need to write your
-+# own custom ConfigVersion.cmake file instead of using this macro.
-+#
-+# Internally, this macro executes configure_file() to create the resulting
-+# version file. Depending on the COMPATIBILITY, either the file
-+# BasicConfigVersion-SameMajorVersion.cmake.in or BasicConfigVersion-AnyNewerVersion.cmake.in
-+# is used. Please note that these two files are internal to CMake and you should
-+# not call configure_file() on them yourself, but they can be used as starting
-+# point to create more sophisticted custom ConfigVersion.cmake files.
-+#
-+#
-+# Example using both configure_package_config_file() and write_basic_package_version_file():
-+# CMakeLists.txt:
-+# set(INCLUDE_INSTALL_DIR include/ ... CACHE )
-+# set(LIB_INSTALL_DIR lib/ ... CACHE )
-+# set(SYSCONFIG_INSTALL_DIR etc/foo/ ... CACHE )
-+# ...
-+# include(CMakePackageConfigHelpers)
-+# configure_package_config_file(FooConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake
-+# INSTALL_DESTINATION ${LIB_INSTALL_DIR}/Foo/cmake
-+# PATH_VARS INCLUDE_INSTALL_DIR SYSCONFIG_INSTALL_DIR)
-+# write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake
-+# VERSION 1.2.3
-+# COMPATIBILITY SameMajorVersion )
-+# install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake
-+# DESTINATION ${LIB_INSTALL_DIR}/Foo/cmake )
-+#
-+# With a FooConfig.cmake.in:
-+# set(FOO_VERSION x.y.z)
-+# ...
-+# @PACKAGE_INIT@
-+# ...
-+# set_and_check(FOO_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
-+# set_and_check(FOO_SYSCONFIG_DIR "@PACKAGE_SYSCONFIG_INSTALL_DIR@")
-+#
-+# check_required_components(Foo)
-+
-+
-+#=============================================================================
-+# Copyright 2012 Alexander Neundorf <neundorf@kde.org>
-+#
-+# Distributed under the OSI-approved BSD License (the "License");
-+# see accompanying file Copyright.txt for details.
-+#
-+# This software is distributed WITHOUT ANY WARRANTY; without even the
-+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-+# See the License for more information.
-+#=============================================================================
-+# (To distribute this file outside of CMake, substitute the full
-+# License text for the above reference.)
-+
-+include(CMakeParseArguments)
-+
-+include(WriteBasicConfigVersionFile)
-+
-+macro(WRITE_BASIC_PACKAGE_VERSION_FILE)
-+ write_basic_config_version_file(${ARGN})
-+endmacro()
-+
-+
-+function(CONFIGURE_PACKAGE_CONFIG_FILE _inputFile _outputFile)
-+ set(options NO_SET_AND_CHECK_MACRO NO_CHECK_REQUIRED_COMPONENTS_MACRO)
-+ set(oneValueArgs INSTALL_DESTINATION )
-+ set(multiValueArgs PATH_VARS )
-+
-+ cmake_parse_arguments(CCF "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
-+
-+ if(CCF_UNPARSED_ARGUMENTS)
-+ message(FATAL_ERROR "Unknown keywords given to CONFIGURE_PACKAGE_CONFIG_FILE(): \"${CCF_UNPARSED_ARGUMENTS}\"")
-+ endif()
-+
-+ if(NOT CCF_INSTALL_DESTINATION)
-+ message(FATAL_ERROR "No INSTALL_DESTINATION given to CONFIGURE_PACKAGE_CONFIG_FILE()")
-+ endif()
-+
-+ if(IS_ABSOLUTE "${CCF_INSTALL_DESTINATION}")
-+ set(absInstallDir "${CCF_INSTALL_DESTINATION}")
-+ else()
-+ set(absInstallDir "${CMAKE_INSTALL_PREFIX}/${CCF_INSTALL_DESTINATION}")
-+ endif()
-+ file(RELATIVE_PATH PACKAGE_RELATIVE_PATH "${absInstallDir}" "${CMAKE_INSTALL_PREFIX}" )
-+
-+ foreach(var ${CCF_PATH_VARS})
-+ if(NOT DEFINED ${var})
-+ message(FATAL_ERROR "Variable ${var} does not exist")
-+ else()
-+ if(IS_ABSOLUTE "${${var}}")
-+ string(REPLACE "${CMAKE_INSTALL_PREFIX}" "\${PACKAGE_PREFIX_DIR}"
-+ PACKAGE_${var} "${${var}}")
-+ else()
-+ set(PACKAGE_${var} "\${PACKAGE_PREFIX_DIR}/${${var}}")
-+ endif()
-+ endif()
-+ endforeach()
-+
-+ set(PACKAGE_INIT "
-+####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() #######
-+get_filename_component(PACKAGE_PREFIX_DIR \"\${CMAKE_CURRENT_LIST_DIR}/${PACKAGE_RELATIVE_PATH}\" ABSOLUTE)
-+")
-+
-+ if(NOT CCF_NO_SET_AND_CHECK_MACRO)
-+ set(PACKAGE_INIT "${PACKAGE_INIT}
-+macro(set_and_check _var _file)
-+ set(\${_var} \"\${_file}\")
-+ if(NOT EXISTS \"\${_file}\")
-+ message(FATAL_ERROR \"File or directory \${_file} referenced by variable \${_var} does not exist !\")
-+ endif()
-+endmacro()
-+")
-+ endif()
-+
-+
-+ if(NOT CCF_NO_CHECK_REQUIRED_COMPONENTS_MACRO)
-+ set(PACKAGE_INIT "${PACKAGE_INIT}
-+macro(check_required_components _NAME)
-+ foreach(comp \${\${_NAME}_FIND_COMPONENTS})
-+ if(NOT \${_NAME}_\${comp}_FOUND)
-+ if(\${_NAME}_FIND_REQUIRED_\${comp})
-+ set(\${_NAME}_FOUND FALSE)
-+ endif()
-+ endif()
-+ endforeach(comp)
-+endmacro()
-+")
-+ endif()
-+
-+ set(PACKAGE_INIT "${PACKAGE_INIT}
-+####################################################################################")
-+
-+ configure_file("${_inputFile}" "${_outputFile}" @ONLY)
-+
-+endfunction()
-diff -Naur glm/cmake/glmBuildConfig.cmake.in glmn/cmake/glmBuildConfig.cmake.in
---- glm/cmake/glmBuildConfig.cmake.in 1970-01-01 01:00:00.000000000 +0100
-+++ glmn/cmake/glmBuildConfig.cmake.in 2019-09-23 00:12:08.090955650 +0200
-@@ -0,0 +1,6 @@
-+set(GLM_VERSION "@GLM_VERSION@")
-+set(GLM_INCLUDE_DIRS "@CMAKE_CURRENT_SOURCE_DIR@")
-+
-+if (NOT CMAKE_VERSION VERSION_LESS "3.0")
-+ include("${CMAKE_CURRENT_LIST_DIR}/glmTargets.cmake")
-+endif()
-diff -Naur glm/cmake/glmConfig.cmake.in glmn/cmake/glmConfig.cmake.in
---- glm/cmake/glmConfig.cmake.in 1970-01-01 01:00:00.000000000 +0100
-+++ glmn/cmake/glmConfig.cmake.in 2019-09-23 00:12:14.566373412 +0200
-@@ -0,0 +1,9 @@
-+set(GLM_VERSION "@GLM_VERSION@")
-+
-+@PACKAGE_INIT@
-+
-+set_and_check(GLM_INCLUDE_DIRS "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@")
-+
-+if (NOT CMAKE_VERSION VERSION_LESS "3.0")
-+ include("${CMAKE_CURRENT_LIST_DIR}/glmTargets.cmake")
-+endif()
-diff -Naur glm/cmake/glm.pc.in glmn/cmake/glm.pc.in
---- glm/cmake/glm.pc.in 1970-01-01 01:00:00.000000000 +0100
-+++ glmn/cmake/glm.pc.in 2019-09-23 00:11:59.695710511 +0200
-@@ -0,0 +1,7 @@
-+prefix=@CMAKE_INSTALL_PREFIX@
-+includedir=${prefix}/include
-+
-+Name: GLM
-+Description: OpenGL Mathematics
-+Version: @GLM_VERSION@
-+Cflags: -I${includedir}
-diff -Naur glm/cmake/GNUInstallDirs.cmake glmn/cmake/GNUInstallDirs.cmake
---- glm/cmake/GNUInstallDirs.cmake 1970-01-01 01:00:00.000000000 +0100
-+++ glmn/cmake/GNUInstallDirs.cmake 2019-09-23 00:11:47.363819337 +0200
-@@ -0,0 +1,188 @@
-+# - Define GNU standard installation directories
-+# Provides install directory variables as defined for GNU software:
-+# http://www.gnu.org/prep/standards/html_node/Directory-Variables.html
-+# Inclusion of this module defines the following variables:
-+# CMAKE_INSTALL_<dir> - destination for files of a given type
-+# CMAKE_INSTALL_FULL_<dir> - corresponding absolute path
-+# where <dir> is one of:
-+# BINDIR - user executables (bin)
-+# SBINDIR - system admin executables (sbin)
-+# LIBEXECDIR - program executables (libexec)
-+# SYSCONFDIR - read-only single-machine data (etc)
-+# SHAREDSTATEDIR - modifiable architecture-independent data (com)
-+# LOCALSTATEDIR - modifiable single-machine data (var)
-+# LIBDIR - object code libraries (lib or lib64 or lib/<multiarch-tuple> on Debian)
-+# INCLUDEDIR - C header files (include)
-+# OLDINCLUDEDIR - C header files for non-gcc (/usr/include)
-+# DATAROOTDIR - read-only architecture-independent data root (share)
-+# DATADIR - read-only architecture-independent data (DATAROOTDIR)
-+# INFODIR - info documentation (DATAROOTDIR/info)
-+# LOCALEDIR - locale-dependent data (DATAROOTDIR/locale)
-+# MANDIR - man documentation (DATAROOTDIR/man)
-+# DOCDIR - documentation root (DATAROOTDIR/doc/PROJECT_NAME)
-+# Each CMAKE_INSTALL_<dir> value may be passed to the DESTINATION options of
-+# install() commands for the corresponding file type. If the includer does
-+# not define a value the above-shown default will be used and the value will
-+# appear in the cache for editing by the user.
-+# Each CMAKE_INSTALL_FULL_<dir> value contains an absolute path constructed
-+# from the corresponding destination by prepending (if necessary) the value
-+# of CMAKE_INSTALL_PREFIX.
-+
-+#=============================================================================
-+# Copyright 2011 Nikita Krupen'ko <krnekit@gmail.com>
-+# Copyright 2011 Kitware, Inc.
-+#
-+# Distributed under the OSI-approved BSD License (the "License");
-+# see accompanying file Copyright.txt for details.
-+#
-+# This software is distributed WITHOUT ANY WARRANTY; without even the
-+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-+# See the License for more information.
-+#=============================================================================
-+# (To distribute this file outside of CMake, substitute the full
-+# License text for the above reference.)
-+
-+# Installation directories
-+#
-+if(NOT DEFINED CMAKE_INSTALL_BINDIR)
-+ set(CMAKE_INSTALL_BINDIR "bin" CACHE PATH "user executables (bin)")
-+endif()
-+
-+if(NOT DEFINED CMAKE_INSTALL_SBINDIR)
-+ set(CMAKE_INSTALL_SBINDIR "sbin" CACHE PATH "system admin executables (sbin)")
-+endif()
-+
-+if(NOT DEFINED CMAKE_INSTALL_LIBEXECDIR)
-+ set(CMAKE_INSTALL_LIBEXECDIR "libexec" CACHE PATH "program executables (libexec)")
-+endif()
-+
-+if(NOT DEFINED CMAKE_INSTALL_SYSCONFDIR)
-+ set(CMAKE_INSTALL_SYSCONFDIR "etc" CACHE PATH "read-only single-machine data (etc)")
-+endif()
-+
-+if(NOT DEFINED CMAKE_INSTALL_SHAREDSTATEDIR)
-+ set(CMAKE_INSTALL_SHAREDSTATEDIR "com" CACHE PATH "modifiable architecture-independent data (com)")
-+endif()
-+
-+if(NOT DEFINED CMAKE_INSTALL_LOCALSTATEDIR)
-+ set(CMAKE_INSTALL_LOCALSTATEDIR "var" CACHE PATH "modifiable single-machine data (var)")
-+endif()
-+
-+if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
-+ set(_LIBDIR_DEFAULT "lib")
-+ # Override this default 'lib' with 'lib64' iff:
-+ # - we are on Linux system but NOT cross-compiling
-+ # - we are NOT on debian
-+ # - we are on a 64 bits system
-+ # reason is: amd64 ABI: http://www.x86-64.org/documentation/abi.pdf
-+ # For Debian with multiarch, use 'lib/${CMAKE_LIBRARY_ARCHITECTURE}' if
-+ # CMAKE_LIBRARY_ARCHITECTURE is set (which contains e.g. "i386-linux-gnu"
-+ # See http://wiki.debian.org/Multiarch
-+ if((CMAKE_SYSTEM_NAME MATCHES "Linux|kFreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "GNU")
-+ AND NOT CMAKE_CROSSCOMPILING)
-+ if (EXISTS "/etc/debian_version") # is this a debian system ?
-+ if(CMAKE_LIBRARY_ARCHITECTURE)
-+ set(_LIBDIR_DEFAULT "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
-+ endif()
-+ else() # not debian, rely on CMAKE_SIZEOF_VOID_P:
-+ if(NOT DEFINED CMAKE_SIZEOF_VOID_P)
-+ message(AUTHOR_WARNING
-+ "Unable to determine default CMAKE_INSTALL_LIBDIR directory because no target architecture is known. "
-+ "Please enable at least one language before including GNUInstallDirs.")
-+ else()
-+ if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
-+ set(_LIBDIR_DEFAULT "lib64")
-+ endif()
-+ endif()
-+ endif()
-+ endif()
-+ set(CMAKE_INSTALL_LIBDIR "${_LIBDIR_DEFAULT}" CACHE PATH "object code libraries (${_LIBDIR_DEFAULT})")
-+endif()
-+
-+if(NOT DEFINED CMAKE_INSTALL_INCLUDEDIR)
-+ set(CMAKE_INSTALL_INCLUDEDIR "include" CACHE PATH "C header files (include)")
-+endif()
-+
-+if(NOT DEFINED CMAKE_INSTALL_OLDINCLUDEDIR)
-+ set(CMAKE_INSTALL_OLDINCLUDEDIR "/usr/include" CACHE PATH "C header files for non-gcc (/usr/include)")
-+endif()
-+
-+if(NOT DEFINED CMAKE_INSTALL_DATAROOTDIR)
-+ set(CMAKE_INSTALL_DATAROOTDIR "share" CACHE PATH "read-only architecture-independent data root (share)")
-+endif()
-+
-+#-----------------------------------------------------------------------------
-+# Values whose defaults are relative to DATAROOTDIR. Store empty values in
-+# the cache and store the defaults in local variables if the cache values are
-+# not set explicitly. This auto-updates the defaults as DATAROOTDIR changes.
-+
-+if(NOT CMAKE_INSTALL_DATADIR)
-+ set(CMAKE_INSTALL_DATADIR "" CACHE PATH "read-only architecture-independent data (DATAROOTDIR)")
-+ set(CMAKE_INSTALL_DATADIR "${CMAKE_INSTALL_DATAROOTDIR}")
-+endif()
-+
-+if(NOT CMAKE_INSTALL_INFODIR)
-+ set(CMAKE_INSTALL_INFODIR "" CACHE PATH "info documentation (DATAROOTDIR/info)")
-+ set(CMAKE_INSTALL_INFODIR "${CMAKE_INSTALL_DATAROOTDIR}/info")
-+endif()
-+
-+if(NOT CMAKE_INSTALL_LOCALEDIR)
-+ set(CMAKE_INSTALL_LOCALEDIR "" CACHE PATH "locale-dependent data (DATAROOTDIR/locale)")
-+ set(CMAKE_INSTALL_LOCALEDIR "${CMAKE_INSTALL_DATAROOTDIR}/locale")
-+endif()
-+
-+if(NOT CMAKE_INSTALL_MANDIR)
-+ set(CMAKE_INSTALL_MANDIR "" CACHE PATH "man documentation (DATAROOTDIR/man)")
-+ set(CMAKE_INSTALL_MANDIR "${CMAKE_INSTALL_DATAROOTDIR}/man")
-+endif()
-+
-+if(NOT CMAKE_INSTALL_DOCDIR)
-+ set(CMAKE_INSTALL_DOCDIR "" CACHE PATH "documentation root (DATAROOTDIR/doc/PROJECT_NAME)")
-+ set(CMAKE_INSTALL_DOCDIR "${CMAKE_INSTALL_DATAROOTDIR}/doc/${PROJECT_NAME}")
-+endif()
-+
-+#-----------------------------------------------------------------------------
-+
-+mark_as_advanced(
-+ CMAKE_INSTALL_BINDIR
-+ CMAKE_INSTALL_SBINDIR
-+ CMAKE_INSTALL_LIBEXECDIR
-+ CMAKE_INSTALL_SYSCONFDIR
-+ CMAKE_INSTALL_SHAREDSTATEDIR
-+ CMAKE_INSTALL_LOCALSTATEDIR
-+ CMAKE_INSTALL_LIBDIR
-+ CMAKE_INSTALL_INCLUDEDIR
-+ CMAKE_INSTALL_OLDINCLUDEDIR
-+ CMAKE_INSTALL_DATAROOTDIR
-+ CMAKE_INSTALL_DATADIR
-+ CMAKE_INSTALL_INFODIR
-+ CMAKE_INSTALL_LOCALEDIR
-+ CMAKE_INSTALL_MANDIR
-+ CMAKE_INSTALL_DOCDIR
-+ )
-+
-+# Result directories
-+#
-+foreach(dir
-+ BINDIR
-+ SBINDIR
-+ LIBEXECDIR
-+ SYSCONFDIR
-+ SHAREDSTATEDIR
-+ LOCALSTATEDIR
-+ LIBDIR
-+ INCLUDEDIR
-+ OLDINCLUDEDIR
-+ DATAROOTDIR
-+ DATADIR
-+ INFODIR
-+ LOCALEDIR
-+ MANDIR
-+ DOCDIR
-+ )
-+ if(NOT IS_ABSOLUTE ${CMAKE_INSTALL_${dir}})
-+ set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_${dir}}")
-+ else()
-+ set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_${dir}}")
-+ endif()
-+endforeach()
-diff -Naur glm/CMakeLists.txt glmn/CMakeLists.txt
---- glm/CMakeLists.txt 2019-09-07 14:10:16.000000000 +0200
-+++ glmn/CMakeLists.txt 2019-09-23 00:10:29.559815104 +0200
-@@ -4,6 +4,11 @@
- set(GLM_VERSION "0.9.9")
- project(glm VERSION ${GLM_VERSION} LANGUAGES CXX)
-
-+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
-+
-+include(GNUInstallDirs)
-+include(CMakePackageConfigHelpers)
-+
- enable_testing()
-
- option(GLM_QUIET "No CMake Message" OFF)
-@@ -237,3 +242,62 @@
- add_subdirectory(glm)
- add_subdirectory(test)
-
-+set(GLM_INSTALL_CONFIGDIR "${CMAKE_INSTALL_LIBDIR}/cmake/glm")
-+install(DIRECTORY glm DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
-+
-+
-+# CMake automatically adds an architecture compatibility check to make sure
-+# 32 and 64 bit code is not accidentally mixed. For a header-only library this
-+# is not required. The check can be disabled by temporarily unsetting
-+# CMAKE_SIZEOF_VOID_P. In CMake 3.14 and later this can be achieved more cleanly
-+# with write_basic_package_version_file(ARCH_INDEPENDENT).
-+# TODO: Use this once a newer CMake can be required.
-+set(GLM_SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P})
-+unset(CMAKE_SIZEOF_VOID_P)
-+write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/glmConfigVersion.cmake" VERSION ${GLM_VERSION} COMPATIBILITY AnyNewerVersion)
-+set(CMAKE_SIZEOF_VOID_P ${GLM_SIZEOF_VOID_P})
-+
-+# build tree package config
-+configure_file(cmake/glmBuildConfig.cmake.in glmConfig.cmake @ONLY)
-+
-+# install tree package config
-+configure_package_config_file(
-+ cmake/glmConfig.cmake.in
-+ ${GLM_INSTALL_CONFIGDIR}/glmConfig.cmake
-+ INSTALL_DESTINATION ${GLM_INSTALL_CONFIGDIR}
-+ PATH_VARS CMAKE_INSTALL_INCLUDEDIR
-+ NO_CHECK_REQUIRED_COMPONENTS_MACRO)
-+
-+install(FILES
-+ "${CMAKE_CURRENT_BINARY_DIR}/${GLM_INSTALL_CONFIGDIR}/glmConfig.cmake"
-+ "${CMAKE_CURRENT_BINARY_DIR}/glmConfigVersion.cmake"
-+ DESTINATION ${GLM_INSTALL_CONFIGDIR})
-+
-+add_library(glm INTERFACE)
-+target_include_directories(glm INTERFACE
-+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
-+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
-+install(TARGETS glm EXPORT glmTargets)
-+
-+export(EXPORT glmTargets FILE "${CMAKE_CURRENT_BINARY_DIR}/glmTargets.cmake")
-+
-+install(EXPORT glmTargets FILE glmTargets.cmake DESTINATION ${GLM_INSTALL_CONFIGDIR})
-+
-+# build pkg-config file
-+configure_file("./cmake/glm.pc.in" "glm.pc" @ONLY)
-+
-+# install pkg-config file
-+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/glm.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
-+
-+export(PACKAGE glm)
-+
-+if(NOT TARGET uninstall)
-+ configure_file(
-+ ${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in
-+ ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
-+ IMMEDIATE @ONLY)
-+
-+ add_custom_target(uninstall
-+ COMMAND ${CMAKE_COMMAND} -P
-+ ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
-+endif()
-diff -Naur glm/cmake_uninstall.cmake.in glmn/cmake_uninstall.cmake.in
---- glm/cmake_uninstall.cmake.in 1970-01-01 01:00:00.000000000 +0100
-+++ glmn/cmake_uninstall.cmake.in 2019-09-23 00:12:22.495660449 +0200
-@@ -0,0 +1,26 @@
-+if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
-+ message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
-+endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
-+
-+if (NOT DEFINED CMAKE_INSTALL_PREFIX)
-+ set (CMAKE_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@")
-+endif ()
-+ message(${CMAKE_INSTALL_PREFIX})
-+
-+file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
-+string(REGEX REPLACE "\n" ";" files "${files}")
-+foreach(file ${files})
-+ message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
-+ if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
-+ exec_program(
-+ "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
-+ OUTPUT_VARIABLE rm_out
-+ RETURN_VALUE rm_retval
-+ )
-+ if(NOT "${rm_retval}" STREQUAL 0)
-+ message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
-+ endif(NOT "${rm_retval}" STREQUAL 0)
-+ else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
-+ message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
-+ endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
-+endforeach(file)
diff --git a/gnu/packages/patches/gnome-shell-disable-test.patch b/gnu/packages/patches/gnome-shell-disable-test.patch
new file mode 100644
index 0000000000..b4c7e73cd7
--- /dev/null
+++ b/gnu/packages/patches/gnome-shell-disable-test.patch
@@ -0,0 +1,25 @@
+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
index fc7f7caf0f..3fa0670c43 100644
--- a/gnu/packages/patches/gnome-shell-theme.patch
+++ b/gnu/packages/patches/gnome-shell-theme.patch
@@ -2,25 +2,23 @@ Adjust GNOME-Shell so that it uses a Guix theme by default.
Patch by Ludovic Courtès <ludo@gnu.org>.
-diff --git a/data/gnome-shell-theme.gresource.xml b/data/gnome-shell-theme.gresource.xml
-index 76aeaa5..8eaf32e 100644
---- a/data/gnome-shell-theme.gresource.xml
-+++ b/data/gnome-shell-theme.gresource.xml
-@@ -22,6 +22,8 @@
+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>page-indicator-active.svg</file>
- <file>page-indicator-inactive.svg</file>
-diff --git a/data/theme/gnome-shell-sass/_common.scss b/data/theme/gnome-shell-sass/_common.scss
-index 54d9f39..b9badd0 100644
---- a/data/theme/gnome-shell-sass/_common.scss
-+++ b/data/theme/gnome-shell-sass/_common.scss
-@@ -1742,7 +1742,16 @@ $legacy_icon_size: 24px;
-
+ <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; }
@@ -37,14 +35,14 @@ index 54d9f39..b9badd0 100644
.login-dialog-banner { color: darken($osd_fg_color,10%); }
.login-dialog-button-box { spacing: 5px; }
.login-dialog-message-warning { color: $warning_color; }
-@@ -1889,9 +1898,10 @@ $legacy_icon_size: 24px;
+@@ -2143,9 +2152,10 @@
}
#lockDialogGroup {
-- background: #2e3436 url(resource:///org/gnome/shell/theme/noise-texture.png);
+- background: lighten(#2e3436, 8%) url(resource:///org/gnome/shell/theme/noise-texture.png);
- background-repeat: repeat;
-}
-+ background: #2e3436 url(resource:///org/gnome/shell/theme/guix-background.png);
++ background: lighten(#2e3436, 8%) url(resource:///org/gnome/shell/theme/guix-background.png);
+ background-repeat: no-repeat;
+ background-size: cover;
+ background-position: center; }
diff --git a/gnu/packages/patches/gnome-todo-delete-esource-duplicate.patch b/gnu/packages/patches/gnome-todo-delete-esource-duplicate.patch
new file mode 100644
index 0000000000..c680e86495
--- /dev/null
+++ b/gnu/packages/patches/gnome-todo-delete-esource-duplicate.patch
@@ -0,0 +1,10 @@
+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/gnutls-cross.patch b/gnu/packages/patches/gnutls-cross.patch
new file mode 100644
index 0000000000..82d08da24e
--- /dev/null
+++ b/gnu/packages/patches/gnutls-cross.patch
@@ -0,0 +1,82 @@
+Not sent upstream.
+
+From e23de62e28f64599148ff06e439fac116a391299 Mon Sep 17 00:00:00 2001
+From: "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org>
+Date: Fri, 10 Apr 2020 07:24:48 +0200
+Subject: [PATCH] guile: Cross build fix.
+
+To cross-build, both the host guile and the native guile-for-build
+must be available. If the native guile is not available, no snarfing
+is done and the guile cross build is skipped.
+
+During the cross-build gnutls.scm does not load when compliling
+extra.scm, becase of missing definitions from guile-gnutls-v-2.
+
+* guile/modules/gnutls.in (protocol/ssl-3 protocol/tls-1.0,
+protocol/tls-1.1, credentials/anonymous, cipher/rijndael-256-cbc,
+cipher/rijndael-128-cbc, cipher/rijndael-cbc, cipher/arcfour-128,
+certificate-verify/allow-any-x509-v1-ca-certificate,
+certificate-verify/allow-x509-v1-ca-certificate): Define to #f
+initially. When "GNUTLS_GUILE_CROSS_COMPILING" not set, set! to value
+from "guile-gnutls-v-2" load-extension C module.
+---
+ guile/modules/gnutls.in | 40 +++++++++++++++++++++++++++-------------
+ 1 file changed, 27 insertions(+), 13 deletions(-)
+
+diff --git a/guile/modules/gnutls.in b/guile/modules/gnutls.in
+index 6461c404a..954e315de 100644
+--- a/guile/modules/gnutls.in
++++ b/guile/modules/gnutls.in
+@@ -564,22 +564,36 @@ This defines 'variable' as an alias for 'alias', and emits a warning when
+ (identifier? #'id)
+ #'alias))))))))))
+
+-
+ ;; Renaming.
+-(define protocol/ssl-3 protocol/ssl3)
+-(define protocol/tls-1.0 protocol/tls1-0)
+-(define protocol/tls-1.1 protocol/tls1-1)
++(define protocol/ssl-3 #f)
++(define protocol/tls-1.0 #f)
++(define protocol/tls-1.1 #f)
+
+ ;; Aliases.
+-(define credentials/anonymous credentials/anon)
+-(define cipher/rijndael-256-cbc cipher/aes-256-cbc)
+-(define cipher/rijndael-128-cbc cipher/aes-128-cbc)
+-(define cipher/rijndael-cbc cipher/aes-128-cbc)
+-(define cipher/arcfour-128 cipher/arcfour)
+-(define certificate-verify/allow-any-x509-v1-ca-certificate
+- certificate-verify/allow-any-x509-v1-ca-crt)
+-(define certificate-verify/allow-x509-v1-ca-certificate
+- certificate-verify/allow-x509-v1-ca-crt)
++(define credentials/anonymous #f)
++(define cipher/rijndael-256-cbc #f)
++(define cipher/rijndael-128-cbc #f)
++(define cipher/rijndael-cbc #f)
++(define cipher/arcfour-128 #f)
++(define certificate-verify/allow-any-x509-v1-ca-certificate #f)
++(define certificate-verify/allow-x509-v1-ca-certificate #f)
++
++(unless (getenv "GNUTLS_GUILE_CROSS_COMPILING")
++ ;; Renaming.
++ (set! protocol/ssl-3 protocol/ssl3)
++ (set! protocol/tls-1.0 protocol/tls1-0)
++ (set! protocol/tls-1.1 protocol/tls1-1)
++
++ ;; Aliases.
++ (set! credentials/anonymous credentials/anon)
++ (set! cipher/rijndael-256-cbc cipher/aes-256-cbc)
++ (set! cipher/rijndael-128-cbc cipher/aes-128-cbc)
++ (set! cipher/rijndael-cbc cipher/aes-128-cbc)
++ (set! cipher/arcfour-128 cipher/arcfour)
++ (set! certificate-verify/allow-any-x509-v1-ca-certificate
++ certificate-verify/allow-any-x509-v1-ca-crt)
++ (set! certificate-verify/allow-x509-v1-ca-certificate
++ certificate-verify/allow-x509-v1-ca-crt))
+
+ ;; Deprecated OpenPGP bindings.
+ (define-deprecated certificate-type/openpgp)
+--
+2.26.0
+
diff --git a/gnu/packages/patches/grocsvs-dont-use-admiral.patch b/gnu/packages/patches/grocsvs-dont-use-admiral.patch
new file mode 100644
index 0000000000..cb976e19b0
--- /dev/null
+++ b/gnu/packages/patches/grocsvs-dont-use-admiral.patch
@@ -0,0 +1,69 @@
+python-admiral doesn't have a license
+https://github.com/nspies/admiral/issues/3
+
+diff --git a/setup.py b/setup.py
+index 692b6a0..568f381 100755
+--- a/setup.py
++++ b/setup.py
+@@ -20,7 +20,7 @@ setup(
+ 'console_scripts' : ["grocsvs = grocsvs.main:main"]
+ },
+
+- install_requires = ["admiral", "h5py", "networkx>=2.0", "pandas", "pybedtools",
++ install_requires = ["h5py", "networkx>=2.0", "pandas", "pybedtools",
+ "pyfaidx", "pysam>=0.10.0", "scipy", "ipython-cluster-helper",
+ "pygraphviz", "psutil"],
+
+diff --git a/src/grocsvs/jobmanagers.py b/src/grocsvs/jobmanagers.py
+index 6da0b58..112d7ff 100755
+--- a/src/grocsvs/jobmanagers.py
++++ b/src/grocsvs/jobmanagers.py
+@@ -41,34 +41,3 @@ class MultiprocessingCluster(Cluster):
+ pool = multiprocessing.Pool(processes=self.processes)
+ return pool.map_async(fn, args).get(999999)
+
+-
+-class AdmiralCluster(Cluster):
+- def map(self, fn, args):
+- from admiral import jobmanagers, remote
+-
+- cluster_options = self.cluster_settings.cluster_options.copy()
+-
+- scheduler = cluster_options.pop("scheduler")
+-
+- jobmanager_class = jobmanagers.get_jobmanager(scheduler)
+- jobmanager = jobmanager_class(
+- batch_dir=self.batch_dir, log_dir=self.batch_dir)
+-
+-
+- if not "mem" in cluster_options:
+- cluster_options["mem"] = "16g"
+- if not "time" in cluster_options:
+- cluster_options["time"] = "12h"
+-
+- jobs = []
+- #for i, arg in enumerate(args):
+-
+- job_name = args[0].__class__.__name__
+- args = [[arg] for arg in args]
+- job = remote.run_remote(fn, jobmanager, job_name, args=args,
+- array=True, overwrite=True, **cluster_options)
+-
+- result = jobmanagers.wait_for_jobs([job], wait=5, progress=True)
+-
+- if not result:
+- raise Exception("Some chunks failed to complete")
+diff --git a/src/grocsvs/pipeline.py b/src/grocsvs/pipeline.py
+index ab1bb2d..350976f 100755
+--- a/src/grocsvs/pipeline.py
++++ b/src/grocsvs/pipeline.py
+@@ -8,8 +8,7 @@ from grocsvs import utilities
+ def make_jobmanager(jobmanager_settings, processes, batch_dir):
+ jobmanager_classes = {"IPCluster":jobmanagers.IPCluster,
+ "local": jobmanagers.LocalCluster,
+- "multiprocessing": jobmanagers.MultiprocessingCluster,
+- "admiral": jobmanagers.AdmiralCluster}
++ "multiprocessing": jobmanagers.MultiprocessingCluster}
+
+ cls = jobmanager_classes[jobmanager_settings.cluster_type]
+ return cls(processes, jobmanager_settings, batch_dir)
diff --git a/gnu/packages/patches/gromacs-tinyxml2.patch b/gnu/packages/patches/gromacs-tinyxml2.patch
new file mode 100644
index 0000000000..cc7d7459a8
--- /dev/null
+++ b/gnu/packages/patches/gromacs-tinyxml2.patch
@@ -0,0 +1,67 @@
+Unbundling tinyxml2 from gromacs and using our own, which is newer, broke gromacs
+build.
+
+This patch fixes three issues:
+
+- cmake now errors out if using multiple target_link_libraries with mixed styles
+ of signatures.
+
+- Error handling API changed, fix the testutils/refdata_xml.cpp code by using the
+ new API: document.ErrorStr() & tinyxml2::XML_SUCCESS.
+
+Those fixes will be submitted for inclusion to upstream, but may not be suitable
+there as long as they still keep the old version bundled.
+
+First hunk has already been requested for merging. Third is in discussion. Second
+will only be sent if third is OK'ed.
+
+diff -ruN gromacs-2020.2/src/testutils/CMakeLists.txt gromacs-2020.2-fixed/src/testutils/CMakeLists.txt
+--- gromacs-2020.2/src/testutils/CMakeLists.txt 2020-04-30 18:33:44.000000000 +0200
++++ gromacs-2020.2-fixed/src/testutils/CMakeLists.txt 2020-05-01 22:52:16.356000000 +0200
+@@ -73,7 +73,7 @@
+
+ if(HAVE_TINYXML2)
+ include_directories(SYSTEM ${TinyXML2_INCLUDE_DIR})
+- target_link_libraries(testutils ${TinyXML2_LIBRARIES})
++ target_link_libraries(testutils PRIVATE ${TinyXML2_LIBRARIES})
+ else()
+ include_directories(BEFORE SYSTEM "../external/tinyxml2")
+ endif()
+diff -ruN gromacs-2020.2/src/testutils/refdata_xml.cpp gromacs-2020.2-fixed/src/testutils/refdata_xml.cpp
+--- gromacs-2020.2/src/testutils/refdata_xml.cpp 2020-04-30 18:33:44.000000000 +0200
++++ gromacs-2020.2-fixed/src/testutils/refdata_xml.cpp 2020-05-01 23:17:09.556000000 +0200
+@@ -206,21 +206,12 @@
+ document.LoadFile(path.c_str());
+ if (document.Error())
+ {
+- const char* errorStr1 = document.GetErrorStr1();
+- const char* errorStr2 = document.GetErrorStr2();
++ const char* errorStr = document.ErrorStr();
+ std::string errorString("Error was ");
+- if (errorStr1)
+- {
+- errorString += errorStr1;
+- }
+- if (errorStr2)
+- {
+- errorString += errorStr2;
+- }
+- if (!errorStr1 && !errorStr2)
+- {
++ if (errorStr)
++ errorString += errorStr;
++ else
+ errorString += "not specified.";
+- }
+ GMX_THROW(TestException("Reference data not parsed successfully: " + path + "\n."
+ + errorString + "\n"));
+ }
+@@ -371,7 +362,7 @@
+ XMLElementPtr rootElement = createRootElement(&document);
+ createChildElements(rootElement, rootEntry);
+
+- if (document.SaveFile(path.c_str()) != tinyxml2::XML_NO_ERROR)
++ if (document.SaveFile(path.c_str()) != tinyxml2::XML_SUCCESS)
+ {
+ GMX_THROW(TestException("Reference data saving failed in " + path));
+ }
diff --git a/gnu/packages/patches/grub-verifiers-Blocklist-fallout-cleanup.patch b/gnu/packages/patches/grub-verifiers-Blocklist-fallout-cleanup.patch
new file mode 100644
index 0000000000..2bea74ea95
--- /dev/null
+++ b/gnu/packages/patches/grub-verifiers-Blocklist-fallout-cleanup.patch
@@ -0,0 +1,41 @@
+This patch is needed to build Grub on the Hurd.
+
+Taken from upstream: https://git.savannah.gnu.org/cgit/grub.git/commit//?id=dabdfa1c6a80639197d05f683a445fa8615517fe
+
+From 7606547586b2d6ca1b384e15e0358d3a3ddc48a6 Mon Sep 17 00:00:00 2001
+From: David Michael <fedora.dm0@gmail.com>
+Date: Fri, 5 Jul 2019 07:45:59 -0400
+Subject: verifiers: Blocklist fallout cleanup
+
+Blocklist fallout cleanup after commit 5c6f9bc15 (generic/blocklist: Fix
+implicit declaration of function grub_file_filter_disable_compression()).
+
+Signed-off-by: David Michael <fedora.dm0@gmail.com>
+Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
+
+---
+ grub-core/osdep/generic/blocklist.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/grub-core/osdep/generic/blocklist.c b/grub-core/osdep/generic/blocklist.c
+index ea2a511b6..2d9040302 100644
+--- a/grub-core/osdep/generic/blocklist.c
++++ b/grub-core/osdep/generic/blocklist.c
+@@ -59,7 +59,7 @@ grub_install_get_blocklist (grub_device_t root_dev,
+
+ grub_disk_cache_invalidate_all ();
+
+- file = grub_file_open (core_path_dev, GRUB_FILE_TYPE_NONE | FILE_TYPE_NO_DECOMPRESS);
++ file = grub_file_open (core_path_dev, GRUB_FILE_TYPE_NONE | GRUB_FILE_TYPE_NO_DECOMPRESS);
+ if (file)
+ {
+ if (grub_file_size (file) != core_size)
+@@ -116,7 +116,7 @@ grub_install_get_blocklist (grub_device_t root_dev,
+
+ grub_file_t file;
+ /* Now read the core image to determine where the sectors are. */
+- file = grub_file_open (core_path_dev, GRUB_FILE_TYPE_NONE | FILE_TYPE_NO_DECOMPRESS);
++ file = grub_file_open (core_path_dev, GRUB_FILE_TYPE_NONE | GRUB_FILE_TYPE_NO_DECOMPRESS);
+ if (! file)
+ grub_util_error ("%s", grub_errmsg);
+
diff --git a/gnu/packages/patches/gsl-test-i686.patch b/gnu/packages/patches/gsl-test-i686.patch
deleted file mode 100644
index 8828c08614..0000000000
--- a/gnu/packages/patches/gsl-test-i686.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-Work around a test failure due to a rounding issue on 32-bit
-platforms, as reported at:
-
- https://lists.gnu.org/archive/html/bug-gsl/2016-10/msg00000.html
-
---- gsl-2.2.1/linalg/test.c 2016-10-05 13:27:42.464059730 +0200
-+++ gsl-2.2.1/linalg/test.c 2016-10-05 13:27:46.988095882 +0200
-@@ -4843,9 +4843,6 @@ main(void)
- gsl_test(test_cholesky_decomp_unit(), "Cholesky Decomposition [unit triangular]");
- gsl_test(test_cholesky_solve(), "Cholesky Solve");
-
-- gsl_test(test_cholesky_decomp(r), "Cholesky Decomposition");
-- gsl_test(test_cholesky_invert(r), "Cholesky Inverse");
-- gsl_test(test_pcholesky_decomp(r), "Pivoted Cholesky Decomposition");
- gsl_test(test_pcholesky_solve(r), "Pivoted Cholesky Solve");
- gsl_test(test_pcholesky_invert(r), "Pivoted Cholesky Inverse");
- gsl_test(test_mcholesky_decomp(r), "Modified Cholesky Decomposition");
diff --git a/gnu/packages/patches/guile-3.0-linux-syscalls.patch b/gnu/packages/patches/guile-3.0-linux-syscalls.patch
new file mode 100644
index 0000000000..0d27f77ee2
--- /dev/null
+++ b/gnu/packages/patches/guile-3.0-linux-syscalls.patch
@@ -0,0 +1,345 @@
+This patch adds bindings to Linux syscalls for which glibc has symbols.
+
+Using the FFI would have been nice, but that's not an option when using
+a statically-linked Guile in an initrd that doesn't have libc.so around.
+
+diff --git a/libguile/posix.c b/libguile/posix.c
+--- a/libguile/posix.c
++++ b/libguile/posix.c
+@@ -2375,6 +2375,336 @@ scm_init_popen (void)
+ }
+ #endif /* HAVE_START_CHILD */
+
++
++/* Linux! */
++#ifdef __linux__
++
++#include <sys/mount.h>
++#include <sys/syscall.h>
++
++#include "libguile/foreign.h"
++#include "libguile/bytevectors.h"
++#include <libguile/variable.h>
++
++SCM_DEFINE (scm_mount, "mount", 3, 2, 0,
++ (SCM source, SCM target, SCM type, SCM flags, SCM data),
++ "Mount file system of @var{type} specified by @var{source} "
++ "on @var{target}.")
++#define FUNC_NAME s_scm_mount
++{
++ int err;
++ char *c_source, *c_target, *c_type, *c_data;
++ unsigned long c_flags;
++
++ c_source = scm_to_locale_string (source);
++ c_target = scm_to_locale_string (target);
++ c_type = scm_to_locale_string (type);
++ c_flags = SCM_UNBNDP (flags) ? 0 : scm_to_ulong (flags);
++
++ if (SCM_UNBNDP (data) || scm_is_false (data))
++ c_data = NULL;
++ else
++ c_data = scm_to_locale_string (data);
++
++ err = mount (c_source, c_target, c_type, c_flags, c_data);
++ if (err != 0)
++ err = errno;
++
++ free (c_source);
++ free (c_target);
++ free (c_type);
++
++ if (c_data != NULL)
++ free (c_data);
++
++ if (err != 0)
++ {
++ errno = err;
++ SCM_SYSERROR;
++ }
++
++ return SCM_UNSPECIFIED;
++}
++#undef FUNC_NAME
++
++SCM_DEFINE (scm_umount, "umount", 1, 0, 0,
++ (SCM target),
++ "Unmount the file system on @var{target}.")
++#define FUNC_NAME s_scm_umount
++{
++ int err;
++ char *c_target;
++
++ c_target = scm_to_locale_string (target);
++
++ err = umount (c_target);
++ if (err != 0)
++ err = errno;
++
++ free (c_target);
++
++ if (err != 0)
++ {
++ errno = err;
++ SCM_SYSERROR;
++ }
++
++ return SCM_UNSPECIFIED;
++}
++#undef FUNC_NAME
++
++/* Linux's module installation syscall. See `kernel/module.c' in Linux;
++ the function itself is part of the GNU libc.
++
++ Load the LEN bytes at MODULE as a kernel module, with arguments from
++ ARGS, a space-separated list of options. */
++extern long init_module (void *module, unsigned long len, const char *args);
++
++/* Load a kernel module from FD. FLAGS must be a bitwise or of
++ MODULE_INIT_* constants. The GNU libc doesn't provide a wrapper for
++ this one so we use 'syscall'. */
++static int
++finit_module (int fd, const char *args, int flags)
++{
++ return syscall (SYS_finit_module, fd, args, flags);
++}
++
++
++SCM_DEFINE (scm_load_linux_module, "load-linux-module", 1, 1, 0,
++ (SCM data, SCM options),
++ "Load the Linux kernel module whose contents are in bytevector "
++ "DATA (the contents of a @code{.ko} file), with the arguments "
++ "from the OPTIONS string.")
++#define FUNC_NAME s_scm_load_linux_module
++{
++ long err;
++ void *c_data;
++ unsigned long c_len;
++ char *c_options;
++
++ SCM_VALIDATE_BYTEVECTOR (SCM_ARG1, data);
++
++ c_data = SCM_BYTEVECTOR_CONTENTS (data);
++ c_len = SCM_BYTEVECTOR_LENGTH (data);
++ c_options =
++ scm_to_locale_string (SCM_UNBNDP (options) ? scm_nullstr : options);
++
++ err = init_module (c_data, c_len, c_options);
++
++ free (c_options);
++
++ if (err != 0)
++ SCM_SYSERROR;
++
++ return SCM_UNSPECIFIED;
++}
++#undef FUNC_NAME
++
++SCM_DEFINE (scm_load_linux_module_fd, "load-linux-module/fd", 1, 2, 0,
++ (SCM fd, SCM options, SCM flags),
++ "Load the Linux kernel module from the file at FD, "
++ "with the arguments from the OPTIONS string, and "
++ "optionally the given FLAGS.")
++#define FUNC_NAME s_scm_load_linux_module_fd
++{
++ long err;
++ int c_fd, c_flags;
++ char *c_options;
++
++ c_fd = scm_to_int (fd);
++ c_options =
++ scm_to_locale_string (SCM_UNBNDP (options) ? scm_nullstr : options);
++ c_flags = SCM_UNBNDP (flags) ? 0 : scm_to_int (flags);
++
++ err = finit_module (c_fd, c_options, c_flags);
++
++ free (c_options);
++
++ if (err != 0)
++ SCM_SYSERROR;
++
++ return SCM_UNSPECIFIED;
++}
++#undef FUNC_NAME
++
++
++/* Rebooting, halting, and all that. */
++
++#include <sys/reboot.h>
++
++SCM_VARIABLE_INIT (flag_RB_AUTOBOOT, "RB_AUTOBOOT",
++ scm_from_int (RB_AUTOBOOT));
++SCM_VARIABLE_INIT (flag_RB_HALT_SYSTEM, "RB_HALT_SYSTEM",
++ scm_from_int (RB_HALT_SYSTEM));
++SCM_VARIABLE_INIT (flag_RB_ENABLE_CAD, "RB_ENABLE_CAD",
++ scm_from_int (RB_ENABLE_CAD));
++SCM_VARIABLE_INIT (flag_RB_DISABLE_CAD, "RB_DISABLE_CAD",
++ scm_from_int (RB_DISABLE_CAD));
++SCM_VARIABLE_INIT (flag_RB_POWER_OFF, "RB_POWER_OFF",
++ scm_from_int (RB_POWER_OFF));
++SCM_VARIABLE_INIT (flag_RB_SW_SUSPEND, "RB_SW_SUSPEND",
++ scm_from_int (RB_SW_SUSPEND));
++SCM_VARIABLE_INIT (flag_RB_KEXEC, "RB_KEXEC",
++ scm_from_int (RB_KEXEC));
++
++SCM_DEFINE (scm_reboot, "reboot", 0, 1, 0,
++ (SCM command),
++ "Reboot the system. @var{command} must be one of the @code{RB_} "
++ "constants; if omitted, @var{RB_AUTOBOOT} is used, thus "
++ "performing a hard reset.")
++#define FUNC_NAME s_scm_reboot
++{
++ int c_command;
++
++ if (SCM_UNBNDP (command))
++ c_command = RB_AUTOBOOT;
++ else
++ c_command = scm_to_int (command);
++
++ reboot (c_command);
++
++ return SCM_UNSPECIFIED; /* likely unreached */
++}
++#undef FUNC_NAME
++
++/* Linux network interfaces. See <linux/if.h>. */
++
++#include <linux/if.h>
++#include <linux/sockios.h>
++#include "libguile/socket.h"
++
++SCM_VARIABLE_INIT (flag_IFF_UP, "IFF_UP",
++ scm_from_int (IFF_UP));
++SCM_VARIABLE_INIT (flag_IFF_BROADCAST, "IFF_BROADCAST",
++ scm_from_int (IFF_BROADCAST));
++SCM_VARIABLE_INIT (flag_IFF_DEBUG, "IFF_DEBUG",
++ scm_from_int (IFF_DEBUG));
++SCM_VARIABLE_INIT (flag_IFF_LOOPBACK, "IFF_LOOPBACK",
++ scm_from_int (IFF_LOOPBACK));
++SCM_VARIABLE_INIT (flag_IFF_POINTOPOINT, "IFF_POINTOPOINT",
++ scm_from_int (IFF_POINTOPOINT));
++SCM_VARIABLE_INIT (flag_IFF_NOTRAILERS, "IFF_NOTRAILERS",
++ scm_from_int (IFF_NOTRAILERS));
++SCM_VARIABLE_INIT (flag_IFF_RUNNING, "IFF_RUNNING",
++ scm_from_int (IFF_RUNNING));
++SCM_VARIABLE_INIT (flag_IFF_NOARP, "IFF_NOARP",
++ scm_from_int (IFF_NOARP));
++SCM_VARIABLE_INIT (flag_IFF_PROMISC, "IFF_PROMISC",
++ scm_from_int (IFF_PROMISC));
++SCM_VARIABLE_INIT (flag_IFF_ALLMULTI, "IFF_ALLMULTI",
++ scm_from_int (IFF_ALLMULTI));
++
++SCM_DEFINE (scm_set_network_interface_address, "set-network-interface-address",
++ 3, 0, 0,
++ (SCM socket, SCM name, SCM address),
++ "Configure network interface @var{name}.")
++#define FUNC_NAME s_scm_set_network_interface_address
++{
++ char *c_name;
++ struct ifreq ifr;
++ struct sockaddr *c_address;
++ size_t sa_len;
++ int fd, err;
++
++ socket = SCM_COERCE_OUTPORT (socket);
++ SCM_VALIDATE_OPFPORT (1, socket);
++ fd = SCM_FPORT_FDES (socket);
++
++ memset (&ifr, 0, sizeof ifr);
++ c_name = scm_to_locale_string (name);
++ c_address = scm_to_sockaddr (address, &sa_len);
++
++ strncpy (ifr.ifr_name, c_name, sizeof ifr.ifr_name - 1);
++ memcpy (&ifr.ifr_addr, c_address, sa_len);
++
++ err = ioctl (fd, SIOCSIFADDR, &ifr);
++ if (err != 0)
++ err = errno;
++
++ free (c_name);
++ free (c_address);
++
++ if (err != 0)
++ {
++ errno = err;
++ SCM_SYSERROR;
++ }
++
++ return SCM_UNSPECIFIED;
++}
++#undef FUNC_NAME
++
++SCM_DEFINE (scm_set_network_interface_flags, "set-network-interface-flags",
++ 3, 0, 0,
++ (SCM socket, SCM name, SCM flags),
++ "Change the flags of network interface @var{name} to "
++ "@var{flags}.")
++#define FUNC_NAME s_scm_set_network_interface_flags
++{
++ struct ifreq ifr;
++ char *c_name;
++ int fd, err;
++
++ socket = SCM_COERCE_OUTPORT (socket);
++ SCM_VALIDATE_OPFPORT (1, socket);
++ fd = SCM_FPORT_FDES (socket);
++
++ memset (&ifr, 0, sizeof ifr);
++ c_name = scm_to_locale_string (name);
++ strncpy (ifr.ifr_name, c_name, sizeof ifr.ifr_name - 1);
++ ifr.ifr_flags = scm_to_short (flags);
++
++ err = ioctl (fd, SIOCSIFFLAGS, &ifr);
++ if (err != 0)
++ err = errno;
++
++ free (c_name);
++
++ if (err != 0)
++ {
++ errno = err;
++ SCM_SYSERROR;
++ }
++
++ return SCM_UNSPECIFIED;
++}
++#undef FUNC_NAME
++
++SCM_DEFINE (scm_network_interface_flags, "network-interface-flags",
++ 2, 0, 0,
++ (SCM socket, SCM name),
++ "Return the flags of network interface @var{name}.")
++#define FUNC_NAME s_scm_network_interface_flags
++{
++ struct ifreq ifr;
++ char *c_name;
++ int fd, err;
++
++ socket = SCM_COERCE_OUTPORT (socket);
++ SCM_VALIDATE_OPFPORT (1, socket);
++ fd = SCM_FPORT_FDES (socket);
++
++ memset (&ifr, 0, sizeof ifr);
++ c_name = scm_to_locale_string (name);
++ strncpy (ifr.ifr_name, c_name, sizeof ifr.ifr_name - 1);
++
++ err = ioctl (fd, SIOCGIFFLAGS, &ifr);
++ if (err != 0)
++ err = errno;
++
++ free (c_name);
++
++ if (err != 0)
++ {
++ errno = err;
++ SCM_SYSERROR;
++ }
++
++ return scm_from_short (ifr.ifr_flags);
++}
++#undef FUNC_NAME
++#endif
++
+ void
+ scm_init_posix ()
+ {
diff --git a/gnu/packages/patches/guile-3.0-relocatable.patch b/gnu/packages/patches/guile-3.0-relocatable.patch
new file mode 100644
index 0000000000..3d101636dc
--- /dev/null
+++ b/gnu/packages/patches/guile-3.0-relocatable.patch
@@ -0,0 +1,69 @@
+This patch changes Guile to use a default search path relative to the
+location of the `guile' binary, allowing it to be relocated.
+
+diff --git a/libguile/load.c b/libguile/load.c
+--- a/libguile/load.c
++++ b/libguile/load.c
+@@ -27,6 +27,7 @@
+ #include <stat-time.h>
+ #include <string.h>
+ #include <stdio.h>
++#include <libgen.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <unistd.h>
+@@ -334,6 +335,32 @@ scm_init_load_path ()
+ SCM cpath = SCM_EOL;
+
+ #ifdef SCM_LIBRARY_DIR
++ char *program, *bin_dir, *prefix, *module_dir, *ccache_dir;
++
++ /* Determine the source and compiled module directories at run-time,
++ relative to the executable's location.
++
++ Note: Use /proc/self/exe instead of argv[0] because the latter is
++ not necessarily an absolute, nor a valid file name. */
++
++ program = scm_gc_malloc_pointerless (256, "string");
++ readlink ("/proc/self/exe", program, 256);
++
++ bin_dir = dirname (strdupa (program));
++
++ prefix = scm_gc_malloc_pointerless (strlen (bin_dir) + 4, "string");
++ strcpy (prefix, bin_dir);
++ strcat (prefix, "/..");
++ prefix = canonicalize_file_name (prefix);
++
++ module_dir = scm_gc_malloc_pointerless (strlen (prefix) + 50, "string");
++ strcpy (module_dir, prefix);
++ strcat (module_dir, "/share/guile/" SCM_EFFECTIVE_VERSION);
++
++ ccache_dir = scm_gc_malloc_pointerless (strlen (prefix) + 50, "string");
++ strcpy (ccache_dir, prefix);
++ strcat (ccache_dir, "/lib/guile/" SCM_EFFECTIVE_VERSION "/ccache");
++
+ env = scm_i_mirror_backslashes (getenv ("GUILE_SYSTEM_PATH"));
+ if (env && strcmp (env, "") == 0)
+ /* special-case interpret system-path=="" as meaning no system path instead
+@@ -342,10 +369,7 @@ scm_init_load_path ()
+ else if (env)
+ path = scm_parse_path (scm_from_locale_string (env), path);
+ else
+- path = scm_list_4 (scm_from_utf8_string (SCM_LIBRARY_DIR),
+- scm_from_utf8_string (SCM_SITE_DIR),
+- scm_from_utf8_string (SCM_GLOBAL_SITE_DIR),
+- scm_from_utf8_string (SCM_PKGDATA_DIR));
++ path = scm_list_1 (scm_from_locale_string (module_dir));
+
+ env = scm_i_mirror_backslashes (getenv ("GUILE_SYSTEM_COMPILED_PATH"));
+ if (env && strcmp (env, "") == 0)
+@@ -355,8 +379,7 @@ scm_init_load_path ()
+ cpath = scm_parse_path (scm_from_locale_string (env), cpath);
+ else
+ {
+- cpath = scm_list_2 (scm_from_utf8_string (SCM_CCACHE_DIR),
+- scm_from_utf8_string (SCM_SITE_CCACHE_DIR));
++ cpath = scm_list_1 (scm_from_locale_string (ccache_dir));
+ }
+
+ #endif /* SCM_LIBRARY_DIR */
diff --git a/gnu/packages/patches/guile-relocatable.patch b/gnu/packages/patches/guile-relocatable.patch
index 464333880c..d8726b4807 100644
--- a/gnu/packages/patches/guile-relocatable.patch
+++ b/gnu/packages/patches/guile-relocatable.patch
@@ -1,6 +1,17 @@
-This patch changes Guile to use a default search path relative to the
-location of the `guile' binary, allowing it to be relocated.
+From 501ad55982a8f92a7a95c76c75944d644870181d Mon Sep 17 00:00:00 2001
+From: Ludovic Courtès <ludo@gnu.org>
+Date: Thu, 12 Mar 2020 15:16:04 +0100
+Subject: [PATCH] load: Make Guile run-time relocatable using /proc/self/exe.
+Import from
+
+ http://git.savannah.gnu.org/cgit/guix.git/commit/?id=920f2c42ce3345dc1355a41377ebf01a33fdae51
+---
+ libguile/load.c | 35 +++++++++++++++++++++++++++++------
+ 1 file changed, 29 insertions(+), 6 deletions(-)
+
+diff --git a/libguile/load.c b/libguile/load.c
+index c2ee5093a..128cdf95a 100644
--- a/libguile/load.c
+++ b/libguile/load.c
@@ -26,6 +26,7 @@
@@ -11,7 +22,7 @@ location of the `guile' binary, allowing it to be relocated.
#include "libguile/_scm.h"
#include "libguile/alist.h"
-@@ -326,6 +327,32 @@ scm_init_load_path ()
+@@ -325,6 +326,32 @@ scm_init_load_path ()
SCM cpath = SCM_EOL;
#ifdef SCM_LIBRARY_DIR
@@ -44,25 +55,28 @@ location of the `guile' binary, allowing it to be relocated.
env = scm_i_mirror_backslashes (getenv ("GUILE_SYSTEM_PATH"));
if (env && strcmp (env, "") == 0)
/* special-case interpret system-path=="" as meaning no system path instead
-@@ -334,10 +361,7 @@ scm_init_load_path ()
+@@ -333,10 +360,7 @@ scm_init_load_path ()
else if (env)
path = scm_parse_path (scm_from_locale_string (env), path);
else
-- path = scm_list_4 (scm_from_utf8_string (SCM_LIBRARY_DIR),
-- scm_from_utf8_string (SCM_SITE_DIR),
-- scm_from_utf8_string (SCM_GLOBAL_SITE_DIR),
-- scm_from_utf8_string (SCM_PKGDATA_DIR));
+- path = scm_list_4 (scm_from_locale_string (SCM_LIBRARY_DIR),
+- scm_from_locale_string (SCM_SITE_DIR),
+- scm_from_locale_string (SCM_GLOBAL_SITE_DIR),
+- scm_from_locale_string (SCM_PKGDATA_DIR));
+ path = scm_list_1 (scm_from_locale_string (module_dir));
env = scm_i_mirror_backslashes (getenv ("GUILE_SYSTEM_COMPILED_PATH"));
if (env && strcmp (env, "") == 0)
-@@ -347,8 +371,7 @@ scm_init_load_path ()
+@@ -346,8 +370,7 @@ scm_init_load_path ()
cpath = scm_parse_path (scm_from_locale_string (env), cpath);
else
{
-- cpath = scm_list_2 (scm_from_utf8_string (SCM_CCACHE_DIR),
-- scm_from_utf8_string (SCM_SITE_CCACHE_DIR));
+- cpath = scm_list_2 (scm_from_locale_string (SCM_CCACHE_DIR),
+- scm_from_locale_string (SCM_SITE_CCACHE_DIR));
+ cpath = scm_list_1 (scm_from_locale_string (ccache_dir));
}
#endif /* SCM_LIBRARY_DIR */
+--
+2.24.0
+
diff --git a/gnu/packages/patches/guile-sqlite3-fix-cross-compilation.patch b/gnu/packages/patches/guile-sqlite3-fix-cross-compilation.patch
new file mode 100644
index 0000000000..9ea9a47677
--- /dev/null
+++ b/gnu/packages/patches/guile-sqlite3-fix-cross-compilation.patch
@@ -0,0 +1,55 @@
+From a6e9e62a77ecc5012929613e20da23b2636450a5 Mon Sep 17 00:00:00 2001
+From: Mathieu Othacehe <mathieu.othacehe@parrot.com>
+Date: Mon, 25 Mar 2019 11:00:38 +0100
+Subject: [PATCH] cross compile
+
+---
+ build-aux/guile.am | 2 +-
+ configure.ac | 19 ++++++++++++-------
+ 2 files changed, 13 insertions(+), 8 deletions(-)
+
+diff --git a/build-aux/guile.am b/build-aux/guile.am
+index dc1e63f..3126372 100644
+--- a/build-aux/guile.am
++++ b/build-aux/guile.am
+@@ -16,4 +16,4 @@ EXTRA_DIST = $(SOURCES) $(NOCOMP_SOURCES)
+ GUILE_WARNINGS = -Wunbound-variable -Warity-mismatch -Wformat
+ SUFFIXES = .scm .go
+ .scm.go:
+- $(AM_V_GEN)$(top_builddir)/env $(GUILE_TOOLS) compile $(GUILE_WARNINGS) -o "$@" "$<"
++ $(AM_V_GEN)$(top_builddir)/env $(GUILE_TOOLS) compile $(GUILE_TARGET) $(GUILE_WARNINGS) -o "$@" "$<"
+diff --git a/configure.ac b/configure.ac
+index f648fcb..2d34d0a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -21,15 +21,20 @@ PKG_CHECK_MODULES([SQLITE], [sqlite3])
+ SQLITE_LIBDIR="`"$PKG_CONFIG" sqlite3 --variable libdir`"
+ AC_SUBST([SQLITE_LIBDIR])
+
+-AC_MSG_CHECKING([whether '$SQLITE_LIBDIR/libsqlite3' is usable])
+-GUILE_CHECK([retval],
+- [(dynamic-func \"sqlite3_open_v2\"
++if test "$cross_compiling" = "no"; then
++ AC_MSG_CHECKING([whether '$SQLITE_LIBDIR/libsqlite3' is usable])
++ GUILE_CHECK([retval],
++ [(dynamic-func \"sqlite3_open_v2\"
+ (dynamic-link \"$SQLITE_LIBDIR/libsqlite3\"))])
+-if test "$retval" != 0; then
+- AC_MSG_RESULT([no])
+- AC_MSG_ERROR([failed to load '$SQLITE_LIBDIR/libsqlite3'])
++ if test "$retval" != 0; then
++ AC_MSG_RESULT([no])
++ AC_MSG_ERROR([failed to load '$SQLITE_LIBDIR/libsqlite3'])
++ else
++ AC_MSG_RESULT([yes])
++ fi
+ else
+- AC_MSG_RESULT([yes])
++ GUILE_TARGET="--target=$host_alias"
++ AC_SUBST([GUILE_TARGET])
+ fi
+
+ AC_CONFIG_FILES([Makefile sqlite3.scm])
+--
+2.17.1
+
diff --git a/gnu/packages/patches/hurd-cross.patch b/gnu/packages/patches/hurd-cross.patch
new file mode 100644
index 0000000000..cc95dddccc
--- /dev/null
+++ b/gnu/packages/patches/hurd-cross.patch
@@ -0,0 +1,33 @@
+This fixes linking libfstest/test-fcntl (and others).
+
+As discussed with upstream: https://lists.gnu.org/archive/html/bug-hurd/2020-03/msg00018.html
+
+From 96a9f67a8685e713f25259c18306797d54cc27a5 Mon Sep 17 00:00:00 2001
+From: Jan Nieuwenhuizen <janneke@gnu.org>
+Date: Sat, 14 Mar 2020 11:28:31 +0100
+Subject: [PATCH] build: Fix cross build on Guix.
+
+As discussed in https://lists.gnu.org/archive/html/bug-hurd/2020-03/msg00018.html.
+
+* Makeconf (lpath): Add -Wl,-rpath-link=<dir> next to -L<dir>.
+---
+ Makeconf | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/Makeconf b/Makeconf
+index 67f7ab1c..f68ff6e3 100644
+--- a/Makeconf
++++ b/Makeconf
+@@ -325,7 +325,8 @@ _libsubst=${libsubst$(patsubst %,-override,${libsubst-override})}
+
+ # Direct the linker where to find shared objects specified in the
+ # dependencies of other shared objects it encounters.
+-lpath := -L. $(patsubst %,-L%,$(dir $(wildcard ../lib*/lib*.so)))
++lib_dirs := $(dir $(wildcard ../lib*/lib*.so))
++lpath := -L. $(lib_dirs:%=-L%) $(lib_dirs:%=-Wl,-rpath-link=%)
+
+ # Main rule to link executables
+ #
+--
+2.24.0
+
diff --git a/gnu/packages/patches/hurd-fix-eth-multiplexer-dependency.patch b/gnu/packages/patches/hurd-fix-eth-multiplexer-dependency.patch
deleted file mode 100644
index 5f0da3eab3..0000000000
--- a/gnu/packages/patches/hurd-fix-eth-multiplexer-dependency.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From ef0399bad41e60cb30d5073129abeb206076394a Mon Sep 17 00:00:00 2001
-From: Manolis Ragkousis <manolis837@gmail.com>
-Date: Sat, 8 Apr 2017 16:44:52 +0300
-Subject: [PATCH] eth-multiplexer: Fix iohelp missing dependency.
-
-* eth-multiplexer/Makefile (HURDLIBS): Add iohelp.
----
- eth-multiplexer/Makefile | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/eth-multiplexer/Makefile b/eth-multiplexer/Makefile
-index 07f909e7..cefa0abd 100644
---- a/eth-multiplexer/Makefile
-+++ b/eth-multiplexer/Makefile
-@@ -26,7 +26,7 @@ MIGSFLAGS = -imacros $(srcdir)/mig-mutate.h
- device-MIGSFLAGS="-DMACH_PAYLOAD_TO_PORT=ports_payload_get_name"
- OBJS = $(SRCS:.c=.o) $(MIGSTUBS)
- LCLHDRS = ethernet.h util.h vdev.h netfs_impl.h
--HURDLIBS = ports ihash fshelp shouldbeinlibc netfs bpf
-+HURDLIBS = ports ihash iohelp fshelp shouldbeinlibc netfs bpf
- LDLIBS = -lpthread
-
- CFLAGS += -I$(top_srcdir)/libbpf
---
-2.12.2
-
diff --git a/gnu/packages/patches/icecat-makeicecat.patch b/gnu/packages/patches/icecat-makeicecat.patch
index c2c59ec855..2978a5789e 100644
--- a/gnu/packages/patches/icecat-makeicecat.patch
+++ b/gnu/packages/patches/icecat-makeicecat.patch
@@ -25,7 +25,7 @@ index 8be2362..48716f2 100755
-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 ad3ea069c3d23aab360ad04ff4d0f5e556d3538f7dd4eae0690c4e9241537570 firefox-${FFVERSION}esr.source.tar.xz |sha256sum -c -
+-echo -n fa5b2266d225878d4b35694678f79fd7e7a6d3c62759a40326129bd90f63e842 firefox-${FFVERSION}esr.source.tar.xz |sha256sum -c -
-
-echo Extracting Firefox tarball
-tar -xf firefox-${FFVERSION}esr.source.tar.xz
@@ -37,7 +37,7 @@ index 8be2362..48716f2 100755
+# 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 ad3ea069c3d23aab360ad04ff4d0f5e556d3538f7dd4eae0690c4e9241537570 firefox-${FFVERSION}esr.source.tar.xz |sha256sum -c -
++# echo -n fa5b2266d225878d4b35694678f79fd7e7a6d3c62759a40326129bd90f63e842 firefox-${FFVERSION}esr.source.tar.xz |sha256sum -c -
+#
+# echo Extracting Firefox tarball
+# tar -xf firefox-${FFVERSION}esr.source.tar.xz
diff --git a/gnu/packages/patches/icecat-use-older-reveal-hidden-html.patch b/gnu/packages/patches/icecat-use-older-reveal-hidden-html.patch
new file mode 100644
index 0000000000..228adc23f1
--- /dev/null
+++ b/gnu/packages/patches/icecat-use-older-reveal-hidden-html.patch
@@ -0,0 +1,70 @@
+From 2e8618d22568b6e00892a17303d437dd700eca98 Mon Sep 17 00:00:00 2001
+From: Mark H Weaver <mhw@netris.org>
+Date: Tue, 5 May 2020 21:27:41 -0400
+Subject: [PATCH] Revert "Update Reveal hidden HTML."
+
+I prefer the user interface of the old version.
+
+This reverts commit f6e3adb6b2344ee2c7bb453a305fd2d6fb4c194c.
+---
+ .../passive_improve_css.js | 23 ++++++++++++++-----
+ 1 file changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/data/extensions/SubmitMe@0xbeef.coffee/passive_improve_css.js b/data/extensions/SubmitMe@0xbeef.coffee/passive_improve_css.js
+index 7692990..ca57982 100644
+--- a/data/extensions/SubmitMe@0xbeef.coffee/passive_improve_css.js
++++ b/data/extensions/SubmitMe@0xbeef.coffee/passive_improve_css.js
+@@ -10,6 +10,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
+ */
+
+
++var bad = [];
++
+ function escapeHTML (unsafe_str) {
+ return unsafe_str
+ .replace(/&/g, '&amp;')
+@@ -20,9 +22,14 @@ function escapeHTML (unsafe_str) {
+ .replace(/\//g, '&#x2F;')
+ }
+
++function dounhide(){
++ for(var i = 0; i < bad.length; i++){
++ bad[i].remove();
++ }
++}
++
+ console.log("passive_improve_css.js");
+ function reveal_css(){
+- var bad = [];
+
+ var elements = document.getElementsByTagName("style");
+ for(var i = 0; i < elements.length; i++){
+@@ -41,16 +48,20 @@ function reveal_css(){
+
+ }
+ }
+- if(bad.length > 0 && window.confirm("Hidden HTML detected, would you like to reveal it?")){
+- for(var i = 0; i < bad.length; i++){
+- bad[i].remove();
+- }
++ if(bad.length > 0){
++ const insertedDiv = document.createElement('div');
++ insertedDiv.innerHTML= '<p id="unhide" class="button white" style="text-decoration:none!important; color:#000!important; font-size:1em !important; font-family:\'sans-serif\'!important; font-weight:normal !important; background-color:transparent!important; margin:0!important; padding:0!important; font-size:10px!important; line-height:1!important"' +
++ 'alt="Click to reveal hidden elements in this page">' +
++ '<span>Reveal hidden elements</span>' +
++ '</a>';
++ insertedDiv.style="position:fixed; bottom:1em; right:1em; opacity:0.8; z-index: 2147483647 !important; border-radius: 3px !important; background-color: #fff !important; padding: 0.5em !important; box-shadow: 0 0 3px grey !important; font-color:#bbb!important; cursor: pointer!important;";
++ insertedDiv.addEventListener("click", dounhide, false);
++ document.body.insertBefore(insertedDiv, document.body.firstChild);
+ }
+ }
+
+ reveal_css();
+
+-
+ /*
+ var a = document.getElementsByTagName("style")[2];
+ var btn = document.createElement("style"); // Create a <button> element
+--
+2.26.2
+
diff --git a/gnu/packages/patches/ilmbase-fix-test-arm.patch b/gnu/packages/patches/ilmbase-fix-test-arm.patch
new file mode 100644
index 0000000000..2dbc55e8c4
--- /dev/null
+++ b/gnu/packages/patches/ilmbase-fix-test-arm.patch
@@ -0,0 +1,60 @@
+Fix a test failure on ARM platforms:
+
+https://github.com/AcademySoftwareFoundation/openexr/issues/713
+
+Taken from upstream:
+
+https://github.com/AcademySoftwareFoundation/openexr/commit/76d9839cd1b300398f8b801dfcb4bcf2f8c0096f
+
+diff --git a/OpenEXR/IlmImfTest/testHuf.cpp b/OpenEXR/IlmImfTest/testHuf.cpp
+index 4c887ee8..a93b8ea9 100644
+--- a/OpenEXR/IlmImfTest/testHuf.cpp
++++ b/OpenEXR/IlmImfTest/testHuf.cpp
+@@ -181,9 +181,9 @@ compressUncompressSubset(const unsigned short raw[], int n)
+ // This DEK hash is determined from an aprior initial run of this
+ // test noting its value from the assert message compressVerify().
+ //
+-#define HUF_COMPRESS_DEK_HASH_FOR_FILL4_USHRT_MAX_PLUS_ONE 2956869585U
+-#define HUF_COMPRESS_DEK_HASH_FOR_FILL4_N 3414126535U
+-#define HUF_COMPRESS_DEK_HASH_FOR_FILL5_N 169791374U
++#define HUF_COMPRESS_DEK_HASH_FOR_FILL4_USHRT_MAX_PLUS_ONE 2013380646U
++#define HUF_COMPRESS_DEK_HASH_FOR_FILL4_N 213880353U
++#define HUF_COMPRESS_DEK_HASH_FOR_FILL5_N 2492982090U
+
+ void
+ compressVerify (const unsigned short raw[],
+@@ -200,7 +200,7 @@ compressVerify (const unsigned short raw[],
+ // under the topic of sorting and search chapter 6.4.
+ //
+ unsigned int compressedHash = nCompressed;
+- const char* cptr = compressed;
++ const unsigned char* cptr = reinterpret_cast<const unsigned char*>( (const char*) compressed);
+ for (int i = 0; i < nCompressed; ++i)
+ {
+ compressedHash =
+@@ -210,6 +210,25 @@ compressVerify (const unsigned short raw[],
+ cout << "verifying compressed checksum hash = "
+ << compressedHash << std::endl;
+
++ if (compressedHash != dekHash)
++ {
++ cout << "hash verification failed. Got " << compressedHash << " expected " << dekHash << std::endl;
++ const unsigned char* cptr = reinterpret_cast<const unsigned char*>( (const char*) compressed);
++ for(int i = 0 ; i < nCompressed ; ++i )
++ {
++ cout << std::hex << (0xFF & (int) (*cptr++));
++ if ( (i & 0xF) ==0 )
++ {
++ cout << '\n';
++ }
++ else
++ {
++ cout << ' ';
++ }
++ }
++ cout << "\n";
++ }
++
+ assert (compressedHash == dekHash);
+ }
+
diff --git a/gnu/packages/patches/ilmbase-openexr-pkg-config.patch b/gnu/packages/patches/ilmbase-openexr-pkg-config.patch
deleted file mode 100644
index 99613080d8..0000000000
--- a/gnu/packages/patches/ilmbase-openexr-pkg-config.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-Fix pkg-config files when using the CMake build system.
-
-Upstream bug report:
-https://github.com/openexr/openexr/issues/567
-
-diff --git a/IlmBase/config/CMakeLists.txt b/IlmBase/config/CMakeLists.txt
-index 508176a..9e6ab91 100644
---- a/IlmBase/config/CMakeLists.txt
-+++ b/IlmBase/config/CMakeLists.txt
-@@ -71,9 +71,9 @@ if(ILMBASE_INSTALL_PKG_CONFIG)
- # use a helper function to avoid variable pollution, but pretty simple
- function(ilmbase_pkg_config_help pcinfile)
- set(prefix ${CMAKE_INSTALL_PREFIX})
-- set(exec_prefix ${CMAKE_INSTALL_BINDIR})
-- set(libdir ${CMAKE_INSTALL_LIBDIR})
-- set(includedir ${CMAKE_INSTALL_INCLUDEDIR})
-+ set(exec_prefix ${CMAKE_INSTALL_FULL_BINDIR})
-+ set(libdir ${CMAKE_INSTALL_FULL_LIBDIR})
-+ set(includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR})
- set(LIB_SUFFIX_DASH ${ILMBASE_LIB_SUFFIX})
- if(TARGET Threads::Threads)
- # hrm, can't use properties as they end up as generator expressions
-diff --git a/OpenEXR/config/CMakeLists.txt b/OpenEXR/config/CMakeLists.txt
-index 1ef829a..b8dc141 100644
---- a/OpenEXR/config/CMakeLists.txt
-+++ b/OpenEXR/config/CMakeLists.txt
-@@ -72,9 +72,9 @@ if(OPENEXR_INSTALL_PKG_CONFIG)
- # use a helper function to avoid variable pollution, but pretty simple
- function(openexr_pkg_config_help pcinfile)
- set(prefix ${CMAKE_INSTALL_PREFIX})
-- set(exec_prefix ${CMAKE_INSTALL_BINDIR})
-- set(libdir ${CMAKE_INSTALL_LIBDIR})
-- set(includedir ${CMAKE_INSTALL_INCLUDEDIR})
-+ set(exec_prefix ${CMAKE_INSTALL_FULL_BINDIR})
-+ set(libdir ${CMAKE_INSTALL_FULL_LIBDIR})
-+ set(includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR})
- set(LIB_SUFFIX_DASH ${OPENEXR_LIB_SUFFIX})
- if(TARGET Threads::Threads)
- # hrm, can't use properties as they end up as generator expressions
-
diff --git a/gnu/packages/patches/inetutils-hurd.patch b/gnu/packages/patches/inetutils-hurd.patch
new file mode 100644
index 0000000000..bd65c4feb1
--- /dev/null
+++ b/gnu/packages/patches/inetutils-hurd.patch
@@ -0,0 +1,583 @@
+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/jbig2dec-ignore-testtest.patch b/gnu/packages/patches/jbig2dec-ignore-testtest.patch
deleted file mode 100644
index 7c80c545e9..0000000000
--- a/gnu/packages/patches/jbig2dec-ignore-testtest.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-Do not run the test 'test_jbig2dec.py'. It doesn't seem to do anything
-and reports failure. TODO: Actually fix the test instead of ignoring it.
-
-diff --git a/Makefile.in b/Makefile.in
-index 63982d4..8af1d61 100644
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -93,7 +93,7 @@ host_triplet = @host@
- bin_PROGRAMS = jbig2dec$(EXEEXT)
- noinst_PROGRAMS = test_sha1$(EXEEXT) test_huffman$(EXEEXT) \
- test_arith$(EXEEXT)
--TESTS = test_sha1$(EXEEXT) test_jbig2dec.py test_huffman$(EXEEXT) \
-+TESTS = test_sha1$(EXEEXT) test_huffman$(EXEEXT) \
- test_arith$(EXEEXT)
- subdir = .
- ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
diff --git a/gnu/packages/patches/julia-SOURCE_DATE_EPOCH-mtime.patch b/gnu/packages/patches/julia-SOURCE_DATE_EPOCH-mtime.patch
index 32dfd7b856..b60f284923 100644
--- a/gnu/packages/patches/julia-SOURCE_DATE_EPOCH-mtime.patch
+++ b/gnu/packages/patches/julia-SOURCE_DATE_EPOCH-mtime.patch
@@ -1,28 +1,22 @@
---- /dev/null
-+++ b/gnu/packages/patches/julia-SOURCE_DATE_EPOCH-mtime.patch
-@@ -0,0 +1,22 @@
-+Fix one of upstream non-determinism, tracked here:
-+
-+https://github.com/JuliaLang/julia/issues/34115
-+https://github.com/JuliaLang/julia/issues/25900
-+
-+
-+Patch by Nicoló Balzarotti <nicolo@nixo.xyz>.
-+
-+--- a/base/loading.jl
-++++ b/base/loading.jl
-+@@ -807,7 +807,10 @@
-+ path = normpath(joinpath(dirname(prev), _path))
-+ end
-+ if _track_dependencies[]
-+- push!(_require_dependencies, (mod, path, mtime(path)))
-++ push!(_require_dependencies,
-++ (mod, path,
-++ haskey(ENV, "SOURCE_DATE_EPOCH") ?
-++ parse(Float64, ENV["SOURCE_DATE_EPOCH"]) : mtime(path)))
-+ end
-+ return path, prev
-+ end
---
-2.26.0
+Fix one of upstream non-determinism, tracked here:
+https://github.com/JuliaLang/julia/issues/34115
+https://github.com/JuliaLang/julia/issues/25900
+
+
+Patch by Nicoló Balzarotti <nicolo@nixo.xyz>.
+
+--- a/base/loading.jl
++++ b/base/loading.jl
+@@ -807,7 +807,10 @@
+ path = normpath(joinpath(dirname(prev), _path))
+ end
+ if _track_dependencies[]
+- push!(_require_dependencies, (mod, path, mtime(path)))
++ push!(_require_dependencies,
++ (mod, path,
++ haskey(ENV, "SOURCE_DATE_EPOCH") ?
++ parse(Float64, ENV["SOURCE_DATE_EPOCH"]) : mtime(path)))
+ end
+ return path, prev
+ end
diff --git a/gnu/packages/patches/less-hurd-path-max.patch b/gnu/packages/patches/less-hurd-path-max.patch
new file mode 100644
index 0000000000..4d23a08788
--- /dev/null
+++ b/gnu/packages/patches/less-hurd-path-max.patch
@@ -0,0 +1,36 @@
+Avoid usage of PATH_MAX.
+
+Submitted to bug-less@gnu.org.
+
+From ef652341ed8b2c14ac40312ccd4ed329cb69fd0c Mon Sep 17 00:00:00 2001
+From: Jan Nieuwenhuizen <janneke@gnu.org>
+Date: Sat, 7 Mar 2020 14:57:19 +0100
+Subject: [PATCH] Avoid usage of PATH_MAX.
+
+* filename.c (lrealpath): Have realpath allocate the buffer. Fixes
+compilation on the Hurd and avoids possible buffer overflow on other
+systems.
+---
+ filename.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/filename.c b/filename.c
+index e420837..faa71b0 100644
+--- a/filename.c
++++ b/filename.c
+@@ -795,9 +795,9 @@ lrealpath(path)
+ char *path;
+ {
+ #if HAVE_REALPATH
+- char rpath[PATH_MAX];
+- if (realpath(path, rpath) != NULL)
+- return (save(rpath));
++ char *rpath = NULL;
++ if ((rpath = realpath(path, rpath)) != NULL)
++ return (rpath);
+ #endif
+ return (save(path));
+ }
+--
+2.24.0
+
diff --git a/gnu/packages/patches/libffi-3.2.1-complex-alpha.patch b/gnu/packages/patches/libffi-3.2.1-complex-alpha.patch
deleted file mode 100644
index ebbc0635a5..0000000000
--- a/gnu/packages/patches/libffi-3.2.1-complex-alpha.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-The patch fixes build failure of form:
- ../src/alpha/osf.S:298:2: error: #error "osf.S out of sync with ffi.h"
-Upstream fixed the bug in a more invasive way
-but didn't have releases since 3.2.1.
-
-The patch is taken from Gentoo:
-https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-libs/libffi/files/libffi-3.2.1-complex_alpha.patch
-
---- libffi-3.2.1/src/alpha/osf.S 2015-01-16 10:46:15.000000000 +0100
-+++ libffi-3.2.1/src/alpha/osf.S 2015-01-16 10:46:24.000000000 +0100
-@@ -279,6 +279,7 @@
- .gprel32 $load_64 # FFI_TYPE_SINT64
- .gprel32 $load_none # FFI_TYPE_STRUCT
- .gprel32 $load_64 # FFI_TYPE_POINTER
-+ .gprel32 $load_none # FFI_TYPE_COMPLEX
-
- /* Assert that the table above is in sync with ffi.h. */
-
-@@ -294,7 +295,8 @@
- || FFI_TYPE_SINT64 != 12 \
- || FFI_TYPE_STRUCT != 13 \
- || FFI_TYPE_POINTER != 14 \
-- || FFI_TYPE_LAST != 14
-+ || FFI_TYPE_COMPLEX != 15 \
-+ || FFI_TYPE_LAST != 15
- #error "osf.S out of sync with ffi.h"
- #endif
-
diff --git a/gnu/packages/patches/libgpg-error-gawk-compat.patch b/gnu/packages/patches/libgpg-error-gawk-compat.patch
deleted file mode 100644
index 85477b0be6..0000000000
--- a/gnu/packages/patches/libgpg-error-gawk-compat.patch
+++ /dev/null
@@ -1,155 +0,0 @@
-From 7865041c77f4f7005282f10f9b6666b19072fbdf Mon Sep 17 00:00:00 2001
-From: NIIBE Yutaka <gniibe@fsij.org>
-Date: Mon, 15 Apr 2019 15:10:44 +0900
-Subject: [PATCH] awk: Prepare for Gawk 5.0.
-
-* src/Makefile.am: Use pkg_namespace (instead of namespace).
-* src/mkerrnos.awk: Likewise.
-* lang/cl/mkerrcodes.awk: Don't escape # in regexp.
-* src/mkerrcodes.awk, src/mkerrcodes1.awk, src/mkerrcodes2.awk: Ditto.
-
---
-
-In Gawk 5.0, regexp routines are replaced by Gnulib implementation,
-which only allows escaping specific characters.
-
-GnuPG-bug-id: 4459
-Reported-by: Marius Schamschula
-Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
----
- lang/cl/mkerrcodes.awk | 2 +-
- src/Makefile.am | 2 +-
- src/mkerrcodes.awk | 2 +-
- src/mkerrcodes1.awk | 2 +-
- src/mkerrcodes2.awk | 2 +-
- src/mkerrnos.awk | 2 +-
- src/mkstrtable.awk | 10 +++++-----
- 7 files changed, 11 insertions(+), 11 deletions(-)
-
-diff --git a/lang/cl/mkerrcodes.awk b/lang/cl/mkerrcodes.awk
-index ae29043..9a1fc18 100644
---- a/lang/cl/mkerrcodes.awk
-+++ b/lang/cl/mkerrcodes.awk
-@@ -122,7 +122,7 @@ header {
- }
-
- !header {
-- sub (/\#.+/, "");
-+ sub (/#.+/, "");
- sub (/[ ]+$/, ""); # Strip trailing space and tab characters.
-
- if (/^$/)
-diff --git a/src/Makefile.am b/src/Makefile.am
-index ce1b882..f2590cb 100644
---- a/src/Makefile.am
-+++ b/src/Makefile.am
-@@ -293,7 +293,7 @@ code-from-errno.h: mkerrcodes$(EXEEXT_FOR_BUILD) Makefile
-
- errnos-sym.h: Makefile mkstrtable.awk errnos.in
- $(AWK) -f $(srcdir)/mkstrtable.awk -v textidx=2 -v nogettext=1 \
-- -v prefix=GPG_ERR_ -v namespace=errnos_ \
-+ -v prefix=GPG_ERR_ -v pkg_namespace=errnos_ \
- $(srcdir)/errnos.in >$@
-
-
-diff --git a/src/mkerrcodes.awk b/src/mkerrcodes.awk
-index 46d436c..e9c857c 100644
---- a/src/mkerrcodes.awk
-+++ b/src/mkerrcodes.awk
-@@ -85,7 +85,7 @@ header {
- }
-
- !header {
-- sub (/\#.+/, "");
-+ sub (/#.+/, "");
- sub (/[ ]+$/, ""); # Strip trailing space and tab characters.
-
- if (/^$/)
-diff --git a/src/mkerrcodes1.awk b/src/mkerrcodes1.awk
-index a771a73..4578e29 100644
---- a/src/mkerrcodes1.awk
-+++ b/src/mkerrcodes1.awk
-@@ -81,7 +81,7 @@ header {
- }
-
- !header {
-- sub (/\#.+/, "");
-+ sub (/#.+/, "");
- sub (/[ ]+$/, ""); # Strip trailing space and tab characters.
-
- if (/^$/)
-diff --git a/src/mkerrcodes2.awk b/src/mkerrcodes2.awk
-index ea58503..188f7a4 100644
---- a/src/mkerrcodes2.awk
-+++ b/src/mkerrcodes2.awk
-@@ -91,7 +91,7 @@ header {
- }
-
- !header {
-- sub (/\#.+/, "");
-+ sub (/#.+/, "");
- sub (/[ ]+$/, ""); # Strip trailing space and tab characters.
-
- if (/^$/)
-diff --git a/src/mkerrnos.awk b/src/mkerrnos.awk
-index f79df66..15b1aad 100644
---- a/src/mkerrnos.awk
-+++ b/src/mkerrnos.awk
-@@ -83,7 +83,7 @@ header {
- }
-
- !header {
-- sub (/\#.+/, "");
-+ sub (/#.+/, "");
- sub (/[ ]+$/, ""); # Strip trailing space and tab characters.
-
- if (/^$/)
-diff --git a/src/mkstrtable.awk b/src/mkstrtable.awk
-index c9de9c1..285e45f 100644
---- a/src/mkstrtable.awk
-+++ b/src/mkstrtable.awk
-@@ -77,7 +77,7 @@
- #
- # The variable prefix can be used to prepend a string to each message.
- #
--# The variable namespace can be used to prepend a string to each
-+# The variable pkg_namespace can be used to prepend a string to each
- # variable and macro name.
-
- BEGIN {
-@@ -102,7 +102,7 @@ header {
- print "/* The purpose of this complex string table is to produce";
- print " optimal code with a minimum of relocations. */";
- print "";
-- print "static const char " namespace "msgstr[] = ";
-+ print "static const char " pkg_namespace "msgstr[] = ";
- header = 0;
- }
- else
-@@ -110,7 +110,7 @@ header {
- }
-
- !header {
-- sub (/\#.+/, "");
-+ sub (/#.+/, "");
- sub (/[ ]+$/, ""); # Strip trailing space and tab characters.
-
- if (/^$/)
-@@ -150,7 +150,7 @@ END {
- else
- print " gettext_noop (\"" last_msgstr "\");";
- print "";
-- print "static const int " namespace "msgidx[] =";
-+ print "static const int " pkg_namespace "msgidx[] =";
- print " {";
- for (i = 0; i < coded_msgs; i++)
- print " " pos[i] ",";
-@@ -158,7 +158,7 @@ END {
- print " };";
- print "";
- print "static GPG_ERR_INLINE int";
-- print namespace "msgidxof (int code)";
-+ print pkg_namespace "msgidxof (int code)";
- print "{";
- print " return (0 ? 0";
-
diff --git a/gnu/packages/patches/libjpeg-turbo-CVE-2019-2201.patch b/gnu/packages/patches/libjpeg-turbo-CVE-2019-2201.patch
deleted file mode 100644
index 35f2bf5963..0000000000
--- a/gnu/packages/patches/libjpeg-turbo-CVE-2019-2201.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-Fix integer overflow which can potentially lead to RCE.
-
-https://www.openwall.com/lists/oss-security/2019/11/11/1
-https://nvd.nist.gov/vuln/detail/CVE-2019-2201
-
-The problem was partially fixed in 2.0.3. This patch is a follow-up.
-https://github.com/libjpeg-turbo/libjpeg-turbo/issues/388
-https://github.com/libjpeg-turbo/libjpeg-turbo/commit/c30b1e72dac76343ef9029833d1561de07d29bad
-
-diff --git a/tjbench.c b/tjbench.c
-index a7d397318..13a5bde62 100644
---- a/tjbench.c
-+++ b/tjbench.c
-@@ -171,7 +171,7 @@ static int decomp(unsigned char *srcBuf, unsigned char **jpegBuf,
- }
- /* Set the destination buffer to gray so we know whether the decompressor
- attempted to write to it */
-- memset(dstBuf, 127, pitch * scaledh);
-+ memset(dstBuf, 127, (size_t)pitch * scaledh);
-
- if (doYUV) {
- int width = doTile ? tilew : scaledw;
-@@ -193,7 +193,7 @@ static int decomp(unsigned char *srcBuf, unsigned char **jpegBuf,
- double start = getTime();
-
- for (row = 0, dstPtr = dstBuf; row < ntilesh;
-- row++, dstPtr += pitch * tileh) {
-+ row++, dstPtr += (size_t)pitch * tileh) {
- for (col = 0, dstPtr2 = dstPtr; col < ntilesw;
- col++, tile++, dstPtr2 += ps * tilew) {
- int width = doTile ? min(tilew, w - col * tilew) : scaledw;
diff --git a/gnu/packages/patches/libreoffice-poppler-compat.patch b/gnu/packages/patches/libreoffice-poppler-compat.patch
new file mode 100644
index 0000000000..8dc0b60a12
--- /dev/null
+++ b/gnu/packages/patches/libreoffice-poppler-compat.patch
@@ -0,0 +1,19 @@
+Fix type mismatch with Poppler 0.86.
+
+Taken from Arch Linux:
+https://git.archlinux.org/svntogit/packages.git/tree/trunk/libreoffice-poppler-0.86.patch?h=packages/libreoffice-fresh
+
+diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
+--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
++++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
+@@ -563,7 +563,9 @@ void PDFOutDev::processLink(Link* link, Catalog*)
+ if (!(pAction && pAction->getKind() == actionURI))
+ return;
+
+-#if POPPLER_CHECK_VERSION(0, 72, 0)
++#if POPPLER_CHECK_VERSION(0, 86, 0)
++ const char* pURI = static_cast<LinkURI*>(pAction)->getURI().c_str();
++#elif POPPLER_CHECK_VERSION(0, 72, 0)
+ const char* pURI = static_cast<LinkURI*>(pAction)->getURI()->c_str();
+ #else
+ const char* pURI = static_cast<LinkURI*>(pAction)->getURI()->getCString();
diff --git a/gnu/packages/patches/libtirpc-hurd-client.patch b/gnu/packages/patches/libtirpc-hurd-client.patch
new file mode 100644
index 0000000000..526ad262d2
--- /dev/null
+++ b/gnu/packages/patches/libtirpc-hurd-client.patch
@@ -0,0 +1,50 @@
+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/libtirpc-hurd.patch b/gnu/packages/patches/libtirpc-hurd.patch
new file mode 100644
index 0000000000..cd625d696f
--- /dev/null
+++ b/gnu/packages/patches/libtirpc-hurd.patch
@@ -0,0 +1,172 @@
+This is a combination of two patches:
+
+1) Taken from https://salsa.debian.org/debian/libtirpc/-/raw/master/debian/patches/03-kfreebsd.diff
+
+Description: Fix build on non Linux architectures
+Author: Andreas Beckmann <anbe@debian.org>
+Last-Update: 2019-09-01
+
+2) Taken from https://salsa.debian.org/debian/libtirpc/-/raw/master/debian/patches/05-hurd-port.diff
+
+Description: Get source building on Hurd
+ - Look for <sys/user.h> before using it.
+ - Define MAXHOSTNAMELEN to 64 if missing.
+ - Bind sockets on Hurd like on Linux.
+Author: Petter Reinholdtsen <pere@hungry.com>
+
+--- a/src/svc_dg.c
++++ b/src/svc_dg.c
+@@ -648,6 +648,7 @@
+ void
+ svc_dg_enable_pktinfo(int fd, const struct __rpc_sockinfo *si)
+ {
++#ifdef __linux__
+ int val = 1;
+
+ switch (si->si_af) {
+@@ -660,6 +661,7 @@
+ break;
+ #endif
+ }
++#endif
+ }
+
+ /*
+@@ -670,6 +672,7 @@
+ int
+ svc_dg_valid_pktinfo(struct msghdr *msg)
+ {
++#ifdef __linux__
+ struct cmsghdr *cmsg;
+
+ if (!msg->msg_name)
+@@ -716,4 +719,7 @@
+ }
+
+ return 1;
++#else
++ return 0;
++#endif
+ }
+--- a/src/clnt_vc.c
++++ b/src/clnt_vc.c
+@@ -71,10 +71,12 @@
+ #define MCALL_MSG_SIZE 24
+
+ #define CMGROUP_MAX 16
+-#define SCM_CREDS 0x03 /* process creds (struct cmsgcred) */
+
+ #undef rpc_createerr /* make it clear it is a thread safe variable */
+
++#ifndef SCM_CREDS
++#define SCM_CREDS 0x03 /* process creds (struct cmsgcred) */
++
+ /*
+ * Credentials structure, used to verify the identity of a peer
+ * process that has sent us a message. This is allocated by the
+@@ -90,6 +92,7 @@
+ short cmcred_ngroups; /* number or groups */
+ gid_t cmcred_groups[CMGROUP_MAX]; /* groups */
+ };
++#endif
+
+ struct cmessage {
+ struct cmsghdr cmsg;
+--- a/src/getpeereid.c
++++ b/src/getpeereid.c
+@@ -25,9 +25,14 @@
+ */
+
+
++#include "config.h"
++
+ #include <sys/param.h>
+ #include <sys/socket.h>
+ #include <sys/un.h>
++#ifdef HAVE_SYS_USER_H
++# include <sys/user.h>
++#endif /* HAVE_SYS_USER_H */
+
+ #include <errno.h>
+ #include <unistd.h>
+--- a/src/getpeereid.c
++++ b/src/getpeereid.c
+@@ -35,12 +36,25 @@
+ int
+ getpeereid(int s, uid_t *euid, gid_t *egid)
+ {
++#ifndef HAVE_SYS_USER_H
++ return(-1);
++#else
++#ifdef XUCRED_VERSION
++ struct xucred uc;
++#define uid cr_uid
++#define gid cr_gid
++#else
+ struct ucred uc;
++#endif
+ socklen_t uclen;
+ int error;
+
+ uclen = sizeof(uc);
++#ifdef XUCRED_VERSION
++ error = getsockopt(s, 0, LOCAL_PEERCRED, &uc, &uclen);
++#else
+ error = getsockopt(s, SOL_SOCKET, SO_PEERCRED, &uc, &uclen); /* SCM_CREDENTIALS */
++#endif
+ if (error != 0)
+ return (error);
+ // if (uc.cr_version != XUCRED_VERSION)
+@@ -59,4 +66,5 @@
+ *euid = uc.uid;
+ *egid = uc.gid;
+ return (0);
++#endif /* HAVE_SYS_USER_H */
+ }
+--- a/tirpc/reentrant.h
++++ b/tirpc/reentrant.h
+@@ -36,7 +36,7 @@
+ * These definitions are only guaranteed to be valid on Linux.
+ */
+
+-#if defined(__linux__)
++#if defined(__linux__) || defined(__GLIBC__)
+
+ #include <pthread.h>
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -93,7 +93,7 @@
+ AC_PROG_LIBTOOL
+ AC_HEADER_DIRENT
+ AC_PREFIX_DEFAULT(/usr)
+-AC_CHECK_HEADERS([arpa/inet.h fcntl.h libintl.h limits.h locale.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h syslog.h unistd.h features.h gssapi/gssapi_ext.h])
++AC_CHECK_HEADERS([arpa/inet.h fcntl.h libintl.h limits.h locale.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h syslog.h unistd.h features.h gssapi/gssapi_ext.h sys/user.h])
+ AC_CHECK_LIB([pthread], [pthread_create])
+ AC_CHECK_FUNCS([getrpcbyname getrpcbynumber setrpcent endrpcent getrpcent])
+
+--- a/src/auth_unix.c
++++ b/src/auth_unix.c
+@@ -56,6 +56,11 @@
+ #include <rpc/auth.h>
+ #include <rpc/auth_unix.h>
+
++/* Workaround for Hurd */
++#ifndef MAXHOSTNAMELEN
++# define MAXHOSTNAMELEN 64
++#endif
++
+ /* auth_unix.c */
+ static void authunix_nextverf (AUTH *);
+ static bool_t authunix_marshal (AUTH *, XDR *);
+--- a/src/bindresvport.c
++++ b/src/bindresvport.c
+@@ -64,7 +64,7 @@
+ return bindresvport_sa(sd, (struct sockaddr *)sin);
+ }
+
+-#ifdef __linux__
++#if defined(__linux__) || defined(__GNU__)
+
+ #define STARTPORT 600
+ #define LOWPORT 512
diff --git a/gnu/packages/patches/libxslt-generated-ids.patch b/gnu/packages/patches/libxslt-generated-ids.patch
index 4273875c7c..1cd2363d6a 100644
--- a/gnu/packages/patches/libxslt-generated-ids.patch
+++ b/gnu/packages/patches/libxslt-generated-ids.patch
@@ -162,10 +162,10 @@ diff --git a/libxslt/xsltInternals.h b/libxslt/xsltInternals.h
index 95e8fe6..8eedae4 100644
--- a/libxslt/xsltInternals.h
+++ b/libxslt/xsltInternals.h
-@@ -1786,6 +1786,8 @@ struct _xsltTransformContext {
- int funcLevel; /* Needed to catch recursive functions issues */
- int maxTemplateDepth;
+@@ -1782,6 +1782,8 @@ struct _xsltTransformContext {
int maxTemplateVars;
+ unsigned long opLimit;
+ unsigned long opCount;
+
+ unsigned long nextid;/* for generating stable ids */
};
diff --git a/gnu/packages/patches/linphoneqt-tabbutton.patch b/gnu/packages/patches/linphoneqt-tabbutton.patch
new file mode 100644
index 0000000000..6b3214026e
--- /dev/null
+++ b/gnu/packages/patches/linphoneqt-tabbutton.patch
@@ -0,0 +1,96 @@
+From ecaab0f73d0b74bbfbf150286305fa6e12970037 Mon Sep 17 00:00:00 2001
+From: Ronan Abhamon <ronan.abhamon@belledonne-communications.com>
+Date: Fri, 19 Jan 2018 14:42:01 +0100
+Subject: [PATCH] fix(SettingsWindow): rename icon property of TabButton to
+ iconName (issue with Qt 5.10 and new icon property)
+
+---
+ ui/modules/Common/Form/Tab/TabButton.qml | 8 ++++----
+ ui/views/App/Settings/SettingsWindow.qml | 14 +++++++-------
+ 2 files changed, 11 insertions(+), 11 deletions(-)
+
+diff --git a/ui/modules/Common/Form/Tab/TabButton.qml b/ui/modules/Common/Form/Tab/TabButton.qml
+index ad220ab2..a47bb20b 100644
+--- a/ui/modules/Common/Form/Tab/TabButton.qml
++++ b/ui/modules/Common/Form/Tab/TabButton.qml
+@@ -12,8 +12,8 @@ Controls.TabButton {
+
+ // ---------------------------------------------------------------------------
+
+- property string icon
+ property int iconSize: TabButtonStyle.icon.size
++ property string iconName
+
+ readonly property bool _isSelected: parent.parent.currentItem === button
+
+@@ -66,9 +66,9 @@ Controls.TabButton {
+ Layout.leftMargin: TabButtonStyle.text.leftPadding
+
+ icon: {
+- var icon = button.icon
+- return icon.length
+- ? (icon + '_' + (button._isSelected ? 'selected' : 'normal'))
++ var iconName = button.iconName
++ return iconName.length
++ ? (iconName + '_' + (button._isSelected ? 'selected' : 'normal'))
+ : ''
+ }
+ iconSize: button.iconSize
+diff --git a/ui/views/App/Settings/SettingsWindow.qml b/ui/views/App/Settings/SettingsWindow.qml
+index b8f5a80f..58909544 100644
+--- a/ui/views/App/Settings/SettingsWindow.qml
++++ b/ui/views/App/Settings/SettingsWindow.qml
+@@ -48,43 +48,43 @@ ApplicationWindow {
+ id: tabBar
+
+ TabButton {
+- icon: 'settings_sip_accounts'
++ iconName: 'settings_sip_accounts'
+ text: qsTr('sipAccountsTab')
+ width: implicitWidth
+ }
+
+ TabButton {
+- icon: 'settings_audio'
++ iconName: 'settings_audio'
+ text: qsTr('audioTab')
+ width: implicitWidth
+ }
+
+ TabButton {
+- icon: 'settings_video'
++ iconName: 'settings_video'
+ text: qsTr('videoTab')
+ width: implicitWidth
+ }
+
+ TabButton {
+- icon: 'settings_call'
++ iconName: 'settings_call'
+ text: qsTr('callsAndChatTab')
+ width: implicitWidth
+ }
+
+ TabButton {
+- icon: 'settings_network'
++ iconName: 'settings_network'
+ text: qsTr('networkTab')
+ width: implicitWidth
+ }
+
+ TabButton {
+- icon: 'settings_advanced'
++ iconName: 'settings_advanced'
+ text: qsTr('uiTab')
+ width: implicitWidth
+ }
+
+ TabButton {
+- icon: 'settings_advanced'
++ iconName: 'settings_advanced'
+ text: qsTr('uiAdvanced')
+ width: implicitWidth
+ }
+--
+2.21.0
+
diff --git a/gnu/packages/patches/llvm-for-extempore.patch b/gnu/packages/patches/llvm-for-extempore.patch
deleted file mode 100644
index 614682c6cb..0000000000
--- a/gnu/packages/patches/llvm-for-extempore.patch
+++ /dev/null
@@ -1,118 +0,0 @@
-This patch to LLVM is required by the developers of the Extempore language.
-The following explanation was posted to the extemporelang@googlegroups.com
-mailing list:
-
-"There is an assumption in the parser that all definitions occur within the
-same compilation unit - i.e. the parser has local state about what has been
-parsed in this unit of work. Extempore obviously does lots of little units
-rather than one big unit and this causes problems for named types that were
-defined in another unit - which they always are. The patch simply checks the
-current module to see if the type has been previously defined, and intervenes
-appropriately if it has."
-
-Message-ID: <CAOjrPOqoreXuZo4ZpDBvHE7M_tgAR_V8Txq5JFjh1HnGRn2EsA@mail.gmail.com>
-
---- llvm-3.7.1.src/include/llvm/MC/MCSectionCOFF.h 2015-04-11 12:11:45.000000000 +1000
-+++ llvm-3.7.1.src/include/llvm/MC/MCSectionCOFF.h 2015-09-14 09:22:56.000000000 +1000
-@@ -16,7 +16,6 @@
-
- #include "llvm/ADT/StringRef.h"
- #include "llvm/MC/MCSection.h"
--#include "llvm/Support/COFF.h"
-
- namespace llvm {
- class MCSymbol;
-
---- llvm-3.7.1.src/lib/AsmParser/LLParser.cpp 2015-07-11 20:30:36.000000000 +1000
-+++ llvm-3.7.1.src/lib/AsmParser/LLParser.cpp 2015-09-14 09:20:57.000000000 +1000
-@@ -1754,8 +1754,14 @@
- // If the type hasn't been defined yet, create a forward definition and
- // remember where that forward def'n was seen (in case it never is defined).
- if (!Entry.first) {
-- Entry.first = StructType::create(Context, Lex.getStrVal());
-- Entry.second = Lex.getLoc();
-+ // this here for extempore
-+ if (M->getTypeByName(Lex.getStrVal())) {
-+ Entry.first = M->getTypeByName(Lex.getStrVal());
-+ Entry.second = SMLoc();
-+ } else {
-+ Entry.first = StructType::create(Context, Lex.getStrVal());
-+ Entry.second = Lex.getLoc();
-+ }
- }
- Result = Entry.first;
- Lex.Lex();
-
---- llvm-3.7.1.src/lib/CodeGen/TargetLoweringObjectFileImpl.cpp 2015-07-01 05:10:31.000000000 +1000
-+++ llvm-3.7.1.src/lib/CodeGen/TargetLoweringObjectFileImpl.cpp 2015-09-14 09:23:40.000000000 +1000
-@@ -32,6 +32,7 @@
- #include "llvm/MC/MCStreamer.h"
- #include "llvm/MC/MCSymbolELF.h"
- #include "llvm/MC/MCValue.h"
-+#include "llvm/Support/COFF.h"
- #include "llvm/Support/Dwarf.h"
- #include "llvm/Support/ELF.h"
- #include "llvm/Support/ErrorHandling.h"
-
---- llvm-3.7.1.src/lib/ExecutionEngine/MCJIT/MCJIT.cpp 2015-07-31 02:31:16.000000000 +1000
-+++ llvm-3.7.1.src/lib/ExecutionEngine/MCJIT/MCJIT.cpp 2015-09-14 09:21:28.000000000 +1000
-@@ -524,6 +524,17 @@
- rv.IntVal = APInt(32, PF(ArgValues[0].IntVal.getZExtValue()));
- return rv;
- }
-+ if (FTy->getNumParams() == 1 &&
-+ RetTy->isVoidTy() &&
-+ FTy->getParamType(0)->isPointerTy()) {
-+ GenericValue rv;
-+ //void (*PF)(char *) = (void(*)(char *))(intptr_t)FPtr;
-+ //printf("are symbols available: %d\n",isSymbolSearchingDisabled());
-+ void (*PF)(char *) = (void(*)(char *))FPtr;
-+ char* mzone = (char*) GVTOP(ArgValues[0]);
-+ PF(mzone);
-+ return rv;
-+ }
- break;
- }
- }
-
---- llvm-3.7.1.src/lib/MC/MCContext.cpp 2015-06-23 21:31:32.000000000 +1000
-+++ llvm-3.7.1.src/lib/MC/MCContext.cpp 2015-09-14 09:24:01.000000000 +1000
-@@ -23,6 +23,7 @@
- #include "llvm/MC/MCSymbolCOFF.h"
- #include "llvm/MC/MCSymbolELF.h"
- #include "llvm/MC/MCSymbolMachO.h"
-+#include "llvm/Support/COFF.h"
- #include "llvm/Support/ELF.h"
- #include "llvm/Support/ErrorHandling.h"
- #include "llvm/Support/FileSystem.h"
-
---- llvm-3.7.1.src/lib/MC/MCObjectFileInfo.cpp 2015-06-25 10:28:42.000000000 +1000
-+++ llvm-3.7.1.src/lib/MC/MCObjectFileInfo.cpp 2015-09-14 09:24:17.000000000 +1000
-@@ -16,6 +16,7 @@
- #include "llvm/MC/MCSectionCOFF.h"
- #include "llvm/MC/MCSectionELF.h"
- #include "llvm/MC/MCSectionMachO.h"
-+#include "llvm/Support/COFF.h"
- using namespace llvm;
-
- static bool useCompactUnwind(const Triple &T) {
-
---- llvm-3.7.1.src/lib/MC/MCSectionCOFF.cpp 2015-06-09 10:31:39.000000000 +1000
-+++ llvm-3.7.1.src/lib/MC/MCSectionCOFF.cpp 2015-09-14 09:24:25.000000000 +1000
-@@ -11,6 +11,7 @@
- #include "llvm/MC/MCAsmInfo.h"
- #include "llvm/MC/MCContext.h"
- #include "llvm/MC/MCSymbol.h"
-+#include "llvm/Support/COFF.h"
- #include "llvm/Support/raw_ostream.h"
- using namespace llvm;
-
---- llvm-3.7.1.src/lib/Target/X86/X86TargetObjectFile.cpp 2015-06-27 04:55:48.000000000 +1000
-+++ llvm-3.7.1.src/lib/Target/X86/X86TargetObjectFile.cpp 2015-09-14 09:25:03.000000000 +1000
-@@ -16,6 +16,7 @@
- #include "llvm/MC/MCSectionCOFF.h"
- #include "llvm/MC/MCSectionELF.h"
- #include "llvm/MC/MCValue.h"
-+#include "llvm/Support/COFF.h"
- #include "llvm/Support/Dwarf.h"
- #include "llvm/Target/TargetLowering.h"
diff --git a/gnu/packages/patches/make-glibc-compat.patch b/gnu/packages/patches/make-glibc-compat.patch
deleted file mode 100644
index 9ce7f2b5bf..0000000000
--- a/gnu/packages/patches/make-glibc-compat.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-Work with the new glob interface in glibc 2.27.
-
-Taken from this upstream commit:
-https://git.savannah.gnu.org/cgit/make.git/commit/?id=193f1e81edd6b1b56b0eb0ff8aa4b41c7b4257b4
-
-diff --git a/dir.c b/dir.c
-index adbb8a9..c343e4c 100644
---- a/dir.c
-+++ b/dir.c
-@@ -1299,15 +1299,40 @@ local_stat (const char *path, struct stat *buf)
- }
- #endif
-
-+/* Similarly for lstat. */
-+#if !defined(lstat) && !defined(WINDOWS32) || defined(VMS)
-+# ifndef VMS
-+# ifndef HAVE_SYS_STAT_H
-+int lstat (const char *path, struct stat *sbuf);
-+# endif
-+# else
-+ /* We are done with the fake lstat. Go back to the real lstat */
-+# ifdef lstat
-+# undef lstat
-+# endif
-+# endif
-+# define local_lstat lstat
-+#elif defined(WINDOWS32)
-+/* Windows doesn't support lstat(). */
-+# define local_lstat local_stat
-+#else
-+static int
-+local_lstat (const char *path, struct stat *buf)
-+{
-+ int e;
-+ EINTRLOOP (e, lstat (path, buf));
-+ return e;
-+}
-+#endif
-+
- void
- dir_setup_glob (glob_t *gl)
- {
- gl->gl_opendir = open_dirstream;
- gl->gl_readdir = read_dirstream;
- gl->gl_closedir = free;
-+ gl->gl_lstat = local_lstat;
- gl->gl_stat = local_stat;
-- /* We don't bother setting gl_lstat, since glob never calls it.
-- The slot is only there for compatibility with 4.4 BSD. */
- }
-
- void
diff --git a/gnu/packages/patches/make-impure-dirs.patch b/gnu/packages/patches/make-impure-dirs.patch
index 83a5fbe3a5..89595b06ec 100644
--- a/gnu/packages/patches/make-impure-dirs.patch
+++ b/gnu/packages/patches/make-impure-dirs.patch
@@ -4,9 +4,9 @@ don't look in /usr/include and friends.
Patch from Nixpkgs, by Eelco Dolstra.
-diff -rc make-3.81-orig/read.c make-3.81/read.c
-*** make-3.81-orig/read.c 2006-03-17 15:24:20.000000000 +0100
---- make-3.81/read.c 2007-05-24 17:16:31.000000000 +0200
+diff -rc make-3.81-orig/src/read.c make-3.81/src/read.c
+*** make-3.81-orig/src/read.c 2006-03-17 15:24:20.000000000 +0100
+--- make-3.81/src/read.c 2007-05-24 17:16:31.000000000 +0200
***************
*** 99,107 ****
--- 99,109 ----
@@ -21,9 +21,9 @@ diff -rc make-3.81-orig/read.c make-3.81/read.c
#endif
0
};
-diff -rc make-3.81-orig/remake.c make-3.81/remake.c
-*** make-3.81-orig/remake.c 2006-03-20 03:36:37.000000000 +0100
---- make-3.81/remake.c 2007-05-24 17:06:54.000000000 +0200
+diff -rc make-3.81-orig/src/remake.c make-3.81/src/remake.c
+*** make-3.81-orig/src/remake.c 2006-03-20 03:36:37.000000000 +0100
+--- make-3.81/src/remake.c 2007-05-24 17:06:54.000000000 +0200
***************
*** 1452,1460 ****
--- 1452,1462 ----
diff --git a/gnu/packages/patches/mit-krb5-hurd.patch b/gnu/packages/patches/mit-krb5-hurd.patch
new file mode 100644
index 0000000000..d4962b1e60
--- /dev/null
+++ b/gnu/packages/patches/mit-krb5-hurd.patch
@@ -0,0 +1,165 @@
+Avoid using MAXPATHLEN and MAXHOSTLEN on the Hurd.
+
+Taken from https://salsa.debian.org/debian/krb5/-/blob/master/debian/patches/debian-local/0001-Debian-HURD-compatibility.patch
+
+From: Sam Hartman <hartmans@debian.org>
+Date: Mon, 26 Dec 2011 18:05:13 -0500
+Subject: Debian: HURD compatibility
+
+HURD has no MAXPATHLEN or MAXHOSTLEN.
+
+Patch-Category: debian-local
+---
+ src/clients/ksu/ksu.h | 4 ++++
+ src/include/k5-int.h | 3 +++
+ src/kadmin/ktutil/ktutil_funcs.c | 4 ++++
+ src/kprop/kprop_util.c | 4 ++++
+ src/lib/gssapi/spnego/spnego_mech.c | 3 +++
+ src/lib/krb5/os/sn2princ.c | 4 ++++
+ src/plugins/kdb/db2/libdb2/include/db-int.h | 4 ++++
+ src/tests/resolve/resolve.c | 4 ++++
+ 8 files changed, 30 insertions(+)
+
+$ diff -u krb5-1.18/src/util/ss/help.c.orig krb5-1.18/src/util/ss/help.c
+--- krb5-1.18/src/util/ss/help.c.orig 2020-03-07 23:25:52.712418587 +0100
++++ krb5-1.18/src/util/ss/help.c 2020-03-07 23:26:25.764941122 +0100
+@@ -6,6 +6,9 @@
+ */
+
+ #include <sys/param.h>
++#ifndef MAXPATHLEN
++# define MAXPATHLEN 4096
++#endif
+ #include <sys/types.h>
+ #include <errno.h>
+ #include <sys/file.h>
+$ diff -u krb5-1.18/src/lib/krb5/os/hostrealm.c.orig krb5-1.18/src/lib/krb5/os/hostrealm.c
+--- krb5-1.18/src/lib/krb5/os/hostrealm.c.orig 2020-03-07 23:33:19.931420994 +0100
++++ krb5-1.18/src/lib/krb5/os/hostrealm.c 2020-03-07 23:33:58.628026424 +0100
+@@ -42,6 +42,10 @@
+ #endif
+ #endif
+
++#ifndef MAXHOSTNAMELEN
++#define MAXHOSTNAMELEN 256
++#endif
++
+ struct hostrealm_module_handle {
+ struct krb5_hostrealm_vtable_st vt;
+ krb5_hostrealm_moddata data;
+diff --git a/src/clients/ksu/ksu.h b/src/clients/ksu/ksu.h
+index 3bf0bd4..f680b33 100644
+--- a/src/clients/ksu/ksu.h
++++ b/src/clients/ksu/ksu.h
+@@ -56,6 +56,10 @@
+ #define MAX_CMD 2048 /* this is temp, should use realloc instead,
+ as done in most of the code */
+
++#ifndef MAXPATHLEN
++# define MAXPATHLEN 4096
++#endif
++
+
+ extern int optind;
+ extern char * optarg;
+diff --git a/src/include/k5-int.h b/src/include/k5-int.h
+index 6522422..e4f1678 100644
+--- a/src/include/k5-int.h
++++ b/src/include/k5-int.h
+@@ -589,6 +589,9 @@ extern char *strdup (const char *);
+ #ifdef HAVE_SYS_PARAM_H
+ #include <sys/param.h> /* MAXPATHLEN */
+ #endif
++#ifndef MAXPATHLEN
++# define MAXPATHLEN 4096
++#endif
+
+ #ifdef HAVE_SYS_FILE_H
+ #include <sys/file.h> /* prototypes for file-related
+diff --git a/src/kadmin/ktutil/ktutil_funcs.c b/src/kadmin/ktutil/ktutil_funcs.c
+index 6d119a2..fb7fa22 100644
+--- a/src/kadmin/ktutil/ktutil_funcs.c
++++ b/src/kadmin/ktutil/ktutil_funcs.c
+@@ -34,6 +34,10 @@
+ #include <string.h>
+ #include <ctype.h>
+
++#ifndef MAXPATHLEN
++# define MAXPATHLEN 4096
++#endif
++
+ /*
+ * Free a kt_list
+ */
+diff --git a/src/kprop/kprop_util.c b/src/kprop/kprop_util.c
+index c32d174..d72ab18 100644
+--- a/src/kprop/kprop_util.c
++++ b/src/kprop/kprop_util.c
+@@ -32,6 +32,10 @@
+ #include <sys/types.h>
+ #include <sys/socket.h>
+
++#ifndef MAXHOSTNAMELEN
++#define MAXHOSTNAMELEN 256
++#endif
++
+ /*
+ * Convert an IPv4 or IPv6 socket address to a newly allocated krb5_address.
+ * There is similar code elsewhere in the tree, so this should possibly become
+diff --git a/src/lib/gssapi/spnego/spnego_mech.c b/src/lib/gssapi/spnego/spnego_mech.c
+index 9d6027c..585d8a6 100644
+--- a/src/lib/gssapi/spnego/spnego_mech.c
++++ b/src/lib/gssapi/spnego/spnego_mech.c
+@@ -65,6 +65,9 @@
+ #include "gssapiP_spnego.h"
+ #include <gssapi_err_generic.h>
+
++#ifndef MAXHOSTNAMELEN
++#define MAXHOSTNAMELEN 256
++#endif
+
+ #undef g_token_size
+ #undef g_verify_token_header
+diff --git a/src/lib/krb5/os/sn2princ.c b/src/lib/krb5/os/sn2princ.c
+index 5932fd9..187daa8 100644
+--- a/src/lib/krb5/os/sn2princ.c
++++ b/src/lib/krb5/os/sn2princ.c
+@@ -126,6 +126,10 @@ find_trailer(const char *hostname)
+ return p;
+ }
+
++#ifndef MAXHOSTNAMELEN
++# define MAXHOSTNAMELEN 256
++#endif
++
+ krb5_error_code KRB5_CALLCONV
+ krb5_sname_to_principal(krb5_context context, const char *hostname,
+ const char *sname, krb5_int32 type,
+diff --git a/src/plugins/kdb/db2/libdb2/include/db-int.h b/src/plugins/kdb/db2/libdb2/include/db-int.h
+index 7e981d4..d83b3b6 100644
+--- a/src/plugins/kdb/db2/libdb2/include/db-int.h
++++ b/src/plugins/kdb/db2/libdb2/include/db-int.h
+@@ -280,4 +280,8 @@ void __dbpanic __P((DB *dbp));
+ #ifndef O_BINARY
+ #define O_BINARY 0 /* Needed for Win32 compiles */
+ #endif
++
++#ifndef MAXPATHLEN
++# 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
new file mode 100644
index 0000000000..491a358731
--- /dev/null
+++ b/gnu/packages/patches/mit-krb5-qualify-short-hostnames.patch
@@ -0,0 +1,29 @@
+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/musl-cross-locale.patch b/gnu/packages/patches/musl-cross-locale.patch
new file mode 100644
index 0000000000..7634eda381
--- /dev/null
+++ b/gnu/packages/patches/musl-cross-locale.patch
@@ -0,0 +1,20 @@
+Disable locales other than C and POSIX because of a compilation error.
+By Danny Milosavljevic <dannym@scratchpost.org>
+This patch is distributed under BSD-3 license.
+See https://github.com/osresearch/heads/pull/610
+diff -ruN b/source/patches/gcc-5.3.0-locale.diff guix-build-musl-cross-0.1-3.a8a6649.drv-12/source/patches/gcc-5.3.0-locale.diff
+--- a/patches/gcc-5.3.0-locale.diff 1970-01-01 01:00:00.000000000 +0100
++++ b/patches/gcc-5.3.0-locale.diff 2020-05-02 14:20:47.213564509 +0200
+@@ -0,0 +1,12 @@
++--- gcc-5.3.0/libstdc++-v3/config/locale/gnu/ctype_members.cc.orig 2020-05-02 14:16:31.376147000 +0200
+++++ gcc-5.3.0/libstdc++-v3/config/locale/gnu/ctype_members.cc 2020-05-02 14:16:56.716279576 +0200
++@@ -47,7 +47,8 @@
++ this->_S_create_c_locale(this->_M_c_locale_ctype, __s);
++ this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
++ this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
++- this->_M_table = this->_M_c_locale_ctype->__ctype_b;
+++ //this->_M_table = this->_M_c_locale_ctype->__ctype_b;
+++ throw 3;
++ }
++ }
++
diff --git a/gnu/packages/patches/openldap-CVE-2020-12243.patch b/gnu/packages/patches/openldap-CVE-2020-12243.patch
deleted file mode 100644
index 6321998198..0000000000
--- a/gnu/packages/patches/openldap-CVE-2020-12243.patch
+++ /dev/null
@@ -1,125 +0,0 @@
-From 98464c11df8247d6a11b52e294ba5dd4f0380440 Mon Sep 17 00:00:00 2001
-From: Howard Chu <hyc@openldap.org>
-Date: Thu, 16 Apr 2020 01:08:19 +0100
-Subject: [PATCH] ITS#9202 limit depth of nested filters
-
-Using a hardcoded limit for now; no reasonable apps
-should ever run into it.
----
- servers/slapd/filter.c | 41 ++++++++++++++++++++++++++++++++---------
- 1 file changed, 32 insertions(+), 9 deletions(-)
-
-diff --git a/servers/slapd/filter.c b/servers/slapd/filter.c
-index 3252cf2a7..ed57bbd7b 100644
---- a/servers/slapd/filter.c
-+++ b/servers/slapd/filter.c
-@@ -37,11 +37,16 @@
- const Filter *slap_filter_objectClass_pres;
- const struct berval *slap_filterstr_objectClass_pres;
-
-+#ifndef SLAPD_MAX_FILTER_DEPTH
-+#define SLAPD_MAX_FILTER_DEPTH 5000
-+#endif
-+
- static int get_filter_list(
- Operation *op,
- BerElement *ber,
- Filter **f,
-- const char **text );
-+ const char **text,
-+ int depth );
-
- static int get_ssa(
- Operation *op,
-@@ -80,12 +85,13 @@ filter_destroy( void )
- return;
- }
-
--int
--get_filter(
-+static int
-+get_filter0(
- Operation *op,
- BerElement *ber,
- Filter **filt,
-- const char **text )
-+ const char **text,
-+ int depth )
- {
- ber_tag_t tag;
- ber_len_t len;
-@@ -126,6 +132,11 @@ get_filter(
- *
- */
-
-+ if( depth > SLAPD_MAX_FILTER_DEPTH ) {
-+ *text = "filter nested too deeply";
-+ return SLAPD_DISCONNECT;
-+ }
-+
- tag = ber_peek_tag( ber, &len );
-
- if( tag == LBER_ERROR ) {
-@@ -221,7 +232,7 @@ get_filter(
-
- case LDAP_FILTER_AND:
- Debug( LDAP_DEBUG_FILTER, "AND\n", 0, 0, 0 );
-- err = get_filter_list( op, ber, &f.f_and, text );
-+ err = get_filter_list( op, ber, &f.f_and, text, depth+1 );
- if ( err != LDAP_SUCCESS ) {
- break;
- }
-@@ -234,7 +245,7 @@ get_filter(
-
- case LDAP_FILTER_OR:
- Debug( LDAP_DEBUG_FILTER, "OR\n", 0, 0, 0 );
-- err = get_filter_list( op, ber, &f.f_or, text );
-+ err = get_filter_list( op, ber, &f.f_or, text, depth+1 );
- if ( err != LDAP_SUCCESS ) {
- break;
- }
-@@ -248,7 +259,7 @@ get_filter(
- case LDAP_FILTER_NOT:
- Debug( LDAP_DEBUG_FILTER, "NOT\n", 0, 0, 0 );
- (void) ber_skip_tag( ber, &len );
-- err = get_filter( op, ber, &f.f_not, text );
-+ err = get_filter0( op, ber, &f.f_not, text, depth+1 );
- if ( err != LDAP_SUCCESS ) {
- break;
- }
-@@ -311,10 +322,22 @@ get_filter(
- return( err );
- }
-
-+int
-+get_filter(
-+ Operation *op,
-+ BerElement *ber,
-+ Filter **filt,
-+ const char **text )
-+{
-+ return get_filter0( op, ber, filt, text, 0 );
-+}
-+
-+
- static int
- get_filter_list( Operation *op, BerElement *ber,
- Filter **f,
-- const char **text )
-+ const char **text,
-+ int depth )
- {
- Filter **new;
- int err;
-@@ -328,7 +351,7 @@ get_filter_list( Operation *op, BerElement *ber,
- tag != LBER_DEFAULT;
- tag = ber_next_element( ber, &len, last ) )
- {
-- err = get_filter( op, ber, new, text );
-+ err = get_filter0( op, ber, new, text, depth );
- if ( err != LDAP_SUCCESS )
- return( err );
- new = &(*new)->f_next;
---
-2.26.2
-
diff --git a/gnu/packages/patches/openresolv-restartcmd-guix.patch b/gnu/packages/patches/openresolv-restartcmd-guix.patch
new file mode 100644
index 0000000000..ad70ebd6f2
--- /dev/null
+++ b/gnu/packages/patches/openresolv-restartcmd-guix.patch
@@ -0,0 +1,34 @@
+From 7f0ce36828ec1e130bee857b8236ca091e4d8a2c Mon Sep 17 00:00:00 2001
+From: Brice Waegeneire <brice@waegenei.re>
+Date: Sat, 9 May 2020 15:52:06 +0200
+Subject: [PATCH] Add RESTARTCMD for Guix System.
+
+---
+
+openresolv need to know how to restart the nscd service, this patch teach it
+to do it on Guix System by using shepherd.
+
+ resolvconf.in | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/resolvconf.in b/resolvconf.in
+index 3cad04d..5ef5294 100644
+--- a/resolvconf.in
++++ b/resolvconf.in
+@@ -369,6 +369,13 @@ detect_init()
+ then
+ /etc/rc.d/$1 restart
+ fi'
++ elif [ -e /gnu/store ] && [ -e /run/current-system/profile ]; then
++ # Guix System
++ RESTARTCMD='
++ if /run/current-system/profile/bin/herd status $1 2>&1
++ then
++ /run/current-system/profile/bin/herd restart $1
++ fi'
+ else
+ for x in /etc/init.d/rc.d /etc/rc.d /etc/init.d; do
+ [ -d $x ] || continue
+--
+2.26.0
+
diff --git a/gnu/packages/patches/openssh-hurd.patch b/gnu/packages/patches/openssh-hurd.patch
new file mode 100644
index 0000000000..1ad09a7ee6
--- /dev/null
+++ b/gnu/packages/patches/openssh-hurd.patch
@@ -0,0 +1,30 @@
+Author: Jan (janneke) Nieuwenhuizen" <janneke@gnu.org>
+Not upstreamed.
+
+From 1ddae040d67e9a4ebcc3e1b95af1bff12c0f086b Mon Sep 17 00:00:00 2001
+From: "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org>
+Date: Tue, 7 Apr 2020 17:41:05 +0200
+Subject: [PATCH] Build fix for the Hurd.
+
+* gss-serv.c (ssh_gssapi_acquire_cred): Use HOST_NAME_MAX instead of
+MAXHOSTNAMELEN.
+---
+ gss-serv.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gss-serv.c b/gss-serv.c
+index 1d47870e7..22081c6f1 100644
+--- a/gss-serv.c
++++ b/gss-serv.c
+@@ -107,7 +107,7 @@ ssh_gssapi_acquire_cred(Gssctxt *ctx)
+ gss_create_empty_oid_set(&status, &oidset);
+ gss_add_oid_set_member(&status, ctx->oid, &oidset);
+
+- if (gethostname(lname, MAXHOSTNAMELEN)) {
++ if (gethostname(lname, HOST_NAME_MAX)) {
+ gss_release_oid_set(&status, &oidset);
+ return (-1);
+ }
+--
+2.26.0
+
diff --git a/gnu/packages/patches/pango-skip-libthai-test.patch b/gnu/packages/patches/pango-skip-libthai-test.patch
new file mode 100644
index 0000000000..98732b5391
--- /dev/null
+++ b/gnu/packages/patches/pango-skip-libthai-test.patch
@@ -0,0 +1,23 @@
+Skip Thai character test when libthai is unavailable.
+
+Taken from upstream bug tracker:
+https://gitlab.gnome.org/GNOME/pango/merge_requests/161
+https://gitlab.gnome.org/GNOME/pango/commit/b73284747ac937e31dc9191f84ed6e24284c88ee
+
+diff --git a/tests/test-break.c b/tests/test-break.c
+index 8549b678bba69360d07dce3af21d915412f20d51..47fa3009165e19a331aa04a0df4351ae2323933b 100644
+--- a/tests/test-break.c
++++ b/tests/test-break.c
+@@ -305,6 +305,12 @@ main (int argc, char *argv[])
+ if (!strstr (name, "break"))
+ continue;
+
++#ifndef HAVE_LIBTHAI
++ /* four.break involves Thai, so only test it when we have libthai */
++ if (strstr (name, "four.break"))
++ continue;
++#endif
++
+ path = g_strdup_printf ("/break/%s", name);
+ g_test_add_data_func_full (path, g_test_build_filename (G_TEST_DIST, "breaks", name, NULL),
+ test_break, g_free);
diff --git a/gnu/packages/patches/pciutils-hurd-configure.patch b/gnu/packages/patches/pciutils-hurd-configure.patch
new file mode 100644
index 0000000000..226891a995
--- /dev/null
+++ b/gnu/packages/patches/pciutils-hurd-configure.patch
@@ -0,0 +1,35 @@
+Add ability to detect GNU/Hurd when configuring.
+
+Adapted from https://git.hadrons.org/cgit/debian/pkgs/pciutils.git/tree/debian/patches/00-configure-hurd.patch
+
+From e39a3af22501234a91cf28e8c57b45f9379f9101 Mon Sep 17 00:00:00 2001
+From: Damien Zammit <damien@zamaudio.com>
+Date: Fri, 26 Oct 2018 09:24:04 -0400
+Subject: [PATCH 2/2] Add ability to detect GNU/Hurd when configuring
+
+---
+ lib/configure | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+--- a/lib/configure
++++ b/lib/configure
+@@ -25,7 +25,7 @@ if [ -z "$HOST" ] ; then
+ proc=`/usr/sbin/lsdev -C -c processor -S available -F name | head -1`
+ cpu=`/usr/sbin/lsattr -F value -l $proc -a type | sed 's/_.*//'`
+ else
+- cpu=`uname -m | sed 's/^i.86$/i386/;s/^sun4u$/sparc64/;s/^i86pc$/i386/;s/^BePC$/i386/;s/^BeMac$/powerpc/;s/^BeBox$/powerpc/'`
++ cpu=`uname -m | sed 's/^i.86-AT386/i386/;s/^i.86$/i386/;s/^sun4u$/sparc64/;s/^i86pc$/i386/;s/^BePC$/i386/;s/^BeMac$/powerpc/;s/^BeBox$/powerpc/'`
+ fi
+ if [ "$sys" = "DragonFly" ]
+ then
+@@ -39,6 +39,10 @@ if [ -z "$HOST" ] ; then
+ then
+ sys=cygwin
+ fi
++ if [ "$sys" = "GNU" ]
++ then
++ sys=gnu
++ fi
+ HOST=${3:-$cpu-$sys}
+ fi
+ [ -n "$RELEASE" ] && rel="${RELEASE}"
diff --git a/gnu/packages/patches/perl-cross.patch b/gnu/packages/patches/perl-cross.patch
new file mode 100644
index 0000000000..a7d10b4e1f
--- /dev/null
+++ b/gnu/packages/patches/perl-cross.patch
@@ -0,0 +1,60 @@
+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/potrace-tests.patch b/gnu/packages/patches/potrace-tests.patch
deleted file mode 100644
index 407be98dab..0000000000
--- a/gnu/packages/patches/potrace-tests.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-This relaxes the comparison threshold between the reference data
-and the bitmaps produced by Ghostscript interpreting the vectorized
-image. Apparently the threshold has become too low with the switch
-to from Ghostscript 2.21 to 2.22.
-
---- potrace-1.15/check/postscript-check.sh 2018-01-06 19:47:26.194900686 +0100
-+++ potrace-1.15/check/postscript-check.sh 2018-01-06 19:51:35.937503739 +0100
-@@ -70,15 +70,15 @@ if test $? -ne 0; then
- echo "Something is wrong with $GS; skipping this test" >& 2
- exit 77
- fi
--actiondiff "$TMP2" "$REFDATA" 1000
-+actiondiff "$TMP2" "$REFDATA" 1500
-
- action $POTRACE -r50 -p -L 0 -B 0 --opaque -o "$TMP1" "$DATA"
- action "$GS" -q -dNOPAUSE -sDEVICE=pbmraw -g460x394 -r100x100 -sOutputFile="$TMP2" -- "$TMP1"
--actiondiff "$TMP2" "$REFDATA" 1200
-+actiondiff "$TMP2" "$REFDATA" 1500
-
- action $POTRACE -r50 -p -L 0 -B 0 -A 160 -o "$TMP1" "$DATA"
- action "$GS" -q -dNOPAUSE -sDEVICE=pbmraw -g568x528 -r100x100 -sOutputFile="$TMP2" -- "$TMP1"
--actiondiff "$TMP2" "$REFDATAROT" 1200
-+actiondiff "$TMP2" "$REFDATAROT" 1500
-
- action rm -f "$TMP1"
- action rm -f "$TMP2"
-
---- potrace-1.15/check/pdf-check.sh 2018-01-06 19:47:28.698886663 +0100
-+++ potrace-1.15/check/pdf-check.sh 2018-01-06 20:54:14.895460329 +0100
-@@ -72,15 +72,15 @@ if test $? -ne 0 -o ! -f "$TMP2"; then
- echo "GS does not understand PDF; skipping this test" >& 2
- exit 77
- fi
--actiondiff "$TMP2" "$REFDATA" 1000
-+actiondiff "$TMP2" "$REFDATA" 1500
-
- action $POTRACE -r50 -p -L 0 -B 0 --opaque -b pdf -o "$TMP1" "$DATA"
- action "$GS" -q -dNOPAUSE -sDEVICE=pbmraw -g460x394 -r100x100 -sOutputFile="$TMP2" -- "$TMP1"
--actiondiff "$TMP2" "$REFDATA" 1200
-+actiondiff "$TMP2" "$REFDATA" 1500
-
- action $POTRACE -r50 -p -L 0 -B 0 -A 160 -b pdf -o "$TMP1" "$DATA"
- action "$GS" -q -dNOPAUSE -sDEVICE=pbmraw -g568x528 -r100x100 -sOutputFile="$TMP2" -- "$TMP1"
--actiondiff "$TMP2" "$REFDATAROT" 1200
-+actiondiff "$TMP2" "$REFDATAROT" 1500
-
- action rm -f "$TMP1"
- action rm -f "$TMP2"
-
-Diff finished. Sat Jan 6 20:54:50 2018
diff --git a/gnu/packages/patches/purescript-relax-dependencies.patch b/gnu/packages/patches/purescript-relax-dependencies.patch
new file mode 100644
index 0000000000..11c4a3c3fc
--- /dev/null
+++ b/gnu/packages/patches/purescript-relax-dependencies.patch
@@ -0,0 +1,42 @@
+Allow the purescript dependencies to better match the available packages in
+Guix.
+
+diff --git purescript-0.13.6/purescript.cabal purescript-0.13.6/purescript.cabal.orig
+index 7e38070..0724a0b 100644
+--- purescript-0.13.6/purescript.cabal
++++ purescript-0.13.6/purescript.cabal.orig
+@@ -1167,1 +1167,1 @@ library
+- Glob ==0.9.*,
++ Glob ==0.10.*,
+@@ -1171,1 +1171,1 @@ library
+- ansi-terminal >=0.7.1 && <0.9,
++ ansi-terminal ==0.9.*,
+@@ -1180,1 +1180,1 @@ library
+- clock <0.8,
++ clock ==0.8.*,
+@@ -1246,1 +1246,1 @@ executable purs
+- Glob ==0.9.*,
++ Glob ==0.10.*,
+@@ -1250,1 +1250,1 @@ executable purs
+- ansi-terminal >=0.7.1 && <0.9,
++ ansi-terminal ==0.9.*,
+@@ -1260,1 +1260,1 @@ executable purs
+- clock <0.8,
++ clock ==0.8.*,
+@@ -1281,1 +1281,1 @@ executable purs
+- network >=3.0.1.1 && <3.1,
++ network >=2.8 && <3.1,
+@@ -1358,1 +1358,1 @@ test-suite tests
+- Glob ==0.9.*,
++ Glob ==0.10.*,
+@@ -1363,1 +1363,1 @@ test-suite tests
+- ansi-terminal >=0.7.1 && <0.9,
++ ansi-terminal ==0.9.*,
+@@ -1372,1 +1372,1 @@ test-suite tests
+- clock <0.8,
++ clock ==0.8.*,
+@@ -1384,2 +1384,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-search-paths.patch b/gnu/packages/patches/python-2.7-search-paths.patch
index a012bc8fe0..3318f44d23 100644
--- a/gnu/packages/patches/python-2.7-search-paths.patch
+++ b/gnu/packages/patches/python-2.7-search-paths.patch
@@ -1,15 +1,19 @@
-Make sure the build system honors CPATH and LIBRARY_PATH when
+Make sure the build system honors C_INCLUDE_PATH and LIBRARY_PATH when
looking for headers and libraries.
--- Python-2.7.10/setup.py 2015-10-07 18:33:18.125153186 +0200
+++ Python-2.7.10/setup.py 2015-10-07 18:33:47.497347552 +0200
-@@ -526,6 +526,10 @@ class PyBuildExt(build_ext):
+@@ -526,6 +526,14 @@ class PyBuildExt(build_ext):
inc_dirs += ['/system/include', '/atheos/autolnk/include']
inc_dirs += os.getenv('C_INCLUDE_PATH', '').split(os.pathsep)
+ # Always honor these variables.
-+ lib_dirs += os.getenv('LIBRARY_PATH', '').split(os.pathsep)
-+ inc_dirs += os.getenv('CPATH', '').split(os.pathsep)
++ if not cross_compiling:
++ lib_dirs += os.getenv('LIBRARY_PATH', '').split(os.pathsep)
++ inc_dirs += os.getenv('C_INCLUDE_PATH', '').split(os.pathsep)
++ else:
++ lib_dirs = os.getenv('CROSS_LIBRARY_PATH', '').split(os.pathsep)
++ inc_dirs = os.getenv('CROSS_CPATH', '').split(os.pathsep)
+
# OSF/1 and Unixware have some stuff in /usr/ccs/lib (like -ldb)
if host_platform in ['osf1', 'unixware7', 'openunix8']:
diff --git a/gnu/packages/patches/python-3-arm-alignment.patch b/gnu/packages/patches/python-3-arm-alignment.patch
new file mode 100644
index 0000000000..065c1a7bb2
--- /dev/null
+++ b/gnu/packages/patches/python-3-arm-alignment.patch
@@ -0,0 +1,21 @@
+Ensure memory accesses in the sha3 module are aligned on ARM as it causes
+problems when running 32-bit code on a 64-bit kernel.
+
+Patch taken from upstream bug report:
+https://bugs.python.org/issue36515
+
+--- a/Modules/_sha3/sha3module.c
++++ b/Modules/_sha3/sha3module.c
+@@ -64,6 +64,12 @@
+ #define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN
+ #endif
+
++/* Bus error on 32-bit ARM due to un-aligned memory accesses; 64-bit ARM
++ * doesn't complain but un-aligned memory accesses are sub-optimal */
++#if defined(__arm__) || defined(__aarch64__)
++#define NO_MISALIGNED_ACCESSES
++#endif
++
+ /* mangle names */
+ #define KeccakF1600_FastLoop_Absorb _PySHA3_KeccakF1600_FastLoop_Absorb
+ #define Keccak_HashFinal _PySHA3_Keccak_HashFinal
diff --git a/gnu/packages/patches/python-3-search-paths.patch b/gnu/packages/patches/python-3-search-paths.patch
index 5fea9c66b6..df01d3b933 100644
--- a/gnu/packages/patches/python-3-search-paths.patch
+++ b/gnu/packages/patches/python-3-search-paths.patch
@@ -1,16 +1,25 @@
-Make sure the build system honors CPATH and LIBRARY_PATH when
+Make sure the build system honors C_INCLUDE_PATH and LIBRARY_PATH when
looking for headers and libraries.
--- a/setup.py 2015-10-07 23:32:58.891329173 +0200
+++ b/setup.py 2015-10-07 23:46:29.653349924 +0200
-@@ -575,8 +575,8 @@
+@@ -676,15 +676,15 @@
# if a file is found in one of those directories, it can
# be assumed that no additional -I,-L directives are needed.
- if not cross_compiling:
-- lib_dirs = self.compiler.library_dirs + system_lib_dirs
-- inc_dirs = self.compiler.include_dirs + system_include_dirs
-+ lib_dirs = os.getenv('LIBRARY_PATH', '').split(os.pathsep)
-+ inc_dirs = os.getenv('CPATH', '').split(os.pathsep)
+ if not CROSS_COMPILING:
+- self.lib_dirs = self.compiler.library_dirs + system_lib_dirs
+- self.inc_dirs = self.compiler.include_dirs + system_include_dirs
++ self.lib_dirs = os.getenv('LIBRARY_PATH', '').split(os.pathsep)
++ self.inc_dirs = os.getenv('C_INCLUDE_PATH', '').split(os.pathsep)
else:
# Add the sysroot paths. 'sysroot' is a compiler option used to
# set the logical path of the standard system headers and
+ # libraries.
+- self.lib_dirs = (self.compiler.library_dirs +
++ self.lib_dirs = (os.getenv('CROSS_LIBRARY_PATH', '').split(os.pathsep) +
+ sysroot_paths(('LDFLAGS', 'CC'), system_lib_dirs))
+- self.inc_dirs = (self.compiler.include_dirs +
++ self.inc_dirs = (os.getenv('CROSS_C_INCLUDE_PATH', '').split(os.pathsep) +
+ sysroot_paths(('CPPFLAGS', 'CFLAGS', 'CC'),
+ system_include_dirs))
+
diff --git a/gnu/packages/patches/python-3.8-search-paths.patch b/gnu/packages/patches/python-3.8-search-paths.patch
deleted file mode 100644
index 88f19850bf..0000000000
--- a/gnu/packages/patches/python-3.8-search-paths.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-diff --git a/setup.py b/setup.py
-index 20d7f35..5751083 100644
---- a/setup.py
-+++ b/setup.py
-@@ -676,8 +676,8 @@ class PyBuildExt(build_ext):
- # if a file is found in one of those directories, it can
- # be assumed that no additional -I,-L directives are needed.
- if not CROSS_COMPILING:
-- self.lib_dirs = self.compiler.library_dirs + system_lib_dirs
-- self.inc_dirs = self.compiler.include_dirs + system_include_dirs
-+ self.lib_dirs = os.getenv('LIBRARY_PATH', '').split(os.pathsep)
-+ self.inc_dirs = os.getenv('CPATH', '').split(os.pathsep)
- else:
- # Add the sysroot paths. 'sysroot' is a compiler option used to
- # set the logical path of the standard system headers and
---
-2.23.0
diff --git a/gnu/packages/patches/python-cffi-x87-stack-clean.patch b/gnu/packages/patches/python-cffi-x87-stack-clean.patch
deleted file mode 100644
index 50243505ee..0000000000
--- a/gnu/packages/patches/python-cffi-x87-stack-clean.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-Fix test that fails on i686:
-
-https://bitbucket.org/cffi/cffi/issues/382
-
-This is a squashed version of these commits:
-https://bitbucket.org/cffi/cffi/commits/ef09637b2314
-https://bitbucket.org/cffi/cffi/commits/7a76a3815340
-
-diff -r 99940f1f5402 testing/cffi0/test_function.py
---- a/testing/cffi0/test_function.py Tue Feb 27 21:18:33 2018 +0100
-+++ b/testing/cffi0/test_function.py Sun Nov 11 16:26:23 2018 +0100
-@@ -45,14 +45,14 @@
- assert x != math.sin(1.23) # rounding effects
- assert abs(x - math.sin(1.23)) < 1E-6
-
-- def test_sin_no_return_value(self):
-+ def test_lround_no_return_value(self):
- # check that 'void'-returning functions work too
- ffi = FFI(backend=self.Backend())
- ffi.cdef("""
-- void sin(double x);
-+ void lround(double x);
- """)
- m = ffi.dlopen(lib_m)
-- x = m.sin(1.23)
-+ x = m.lround(1.23)
- assert x is None
-
- def test_dlopen_filename(self):
diff --git a/gnu/packages/patches/python-cross-compile.patch b/gnu/packages/patches/python-cross-compile.patch
new file mode 100644
index 0000000000..5a470e1852
--- /dev/null
+++ b/gnu/packages/patches/python-cross-compile.patch
@@ -0,0 +1,145 @@
+Patch taken from https://bugs.python.org/issue22724 and augmented with
+following Nix patch
+https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/interpreters/python/cpython/2.7/cross-compile.patch
+to fix the whole cross-compilation circus.
+
+---
+ Makefile.pre.in | 14 +++++++-------
+ configure | 5 ++++-
+ setup.py | 9 ++++++---
+ 3 files changed, 17 insertions(+), 11 deletions(-)
+
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index 2a14f3323b..6239fc32fc 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -492,7 +492,7 @@ $(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY)
+ $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
+
+ platform: $(BUILDPYTHON) pybuilddir.txt
+- $(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
++ $(RUNSHARED) $(PY_BUILD_ENVIRON) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
+
+ # Create build directory and generate the sysconfig build-time data there.
+ # pybuilddir.txt contains the name of the build dir and is used for
+@@ -503,7 +503,7 @@ platform: $(BUILDPYTHON) pybuilddir.txt
+ # or removed in case of failure.
+ pybuilddir.txt: $(BUILDPYTHON)
+ @echo "none" > ./pybuilddir.txt
+- $(RUNSHARED) $(PYTHON_FOR_BUILD) -S -m sysconfig --generate-posix-vars ;\
++ $(RUNSHARED) $(PY_BUILD_ENVIRON) $(PYTHON_FOR_BUILD) -S -m sysconfig --generate-posix-vars ;\
+ if test $$? -ne 0 ; then \
+ echo "generate-posix-vars failed" ; \
+ rm -f ./pybuilddir.txt ; \
+@@ -525,7 +525,7 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o
+ esac; \
+ $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
+ _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
+- $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
++ $(PY_BUILD_ENVIRON) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
+
+ # Build static library
+ # avoid long command lines, same as LIBRARY_OBJS
+@@ -928,7 +928,7 @@ install: @FRAMEWORKINSTALLFIRST@ commoninstall bininstall maninstall @FRAMEWORKI
+ upgrade) ensurepip="--upgrade" ;; \
+ install|*) ensurepip="" ;; \
+ esac; \
+- $(RUNSHARED) $(PYTHON_FOR_BUILD) -m ensurepip \
++ $(RUNSHARED) $(PY_BUILD_ENVIRON) $(PYTHON_FOR_BUILD) -m ensurepip \
+ $$ensurepip --root=$(DESTDIR)/ ; \
+ fi
+
+@@ -939,7 +939,7 @@ altinstall: commoninstall
+ upgrade) ensurepip="--altinstall --upgrade --no-default-pip" ;; \
+ install|*) ensurepip="--altinstall --no-default-pip" ;; \
+ esac; \
+- $(RUNSHARED) $(PYTHON_FOR_BUILD) -m ensurepip \
++ $(RUNSHARED) $(PY_BUILD_ENVIRON) $(PYTHON_FOR_BUILD) -m ensurepip \
+ $$ensurepip --root=$(DESTDIR)/ ; \
+ fi
+
+@@ -1270,7 +1270,7 @@ libainstall: @DEF_MAKE_RULE@ python-config
+ # Install the dynamically loadable modules
+ # This goes into $(exec_prefix)
+ sharedinstall: sharedmods
+- $(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \
++ $(RUNSHARED) $(PY_BUILD_ENVIRON) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \
+ --prefix=$(prefix) \
+ --install-scripts=$(BINDIR) \
+ --install-platlib=$(DESTSHARED) \
+@@ -1344,7 +1344,7 @@ frameworkinstallextras:
+ # This installs a few of the useful scripts in Tools/scripts
+ scriptsinstall:
+ SRCDIR=$(srcdir) $(RUNSHARED) \
+- $(PYTHON_FOR_BUILD) $(srcdir)/Tools/scripts/setup.py install \
++ $(PY_BUILD_ENVIRON) $(PYTHON_FOR_BUILD) $(srcdir)/Tools/scripts/setup.py install \
+ --prefix=$(prefix) \
+ --install-scripts=$(BINDIR) \
+ --root=$(DESTDIR)/
+diff --git a/configure b/configure
+index 67300fe2b6..6050f588c5 100755
+--- a/configure
++++ b/configure
+@@ -741,6 +741,7 @@ CONFIG_ARGS
+ SOVERSION
+ VERSION
+ PYTHON_FOR_BUILD
++PY_BUILD_ENVIRON
+ PYTHON_FOR_REGEN
+ host_os
+ host_vendor
+@@ -2964,7 +2965,8 @@ $as_echo_n "checking for python interpreter for cross build... " >&6; }
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $interp" >&5
+ $as_echo "$interp" >&6; }
+- PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/$(PLATDIR) '$interp
++ PY_BUILD_ENVIRON='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/$(PLATDIR)'
++ PYTHON_FOR_BUILD=$interp
+ fi
+ elif test "$cross_compiling" = maybe; then
+ as_fn_error $? "Cross compiling required --host=HOST-TUPLE and --build=ARCH" "$LINENO" 5
+@@ -2974,6 +2976,7 @@ fi
+
+
+
++
+ if test "$prefix" != "/"; then
+ prefix=`echo "$prefix" | sed -e 's/\/$//g'`
+ fi
+diff --git a/setup.py b/setup.py
+index cb47a2339c..472e7e2b26 100644
+--- a/setup.py
++++ b/setup.py
+@@ -497,8 +497,6 @@ class PyBuildExt(build_ext):
+ if not cross_compiling:
+ add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
+ add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+- if cross_compiling:
+- self.add_gcc_paths()
+ self.add_multiarch_paths()
+
+ # Add paths specified in the environment variables LDFLAGS and
+@@ -556,7 +554,10 @@ class PyBuildExt(build_ext):
+ # be assumed that no additional -I,-L directives are needed.
+ inc_dirs = self.compiler.include_dirs[:]
+ lib_dirs = self.compiler.library_dirs[:]
+- if not cross_compiling:
++ if cross_compiling:
++ inc_dirs = []
++ lib_dirs = []
++ else:
+ for d in (
+ '/usr/include',
+ ):
+@@ -621,6 +622,8 @@ class PyBuildExt(build_ext):
+ # Some modules that are normally always on:
+ #exts.append( Extension('_weakref', ['_weakref.c']) )
+
++ self.compiler.library_dirs = lib_dirs + [ '.' ]
++
+ # array objects
+ exts.append( Extension('array', ['arraymodule.c']) )
+
+--
+2.17.1
+
diff --git a/gnu/packages/patches/python-gst-fix-build-with-python-3.8.patch b/gnu/packages/patches/python-gst-fix-build-with-python-3.8.patch
new file mode 100644
index 0000000000..affa0e1317
--- /dev/null
+++ b/gnu/packages/patches/python-gst-fix-build-with-python-3.8.patch
@@ -0,0 +1,36 @@
+Fix build with Python 3.8 by also checking for python-3.X-embed.pc. Since
+Python 3.8 the normal checks don't include the Python libraries anymore and
+linking of the gst-python module would fail.
+
+See also https://github.com/mesonbuild/meson/issues/5629
+Fixes https://gitlab.freedesktop.org/gstreamer/gst-python/issues/28
+
+Patch based on upstream commit:
+
+https://gitlab.freedesktop.org/gstreamer/gst-python/-/commit/10707f437f2fc3632067c6a0efa4432f7ebaf362
+
+diff --git a/meson.build b/meson.build
+index 5f13b48..d7c7e66 100644
+--- a/meson.build
++++ b/meson.build
+@@ -23,7 +23,17 @@ pygobject_dep = dependency('pygobject-3.0', fallback: ['pygobject', 'pygobject_d
+
+ pymod = import('python')
+ python = pymod.find_installation(get_option('python'))
+-python_dep = python.dependency(required : true)
++pythonver = python.language_version()
++if pythonver.version_compare('<3.0')
++ error('Python2 is not supported anymore, please port your code to python3 (@0@ specified)'.format(python.language_version()))
++endif
++
++# Workaround for https://github.com/mesonbuild/meson/issues/5629
++# https://gitlab.freedesktop.org/gstreamer/gst-python/issues/28
++python_dep = dependency('python-@0@-embed'.format(pythonver), version: '>=3', required: false)
++if not python_dep.found()
++ python_dep = python.dependency(required : true)
++endif
+
+ python_abi_flags = python.get_variable('ABIFLAGS', '')
+ pylib_loc = get_option('libpython-dir')
+--
+2.26.2
diff --git a/gnu/packages/patches/python-pycrypto-time-clock.patch b/gnu/packages/patches/python-pycrypto-time-clock.patch
new file mode 100644
index 0000000000..9b7a8232a2
--- /dev/null
+++ b/gnu/packages/patches/python-pycrypto-time-clock.patch
@@ -0,0 +1,23 @@
+Drop use of the deprecated time.clock which was removed in Python 3.8.
+
+Adapted from upstream pull request:
+
+https://github.com/dlitz/pycrypto/pull/296
+
+diff --git a/lib/Crypto/Random/_UserFriendlyRNG.py b/lib/Crypto/Random/_UserFriendlyRNG.py
+--- a/lib/Crypto/Random/_UserFriendlyRNG.py
++++ b/lib/Crypto/Random/_UserFriendlyRNG.py
+@@ -73,8 +73,11 @@ class _EntropyCollector(object):
+ t = time.time()
+ self._time_es.feed(struct.pack("@I", int(2**30 * (t - floor(t)))))
+
+- # Add the fractional part of time.clock()
+- t = time.clock()
++ # Add the fractional part of time.process_time()
++ try:
++ t = time.process_time()
++ except AttributeError:
++ t = time.clock()
+ self._clock_es.feed(struct.pack("@I", int(2**30 * (t - floor(t)))))
+
+
diff --git a/gnu/packages/patches/qemu-CVE-2020-1711.patch b/gnu/packages/patches/qemu-CVE-2020-1711.patch
deleted file mode 100644
index 32d04f61dd..0000000000
--- a/gnu/packages/patches/qemu-CVE-2020-1711.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-Fix CVE-2020-1711:
-
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-1711
-
-Patch copied from upstream source repository:
-
-https://git.qemu.org/?p=qemu.git;a=commitdiff;h=693fd2acdf14dd86c0bf852610f1c2cca80a74dc
-
-From 693fd2acdf14dd86c0bf852610f1c2cca80a74dc Mon Sep 17 00:00:00 2001
-From: Felipe Franciosi <felipe@nutanix.com>
-Date: Thu, 23 Jan 2020 12:44:59 +0000
-Subject: [PATCH] iscsi: Cap block count from GET LBA STATUS (CVE-2020-1711)
-
-When querying an iSCSI server for the provisioning status of blocks (via
-GET LBA STATUS), Qemu only validates that the response descriptor zero's
-LBA matches the one requested. Given the SCSI spec allows servers to
-respond with the status of blocks beyond the end of the LUN, Qemu may
-have its heap corrupted by clearing/setting too many bits at the end of
-its allocmap for the LUN.
-
-A malicious guest in control of the iSCSI server could carefully program
-Qemu's heap (by selectively setting the bitmap) and then smash it.
-
-This limits the number of bits that iscsi_co_block_status() will try to
-update in the allocmap so it can't overflow the bitmap.
-
-Fixes: CVE-2020-1711
-Cc: qemu-stable@nongnu.org
-Signed-off-by: Felipe Franciosi <felipe@nutanix.com>
-Signed-off-by: Peter Turschmid <peter.turschm@nutanix.com>
-Signed-off-by: Raphael Norwitz <raphael.norwitz@nutanix.com>
-Signed-off-by: Kevin Wolf <kwolf@redhat.com>
----
- block/iscsi.c | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
-
-diff --git a/block/iscsi.c b/block/iscsi.c
-index 2aea7e3f13..cbd57294ab 100644
---- a/block/iscsi.c
-+++ b/block/iscsi.c
-@@ -701,7 +701,7 @@ static int coroutine_fn iscsi_co_block_status(BlockDriverState *bs,
- struct scsi_get_lba_status *lbas = NULL;
- struct scsi_lba_status_descriptor *lbasd = NULL;
- struct IscsiTask iTask;
-- uint64_t lba;
-+ uint64_t lba, max_bytes;
- int ret;
-
- iscsi_co_init_iscsitask(iscsilun, &iTask);
-@@ -721,6 +721,7 @@ static int coroutine_fn iscsi_co_block_status(BlockDriverState *bs,
- }
-
- lba = offset / iscsilun->block_size;
-+ max_bytes = (iscsilun->num_blocks - lba) * iscsilun->block_size;
-
- qemu_mutex_lock(&iscsilun->mutex);
- retry:
-@@ -764,7 +765,7 @@ retry:
- goto out_unlock;
- }
-
-- *pnum = (int64_t) lbasd->num_blocks * iscsilun->block_size;
-+ *pnum = MIN((int64_t) lbasd->num_blocks * iscsilun->block_size, max_bytes);
-
- if (lbasd->provisioning == SCSI_PROVISIONING_TYPE_DEALLOCATED ||
- lbasd->provisioning == SCSI_PROVISIONING_TYPE_ANCHORED) {
---
-2.25.0
-
diff --git a/gnu/packages/patches/qemu-CVE-2020-7039.patch b/gnu/packages/patches/qemu-CVE-2020-7039.patch
deleted file mode 100644
index ffebda68ab..0000000000
--- a/gnu/packages/patches/qemu-CVE-2020-7039.patch
+++ /dev/null
@@ -1,173 +0,0 @@
-Fix CVE-2020-7039:
-
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-7039
-
-Patches copied from upstream dependency repository:
-
-https://gitlab.freedesktop.org/slirp/libslirp/commit/2655fffed7a9e765bcb4701dd876e9dab975f289
-https://gitlab.freedesktop.org/slirp/libslirp/commit/ce131029d6d4a405cb7d3ac6716d03e58fb4a5d9
-https://gitlab.freedesktop.org/slirp/libslirp/commit/82ebe9c370a0e2970fb5695aa19aa5214a6a1c80
-
-From 2655fffed7a9e765bcb4701dd876e9dab975f289 Mon Sep 17 00:00:00 2001
-From: Samuel Thibault <samuel.thibault@ens-lyon.org>
-Date: Wed, 8 Jan 2020 00:58:48 +0100
-Subject: [PATCH] tcp_emu: Fix oob access
-
-The main loop only checks for one available byte, while we sometimes
-need two bytes.
----
- CHANGELOG.md | 1 +
- src/tcp_subr.c | 7 +++++++
- 2 files changed, 8 insertions(+)
-
-#diff --git a/CHANGELOG.md b/CHANGELOG.md
-#index 00d0ce2..5cf94a8 100644
-#--- a/CHANGELOG.md
-#+++ b/CHANGELOG.md
-#@@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
-# ### Fixed
-#
-# - ncsi: fix checksum OOB memory access
-#+ - `tcp_emu()`: fix OOB accesses
-#
-# ## [4.1.0] - 2019-12-02
-#
-diff --git a/src/tcp_subr.c b/src/tcp_subr.c
-index 382aa38..9c1bdec 100644
---- a/slirp/src/tcp_subr.c
-+++ b/slirp/src/tcp_subr.c
-@@ -871,6 +871,9 @@ int tcp_emu(struct socket *so, struct mbuf *m)
- break;
-
- case 5:
-+ if (bptr == m->m_data + m->m_len - 1)
-+ return 1; /* We need two bytes */
-+
- /*
- * The difference between versions 1.0 and
- * 2.0 is here. For future versions of
-@@ -886,6 +889,10 @@ int tcp_emu(struct socket *so, struct mbuf *m)
- /* This is the field containing the port
- * number that RA-player is listening to.
- */
-+
-+ if (bptr == m->m_data + m->m_len - 1)
-+ return 1; /* We need two bytes */
-+
- lport = (((uint8_t *)bptr)[0] << 8) + ((uint8_t *)bptr)[1];
- if (lport < 6970)
- lport += 256; /* don't know why */
---
-2.24.1
-
-From ce131029d6d4a405cb7d3ac6716d03e58fb4a5d9 Mon Sep 17 00:00:00 2001
-From: Prasad J Pandit <pjp@fedoraproject.org>
-Date: Thu, 9 Jan 2020 15:12:27 +0530
-Subject: [PATCH] slirp: use correct size while emulating IRC commands
-
-While emulating IRC DCC commands, tcp_emu() uses 'mbuf' size
-'m->m_size' to write DCC commands via snprintf(3). This may
-lead to OOB write access, because 'bptr' points somewhere in
-the middle of 'mbuf' buffer, not at the start. Use M_FREEROOM(m)
-size to avoid OOB access.
-
-Reported-by: Vishnu Dev TJ <vishnudevtj@gmail.com>
-Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
-Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
-Message-Id: <20200109094228.79764-2-ppandit@redhat.com>
----
- src/tcp_subr.c | 11 ++++++-----
- 1 file changed, 6 insertions(+), 5 deletions(-)
-
-diff --git a/src/tcp_subr.c b/src/tcp_subr.c
-index 9c1bdec..ee7a938 100644
---- a/slirp/src/tcp_subr.c
-+++ b/slirp/src/tcp_subr.c
-@@ -763,7 +763,8 @@ int tcp_emu(struct socket *so, struct mbuf *m)
- return 1;
- }
- m->m_len = bptr - m->m_data; /* Adjust length */
-- m->m_len += snprintf(bptr, m->m_size, "DCC CHAT chat %lu %u%c\n",
-+ m->m_len += snprintf(bptr, M_FREEROOM(m),
-+ "DCC CHAT chat %lu %u%c\n",
- (unsigned long)ntohl(so->so_faddr.s_addr),
- ntohs(so->so_fport), 1);
- } else if (sscanf(bptr, "DCC SEND %256s %u %u %u", buff, &laddr, &lport,
-@@ -773,8 +774,8 @@ int tcp_emu(struct socket *so, struct mbuf *m)
- return 1;
- }
- m->m_len = bptr - m->m_data; /* Adjust length */
-- m->m_len +=
-- snprintf(bptr, m->m_size, "DCC SEND %s %lu %u %u%c\n", buff,
-+ m->m_len += snprintf(bptr, M_FREEROOM(m),
-+ "DCC SEND %s %lu %u %u%c\n", buff,
- (unsigned long)ntohl(so->so_faddr.s_addr),
- ntohs(so->so_fport), n1, 1);
- } else if (sscanf(bptr, "DCC MOVE %256s %u %u %u", buff, &laddr, &lport,
-@@ -784,8 +785,8 @@ int tcp_emu(struct socket *so, struct mbuf *m)
- return 1;
- }
- m->m_len = bptr - m->m_data; /* Adjust length */
-- m->m_len +=
-- snprintf(bptr, m->m_size, "DCC MOVE %s %lu %u %u%c\n", buff,
-+ m->m_len += snprintf(bptr, M_FREEROOM(m),
-+ "DCC MOVE %s %lu %u %u%c\n", buff,
- (unsigned long)ntohl(so->so_faddr.s_addr),
- ntohs(so->so_fport), n1, 1);
- }
---
-2.24.1
-
-From 82ebe9c370a0e2970fb5695aa19aa5214a6a1c80 Mon Sep 17 00:00:00 2001
-From: Prasad J Pandit <pjp@fedoraproject.org>
-Date: Thu, 9 Jan 2020 15:12:28 +0530
-Subject: [PATCH] slirp: use correct size while emulating commands
-
-While emulating services in tcp_emu(), it uses 'mbuf' size
-'m->m_size' to write commands via snprintf(3). Use M_FREEROOM(m)
-size to avoid possible OOB access.
-
-Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
-Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
-Message-Id: <20200109094228.79764-3-ppandit@redhat.com>
----
- src/tcp_subr.c | 9 ++++-----
- 1 file changed, 4 insertions(+), 5 deletions(-)
-
-diff --git a/src/tcp_subr.c b/src/tcp_subr.c
-index ee7a938..177dfd2 100644
---- a/slirp/src/tcp_subr.c
-+++ b/slirp/src/tcp_subr.c
-@@ -681,7 +681,7 @@ int tcp_emu(struct socket *so, struct mbuf *m)
- n4 = (laddr & 0xff);
-
- m->m_len = bptr - m->m_data; /* Adjust length */
-- m->m_len += snprintf(bptr, m->m_size - m->m_len,
-+ m->m_len += snprintf(bptr, M_FREEROOM(m),
- "ORT %d,%d,%d,%d,%d,%d\r\n%s", n1, n2, n3, n4,
- n5, n6, x == 7 ? buff : "");
- return 1;
-@@ -716,8 +716,7 @@ int tcp_emu(struct socket *so, struct mbuf *m)
- n4 = (laddr & 0xff);
-
- m->m_len = bptr - m->m_data; /* Adjust length */
-- m->m_len +=
-- snprintf(bptr, m->m_size - m->m_len,
-+ m->m_len += snprintf(bptr, M_FREEROOM(m),
- "27 Entering Passive Mode (%d,%d,%d,%d,%d,%d)\r\n%s",
- n1, n2, n3, n4, n5, n6, x == 7 ? buff : "");
-
-@@ -743,8 +742,8 @@ int tcp_emu(struct socket *so, struct mbuf *m)
- if (m->m_data[m->m_len - 1] == '\0' && lport != 0 &&
- (so = tcp_listen(slirp, INADDR_ANY, 0, so->so_laddr.s_addr,
- htons(lport), SS_FACCEPTONCE)) != NULL)
-- m->m_len =
-- snprintf(m->m_data, m->m_size, "%d", ntohs(so->so_fport)) + 1;
-+ m->m_len = snprintf(m->m_data, M_ROOM(m),
-+ "%d", ntohs(so->so_fport)) + 1;
- return 1;
-
- case EMU_IRC:
---
-2.24.1
-
diff --git a/gnu/packages/patches/qemu-CVE-2020-7211.patch b/gnu/packages/patches/qemu-CVE-2020-7211.patch
deleted file mode 100644
index 2885dda411..0000000000
--- a/gnu/packages/patches/qemu-CVE-2020-7211.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-Fix CVE-2020-7211:
-
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-7211
-
-Patch copied from upstream dependency repository:
-
-https://gitlab.freedesktop.org/slirp/libslirp/commit/14ec36e107a8c9af7d0a80c3571fe39b291ff1d4
-
-From 14ec36e107a8c9af7d0a80c3571fe39b291ff1d4 Mon Sep 17 00:00:00 2001
-From: Prasad J Pandit <pjp@fedoraproject.org>
-Date: Mon, 13 Jan 2020 17:44:31 +0530
-Subject: [PATCH] slirp: tftp: restrict relative path access
-
-tftp restricts relative or directory path access on Linux systems.
-Apply same restrictions on Windows systems too. It helps to avoid
-directory traversal issue.
-
-Fixes: https://bugs.launchpad.net/qemu/+bug/1812451
-Reported-by: Peter Maydell <peter.maydell@linaro.org>
-Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
-Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
-Message-Id: <20200113121431.156708-1-ppandit@redhat.com>
----
- src/tftp.c | 9 +++++++--
- 1 file changed, 7 insertions(+), 2 deletions(-)
-
-diff --git a/src/tftp.c b/src/tftp.c
-index 093c2e0..e52e71b 100644
---- a/slirp/src/tftp.c
-+++ b/slirp/src/tftp.c
-@@ -344,8 +344,13 @@ static void tftp_handle_rrq(Slirp *slirp, struct sockaddr_storage *srcsas,
- k += 6; /* skipping octet */
-
- /* do sanity checks on the filename */
-- if (!strncmp(req_fname, "../", 3) ||
-- req_fname[strlen(req_fname) - 1] == '/' || strstr(req_fname, "/../")) {
-+ if (
-+#ifdef G_OS_WIN32
-+ strstr(req_fname, "..\\") ||
-+ req_fname[strlen(req_fname) - 1] == '\\' ||
-+#endif
-+ strstr(req_fname, "../") ||
-+ req_fname[strlen(req_fname) - 1] == '/') {
- tftp_send_error(spt, 2, "Access violation", tp);
- return;
- }
---
-2.24.1
-
diff --git a/gnu/packages/patches/qemu-CVE-2020-8608.patch b/gnu/packages/patches/qemu-CVE-2020-8608.patch
deleted file mode 100644
index 4cb017c795..0000000000
--- a/gnu/packages/patches/qemu-CVE-2020-8608.patch
+++ /dev/null
@@ -1,269 +0,0 @@
-Fix CVE-2020-8608:
-
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-8608
-https://www.openwall.com/lists/oss-security/2020/02/06/2
-
-Patches copied from upstream dependency repository:
-
-https://gitlab.freedesktop.org/slirp/libslirp/commit/68ccb8021a838066f0951d4b2817eb6b6f10a843
-https://gitlab.freedesktop.org/slirp/libslirp/commit/30648c03b27fb8d9611b723184216cd3174b6775
-
-From 68ccb8021a838066f0951d4b2817eb6b6f10a843 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com>
-Date: Mon, 27 Jan 2020 10:24:14 +0100
-Subject: [PATCH] tcp_emu: fix unsafe snprintf() usages
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Various calls to snprintf() assume that snprintf() returns "only" the
-number of bytes written (excluding terminating NUL).
-
-https://pubs.opengroup.org/onlinepubs/9699919799/functions/snprintf.html#tag_16_159_04
-
-"Upon successful completion, the snprintf() function shall return the
-number of bytes that would be written to s had n been sufficiently
-large excluding the terminating null byte."
-
-Before patch ce131029, if there isn't enough room in "m_data" for the
-"DCC ..." message, we overflow "m_data".
-
-After the patch, if there isn't enough room for the same, we don't
-overflow "m_data", but we set "m_len" out-of-bounds. The next time an
-access is bounded by "m_len", we'll have a buffer overflow then.
-
-Use slirp_fmt*() to fix potential OOB memory access.
-
-Reported-by: Laszlo Ersek <lersek@redhat.com>
-Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
-Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
-Message-Id: <20200127092414.169796-7-marcandre.lureau@redhat.com>
----
- src/tcp_subr.c | 44 +++++++++++++++++++++-----------------------
- 1 file changed, 21 insertions(+), 23 deletions(-)
-
-diff --git a/src/tcp_subr.c b/src/tcp_subr.c
-index a699117..a72c86b 100644
---- a/slirp/src/tcp_subr.c
-+++ b/slirp/src/tcp_subr.c
-@@ -643,8 +643,7 @@ int tcp_emu(struct socket *so, struct mbuf *m)
- NTOHS(n1);
- NTOHS(n2);
- m_inc(m, snprintf(NULL, 0, "%d,%d\r\n", n1, n2) + 1);
-- m->m_len = snprintf(m->m_data, M_ROOM(m), "%d,%d\r\n", n1, n2);
-- assert(m->m_len < M_ROOM(m));
-+ m->m_len = slirp_fmt(m->m_data, M_ROOM(m), "%d,%d\r\n", n1, n2);
- } else {
- *eol = '\r';
- }
-@@ -684,9 +683,9 @@ int tcp_emu(struct socket *so, struct mbuf *m)
- n4 = (laddr & 0xff);
-
- m->m_len = bptr - m->m_data; /* Adjust length */
-- m->m_len += snprintf(bptr, M_FREEROOM(m),
-- "ORT %d,%d,%d,%d,%d,%d\r\n%s", n1, n2, n3, n4,
-- n5, n6, x == 7 ? buff : "");
-+ m->m_len += slirp_fmt(bptr, M_FREEROOM(m),
-+ "ORT %d,%d,%d,%d,%d,%d\r\n%s",
-+ n1, n2, n3, n4, n5, n6, x == 7 ? buff : "");
- return 1;
- } else if ((bptr = (char *)strstr(m->m_data, "27 Entering")) != NULL) {
- /*
-@@ -719,10 +718,9 @@ int tcp_emu(struct socket *so, struct mbuf *m)
- n4 = (laddr & 0xff);
-
- m->m_len = bptr - m->m_data; /* Adjust length */
-- m->m_len += snprintf(bptr, M_FREEROOM(m),
-- "27 Entering Passive Mode (%d,%d,%d,%d,%d,%d)\r\n%s",
-- n1, n2, n3, n4, n5, n6, x == 7 ? buff : "");
--
-+ m->m_len += slirp_fmt(bptr, M_FREEROOM(m),
-+ "27 Entering Passive Mode (%d,%d,%d,%d,%d,%d)\r\n%s",
-+ n1, n2, n3, n4, n5, n6, x == 7 ? buff : "");
- return 1;
- }
-
-@@ -745,8 +743,8 @@ int tcp_emu(struct socket *so, struct mbuf *m)
- if (m->m_data[m->m_len - 1] == '\0' && lport != 0 &&
- (so = tcp_listen(slirp, INADDR_ANY, 0, so->so_laddr.s_addr,
- htons(lport), SS_FACCEPTONCE)) != NULL)
-- m->m_len = snprintf(m->m_data, M_ROOM(m),
-- "%d", ntohs(so->so_fport)) + 1;
-+ m->m_len = slirp_fmt0(m->m_data, M_ROOM(m),
-+ "%d", ntohs(so->so_fport));
- return 1;
-
- case EMU_IRC:
-@@ -765,10 +763,10 @@ int tcp_emu(struct socket *so, struct mbuf *m)
- return 1;
- }
- m->m_len = bptr - m->m_data; /* Adjust length */
-- m->m_len += snprintf(bptr, M_FREEROOM(m),
-- "DCC CHAT chat %lu %u%c\n",
-- (unsigned long)ntohl(so->so_faddr.s_addr),
-- ntohs(so->so_fport), 1);
-+ m->m_len += slirp_fmt(bptr, M_FREEROOM(m),
-+ "DCC CHAT chat %lu %u%c\n",
-+ (unsigned long)ntohl(so->so_faddr.s_addr),
-+ ntohs(so->so_fport), 1);
- } else if (sscanf(bptr, "DCC SEND %256s %u %u %u", buff, &laddr, &lport,
- &n1) == 4) {
- if ((so = tcp_listen(slirp, INADDR_ANY, 0, htonl(laddr),
-@@ -776,10 +774,10 @@ int tcp_emu(struct socket *so, struct mbuf *m)
- return 1;
- }
- m->m_len = bptr - m->m_data; /* Adjust length */
-- m->m_len += snprintf(bptr, M_FREEROOM(m),
-- "DCC SEND %s %lu %u %u%c\n", buff,
-- (unsigned long)ntohl(so->so_faddr.s_addr),
-- ntohs(so->so_fport), n1, 1);
-+ m->m_len += slirp_fmt(bptr, M_FREEROOM(m),
-+ "DCC SEND %s %lu %u %u%c\n", buff,
-+ (unsigned long)ntohl(so->so_faddr.s_addr),
-+ ntohs(so->so_fport), n1, 1);
- } else if (sscanf(bptr, "DCC MOVE %256s %u %u %u", buff, &laddr, &lport,
- &n1) == 4) {
- if ((so = tcp_listen(slirp, INADDR_ANY, 0, htonl(laddr),
-@@ -787,10 +785,10 @@ int tcp_emu(struct socket *so, struct mbuf *m)
- return 1;
- }
- m->m_len = bptr - m->m_data; /* Adjust length */
-- m->m_len += snprintf(bptr, M_FREEROOM(m),
-- "DCC MOVE %s %lu %u %u%c\n", buff,
-- (unsigned long)ntohl(so->so_faddr.s_addr),
-- ntohs(so->so_fport), n1, 1);
-+ m->m_len += slirp_fmt(bptr, M_FREEROOM(m),
-+ "DCC MOVE %s %lu %u %u%c\n", buff,
-+ (unsigned long)ntohl(so->so_faddr.s_addr),
-+ ntohs(so->so_fport), n1, 1);
- }
- return 1;
-
---
-2.25.1
-
-From 30648c03b27fb8d9611b723184216cd3174b6775 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com>
-Date: Mon, 27 Jan 2020 10:24:09 +0100
-Subject: [PATCH] util: add slirp_fmt() helpers
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Various calls to snprintf() in libslirp assume that snprintf() returns
-"only" the number of bytes written (excluding terminating NUL).
-
-https://pubs.opengroup.org/onlinepubs/9699919799/functions/snprintf.html#tag_16_159_04
-
-"Upon successful completion, the snprintf() function shall return the
-number of bytes that would be written to s had n been sufficiently
-large excluding the terminating null byte."
-
-Introduce slirp_fmt() that handles several pathological cases the
-way libslirp usually expect:
-
-- treat error as fatal (instead of silently returning -1)
-
-- fmt0() will always \0 end
-
-- return the number of bytes actually written (instead of what would
-have been written, which would usually result in OOB later), including
-the ending \0 for fmt0()
-
-- warn if truncation happened (instead of ignoring)
-
-Other less common cases can still be handled with strcpy/snprintf() etc.
-
-Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
-Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
-Message-Id: <20200127092414.169796-2-marcandre.lureau@redhat.com>
----
- src/util.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
- src/util.h | 3 +++
- 2 files changed, 65 insertions(+)
-
-diff --git a/src/util.c b/src/util.c
-index e596087..e3b6257 100644
---- a/slirp/src/util.c
-+++ b/slirp/src/util.c
-@@ -364,3 +364,65 @@ void slirp_pstrcpy(char *buf, int buf_size, const char *str)
- }
- *q = '\0';
- }
-+
-+static int slirp_vsnprintf(char *str, size_t size,
-+ const char *format, va_list args)
-+{
-+ int rv = vsnprintf(str, size, format, args);
-+
-+ if (rv < 0) {
-+ g_error("vsnprintf() failed: %s", g_strerror(errno));
-+ }
-+
-+ return rv;
-+}
-+
-+/*
-+ * A snprintf()-like function that:
-+ * - returns the number of bytes written (excluding optional \0-ending)
-+ * - dies on error
-+ * - warn on truncation
-+ */
-+int slirp_fmt(char *str, size_t size, const char *format, ...)
-+{
-+ va_list args;
-+ int rv;
-+
-+ va_start(args, format);
-+ rv = slirp_vsnprintf(str, size, format, args);
-+ va_end(args);
-+
-+ if (rv > size) {
-+ g_critical("vsnprintf() truncation");
-+ }
-+
-+ return MIN(rv, size);
-+}
-+
-+/*
-+ * A snprintf()-like function that:
-+ * - always \0-end (unless size == 0)
-+ * - returns the number of bytes actually written, including \0 ending
-+ * - dies on error
-+ * - warn on truncation
-+ */
-+int slirp_fmt0(char *str, size_t size, const char *format, ...)
-+{
-+ va_list args;
-+ int rv;
-+
-+ va_start(args, format);
-+ rv = slirp_vsnprintf(str, size, format, args);
-+ va_end(args);
-+
-+ if (rv >= size) {
-+ g_critical("vsnprintf() truncation");
-+ if (size > 0)
-+ str[size - 1] = '\0';
-+ rv = size;
-+ } else {
-+ rv += 1; /* include \0 */
-+ }
-+
-+ return rv;
-+}
-diff --git a/src/util.h b/src/util.h
-index e9c3073..5530c46 100644
---- a/slirp/src/util.h
-+++ b/slirp/src/util.h
-@@ -181,4 +181,7 @@ static inline int slirp_socket_set_fast_reuse(int fd)
-
- void slirp_pstrcpy(char *buf, int buf_size, const char *str);
-
-+int slirp_fmt(char *str, size_t size, const char *format, ...);
-+int slirp_fmt0(char *str, size_t size, const char *format, ...);
-+
- #endif
---
-2.25.1
-
diff --git a/gnu/packages/patches/qemu-fix-documentation-build-failure.patch b/gnu/packages/patches/qemu-fix-documentation-build-failure.patch
deleted file mode 100644
index c913c553b2..0000000000
--- a/gnu/packages/patches/qemu-fix-documentation-build-failure.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-Fix a build failure caused by a texinfo bug:
-
-qemu-doc.texi:41: @menu reference to nonexistent node `QEMU Guest Agent'
-
-Patch copied from upstream source repository:
-
-https://git.qemu.org/?p=qemu.git;a=commitdiff;h=80bc935eaaf93e5b9a4efe97abd7c51d645f2612
-
-From 80bc935eaaf93e5b9a4efe97abd7c51d645f2612 Mon Sep 17 00:00:00 2001
-From: Thomas Huth <thuth@redhat.com>
-Date: Mon, 16 Dec 2019 14:29:41 +0100
-Subject: [PATCH] qemu-doc: Remove the unused "Guest Agent" node
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The node has been removed from the texi file some months ago, so we
-should remove it from the menu section, too.
-
-Fixes: 27a296fce982 ("qemu-ga: Convert invocation documentation to rST")
-Signed-off-by: Thomas Huth <thuth@redhat.com>
-Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
-Message-Id: <20191216132941.25729-1-thuth@redhat.com>
-Signed-off-by: Laurent Vivier <laurent@vivier.eu>
----
- qemu-doc.texi | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/qemu-doc.texi b/qemu-doc.texi
-index eea91a2d1e..39f950471f 100644
---- a/qemu-doc.texi
-+++ b/qemu-doc.texi
-@@ -38,7 +38,6 @@
- * Introduction::
- * QEMU PC System emulator::
- * QEMU System emulator for non PC targets::
--* QEMU Guest Agent::
- * QEMU User space emulator::
- * System requirements::
- * Security::
---
-2.24.1
-
diff --git a/gnu/packages/patches/qtbase-moc-ignore-gcc-macro.patch b/gnu/packages/patches/qtbase-moc-ignore-gcc-macro.patch
new file mode 100644
index 0000000000..b296cf0b72
--- /dev/null
+++ b/gnu/packages/patches/qtbase-moc-ignore-gcc-macro.patch
@@ -0,0 +1,17 @@
+The moc executable loops through headers on CPLUS_INCLUDE_PATH and stumbles
+on the GCC internal _GLIBCXX_VISIBILITY macro. Tell it to ignore it as it is
+not supposed to be looking there to begin with.
+
+Upstream report: https://bugreports.qt.io/browse/QTBUG-83160
+
+diff --git a/src/tools/moc/main.cpp b/src/tools/moc/main.cpp
+--- a/src/tools/moc/main.cpp
++++ b/src/tools/moc/main.cpp
+@@ -188,6 +188,7 @@ int runMoc(int argc, char **argv)
+ dummyVariadicFunctionMacro.arguments += Symbol(0, PP_IDENTIFIER, "__VA_ARGS__");
+ pp.macros["__attribute__"] = dummyVariadicFunctionMacro;
+ pp.macros["__declspec"] = dummyVariadicFunctionMacro;
++ pp.macros["_GLIBCXX_VISIBILITY"] = dummyVariadicFunctionMacro;
+
+ QString filename;
+ QString output;
diff --git a/gnu/packages/patches/ruby-rubygems-276-for-ruby24.patch b/gnu/packages/patches/ruby-rubygems-276-for-ruby24.patch
deleted file mode 100644
index 0d0ed6b204..0000000000
--- a/gnu/packages/patches/ruby-rubygems-276-for-ruby24.patch
+++ /dev/null
@@ -1,605 +0,0 @@
-diff --git lib/rubygems.rb lib/rubygems.rb
-index 0685bcb3c6..a5a9202e56 100644
---- ruby-2.4.3/lib/rubygems.rb
-+++ ruby-2.4.3/lib/rubygems.rb
-@@ -10,7 +10,7 @@
- require 'thread'
-
- module Gem
-- VERSION = "2.6.14"
-+ VERSION = "2.6.14.1"
- end
-
- # Must be first since it unloads the prelude from 1.9.2
-diff --git lib/rubygems/commands/owner_command.rb lib/rubygems/commands/owner_command.rb
-index 4b99434e87..2ee7f84462 100644
---- ruby-2.4.3/lib/rubygems/commands/owner_command.rb
-+++ ruby-2.4.3/lib/rubygems/commands/owner_command.rb
-@@ -62,7 +62,7 @@ def show_owners name
- end
-
- with_response response do |resp|
-- owners = YAML.load resp.body
-+ owners = Gem::SafeYAML.load resp.body
-
- say "Owners for gem: #{name}"
- owners.each do |owner|
-diff --git lib/rubygems/package.rb lib/rubygems/package.rb
-index 77811ed5ec..b5a5fe2a26 100644
---- ruby-2.4.3/lib/rubygems/package.rb
-+++ ruby-2.4.3/lib/rubygems/package.rb
-@@ -378,7 +378,7 @@ def extract_tar_gz io, destination_dir, pattern = "*" # :nodoc:
- File.dirname destination
- end
-
-- FileUtils.mkdir_p mkdir, mkdir_options
-+ mkdir_p_safe mkdir, mkdir_options, destination_dir, entry.full_name
-
- open destination, 'wb' do |out|
- out.write entry.read
-@@ -416,20 +416,35 @@ def install_location filename, destination_dir # :nodoc:
- raise Gem::Package::PathError.new(filename, destination_dir) if
- filename.start_with? '/'
-
-- destination_dir = File.realpath destination_dir if
-- File.respond_to? :realpath
-+ destination_dir = realpath destination_dir
- destination_dir = File.expand_path destination_dir
-
- destination = File.join destination_dir, filename
- destination = File.expand_path destination
-
- raise Gem::Package::PathError.new(destination, destination_dir) unless
-- destination.start_with? destination_dir
-+ destination.start_with? destination_dir + '/'
-
- destination.untaint
- destination
- end
-
-+ def mkdir_p_safe mkdir, mkdir_options, destination_dir, file_name
-+ destination_dir = realpath File.expand_path(destination_dir)
-+ parts = mkdir.split(File::SEPARATOR)
-+ parts.reduce do |path, basename|
-+ path = realpath path unless path == ""
-+ path = File.expand_path(path + File::SEPARATOR + basename)
-+ lstat = File.lstat path rescue nil
-+ if !lstat || !lstat.directory?
-+ unless path.start_with? destination_dir and (FileUtils.mkdir path, mkdir_options rescue false)
-+ raise Gem::Package::PathError.new(file_name, destination_dir)
-+ end
-+ end
-+ path
-+ end
-+ end
-+
- ##
- # Loads a Gem::Specification from the TarEntry +entry+
-
-@@ -603,6 +618,10 @@ def verify_files gem
- raise Gem::Package::FormatError.new \
- 'package content (data.tar.gz) is missing', @gem
- end
-+
-+ if duplicates = @files.group_by {|f| f }.select {|k,v| v.size > 1 }.map(&:first) and duplicates.any?
-+ raise Gem::Security::Exception, "duplicate files in the package: (#{duplicates.map(&:inspect).join(', ')})"
-+ end
- end
-
- ##
-@@ -616,6 +635,16 @@ def verify_gz entry # :nodoc:
- raise Gem::Package::FormatError.new(e.message, entry.full_name)
- end
-
-+ if File.respond_to? :realpath
-+ def realpath file
-+ File.realpath file
-+ end
-+ else
-+ def realpath file
-+ file
-+ end
-+ end
-+
- end
-
- require 'rubygems/package/digest_io'
-diff --git lib/rubygems/package/tar_header.rb lib/rubygems/package/tar_header.rb
-index c54bd14d57..d557357114 100644
---- ruby-2.4.3/lib/rubygems/package/tar_header.rb
-+++ ruby-2.4.3/lib/rubygems/package/tar_header.rb
-@@ -104,25 +104,30 @@ def self.from(stream)
- fields = header.unpack UNPACK_FORMAT
-
- new :name => fields.shift,
-- :mode => fields.shift.oct,
-- :uid => fields.shift.oct,
-- :gid => fields.shift.oct,
-- :size => fields.shift.oct,
-- :mtime => fields.shift.oct,
-- :checksum => fields.shift.oct,
-+ :mode => strict_oct(fields.shift),
-+ :uid => strict_oct(fields.shift),
-+ :gid => strict_oct(fields.shift),
-+ :size => strict_oct(fields.shift),
-+ :mtime => strict_oct(fields.shift),
-+ :checksum => strict_oct(fields.shift),
- :typeflag => fields.shift,
- :linkname => fields.shift,
- :magic => fields.shift,
-- :version => fields.shift.oct,
-+ :version => strict_oct(fields.shift),
- :uname => fields.shift,
- :gname => fields.shift,
-- :devmajor => fields.shift.oct,
-- :devminor => fields.shift.oct,
-+ :devmajor => strict_oct(fields.shift),
-+ :devminor => strict_oct(fields.shift),
- :prefix => fields.shift,
-
- :empty => empty
- end
-
-+ def self.strict_oct(str)
-+ return str.oct if str =~ /\A[0-7]*\z/
-+ raise ArgumentError, "#{str.inspect} is not an octal string"
-+ end
-+
- ##
- # Creates a new TarHeader using +vals+
-
-diff --git lib/rubygems/package/tar_writer.rb lib/rubygems/package/tar_writer.rb
-index f68b8d4c5e..390f7851a3 100644
---- ruby-2.4.3/lib/rubygems/package/tar_writer.rb
-+++ ruby-2.4.3/lib/rubygems/package/tar_writer.rb
-@@ -196,6 +196,8 @@ def add_file_signed name, mode, signer
- digest_name == signer.digest_name
- end
-
-+ raise "no #{signer.digest_name} in #{digests.values.compact}" unless signature_digest
-+
- if signer.key then
- signature = signer.sign signature_digest.digest
-
-diff --git lib/rubygems/server.rb lib/rubygems/server.rb
-index df4eb566d3..a7b5243ba0 100644
---- ruby-2.4.3/lib/rubygems/server.rb
-+++ ruby-2.4.3/lib/rubygems/server.rb
-@@ -631,6 +631,18 @@ def root(req, res)
- executables = nil if executables.empty?
- executables.last["is_last"] = true if executables
-
-+ # Pre-process spec homepage for safety reasons
-+ begin
-+ homepage_uri = URI.parse(spec.homepage)
-+ if [URI::HTTP, URI::HTTPS].member? homepage_uri.class
-+ homepage_uri = spec.homepage
-+ else
-+ homepage_uri = "."
-+ end
-+ rescue URI::InvalidURIError
-+ homepage_uri = "."
-+ end
-+
- specs << {
- "authors" => spec.authors.sort.join(", "),
- "date" => spec.date.to_s,
-@@ -640,7 +652,7 @@ def root(req, res)
- "only_one_executable" => (executables && executables.size == 1),
- "full_name" => spec.full_name,
- "has_deps" => !deps.empty?,
-- "homepage" => spec.homepage,
-+ "homepage" => homepage_uri,
- "name" => spec.name,
- "rdoc_installed" => Gem::RDoc.new(spec).rdoc_installed?,
- "ri_installed" => Gem::RDoc.new(spec).ri_installed?,
-diff --git lib/rubygems/specification.rb lib/rubygems/specification.rb
-index 40e3a70d47..0a154b9001 100644
---- ruby-2.4.3/lib/rubygems/specification.rb
-+++ ruby-2.4.3/lib/rubygems/specification.rb
-@@ -15,6 +15,7 @@
- require 'rubygems/stub_specification'
- require 'rubygems/util/list'
- require 'stringio'
-+require 'uri'
-
- ##
- # The Specification class contains the information for a Gem. Typically
-@@ -2813,10 +2814,16 @@ def validate packaging = true
- raise Gem::InvalidSpecificationException, "#{lazy} is not a summary"
- end
-
-- if homepage and not homepage.empty? and
-- homepage !~ /\A[a-z][a-z\d+.-]*:/i then
-- raise Gem::InvalidSpecificationException,
-- "\"#{homepage}\" is not a URI"
-+ # Make sure a homepage is valid HTTP/HTTPS URI
-+ if homepage and not homepage.empty?
-+ begin
-+ homepage_uri = URI.parse(homepage)
-+ unless [URI::HTTP, URI::HTTPS].member? homepage_uri.class
-+ raise Gem::InvalidSpecificationException, "\"#{homepage}\" is not a valid HTTP URI"
-+ end
-+ rescue URI::InvalidURIError
-+ raise Gem::InvalidSpecificationException, "\"#{homepage}\" is not a valid HTTP URI"
-+ end
- end
-
- # Warnings
-diff --git test/rubygems/test_gem_commands_owner_command.rb test/rubygems/test_gem_commands_owner_command.rb
-index 44652c1093..53cac4ce87 100644
---- ruby-2.4.3/test/rubygems/test_gem_commands_owner_command.rb
-+++ ruby-2.4.3/test/rubygems/test_gem_commands_owner_command.rb
-@@ -43,6 +43,31 @@ def test_show_owners
- assert_match %r{- 4}, @ui.output
- end
-
-+ def test_show_owners_dont_load_objects
-+ skip "testing a psych-only API" unless defined?(::Psych::DisallowedClass)
-+
-+ response = <<EOF
-+---
-+- email: !ruby/object:Object {}
-+ id: 1
-+ handle: user1
-+- email: user2@example.com
-+- id: 3
-+ handle: user3
-+- id: 4
-+EOF
-+
-+ @fetcher.data["#{Gem.host}/api/v1/gems/freewill/owners.yaml"] = [response, 200, 'OK']
-+
-+ assert_raises Psych::DisallowedClass do
-+ use_ui @ui do
-+ @cmd.show_owners("freewill")
-+ end
-+ end
-+
-+ end
-+
-+
- def test_show_owners_setting_up_host_through_env_var
- response = "- email: user1@example.com\n"
- host = "http://rubygems.example"
-diff --git test/rubygems/test_gem_package.rb test/rubygems/test_gem_package.rb
-index 9d47f0dea4..5b93475314 100644
---- ruby-2.4.3/test/rubygems/test_gem_package.rb
-+++ ruby-2.4.3/test/rubygems/test_gem_package.rb
-@@ -455,6 +455,31 @@ def test_extract_tar_gz_symlink_relative_path
- File.read(extracted)
- end
-
-+ def test_extract_symlink_parent
-+ skip 'symlink not supported' if Gem.win_platform?
-+
-+ package = Gem::Package.new @gem
-+
-+ tgz_io = util_tar_gz do |tar|
-+ tar.mkdir 'lib', 0755
-+ tar.add_symlink 'lib/link', '../..', 0644
-+ tar.add_file 'lib/link/outside.txt', 0644 do |io| io.write 'hi' end
-+ end
-+
-+ # Extract into a subdirectory of @destination; if this test fails it writes
-+ # a file outside destination_subdir, but we want the file to remain inside
-+ # @destination so it will be cleaned up.
-+ destination_subdir = File.join @destination, 'subdir'
-+ FileUtils.mkdir_p destination_subdir
-+
-+ e = assert_raises Gem::Package::PathError do
-+ package.extract_tar_gz tgz_io, destination_subdir
-+ end
-+
-+ assert_equal("installing into parent path lib/link/outside.txt of " +
-+ "#{destination_subdir} is not allowed", e.message)
-+ end
-+
- def test_extract_tar_gz_directory
- package = Gem::Package.new @gem
-
-@@ -566,6 +591,21 @@ def test_install_location_relative
- "#{@destination} is not allowed", e.message)
- end
-
-+ def test_install_location_suffix
-+ package = Gem::Package.new @gem
-+
-+ filename = "../#{File.basename(@destination)}suffix.rb"
-+
-+ e = assert_raises Gem::Package::PathError do
-+ package.install_location filename, @destination
-+ end
-+
-+ parent = File.expand_path File.join @destination, filename
-+
-+ assert_equal("installing into parent path #{parent} of " +
-+ "#{@destination} is not allowed", e.message)
-+ end
-+
- def test_load_spec
- entry = StringIO.new Gem.gzip @spec.to_yaml
- def entry.full_name() 'metadata.gz' end
-@@ -723,6 +763,32 @@ def test_verify_nonexistent
- assert_match %r%nonexistent.gem$%, e.message
- end
-
-+ def test_verify_duplicate_file
-+ FileUtils.mkdir_p 'lib'
-+ FileUtils.touch 'lib/code.rb'
-+
-+ build = Gem::Package.new @gem
-+ build.spec = @spec
-+ build.setup_signer
-+ open @gem, 'wb' do |gem_io|
-+ Gem::Package::TarWriter.new gem_io do |gem|
-+ build.add_metadata gem
-+ build.add_contents gem
-+
-+ gem.add_file_simple 'a.sig', 0444, 0
-+ gem.add_file_simple 'a.sig', 0444, 0
-+ end
-+ end
-+
-+ package = Gem::Package.new @gem
-+
-+ e = assert_raises Gem::Security::Exception do
-+ package.verify
-+ end
-+
-+ assert_equal 'duplicate files in the package: ("a.sig")', e.message
-+ end
-+
- def test_verify_security_policy
- skip 'openssl is missing' unless defined?(OpenSSL::SSL)
-
-@@ -780,7 +846,13 @@ def test_verify_security_policy_checksum_missing
-
- # write bogus data.tar.gz to foil signature
- bogus_data = Gem.gzip 'hello'
-- gem.add_file_simple 'data.tar.gz', 0444, bogus_data.length do |io|
-+ fake_signer = Class.new do
-+ def digest_name; 'SHA512'; end
-+ def digest_algorithm; Digest(:SHA512); end
-+ def key; 'key'; end
-+ def sign(*); 'fake_sig'; end
-+ end
-+ gem.add_file_signed 'data2.tar.gz', 0444, fake_signer.new do |io|
- io.write bogus_data
- end
-
-diff --git test/rubygems/test_gem_package_tar_header.rb test/rubygems/test_gem_package_tar_header.rb
-index d33877057d..43f508df45 100644
---- ruby-2.4.3/test/rubygems/test_gem_package_tar_header.rb
-+++ ruby-2.4.3/test/rubygems/test_gem_package_tar_header.rb
-@@ -143,5 +143,26 @@ def test_update_checksum
- assert_equal '012467', @tar_header.checksum
- end
-
-+ def test_from_bad_octal
-+ test_cases = [
-+ "00000006,44\000", # bogus character
-+ "00000006789\000", # non-octal digit
-+ "+0000001234\000", # positive sign
-+ "-0000001000\000", # negative sign
-+ "0x000123abc\000", # radix prefix
-+ ]
-+
-+ test_cases.each do |val|
-+ header_s = @tar_header.to_s
-+ # overwrite the size field
-+ header_s[124, 12] = val
-+ io = TempIO.new header_s
-+ assert_raises ArgumentError do
-+ new_header = Gem::Package::TarHeader.from io
-+ end
-+ io.close! if io.respond_to? :close!
-+ end
-+ end
-+
- end
-
-diff --git test/rubygems/test_gem_server.rb test/rubygems/test_gem_server.rb
-index 4873fac5b6..96ed9194e9 100644
---- ruby-2.4.3/test/rubygems/test_gem_server.rb
-+++ ruby-2.4.3/test/rubygems/test_gem_server.rb
-@@ -336,6 +336,171 @@ def test_root_gemdirs
- assert_match 'z 9', @res.body
- end
-
-+
-+ def test_xss_homepage_fix_289313
-+ data = StringIO.new "GET / HTTP/1.0\r\n\r\n"
-+ dir = "#{@gemhome}2"
-+
-+ spec = util_spec 'xsshomepagegem', 1
-+ spec.homepage = "javascript:confirm(document.domain)"
-+
-+ specs_dir = File.join dir, 'specifications'
-+ FileUtils.mkdir_p specs_dir
-+
-+ open File.join(specs_dir, spec.spec_name), 'w' do |io|
-+ io.write spec.to_ruby
-+ end
-+
-+ server = Gem::Server.new dir, process_based_port, false
-+
-+ @req.parse data
-+
-+ server.root @req, @res
-+
-+ assert_equal 200, @res.status
-+ assert_match 'xsshomepagegem 1', @res.body
-+
-+ # This verifies that the homepage for this spec is not displayed and is set to ".", because it's not a
-+ # valid HTTP/HTTPS URL and could be unsafe in an HTML context. We would prefer to throw an exception here,
-+ # but spec.homepage is currently free form and not currently required to be a URL, this behavior may be
-+ # validated in future versions of Gem::Specification.
-+ #
-+ # There are two variant we're checking here, one where rdoc is not present, and one where rdoc is present in the same regex:
-+ #
-+ # Variant #1 - rdoc not installed
-+ #
-+ # <b>xsshomepagegem 1</b>
-+ #
-+ #
-+ # <span title="rdoc not installed">[rdoc]</span>
-+ #
-+ #
-+ #
-+ # <a href="." title=".">[www]</a>
-+ #
-+ # Variant #2 - rdoc installed
-+ #
-+ # <b>xsshomepagegem 1</b>
-+ #
-+ #
-+ # <a href="\/doc_root\/xsshomepagegem-1\/">\[rdoc\]<\/a>
-+ #
-+ #
-+ #
-+ # <a href="." title=".">[www]</a>
-+ regex_match = /xsshomepagegem 1<\/b>[\n\s]+(<span title="rdoc not installed">\[rdoc\]<\/span>|<a href="\/doc_root\/xsshomepagegem-1\/">\[rdoc\]<\/a>)[\n\s]+<a href="\." title="\.">\[www\]<\/a>/
-+ assert_match regex_match, @res.body
-+ end
-+
-+ def test_invalid_homepage
-+ data = StringIO.new "GET / HTTP/1.0\r\n\r\n"
-+ dir = "#{@gemhome}2"
-+
-+ spec = util_spec 'invalidhomepagegem', 1
-+ spec.homepage = "notavalidhomepageurl"
-+
-+ specs_dir = File.join dir, 'specifications'
-+ FileUtils.mkdir_p specs_dir
-+
-+ open File.join(specs_dir, spec.spec_name), 'w' do |io|
-+ io.write spec.to_ruby
-+ end
-+
-+ server = Gem::Server.new dir, process_based_port, false
-+
-+ @req.parse data
-+
-+ server.root @req, @res
-+
-+ assert_equal 200, @res.status
-+ assert_match 'invalidhomepagegem 1', @res.body
-+
-+ # This verifies that the homepage for this spec is not displayed and is set to ".", because it's not a
-+ # valid HTTP/HTTPS URL and could be unsafe in an HTML context. We would prefer to throw an exception here,
-+ # but spec.homepage is currently free form and not currently required to be a URL, this behavior may be
-+ # validated in future versions of Gem::Specification.
-+ #
-+ # There are two variant we're checking here, one where rdoc is not present, and one where rdoc is present in the same regex:
-+ #
-+ # Variant #1 - rdoc not installed
-+ #
-+ # <b>invalidhomepagegem 1</b>
-+ #
-+ #
-+ # <span title="rdoc not installed">[rdoc]</span>
-+ #
-+ #
-+ #
-+ # <a href="." title=".">[www]</a>
-+ #
-+ # Variant #2 - rdoc installed
-+ #
-+ # <b>invalidhomepagegem 1</b>
-+ #
-+ #
-+ # <a href="\/doc_root\/invalidhomepagegem-1\/">\[rdoc\]<\/a>
-+ #
-+ #
-+ #
-+ # <a href="." title=".">[www]</a>
-+ regex_match = /invalidhomepagegem 1<\/b>[\n\s]+(<span title="rdoc not installed">\[rdoc\]<\/span>|<a href="\/doc_root\/invalidhomepagegem-1\/">\[rdoc\]<\/a>)[\n\s]+<a href="\." title="\.">\[www\]<\/a>/
-+ assert_match regex_match, @res.body
-+ end
-+
-+ def test_valid_homepage_http
-+ data = StringIO.new "GET / HTTP/1.0\r\n\r\n"
-+ dir = "#{@gemhome}2"
-+
-+ spec = util_spec 'validhomepagegemhttp', 1
-+ spec.homepage = "http://rubygems.org"
-+
-+ specs_dir = File.join dir, 'specifications'
-+ FileUtils.mkdir_p specs_dir
-+
-+ open File.join(specs_dir, spec.spec_name), 'w' do |io|
-+ io.write spec.to_ruby
-+ end
-+
-+ server = Gem::Server.new dir, process_based_port, false
-+
-+ @req.parse data
-+
-+ server.root @req, @res
-+
-+ assert_equal 200, @res.status
-+ assert_match 'validhomepagegemhttp 1', @res.body
-+
-+ regex_match = /validhomepagegemhttp 1<\/b>[\n\s]+(<span title="rdoc not installed">\[rdoc\]<\/span>|<a href="\/doc_root\/validhomepagegemhttp-1\/">\[rdoc\]<\/a>)[\n\s]+<a href="http:\/\/rubygems\.org" title="http:\/\/rubygems\.org">\[www\]<\/a>/
-+ assert_match regex_match, @res.body
-+ end
-+
-+ def test_valid_homepage_https
-+ data = StringIO.new "GET / HTTP/1.0\r\n\r\n"
-+ dir = "#{@gemhome}2"
-+
-+ spec = util_spec 'validhomepagegemhttps', 1
-+ spec.homepage = "https://rubygems.org"
-+
-+ specs_dir = File.join dir, 'specifications'
-+ FileUtils.mkdir_p specs_dir
-+
-+ open File.join(specs_dir, spec.spec_name), 'w' do |io|
-+ io.write spec.to_ruby
-+ end
-+
-+ server = Gem::Server.new dir, process_based_port, false
-+
-+ @req.parse data
-+
-+ server.root @req, @res
-+
-+ assert_equal 200, @res.status
-+ assert_match 'validhomepagegemhttps 1', @res.body
-+
-+ regex_match = /validhomepagegemhttps 1<\/b>[\n\s]+(<span title="rdoc not installed">\[rdoc\]<\/span>|<a href="\/doc_root\/validhomepagegemhttps-1\/">\[rdoc\]<\/a>)[\n\s]+<a href="https:\/\/rubygems\.org" title="https:\/\/rubygems\.org">\[www\]<\/a>/
-+ assert_match regex_match, @res.body
-+ end
-+
- def test_specs
- data = StringIO.new "GET /specs.#{Gem.marshal_version} HTTP/1.0\r\n\r\n"
- @req.parse data
-diff --git test/rubygems/test_gem_specification.rb test/rubygems/test_gem_specification.rb
-index 0fcc11e78f..1c68826fb3 100644
---- ruby-2.4.3/test/rubygems/test_gem_specification.rb
-+++ ruby-2.4.3/test/rubygems/test_gem_specification.rb
-@@ -2890,7 +2890,22 @@ def test_validate_homepage
- @a1.validate
- end
-
-- assert_equal '"over at my cool site" is not a URI', e.message
-+ assert_equal '"over at my cool site" is not a valid HTTP URI', e.message
-+
-+ @a1.homepage = 'ftp://rubygems.org'
-+
-+ e = assert_raises Gem::InvalidSpecificationException do
-+ @a1.validate
-+ end
-+
-+ assert_equal '"ftp://rubygems.org" is not a valid HTTP URI', e.message
-+
-+ @a1.homepage = 'http://rubygems.org'
-+ assert_equal true, @a1.validate
-+
-+ @a1.homepage = 'https://rubygems.org'
-+ assert_equal true, @a1.validate
-+
- end
- end
-
diff --git a/gnu/packages/patches/rust-nettle-disable-vendor.patch b/gnu/packages/patches/rust-nettle-disable-vendor.patch
new file mode 100644
index 0000000000..5b52821cdb
--- /dev/null
+++ b/gnu/packages/patches/rust-nettle-disable-vendor.patch
@@ -0,0 +1,13 @@
+Subject: nettle: clear out "vendored" feature cruft from build.rs
+From: Daniel Kahn Gillmor's avatarDaniel Kahn Gillmor <dkg@fifthhorseman.net>
+
+https://salsa.debian.org/rust-team/debcargo-conf/-/commit/b608e6beaa1d38c14fc16ad53780d94954a91900
+https://sources.debian.org/src/rust-nettle/7.0.0-1/debian/patches/disable-vendor.diff/
+--- a/Cargo.toml 1969-12-31 19:00:00.000000000 -0500
++++ b/Cargo.toml 2019-10-23 19:12:01.076181971 -0400
+@@ -35,4 +35,4 @@
+ version = "1"
+
+ [features]
+-vendored = ["nettle-sys/vendored"]
++vendored = []
diff --git a/gnu/packages/patches/rust-nettle-sys-disable-vendor.patch b/gnu/packages/patches/rust-nettle-sys-disable-vendor.patch
new file mode 100644
index 0000000000..ae5ef5ebe0
--- /dev/null
+++ b/gnu/packages/patches/rust-nettle-sys-disable-vendor.patch
@@ -0,0 +1,48 @@
+Subject: nettle-sys: clear out "vendored" feature cruft from build.rs
+From: Daniel Kahn Gillmor's avatarDaniel Kahn Gillmor <dkg@fifthhorseman.net>
+
+https://salsa.debian.org/rust-team/debcargo-conf/-/commit/0c71150ad26bb66a8396dcdab055181af232ddc5
+https://sources.debian.org/src/rust-nettle-sys/2.0.4-3/debian/patches/disable-vendor.diff/
+--- a/Cargo.toml 2019-10-23 13:08:07.000000000 -0400
++++ b/Cargo.toml 2019-10-23 14:08:46.644064014 -0400
+@@ -29,12 +29,9 @@
+ version = "0.51.1"
+ default-features = false
+
+-[build-dependencies.nettle-src]
+-version = "3.5.1-0"
+-optional = true
+-
+ [build-dependencies.pkg-config]
+ version = "0.3"
+
+ [features]
+ vendored = ["nettle-src"]
++nettle-src = []
+diff --git a/build.rs b/build.rs
+index 44f7af3..ede4b2f 100644
+--- a/build.rs
++++ b/build.rs
+@@ -1,7 +1,5 @@
+ extern crate bindgen;
+ extern crate pkg_config;
+-#[cfg(feature = "vendored")]
+-extern crate nettle_src;
+
+ use std::env;
+ use std::fs;
+@@ -36,14 +34,6 @@ fn main() {
+ println!("cargo:rerun-if-env-changed=NETTLE_STATIC");
+ println!("cargo:rerun-if-env-changed={}", NETTLE_PREGENERATED_BINDINGS);
+
+- #[cfg(feature = "vendored")]
+- {
+- let artifacts = nettle_src::Build::new().build();
+- println!("cargo:vendored=1");
+- env::set_var("PKG_CONFIG_PATH",
+- artifacts.lib_dir().join("pkgconfig"));
+- }
+-
+ let nettle = pkg_config::probe_library("nettle hogweed").unwrap();
+
+ let mode = match env::var_os("NETTLE_STATIC") {
diff --git a/gnu/packages/patches/screen-hurd-path-max.patch b/gnu/packages/patches/screen-hurd-path-max.patch
new file mode 100644
index 0000000000..e906f154f3
--- /dev/null
+++ b/gnu/packages/patches/screen-hurd-path-max.patch
@@ -0,0 +1,42 @@
+Workaround for PATH_MAX usage on the Hurd.
+
+Taken from https://salsa.debian.org/debian/screen/-/blob/master/debian/patches/61-default-PATH_MAX-if-undefined-for-hurd.patch
+
+Description: Set PATH_MAX to 4096 if undefined
+ Fixes FTBFS since 4.4.0 on GNU/Hurd. Updated to add one more occurrence for 4.5.0.
+Author: Axel Beckert <abe@debian.org>
+Bug: https://savannah.gnu.org/bugs/?50089
+Last-Updated: 2017-01-18
+
+--- a/tty.sh
++++ b/tty.sh
+@@ -1478,6 +1478,13 @@
+ return 0;
+ }
+
++/*
++ * Define PATH_MAX to 4096 if it's not defined, like on GNU/Hurd
++ */
++
++#ifndef PATH_MAX
++#define PATH_MAX 4096
++#endif
+
+ int CheckTtyname (char *tty)
+ {
+--- a/screen.h
++++ b/screen.h
+@@ -109,6 +109,13 @@
+ # define DEFAULT_BUFFERFILE "/tmp/screen-exchange"
+ #endif
+
++/*
++ * Define PATH_MAX to 4096 if it's not defined, like on GNU/Hurd
++ */
++
++#ifndef PATH_MAX
++#define PATH_MAX 4096
++#endif
+
+ #if defined(hpux) && !(defined(VSUSP) && defined(VDSUSP) && defined(VWERASE) && defined(VLNEXT))
+ # define HPUX_LTCHARS_HACK
diff --git a/gnu/packages/patches/scribus-1.5.5-poppler-0.86-build-fix.patch b/gnu/packages/patches/scribus-1.5.5-poppler-0.86-build-fix.patch
new file mode 100644
index 0000000000..39008cba5c
--- /dev/null
+++ b/gnu/packages/patches/scribus-1.5.5-poppler-0.86-build-fix.patch
@@ -0,0 +1,642 @@
+Fix build with Poppler 0.86.
+
+The original series of patches authored by Craig Bradney <mrb@scribus.info>
+and Jean Ghali <jghali@libertysurf.fr>, taken from
+https://gitweb.gentoo.org/repo/gentoo.git/tree/app-office/scribus/files
+
+diff --git a/scribus/plugins/import/pdf/importpdf.cpp b/scribus/plugins/import/pdf/importpdf.cpp
+--- a/scribus/plugins/import/pdf/importpdf.cpp
++++ b/scribus/plugins/import/pdf/importpdf.cpp
+@@ -75,7 +75,11 @@ PdfPlug::PdfPlug(ScribusDoc* doc, int flags)
+ QImage PdfPlug::readThumbnail(const QString& fName)
+ {
+ QString pdfFile = QDir::toNativeSeparators(fName);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 83, 0)
++ globalParams.reset(new GlobalParams());
++#else
+ globalParams = new GlobalParams();
++#endif
+ if (globalParams)
+ {
+ #if defined(Q_OS_WIN32) && POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 62, 0)
+@@ -90,7 +94,9 @@ QImage PdfPlug::readThumbnail(const QString& fName)
+ if (pdfDoc->getErrorCode() == errEncrypted)
+ {
+ delete pdfDoc;
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 83, 0)
+ delete globalParams;
++#endif
+ return QImage();
+ }
+ if (pdfDoc->isOk())
+@@ -134,11 +140,15 @@ QImage PdfPlug::readThumbnail(const QString& fName)
+ image.setText("YSize", QString("%1").arg(h));
+ delete dev;
+ delete pdfDoc;
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 83, 0)
+ delete globalParams;
++#endif
+ return image;
+ }
+ delete pdfDoc;
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 83, 0)
+ delete globalParams;
++#endif
+ }
+ }
+ return QImage();
+@@ -387,7 +397,11 @@ bool PdfPlug::convert(const QString& fn)
+ qApp->processEvents();
+ }
+
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 83, 0)
++ globalParams.reset(new GlobalParams());
++#else
+ globalParams = new GlobalParams();
++#endif
+ GooString *userPW = nullptr;
+ if (globalParams)
+ {
+@@ -429,7 +443,9 @@ bool PdfPlug::convert(const QString& fn)
+ if (progressDialog)
+ progressDialog->close();
+ delete pdfDoc;
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 83, 0)
+ delete globalParams;
++#endif
+ return false;
+ }
+ if (progressDialog)
+@@ -474,7 +490,9 @@ bool PdfPlug::convert(const QString& fn)
+ progressDialog->close();
+ delete optImp;
+ delete pdfDoc;
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 83, 0)
+ delete globalParams;
++#endif
+ return false;
+ }
+ pageString = optImp->getPagesString();
+@@ -838,11 +856,20 @@ bool PdfPlug::convert(const QString& fn)
+ names = catDict.dictLookup("OpenAction");
+ if (names.isDict())
+ {
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ std::unique_ptr<LinkAction> linkAction;
++ linkAction = LinkAction::parseAction(&names, pdfDoc->getCatalog()->getBaseURI());
++#else
+ LinkAction *linkAction = nullptr;
+ linkAction = LinkAction::parseAction(&names, pdfDoc->getCatalog()->getBaseURI());
++#endif
+ if (linkAction)
+ {
+- LinkJavaScript *jsa = (LinkJavaScript*)linkAction;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ LinkJavaScript *jsa = (LinkJavaScript*) linkAction.get();
++#else
++ LinkJavaScript *jsa = (LinkJavaScript*) linkAction;
++#endif
+ if (jsa->isOk())
+ {
+ QString script = UnicodeParsedString(jsa->getScript());
+@@ -908,8 +935,12 @@ bool PdfPlug::convert(const QString& fn)
+ }
+ delete pdfDoc;
+ }
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 83, 0)
++ globalParams.release();
++#else
+ delete globalParams;
+ globalParams = nullptr;
++#endif
+
+ // qDebug() << "converting finished";
+ // qDebug() << "Imported" << Elements.count() << "Elements";
+@@ -1046,3 +1077,43 @@ QString PdfPlug::UnicodeParsedString(POPPLER_CONST GooString *s1)
+ }
+ return result;
+ }
++
++QString PdfPlug::UnicodeParsedString(const std::string& s1)
++{
++ if (s1.length() == 0)
++ return QString();
++ GBool isUnicode;
++ int i;
++ Unicode u;
++ QString result;
++ if ((s1.at(0) & 0xff) == 0xfe && (s1.length() > 1 && (s1.at(1) & 0xff) == 0xff))
++ {
++ isUnicode = gTrue;
++ i = 2;
++ result.reserve((s1.length() - 2) / 2);
++ }
++ else
++ {
++ isUnicode = gFalse;
++ i = 0;
++ result.reserve(s1.length());
++ }
++ while (i < s1.length())
++ {
++ if (isUnicode)
++ {
++ u = ((s1.at(i) & 0xff) << 8) | (s1.at(i+1) & 0xff);
++ i += 2;
++ }
++ else
++ {
++ u = s1.at(i) & 0xff;
++ ++i;
++ }
++ // #15616: imagemagick may write unicode strings incorrectly in PDF
++ if (u == 0)
++ continue;
++ result += QChar( u );
++ }
++ return result;
++}
+diff --git a/scribus/plugins/import/pdf/importpdf.h b/scribus/plugins/import/pdf/importpdf.h
+--- a/scribus/plugins/import/pdf/importpdf.h
++++ b/scribus/plugins/import/pdf/importpdf.h
+@@ -82,6 +82,7 @@ private:
+ bool convert(const QString& fn);
+ QRectF getCBox(int box, int pgNum);
+ QString UnicodeParsedString(POPPLER_CONST GooString *s1);
++ QString UnicodeParsedString(const std::string& s1);
+
+ QList<PageItem*> Elements;
+ double baseX, baseY;
+diff --git a/scribus/plugins/import/pdf/importpdfconfig.h b/scribus/plugins/import/pdf/importpdfconfig.h
+--- a/scribus/plugins/import/pdf/importpdfconfig.h
++++ b/scribus/plugins/import/pdf/importpdfconfig.h
+@@ -52,4 +52,16 @@ for which a new license (GPL+exception) is in place.
+ #define POPPLER_REF
+ #endif
+
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 82, 0)
++#define POPPLER_CONST_082 const
++#else
++#define POPPLER_CONST_082
++#endif
++
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 83, 0)
++#define POPPLER_CONST_083 const
++#else
++#define POPPLER_CONST_083
++#endif
++
+ #endif
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -308,9 +308,15 @@ LinkAction* SlaOutputDev::SC_getAction(AnnotWidget *ano)
+ }
+
+ /* Replacement for the crippled Poppler function LinkAction* AnnotWidget::getAdditionalAction(AdditionalActionsType type) */
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++std::unique_ptr<LinkAction> SlaOutputDev::SC_getAdditionalAction(const char *key, AnnotWidget *ano)
++{
++ std::unique_ptr<LinkAction> linkAction;
++#else
+ LinkAction* SlaOutputDev::SC_getAdditionalAction(const char *key, AnnotWidget *ano)
+ {
+ LinkAction *linkAction = nullptr;
++#endif
+ Object obj;
+ Ref refa = ano->getRef();
+
+@@ -455,7 +461,11 @@ bool SlaOutputDev::handleLinkAnnot(Annot* annota, double xCoor, double yCoor, do
+ POPPLER_CONST GooString *ndst = gto->getNamedDest();
+ if (ndst)
+ {
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ std::unique_ptr<LinkDest> dstn = pdfDoc->findDest(ndst);
++#else
+ LinkDest *dstn = pdfDoc->findDest(ndst);
++#endif
+ if (dstn)
+ {
+ if (dstn->getKind() == destXYZ)
+@@ -499,7 +509,11 @@ bool SlaOutputDev::handleLinkAnnot(Annot* annota, double xCoor, double yCoor, do
+ POPPLER_CONST GooString *ndst = gto->getNamedDest();
+ if (ndst)
+ {
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ std::unique_ptr<LinkDest> dstn = pdfDoc->findDest(ndst);
++#else
+ LinkDest *dstn = pdfDoc->findDest(ndst);
++#endif
+ if (dstn)
+ {
+ if (dstn->getKind() == destXYZ)
+@@ -967,7 +981,11 @@ void SlaOutputDev::handleActions(PageItem* ite, AnnotWidget *ano)
+ POPPLER_CONST GooString *ndst = gto->getNamedDest();
+ if (ndst)
+ {
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ std::unique_ptr<LinkDest> dstn = pdfDoc->findDest(ndst);
++#else
+ LinkDest *dstn = pdfDoc->findDest(ndst);
++#endif
+ if (dstn)
+ {
+ if (dstn->getKind() == destXYZ)
+@@ -1019,7 +1037,11 @@ void SlaOutputDev::handleActions(PageItem* ite, AnnotWidget *ano)
+ POPPLER_CONST GooString *ndst = gto->getNamedDest();
+ if (ndst)
+ {
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ std::unique_ptr<LinkDest> dstn = pdfDoc->findDest(ndst);
++#else
+ LinkDest *dstn = pdfDoc->findDest(ndst);
++#endif
+ if (dstn)
+ {
+ if (dstn->getKind() == destXYZ)
+@@ -1088,96 +1110,148 @@ void SlaOutputDev::handleActions(PageItem* ite, AnnotWidget *ano)
+ else
+ qDebug() << "Found unsupported Action of type" << Lact->getKind();
+ }
+- LinkAction *Aact = SC_getAdditionalAction("D", ano);
++ auto Aact = SC_getAdditionalAction("D", ano);
+ if (Aact)
+ {
+ if (Aact->getKind() == actionJavaScript)
+ {
+- LinkJavaScript *jsa = (LinkJavaScript*)Aact;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
++#else
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact;
++#endif
+ if (jsa->isOk())
+ {
+ ite->annotation().setD_act(UnicodeParsedString(jsa->getScript()));
+ ite->annotation().setAAact(true);
+ }
+ }
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ Aact.reset();
++#else
+ Aact = nullptr;
++#endif
+ }
+ Aact = SC_getAdditionalAction("E", ano);
+ if (Aact)
+ {
+ if (Aact->getKind() == actionJavaScript)
+ {
+- LinkJavaScript *jsa = (LinkJavaScript*)Aact;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
++#else
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact;
++#endif
+ if (jsa->isOk())
+ {
+ ite->annotation().setE_act(UnicodeParsedString(jsa->getScript()));
+ ite->annotation().setAAact(true);
+ }
+ }
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ Aact.reset();
++#else
+ Aact = nullptr;
++#endif
+ }
+ Aact = SC_getAdditionalAction("X", ano);
+ if (Aact)
+ {
+ if (Aact->getKind() == actionJavaScript)
+ {
+- LinkJavaScript *jsa = (LinkJavaScript*)Aact;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
++#else
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact;
++#endif
+ if (jsa->isOk())
+ {
+ ite->annotation().setX_act(UnicodeParsedString(jsa->getScript()));
+ ite->annotation().setAAact(true);
+ }
+ }
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ Aact.reset();
++#else
+ Aact = nullptr;
++#endif
+ }
+ Aact = SC_getAdditionalAction("Fo", ano);
+ if (Aact)
+ {
+ if (Aact->getKind() == actionJavaScript)
+ {
+- LinkJavaScript *jsa = (LinkJavaScript*)Aact;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
++#else
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact;
++#endif
+ if (jsa->isOk())
+ {
+ ite->annotation().setFo_act(UnicodeParsedString(jsa->getScript()));
+ ite->annotation().setAAact(true);
+ }
+ }
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ Aact.reset();
++#else
+ Aact = nullptr;
++#endif
+ }
+ Aact = SC_getAdditionalAction("Bl", ano);
+ if (Aact)
+ {
+ if (Aact->getKind() == actionJavaScript)
+ {
+- LinkJavaScript *jsa = (LinkJavaScript*)Aact;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
++#else
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact;
++#endif
+ if (jsa->isOk())
+ {
+ ite->annotation().setBl_act(UnicodeParsedString(jsa->getScript()));
+ ite->annotation().setAAact(true);
+ }
+ }
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ Aact.reset();
++#else
+ Aact = nullptr;
++#endif
+ }
+ Aact = SC_getAdditionalAction("C", ano);
+ if (Aact)
+ {
+ if (Aact->getKind() == actionJavaScript)
+ {
+- LinkJavaScript *jsa = (LinkJavaScript*)Aact;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
++#else
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact;
++#endif
+ if (jsa->isOk())
+ {
+ ite->annotation().setC_act(UnicodeParsedString(jsa->getScript()));
+ ite->annotation().setAAact(true);
+ }
+ }
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ Aact.reset();
++#else
+ Aact = nullptr;
++#endif
+ }
+ Aact = SC_getAdditionalAction("F", ano);
+ if (Aact)
+ {
+ if (Aact->getKind() == actionJavaScript)
+ {
+- LinkJavaScript *jsa = (LinkJavaScript*)Aact;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
++#else
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact;
++#endif
+ if (jsa->isOk())
+ {
+ ite->annotation().setF_act(UnicodeParsedString(jsa->getScript()));
+@@ -1185,14 +1259,22 @@ void SlaOutputDev::handleActions(PageItem* ite, AnnotWidget *ano)
+ ite->annotation().setFormat(5);
+ }
+ }
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ Aact.reset();
++#else
+ Aact = nullptr;
++#endif
+ }
+ Aact = SC_getAdditionalAction("K", ano);
+ if (Aact)
+ {
+ if (Aact->getKind() == actionJavaScript)
+ {
+- LinkJavaScript *jsa = (LinkJavaScript*)Aact;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
++#else
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact;
++#endif
+ if (jsa->isOk())
+ {
+ ite->annotation().setK_act(UnicodeParsedString(jsa->getScript()));
+@@ -1200,21 +1282,33 @@ void SlaOutputDev::handleActions(PageItem* ite, AnnotWidget *ano)
+ ite->annotation().setFormat(5);
+ }
+ }
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ Aact.reset();
++#else
+ Aact = nullptr;
++#endif
+ }
+ Aact = SC_getAdditionalAction("V", ano);
+ if (Aact)
+ {
+ if (Aact->getKind() == actionJavaScript)
+ {
+- LinkJavaScript *jsa = (LinkJavaScript*)Aact;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
++#else
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact;
++#endif
+ if (jsa->isOk())
+ {
+ ite->annotation().setV_act(UnicodeParsedString(jsa->getScript()));
+ ite->annotation().setAAact(true);
+ }
+ }
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ Aact.reset();
++#else
+ Aact = nullptr;
++#endif
+ }
+ }
+
+@@ -1224,6 +1318,11 @@ void SlaOutputDev::startDoc(PDFDoc *doc, XRef *xrefA, Catalog *catA)
+ catalog = catA;
+ pdfDoc = doc;
+ updateGUICounter = 0;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 84, 0)
++ m_fontEngine = new SplashFontEngine(true, true, true, true);
++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 61, 0)
++ m_fontEngine = new SplashFontEngine(globalParams->getEnableFreeType(), true, true, true);
++#else
+ m_fontEngine = new SplashFontEngine(
+ #if HAVE_T1LIB_H
+ globalParams->getEnableT1lib(),
+@@ -1234,6 +1333,7 @@ void SlaOutputDev::startDoc(PDFDoc *doc, XRef *xrefA, Catalog *catA)
+ true,
+ #endif
+ true);
++#endif
+ }
+
+ void SlaOutputDev::startPage(int pageNum, GfxState *, XRef *)
+@@ -2784,7 +2884,7 @@ void SlaOutputDev::drawMaskedImage(GfxState *state, Object *ref, Stream *str, i
+ delete[] mbuffer;
+ }
+
+-void SlaOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool interpolate, int *maskColors, GBool inlineImg)
++void SlaOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool interpolate, POPPLER_CONST_082 int* maskColors, GBool inlineImg)
+ {
+ ImageStream * imgStr = new ImageStream(str, width, colorMap->getNumPixelComps(), colorMap->getBits());
+ // qDebug() << "Image Components" << colorMap->getNumPixelComps() << "Mask" << maskColors;
+@@ -3365,7 +3465,7 @@ err1:
+ fontsrc->unref();
+ }
+
+-void SlaOutputDev::drawChar(GfxState *state, double x, double y, double dx, double dy, double originX, double originY, CharCode code, int nBytes, Unicode *u, int uLen)
++void SlaOutputDev::drawChar(GfxState *state, double x, double y, double dx, double dy, double originX, double originY, CharCode code, int nBytes, POPPLER_CONST_082 Unicode *u, int uLen)
+ {
+ double x1, y1, x2, y2;
+ int render;
+@@ -3452,7 +3552,7 @@ void SlaOutputDev::drawChar(GfxState *state, double x, double y, double dx, doub
+ }
+ }
+
+-GBool SlaOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, Unicode *u, int uLen)
++GBool SlaOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, POPPLER_CONST_082 Unicode *u, int uLen)
+ {
+ // qDebug() << "beginType3Char";
+ GfxFont *gfxFont;
+@@ -3705,7 +3805,7 @@ QString SlaOutputDev::getAnnotationColor(const AnnotColor *color)
+ return fNam;
+ }
+
+-QString SlaOutputDev::convertPath(GfxPath *path)
++QString SlaOutputDev::convertPath(POPPLER_CONST_083 GfxPath *path)
+ {
+ if (! path)
+ return QString();
+@@ -3715,7 +3815,7 @@ QString SlaOutputDev::convertPath(GfxPath *path)
+
+ for (int i = 0; i < path->getNumSubpaths(); ++i)
+ {
+- GfxSubpath * subpath = path->getSubpath(i);
++ POPPLER_CONST_083 GfxSubpath * subpath = path->getSubpath(i);
+ if (subpath->getNumPoints() > 0)
+ {
+ output += QString("M %1 %2").arg(subpath->getX(0)).arg(subpath->getY(0));
+@@ -3922,6 +4022,46 @@ QString SlaOutputDev::UnicodeParsedString(POPPLER_CONST GooString *s1)
+ return result;
+ }
+
++QString SlaOutputDev::UnicodeParsedString(const std::string& s1)
++{
++ if (s1.length() == 0)
++ return QString();
++ GBool isUnicode;
++ int i;
++ Unicode u;
++ QString result;
++ if ((s1.at(0) & 0xff) == 0xfe && (s1.length() > 1 && (s1.at(1) & 0xff) == 0xff))
++ {
++ isUnicode = gTrue;
++ i = 2;
++ result.reserve((s1.length() - 2) / 2);
++ }
++ else
++ {
++ isUnicode = gFalse;
++ i = 0;
++ result.reserve(s1.length());
++ }
++ while (i < s1.length())
++ {
++ if (isUnicode)
++ {
++ u = ((s1.at(i) & 0xff) << 8) | (s1.at(i+1) & 0xff);
++ i += 2;
++ }
++ else
++ {
++ u = s1.at(i) & 0xff;
++ ++i;
++ }
++ // #15616: imagemagick may write unicode strings incorrectly in PDF
++ if (u == 0)
++ continue;
++ result += QChar( u );
++ }
++ return result;
++}
++
+ bool SlaOutputDev::checkClip()
+ {
+ bool ret = false;
+diff --git a/scribus/plugins/import/pdf/slaoutput.h b/scribus/plugins/import/pdf/slaoutput.h
+--- a/scribus/plugins/import/pdf/slaoutput.h
++++ b/scribus/plugins/import/pdf/slaoutput.h
+@@ -20,6 +20,8 @@ for which a new license (GPL+exception) is in place.
+ #include <QTextStream>
+ #include <QTransform>
+
++#include <memory>
++
+ #include "fpointarray.h"
+ #include "importpdfconfig.h"
+ #include "pageitem.h"
+@@ -159,7 +161,11 @@ public:
+ virtual ~SlaOutputDev();
+
+ LinkAction* SC_getAction(AnnotWidget *ano);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ std::unique_ptr<LinkAction> SC_getAdditionalAction(const char *key, AnnotWidget *ano);
++#else
+ LinkAction* SC_getAdditionalAction(const char *key, AnnotWidget *ano);
++#endif
+ static GBool annotations_callback(Annot *annota, void *user_data);
+ bool handleTextAnnot(Annot* annota, double xCoor, double yCoor, double width, double height);
+ bool handleLinkAnnot(Annot* annota, double xCoor, double yCoor, double width, double height);
+@@ -229,7 +235,7 @@ public:
+
+ //----- image drawing
+ void drawImageMask(GfxState *state, Object *ref, Stream *str, int width, int height, GBool invert, GBool interpolate, GBool inlineImg) override;
+- void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool interpolate, int *maskColors, GBool inlineImg) override;
++ void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool interpolate, POPPLER_CONST_082 int *maskColors, GBool inlineImg) override;
+ void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
+ int width, int height,
+ GfxImageColorMap *colorMap,
+@@ -261,8 +267,8 @@ public:
+ //----- text drawing
+ void beginTextObject(GfxState *state) override;
+ void endTextObject(GfxState *state) override;
+- void drawChar(GfxState *state, double /*x*/, double /*y*/, double /*dx*/, double /*dy*/, double /*originX*/, double /*originY*/, CharCode /*code*/, int /*nBytes*/, Unicode * /*u*/, int /*uLen*/) override;
+- GBool beginType3Char(GfxState * /*state*/, double /*x*/, double /*y*/, double /*dx*/, double /*dy*/, CharCode /*code*/, Unicode * /*u*/, int /*uLen*/) override;
++ void drawChar(GfxState *state, double /*x*/, double /*y*/, double /*dx*/, double /*dy*/, double /*originX*/, double /*originY*/, CharCode /*code*/, int /*nBytes*/, POPPLER_CONST_082 Unicode * /*u*/, int /*uLen*/) override;
++ GBool beginType3Char(GfxState * /*state*/, double /*x*/, double /*y*/, double /*dx*/, double /*dy*/, CharCode /*code*/, POPPLER_CONST_082 Unicode * /*u*/, int /*uLen*/) override;
+ void endType3Char(GfxState * /*state*/) override;
+ void type3D0(GfxState * /*state*/, double /*wx*/, double /*wy*/) override;
+ void type3D1(GfxState * /*state*/, double /*wx*/, double /*wy*/, double /*llx*/, double /*lly*/, double /*urx*/, double /*ury*/) override;
+@@ -282,11 +288,12 @@ private:
+ void getPenState(GfxState *state);
+ QString getColor(GfxColorSpace *color_space, POPPLER_CONST_070 GfxColor *color, int *shade);
+ QString getAnnotationColor(const AnnotColor *color);
+- QString convertPath(GfxPath *path);
++ QString convertPath(POPPLER_CONST_083 GfxPath *path);
+ int getBlendMode(GfxState *state);
+ void applyMask(PageItem *ite);
+ void pushGroup(const QString& maskName = "", GBool forSoftMask = gFalse, GBool alpha = gFalse, bool inverted = false);
+ QString UnicodeParsedString(POPPLER_CONST GooString *s1);
++ QString UnicodeParsedString(const std::string& s1);
+ bool checkClip();
+ bool pathIsClosed;
+ QString CurrColorFill;
diff --git a/gnu/packages/patches/seahorse-gkr-use-0-on-empty-flags.patch b/gnu/packages/patches/seahorse-gkr-use-0-on-empty-flags.patch
deleted file mode 100644
index 55866d2973..0000000000
--- a/gnu/packages/patches/seahorse-gkr-use-0-on-empty-flags.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-Patch from <https://gitlab.gnome.org/GNOME/seahorse/commit/d9db29db567012b7c72e85e1be1fbf55fcc9b667>.
-
-From d9db29db567012b7c72e85e1be1fbf55fcc9b667 Mon Sep 17 00:00:00 2001
-From: Niels De Graef <nielsdegraef@gmail.com>
-Date: Sat, 11 May 2019 09:02:34 +0200
-Subject: [PATCH] gkr: Use 0 on empty flags
-
-A Flags-type variable without any flag set can be replaced with 0, so
-this is a safe thing to do. It also prevents us from having to deal with
-the accidental API break in libsecret (see
-https://gitlab.gnome.org/GNOME/libsecret/merge_requests/19)
----
- gkr/gkr-keyring-add.vala | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
-
-diff --git a/gkr/gkr-keyring-add.vala b/gkr/gkr-keyring-add.vala
-index 4e92a520..f60c9a22 100644
---- a/gkr/gkr-keyring-add.vala
-+++ b/gkr/gkr-keyring-add.vala
-@@ -41,8 +41,7 @@ public class Seahorse.Gkr.KeyringAdd : Gtk.Dialog {
-
- var cancellable = Dialog.begin_request(this);
- var service = Backend.instance().service;
-- Secret.Collection.create.begin(service, this.name_entry.text, null,
-- Secret.CollectionCreateFlags.COLLECTION_CREATE_NONE,
-+ Secret.Collection.create.begin(service, this.name_entry.text, null, 0,
- cancellable, (obj, res) => {
- /* Clear the operation without cancelling it since it is complete */
- Dialog.complete_request(this, false);
---
-2.23.0
-
diff --git a/gnu/packages/patches/shadow-hurd-pctrl.patch b/gnu/packages/patches/shadow-hurd-pctrl.patch
new file mode 100644
index 0000000000..2e376e19a9
--- /dev/null
+++ b/gnu/packages/patches/shadow-hurd-pctrl.patch
@@ -0,0 +1,16 @@
+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/swig-guile-gc.patch b/gnu/packages/patches/swig-guile-gc.patch
deleted file mode 100644
index 0e745a6247..0000000000
--- a/gnu/packages/patches/swig-guile-gc.patch
+++ /dev/null
@@ -1,76 +0,0 @@
-Fix garbage collection for Guile versions >= 2.0.12. This issue showed
-up when running the tests on i686-linux.
-
-Taken from this upstream commit:
-https://github.com/swig/swig/commit/38f2ab0c30e369e63bbd0a6152108488d0de68e1
-
-diff --git a/Lib/guile/guile_scm_run.swg b/Lib/guile/guile_scm_run.swg
-index 274f197158..0d04cb7c62 100644
---- a/Lib/guile/guile_scm_run.swg
-+++ b/Lib/guile/guile_scm_run.swg
-@@ -99,6 +99,7 @@ SWIG_Guile_scm2newstr(SCM str, size_t *len) {
- static int swig_initialized = 0;
- static scm_t_bits swig_tag = 0;
- static scm_t_bits swig_collectable_tag = 0;
-+static scm_t_bits swig_finalized_tag = 0;
- static scm_t_bits swig_destroyed_tag = 0;
- static scm_t_bits swig_member_function_tag = 0;
- static SCM swig_make_func = SCM_EOL;
-@@ -163,7 +164,19 @@ SWIG_Guile_PointerType(SCM object)
- }
- else scm_wrong_type_arg("SWIG-Guile-PointerType", 1, object);
- }
--
-+
-+SWIGINTERN int
-+SWIG_Guile_IsValidSmob(SCM smob)
-+{
-+ /* We do not accept smobs representing destroyed pointers, but we have to
-+ allow finalized smobs because Guile >= 2.0.12 sets all smob instances
-+ to the 'finalized' type before calling their 'free' function. This change
-+ was introduced to Guile in commit 8dff3af087c6eaa83ae0d72aa8b22aef5c65d65d */
-+ return SCM_SMOB_PREDICATE(swig_tag, smob)
-+ || SCM_SMOB_PREDICATE(swig_collectable_tag, smob)
-+ || SCM_SMOB_PREDICATE(swig_finalized_tag, smob);
-+}
-+
- SWIGINTERN int
- SWIG_Guile_ConvertPtr(SCM s, void **result, swig_type_info *type, int flags)
- {
-@@ -179,8 +192,7 @@ SWIG_Guile_ConvertPtr(SCM s, void **result, swig_type_info *type, int flags)
- *result = SCM_POINTER_VALUE(s);
- return SWIG_OK;
- #endif /* if SCM_MAJOR_VERSION >= 2 */
-- } else if (SCM_SMOB_PREDICATE(swig_tag, smob) || SCM_SMOB_PREDICATE(swig_collectable_tag, smob)) {
-- /* we do not accept smobs representing destroyed pointers */
-+ } else if (SWIG_Guile_IsValidSmob(smob)) {
- from = (swig_type_info *) SCM_CELL_WORD_2(smob);
- if (!from) return SWIG_ERROR;
- if (type) {
-@@ -239,7 +251,7 @@ SWIG_Guile_MarkPointerNoncollectable(SCM s)
- {
- SCM smob = SWIG_Guile_GetSmob(s);
- if (!SCM_NULLP(smob)) {
-- if (SCM_SMOB_PREDICATE(swig_tag, smob) || SCM_SMOB_PREDICATE(swig_collectable_tag, smob)) {
-+ if (SWIG_Guile_IsValidSmob(smob)) {
- SCM_SET_CELL_TYPE(smob, swig_tag);
- }
- else scm_wrong_type_arg(NULL, 0, s);
-@@ -252,7 +264,7 @@ SWIG_Guile_MarkPointerDestroyed(SCM s)
- {
- SCM smob = SWIG_Guile_GetSmob(s);
- if (!SCM_NULLP(smob)) {
-- if (SCM_SMOB_PREDICATE(swig_tag, smob) || SCM_SMOB_PREDICATE(swig_collectable_tag, smob)) {
-+ if (SWIG_Guile_IsValidSmob(smob)) {
- SCM_SET_CELL_TYPE(smob, swig_destroyed_tag);
- }
- else scm_wrong_type_arg(NULL, 0, s);
-@@ -419,6 +431,8 @@ SWIG_Guile_Init ()
- scm_set_smob_print(swig_collectable_tag, print_collectable_swig);
- scm_set_smob_equalp(swig_collectable_tag, equalp_swig);
- scm_set_smob_free(swig_collectable_tag, free_swig);
-+ /* For Guile >= 2.0.12. See libguile/smob.c:clear_smobnum */
-+ swig_finalized_tag = swig_collectable_tag & ~0xff00;
- }
- if (ensure_smob_tag(swig_module, &swig_destroyed_tag,
- "destroyed-swig-pointer", "destroyed-swig-pointer-tag")) {
diff --git a/gnu/packages/patches/tcl-fix-cross-compilation.patch b/gnu/packages/patches/tcl-fix-cross-compilation.patch
new file mode 100644
index 0000000000..00c36b8f27
--- /dev/null
+++ b/gnu/packages/patches/tcl-fix-cross-compilation.patch
@@ -0,0 +1,39 @@
+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 78444a1b2a..200867cb9b 100644
--- a/gnu/packages/patches/tcsh-fix-autotest.patch
+++ b/gnu/packages/patches/tcsh-fix-autotest.patch
@@ -63,38 +63,14 @@
AT_DATA([comment2.csh],
[[echo testing...@%:@\
-@@ -567,10 +567,10 @@ run=3
-# Adapt to changes in sed 4.3:
-# https://github.com/tcsh-org/tcsh/commit/2ad4fc1705893207598ed5cd21713ddf3f17bba0
- ]])
- AT_DATA([uniformity_test.csh],
- [[
--set SERVICE_NAME_LOG = `cat batchsystem.properties | grep '^jdbc_url' | sed -ne 's/^[^=]*=[^@]*@[:blank:]*\([^$]*\)$/\1/p' | perl -pe 's/\s//g' | perl -pe 's/\)/\\\)/g' | perl -pe 's/\(/\\\(/g'`
-+set SERVICE_NAME_LOG = `cat batchsystem.properties | grep '^jdbc_url' | sed -ne 's/^[^=]*=[^@]*@[[:blank:]]*\([^$]*\)$/\1/p' | perl -pe 's/\s//g' | perl -pe 's/\)/\\\)/g' | perl -pe 's/\(/\\\(/g'`
- echo -n "$SERVICE_NAME_LOG" > ./output1
-
--cat batchsystem.properties | grep '^jdbc_url' | sed -ne 's/^[^=]*=[^@]*@[:blank:]*\([^$]*\)$/\1/p' | perl -pe 's/\s//g' | perl -pe 's/\)/\\\)/g' | perl -pe 's/\(/\\\(/g' > ./output2
-+cat batchsystem.properties | grep '^jdbc_url' | sed -ne 's/^[^=]*=[^@]*@[[:blank:]]*\([^$]*\)$/\1/p' | perl -pe 's/\s//g' | perl -pe 's/\)/\\\)/g' | perl -pe 's/\(/\\\(/g' > ./output2
-
- diff -uprN ./output1 ./output2 >& /dev/null
-
-@@ -587,7 +587,7 @@ AT_DATA([quoting_result_test.csh],
- echo "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP\)(HOST=db\)(PORT=1521\)\)(CONNECT_DATA=(SERVER=DEDICATED\)(SERVICE_NAME=bns03\)\)\)" > ./expected_result
-
- set string = "jdbc_url=jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=db)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=bns03)))"
--set SERVICE_NAME_LOG = `echo "$string" | grep '^jdbc_url' | sed -ne 's/^[^=]*=[^@]*@[:blank:]*\([^$]*\)$/\1/p' | perl -pe 's/\)/\\\)/g'`
-+set SERVICE_NAME_LOG = `echo "$string" | grep '^jdbc_url' | sed -ne 's/^[^=]*=[^@]*@[[:blank:]]*\([^$]*\)$/\1/p' | perl -pe 's/\)/\\\)/g'`
-
- echo "$SERVICE_NAME_LOG" > ./actual_result
-
--- tests/subst.at
+++ tests/subst.at
-@@ -54,7 +54,7 @@ AT_CHECK([echo 'echo ~; echo "$HOME"' | tcsh -f | uniq | wc -l | tr -d ' \t'],
+@@ -54,7 +54,7 @@ AT_CHECK([export HOME=$(getent passwd $(id -un) | awk -F: '{ print $(NF - 1) }')
, [1
])
--AT_CHECK([echo "echo ~$(id -un)/foo; echo \"$HOME/foo\"" | tcsh -f | uniq dnl
-+AT_CHECK([echo "echo ~$(id -un)/foo; echo \"$HOME/foo\"" | tcsh -f | grep -v "/homeless-shelter" | 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
++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
])
@@ -110,21 +86,6 @@
]])
chmod a+x args.sh
AT_CHECK([tcsh -f listflags.csh], ,
-@@ -704,9 +705,9 @@ AT_CHECK([tcsh -f mail.csh], ,
-# This test fails by trying to change to the build user's home
-# directory, which does not exist.
- AT_CLEANUP
-
-
--AT_SETUP([$ cdtohome])
--AT_CHECK([tcsh -f -c 'cd'], 0)
--AT_CLEANUP
-+#AT_SETUP([$ cdtohome])
-+#AT_CHECK([tcsh -f -c 'cd'], 0)
-+#AT_CLEANUP
- AT_SETUP([$ noimplicithome])
- AT_CHECK([tcsh -f -c 'unset cdtohome; cd'], 1, , [cd: Too few arguments.
- ])
@@ -728,55 +729,57 @@ TCSH_UNTESTED([$ oid])
AT_SETUP([$ owd])
diff --git a/gnu/packages/patches/tcsh-fix-out-of-bounds-read.patch b/gnu/packages/patches/tcsh-fix-out-of-bounds-read.patch
deleted file mode 100644
index 48c294f78e..0000000000
--- a/gnu/packages/patches/tcsh-fix-out-of-bounds-read.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-Fix out-of-bounds read in c_substitute():
-
-http://seclists.org/oss-sec/2016/q4/612
-
-Patch copied from upstream source repository:
-
-https://github.com/tcsh-org/tcsh/commit/6a542dc4fb2ba26518a47e9b3a9bcd6a91b94596
-
-From 6a542dc4fb2ba26518a47e9b3a9bcd6a91b94596 Mon Sep 17 00:00:00 2001
-From: christos <christos>
-Date: Fri, 2 Dec 2016 16:59:28 +0000
-Subject: [PATCH] Fix out of bounds read (Brooks Davis) (reproduce by starting
- tcsh and hitting tab at the prompt)
-
----
- ed.chared.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/ed.chared.c b/ed.chared.c
-index 1277e53..310393e 100644
---- ed.chared.c
-+++ ed.chared.c
-@@ -750,7 +750,7 @@ c_substitute(void)
- /*
- * If we found a history character, go expand it.
- */
-- if (HIST != '\0' && *p == HIST)
-+ if (p >= InputBuf && HIST != '\0' && *p == HIST)
- nr_exp = c_excl(p);
- else
- nr_exp = 0;
diff --git a/gnu/packages/patches/telepathy-glib-channel-memory-leak.patch b/gnu/packages/patches/telepathy-glib-channel-memory-leak.patch
new file mode 100644
index 0000000000..fe07548ec0
--- /dev/null
+++ b/gnu/packages/patches/telepathy-glib-channel-memory-leak.patch
@@ -0,0 +1,19 @@
+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/texlive-bin-CVE-2018-17407.patch b/gnu/packages/patches/texlive-bin-CVE-2018-17407.patch
deleted file mode 100644
index 63646d420c..0000000000
--- a/gnu/packages/patches/texlive-bin-CVE-2018-17407.patch
+++ /dev/null
@@ -1,249 +0,0 @@
-This patch adds support for newer versions of Poppler and some upstream
-TexLive fixes, including one for CVE-2018-17407.
-
-It is taken from Linux From Scratch:
-<http://www.linuxfromscratch.org/patches/blfs/svn/texlive-20180414-source-upstream_fixes-3.patch>.
-
-Submitted By: Ken Moffat <ken at linuxfromscratch dot org>
-Date: 2018-12-26
-Initial Package Version: 20180414
-Upstream Status: Applied
-Origin: Upstream
-Description: Two fixes, cherry-picked from svn plus a CVE fix.
-I have removed the partial fixes for various system versions of poppler.
-
-r47469 Fix segfault in dvipdfm-x (XeTeX) on 1/2/4-bit transparent indexed PNGs.
-
-r47477 Fix a ptex regression for discontinuous kinsoku table.
-
-Also, via fedora (I got lost in svn) a critical fix for CVE-2018-17407
-
-"A buffer overflow in the handling of Type 1 fonts allows arbitrary code
-execution when a malicious font is loaded by one of the vulnerable tools:
-pdflatex, pdftex, dvips, or luatex."
-
-diff -Naur a/texk/dvipdfm-x/pngimage.c b/texk/dvipdfm-x/pngimage.c
---- a/texk/dvipdfm-x/pngimage.c 2018-02-17 08:41:35.000000000 +0000
-+++ b/texk/dvipdfm-x/pngimage.c 2018-10-09 01:52:01.648670875 +0100
-@@ -964,12 +964,16 @@
- png_bytep trans;
- int num_trans;
- png_uint_32 i;
-+ png_byte bpc, mask, shift;
-
- if (!png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS) ||
- !png_get_tRNS(png_ptr, info_ptr, &trans, &num_trans, NULL)) {
- WARN("%s: PNG does not have valid tRNS chunk but tRNS is requested.", PNG_DEBUG_STR);
- return NULL;
- }
-+ bpc = png_get_bit_depth(png_ptr, info_ptr);
-+ mask = 0xff >> (8 - bpc);
-+ shift = 8 - bpc;
-
- smask = pdf_new_stream(STREAM_COMPRESS);
- dict = pdf_stream_dict(smask);
-@@ -981,7 +985,8 @@
- pdf_add_dict(dict, pdf_new_name("ColorSpace"), pdf_new_name("DeviceGray"));
- pdf_add_dict(dict, pdf_new_name("BitsPerComponent"), pdf_new_number(8));
- for (i = 0; i < width*height; i++) {
-- png_byte idx = image_data_ptr[i];
-+ /* data is packed for 1/2/4 bpc formats, msb first */
-+ png_byte idx = (image_data_ptr[bpc * i / 8] >> (shift - bpc * i % 8)) & mask;
- smask_data_ptr[i] = (idx < num_trans) ? trans[idx] : 0xff;
- }
- pdf_add_stream(smask, (char *)smask_data_ptr, width*height);
-diff -Naur a/texk/dvipsk/writet1.c b/texk/dvipsk/writet1.c
---- a/texk/dvipsk/writet1.c 2016-11-25 18:24:26.000000000 +0000
-+++ b/texk/dvipsk/writet1.c 2018-10-09 01:52:01.648670875 +0100
-@@ -1449,7 +1449,9 @@
- *(strend(t1_buf_array) - 1) = ' ';
-
- t1_getline();
-+ alloc_array(t1_buf, strlen(t1_line_array) + strlen(t1_buf_array) + 1, T1_BUF_SIZE);
- strcat(t1_buf_array, t1_line_array);
-+ alloc_array(t1_line, strlen(t1_buf_array) + 1, T1_BUF_SIZE);
- strcpy(t1_line_array, t1_buf_array);
- t1_line_ptr = eol(t1_line_array);
- }
-diff -Naur a/texk/web2c/luatexdir/font/writet1.w b/texk/web2c/luatexdir/font/writet1.w
---- a/texk/web2c/luatexdir/font/writet1.w 2016-11-25 18:24:34.000000000 +0000
-+++ b/texk/web2c/luatexdir/font/writet1.w 2018-10-09 01:52:01.648670875 +0100
-@@ -1625,7 +1625,9 @@
- if (sscanf(p, "%i", &i) != 1) {
- strcpy(t1_buf_array, t1_line_array);
- t1_getline();
-+ alloc_array(t1_buf, strlen(t1_line_array) + strlen(t1_buf_array) + 1, T1_BUF_SIZE);
- strcat(t1_buf_array, t1_line_array);
-+ alloc_array(t1_line, strlen(t1_buf_array) + 1, T1_BUF_SIZE);
- strcpy(t1_line_array, t1_buf_array);
- t1_line_ptr = eol(t1_line_array);
- }
-diff -Naur a/texk/web2c/luatexdir/image/pdftoepdf.w b/texk/web2c/luatexdir/image/pdftoepdf.w
---- a/texk/web2c/luatexdir/image/pdftoepdf.w 2018-01-17 18:00:12.000000000 +0000
-+++ b/texk/web2c/luatexdir/image/pdftoepdf.w 2018-10-09 01:52:01.648670875 +0100
-@@ -472,10 +472,10 @@
- break;
- */
- case objString:
-- copyString(pdf, obj->getString());
-+ copyString(pdf, (GooString *)obj->getString());
- break;
- case objName:
-- copyName(pdf, obj->getName());
-+ copyName(pdf, (char *)obj->getName());
- break;
- case objNull:
- pdf_add_null(pdf);
-diff -Naur a/texk/web2c/luatexdir/lua/lepdflib.cc b/texk/web2c/luatexdir/lua/lepdflib.cc
---- a/texk/web2c/luatexdir/lua/lepdflib.cc 2018-02-14 14:44:38.000000000 +0000
-+++ b/texk/web2c/luatexdir/lua/lepdflib.cc 2018-10-09 01:52:01.649670868 +0100
-@@ -674,7 +674,7 @@
- uin = (udstruct *) luaL_checkudata(L, 1, M_##in); \
- if (uin->pd != NULL && uin->pd->pc != uin->pc) \
- pdfdoc_changed_error(L); \
-- gs = ((in *) uin->d)->function(); \
-+ gs = (GooString *)((in *) uin->d)->function(); \
- if (gs != NULL) \
- lua_pushlstring(L, gs->getCString(), gs->getLength()); \
- else \
-@@ -1813,7 +1813,7 @@
- if (uin->pd != NULL && uin->pd->pc != uin->pc)
- pdfdoc_changed_error(L);
- if (((Object *) uin->d)->isString()) {
-- gs = ((Object *) uin->d)->getString();
-+ gs = (GooString *)((Object *) uin->d)->getString();
- lua_pushlstring(L, gs->getCString(), gs->getLength());
- } else
- lua_pushnil(L);
-diff -Naur a/texk/web2c/pdftexdir/writet1.c b/texk/web2c/pdftexdir/writet1.c
---- a/texk/web2c/pdftexdir/writet1.c 2016-11-25 18:24:37.000000000 +0000
-+++ b/texk/web2c/pdftexdir/writet1.c 2018-10-09 01:52:01.649670868 +0100
-@@ -1598,7 +1598,9 @@
- *(strend(t1_buf_array) - 1) = ' ';
-
- t1_getline();
-+ alloc_array(t1_buf, strlen(t1_line_array) + strlen(t1_buf_array) + 1, T1_BUF_SIZE);
- strcat(t1_buf_array, t1_line_array);
-+ alloc_array(t1_line, strlen(t1_buf_array) + 1, T1_BUF_SIZE);
- strcpy(t1_line_array, t1_buf_array);
- t1_line_ptr = eol(t1_line_array);
- }
-diff -Naur a/texk/web2c/ptexdir/ptex_version.h b/texk/web2c/ptexdir/ptex_version.h
---- a/texk/web2c/ptexdir/ptex_version.h 2018-01-21 03:48:06.000000000 +0000
-+++ b/texk/web2c/ptexdir/ptex_version.h 2018-10-09 01:52:01.649670868 +0100
-@@ -1 +1 @@
--#define PTEX_VERSION "p3.8.0"
-+#define PTEX_VERSION "p3.8.1"
-diff -Naur a/texk/web2c/ptexdir/tests/free_ixsp.tex b/texk/web2c/ptexdir/tests/free_ixsp.tex
---- a/texk/web2c/ptexdir/tests/free_ixsp.tex 1970-01-01 01:00:00.000000000 +0100
-+++ b/texk/web2c/ptexdir/tests/free_ixsp.tex 2018-10-09 01:52:01.649670868 +0100
-@@ -0,0 +1,53 @@
-+%#!eptex -ini -etex
-+\let\dump\relax
-+\batchmode
-+\input plain
-+
-+\errorstopmode
-+\catcode`@=11
-+\newcount\@tempcnta
-+\newcount\@tempcntb
-+\newcount\@tempcntc
-+\mathchardef\LIM=256
-+
-+\def\MYCHAR#1{%
-+ \@tempcntc=\numexpr7*#1+"101\relax
-+ \@tempcnta=\@tempcntc\divide\@tempcnta 94
-+ \@tempcntb=\numexpr\@tempcntc-94*\@tempcnta+1\relax
-+ \ifnum\@tempcntb<0\advance\@tempcntb94 \advance\@tempcnta-1\fi
-+ \advance\@tempcnta18 % 18区以降
-+ \CNTA=\kuten\numexpr"100*\@tempcnta+\@tempcntb\relax
-+}
-+
-+\newcount\CNT\newcount\CNTA
-+\CNT=0
-+\loop
-+ \MYCHAR\CNT
-+ \message{\the\CNT.}
-+ \inhibitxspcode\CNTA=1\relax
-+ \advance\CNT1\relax
-+ \ifnum\CNT<\LIM
-+\repeat
-+
-+\newcount\CNTB
-+
-+\loop
-+ \MYCHAR\CNTB
-+ \global\inhibitxspcode\CNTA=3
-+{%
-+\CNT=0
-+\loop
-+ \MYCHAR\CNT
-+ \count@=\numexpr 1-\inhibitxspcode\CNTA\relax
-+ \ifnum\count@=0\else\ifnum\CNTB=\CNT\else
-+ \errmessage{<\the\CNTB, \the\CNT, \the\inhibitxspcode\CNTA>}\fi\fi
-+ \advance\CNT1\relax
-+ \ifnum\CNT<\LIM
-+\repeat
-+}
-+ \MYCHAR\CNTB
-+ \global\inhibitxspcode\CNTA=1\relax
-+ \advance\CNTB1\relax
-+ \ifnum\CNTB<\LIM
-+\repeat
-+\bye
-diff -Naur a/texk/web2c/ptexdir/tests/free_pena.tex b/texk/web2c/ptexdir/tests/free_pena.tex
---- a/texk/web2c/ptexdir/tests/free_pena.tex 1970-01-01 01:00:00.000000000 +0100
-+++ b/texk/web2c/ptexdir/tests/free_pena.tex 2018-10-09 01:52:01.649670868 +0100
-@@ -0,0 +1,52 @@
-+%#!eptex -ini -etex
-+\let\dump\relax
-+\batchmode
-+\input plain
-+
-+\errorstopmode
-+\catcode`@=11
-+\newcount\@tempcnta
-+\newcount\@tempcntb
-+\newcount\@tempcntc
-+\mathchardef\LIM=256
-+
-+\def\MYCHAR#1{%
-+ \@tempcntc=\numexpr7*#1+"101\relax
-+ \@tempcnta=\@tempcntc\divide\@tempcnta 94
-+ \@tempcntb=\numexpr\@tempcntc-94*\@tempcnta+1\relax
-+ \ifnum\@tempcntb<0\advance\@tempcntb94 \advance\@tempcnta-1\fi
-+ \advance\@tempcnta18 % 18区以降
-+ \CNTA=\kuten\numexpr"100*\@tempcnta+\@tempcntb\relax
-+}
-+
-+\newcount\CNT\newcount\CNTA
-+\CNT=0
-+\loop
-+ \MYCHAR\CNT
-+ \message{\the\CNT.}
-+ \prebreakpenalty\CNTA=\numexpr\CNT+1\relax
-+ \advance\CNT1\relax
-+ \ifnum\CNT<\LIM
-+\repeat
-+
-+\newcount\CNTB
-+
-+\loop
-+ \MYCHAR\CNTB
-+ \global\prebreakpenalty\CNTA=0
-+{%
-+\CNT=0
-+\loop
-+ \MYCHAR\CNT
-+ \count@=\numexpr -\CNT-1+\prebreakpenalty\CNTA\relax
-+ \ifnum\count@=0\else\ifnum\CNTB=\CNT\else\errmessage{<\the\CNTB, \the\CNT>}\fi\fi
-+ \advance\CNT1\relax
-+ \ifnum\CNT<\LIM
-+\repeat
-+}
-+ \MYCHAR\CNTB
-+ \global\prebreakpenalty\CNTA=\numexpr\CNTB+1\relax
-+ \advance\CNTB1\relax
-+ \ifnum\CNTB<\LIM
-+\repeat
-+\bye
diff --git a/gnu/packages/patches/texlive-bin-luatex-poppler-compat.patch b/gnu/packages/patches/texlive-bin-luatex-poppler-compat.patch
deleted file mode 100644
index 024ff416af..0000000000
--- a/gnu/packages/patches/texlive-bin-luatex-poppler-compat.patch
+++ /dev/null
@@ -1,293 +0,0 @@
-Fix LuaTeX compatibility with Poppler 0.75.
-
-Upstream LuaTeX have moved from Poppler to "pplib" and thus upstream
-fixes are unavailable. This is based on Archs patch, with minor
-tweaks to comply with texlive-bin-CVE-2018-17407.patch.
-https://git.archlinux.org/svntogit/packages.git/tree/trunk?h=packages/texlive-bin&id=418dd6f008c3d41a461353fdb60f2d73d87c58ed
-
-diff --git a/texk/web2c/luatexdir/image/pdftoepdf.w b/texk/web2c/luatexdir/image/pdftoepdf.w
---- a/texk/web2c/luatexdir/image/pdftoepdf.w
-+++ b/texk/web2c/luatexdir/image/pdftoepdf.w
-@@ -363,7 +363,7 @@ void copyReal(PDF pdf, double d)
-
- static void copyString(PDF pdf, GooString * string)
- {
-- char *p;
-+ const char *p;
- unsigned char c;
- size_t i, l;
- p = string->getCString();
-@@ -393,7 +393,7 @@ static void copyString(PDF pdf, GooString * string)
- pdf->cave = true;
- }
-
--static void copyName(PDF pdf, char *s)
-+static void copyName(PDF pdf, const char *s)
- {
- pdf_out(pdf, '/');
- for (; *s != 0; s++) {
-@@ -412,7 +412,7 @@ static void copyArray(PDF pdf, PdfDocument * pdf_doc, Array * array)
- Object obj1;
- pdf_begin_array(pdf);
- for (i = 0, l = array->getLength(); i < l; ++i) {
-- obj1 = array->getNF(i);
-+ obj1 = array->getNF(i).copy();
- copyObject(pdf, pdf_doc, &obj1);
- }
- pdf_end_array(pdf);
-@@ -425,7 +425,7 @@ static void copyDict(PDF pdf, PdfDocument * pdf_doc, Dict * dict)
- pdf_begin_dict(pdf);
- for (i = 0, l = dict->getLength(); i < l; ++i) {
- copyName(pdf, dict->getKey(i));
-- obj1 = dict->getValNF(i);
-+ obj1 = dict->getValNF(i).copy();
- copyObject(pdf, pdf_doc, &obj1);
- }
- pdf_end_dict(pdf);
-@@ -475,7 +475,7 @@ static void copyObject(PDF pdf, PdfDocument * pdf_doc, Object * obj)
- copyString(pdf, (GooString *)obj->getString());
- break;
- case objName:
-- copyName(pdf, (char *)obj->getName());
-+ copyName(pdf, obj->getName());
- break;
- case objNull:
- pdf_add_null(pdf);
-@@ -531,22 +531,22 @@ static PDFRectangle *get_pagebox(Page * page, int pagebox_spec)
- {
- switch (pagebox_spec) {
- case PDF_BOX_SPEC_MEDIA:
-- return page->getMediaBox();
-+ return (PDFRectangle *) page->getMediaBox();
- break;
- case PDF_BOX_SPEC_CROP:
-- return page->getCropBox();
-+ return (PDFRectangle *) page->getCropBox();
- break;
- case PDF_BOX_SPEC_BLEED:
-- return page->getBleedBox();
-+ return (PDFRectangle *) page->getBleedBox();
- break;
- case PDF_BOX_SPEC_TRIM:
-- return page->getTrimBox();
-+ return (PDFRectangle *) page->getTrimBox();
- break;
- case PDF_BOX_SPEC_ART:
-- return page->getArtBox();
-+ return (PDFRectangle *) page->getArtBox();
- break;
- default:
-- return page->getMediaBox();
-+ return (PDFRectangle *) page->getMediaBox();
- break;
- }
- }
-@@ -788,12 +788,12 @@ void write_epdf(PDF pdf, image_dict * idict, int suppress_optional_info)
- Now all relevant parts of the Page dictionary are copied. Metadata validity
- check is needed(as a stream it must be indirect).
- */
-- obj1 = pageDict->lookupNF("Metadata");
-+ obj1 = pageDict->lookupNF("Metadata").copy();
- if (!obj1.isNull() && !obj1.isRef())
- formatted_warning("pdf inclusion","/Metadata must be indirect object");
- /* copy selected items in Page dictionary */
- for (i = 0; pagedictkeys[i] != NULL; i++) {
-- obj1 = pageDict->lookupNF(pagedictkeys[i]);
-+ obj1 = pageDict->lookupNF(pagedictkeys[i]).copy();
- if (!obj1.isNull()) {
- pdf_add_name(pdf, pagedictkeys[i]);
- /* preserves indirection */
-@@ -806,13 +806,13 @@ void write_epdf(PDF pdf, image_dict * idict, int suppress_optional_info)
- PDF file, climbing up the tree until the Resources are found.
- (This fixes a problem with Scribus 1.3.3.14.)
- */
-- obj1 = pageDict->lookupNF("Resources");
-+ obj1 = pageDict->lookupNF("Resources").copy();
- if (obj1.isNull()) {
- op1 = &pagesobj1;
- op2 = &pagesobj2;
- *op1 = pageDict->lookup("Parent");
- while (op1->isDict()) {
-- obj1 = op1->dictLookupNF("Resources");
-+ obj1 = op1->dictLookupNF("Resources").copy();
- if (!obj1.isNull()) {
- pdf_add_name(pdf, "Resources");
- copyObject(pdf, pdf_doc, &obj1);
-diff --git a/texk/web2c/luatexdir/lua/lepdflib.cc b/texk/web2c/luatexdir/lua/lepdflib.cc
---- a/texk/web2c/luatexdir/lua/lepdflib.cc
-+++ b/texk/web2c/luatexdir/lua/lepdflib.cc
-@@ -240,7 +240,7 @@ static int l_new_Attribute(lua_State * L)
- if (uobj->pd != NULL && uobj->pd->pc != uobj->pc)
- pdfdoc_changed_error(L);
- uout = new_Attribute_userdata(L);
-- uout->d = new Attribute(n, nlen, (Object *)uobj->d);
-+ uout->d = new Attribute((GooString)n, (Object *)uobj->d);
- uout->atype = ALLOC_LEPDF;
- uout->pc = uobj->pc;
- uout->pd = uobj->pd;
-@@ -496,7 +496,7 @@ static int l_new_Object(lua_State * L)
- double numA = lua_tonumber(L,1);
- double genA = lua_tonumber(L,2);
- if ( ((numA)==(int)(numA)) && ((genA)==(int)(genA)) ){
-- uout->d = new Object((int)(numA), (int)(genA));
-+ uout->d = new Object({(int)(numA), (int)(genA)});
- uout->atype = ALLOC_LEPDF;
- uout->pc = 0;
- uout->pd = NULL;
-@@ -596,7 +596,7 @@ static int m_##in##_##function(lua_State * L) \
- uin = (udstruct *) luaL_checkudata(L, 1, M_##in); \
- if (uin->pd != NULL && uin->pd->pc != uin->pc) \
- pdfdoc_changed_error(L); \
-- o = ((in *) uin->d)->function(); \
-+ o = (out *) ((in *) uin->d)->function(); \
- if (o != NULL) { \
- uout = new_##out##_userdata(L); \
- uout->d = o; \
-@@ -889,7 +889,7 @@ static int m_Array_getNF(lua_State * L)
- if (i > 0 && i <= len) {
- uout = new_Object_userdata(L);
- uout->d = new Object();
-- *((Object *) uout->d) = ((Array *) uin->d)->getNF(i - 1);
-+ *((Object *) uout->d) = ((Array *) uin->d)->getNF(i - 1).copy();
- uout->atype = ALLOC_LEPDF;
- uout->pc = uin->pc;
- uout->pd = uin->pd;
-@@ -1125,12 +1125,12 @@ m_poppler_get_INT(Dict, getLength);
-
- static int m_Dict_add(lua_State * L)
- {
-- char *s;
-+ const char *s;
- udstruct *uin, *uobj;
- uin = (udstruct *) luaL_checkudata(L, 1, M_Dict);
- if (uin->pd != NULL && uin->pd->pc != uin->pc)
- pdfdoc_changed_error(L);
-- s = copyString(luaL_checkstring(L, 2));
-+ s = luaL_checkstring(L, 2);
- uobj = (udstruct *) luaL_checkudata(L, 3, M_Object);
- ((Dict *) uin->d)->add(s, std::move(*((Object *) uobj->d)));
- return 0;
-@@ -1190,7 +1190,7 @@ static int m_Dict_lookupNF(lua_State * L)
- s = luaL_checkstring(L, 2);
- uout = new_Object_userdata(L);
- uout->d = new Object();
-- *((Object *) uout->d) = ((Dict *) uin->d)->lookupNF(s);
-+ *((Object *) uout->d) = ((Dict *) uin->d)->lookupNF(s).copy();
- uout->atype = ALLOC_LEPDF;
- uout->pc = uin->pc;
- uout->pd = uin->pd;
-@@ -1263,7 +1263,7 @@ static int m_Dict_getValNF(lua_State * L)
- if (i > 0 && i <= len) {
- uout = new_Object_userdata(L);
- uout->d = new Object();
-- *((Object *) uout->d) = ((Dict *) uin->d)->getValNF(i - 1);
-+ *((Object *) uout->d) = ((Dict *) uin->d)->getValNF(i - 1).copy();
- uout->atype = ALLOC_LEPDF;
- uout->pc = uin->pc;
- uout->pd = uin->pd;
-@@ -1653,7 +1653,7 @@ static int m_Object_initRef(lua_State * L)
- pdfdoc_changed_error(L);
- num = luaL_checkint(L, 2);
- gen = luaL_checkint(L, 3);
-- *((Object *) uin->d) = Object(num, gen);
-+ *((Object *) uin->d) = Object({num, gen});
- return 0;
- }
-
-@@ -2011,7 +2011,7 @@ static int m_Object_arrayGetNF(lua_State * L)
- if (i > 0 && i <= len) {
- uout = new_Object_userdata(L);
- uout->d = new Object();
-- *((Object *) uout->d) = ((Object *) uin->d)->arrayGetNF(i - 1);
-+ *((Object *) uout->d) = ((Object *) uin->d)->arrayGetNF(i - 1).copy();
- uout->atype = ALLOC_LEPDF;
- uout->pc = uin->pc;
- uout->pd = uin->pd;
-@@ -2051,7 +2051,7 @@ static int m_Object_dictAdd(lua_State * L)
- pdfdoc_changed_error(L);
- if (!((Object *) uin->d)->isDict())
- luaL_error(L, "Object is not a Dict");
-- ((Object *) uin->d)->dictAdd(copyString(s), std::move(*((Object *) uobj->d)));
-+ ((Object *) uin->d)->dictAdd(s, std::move(*((Object *) uobj->d)));
- return 0;
- }
-
-@@ -2104,7 +2104,7 @@ static int m_Object_dictLookupNF(lua_State * L)
- if (((Object *) uin->d)->isDict()) {
- uout = new_Object_userdata(L);
- uout->d = new Object();
-- *((Object *) uout->d) = ((Object *) uin->d)->dictLookupNF(s);
-+ *((Object *) uout->d) = ((Object *) uin->d)->dictLookupNF(s).copy();
- uout->atype = ALLOC_LEPDF;
- uout->pc = uin->pc;
- uout->pd = uin->pd;
-@@ -2169,7 +2169,7 @@ static int m_Object_dictGetValNF(lua_State * L)
- if (i > 0 && i <= len) {
- uout = new_Object_userdata(L);
- uout->d = new Object();
-- *((Object *) uout->d) = ((Object *) uin->d)->dictGetValNF(i - 1);
-+ *((Object *) uout->d) = ((Object *) uin->d)->dictGetValNF(i - 1).copy();
- uout->atype = ALLOC_LEPDF;
- uout->pc = uin->pc;
- uout->pd = uin->pd;
-@@ -2470,7 +2470,7 @@ static int m_PDFDoc_getFileName(lua_State * L)
- uin = (udstruct *) luaL_checkudata(L, 1, M_PDFDoc);
- if (uin->pd != NULL && uin->pd->pc != uin->pc)
- pdfdoc_changed_error(L);
-- gs = ((PdfDocument *) uin->d)->doc->getFileName();
-+ gs = (GooString *) ((PdfDocument *) uin->d)->doc->getFileName();
- if (gs != NULL)
- lua_pushlstring(L, gs->getCString(), gs->getLength());
- else
-@@ -2559,7 +2559,7 @@ static int m_PDFDoc_readMetadata(lua_State * L)
- if (uin->pd != NULL && uin->pd->pc != uin->pc)
- pdfdoc_changed_error(L);
- if (((PdfDocument *) uin->d)->doc->getCatalog()->isOk()) {
-- gs = ((PdfDocument *) uin->d)->doc->readMetadata();
-+ gs = (GooString *) ((PdfDocument *) uin->d)->doc->readMetadata();
- if (gs != NULL)
- lua_pushlstring(L, gs->getCString(), gs->getLength());
- else
-@@ -2577,7 +2577,7 @@ static int m_PDFDoc_getStructTreeRoot(lua_State * L)
- if (uin->pd != NULL && uin->pd->pc != uin->pc)
- pdfdoc_changed_error(L);
- if (((PdfDocument *) uin->d)->doc->getCatalog()->isOk()) {
-- obj = ((PdfDocument *) uin->d)->doc->getStructTreeRoot();
-+ obj = (StructTreeRoot *) ((PdfDocument *) uin->d)->doc->getStructTreeRoot();
- uout = new_StructTreeRoot_userdata(L);
- uout->d = obj;
- uout->pc = uin->pc;
---- texlive-source/texk/web2c/luatexdir/lua/lepdflib.cc.orig 2019-04-24 09:41:05.090522664 +0000
-+++ texlive-source/texk/web2c/luatexdir/lua/lepdflib.cc 2019-04-24 09:43:37.119184926 +0000
-@@ -994,7 +994,8 @@
- pdfdoc_changed_error(L);
- num = luaL_checkint(L, 2);
- gen = luaL_checkint(L, 3);
-- i = ((Catalog *) uin->d)->findPage(num, gen);
-+ Ref numgen = {num, gen};
-+ i = ((Catalog *) uin->d)->findPage(numgen);
- if (i > 0)
- lua_pushinteger(L, i);
- else
-@@ -2596,8 +2597,9 @@
- pdfdoc_changed_error(L);
- num = luaL_checkint(L, 2);
- gen = luaL_checkint(L, 3);
-+ Ref numgen = {num, gen};
- if (((PdfDocument *) uin->d)->doc->getCatalog()->isOk()) {
-- i = ((PdfDocument *) uin->d)->doc->findPage(num, gen);
-+ i = ((PdfDocument *) uin->d)->doc->findPage(numgen);
- if (i > 0)
- lua_pushinteger(L, i);
- else
---- texlive-source/texk/web2c/luatexdir/image/pdftoepdf.w.orig 2019-04-24 09:56:38.406498975 +0000
-+++ texlive-source/texk/web2c/luatexdir/image/pdftoepdf.w 2019-04-24 09:56:57.020081327 +0000
-@@ -630,7 +630,7 @@
- if (link == NULL || !link->isOk())
- formatted_error("pdf inclusion","invalid destination '%s'",img_pagename(idict));
- Ref ref = link->getPageRef();
-- img_pagenum(idict) = catalog->findPage(ref.num, ref.gen);
-+ img_pagenum(idict) = catalog->findPage(ref);
- if (img_pagenum(idict) == 0)
- formatted_error("pdf inclusion","destination is not a page '%s'",img_pagename(idict));
- delete link;
diff --git a/gnu/packages/patches/texlive-bin-poppler-0.83.patch b/gnu/packages/patches/texlive-bin-poppler-0.83.patch
new file mode 100644
index 0000000000..5e57e3efac
--- /dev/null
+++ b/gnu/packages/patches/texlive-bin-poppler-0.83.patch
@@ -0,0 +1,52 @@
+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
new file mode 100644
index 0000000000..b1adca657b
--- /dev/null
+++ b/gnu/packages/patches/texlive-bin-poppler-0.86.patch
@@ -0,0 +1,17 @@
+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/twinkle-bcg729.patch b/gnu/packages/patches/twinkle-bcg729.patch
new file mode 100644
index 0000000000..eb8667b679
--- /dev/null
+++ b/gnu/packages/patches/twinkle-bcg729.patch
@@ -0,0 +1,176 @@
+From 46bee14d3cc49d4fb49eaf36a29dbcc7a11a5ab7 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Bri=C3=A8re?= <fbriere@fbriere.net>
+Date: Sat, 6 Jul 2019 15:40:56 -0400
+Subject: [PATCH] Add support for the new bcg729 API, introduced in version
+ 1.0.2
+
+Starting with version 1.0.2, bcg729 has changed its API to add support
+for G.729B, thus requiring us to adjust our function calls depending on
+which version is installed.
+
+When dealing with the new API, we merely need to add a few parameters to
+disable all G.729B features, namely:
+
+* On the decoder side: When `SIDFrameFlag` is not set, the decoder will
+ behave just like before, decoding the payload as a standard G.729A
+ voice frame (or concealing an erased frame). The other parameters,
+ `rfc3389PayloadFlag` and `bitStreamLength`, are only of use when
+ dealing with a SID frame sent as per RFC 3389, and are ignored if
+ `SIDFrameFlag` is not set.
+
+* On the encoder side: When `enableVAD` is disabled, the encoder will
+ behave just like before, producing only standard G.729A voice frames.
+ The only API difference is the introduction of `*bitStreamLength`, to
+ return the length of the encoded frame (0, 2 or 10 bytes). In our
+ case, this will always be 10 bytes just like before; an assert() was
+ added to guarantee this.
+
+Closes #104
+---
+ CMakeLists.txt | 4 ++++
+ cmake/FindG729.cmake | 36 ++++++++++++++++++++++++++++++++++++
+ src/audio/audio_decoder.cpp | 8 ++++++++
+ src/audio/audio_encoder.cpp | 10 ++++++++++
+ twinkle_config.h.in | 1 +
+ 5 files changed, 59 insertions(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 1dafe55..7e3fde0 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -116,6 +116,10 @@ if (WITH_G729)
+ if (G729_FOUND)
+ message(STATUS "bcg729 OK")
+ set(HAVE_BCG729 TRUE)
++
++ if (G729_ANNEX_B)
++ set(HAVE_BCG729_ANNEX_B TRUE)
++ endif (G729_ANNEX_B)
+
+ include_directories(${G729_INCLUDE_DIR})
+ else (G729_FOUND)
+diff --git a/cmake/FindG729.cmake b/cmake/FindG729.cmake
+index 4a30ba0..1fbfeeb 100644
+--- a/cmake/FindG729.cmake
++++ b/cmake/FindG729.cmake
+@@ -1,14 +1,50 @@
++INCLUDE(CMakePushCheckState)
++INCLUDE(CheckCSourceCompiles)
++
+ FIND_PATH(G729_INCLUDE_DIR bcg729/decoder.h)
+ FIND_LIBRARY(G729_LIBRARY NAMES bcg729)
+
+ IF(G729_INCLUDE_DIR AND G729_LIBRARY)
+ SET(G729_FOUND TRUE)
++
++ # The bcg729 API was changed in 1.0.2 to add support for G.729 Annex B.
++ # This checks whether we are dealing with the old or new API.
++ CMAKE_PUSH_CHECK_STATE()
++ SET(CMAKE_REQUIRED_INCLUDES "${INCLUDE_DIRECTORIES}" "${G729_INCLUDE_DIR}")
++ SET(CMAKE_REQUIRED_LIBRARIES "${G729_LIBRARY}")
++ SET(CMAKE_REQUIRED_QUIET TRUE)
++ # Try to compile something using the old (pre-1.0.2) API.
++ #
++ # We cannot do it the other way around, as initBcg729EncoderChannel()
++ # did not have a prototype before 1.0.2, thus compilation would not fail
++ # when passing it an extra argument.
++ CHECK_C_SOURCE_COMPILES("
++ #include <bcg729/encoder.h>
++
++ int main() {
++ /* This function requires an argument since 1.0.2 */
++ initBcg729EncoderChannel();
++ return 0;
++ }
++ " G729_OLD_API)
++ CMAKE_POP_CHECK_STATE()
++
++ IF (G729_OLD_API)
++ SET(G729_ANNEX_B FALSE)
++ ELSE (G729_OLD_API)
++ SET(G729_ANNEX_B TRUE)
++ ENDIF (G729_OLD_API)
+ ENDIF(G729_INCLUDE_DIR AND G729_LIBRARY)
+
+ IF(G729_FOUND)
+ IF (NOT G729_FIND_QUIETLY)
+ MESSAGE(STATUS "Found bcg729 includes: ${G729_INCLUDE_DIR}/bcg729/decoder.h")
+ MESSAGE(STATUS "Found bcg729 library: ${G729_LIBRARY}")
++ IF (G729_ANNEX_B)
++ MESSAGE(STATUS "bcg729 supports Annex B; using the new (1.0.2) API")
++ ELSE (G729_ANNEX_B)
++ MESSAGE(STATUS "bcg729 does not support Annex B; using the old (pre-1.0.2) API")
++ ENDIF (G729_ANNEX_B)
+ ENDIF (NOT G729_FIND_QUIETLY)
+ ELSE(G729_FOUND)
+ IF (G729_FIND_REQUIRED)
+diff --git a/src/audio/audio_decoder.cpp b/src/audio/audio_decoder.cpp
+index 65935dd..c661910 100644
+--- a/src/audio/audio_decoder.cpp
++++ b/src/audio/audio_decoder.cpp
+@@ -547,7 +547,11 @@ uint16 t_g729a_audio_decoder::decode(uint8 *payload, uint16 payload_size,
+
+ for (uint16 done = 0; done < payload_size; done += 10)
+ {
++#ifdef HAVE_BCG729_ANNEX_B
++ bcg729Decoder(_context, &payload[done], 0, false, false, false, &pcm_buf[done * 8]);
++#else
+ bcg729Decoder(_context, &payload[done], false, &pcm_buf[done * 8]);
++#endif
+ }
+
+ return payload_size * 8;
+@@ -562,7 +566,11 @@ uint16 t_g729a_audio_decoder::conceal(int16 *pcm_buf, uint16 pcm_buf_size)
+ {
+ assert(pcm_buf_size >= 80);
+
++#ifdef HAVE_BCG729_ANNEX_B
++ bcg729Decoder(_context, nullptr, 0, true, false, false, pcm_buf);
++#else
+ bcg729Decoder(_context, nullptr, true, pcm_buf);
++#endif
+ return 80;
+ }
+
+diff --git a/src/audio/audio_encoder.cpp b/src/audio/audio_encoder.cpp
+index d6ff356..952b1ee 100644
+--- a/src/audio/audio_encoder.cpp
++++ b/src/audio/audio_encoder.cpp
+@@ -433,7 +433,11 @@ uint16 t_g726_audio_encoder::encode(int16 *sample_buf, uint16 nsamples,
+ t_g729a_audio_encoder::t_g729a_audio_encoder(uint16 payload_id, uint16 ptime, t_user *user_config)
+ : t_audio_encoder(payload_id, ptime, user_config)
+ {
++#ifdef HAVE_BCG729_ANNEX_B
++ _context = initBcg729EncoderChannel(false);
++#else
+ _context = initBcg729EncoderChannel();
++#endif
+ }
+
+ t_g729a_audio_encoder::~t_g729a_audio_encoder()
+@@ -451,7 +455,13 @@ uint16 t_g729a_audio_encoder::encode(int16 *sample_buf, uint16 nsamples,
+
+ for (uint16 done = 0; done < nsamples; done += 80)
+ {
++#ifdef HAVE_BCG729_ANNEX_B
++ uint8 frame_size = 10;
++ bcg729Encoder(_context, &sample_buf[done], &payload[done / 8], &frame_size);
++ assert(frame_size == 10);
++#else
+ bcg729Encoder(_context, &sample_buf[done], &payload[done / 8]);
++#endif
+ }
+
+ return nsamples / 8;
+diff --git a/twinkle_config.h.in b/twinkle_config.h.in
+index a1aa3b4..53a0426 100644
+--- a/twinkle_config.h.in
++++ b/twinkle_config.h.in
+@@ -4,6 +4,7 @@
+ #cmakedefine HAVE_ILBC_CPP
+ #cmakedefine HAVE_ZRTP
+ #cmakedefine HAVE_BCG729
++#cmakedefine HAVE_BCG729_ANNEX_B
+ #cmakedefine HAVE_GSM
+
+ #cmakedefine HAVE_UNISTD_H
diff --git a/gnu/packages/patches/vigra-python-compat.patch b/gnu/packages/patches/vigra-python-compat.patch
new file mode 100644
index 0000000000..63c6abb326
--- /dev/null
+++ b/gnu/packages/patches/vigra-python-compat.patch
@@ -0,0 +1,18 @@
+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/vlc-fix-test_libvlc_slaves.patch b/gnu/packages/patches/vlc-fix-test_libvlc_slaves.patch
deleted file mode 100644
index 9bc6d35f18..0000000000
--- a/gnu/packages/patches/vlc-fix-test_libvlc_slaves.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 4186c94104ee528abd6860611b49515f3e6ec644 Mon Sep 17 00:00:00 2001
-From: Thomas Guillem <thomas@gllm.fr>
-Date: Fri, 18 Oct 2019 10:34:07 +0200
-Subject: [PATCH] input/item: sort before attaching slaves
-
-The order of readdir() is completely filesystem dependent.
-
-Slaves should be attached using the same order across multiple OSses/access
-modules.
-
-This fixes the test_libvlc_slaves on some system when the entry order from
-readdir() is different.
-
-This patch need to be backported to VLC 3.0.
----
- src/input/item.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/input/item.c b/src/input/item.c
-index e8db39ca28..fbd74cc95f 100644
---- a/src/input/item.c
-+++ b/src/input/item.c
-@@ -1809,8 +1809,8 @@ void vlc_readdir_helper_finish(struct vlc_readdir_helper *p_rdh, bool b_success)
- {
- if (b_success)
- {
-- rdh_attach_slaves(p_rdh, p_rdh->p_node);
- rdh_sort(p_rdh->p_node);
-+ rdh_attach_slaves(p_rdh, p_rdh->p_node);
- }
- free(p_rdh->psz_ignored_exts);
-
---
-2.20.1
-
diff --git a/gnu/packages/patches/warsow-qfusion-fix-bool-return-type.patch b/gnu/packages/patches/warsow-qfusion-fix-bool-return-type.patch
new file mode 100644
index 0000000000..ec22377446
--- /dev/null
+++ b/gnu/packages/patches/warsow-qfusion-fix-bool-return-type.patch
@@ -0,0 +1,22 @@
+diff --git a/source/ref_gl/r_imagelib.cpp b/source/ref_gl/r_imagelib.cpp
+index 418028a..f76916b 100644
+--- a/source/ref_gl/r_imagelib.cpp
++++ b/source/ref_gl/r_imagelib.cpp
+@@ -762,7 +762,7 @@ static void q_jpg_noop( j_decompress_ptr cinfo ) {
+
+ static boolean q_jpg_fill_input_buffer( j_decompress_ptr cinfo ) {
+ Com_DPrintf( "Premature end of jpeg file\n" );
+- return 1;
++ return TRUE;
+ }
+
+ static void q_jpg_skip_input_data( j_decompress_ptr cinfo, long num_bytes ) {
+@@ -955,7 +955,7 @@ bool WriteJPG( const char *name, r_imginfo_t *info, int quality ) {
+ }
+
+ // start compression
+- qjpeg_start_compress( &cinfo, true );
++ qjpeg_start_compress( &cinfo, TRUE );
+
+ // feed scanline data
+ w3 = cinfo.image_width * info->samples;
diff --git a/gnu/packages/patches/webkitgtk-share-store.patch b/gnu/packages/patches/webkitgtk-share-store.patch
new file mode 100644
index 0000000000..053d86fcf4
--- /dev/null
+++ b/gnu/packages/patches/webkitgtk-share-store.patch
@@ -0,0 +1,19 @@
+Tell bubblewrap to share the store. Required for programs that use the
+sandboxing features such as Epiphany.
+
+See <https://bugs.gnu.org/40837>.
+Author: Jack Hill <jackhill@jackhill.us>
+---
+diff --git a/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp b/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp
+--- a/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp
++++ b/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp
+@@ -737,6 +737,9 @@ GRefPtr<GSubprocess> bubblewrapSpawn(GSubprocessLauncher* launcher, const Proces
+ "--ro-bind-try", "/usr/local/share", "/usr/local/share",
+ "--ro-bind-try", DATADIR, DATADIR,
+
++ // Bind mount the store inside the WebKitGTK sandbox.
++ "--ro-bind", "@storedir@", "@storedir@",
++
+ // We only grant access to the libdirs webkit is built with and
+ // guess system libdirs. This will always have some edge cases.
+ "--ro-bind-try", "/lib", "/lib",