code:
Submitted upstream.

From 4c3eb19a11dfe5c88c902481a8294c4f675fcd03 Mon Sep 17 00:00:00 2001
From: "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org>
Date: Sun, 19 Apr 2020 23:33:28 +0200
Subject: [PATCH] Support cross-compiling to the Hurd.

* cnf/hints/gnu: New file.
* cnf/configure_tool.sh: Guess it.
---
 cnf/configure_tool.sh |  4 ++++
 cnf/hints/gnu         | 21 +++++++++++++++++++++
 2 files changed, 25 insertions(+)
 create mode 100644 cnf/hints/gnu

diff --git a/cnf/configure_tool.sh b/cnf/configure_tool.sh
index 32201c0..7b0baa4 100644
--- a/cnf/configure_tool.sh
+++ b/cnf/configure_tool.sh
@@ -266,6 +266,10 @@ if not hinted 'osname'; then
 			define osname "bsd"
 			result "BSD"
 			;;
+		*-gnu*)
+			define osname "gnu"
+			result "GNU"
+			;;
 		*)
 			result "no"
 			;;
diff --git a/cnf/hints/gnu b/cnf/hints/gnu
new file mode 100644
index 0000000..a0583a2
--- /dev/null
+++ b/cnf/hints/gnu
@@ -0,0 +1,21 @@
+# Hurd syscalls
+d_voidsig='define'
+d_nanosleep='undef'
+d_clock_gettime='define'
+d_clock_getres='define'
+d_clock_nanosleep='define'
+d_clock='define'
+
+# From the original linux.sh
+usemallocwrap='define'
+
+# libraries to test
+libswanted='m crypt pthread nm ndbm gdbm dbm db dl gdbm_compat'
+
+d_procselfexe='undef'
+procselfexe='"undef"'
+
+st_ino_sign=1
+st_ino_size=8
+
+d_fcntl_can_lock='define'
--
2.26.0


code:
From <https://bugs.debian.org/801523>.

From c01f602d1926b0671fd2c8d91f7e52c4e4c9fb24 Mon Sep 17 00:00:00 2001
From: Niko Tyni <ntyni@debian.org>
Date: Sun, 11 Oct 2015 19:27:56 +0300
Subject: [PATCH] Sort the list of XS code files when generating RealPPPort.xs

all_files_in_dir() uses readdir() ordering to make the list of
input files. This can vary between build systems, breaking build
reproducibility.
---
 cpan/Devel-PPPort/PPPort_xs.PL | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dist/Devel-PPPort/PPPort_xs.PL b/dist/Devel-PPPort/PPPort_xs.PL
index 5f18940..149f2fe 100644
--- a/dist/Devel-PPPort/PPPort_xs.PL
+++ b/dist/Devel-PPPort/PPPort_xs.PL
@@ -38,7 +38,7 @@ END
 my $file;
 my $sec;

-for $file (all_files_in_dir('parts/inc')) {
+for $file (sort(all_files_in_dir('parts/inc'))) {
   my $spec = parse_partspec($file);

   my $msg = 0;
--
2.5.1

repo_name: maximed/guix

license: mit


code:
Rather than unconditionally using Mozilla's CA certificates, let the user tell
LWP's UserAgent where to find certificates with the PERL_LWP_SSL_CA_FILE,
HTTPS_CA_FILE, PERL_LWP_SSL_CA_PATH, or HTTPS_CA_DIR environment variables
instead.

--- Finance-Quote-1.37/lib/Finance/Quote/Tiaacref.pm.orig	2015-02-01 13:24:41.000000000 -0600
+++ Finance-Quote-1.37/lib/Finance/Quote/Tiaacref.pm	2015-07-07 20:09:47.278885944 -0500
@@ -30,7 +30,6 @@
 package Finance::Quote::Tiaacref;
 require 5.005;
 require LWP::Protocol::https;
-require Mozilla::CA;

 use strict;


code:
Fix CVE-2021-22204:

https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-22204

Patch extracted from commit cf0f4e7dcd024ca99615bfd1102a841a25dde031
from upstream source repository:

https://github.com/exiftool/exiftool/commit/cf0f4e7dcd024ca99615bfd1102a841a25dde031#diff-fa0d652d10dbcd246e6b1df16c1e992931d3bb717a7e36157596b76bdadb3800

diff --git a/lib/Image/ExifTool/DjVu.pm b/lib/Image/ExifTool/DjVu.pm
index c284d10..03b3f9f 100644
--- a/lib/Image/ExifTool/DjVu.pm
+++ b/lib/Image/ExifTool/DjVu.pm
@@ -18,7 +18,7 @@ use strict;
 use vars qw($VERSION);
 use Image::ExifTool qw(:DataAccess :Utils);

-$VERSION = '1.06';
+$VERSION = '1.07';

 sub ParseAnt($);
 sub ProcessAnt($$$);
@@ -227,10 +227,11 @@ Tok: for (;;) {
                 last unless $tok =~ /(\\+)$/ and length($1) & 0x01;
                 $tok .= '"';    # quote is part of the string
             }
-            # must protect unescaped "$" and "@" symbols, and "\" at end of string
-            $tok =~ s{\\(.)|([\$\@]|\\$)}{'\\'.($2 || $1)}sge;
-            # convert C escape sequences (allowed in quoted text)
-            $tok = eval qq{"$tok"};
+            # convert C escape sequences, allowed in quoted text
+            # (note: this only converts a few of them!)
+            my %esc = ( a => "\a", b => "\b", f => "\f", n => "\n",
+                        r => "\r", t => "\t", '"' => '"', '\\' => '\\' );
+            $tok =~ s/\\(.)/$esc{$1}||'\\'.$1/egs;
         } else {                # key name
             pos($$dataPt) = pos($$dataPt) - 1;
             # allow anything in key but whitespace, braces and double quotes


code:
Work around a problem arising from the update to OpenSSL 1.0.2f, based on the
following upstream commit:

  https://github.com/noxxi/p5-io-socket-ssl/commit/6e23ee4a433f83f1065bd2467255eba5ee9b1ddd

Attempting to update to IO-Socket-SSL-2.023, which includes this commit,
caused other test failures.  See:

  https://lists.gnu.org/archive/html/guix-devel/2016-01/msg01032.html

Description from the upstream commit:

  OpenSSL 1.0.2f changed the behavior of SSL shutdown in case the TLS connection
  was not fully established (commit: f73c737c7ac908c5d6407c419769123392a3b0a9).
  This somehow resulted in Net::SSLeay::shutdown returning 0 (i.e. keep trying)
  which caused an endless loop. It will now ignore this result in case the TLS
  connection was not yet established and consider the TLS connection closed
  instead.

--- IO-Socket-SSL-2.002/lib/IO/Socket/SSL.pm.orig	2014-10-21 16:51:16.000000000 -0400
+++ IO-Socket-SSL-2.002/lib/IO/Socket/SSL.pm	2016-01-31 15:07:14.971099894 -0500
@@ -1213,6 +1213,11 @@
 		    # shutdown complete
 		    last;
 		}
+		if ((${*$self}{'_SSL_opened'}||0) <= 0) {
+		    # not really open, thus don't expect shutdown to return
+		    # something meaningful
+		    last;
+		}

 		# initiate or complete shutdown
 		local $SIG{PIPE} = 'IGNORE';


code:
Fix Perl module Module::Pluggable such that it can find plugins that live in
symlinked directories.

Patch borrowed/adapted from Nixpkgs.

--- Module-Pluggable-5.2/lib/Module/Pluggable/Object.pm   2015-04-08 23:28:48.120164135 -0500
+++ Module-Pluggable-5.2/lib/Module/Pluggable/Object.pm   2015-04-08 23:30:27.032166704 -0500
@@ -164,7 +164,7 @@
         my $sp = catdir($dir, (split /::/, $searchpath));

         # if it doesn't exist or it's not a dir then skip it
-        next unless ( -e $sp && -d _ ); # Use the cached stat the second time
+        next unless ( -e $sp );

         my @files = $self->find_files($sp);

@@ -279,7 +279,7 @@
                              (my $path = $File::Find::name) =~ s#^\\./##;
                              push @files, $path;
                            }
-                      }, $search_path );
+                      }, "$search_path/." );
     }
     #chdir $cwd;
     return @files;


code:
Patch borrowed from nixpkgs.  Works around warning message produced by the
current version of Moose:

"Passing a list of values to enum is deprecated. Enum values should be wrapped
in an arrayref."

--- Net-Amazon-S3-0.60/lib/Net/Amazon/S3/Client/Object.pm	2015-04-15 16:18:47.226410022 -0500
+++ Net-Amazon-S3-0.60/lib/Net/Amazon/S3/Client/Object.pm	2015-04-15 16:19:25.410408425 -0500
@@ -19,7 +19,7 @@
     [ qw(private public-read public-read-write authenticated-read) ];

 enum 'StorageClass' =>
-    qw(standard reduced_redundancy);
+    [ qw(standard reduced_redundancy) ];

 has 'client' =>
     ( is => 'ro', isa => 'Net::Amazon::S3::Client', required => 1 );


code:
perl-net-dns-resolver-programmable used the undocumented and internal
method Net::DNS::rcodesbyname [0], and that interface is no longer
exposed.

This patch, copied from [1], makes the program check for the existence
of the method before trying to use it.

[0]
<https://rt.cpan.org/Public/Bug/Display.html?id=95901>

[1]
<https://rt.cpan.org/Public/Bug/Display.html?id=95901#txn-1575108>

diff --git a/lib/Net/DNS/Resolver/Programmable.pm b/lib/Net/DNS/Resolver/Programmable.pm
index 1af72ce..e09a2f0 100644
--- a/lib/Net/DNS/Resolver/Programmable.pm
+++ b/lib/Net/DNS/Resolver/Programmable.pm
@@ -203,8 +203,10 @@ sub send {
     if (defined(my $resolver_code = $self->{resolver_code})) {
         ($result, $aa, @answer_rrs) = $resolver_code->($domain, $rr_type, $class);
     }
-
-    if (not defined($result) or defined($Net::DNS::rcodesbyname{$result})) {
+
+    if (not defined($result)
+         or defined($Net::DNS::Parameters::rcodebyname{$result})
+         or defined($Net::DNS::rcodesbyname{$result})) {
         # Valid RCODE, return a packet:

         $aa     = TRUE      if not defined($aa);


code:
Don't look for headers and libraries in "traditional" locations.

Patch adapted from Nixpkgs, originally by Eelco Dolstra
<eelco.dolstra@logicblox.com>.

diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/Configure perl-5.20.0/Configure
--- perl-5.20.0-orig/Configure	2014-05-26 15:34:18.000000000 +0200
+++ perl-5.20.0/Configure	2014-06-25 10:43:35.368285986 +0200
@@ -106,15 +106,7 @@
 fi

 : Proper PATH setting
-paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
-paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
-paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
-paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
-paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
-paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
-paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
-paths="$paths /sbin /usr/sbin /usr/libexec"
-paths="$paths /system/gnu_library/bin"
+paths=''

 for p in $paths
 do
@@ -1337,8 +1329,7 @@
 archname=''
 : Possible local include directories to search.
 : Set locincpth to "" in a hint file to defeat local include searches.
-locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
-locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
+locincpth=""
 :
 : no include file wanted by default
 inclwanted=''
@@ -1349,17 +1340,12 @@

 libnames=''
 : change the next line if compiling for Xenix/286 on Xenix/386
-xlibpth='/usr/lib/386 /lib/386'
+xlibpth=''
 : Possible local library directories to search.
-loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
-loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
+loclibpth=""

 : general looking path for locating libraries
-glibpth="/lib /usr/lib $xlibpth"
-glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
-test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
-test -f /shlib/libc.so     && glibpth="/shlib $glibpth"
-test -d /usr/lib64         && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
+glibpth=""

 : Private path used by Configure to find libraries.  Its value
 : is prepended to libpth. This variable takes care of special
@@ -1391,8 +1377,6 @@
 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
 : We probably want to search /usr/shlib before most other libraries.
 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
-glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
-glibpth="/usr/shlib $glibpth"
 : Do not use vfork unless overridden by a hint file.
 usevfork=false

@@ -2446,7 +2430,6 @@
 zip
 "
 pth=`echo $PATH | sed -e "s/$p_/ /g"`
-pth="$pth $sysroot/lib $sysroot/usr/lib"
 for file in $loclist; do
 	eval xxx=\$$file
 	case "$xxx" in
@@ -4936,7 +4919,7 @@
 : Set private lib path
 case "$plibpth" in
 '') if ./mips; then
-	plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
+	plibpth="$incpath/usr/lib"
     fi;;
 esac
 case "$libpth" in
@@ -8600,13 +8583,8 @@
 echo " "
 case "$sysman" in
 '')
-	syspath='/usr/share/man/man1 /usr/man/man1'
-	syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
-	syspath="$syspath /usr/man/u_man/man1"
-	syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
-	syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
-	syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
-	sysman=`./loc . /usr/man/man1 $syspath`
+	syspath=''
+	sysman=''
 	;;
 esac
 if $test -d "$sysman"; then
@@ -19900,9 +19878,10 @@
 case "$full_ar" in
 '') full_ar=$ar ;;
 esac
+full_ar=ar

 : Store the full pathname to the sed program for use in the C program
-full_sed=$sed
+full_sed=sed

 : see what type gids are declared as in the kernel
 echo " "
Only in perl-5.20.0/: Configure.orig
diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/ext/Errno/Errno_pm.PL perl-5.20.0/ext/Errno/Errno_pm.PL
--- perl-5.20.0-orig/ext/Errno/Errno_pm.PL	2014-05-26 15:34:20.000000000 +0200
+++ perl-5.20.0/ext/Errno/Errno_pm.PL	2014-06-25 10:31:24.317970047 +0200
@@ -114,7 +114,7 @@ sub get_files {
     # When cross-compiling we may store a path for gcc's "sysroot" option:
     my $sysroot = $Config{sysroot} || '';
     my $linux_errno_h;
-    if ($^O eq 'linux') {
+    if (0) {
 	# Some Linuxes have weird errno.hs which generate
 	# no #file or #line directives
 	($linux_errno_h) = grep { -e $_ } map { "$_/errno.h" }
@@ -134,13 +134,6 @@ sub get_files {
 	if ($dep =~ /(\S+errno\.h)/) {
 	     $file{$1} = 1;
 	}
-    } elsif ($^O eq 'linux' &&
-	      $Config{gccversion} ne '' &&
-	      $Config{gccversion} !~ /intel/i &&
-	      # might be using, say, Intel's icc
-	      $linux_errno_h
-	     ) {
-	$file{$linux_errno_h} = 1;
     } elsif ($^O eq 'haiku') {
 	# hidden in a special place
 	$file{'/boot/develop/headers/posix/errno.h'} = 1;
diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/hints/freebsd.sh perl-5.20.0/hints/freebsd.sh
--- perl-5.20.0-orig/hints/freebsd.sh	2014-01-31 22:55:51.000000000 +0100
+++ perl-5.20.0/hints/freebsd.sh	2014-06-25 10:25:53.263964680 +0200
@@ -119,21 +119,21 @@
         objformat=`/usr/bin/objformat`
         if [ x$objformat = xaout ]; then
             if [ -e /usr/lib/aout ]; then
-                libpth="/usr/lib/aout /usr/local/lib /usr/lib"
-                glibpth="/usr/lib/aout /usr/local/lib /usr/lib"
+                libpth=""
+                glibpth=""
             fi
             lddlflags='-Bshareable'
         else
-            libpth="/usr/lib /usr/local/lib"
-            glibpth="/usr/lib /usr/local/lib"
+            libpth=""
+            glibpth=""
             ldflags="-Wl,-E "
             lddlflags="-shared "
         fi
         cccdlflags='-DPIC -fPIC'
         ;;
 *)
-       libpth="/usr/lib /usr/local/lib"
-       glibpth="/usr/lib /usr/local/lib"
+       libpth=""
+       glibpth=""
        ldflags="-Wl,-E "
         lddlflags="-shared "
         cccdlflags='-DPIC -fPIC'
diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/hints/linux.sh perl-5.20.0/hints/linux.sh
--- perl-5.20.0-orig/hints/linux.sh	2014-05-26 15:34:20.000000000 +0200
+++ perl-5.20.0/hints/linux.sh	2014-06-25 10:33:47.354883843 +0200
@@ -150,25 +150,6 @@
     ;;
 esac

-# Ubuntu 11.04 (and later, presumably) doesn't keep most libraries
-# (such as -lm) in /lib or /usr/lib.  So we have to ask gcc to tell us
-# where to look.  We don't want gcc's own libraries, however, so we
-# filter those out.
-# This could be conditional on Unbuntu, but other distributions may
-# follow suit, and this scheme seems to work even on rather old gcc's.
-# This unconditionally uses gcc because even if the user is using another
-# compiler, we still need to find the math library and friends, and I don't
-# know how other compilers will cope with that situation.
-# Morever, if the user has their own gcc earlier in $PATH than the system gcc,
-# we don't want its libraries. So we try to prefer the system gcc
-# Still, as an escape hatch, allow Configure command line overrides to
-# plibpth to bypass this check.
-if [ -x /usr/bin/gcc ] ; then
-    gcc=/usr/bin/gcc
-else
-    gcc=gcc
-fi
-
 case "$plibpth" in
 '') plibpth=`LANG=C LC_ALL=C $gcc $ccflags $ldflags -print-search-dirs | grep libraries |
 	cut -f2- -d= | tr ':' $trnl | grep -v 'gcc' | sed -e 's:/$::'`
@@ -367,33 +322,6 @@
 	;;
 esac

-# SuSE8.2 has /usr/lib/libndbm* which are ld scripts rather than
-# true libraries. The scripts cause binding against static
-# version of -lgdbm which is a bad idea. So if we have 'nm'
-# make sure it can read the file
-# NI-S 2003/08/07
-case "$nm" in
-    '') ;;
-    *)
-    for p in $plibpth
-    do
-        if $test -r $p/libndbm.so; then
-            if $nm $p/libndbm.so >/dev/null 2>&1 ; then
-                echo 'Your shared -lndbm seems to be a real library.'
-                _libndbm_real=1
-                break
-            fi
-        fi
-    done
-    if $test "X$_libndbm_real" = X; then
-        echo 'Your shared -lndbm is not a real library.'
-        set `echo X "$libswanted "| sed -e 's/ ndbm / /'`
-        shift
-        libswanted="$*"
-    fi
-    ;;
-esac
-
 # Linux on Synology.
 if [ -f /etc/synoinfo.conf -a -d /usr/syno ]; then
     # Tested on Synology DS213 and DS413
diff --git a/hints/linux.sh b/hints/linux.sh
index 3f38ea0..97aed11 100644
--- a/hints/linux.sh
+++ b/hints/linux.sh
@@ -195,32 +195,6 @@ case "$usequadmath" in
   ;;
 esac

-case "$libc" in
-'')
-# If you have glibc, then report the version for ./myconfig bug reporting.
-# (Configure doesn't need to know the specific version since it just uses
-# gcc to load the library for all tests.)
-# We don't use __GLIBC__ and  __GLIBC_MINOR__ because they
-# are insufficiently precise to distinguish things like
-# libc-2.0.6 and libc-2.0.7.
-    for p in $plibpth
-    do
-        for trylib in libc.so.6 libc.so
-        do
-            if $test -e $p/$trylib; then
-                libc=`ls -l $p/$trylib | awk '{print $NF}'`
-                if $test "X$libc" != X; then
-                    break
-                fi
-            fi
-        done
-        if $test "X$libc" != X; then
-            break
-        fi
-    done
-    ;;
-esac
-
 if ${sh:-/bin/sh} -c exit; then
   echo ''
   echo 'You appear to have a working bash.  Good.'


code:
Don't encode the current timestamp.

This affects the output of `perl -V`, specifically the message "Compiled
at [...]".

The 'cf_time' and 'cf_by' values show up in 'config.h' and
in 'Config_heavy.pl'.

Use the output of 'uname -s' instead of 'uname -a' to avoid recording
the kernel version ('uname -o' leads to directory names like
'x86_64-gnulinux' instead of 'x86_64-linux', which might cause breakage
down the road.)

diff --git a/perl.c b/perl.c
index 228a0d8..ed38313 100644
--- a/perl.c
+++ b/perl.c
@@ -1825,6 +1825,7 @@ S_Internals_V(pTHX_ CV *cv)
     PUSHs(Perl_newSVpvn_flags(aTHX_ non_bincompat_options,
 			      sizeof(non_bincompat_options) - 1, SVs_TEMP));

+#define PERL_BUILD_DATE "Jan  1 1970 00:00:00"
 #ifndef PERL_BUILD_DATE
 #  ifdef __DATE__
 #    ifdef __TIME__

--- a/Configure	1970-01-01 01:00:00.000000000 +0100
+++ b/Configure	2016-10-01 14:47:20.017319739 +0200
@@ -3276,7 +3276,7 @@ $eunicefix tr
 : Try to determine whether config.sh was made on this system
 case "$config_sh" in
 '')
-myuname=`$uname -a 2>/dev/null`
+myuname=`$uname -s 2>/dev/null`
 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
 # Downcase everything to avoid ambiguity.
 # Remove slashes and single quotes so we can use parts of this in
@@ -3845,10 +3845,10 @@
 . ./posthint.sh

 : who configured the system
-cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
+cf_time="1970-01-01"
 case "$cf_by" in
 "")
-	cf_by=`(logname) 2>/dev/null`
+	cf_by="guix"
 	case "$cf_by" in
 	"")
 		cf_by=`(whoami) 2>/dev/null`


code:
Description: Use the markdown library provided by the libmarkdown2 package.
Author: Alessandro Ghedini <al3xbio@gmail.com>
Origin: vendor
Forwarded: not-needed
Last-Update: 2012-01-01

--- a/Makefile.PL
+++ b/Makefile.PL
@@ -57,12 +57,6 @@

-sub MY::postamble {
-    return sprintf('
-$(MYEXTLIB):
-	%s
-', qq{( cd $extdir; CC='cc -fPIC' sh configure.sh; make )\n});
-}

 WriteMakefile(
     NAME              => 'Text::Markdown::Discount',
@@ -71,8 +65,6 @@
     ($] >= 5.005 ?
       (ABSTRACT_FROM  => 'lib/Text/Markdown/Discount.pm',
        AUTHOR         => 'Masayoshi Sekimura <sekimura@cpan.org>') : ()),
-    LIBS               => '-L' . $extdir,
-    INC               => '-I. -I' . $extdir,
-    MYEXTLIB          => $myextlib,
-    clean             => { FILES => $clean_files },
+    LIBS               => '-lmarkdown',
+    INC               => '-I.',
 );


code:
From: Tobias Geerinckx-Rice <me@tobias.gr>
Date: Sat, 14 Nov 2020 15:40:56 +0100
Subject: [PATCH] gnu: perl-www-curl: Fix struct void* usage.

Copied verbatim from Gentoo[0].  Fixes:

  Curl.xs:76:12: error: expected ‘{’ before ‘void’
       struct void *curlm;
              ^~~~
  Curl.xs:76:12: error: two or more data types in declaration specifiers

[0]: https://694466.bugs.gentoo.org/attachment.cgi?id=595098

--- WWW-Curl-4.17/Curl.xs	2014-02-21 18:08:30.000000000 +0200
+++ WWW-Curl-4.17.new/Curl.xs	2019-11-05 21:44:55.434395739 +0200
@@ -73,7 +73,7 @@ typedef struct {
 #ifdef __CURL_MULTI_H
     struct CURLM *curlm;
 #else
-    struct void *curlm;
+    void *curlm;
 #endif
 } perl_curl_multi;


code:
From: Tobias Geerinckx-Rice <me@tobias.gr>
Date: Sat, 14 Nov 2020 15:40:38 +0100
Subject: [PATCH] gnu: perl-www-curl: Remove undeclared symbols.

Copied verbatim from the FreeBSD port[0].

[0]: https://www.freshports.org/www/p5-WWW-Curl

--- a/Makefile.PL	2014-02-21 08:08:09.000000000 -0800
+++ b/Makefile.PL	2020-04-20 15:36:35.008798000 -0700
@@ -100,6 +100,13 @@
      print "Found curl.h in $curl_h\n";
      my @syms;
      my $has_cpp = 0;
+     my @skiplist = qw/
+        CURL_DID_MEMORY_FUNC_TYPEDEFS
+        CURL_STRICTER
+        CURLINC_CURL_H
+        CURL_WIN32
+        CURLOPT
+     /;
      open(H_IN, "-|", "cpp", $curl_h) and $has_cpp++;
      unless ($has_cpp) {
          warn "No working cpp ($!).  Parsing curl.h in Perl";
@@ -121,6 +128,7 @@
     open (H, "<", $curl_h) or die ("Cannot open $curl_h: ".$!);
     while(<H>) {
         if (/^#define (CURL[A-Za-z0-9_]*)/) {
+            next if $1 ~~ @skiplist;
             push @syms, $1;
         }
     }


code:
Index: b/test/formats/test_id3.py
===================================================================
--- a/test/formats/test_id3.py
+++ b/test/formats/test_id3.py
@@ -266,5 +266,5 @@
         def test_rename_txxx_tags(self):
             file_path = os.path.join('test', 'data', 'test-id3-rename-tags.mp3')
-            filename = self.copy_file_tmp(file_path, 'mp3')
+            filename = self.copy_file_tmp(file_path, '.mp3')
             raw_metadata = load_raw(filename)
             self.assertIn('TXXX:Artists', raw_metadata)


code:
https://sources.debian.org/data/main/p/picprog/1.9.1-3/debian/patches/20_iopl.patch

Description: Avoid some functions in some architectures
 Upstream uses iopl() function and other architecture-dependent
 codes. This patch adds building switches to avoid them in
 some architectures.
Author: Koichi Akabe <vbkaisetsu@gmail.com>
Last-Update: 2011-11-30

--- picprog-1.9.1.orig/picport.cc
+++ picprog-1.9.1/picport.cc
@@ -38,7 +38,12 @@
 #include <ctime>

 #include <sys/ioctl.h>
-#include <sys/io.h>
+
+#if defined(__i386__) || defined(__x86_64__)
+  #include <sys/io.h>
+  #define HAVE_IOPL
+#endif
+
 #include <fcntl.h>
 #include <sys/time.h>
 #include <unistd.h>
@@ -160,8 +165,12 @@
     // Not root.  Cannot use realtime scheduling.
     use_nanosleep = 0;
   }
+#ifdef HAVE_IOPL
   if (iopl (3))
     disable_interrupts = 0;
+#else
+  disable_interrupts = 0;
+#endif

 #ifdef CPU_SETSIZE
   // When computing the delay loops, we do not want the cpu's to change.
@@ -403,13 +412,17 @@
 {
   struct timeval tv1, tv2;
   gettimeofday (&tv1, 0);
+#if defined(__i386__) or defined(__x86_64__)
   if (tsc_1000ns > 1 && disable_interrupts)
     asm volatile("pushf; cli");
+#endif
   set_clock_data (1, b); // set data, clock up
   delay (cable_delay);
   set_clock_data (0, b); // clock down
+#if defined(__i386__) or defined(__x86_64__)
   if (tsc_1000ns > 1 && disable_interrupts)
     asm volatile("popf");
+#endif
   gettimeofday (&tv2, 0);

   // We may have spent a long time in an interrupt or in another task
@@ -428,13 +441,17 @@
 {
   struct timeval tv1, tv2;
   gettimeofday (&tv1, 0);
+#if defined(__i386__) or defined(__x86_64__)
   if (tsc_1000ns > 1 && disable_interrupts)
     asm volatile("pushf; cli");
+#endif
   set_clock_data (1, 1); // clock up
   delay (cable_delay);
   set_clock_data (0, 1); // set data up, clock down
+#if defined(__i386__) or defined(__x86_64__)
   if (tsc_1000ns > 1 && disable_interrupts)
     asm volatile("popf");
+#endif
   gettimeofday (&tv2, 0);

   // We may have spent a long time in an interrupt or in another task


code:
Support the PURPLE_PLUGIN_PATH environment variable.  This patch is based on
one from Nixpkgs, but properly handles the case where that variable is unset.

--- pidgin-2.10.11/libpurple/plugin.c.orig	2014-11-23 11:41:25.000000000 -0500
+++ pidgin-2.10.11/libpurple/plugin.c	2015-08-04 14:31:02.257366144 -0400
@@ -1178,8 +1178,19 @@
 void
 purple_plugins_init(void) {
 	void *handle = purple_plugins_get_handle();
+	const gchar *purple_plugin_path;

 	purple_plugins_add_search_path(LIBDIR);
+	purple_plugin_path = g_getenv("PURPLE_PLUGIN_PATH");
+	if (purple_plugin_path && *purple_plugin_path) {
+		gchar **paths = g_strsplit(purple_plugin_path, ":", -1);
+		if (paths) {
+			gchar **p;
+			for (p = paths; *p; ++p)
+				if (**p) purple_plugins_add_search_path(*p);
+		}
+		g_strfreev(paths);
+	}

 	purple_signal_register(handle, "plugin-load",
 						 purple_marshal_VOID__POINTER,


code:
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
 AUTOMAKE_OPTIONS = gnu

-SUBDIRS = libltdl addon base data src test
+SUBDIRS = addon base data src test

 EXTRA_DIST = bootstrap pinball.spec clean pinball.desktop


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):


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:
From ff5ed26f21d304e867ab57781878069567deb23d Mon Sep 17 00:00:00 2001
From: Hartmut Goebel <h.goebel@crazy-compilers.com>
Date: Mon, 3 Aug 2020 19:49:58 +0000
Subject: [PATCH] Fix build errors if PREFIX is different from ECM's PREFIX.

See <https://bugs.kde.org/424483> for details
---
 KF5PlasmaMacros.cmake | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/KF5PlasmaMacros.cmake b/KF5PlasmaMacros.cmake
index 494b42d56..80b3fd8dd 100644
--- a/KF5PlasmaMacros.cmake
+++ b/KF5PlasmaMacros.cmake
@@ -1,6 +1,5 @@

-find_package(ECM 1.6.0 CONFIG REQUIRED)
-include(${ECM_KDE_MODULE_DIR}/KDEInstallDirs.cmake)
+include(KDEInstallDirs)

 set(PLASMA_RELATIVE_DATA_INSTALL_DIR "plasma")
 set(PLASMA_DATA_INSTALL_DIR "${KDE_INSTALL_DATADIR}/${PLASMA_RELATIVE_DATA_INSTALL_DIR}")
--
GitLab


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:
This patch fixes CVE-2021-3560, "local privilege escalation using
polkit_system_bus_name_get_creds_sync()":

  https://www.openwall.com/lists/oss-security/2021/06/03/1

Patch from <https://gitlab.freedesktop.org/polkit/polkit/-/commit/a04d13a>.

diff --git a/src/polkit/polkitsystembusname.c b/src/polkit/polkitsystembusname.c
index 8daa12cb9093c1d765c7b83654a2b8d0d382378e..8ed13631508dd96624898df90ee2ece4dcf3e1e5 100644
--- a/src/polkit/polkitsystembusname.c
+++ b/src/polkit/polkitsystembusname.c
@@ -435,6 +435,9 @@ polkit_system_bus_name_get_creds_sync (PolkitSystemBusName           *system_bus
   while (!((data.retrieved_uid && data.retrieved_pid) || data.caught_error))
     g_main_context_iteration (tmp_context, TRUE);

+  if (data.caught_error)
+    goto out;
+
   if (out_uid)
     *out_uid = data.uid;
   if (out_pid)


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 942730ce7148cd54a30d4a606ce71a2654c8a2e0 Mon Sep 17 00:00:00 2001
From: Leo Prikler <leo.prikler@student.tugraz.at>
Date: Sat, 5 Jun 2021 22:47:00 -0400
Subject: [PATCH] ppsspp: Remove upgrade code and gold support.

Original patch from Leo Prikler.
Rebased on master (commit 69fa20744958aef8da9ca052ba7675fdc1636e46) by
Maxim Cournoyer.
---
 Core/Config.cpp             | 11 ------
 Core/Config.h               |  2 --
 Qt/QtMain.cpp               |  6 ----
 SDL/SDLMain.cpp             |  6 ----
 UI/DevScreens.cpp           |  3 --
 UI/GameSettingsScreen.cpp   |  2 --
 UI/MainScreen.cpp           | 70 +------------------------------------
 UI/MiscScreens.cpp          | 31 ++--------------
 UWP/PPSSPP_UWPMain.cpp      |  6 ----
 Windows/MainWindowMenu.cpp  |  2 +-
 Windows/main.cpp            |  6 ----
 android/jni/app-android.cpp |  6 ----
 ios/main.mm                 |  6 ----
 13 files changed, 5 insertions(+), 152 deletions(-)

diff --git a/Core/Config.cpp b/Core/Config.cpp
index 74be99d75..b14aa22c7 100644
--- a/Core/Config.cpp
+++ b/Core/Config.cpp
@@ -467,7 +467,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...
@@ -1323,16 +1322,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", Path(), &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 79323eefc..d47bec0c7 100644
--- a/Core/Config.h
+++ b/Core/Config.h
@@ -103,7 +103,6 @@ struct Config {

 	bool bFastMemory;
 	int iCpuCore;
-	bool bCheckForNewVersion;
 	bool bForceLagSync;
 	bool bFuncReplacements;
 	bool bHideSlowWarnings;
@@ -542,4 +541,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 b642f7442..a880d7c94 100644
--- a/Qt/QtMain.cpp
+++ b/Qt/QtMain.cpp
@@ -219,12 +219,6 @@ bool System_GetPropertyBool(SystemProperty prop) {
 	case SYSPROP_HAS_FILE_BROWSER:
 	case SYSPROP_HAS_FOLDER_BROWSER:
 		return true;
-	case SYSPROP_APP_GOLD:
-#ifdef GOLD
-		return true;
-#else
-		return false;
-#endif
 	case SYSPROP_CAN_JIT:
 		return true;
 	default:
diff --git a/SDL/SDLMain.cpp b/SDL/SDLMain.cpp
index f0f74f979..f963f36e9 100644
--- a/SDL/SDLMain.cpp
+++ b/SDL/SDLMain.cpp
@@ -381,12 +381,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
 	case SYSPROP_CAN_JIT:
 		return true;
 	default:
diff --git a/UI/DevScreens.cpp b/UI/DevScreens.cpp
index 29baf2f2e..926692363 100644
--- a/UI/DevScreens.cpp
+++ b/UI/DevScreens.cpp
@@ -635,9 +635,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 393e33cd9..d07d00d45 100644
--- a/UI/GameSettingsScreen.cpp
+++ b/UI/GameSettingsScreen.cpp
@@ -922,8 +922,6 @@ void GameSettingsScreen::CreateViews() {
 		}
 	}
 #endif
-	systemSettings->Add(new CheckBox(&g_Config.bCheckForNewVersion, sy->T("VersionCheck", "Check for new versions of PPSSPP")));
-
 	systemSettings->Add(new Choice(sy->T("Restore Default Settings")))->OnClick.Handle(this, &GameSettingsScreen::OnRestoreDefaultSettings);
 	systemSettings->Add(new CheckBox(&g_Config.bEnableStateUndo, sy->T("Savestate slot backups")));
 	static const char *autoLoadSaveStateChoices[] = { "Off", "Oldest Save", "Newest Save", "Slot 1", "Slot 2", "Slot 3", "Slot 4", "Slot 5" };
diff --git a/UI/MainScreen.cpp b/UI/MainScreen.cpp
index f88509276..51b21b640 100644
--- a/UI/MainScreen.cpp
+++ b/UI/MainScreen.cpp
@@ -1080,11 +1080,7 @@ void MainScreen::CreateViews() {
 	sprintf(versionString, "%s", PPSSPP_GIT_VERSION);
 	rightColumnItems->SetSpacing(0.0f);
 	AnchorLayout *logos = new AnchorLayout(new AnchorLayoutParams(FILL_PARENT, 60.0f, false));
-	if (System_GetPropertyBool(SYSPROP_APP_GOLD)) {
-		logos->Add(new ImageView(ImageID("I_ICONGOLD"), "", IS_DEFAULT, new AnchorLayoutParams(64, 64, 0, 0, NONE, NONE, false)));
-	} else {
-		logos->Add(new ImageView(ImageID("I_ICON"), "", IS_DEFAULT, new AnchorLayoutParams(64, 64, 0, 0, NONE, NONE, false)));
-	}
+        logos->Add(new ImageView(ImageID("I_ICON"), "", IS_DEFAULT, new AnchorLayoutParams(64, 64, 0, 0, NONE, NONE, false)));
 	logos->Add(new ImageView(ImageID("I_LOGO"), "PPSSPP", IS_DEFAULT, new AnchorLayoutParams(180, 64, 64, -5.0f, NONE, NONE, false)));

 #if !defined(MOBILE_DEVICE)
@@ -1107,11 +1103,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.
@@ -1136,32 +1127,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)));
-#if PPSSPP_PLATFORM(ANDROID) || PPSSPP_PLATFORM(WINDOWS)
-		upgradeBar_->Add(new Button(u->T("Download"), new LinearLayoutParams(buttonMargins)))->OnClick.Handle(this, &MainScreen::OnDownloadUpgrade);
-#else
-		upgradeBar_->Add(new Button(u->T("Details"), new LinearLayoutParams(buttonMargins)))->OnClick.Handle(this, &MainScreen::OnDownloadUpgrade);
-#endif
-		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) {
@@ -1169,30 +1134,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");
-	}
-#elif PPSSPP_PLATFORM(WINDOWS)
-	LaunchBrowser("https://www.ppsspp.org/downloads.html");
-#else
-	// Go directly to ppsspp.org and let the user sort it out
-	// (for details and in case downloads doesn't have their platform.)
-	LaunchBrowser("https://www.ppsspp.org/");
-#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);
@@ -1396,15 +1337,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 901a5fb09..9d067aee6 100644
--- a/UI/MiscScreens.cpp
+++ b/UI/MiscScreens.cpp
@@ -661,11 +661,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", bounds.w / 2, bounds.h / 2 - 30, textColor, ALIGN_CENTER);
 	dc.SetFontScale(1.0f, 1.0f);
@@ -701,10 +697,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);
@@ -713,20 +705,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) {
@@ -916,11 +895,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 29afda806..b7028fc0c 100644
--- a/UWP/PPSSPP_UWPMain.cpp
+++ b/UWP/PPSSPP_UWPMain.cpp
@@ -426,12 +426,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
 	case SYSPROP_CAN_JIT:
 		return true;
 	default:
diff --git a/Windows/MainWindowMenu.cpp b/Windows/MainWindowMenu.cpp
index c0d790e06..e8de4f956 100644
--- a/Windows/MainWindowMenu.cpp
+++ b/Windows/MainWindowMenu.cpp
@@ -1395,7 +1395,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 ecfe18fa4..3261151d2 100644
--- a/Windows/main.cpp
+++ b/Windows/main.cpp
@@ -304,12 +304,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
 	case SYSPROP_CAN_JIT:
 		return true;
 	default:
diff --git a/android/jni/app-android.cpp b/android/jni/app-android.cpp
index 2fad16224..8ed6dd9cd 100644
--- a/android/jni/app-android.cpp
+++ b/android/jni/app-android.cpp
@@ -490,12 +490,6 @@ bool System_GetPropertyBool(SystemProperty prop) {
 	case SYSPROP_HAS_FOLDER_BROWSER:
 		// Uses OPEN_DOCUMENT_TREE to let you select a folder.
 		return androidVersion >= 21;  // when ACTION_OPEN_DOCUMENT_TREE was added
-	case SYSPROP_APP_GOLD:
-#ifdef GOLD
-		return true;
-#else
-		return false;
-#endif
 	case SYSPROP_CAN_JIT:
 		return true;
 	case SYSPROP_ANDROID_SCOPED_STORAGE:
diff --git a/ios/main.mm b/ios/main.mm
index e53b7c7ab..fe69647ed 100644
--- a/ios/main.mm
+++ b/ios/main.mm
@@ -148,12 +148,6 @@ bool System_GetPropertyBool(SystemProperty prop) {
 	switch (prop) {
 		case SYSPROP_HAS_BACK_BUTTON:
 			return false;
-		case SYSPROP_APP_GOLD:
-#ifdef GOLD
-			return true;
-#else
-			return false;
-#endif
 		case SYSPROP_CAN_JIT:
 			return g_jitAvailable;

--
2.31.1


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:
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