code:
https://github.com/Pingus/pingus/commit/fef8cf6512fa4aa09e87643c22ef66de9ec7bb41.patch

From fef8cf6512fa4aa09e87643c22ef66de9ec7bb41 Mon Sep 17 00:00:00 2001
From: Ingo Ruhnke <grumbel@gmail.com>
Date: Sat, 26 Jul 2014 20:49:11 +0200
Subject: [PATCH] Switched to boost::signals2

---
 SConscript                           |  5 ++---
 src/editor/button.hpp                |  4 ++--
 src/editor/checkbox.hpp              |  4 ++--
 src/editor/combobox.hpp              |  4 ++--
 src/editor/file_list.hpp             |  4 ++--
 src/editor/inputbox.hpp              |  6 +++---
 src/editor/message_box.hpp           |  2 +-
 src/editor/object_selector.cpp       |  4 ++--
 src/editor/viewport.hpp              |  4 ++--
 src/pingus/components/check_box.hpp  |  4 ++--
 src/pingus/components/choice_box.hpp |  4 ++--
 src/pingus/components/slider_box.hpp |  4 ++--
 src/pingus/config_manager.hpp        | 28 ++++++++++++++--------------
 src/pingus/screens/option_menu.hpp   |  4 ++--
 14 files changed, 40 insertions(+), 41 deletions(-)

diff --git a/SConscript b/SConscript
index 758567f51..c4d25a8a9 100644
--- a/SConscript
+++ b/SConscript
@@ -187,9 +187,8 @@ class Project:
                                                      'src/engine/input/xinput/xinput_device.cpp'])

     def configure_boost(self):
-        if not self.conf.CheckLibWithHeader('boost_signals', 'boost/signals.hpp', 'c++'):
-            if not self.conf.CheckLibWithHeader('boost_signals-mt', 'boost/signals.hpp', 'c++'):
-                self.fatal_error += "  * library 'boost_signals' not found\n"
+        if not self.conf.CheckHeader('boost/signals2.hpp', '<>', 'c++'):
+            self.fatal_error += "  * library 'boost_signals2' not found\n"

     def configure_png(self):
         if self.conf.CheckMyProgram('pkg-config'):
diff --git a/src/editor/button.hpp b/src/editor/button.hpp
index c85d7da9e..d89dfe669 100644
--- a/src/editor/button.hpp
+++ b/src/editor/button.hpp
@@ -17,7 +17,7 @@
 #ifndef HEADER_PINGUS_EDITOR_BUTTON_HPP
 #define HEADER_PINGUS_EDITOR_BUTTON_HPP

-#include <boost/signal.hpp>
+#include <boost/signals2.hpp>

 #include "engine/gui/rect_component.hpp"

@@ -48,7 +48,7 @@ class Button : public GUI::RectComponent
   void enable()  { enabled = true; }
   void disable() { enabled = false; }

-  boost::signal<void()> on_click;
+  boost::signals2::signal<void()> on_click;

 private:
   Button (const Button&);
diff --git a/src/editor/checkbox.hpp b/src/editor/checkbox.hpp
index 7c3bc835f..66382d79b 100644
--- a/src/editor/checkbox.hpp
+++ b/src/editor/checkbox.hpp
@@ -17,7 +17,7 @@
 #ifndef HEADER_PINGUS_EDITOR_CHECKBOX_HPP
 #define HEADER_PINGUS_EDITOR_CHECKBOX_HPP

-#include <boost/signal.hpp>
+#include <boost/signals2.hpp>

 #include "engine/gui/rect_component.hpp"

@@ -40,7 +40,7 @@ class Checkbox : public GUI::RectComponent
   bool is_checked() const { return checked; }
   void on_primary_button_press(int x, int y);

-  boost::signal<void (bool)> on_change;
+  boost::signals2::signal<void (bool)> on_change;

 private:
   Checkbox (const Checkbox&);
diff --git a/src/editor/combobox.hpp b/src/editor/combobox.hpp
index 0ca742593..603556bd9 100644
--- a/src/editor/combobox.hpp
+++ b/src/editor/combobox.hpp
@@ -18,7 +18,7 @@
 #ifndef HEADER_PINGUS_EDITOR_COMBOBOX_HPP
 #define HEADER_PINGUS_EDITOR_COMBOBOX_HPP

-#include <boost/signal.hpp>
+#include <boost/signals2.hpp>

 #include "engine/display/sprite.hpp"
 #include "engine/gui/rect_component.hpp"
@@ -88,7 +88,7 @@ class Combobox : public GUI::RectComponent

   void update_layout() {}

-  boost::signal<void (const ComboItem&)> on_select;
+  boost::signals2::signal<void (const ComboItem&)> on_select;

 private:
   Combobox();
diff --git a/src/editor/file_list.hpp b/src/editor/file_list.hpp
index cc4bba2de..85efe6aa0 100644
--- a/src/editor/file_list.hpp
+++ b/src/editor/file_list.hpp
@@ -17,7 +17,7 @@
 #ifndef HEADER_PINGUS_EDITOR_FILE_LIST_HPP
 #define HEADER_PINGUS_EDITOR_FILE_LIST_HPP

-#include <boost/signal.hpp>
+#include <boost/signals2.hpp>

 #include "engine/display/sprite.hpp"
 #include "engine/gui/rect_component.hpp"
@@ -61,7 +61,7 @@ class FileList : public GUI::RectComponent
   bool has_more_next_pages();
   bool has_more_prev_pages();

-  boost::signal<void (const System::DirectoryEntry&)> on_click;
+  boost::signals2::signal<void (const System::DirectoryEntry&)> on_click;

 private:
   int items_per_page();
diff --git a/src/editor/inputbox.hpp b/src/editor/inputbox.hpp
index cad9663ec..87321dbba 100644
--- a/src/editor/inputbox.hpp
+++ b/src/editor/inputbox.hpp
@@ -17,7 +17,7 @@
 #ifndef HEADER_PINGUS_EDITOR_INPUTBOX_HPP
 #define HEADER_PINGUS_EDITOR_INPUTBOX_HPP

-#include <boost/signal.hpp>
+#include <boost/signals2.hpp>

 #include "engine/gui/rect_component.hpp"

@@ -40,8 +40,8 @@ class Inputbox : public GUI::RectComponent

   void update_layout() {}

-  boost::signal<void (const std::string&)> on_change;
-  boost::signal<void (const std::string&)> on_enter;
+  boost::signals2::signal<void (const std::string&)> on_change;
+  boost::signals2::signal<void (const std::string&)> on_enter;

 private:
   Inputbox (const Inputbox&);
diff --git a/src/editor/message_box.hpp b/src/editor/message_box.hpp
index 385387a61..d885767cf 100644
--- a/src/editor/message_box.hpp
+++ b/src/editor/message_box.hpp
@@ -45,7 +45,7 @@ class MessageBox : public GUI::GroupComponent
   void on_cancel_button();

 public:
-  boost::signal<void()> on_ok;
+  boost::signals2::signal<void()> on_ok;

 private:
   MessageBox(const MessageBox&);
diff --git a/src/editor/object_selector.cpp b/src/editor/object_selector.cpp
index 28e306826..f3a36b5e8 100644
--- a/src/editor/object_selector.cpp
+++ b/src/editor/object_selector.cpp
@@ -16,7 +16,7 @@

 #include "editor/object_selector.hpp"

-#include <boost/signal.hpp>
+#include <boost/signals2.hpp>

 #include "editor/generic_level_obj.hpp"
 #include "editor/gui_style.hpp"
@@ -47,7 +47,7 @@ class ObjectSelectorButton : public GUI::RectComponent
   std::string tooltip;

 public:
-  boost::signal<void()> on_click;
+  boost::signals2::signal<void()> on_click;

 public:
   ObjectSelectorButton(ObjectSelectorList* object_list_,
diff --git a/src/editor/viewport.hpp b/src/editor/viewport.hpp
index 1ae9eff7c..18868254d 100644
--- a/src/editor/viewport.hpp
+++ b/src/editor/viewport.hpp
@@ -18,7 +18,7 @@
 #ifndef HEADER_PINGUS_EDITOR_VIEWPORT_HPP
 #define HEADER_PINGUS_EDITOR_VIEWPORT_HPP

-#include <boost/signal.hpp>
+#include <boost/signals2.hpp>
 #include <set>

 #include "editor/selection.hpp"
@@ -148,7 +148,7 @@ class Viewport : public GUI::RectComponent

   void clear_selection();

-  boost::signal<void (const Selection&)> selection_changed;
+  boost::signals2::signal<void (const Selection&)> selection_changed;
 private:
   Viewport();
   Viewport (const Viewport&);
diff --git a/src/pingus/components/check_box.hpp b/src/pingus/components/check_box.hpp
index 00e23b764..5bef50f6b 100644
--- a/src/pingus/components/check_box.hpp
+++ b/src/pingus/components/check_box.hpp
@@ -17,7 +17,7 @@
 #ifndef HEADER_PINGUS_PINGUS_COMPONENTS_CHECK_BOX_HPP
 #define HEADER_PINGUS_PINGUS_COMPONENTS_CHECK_BOX_HPP

-#include <boost/signal.hpp>
+#include <boost/signals2.hpp>

 #include "engine/display/sprite.hpp"
 #include "engine/gui/rect_component.hpp"
@@ -39,7 +39,7 @@ class CheckBox : public GUI::RectComponent

   void set_state(bool v, bool send_signal);

-  boost::signal<void (bool)> on_change;
+  boost::signals2::signal<void (bool)> on_change;

 private:
   CheckBox (const CheckBox&);
diff --git a/src/pingus/components/choice_box.hpp b/src/pingus/components/choice_box.hpp
index 49d6e1948..ef51b6dd2 100644
--- a/src/pingus/components/choice_box.hpp
+++ b/src/pingus/components/choice_box.hpp
@@ -17,7 +17,7 @@
 #ifndef HEADER_PINGUS_PINGUS_COMPONENTS_CHOICE_BOX_HPP
 #define HEADER_PINGUS_PINGUS_COMPONENTS_CHOICE_BOX_HPP

-#include <boost/signal.hpp>
+#include <boost/signals2.hpp>

 #include "engine/gui/rect_component.hpp"

@@ -36,7 +36,7 @@ class ChoiceBox : public GUI::RectComponent
   void add_choice(const std::string& str);
   void set_current_choice(int choice);

-  boost::signal<void (std::string)> on_change;
+  boost::signals2::signal<void (std::string)> on_change;

 private:
   ChoiceBox (const ChoiceBox&);
diff --git a/src/pingus/components/slider_box.hpp b/src/pingus/components/slider_box.hpp
index ae4d92406..75118eac2 100644
--- a/src/pingus/components/slider_box.hpp
+++ b/src/pingus/components/slider_box.hpp
@@ -17,7 +17,7 @@
 #ifndef HEADER_PINGUS_PINGUS_COMPONENTS_SLIDER_BOX_HPP
 #define HEADER_PINGUS_PINGUS_COMPONENTS_SLIDER_BOX_HPP

-#include <boost/signal.hpp>
+#include <boost/signals2.hpp>

 #include "engine/gui/rect_component.hpp"

@@ -39,7 +39,7 @@ class SliderBox : public GUI::RectComponent

   void set_value(int v);

-  boost::signal<void (int)> on_change;
+  boost::signals2::signal<void (int)> on_change;

 private:
   SliderBox (const SliderBox&);
diff --git a/src/pingus/config_manager.hpp b/src/pingus/config_manager.hpp
index b07b83e65..4cf08e046 100644
--- a/src/pingus/config_manager.hpp
+++ b/src/pingus/config_manager.hpp
@@ -17,7 +17,7 @@
 #ifndef HEADER_PINGUS_PINGUS_CONFIG_MANAGER_HPP
 #define HEADER_PINGUS_PINGUS_CONFIG_MANAGER_HPP

-#include <boost/signal.hpp>
+#include <boost/signals2.hpp>

 #include "math/size.hpp"
 #include "pingus/options.hpp"
@@ -39,55 +39,55 @@ class ConfigManager

   void set_master_volume(int);
   int  get_master_volume() const;
-  boost::signal<void(int)> on_master_volume_change;
+  boost::signals2::signal<void(int)> on_master_volume_change;

   void set_sound_volume(int);
   int  get_sound_volume() const;
-  boost::signal<void(int)> on_sound_volume_change;
+  boost::signals2::signal<void(int)> on_sound_volume_change;

   void set_music_volume(int);
   int  get_music_volume() const;
-  boost::signal<void(int)> on_music_volume_change;
+  boost::signals2::signal<void(int)> on_music_volume_change;

   void set_fullscreen_resolution(const Size& size);
   Size get_fullscreen_resolution() const;
-  boost::signal<void(Size)> on_fullscreen_resolution_change;
+  boost::signals2::signal<void(Size)> on_fullscreen_resolution_change;

   void set_fullscreen(bool);
   bool get_fullscreen() const;
-  boost::signal<void(bool)> on_fullscreen_change;
+  boost::signals2::signal<void(bool)> on_fullscreen_change;

   void set_renderer(FramebufferType type);
   FramebufferType get_renderer() const;
-  boost::signal<void(FramebufferType)> on_renderer_change;
+  boost::signals2::signal<void(FramebufferType)> on_renderer_change;

   void set_resizable(bool);
   bool get_resizable() const;
-  boost::signal<void(bool)> on_resizable_change;
+  boost::signals2::signal<void(bool)> on_resizable_change;

   void set_mouse_grab(bool);
   bool get_mouse_grab() const;
-  boost::signal<void(bool)> on_mouse_grab_change;
+  boost::signals2::signal<void(bool)> on_mouse_grab_change;

   void set_print_fps(bool);
   bool get_print_fps() const;
-  boost::signal<void(bool)> on_print_fps_change;
+  boost::signals2::signal<void(bool)> on_print_fps_change;

   void set_language(const tinygettext::Language&);
   tinygettext::Language get_language() const;
-  boost::signal<void(const tinygettext::Language&)> on_language_change;
+  boost::signals2::signal<void(const tinygettext::Language&)> on_language_change;

   void set_software_cursor(bool);
   bool get_software_cursor() const;
-  boost::signal<void(bool)> on_software_cursor_change;
+  boost::signals2::signal<void(bool)> on_software_cursor_change;

   void set_auto_scrolling(bool);
   bool get_auto_scrolling() const;
-  boost::signal<void(bool)> on_auto_scrolling_change;
+  boost::signals2::signal<void(bool)> on_auto_scrolling_change;

   void set_drag_drop_scrolling(bool);
   bool get_drag_drop_scrolling() const;
-  boost::signal<void(bool)> on_drag_drop_scrolling_change;
+  boost::signals2::signal<void(bool)> on_drag_drop_scrolling_change;

 private:
   ConfigManager (const ConfigManager&);
diff --git a/src/pingus/screens/option_menu.hpp b/src/pingus/screens/option_menu.hpp
index 60b1578d2..154ef0f69 100644
--- a/src/pingus/screens/option_menu.hpp
+++ b/src/pingus/screens/option_menu.hpp
@@ -17,7 +17,7 @@
 #ifndef HEADER_PINGUS_PINGUS_SCREENS_OPTION_MENU_HPP
 #define HEADER_PINGUS_PINGUS_SCREENS_OPTION_MENU_HPP

-#include <boost/signals.hpp>
+#include <boost/signals2.hpp>
 #include <map>
 #include <vector>

@@ -66,7 +66,7 @@ class OptionMenu : public GUIScreen
   //Label* defaults_label;
   //CheckBox* defaults_box;

-  typedef std::vector<boost::signals::connection> Connections;
+  typedef std::vector<boost::signals2::connection> Connections;
   Connections connections;

   tinygettext::Language m_language;


code:
Do not assume the SDL_image and SLD_mixer libraries are installed at the same
prefix reported by sdl-config, but instead get flags from the pkg-config files
installed with these libraries.

--- a/SConscript	2011-12-24 15:46:47.000000000 -0600
+++ b/SConscript	2014-06-12 21:20:45.702668330 -0500
@@ -199,7 +199,13 @@
                 self.fatal_error += "  * library 'png' not found\n"

     def configure_sdl(self):
-        if self.conf.CheckMyProgram('sdl-config'):
+        if self.conf.CheckMyProgram('pkg-config'):
+            self.conf.env.ParseConfig("pkg-config --cflags --libs sdl")
+            for sdllib in ['image', 'mixer']:
+                self.conf.env.ParseConfig("pkg-config --cflags --libs SDL_%s" % sdllib)
+                if not self.conf.CheckSDLLib(sdllib):
+                    self.fatal_error += "  * SDL library '%s' not found\n" % sdllib
+        elif self.conf.CheckMyProgram('sdl-config'):
             self.conf.env.ParseConfig("sdl-config  --cflags --libs | sed 's/-I/-isystem/g'")
             for sdllib in ['image', 'mixer']:
                 if not self.conf.CheckSDLLib(sdllib):

license: mit


code:
Fix CVE-2016-5296: Heap-buffer-overflow WRITE in rasterize_edges_1
Adapted for upstream pixman based on:

  https://hg.mozilla.org/releases/mozilla-esr45/rev/5e39c1c2fded

--- pixman-0.34.0/pixman/pixman-edge-imp.h.orig	2015-06-30 05:48:31.000000000 -0400
+++ pixman-0.34.0/pixman/pixman-edge-imp.h	2016-11-16 01:09:34.046335106 -0500
@@ -55,8 +55,9 @@
 	 *
 	 * (The AA case does a similar  adjustment in RENDER_SAMPLES_X)
 	 */
-	lx += X_FRAC_FIRST(1) - pixman_fixed_e;
-	rx += X_FRAC_FIRST(1) - pixman_fixed_e;
+	/* we cast to unsigned to get defined behaviour for overflow */
+	lx = (unsigned)lx + X_FRAC_FIRST(1) - pixman_fixed_e;
+	rx = (unsigned)rx + X_FRAC_FIRST(1) - pixman_fixed_e;
 #endif
 	/* clip X */
 	if (lx < 0)


code:
From 44f8f6c1c71bec6bf00269b075a2dc801ae6fd45 Mon Sep 17 00:00:00 2001
From: Vladimir Stoiakin <VStoiakin@lavabit.com>
Date: Thu, 23 Apr 2020 14:06:40 +0300
Subject: [PATCH 1/2] libpjproject.pc: correct the field 'cflags'

---
 Makefile           | 6 ++----
 aconfigure         | 4 ++++
 aconfigure.ac      | 3 +++
 build.mak.in       | 7 +++----
 libpjproject.pc.in | 4 ++--
 5 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/Makefile b/Makefile
index ffaf638dd..3fd5cab40 100644
--- a/Makefile
+++ b/Makefile
@@ -132,10 +132,8 @@ install:
 		sed -e "s!@INCLUDEDIR@!$(includedir)!" | \
 		sed -e "s!@LIBDIR@!$(libdir)!" | \
 		sed -e "s/@PJ_VERSION@/$(PJ_VERSION)/" | \
-		sed -e "s!@PJ_LDLIBS@!!" | \
-		sed -e "s!@PJ_LDXXLIBS@!$(PJ_LDXXLIBS)!" | \
-		sed -e "s!@PJ_INSTALL_CFLAGS@!!" | \
-		sed -e "s!@PJ_INSTALL_CXXFLAGS@!$(PJ_INSTALL_CXXFLAGS)!" > $(DESTDIR)/$(libdir)/pkgconfig/libpjproject.pc
+		sed -e "s!@PJ_INSTALL_LDFLAGS@!$(PJ_INSTALL_LDFLAGS)!" | \
+		sed -e "s!@PJ_INSTALL_CFLAGS@!$(PJ_INSTALL_CFLAGS)!" > $(DESTDIR)/$(libdir)/pkgconfig/libpjproject.pc

 uninstall:
 	$(RM) $(DESTDIR)$(libdir)/pkgconfig/libpjproject.pc
diff --git a/aconfigure b/aconfigure
index 2abbcf533..1ab932bda 100755
--- a/aconfigure
+++ b/aconfigure
@@ -706,6 +706,7 @@ GREP
 CPP
 ac_cross_compile
 ac_shlib_suffix
+ac_cflags
 ac_build_mak_vars
 ac_pjdir
 CC_CFLAGS
@@ -3952,6 +3953,7 @@ if test "$CC_CFLAGS" = ""; then CC_CFLAGS="-Wall"; fi

+
 case $host in
     *mingw* | *cygw* | *win32* | *w32* )
 	if pwd -W 2&> /dev/null; then
@@ -5138,8 +5140,10 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h

 if test "x$ac_cv_c_bigendian" = "xyes"; then
   CFLAGS="$CFLAGS -DPJ_IS_BIG_ENDIAN=1 -DPJ_IS_LITTLE_ENDIAN=0"
+  ac_cflags="$ac_cflags -DPJ_IS_BIG_ENDIAN=1 -DPJ_IS_LITTLE_ENDIAN=0"
 else
   CFLAGS="$CFLAGS -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1"
+  ac_cflags="$ac_cflags -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1"
 fi

diff --git a/aconfigure.ac b/aconfigure.ac
index 83d3559ed..b1d493c08 100644
--- a/aconfigure.ac
+++ b/aconfigure.ac
@@ -71,6 +71,7 @@ AC_SUBST(CC_CFLAGS)

 AC_SUBST(ac_pjdir)
 AC_SUBST(ac_build_mak_vars)
+AC_SUBST(ac_cflags)

 case $host in
     *mingw* | *cygw* | *win32* | *w32* )
@@ -144,8 +145,10 @@ AC_C_BIGENDIAN

 if test "x$ac_cv_c_bigendian" = "xyes"; then
   CFLAGS="$CFLAGS -DPJ_IS_BIG_ENDIAN=1 -DPJ_IS_LITTLE_ENDIAN=0"
+  ac_cflags="$ac_cflags -DPJ_IS_BIG_ENDIAN=1 -DPJ_IS_LITTLE_ENDIAN=0"
 else
   CFLAGS="$CFLAGS -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1"
+  ac_cflags="$ac_cflags -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1"
 fi

 dnl
diff --git a/build.mak.in b/build.mak.in
index abc0c4fa0..a9078bb25 100644
--- a/build.mak.in
+++ b/build.mak.in
@@ -299,7 +299,7 @@ export APP_LDXXLIBS := $(PJSUA2_LIB_LDLIB) \
 	-lstdc++ \
 	$(APP_LDLIBS)

-# Here are the variabels to use if application is using the library
+# Here are the variables to use if application is using the library
 # from within the source distribution
 export PJ_CC := $(APP_CC)
 export PJ_CXX := $(APP_CXX)
@@ -317,6 +317,5 @@ export PJ_LIBXX_FILES := $(APP_LIBXX_FILES)
 export PJ_INSTALL_DIR := @prefix@
 export PJ_INSTALL_INC_DIR := @includedir@
 export PJ_INSTALL_LIB_DIR := @libdir@
-export PJ_INSTALL_CFLAGS := -I$(PJ_INSTALL_INC_DIR) -DPJ_AUTOCONF=1 @CFLAGS@
-export PJ_INSTALL_CXXFLAGS := @CXXFLAGS@ $(PJ_INSTALL_CFLAGS)
-export PJ_INSTALL_LDFLAGS := -L$(PJ_INSTALL_LIB_DIR) $(APP_LDLIBS)
+export PJ_INSTALL_CFLAGS := -I$(PJ_INSTALL_INC_DIR) -DPJ_AUTOCONF=1 @ac_cflags@
+export PJ_INSTALL_LDFLAGS := -L$(PJ_INSTALL_LIB_DIR) $(APP_LDXXLIBS)
diff --git a/libpjproject.pc.in b/libpjproject.pc.in
index fa8d39114..30ea05c07 100644
--- a/libpjproject.pc.in
+++ b/libpjproject.pc.in
@@ -9,5 +9,5 @@ Name: libpjproject
 Description: Multimedia communication library
 URL: http://www.pjsip.org
 Version: @PJ_VERSION@
-Libs: -L${libdir} @PJ_LDXXLIBS@
-Cflags: -I${includedir} @PJ_INSTALL_CXXFLAGS@
+Libs: @PJ_INSTALL_LDFLAGS@
+Cflags: @PJ_INSTALL_CFLAGS@
--
2.27.0


code:
From 9bcba7fb28055550961b134e517b695a8cd05b2a Mon Sep 17 00:00:00 2001
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Date: Mon, 3 Aug 2020 17:43:19 -0400
Subject: [PATCH] libpjproject.pc: Move external libraries to Libs.private.

This is done so users of a shared pjproject library do not get link
directives (provided via pkg-config file of pjproject) to link against
pjproject's own library dependencies.

Static linking with pjproject is preserved by moving the external
libraries link directives to the Libs.private field, which is
specifically intended for this purpose, via for example:

  $ pkg-config --static --libs libpjproject

* build.mak.in (PJ_INSTALL_LDFLAGS_PRIVATE): New variable.
(PJ_INSTALL_LDFLAGS): Filter out PJ_INSTALL_LDFLAGS_PRIVATE entries.
* libpjproject.pc.in (Libs.private): New field.
* Makefile: Substitute PJ_INSTALL_LDFLAGS_PRIVATE as the value for the
Libs.private field.
---
 Makefile           | 5 +++--
 build.mak.in       | 3 ++-
 libpjproject.pc.in | 1 +
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 3fd5cab40..d67badfa4 100644
--- a/Makefile
+++ b/Makefile
@@ -54,14 +54,14 @@ doc:
 		    exit 1; \
 		fi; \
 	done
-
+
 LIBS = 	pjlib/lib/libpj-$(TARGET_NAME).a \
 	pjlib-util/lib/libpjlib-util-$(TARGET_NAME).a \
 	pjnath/lib/libpjnath-$(TARGET_NAME).a \
 	pjmedia/lib/libpjmedia-$(TARGET_NAME).a \
 	pjmedia/lib/libpjmedia-audiodev-$(TARGET_NAME).a \
 	pjmedia/lib/libpjmedia-codec-$(TARGET_NAME).a \
-    	pjsip/lib/libpjsip-$(TARGET_NAME).a \
+	pjsip/lib/libpjsip-$(TARGET_NAME).a \
 	pjsip/lib/libpjsip-ua-$(TARGET_NAME).a \
 	pjsip/lib/libpjsip-simple-$(TARGET_NAME).a \
 	pjsip/lib/libpjsua-$(TARGET_NAME).a
@@ -133,6 +133,7 @@ install:
 		sed -e "s!@LIBDIR@!$(libdir)!" | \
 		sed -e "s/@PJ_VERSION@/$(PJ_VERSION)/" | \
 		sed -e "s!@PJ_INSTALL_LDFLAGS@!$(PJ_INSTALL_LDFLAGS)!" | \
+		sed -e "s!@PJ_INSTALL_LDFLAGS_PRIVATE@!$(PJ_INSTALL_LDFLAGS_PRIVATE)!" | \
 		sed -e "s!@PJ_INSTALL_CFLAGS@!$(PJ_INSTALL_CFLAGS)!" > $(DESTDIR)/$(libdir)/pkgconfig/libpjproject.pc

 uninstall:
diff --git a/build.mak.in b/build.mak.in
index a9078bb25..1a18a8513 100644
--- a/build.mak.in
+++ b/build.mak.in
@@ -318,4 +318,5 @@ export PJ_INSTALL_DIR := @prefix@
 export PJ_INSTALL_INC_DIR := @includedir@
 export PJ_INSTALL_LIB_DIR := @libdir@
 export PJ_INSTALL_CFLAGS := -I$(PJ_INSTALL_INC_DIR) -DPJ_AUTOCONF=1 @ac_cflags@
-export PJ_INSTALL_LDFLAGS := -L$(PJ_INSTALL_LIB_DIR) $(APP_LDXXLIBS)
+export PJ_INSTALL_LDFLAGS_PRIVATE := $(APP_THIRD_PARTY_LIBS) $(APP_THIRD_PARTY_EXT) @LIBS@
+export PJ_INSTALL_LDFLAGS := -L$(PJ_INSTALL_LIB_DIR) $(filter-out $(PJ_INSTALL_LDFLAGS_PRIVATE),$(APP_LDXXLIBS))
diff --git a/libpjproject.pc.in b/libpjproject.pc.in
index 30ea05c07..4372d5016 100644
--- a/libpjproject.pc.in
+++ b/libpjproject.pc.in
@@ -10,4 +10,5 @@ Description: Multimedia communication library
 URL: http://www.pjsip.org
 Version: @PJ_VERSION@
 Libs: @PJ_INSTALL_LDFLAGS@
+Libs.private: @PJ_INSTALL_LDFLAGS_PRIVATE@
 Cflags: @PJ_INSTALL_CFLAGS@
--
2.27.0


code:
https://sources.debian.org/data/main/p/plib/1.8.5-8/debian/patches/04_CVE-2011-4620.diff

--- a/src/util/ulError.cxx
+++ b/src/util/ulError.cxx
@@ -39,7 +39,7 @@
 {
   va_list argp;
   va_start ( argp, fmt ) ;
-  vsprintf ( _ulErrorBuffer, fmt, argp ) ;
+  vsnprintf ( _ulErrorBuffer, sizeof(_ulErrorBuffer), fmt, argp ) ;
   va_end ( argp ) ;

   if ( _ulErrorCB )


code:
https://sources.debian.org/data/main/p/plib/1.8.5-8/debian/patches/05_CVE-2012-4552.diff

diff -up plib-1.8.5/src/ssg/ssgParser.cxx~ plib-1.8.5/src/ssg/ssgParser.cxx
--- plib-1.8.5/src/ssg/ssgParser.cxx~	2008-03-11 03:06:23.000000000 +0100
+++ plib-1.8.5/src/ssg/ssgParser.cxx	2012-11-01 15:33:12.424483374 +0100
@@ -57,18 +57,16 @@ void _ssgParser::error( const char *form
   char msgbuff[ 255 ];
   va_list argp;

-  char* msgptr = msgbuff;
-  if (linenum)
-  {
-    msgptr += sprintf ( msgptr,"%s, line %d: ",
-      path, linenum );
-  }
-
   va_start( argp, format );
-  vsprintf( msgptr, format, argp );
+  vsnprintf( msgbuff, sizeof(msgbuff), format, argp );
   va_end( argp );

-  ulSetError ( UL_WARNING, "%s", msgbuff ) ;
+  if (linenum)
+  {
+    ulSetError ( UL_WARNING, "%s, line %d: %s", path, linenum, msgbuff ) ;
+  } else {
+    ulSetError ( UL_WARNING, "%s", msgbuff ) ;
+  }
 }

@@ -78,18 +76,16 @@ void _ssgParser::message( const char *fo
   char msgbuff[ 255 ];
   va_list argp;

-  char* msgptr = msgbuff;
-  if (linenum)
-  {
-    msgptr += sprintf ( msgptr,"%s, line %d: ",
-      path, linenum );
-  }
-
   va_start( argp, format );
-  vsprintf( msgptr, format, argp );
+  vsnprintf( msgbuff, sizeof(msgbuff), format, argp );
   va_end( argp );

-  ulSetError ( UL_DEBUG, "%s", msgbuff ) ;
+  if (linenum)
+  {
+    ulSetError ( UL_DEBUG, "%s, line %d: %s", path, linenum, msgbuff ) ;
+  } else {
+    ulSetError ( UL_DEBUG, "%s", msgbuff ) ;
+  }
 }

 // Opens the file and does a few internal calculations based on the spec.


code:
GCC rightfully complains about redefined variables, as iterator declarations
appear inside loops with a loop variable of the same name.

This patch has been sent upstream.

--- a/sets.cpp	2015-06-25 11:22:08.252821681 +0200
+++ b/sets.cpp	2015-06-25 11:22:23.239187985 +0200
@@ -768,11 +768,11 @@
       //////////////////////////////////////////////
       // Reset original missing status

-      vector<Individual*>::iterator i = PP->sample.begin();
-      while ( i != PP->sample.end() )
+      vector<Individual*>::iterator it = PP->sample.begin();
+      while ( it != PP->sample.end() )
 	{
-	  (*i)->missing = (*i)->flag;
-	  ++i;
+	  (*it)->missing = (*it)->flag;
+	  ++it;
 	}

       ////////////////////////////////////////////////

--- a/elf.cpp	2009-10-10 18:00:21.000000000 +0200
+++ b/elf.cpp	2015-06-25 11:34:06.136835756 +0200
@@ -1175,10 +1175,10 @@
 	  << setw(8) << gcnt << " "
 	  << setw(8) << (double)cnt / (double)gcnt << "\n";

-      map<int,int>::iterator i = chr_cnt.begin();
-      while ( i != chr_cnt.end() )
+      map<int,int>::iterator it = chr_cnt.begin();
+      while ( it != chr_cnt.end() )
 	{
-	  int c = i->first;
+	  int c = it->first;
 	  int x = chr_cnt.find( c )->second;
 	  int y = chr_gcnt.find( c )->second;

@@ -1189,7 +1189,7 @@
 	      << setw(8) << y << " "
 	      << setw(8) << (double)x / (double)y << "\n";

-	  ++i;
+	  ++it;
 	}

     }

--- plink-1.07-src/idhelp.cpp	2009-10-10 18:00:22.000000000 +0200
+++ plink-1.07-src/idhelp.cpp.patched	2015-06-25 11:37:39.387204086 +0200
@@ -772,12 +772,12 @@
       for (int j = 0 ; j < jointField.size(); j++ )
 	{
 	  set<IDField*> & jf = jointField[j];
-	  set<IDField*>::iterator j = jf.begin();
+	  set<IDField*>::iterator jit = jf.begin();
 	  PP->printLOG(" { ");
-	  while ( j != jf.end() )
+	  while ( jit != jf.end() )
 	    {
-	      PP->printLOG( (*j)->name + " " );
-	      ++j;
+	      PP->printLOG( (*jit)->name + " " );
+	      ++jit;
 	    }
 	  PP->printLOG(" }");
 	}


code:
This patch is borrowed from Debian's patches for plink

Author: Peter Green <plugwash@p10link.net>
Puropose: Fallback to endian.h if all else fails on 64bit machines
Closes: #528659
Forwarded: Shaun Purcell <plink@chgr.mgh.harvard.edu>
License: same as plink itself.
===================================================================
--- plink-1.06.orig/Rsrv.h	2009-05-15 03:35:29.000000000 +0100
+++ plink-1.06/Rsrv.h	2009-05-15 03:35:41.000000000 +0100
@@ -313,7 +313,18 @@
 #define __BIG_ENDIAN__ 1
 #define SWAPEND 1
 #elif ! defined Win32 /* Windows is little-endian is most cases, anywhere else we're stuck */
-#error "Cannot determine endianness. Make sure config.h is included or __{BIG|LITTLE}_ENDIAN__ is defined ."
+  //try endian.h before we finally bail out
+  #include <endian.h>
+  #if __BYTE_ORDER == __LITTLE_ENDIAN
+    #warning using little endian based on information from endian.h
+    #define __LITTLE_ENDIAN__ 1
+  #elif __BYTE_ORDER == __BIG_ENDIAN
+    #warning using big endian based on information from endian.h
+    #define __BIG_ENDIAN__ 1
+    #define SWAPEND 1
+  #else
+    #error "Cannot determine endianness. Make sure config.h is included or __{BIG|LITTLE}_ENDIAN__ is defined ."
+  #endif
 #endif

 /* FIXME: all the mess below needs more efficient implementation - the current one is so messy to work around alignment problems on some platforms like Sun and HP 9000 */


code:
Description: Work around i386 testsuite error
Author: Andreas Metzler <ametzler@debian.org>
Origin: vendor
Bug: http://lists.gnu.org/archive/html/bug-plotutils/2017-02/msg00001.html
Bug-Debian: https://bugs.debian.org/856134
Forwarded: http://lists.gnu.org/archive/html/bug-plotutils/2017-02/msg00002.html
Last-Update: 2017-02-25

--- a/test/spline.test
+++ b/test/spline.test
@@ -3,12 +3,21 @@
 echo 0 1 0.5 0.75 -0.25 0 | ../spline/spline -a -T 1 -n 120 \
 	--precision 5 -p >spline.out

+# Work around testsuite error
+# http://lists.gnu.org/archive/html/bug-plotutils/2016-04/msg00000.html
+#
 # work around line end problems in installations with DJGPP under DOS
-tr -d '\015' < spline.out > spline.dos
+tr -d '\015' < spline.out \
+	| head -n 120 | tail -n 119 \
+	> spline.dos

-if cmp -s $SRCDIR/spline.xout spline.dos
+# cannot patch spline.xout, it is used as input for graph.test.
+head -n 120 $SRCDIR/spline.xout | tail -n 119 > spline.xout.4comp
+
+if cmp -s spline.xout.4comp spline.dos
 	then retval=0;
 	else retval=1;
 	fi;

+rm -f spline.xout.4comp
 exit $retval


code:
The build fails with cmake 3.12.0.  This patch will be obsolete with the next
release.

https://sourceforge.net/p/podofo/tickets/24/attachment/podofo-cmake-3.12.patch

--- a/test/TokenizerTest/CMakeLists.txt	2018-07-20 18:26:02.921494293 +0200
+++ b/test/TokenizerTest/CMakeLists.txt	2018-07-20 18:34:53.727136443 +0200
@@ -2,10 +2,3 @@
 TARGET_LINK_LIBRARIES(TokenizerTest ${PODOFO_LIB} ${PODOFO_LIB_DEPENDS})
 SET_TARGET_PROPERTIES(TokenizerTest PROPERTIES COMPILE_FLAGS "${PODOFO_CFLAGS}")
 ADD_DEPENDENCIES(TokenizerTest ${PODOFO_DEPEND_TARGET})
-
-# Copy the test samples over to the build tree
-ADD_CUSTOM_COMMAND(
-    TARGET TokenizerTest
-    POST_BUILD
-    COMMAND "${CMAKE_COMMAND}" -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/objects" "${CMAKE_CURRENT_BINARY_DIR}/objects"
-    )


code:
Description: Add features needed to make portmixer work with audacity.
Author: Audacity Team
Last-Update: 2011-12-07

See <http://music.columbia.edu/pipermail/portaudio/2015-March/016611.html>.

--- a/include/pa_win_ds.h
+++ b/include/pa_win_ds.h
@@ -89,6 +89,21 @@

 }PaWinDirectSoundStreamInfo;

+/** Retrieve the GUID of the input device.
+
+ @param stream The stream to query.
+
+ @return A pointer to the GUID, or NULL if none.
+*/
+LPGUID PaWinDS_GetStreamInputGUID( PaStream* s );
+
+/** Retrieve the GUID of the output device.
+
+ @param stream The stream to query.
+
+ @return A pointer to the GUID, or NULL if none.
+*/
+LPGUID PaWinDS_GetStreamOutputGUID( PaStream* s );

 #ifdef __cplusplus
--- a/include/portaudio.h
+++ b/include/portaudio.h
@@ -1146,6 +1146,15 @@
 signed long Pa_GetStreamWriteAvailable( PaStream* stream );

+/** Retrieve the host type handling an open stream.
+
+ @return Returns a non-negative value representing the host API type
+ handling an open stream or, a PaErrorCode (which are always negative)
+ if PortAudio is not initialized or an error is encountered.
+*/
+PaHostApiTypeId Pa_GetStreamHostApiType( PaStream* stream );
+
+
 /* Miscellaneous utilities */

--- /dev/null
+++ b/include/pa_unix_oss.h
@@ -0,0 +1,104 @@
+#ifndef PA_UNIX_OSS_H
+#define PA_UNIX_OSS_H
+
+/*
+ * $Id: portaudio.patch,v 1.10 2009-06-30 04:52:59 llucius Exp $
+ * PortAudio Portable Real-Time Audio Library
+ * OSS-specific extensions
+ *
+ * Copyright (c) 1999-2000 Ross Bencina and Phil Burk
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * Any person wishing to distribute modifications to the Software is
+ * requested to send the modifications to the original developer so that
+ * they can be incorporated into the canonical version.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+/** @file
+ * OSS-specific PortAudio API extension header file.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+const char *PaOSS_GetStreamInputDevice( PaStream *s );
+
+const char *PaOSS_GetStreamOutputDevice( PaStream *s );
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+#ifndef PA_UNIX_OSS_H
+#define PA_UNIX_OSS_H
+
+/*
+ * $Id: portaudio.patch,v 1.10 2009-06-30 04:52:59 llucius Exp $
+ * PortAudio Portable Real-Time Audio Library
+ * OSS-specific extensions
+ *
+ * Copyright (c) 1999-2000 Ross Bencina and Phil Burk
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * Any person wishing to distribute modifications to the Software is
+ * requested to send the modifications to the original developer so that
+ * they can be incorporated into the canonical version.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+/** @file
+ * OSS-specific PortAudio API extension header file.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+const char *PaOSS_GetStreamInputDevice( PaStream *s );
+
+const char *PaOSS_GetStreamOutputDevice( PaStream *s );
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- a/src/common/pa_front.c
+++ b/src/common/pa_front.c
@@ -1216,8 +1216,10 @@
                                   hostApiInputParametersPtr, hostApiOutputParametersPtr,
                                   sampleRate, framesPerBuffer, streamFlags, streamCallback, userData );

-    if( result == paNoError )
+    if( result == paNoError ) {
         AddOpenStream( *stream );
+        PA_STREAM_REP(*stream)->hostApiType = hostApi->info.type;
+    }

     PA_LOGAPI(("Pa_OpenStream returned:\n" ));
@@ -1729,6 +1731,32 @@
     return result;
 }

+PaHostApiTypeId Pa_GetStreamHostApiType( PaStream* stream )
+{
+    PaError error = PaUtil_ValidateStreamPointer( stream );
+    PaHostApiTypeId result;
+
+#ifdef PA_LOG_API_CALLS
+    PaUtil_DebugPrint("Pa_GetStreamHostApiType called:\n" );
+    PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream );
+#endif
+
+    if( error == paNoError )
+    {
+        result = PA_STREAM_REP(stream)->hostApiType;
+    }
+    else
+    {
+        result = (PaHostApiTypeId) error;
+    }
+
+#ifdef PA_LOG_API_CALLS
+    PaUtil_DebugPrint("Pa_GetStreamHostApiType returned:\n" );
+    PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) );
+#endif
+
+    return result;
+}

 PaError Pa_GetSampleSize( PaSampleFormat format )
 {
--- a/src/common/pa_stream.c
+++ b/src/common/pa_stream.c
@@ -93,6 +93,8 @@
     streamRepresentation->streamInfo.inputLatency = 0.;
     streamRepresentation->streamInfo.outputLatency = 0.;
     streamRepresentation->streamInfo.sampleRate = 0.;
+
+    streamRepresentation->hostApiType = 0;
 }

--- a/src/common/pa_stream.h
+++ b/src/common/pa_stream.h
@@ -152,6 +152,7 @@
     PaStreamFinishedCallback *streamFinishedCallback;
     void *userData;
     PaStreamInfo streamInfo;
+    PaHostApiTypeId hostApiType;
 } PaUtilStreamRepresentation;

--- a/src/hostapi/coreaudio/pa_mac_core_blocking.c
+++ b/src/hostapi/coreaudio/pa_mac_core_blocking.c
@@ -66,6 +66,9 @@
 #ifdef MOSX_USE_NON_ATOMIC_FLAG_BITS
 # define OSAtomicOr32( a, b ) ( (*(b)) |= (a) )
 # define OSAtomicAnd32( a, b ) ( (*(b)) &= (a) )
+#elif MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_3
+# define OSAtomicOr32( a, b ) BitOrAtomic( a, (UInt32 *) b )
+# define OSAtomicAnd32( a, b ) BitAndAtomic( a, (UInt32 *) b )
 #else
 # include <libkern/OSAtomic.h>
 #endif
--- a/src/hostapi/alsa/pa_linux_alsa.c
+++ b/src/hostapi/alsa/pa_linux_alsa.c
@@ -611,6 +611,7 @@
     StreamDirection streamDir;

     snd_pcm_channel_area_t *channelAreas;  /* Needed for channel adaption */
+    int card;
 } PaAlsaStreamComponent;

 /* Implementation specific stream structure */
@@ -1806,6 +1807,7 @@
 {
     PaError result = paNoError;
     PaSampleFormat userSampleFormat = params->sampleFormat, hostSampleFormat = paNoError;
+    snd_pcm_info_t* pcmInfo;
     assert( params->channelCount > 0 );

     /* Make sure things have an initial value */
@@ -1826,6 +1828,9 @@
     self->device = params->device;

     PA_ENSURE( AlsaOpen( &alsaApi->baseHostApiRep, params, streamDir, &self->pcm ) );
+
+    snd_pcm_info_alloca( &pcmInfo );
+    self->card = snd_pcm_info_get_card( pcmInfo );
     self->nfds = alsa_snd_pcm_poll_descriptors_count( self->pcm );

     PA_ENSURE( hostSampleFormat = PaUtil_SelectClosestAvailableFormat( GetAvailableFormats( self->pcm ), userSampleFormat ) );
@@ -4519,9 +4524,7 @@
     /* XXX: More descriptive error? */
     PA_UNLESS( stream->capture.pcm, paDeviceUnavailable );

-    alsa_snd_pcm_info_alloca( &pcmInfo );
-    PA_ENSURE( alsa_snd_pcm_info( stream->capture.pcm, pcmInfo ) );
-    *card = alsa_snd_pcm_info_get_card( pcmInfo );
+    *card = stream->capture.card;

 error:
     return result;
@@ -4537,9 +4540,7 @@
     /* XXX: More descriptive error? */
     PA_UNLESS( stream->playback.pcm, paDeviceUnavailable );

-    alsa_snd_pcm_info_alloca( &pcmInfo );
-    PA_ENSURE( alsa_snd_pcm_info( stream->playback.pcm, pcmInfo ) );
-    *card = alsa_snd_pcm_info_get_card( pcmInfo );
+    *card = stream->playback.card;

 error:
     return result;
--- a/src/hostapi/oss/pa_unix_oss.c
+++ b/src/hostapi/oss/pa_unix_oss.c
@@ -2028,3 +2028,26 @@
 #endif
 }

+const char *PaOSS_GetStreamInputDevice( PaStream* s )
+{
+    PaOssStream *stream = (PaOssStream*)s;
+
+    if( stream->capture )
+    {
+      return stream->capture->devName;
+    }
+
+   return NULL;
+}
+
+const char *PaOSS_GetStreamOutputDevice( PaStream* s )
+{
+    PaOssStream *stream = (PaOssStream*)s;
+
+    if( stream->playback )
+    {
+      return stream->playback->devName;
+    }
+
+   return NULL;
+}
--- a/configure.in
+++ b/configure.in
@@ -365,6 +365,7 @@
                    DLL_LIBS="$DLL_LIBS -lossaudio"
                    LIBS="$LIBS -lossaudio"
            fi
+           INCLUDES="$INCLUDES pa_unix_oss.h"
            AC_DEFINE(PA_USE_OSS,1)
         fi


code:
We took this patch from Gentoo to break apart the portmidi build, so that we
can disable the Java parts and cleanly disable the tests which fail to link
(possibly because they are linked before “-lportmidi” is available).  The
patch was downloaded from here:

https://gitweb.gentoo.org/repo/gentoo.git/plain/media-libs/portmidi/files/portmidi-217-cmake.patch?id=56bd759df1d0c750a065b8c845e93d5dfa6b549d

--- portmidi/CMakeLists.txt
+++ portmidi/CMakeLists.txt
@@ -9,12 +9,11 @@
   set(CMAKE_BUILD_TYPE Release CACHE STRING
       "Semicolon-separate list of supported configuration types")
   # set default directories but don't override cached values...
-  set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CACHEFILE_DIR}/${CMAKE_BUILD_TYPE}
+  set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
       CACHE STRING "libraries go here")
-  set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CACHEFILE_DIR}/${CMAKE_BUILD_TYPE}
+  set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
       CACHE STRING "libraries go here")
-  set(CMAKE_RUNTIME_OUTPUT_DIRECTORY
-      ${CMAKE_CACHEFILE_DIR}/${CMAKE_BUILD_TYPE}
+  set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
       CACHE STRING "executables go here")

 else(UNIX)
@@ -68,10 +67,20 @@
 include_directories(pm_common porttime)
 add_subdirectory(pm_common)

-add_subdirectory(pm_test)
+option(PORTMIDI_ENABLE_JAVA "Enable Java bindings support" ON)
+option(PORTMIDI_ENABLE_STATIC "Build and install static libraries" OFF)
+option(PORTMIDI_ENABLE_TEST "Build test programs" ON)
+
+if(PORTMIDI_ENABLE_TEST)
+  add_subdirectory(pm_test)
+endif(PORTMIDI_ENABLE_TEST)

 add_subdirectory(pm_dylib)

 # Cannot figure out how to make an xcode Java application with CMake
-add_subdirectory(pm_java)
+if(PORTMIDI_ENABLE_JAVA)
+  set(JAR_INSTALL_DIR share/java
+      CACHE STRING "Define directory name for jar installation")
+  add_subdirectory(pm_java)
+endif(PORTMIDI_ENABLE_JAVA)

--- portmidi/pm_common/CMakeLists.txt
+++ portmidi/pm_common/CMakeLists.txt
@@ -44,9 +44,6 @@

 # first include the appropriate system-dependent file:
 if(UNIX)
-  # add the -g switch for Linux and Mac OS X (not used in Win32)
-  set (CMAKE_C_FLAGS_DEBUG "-g ${CMAKE_C_FLAGS_DEBUG}"
-       CACHE STRING "enable extra checks for debugging" FORCE)
   if(APPLE)
     set(MACSRC pmmacosxcm pmmac readbinaryplist finddefault)
     prepend_path(LIBSRC ../pm_mac/ ${MACSRC})
@@ -62,19 +59,23 @@
                              ${COREMIDI_LIB} ${CORESERVICES_LIB}
         CACHE INTERNAL "")

-    set(JAVAVM_LIB "${FRAMEWORK_PATH}/JavaVM.framework")
-    set(JAVA_INCLUDE_PATHS ${JAVAVM_LIB}/Headers)
+    if(PORTMIDI_ENABLE_JAVA)
+      set(JAVAVM_LIB "${FRAMEWORK_PATH}/JavaVM.framework")
+      set(JAVA_INCLUDE_PATHS ${JAVAVM_LIB}/Headers)
+    endif(PORTMIDI_ENABLE_JAVA)
     message(STATUS "SYSROOT: " ${CMAKE_OSX_SYSROOT})
   else(APPLE)
     # LINUX settings...
-    include(FindJNI)
-    message(STATUS "JAVA_JVM_LIB_PATH is " ${JAVA_JVM_LIB_PATH})
-    message(STATUS "JAVA_INCLUDE_PATH is " ${JAVA_INCLUDE_PATH})
-    message(STATUS "JAVA_INCLUDE_PATH2 is " ${JAVA_INCLUDE_PATH2})
-    message(STATUS "JAVA_JVM_LIBRARY is " ${JAVA_JVM_LIBRARY})
-    set(JAVA_INCLUDE_PATHS ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})
-    # libjvm.so is found relative to JAVA_INCLUDE_PATH:
-    set(JAVAVM_LIB ${JAVA_JVM_LIBRARY}/libjvm.so)
+    if(PORTMIDI_ENABLE_JAVA)
+      include(FindJNI)
+      message(STATUS "JAVA_JVM_LIB_PATH is " ${JAVA_JVM_LIB_PATH})
+      message(STATUS "JAVA_INCLUDE_PATH is " ${JAVA_INCLUDE_PATH})
+      message(STATUS "JAVA_INCLUDE_PATH2 is " ${JAVA_INCLUDE_PATH2})
+      message(STATUS "JAVA_JVM_LIBRARY is " ${JAVA_JVM_LIBRARY})
+      set(JAVA_INCLUDE_PATHS ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})
+      # libjvm.so is found relative to JAVA_INCLUDE_PATH:
+      set(JAVAVM_LIB ${JAVA_JVM_LIBRARY}/libjvm.so)
+    endif(PORTMIDI_ENABLE_JAVA)

     set(LINUXSRC pmlinuxalsa pmlinux finddefault)
     prepend_path(LIBSRC ../pm_linux/ ${LINUXSRC})
@@ -88,10 +89,12 @@
     # /MD is multithread DLL, /MT is multithread. Change to static:
     include(../pm_win/static.cmake)

-    include(FindJNI)
+    if(PORTMIDI_ENABLE_JAVA)
+      include(FindJNI)

-    set(JAVA_INCLUDE_PATHS ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})
-    # message(STATUS "JAVA_INCLUDE_PATHS: " ${JAVA_INCLUDE_PATHS})
+      set(JAVA_INCLUDE_PATHS ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})
+      # message(STATUS "JAVA_INCLUDE_PATHS: " ${JAVA_INCLUDE_PATHS})
+    endif(PORTMIDI_ENABLE_JAVA)

     set(WINSRC pmwin pmwinmm)
     prepend_path(LIBSRC ../pm_win/ ${WINSRC})
@@ -99,29 +102,43 @@
     set(PM_NEEDED_LIBS winmm.lib)
   endif(WIN32)
 endif(UNIX)
-set(JNI_EXTRA_LIBS ${PM_NEEDED_LIBS} ${JAVA_JVM_LIBRARY})
+
+if(PORTMIDI_ENABLE_JAVA)
+  set(JNI_EXTRA_LIBS ${PM_NEEDED_LIBS} ${JAVA_JVM_LIBRARY})
+endif(PORTMIDI_ENABLE_JAVA)

 # this completes the list of library sources by adding shared code
 list(APPEND LIBSRC pmutil portmidi)

 # now add the shared files to make the complete list of library sources
-add_library(portmidi-static ${LIBSRC})
-set_target_properties(portmidi-static PROPERTIES OUTPUT_NAME "portmidi_s")
-target_link_libraries(portmidi-static ${PM_NEEDED_LIBS})
-
-# define the jni library
-include_directories(${JAVA_INCLUDE_PATHS})
-
-set(JNISRC ${LIBSRC} ../pm_java/pmjni/pmjni.c)
-add_library(pmjni SHARED ${JNISRC})
-target_link_libraries(pmjni ${JNI_EXTRA_LIBS})
-set_target_properties(pmjni PROPERTIES EXECUTABLE_EXTENSION "jnilib")
+if(PORTMIDI_ENABLE_STATIC)
+  add_library(portmidi-static ${LIBSRC})
+  set_target_properties(portmidi-static PROPERTIES OUTPUT_NAME "portmidi")
+  target_link_libraries(portmidi-static ${PM_NEEDED_LIBS})
+endif(PORTMIDI_ENABLE_STATIC)
+
+if(PORTMIDI_ENABLE_JAVA)
+  # define the jni library
+  include_directories(${JAVA_INCLUDE_PATHS})
+
+  set(JNISRC ${LIBSRC} ../pm_java/pmjni/pmjni.c)
+  add_library(pmjni SHARED ${JNISRC})
+  target_link_libraries(pmjni ${JNI_EXTRA_LIBS})
+  set_target_properties(pmjni PROPERTIES EXECUTABLE_EXTENSION "jnilib")
+endif(PORTMIDI_ENABLE_JAVA)

 # install the libraries (Linux and Mac OS X command line)
 if(UNIX)
-  INSTALL(TARGETS portmidi-static pmjni
-    LIBRARY DESTINATION /usr/local/lib
-    ARCHIVE DESTINATION /usr/local/lib)
+  if(PORTMIDI_ENABLE_STATIC)
+    INSTALL(TARGETS portmidi-static
+      LIBRARY DESTINATION lib${LIB_SUFFIX}
+      ARCHIVE DESTINATION lib${LIB_SUFFIX})
+  endif(PORTMIDI_ENABLE_STATIC)
+  if(PORTMIDI_ENABLE_JAVA)
+    INSTALL(TARGETS pmjni
+      LIBRARY DESTINATION lib${LIB_SUFFIX}
+      ARCHIVE DESTINATION lib${LIB_SUFFIX})
+  endif(PORTMIDI_ENABLE_JAVA)
 # .h files installed by pm_dylib/CMakeLists.txt, so don't need them here
 #  INSTALL(FILES portmidi.h ../porttime/porttime.h
 #    DESTINATION /usr/local/include)
--- portmidi/pm_dylib/CMakeLists.txt
+++ portmidi/pm_dylib/CMakeLists.txt
@@ -39,9 +39,6 @@

 # first include the appropriate system-dependent file:
 if(UNIX)
-  # add the -g switch for Linux and Mac OS X (not used in Win32)
-  set (CMAKE_C_FLAGS_DEBUG "-g ${CMAKE_C_FLAGS_DEBUG}"
-       CACHE STRING "enable extra checks for debugging" FORCE)
   if(APPLE)
     set(MACSRC pmmacosxcm pmmac readbinaryplist finddefault)
     prepend_path(LIBSRC ../pm_mac/ ${MACSRC})
@@ -63,7 +60,8 @@
     message(STATUS "SYSROOT: " ${CMAKE_OSX_SYSROOT})
   else(APPLE)
     # LINUX settings...
-    include(FindJNI)
+    if(PORTMIDI_ENABLE_JAVA)
+      include(FindJNI)
     # message(STATUS "JAVA_JVM_LIB_PATH is " ${JAVA_JVM_LIB_PATH})
     # message(STATUS "JAVA_INCLUDE_PATH is " ${JAVA_INCLUDE_PATH})
     # note: should use JAVA_JVM_LIB_PATH, but it is not set properly
@@ -75,11 +73,8 @@
     # JAVA_INCLUDE_PATH2; if no, then we need to make both JAVA_INCLUDE_PATH
     # and JAVA_INCLUDE_PATH2 set by user (will need clear documentation
     # because JAVA_INCLUDE_PATH2 is pretty obscure)
-    set(JAVA_INCLUDE_PATH  ${JAVA_INCLUDE_PATH-UNKNOWN}
-        CACHE STRING "where to find Java SDK include directory")
-    set(JAVA_INCLUDE_PATHS ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH}/linux)
-    # libjvm.so is found relative to JAVA_INCLUDE_PATH:
-    set(JAVAVM_LIB ${JAVA_INCLUDE_PATH}/../jre/lib/i386/client/libjvm.so)
+      set(JAVAVM_LIB ${JAVA_JVM_LIBRARY})
+    endif(PORTMIDI_ENABLE_JAVA)

     set(LINUXSRC pmlinuxalsa pmlinux finddefault)
     prepend_path(LIBSRC ../pm_linux/ ${LINUXSRC})
@@ -91,13 +86,15 @@
   if(WIN32)
     # /MDd is multithread debug DLL, /MTd is multithread debug
     # /MD is multithread DLL, /MT is multithread
-
-    include(FindJNI)
-    # note: should use JAVA_JVM_LIB_PATH, but it is not set properly
-    set(JAVAVM_LIB ${JAVA_INCLUDE_PATH}/../lib/jvm.lib)

-    set(JAVA_INCLUDE_PATHS ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})
-    # message(STATUS "JAVA_INCLUDE_PATHS: " ${JAVA_INCLUDE_PATHS})
+    if(PORTMIDI_ENABLE_JAVA)
+      include(FindJNI)
+      # note: should use JAVA_JVM_LIB_PATH, but it is not set properly
+      set(JAVAVM_LIB ${JAVA_INCLUDE_PATH}/../lib/jvm.lib)
+
+      set(JAVA_INCLUDE_PATHS ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})
+      # message(STATUS "JAVA_INCLUDE_PATHS: " ${JAVA_INCLUDE_PATHS})
+    endif(PORTMIDI_ENABLE_JAVA)

     set(WINSRC pmwin pmwinmm)
     prepend_path(LIBSRC ../pm_win/ ${WINSRC})
@@ -106,7 +103,10 @@
     # message(STATUS "JAVAVM_LIB: " ${JAVAVM_LIB})
   endif(WIN32)
 endif(UNIX)
+
+if(PORTMIDI_ENABLE_JAVA)
 set(JNI_EXTRA_LIBS ${PM_NEEDED_LIBS} ${JAVAVM_LIB})
+endif(PORTMIDI_ENABLE_JAVA)

 # this completes the list of library sources by adding shared code
 set(SHARED_FILES pmutil portmidi)
@@ -120,8 +120,8 @@
 # install the libraries (Linux and Mac OS X command line)
 if(UNIX)
   INSTALL(TARGETS portmidi-dynamic
-    LIBRARY DESTINATION /usr/local/lib
-    ARCHIVE DESTINATION /usr/local/lib)
+    LIBRARY DESTINATION lib${LIB_SUFFIX}
+    ARCHIVE DESTINATION lib${LIB_SUFFIX})
   INSTALL(FILES ../pm_common/portmidi.h ../porttime/porttime.h
-    DESTINATION /usr/local/include)
+    DESTINATION include)
 endif(UNIX)
--- portmidi/pm_java/CMakeLists.txt
+++ portmidi/pm_java/CMakeLists.txt
@@ -5,43 +5,24 @@
     # java not dealt with in CMake -- see pm_mac/pm_mac.xcodeproj
   else(APPLE)
     # linux
-    set(JPORTMIDICLASS JPortMidi.class JPortMidiException.class
-    		       JPortMidiApi.class)
-    set(PMDEFAULTSCLASS PmDefaultsFrame.class PmDefaults.class)
-    prepend_path(JPORTMIDICLASS2 jportmidi/ ${JPORTMIDICLASS})
-    prepend_path(PMDEFAULTSCLASS2 pmdefaults/ ${PMDEFAULTSCLASS})
-    set(PMDEFAULTS_ALL_CLASSES ${JPORTMIDICLASS2} ${PMDEFAULTSCLASS2})
-    # message(STATUS "PMDEFAULTS_ALL_CLASSES is " ${PMDEFAULTS_ALL_CLASSES})
-    add_custom_command(OUTPUT pmdefaults/PmDefaultsFrame.class
-        COMMAND javac -classpath . pmdefaults/PmDefaultsFrame.java
-	MAIN_DEPENDENCY pmdefaults/PmDefaultsFrame.java
-	DEPENDS pmdefaults/PmDefaults.java
-	WORKING_DIRECTORY pm_java)
-    add_custom_command(OUTPUT pmdefaults/PmDefaults.class
-        COMMAND javac -classpath . pmdefaults/PmDefaults.java
-	MAIN_DEPENDENCY pmdefaults/PmDefaults.java
-	DEPENDS pmdefaults/PmDefaultsFrame.java
-	WORKING_DIRECTORY pm_java)
-    add_custom_command(OUTPUT ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pmdefaults.jar
-        COMMAND	cp pmdefaults/portmusic_logo.png .
-        COMMAND	jar cmf pmdefaults/manifest.txt pmdefaults.jar
-		pmdefaults/*.class portmusic_logo.png jportmidi/*.class
-  	COMMAND chmod +x pmdefaults/pmdefaults
-	COMMAND cp pmdefaults/pmdefaults ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
-	COMMAND mv pmdefaults.jar ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
-	COMMAND rm portmusic_logo.png
-	MAIN_DEPENDENCY pmdefaults/PmDefaults.class
-	DEPENDS ${PMDEFAULTS_ALL_CLASSES}
-	WORKING_DIRECTORY pm_java)
-    add_custom_target(pmdefaults_target ALL
-        DEPENDS ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pmdefaults.jar)
-    # message(STATUS "add_custom_target: pmdefaults.jar")
+	set(JAVA_CLASSES jportmidi pmdefaults)
+	add_custom_command(OUTPUT ${JAVA_CLASSES}
+		COMMAND javac -d ${CMAKE_CURRENT_BINARY_DIR} jportmidi/*.java pmdefaults/*.java
+		WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+	add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/pmdefaults.jar
+		DEPENDS ${JAVA_CLASSES}
+		COMMAND jar cmf pmdefaults/manifest.txt ${CMAKE_CURRENT_BINARY_DIR}/pmdefaults.jar
+		-C pmdefaults portmusic_logo.png -C ${CMAKE_CURRENT_BINARY_DIR} jportmidi
+		-C ${CMAKE_CURRENT_BINARY_DIR} pmdefaults
+		WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+	add_custom_target(pmdefaults.jar ALL
+		DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/pmdefaults.jar)

     # install the libraries (Linux only)
-    INSTALL(FILES ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pmdefaults.jar
-      DESTINATION /usr/share/java)
-    INSTALL(PROGRAMS ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pmdefaults
-      DESTINATION /usr/local/bin)
+    INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/pmdefaults.jar
+      DESTINATION ${JAR_INSTALL_DIR})
+    INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/pmdefaults/pmdefaults
+      DESTINATION bin)
   endif(APPLE)
 endif(UNIX)
 # In windows, use pm_java/make.bat
--- portmidi/pm_test/CMakeLists.txt
+++ portmidi/pm_test/CMakeLists.txt
@@ -12,8 +12,8 @@

 macro(make_a_test name)
   add_executable(${name} ${name}.c)
-  target_link_libraries(${name} portmidi-static ${PM_NEEDED_LIBS})
-  add_dependencies(${name} portmidi-static)
+  target_link_libraries(${name} portmidi ${PM_NEEDED_LIBS})
+  add_dependencies(${name} portmidi)
 endmacro(make_a_test)

 make_a_test(test)


code:
From 223c82d1d6ed1f29f26307249827ff679e09c780 Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
Date: Sat, 28 Jul 2018 12:22:12 +0200
Subject: [PATCH] disable resolve_symlink

---
 src/common/exec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/common/exec.c b/src/common/exec.c
index 878fc29..6b3e283 100644
--- a/src/common/exec.c
+++ b/src/common/exec.c
@@ -218,6 +218,8 @@ find_my_exec(const char *argv0, char *retpath)
 static int
 resolve_symlinks(char *path)
 {
+	// On GuixSD we *want* stuff relative to symlinks.
+	return 0;
 #ifdef HAVE_READLINK
 	struct stat buf;
 	char		orig_wd[MAXPGPATH],
--
2.18.0


code:
From 951f2269f67d618d376656db831796c119f4f6b3 Mon Sep 17 00:00:00 2001
From: Leo Prikler <leo.prikler@student.tugraz.at>
Date: Fri, 26 Jun 2020 18:20:04 +0200
Subject: [PATCH] ppsspp: disable upgrade and gold

---
 Core/Config.cpp             | 11 -------
 Core/Config.h               |  2 --
 Qt/QtMain.cpp               |  6 ----
 SDL/SDLMain.cpp             |  6 ----
 UI/DevScreens.cpp           |  3 --
 UI/GameSettingsScreen.cpp   |  1 -
 UI/MainScreen.cpp           | 63 +------------------------------------
 UI/MiscScreens.cpp          | 31 ++----------------
 UWP/PPSSPP_UWPMain.cpp      |  6 ----
 Windows/MainWindowMenu.cpp  |  2 +-
 Windows/main.cpp            |  6 ----
 android/jni/app-android.cpp |  6 ----
 12 files changed, 5 insertions(+), 138 deletions(-)

diff --git a/Core/Config.cpp b/Core/Config.cpp
index 214aeb433..04e3b151d 100644
--- a/Core/Config.cpp
+++ b/Core/Config.cpp
@@ -428,7 +428,6 @@ static ConfigSetting generalSettings[] = {
 	ConfigSetting("IgnoreBadMemAccess", &g_Config.bIgnoreBadMemAccess, true, true),
 	ConfigSetting("CurrentDirectory", &g_Config.currentDirectory, ""),
 	ConfigSetting("ShowDebuggerOnLoad", &g_Config.bShowDebuggerOnLoad, false),
-	ConfigSetting("CheckForNewVersion", &g_Config.bCheckForNewVersion, true),
 	ConfigSetting("Language", &g_Config.sLanguageIni, &DefaultLangRegion),
 	ConfigSetting("ForceLagSync2", &g_Config.bForceLagSync, false, true, true),
 	ConfigSetting("DiscordPresence", &g_Config.bDiscordPresence, true, true, false),  // Or maybe it makes sense to have it per-game? Race conditions abound...
@@ -1229,16 +1228,6 @@ void Config::Load(const char *iniFileName, const char *controllerIniFilename) {
 		upgradeMessage = "";
 	}

-	// Check for new version on every 10 runs.
-	// Sometimes the download may not be finished when the main screen shows (if the user dismisses the
-	// splash screen quickly), but then we'll just show the notification next time instead, we store the
-	// upgrade number in the ini.
-	if (iRunCount % 10 == 0 && bCheckForNewVersion) {
-		std::shared_ptr<http::Download> dl = g_DownloadManager.StartDownloadWithCallback(
-			"http://www.ppsspp.org/version.json", "", &DownloadCompletedCallback);
-		dl->SetHidden(true);
-	}
-
 	INFO_LOG(LOADER, "Loading controller config: %s", controllerIniFilename_.c_str());
 	bSaveSettings = true;

diff --git a/Core/Config.h b/Core/Config.h
index 084eacc94..e7134cab5 100644
--- a/Core/Config.h
+++ b/Core/Config.h
@@ -99,7 +99,6 @@ struct Config {
 	bool bIgnoreBadMemAccess;
 	bool bFastMemory;
 	int iCpuCore;
-	bool bCheckForNewVersion;
 	bool bForceLagSync;
 	bool bFuncReplacements;
 	bool bHideSlowWarnings;
@@ -521,4 +520,3 @@ std::string CreateRandMAC();
 // TODO: Find a better place for this.
 extern http::Downloader g_DownloadManager;
 extern Config g_Config;
-
diff --git a/Qt/QtMain.cpp b/Qt/QtMain.cpp
index 7713b6587..1d92d1175 100644
--- a/Qt/QtMain.cpp
+++ b/Qt/QtMain.cpp
@@ -194,12 +194,6 @@ bool System_GetPropertyBool(SystemProperty prop) {
 		return true;
 	case SYSPROP_HAS_FILE_BROWSER:
 		return true;
-	case SYSPROP_APP_GOLD:
-#ifdef GOLD
-		return true;
-#else
-		return false;
-#endif
 	default:
 		return false;
 	}
diff --git a/SDL/SDLMain.cpp b/SDL/SDLMain.cpp
index 52028d087..d8697d210 100644
--- a/SDL/SDLMain.cpp
+++ b/SDL/SDLMain.cpp
@@ -356,12 +356,6 @@ bool System_GetPropertyBool(SystemProperty prop) {
 	switch (prop) {
 	case SYSPROP_HAS_BACK_BUTTON:
 		return true;
-	case SYSPROP_APP_GOLD:
-#ifdef GOLD
-		return true;
-#else
-		return false;
-#endif
 	default:
 		return false;
 	}
diff --git a/UI/DevScreens.cpp b/UI/DevScreens.cpp
index f146d099e..625ee124c 100644
--- a/UI/DevScreens.cpp
+++ b/UI/DevScreens.cpp
@@ -603,9 +603,6 @@ void SystemInfoScreen::CreateViews() {
 #ifdef _M_SSE
 	buildConfig->Add(new InfoItem("_M_SSE", StringFromFormat("0x%x", _M_SSE)));
 #endif
-	if (System_GetPropertyBool(SYSPROP_APP_GOLD)) {
-		buildConfig->Add(new InfoItem("GOLD", ""));
-	}

 	ViewGroup *cpuExtensionsScroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, FILL_PARENT));
 	cpuExtensionsScroll->SetTag("DevSystemInfoCPUExt");
diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp
index 8202870c7..81112f822 100644
--- a/UI/GameSettingsScreen.cpp
+++ b/UI/GameSettingsScreen.cpp
@@ -796,7 +796,6 @@ void GameSettingsScreen::CreateViews() {
 	}
 #endif

-	systemSettings->Add(new CheckBox(&g_Config.bCheckForNewVersion, sy->T("VersionCheck", "Check for new versions of PPSSPP")));
 	const std::string bgPng = GetSysDirectory(DIRECTORY_SYSTEM) + "background.png";
 	const std::string bgJpg = GetSysDirectory(DIRECTORY_SYSTEM) + "background.jpg";
 	if (File::Exists(bgPng) || File::Exists(bgJpg)) {
diff --git a/UI/MainScreen.cpp b/UI/MainScreen.cpp
index 43535913d..36834020d 100644
--- a/UI/MainScreen.cpp
+++ b/UI/MainScreen.cpp
@@ -1054,11 +1054,7 @@ void MainScreen::CreateViews() {
 	sprintf(versionString, "%s", PPSSPP_GIT_VERSION);
 	rightColumnItems->SetSpacing(0.0f);
 	LinearLayout *logos = new LinearLayout(ORIENT_HORIZONTAL);
-	if (System_GetPropertyBool(SYSPROP_APP_GOLD)) {
-		logos->Add(new ImageView(ImageID("I_ICONGOLD"), IS_DEFAULT, new AnchorLayoutParams(64, 64, 10, 10, NONE, NONE, false)));
-	} else {
-		logos->Add(new ImageView(ImageID("I_ICON"), IS_DEFAULT, new AnchorLayoutParams(64, 64, 10, 10, NONE, NONE, false)));
-	}
+	logos->Add(new ImageView(ImageID("I_ICON"), IS_DEFAULT, new AnchorLayoutParams(64, 64, 10, 10, NONE, NONE, false)));
 	logos->Add(new ImageView(ImageID("I_LOGO"), IS_DEFAULT, new LinearLayoutParams(Margins(-12, 0, 0, 0))));
 	rightColumnItems->Add(logos);
 	TextView *ver = rightColumnItems->Add(new TextView(versionString, new LinearLayoutParams(Margins(70, -6, 0, 0))));
@@ -1070,11 +1066,6 @@ void MainScreen::CreateViews() {
 	rightColumnItems->Add(new Choice(mm->T("Game Settings", "Settings")))->OnClick.Handle(this, &MainScreen::OnGameSettings);
 	rightColumnItems->Add(new Choice(mm->T("Credits")))->OnClick.Handle(this, &MainScreen::OnCredits);
 	rightColumnItems->Add(new Choice(mm->T("www.ppsspp.org")))->OnClick.Handle(this, &MainScreen::OnPPSSPPOrg);
-	if (!System_GetPropertyBool(SYSPROP_APP_GOLD)) {
-		Choice *gold = rightColumnItems->Add(new Choice(mm->T("Buy PPSSPP Gold")));
-		gold->OnClick.Handle(this, &MainScreen::OnSupport);
-		gold->SetIcon(ImageID("I_ICONGOLD"));
-	}

 #if !PPSSPP_PLATFORM(UWP)
 	// Having an exit button is against UWP guidelines.
@@ -1099,28 +1090,6 @@ void MainScreen::CreateViews() {
 	} else if (tabHolder_->GetVisibility() != V_GONE) {
 		root_->SetDefaultFocusView(tabHolder_);
 	}
-
-	auto u = GetI18NCategory("Upgrade");
-
-	upgradeBar_ = 0;
-	if (!g_Config.upgradeMessage.empty()) {
-		upgradeBar_ = new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT));
-
-		UI::Margins textMargins(10, 5);
-		UI::Margins buttonMargins(0, 0);
-		UI::Drawable solid(0xFFbd9939);
-		upgradeBar_->SetBG(solid);
-		upgradeBar_->Add(new TextView(u->T("New version of PPSSPP available") + std::string(": ") + g_Config.upgradeVersion, new LinearLayoutParams(1.0f, textMargins)));
-		upgradeBar_->Add(new Button(u->T("Download"), new LinearLayoutParams(buttonMargins)))->OnClick.Handle(this, &MainScreen::OnDownloadUpgrade);
-		upgradeBar_->Add(new Button(u->T("Dismiss"), new LinearLayoutParams(buttonMargins)))->OnClick.Handle(this, &MainScreen::OnDismissUpgrade);
-
-		// Slip in under root_
-		LinearLayout *newRoot = new LinearLayout(ORIENT_VERTICAL);
-		newRoot->Add(root_);
-		newRoot->Add(upgradeBar_);
-		root_->ReplaceLayoutParams(new LinearLayoutParams(1.0));
-		root_ = newRoot;
-	}
 }

 UI::EventReturn MainScreen::OnAllowStorage(UI::EventParams &e) {
@@ -1128,27 +1097,6 @@ UI::EventReturn MainScreen::OnAllowStorage(UI::EventParams &e) {
 	return UI::EVENT_DONE;
 }

-UI::EventReturn MainScreen::OnDownloadUpgrade(UI::EventParams &e) {
-#if PPSSPP_PLATFORM(ANDROID)
-	// Go to app store
-	if (System_GetPropertyBool(SYSPROP_APP_GOLD)) {
-		LaunchBrowser("market://details?id=org.ppsspp.ppssppgold");
-	} else {
-		LaunchBrowser("market://details?id=org.ppsspp.ppsspp");
-	}
-#else
-	// Go directly to ppsspp.org and let the user sort it out
-	LaunchBrowser("https://www.ppsspp.org/downloads.html");
-#endif
-	return UI::EVENT_DONE;
-}
-
-UI::EventReturn MainScreen::OnDismissUpgrade(UI::EventParams &e) {
-	g_Config.DismissUpgrade();
-	upgradeBar_->SetVisibility(UI::V_GONE);
-	return UI::EVENT_DONE;
-}
-
 void MainScreen::sendMessage(const char *message, const char *value) {
 	// Always call the base class method first to handle the most common messages.
 	UIScreenWithBackground::sendMessage(message, value);
@@ -1319,15 +1267,6 @@ UI::EventReturn MainScreen::OnCredits(UI::EventParams &e) {
 	return UI::EVENT_DONE;
 }

-UI::EventReturn MainScreen::OnSupport(UI::EventParams &e) {
-#ifdef __ANDROID__
-	LaunchBrowser("market://details?id=org.ppsspp.ppssppgold");
-#else
-	LaunchBrowser("https://central.ppsspp.org/buygold");
-#endif
-	return UI::EVENT_DONE;
-}
-
 UI::EventReturn MainScreen::OnPPSSPPOrg(UI::EventParams &e) {
 	LaunchBrowser("https://www.ppsspp.org");
 	return UI::EVENT_DONE;
diff --git a/UI/MiscScreens.cpp b/UI/MiscScreens.cpp
index a6542c65d..f5f101594 100644
--- a/UI/MiscScreens.cpp
+++ b/UI/MiscScreens.cpp
@@ -498,11 +498,7 @@ void LogoScreen::render() {
 	char temp[256];
 	// Manually formatting UTF-8 is fun.  \xXX doesn't work everywhere.
 	snprintf(temp, sizeof(temp), "%s Henrik Rydg%c%crd", cr->T("created", "Created by"), 0xC3, 0xA5);
-	if (System_GetPropertyBool(SYSPROP_APP_GOLD)) {
-		dc.Draw()->DrawImage(ImageID("I_ICONGOLD"), bounds.centerX() - 120, bounds.centerY() - 30, 1.2f, textColor, ALIGN_CENTER);
-	} else {
-		dc.Draw()->DrawImage(ImageID("I_ICON"), bounds.centerX() - 120, bounds.centerY() - 30, 1.2f, textColor, ALIGN_CENTER);
-	}
+	dc.Draw()->DrawImage(ImageID("I_ICON"), bounds.centerX() - 120, bounds.centerY() - 30, 1.2f, textColor, ALIGN_CENTER);
 	dc.Draw()->DrawImage(ImageID("I_LOGO"), bounds.centerX() + 40, bounds.centerY() - 30, 1.5f, textColor, ALIGN_CENTER);
 	//dc.Draw()->DrawTextShadow(UBUNTU48, "PPSSPP", xres / 2, yres / 2 - 30, textColor, ALIGN_CENTER);
 	dc.SetFontScale(1.0f, 1.0f);
@@ -538,10 +534,6 @@ void CreditsScreen::CreateViews() {
 	// Really need to redo this whole layout with some linear layouts...

 	int rightYOffset = 0;
-	if (!System_GetPropertyBool(SYSPROP_APP_GOLD)) {
-		root_->Add(new Button(cr->T("Buy Gold"), new AnchorLayoutParams(260, 64, NONE, NONE, 10, 84, false)))->OnClick.Handle(this, &CreditsScreen::OnSupport);
-		rightYOffset = 74;
-	}
 	root_->Add(new Button(cr->T("PPSSPP Forums"), new AnchorLayoutParams(260, 64, 10, NONE, NONE, 158, false)))->OnClick.Handle(this, &CreditsScreen::OnForums);
 	root_->Add(new Button(cr->T("Discord"), new AnchorLayoutParams(260, 64, 10, NONE, NONE, 232, false)))->OnClick.Handle(this, &CreditsScreen::OnDiscord);
 	root_->Add(new Button("www.ppsspp.org", new AnchorLayoutParams(260, 64, 10, NONE, NONE, 10, false)))->OnClick.Handle(this, &CreditsScreen::OnPPSSPPOrg);
@@ -550,20 +542,7 @@ void CreditsScreen::CreateViews() {
 #if PPSSPP_PLATFORM(ANDROID) || PPSSPP_PLATFORM(IOS)
 	root_->Add(new Button(cr->T("Share PPSSPP"), new AnchorLayoutParams(260, 64, NONE, NONE, 10, rightYOffset + 158, false)))->OnClick.Handle(this, &CreditsScreen::OnShare);
 #endif
-	if (System_GetPropertyBool(SYSPROP_APP_GOLD)) {
-		root_->Add(new ImageView(ImageID("I_ICONGOLD"), IS_DEFAULT, new AnchorLayoutParams(100, 64, 10, 10, NONE, NONE, false)));
-	} else {
-		root_->Add(new ImageView(ImageID("I_ICON"), IS_DEFAULT, new AnchorLayoutParams(100, 64, 10, 10, NONE, NONE, false)));
-	}
-}
-
-UI::EventReturn CreditsScreen::OnSupport(UI::EventParams &e) {
-#ifdef __ANDROID__
-	LaunchBrowser("market://details?id=org.ppsspp.ppssppgold");
-#else
-	LaunchBrowser("https://central.ppsspp.org/buygold");
-#endif
-	return UI::EVENT_DONE;
+	root_->Add(new ImageView(ImageID("I_ICON"), IS_DEFAULT, new AnchorLayoutParams(100, 64, 10, 10, NONE, NONE, false)));
 }

 UI::EventReturn CreditsScreen::OnTwitter(UI::EventParams &e) {
@@ -747,11 +726,7 @@ void CreditsScreen::render() {

 	// TODO: This is kinda ugly, done on every frame...
 	char temp[256];
-	if (System_GetPropertyBool(SYSPROP_APP_GOLD)) {
-		snprintf(temp, sizeof(temp), "PPSSPP Gold %s", PPSSPP_GIT_VERSION);
-	} else {
-		snprintf(temp, sizeof(temp), "PPSSPP %s", PPSSPP_GIT_VERSION);
-	}
+	snprintf(temp, sizeof(temp), "PPSSPP %s", PPSSPP_GIT_VERSION);
 	credits[0] = (const char *)temp;

 	UIContext &dc = *screenManager()->getUIContext();
diff --git a/UWP/PPSSPP_UWPMain.cpp b/UWP/PPSSPP_UWPMain.cpp
index 24f3b964d..1d66ba7ee 100644
--- a/UWP/PPSSPP_UWPMain.cpp
+++ b/UWP/PPSSPP_UWPMain.cpp
@@ -399,12 +399,6 @@ bool System_GetPropertyBool(SystemProperty prop) {
 		return false;
 	case SYSPROP_HAS_BACK_BUTTON:
 		return true;
-	case SYSPROP_APP_GOLD:
-#ifdef GOLD
-		return true;
-#else
-		return false;
-#endif
 	default:
 		return false;
 	}
diff --git a/Windows/MainWindowMenu.cpp b/Windows/MainWindowMenu.cpp
index b5e1bb0eb..71b29b48a 100644
--- a/Windows/MainWindowMenu.cpp
+++ b/Windows/MainWindowMenu.cpp
@@ -1377,7 +1377,7 @@ namespace MainWindow {
 		{
 			W32Util::CenterWindow(hDlg);
 			HWND versionBox = GetDlgItem(hDlg, IDC_VERSION);
-			std::string windowText = System_GetPropertyBool(SYSPROP_APP_GOLD) ? "PPSSPP Gold " : "PPSSPP ";
+			std::string windowText = "PPSSPP ";
 			windowText.append(PPSSPP_GIT_VERSION);
 			SetWindowText(versionBox, ConvertUTF8ToWString(windowText).c_str());
 		}
diff --git a/Windows/main.cpp b/Windows/main.cpp
index 3795597e2..fd98d0453 100644
--- a/Windows/main.cpp
+++ b/Windows/main.cpp
@@ -268,12 +268,6 @@ bool System_GetPropertyBool(SystemProperty prop) {
 		return true;
 	case SYSPROP_HAS_BACK_BUTTON:
 		return true;
-	case SYSPROP_APP_GOLD:
-#ifdef GOLD
-		return true;
-#else
-		return false;
-#endif
 	default:
 		return false;
 	}
diff --git a/android/jni/app-android.cpp b/android/jni/app-android.cpp
index 086371085..0a340c0ae 100644
--- a/android/jni/app-android.cpp
+++ b/android/jni/app-android.cpp
@@ -372,12 +372,6 @@ bool System_GetPropertyBool(SystemProperty prop) {
 		return true;
 	case SYSPROP_HAS_IMAGE_BROWSER:
 		return true;
-	case SYSPROP_APP_GOLD:
-#ifdef GOLD
-		return true;
-#else
-		return false;
-#endif
 	default:
 		return false;
 	}
--
2.26.2


code:
Fixes CVE-2014-3618 (heap overflow in formisc.c allowing denial of
service and potential remote execution of arbitrary code).
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-3618

Source:
http://seclists.org/oss-sec/2014/q3/495

Adopted by Debian as patch '27':
https://sources.debian.net/src/procmail/3.22-25/debian/patches/27/

--- a/src/formisc.c
+++ b/src/formisc.c
@@ -84,12 +84,11 @@
 	case '"':*target++=delim='"';start++;
       }
      ;{ int i;
-	do
+	while(*start)
 	   if((i= *target++= *start++)==delim)	 /* corresponding delimiter? */
 	      break;
 	   else if(i=='\\'&&*start)		    /* skip quoted character */
 	      *target++= *start++;
-	while(*start);						/* anything? */
       }
      hitspc=2;
    }


code:
Fix CVE-2017-16844:

https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-16844
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=876511

Patch copied from Debian procmail package 3.22-26:

http://http.debian.net/debian/pool/main/p/procmail/procmail_3.22-26.debian.tar.xz

From: Santiago Vila <sanvila@debian.org>
Subject: Fix heap-based buffer overflow in loadbuf()
Bug-Debian: http://bugs.debian.org/876511
X-Debian-version: 3.22-26

--- a/src/formisc.c
+++ b/src/formisc.c
@@ -103,7 +103,7 @@
 }
 							    /* append to buf */
 void loadbuf(text,len)const char*const text;const size_t len;
-{ if(buffilled+len>buflen)			  /* buf can't hold the text */
+{ while(buffilled+len>buflen)			  /* buf can't hold the text */
      buf=realloc(buf,buflen+=Bsize);
   tmemmove(buf+buffilled,text,len);buffilled+=len;
 }


code:
Rename getline() to procmail_getline() to avoid namespace clash with
POSIX getline(). Fixes FTBFS.

Copied from Debian:
http://sources.debian.net/src/procmail/3.22-24/debian/patches/24/

References:
http://bugs.debian.org/549426

--- a/src/fields.c
+++ b/src/fields.c
@@ -110,16 +110,16 @@
 		    /* try and append one valid field to rdheader from stdin */
 int readhead P((void))
 { int idlen;
-  getline();
+  procmail_getline();
   if((idlen=breakfield(buf,buffilled))<=0) /* not the start of a valid field */
      return 0;
   if(idlen==STRLEN(FROM)&&eqFrom_(buf))			/* it's a From_ line */
    { if(rdheader)
 	return 0;			       /* the From_ line was a fake! */
-     for(;buflast=='>';getline());	    /* gather continued >From_ lines */
+     for(;buflast=='>';procmail_getline());	    /* gather continued >From_ lines */
    }
   else
-     for(;;getline())		      /* get the rest of the continued field */
+     for(;;procmail_getline())		      /* get the rest of the continued field */
       { switch(buflast)			     /* will this line be continued? */
 	 { case ' ':case '\t':				  /* yep, it sure is */
 	      continue;
--- a/src/formail.c
+++ b/src/formail.c
@@ -819,7 +819,7 @@
       { if(split)		       /* gobble up the next start separator */
 	 { buffilled=0;
 #ifdef sMAILBOX_SEPARATOR
-	   getline();buffilled=0;		 /* but only if it's defined */
+	   procmail_getline();buffilled=0;		 /* but only if it's defined */
 #endif
 	   if(buflast!=EOF)					   /* if any */
 	      goto splitit;
--- a/src/formisc.c
+++ b/src/formisc.c
@@ -115,7 +115,7 @@
   buf[buffilled++]=c;
 }

-int getline P((void))			   /* read a newline-terminated line */
+int procmail_getline P((void))			   /* read a newline-terminated line */
 { if(buflast==EOF)			 /* at the end of our Latin already? */
    { loadchar('\n');					  /* fake empty line */
      return EOF;					  /* spread the word */
--- a/src/formisc.h
+++ b/src/formisc.h
@@ -17,4 +17,4 @@
 char*
  skipwords P((char*start));
 int
- getline P((void));
+ procmail_getline P((void));


code:
The test suite of PRoot makes many FHS assumptions, such as assuming
that /bin, /bin/true, and /usr exist.  This patch fixes these assumptions.

--- source/tests/GNUmakefile	2017-05-11 15:26:36.899115484 +0200
+++ source/tests/GNUmakefile	2017-05-11 15:26:46.143063166 +0200
@@ -121,7 +121,7 @@ $(ROOTFS_DIR):
 setup: $(ROOTFS_BIN)

 $(ROOTFS)/bin/abs-true:
-	@ln -fs /bin/true $@
+	@ln -fs `which true`  $@

 $(ROOTFS)/bin/rel-true:
 	@ln -fs ./true $@

--- source/tests/test-d2175fc3.sh	2017-05-11 15:36:53.727617010 +0200
+++ source/tests/test-d2175fc3.sh	2017-05-11 15:37:10.155523637 +0200
@@ -2,8 +2,8 @@ if [ ! -x  ${ROOTFS}/bin/readlink ] || [
     exit 125;
 fi

-${PROOT} -r ${ROOTFS} /bin/readlink /bin/abs-true | grep '^/bin/true$'
+${PROOT} -r ${ROOTFS} /bin/readlink /bin/abs-true | grep "`which true`"
 ${PROOT} -r ${ROOTFS} /bin/readlink /bin/rel-true | grep '^\./true$'

-${PROOT} -b /:/host-rootfs -r ${ROOTFS} /bin/readlink /bin/abs-true | grep '^/bin/true$'
+${PROOT} -b /:/host-rootfs -r ${ROOTFS} /bin/readlink /bin/abs-true | grep "`which true`"
 ${PROOT} -b /:/host-rootfs -r ${ROOTFS} /bin/readlink /bin/rel-true | grep '^./true$'

--- source/tests/test-d1be631a.sh	2017-05-11 15:41:36.458008715 +0200
+++ source/tests/test-d1be631a.sh	2017-05-11 15:41:38.921994686 +0200
@@ -1,4 +1,4 @@
-if [ -z `which mknod`] || [ `id -u` -eq 0 ]; then
+if [ -z `which mknod` ] || [ `id -u` -eq 0 ]; then
     exit 125;
 fi

--- source/tests/test-5bed7141.c	2017-05-11 15:34:23.088472743 +0200
+++ source/tests/test-5bed7141.c	2017-05-11 15:34:27.052450235 +0200
@@ -80,7 +80,7 @@ int main(int argc, char *argv[])
 		exit(EXIT_FAILURE);

 	case 0: /* child */
-		status = chdir("/usr");
+		status = chdir("/gnu");
 		if (status < 0) {
 			perror("chdir");
 			exit(EXIT_FAILURE);

--- a/tests/test-092c5e26.sh
+++ b/tests/test-092c5e26.sh
@@ -24,7 +24,7 @@ fi

 unset LD_LIBRARY_PATH

-env PROOT_FORCE_FOREIGN_BINARY=1 PATH=/tmp:/bin:/usr/bin ${PROOT} -r ${ROOTFS} -q echo ${TMP} | grep "^-U LD_LIBRARY_PATH ${EXTRA}-0 /bin/argv0 /bin/argv0 ${TMP_ABS}$"
+env PROOT_FORCE_FOREIGN_BINARY=1 PATH=/tmp:/bin:/usr/bin:$(dirname $(which echo)) ${PROOT} -r ${ROOTFS} -q echo ${TMP} | grep "^-U LD_LIBRARY_PATH ${EXTRA}-0 /bin/argv0 /bin/argv0 ${TMP_ABS}$"
 env PROOT_FORCE_FOREIGN_BINARY=1 ${PROOT} -r ${ROOTFS} -q echo ${TMP_ABS} | grep "^-U LD_LIBRARY_PATH ${EXTRA}-0 /bin/argv0 /bin/argv0 ${TMP_ABS}$"

 cat > ${ROOTFS}/${TMP_ABS} <<EOF
@@ -34,7 +34,7 @@ chmod +x ${ROOTFS}/${TMP_ABS}

 # Valgrind prepends "/bin/sh" in front of foreign binaries.
 if ! $(echo ${PROOT} | grep -q valgrind); then
-    env PATH=/tmp:/bin:/usr/bin ${PROOT} -r ${ROOTFS} -q echo ${TMP} | grep "^-U LD_LIBRARY_PATH -0 ${TMP} ${TMP_ABS}$"
+    env PATH=/tmp:/bin:/usr/bin:$(dirname $(which echo)) ${PROOT} -r ${ROOTFS} -q echo ${TMP} | grep "^-U LD_LIBRARY_PATH -0 ${TMP} ${TMP_ABS}$"
     ${PROOT} -r ${ROOTFS} -q echo ${TMP_ABS}                | grep "^-U LD_LIBRARY_PATH -0 ${TMP_ABS} ${TMP_ABS}$"
 fi

diff --git a/tests/test-5467b986.sh b/tests/test-5467b986.sh
index c6ac71a..f616f1e 100644
--- a/tests/test-5467b986.sh
+++ b/tests/test-5467b986.sh
@@ -30,8 +30,8 @@ ${PROOT} -v -1 -b /tmp:/b -b /tmp:/a -r ${ROOTFS} fchdir_getcwd /b | grep '^/[ab
 ! ${PROOT} -w /bin -r ${ROOTFS} fchdir_getcwd true
 [ $? -eq 0 ]

-${PROOT} -v -1 -w /usr -r / ${ROOTFS}/bin/chdir_getcwd share  | grep '^/usr/share$'
-${PROOT} -v -1 -w /usr -r / ${ROOTFS}/bin/fchdir_getcwd share | grep '^/usr/share$'
+${PROOT} -v -1 -w /gnu -r / ${ROOTFS}/bin/chdir_getcwd store  | grep '^/gnu/store$'
+${PROOT} -v -1 -w /gnu -r / ${ROOTFS}/bin/fchdir_getcwd store | grep '^/gnu/store$'

-(cd /; ${PROOT} -v -1 -w usr -r / ${ROOTFS}/bin/chdir_getcwd share  | grep '^/usr/share$')
-(cd /; ${PROOT} -v -1 -w usr -r / ${ROOTFS}/bin/fchdir_getcwd share | grep '^/usr/share$')
+(cd /; ${PROOT} -v -1 -w gnu -r / ${ROOTFS}/bin/chdir_getcwd store  | grep '^/gnu/store$')
+(cd /; ${PROOT} -v -1 -w gnu -r / ${ROOTFS}/bin/fchdir_getcwd store | grep '^/gnu/store$')

--- a/tests/test-c15999f9.sh
+++ b/tests/test-c15999f9.sh
@@ -5,7 +5,7 @@ fi
 TMP=/tmp/$(mcookie)
 mkdir ${TMP}

-${PROOT} -b /bin/true:${TMP}/true /bin/true
+${PROOT} -b `which true`:${TMP}/true `which true`
 ! test -e ${TMP}/true
 [ $? -eq 0 ]


code:
Use 'uname -m', which in practice returns the processor architecture.

--- psm-3.3/buildflags.mak~	2014-08-20 21:00:18.000000000 +0100
+++ psm-3.3/buildflags.mak	2017-10-22 12:02:12.855291447 +0100
@@ -38,7 +38,7 @@
 endif

 export os ?= $(shell uname -s | tr '[A-Z]' '[a-z]')
-export arch := $(shell uname -p | sed -e 's,\(i[456]86\|athlon$$\),i386,')
+export arch := $(shell uname -m | sed -e 's,\(i[456]86\|athlon$$\),i386,')

 CC ?= gcc


code:
The memory statistics code leads to segfaults during initialization (on
machines with InfiniPath networking):

  (gdb) bt full
  #0  ips_ptl_init (ep=0x1fc6af8, ptl=0x1fc6f88, ctl=0x1fc6d78) at ptl.c:224
	  err = PSM_OK
	  num_of_send_bufs = 1024
	  num_of_send_desc = 4096
	  imm_size = 128
	  context = 0x1fc6b70
	  user_info = 0x1fc6b90
	  enable_shcontexts = 0
	  current_count = <optimized out>
  #1  0x00007fb2aa672abf in __psm_ep_open_internal (
      unique_job_key=unique_job_key@entry=0x7ffed1ee5800 "<\207\020#5\271\267\200\354x\242e8\364zo",
      devid_enabled=devid_enabled@entry=0x7ffed1ee5724, opts_i=opts_i@entry=0x7ffed1ee5810, mq=<optimized out>,
      epo=epo@entry=0x7ffed1ee5710, epido=epido@entry=0x7ffed1ee5708) at psm_ep.c:929
	  ep = 0x1fc6af8
	  num_units = 1
	  len = <optimized out>
	  err = <optimized out>
	  epaddr = 0x1e9dd78
	  buf = "miriel044:2.0.", '\000' <repeats 113 times>
	  p = <optimized out>
	  e = <optimized out>
	  old_cpuaff = 0x0
	  old_unit = 0x0
	  yield_cnt = {e_void = 0xfa, e_str = 0xfa <error: Cannot access memory at address 0xfa>, e_int = 250,
	    e_uint = 250, e_long = 250, e_ulong = 250, e_ulonglong = 250}
	  no_cpuaff = {e_void = 0x0, e_str = 0x0, e_int = 0, e_uint = 0, e_long = 0, e_ulong = 0, e_ulonglong = 0}
	  env_unit_id = {e_void = 0xffffffffffffffff,
	    e_str = 0xffffffffffffffff <error: Cannot access memory at address 0xffffffffffffffff>, e_int = -1,
	    e_uint = 4294967295, e_long = -1, e_ulong = 18446744073709551615, e_ulonglong = 18446744073709551615}
	  env_port_id = {e_void = 0x0, e_str = 0x0, e_int = 0, e_uint = 0, e_long = 0, e_ulong = 0, e_ulonglong = 0}
	  env_sl = {e_void = 0x0, e_str = 0x0, e_int = 0, e_uint = 0, e_long = 0, e_ulong = 0, e_ulonglong = 0}
	  ptl_sizes = <optimized out>
	  default_cpuaff = <optimized out>
	  opts = {timeout = 180000000000, unit = -1, affinity = 0, shm_mbytes = 10, sendbufs_num = 1024,
	    network_pkey = 65535, port = 0, outsl = 0, service_id = 1152940698815692800,
	    path_res_type = PSM_PATH_RES_NONE, senddesc_num = 4096, imm_size = 128}
	  amsh_ptl = 0x1fc6e48
	  ips_ptl = 0x1fc6f88
	  self_ptl = 0x1fc99c8
	  i = 3

It looks like ptl.c:24 is writing past the region that was malloc'd.

Turning stats off solves the problem.

diff --git a/psm_utils.c b/psm_utils.c
index c8651fe..5514921 100644
--- a/psm_utils.c
+++ b/psm_utils.c
@@ -1058,7 +1058,7 @@ psmi_log_memstats(psmi_memtype_t type, int64_t nbytes)
     return;
 }

-#define psmi_stats_mask PSMI_STATSTYPE_MEMORY
+#define psmi_stats_mask 0

 #ifdef malloc
 #undef malloc


code:
Add missing flags.

--- psm-3.3/ipath/Makefile~	1970-01-01 01:00:00.000000000 +0100
+++ psm-3.3/ipath/Makefile	2017-10-22 15:10:10.269177711 +0100
@@ -73,7 +73,7 @@
 ${TARGLIB}.so.${MAJOR}.${MINOR}: ${${TARGLIB}-objs}
 	date +'static __attribute__ ((unused)) char __psc_infinipath_revision[] ="$$""Date: %F %R ${rpm_extra_description}InfiniPath $$";' > _revision.c
 	$(CC) -c $(BASECFLAGS) $(INCLUDES) _revision.c -o _revision.o
-	$(CC) -o $@ -Wl,-soname=${TARGLIB}.so.${MAJOR} -shared \
+	$(CC) -o $@ -Wl,-soname=${TARGLIB}.so.${MAJOR} $(LDFLAGS) -shared \
 		-Wl,--unique='*fastpath*' \
 		${${TARGLIB}-objs} _revision.o $(LDFLAGS) $(if $(MIC:0=),$(SCIF_LINK_FLAGS))


code:
From <https://github.com/bmwiedemann/psm/commit/98acae1a6f2c9b2e6014eac4070a817c9d0fd8a2>.

From 98acae1a6f2c9b2e6014eac4070a817c9d0fd8a2 Mon Sep 17 00:00:00 2001
From: "Bernhard M. Wiedemann" <bwiedemann@suse.de>
Date: Sun, 23 Jul 2017 07:02:28 +0200
Subject: [PATCH] Allow to override build date

in order to make builds reproducible.
See https://reproducible-builds.org/ for why this is good
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.

Also uses UTC to be independent of timezone settings.
---
 Makefile       | 2 +-
 ipath/Makefile | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index d79c4bd..99406ef 100644
--- a/Makefile
+++ b/Makefile
@@ -270,7 +270,7 @@ ${TARGLIB}.so.${MAJOR}: ${TARGLIB}.so.${MAJOR}.${MINOR}
 # file around.  Generate it such that the ident command can find it
 # and strings -a | grep InfiniPath does a reasonable job as well.
 ${TARGLIB}.so.${MAJOR}.${MINOR}: ${${TARGLIB}-objs}
-	date +'char psmi_infinipath_revision[] ="$$""Date: %F %R ${rpm_extra_description}InfiniPath $$";' > ${lib_build_dir}/_revision.c
+	date -u -d@$${SOURCE_DATE_EPOCH:-$$(date +%s)} +'char psmi_infinipath_revision[] ="$$""Date: %F %R ${rpm_extra_description}InfiniPath $$";' > ${lib_build_dir}/_revision.c
 	$(CC) -c $(BASECFLAGS) $(INCLUDES) _revision.c -o _revision.o
 	$(CC) $(LDFLAGS) -o $@ -Wl,-soname=${TARGLIB}.so.${MAJOR} -shared -Wl,--unique='*fastpath*' \
 		${${TARGLIB}-objs} _revision.o -L$(build_dir)/ipath $(LDLIBS)
diff --git a/ipath/Makefile b/ipath/Makefile
index 8c2cc6e..73abd6f 100644
--- a/ipath/Makefile
+++ b/ipath/Makefile
@@ -70,7 +70,7 @@ ${TARGLIB}.so.${MAJOR}: ${TARGLIB}.so.${MAJOR}.${MINOR}
 # file around.  Generate it such that the ident command can find it
 # and strings -a | grep InfiniPath does a reasonable job as well.
 ${TARGLIB}.so.${MAJOR}.${MINOR}: ${${TARGLIB}-objs}
-	date +'static __attribute__ ((unused)) char __psc_infinipath_revision[] ="$$""Date: %F %R ${rpm_extra_description}InfiniPath $$";' > _revision.c
+	date -u -d@$${SOURCE_DATE_EPOCH:-$$(date +%s)} +'static __attribute__ ((unused)) char __psc_infinipath_revision[] ="$$""Date: %F %R ${rpm_extra_description}InfiniPath $$";' > _revision.c
 	$(CC) -c $(BASECFLAGS) $(INCLUDES) _revision.c -o _revision.o
 	$(CC) -o $@ -Wl,-soname=${TARGLIB}.so.${MAJOR} -shared \
 		-Wl,--unique='*fastpath*' \


code:
Avoid signed overflow during mult-s16-test which intermittently
failed.

Patch by Mark H Weaver <mhw@netris.org>.

--- pulseaudio-5.0/src/tests/mult-s16-test.c.orig	2014-01-23 13:57:55.000000000 -0500
+++ pulseaudio-5.0/src/tests/mult-s16-test.c	2014-10-24 03:13:46.464661815 -0400
@@ -55,7 +55,7 @@
 START_TEST (mult_s16_test) {
     int16_t samples[SAMPLES];
     int32_t volumes[SAMPLES];
-    int32_t sum1 = 0, sum2 = 0;
+    uint32_t sum1 = 0, sum2 = 0;
     int i;

     pa_random(samples, sizeof(samples));


code:
Increase the timeout on 'cpu-mix-test' to accommodate slower machines.

--- pulseaudio-6.0/src/tests/cpu-mix-test.c.ORIG	2015-02-12 09:10:35.000000000 -0500
+++ pulseaudio-6.0/src/tests/cpu-mix-test.c	2015-03-31 13:45:05.316878322 -0400
@@ -212,7 +212,7 @@
 #if defined (__arm__) && defined (__linux__) && defined (HAVE_NEON)
     tcase_add_test(tc, mix_neon_test);
 #endif
-    tcase_set_timeout(tc, 120);
+    tcase_set_timeout(tc, 240);
     suite_add_tcase(s, tc);

     sr = srunner_create(s);


code:
In case of 'AttributeError', 'value' is None, so do not try to
access it.
Submitted upstream.

--- pybugz-0.6.11/bugz.py	2006-09-02 14:35:37.000000000 +0200
+++ pybugz-0.6.11/bugz.py	2014-05-05 16:02:20.000000000 +0200
@@ -1249,9 +1254,9 @@ class PrettyBugz(Bugz):
         for field, name in FIELDS + MORE_FIELDS:
             try:
                 value = result.find('//%s' % field).text
+                print '%-12s: %s' % (name, value.encode(self.enc))
             except AttributeError:
                 continue
-            print '%-12s: %s' % (name, value.encode(self.enc))

         # Print out the cc'ed people
         cced = result.findall('.//cc')


code:
Gracefully deal with 'stty size' failures.
Submitted upstream.

--- pybugz-0.6.11/bugz.py	2006-09-02 14:35:37.000000000 +0200
+++ pybugz-0.6.11/bugz.py	2014-05-05 15:17:03.000000000 +0200
@@ -288,7 +288,12 @@ def get_cols():
     stty = which('stty')
     if stty:
         row_cols = commands.getoutput("%s size" % stty)
-        rows, cols = map(int, row_cols.split())
+        try:
+            rows, cols = map(int, row_cols.split())
+        except:
+            # In some cases 'stty size' will just fail with
+            # "Inappropriate ioctl for device".
+            cols = DEFAULT_NUM_COLS
         return cols
     else:
         return DEFAULT_NUM_COLS


code:
These tests require a gpg agent to run, and are difficult to get to work right
in Guix's environment.  For more details, see:
  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=713074
  https://bugs.launchpad.net/pygpgme/+bug/999949

--- pygpgme-0.3/tests/test_encrypt_decrypt.py	2012-02-28 19:10:28.000000000 -0800
+++ pygpgme-0.3/tests/test_encrypt_decrypt.py	2016-02-05 10:21:58.966685384 -0800
@@ -125,7 +125,7 @@
         ctx.decrypt(ciphertext, plaintext)
         self.assertEqual(plaintext.getvalue(), b'Hello World\n')

-    def test_encrypt_symmetric(self):
+    def skip_test_encrypt_symmetric(self):
         plaintext = BytesIO(b'Hello World\n')
         ciphertext = BytesIO()
         def passphrase(uid_hint, passphrase_info, prev_was_bad, fd):

--- pygpgme-0.3/tests/test_passphrase.py	2012-02-28 19:04:17.000000000 -0800
+++ pygpgme-0.3/tests/test_passphrase.py	2016-02-05 10:21:47.990630956 -0800
@@ -30,7 +30,7 @@

     import_keys = ['passphrase.pub', 'passphrase.sec']

-    def test_sign_without_passphrase_cb(self):
+    def skip_test_sign_without_passphrase_cb(self):
         ctx = gpgme.Context()
         key = ctx.get_key('EFB052B4230BBBC51914BCBB54DCBBC8DBFB9EB3')
         ctx.signers = [key]
@@ -51,7 +51,7 @@
         self.prev_was_bad = prev_was_bad
         os.write(fd, b'test\n')

-    def test_sign_with_passphrase_cb(self):
+    def skip_test_sign_with_passphrase_cb(self):
         ctx = gpgme.Context()
         key = ctx.get_key('EFB052B4230BBBC51914BCBB54DCBBC8DBFB9EB3')
         ctx.signers = [key]


code:
Fix a few testcases. Adapted from python-3-fix-tests.patch.

diff -Naur pypy3.6-v7.3.1-src.orig/lib-python/3/ctypes/test/test_callbacks.py pypy3.6-v7.3.1-src/lib-python/3/ctypes/test/test_callbacks.py
--- pypy3.6-v7.3.1-src.orig/lib-python/3/ctypes/test/test_callbacks.py	1970-01-01 01:00:01.000000000 +0100
+++ pypy3.6-v7.3.1-src/lib-python/3/ctypes/test/test_callbacks.py	2020-05-21 14:19:14.827288853 +0200
@@ -4,6 +4,7 @@
 from ctypes import *
 from ctypes.test import need_symbol
 import _ctypes_test
+import platform

 class Callbacks(unittest.TestCase):
     functype = CFUNCTYPE
@@ -178,6 +179,8 @@

         self.assertLess(diff, 0.01, "%s not less than 0.01" % diff)

+    @unittest.skipIf(platform.machine() in ['mips64'],
+                     "This test fails on this platform")
     def test_issue_8959_a(self):
         from ctypes.util import find_library
         libc_path = find_library("c")
diff -Naur pypy3.6-v7.3.1-src.orig/lib-python/3/ctypes/test/test_libc.py pypy3.6-v7.3.1-src/lib-python/3/ctypes/test/test_libc.py
--- pypy3.6-v7.3.1-src.orig/lib-python/3/ctypes/test/test_libc.py	1970-01-01 01:00:01.000000000 +0100
+++ pypy3.6-v7.3.1-src/lib-python/3/ctypes/test/test_libc.py	2020-05-21 14:19:14.827288853 +0200
@@ -2,6 +2,7 @@

 from ctypes import *
 import _ctypes_test
+import platform

 lib = CDLL(_ctypes_test.__file__)

@@ -17,6 +18,8 @@
         import math
         self.assertEqual(lib.my_sqrt(2.0), math.sqrt(2.0))

+    @unittest.skipIf(platform.machine() in ['mips64'],
+                     "This test fails on this platform")
     def test_qsort(self):
         comparefunc = CFUNCTYPE(c_int, POINTER(c_char), POINTER(c_char))
         lib.my_qsort.argtypes = c_void_p, c_size_t, c_size_t, comparefunc
diff -Naur pypy3.6-v7.3.1-src.orig/lib-python/3/distutils/tests/test_archive_util.py pypy3.6-v7.3.1-src/lib-python/3/distutils/tests/test_archive_util.py
--- pypy3.6-v7.3.1-src.orig/lib-python/3/distutils/tests/test_archive_util.py	1970-01-01 01:00:01.000000000 +0100
+++ pypy3.6-v7.3.1-src/lib-python/3/distutils/tests/test_archive_util.py	2020-05-21 14:19:14.827288853 +0200
@@ -333,6 +333,7 @@
         self.assertEqual(os.path.basename(res), 'archive.tar.xz')
         self.assertEqual(self._tarinfo(res), self._created_files)

+    @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix")
     def test_make_archive_owner_group(self):
         # testing make_archive with owner and group, with various combinations
         # this works even if there's not gid/uid support
@@ -362,6 +363,7 @@

     @unittest.skipUnless(ZLIB_SUPPORT, "Requires zlib")
     @unittest.skipUnless(UID_GID_SUPPORT, "Requires grp and pwd support")
+    @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix")
     def test_tarfile_root_owner(self):
         tmpdir =  self._create_files()
         base_name = os.path.join(self.mkdtemp(), 'archive')
diff -Naur pypy3.6-v7.3.1-src.orig/lib-python/3/distutils/tests/test_sdist.py pypy3.6-v7.3.1-src/lib-python/3/distutils/tests/test_sdist.py
--- pypy3.6-v7.3.1-src.orig/lib-python/3/distutils/tests/test_sdist.py	1970-01-01 01:00:01.000000000 +0100
+++ pypy3.6-v7.3.1-src/lib-python/3/distutils/tests/test_sdist.py	2020-05-21 14:19:14.827288853 +0200
@@ -443,6 +443,7 @@
                      "The tar command is not found")
     @unittest.skipIf(find_executable('gzip') is None,
                      "The gzip command is not found")
+    @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix")
     def test_make_distribution_owner_group(self):
         # now building a sdist
         dist, cmd = self.get_cmd()
diff -Naur pypy3.6-v7.3.1-src.orig/lib-python/3/test/test_asyncio/test_base_events.py pypy3.6-v7.3.1-src/lib-python/3/test/test_asyncio/test_base_events.py
--- pypy3.6-v7.3.1-src.orig/lib-python/3/test/test_asyncio/test_base_events.py	1970-01-01 01:00:01.000000000 +0100
+++ pypy3.6-v7.3.1-src/lib-python/3/test/test_asyncio/test_base_events.py	2020-05-21 14:19:14.827288853 +0200
@@ -1296,6 +1296,8 @@
         self._test_create_connection_ip_addr(m_socket, False)

     @patch_socket
+    @unittest.skipUnless(support.is_resource_enabled('network'),
+                         'network is not enabled')
     def test_create_connection_service_name(self, m_socket):
         m_socket.getaddrinfo = socket.getaddrinfo
         sock = m_socket.socket.return_value
diff -Naur pypy3.6-v7.3.1-src.orig/lib-python/3/test/test_generators.py pypy3.6-v7.3.1-src/lib-python/3/test/test_generators.py
--- pypy3.6-v7.3.1-src.orig/lib-python/3/test/test_generators.py	1970-01-01 01:00:01.000000000 +0100
+++ pypy3.6-v7.3.1-src/lib-python/3/test/test_generators.py	2020-05-21 14:19:14.827288853 +0200
@@ -35,6 +35,7 @@
         else:
             return "FAILED"

+    @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build environment')
     def test_raise_and_yield_from(self):
         gen = self.generator1()
         gen.send(None)
diff -Naur pypy3.6-v7.3.1-src.orig/lib-python/3/test/_test_multiprocessing.py pypy3.6-v7.3.1-src/lib-python/3/test/_test_multiprocessing.py
--- pypy3.6-v7.3.1-src.orig/lib-python/3/test/_test_multiprocessing.py	1970-01-01 01:00:01.000000000 +0100
+++ pypy3.6-v7.3.1-src/lib-python/3/test/_test_multiprocessing.py	2020-05-21 14:19:14.827288853 +0200
@@ -1212,6 +1212,7 @@
         if pid is not None:
             os.kill(pid, signal.SIGINT)

+    @unittest.skipIf(True, "This fails for unknown reasons on Guix")
     def test_wait_result(self):
         if isinstance(self, ProcessesMixin) and sys.platform != 'win32':
             pid = os.getpid()
diff -Naur pypy3.6-v7.3.1-src.orig/lib-python/3/test/test_normalization.py pypy3.6-v7.3.1-src/lib-python/3/test/test_normalization.py
--- pypy3.6-v7.3.1-src.orig/lib-python/3/test/test_normalization.py	1970-01-01 01:00:01.000000000 +0100
+++ pypy3.6-v7.3.1-src/lib-python/3/test/test_normalization.py	2020-05-21 14:19:14.827288853 +0200
@@ -2,6 +2,7 @@
 import unittest

 from http.client import HTTPException
+from urllib.error import URLError
 import sys
 from unicodedata import normalize, unidata_version

@@ -43,6 +44,8 @@
         except PermissionError:
             self.skipTest(f"Permission error when downloading {TESTDATAURL} "
                           f"into the test data directory")
+        except URLError:
+            self.skipTest("DNS lookups are not enabled.")
         except (OSError, HTTPException):
             self.fail(f"Could not retrieve {TESTDATAURL}")

diff -Naur pypy3.6-v7.3.1-src.orig/lib-python/3/test/test_pathlib.py pypy3.6-v7.3.1-src/lib-python/3/test/test_pathlib.py
--- pypy3.6-v7.3.1-src.orig/lib-python/3/test/test_pathlib.py	1970-01-01 01:00:01.000000000 +0100
+++ pypy3.6-v7.3.1-src/lib-python/3/test/test_pathlib.py	2020-05-21 14:19:14.827288853 +0200
@@ -2130,8 +2130,7 @@
         self.assertEqual(given, expect)
         self.assertEqual(set(p.rglob("FILEd*")), set())

-    @unittest.skipUnless(hasattr(pwd, 'getpwall'),
-                         'pwd module does not expose getpwall()')
+    @unittest.skipIf(True, "Guix builder home is '/' which causes trouble for these tests")
     def test_expanduser(self):
         P = self.cls
         support.import_module('pwd')
diff -Naur pypy3.6-v7.3.1-src.orig/lib-python/3/test/test_pdb.py pypy3.6-v7.3.1-src/lib-python/3/test/test_pdb.py
--- pypy3.6-v7.3.1-src.orig/lib-python/3/test/test_pdb.py	1970-01-01 01:00:01.000000000 +0100
+++ pypy3.6-v7.3.1-src/lib-python/3/test/test_pdb.py	2020-05-21 14:20:24.377203281 +0200
@@ -1136,11 +1136,11 @@
     > <doctest test.test_pdb.test_pdb_issue_20766[0]>(6)test_function()
     -> print('pdb %d: %s' % (i, sess._previous_sigint_handler))
     (Pdb) continue
-    pdb 1: <built-in function default_int_handler>
+    pdb 1: Handlers.SIG_IGN
     > <doctest test.test_pdb.test_pdb_issue_20766[0]>(6)test_function()
     -> print('pdb %d: %s' % (i, sess._previous_sigint_handler))
     (Pdb) continue
-    pdb 2: <built-in function default_int_handler>
+    pdb 2: Handlers.SIG_IGN
     """

 class PdbTestCase(unittest.TestCase):
diff -Naur pypy3.6-v7.3.1-src.orig/lib-python/3/test/test_regrtest.py pypy3.6-v7.3.1-src/lib-python/3/test/test_regrtest.py
--- pypy3.6-v7.3.1-src.orig/lib-python/3/test/test_regrtest.py	1970-01-01 01:00:01.000000000 +0100
+++ pypy3.6-v7.3.1-src/lib-python/3/test/test_regrtest.py	2020-05-21 14:19:14.827288853 +0200
@@ -766,6 +766,7 @@
         output = self.run_tests('--fromfile', filename)
         self.check_executed_tests(output, tests)

+    @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build environment.')
     def test_interrupted(self):
         code = TEST_INTERRUPTED
         test = self.create_test('sigint', code=code)
diff -Naur pypy3.6-v7.3.1-src.orig/lib-python/3/test/test_resource.py pypy3.6-v7.3.1-src/lib-python/3/test/test_resource.py
--- pypy3.6-v7.3.1-src.orig/lib-python/3/test/test_resource.py	1970-01-01 01:00:01.000000000 +0100
+++ pypy3.6-v7.3.1-src/lib-python/3/test/test_resource.py	2020-05-21 14:19:14.827288853 +0200
@@ -146,6 +146,7 @@

     @unittest.skipUnless(hasattr(resource, 'prlimit'), 'no prlimit')
     @support.requires_linux_version(2, 6, 36)
+    @unittest.skipIf(True, "Bug: the PermissionError is not raised")
     def test_prlimit(self):
         self.assertRaises(TypeError, resource.prlimit)
         self.assertRaises(ProcessLookupError, resource.prlimit,
diff -Naur pypy3.6-v7.3.1-src.orig/lib-python/3/test/test_shutil.py pypy3.6-v7.3.1-src/lib-python/3/test/test_shutil.py
--- pypy3.6-v7.3.1-src.orig/lib-python/3/test/test_shutil.py	1970-01-01 01:00:01.000000000 +0100
+++ pypy3.6-v7.3.1-src/lib-python/3/test/test_shutil.py	2020-05-21 14:19:14.827288853 +0200
@@ -1138,6 +1138,7 @@
         self.assertRaises(ValueError, make_archive, base_name, 'xxx')

     @support.requires_zlib
+    @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix")
     def test_make_archive_owner_group(self):
         # testing make_archive with owner and group, with various combinations
         # this works even if there's not gid/uid support
@@ -1166,6 +1167,7 @@

     @support.requires_zlib
+    @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix")
     @unittest.skipUnless(UID_GID_SUPPORT, "Requires grp and pwd support")
     def test_tarfile_root_owner(self):
         root_dir, base_dir = self._create_files()
diff -Naur pypy3.6-v7.3.1-src.orig/lib-python/3/test/test_socket.py pypy3.6-v7.3.1-src/lib-python/3/test/test_socket.py
--- pypy3.6-v7.3.1-src.orig/lib-python/3/test/test_socket.py	1970-01-01 01:00:01.000000000 +0100
+++ pypy3.6-v7.3.1-src/lib-python/3/test/test_socket.py	2020-05-21 14:19:14.827288853 +0200
@@ -815,6 +815,8 @@
         if not fqhn in all_host_names:
             self.fail("Error testing host resolution mechanisms. (fqdn: %s, all: %s)" % (fqhn, repr(all_host_names)))

+    @unittest.skipUnless(support.is_resource_enabled('network'),
+                         'network is not enabled')
     def test_host_resolution(self):
         for addr in [support.HOST, '10.0.0.1', '255.255.255.255']:
             self.assertEqual(socket.gethostbyname(addr), addr)
@@ -934,6 +936,8 @@
             self.assertRaises(OverflowError, socket.htonl, k)
             self.assertRaises(OverflowError, socket.htons, k)

+    @unittest.skipUnless(os.path.exists("/etc/services"),
+                         "getservbyname uses /etc/services, which is not in the chroot")
     def testGetServBy(self):
         eq = self.assertEqual
         # Find one service that exists, then check all the related interfaces.
@@ -1278,6 +1282,8 @@
             raise
         self.assertRaises(TypeError, s.ioctl, socket.SIO_LOOPBACK_FAST_PATH, None)

+    @unittest.skipUnless(os.path.exists("/etc/gai.conf"),
+                         "getaddrinfo() will fail")
     def testGetaddrinfo(self):
         try:
             socket.getaddrinfo('localhost', 80)
@@ -1357,6 +1363,8 @@
         # only IP addresses are allowed
         self.assertRaises(OSError, socket.getnameinfo, ('mail.python.org',0), 0)

+    @unittest.skipUnless(os.path.exists("/etc/gai.conf"),
+                         "getaddrinfo() will fail")
     @unittest.skipUnless(support.is_resource_enabled('network'),
                          'network is not enabled')
     def test_idna(self):
diff -Naur pypy3.6-v7.3.1-src.orig/lib-python/3/test/test_spwd.py pypy3.6-v7.3.1-src/lib-python/3/test/test_spwd.py
--- pypy3.6-v7.3.1-src.orig/lib-python/3/test/test_spwd.py	1970-01-01 01:00:01.000000000 +0100
+++ pypy3.6-v7.3.1-src/lib-python/3/test/test_spwd.py	2020-05-21 14:19:14.827288853 +0200
@@ -5,8 +5,7 @@
 spwd = support.import_module('spwd')

-@unittest.skipUnless(hasattr(os, 'geteuid') and os.geteuid() == 0,
-                     'root privileges required')
+@unittest.skipUnless(os.path.exists("/etc/shadow"), 'spwd tests require /etc/shadow')
 class TestSpwdRoot(unittest.TestCase):

     def test_getspall(self):
@@ -56,8 +55,7 @@
             self.assertRaises(TypeError, spwd.getspnam, bytes_name)

-@unittest.skipUnless(hasattr(os, 'geteuid') and os.geteuid() != 0,
-                     'non-root user required')
+@unittest.skipUnless(os.path.exists("/etc/shadow"), 'spwd tests require /etc/shadow')
 class TestSpwdNonRoot(unittest.TestCase):

     def test_getspnam_exception(self):
diff -Naur pypy3.6-v7.3.1-src.orig/lib-python/3/test/test_tarfile.py pypy3.6-v7.3.1-src/lib-python/3/test/test_tarfile.py
--- pypy3.6-v7.3.1-src.orig/lib-python/3/test/test_tarfile.py	1970-01-01 01:00:01.000000000 +0100
+++ pypy3.6-v7.3.1-src/lib-python/3/test/test_tarfile.py	2020-05-21 14:19:14.827288853 +0200
@@ -2491,9 +2491,12 @@
         import pwd, grp
     except ImportError:
         return False
-    if pwd.getpwuid(0)[0] != 'root':
-        return False
-    if grp.getgrgid(0)[0] != 'root':
+    try:
+        if pwd.getpwuid(0)[0] != 'root':
+            return False
+        if grp.getgrgid(0)[0] != 'root':
+            return False
+    except KeyError:
         return False
     return True


code:
Have configure.py modify internal variables depending on the --qml-plugindir
configure option.
diff -u PyQt-gpl-5.4.alt/configure.py PyQt-gpl-5.4/configure.py
--- PyQt-gpl-5.4.alt/configure.py	2015-01-25 17:27:50.000000000 +0100
+++ PyQt-gpl-5.4/configure.py	2015-01-25 17:56:41.000000000 +0100
@@ -904,6 +904,9 @@
         if opts.pyuicinterpreter is not None:
             self.pyuic_interpreter = opts.pyuicinterpreter

+        if opts.qmlplugindir is not None:
+            self.qml_plugin_dir = opts.qmlplugindir
+
         if opts.qsciapidir is not None:
             self.qsci_api_dir = opts.qsciapidir