code:
Adjust the bundled gnulib to cope with removal of libio interface in
glibc 2.28.

Based on this upstream patch, without hunks that do not apply to m4:
https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=4af4a4a71827c0bc5e0ec67af23edef4f15cee8e

diff --git a/lib/fflush.c b/lib/fflush.c
index 983ade0..a6edfa1 100644
--- a/lib/fflush.c
+++ b/lib/fflush.c
@@ -33,7 +33,7 @@
 #undef fflush

-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */

 /* Clear the stream's ungetc buffer, preserving the value of ftello (fp).  */
 static void
@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)

 #endif

-#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)

 # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
 /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
   if (stream == NULL || ! freading (stream))
     return fflush (stream);

-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */

   clear_ungetc_buffer_preserving_position (stream);

diff --git a/lib/fpending.c b/lib/fpending.c
index c84e3a5..789f50e 100644
--- a/lib/fpending.c
+++ b/lib/fpending.c
@@ -32,7 +32,7 @@ __fpending (FILE *fp)
   /* Most systems provide FILE as a struct and the necessary bitmask in
      <stdio.h>, because they need it for implementing getc() and putc() as
      fast macros.  */
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
   return fp->_IO_write_ptr - fp->_IO_write_base;
 #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
diff --git a/lib/fpurge.c b/lib/fpurge.c
index b1d417c..3aedcc3 100644
--- a/lib/fpurge.c
+++ b/lib/fpurge.c
@@ -62,7 +62,7 @@ fpurge (FILE *fp)
   /* Most systems provide FILE as a struct and the necessary bitmask in
      <stdio.h>, because they need it for implementing getc() and putc() as
      fast macros.  */
-# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
   fp->_IO_read_end = fp->_IO_read_ptr;
   fp->_IO_write_ptr = fp->_IO_write_base;
   /* Avoid memory leak when there is an active ungetc buffer.  */
diff --git a/lib/freadahead.c b/lib/freadahead.c
index c2ecb5b..23ec76e 100644
--- a/lib/freadahead.c
+++ b/lib/freadahead.c
@@ -30,7 +30,7 @@ extern size_t __sreadahead (FILE *);
 size_t
 freadahead (FILE *fp)
 {
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
   if (fp->_IO_write_ptr > fp->_IO_write_base)
     return 0;
   return (fp->_IO_read_end - fp->_IO_read_ptr)
diff --git a/lib/freading.c b/lib/freading.c
index 73c28ac..c24d0c8 100644
--- a/lib/freading.c
+++ b/lib/freading.c
@@ -31,7 +31,7 @@ freading (FILE *fp)
   /* Most systems provide FILE as a struct and the necessary bitmask in
      <stdio.h>, because they need it for implementing getc() and putc() as
      fast macros.  */
-# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
   return ((fp->_flags & _IO_NO_WRITES) != 0
           || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
               && fp->_IO_read_base != NULL));
diff --git a/lib/fseeko.c b/lib/fseeko.c
index 0101ab5..193f4e8 100644
--- a/lib/fseeko.c
+++ b/lib/fseeko.c
@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence)
 #endif

   /* These tests are based on fpurge.c.  */
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
   if (fp->_IO_read_end == fp->_IO_read_ptr
       && fp->_IO_write_ptr == fp->_IO_write_base
       && fp->_IO_save_base == NULL)
@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence)
           return -1;
         }

-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
       fp->_flags &= ~_IO_EOF_SEEN;
       fp->_offset = pos;
 #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
diff --git a/lib/stdio-impl.h b/lib/stdio-impl.h
index 78d896e..05c5752 100644
--- a/lib/stdio-impl.h
+++ b/lib/stdio-impl.h
@@ -18,6 +18,12 @@
    the same implementation of stdio extension API, except that some fields
    have different naming conventions, or their access requires some casts.  */

+/* Glibc 2.28 made _IO_IN_BACKUP private.  For now, work around this
+   problem by defining it ourselves.  FIXME: Do not rely on glibc
+   internals.  */
+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
+# define _IO_IN_BACKUP 0x100
+#endif

 /* BSD stdio derived implementations.  */


code:
Purity: don't look for library dependencies (of the form `-lfoo') in
/lib and /usr/lib.  Likewise, when searching for included Makefiles,
don't look in /usr/include and friends.

Patch from Nixpkgs, by Eelco Dolstra.

diff -rc make-3.81-orig/src/read.c make-3.81/src/read.c
*** make-3.81-orig/src/read.c	2006-03-17 15:24:20.000000000 +0100
--- make-3.81/src/read.c	2007-05-24 17:16:31.000000000 +0200
***************
*** 99,107 ****
--- 99,109 ----
  #endif
      INCLUDEDIR,
  #ifndef _AMIGA
+ #if 0
      "/usr/gnu/include",
      "/usr/local/include",
      "/usr/include",
+ #endif
  #endif
      0
    };
diff -rc make-3.81-orig/src/remake.c make-3.81/src/remake.c
*** make-3.81-orig/src/remake.c	2006-03-20 03:36:37.000000000 +0100
--- make-3.81/src/remake.c	2007-05-24 17:06:54.000000000 +0200
***************
*** 1452,1460 ****
--- 1452,1462 ----
    static char *dirs[] =
      {
  #ifndef _AMIGA
+ #if 0
        "/lib",
        "/usr/lib",
  #endif
+ #endif
  #if defined(WINDOWS32) && !defined(LIBDIR)
  /*
   * This is completely up to the user at product install time. Just define

license: mit


code:
From 93efa48a7b972fc463406603574a4d508eefe792 Mon Sep 17 00:00:00 2001
From: Sergei Golubchik <serg@mariadb.org>
Date: Sun, 13 May 2018 18:50:21 +0200
Subject: [PATCH] fix failing main.mysql_client_test test on 32bit

in `ulonglong=ulong*uint` multiplication
is done in ulong, wrapping around on 32bit.

This became visible after C/C changed the
default charset to utf8, thus changing
mbmaxlem from 1 to 3.
---
 tests/mysql_client_fw.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/mysql_client_fw.c b/tests/mysql_client_fw.c
index f69eb28a2871..4d036887629a 100644
--- a/tests/mysql_client_fw.c
+++ b/tests/mysql_client_fw.c
@@ -768,7 +768,7 @@ static void do_verify_prepare_field(MYSQL_RES *result,
 {
   MYSQL_FIELD *field;
   CHARSET_INFO *cs;
-  ulonglong expected_field_length;
+  ulonglong expected_field_length= length;

   if (!(field= mysql_fetch_field_direct(result, no)))
   {
@@ -777,7 +777,7 @@ static void do_verify_prepare_field(MYSQL_RES *result,
   }
   cs= get_charset(field->charsetnr, 0);
   DIE_UNLESS(cs);
-  if ((expected_field_length= length * cs->mbmaxlen) > UINT_MAX32)
+  if ((expected_field_length*= cs->mbmaxlen) > UINT_MAX32)
     expected_field_length= UINT_MAX32;
   if (!opt_silent)
   {


code:
Remove install target for non-existant directory.

--- a/src/CMakeLists.txt	2015-09-13 20:52:28.517344327 +0200
+++ b/src/CMakeLists.txt	2015-09-13 20:53:04.842453987 +0200
@@ -122,12 +122,6 @@
 		DESTINATION
 			${CMAKE_INSTALL_PREFIX}/share/applications
 	)
-	install(
-		FILES
-			${MARS_SOURCE_DIR}/resources/mars
-		DESTINATION
-			${CMAKE_INSTALL_PREFIX}/share/menu
-	)

 else(UNIX)
 	# executable


code:
This is a concatenation of the following two patches:

  https://github.com/jcowgill/M.A.R.S./commit/33d5affabf8ff84f2c028b9303c6a9e83cc824ad.patch
  https://patch-diff.githubusercontent.com/raw/thelaui/M.A.R.S./pull/2.patch

Their purpose is to allow Mars to be built against the latest version of SFML.

From 33d5affabf8ff84f2c028b9303c6a9e83cc824ad Mon Sep 17 00:00:00 2001
From: James Cowgill <james410@cowgill.org.uk>
Date: Sat, 9 May 2015 01:54:14 +0100
Subject: [PATCH] Remove dependency on GLU - fixes build with SFML 2.3

---
 premake4.lua           |  8 ++++----
 src/Shaders/postFX.cpp |  2 +-
 src/System/window.cpp  | 12 ++++++------
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/premake4.lua b/premake4.lua
index 023dddd..5af4495 100755
--- a/premake4.lua
+++ b/premake4.lua
@@ -11,11 +11,11 @@ project "mars"
     defines { "NDEBUG" }
     flags   { "Optimize" }
     if os.get() == "windows" then
-      links { "sfml-graphics", "sfml-audio", "sfml-system", "sfml-window", "glu32", "opengl32", "fribidi-0", "tag" }
+      links { "sfml-graphics", "sfml-audio", "sfml-system", "sfml-window", "opengl32", "fribidi-0", "tag" }
     elseif os.get() == "macosx" then
       links { "sfml-graphics.framework", "sfml-audio.framework", "sfml-system.framework", "sfml-window.framework", "opengl.framework", "fribidi", "tag" }
     else
-      links { "GLU", "sfml-graphics", "sfml-audio", "sfml-system", "sfml-window", "fribidi", "tag" }
+      links { "sfml-graphics", "sfml-audio", "sfml-system", "sfml-window", "fribidi", "tag" }
       libdirs { "/usr/lib", "/usr/local/lib" }
     end

@@ -23,10 +23,10 @@ project "mars"
     defines { "_DEBUG", "DEBUG" }
     flags   { "Symbols" }
     if os.get() == "windows" then
-      links { "sfml-graphics", "sfml-audio", "sfml-system", "sfml-window", "glu32", "opengl32", "fribidi-0", "tag" }
+      links { "sfml-graphics", "sfml-audio", "sfml-system", "sfml-window", "opengl32", "fribidi-0", "tag" }
     elseif os.get() == "macosx" then
       links { "sfml-graphics.framework", "sfml-audio.framework", "sfml-system.framework", "sfml-window.framework", "opengl.framework", "fribidi", "tag" }
     else
-      links { "GLU", "sfml-graphics", "sfml-audio", "sfml-system", "sfml-window", "fribidi", "tag" }
+      links { "sfml-graphics", "sfml-audio", "sfml-system", "sfml-window", "fribidi", "tag" }
       libdirs { "/usr/lib", "/usr/local/lib" }
     end
diff --git a/src/Shaders/postFX.cpp b/src/Shaders/postFX.cpp
index 987f411..f767a47 100644
--- a/src/Shaders/postFX.cpp
+++ b/src/Shaders/postFX.cpp
@@ -78,7 +78,7 @@ namespace postFX {
             postFX_.loadFromFile(settings::C_dataPath + "shaders/bump.frag", sf::Shader::Fragment);
             bumpMap_.create(SPACE_X_RESOLUTION*0.5f, SPACE_Y_RESOLUTION*0.5f);
             glViewport(0,0,SPACE_X_RESOLUTION*0.5f,SPACE_Y_RESOLUTION*0.5f);
-            gluOrtho2D(0, SPACE_X_RESOLUTION, SPACE_Y_RESOLUTION, 0);
+            glOrtho(0, SPACE_X_RESOLUTION, SPACE_Y_RESOLUTION, 0, -1, 1);
             glEnable(GL_BLEND);
             glMatrixMode(GL_MODELVIEW);
             postFX_.setParameter("BumpMap", bumpMap_.getTexture());
diff --git a/src/System/window.cpp b/src/System/window.cpp
index e9a099a..8e12dcc 100644
--- a/src/System/window.cpp
+++ b/src/System/window.cpp
@@ -222,7 +222,7 @@ namespace window {
         glLoadIdentity();

         // Setup translation (according to left-upper corner)
-        gluOrtho2D(0.f, SPACE_X_RESOLUTION, SPACE_Y_RESOLUTION, 0.f);
+        glOrtho(0.f, SPACE_X_RESOLUTION, SPACE_Y_RESOLUTION, 0.f, -1, 1);

         // probably improves performance...
         glDisable(GL_LIGHTING);
@@ -247,7 +247,7 @@ namespace window {

         glMatrixMode(GL_PROJECTION);
         glLoadIdentity();
-        gluOrtho2D(0.f, viewPort_.x_, viewPort_.y_, 0.f);
+        glOrtho(0.f, viewPort_.x_, viewPort_.y_, 0.f, -1, 1);
         glMatrixMode(GL_MODELVIEW);
         glLoadIdentity();

@@ -255,7 +255,7 @@ namespace window {

         glMatrixMode(GL_PROJECTION);
         glLoadIdentity();
-        gluOrtho2D(0.f, SPACE_X_RESOLUTION, SPACE_Y_RESOLUTION, 0.f);
+        glOrtho(0.f, SPACE_X_RESOLUTION, SPACE_Y_RESOLUTION, 0.f, -1, 1);
         glMatrixMode(GL_MODELVIEW);
         glLoadIdentity();
     }
@@ -270,7 +270,7 @@ namespace window {
             glLoadIdentity();
             setViewPort();

-            gluOrtho2D(0.f, viewPort_.x_, viewPort_.y_, 0.f);
+            glOrtho(0.f, viewPort_.x_, viewPort_.y_, 0.f, -1, 1);

             glMatrixMode(GL_MODELVIEW);
             glLoadIdentity();
@@ -284,7 +284,7 @@ namespace window {
             glLoadIdentity();
             setViewPort();

-            gluOrtho2D(0.f, viewPort_.x_, viewPort_.y_, 0.f);
+            glOrtho(0.f, viewPort_.x_, viewPort_.y_, 0.f, -1, 1);

             glMatrixMode(GL_MODELVIEW);
             glLoadIdentity();
@@ -294,7 +294,7 @@ namespace window {
         else {
             glMatrixMode(GL_PROJECTION);
             glLoadIdentity();
-            gluOrtho2D(0.f, viewPort_.x_, viewPort_.y_, 0.f);
+            glOrtho(0.f, viewPort_.x_, viewPort_.y_, 0.f, -1, 1);
             glMatrixMode(GL_MODELVIEW);
             glLoadIdentity();
         }

From a97d0d6a19b5b43e3c53081e36f1f1747b6674e6 Mon Sep 17 00:00:00 2001
From: Sylvain BOILARD <boilard@crans.org>
Date: Wed, 23 Jan 2013 02:02:47 +0100
Subject: [PATCH] Use sf::Shader::Bind() correctly after latest update of the
 SFML's API.

---
 src/System/window.cpp | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/System/window.cpp b/src/System/window.cpp
index e9a099a..3ffcf65 100644
--- a/src/System/window.cpp
+++ b/src/System/window.cpp
@@ -307,13 +307,11 @@ namespace window {
         window_.setActive(true);
         glEnable(GL_TEXTURE_2D);

-        if (shader)
-            shader->bind();
+        sf::Shader::bind(shader);

         window_.draw(toBeDrawn, states);

-        if (shader)
-            shader->unbind();
+        sf::Shader::bind(NULL);

         window_.popGLStates();
         glPopMatrix();


code:
From eccc46eaf7903a8e837813795498b12c078faaea Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
Date: Wed, 11 Mar 2020 21:53:32 +0100
Subject: [PATCH] Fix old dependencies

---
 .../enforcer/AbstractBanDependencies.java     |  2 +-
 .../enforcer/BanTransitiveDependencies.java   |  2 +-
 .../enforcer/DependencyConvergence.java       | 17 ++++++++---------
 .../enforcer/RequireUpperBoundDeps.java       | 19 +++++++++----------
 .../enforcer/utils/DependencyVersionMap.java  |  6 +++---
 5 files changed, 22 insertions(+), 24 deletions(-)

diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractBanDependencies.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractBanDependencies.java
index 2888a61..2b944b7 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractBanDependencies.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractBanDependencies.java
@@ -119,7 +119,7 @@ public abstract class AbstractBanDependencies
         Set<Artifact> dependencies = null;
         try
         {
-            DependencyNode node = graphBuilder.buildDependencyGraph( project, null );
+            DependencyNode node = graphBuilder.buildDependencyGraph( project.getProjectBuildingRequest(), null );
             if ( searchTransitive )
             {
                 dependencies = ArtifactUtils.getAllDescendants( node );
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanTransitiveDependencies.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanTransitiveDependencies.java
index 6e1dcd4..1b964ba 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanTransitiveDependencies.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanTransitiveDependencies.java
@@ -158,7 +158,7 @@ public class BanTransitiveDependencies
         try
         {
             MavenProject project = (MavenProject) helper.evaluate( "${project}" );
-            rootNode = createDependencyGraphBuilder().buildDependencyGraph( project, null );
+            rootNode = createDependencyGraphBuilder().buildDependencyGraph( project.getProjectBuildingRequest(), null );
         }
         catch ( Exception e )
         {
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/DependencyConvergence.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/DependencyConvergence.java
index 684f984..ca7ad3a 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/DependencyConvergence.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/DependencyConvergence.java
@@ -35,9 +35,9 @@ import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper;
 import org.apache.maven.plugin.logging.Log;
 import org.apache.maven.plugins.enforcer.utils.DependencyVersionMap;
 import org.apache.maven.project.MavenProject;
-import org.apache.maven.shared.dependency.tree.DependencyNode;
-import org.apache.maven.shared.dependency.tree.DependencyTreeBuilder;
-import org.apache.maven.shared.dependency.tree.DependencyTreeBuilderException;
+import org.apache.maven.shared.dependency.graph.DependencyNode;
+import org.apache.maven.shared.dependency.graph.DependencyGraphBuilder;
+import org.apache.maven.shared.dependency.graph.DependencyGraphBuilderException;
 import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException;
 import org.codehaus.plexus.component.repository.exception.ComponentLookupException;

@@ -60,7 +60,7 @@ public class DependencyConvergence
     // CHECKSTYLE_OFF: LineLength
     /**
      * Uses the {@link EnforcerRuleHelper} to populate the values of the
-     * {@link DependencyTreeBuilder#buildDependencyTree(MavenProject, ArtifactRepository, ArtifactFactory, ArtifactMetadataSource, ArtifactFilter, ArtifactCollector)}
+     * {@link DependencyGraphBuilder#buildDependencyTree(MavenProject, ArtifactRepository, ArtifactFactory, ArtifactMetadataSource, ArtifactFilter, ArtifactCollector)}
      * factory method.

      * This method simply exists to hide all the ugly lookup that the {@link EnforcerRuleHelper} has to do.
      *
@@ -75,16 +75,15 @@ public class DependencyConvergence
         try
         {
             MavenProject project = (MavenProject) helper.evaluate( "${project}" );
-            DependencyTreeBuilder dependencyTreeBuilder =
-                (DependencyTreeBuilder) helper.getComponent( DependencyTreeBuilder.class );
+            DependencyGraphBuilder dependencyTreeBuilder =
+                (DependencyGraphBuilder) helper.getComponent( DependencyGraphBuilder.class );
             ArtifactRepository repository = (ArtifactRepository) helper.evaluate( "${localRepository}" );
             ArtifactFactory factory = (ArtifactFactory) helper.getComponent( ArtifactFactory.class );
             ArtifactMetadataSource metadataSource =
                 (ArtifactMetadataSource) helper.getComponent( ArtifactMetadataSource.class );
             ArtifactCollector collector = (ArtifactCollector) helper.getComponent( ArtifactCollector.class );
             ArtifactFilter filter = null; // we need to evaluate all scopes
-            DependencyNode node = dependencyTreeBuilder.buildDependencyTree( project, repository, factory,
-                                                                             metadataSource, filter, collector );
+            DependencyNode node = dependencyTreeBuilder.buildDependencyGraph( project.getProjectBuildingRequest(), filter);
             return node;
         }
         catch ( ExpressionEvaluationException e )
@@ -95,7 +94,7 @@ public class DependencyConvergence
         {
             throw new EnforcerRuleException( "Unable to lookup a component " + e.getLocalizedMessage(), e );
         }
-        catch ( DependencyTreeBuilderException e )
+        catch ( DependencyGraphBuilderException e )
         {
             throw new EnforcerRuleException( "Could not build dependency tree " + e.getLocalizedMessage(), e );
         }
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireUpperBoundDeps.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireUpperBoundDeps.java
index 458554a..2de9870 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireUpperBoundDeps.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireUpperBoundDeps.java
@@ -38,10 +38,10 @@ import org.apache.maven.enforcer.rule.api.EnforcerRuleException;
 import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper;
 import org.apache.maven.plugin.logging.Log;
 import org.apache.maven.project.MavenProject;
-import org.apache.maven.shared.dependency.tree.DependencyNode;
-import org.apache.maven.shared.dependency.tree.DependencyTreeBuilder;
-import org.apache.maven.shared.dependency.tree.DependencyTreeBuilderException;
-import org.apache.maven.shared.dependency.tree.traversal.DependencyNodeVisitor;
+import org.apache.maven.shared.dependency.graph.DependencyNode;
+import org.apache.maven.shared.dependency.graph.DependencyGraphBuilder;
+import org.apache.maven.shared.dependency.graph.DependencyGraphBuilderException;
+import org.apache.maven.shared.dependency.graph.traversal.DependencyNodeVisitor;
 import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException;
 import org.codehaus.plexus.component.repository.exception.ComponentLookupException;

@@ -91,7 +91,7 @@ public class RequireUpperBoundDeps
     // CHECKSTYLE_OFF: LineLength
     /**
      * Uses the {@link EnforcerRuleHelper} to populate the values of the
-     * {@link DependencyTreeBuilder#buildDependencyTree(MavenProject, ArtifactRepository, ArtifactFactory, ArtifactMetadataSource, ArtifactFilter, ArtifactCollector)}
+     * {@link DependencyGraphBuilder#buildDependencyTree(MavenProject, ArtifactRepository, ArtifactFactory, ArtifactMetadataSource, ArtifactFilter, ArtifactCollector)}
      * factory method.

      * This method simply exists to hide all the ugly lookup that the {@link EnforcerRuleHelper} has to do.
      *
@@ -106,8 +106,8 @@ public class RequireUpperBoundDeps
         try
         {
             MavenProject project = (MavenProject) helper.evaluate( "${project}" );
-            DependencyTreeBuilder dependencyTreeBuilder =
-                (DependencyTreeBuilder) helper.getComponent( DependencyTreeBuilder.class );
+            DependencyGraphBuilder dependencyTreeBuilder =
+                (DependencyGraphBuilder) helper.getComponent( DependencyGraphBuilder.class );
             ArtifactRepository repository = (ArtifactRepository) helper.evaluate( "${localRepository}" );
             ArtifactFactory factory = (ArtifactFactory) helper.getComponent( ArtifactFactory.class );
             ArtifactMetadataSource metadataSource =
@@ -115,8 +115,7 @@ public class RequireUpperBoundDeps
             ArtifactCollector collector = (ArtifactCollector) helper.getComponent( ArtifactCollector.class );
             ArtifactFilter filter = null; // we need to evaluate all scopes
             DependencyNode node =
-                dependencyTreeBuilder.buildDependencyTree( project, repository, factory, metadataSource, filter,
-                                                           collector );
+                dependencyTreeBuilder.buildDependencyGraph( project.getProjectBuildingRequest(), filter);
             return node;
         }
         catch ( ExpressionEvaluationException e )
@@ -127,7 +126,7 @@ public class RequireUpperBoundDeps
         {
             throw new EnforcerRuleException( "Unable to lookup a component " + e.getLocalizedMessage(), e );
         }
-        catch ( DependencyTreeBuilderException e )
+        catch ( DependencyGraphBuilderException e )
         {
             throw new EnforcerRuleException( "Could not build dependency tree " + e.getLocalizedMessage(), e );
         }
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/DependencyVersionMap.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/DependencyVersionMap.java
index b6213fa..2c2a645 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/DependencyVersionMap.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/DependencyVersionMap.java
@@ -26,8 +26,8 @@ import java.util.Map;

 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.plugin.logging.Log;
-import org.apache.maven.shared.dependency.tree.DependencyNode;
-import org.apache.maven.shared.dependency.tree.traversal.DependencyNodeVisitor;
+import org.apache.maven.shared.dependency.graph.DependencyNode;
+import org.apache.maven.shared.dependency.graph.traversal.DependencyNodeVisitor;

 /**
  * @author Brian Fox
@@ -132,4 +132,4 @@ public class DependencyVersionMap
         }
         return output;
     }
-}
\ No newline at end of file
+}
--
2.24.1


code:
From da9e282d834f0e2128501a8154128dc95b4c599d Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
Date: Sat, 9 Sep 2017 20:34:38 +0200
Subject: [PATCH] Add a script to generate component.xml files.

plexus-component-metadata is normally used for this task, but it
depends on maven-core, which depends on maven-model-builder, which needs
plexus-component-metadata. This script is meant to break this dependency
cycle.
---
 components.sh | 132 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 132 insertions(+)
 create mode 100755 components.sh

diff --git a/components.sh b/components.sh
new file mode 100755
index 0000000..c6748bd
--- /dev/null
+++ b/components.sh
@@ -0,0 +1,148 @@
+## This script generates a rough plexus/components.xml file. It is meant to
+## replace plexus-component-metadata as it eventually has a recursive dependency
+## on itself.
+##
+## This script must be run in the source directory (usually src/main/java).
+
+# Finds the complete name from a class name.
+function find_role() {
+    role=$1
+    # Find role
+    case $role in
+      "SettingsWriter" | "SettingsReader")
+        role=org.apache.maven.settings.io.$role
+        ;;
+      "SecDispatcher")
+        role=org.sonatype.plexus.components.sec.dispatcher.$role
+        ;;
+      "SettingsDecrypter")
+        role=org.apache.maven.settings.crypto.$role
+        ;;
+      "SettingsBuilder")
+        role=org.apache.maven.settings.building.$role
+        ;;
+      "SettingsValidator")
+        role=org.apache.maven.settings.validation.$role
+        ;;
+      "LoggerFactory")
+        role=org.eclipse.aether.spi.log.$role
+        ;;
+      "RemoteRepositoryManager" | "VersionResolver" | "VersionRangeResolver" \
+      | "ArtifactResolver" | "RepositoryEventDispatcher" | "MetadataResolver" \
+      | "SyncContextFactory" | "MetadataGeneratorFactory" | "MetadatResolver" \
+      | "ArtifactDescriptorReader")
+        role=org.eclipse.aether.impl.$role
+        ;;
+      "ModelBuilder" | "ModelProcessor")
+        role=org.apache.maven.model.building.$role
+        ;;
+      "ModelValidator")
+        role=org.apache.maven.model.validation.$role
+        ;;
+      "ProfileInjector" | "ProfileSelector")
+        role=org.apache.maven.model.profile.$role
+        ;;
+      "ProfileActivator")
+        role=org.apache.maven.model.profile.activation.$role
+        ;;
+      "SuperPomProvider")
+        role=org.apache.maven.model.superpom.$role
+        ;;
+      "ReportConfigurationExpander" | "PluginConfigurationExpander" \
+      | "ReportingConverter" | "LifecycleBindingsInjector")
+        role=org.apache.maven.model.plugin.$role
+        ;;
+      "ModelLocator")
+        role=org.apache.maven.model.locator.$role
+        ;;
+      "ModelPathTranslator" | "PathTranslator" | "UrlNormalizer" | "ModelUrlNormalizer")
+        role=org.apache.maven.model.path.$role
+        ;;
+      "DependencyManagementInjector" | "PluginManagementInjector")
+        role=org.apache.maven.model.management.$role
+        ;;
+      "ModelWriter" | "ModelReader")
+        role=org.apache.maven.model.io.$role
+        ;;
+      "DependencyManagementImporter")
+        role=org.apache.maven.model.composition.$role
+        ;;
+      "ModelNormalizer")
+        role=org.apache.maven.model.normalization.$role
+        ;;
+      "ModelInterpolator")
+        role=org.apache.maven.model.interpolation.$role
+        ;;
+      "InheritanceAssembler")
+        role=org.apache.maven.model.inheritance.$role
+        ;;
+      *)
+        role=$role
+        ;;
+    esac
+    echo $role
+}
+
+function generate_xml() {
+echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+echo "<component-set>"
+echo "<components>"
+
+for file in `find -name '*.java'`; do
+  annot=`grep "@Component" $file`
+  if [ "$?" == "0" ]; then
+    # We have a component!
+    role=$(echo $annot | sed 's|.*role = \(.*\).class.*|\1|')
+    role_hint=$(echo $annot | sed 's|.*hint = "\(.*\)" .*|\1|')
+    if [ "$role_hint" = "$annot" ]; then
+      role_hint=default
+    fi
+    implem=$(echo $file | sed -e 's|^\./||' -e 's|\.java||' -e 's|/|.|g')
+    role=$(find_role $role)
+
+    echo "<component>"
+    echo "  <role>$role</role>"
+    echo "  <role-hint>$role_hint</role-hint>"
+    echo "  <implementation>$implem</implementation>"
+    echo "  <description />"
+    echo "  <isolated-realm>false</isolated-realm>"
+    echo "  <requirements>"
+    reqn=1
+    cont=true
+    while [ "$cont" = "true" ]; do
+      requirement=$(grep "@Requirement" $file -A1 | head -n ${reqn} | tail -1)
+      ((reqn++))
+      property=$(grep "@Requirement" $file -A1 | head -n ${reqn} | tail -1)
+      if (echo $requirement | grep "@Requirement" >/dev/null); then
+        ((reqn++))
+        ((reqn++))
+        optional=$(echo $requirement | sed 's|.*optional = \(.*\) .*|\1|')
+        req_role=$(echo $requirement | sed 's|.*role = \(.*\).class .*|\1|')
+        if (echo $req_role | grep "@Requirement" >/dev/null); then
+          req_role=$(echo $property | sed 's|.*private \(.*\) .*|\1|')
+        fi
+        req_role=$(find_role $req_role)
+        req_name=$(echo $property | sed 's|[^ ]* [^ ]* \([^ ;]*\).*|\1|')
+        echo "    <requirement>"
+        echo "      <role>$req_role</role>"
+        echo "      <field-name>$req_name</field-name>"
+        if (echo $optional | grep "@Requirement" >/dev/null); then
+          :
+        else
+          echo "      <optional>$optional</optional>"
+        fi
+        echo "    </requirement>"
+      else
+        cont=false
+      fi
+    done
+    echo "  </requirements>"
+    echo "</component>"
+  fi
+done
+
+echo "</components>"
+echo "</component-set>"
+}
+
+(cd $1; generate_xml) > $2
--
2.14.1


code:
From 1d20c0e403f1a38d4aca830e0eb4db03ba43efd3 Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
Date: Tue, 19 Sep 2017 22:21:29 +0200
Subject: [PATCH] Add sisu-maven-plugin replacement

---
 sisu.sh | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100755 sisu.sh

diff --git a/sisu.sh b/sisu.sh
new file mode 100755
index 0000000..979f373
--- /dev/null
+++ b/sisu.sh
@@ -0,0 +1,12 @@
+## This script generates a rough javax.inject.Named file. It is meant to
+## replace sisu-maven-plugin as it eventually has a recursive dependency
+## on maven.
+##
+## This script must be run in the source directory (usually src/main/java).
+
+for file in `(cd $1; find -name '*.java')`; do
+  annot=`grep "^@Named" $1/$file`
+  if [ "$annot" != "" ]; then
+    echo $file | sed -e 's|^\./||' -e 's|\.java||' -e 's|/|.|g'
+  fi
+done > $2
--
2.14.1


code:
Change 'ensure-directories-exist' to look for 'mkdir' in $PATH, not in /bin.

--- maxima-5.36.1/lisp-utils/defsystem.lisp.orig	2014-11-22 16:21:30.000000000 -0500
+++ maxima-5.36.1/lisp-utils/defsystem.lisp	2015-05-25 21:53:31.223648483 -0400
@@ -4627,7 +4627,7 @@
         (cmd (if (member :win32 *features*)
                  (format nil "mkdir \"~a\""
                          (coerce (subst #\\ #\/ (coerce (namestring dir) 'list)) 'string))
-                 (format nil "/bin/mkdir -p ~S" (namestring dir)))))
+                 (format nil "mkdir -p ~S" (namestring dir)))))
    (unless (directory dir)
      (lisp:system cmd))
    ;; The second return value is supposed to be T if directories were


code:
From 4876e3a692739bb9ca00d0f500fd5f4b3eb16ce3 Mon Sep 17 00:00:00 2001
From: Tom Callaway <spot@fedoraproject.org>
Date: Fri, 7 Sep 2012 11:39:29 -0400
Subject: apply fix for CVE-2012-4409 (thanks to Raphael Geissert)

--- mcrypt-2.6.8/src/extra.c.CVE-2012-4409	2012-09-07 11:00:55.906870746 -0400
+++ mcrypt-2.6.8/src/extra.c	2012-09-07 11:00:27.967858365 -0400
@@ -242,6 +242,8 @@ int check_file_head(FILE * fstream, char
 			if (m_getbit(0, sflag) != 0) { /* if the first bit is set */
 				*salt_size = m_setbit(0, sflag, 0);
 				if (*salt_size > 0) {
+					if (*salt_size > sizeof(tmp_buf))
+						err_quit(_("Salt is too long\n"));
 					fread(tmp_buf, 1, *salt_size,
 					      fstream);
 					memmove(salt, tmp_buf, *salt_size);

--
cgit v0.12


code:
diff --git a/mcrypt-CVE-2012-4426.patch b/mcrypt-CVE-2012-4426.patch
new file mode 100644
index 0000000..747f428
--- mcrypt-2.6.8/src/errors.c
+++ mcrypt-2.6.8/src/errors.c
@@ -25,24 +25,24 @@

 void err_quit(char *errmsg)
 {
-	fprintf(stderr, errmsg);
+	fprintf(stderr, "%s", errmsg);
 	exit(-1);
 }

 void err_warn(char *errmsg)
 {
 	if (quiet <= 1)
-		fprintf(stderr, errmsg);
+		fprintf(stderr, "%s", errmsg);
 }

 void err_info(char *errmsg)
 {
 	if (quiet == 0)
-		fprintf(stderr, errmsg);
+		fprintf(stderr, "%s", errmsg);
 }

 void err_crit(char *errmsg)
 {
 	if (quiet <= 2)
-		fprintf(stderr, errmsg);
+		fprintf(stderr, "%s", errmsg);
 }

---


code:
From b0716eac4e800a0ea53e1b949250f671702f28a0 Mon Sep 17 00:00:00 2001
From: Tom Callaway <spot@fedoraproject.org>
Date: Tue, 30 Oct 2012 15:39:24 -0400
Subject: apply workaround to CVE-2012-4527

--- mcrypt-2.6.8.orig/src/mcrypt.c
+++ mcrypt-2.6.8/src/mcrypt.c
@@ -41,6 +41,8 @@
 # include <time.h>
 #endif

+#define WIDTH 80
+
 static char rcsid[] =
     "$Id: mcrypt.c,v 1.2 2007/11/07 17:10:21 nmav Exp $";

@@ -482,7 +484,7 @@
 #ifdef HAVE_STAT
       if (stream_flag == FALSE) {
 	 if (is_normal_file(file[i]) == FALSE) {
-	    sprintf(tmperr,
+	    snprintf(tmperr, WIDTH,
 		    _
 		    ("%s: %s is not a regular file. Skipping...\n"),
 		    program_name, file[i]);
@@ -501,7 +503,7 @@
 	    dinfile = file[i];
 	 if ((isatty(fileno((FILE *) (stdin))) == 1)
 	     && (stream_flag == TRUE) && (force == 0)) {	/* not a tty */
-	    sprintf(tmperr,
+	    snprintf(tmperr, WIDTH,
 		    _
 		    ("%s: Encrypted data will not be read from a terminal.\n"),
 		    program_name);
@@ -520,7 +522,7 @@
 	    einfile = file[i];
 	 if ((isatty(fileno((FILE *) (stdout))) == 1)
 	     && (stream_flag == TRUE) && (force == 0)) {	/* not a tty */
-	    sprintf(tmperr,
+	    snprintf(tmperr, WIDTH,
 		    _
 		    ("%s: Encrypted data will not be written to a terminal.\n"),
 		    program_name);
@@ -544,7 +546,7 @@
 	    strcpy(outfile, einfile);
 	    /* if file has already the .nc ignore it */
 	    if (strstr(outfile, ".nc") != NULL) {
-	       sprintf(tmperr,
+	       snprintf(tmperr, WIDTH,
 		       _
 		       ("%s: file %s has the .nc suffix... skipping...\n"),
 		       program_name, outfile);
@@ -590,10 +592,10 @@

 	 if (x == 0) {
 	    if (stream_flag == FALSE) {
-	       sprintf(tmperr, _("File %s was decrypted.\n"), dinfile);
+	       snprintf(tmperr, WIDTH, _("File %s was decrypted.\n"), dinfile);
 	       err_warn(tmperr);
 	    } else {
-	       sprintf(tmperr, _("Stdin was decrypted.\n"));
+	       snprintf(tmperr, WIDTH, _("Stdin was decrypted.\n"));
 	       err_warn(tmperr);
 	    }
 #ifdef HAVE_STAT
@@ -610,7 +612,7 @@

 	 } else {
 	    if (stream_flag == FALSE) {
-	       sprintf(tmperr,
+	       snprintf(tmperr, WIDTH,
 		       _
 		       ("File %s was NOT decrypted successfully.\n"),
 		       dinfile);
@@ -636,10 +638,10 @@

 	 if (x == 0) {
 	    if (stream_flag == FALSE) {
-	       sprintf(tmperr, _("File %s was encrypted.\n"), einfile);
+	       snprintf(tmperr, WIDTH, _("File %s was encrypted.\n"), einfile);
 	       err_warn(tmperr);
 	    } else {
-	       sprintf(tmperr, _("Stdin was encrypted.\n"));
+	       snprintf(tmperr, WIDTH, _("Stdin was encrypted.\n"));
 	       err_warn(tmperr);
 	    }
 #ifdef HAVE_STAT
@@ -655,7 +657,7 @@

 	 } else {
 	    if (stream_flag == FALSE) {
-	       sprintf(tmperr,
+	       snprintf(tmperr, WIDTH,
 		       _
 		       ("File %s was NOT encrypted successfully.\n"),
 		       einfile);
-
git v0.12


code:
From 97903498364ae2596e790cb2c2ce9ac76c04d64a Mon Sep 17 00:00:00 2001
From: Danmei Chen <danmei.chen@belledonne-communications.com>
Date: Fri, 19 Jan 2018 10:04:07 +0100
Subject: [PATCH] add compability with srtp2

---
 cmake/FindSRTP.cmake    | 24 ++++++++++++++++++++----
 src/CMakeLists.txt      |  1 +
 src/crypto/ms_srtp.c    | 10 ++--------
 src/utils/srtp_prefix.h | 41 +++++++++++++++++++++++++++++++++++++++++
 4 files changed, 64 insertions(+), 12 deletions(-)
 create mode 100644 src/utils/srtp_prefix.h

diff --git a/cmake/FindSRTP.cmake b/cmake/FindSRTP.cmake
index 988b846a..f720ce7e 100644
--- a/cmake/FindSRTP.cmake
+++ b/cmake/FindSRTP.cmake
@@ -31,20 +31,36 @@ set(_SRTP_ROOT_PATHS
 )

 find_path(SRTP_INCLUDE_DIRS
-	NAMES srtp/srtp.h
+	NAMES srtp2/srtp.h
 	HINTS _SRTP_ROOT_PATHS
 	PATH_SUFFIXES include
 )

 if(SRTP_INCLUDE_DIRS)
 	set(HAVE_SRTP_SRTP_H 1)
-endif()
-
-find_library(SRTP_LIBRARIES
+	set(SRTP_VERSION 2)
+	find_library(SRTP_LIBRARIES
+		NAMES srtp2
+		HINTS ${_SRTP_ROOT_PATHS}
+		PATH_SUFFIXES bin lib
+	)
+else()
+	find_path(SRTP_INCLUDE_DIRS
+		NAMES srtp/srtp.h
+		HINTS _SRTP_ROOT_PATHS
+		PATH_SUFFIXES include
+	)
+	if(SRTP_INCLUDE_DIRS)
+		set(HAVE_SRTP_SRTP_H 1)
+		set(SRTP_VERSION 1)
+	endif()
+	find_library(SRTP_LIBRARIES
 	NAMES srtp
 	HINTS ${_SRTP_ROOT_PATHS}
 	PATH_SUFFIXES bin lib
 )
+endif()
+

 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(SRTP
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index da429764..c46faa62 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -183,6 +183,7 @@ set(VOIP_SOURCE_FILES_C
 	utils/pcap_sender.c
 	utils/pcap_sender.h
 	utils/stream_regulator.c
+	utils/srtp_prefix.h
 	voip/audioconference.c
 	voip/audiostream.c
 	voip/bandwidthcontroller.c
diff --git a/src/crypto/ms_srtp.c b/src/crypto/ms_srtp.c
index 5a510c99..67810316 100644
--- a/src/crypto/ms_srtp.c
+++ b/src/crypto/ms_srtp.c
@@ -25,6 +25,7 @@
 #include "mediastreamer2/ms_srtp.h"
 #include "mediastreamer2/mediastream.h"

+
 #ifdef HAVE_SRTP

 /*srtp defines all this stuff*/
@@ -34,13 +35,7 @@
 #undef PACKAGE_TARNAME
 #undef PACKAGE_VERSION

-#if defined(MS2_WINDOWS_PHONE)
-// Windows phone doesn't use make install
-#include <srtp.h>
-#else
-#include <srtp/srtp.h>
-#endif
-
+#include "srtp_prefix.h"

 #include "ortp/b64.h"

@@ -352,7 +347,6 @@ int ms_srtp_init(void)
 			srtp_init_done++;
 		}else{
 			ms_fatal("Couldn't initialize SRTP library: %d.", st);
-			err_reporting_init("mediastreamer2");
 		}
 	}else srtp_init_done++;
 	return (int)st;
diff --git a/src/utils/srtp_prefix.h b/src/utils/srtp_prefix.h
new file mode 100644
index 00000000..68bde496
--- /dev/null
+++ b/src/utils/srtp_prefix.h
@@ -0,0 +1,41 @@
+/*
+  mediastreamer2 library - modular sound and video processing and streaming
+  Copyright (C) 2006-2014 Belledonne Communications, Grenoble
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License, or (at your option) any later version.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+#ifndef __SRTP2_H__
+#define __SRTP2_H__
+
+#if defined(MS2_WINDOWS_PHONE)
+// Windows phone doesn't use make install
+#include <srtp.h>
+#elif SRTP_VERSION==1
+#include <srtp/srtp.h>
+#else
+#include <srtp2/srtp.h>
+#define err_status_t srtp_err_status_t
+#define err_status_ok srtp_err_status_ok
+#define crypto_policy_t srtp_crypto_policy_t
+#define crypto_policy_set_aes_cm_256_hmac_sha1_80 srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80
+#define crypto_policy_set_aes_cm_128_hmac_sha1_32 srtp_crypto_policy_set_aes_cm_128_hmac_sha1_32
+#define crypto_policy_set_aes_cm_128_null_auth srtp_crypto_policy_set_aes_cm_128_null_auth
+#define crypto_policy_set_null_cipher_hmac_sha1_80 srtp_crypto_policy_set_null_cipher_hmac_sha1_80
+#define crypto_policy_set_aes_cm_128_hmac_sha1_80 srtp_crypto_policy_set_aes_cm_128_hmac_sha1_80
+#define crypto_policy_set_aes_cm_256_hmac_sha1_32 srtp_crypto_policy_set_aes_cm_256_hmac_sha1_32
+#define ssrc_t srtp_ssrc_t
+#endif
+
+#endif
--
2.21.0


code:
disk_cache_create() here looks up the users home directory from <pwd.h>
which resolves to "/" in the build environment. I could not find an easy
way to set the home directory to something else, so we disable this test
for now.

--- a/src/compiler/glsl/tests/cache_test.c
+++ b/src/compiler/glsl/tests/cache_test.c
@@ -170,11 +170,6 @@
    unsetenv("MESA_GLSL_CACHE_DIR");
    unsetenv("XDG_CACHE_HOME");

-   cache = disk_cache_create("test", "make_check", 0);
-   expect_non_null(cache, "disk_cache_create with no environment variables");
-
-   disk_cache_destroy(cache);
-
    /* Test with XDG_CACHE_HOME set */
    setenv("XDG_CACHE_HOME", CACHE_TEST_TMP "/xdg-cache-home", 1);
    cache = disk_cache_create("test", "make_check", 0);


code:
From c184e95096881a13f29ebd7fc507fe305d3d8de5 Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@gnu.org>
Date: Thu, 4 Oct 2018 22:03:31 +0200
Subject: [PATCH] build.sh: Update for mes 0.18.

---
 build.sh   | 92 +++++++++++++++++++++++++++++++++++++-----------------
 install.sh |  6 ++--
 2 files changed, 66 insertions(+), 32 deletions(-)

diff --git a/build.sh b/build.sh
index 335a7bb..19a0029 100755
--- a/build.sh
+++ b/build.sh
@@ -18,7 +18,8 @@
 # along with mescc-tools.  If not, see <http://www.gnu.org/licenses/>.

 set -eux
-MES_SEED=${MES_SEED-../mescc-tools-seed/libs}
+MES_PREFIX=${MES_PREFIX-../mes}
+MES_SEED=${MES_SEED-../mes-seed}
 MESCC_TOOLS_SEED=${MESCC_TOOLS_SEED-../mescc-tools-seed}

 #########################################
@@ -32,15 +33,23 @@ MESCC_TOOLS_SEED=${MESCC_TOOLS_SEED-../mescc-tools-seed}
 # blood-elf
 # Create proper debug segment
 $MESCC_TOOLS_SEED/blood-elf\
+    -f $MESCC_TOOLS_SEED/file_print.M1\
+    -f $MESCC_TOOLS_SEED/match.M1\
+    -f $MESCC_TOOLS_SEED/numerate_number.M1\
+    -f $MESCC_TOOLS_SEED/string.M1\
     -f $MESCC_TOOLS_SEED/blood-elf.M1\
     -o blood-elf-blood-elf-footer.M1

 # Build
 # M1-macro phase
 $MESCC_TOOLS_SEED/M1 --LittleEndian --Architecture 1\
-    -f $MES_SEED/x86.M1\
-    -f $MES_SEED/crt1.M1\
-    -f $MES_SEED/libc+tcc-mes.M1\
+    -f $MES_PREFIX/lib/x86-mes/x86.M1\
+    -f $MES_SEED/x86-mes/crt1.S\
+    -f $MES_SEED/x86-mes/libc+tcc.S\
+    -f $MESCC_TOOLS_SEED/file_print.M1\
+    -f $MESCC_TOOLS_SEED/match.M1\
+    -f $MESCC_TOOLS_SEED/numerate_number.M1\
+    -f $MESCC_TOOLS_SEED/string.M1\
     -f $MESCC_TOOLS_SEED/blood-elf.M1\
     -f blood-elf-blood-elf-footer.M1\
     -o blood-elf.hex2
@@ -49,7 +58,7 @@ $MESCC_TOOLS_SEED/hex2\
     --LittleEndian\
     --Architecture 1\
     --BaseAddress 0x1000000\
-    -f $MES_SEED/elf32-header.hex2\
+    -f $MES_PREFIX/lib/x86-mes/elf32-header.hex2\
     -f blood-elf.hex2\
     --exec_enable\
     -o bin/blood-elf
@@ -65,9 +74,13 @@ $MESCC_TOOLS_SEED/hex2\
 $MESCC_TOOLS_SEED/M1 \
     --LittleEndian\
     --Architecture 1\
-    -f $MES_SEED/x86.M1\
-    -f $MES_SEED/crt1.M1\
-    -f $MES_SEED/libc+tcc-mes.M1\
+    -f $MES_PREFIX/lib/x86-mes/x86.M1\
+    -f $MES_SEED/x86-mes/crt1.S\
+    -f $MES_SEED/x86-mes/libc+tcc.S\
+    -f $MESCC_TOOLS_SEED/file_print.M1\
+    -f $MESCC_TOOLS_SEED/match.M1\
+    -f $MESCC_TOOLS_SEED/numerate_number.M1\
+    -f $MESCC_TOOLS_SEED/string.M1\
     -f $MESCC_TOOLS_SEED/M1.M1\
     -f M1-footer.M1\
     -o M1.hex2
@@ -76,7 +89,7 @@ $MESCC_TOOLS_SEED/hex2 \
     --LittleEndian\
     --Architecture 1\
     --BaseAddress 0x1000000\
-    -f $MES_SEED/elf32-header.hex2\
+    -f $MES_PREFIX/lib/x86-mes/elf32-header.hex2\
     -f M1.hex2\
     --exec_enable\
     -o bin/M1
@@ -92,9 +105,13 @@ $MESCC_TOOLS_SEED/hex2 \
 ./bin/M1 \
     --LittleEndian\
     --Architecture 1\
-    -f $MES_SEED/x86.M1\
-    -f $MES_SEED/crt1.M1\
-    -f $MES_SEED/libc+tcc-mes.M1\
+    -f $MES_PREFIX/lib/x86-mes/x86.M1\
+    -f $MES_SEED/x86-mes/crt1.S\
+    -f $MES_SEED/x86-mes/libc+tcc.S\
+    -f $MESCC_TOOLS_SEED/file_print.M1\
+    -f $MESCC_TOOLS_SEED/match.M1\
+    -f $MESCC_TOOLS_SEED/numerate_number.M1\
+    -f $MESCC_TOOLS_SEED/string.M1\
     -f $MESCC_TOOLS_SEED/hex2.M1\
     -f hex2-footer.M1\
     -o hex2.hex2
@@ -103,10 +120,10 @@ $MESCC_TOOLS_SEED/hex2 \
       --LittleEndian\
       --Architecture 1\
       --BaseAddress 0x1000000\
-      -f $MES_SEED/elf32-header.hex2\
+      -f $MES_PREFIX/lib/x86-mes/elf32-header.hex2\
       -f hex2.hex2\
       --exec_enable\
-      -o bin/hex2
+      -o bin/hex2-0

 #########################
 # Phase-1 Self-host     #
@@ -123,18 +140,22 @@ $MESCC_TOOLS_SEED/hex2 \
 ./bin/M1 \
     --LittleEndian\
     --Architecture 1\
-    -f $MES_SEED/x86.M1\
-    -f $MES_SEED/crt1.M1\
-    -f $MES_SEED/libc+tcc-mes.M1\
+    -f $MES_PREFIX/lib/x86-mes/x86.M1\
+    -f $MES_SEED/x86-mes/crt1.S\
+    -f $MES_SEED/x86-mes/libc+tcc.S\
+    -f $MESCC_TOOLS_SEED/file_print.M1\
+    -f $MESCC_TOOLS_SEED/match.M1\
+    -f $MESCC_TOOLS_SEED/numerate_number.M1\
+    -f $MESCC_TOOLS_SEED/string.M1\
     -f $MESCC_TOOLS_SEED/blood-elf.M1\
     -f blood-elf-blood-elf-footer.M1\
     -o blood-elf.hex2
 # Hex2-linker phase
-./bin/hex2 \
+./bin/hex2-0 \
     --LittleEndian\
     --Architecture 1\
     --BaseAddress 0x1000000\
-    -f $MES_SEED/elf32-header.hex2\
+    -f $MES_PREFIX/lib/x86-mes/elf32-header.hex2\
     -f blood-elf.hex2\
     --exec_enable\
     -o blood-elf
@@ -150,18 +171,22 @@ $MESCC_TOOLS_SEED/hex2 \
 ./bin/M1 \
     --LittleEndian\
     --Architecture 1\
-    -f $MES_SEED/x86.M1\
-    -f $MES_SEED/crt1.M1\
-    -f $MES_SEED/libc+tcc-mes.M1\
+    -f $MES_PREFIX/lib/x86-mes/x86.M1\
+    -f $MES_SEED/x86-mes/crt1.S\
+    -f $MES_SEED/x86-mes/libc+tcc.S\
+    -f $MESCC_TOOLS_SEED/file_print.M1\
+    -f $MESCC_TOOLS_SEED/match.M1\
+    -f $MESCC_TOOLS_SEED/numerate_number.M1\
+    -f $MESCC_TOOLS_SEED/string.M1\
     -f $MESCC_TOOLS_SEED/M1.M1\
     -f M1-footer.M1\
     -o M1.hex2
 # Hex2-linker phase
-./bin/hex2 \
+./bin/hex2-0 \
     --LittleEndian\
     --Architecture 1\
     --BaseAddress 0x1000000\
-    -f $MES_SEED/elf32-header.hex2\
+    -f $MES_PREFIX/lib/x86-mes/elf32-header.hex2\
     -f M1.hex2\
     --exec_enable\
     -o bin/M1
@@ -177,18 +202,27 @@ $MESCC_TOOLS_SEED/hex2 \
 ./bin/M1 \
     --LittleEndian\
     --Architecture 1\
-    -f $MES_SEED/x86.M1\
-    -f $MES_SEED/crt1.M1\
-    -f $MES_SEED/libc+tcc-mes.M1\
+    -f $MES_PREFIX/lib/x86-mes/x86.M1\
+    -f $MES_SEED/x86-mes/crt1.S\
+    -f $MES_SEED/x86-mes/libc+tcc.S\
+    -f $MESCC_TOOLS_SEED/file_print.M1\
+    -f $MESCC_TOOLS_SEED/match.M1\
+    -f $MESCC_TOOLS_SEED/numerate_number.M1\
+    -f $MESCC_TOOLS_SEED/string.M1\
     -f $MESCC_TOOLS_SEED/hex2.M1\
     -f hex2-footer.M1\
     -o hex2.hex2
 # Hex2-linker phase
-./bin/hex2 \
+./bin/hex2-0 \
       --LittleEndian\
       --Architecture 1\
       --BaseAddress 0x1000000\
-      -f $MES_SEED/elf32-header.hex2\
+      -f $MES_PREFIX/lib/x86-mes/elf32-header.hex2\
       -f hex2.hex2\
       --exec_enable\
       -o bin/hex2
+
+# TODO
+touch bin/exec_enable
+touch bin/get_machine
+touch bin/kaem
diff --git a/install.sh b/install.sh
index e4dccff..29e58d6 100644
--- a/install.sh
+++ b/install.sh
@@ -18,6 +18,6 @@
 PREFIX=${PREFIX-usr}

 mkdir -p "$PREFIX/bin"
-cp blood-elf "$PREFIX/bin/blood-elf"
-cp hex2 "$PREFIX/bin/hex2"
-cp M1 "$PREFIX/bin/M1"
+cp bin/blood-elf "$PREFIX/bin/blood-elf"
+cp bin/hex2 "$PREFIX/bin/hex2"
+cp bin/M1 "$PREFIX/bin/M1"
--
2.18.0


code:
This patch changes metabat so that (1) it is not build statically, (2) it uses
shared libraries rather than static libraries where possible.

diff --git a/SConstruct b/SConstruct
index 69cdc0a..ac99bcb 100644
--- a/SConstruct
+++ b/SConstruct
@@ -26,8 +26,6 @@ debug = ARGUMENTS.get('DEBUG', None)
 build_flags = ['-Wall', '-g', '-std=c++11', '-fopenmp']
 link_flags = ['-lstdc++', '-lm', '-fopenmp']

-if platform.platform(True, True).find('Darwin') == -1:
-    link_flags.extend(['-static', '-static-libgcc', '-static-libstdc++'])

 if debug is None:
     build_flags.extend(['-O3', '-DNDEBUG', '-Wno-unknown-pragmas', '-Wno-deprecated-declarations', '-Wno-overflow', '-Wno-unused-variable'])
@@ -110,17 +108,17 @@ def findStaticOrShared( lib, testPaths, static_source_list, link_flag_list, stat
     for path in testPaths:
         if not os.path.isdir(path):
             continue
+        for testfile in ('%s/lib%s.so' % (path, lib), '%s/lib%s.dylib' % (path, lib)):
+            if os.path.isfile(testfile):
+                print "Found shared library %s as %s" % (lib, testfile)
+                link_flag_list.extend( ["-L%s" % (path), "-l%s" % (lib) ] )
+                return
         for suffix in staticSuffixes:
             testfile = '%s/lib%s%s' % (path, lib, suffix)
             if os.path.isfile(testfile):
                 static_source_list.append(testfile)
                 print "Found static library %s as %s" % (lib, testfile)
                 return
-        for testfile in ('%s/lib%s.so' % (path, lib), '%s/lib%s.dylib' % (path, lib)):
-            if os.path.isfile(testfile):
-                print "Found shared library %s as %s" % (lib, testfile)
-                link_flag_list.extend( ["-L%s" % (path), "-l%s" % (lib) ] )
-                return
     print "Could not find library for %s!!! Looked in %s" % (lib, testPaths)
     return


code:
This patch from resolution of https://sourceforge.net/p/mhash/bugs/37/

--- a/src/keygen_test.c
+++ b/src/keygen_test.c
@@ -121,8 +121,6 @@

 	mhash_keygen_ext(KEYGEN_S2K_SALTED, data, key, keysize, password, passlen);

-	mutils_memset(tmp, 0, keysize * 2);
-
 	tmp = mutils_asciify(key, keysize);

 	result = mutils_strcmp((mutils_word8 *) KEY2, tmp);


code:
This patch includes

   * mingw-w64-headers/include/winnt.h: compile fixes for1 gcc-4.9.3
   * mingw-w64-headers/crt/math.h: Likewise
   * mingw-w64-headers/crt/float.h (FLT_EPSILON,DBL_EPSILON,LDBL_EPSILON): Add
   symbols.
   * mingw-w64-headers/crt/stat.h (S_ISLNK,S_ISSOCK,S_ISUID,S_ISGID,S_ISLINK):
   Add symbols.
   (lstat): Add function.
   * mingw-w64-headers/crt/_mingw_stat64.h: Likewise
   * mingw-w64-headers/crt/stdlib.h (realpath): Add function.

Needed for building with gcc-4.9.3 and using with cross-libtool-2.4.6.

Upstream status: not yet presented upstream.

diff --git a/mingw-w64-headers/crt/float.h b/mingw-w64-headers/crt/float.h
index 5874f4e..bdf4ead 100644
--- a/mingw-w64-headers/crt/float.h
+++ b/mingw-w64-headers/crt/float.h
@@ -22,6 +22,15 @@
 #if (__GNUC__ < 4)
 #error Corrupt install of gcc-s internal headers, or search order was changed.
 #else
+
+        /* From gcc-4.9.3 float.h.  */
+        #undef FLT_EPSILON
+        #undef DBL_EPSILON
+        #undef LDBL_EPSILON
+        #define FLT_EPSILON	__FLT_EPSILON__
+        #define DBL_EPSILON	__DBL_EPSILON__
+        #define LDBL_EPSILON	__LDBL_EPSILON__
+
 	/* #include_next <float_ginclude.h> */

    	/* Number of decimal digits, q, such that any floating-point number with q
diff --git a/mingw-w64-headers/crt/math.h b/mingw-w64-headers/crt/math.h
index 1e970f4..99a332f 100644
--- a/mingw-w64-headers/crt/math.h
+++ b/mingw-w64-headers/crt/math.h
@@ -216,6 +216,7 @@ extern "C" {
 #endif
   }

+#if 0
   __CRT_INLINE long double __cdecl fabsl (long double x)
   {
 #ifdef __arm__
@@ -226,6 +227,7 @@ extern "C" {
     return res;
 #endif
   }
+#endif

   __CRT_INLINE double __cdecl fabs (double x)
   {
@@ -905,7 +907,7 @@ __mingw_choose_expr (                                         \
 /* 7.12.7.3  */
   extern double __cdecl hypot (double, double) __MINGW_ATTRIB_DEPRECATED_MSVC2005; /* in libmoldname.a */
   extern float __cdecl hypotf (float x, float y);
-#ifndef __CRT__NO_INLINE
+#if 0 //ndef __CRT__NO_INLINE
   __CRT_INLINE float __cdecl hypotf (float x, float y) { return (float) hypot ((double)x, (double)y);}
 #endif
   extern long double __cdecl hypotl (long double, long double);


code:
This following patch was originally found at the debian mingw-w64 team's
mingw-w64 repo located here:
https://salsa.debian.org/mingw-w64-team/mingw-w64.git

Invoke the following in the aforementioned repo to see the original patch:

  $ git show 4974e2c:debian/patches/dlltool-temp-prefix.patch

Description: Specify dlltool's temp prefix
Author: Stephen Kitt <steve@sk2.org>

By default dlltool uses its pid for the object files it generates.
Enforcing its temp prefix allows the files it generates to be
reproducible.

--- a/mingw-w64-crt/Makefile.am
+++ b/mingw-w64-crt/Makefile.am
@@ -36,7 +36,7 @@
   DTDEF32=$(GENLIB) $(DLLTOOLFLAGS32) $(AM_DLLTOOLFLAGS)
   DTDEF64=$(GENLIB) $(DLLTOOLFLAGS64) $(AM_DLLTOOLFLAGS)
 else
-  AM_DLLTOOLFLAGS=-k --as=$(AS) --output-lib $@
+  AM_DLLTOOLFLAGS=-k --as=$(AS) --output-lib $@ --temp-prefix $$(basename $@ .a)
   DLLTOOLFLAGSARM32=-m arm
   DLLTOOLFLAGSARM64=-m arm64
   DLLTOOLFLAGS32=--as-flags=--32 -m i386


code:
This following patch was originally found at the debian mingw-w64 team's
mingw-w64 repo located here:
https://salsa.debian.org/mingw-w64-team/mingw-w64.git

Invoke the following in the aforementioned repo to see the original patch:

  $ git show 4974e2c:debian/patches/reproducible-gendef.patch

Description: Drop __DATE__ from gendef
Author: Stephen Kitt <skitt@debian.org>

This allows gendef to be built reproducibly.

--- a/mingw-w64-tools/gendef/src/gendef.c
+++ b/mingw-w64-tools/gendef/src/gendef.c
@@ -196,7 +196,6 @@
                    "  By default, the output files are named after their DLL counterparts\n"
                    "  gendef MYDLL.DLL     Produces MYDLL.def\n"
                    "  gendef - MYDLL.DLL   Prints the exports to stdout\n");
-  fprintf (stderr, "\nBuilt on %s\n", __DATE__);
   fprintf (stderr, "\nReport bugs to <mingw-w64-public@lists.sourceforge.net>\n");
   exit (0);
 }


code:
See https://groups.google.com/forum/#!topic/minisat/FCocZsC8oMQ
This seems to only be a problem with newer versions of g++, and
upstream development seems to have stopped in 2013.

diff -rupN minisat-2.2.0/core/SolverTypes.h minisat-2.2.0.patched/core/SolverTypes.h
--- a/minisat/core/SolverTypes.h	2010-07-10 17:07:36.000000000 +0100
+++ b/minisat/core/SolverTypes.h	2014-03-29 11:57:49.000000000 +0000
@@ -47,7 +47,7 @@ struct Lit {
     int     x;

     // Use this as a constructor:
-    friend Lit mkLit(Var var, bool sign = false);
+    //friend Lit mkLit(Var var, bool sign = false);

     bool operator == (Lit p) const { return x == p.x; }
     bool operator != (Lit p) const { return x != p.x; }
@@ -55,7 +55,7 @@ struct Lit {
 };

-inline  Lit  mkLit     (Var var, bool sign) { Lit p; p.x = var + var + (int)sign; return p; }
+inline  Lit  mkLit     (Var var, bool sign = false) { Lit p; p.x = var + var + (int)sign; return p; }
 inline  Lit  operator ~(Lit p)              { Lit q; q.x = p.x ^ 1; return q; }
 inline  Lit  operator ^(Lit p, bool b)      { Lit q; q.x = p.x ^ (unsigned int)b; return q; }
 inline  bool sign      (Lit p)              { return p.x & 1; }


code:
Avoid the default dynamic executable, which depends on minisat.so
Instead install the release version, which is statically linked.

diff --git a/Makefile b/Makefile
index ceb9d77..7b91906 100644
--- a/Makefile
+++ b/Makefile
@@ -191,9 +191,9 @@ install-lib: $(BUILD_DIR)/release/lib/$(MINISAT_SLIB) $(BUILD_DIR)/dynamic/lib/$
 	ln -sf $(MINISAT_DLIB).$(SOMAJOR) $(DESTDIR)$(libdir)/$(MINISAT_DLIB)
 	$(INSTALL) -m 644 $(BUILD_DIR)/release/lib/$(MINISAT_SLIB) $(DESTDIR)$(libdir)

-install-bin: $(BUILD_DIR)/dynamic/bin/$(MINISAT)
+install-bin: $(BUILD_DIR)/release/bin/$(MINISAT)
 	$(INSTALL) -d $(DESTDIR)$(bindir)
-	$(INSTALL) -m 755 $(BUILD_DIR)/dynamic/bin/$(MINISAT) $(DESTDIR)$(bindir)
+	$(INSTALL) -m 755 $(BUILD_DIR)/release/bin/$(MINISAT) $(DESTDIR)$(bindir)

 clean:
 	rm -f $(foreach t, release debug profile dynamic, $(foreach o, $(SRCS:.cc=.o), $(BUILD_DIR)/$t/$o)) \


code:
Avoid using MAXPATHLEN and MAXHOSTLEN on the Hurd.

Taken from https://salsa.debian.org/debian/krb5/-/blob/master/debian/patches/debian-local/0001-Debian-HURD-compatibility.patch

From: Sam Hartman <hartmans@debian.org>
Date: Mon, 26 Dec 2011 18:05:13 -0500
Subject: Debian: HURD compatibility

HURD has no MAXPATHLEN or MAXHOSTLEN.

Patch-Category: debian-local
---
 src/clients/ksu/ksu.h                       | 4 ++++
 src/include/k5-int.h                        | 3 +++
 src/kadmin/ktutil/ktutil_funcs.c            | 4 ++++
 src/kprop/kprop_util.c                      | 4 ++++
 src/lib/gssapi/spnego/spnego_mech.c         | 3 +++
 src/lib/krb5/os/sn2princ.c                  | 4 ++++
 src/plugins/kdb/db2/libdb2/include/db-int.h | 4 ++++
 src/tests/resolve/resolve.c                 | 4 ++++
 8 files changed, 30 insertions(+)

$ diff -u krb5-1.18/src/util/ss/help.c.orig krb5-1.18/src/util/ss/help.c
--- krb5-1.18/src/util/ss/help.c.orig	2020-03-07 23:25:52.712418587 +0100
+++ krb5-1.18/src/util/ss/help.c	2020-03-07 23:26:25.764941122 +0100
@@ -6,6 +6,9 @@
  */

 #include <sys/param.h>
+#ifndef MAXPATHLEN
+# define MAXPATHLEN 4096
+#endif
 #include <sys/types.h>
 #include <errno.h>
 #include <sys/file.h>
$ diff -u krb5-1.18/src/lib/krb5/os/hostrealm.c.orig krb5-1.18/src/lib/krb5/os/hostrealm.c
--- krb5-1.18/src/lib/krb5/os/hostrealm.c.orig	2020-03-07 23:33:19.931420994 +0100
+++ krb5-1.18/src/lib/krb5/os/hostrealm.c	2020-03-07 23:33:58.628026424 +0100
@@ -42,6 +42,10 @@
 #endif
 #endif

+#ifndef MAXHOSTNAMELEN
+#define MAXHOSTNAMELEN 256
+#endif
+
 struct hostrealm_module_handle {
     struct krb5_hostrealm_vtable_st vt;
     krb5_hostrealm_moddata data;
diff --git a/src/clients/ksu/ksu.h b/src/clients/ksu/ksu.h
index 3bf0bd4..f680b33 100644
--- a/src/clients/ksu/ksu.h
+++ b/src/clients/ksu/ksu.h
@@ -56,6 +56,10 @@
 #define MAX_CMD 2048 /* this is temp, should use realloc instead,
                         as done in most of the code */

+#ifndef MAXPATHLEN
+# define MAXPATHLEN 4096
+#endif
+

 extern int optind;
 extern char * optarg;
diff --git a/src/include/k5-int.h b/src/include/k5-int.h
index 6522422..e4f1678 100644
--- a/src/include/k5-int.h
+++ b/src/include/k5-int.h
@@ -589,6 +589,9 @@ extern char *strdup (const char *);
 #ifdef HAVE_SYS_PARAM_H
 #include <sys/param.h>                  /* MAXPATHLEN */
 #endif
+#ifndef MAXPATHLEN
+# define MAXPATHLEN 4096
+#endif

 #ifdef HAVE_SYS_FILE_H
 #include <sys/file.h>                   /* prototypes for file-related
diff --git a/src/kadmin/ktutil/ktutil_funcs.c b/src/kadmin/ktutil/ktutil_funcs.c
index 6d119a2..fb7fa22 100644
--- a/src/kadmin/ktutil/ktutil_funcs.c
+++ b/src/kadmin/ktutil/ktutil_funcs.c
@@ -34,6 +34,10 @@
 #include <string.h>
 #include <ctype.h>

+#ifndef MAXPATHLEN
+# define MAXPATHLEN 4096
+#endif
+
 /*
  * Free a kt_list
  */
diff --git a/src/kprop/kprop_util.c b/src/kprop/kprop_util.c
index c32d174..d72ab18 100644
--- a/src/kprop/kprop_util.c
+++ b/src/kprop/kprop_util.c
@@ -32,6 +32,10 @@
 #include <sys/types.h>
 #include <sys/socket.h>

+#ifndef MAXHOSTNAMELEN
+#define MAXHOSTNAMELEN 256
+#endif
+
 /*
  * Convert an IPv4 or IPv6 socket address to a newly allocated krb5_address.
  * There is similar code elsewhere in the tree, so this should possibly become
diff --git a/src/lib/gssapi/spnego/spnego_mech.c b/src/lib/gssapi/spnego/spnego_mech.c
index 9d6027c..585d8a6 100644
--- a/src/lib/gssapi/spnego/spnego_mech.c
+++ b/src/lib/gssapi/spnego/spnego_mech.c
@@ -65,6 +65,9 @@
 #include	"gssapiP_spnego.h"
 #include	<gssapi_err_generic.h>

+#ifndef MAXHOSTNAMELEN
+#define MAXHOSTNAMELEN 256
+#endif

 #undef g_token_size
 #undef g_verify_token_header
diff --git a/src/lib/krb5/os/sn2princ.c b/src/lib/krb5/os/sn2princ.c
index 5932fd9..187daa8 100644
--- a/src/lib/krb5/os/sn2princ.c
+++ b/src/lib/krb5/os/sn2princ.c
@@ -126,6 +126,10 @@ find_trailer(const char *hostname)
     return p;
 }

+#ifndef MAXHOSTNAMELEN
+# define MAXHOSTNAMELEN 256
+#endif
+
 krb5_error_code KRB5_CALLCONV
 krb5_sname_to_principal(krb5_context context, const char *hostname,
                         const char *sname, krb5_int32 type,
diff --git a/src/plugins/kdb/db2/libdb2/include/db-int.h b/src/plugins/kdb/db2/libdb2/include/db-int.h
index 7e981d4..d83b3b6 100644
--- a/src/plugins/kdb/db2/libdb2/include/db-int.h
+++ b/src/plugins/kdb/db2/libdb2/include/db-int.h
@@ -280,4 +280,8 @@ void	 __dbpanic __P((DB *dbp));
 #ifndef O_BINARY
 #define O_BINARY	0		/* Needed for Win32 compiles */
 #endif
+
+#ifndef MAXPATHLEN
+# define MAXPATHLEN 4096
+#endif
 #endif /* _DB_INT_H_ */
diff --git a/src/tests/resolve/resolve.c b/src/tests/resolve/resolve.c
index 7339d21..38f7253 100644
--- a/src/tests/resolve/resolve.c
+++ b/src/tests/resolve/resolve.c
@@ -73,6 +73,10 @@ char *strchr();
 #include <netinet/in.h>
 #include <netdb.h>

+#ifndef MAXHOSTNAMELEN
+# define MAXHOSTNAMELEN 256
+#endif
+
 int
 main(argc, argv)
     int argc;


code:
Fix a null pointer dereference when no DNS search path is configured.
This showed up as a segfault while running the gsasl test suite.

Taken from upstream:
https://github.com/krb5/krb5/commit/cd82bf377e7fad2409c76bf8b241920692f34fda

diff --git a/src/lib/krb5/os/dnsglue.c b/src/lib/krb5/os/dnsglue.c
index e35ca9d76c..0cd213fdd7 100644
--- a/src/lib/krb5/os/dnsglue.c
+++ b/src/lib/krb5/os/dnsglue.c
@@ -91,7 +91,7 @@ static int initparse(struct krb5int_dns_state *);
 #define DECLARE_HANDLE(h) struct __res_state h
 #define INIT_HANDLE(h) (memset(&h, 0, sizeof(h)), res_ninit(&h) == 0)
 #define SEARCH(h, n, c, t, a, l) res_nsearch(&h, n, c, t, a, l)
-#define PRIMARY_DOMAIN(h) strdup(h.dnsrch[0])
+#define PRIMARY_DOMAIN(h) ((h.dnsrch[0] == NULL) ? NULL : strdup(h.dnsrch[0]))
 #if HAVE_RES_NDESTROY
 #define DESTROY_HANDLE(h) res_ndestroy(&h)
 #else
@@ -104,7 +104,8 @@ static int initparse(struct krb5int_dns_state *);
 #define DECLARE_HANDLE(h)
 #define INIT_HANDLE(h) (res_init() == 0)
 #define SEARCH(h, n, c, t, a, l) res_search(n, c, t, a, l)
-#define PRIMARY_DOMAIN(h) strdup(_res.defdname)
+#define PRIMARY_DOMAIN(h) \
+    ((_res.defdname == NULL) ? NULL : strdup(_res.defdname))
 #define DESTROY_HANDLE(h)

 #endif


code:
This patch changes 'modprobe' & co. so they honor the 'LINUX_MODULE_DIRECTORY'
environment variable, rather than looking for modules exclusively in
/lib/modules.

Original patch by David Guibert, from Nixpkgs; adjusted to use
'LINUX_MODULE_DIRECTORY' rather than 'MODULE_DIR' as the variable name.

diff --git a/depmod.c b/depmod.c
index a1d2f8c..ff579c7 100644
--- a/depmod.c
+++ b/depmod.c
@@ -48,9 +48,6 @@

 #include "testing.h"

-#ifndef MODULE_DIR
-#define MODULE_DIR "/lib/modules/"
-#endif

 #ifndef MODULE_BUILTIN_KEY
 #define MODULE_BUILTIN_KEY "built-in"
@@ -1516,6 +1513,7 @@ static int parse_config_file(const char *filename,
 	char *line;
 	unsigned int linenum = 0;
 	FILE *cfile;
+ 	char *module_dir;

 	cfile = fopen(filename, "r");
 	if (!cfile) {
@@ -1525,6 +1523,10 @@ static int parse_config_file(const char *filename,
 		return 0;
 	}

+        if((module_dir = getenv("LINUX_MODULE_DIRECTORY")) == NULL) {
+                module_dir = "/lib/modules";
+        }
+
 	while ((line = getline_wrapped(cfile, &linenum)) != NULL) {
 		char *ptr = line;
 		char *cmd, *modname;
@@ -1549,8 +1551,8 @@ static int parse_config_file(const char *filename,
 							     0, *search);
 					continue;
 				}
-				nofail_asprintf(&dirname, "%s%s%s/%s", basedir,
-					MODULE_DIR, kernelversion, search_path);
+				nofail_asprintf(&dirname, "%s%s/%s/%s", basedir,
+					module_dir, kernelversion, search_path);
 				len = strlen(dirname);
 				*search = add_search(dirname, len, *search);
 				free(dirname);
@@ -1564,8 +1566,8 @@ static int parse_config_file(const char *filename,
 			if (!regex_match(kernelversion, (const char *)version))
 				continue;

-			nofail_asprintf(&pathname, "%s%s%s/%s/%s.ko", basedir,
-				MODULE_DIR, kernelversion, subdir, modname);
+			nofail_asprintf(&pathname, "%s%s/%s/%s/%s.ko", basedir,
+				module_dir, kernelversion, subdir, modname);

 			*overrides = add_override(pathname, *overrides);
 			free(pathname);
@@ -1737,6 +1739,7 @@ int main(int argc, char *argv[])
 	char *basedir = "", *dirname, *version;
 	char *system_map = NULL, *module_symvers = NULL;
 	int i;
+ 	char *module_dir;
 	const char *config = NULL;

 	if (native_endianness() == 0)
@@ -1832,7 +1835,11 @@ int main(int argc, char *argv[])
 	if (optind == argc)
 		all = 1;

-	nofail_asprintf(&dirname, "%s%s%s", basedir, MODULE_DIR, version);
+        if((module_dir = getenv("LINUX_MODULE_DIRECTORY")) == NULL) {
+                module_dir = "/lib/modules";
+        }
+
+	nofail_asprintf(&dirname, "%s%s/%s", basedir, module_dir, version);

 	if (maybe_all) {
 		if (!doing_stdout && !depfile_out_of_date(dirname))
@@ -1849,8 +1856,8 @@ int main(int argc, char *argv[])
 		char *dirname;
 		size_t len;

-		nofail_asprintf(&dirname, "%s%s%s/updates", basedir,
-				MODULE_DIR, version);
+		nofail_asprintf(&dirname, "%s%s/%s/updates", basedir,
+				module_dir, version);
 		len = strlen(dirname);
 		search = add_search(dirname, len, search);
 	}
diff --git a/modinfo.c b/modinfo.c
index 1dd8469..6a1865b 100644
--- a/modinfo.c
+++ b/modinfo.c
@@ -19,9 +19,6 @@
 #include "zlibsupport.h"
 #include "testing.h"

-#ifndef MODULE_DIR
-#define MODULE_DIR "/lib/modules"
-#endif

 struct param
 {
@@ -193,6 +190,11 @@ static struct elf_file *grab_module(const char *name,
 	struct utsname buf;
 	char *depname, *p, *moddir;
 	struct elf_file *module;
+ 	char *module_dir;
+
+        if((module_dir = getenv("LINUX_MODULE_DIRECTORY")) == NULL) {
+                module_dir = "/lib/modules";
+        }

 	if (strchr(name, '.') || strchr(name, '/')) {
 		module = grab_elf_file(name);
@@ -207,9 +209,9 @@ static struct elf_file *grab_module(const char *name,
 		kernel = buf.release;
 	}
 	if (strlen(basedir))
-		nofail_asprintf(&moddir, "%s/%s/%s", basedir, MODULE_DIR, kernel);
+		nofail_asprintf(&moddir, "%s/%s/%s", basedir, module_dir, kernel);
 	else
-		nofail_asprintf(&moddir, "%s/%s", MODULE_DIR, kernel);
+		nofail_asprintf(&moddir, "%s/%s", module_dir, kernel);

 	/* Search for it in modules.dep. */
 	nofail_asprintf(&depname, "%s/%s", moddir, "modules.dep");
diff --git a/modprobe.c b/modprobe.c
index 5464f45..cb57917 100644
--- a/modprobe.c
+++ b/modprobe.c
@@ -86,10 +86,6 @@ typedef enum

 } modprobe_flags_t;

-#ifndef MODULE_DIR
-#define MODULE_DIR "/lib/modules"
-#endif
-
 /**
  * print_usage - output the prefered program usage
  *
@@ -2136,6 +2132,7 @@ int main(int argc, char *argv[])
 	struct modprobe_conf conf = {};

 	recursion_depth = 0;
+ 	char *module_dir = NULL;

 	/* Prepend options from environment. */
 	argv = merge_args(getenv("MODPROBE_OPTIONS"), argv, &argc);
@@ -2233,7 +2230,11 @@ int main(int argc, char *argv[])
 	if (argc < optind + 1 && !dump_config && !list_only)
 		print_usage(argv[0]);

-	nofail_asprintf(&dirname, "%s%s/%s", basedir, MODULE_DIR, buf.release);
+	if((module_dir = getenv("LINUX_MODULE_DIRECTORY")) == NULL) {
+		module_dir = "/lib/modules";
+	}
+
+	nofail_asprintf(&dirname, "%s%s/%s", basedir, module_dir, buf.release);

 	/* Old-style -t xxx wildcard?  Only with -l. */
 	if (list_only) {


code:
diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt
index 7553f87e..8e865c6c 100644
--- a/external/CMakeLists.txt
+++ b/external/CMakeLists.txt
@@ -37,19 +37,7 @@

 find_package(Miniupnpc REQUIRED)

-message(STATUS "Using in-tree miniupnpc")
-add_subdirectory(miniupnp/miniupnpc)
-set_property(TARGET libminiupnpc-static PROPERTY FOLDER "external")
-if(MSVC)
-  set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -wd4244 -wd4267")
-elseif(NOT MSVC)
-  set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-undef -Wno-unused-result -Wno-unused-value")
-endif()
-if(CMAKE_SYSTEM_NAME MATCHES "NetBSD")
-	set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -D_NETBSD_SOURCE")
-endif()
-
-set(UPNP_LIBRARIES "libminiupnpc-static" PARENT_SCOPE)
+set(UPNP_LIBRARIES "miniupnpc" PARENT_SCOPE)

 find_package(Unbound)

diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl
index 74924e4f..3554dd0d 100644
--- a/src/p2p/net_node.inl
+++ b/src/p2p/net_node.inl
@@ -49,9 +49,9 @@
 #include "storages/levin_abstract_invoke2.h"
 #include "cryptonote_core/cryptonote_core.h"

-#include <miniupnp/miniupnpc/miniupnpc.h>
-#include <miniupnp/miniupnpc/upnpcommands.h>
-#include <miniupnp/miniupnpc/upnperrors.h>
+#include <miniupnpc/miniupnpc.h>
+#include <miniupnpc/upnpcommands.h>
+#include <miniupnpc/upnperrors.h>

 #undef MONERO_DEFAULT_LOG_CATEGORY
 #define MONERO_DEFAULT_LOG_CATEGORY "net.p2p"


code:
From e724bb7018a482640c4f194f88b554af2c59d76e Mon Sep 17 00:00:00 2001
From: Mark Benvenuto <mark.benvenuto@mongodb.com>
Date: Wed, 20 Sep 2017 11:50:02 -0400
Subject: [PATCH] SERVER-30857 Support unknown Linux distributions

---
 src/mongo/rpc/metadata/client_metadata.cpp | 6 ------
 src/mongo/util/processinfo_linux.cpp       | 9 ++++++---
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/src/mongo/rpc/metadata/client_metadata.cpp b/src/mongo/rpc/metadata/client_metadata.cpp
index 845a315dd74..a959a4e31e9 100644
--- a/src/mongo/rpc/metadata/client_metadata.cpp
+++ b/src/mongo/rpc/metadata/client_metadata.cpp
@@ -302,9 +302,6 @@ void ClientMetadata::serializePrivate(StringData driverName,
                                       StringData osArchitecture,
                                       StringData osVersion,
                                       BSONObjBuilder* builder) {
-    invariant(!driverName.empty() && !driverVersion.empty() && !osType.empty() && !osName.empty() &&
-              !osArchitecture.empty() && !osVersion.empty());
-
     BSONObjBuilder metaObjBuilder(builder->subobjStart(kMetadataDocumentName));

     {
@@ -347,9 +344,6 @@ Status ClientMetadata::serializePrivate(StringData driverName,
                                         StringData osVersion,
                                         StringData appName,
                                         BSONObjBuilder* builder) {
-    invariant(!driverName.empty() && !driverVersion.empty() && !osType.empty() && !osName.empty() &&
-              !osArchitecture.empty() && !osVersion.empty());
-
     if (appName.size() > kMaxApplicationNameByteLength) {
         return Status(ErrorCodes::ClientMetadataAppNameTooLarge,
                       str::stream() << "The '" << kApplication << "." << kName
diff --git a/src/mongo/util/processinfo_linux.cpp b/src/mongo/util/processinfo_linux.cpp
index c3debf377bd..c2813b026b0 100644
--- a/src/mongo/util/processinfo_linux.cpp
+++ b/src/mongo/util/processinfo_linux.cpp
@@ -376,10 +376,13 @@ class LinuxSysHelper {
             if ((nl = name.find('\n', nl)) != string::npos)
                 // stop at first newline
                 name.erase(nl);
-            // no standard format for name and version.  use kernel version
-            version = "Kernel ";
-            version += LinuxSysHelper::readLineFromFile("/proc/sys/kernel/osrelease");
+        } else {
+            name = "unknown";
         }
+
+        // There is no standard format for name and version so use the kernel version.
+        version = "Kernel ";
+        version += LinuxSysHelper::readLineFromFile("/proc/sys/kernel/osrelease");
     }

     /**


code:
--- mono-4.4.1/mcs/class/monodoc/Monodoc/storage/ZipStorage.cs.orig	2018-11-26 22:16:25.008879747 +0100
+++ mono-4.4.1/mcs/class/monodoc/Monodoc/storage/ZipStorage.cs	2018-11-26 22:21:53.969770985 +0100
@@ -74,6 +74,12 @@
 				id = GetNewCode ();

 			ZipEntry entry = new ZipEntry (id);
+			var SOURCE_DATE_EPOCH_string = Environment.GetEnvironmentVariable("SOURCE_DATE_EPOCH");
+			if (SOURCE_DATE_EPOCH_string != null)
+			{
+				var SOURCE_DATE_EPOCH = Convert.ToInt64(SOURCE_DATE_EPOCH_string);
+				entry.DateTime = new DateTime(SOURCE_DATE_EPOCH, DateTimeKind.Utc);
+			}
 			zipOutput.PutNextEntry (entry);
 		}


code:
https://build.opensuse.org/package/view_file/openSUSE:Factory/mozjs17/mozjs-aarch64-support.patch

index c071c33..90764c3 100644
--- a/js/src/assembler/jit/ExecutableAllocator.h
+++ b/js/src/assembler/jit/ExecutableAllocator.h
@@ -382,6 +382,12 @@ public:
     {
         reprotectRegion(start, size, Executable);
     }
+#elif WTF_CPU_AARCH64 && WTF_PLATFORM_LINUX
+    static void cacheFlush(void* code, size_t size)
+    {
+        intptr_t end = reinterpret_cast<intptr_t>(code) + size;
+        __builtin___clear_cache(reinterpret_cast<char*>(code), reinterpret_cast<char*>(end));
+    }
 #else
     static void makeWritable(void*, size_t) {}
     static void makeExecutable(void*, size_t) {}
diff --git a/js/src/assembler/wtf/Platform.h b/js/src/assembler/wtf/Platform.h
index 0c84896..e8763a7 100644
--- a/js/src/assembler/wtf/Platform.h
+++ b/js/src/assembler/wtf/Platform.h
@@ -325,6 +325,10 @@
 #define WTF_THUMB_ARCH_VERSION 0
 #endif

+/* CPU(AArch64) - 64-bit ARM */
+#if defined(__aarch64__)
+#define WTF_CPU_AARCH64 1
+#endif

 /* WTF_CPU_ARMV5_OR_LOWER - ARM instruction set v5 or earlier */
 /* On ARMv5 and below the natural alignment is required.
diff --git a/js/src/configure.in b/js/src/configure.in
index 15605b2..19fd704 100644
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -1121,6 +1121,10 @@ arm*)
     CPU_ARCH=arm
     ;;

+aarch64)
+    CPU_ARCH=aarch64
+    ;;
+
 mips|mipsel)
     CPU_ARCH="mips"
     ;;
diff --git a/mfbt/double-conversion/utils.h b/mfbt/double-conversion/utils.h
index 0eec2d9..fe26dab 100644
--- a/mfbt/double-conversion/utils.h
+++ b/mfbt/double-conversion/utils.h
@@ -58,6 +58,7 @@
     defined(__mips__) || defined(__powerpc__) || \
     defined(__sparc__) || defined(__sparc) || defined(__s390__) || \
     defined(__SH4__) || defined(__alpha__) || \
+    defined(__aarch64__) || \
     defined(_MIPS_ARCH_MIPS32R2)
 #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1
 #elif defined(_M_IX86) || defined(__i386__) || defined(__i386)


code:
This patch is sourced from Debian's mozjs24 patch set.

Description: Add arm64 support
Author: Andreas Schwab <schwab@suse.de>
Origin: vendor, https://build.opensuse.org/package/view_file/openSUSE:Factory/mozjs17/mozjs-aarch64-support.patch
Forwarded: no
Last-Update: 2014-01-03

Index: b/mfbt/double-conversion/utils.h
===================================================================
--- a/mfbt/double-conversion/utils.h
+++ b/mfbt/double-conversion/utils.h
@@ -58,7 +58,7 @@
     defined(__mips__) || defined(__powerpc__) || \
     defined(__sparc__) || defined(__sparc) || defined(__s390__) || \
     defined(__SH4__) || defined(__alpha__) || \
-    defined(_MIPS_ARCH_MIPS32R2)
+    defined(_MIPS_ARCH_MIPS32R2) || defined(__aarch64__)
 #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1
 #elif defined(_M_IX86) || defined(__i386__) || defined(__i386)
 #if defined(_WIN32)


code:
Taken from https://bug1339931.bmoattachments.org/attachment.cgi?id=8837770.

Add major version to pkg-config filename.
Author: Rico Tzschichholz <ricotz@ubuntu.com>
Forwarded: no
Last-Update: 2015-05-04

Index: b/js/src/Makefile.in
===================================================================
--- a/js/src/Makefile.in
+++ b/js/src/Makefile.in
@@ -214,10 +214,10 @@
 $(JS_CONFIG_NAME): js-config
    cp $^ $@

-$(LIBRARY_NAME).pc: js.pc
+$(JS_LIBRARY_NAME).pc: js.pc
 	cp $^ $@

-install:: $(LIBRARY_NAME).pc
+install:: $(JS_LIBRARY_NAME).pc
 	$(SYSINSTALL) $^ $(DESTDIR)$(libdir)/pkgconfig

 install:: js-config.h


code:
Taken from https://bug1339931.bmoattachments.org/attachment.cgi?id=8837771.

# HG changeset patch
# Parent 4732a0e5d22bc7e5c1f1ace7a182d537d9cc2c6a
Add major version to shell and js-config filenames.
Author: Rico Tzschichholz <ricotz@ubuntu.com>
Forwarded: no
Last-Update: 2014-10-29

---
diff --git a/js/src/configure b/js/src/configure
--- a/js/src/configure
+++ b/js/src/configure
@@ -1696,8 +1696,13 @@
 MOZJS_PATCH_VERSION=`echo $MOZILLA_VERSION | sed "s|^[0-9]*\.[0-9]*[^0-9]*||"`
 IS_ALPHA=`echo $MOZILLA_VERSION | grep '[ab]'`

+if test -n "$JS_STANDALONE"; then
+JS_SHELL_NAME=js$MOZJS_MAJOR_VERSION
+JS_CONFIG_NAME=js$MOZJS_MAJOR_VERSION-config
+else
 JS_SHELL_NAME=js
 JS_CONFIG_NAME=js-config
+fi

 if test -n "$IS_ALPHA"; then

diff --git a/js/src/configure.in b/js/src/configure.in
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -234,16 +234,13 @@ MOZJS_MINOR_VERSION=`echo $MOZILLA_VERSI
 MOZJS_PATCH_VERSION=`echo $MOZILLA_VERSION | sed "s|^[0-9]*\.[0-9]*[^0-9]*||"`
 IS_ALPHA=`echo $MOZILLA_VERSION | grep '[ab]'`

-dnl XXX in a temporary bid to avoid developer anger at renaming files
-dnl XXX before "js" symlinks exist, don't change names.
-dnl
-dnl if test -n "$JS_STANDALONE"; then
-dnl JS_SHELL_NAME=js$MOZJS_MAJOR_VERSION
-dnl JS_CONFIG_NAME=js$MOZJS_MAJOR_VERSION-config
-dnl else
+if test -n "$JS_STANDALONE"; then
+JS_SHELL_NAME=js$MOZJS_MAJOR_VERSION
+JS_CONFIG_NAME=js$MOZJS_MAJOR_VERSION-config
+else
 JS_SHELL_NAME=js
 JS_CONFIG_NAME=js-config
-dnl fi
+fi

 changequote([,])
 if test -n "$IS_ALPHA"; then

diff -r 80a9e64d75f5 js/src/Makefile.in
--- a/js/src/Makefile.in        Wed Jun 25 15:11:42 2014 +0200
+++ b/js/src/Makefile.in        Sat Jul 05 14:08:38 2014 +0200
@@ -273,6 +273,9 @@
 SCRIPTS = $(JS_CONFIG_NAME)
 SDK_BINARY = $(JS_CONFIG_NAME)

+$(JS_CONFIG_NAME): js-config
+	cp $^ $@
+
 $(JS_LIBRARY_NAME).pc: js.pc
 	cp $^ $@