summary refs log tree commit diff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/aspell-default-dict-dir.patch24
-rw-r--r--gnu/packages/patches/aspell-gcc-compat.patch31
-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/cmake-curl-certificates.patch10
-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/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/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/fribidi-CVE-2019-18397.patch26
-rw-r--r--gnu/packages/patches/ghostscript-CVE-2019-14869.patch48
-rw-r--r--gnu/packages/patches/ghostscript-no-header-id.patch14
-rw-r--r--gnu/packages/patches/giflib-make-reallocarray-private.patch120
-rw-r--r--gnu/packages/patches/glibc-CVE-2019-19126.patch22
-rw-r--r--gnu/packages/patches/gsl-test-i686.patch17
-rw-r--r--gnu/packages/patches/guile-sqlite3-fix-cross-compilation.patch55
-rw-r--r--gnu/packages/patches/libffi-3.2.1-complex-alpha.patch28
-rw-r--r--gnu/packages/patches/libjpeg-turbo-CVE-2019-2201.patch31
-rw-r--r--gnu/packages/patches/libxslt-generated-ids.patch6
-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/pango-skip-libthai-test.patch23
-rw-r--r--gnu/packages/patches/python-2.7-search-paths.patch10
-rw-r--r--gnu/packages/patches/python-3-search-paths.patch21
-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/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/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/vigra-python-compat.patch18
-rw-r--r--gnu/packages/patches/webkitgtk-icu-65.patch47
42 files changed, 957 insertions, 1266 deletions
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/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/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/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/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/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/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/ghostscript-CVE-2019-14869.patch b/gnu/packages/patches/ghostscript-CVE-2019-14869.patch
new file mode 100644
index 0000000000..d80fba0594
--- /dev/null
+++ b/gnu/packages/patches/ghostscript-CVE-2019-14869.patch
@@ -0,0 +1,48 @@
+Fix CVE-2019-14869:
+
+https://nvd.nist.gov/vuln/detail/CVE-2019-14869
+
+Patch taken from upstream:
+
+https://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=485904772c5f0aa1140032746e5a0abfc40f4cef
+
+diff --git a/Resource/Init/gs_ttf.ps b/Resource/Init/gs_ttf.ps
+index 74043d1..6be8fe9 100644
+--- a/Resource/Init/gs_ttf.ps
++++ b/Resource/Init/gs_ttf.ps
+@@ -1304,7 +1304,7 @@ currentdict /.pickcmap_with_no_xlatmap .undef
+           TTFDEBUG { (\n1 setting alias: ) print dup ==only
+                 ( to be the same as  ) print 2 index //== exec } if
+ 
+-          7 index 2 index 3 -1 roll exch .forceput
++          7 index 2 index 3 -1 roll exch put
+         } forall
+         pop pop pop
+       }
+@@ -1322,7 +1322,7 @@ currentdict /.pickcmap_with_no_xlatmap .undef
+           exch pop
+           TTFDEBUG { (\n2 setting alias: ) print 1 index ==only
+                      ( to use glyph index: ) print dup //== exec } if
+-          5 index 3 1 roll .forceput
++          5 index 3 1 roll put
+           //false
+         }
+         {
+@@ -1339,7 +1339,7 @@ currentdict /.pickcmap_with_no_xlatmap .undef
+         {                            %  CharStrings(dict) isunicode(boolean) cmap(dict) RAGL(dict) gname(name) codep(integer) gindex(integer)
+           TTFDEBUG { (\3 nsetting alias: ) print 1 index ==only
+                 ( to be index: ) print dup //== exec } if
+-          exch pop 5 index 3 1 roll .forceput
++          exch pop 5 index 3 1 roll put
+         }
+         {
+           pop pop
+@@ -1369,7 +1369,7 @@ currentdict /.pickcmap_with_no_xlatmap .undef
+       } ifelse
+     ]
+   TTFDEBUG { (Encoding: ) print dup === flush } if
+-} .bind executeonly odef		% hides .forceput
++} .bind odef
+ 
+ % ---------------- CIDFontType 2 font loading ---------------- %
+ 
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/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/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/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-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/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/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/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/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/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/python-2.7-search-paths.patch b/gnu/packages/patches/python-2.7-search-paths.patch
index a012bc8fe0..5a345c7691 100644
--- a/gnu/packages/patches/python-2.7-search-paths.patch
+++ b/gnu/packages/patches/python-2.7-search-paths.patch
@@ -3,13 +3,17 @@ 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('CPATH', '').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-search-paths.patch b/gnu/packages/patches/python-3-search-paths.patch
index 5fea9c66b6..aaf7236631 100644
--- a/gnu/packages/patches/python-3-search-paths.patch
+++ b/gnu/packages/patches/python-3-search-paths.patch
@@ -3,14 +3,23 @@ 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('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
+             # 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_CPATH', '').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/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/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/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/webkitgtk-icu-65.patch b/gnu/packages/patches/webkitgtk-icu-65.patch
new file mode 100644
index 0000000000..66819c566b
--- /dev/null
+++ b/gnu/packages/patches/webkitgtk-icu-65.patch
@@ -0,0 +1,47 @@
+Fix build with ICU 65.
+
+Taken from upstream:
+https://bugs.webkit.org/show_bug.cgi?id=202600
+https://trac.webkit.org/r250747
+
+diff --git a/Source/WTF/wtf/URLHelpers.cpp b/Source/WTF/wtf/URLHelpers.cpp
+index 18e7f13cd615..c584f1a0cb7e 100644
+--- a/Source/WTF/wtf/URLHelpers.cpp
++++ b/Source/WTF/wtf/URLHelpers.cpp
+@@ -301,7 +301,7 @@ static bool allCharactersInIDNScriptWhiteList(const UChar* buffer, int32_t lengt
+     Optional<UChar32> previousCodePoint;
+     while (i < length) {
+         UChar32 c;
+-        U16_NEXT(buffer, i, length, c)
++        U16_NEXT(buffer, i, length, c);
+         UErrorCode error = U_ZERO_ERROR;
+         UScriptCode script = uscript_getScript(c, &error);
+         if (error != U_ZERO_ERROR) {
+diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp
+index 2443e24c9bc4..1fbb3a716006 100644
+--- a/Source/WebCore/dom/Document.cpp
++++ b/Source/WebCore/dom/Document.cpp
+@@ -4954,12 +4954,12 @@ static bool isValidNameNonASCII(const UChar* characters, unsigned length)
+     unsigned i = 0;
+ 
+     UChar32 c;
+-    U16_NEXT(characters, i, length, c)
++    U16_NEXT(characters, i, length, c);
+     if (!isValidNameStart(c))
+         return false;
+ 
+     while (i < length) {
+-        U16_NEXT(characters, i, length, c)
++        U16_NEXT(characters, i, length, c);
+         if (!isValidNamePart(c))
+             return false;
+     }
+@@ -5019,7 +5019,7 @@ ExceptionOr<std::pair<AtomString, AtomString>> Document::parseQualifiedName(cons
+ 
+     for (unsigned i = 0; i < length; ) {
+         UChar32 c;
+-        U16_NEXT(qualifiedName, i, length, c)
++        U16_NEXT(qualifiedName, i, length, c);
+         if (c == ':') {
+             if (sawColon)
+                 return Exception { InvalidCharacterError };