summary refs log tree commit diff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2020-03-04 23:16:17 +0100
committerMarius Bakke <mbakke@fastmail.com>2020-03-04 23:16:17 +0100
commitebb7cf9e21060105d9950dd5142c0eb918083666 (patch)
tree36c1607b80d92e27fb9d09029d1d3b57a1fd5065 /gnu/packages/patches
parent0b870f7915f5da43758753fd088a22033936dc50 (diff)
parentc2d7e800e6788277bc56f31d5836f9d507dc1506 (diff)
downloadguix-ebb7cf9e21060105d9950dd5142c0eb918083666.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/appstream-glib-2020.patch31
-rw-r--r--gnu/packages/patches/ceph-boost-compat.patch81
-rw-r--r--gnu/packages/patches/ceph-volume-respect-PATH.patch22
-rw-r--r--gnu/packages/patches/choqok-Fix-building-under-Qt-5.13.patch89
-rw-r--r--gnu/packages/patches/clang-9.0-libc-search-path.patch83
-rw-r--r--gnu/packages/patches/containerd-test-with-go1.13.patch21
-rw-r--r--gnu/packages/patches/desmume-gcc6-fixes.patch59
-rw-r--r--gnu/packages/patches/desmume-gcc7-fixes.patch18
-rw-r--r--gnu/packages/patches/elixir-path-length.patch8
-rw-r--r--gnu/packages/patches/libgit2-avoid-python.patch322
-rw-r--r--gnu/packages/patches/mumps-shared-libseq.patch2
-rw-r--r--gnu/packages/patches/mumps-shared-mumps.patch8
-rw-r--r--gnu/packages/patches/mumps-shared-pord.patch4
-rw-r--r--gnu/packages/patches/qtbase-QTBUG-81715.patch40
-rw-r--r--gnu/packages/patches/racket-store-checksum-override.patch30
-rw-r--r--gnu/packages/patches/upx-fix-CVE-2017-15056.patch96
-rw-r--r--gnu/packages/patches/zziplib-CVE-2018-16548.patch49
17 files changed, 296 insertions, 667 deletions
diff --git a/gnu/packages/patches/appstream-glib-2020.patch b/gnu/packages/patches/appstream-glib-2020.patch
deleted file mode 100644
index ab8a4bbdee..0000000000
--- a/gnu/packages/patches/appstream-glib-2020.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-2020 is no longer the future.
-
-Taken from upstream:
-https://github.com/hughsie/appstream-glib/commit/953c8e529d7291e60a95e580967ed79ce2c9ccf0
-
-diff --git a/data/tests/broken.appdata.xml b/data/tests/broken.appdata.xml
-index f7a5386e..cf80f5b4 100644
---- a/data/tests/broken.appdata.xml
-+++ b/data/tests/broken.appdata.xml
-@@ -40,7 +40,7 @@
-         <p>This is a duplicate release on the same day!</p>
-       </description>
-     </release>
--    <release date="2020-01-01" version="0.6.2">
-+    <release date="2050-01-01" version="0.6.2">
-       <description>
-         <p>This is a release in the future!</p>
-       </description>
-diff --git a/libappstream-glib/as-app-validate.c b/libappstream-glib/as-app-validate.c
-index c1103ace..f50e4e41 100644
---- a/libappstream-glib/as-app-validate.c
-+++ b/libappstream-glib/as-app-validate.c
-@@ -864,7 +864,7 @@ as_app_validate_release (AsApp *app,
- 				     AS_PROBLEM_KIND_ATTRIBUTE_MISSING,
- 				     "<release> has no timestamp");
- 	}
--	if (timestamp > 20120101 && timestamp < 20251231) {
-+	if (timestamp > 20120101 && timestamp < 20351231) {
- 		ai_app_validate_add (helper,
- 				     AS_PROBLEM_KIND_ATTRIBUTE_INVALID,
- 				     "<release> timestamp should be a UNIX time");
diff --git a/gnu/packages/patches/ceph-boost-compat.patch b/gnu/packages/patches/ceph-boost-compat.patch
deleted file mode 100644
index b3df659d6b..0000000000
--- a/gnu/packages/patches/ceph-boost-compat.patch
+++ /dev/null
@@ -1,81 +0,0 @@
-Fix compatibility with Boost 1.70.
-
-Adapted for 14.2.5 from these upstream commits:
-https://github.com/ceph/ceph/commit/064f142746ae97f54865069cdacf5aae2b1b14f6
-https://github.com/ceph/ceph/commit/f1651b8c509d60787d10c4115e29fecfd2da237c
-
-diff --git a/src/rgw/rgw_asio_frontend.cc b/src/rgw/rgw_asio_frontend.cc
---- a/src/rgw/rgw_asio_frontend.cc
-+++ b/src/rgw/rgw_asio_frontend.cc
-@@ -83,7 +83,8 @@
- using SharedMutex = ceph::async::SharedMutex<boost::asio::io_context::executor_type>;
- 
- template <typename Stream>
--void handle_connection(RGWProcessEnv& env, Stream& stream,
-+void handle_connection(boost::asio::io_context& context,
-+		       RGWProcessEnv& env, Stream& stream,
-                        parse_buffer& buffer, bool is_ssl,
-                        SharedMutex& pause_mutex,
-                        rgw::dmclock::Scheduler *scheduler,
-@@ -160,7 +161,7 @@
-                                   rgw::io::add_conlen_controlling(
-                                     &real_client))));
-       RGWRestfulIO client(cct, &real_client_io);
--      auto y = optional_yield{socket.get_io_context(), yield};
-+      auto y = optional_yield{context, yield};
-       process_request(env.store, env.rest, &req, env.uri_prefix,
-                       *env.auth_registry, &client, env.olog, y, scheduler);
-     }
-@@ -604,7 +605,7 @@
-           return;
-         }
-         buffer->consume(bytes);
--        handle_connection(env, stream, *buffer, true, pause_mutex,
-+        handle_connection(context, env, stream, *buffer, true, pause_mutex,
-                           scheduler.get(), ec, yield);
-         if (!ec) {
-           // ssl shutdown (ignoring errors)
-@@ -622,7 +623,7 @@
-         auto c = connections.add(conn);
-         auto buffer = std::make_unique<parse_buffer>();
-         boost::system::error_code ec;
--        handle_connection(env, s, *buffer, false, pause_mutex,
-+        handle_connection(context, env, s, *buffer, false, pause_mutex,
-                           scheduler.get(), ec, yield);
-         s.shutdown(tcp::socket::shutdown_both, ec);
-       });
-diff --git a/src/rgw/rgw_dmclock_async_scheduler.h b/src/rgw/rgw_dmclock_async_scheduler.h
---- a/src/rgw/rgw_dmclock_async_scheduler.h
-+++ b/src/rgw/rgw_dmclock_async_scheduler.h
-@@ -82,7 +82,12 @@ class AsyncScheduler : public md_config_obs_t, public Scheduler {
-   using Completion = async::Completion<Signature, async::AsBase<Request>>;
- 
-   using Clock = ceph::coarse_real_clock;
-+#if BOOST_VERSION < 107000
-   using Timer = boost::asio::basic_waitable_timer<Clock>;
-+#else
-+  using Timer = boost::asio::basic_waitable_timer<Clock,
-+        boost::asio::wait_traits<Clock>, executor_type>;
-+#endif
-   Timer timer; //< timer for the next scheduled request
- 
-   CephContext *const cct;
-diff --git a/src/rgw/rgw_reshard.h b/src/rgw/rgw_reshard.h
---- a/src/rgw/rgw_reshard.h
-+++ b/src/rgw/rgw_reshard.h
-@@ -183,7 +183,14 @@ class RGWReshardWait {
-   ceph::condition_variable cond;
- 
-   struct Waiter : boost::intrusive::list_base_hook<> {
--    boost::asio::basic_waitable_timer<Clock> timer;
-+#if BOOST_VERSION < 107000
-+    using Timer = boost::asio::basic_waitable_timer<Clock>;
-+#else
-+    using Executor = boost::asio::io_context::executor_type;
-+    using Timer = boost::asio::basic_waitable_timer<Clock,
-+          boost::asio::wait_traits<Clock>, Executor>;
-+#endif
-+    Timer timer;
-     explicit Waiter(boost::asio::io_context& ioc) : timer(ioc) {}
-   };
-   boost::intrusive::list<Waiter> waiters;
diff --git a/gnu/packages/patches/ceph-volume-respect-PATH.patch b/gnu/packages/patches/ceph-volume-respect-PATH.patch
deleted file mode 100644
index 08a9a15ddd..0000000000
--- a/gnu/packages/patches/ceph-volume-respect-PATH.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-Look for required tools in $PATH instead of just a handful locations.
-
-diff --git a/src/ceph-volume/ceph_volume/util/system.py b/src/ceph-volume/ceph_volume/util/system.py
-index b637f023a4..14516e1c65 100644
---- a/src/ceph-volume/ceph_volume/util/system.py
-+++ b/src/ceph-volume/ceph_volume/util/system.py
-@@ -33,14 +33,7 @@ def generate_uuid():
- 
- def which(executable):
-     """find the location of an executable"""
--    locations = (
--        '/usr/local/bin',
--        '/bin',
--        '/usr/bin',
--        '/usr/local/sbin',
--        '/usr/sbin',
--        '/sbin',
--    )
-+    locations = os.getenv('PATH').split(':')
- 
-     for location in locations:
-         executable_path = os.path.join(location, executable)
diff --git a/gnu/packages/patches/choqok-Fix-building-under-Qt-5.13.patch b/gnu/packages/patches/choqok-Fix-building-under-Qt-5.13.patch
deleted file mode 100644
index 4250106a19..0000000000
--- a/gnu/packages/patches/choqok-Fix-building-under-Qt-5.13.patch
+++ /dev/null
@@ -1,89 +0,0 @@
-Add QMap include to fix building under Qt 5.13
-
-This combines several patches which all add the same missing include:
-- e13ab06f65a4e8b6259bccda1401abb9c1c9fdca
-- 546ede9ef712bb1b156a55ce30df81c3203dde61
-- 08fb06b63a78888e6703de6ac1a4fd6a0e2791eb
-- bef6784596bf0b41287ebad81f138e1c8c2a6be2
-
-Include is no longer added transitively.
----
-
---- a/plugins/betternotify/notify.h
-+++ b/plugins/betternotify/notify.h
-@@ -23,6 +23,7 @@
- #ifndef NOTIFY_H
- #define NOTIFY_H
- 
-+#include <QMap>
- #include <QQueue>
- #include <QPoint>
- #include <QPointer>
---- a/plugins/untiny/untiny.h
-+++ b/plugins/untiny/untiny.h
-@@ -27,6 +27,7 @@
- 
- #include "plugin.h"
- 
-+#include <QMap>
- #include <QQueue>
- #include <QUrl>
- #include <QPointer>
---- a/plugins/uploaders/flickr/flickr.h
-+++ b/plugins/uploaders/flickr/flickr.h
-@@ -26,6 +26,8 @@
- 
- #include "uploader.h"
- 
-+#include <QMap>
-+
- /**
- @author Andrey Esin \<gmlastik@gmail.com\>
- */
-diff --git a/plugins/uploaders/imageshack/imageshack.h b/plugins/uploaders/imageshack/imageshack.h
-index d9ddc88..63d0e3f 100644
---- a/plugins/uploaders/imageshack/imageshack.h
-+++ b/plugins/uploaders/imageshack/imageshack.h
-@@ -26,6 +26,8 @@
- 
- #include "uploader.h"
- 
-+#include <QMap>
-+
- /**
- @author Mehrdad Momeny \<mehrdad.momeny@gmail.com\>
- */
---- a/plugins/uploaders/mobypicture/mobypicture.h
-+++ b/plugins/uploaders/mobypicture/mobypicture.h
-@@ -26,6 +26,8 @@
- 
- #include "uploader.h"
- 
-+#include <QMap>
-+
- class KJob;
- 
- class Mobypicture : public Choqok::Uploader
---- a/plugins/uploaders/posterous/posterous.h
-+++ b/plugins/uploaders/posterous/posterous.h
-@@ -26,6 +26,8 @@
- 
- #include "uploader.h"
- 
-+#include <QMap>
-+
- class KJob;
- 
- class Posterous : public Choqok::Uploader
---- a/plugins/uploaders/twitgoo/twitgoo.h
-+++ b/plugins/uploaders/twitgoo/twitgoo.h
-@@ -26,6 +26,8 @@
- 
- #include "uploader.h"
- 
-+#include <QMap>
-+
- class KJob;
- 
- class Twitgoo : public Choqok::Uploader
---
diff --git a/gnu/packages/patches/clang-9.0-libc-search-path.patch b/gnu/packages/patches/clang-9.0-libc-search-path.patch
new file mode 100644
index 0000000000..be34344842
--- /dev/null
+++ b/gnu/packages/patches/clang-9.0-libc-search-path.patch
@@ -0,0 +1,83 @@
+Clang attempts to guess file names based on the OS and distro (yes!),
+but unfortunately, that doesn't work for us.
+
+This patch makes it easy to insert libc's $libdir so that Clang passes the
+correct absolute file name of crt1.o etc. to 'ld'.  It also disables all
+the distro-specific stuff and removes the hard-coded FHS directory names
+to make sure Clang also works on non-GuixSD systems.
+
+diff --git a/lib/Driver/ToolChains/Linux.cpp b/lib/Driver/ToolChains/Linux.cpp
+--- a/lib/Driver/ToolChains/Linux.cpp
++++ b/lib/Driver/ToolChains/Linux.cpp
+@@ -240,6 +240,9 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
+                          .str());
+   }
+ 
++// Comment out the distro-specific tweaks so that they don't bite when
++// using Guix on a foreign distro.
++#if 0
+   Distro Distro(D.getVFS());
+ 
+   if (Distro.IsAlpineLinux() || Triple.isAndroid()) {
+@@ -306,6 +309,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
+ 
+   if (IsAndroid || Distro.IsOpenSUSE())
+     ExtraOpts.push_back("--enable-new-dtags");
++#endif
+ 
+   // The selection of paths to try here is designed to match the patterns which
+   // the GCC driver itself uses, as this is part of the GCC-compatible driver.
+@@ -363,7 +367,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
+     // the cross. Note that GCC does include some of these directories in some
+     // configurations but this seems somewhere between questionable and simply
+     // a bug.
+-    if (StringRef(LibPath).startswith(SysRoot)) {
++    if (0) {
+       addPathIfExists(D, LibPath + "/" + MultiarchTriple, Paths);
+       addPathIfExists(D, LibPath + "/../" + OSLibDir, Paths);
+     }
+@@ -382,6 +386,8 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
+   addPathIfExists(D, SysRoot + "/lib/" + MultiarchTriple, Paths);
+   addPathIfExists(D, SysRoot + "/lib/../" + OSLibDir, Paths);
+ 
++// This requires the commented distro tweaks above.
++#if 0
+   if (IsAndroid) {
+     // Android sysroots contain a library directory for each supported OS
+     // version as well as some unversioned libraries in the usual multiarch
+@@ -410,10 +416,15 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
+     addPathIfExists(D, SysRoot + "/" + OSLibDir + "/" + ABIName, Paths);
+     addPathIfExists(D, SysRoot + "/usr/" + OSLibDir + "/" + ABIName, Paths);
+   }
++#endif
+ 
+   // Try walking via the GCC triple path in case of biarch or multiarch GCC
+   // installations with strange symlinks.
+   if (GCCInstallation.isValid()) {
++
++// The following code would end up adding things like
++// "/usr/lib/x86_64-unknown-linux-gnu/../../lib64" to the search path.
++#if 0
+     addPathIfExists(D,
+                     SysRoot + "/usr/lib/" + GCCInstallation.getTriple().str() +
+                         "/../../" + OSLibDir,
+@@ -426,6 +437,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
+                              BiarchSibling.gccSuffix(),
+                       Paths);
+     }
++#endif
+ 
+     // See comments above on the multilib variant for details of why this is
+     // included even from outside the sysroot.
+@@ -450,8 +462,9 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
+   if (StringRef(D.Dir).startswith(SysRoot))
+     addPathIfExists(D, D.Dir + "/../lib", Paths);
+ 
+-  addPathIfExists(D, SysRoot + "/lib", Paths);
+-  addPathIfExists(D, SysRoot + "/usr/lib", Paths);
++  // Add libc's lib/ directory to the search path, so that crt1.o, crti.o,
++  // and friends can be found.
++  addPathIfExists(D, "@GLIBC_LIBDIR@", Paths);
+ }
+ 
+ ToolChain::CXXStdlibType Linux::GetDefaultCXXStdlibType() const {
diff --git a/gnu/packages/patches/containerd-test-with-go1.13.patch b/gnu/packages/patches/containerd-test-with-go1.13.patch
new file mode 100644
index 0000000000..964adee9e6
--- /dev/null
+++ b/gnu/packages/patches/containerd-test-with-go1.13.patch
@@ -0,0 +1,21 @@
+Compatibility fix for go 1.13, flag.Parse() shouldn't be called during
+package initialization.
+https://golang.org/doc/go1.13#testing
+--- a/client_test.go	2020-02-12 14:50:28.991245371 -0500
++++ b/client_test.go	2020-02-12 15:12:37.383523980 -0500
+@@ -49,7 +49,6 @@
+ 	flag.StringVar(&address, "address", defaultAddress, "The address to the containerd socket for use in the tests")
+ 	flag.BoolVar(&noDaemon, "no-daemon", false, "Do not start a dedicated daemon for the tests")
+ 	flag.BoolVar(&noCriu, "no-criu", false, "Do not run the checkpoint tests")
+-	flag.Parse()
+ }
+ 
+ func testContext() (context.Context, context.CancelFunc) {
+@@ -59,6 +58,7 @@
+ }
+ 
+ func TestMain(m *testing.M) {
++	flag.Parse()
+ 	if testing.Short() {
+ 		os.Exit(m.Run())
+ 	}
diff --git a/gnu/packages/patches/desmume-gcc6-fixes.patch b/gnu/packages/patches/desmume-gcc6-fixes.patch
new file mode 100644
index 0000000000..6eb9576f64
--- /dev/null
+++ b/gnu/packages/patches/desmume-gcc6-fixes.patch
@@ -0,0 +1,59 @@
+From: zeromus
+Origin: upstream, https://sourceforge.net/p/desmume/code/5514, https://sourceforge.net/p/desmume/code/5517, https://sourceforge.net/p/desmume/code/5430
+Subject: fix GCC6 issues
+Bug: https://sourceforge.net/p/desmume/bugs/1570/
+Bug-Debian: http://bugs.debian.org/811691
+
+Index: desmume/src/MMU_timing.h
+===================================================================
+--- desmume/src/MMU_timing.h	(revision 5513)
++++ desmume/src/MMU_timing.h	(revision 5517)
+@@ -155,8 +155,8 @@
+ 	enum { ASSOCIATIVITY = 1 << ASSOCIATIVESHIFT };

+ 	enum { BLOCKSIZE = 1 << BLOCKSIZESHIFT };

+ 	enum { TAGSHIFT = SIZESHIFT - ASSOCIATIVESHIFT };

+-	enum { TAGMASK = (u32)(~0 << TAGSHIFT) };

+-	enum { BLOCKMASK = ((u32)~0 >> (32 - TAGSHIFT)) & (u32)(~0 << BLOCKSIZESHIFT) };

++	enum { TAGMASK = (u32)(~0U << TAGSHIFT) };

++	enum { BLOCKMASK = ((u32)~0U >> (32 - TAGSHIFT)) & (u32)(~0U << BLOCKSIZESHIFT) };

+ 	enum { WORDSIZE = sizeof(u32) };

+ 	enum { WORDSPERBLOCK = (1 << BLOCKSIZESHIFT) / WORDSIZE };

+ 	enum { DATAPERWORD = WORDSIZE * ASSOCIATIVITY };

+Index: desmume/src/ctrlssdl.cpp
+===================================================================
+--- desmume/src/ctrlssdl.cpp	(revision 5513)
++++ desmume/src/ctrlssdl.cpp	(revision 5517)
+@@ -200,7 +200,7 @@
+           break;
+         case SDL_JOYAXISMOTION:
+           /* Dead zone of 50% */
+-          if( (abs(event.jaxis.value) >> 14) != 0 )
++          if( ((u32)abs(event.jaxis.value) >> 14) != 0 )
+             {
+               key = ((event.jaxis.which & 15) << 12) | JOY_AXIS << 8 | ((event.jaxis.axis & 127) << 1);
+               if (event.jaxis.value > 0) {
+@@ -370,7 +370,7 @@
+          Note: button constants have a 1bit offset. */
+     case SDL_JOYAXISMOTION:
+       key_code = ((event->jaxis.which & 15) << 12) | JOY_AXIS << 8 | ((event->jaxis.axis & 127) << 1);
+-      if( (abs(event->jaxis.value) >> 14) != 0 )
++      if( ((u32)abs(event->jaxis.value) >> 14) != 0 )
+         {
+           if (event->jaxis.value > 0)
+             key_code |= 1;
+Index: desmume/src/wifi.cpp
+===================================================================
+--- desmume/src/wifi.cpp	(revision 5429)
++++ desmume/src/wifi.cpp	(revision 5430)
+@@ -320,9 +320,9 @@
+ 
+ #if (WIFI_LOGGING_LEVEL >= 1)
+ 	#if WIFI_LOG_USE_LOGC
+-		#define WIFI_LOG(level, ...) if(level <= WIFI_LOGGING_LEVEL) LOGC(8, "WIFI: "__VA_ARGS__);
++		#define WIFI_LOG(level, ...) if(level <= WIFI_LOGGING_LEVEL) LOGC(8, "WIFI: " __VA_ARGS__);
+ 	#else
+-		#define WIFI_LOG(level, ...) if(level <= WIFI_LOGGING_LEVEL) printf("WIFI: "__VA_ARGS__);
++		#define WIFI_LOG(level, ...) if(level <= WIFI_LOGGING_LEVEL) printf("WIFI: " __VA_ARGS__);
+ 	#endif
+ #else
+ #define WIFI_LOG(level, ...) {}
diff --git a/gnu/packages/patches/desmume-gcc7-fixes.patch b/gnu/packages/patches/desmume-gcc7-fixes.patch
new file mode 100644
index 0000000000..a4934ff6e6
--- /dev/null
+++ b/gnu/packages/patches/desmume-gcc7-fixes.patch
@@ -0,0 +1,18 @@
+From e1f7039f1b06add4fb75b2f8774000b8f05574af Mon Sep 17 00:00:00 2001
+From: rogerman <rogerman@users.sf.net>
+Date: Mon, 17 Aug 2015 21:15:04 +0000
+Subject: Fix bug with libfat string handling.
+
+diff --git a/src/utils/libfat/directory.cpp b/src/utils/libfat/directory.cpp
+index 765d7ae5..b6d7f01f 100644
+--- a/src/utils/libfat/directory.cpp
++++ b/src/utils/libfat/directory.cpp
+@@ -139,7 +139,7 @@ static size_t _FAT_directory_mbstoucs2 (ucs2_t* dst, const char* src, size_t len
+ 	int bytes;
+ 	size_t count = 0;
+ 
+-	while (count < len-1 && src != '\0') {
++	while (count < len-1 && *src != '\0') {
+ 		bytes = mbrtowc (&tempChar, src, MB_CUR_MAX, &ps);
+ 		if (bytes > 0) {
+ 			*dst = (ucs2_t)tempChar;
diff --git a/gnu/packages/patches/elixir-path-length.patch b/gnu/packages/patches/elixir-path-length.patch
index aa8bf38829..ab99595cff 100644
--- a/gnu/packages/patches/elixir-path-length.patch
+++ b/gnu/packages/patches/elixir-path-length.patch
@@ -5,11 +5,11 @@ after the substitution is made.
 
 --- a/Makefile
 +++ b/Makefile
-@@ -213,6 +213,7 @@
- TEST_ERLS = $(addprefix $(TEST_EBIN)/, $(addsuffix .beam, $(basename $(notdir $(wildcard $(TEST_ERL)/*.erl)))))
+@@ -265,6 +265,7 @@ format: compile
+	$(call FORMAT)
  
  test_formatted: compile
-+	bin/elixir bin/mix format lib/mix/lib/mix/scm/git.ex
- 	bin/elixir bin/mix format --check-formatted
++	$(call FORMAT,lib/mix/lib/mix/scm/git.ex)
+	$(call FORMAT,--check-formatted)
  
  test_erlang: compile $(TEST_ERLS)
diff --git a/gnu/packages/patches/libgit2-avoid-python.patch b/gnu/packages/patches/libgit2-avoid-python.patch
deleted file mode 100644
index b2e5141563..0000000000
--- a/gnu/packages/patches/libgit2-avoid-python.patch
+++ /dev/null
@@ -1,322 +0,0 @@
-This provides a Guile reimplementation of clar's "generate.py".
-It makes it possible for us to remove Python from libgit2's build-time
-dependencies.
-libgit2 is used in order to fetch a lot of sources for guix packages.
-Both Python2 and Python3 builds acted up in the past.
-Hence this patch which makes the number of libgit2 dependencies very
-small.
-The reimplementation tries to keep as close as possible to the original
-in both structure and runtime effect.  Some things are thus overly
-convoluted just to make them the same as in the original.
-
-Both implementations basically do:
-
-grep -r 'test_.*__.*' . > clar.suite
-
-It is important that the directory traversal order of the original and
-the reimplementation stay the same.
-
-diff -ruN orig/libgit2-0.27.7/tests/CMakeLists.txt libgit2-0.27.7/tests/CMakeLists.txt
---- orig/libgit2-0.27.7/tests/CMakeLists.txt	1970-01-01 01:00:00.000000000 +0100
-+++ libgit2-0.27.7/tests/CMakeLists.txt	2019-03-04 11:13:06.640118979 +0100
-@@ -1,10 +1,3 @@
--FIND_PACKAGE(PythonInterp)
--
--IF(NOT PYTHONINTERP_FOUND)
--  MESSAGE(FATAL_ERROR "Could not find a python interpeter, which is needed to build the tests. "
--    "Make sure python is available, or pass -DBUILD_CLAR=OFF to skip building the tests")
--ENDIF()
--
- SET(CLAR_FIXTURES "${CMAKE_CURRENT_SOURCE_DIR}/resources/")
- SET(CLAR_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
- ADD_DEFINITIONS(-DCLAR_FIXTURE_PATH=\"${CLAR_FIXTURES}\")
-@@ -21,7 +14,7 @@
- 
- ADD_CUSTOM_COMMAND(
- 	OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/clar.suite
--	COMMAND ${PYTHON_EXECUTABLE} generate.py -o "${CMAKE_CURRENT_BINARY_DIR}" -f -xonline -xstress -xperf .
-+	COMMAND guile generate.scm -o "${CMAKE_CURRENT_BINARY_DIR}" -f -x online -x stress -x perf .
- 	DEPENDS ${SRC_TEST}
- 	WORKING_DIRECTORY ${CLAR_PATH}
- )
-diff -ruN orig/libgit2-0.27.7/tests/generate.scm libgit2-0.27.7/tests/generate.scm
---- orig/libgit2-0.27.7/tests/generate.scm	1970-01-01 01:00:00.000000000 +0100
-+++ libgit2-0.27.7/tests/generate.scm	2019-03-04 12:18:00.688040975 +0100
-@@ -0,0 +1,277 @@
-+;; -*- geiser-scheme-implementation: guile -*-
-+
-+;;; Implementation: Danny Milosavljevic <dannym@scratchpost.org>
-+;;; Based on: Implementation in Python by Vicent Marti.
-+;;; License: ISC, like the original generate.py in clar.
-+
-+(use-modules (ice-9 ftw))
-+(use-modules (ice-9 regex))
-+(use-modules (ice-9 getopt-long))
-+(use-modules (ice-9 rdelim))
-+(use-modules (ice-9 match))
-+(use-modules (ice-9 textual-ports))
-+(use-modules (srfi srfi-1))
-+
-+(define (render-callback cb)
-+  (if cb
-+      (string-append "    { \"" (assoc-ref cb "short-name") "\", &"
-+                     (assoc-ref cb "symbol") " }")
-+      "    { NULL, NULL }"))
-+
-+(define (replace needle replacement haystack)
-+  "Replace all occurences of NEEDLE in HAYSTACK by REPLACEMENT.
-+NEEDLE is a regular expression."
-+  (regexp-substitute/global #f needle haystack 'pre replacement 'post))
-+
-+(define (skip-comments* text)
-+  (call-with-input-string
-+   text
-+   (lambda (port)
-+     (let loop ((result '())
-+                (section #f))
-+       (define (consume-char)
-+         (cons (read-char port) result))
-+       (define (skip-char)
-+         (read-char port)
-+         result)
-+       (match section
-+        (#f
-+         (match (peek-char port)
-+          (#\/ (loop (consume-char) 'almost-in-block-comment))
-+          (#\" (loop (consume-char) 'in-string-literal))
-+          (#\' (loop (consume-char) 'in-character-literal))
-+          ((? eof-object?) result)
-+          (_ (loop (consume-char) section))))
-+        ('almost-in-block-comment
-+         (match (peek-char port)
-+          (#\* (loop (consume-char) 'in-block-comment))
-+          (#\/ (loop (consume-char) 'in-line-comment))
-+          ((? eof-object?) result)
-+          (_ (loop (consume-char) #f))))
-+        ('in-line-comment
-+         (match (peek-char port)
-+          (#\newline (loop (consume-char) #f))
-+          ((? eof-object?) result)
-+          (_ (loop (skip-char) section))))
-+        ('in-block-comment
-+         (match (peek-char port)
-+           (#\* (loop (skip-char) 'almost-out-of-block-comment))
-+           ((? eof-object?) result)
-+           (_ (loop (skip-char) section))))
-+        ('almost-out-of-block-comment
-+         (match (peek-char port)
-+           (#\/ (loop (cons (read-char port) (cons #\* result)) #f))
-+           (#\* (loop (skip-char) 'almost-out-of-block-comment))
-+           ((? eof-object?) result)
-+           (_ (loop (skip-char) 'in-block-comment))))
-+        ('in-string-literal
-+         (match (peek-char port)
-+           (#\\ (loop (consume-char) 'in-string-literal-escape))
-+           (#\" (loop (consume-char) #f))
-+           ((? eof-object?) result)
-+           (_ (loop (consume-char) section))))
-+        ('in-string-literal-escape
-+         (match (peek-char port)
-+           ((? eof-object?) result)
-+           (_ (loop (consume-char) 'in-string-literal))))
-+        ('in-character-literal
-+         (match (peek-char port)
-+           (#\\ (loop (consume-char) 'in-character-literal-escape))
-+           (#\' (loop (consume-char) #f))
-+           ((? eof-object?) result)
-+           (_ (loop (consume-char) section))))
-+        ('in-character-literal-escape
-+         (match (peek-char port)
-+           ((? eof-object?) result)
-+           (_ (loop (consume-char) 'in-character-literal)))))))))
-+
-+(define (skip-comments text)
-+  (list->string (reverse (skip-comments* text))))
-+
-+(define (maybe-only items)
-+  (match items
-+   ((a) a)
-+   (_ #f)))
-+
-+(define (Module name path excludes)
-+  (let* ((clean-name (replace "_" "::" name))
-+         (enabled (not (any (lambda (exclude)
-+                              (string-prefix? exclude clean-name))
-+                            excludes))))
-+    (define (parse contents)
-+      (define (cons-match match prev)
-+        (cons
-+         `(("declaration" . ,(match:substring match 1))
-+           ("symbol" . ,(match:substring match 2))
-+           ("short-name" . ,(match:substring match 3)))
-+         prev))
-+      (let* ((contents (skip-comments contents))
-+             (entries (fold-matches (make-regexp
-+                                     (string-append "^(void\\s+(test_"
-+                                                    name
-+                                                    "__(\\w+))\\s*\\(\\s*void\\s*\\))\\s*\\{")
-+                                     regexp/newline)
-+                                    contents
-+                                    '()
-+                                    cons-match))
-+             (entries (reverse entries))
-+             (callbacks (filter (lambda (entry)
-+                                   (match (assoc-ref entry "short-name")
-+                                    ("initialize" #f)
-+                                    ("cleanup" #f)
-+                                    (_ #t)))
-+                                entries)))
-+        (if (> (length callbacks) 0)
-+            `(("name" . ,name)
-+              ("enabled" . ,(if enabled "1" "0"))
-+              ("clean-name" . ,clean-name)
-+              ("initialize" . ,(maybe-only (filter-map (lambda (entry)
-+                                                      (match (assoc-ref entry "short-name")
-+                                                       ("initialize" entry)
-+                                                       (_ #f)))
-+                                                     entries)))
-+              ("cleanup" . ,(maybe-only (filter-map (lambda (entry)
-+                                                   (match (assoc-ref entry "short-name")
-+                                                    ("cleanup" entry)
-+                                                    (_ #f)))
-+                                                  entries)))
-+              ("callbacks" . ,callbacks))
-+            #f)))
-+
-+    (define (refresh path)
-+      (and (file-exists? path)
-+           (parse (call-with-input-file path get-string-all))))
-+    (refresh path)))
-+
-+(define (generate-TestSuite path output excludes)
-+    (define (load)
-+        (define enter? (const #t))
-+        (define (leaf file stat result)
-+          (let* ((module-root (string-drop (dirname file)
-+                                           (string-length path)))
-+                 (module-root (filter-map (match-lambda
-+                                           ("" #f)
-+                                           (a a))
-+                                          (string-split module-root #\/))))
-+            (define (make-module path)
-+              (let* ((name (string-join (append module-root (list (string-drop-right (basename path) (string-length ".c")))) "_"))
-+                     (name (replace "-" "_" name)))
-+                (Module name path excludes)))
-+            (if (string-suffix? ".c" file)
-+                (let ((module (make-module file)))
-+                  (if module
-+                      (cons module result)
-+                      result))
-+                result)))
-+        (define (down dir stat result)
-+          result)
-+        (define (up file state result)
-+          result)
-+        (define skip (const #f))
-+        (file-system-fold enter? leaf down up skip error '() path))
-+
-+    (define (CallbacksTemplate module)
-+      (string-append "static const struct clar_func _clar_cb_"
-+                     (assoc-ref module "name") "[] = {\n"
-+                     (string-join (map render-callback
-+                                       (assoc-ref module "callbacks"))
-+                                  ",\n")
-+                     "\n};\n"))
-+
-+    (define (DeclarationTemplate module)
-+      (string-append (string-join (map (lambda (cb)
-+                                         (string-append "extern "
-+                                                        (assoc-ref cb "declaration")
-+                                                        ";"))
-+                                       (assoc-ref module "callbacks"))
-+                                  "\n")
-+                     "\n"
-+                     (if (assoc-ref module "initialize")
-+                         (string-append "extern " (assoc-ref (assoc-ref module "initialize") "declaration") ";\n")
-+                         "")
-+                     (if (assoc-ref module "cleanup")
-+                         (string-append "extern " (assoc-ref (assoc-ref module "cleanup") "declaration") ";\n")
-+                         "")))
-+
-+    (define (InfoTemplate module)
-+      (string-append "
-+    {
-+        \"" (assoc-ref module "clean-name") "\",
-+    " (render-callback (assoc-ref module "initialize")) ",
-+    " (render-callback (assoc-ref module "cleanup")) ",
-+        _clar_cb_" (assoc-ref module "name") ", "
-+        (number->string (length (assoc-ref module "callbacks")))
-+        ", " (assoc-ref module "enabled") "
-+    }"))
-+
-+    (define (Write data)
-+      (define (name< module-a module-b)
-+        (string<? (assoc-ref module-a "name")
-+                  (assoc-ref module-b "name")))
-+      (define modules (sort (load) name<))
-+
-+      (define (suite-count)
-+        (length modules))
-+
-+      (define (callback-count)
-+        (fold + 0 (map (lambda (entry)
-+                         (length (assoc-ref entry "callbacks")))
-+                         modules)))
-+
-+      (define (display-x value)
-+        (display value data))
-+
-+      (for-each (compose display-x DeclarationTemplate) modules)
-+      (for-each (compose display-x CallbacksTemplate) modules)
-+
-+      (display-x "static struct clar_suite _clar_suites[] = {")
-+      (display-x (string-join (map InfoTemplate modules) ","))
-+      (display-x "\n};\n")
-+
-+      (let ((suite-count-str (number->string (suite-count)))
-+            (callback-count-str (number->string (callback-count))))
-+        (display-x "static const size_t _clar_suite_count = ")
-+        (display-x suite-count-str)
-+        (display-x ";\n")
-+
-+        (display-x "static const size_t _clar_callback_count = ")
-+        (display-x callback-count-str)
-+        (display-x ";\n")
-+
-+        (display (string-append "Written `clar.suite` ("
-+                                callback-count-str
-+                                " tests in "
-+                                suite-count-str
-+                                " suites)"))
-+        (newline))
-+      #t)
-+
-+    (call-with-output-file (string-append output "/clar.suite") Write))
-+
-+;;; main
-+
-+(define (main)
-+  (define option-spec
-+    '((force (single-char #\f) (value #f))
-+      (exclude (single-char #\x) (value #t))
-+      (output (single-char #\o) (value #t))
-+      (help  (single-char #\h) (value #f))))
-+
-+  (define options (getopt-long (command-line) option-spec #:stop-at-first-non-option #t))
-+  (define args (reverse (option-ref options '() '())))
-+  (when (> (length args) 1)
-+    (display "More than one path given\n")
-+    (exit 1))
-+
-+  (if (< (length args) 1)
-+      (set! args '(".")))
-+
-+  (let* ((path (car args))
-+         (output (option-ref options 'output path))
-+         (excluded (filter-map (match-lambda
-+                                (('exclude . value) value)
-+                                (_ #f))
-+                               options)))
-+    (generate-TestSuite path output excluded)))
-+
-+(main)
diff --git a/gnu/packages/patches/mumps-shared-libseq.patch b/gnu/packages/patches/mumps-shared-libseq.patch
index feafcf123b..eccf528f7a 100644
--- a/gnu/packages/patches/mumps-shared-libseq.patch
+++ b/gnu/packages/patches/mumps-shared-libseq.patch
@@ -17,7 +17,7 @@ Index: mumps/libseq/Makefile
 +	$(AR) $@ mpi.o mpic.o elapse.o
  	$(RANLIB) $@
 +libmpiseq$(PLAT).so: mpi.o mpic.o elapse.o
-+	$(FC) -shared $^ -Wl,-soname,libmpiseq$(PLAT)-5.1.2.so -o libmpiseq$(PLAT)-5.1.2.so -Wl,-z,defs
++	$(FC) -shared $^ -Wl,-soname,libmpiseq$(PLAT)-5.2.1.so -o libmpiseq$(PLAT)-5.2.1.so -Wl,-z,defs
  .f.o:
 -	$(FC) $(OPTF)              -c $*.f $(OUTF)$*.o
 +	$(FC) $(OPTF)              -fPIC -c $*.f $(OUTF)$*.o
diff --git a/gnu/packages/patches/mumps-shared-mumps.patch b/gnu/packages/patches/mumps-shared-mumps.patch
index 9e2491f300..d94ccf6ce9 100644
--- a/gnu/packages/patches/mumps-shared-mumps.patch
+++ b/gnu/packages/patches/mumps-shared-mumps.patch
@@ -30,16 +30,16 @@ Index: mumps/src/Makefile
 -$(libdir)/lib$(ARITH)mumps$(PLAT)$(LIBEXT):    $(OBJS_MOD) $(OBJS_OTHER)
 -	$(AR)$@ $?
 +$(libdir)/libmumps_common$(PLAT).so:      $(OBJS_COMMON_MOD) $(OBJS_COMMON_OTHER)
-+	$(FC) -shared $^ -Wl,-soname,libmumps_common$(PLAT)-5.1.2.so -L$(libdir) $(LORDERINGS) -lpthread $(MPIFLIB) $(MPICLIB) $(LEXTRAS) -o $(libdir)/libmumps_common$(PLAT)-5.1.2.so -Wl,-z,defs
-+	ln -s libmumps_common$(PLAT)-5.1.2.so $@
++	$(FC) -shared $^ -Wl,-soname,libmumps_common$(PLAT)-5.2.1.so -L$(libdir) $(LORDERINGS) -lpthread $(MPIFLIB) $(MPICLIB) $(LEXTRAS) -o $(libdir)/libmumps_common$(PLAT)-5.2.1.so -Wl,-z,defs
++	ln -s libmumps_common$(PLAT)-5.2.1.so $@
 +
 +$(libdir)/lib$(ARITH)mumps$(PLAT).a:    $(OBJS_MOD) $(OBJS_OTHER)
 +	$(AR) $@ $?
  	$(RANLIB) $@
  
 +$(libdir)/lib$(ARITH)mumps$(PLAT).so:    $(OBJS_MOD) $(OBJS_OTHER)
-+	$(FC) -shared $^ -Wl,-soname,lib$(ARITH)mumps$(PLAT)-5.1.2.so -L$(libdir) -lmumps_common$(PLAT) $(LORDERINGS) $(MPIFLIB) $(LEXTRAS) $(LIBBLAS) $(SCALAP) $(LAPACK) -o $(libdir)/lib$(ARITH)mumps$(PLAT)-5.1.2.so -Wl,-z,defs
-+	ln -s lib$(ARITH)mumps$(PLAT)-5.1.2.so $@
++	$(FC) -shared $^ -Wl,-soname,lib$(ARITH)mumps$(PLAT)-5.2.1.so -L$(libdir) -lmumps_common$(PLAT) $(LORDERINGS) $(MPIFLIB) $(LEXTRAS) $(LIBBLAS) $(SCALAP) $(LAPACK) -o $(libdir)/lib$(ARITH)mumps$(PLAT)-5.2.1.so -Wl,-z,defs
++	ln -s lib$(ARITH)mumps$(PLAT)-5.2.1.so $@
 +
  # Dependencies between modules:
  $(ARITH)mumps_load.o:		$(ARITH)mumps_comm_buffer.o \
diff --git a/gnu/packages/patches/mumps-shared-pord.patch b/gnu/packages/patches/mumps-shared-pord.patch
index 48062d4f89..d3915b0ad9 100644
--- a/gnu/packages/patches/mumps-shared-pord.patch
+++ b/gnu/packages/patches/mumps-shared-pord.patch
@@ -24,8 +24,8 @@ Index: mumps/PORD/lib/Makefile
  	$(RANLIB) $@
  
 +libpord$(PLAT).so: $(OBJS)
-+	$(CC) -shared $(OBJS) -Wl,-soname,libpord$(PLAT)-5.1.2.so -o libpord$(PLAT)-5.1.2.so -Wl,-z,defs
-+	ln -s libpord$(PLAT)-5.1.2.so $@
++	$(CC) -shared $(OBJS) -Wl,-soname,libpord$(PLAT)-5.2.1.so -o libpord$(PLAT)-5.2.1.so -Wl,-z,defs
++	ln -s libpord$(PLAT)-5.2.1.so $@
 +
  clean:
  	rm -f *.o
diff --git a/gnu/packages/patches/qtbase-QTBUG-81715.patch b/gnu/packages/patches/qtbase-QTBUG-81715.patch
new file mode 100644
index 0000000000..70b83b97d2
--- /dev/null
+++ b/gnu/packages/patches/qtbase-QTBUG-81715.patch
@@ -0,0 +1,40 @@
+From 8a3fde00bf53d99e9e4853e8ab97b0e1bcf74915 Mon Sep 17 00:00:00 2001
+From: Joerg Bornemann <joerg.bornemann@qt.io>
+Date: Wed, 29 Jan 2020 11:06:35 +0100
+Subject: [PATCH] Fix qt5_make_output_file macro for paths containing dots
+
+Commit 89bd5a7e broke CMake projects that use dots in their build
+paths, because the used regular expression matches the directory part
+of the path as well.
+
+The regex wants to achieve the same as get_filename_component(...
+NAME_WLE) which is available since CMake 3.14. Re-implement the
+NAME_WLE functionality for older CMake versions by using multiple
+get_filename_component calls.
+
+Fixes: QTBUG-81715
+Task-number: QTBUG-80295
+Change-Id: I2ef053300948f6e1b2c0c5eafac35105f193d4e6
+Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
+---
+
+diff --git a/src/corelib/Qt5CoreMacros.cmake b/src/corelib/Qt5CoreMacros.cmake
+index 7735e51..b3da640 100644
+--- a/src/corelib/Qt5CoreMacros.cmake
++++ b/src/corelib/Qt5CoreMacros.cmake
+@@ -59,7 +59,14 @@
+     set(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${rel}")
+     string(REPLACE ".." "__" _outfile ${_outfile})
+     get_filename_component(outpath ${_outfile} PATH)
+-    string(REGEX REPLACE "\\.[^.]*$" "" _outfile ${_outfile})
++    if(CMAKE_VERSION VERSION_LESS "3.14")
++        get_filename_component(_outfile_ext ${_outfile} EXT)
++        get_filename_component(_outfile_ext ${_outfile_ext} NAME_WE)
++        get_filename_component(_outfile ${_outfile} NAME_WE)
++        string(APPEND _outfile ${_outfile_ext})
++    else()
++        get_filename_component(_outfile ${_outfile} NAME_WLE)
++    endif()
+     file(MAKE_DIRECTORY ${outpath})
+     set(${outfile} ${outpath}/${prefix}${_outfile}.${ext})
+ endmacro()
diff --git a/gnu/packages/patches/racket-store-checksum-override.patch b/gnu/packages/patches/racket-store-checksum-override.patch
index 236c843de1..6c4ebcf022 100644
--- a/gnu/packages/patches/racket-store-checksum-override.patch
+++ b/gnu/packages/patches/racket-store-checksum-override.patch
@@ -11,26 +11,15 @@ See <https://debbugs.gnu.org/30680> for details.
 ---
 --- a/collects/compiler/private/cm-minimal.rkt
 +++ b/collects/compiler/private/cm-minimal.rkt
-@@ -7,6 +7,7 @@
+@@ -6,6 +6,7 @@
           racket/list
           racket/path
           racket/promise
 +         racket/string
           file/sha1
-          setup/collects
           setup/cross-system
-@@ -940,6 +941,10 @@
-       #f
-       (list src-hash recorded-hash)))
- 
-+(define (store-reference? path)
-+  (let ([store-prefix (or (getenv "NIX_STORE") "/gnu/store")])
-+    (string-prefix? (path->string path) store-prefix)))
-+
- (define (rkt->ss p)
-   (if (path-has-extension? p #".rkt")
-       (path-replace-extension p #".ss")
-@@ -1015,6 +1020,7 @@
+          compiler/compilation-path
+@@ -268,7 +269,8 @@
                 (trace-printf "newer src... ~a > ~a" path-time path-zo-time)
                 (maybe-compile-zo deps path->mode roots path orig-path read-src-syntax up-to-date collection-cache new-seen
                                   #:trying-sha1? sha1-only?)]
@@ -39,4 +28,15 @@ See <https://debbugs.gnu.org/30680> for details.
 +                    (different-source-sha1-and-dep-recorded path deps))
                 => (lambda (difference)
                      (trace-printf "different src hash ~a for ~a..." difference path)
-                     (maybe-compile-zo deps path->mode roots path orig-path read-src-syntax up-to-date collection-cache new-seen
\ No newline at end of file
+                     (maybe-compile-zo deps path->mode roots path orig-path read-src-syntax up-to-date collection-cache new-seen
+@@ -1012,5 +1014,9 @@
+       #f
+       (list src-hash recorded-hash)))
+
++(define (store-reference? path)
++  (let ([store-prefix (or (getenv "NIX_STORE") "/gnu/store")])
++    (string-prefix? (path->string path) store-prefix)))
++
+ ;; Make sure `recompile-from` is machine-independent so that
+ ;; recompilation makes sense.
+ ;; The compilation lock must is held for the source of `recompile-from`.
\ No newline at end of file
diff --git a/gnu/packages/patches/upx-fix-CVE-2017-15056.patch b/gnu/packages/patches/upx-fix-CVE-2017-15056.patch
deleted file mode 100644
index 525980e73e..0000000000
--- a/gnu/packages/patches/upx-fix-CVE-2017-15056.patch
+++ /dev/null
@@ -1,96 +0,0 @@
-From 3e0c2966dffb5dadb512a476ef4be3d0cc51c2be Mon Sep 17 00:00:00 2001
-From: Pierre Neidhardt <ambrevar@gmail.com>
-Date: Sat, 16 Jun 2018 16:35:00 +0200
-Subject: [PATCH] Protect against bad crafted input
-
-Also check for wrap-around when checking oversize involving e_shoff and e_shnum.
-
-raised by https://github.com/upx/upx/pull/190
-	modified:   p_lx_elf.cpp
----
- src/p_lx_elf.cpp | 30 ++++++++++++++++++++++++++++++
- 1 file changed, 30 insertions(+)
-
-diff --git a/src/p_lx_elf.cpp b/src/p_lx_elf.cpp
-index 822a7652..41e805ee 100644
---- a/src/p_lx_elf.cpp
-+++ b/src/p_lx_elf.cpp
-@@ -235,8 +235,17 @@ PackLinuxElf32::PackLinuxElf32help1(InputFile *f)
-         sz_phdrs = 0;
-         return;
-     }
-+    if (0==e_phnum) throwCantUnpack("0==e_phnum");
-     e_phoff = get_te32(&ehdri.e_phoff);
-+    unsigned const last_Phdr = e_phoff + e_phnum * sizeof(Elf32_Phdr);
-+    if (last_Phdr < e_phoff || (unsigned long)file_size < last_Phdr) {
-+        throwCantUnpack("bad e_phoff");
-+    }
-     e_shoff = get_te32(&ehdri.e_shoff);
-+    unsigned const last_Shdr = e_shoff + e_shnum * sizeof(Elf32_Shdr);
-+    if (last_Shdr < e_shoff || (unsigned long)file_size < last_Shdr) {
-+        throwCantUnpack("bad e_shoff");
-+    }
-     sz_phdrs = e_phnum * e_phentsize;
- 
-     if (f && Elf32_Ehdr::ET_DYN!=e_type) {
-@@ -599,8 +608,17 @@ PackLinuxElf64::PackLinuxElf64help1(InputFile *f)
-         sz_phdrs = 0;
-         return;
-     }
-+    if (0==e_phnum) throwCantUnpack("0==e_phnum");
-     e_phoff = get_te64(&ehdri.e_phoff);
-+    upx_uint64_t const last_Phdr = e_phoff + e_phnum * sizeof(Elf64_Phdr);
-+    if (last_Phdr < e_phoff || (unsigned long)file_size < last_Phdr) {
-+        throwCantUnpack("bad e_phoff");
-+    }
-     e_shoff = get_te64(&ehdri.e_shoff);
-+    upx_uint64_t const last_Shdr = e_shoff + e_shnum * sizeof(Elf64_Shdr);
-+    if (last_Shdr < e_shoff || (unsigned long)file_size < last_Shdr) {
-+        throwCantUnpack("bad e_shoff");
-+    }
-     sz_phdrs = e_phnum * e_phentsize;
- 
-     if (f && Elf64_Ehdr::ET_DYN!=e_type) {
-@@ -3763,6 +3781,9 @@ void PackLinuxElf64::pack4(OutputFile *fo, Filter &ft)
- 
- void PackLinuxElf64::unpack(OutputFile *fo)
- {
-+    if (e_phoff != sizeof(Elf64_Ehdr)) {// Phdrs not contiguous with Ehdr
-+        throwCantUnpack("bad e_phoff");
-+    }
-     unsigned const c_phnum = get_te16(&ehdri.e_phnum);
-     upx_uint64_t old_data_off = 0;
-     upx_uint64_t old_data_len = 0;
-@@ -3828,6 +3849,9 @@ void PackLinuxElf64::unpack(OutputFile *fo)
-     unsigned total_out = 0;
-     unsigned c_adler = upx_adler32(NULL, 0);
-     unsigned u_adler = upx_adler32(NULL, 0);
-+    if ((MAX_ELF_HDR - sizeof(Elf64_Ehdr))/sizeof(Elf64_Phdr) < u_phnum) {
-+        throwCantUnpack("bad compressed e_phnum");
-+    }
- 
-     // Packed ET_EXE has no PT_DYNAMIC.
-     // Packed ET_DYN has original PT_DYNAMIC for info needed by rtld.
-@@ -4383,6 +4407,9 @@ Elf64_Sym const *PackLinuxElf64::elf_lookup(char const *name) const
- 
- void PackLinuxElf32::unpack(OutputFile *fo)
- {
-+    if (e_phoff != sizeof(Elf32_Ehdr)) {// Phdrs not contiguous with Ehdr
-+        throwCantUnpack("bad e_phoff");
-+    }
-     unsigned const c_phnum = get_te16(&ehdri.e_phnum);
-     unsigned old_data_off = 0;
-     unsigned old_data_len = 0;
-@@ -4449,6 +4476,9 @@ void PackLinuxElf32::unpack(OutputFile *fo)
-     unsigned total_out = 0;
-     unsigned c_adler = upx_adler32(NULL, 0);
-     unsigned u_adler = upx_adler32(NULL, 0);
-+    if ((MAX_ELF_HDR - sizeof(Elf32_Ehdr))/sizeof(Elf32_Phdr) < u_phnum) {
-+        throwCantUnpack("bad compressed e_phnum");
-+    }
- 
-     // Packed ET_EXE has no PT_DYNAMIC.
-     // Packed ET_DYN has original PT_DYNAMIC for info needed by rtld.
--- 
-2.17.0
-
diff --git a/gnu/packages/patches/zziplib-CVE-2018-16548.patch b/gnu/packages/patches/zziplib-CVE-2018-16548.patch
new file mode 100644
index 0000000000..a17c6a9768
--- /dev/null
+++ b/gnu/packages/patches/zziplib-CVE-2018-16548.patch
@@ -0,0 +1,49 @@
+The following 3 patches applied to 0.13.69 in this order, combined:
+https://github.com/gdraheim/zziplib/commit/9411bde3e4a70a81ff3ffd256b71927b2d90dcbb.patch
+https://github.com/gdraheim/zziplib/commit/d2e5d5c53212e54a97ad64b793a4389193fec687.patch
+https://github.com/gdraheim/zziplib/commit/0e1dadb05c1473b9df2d7b8f298dab801778ef99.patch
+
+diff --git a/test/test.zip b/test/test.zip
+index 2c992ea..952d475 100644
+Binary files a/test/test.zip and b/test/test.zip differ
+diff --git a/zzip/zip.c b/zzip/zip.c
+index 14e2e06..f97a40a 100644
+--- a/zzip/zip.c
++++ b/zzip/zip.c
+@@ -472,9 +472,15 @@ __zzip_parse_root_directory(int fd,
+         } else
+         {
+             if (io->fd.seeks(fd, zz_rootseek + zz_offset, SEEK_SET) < 0)
++	    {
++	    	free(hdr0);
+                 return ZZIP_DIR_SEEK;
++	    }
+             if (io->fd.read(fd, &dirent, sizeof(dirent)) < __sizeof(dirent))
++	    {
++	    	free(hdr0);
+                 return ZZIP_DIR_READ;
++	    }
+             d = &dirent;
+         }
+ 
+@@ -574,11 +580,18 @@ __zzip_parse_root_directory(int fd,
+ 
+         if (hdr_return)
+             *hdr_return = hdr0;
++	else
++	{
++	    /* If it is not assigned to *hdr_return, it will never be free()'d */
++	    free(hdr0);
++	}
+     }                           /* else zero (sane) entries */
++    else
++        free(hdr0);
+ #  ifndef ZZIP_ALLOW_MODULO_ENTRIES
+-    return (entries != zz_entries ? ZZIP_CORRUPTED : 0);
++    return (entries != zz_entries) ? ZZIP_CORRUPTED : 0;
+ #  else
+-    return ((entries & (unsigned)0xFFFF) != zz_entries ? ZZIP_CORRUPTED : 0);
++    return ((entries & (unsigned)0xFFFF) != zz_entries) ? ZZIP_CORRUPTED : 0;
+ #  endif
+ }
+