summaryrefslogtreecommitdiff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2019-06-20 23:38:56 +0200
committerMarius Bakke <mbakke@fastmail.com>2019-06-20 23:38:56 +0200
commit6cb1ef9ea28ee14b3bb5442e8af1f54c27802f09 (patch)
treec2c35f733d250f86eb052d174fcb1c24a54fea79 /gnu/packages/patches
parent20e4ee1e3b7044d9f64de02c6237b00e5a57da35 (diff)
parent010689e7067df1288af29176f4a8639de816b1ef (diff)
Merge branch 'staging' into core-updates
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/benchmark-unbundle-googletest.patch69
-rw-r--r--gnu/packages/patches/dbus-CVE-2019-12749.patch116
-rw-r--r--gnu/packages/patches/dstat-fix-crash-when-specifying-delay.patch48
-rw-r--r--gnu/packages/patches/dstat-skip-devices-without-io.patch32
-rw-r--r--gnu/packages/patches/emacs-unpackaged-req.patch24
-rw-r--r--gnu/packages/patches/inkscape-poppler-compat3.patch499
-rw-r--r--gnu/packages/patches/open-zwave-hidapi.patch15
-rw-r--r--gnu/packages/patches/ratpoints-sturm_and_rp_private.patch194
-rw-r--r--gnu/packages/patches/ri-li-modernize_cpp.patch391
-rw-r--r--gnu/packages/patches/symmetrica-bruch.patch38
-rw-r--r--gnu/packages/patches/symmetrica-int32.patch37
-rw-r--r--gnu/packages/patches/symmetrica-return_values.patch14
-rw-r--r--gnu/packages/patches/symmetrica-sort_sum_rename.patch340
13 files changed, 1318 insertions, 499 deletions
diff --git a/gnu/packages/patches/benchmark-unbundle-googletest.patch b/gnu/packages/patches/benchmark-unbundle-googletest.patch
new file mode 100644
index 0000000000..4dce8f59f1
--- /dev/null
+++ b/gnu/packages/patches/benchmark-unbundle-googletest.patch
@@ -0,0 +1,69 @@
+From 5eb306618196ea78b8c9390e22ea2edce20760fe Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?G=C3=A1bor=20Boskovits?= <boskovits@gmail.com>
+Date: Fri, 14 Jun 2019 22:15:49 +0200
+Subject: [PATCH] Remove googletest lookup from build system.
+
+---
+ cmake/GoogleTest.cmake | 18 +++++++++---------
+ cmake/GoogleTest.cmake.in | 12 ++++++------
+ 2 files changed, 15 insertions(+), 15 deletions(-)
+
+diff --git a/cmake/GoogleTest.cmake b/cmake/GoogleTest.cmake
+index fb7c6be..a6c473b 100644
+--- a/cmake/GoogleTest.cmake
++++ b/cmake/GoogleTest.cmake
+@@ -27,15 +27,15 @@ endif()
+ # settings on Windows
+ set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
+
+-include(${GOOGLETEST_PREFIX}/googletest-paths.cmake)
++#include(${GOOGLETEST_PREFIX}/googletest-paths.cmake)
+
+ # Add googletest directly to our build. This defines
+ # the gtest and gtest_main targets.
+-add_subdirectory(${GOOGLETEST_SOURCE_DIR}
+- ${GOOGLETEST_BINARY_DIR}
+- EXCLUDE_FROM_ALL)
+-
+-set_target_properties(gtest PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:gtest,INTERFACE_INCLUDE_DIRECTORIES>)
+-set_target_properties(gtest_main PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:gtest_main,INTERFACE_INCLUDE_DIRECTORIES>)
+-set_target_properties(gmock PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:gmock,INTERFACE_INCLUDE_DIRECTORIES>)
+-set_target_properties(gmock_main PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:gmock_main,INTERFACE_INCLUDE_DIRECTORIES>)
++#add_subdirectory(${GOOGLETEST_SOURCE_DIR}
++# ${GOOGLETEST_BINARY_DIR}
++# EXCLUDE_FROM_ALL)
++
++#set_target_properties(gtest PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:gtest,INTERFACE_INCLUDE_DIRECTORIES>)
++#set_target_properties(gtest_main PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:gtest_main,INTERFACE_INCLUDE_DIRECTORIES>)
++#set_target_properties(gmock PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:gmock,INTERFACE_INCLUDE_DIRECTORIES>)
++#set_target_properties(gmock_main PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:gmock_main,INTERFACE_INCLUDE_DIRECTORIES>)
+diff --git a/cmake/GoogleTest.cmake.in b/cmake/GoogleTest.cmake.in
+index 28818ee..13b0888 100644
+--- a/cmake/GoogleTest.cmake.in
++++ b/cmake/GoogleTest.cmake.in
+@@ -31,7 +31,7 @@ if(EXISTS "${GOOGLETEST_PATH}" AND IS_DIRECTORY "${GOOGLETEST_PATH}"
+ )
+ else()
+ if(NOT ALLOW_DOWNLOADING_GOOGLETEST)
+- message(SEND_ERROR "Did not find Google Test sources! Either pass correct path in GOOGLETEST_PATH, or enable ALLOW_DOWNLOADING_GOOGLETEST, or disable BENCHMARK_ENABLE_GTEST_TESTS / BENCHMARK_ENABLE_TESTING.")
++ message(WARNING "Did not find Google Test sources! Either pass correct path in GOOGLETEST_PATH, or enable ALLOW_DOWNLOADING_GOOGLETEST, or disable BENCHMARK_ENABLE_GTEST_TESTS / BENCHMARK_ENABLE_TESTING.")
+ else()
+ message(WARNING "Did not find Google Test sources! Fetching from web...")
+ ExternalProject_Add(
+@@ -51,8 +51,8 @@ else()
+ endif()
+ endif()
+
+-ExternalProject_Get_Property(googletest SOURCE_DIR BINARY_DIR)
+-file(WRITE googletest-paths.cmake
+-"set(GOOGLETEST_SOURCE_DIR \"${SOURCE_DIR}\")
+-set(GOOGLETEST_BINARY_DIR \"${BINARY_DIR}\")
+-")
++#ExternalProject_Get_Property(googletest SOURCE_DIR BINARY_DIR)
++#file(WRITE googletest-paths.cmake
++#"set(GOOGLETEST_SOURCE_DIR \"${SOURCE_DIR}\")
++#set(GOOGLETEST_BINARY_DIR \"${BINARY_DIR}\")
++#")
+--
+2.22.0
+
diff --git a/gnu/packages/patches/dbus-CVE-2019-12749.patch b/gnu/packages/patches/dbus-CVE-2019-12749.patch
new file mode 100644
index 0000000000..12106f4589
--- /dev/null
+++ b/gnu/packages/patches/dbus-CVE-2019-12749.patch
@@ -0,0 +1,116 @@
+From 47b1a4c41004bf494b87370987b222c934b19016 Mon Sep 17 00:00:00 2001
+From: Simon McVittie <smcv@collabora.com>
+Date: Thu, 30 May 2019 12:53:03 +0100
+Subject: [PATCH] auth: Reject DBUS_COOKIE_SHA1 for users other than the server
+ owner
+
+The DBUS_COOKIE_SHA1 authentication mechanism aims to prove ownership
+of a shared home directory by having the server write a secret "cookie"
+into a .dbus-keyrings subdirectory of the desired identity's home
+directory with 0700 permissions, and having the client prove that it can
+read the cookie. This never actually worked for non-malicious clients in
+the case where server uid != client uid (unless the server and client
+both have privileges, such as Linux CAP_DAC_OVERRIDE or traditional
+Unix uid 0) because an unprivileged server would fail to write out the
+cookie, and an unprivileged client would be unable to read the resulting
+file owned by the server.
+
+Additionally, since dbus 1.7.10 we have checked that ~/.dbus-keyrings
+is owned by the uid of the server (a side-effect of a check added to
+harden our use of XDG_RUNTIME_DIR), further ruling out successful use
+by a non-malicious client with a uid differing from the server's.
+
+Joe Vennix of Apple Information Security discovered that the
+implementation of DBUS_COOKIE_SHA1 was susceptible to a symbolic link
+attack: a malicious client with write access to its own home directory
+could manipulate a ~/.dbus-keyrings symlink to cause the DBusServer to
+read and write in unintended locations. In the worst case this could
+result in the DBusServer reusing a cookie that is known to the
+malicious client, and treating that cookie as evidence that a subsequent
+client connection came from an attacker-chosen uid, allowing
+authentication bypass.
+
+This is mitigated by the fact that by default, the well-known system
+dbus-daemon (since 2003) and the well-known session dbus-daemon (in
+stable releases since dbus 1.10.0 in 2015) only accept the EXTERNAL
+authentication mechanism, and as a result will reject DBUS_COOKIE_SHA1
+at an early stage, before manipulating cookies. As a result, this
+vulnerability only applies to:
+
+* system or session dbus-daemons with non-standard configuration
+* third-party dbus-daemon invocations such as at-spi2-core (although
+ in practice at-spi2-core also only accepts EXTERNAL by default)
+* third-party uses of DBusServer such as the one in Upstart
+
+Avoiding symlink attacks in a portable way is difficult, because APIs
+like openat() and Linux /proc/self/fd are not universally available.
+However, because DBUS_COOKIE_SHA1 already doesn't work in practice for
+a non-matching uid, we can solve this vulnerability in an easier way
+without regressions, by rejecting it early (before looking at
+~/.dbus-keyrings) whenever the requested identity doesn't match the
+identity of the process hosting the DBusServer.
+
+Signed-off-by: Simon McVittie <smcv@collabora.com>
+Closes: https://gitlab.freedesktop.org/dbus/dbus/issues/269
+Closes: CVE-2019-12749
+---
+ dbus/dbus-auth.c | 32 ++++++++++++++++++++++++++++++++
+ 1 file changed, 32 insertions(+)
+
+diff --git a/dbus/dbus-auth.c b/dbus/dbus-auth.c
+index 37d8d4c9..7390a9d5 100644
+--- a/dbus/dbus-auth.c
++++ b/dbus/dbus-auth.c
+@@ -529,6 +529,7 @@ sha1_handle_first_client_response (DBusAuth *auth,
+ DBusString tmp2;
+ dbus_bool_t retval = FALSE;
+ DBusError error = DBUS_ERROR_INIT;
++ DBusCredentials *myself = NULL;
+
+ _dbus_string_set_length (&auth->challenge, 0);
+
+@@ -565,6 +566,34 @@ sha1_handle_first_client_response (DBusAuth *auth,
+ return FALSE;
+ }
+
++ myself = _dbus_credentials_new_from_current_process ();
++
++ if (myself == NULL)
++ goto out;
++
++ if (!_dbus_credentials_same_user (myself, auth->desired_identity))
++ {
++ /*
++ * DBUS_COOKIE_SHA1 is not suitable for authenticating that the
++ * client is anyone other than the user owning the process
++ * containing the DBusServer: we probably aren't allowed to write
++ * to other users' home directories. Even if we can (for example
++ * uid 0 on traditional Unix or CAP_DAC_OVERRIDE on Linux), we
++ * must not, because the other user controls their home directory,
++ * and could carry out symlink attacks to make us read from or
++ * write to unintended locations. It's difficult to avoid symlink
++ * attacks in a portable way, so we just don't try. This isn't a
++ * regression, because DBUS_COOKIE_SHA1 never worked for other
++ * users anyway.
++ */
++ _dbus_verbose ("%s: client tried to authenticate as \"%s\", "
++ "but that doesn't match this process",
++ DBUS_AUTH_NAME (auth),
++ _dbus_string_get_const_data (data));
++ retval = send_rejected (auth);
++ goto out;
++ }
++
+ /* we cache the keyring for speed, so here we drop it if it's the
+ * wrong one. FIXME caching the keyring here is useless since we use
+ * a different DBusAuth for every connection.
+@@ -679,6 +708,9 @@ sha1_handle_first_client_response (DBusAuth *auth,
+ _dbus_string_zero (&tmp2);
+ _dbus_string_free (&tmp2);
+
++ if (myself != NULL)
++ _dbus_credentials_unref (myself);
++
+ return retval;
+ }
+
diff --git a/gnu/packages/patches/dstat-fix-crash-when-specifying-delay.patch b/gnu/packages/patches/dstat-fix-crash-when-specifying-delay.patch
new file mode 100644
index 0000000000..0b59387dc9
--- /dev/null
+++ b/gnu/packages/patches/dstat-fix-crash-when-specifying-delay.patch
@@ -0,0 +1,48 @@
+From: Tobias Geerinckx-Rice <me@tobias.gr>
+Date: Sun, 16 Jun 2019 02:34:10 +0200
+Subject: [PATCH] gnu: dstat: Fix crash when specifying a delay.
+
+Taken verbatim from a pull request[0] that will never be merged.
+
+[0]: https://github.com/dagwieers/dstat/pull/167
+
+From 220a785321b13b6df92a536080aca6ef1cb644ad Mon Sep 17 00:00:00 2001
+From: Falko Goettsch <falko@uw.edu>
+Date: Mon, 11 Mar 2019 20:12:49 -0700
+Subject: [PATCH] Fixed bug when specifying a delay
+
+The division in the 'loop' calculation in perform() was returning floating point values
+after the migration to Python 3, rather than rounding down. Changed to floor division.
+
+I think the floating point values kept 'loop == 0' from ever being
+true and the variables inside that conditional were never initialized,
+causing the following error when a delay other than 1 was specified:
+
+You did not select any stats, using -cdngy by default.
+Traceback (most recent call last):
+ File "/home/falko/repos/dstat/dstat", line 2825, in <module>
+ main()
+ File "/home/falko/repos/dstat/dstat", line 2684, in main
+ scheduler.run()
+ File "/home/falko/.conda/envs/python3/lib/python3.7/sched.py", line 151, in run
+ action(*argument, **kwargs)
+ File "/home/falko/repos/dstat/dstat", line 2729, in perform
+ oldcols = cols
+NameError: name 'cols' is not defined
+---
+ dstat | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/dstat b/dstat
+index 9359965..3b4980f 100755
+--- a/dstat
++++ b/dstat
+@@ -2697,7 +2697,7 @@ def perform(update):
+
+ starttime = time.time()
+
+- loop = (update - 1 + op.delay) / op.delay
++ loop = (update - 1 + op.delay) // op.delay
+ step = ((update - 1) % op.delay) + 1
+
+ ### Get current time (may be different from schedule) for debugging
diff --git a/gnu/packages/patches/dstat-skip-devices-without-io.patch b/gnu/packages/patches/dstat-skip-devices-without-io.patch
new file mode 100644
index 0000000000..eb0910f501
--- /dev/null
+++ b/gnu/packages/patches/dstat-skip-devices-without-io.patch
@@ -0,0 +1,32 @@
+From: Tobias Geerinckx-Rice <me@tobias.gr>
+Date: Sun, 16 Jun 2019 02:36:23 +0200
+Subject: [PATCH] gnu: dstat: Skip devices without I/O.
+
+Taken verbatim from a pull request[0] that will never be merged.
+
+[0]: https://github.com/dagwieers/dstat/pull/164
+
+From 0988589ea4ee092b285bd4049d56add5f61e3f69 Mon Sep 17 00:00:00 2001
+From: Tobias Gruetzmacher <tobias-git@23.gs>
+Date: Fri, 15 Feb 2019 18:46:57 +0100
+Subject: [PATCH] Skip devices without I/O
+
+Linux 4.18+ has added more fields to the diskstats proc file, so the
+original skip condition for devices without I/O didn't apply anymore.
+---
+ dstat | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/dstat b/dstat
+index 9359965..5c2fb53 100755
+--- a/dstat
++++ b/dstat
+@@ -763,7 +763,7 @@ class dstat_disk(dstat):
+ ret = []
+ for l in self.splitlines():
+ if len(l) < 13: continue
+- if l[3:] == ['0',] * 11: continue
++ if l[3:] == ['0',] * (len(l) - 3): continue
+ name = l[2]
+ ret.append(name)
+ for item in objlist: ret.append(item)
diff --git a/gnu/packages/patches/emacs-unpackaged-req.patch b/gnu/packages/patches/emacs-unpackaged-req.patch
new file mode 100644
index 0000000000..ddb9277610
--- /dev/null
+++ b/gnu/packages/patches/emacs-unpackaged-req.patch
@@ -0,0 +1,24 @@
+From e5be173e201710538464c279335bef735a327a68 Mon Sep 17 00:00:00 2001
+From: Brian Leung <bkleung89@gmail.com>
+Date: Tue, 18 Jun 2019 06:37:46 +0200
+Subject: [PATCH] Add missing require.
+
+---
+ unpackaged.el | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/unpackaged.el b/unpackaged.el
+index 2d46b3c..e62184a 100644
+--- a/unpackaged.el
++++ b/unpackaged.el
+@@ -38,6 +38,7 @@
+ (require 'dash)
+ (require 's)
+ (require 'use-package)
++(require 'hydra)
+
+ ;;; Faces, fonts
+
+--
+2.22.0
+
diff --git a/gnu/packages/patches/inkscape-poppler-compat3.patch b/gnu/packages/patches/inkscape-poppler-compat3.patch
deleted file mode 100644
index eaaf7d93f1..0000000000
--- a/gnu/packages/patches/inkscape-poppler-compat3.patch
+++ /dev/null
@@ -1,499 +0,0 @@
-Fix compatibility with Poppler >= 0.69.
-
-This is a combination of these upstream commits:
-https://gitlab.com/inkscape/inkscape/commit/722e121361d0f784083d10e897155b7d4e44e515
-https://gitlab.com/inkscape/inkscape/commit/402c0274420fe39fd2f3393bc7d8d8879d436358
-
-...with slight adjustments for the 0.92.3 release tarball.
-
-diff --git a/CMakeScripts/DefineDependsandFlags.cmake b/CMakeScripts/DefineDependsandFlags.cmake
---- a/CMakeScripts/DefineDependsandFlags.cmake
-+++ b/CMakeScripts/DefineDependsandFlags.cmake
-@@ -116,18 +116,6 @@ if(ENABLE_POPPLER)
- set(HAVE_POPPLER_GLIB ON)
- endif()
- endif()
-- if(POPPLER_VERSION VERSION_GREATER "0.26.0" OR
-- POPPLER_VERSION VERSION_EQUAL "0.26.0")
-- set(POPPLER_EVEN_NEWER_COLOR_SPACE_API ON)
-- endif()
-- if(POPPLER_VERSION VERSION_GREATER "0.29.0" OR
-- POPPLER_VERSION VERSION_EQUAL "0.29.0")
-- set(POPPLER_EVEN_NEWER_NEW_COLOR_SPACE_API ON)
-- endif()
-- if(POPPLER_VERSION VERSION_GREATER "0.58.0" OR
-- POPPLER_VERSION VERSION_EQUAL "0.58.0")
-- set(POPPLER_NEW_OBJECT_API ON)
-- endif()
- else()
- set(ENABLE_POPPLER_CAIRO OFF)
- endif()
-diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp
---- a/src/extension/internal/pdfinput/pdf-input.cpp
-+++ b/src/extension/internal/pdfinput/pdf-input.cpp
-@@ -793,7 +793,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) {
- dlg->getImportSettings(prefs);
-
- // Apply crop settings
-- PDFRectangle *clipToBox = NULL;
-+ _POPPLER_CONST PDFRectangle *clipToBox = NULL;
- double crop_setting;
- sp_repr_get_double(prefs, "cropTo", &crop_setting);
-
-diff --git a/src/extension/internal/pdfinput/pdf-input.h b/src/extension/internal/pdfinput/pdf-input.h
---- a/src/extension/internal/pdfinput/pdf-input.h
-+++ b/src/extension/internal/pdfinput/pdf-input.h
-@@ -15,6 +15,7 @@
- #endif
-
- #ifdef HAVE_POPPLER
-+#include "poppler-transition-api.h"
-
- #include <gtkmm/dialog.h>
-
-diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
---- a/src/extension/internal/pdfinput/pdf-parser.cpp
-+++ b/src/extension/internal/pdfinput/pdf-parser.cpp
-@@ -36,6 +36,7 @@ extern "C" {
- #include "pdf-parser.h"
- #include "util/units.h"
-
-+#include "glib/poppler-features.h"
- #include "goo/gmem.h"
- #include "goo/GooString.h"
- #include "GlobalParams.h"
-@@ -294,8 +295,8 @@ PdfParser::PdfParser(XRef *xrefA,
- int /*pageNum*/,
- int rotate,
- Dict *resDict,
-- PDFRectangle *box,
-- PDFRectangle *cropBox) :
-+ _POPPLER_CONST PDFRectangle *box,
-+ _POPPLER_CONST PDFRectangle *cropBox) :
- xref(xrefA),
- builder(builderA),
- subPage(gFalse),
-@@ -317,7 +318,7 @@ PdfParser::PdfParser(XRef *xrefA,
- builder->setDocumentSize(Inkscape::Util::Quantity::convert(state->getPageWidth(), "pt", "px"),
- Inkscape::Util::Quantity::convert(state->getPageHeight(), "pt", "px"));
-
-- double *ctm = state->getCTM();
-+ const double *ctm = state->getCTM();
- double scaledCTM[6];
- for (int i = 0; i < 6; ++i) {
- baseMatrix[i] = ctm[i];
-@@ -352,7 +353,7 @@ PdfParser::PdfParser(XRef *xrefA,
- PdfParser::PdfParser(XRef *xrefA,
- Inkscape::Extension::Internal::SvgBuilder *builderA,
- Dict *resDict,
-- PDFRectangle *box) :
-+ _POPPLER_CONST PDFRectangle *box) :
- xref(xrefA),
- builder(builderA),
- subPage(gTrue),
-@@ -571,7 +572,7 @@ const char *PdfParser::getPreviousOperator(unsigned int look_back) {
-
- void PdfParser::execOp(Object *cmd, Object args[], int numArgs) {
- PdfOperator *op;
-- char *name;
-+ const char *name;
- Object *argPtr;
- int i;
-
-@@ -619,7 +620,7 @@ void PdfParser::execOp(Object *cmd, Object args[], int numArgs) {
- (this->*op->func)(argPtr, numArgs);
- }
-
--PdfOperator* PdfParser::findOp(char *name) {
-+PdfOperator* PdfParser::findOp(const char *name) {
- int a = -1;
- int b = numOps;
- int cmp = -1;
-@@ -1751,7 +1752,7 @@ void PdfParser::doShadingPatternFillFallback(GfxShadingPattern *sPat,
- GBool stroke, GBool eoFill) {
- GfxShading *shading;
- GfxPath *savedPath;
-- double *ctm, *btm, *ptm;
-+ const double *ctm, *btm, *ptm;
- double m[6], ictm[6], m1[6];
- double xMin, yMin, xMax, yMax;
- double det;
-@@ -1993,7 +1994,7 @@ void PdfParser::doFunctionShFill1(GfxFunctionShading *shading,
- GfxColor color0M, color1M, colorM0, colorM1, colorMM;
- GfxColor colors2[4];
- double functionColorDelta = colorDeltas[pdfFunctionShading-1];
-- double *matrix;
-+ const double *matrix;
- double xM, yM;
- int nComps, i, j;
-
-@@ -2173,7 +2174,7 @@ void PdfParser::doPatchMeshShFill(GfxPatchMeshShading *shading) {
- }
- }
-
--void PdfParser::fillPatch(GfxPatch *patch, int nComps, int depth) {
-+void PdfParser::fillPatch(_POPPLER_CONST GfxPatch *patch, int nComps, int depth) {
- GfxPatch patch00 = blankPatch();
- GfxPatch patch01 = blankPatch();
- GfxPatch patch10 = blankPatch();
-@@ -2581,7 +2582,11 @@ void PdfParser::opShowSpaceText(Object args[], int /*numArgs*/)
- }
- }
-
-+#if POPPLER_CHECK_VERSION(0,64,0)
- void PdfParser::doShowText(const GooString *s) {
-+#else
-+void PdfParser::doShowText(GooString *s) {
-+#endif
- GfxFont *font;
- int wMode;
- double riseX, riseY;
-@@ -2590,11 +2595,15 @@ void PdfParser::doShowText(const GooString *s) {
- double x, y, dx, dy, tdx, tdy;
- double originX, originY, tOriginX, tOriginY;
- double oldCTM[6], newCTM[6];
-- double *mat;
-+ const double *mat;
- Object charProc;
- Dict *resDict;
- Parser *oldParser;
-+#if POPPLER_CHECK_VERSION(0,64,0)
-+ const char *p;
-+#else
- char *p;
-+#endif
- int len, n, uLen;
-
- font = state->getFont();
-@@ -2630,7 +2639,7 @@ void PdfParser::doShowText(const GooString *s) {
- double lineX = state->getLineX();
- double lineY = state->getLineY();
- oldParser = parser;
-- p = g_strdup(s->getCString());
-+ p = s->getCString();
- len = s->getLength();
- while (len > 0) {
- n = font->getNextChar(p, len, &code,
-@@ -2685,7 +2694,7 @@ void PdfParser::doShowText(const GooString *s) {
-
- } else {
- state->textTransformDelta(0, state->getRise(), &riseX, &riseY);
-- p = g_strdup(s->getCString());
-+ p = s->getCString();
- len = s->getLength();
- while (len > 0) {
- n = font->getNextChar(p, len, &code,
-@@ -2731,7 +2740,11 @@ void PdfParser::opXObject(Object args[], int /*numArgs*/)
- {
- Object obj1, obj2, obj3, refObj;
-
-- char *name = g_strdup(args[0].getName());
-+#if POPPLER_CHECK_VERSION(0,64,0)
-+ const char *name = args[0].getName();
-+#else
-+ char *name = args[0].getName();
-+#endif
- #if defined(POPPLER_NEW_OBJECT_API)
- if ((obj1 = res->lookupXObject(name)).isNull()) {
- #else
-@@ -3656,7 +3669,6 @@ void PdfParser::opBeginImage(Object /*args*/[], int /*numArgs*/)
- Stream *PdfParser::buildImageStream() {
- Object dict;
- Object obj;
-- char *key;
- Stream *str;
-
- // build dictionary
-@@ -3674,26 +3686,17 @@ Stream *PdfParser::buildImageStream() {
- obj.free();
- #endif
- } else {
-- key = copyString(obj.getName());
--#if defined(POPPLER_NEW_OBJECT_API)
-- obj = parser->getObj();
--#else
-- obj.free();
-- parser->getObj(&obj);
--#endif
-- if (obj.isEOF() || obj.isError()) {
-- gfree(key);
-+ Object obj2;
-+ _POPPLER_CALL(obj2, parser->getObj);
-+ if (obj2.isEOF() || obj2.isError()) {
-+ _POPPLER_FREE(obj);
- break;
- }
--#if defined(POPPLER_NEW_OBJECT_API)
-- dict.dictAdd(key, std::move(obj));
-- }
-- obj = parser->getObj();
--#else
-- dict.dictAdd(key, &obj);
-+ _POPPLER_DICTADD(dict, obj.getName(), obj2);
-+ _POPPLER_FREE(obj);
-+ _POPPLER_FREE(obj2);
- }
-- parser->getObj(&obj);
--#endif
-+ _POPPLER_CALL(obj, parser->getObj);
- }
- if (obj.isEOF()) {
- error(errSyntaxError, getPos(), "End of file in inline image");
-diff --git a/src/extension/internal/pdfinput/pdf-parser.h b/src/extension/internal/pdfinput/pdf-parser.h
---- a/src/extension/internal/pdfinput/pdf-parser.h
-+++ b/src/extension/internal/pdfinput/pdf-parser.h
-@@ -9,6 +9,7 @@
- #define PDF_PARSER_H
-
- #ifdef HAVE_POPPLER
-+#include "poppler-transition-api.h"
-
- #ifdef USE_GCC_PRAGMAS
- #pragma interface
-@@ -25,6 +26,7 @@ namespace Inkscape {
- // TODO clean up and remove using:
- using Inkscape::Extension::Internal::SvgBuilder;
-
-+#include "glib/poppler-features.h"
- #include "goo/gtypes.h"
- #include "Object.h"
-
-@@ -127,11 +129,14 @@ public:
-
- // Constructor for regular output.
- PdfParser(XRef *xrefA, SvgBuilder *builderA, int pageNum, int rotate,
-- Dict *resDict, PDFRectangle *box, PDFRectangle *cropBox);
-+ Dict *resDict,
-+ _POPPLER_CONST PDFRectangle *box,
-+ _POPPLER_CONST PDFRectangle *cropBox);
-
- // Constructor for a sub-page object.
- PdfParser(XRef *xrefA, Inkscape::Extension::Internal::SvgBuilder *builderA,
-- Dict *resDict, PDFRectangle *box);
-+ Dict *resDict,
-+ _POPPLER_CONST PDFRectangle *box);
-
- virtual ~PdfParser();
-
-@@ -185,7 +190,7 @@ private:
-
- void go(GBool topLevel);
- void execOp(Object *cmd, Object args[], int numArgs);
-- PdfOperator *findOp(char *name);
-+ PdfOperator *findOp(const char *name);
- GBool checkArg(Object *arg, TchkType type);
- int getPos();
-
-@@ -256,7 +261,7 @@ private:
- double x2, double y2, GfxColor *color2,
- int nComps, int depth);
- void doPatchMeshShFill(GfxPatchMeshShading *shading);
-- void fillPatch(GfxPatch *patch, int nComps, int depth);
-+ void fillPatch(_POPPLER_CONST GfxPatch *patch, int nComps, int depth);
- void doEndPath();
-
- // path clipping operators
-@@ -287,7 +292,12 @@ private:
- void opMoveShowText(Object args[], int numArgs);
- void opMoveSetShowText(Object args[], int numArgs);
- void opShowSpaceText(Object args[], int numArgs);
-+#if POPPLER_CHECK_VERSION(0,64,0)
- void doShowText(const GooString *s);
-+#else
-+ void doShowText(GooString *s);
-+#endif
-+
-
- // XObject operators
- void opXObject(Object args[], int numArgs);
-diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
-new file mode 100644
---- /dev/null
-+++ b/src/extension/internal/pdfinput/poppler-transition-api.h
-@@ -0,0 +1,39 @@
-+#ifndef SEEN_POPPLER_TRANSITION_API_H
-+#define SEEN_POPPLER_TRANSITION_API_H
-+
-+#include <glib/poppler-features.h>
-+
-+#if POPPLER_CHECK_VERSION(0,70,0)
-+#define _POPPLER_CONST const
-+#else
-+#define _POPPLER_CONST
-+#endif
-+
-+#if POPPLER_CHECK_VERSION(0,69,0)
-+#define _POPPLER_DICTADD(dict, key, obj) (dict).dictAdd(key, std::move(obj))
-+#elif POPPLER_CHECK_VERSION(0,58,0)
-+#define _POPPLER_DICTADD(dict, key, obj) (dict).dictAdd(copyString(key), std::move(obj))
-+#else
-+#define _POPPLER_DICTADD(dict, key, obj) (dict).dictAdd(copyString(key), &obj)
-+#endif
-+
-+#if POPPLER_CHECK_VERSION(0,58,0)
-+#define POPPLER_NEW_OBJECT_API
-+#define _POPPLER_FREE(obj)
-+#define _POPPLER_CALL(ret, func) (ret = func())
-+#define _POPPLER_CALL_ARGS(ret, func, ...) (ret = func(__VA_ARGS__))
-+#else
-+#define _POPPLER_FREE(obj) (obj).free()
-+#define _POPPLER_CALL(ret, func) (*func(&ret))
-+#define _POPPLER_CALL_ARGS(ret, func, ...) (*func(__VA_ARGS__, &ret))
-+#endif
-+
-+#if POPPLER_CHECK_VERSION(0, 29, 0)
-+#define POPPLER_EVEN_NEWER_NEW_COLOR_SPACE_API
-+#endif
-+
-+#if POPPLER_CHECK_VERSION(0, 25, 0)
-+#define POPPLER_EVEN_NEWER_COLOR_SPACE_API
-+#endif
-+
-+#endif
-diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp
---- a/src/extension/internal/pdfinput/svg-builder.cpp
-+++ b/src/extension/internal/pdfinput/svg-builder.cpp
-@@ -625,7 +625,7 @@ gchar *SvgBuilder::_createPattern(GfxPattern *pattern, GfxState *state, bool is_
- if ( pattern != NULL ) {
- if ( pattern->getType() == 2 ) { // Shading pattern
- GfxShadingPattern *shading_pattern = static_cast<GfxShadingPattern *>(pattern);
-- double *ptm;
-+ const double *ptm;
- double m[6] = {1, 0, 0, 1, 0, 0};
- double det;
-
-@@ -672,7 +672,7 @@ gchar *SvgBuilder::_createTilingPattern(GfxTilingPattern *tiling_pattern,
-
- Inkscape::XML::Node *pattern_node = _xml_doc->createElement("svg:pattern");
- // Set pattern transform matrix
-- double *p2u = tiling_pattern->getMatrix();
-+ const double *p2u = tiling_pattern->getMatrix();
- double m[6] = {1, 0, 0, 1, 0, 0};
- double det;
- det = _ttm[0] * _ttm[3] - _ttm[1] * _ttm[2]; // see LP Bug 1168908
-@@ -698,7 +698,7 @@ gchar *SvgBuilder::_createTilingPattern(GfxTilingPattern *tiling_pattern,
- pattern_node->setAttribute("patternUnits", "userSpaceOnUse");
- // Set pattern tiling
- // FIXME: don't ignore XStep and YStep
-- double *bbox = tiling_pattern->getBBox();
-+ const double *bbox = tiling_pattern->getBBox();
- sp_repr_set_svg_double(pattern_node, "x", 0.0);
- sp_repr_set_svg_double(pattern_node, "y", 0.0);
- sp_repr_set_svg_double(pattern_node, "width", bbox[2] - bbox[0]);
-@@ -751,7 +751,7 @@ gchar *SvgBuilder::_createTilingPattern(GfxTilingPattern *tiling_pattern,
- */
- gchar *SvgBuilder::_createGradient(GfxShading *shading, double *matrix, bool for_shading) {
- Inkscape::XML::Node *gradient;
-- Function *func;
-+ _POPPLER_CONST Function *func;
- int num_funcs;
- bool extend0, extend1;
-
-@@ -865,7 +865,7 @@ static bool svgGetShadingColorRGB(GfxShading *shading, double offset, GfxRGB *re
-
- #define INT_EPSILON 8
- bool SvgBuilder::_addGradientStops(Inkscape::XML::Node *gradient, GfxShading *shading,
-- Function *func) {
-+ _POPPLER_CONST Function *func) {
- int type = func->getType();
- if ( type == 0 || type == 2 ) { // Sampled or exponential function
- GfxRGB stop1, stop2;
-@@ -877,9 +877,9 @@ bool SvgBuilder::_addGradientStops(Inkscape::XML::Node *gradient, GfxShading *sh
- _addStopToGradient(gradient, 1.0, &stop2, 1.0);
- }
- } else if ( type == 3 ) { // Stitching
-- StitchingFunction *stitchingFunc = static_cast<StitchingFunction*>(func);
-- double *bounds = stitchingFunc->getBounds();
-- double *encode = stitchingFunc->getEncode();
-+ auto stitchingFunc = static_cast<_POPPLER_CONST StitchingFunction*>(func);
-+ const double *bounds = stitchingFunc->getBounds();
-+ const double *encode = stitchingFunc->getEncode();
- int num_funcs = stitchingFunc->getNumFuncs();
-
- // Add stops from all the stitched functions
-@@ -890,7 +890,7 @@ bool SvgBuilder::_addGradientStops(Inkscape::XML::Node *gradient, GfxShading *sh
- svgGetShadingColorRGB(shading, bounds[i + 1], &color);
- // Add stops
- if (stitchingFunc->getFunc(i)->getType() == 2) { // process exponential fxn
-- double expE = (static_cast<ExponentialFunction*>(stitchingFunc->getFunc(i)))->getE();
-+ double expE = (static_cast<_POPPLER_CONST ExponentialFunction*>(stitchingFunc->getFunc(i)))->getE();
- if (expE > 1.0) {
- expE = (bounds[i + 1] - bounds[i])/expE; // approximate exponential as a single straight line at x=1
- if (encode[2*i] == 0) { // normal sequence
-@@ -1020,9 +1020,9 @@ void SvgBuilder::updateFont(GfxState *state) {
- GfxFont *font = state->getFont();
- // Store original name
- if (font->getName()) {
-- _font_specification = g_strdup(font->getName()->getCString());
-+ _font_specification = font->getName()->getCString();
- } else {
-- _font_specification = (char*) "Arial";
-+ _font_specification = "Arial";
- }
-
- // Prune the font name to get the correct font family name
-@@ -1030,7 +1030,7 @@ void SvgBuilder::updateFont(GfxState *state) {
- char *font_family = NULL;
- char *font_style = NULL;
- char *font_style_lowercase = NULL;
-- char *plus_sign = strstr(_font_specification, "+");
-+ const char *plus_sign = strstr(_font_specification, "+");
- if (plus_sign) {
- font_family = g_strdup(plus_sign + 1);
- _font_specification = plus_sign + 1;
-@@ -1148,7 +1148,7 @@ void SvgBuilder::updateFont(GfxState *state) {
- Inkscape::CSSOStringStream os_font_size;
- double css_font_size = _font_scaling * state->getFontSize();
- if ( font->getType() == fontType3 ) {
-- double *font_matrix = font->getFontMatrix();
-+ const double *font_matrix = font->getFontMatrix();
- if ( font_matrix[0] != 0.0 ) {
- css_font_size *= font_matrix[3] / font_matrix[0];
- }
-@@ -1193,7 +1193,7 @@ void SvgBuilder::updateTextPosition(double tx, double ty) {
- void SvgBuilder::updateTextMatrix(GfxState *state) {
- _flushText();
- // Update text matrix
-- double *text_matrix = state->getTextMat();
-+ const double *text_matrix = state->getTextMat();
- double w_scale = sqrt( text_matrix[0] * text_matrix[0] + text_matrix[2] * text_matrix[2] );
- double h_scale = sqrt( text_matrix[1] * text_matrix[1] + text_matrix[3] * text_matrix[3] );
- double max_scale;
-diff --git a/src/extension/internal/pdfinput/svg-builder.h b/src/extension/internal/pdfinput/svg-builder.h
---- a/src/extension/internal/pdfinput/svg-builder.h
-+++ b/src/extension/internal/pdfinput/svg-builder.h
-@@ -15,6 +15,7 @@
- #endif
-
- #ifdef HAVE_POPPLER
-+#include "poppler-transition-api.h"
-
- class SPDocument;
- namespace Inkscape {
-@@ -80,7 +81,7 @@ struct SvgGlyph {
- bool style_changed; // Set to true if style has to be reset
- SPCSSAttr *style;
- int render_mode; // Text render mode
-- char *font_specification; // Pointer to current font specification
-+ const char *font_specification; // Pointer to current font specification
- };
-
- /**
-@@ -174,7 +175,7 @@ private:
- void _addStopToGradient(Inkscape::XML::Node *gradient, double offset,
- GfxRGB *color, double opacity);
- bool _addGradientStops(Inkscape::XML::Node *gradient, GfxShading *shading,
-- Function *func);
-+ _POPPLER_CONST Function *func);
- gchar *_createTilingPattern(GfxTilingPattern *tiling_pattern, GfxState *state,
- bool is_stroke=false);
- // Image/mask creation
-@@ -202,7 +203,7 @@ private:
-
- SPCSSAttr *_font_style; // Current font style
- GfxFont *_current_font;
-- char *_font_specification;
-+ const char *_font_specification;
- double _font_scaling;
- bool _need_font_update;
- Geom::Affine _text_matrix;
diff --git a/gnu/packages/patches/open-zwave-hidapi.patch b/gnu/packages/patches/open-zwave-hidapi.patch
new file mode 100644
index 0000000000..fc50bfeade
--- /dev/null
+++ b/gnu/packages/patches/open-zwave-hidapi.patch
@@ -0,0 +1,15 @@
+Build against the system's HIDAPI instead of the bundled one.
+
+--- open-zwave-1.6-checkout/cpp/build/support.mk 2019-06-16 15:15:34.258331628 +0200
++++ open-zwave-1.6-checkout/cpp/build/support.mk 2019-06-16 15:15:54.698249462 +0200
+@@ -86,6 +86,10 @@ endif
+ endif
+ SED := sed
+
++# Build against the system's HIDAPI.
++CPPFLAGS += $(shell pkg-config hidapi-libusb --cflags)
++LDFLAGS += $(shell pkg-config hidapi-libusb --libs)
++
+ #determine if we are release or debug Build and set appropriate flags
+ ifeq ($(BUILD), release)
+ CFLAGS += -c $(RELEASE_CFLAGS)
diff --git a/gnu/packages/patches/ratpoints-sturm_and_rp_private.patch b/gnu/packages/patches/ratpoints-sturm_and_rp_private.patch
new file mode 100644
index 0000000000..664198c4de
--- /dev/null
+++ b/gnu/packages/patches/ratpoints-sturm_and_rp_private.patch
@@ -0,0 +1,194 @@
+diff --git a/rp-private.h b/rp-private.h
+index b4c7dad..0c7193e 100644
+--- a/rp-private.h
++++ b/rp-private.h
+@@ -36,7 +36,7 @@
+ #define LONG_SHIFT ((LONG_LENGTH == 16) ? 4 : \
+ (LONG_LENGTH == 32) ? 5 : \
+ (LONG_LENGTH == 64) ? 6 : 0)
+-#define LONG_MASK (~(-1L<<LONG_SHIFT))
++#define LONG_MASK (~(-(1L<<LONG_SHIFT)))
+
+ /* Check if SSE instructions can be used.
+ We assume that one SSE word of 128 bit is two long's,
+diff --git a/sturm.c b/sturm.c
+index c78d7c6..5fd2cf5 100644
+--- a/sturm.c
++++ b/sturm.c
+@@ -27,7 +27,6 @@
+ ***********************************************************************/
+
+ #include "ratpoints.h"
+-
+ /**************************************************************************
+ * Arguments of _ratpoints_compute_sturm() : (from the args argument) *
+ * *
+@@ -53,7 +52,7 @@
+ /* A helper function: evaluate the polynomial in cofs[] of given degree
+ at num/2^denexp and return the sign. */
+
+-static long eval_sign(ratpoints_args *args, mpz_t *cofs, long degree,
++static long eval_sign(const ratpoints_args *args, const mpz_t *cofs, long degree,
+ long num, long denexp)
+ {
+ long n, e, s;
+@@ -70,11 +69,80 @@ static long eval_sign(ratpoints_args *args, mpz_t *cofs, long degree,
+ return(s);
+ }
+
++static const long max = (long)(((unsigned long)(-1))>>1);
++static const long min = (long)(-(((unsigned long)(-1))>>1));
++ /* recursive helper function */
++static void iterate(long nl, long nr, long del, long der, long cleft, long cright,
++ long sl, long sr, long depth,
++ ratpoints_interval **iptr, const ratpoints_interval *ivlo,
++ const ratpoints_args *args, const long k, const long sturm_degs[],
++ const mpz_t sturm[][args->degree + 1])
++ { /* nl/2^del, nr/2^der : interval left/right endpoints,
++ cleft, cright: sign change counts at endpoints,
++ sl, sr: signs at endpoints,
++ depth: iteration depth */
++ long iter = args->sturm;
++ if(cleft == cright && sl < 0) { return; }
++ /* here we know the polynomial is negative on the interval */
++ if((cleft == cright && sl > 0) || depth >= iter)
++ /* we have to add/extend an interval if we either know that
++ the polynomial is positive on the interval (first condition)
++ or the maximal iteration depth has been reached (second condition) */
++ { double l = ((double)nl)/((double)(1<<del));
++ double u = ((double)nr)/((double)(1<<der));
++ if(*iptr == ivlo)
++ { (*iptr)->low = l; (*iptr)->up = u; (*iptr)++; }
++ else
++ { if(((*iptr)-1)->up == l) /* extend interval */
++ { ((*iptr)-1)->up = u; }
++ else /* new interval */
++ { (*iptr)->low = l; (*iptr)->up = u; (*iptr)++; }
++ }
++ return;
++ }
++ /* now we must split the interval and evaluate the sturm sequence
++ at the midpoint */
++ { long nm, dem, s0, s1, s2, s, cmid = 0, n;
++ if(nl == min)
++ { if(nr == max) { nm = 0; dem = 0; }
++ else { nm = (nr == 0) ? -1 : 2*nr; dem = 0; }
++ }
++ else
++ { if(nr == max) { nm = (nl == 0) ? 1 : 2*nl; dem = 0; }
++ else /* "normal" case */
++ { if(del == der) /* then both are zero */
++ { if(((nl+nr) & 1) == 0) { nm = (nl+nr)>>1; dem = 0; }
++ else { nm = nl+nr; dem = 1; }
++ }
++ else /* here one de* is greater */
++ { if(del > der) { nm = nl + (nr<<(del-der)); dem = del+1; }
++ else { nm = (nl<<(der-del)) + nr; dem = der+1; }
++ }
++ }
++ }
++ s0 = eval_sign(args, sturm[0], sturm_degs[0], nm, dem);
++ s1 = eval_sign(args, sturm[1], sturm_degs[1], nm, dem);
++ if(s0*s1 == -1) { cmid++; }
++ s = (s1 == 0) ? s0 : s1;
++ for(n = 2; n <= k; n++)
++ { s2 = eval_sign(args, sturm[n], sturm_degs[n], nm, dem);
++ if(s2 == -s) { cmid++; s = s2; }
++ else if(s2 != 0) { s = s2; }
++ }
++ /* now recurse */
++ iterate(nl, nm, del, dem, cleft, (s0==0) ? (cmid+1) : cmid,
++ sl, (s0==0) ? -s1 : s0, depth+1,
++ iptr, ivlo, args, k, sturm_degs, sturm);
++ iterate(nm, nr, dem, der, cmid, cright,
++ (s0==0) ? s1 : s0, sr, depth+1,
++ iptr, ivlo, args, k, sturm_degs, sturm);
++ }
++ } /* end iterate() */
++
+ long _ratpoints_compute_sturm(ratpoints_args *args)
+ {
+ mpz_t *cofs = args->cof;
+ long degree = args->degree;
+- long iter = args->sturm;
+ ratpoints_interval *ivlist = args->domain;
+ long num_iv = args->num_inter;
+ long n, m, k, new_num;
+@@ -165,75 +233,12 @@ long _ratpoints_compute_sturm(ratpoints_args *args)
+ /* recall: typedef struct {double low; double up;} ratpoints_interval; */
+ { ratpoints_interval ivlocal[1 + (degree>>1)];
+ ratpoints_interval *iptr = &ivlocal[0];
+- long max = (long)(((unsigned long)(-1))>>1);
+- long min = -max;
+ long num_intervals;
+ long slcf = mpz_cmp_si(cofs[degree], 0);
+
+- /* recursive helper function */
+- void iterate(long nl, long nr, long del, long der, long cleft, long cright,
+- long sl, long sr, long depth)
+- { /* nl/2^del, nr/2^der : interval left/right endpoints,
+- cleft, cright: sign change counts at endpoints,
+- sl, sr: signs at endpoints,
+- depth: iteration depth */
+- if(cleft == cright && sl < 0) { return; }
+- /* here we know the polynomial is negative on the interval */
+- if((cleft == cright && sl > 0) || depth >= iter)
+- /* we have to add/extend an interval if we either know that
+- the polynomial is positive on the interval (first condition)
+- or the maximal iteration depth has been reached (second condition) */
+- { double l = ((double)nl)/((double)(1<<del));
+- double u = ((double)nr)/((double)(1<<der));
+- if(iptr == &ivlocal[0])
+- { iptr->low = l; iptr->up = u; iptr++; }
+- else
+- { if((iptr-1)->up == l) /* extend interval */
+- { (iptr-1)->up = u; }
+- else /* new interval */
+- { iptr->low = l; iptr->up = u; iptr++; }
+- }
+- return;
+- }
+- /* now we must split the interval and evaluate the sturm sequence
+- at the midpoint */
+- { long nm, dem, s0, s1, s2, s, cmid = 0, n;
+- if(nl == min)
+- { if(nr == max) { nm = 0; dem = 0; }
+- else { nm = (nr == 0) ? -1 : 2*nr; dem = 0; }
+- }
+- else
+- { if(nr == max) { nm = (nl == 0) ? 1 : 2*nl; dem = 0; }
+- else /* "normal" case */
+- { if(del == der) /* then both are zero */
+- { if(((nl+nr) & 1) == 0) { nm = (nl+nr)>>1; dem = 0; }
+- else { nm = nl+nr; dem = 1; }
+- }
+- else /* here one de* is greater */
+- { if(del > der) { nm = nl + (nr<<(del-der)); dem = del+1; }
+- else { nm = (nl<<(der-del)) + nr; dem = der+1; }
+- }
+- }
+- }
+- s0 = eval_sign(args, sturm[0], sturm_degs[0], nm, dem);
+- s1 = eval_sign(args, sturm[1], sturm_degs[1], nm, dem);
+- if(s0*s1 == -1) { cmid++; }
+- s = (s1 == 0) ? s0 : s1;
+- for(n = 2; n <= k; n++)
+- { s2 = eval_sign(args, sturm[n], sturm_degs[n], nm, dem);
+- if(s2 == -s) { cmid++; s = s2; }
+- else if(s2 != 0) { s = s2; }
+- }
+- /* now recurse */
+- iterate(nl, nm, del, dem, cleft, (s0==0) ? (cmid+1) : cmid,
+- sl, (s0==0) ? -s1 : s0, depth+1);
+- iterate(nm, nr, dem, der, cmid, cright,
+- (s0==0) ? s1 : s0, sr, depth+1);
+- }
+- } /* end iterate() */
+-
+ iterate(min, max, 0, 0, count2, count1,
+- (degree & 1) ? -slcf : slcf, slcf, 0);
++ (degree & 1) ? -slcf : slcf, slcf, 0,
++ &iptr, &ivlocal[0], args, k, sturm_degs, sturm);
+ num_intervals = iptr - &ivlocal[0];
+ /* intersect with given intervals */
+ { ratpoints_interval local_copy[num_iv];
diff --git a/gnu/packages/patches/ri-li-modernize_cpp.patch b/gnu/packages/patches/ri-li-modernize_cpp.patch
new file mode 100644
index 0000000000..3d076afb39
--- /dev/null
+++ b/gnu/packages/patches/ri-li-modernize_cpp.patch
@@ -0,0 +1,391 @@
+diff -r -u Ri-li-2.0.1.orig/src/audio.cc Ri-li-2.0.1/src/audio.cc
+--- Ri-li-2.0.1.orig/src/audio.cc 2012-01-22 00:40:56.928609371 -0800
++++ Ri-li-2.0.1/src/audio.cc 2012-01-22 00:28:33.360636539 -0800
+@@ -22,8 +22,8 @@
+ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ #include <stdlib.h>
+-#include <iostream.h>
+-#include <string.h>
++#include <iostream>
++#include <string>
+
+ #include "audio.h"
+ #include "utils.h"
+@@ -57,7 +57,7 @@
+ char PathFile[512];
+
+ if(Mix_OpenAudio(22050,AUDIO_S16,1,1024)) {
+- cerr <<"Enable to init Sound card ! "<<SDL_GetError()<<endl;
++ std::cerr <<"Enable to init Sound card ! "<<SDL_GetError()<<std::endl;
+ return false;
+ }
+
+diff -r -u Ri-li-2.0.1.orig/src/ecran.cc Ri-li-2.0.1/src/ecran.cc
+--- Ri-li-2.0.1.orig/src/ecran.cc 2007-11-02 04:48:16.000000000 -0700
++++ Ri-li-2.0.1/src/ecran.cc 2012-01-22 00:13:54.422798653 -0800
+@@ -21,7 +21,7 @@
+ // with this program; if not, write to the Free Software Foundation, Inc.,
+ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+-#include <iostream.h>
++#include <iostream>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <math.h>
+diff -r -u Ri-li-2.0.1.orig/src/editeur.cc Ri-li-2.0.1/src/editeur.cc
+--- Ri-li-2.0.1.orig/src/editeur.cc 2007-11-02 04:48:17.000000000 -0700
++++ Ri-li-2.0.1/src/editeur.cc 2012-01-22 00:28:59.632635579 -0800
+@@ -25,10 +25,10 @@
+ #include <windows.h>
+ #endif
+
+-#include <iostream.h>
++#include <iostream>
+ #include <stdio.h>
+ #include <stdlib.h>
+-#include <string.h>
++#include <string>
+ #include <math.h>
+ #include <SDL/SDL.h>
+
+@@ -374,7 +374,7 @@
+
+ // Sauve le niveau
+ if(Niveau.Save()==false) {
+- cerr <<"ERREUR Saving levels!"<<endl;
++ std::cerr <<"ERREUR Saving levels!"<<std::endl;
+ exit(-1);
+ }
+
+diff -r -u Ri-li-2.0.1.orig/src/jeux.cc Ri-li-2.0.1/src/jeux.cc
+--- Ri-li-2.0.1.orig/src/jeux.cc 2007-11-02 04:48:17.000000000 -0700
++++ Ri-li-2.0.1/src/jeux.cc 2012-01-22 00:14:08.422798143 -0800
+@@ -25,10 +25,10 @@
+ #include <windows.h>
+ #endif
+
+-#include <iostream.h>
++#include <iostream>
+ #include <stdio.h>
+ #include <stdlib.h>
+-#include <string.h>
++#include <string>
+ #include <math.h>
+ #include <SDL/SDL.h>
+
+diff -r -u Ri-li-2.0.1.orig/src/loco.cc Ri-li-2.0.1/src/loco.cc
+--- Ri-li-2.0.1.orig/src/loco.cc 2007-11-02 04:48:18.000000000 -0700
++++ Ri-li-2.0.1/src/loco.cc 2012-01-22 00:14:17.878797797 -0800
+@@ -21,10 +21,10 @@
+ // with this program; if not, write to the Free Software Foundation, Inc.,
+ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+-#include <iostream.h>
++#include <iostream>
+ #include <stdio.h>
+ #include <stdlib.h>
+-#include <string.h>
++#include <string>
+ #include <math.h>
+ #include "preference.h"
+ #include "loco.h"
+diff -r -u Ri-li-2.0.1.orig/src/main.cc Ri-li-2.0.1/src/main.cc
+--- Ri-li-2.0.1.orig/src/main.cc 2007-11-02 04:48:19.000000000 -0700
++++ Ri-li-2.0.1/src/main.cc 2012-01-22 00:29:40.080634136 -0800
+@@ -23,8 +23,8 @@
+
+ #include <stdio.h>
+ #include <stdlib.h>
+-#include <iostream.h>
+-#include <string.h>
++#include <iostream>
++#include <string>
+ #include <SDL/SDL.h>
+ #include <SDL/SDL_mixer.h>
+
+@@ -115,7 +115,7 @@
+
+ // Initilise SDL
+ if( SDL_Init(SDL_INIT_VIDEO|SDL_INIT_TIMER|SDL_INIT_AUDIO|SDL_INIT_NOPARACHUTE) < 0 ) {
+- cerr <<"Impossible d'initialiser SDL:"<<SDL_GetError()<<endl;
++ std::cerr <<"Impossible d'initialiser SDL:"<<SDL_GetError()<<std::endl;
+ exit(-1);
+ }
+ // Ferme le programme correctement quant quit
+@@ -125,7 +125,7 @@
+ sdlVideoInfo=(SDL_VideoInfo*)SDL_GetVideoInfo();
+
+ if(sdlVideoInfo->vfmt->BitsPerPixel==8) {
+- cerr <<"Impossible d'utiliser 8bits pour la vidéo !"<<endl;
++ std::cerr <<"Impossible d'utiliser 8bits pour la vidéo !"<<std::endl;
+ exit(-1);
+ }
+
+@@ -145,7 +145,7 @@
+ sdlVideo=SDL_SetVideoMode(800,600,sdlVideoInfo->vfmt->BitsPerPixel,vOption);
+
+ if(sdlVideo==NULL) {
+- cerr <<"Impossible de passer dans le mode vidéo 800x600 !"<<endl;
++ std::cerr <<"Impossible de passer dans le mode vidéo 800x600 !"<<std::endl;
+ exit(-1);
+ }
+ // Change le nom de la fenetre
+diff -r -u Ri-li-2.0.1.orig/src/menu.cc Ri-li-2.0.1/src/menu.cc
+--- Ri-li-2.0.1.orig/src/menu.cc 2007-11-02 04:48:19.000000000 -0700
++++ Ri-li-2.0.1/src/menu.cc 2012-01-22 00:30:04.752633198 -0800
+@@ -21,10 +21,10 @@
+ // with this program; if not, write to the Free Software Foundation, Inc.,
+ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+-#include <iostream.h>
++#include <iostream>
+ #include <stdio.h>
+ #include <stdlib.h>
+-#include <string.h>
++#include <string>
+ #include "preference.h"
+ #include "menu.h"
+ #include "sprite.h"
+@@ -92,7 +92,7 @@
+ // Teste la resolution video
+ sdlVideoInfo=(SDL_VideoInfo*)SDL_GetVideoInfo();
+ if(sdlVideoInfo->vfmt->BitsPerPixel==8) {
+- cerr <<"Impossible d'utiliser 8bits pour la vidéo !"<<endl;
++ std::cerr <<"Impossible d'utiliser 8bits pour la vidéo !"<<std::endl;
+ exit(-1);
+ }
+
+@@ -112,7 +112,7 @@
+ if(Pref.FullScreen) vOption|=SDL_FULLSCREEN;
+ sdlVideo=SDL_SetVideoMode(800,600,sdlVideoInfo->vfmt->BitsPerPixel,vOption);
+ if(sdlVideo==NULL) {
+- cerr <<"Impossible de passer dans le mode vidéo 800x600 !"<<endl;
++ std::cerr <<"Impossible de passer dans le mode vidéo 800x600 !"<<std::endl;
+ exit(-1);
+ }
+
+diff -r -u Ri-li-2.0.1.orig/src/mouse.cc Ri-li-2.0.1/src/mouse.cc
+--- Ri-li-2.0.1.orig/src/mouse.cc 2007-11-02 04:48:20.000000000 -0700
++++ Ri-li-2.0.1/src/mouse.cc 2012-01-22 00:14:36.438797120 -0800
+@@ -21,7 +21,7 @@
+ // with this program; if not, write to the Free Software Foundation, Inc.,
+ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+-#include <iostream.h>
++#include <iostream>
+ #include <stdio.h>
+ #include "mouse.h"
+ #include "preference.h"
+diff -r -u Ri-li-2.0.1.orig/src/sprite.cc Ri-li-2.0.1/src/sprite.cc
+--- Ri-li-2.0.1.orig/src/sprite.cc 2007-11-02 04:48:20.000000000 -0700
++++ Ri-li-2.0.1/src/sprite.cc 2012-01-22 00:30:43.640631779 -0800
+@@ -21,10 +21,10 @@
+ // with this program; if not, write to the Free Software Foundation, Inc.,
+ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+-#include <iostream.h>
++#include <iostream>
+ #include <stdio.h>
+ #include <stdlib.h>
+-#include <string.h>
++#include <string>
+ #include <math.h>
+ #include "sprite.h"
+ #include "preference.h"
+@@ -84,7 +84,7 @@
+ strcpy(PathFile,Langue[Pref.Langue]);
+ GetPath(PathFile);
+ if(FileExiste(PathFile)==false) {
+- cerr <<"Impossible de trouver "<<Langue[Pref.Langue]<<endl;
++ std::cerr <<"Impossible de trouver "<<Langue[Pref.Langue]<<std::endl;
+ return false;
+ }
+ L=ChargeFichier(PathFile,Buf);
+@@ -128,7 +128,7 @@
+ // *** Charge le fichier des langues ***
+ // *************************************
+ if(FileExiste(PathFile)==false) {
+- cerr <<"Impossible de trouver 'language.dat'"<<endl;
++ std::cerr <<"Impossible de trouver 'language.dat'"<<std::endl;
+ return false;
+ }
+ L=ChargeFichier(PathFile,Buf);
+@@ -163,7 +163,7 @@
+ strcpy(PathFile,"sprites.dat");
+ GetPath(PathFile);
+ if(FileExiste(PathFile)==false) {
+- cerr <<"Impossible de trouver 'sprites.dat'"<<endl;
++ std::cerr <<"Impossible de trouver 'sprites.dat'"<<std::endl;
+ return false;
+ }
+ L=ChargeFichier(PathFile,Buf);
+@@ -352,7 +352,7 @@
+ Image[i]=SDL_CreateRGBSurface((Dim[i].bpp-3)*SDL_SRCALPHA,Dim[i].L,Dim[i].H,Dim[i].bpp*8,
+ 0xff,0xff00,0xff0000,0xff000000*(Dim[i].bpp-3));
+ if(Image[i]<=NULL) {
+- cerr <<"Impossible de créer une Surface SDL!"<<endl;
++ std::cerr <<"Impossible de créer une Surface SDL!"<<std::endl;
+ return false;
+ }
+
+@@ -486,7 +486,7 @@
+ Image[0]=SDL_CreateRGBSurface((Dim[0].bpp-3)*SDL_SRCALPHA,Dim[0].L,Dim[0].H,Dim[0].bpp*8,
+ 0xff,0xff00,0xff0000,0xff000000*(Dim[0].bpp-3));
+ if(Image[0]<=NULL) {
+- cerr <<"Impossible de créer une Surface SDL!"<<endl;
++ std::cerr <<"Impossible de créer une Surface SDL!"<<std::endl;
+ return false;
+ }
+ return true;
+diff -r -u Ri-li-2.0.1.orig/src/tableau.cc Ri-li-2.0.1/src/tableau.cc
+--- Ri-li-2.0.1.orig/src/tableau.cc 2007-11-02 04:48:21.000000000 -0700
++++ Ri-li-2.0.1/src/tableau.cc 2012-01-22 00:14:50.710796598 -0800
+@@ -21,7 +21,7 @@
+ // with this program; if not, write to the Free Software Foundation, Inc.,
+ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+-#include <iostream.h>
++#include <iostream>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include "preference.h"
+diff -r -u Ri-li-2.0.1.orig/src/utils.cc Ri-li-2.0.1/src/utils.cc
+--- Ri-li-2.0.1.orig/src/utils.cc 2007-11-02 04:48:22.000000000 -0700
++++ Ri-li-2.0.1/src/utils.cc 2012-01-22 00:31:30.944630051 -0800
+@@ -21,10 +21,10 @@
+ // with this program; if not, write to the Free Software Foundation, Inc.,
+ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+-#include <iostream.h>
++#include <iostream>
+ #include <stdio.h>
+ #include <stdlib.h>
+-#include <string.h>
++#include <string>
+
+ #ifdef WINDOWS
+ #include <windows.h>
+@@ -77,7 +77,7 @@
+
+ file=fopen(Path,"r");
+ if(!file) {
+- cerr <<"ERREUR: Impossible d'ouvrir '"<<Path<<"'"<<endl;
++ std::cerr <<"ERREUR: Impossible d'ouvrir '"<<Path<<"'"<<std::endl;
+ perror("fopen");
+ return -1;
+ }
+@@ -93,7 +93,7 @@
+
+ Buf=new unsigned char [L+1];
+ if(Buf==NULL) {
+- cerr <<"ERREUR: Memoire insuffisante!"<<endl;
++ std::cerr <<"ERREUR: Memoire insuffisante!"<<std::endl;
+ fclose(file);
+ return -1;
+ }
+@@ -104,7 +104,7 @@
+ while(Compt>1024) {
+ AfficheChargeur();
+ if( fread(Po,1,1024,file) != 1024 ) {
+- cerr <<"ERREUR de lecture du fichier '"<<Path<<"'"<<endl;
++ std::cerr <<"ERREUR de lecture du fichier '"<<Path<<"'"<<std::endl;
+ perror("fread");
+ fclose(file);
+ delete [] Buf;
+@@ -131,13 +131,13 @@
+
+ file=_lopen(Path,OF_READ);
+ if(file==-1) {
+- cerr <<"Impossible d'ouvrir "<<Path<<endl;
++ std::cerr <<"Impossible d'ouvrir "<<Path<<std::endl;
+ exit(-1);
+ }
+
+ long L=(long)_llseek(file,0,SEEK_END);
+ if(L==-1) {
+- cerr <<"Impossible de trouver la longueur du fichier"<<endl;
++ std::cerr <<"Impossible de trouver la longueur du fichier"<<std::endl;
+ perror("lseek");
+ _lclose(file);
+ return -1;
+@@ -146,7 +146,7 @@
+
+ Buf=new unsigned char [L+1];
+ if(Buf==NULL) {
+- cerr <<"ERREUR: Memoire insuffisante!"<<endl;
++ std::cerr <<"ERREUR: Memoire insuffisante!"<<std::endl;
+ _lclose(file);
+ return -1;
+ }
+@@ -169,14 +169,14 @@
+
+ file=fopen(Path,"w");
+ if(!file) {
+- cerr <<"ERREUR: Impossible d'ouvrir '"<<Path<<"'"<<endl;
++ std::cerr <<"ERREUR: Impossible d'ouvrir '"<<Path<<"'"<<std::endl;
+ perror("fopen");
+ return false;
+ }
+
+ while(L>512) {
+ if( fwrite(Buf,1,512,file) != 512 ) {
+- cerr <<"ERREUR d'ecriture du fichier '"<<Path<<"'"<<endl;
++ std::cerr <<"ERREUR d'ecriture du fichier '"<<Path<<"'"<<std::endl;
+ perror("fwrite");
+ fclose(file);
+ return false;
+@@ -187,7 +187,7 @@
+
+ if(L>0) {
+ if( fwrite(Buf,1,(size_t)L,file) != (size_t)L ) {
+- cerr <<"ERREUR d'ecriture du fichier '"<<Path<<"'"<<endl;
++ std::cerr <<"ERREUR d'ecriture du fichier '"<<Path<<"'"<<std::endl;
+ perror("fwrite");
+ fclose(file);
+ return false;
+@@ -208,7 +208,7 @@
+
+ file=_lcreat(Path,0);
+ if(!file) {
+- cerr <<"ERREUR: Impossible de créer le fichier '"<<Path<<"'"<<endl;
++ std::cerr <<"ERREUR: Impossible de créer le fichier '"<<Path<<"'"<<std::endl;
+ return false;
+ }
+
+@@ -216,7 +216,7 @@
+ _lclose(file);
+
+ if(Lec!=L) {
+- cerr <<"Problème d'ecriture du fichier '"<<Path<<"' ecris="<<Lec<<" au lieux de ="<<L<<endl;
++ std::cerr <<"Problème d'ecriture du fichier '"<<Path<<"' ecris="<<Lec<<" au lieux de ="<<L<<std::endl;
+ return false;
+ }
+
+@@ -250,7 +250,7 @@
+ sprintf(Path,"/usr/share/games/Ri-li/%s",Provi);
+ if(FileExiste(Path)) return;
+
+- cerr <<"Impossible de trouver le fichier '"<<Provi<<endl;
++ std::cerr <<"Impossible de trouver le fichier '"<<Provi<<std::endl;
+ exit(-1);
+ }
+ #endif
+@@ -266,7 +266,7 @@
+ sprintf(Path,"PROGDIR:%s",Provi);
+ if(FileExiste(Path)) return;
+
+- cerr <<"Impossible de trouver le fichier '"<<Path<<endl;
++ std::cerr <<"Impossible de trouver le fichier '"<<Path<<std::endl;
+ exit(-1);
+ }
+ #endif
+@@ -282,7 +282,7 @@
+ sprintf(Path,"Ri-li.app/Contents/Resources/%s",Provi);
+ if(FileExiste(Path)) return;
+
+- cerr <<"Impossible de trouver le fichier '"<<Path<<endl;
++ std::cerr <<"Impossible de trouver le fichier '"<<Path<<std::endl;
+ exit(-1);
+ }
+ #endif
diff --git a/gnu/packages/patches/symmetrica-bruch.patch b/gnu/packages/patches/symmetrica-bruch.patch
new file mode 100644
index 0000000000..ae88b79206
--- /dev/null
+++ b/gnu/packages/patches/symmetrica-bruch.patch
@@ -0,0 +1,38 @@
+--- src/bruch.c 2007-12-06 11:30:00.000000000 -0500
++++ b/bruch.c 2013-10-22 08:37:43.000000000 -0400
+@@ -975,14 +975,16 @@
+ ggterg = ggt_i(S_B_UI(bruch),S_B_OI(bruch));
+
+ if (ggterg == S_B_UI(bruch)) {
++ INT tmp = S_B_OI(bruch);
+ freeself_bruch(bruch);
+- M_I_I(S_B_OI(bruch) / ggterg,bruch);
++ M_I_I(tmp / ggterg,bruch);
+ goto ende;
+ }
+
+ if (-ggterg == S_B_UI(bruch)) {
++ INT tmp = S_B_OI(bruch);
+ freeself_bruch(bruch);
+- M_I_I(- S_B_OI(bruch) / ggterg,bruch);
++ M_I_I(- tmp / ggterg,bruch);
+ goto ende;
+ }
+
+@@ -1032,12 +1034,14 @@
+
+ if (S_O_K(S_B_U(bruch)) == INTEGER)
+ if (S_B_UI(bruch) == 1) {
++ INT tmp = S_B_OI(bruch);
+ freeself_bruch(bruch);
+- M_I_I(S_B_OI(bruch),bruch);
++ M_I_I(tmp,bruch);
+ goto ende; }
+ else if (S_B_UI(bruch) == -1) {
++ INT tmp = S_B_OI(bruch);
+ freeself_bruch(bruch);
+- M_I_I( - S_B_OI(bruch),bruch);
++ M_I_I( - tmp,bruch);
+ goto ende; }
+ if (NEGP(S_B_O(bruch)) && NEGP(S_B_U(bruch)))
+ {
diff --git a/gnu/packages/patches/symmetrica-int32.patch b/gnu/packages/patches/symmetrica-int32.patch
new file mode 100644
index 0000000000..b64f27d51e
--- /dev/null
+++ b/gnu/packages/patches/symmetrica-int32.patch
@@ -0,0 +1,37 @@
+diff -ru src/def.h c/def.h
+--- src/def.h 2007-12-06 17:30:56.000000000 +0100
++++ c/def.h 2013-10-19 18:42:55.118745730 +0200
+@@ -2,14 +2,9 @@
+ /* INT should always be 4 byte */
+ #ifndef DEF_H
+
+-
+-#ifdef __alpha
+-typedef int INT;
+-typedef unsigned int UINT;
+-#else /* __alpha */
+-typedef long INT;
+-typedef unsigned long UINT;
+-#endif /* __alpha */
++#include <stdint.h>
++typedef int32_t INT;
++typedef uint32_t UINT;
+
+ #include <stdio.h>
+ #include <memory.h>
+@@ -65,10 +60,13 @@
+
+
+ /* definitionen fuer object.c */
+-typedef INT OBJECTKIND; /* 4 byte */
++/* NOTE: partition code assumes that there is no unused space in the
++ * object struct when an INT is stored. This requires both OBJECTKIND
++ * and OBJECTSELF to have a size equal to a machine word. */
++typedef intptr_t OBJECTKIND;
+
+ typedef union {
+- INT ob_INT;
++ intptr_t ob_INT;
+ INT * ob_INTpointer;
+ char *ob_charpointer;
+ struct bruch *ob_bruch;
diff --git a/gnu/packages/patches/symmetrica-return_values.patch b/gnu/packages/patches/symmetrica-return_values.patch
new file mode 100644
index 0000000000..e09c389337
--- /dev/null
+++ b/gnu/packages/patches/symmetrica-return_values.patch
@@ -0,0 +1,14 @@
+diff -ru src/part.c b/part.c
+--- src/part.c Thu May 14 06:01:00 2009 -0400
++++ b/part.c Thu May 14 06:01:00 2009 -0400
+@@ -1767,8 +1767,8 @@
+ /* to compute number of partitions */
+ {
+ INT erg = OK;
+- if (ni<0) return;
+- if (not EMPTYP(S_V_I(vec,ni))) return;
++ if (ni<0) return 0;
++ if (not EMPTYP(S_V_I(vec,ni))) return 0;
+ else if (ni<=1) M_I_I(1,S_V_I(vec,ni));
+ else {
+
diff --git a/gnu/packages/patches/symmetrica-sort_sum_rename.patch b/gnu/packages/patches/symmetrica-sort_sum_rename.patch
new file mode 100644
index 0000000000..2d9a2dae06
--- /dev/null
+++ b/gnu/packages/patches/symmetrica-sort_sum_rename.patch
@@ -0,0 +1,340 @@
+diff -r 5cd656a07aa5 src/bar.c
+--- a/bar.c Thu May 14 06:01:00 2009 -0400
++++ b/bar.c Thu May 14 07:38:17 2009 -0400
+@@ -237,7 +237,7 @@
+ g = callocobject();
+ e = S_V_I(a,0L);
+ f = S_V_I(a,1L);
+- erg += sum(f,g);
++ erg += sym_sum(f,g);
+ j=0L;
+ for (i=0L;i<S_V_LI(e);i++)
+ j += S_V_II(e,i)*(i+1L);
+@@ -427,7 +427,7 @@
+ for (i=0L;i<S_V_LI(b);i++)
+ erg += kranztypus_to_matrix(S_V_I(c,i),S_V_I(b,i));
+ erg += freeall(c);
+- erg += sort(b); /* AK 130592 */
++ erg += sym_sort(b); /* AK 130592 */
+ ENDR("makevectorof_class_bar");
+ }
+
+@@ -615,7 +615,7 @@
+ c = callocobject();
+ d = callocobject();
+ erg += lehmercode_bar(a,c);
+- erg += sum(S_V_I(c,1L),b);
++ erg += sym_sum(S_V_I(c,1L),b);
+ for(i=0L;i<S_P_LI(a);i++)
+ {
+ if (S_V_II(S_V_I(c,0L),i) == 1L)
+diff -r 5cd656a07aa5 src/def.h
+--- a/def.h Thu May 14 06:01:00 2009 -0400
++++ b/def.h Thu May 14 07:38:17 2009 -0400
+@@ -3105,7 +3105,7 @@
+ extern INT so_character ();
+ extern INT so_dimension ();
+ extern OBJECTKIND s_o_k();
+-extern INT sort();
++extern INT sym_sort();
+ extern INT sort_rows_tableaux_apply();
+ extern INT sort_vector();
+ extern OBJECTSELF s_o_s();
+@@ -3271,7 +3271,7 @@
+ extern INT sub_part_part();
+ extern INT substitute_one_matrix ();
+ extern INT substitute_one_monopoly ();
+-extern INT sum();
++extern INT sym_sum();
+ extern INT sum_integervector();
+ extern INT sum_matrix();
+ extern INT sum_vector();
+diff -r 5cd656a07aa5 src/di.c
+--- a/di.c Thu May 14 06:01:00 2009 -0400
++++ b/di.c Thu May 14 07:38:17 2009 -0400
+@@ -1355,7 +1355,7 @@
+ m_il_nv(0L,weight_watcher);
+ m_il_nv(0L,perm_vec);
+ copy(S_V_I(FP,0L),fix);
+- sort(fix);
++ sym_sort(fix);
+
+ get_perm(hweight,p,b,S_I_I(n),S_I_I(m),0L,
+ perm_vec,weight_watcher,fix);
+@@ -1502,7 +1502,7 @@
+ if(ind == m)
+ {
+ mult_perm_fix(p,fix,hfix);
+- sort(hfix);
++ sym_sort(hfix);
+ if(!hfix_in_ww(hfix,ww))
+ {
+ inc(ww);
+diff -r 5cd656a07aa5 src/ga.c
+--- a/ga.c Thu May 14 06:01:00 2009 -0400
++++ b/ga.c Thu May 14 07:38:17 2009 -0400
+@@ -632,7 +632,7 @@
+ else if (what == 0L)
+ erg += vertikal_sum(S_V_L(a),c);
+ erg += copy(a,d);
+- erg += sort(d);
++ erg += sym_sort(d);
+ erg += m_il_p(S_V_II(d,S_V_LI(d)-1L),e); /* identitaet */
+ for (i=0L,k=0L,j=S_V_LI(d);i<S_P_LI(e);i++)
+ if (i+1L == S_V_II(d,k) )
+@@ -722,7 +722,7 @@
+
+ j=0L;
+ erg += append(h,g,h2);
+- erg += sort(h2);
++ erg += sym_sort(h2);
+ for (i=0L;i<S_V_LI(g);i++)
+ {
+ erg += m_i_i(S_V_II(g,i),S_P_I(a,j));
+diff -r 5cd656a07aa5 src/galois.c
+--- a/galois.c Thu May 14 06:01:00 2009 -0400
++++ b/galois.c Thu May 14 07:38:17 2009 -0400
+@@ -758,7 +758,7 @@
+ }
+ }
+ FREEALL2(v,nv);
+- sort(res);
++ sym_sort(res);
+ }
+ S3R(k,phg_c,phg_d,"all_points_phg_store",res);
+ ENDR("all_points");
+diff -r 5cd656a07aa5 src/macro.h
+--- a/macro.h Thu May 14 06:01:00 2009 -0400
++++ b/macro.h Thu May 14 07:38:17 2009 -0400
+@@ -1,6 +1,8 @@
+ /* file: macro.h symmetrica source code */
+ #ifndef MACRO_H
+
++#include "string.h"
++
+ #ifdef SYMMAGMA
+ #define SYM_MALLOC(a) mem_malloc(a)
+ #else
+ #define C_O_K(a,b) ((a)->ob_kind = (OBJECTKIND)(b))
+--- a/nc.c Thu May 14 06:01:00 2009 -0400
++++ b/nc.c Thu May 14 07:38:17 2009 -0400
+@@ -204,7 +204,7 @@
+ erg += mult(S_NC_C(a),S_NC_C(b),d);
+ erg += m_gl_co(S_NC_GL(a),e);
+ erg += mult_apply(e,d);
+- erg += sum(d,e);
++ erg += sym_sum(d,e);
+ erg += m_gl_go(S_NC_GL(a),d);
+ erg += div(e,d,c);
+ erg += freeall(e);
+@@ -617,7 +617,7 @@
+ erg += mult_nc_kranz(c,a,e);
+ erg += mult(S_V_I(e,1L),f,c);
+ erg += div(c,g,c);
+- erg += sum(c,S_V_I(S_NC_C(b),S_I_I(d)));
++ erg += sym_sum(c,S_V_I(S_NC_C(b),S_I_I(d)));
+ }
+ erg += freeall(c);
+ erg += freeall(d);
+@@ -712,7 +712,7 @@
+ for(j = 0L; j<S_V_LI(c);j++) {
+ kranztypus_to_matrix(S_V_I(c,j),S_V_I(a,j));
+ }
+- sort(a);
++ sym_sort(a);
+ freeall(f); freeall(h); freeall(c);
+ return OK;
+ }
+@@ -739,7 +739,7 @@
+ kranztypus_to_matrix(S_V_I(c,j),S_V_I(h,j));
+ }
+
+- sort(h);
++ sym_sort(h);
+ m_l_v(S_V_L(h),a);
+ for(j = 0L; j<S_V_LI(c);j++) {
+ typusorder(S_V_I(h,j), zb, za, S_V_I(a,j), f);
+@@ -789,7 +789,7 @@
+ erg += kranztypus_to_matrix(S_V_I(c,j),S_V_I(h,j));
+ }
+
+- erg += sort(h);
++ erg += sym_sort(h);
+ erg += typusorder(S_V_I(h,S_I_I(i)), zb, za, a, f);
+ erg += freeall(f);
+ erg += freeall(c);
+diff -r 5cd656a07aa5 src/nu.c
+--- a/nu.c Thu May 14 06:01:00 2009 -0400
++++ b/nu.c Thu May 14 07:38:17 2009 -0400
+@@ -531,13 +531,13 @@
+ ENDR("add");
+ }
+
+-INT sort(a) OP a;
++INT sym_sort(a) OP a;
+ /* sortiert das object in aufsteigender reihenfolge AK 270787 */
+ /* AK 160986 */ /* AK 280689 V1.0 */ /* AK 050390 V1.1 */
+ /* AK 070891 V1.3 */
+ {
+ INT erg = OK;
+- EOP("sort(1)",a);
++ EOP("sym_sort(1)",a);
+
+ switch(S_O_K(a))
+ {
+@@ -547,9 +547,9 @@
+ erg += sort_vector(a);break;
+ #endif /* VECTORTRUE */
+ default:
+- erg += WTO("sort",a); break;
++ erg += WTO("sym_sort",a); break;
+ };
+- ENDR("sort");
++ ENDR("sym_sort");
+ }
+
+ INT length(a,d) OP a,d;
+@@ -641,7 +641,7 @@
+ ENDR("content");
+ }
+
+-INT sum(a,res) OP a,res;
++INT sym_sum(a,res) OP a,res;
+ /* AK 280689 V1.0 */ /* AK 050390 V1.1 */ /* AK 120391 V1.2 */
+ /* AK 140891 V1.3 */
+ /* AK 170298 V2.0 */
+@@ -649,7 +649,7 @@
+ INT erg = OK;
+ COP("sum(1)",a);
+ COP("sum(2)",res);
+- CE2(a,res,sum);
++ CE2(a,res,sym_sum);
+
+ switch(S_O_K(a))
+ {
+@@ -680,7 +680,7 @@
+ erg += WTO("sum",a); break;
+ };
+
+- ENDR("sum");
++ ENDR("sym_sum");
+ }
+
+
+diff -r 5cd656a07aa5 src/part.c
+--- a/part.c Thu May 14 06:01:00 2009 -0400
++++ b/part.c Thu May 14 07:38:17 2009 -0400
+@@ -347,7 +347,7 @@
+ if (a == b) { /* a := a+a */
+ if (S_PA_K(a) == VECTOR) {
+ erg += append_apply_vector(S_PA_S(a),S_PA_S(b));
+- erg += sort(S_PA_S(a));
++ erg += sym_sort(S_PA_S(a));
+ goto endr_ende;
+ }
+ else if (S_PA_K(a) == EXPONENT) {
+@@ -406,7 +406,7 @@
+ k=S_PA_LI(b)-1;
+ /*
+ erg += append_apply_vector(S_PA_S(a),S_PA_S(b));
+- erg += sort(S_PA_S(a));
++ erg += sym_sort(S_PA_S(a));
+ */
+ inc_vector_co(S_PA_S(a),S_PA_LI(b));
+ for (j=S_PA_LI(a)-1;j>=0;j--)
+diff -r 5cd656a07aa5 src/perm.c
+--- a/perm.c Thu May 14 06:01:00 2009 -0400
++++ b/perm.c Thu May 14 07:38:17 2009 -0400
+@@ -833,9 +833,9 @@
+ /* s = Anzahl der spalten */
+
+ s = S_V_LI(S_V_I(a,0L));
+- sum(S_V_I(a,0L),summe);/* composition ist vector */
++ sym_sum(S_V_I(a,0L),summe);/* composition ist vector */
+ z = S_I_I(summe);
+- FREEALL(summe);
++ FREEALL(summe);
+ m_ilih_nm(s,z,b);
+ C_O_K(b,KRANZTYPUS);
+ for (i=0L;i<s;i++)
+@@ -1114,7 +1114,7 @@
+ erg += kranztypus_to_matrix(S_V_I(c,i),S_V_I(h,i));
+ }
+
+- erg += sort(h);
++ erg += sym_sort(h);
+
+ erg += chartafel(b,ct);
+
+@@ -1926,7 +1926,7 @@
+ OP c;
+ c = CALLOCOBJECT();
+ erg += lehmercode_permutation(a,c); /*result is a vector */
+- erg += sum(c,b);
++ erg += sym_sum(c,b);
+ FREEALL(c);
+ }
+ ENDR("numberof_inversionen");
+@@ -2364,7 +2364,7 @@
+ COP("rz_lehmercode(2)",b);
+
+ zw = callocobject();
+- erg += sum(lc,zw);
++ erg += sym_sum(lc,zw);
+ if (NULLP(zw))
+ {
+ erg += m_il_integervector((INT)0,b);
+diff -r 5cd656a07aa5 src/rest.c
+--- a/rest.c Thu May 14 06:01:00 2009 -0400
++++ b/rest.c Thu May 14 07:38:17 2009 -0400
+@@ -3998,7 +3998,7 @@
+ oj = j;
+ }
+ }
+- erg += sum(c,b);
++ erg += sym_sum(c,b);
+ eee:
+ erg += freeall(c);
+ ENDR("charge_word");
+diff -r 5cd656a07aa5 src/ta.c
+--- a/ta.c Thu May 14 06:01:00 2009 -0400
++++ b/ta.c Thu May 14 07:38:17 2009 -0400
+@@ -1596,7 +1596,7 @@
+ {
+ OP d,e;
+ e = CALLOCOBJECT();
+- erg += sum(content,e); /* AK 271098 */
++ erg += sym_sum(content,e); /* AK 271098 */
+ d = CALLOCOBJECT();
+ erg += weight(shape,d);
+ if (NEQ(d,e))
+@@ -1821,7 +1821,7 @@
+ CE3(matrix, column_index, row_index,matrix_twoword);
+ c = callocobject();
+ erg += zeilen_summe(matrix,c);
+- erg += sum(c,c);
++ erg += sym_sum(c,c);
+ erg += m_l_v(c,column_index);
+ erg += m_l_v(c,row_index);
+ for(i=0,l=0;i<S_M_HI(matrix);i++)
+diff -r 5cd656a07aa5 src/zyk.c
+--- a/zyk.c Thu May 14 06:01:00 2009 -0400
++++ b/zyk.c Thu May 14 07:38:17 2009 -0400
+@@ -804,7 +804,7 @@
+ zykeltypvec = CALLOCOBJECT();
+ ak_order = CALLOCOBJECT();
+
+- sum(numztvec,ak_order); /* AK 060295 */
++ sym_sum(numztvec,ak_order); /* AK 060295 */
+
+
+
+@@ -1176,7 +1176,7 @@
+ erg += m_i_i(0,c);
+ while (z!=NULL)
+ {
+- erg += sum(S_PO_S(z),e);
++ erg += sym_sum(S_PO_S(z),e);
+ erg += hoch(b,e,e);
+ erg += mult_apply(S_PO_K(z),e);
+ erg += add_apply(e,c);