code:
--- openssh-6.5p1.org/sshd.c
+++ openssh-6.5p1/sshd.c
@@ -44,6 +44,7 @@

 #include "includes.h"

+#include <sys/param.h> /* MAXHOSTNAMELEN */
 #include <sys/types.h>
 #include <sys/ioctl.h>
 #include <sys/socket.h>

repo_name: aarf/bkauler

license: unknown


code:
# lxpanel <profile> config file. Manually editing is not recommended.
# Use preference dialog in lxpanel to adjust config when you can.

Global {
    edge=bottom
    allign=left
    margin=0
    widthtype=percent
    width=100
    height=26
    transparent=0
    tintcolor=#000000
    alpha=0
    autohide=0
    heightwhenhidden=2
    setdocktype=1
    setpartialstrut=1
    usefontcolor=1
    fontsize=10
    fontcolor=#ffffff
    usefontsize=0
    background=1
    backgroundfile=/share/lxpanel/images/background.png
    iconsize=24
}

Plugin {
    type = space
    Config {
        Size=2
    }
}

Plugin {
    type = menu
    Config {
        image=/share/lxde/images/sabotage-menu.png
        system {
        }
        separator {
        }
        item {
            command=run
        }
        separator {
        }
        item {
            image=gnome-logout
            command=logout
        }
    }
}

Plugin {
    type = launchbar
    Config {
        Button {
            id=pcmanfm.desktop
        }
        Button {
            id=xterm.desktop
        }
    }
}

Plugin {
    type = space
    Config {
        Size=4
    }
}

Plugin {
    type = wincmd
    Config {
        image=window-manager
        Button1=iconify
        Button2=shade
        Toggle=0
    }
}

Plugin {
    type = space
    Config {
        Size=4
    }
}

Plugin {
    type = pager
}

Plugin {
    type = space
    Config {
        Size=4
    }
}

Plugin {
    type = taskbar
    expand=1
    Config {
        tooltips=1
        IconsOnly=0
        ShowAllDesks=0
        UseMouseWheel=1
        UseUrgencyHint=1
        FlatButton=1
        MaxTaskWidth=80
        spacing=1
        GroupedTasks=0
    }
}

Plugin {
    type = netstat
}

Plugin {
    type = cpu
}

Plugin {
    type = tray
}

Plugin {
    type = dclock
    Config {
        ClockFmt=%R
        TooltipFmt=%A %x
        BoldFont=0
        IconOnly=0
        CenterText=0
    }
}

path: KEEP/panel


code:
/* Pango
 * querymodules.c:
 *
 * Copyright (C) 1999 Red Hat Software
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */

#include <stdlib.h>
#include "config.h"

#include <glib.h>
#include <gmodule.h>
#include "pango-break.h"
#include "pango-context.h"
#include "pango-impl-utils.h"
#include "pango-engine.h"
#include "pango-enum-types.h"

#include <errno.h>
#include <string.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <glib/gprintf.h>

#ifdef USE_LA_MODULES
#define SOEXT ".la"
#else
#define SOEXT ("." G_MODULE_SUFFIX)
#endif
#define SOEXT_LEN ((int) strlen (SOEXT))

static gboolean
string_needs_escape (const char *str)
{
  while (TRUE)
    {
      char c = *str++;

      if (!c)
	return FALSE;
      else if (c == '\"' || c == '\\' || g_ascii_isspace (c))
	return TRUE;
    }
}

static char *
escape_string (const char *str)
{
  GString *result = g_string_new (NULL);

  while (TRUE)
    {
      char c = *str++;

      switch (c)
	{
	case '\0':
	  goto done;
	case '\n':
	  g_string_append (result, "\\n");
	  break;
	case '\"':
	  g_string_append (result, "\\\"");
	  break;
	case '\\':
	  g_string_append (result, "\\\\");
	  break;
	default:
	  g_string_append_c (result, c);
	}
    }

 done:
  return g_string_free (result, FALSE);
}

#define GET_SYMBOL(module,name,location)                 \
  g_module_symbol (module, name, (gpointer *)(void *)&location)

static const char *
string_from_script (PangoScript script)
{
  static GEnumClass *class = NULL;
  GEnumValue *value;
  if (!class)
    class = g_type_class_ref (PANGO_TYPE_SCRIPT);

  value = g_enum_get_value (class, script);
  if (!value)
    {
      g_warning ("Engine reported invalid script value %d\n", script);
      return string_from_script (PANGO_SCRIPT_INVALID_CODE);
    }

  return value->value_nick;
}

static char* prefix = "";

static void
query_module (const char *dir, const char *name)
{
  void (*list) (PangoEngineInfo **engines, gint *n_engines);
  void (*init) (GTypeModule *module);
  void (*exit) (void);
  PangoEngine *(*create) (const gchar *id);

  GModule *module;
  gchar *path;

  if (g_path_is_absolute (name))
    path = g_strdup (name);
  else
    path = g_build_filename (dir, name, NULL);

  module = g_module_open (path, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);

  if (!module)
    g_printerr ("Cannot load module %s: %s\n", path, g_module_error ());

  if (module &&
      GET_SYMBOL (module, "script_engine_list", list) &&
      GET_SYMBOL (module, "script_engine_init", init) &&
      GET_SYMBOL (module, "script_engine_exit", exit) &&
      GET_SYMBOL (module, "script_engine_create", create))
    {
      gint i,j;
      PangoEngineInfo *engines;
      gint n_engines;

      (*list) (&engines, &n_engines);

      for (i=0; i<n_engines; i++)
	{
	  const gchar *quote;
	  gchar *quoted_path;
	size_t l = strlen(prefix);

	  if (string_needs_escape (path + l))
	    {
	      quote = "\"";
	      quoted_path = escape_string (path + l);
	    }
	  else
	    {
	      quote = "";
	      quoted_path = g_strdup (path + l);
	    }

	  g_printf ("%s%s%s %s %s %s", quote, quoted_path, quote,
		    engines[i].id, engines[i].engine_type, engines[i].render_type);
	  g_free (quoted_path);

	  for (j=0; j < engines[i].n_scripts; j++)
	    {
	      g_printf (" %s:%s",
			string_from_script (engines[i].scripts[j].script),
			engines[i].scripts[j].langs);
	    }
	  g_printf ("\n");
	}
    }
  else
    {
      g_printerr ("%s does not export Pango module API\n", path);
    }

  g_free (path);
  if (module)
    g_module_close (module);
}

static G_GNUC_NORETURN gboolean
show_version(const char *name G_GNUC_UNUSED,
	     const char *arg G_GNUC_UNUSED,
	     gpointer    data G_GNUC_UNUSED,
	     GError    **error G_GNUC_UNUSED)
{
  g_printf("pango-querymodules (%s) %s\n", PACKAGE_NAME, PACKAGE_VERSION);
  g_printf("module interface version: %s\n", MODULE_VERSION);
  exit(0);
}

int
main (int argc, char **argv)
{
  char *cwd;
  int i;
  char *path;
	char buf[4096];

  g_type_init ();

  g_printf ("# Pango Modules file\n"
	    "# Automatically generated file, do not edit\n"
	    "#\n");

  if (argc == 1 || (argc == 2 && !memcmp(argv[1], "prefix=", 7)))		/* No arguments given */
    {
      char **dirs;
      int i;

      path = pango_config_key_get ("Pango/ModulesPath");
      if (!path)
	path = g_build_filename (pango_get_lib_subdirectory (),
				 MODULE_VERSION,
				 "modules",
				 NULL);

	if(argc == 2) prefix=argv[1]+7;
	snprintf(buf, sizeof(buf), "%s%s", prefix, path);

      g_free (path);

	path=buf;

      g_printf ("# ModulesPath = %s\n#\n", path);

      dirs = pango_split_file_list (path);

      for (i=0; dirs[i]; i++)
	{
	  GDir *dir = g_dir_open (dirs[i], 0, NULL);
	  if (dir)
	    {
	      const char *dent;

	      while ((dent = g_dir_read_name (dir)))
		{
		  int len = strlen (dent);
		  if (len > SOEXT_LEN && strcmp (dent + len - SOEXT_LEN, SOEXT) == 0)
		    query_module (dirs[i], dent);
		}

	      g_dir_close (dir);
	    }
	}

      g_strfreev (dirs);
    }
  else
    {
      cwd = g_get_current_dir ();

      for (i=1; i<argc; i++)
	query_module (cwd, argv[i]);

      g_free (cwd);
    }

  return 0;
}


code:
diff -r -c parted-3.2/libparted/fs/xfs/platform_defs.h parted-3.2-fixed/libparted/fs/xfs/platform_defs.h
*** parted-3.2/libparted/fs/xfs/platform_defs.h	Sun Jun 15 18:17:43 2014
--- parted-3.2-fixed/libparted/fs/xfs/platform_defs.h	Sat Oct 11 15:33:49 2014
***************
*** 44,49 ****
--- 44,50 ----
  #include <unistd.h>
  #include <sys/param.h>
  #include <sys/types.h>
+ #include <fcntl.h>

  #if (__GLIBC__ <= 2) && (__GLIBC_MINOR__ <= 1)
  # define constpp	const char * const *


code:
From caa88ed2986eedc121a4e9efbd76459ea4b5b73f Mon Sep 17 00:00:00 2001
From: rofl0r <retnyg@gmx.net>
Date: Fri, 21 Sep 2012 16:38:01 +0200
Subject: [PATCH] update to CVS version from 2012-09-20

---
 man/fragment/version |    2 +-
 scanelf.c            |   11 ++++++++---
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/man/fragment/version b/man/fragment/version
index 36c1955..6ea022b 100644
--- a/man/fragment/version
+++ b/man/fragment/version
@@ -1 +1 @@
-<releaseinfo>0.4</releaseinfo>
+<releaseinfo>cvs</releaseinfo>
diff --git a/scanelf.c b/scanelf.c
index e87ce08..5707cc7 100644
--- a/scanelf.c
+++ b/scanelf.c
@@ -1,13 +1,13 @@
 /*
  * Copyright 2003-2007 Gentoo Foundation
  * Distributed under the terms of the GNU General Public License v2
- * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v 1.244 2012/04/29 06:21:36 vapier Exp $
+ * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v 1.245 2012/08/04 06:08:25 vapier Exp $
  *
  * Copyright 2003-2007 Ned Ludd        - <solar@gentoo.org>
  * Copyright 2004-2007 Mike Frysinger  - <vapier@gentoo.org>
  */

-static const char rcsid[] = "$Id: scanelf.c,v 1.244 2012/04/29 06:21:36 vapier Exp $";
+static const char rcsid[] = "$Id: scanelf.c,v 1.245 2012/08/04 06:08:25 vapier Exp $";
 const char argv0[] = "scanelf";

 #include "paxinc.h"
@@ -1661,8 +1661,13 @@ static int scanelf_fileat(int dir_fd, const char *filename, const struct stat *s
 			return 1;
 	}
 	fd = openat(dir_fd, filename, (fix_elf ? O_RDWR : O_RDONLY) | O_CLOEXEC);
-	if (fd == -1)
+	if (fd == -1) {
+		if (fix_elf && errno == ETXTBSY)
+			warnp("%s: could not fix", filename);
+		else if (be_verbose > 2)
+			printf("%s: skipping file: %s\n", filename, strerror(errno));
 		return 1;
+	}

 	if (scanelf_elf(filename, fd, st->st_size) == 2) {
 		/* if it isn't an ELF, maybe it's an .a archive */
--
1.7.3.4


code:
--- pciutils-3.2.1.org/lib/names-net.c
+++ pciutils-3.2.1/lib/names-net.c
@@ -8,6 +8,7 @@

 #include <string.h>
 #include <stdlib.h>
+#include <stdio.h> /* for sprintf() */

 #include "internal.h"
 #include "names.h"


code:
--- pciutils-3.2.1.org/lib/i386-io-linux.h
+++ pciutils-3.2.1/lib/i386-io-linux.h
@@ -6,11 +6,7 @@
  *	Can be freely distributed and used under the terms of the GNU GPL.
  */

-#ifdef __GLIBC__
 #include <sys/io.h>
-#else
-#include <asm/io.h>
-#endif

 static int
 intel_setup_io(struct pci_access *a UNUSED)


code:
--- pcmanfm-1.0rc1.org/src/Makefile.in
+++ pcmanfm-1.0rc1/src/Makefile.in
@@ -82,7 +82,7 @@
 am_xml_purge_OBJECTS = xml_purge-xml-purge.$(OBJEXT)
 xml_purge_OBJECTS = $(am_xml_purge_OBJECTS)
 xml_purge_DEPENDENCIES = $(am__DEPENDENCIES_1)
-xml_purge_LINK = $(CCLD) $(xml_purge_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+xml_purge_LINK = $(HOSTCC) $(xml_purge_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
 	$(LDFLAGS) -o $@
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/depcomp
@@ -541,11 +541,7 @@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pcmanfm_CFLAGS) $(CFLAGS) -c -o pcmanfm-single-inst.obj `if test -f 'single-inst.c'; then $(CYGPATH_W) 'single-inst.c'; else $(CYGPATH_W) '$(srcdir)/single-inst.c'; fi`

 xml_purge-xml-purge.o: xml-purge.c
-@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xml_purge_CFLAGS) $(CFLAGS) -MT xml_purge-xml-purge.o -MD -MP -MF $(DEPDIR)/xml_purge-xml-purge.Tpo -c -o xml_purge-xml-purge.o `test -f 'xml-purge.c' || echo '$(srcdir)/'`xml-purge.c
-@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/xml_purge-xml-purge.Tpo $(DEPDIR)/xml_purge-xml-purge.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='xml-purge.c' object='xml_purge-xml-purge.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xml_purge_CFLAGS) $(CFLAGS) -c -o xml_purge-xml-purge.o `test -f 'xml-purge.c' || echo '$(srcdir)/'`xml-purge.c
+	$(HOSTCC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xml_purge_CFLAGS) $(CFLAGS) -c -o xml_purge-xml-purge.o `test -f 'xml-purge.c' || echo '$(srcdir)/'`xml-purge.c

 xml_purge-xml-purge.obj: xml-purge.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xml_purge_CFLAGS) $(CFLAGS) -MT xml_purge-xml-purge.obj -MD -MP -MF $(DEPDIR)/xml_purge-xml-purge.Tpo -c -o xml_purge-xml-purge.obj `if test -f 'xml-purge.c'; then $(CYGPATH_W) 'xml-purge.c'; else $(CYGPATH_W) '$(srcdir)/xml-purge.c'; fi`


code:
--- perl-5.16.3.org/cpan/Time-Piece/Piece.xs
+++ perl-5.16.3/cpan/Time-Piece/Piece.xs
@@ -955,7 +955,7 @@

 MODULE = Time::Piece     PACKAGE = Time::Piece

-PROTOTYPES: ENABLE
+PROTOTYPES: DISABLE

 void
 _strftime(fmt, sec, min, hour, mday, mon, year, wday = -1, yday = -1, isdst = -1)


code:
[vars]
filesize=
sha512=

[mirrors]

[deps]

[build]
#patch -p1 < "$K"/some.patch

[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/') \
  --with-sysroot=$butch_root_dir"

CPPFLAGS="-D_GNU_SOURCE" CFLAGS="$optcflags" CXXFLAGS="$optcflags" \
LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
  ./configure -C --prefix="$butch_prefix" --disable-nls $xconfflags

#[ -n "$CROSS_COMPILE" ] && "$K"/libtool.cross.gen --sysroot="$butch_root_dir"

make V=1 -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install


code:
[deps]

[deps.host]
cmake

[build]
mkdir -p build && cd build
for i in ar ld nm objcopy objdump strip ; do
printf '#!/bin/sh\n%s%s "$@"\n' "$CROSS_COMPILE" "$i" > "$CROSS_COMPILE""$i"
chmod +x "$CROSS_COMPILE""$i"
done
[ -n "$CROSS_COMPILE" ] && xconfflags="
-DCMAKE_FIND_ROOT_PATH=$butch_root_dir$butch_prefix \
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
-DCMAKE_AR="$CROSS_COMPILE"ar \
-DCMAKE_LD="$CROSS_COMPILE"ld \
-DCMAKE_NM="$CROSS_COMPILE"nm \
-DCMAKE_OBJCOPY="$CROSS_COMPILE"objcopy \
-DCMAKE_OBJDUMP="$CROSS_COMPILE"objdump \
-DCMAKE_STRIP="$CROSS_COMPILE"strip \
"

CFLAGS="-D_GNU_SOURCE $optcflags" \
LDFLAGS="$optldflags  -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
CXXFLAGS="$optcflags" \
cmake $xconfflags \
  -DCMAKE_INSTALL_PREFIX="$butch_prefix" \
  -DCMAKE_VERBOSE_MAKEFILE=ON \
  ..
make -j$MAKE_THREADS VERBOSE=1
make DESTDIR="$butch_install_dir" install


code:
[deps]
git

[build]

dest="$S/build/"
baseurl=git://github.com/rofl0r/
repo=reponame

if [ -d "$dest/${repo}-git" ] ; then
	cd "$dest/${repo}-git"
	git pull || exit 1
else
	mkdir -p "$dest"
	cd "$dest"
	git clone ${baseurl}${repo} ${repo}-git || exit 1
	cd ${repo}-git
fi

echo prefix=/ > config.mak
make clean
make -j$MAKE_THREADS || exit 1
make DESTDIR="$butch_install_dir" install || exit 1


code:
[deps]
go
git

[build]
repo="github.com/user/repo"

dest="$butch_install_dir""$butch_prefix"
srcdest="$S"/build/"$butch_package_name"
GOROOT="$butch_root_dir"/opt/go GOPATH="$dest" go get "$repo"
[ -d "$srcdest" ] && rm -rf "$srcdest"
mv -f "$dest"/src "$srcdest"


code:
[mirrors]

[vars]

[deps.host]
perl

[deps.run]
perl

[deps]

[build]
perl Makefile.PL
make -j$MAKE_THREADS
[ -z "$CROSS_COMPILE" ] && make test
make DESTDIR="$butch_install_dir" install


code:
[mirrors]

[vars]

[deps.run]
python

[deps.host]
python
wget

[build]
python setup.py build
python setup.py install --prefix="$butch_prefix" \
       --root="$butch_install_dir"


code:
From 7cae28f35a80a069f51ae4dfc3f9e2550527f372 Mon Sep 17 00:00:00 2001
From: rofl0r <retnyg@gmx.net>
Date: Fri, 28 Sep 2012 00:02:04 +0200
Subject: [PATCH] remove superfluous is_system_libdir check

this caused -L/lib not being printed when prefix= was used.
the test was bogus anyway, because it used strcmp on non-reduced paths
directly. so //lib and /lib were 2 different things, when in reality
they are not.
---
 main.c |   21 ---------------------
 1 files changed, 0 insertions(+), 21 deletions(-)

diff --git a/main.c b/main.c
index a5eff0a..345846b 100644
--- a/main.c
+++ b/main.c
@@ -55,24 +55,6 @@ static char *sysroot_dir = NULL;

 FILE *error_msgout = NULL;

-static bool
-fragment_has_system_dir(pkg_fragment_t *frag)
-{
-	switch (frag->type)
-	{
-	case 'L':
-		if ((want_flags & PKG_KEEP_SYSTEM_CFLAGS) == 0 && !strcasecmp(SYSTEM_LIBDIR, frag->data))
-			return true;
-	case 'I':
-		if ((want_flags & PKG_KEEP_SYSTEM_LIBS) == 0 && !strcasecmp(SYSTEM_INCLUDEDIR, frag->data))
-			return true;
-	default:
-		break;
-	}
-
-	return false;
-}
-
 static inline const char *
 print_sysroot_dir(pkg_fragment_t *frag)
 {
@@ -93,9 +75,6 @@ print_sysroot_dir(pkg_fragment_t *frag)
 static void
 print_fragment(pkg_fragment_t *frag)
 {
-	if (fragment_has_system_dir(frag))
-		return;
-
 	if (frag->type)
 		printf("-%c%s%s ", frag->type, print_sysroot_dir(frag), frag->data);
 	else
--
1.7.3.4


code:
From 52cfc6486d0ee00c64ac16e890ebd46e81dcbff2 Mon Sep 17 00:00:00 2001
From: rofl0r <retnyg@gmx.net>
Date: Fri, 25 Dec 2015 16:21:50 +0000
Subject: [PATCH] fix for sysroot being appended if already in path

if a package uses PKG_CONFIG_PATH with a (at least relative) path that
resides into its src dir, and that src dir is a childpath of sysroot,
previously that path got expanded to an absolute pathname and erroneously
prefixed with sysroot.
for example with audacity
-I /sysroot-mips/include/sysroot-mips/src/build/audacity/lib-src/lib-widget-extra
---
 main.c | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 74 insertions(+), 3 deletions(-)

diff --git a/main.c b/main.c
index 345846b..b688855 100644
--- a/main.c
+++ b/main.c
@@ -72,12 +72,83 @@ print_sysroot_dir(pkg_fragment_t *frag)
 	return "";
 }

+/* removes multiple slashes, /./ style stuff and resolves ../ kind of stuff on _absolute_ paths.
+ * will always strip trailing slashes.
+ * will fail with relative paths. (C) 2015 rofl0r */
+static char* normalizepath(const char* path, char* out) {
+	size_t i, out_size = 0;
+	char* tmp;
+	if(path[0] != '/') goto fail;
+	for(i = 0; path[i]; i++) switch(path[i]) {
+		case '/':
+			while(path[i+1] == '/') i++;
+			if(!out_size || out[out_size -1] != '/') goto copy;
+			break;
+		case '.':
+			if(!i || !out_size) goto fail;
+			else if(path[i-1] == '/' && out[out_size -1] == '/') {
+				out_size--;
+				switch(path[i+1]) {
+					case '.':
+						if((!path[i+2] || path[i+2] == '/')) {
+							tmp = out + out_size;
+							while(--tmp > out && *tmp != '/');
+							if(tmp >= out && *tmp == '/') {
+								out_size = tmp - out;
+								i += 2;
+								goto restore;
+							} else {
+								fail:
+								return 0;
+							}
+						}
+						goto def;
+					case '/':
+						i++;
+						restore:
+						out_size++;
+						if(!path[i]) goto done;
+						break;
+					case 0:
+						goto restore;
+					default:
+						def:
+						out_size++;
+						goto copy;
+						break;
+				}
+			} else goto copy;
+			break;
+		default:
+			copy:
+			out[out_size++] = path[i];
+			break;
+	}
+	done:
+	if(out_size > 1 && out[out_size -1] == '/')
+		out_size--; // remove trailing slash
+	out[out_size] = 0;
+	return out;
+}
+#include <limits.h>
 static void
 print_fragment(pkg_fragment_t *frag)
 {
-	if (frag->type)
-		printf("-%c%s%s ", frag->type, print_sysroot_dir(frag), frag->data);
-	else
+	if (frag->type) {
+		char b1[PATH_MAX], b2[PATH_MAX];
+		const char *sr = print_sysroot_dir(frag);
+		/* check that the include path does not already contain sysroot.
+		   this will happen for instance if a caller uses
+		   PKG_CONFIG_PATH to point to a .pc file embedded into its
+		   src tree if the src tree is a subdir of the sysroot */
+		if(*sr && normalizepath(sr, b1) &&
+		   normalizepath(frag->data, b2) &&
+		   !strncmp(b1, b2, strlen(b1)))
+			printf("-%c%s ", frag->type, b2);
+		else
+			printf("-%c%s%s ", frag->type, sr, frag->data);
+
+	} else
 		printf("%s ", frag->data);
 }

--
1.8.4


code:
--- poppler-0.22.0.org/poppler/GlobalParams.cc	2013-01-09 15:10:49.947000004 +0000
+++ poppler-0.22.0/poppler/GlobalParams.cc	2013-01-09 16:54:48.168000002 +0000
@@ -1088,10 +1088,10 @@

   const char *lang = getFontLang(font);

-  p = FcPatternBuild(NULL,
+  p = FcPatternBuild(0,
                     FC_FAMILY, FcTypeString, family,
                     FC_LANG, FcTypeString, lang,
-                    NULL);
+                    (void*) 0);
   if (slant != -1) FcPatternAddInteger(p, FC_SLANT, slant);
   if (weight != -1) FcPatternAddInteger(p, FC_WEIGHT, weight);
   if (width != -1) FcPatternAddInteger(p, FC_WIDTH, width);


code:
--- portablexdr-4.9.1.org/rpc/types.h	2013-10-27 04:35:07.704190969 +0000
+++ portablexdr-4.9.1/rpc/types.h	2013-10-27 04:38:36.456193768 +0000
@@ -35,15 +35,12 @@
 #ifndef __TYPES_RPC_HEADER__
 #define __TYPES_RPC_HEADER__

+#undef _BSD_SOURCE
+#define _BSD_SOURCE
+#undef _GNU_SOURCE
+#define _GNU_SOURCE
 #include <stdint.h>
-
-typedef unsigned char u_char;
-typedef uint16_t      u_short;
-typedef uint32_t      u_int;
-typedef unsigned long u_long;
-typedef uint64_t      u_quad_t;
-typedef int64_t       quad_t;
-typedef char *        caddr_t;
+#include <sys/types.h>

 #ifndef TRUE
 #define TRUE 1


code:
compatibility_level = 2
inet_interfaces = all
myhostname = mail.localdomain

virtual_alias_maps = hash:/etc/postfix/virtual

smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_tls_auth_only = yes
smtpd_tls_cert_file=/etc/postfix/postfix.crt
smtpd_tls_key_file=/etc/postfix/postfix.key
smtpd_tls_mandatory_ciphers = high
smtpd_tls_protocols = TLSv1.2, TLSv1.1, TLSv1, !SSLv3, !SSLv2
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:/var/spool/postfix/smtpd_tls_cache
tls_high_cipherlist = AES+EECDH:AES+EDH:+AES256
tls_random_source = dev:/dev/urandom

command_directory = /bin
daemon_directory = /lib/postfix
data_directory = /var/lib/postfix
html_directory = no
mailq_path = /bin/mailq
manpage_directory = /share/man
newaliases_path = /bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = no
sendmail_path = /sbin/sendmail

home_mailbox = Maildir/
mail_owner = postfix
setgid_group = postdrop


code:
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
smtp      inet  n       -       n       -       -       smtpd
submission inet n       -       n       -       -       smtpd -v
  -o smtpd_tls_security_level=encrypt
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_reject_unlisted_recipient=no
  -o smtpd_recipient_restrictions=permit_mynetworks,permit_inet_interfaces,permit_auth_destination,permit_sasl_authenticated,reject
pickup    unix  n       -       n       60      1       pickup
cleanup   unix  n       -       n       -       0       cleanup
qmgr      unix  n       -       n       300     1       qmgr
tlsmgr    unix  -       -       n       1000?   1       tlsmgr
rewrite   unix  -       -       n       -       -       trivial-rewrite
bounce    unix  -       -       n       -       0       bounce
defer     unix  -       -       n       -       0       bounce
trace     unix  -       -       n       -       0       bounce
verify    unix  -       -       n       -       1       verify
flush     unix  n       -       n       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       n       -       -       smtp
relay     unix  -       -       n       -       -       smtp
showq     unix  n       -       n       -       -       showq
error     unix  -       -       n       -       -       error
retry     unix  -       -       n       -       -       error
discard   unix  -       -       n       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       n       -       -       lmtp
anvil     unix  -       -       n       -       1       anvil
scache    unix  -       -       n       -       1       scache


code:
# (address-match) (mbox-destination)

# catchall-example.com	DOMAIN
# @catchall-example.com	user1
# a@catchall-example.com	user2
# b@catchall-example.com	user3

# For the next example, add this to /etc/aliases:
# nobody:		/dev/null
# Then run 'postalias /etc/aliases'

# killfile-example.com	DOMAIN
# spam@killfile-example.com	nobody
# junk@killfile-example.com	nobody
# @killfile-example.com	user1

example@removeme.com root

path: KEEP/postfix-virtual


code:
#define PT_R0   0
#define PT_R1   1
#define PT_R2   2
#define PT_R3   3
#define PT_R4   4
#define PT_R5   5
#define PT_R6   6
#define PT_R7   7
#define PT_R8   8
#define PT_R9   9
#define PT_R10  10
#define PT_R11  11
#define PT_R12  12
#define PT_R13  13
#define PT_R14  14
#define PT_R15  15
#define PT_R16  16
#define PT_R17  17
#define PT_R18  18
#define PT_R19  19
#define PT_R20  20
#define PT_R21  21
#define PT_R22  22
#define PT_R23  23
#define PT_R24  24
#define PT_R25  25
#define PT_R26  26
#define PT_R27  27
#define PT_R27  27
#define PT_R28  28
#define PT_R29  29
#define PT_R30  30
#define PT_R31  31
#define PT_NIP  32
#define PT_MSR  33
#define PT_ORIG_R3 34
#define PT_CTR  35
#define PT_LNK  36
#define PT_XER  37
#define PT_CCR  38
#define PT_MQ   39
#define PT_TRAP 40
#define PT_DAR  41
#define PT_DSISR 42
#define PT_RESULT 43
#define PT_REGS_COUNT 44
#define PT_FPR0 48
#define PT_FPR31 (PT_FPR0 + 2*31)
#define PT_FPSCR (PT_FPR0 + 2*32 + 1)


code:
diff --git a/include/net/ppp_defs.h b/include/net/ppp_defs.h
index b06eda5..dafa36c 100644
--- a/include/net/ppp_defs.h
+++ b/include/net/ppp_defs.h
@@ -38,6 +38,8 @@
 #ifndef _PPP_DEFS_H_
 #define _PPP_DEFS_H_

+#include <sys/time.h>
+
 /*
  * The basic PPP frame.
  */
diff --git a/pppd/Makefile.linux b/pppd/Makefile.linux
index a74c914..7acd2cf 100644
--- a/pppd/Makefile.linux
+++ b/pppd/Makefile.linux
@@ -126,7 +126,7 @@ LIBS	+= -lcrypt
 endif

 ifdef USE_LIBUTIL
-CFLAGS	+= -DHAVE_LOGWTMP=1
+#CFLAGS	+= -DHAVE_LOGWTMP=1
 LIBS	+= -lutil
 endif

diff --git a/pppd/magic.h b/pppd/magic.h
index c81213b..305aece 100644
--- a/pppd/magic.h
+++ b/pppd/magic.h
@@ -42,6 +42,8 @@
  * $Id: magic.h,v 1.5 2003/06/11 23:56:26 paulus Exp $
  */

+#include <sys/cdefs.h>
+
 void magic_init __P((void));	/* Initialize the magic number generator */
 u_int32_t magic __P((void));	/* Returns the next magic number */

diff --git a/pppd/plugins/rp-pppoe/if.c b/pppd/plugins/rp-pppoe/if.c
index 91e9a57..9c0fac3 100644
--- a/pppd/plugins/rp-pppoe/if.c
+++ b/pppd/plugins/rp-pppoe/if.c
@@ -30,10 +30,6 @@ static char const RCSID[] =
 #include <linux/if_packet.h>
 #endif

-#ifdef HAVE_NET_ETHERNET_H
-#include <net/ethernet.h>
-#endif
-
 #ifdef HAVE_ASM_TYPES_H
 #include <asm/types.h>
 #endif
diff --git a/pppd/plugins/rp-pppoe/plugin.c b/pppd/plugins/rp-pppoe/plugin.c
index a8c2bb4..ca34d79 100644
--- a/pppd/plugins/rp-pppoe/plugin.c
+++ b/pppd/plugins/rp-pppoe/plugin.c
@@ -46,7 +46,6 @@ static char const RCSID[] =
 #include <unistd.h>
 #include <fcntl.h>
 #include <signal.h>
-#include <net/ethernet.h>
 #include <net/if_arp.h>
 #include <linux/ppp_defs.h>
 #include <linux/if_pppox.h>
diff --git a/pppd/plugins/rp-pppoe/pppoe-discovery.c b/pppd/plugins/rp-pppoe/pppoe-discovery.c
index 3d3bf4e..b5f82d3 100644
--- a/pppd/plugins/rp-pppoe/pppoe-discovery.c
+++ b/pppd/plugins/rp-pppoe/pppoe-discovery.c
@@ -27,10 +27,6 @@
 #include <linux/if_packet.h>
 #endif

-#ifdef HAVE_NET_ETHERNET_H
-#include <net/ethernet.h>
-#endif
-
 #ifdef HAVE_ASM_TYPES_H
 #include <asm/types.h>
 #endif
@@ -55,6 +51,8 @@ void die(int status)
 	exit(status);
 }

+#define error(x...) fprintf(stderr, x)
+
 /* Initialize frame types to RFC 2516 values.  Some broken peers apparently
    use different frame types... sigh... */

diff --git a/pppd/plugins/rp-pppoe/pppoe.h b/pppd/plugins/rp-pppoe/pppoe.h
index 9ab2eee..4d68147 100644
--- a/pppd/plugins/rp-pppoe/pppoe.h
+++ b/pppd/plugins/rp-pppoe/pppoe.h
@@ -86,18 +86,6 @@ typedef unsigned long UINT32_t;

 #include <netinet/in.h>

-#ifdef HAVE_NETINET_IF_ETHER_H
-#include <sys/types.h>
-
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#ifndef HAVE_SYS_DLPI_H
-#include <netinet/if_ether.h>
-#endif
-#endif
-
-

 /* Ethernet frame types according to RFC 2516 */
 #define ETH_PPPOE_DISCOVERY 0x8863
diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c
index 6d71530..86d224e 100644
--- a/pppd/sys-linux.c
+++ b/pppd/sys-linux.c
@@ -102,19 +102,11 @@
 #define MAX_ADDR_LEN 7
 #endif

-#if __GLIBC__ >= 2
 #include <asm/types.h>		/* glibc 2 conflicts with linux/types.h */
 #include <net/if.h>
 #include <net/if_arp.h>
 #include <net/route.h>
 #include <netinet/if_ether.h>
-#else
-#include <linux/types.h>
-#include <linux/if.h>
-#include <linux/if_arp.h>
-#include <linux/route.h>
-#include <linux/if_ether.h>
-#endif
 #include <netinet/in.h>
 #include <arpa/inet.h>


code:
--- psmisc-22.19.org/src/pstree.c
+++ psmisc-22.19/src/pstree.c
@@ -33,9 +33,13 @@
 #include <getopt.h>
 #include <pwd.h>
 #include <dirent.h>
-#include <curses.h>
-#include <term.h>
 #include <termios.h>
+#include <termcap.h>
+
+#define tigetstr(X) NULL
+#define OK 0
+#define setupterm(X, Y, Z) OK
+
 #include <langinfo.h>
 #include <assert.h>
 #include <sys/types.h>


code:
From: Nirav Patel
Subject: Patch from Martijn Schmidt. Remove V4L support.
 With modifications by Nirav Patel.  V4L has effectively
 been deprecated from the Linux kernel as of 2.6.38. Support
 in pygame was just a placeholder, and removing it
 will not change any functionality.
Origin: Upstream, http://svn.seul.org/viewcvs/viewvc.cgi?view=rev&root=PyGame&revision=3077
Bug-Ubuntu: http://bugs.launchpad.net/bugs/755980
Last-Update: 2011-06-20

Upstream-Commit-Date: 2011-04-23 14:39:19 -0400
Comments-Ubuntu:
 Minor changes made by Scott Moser to apply upstream patch to 1.9.1release
 This patch can be dropped when 1.9.2 is released and integrated.
--- a/Setup.in
+++ b/Setup.in
@@ -34,7 +34,7 @@ _numericsurfarray src/_numericsurfarray.
 _numericsndarray src/_numericsndarray.c $(SDL) $(MIXER) $(DEBUG)
 movie src/movie.c $(SDL) $(SMPEG) $(DEBUG)
 scrap src/scrap.c $(SDL) $(SCRAP) $(DEBUG)
-_camera src/_camera.c src/camera_v4l2.c src/camera_v4l.c $(SDL) $(DEBUG)
+_camera src/_camera.c src/camera_v4l2.c $(SDL) $(DEBUG)
 pypm src/pypm.c $(SDL) $(PORTMIDI) $(PORTTIME) $(DEBUG)

 GFX = src/SDL_gfx/SDL_gfxPrimitives.c
--- a/pygame.egg-info/SOURCES.txt
+++ b/pygame.egg-info/SOURCES.txt
@@ -241,7 +241,6 @@ src/bitmask.h
 src/bufferproxy.c
 src/camera.doc
 src/camera.h
-src/camera_v4l.c
 src/camera_v4l2.c
 src/cdrom.c
 src/cdrom.doc
@@ -465,4 +464,4 @@ test/util/build_page/results/.htaccess
 test/util/build_page/results/index.py
 test/util/build_page/results/results.css
 test/util/build_page/upload_results/.htaccess
-test/util/build_page/upload_results/index.py
\ No newline at end of file
+test/util/build_page/upload_results/index.py
--- a/src/_camera.c
+++ b/src/_camera.c
@@ -22,7 +22,7 @@
  * Author: Nirav Patel
  *
  * This module allows for use of v4l2 webcams in pygame.  The code is written
- * such that adding support for v4l or vfw cameras should be possible without
+ * such that adding support for vfw cameras should be possible without
  * much modification of existing functions.  v4l2 functions are kept seperate
  * from functions available to pygame users and generic functions like
  * colorspace conversion.
@@ -160,20 +160,8 @@ PyObject* camera_start (PyCameraObject*
 {
 #if defined(__unix__)
     if (v4l2_open_device(self) == 0) {
-        if (v4l_open_device(self) == 0) {
-            v4l2_close_device(self);
-            return NULL;
-        } else {
-            self->camera_type = CAM_V4L;
-            if (v4l_init_device(self) == 0) {
-                v4l2_close_device(self);
-                return NULL;
-            }
-            if (v4l_start_capturing(self) == 0) {
-                v4l2_close_device(self);
-                return NULL;
-            }
-        }
+        v4l2_close_device(self);
+        return NULL;
     } else {
         self->camera_type = CAM_V4L2;
         if (v4l2_init_device(self) == 0) {
--- a/src/camera.h
+++ b/src/camera.h
@@ -39,7 +39,6 @@

     #include <asm/types.h>          /* for videodev2.h */

-    #include <linux/videodev.h>
     #include <linux/videodev2.h>
 #endif

@@ -51,7 +50,7 @@
 #define RGB_OUT 1
 #define YUV_OUT 2
 #define HSV_OUT 4
-#define CAM_V4L 1
+#define CAM_V4L 1 /* deprecated. the incomplete support in pygame was removed */
 #define CAM_V4L2 2

 struct buffer
@@ -111,8 +110,4 @@ int v4l2_init_device (PyCameraObject* se
 int v4l2_close_device (PyCameraObject* self);
 int v4l2_open_device (PyCameraObject* self);

-/* internal functions specific to v4l */
-int v4l_open_device (PyCameraObject* self);
-int v4l_init_device(PyCameraObject* self);
-int v4l_start_capturing(PyCameraObject* self);
 #endif
--- a/src/camera_v4l.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
-  pygame - Python Game Library
-
-  This library is free software; you can redistribute it and/or
-  modify it under the terms of the GNU Library General Public
-  License as published by the Free Software Foundation; either
-  version 2 of the License, or (at your option) any later version.
-
-  This library is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  Library General Public License for more details.
-
-  You should have received a copy of the GNU Library General Public
-  License along with this library; if not, write to the Free
-  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-*/
-#if defined(__unix__)
-#include "camera.h"
-
-/*
- * V4L functions
- */
-
-int v4l_open_device (PyCameraObject* self)
-{
-    struct stat st;
-    struct video_capability cap;
-    struct video_mbuf buf;
-
-    if (-1 == stat (self->device_name, &st)) {
-        PyErr_Format(PyExc_SystemError, "Cannot identify '%s': %d, %s",
-            self->device_name, errno, strerror (errno));
-        return 0;
-    }
-
-    if (!S_ISCHR (st.st_mode)) {
-        PyErr_Format(PyExc_SystemError, "%s is no device",self->device_name);
-        return 0;
-    }
-
-    self->fd = open (self->device_name, O_RDWR /* required | O_NONBLOCK */, 0);
-
-    if (-1 == self->fd) {
-        PyErr_Format(PyExc_SystemError, "Cannot open '%s': %d, %s",
-            self->device_name, errno, strerror (errno));
-        return 0;
-    }
-
-    if(ioctl(self->fd, VIDIOCGCAP, cap) == -1) {
-        PyErr_Format(PyExc_SystemError, "%s is not a V4L device",
-            self->device_name);
-	return 0;
-    }
-
-    if(!(cap.type & VID_TYPE_CAPTURE)) {
-        PyErr_Format(PyExc_SystemError, "%s is not a video capture device",
-            self->device_name);
-        return 0;
-    }
-
-    if( ioctl(self->fd , VIDIOCGMBUF , buf ) == -1 ) {
-        PyErr_Format(PyExc_SystemError, "%s does not support streaming i/o",
-            self->device_name);
-	return 0;
-    }
-
-    return 1;
-}
-
-int v4l_init_device(PyCameraObject* self)
-{
-    return 0;
-}
-
-int v4l_start_capturing(PyCameraObject* self)
-{
-    return 0;
-}
-#endif


code:
Submitted By: Andrew Benton <andy@benton.eu.com>
Date: 2012-03-29
Initial Package Version: 2.28.6
Upstream Status: not submitted
Origin: me
Description: Fixes compiling with a recent version of gobject-introspection

--- pygobject-2.28.6/gi/pygi-info.c-orig	2012-03-29 02:27:37.494228732 +0100
+++ pygobject-2.28.6/gi/pygi-info.c	2012-03-29 02:26:37.735132310 +0100
@@ -162,9 +162,6 @@
         case GI_INFO_TYPE_CONSTANT:
             type = &PyGIConstantInfo_Type;
             break;
-        case GI_INFO_TYPE_ERROR_DOMAIN:
-            type = &PyGIErrorDomainInfo_Type;
-            break;
         case GI_INFO_TYPE_UNION:
             type = &PyGIUnionInfo_Type;
             break;
@@ -481,7 +478,6 @@
                 case GI_INFO_TYPE_INVALID:
                 case GI_INFO_TYPE_FUNCTION:
                 case GI_INFO_TYPE_CONSTANT:
-                case GI_INFO_TYPE_ERROR_DOMAIN:
                 case GI_INFO_TYPE_VALUE:
                 case GI_INFO_TYPE_SIGNAL:
                 case GI_INFO_TYPE_PROPERTY:
@@ -860,7 +856,6 @@
                     case GI_INFO_TYPE_INVALID:
                     case GI_INFO_TYPE_FUNCTION:
                     case GI_INFO_TYPE_CONSTANT:
-                    case GI_INFO_TYPE_ERROR_DOMAIN:
                     case GI_INFO_TYPE_VALUE:
                     case GI_INFO_TYPE_SIGNAL:
                     case GI_INFO_TYPE_PROPERTY:


code:
patch taken from openADK

--- Python-2.7.7/setup.py	2014-05-31 20:58:40.000000000 +0200
+++ Python-2.7.7.patched/setup.py	2014-12-05 18:36:23.166398725 +0100
@@ -74,7 +74,7 @@
     'paths' is a list of additional locations to check; if the file is
         found in one of them, the resulting list will contain the directory.
     """
-    if host_platform == 'darwin':
+    if host_platform == 'darwin' and not cross_compiling:
         # Honor the MacOSX SDK setting when one was specified.
         # An SDK is a directory with the same structure as a real
         # system, but with only header files and libraries.
@@ -84,7 +84,7 @@
     for dir in std_dirs:
         f = os.path.join(dir, filename)

-        if host_platform == 'darwin' and is_macosx_sdk_path(dir):
+        if host_platform == 'darwin' and is_macosx_sdk_path(dir) and not cross_compiling:
             f = os.path.join(sysroot, dir[1:], filename)

         if os.path.exists(f): return []
@@ -93,7 +93,7 @@
     for dir in paths:
         f = os.path.join(dir, filename)

-        if host_platform == 'darwin' and is_macosx_sdk_path(dir):
+        if host_platform == 'darwin' and is_macosx_sdk_path(dir) and not cross_compiling:
             f = os.path.join(sysroot, dir[1:], filename)

         if os.path.exists(f):
@@ -107,7 +107,7 @@
     if result is None:
         return None

-    if host_platform == 'darwin':
+    if host_platform == 'darwin' and not cross_compiling:
         sysroot = macosx_sdk_root()

     # Check whether the found file is in one of the standard directories
@@ -116,7 +116,7 @@
         # Ensure path doesn't end with path separator
         p = p.rstrip(os.sep)

-        if host_platform == 'darwin' and is_macosx_sdk_path(p):
+        if host_platform == 'darwin' and is_macosx_sdk_path(p) and not cross_compiling:
             if os.path.join(sysroot, p[1:]) == dirname:
                 return [ ]

@@ -129,7 +129,7 @@
         # Ensure path doesn't end with path separator
         p = p.rstrip(os.sep)

-        if host_platform == 'darwin' and is_macosx_sdk_path(p):
+        if host_platform == 'darwin' and is_macosx_sdk_path(p) and not cross_compiling:
             if os.path.join(sysroot, p[1:]) == dirname:
                 return [ p ]

@@ -162,6 +162,7 @@

     def build_extensions(self):

+        self.compiler.library_dirs = []
         # Detect which modules should be compiled
         missing = self.detect_modules()

@@ -281,6 +282,7 @@

     def build_extension(self, ext):

+
         if ext.name == '_ctypes':
             if not self.configure_ctypes(ext):
                 return
@@ -442,7 +444,8 @@
             add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
         if cross_compiling:
             self.add_gcc_paths()
-        self.add_multiarch_paths()
+        if not cross_compiling:
+            self.add_multiarch_paths()

         # Add paths specified in the environment variables LDFLAGS and
         # CPPFLAGS for header and library files.
@@ -479,7 +482,8 @@
                         add_dir_to_list(dir_list, directory)

         if os.path.normpath(sys.prefix) != '/usr' \
-                and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
+                and not sysconfig.get_config_var('PYTHONFRAMEWORK') \
+                and not cross_compiling:
             # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
             # (PYTHONFRAMEWORK is set) to avoid # linking problems when
             # building a framework with different architectures than
@@ -497,8 +501,13 @@
         # lib_dirs and inc_dirs are used to search for files;
         # if a file is found in one of those directories, it can
         # be assumed that no additional -I,-L directives are needed.
+        if cross_compiling:
+            add_dir_to_list(self.compiler.library_dirs,
+                            sysconfig.get_config_var('srcdir'))
+
         inc_dirs = self.compiler.include_dirs[:]
         lib_dirs = self.compiler.library_dirs[:]
+
         if not cross_compiling:
             for d in (
                 '/usr/include',
@@ -532,7 +541,7 @@
         if host_platform == 'hp-ux11':
             lib_dirs += ['/usr/lib/hpux64', '/usr/lib/hpux32']

-        if host_platform == 'darwin':
+        if host_platform == 'darwin' and not cross_compiling:
             # This should work on any unixy platform ;-)
             # If the user has bothered specifying additional -I and -L flags
             # in OPT and LDFLAGS we might as well use them here.


code:
--- Python-2.7.6.org/Makefile.pre.in
+++ Python-2.7.6/Makefile.pre.in
@@ -597,8 +598,8 @@

 $(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS)
 		@$(MKDIR_P) Include
-		$(MAKE) $(PGEN)
-		$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
+		true
+		$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
 $(GRAMMAR_C): $(GRAMMAR_H) $(GRAMMAR_INPUT) $(PGENSRCS)
 		$(MAKE) $(GRAMMAR_H)
 		touch $(GRAMMAR_C)
@@ -1005,28 +1006,6 @@
 		$(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
 			$(DESTDIR)$(LIBDEST)/distutils/tests ; \
 	fi
-	PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
-		$(PYTHON_FOR_BUILD) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
-		-d $(LIBDEST) -f \
-		-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
-		$(DESTDIR)$(LIBDEST)
-	PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
-		$(PYTHON_FOR_BUILD) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
-		-d $(LIBDEST) -f \
-		-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
-		$(DESTDIR)$(LIBDEST)
-	-PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
-		$(PYTHON_FOR_BUILD) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
-		-d $(LIBDEST)/site-packages -f \
-		-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
-	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
-		$(PYTHON_FOR_BUILD) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
-		-d $(LIBDEST)/site-packages -f \
-		-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
-	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
-		$(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
-	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
-		$(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt

 # Create the PLATDIR source directory, if one wasn't distributed..
 $(srcdir)/Lib/$(PLATDIR):


code:
--- Python-2.7.10.org/Modules/_cursesmodule.c
+++ Python-2.7.10/Modules/_cursesmodule.c
@@ -113,11 +113,13 @@
 #define CURSES_MODULE
 #include "py_curses.h"

+#ifdef REAL_NCURSES
 /*  These prototypes are in <term.h>, but including this header
     #defines many common symbols (such as "lines") which breaks the
     curses module in other ways.  So the code will just specify
     explicit prototypes here. */
 extern int setupterm(char *,int,int *);
+#endif
 #ifdef __sgi
 #include <term.h>
 #endif
@@ -130,6 +132,10 @@
 #if defined(_AIX)
 #define STRICT_SYSV_CURSES
 #endif
+#ifndef REAL_NCURSES
+#include <termcap.h>
+#include <term.h>
+#endif

 /* Definition of exception curses.error */

@@ -312,7 +318,9 @@
 Window_NoArgNoReturnVoidFunction(wclear)

 Window_OneArgNoReturnVoidFunction(idcok, int, "i;True(1) or False(0)")
+#ifdef REAL_NCURSES
 Window_OneArgNoReturnVoidFunction(immedok, int, "i;True(1) or False(0)")
+#endif
 Window_OneArgNoReturnVoidFunction(wtimeout, int, "i;delay")

 Window_NoArg2TupleReturnFunction(getyx, int, "ii")
@@ -336,7 +344,9 @@
 Window_OneArgNoReturnFunction(notimeout, int, "i;True(1) or False(0)")
 Window_OneArgNoReturnFunction(scrollok, int, "i;True(1) or False(0)")
 Window_OneArgNoReturnFunction(winsdelln, int, "i;nlines")
+#ifdef REAL_NCURSES
 Window_OneArgNoReturnFunction(syncok, int, "i;True(1) or False(0)")
+#endif

 Window_TwoArgNoReturnFunction(mvwin, int, "ii;y,x")
 Window_TwoArgNoReturnFunction(mvderwin, int, "ii;y,x")
@@ -806,7 +816,7 @@
         return NULL;
     }

-#ifdef WINDOW_HAS_FLAGS
+#if defined(WINDOW_HAS_FLAGS) && defined(REAL_NCURSES)
     if (self->win->_flags & _ISPAD)
         return PyCursesCheckERR(pechochar(self->win, ch | attr),
                                 "echochar");
@@ -1234,7 +1244,7 @@
     int pminrow,pmincol,sminrow,smincol,smaxrow,smaxcol;
     int rtn;

-#ifndef WINDOW_HAS_FLAGS
+#if !defined(WINDOW_HAS_FLAGS) || !defined(REAL_NCURSES)
     if (0)
 #else
         if (self->win->_flags & _ISPAD)
@@ -1377,7 +1387,7 @@
     int pminrow,pmincol,sminrow,smincol,smaxrow,smaxcol;
     int rtn;

-#ifndef WINDOW_HAS_FLAGS
+#if !defined(WINDOW_HAS_FLAGS) || !defined(REAL_NCURSES)
     if (0)
 #else
         if (self->win->_flags & _ISPAD)
@@ -1446,7 +1456,7 @@
     }

     /* printf("Subwin: %i %i %i %i   \n", nlines, ncols, begin_y, begin_x); */
-#ifdef WINDOW_HAS_FLAGS
+#if defined(WINDOW_HAS_FLAGS) && defined(REAL_NCURSES)
     if (self->win->_flags & _ISPAD)
         win = subpad(self->win, nlines, ncols, begin_y, begin_x);
     else
@@ -1580,7 +1590,9 @@
     {"hline",           (PyCFunction)PyCursesWindow_Hline, METH_VARARGS},
     {"idcok",           (PyCFunction)PyCursesWindow_idcok, METH_VARARGS},
     {"idlok",           (PyCFunction)PyCursesWindow_idlok, METH_VARARGS},
+#ifdef REAL_NCURSES
     {"immedok",         (PyCFunction)PyCursesWindow_immedok, METH_VARARGS},
+#endif
     {"inch",            (PyCFunction)PyCursesWindow_InCh, METH_VARARGS},
     {"insch",           (PyCFunction)PyCursesWindow_InsCh, METH_VARARGS},
     {"insdelln",        (PyCFunction)PyCursesWindow_winsdelln, METH_VARARGS},
@@ -1618,7 +1630,9 @@
     {"subpad",          (PyCFunction)PyCursesWindow_SubWin, METH_VARARGS},
     {"subwin",          (PyCFunction)PyCursesWindow_SubWin, METH_VARARGS},
     {"syncdown",        (PyCFunction)PyCursesWindow_wsyncdown, METH_NOARGS},
+#ifdef REAL_NCURSES
     {"syncok",          (PyCFunction)PyCursesWindow_syncok, METH_VARARGS},
+#endif
     {"syncup",          (PyCFunction)PyCursesWindow_wsyncup, METH_NOARGS},
     {"timeout",         (PyCFunction)PyCursesWindow_wtimeout, METH_VARARGS},
     {"touchline",       (PyCFunction)PyCursesWindow_TouchLine, METH_VARARGS},
@@ -1680,10 +1694,10 @@

 NoArgReturnIntFunction(baudrate)
 NoArgReturnIntFunction(termattrs)
-
+#ifdef REAL_NCURSES
 NoArgReturnStringFunction(termname)
 NoArgReturnStringFunction(longname)
-
+#endif
 NoArgTrueFalseFunction(can_change_color)
 NoArgTrueFalseFunction(has_colors)
 NoArgTrueFalseFunction(has_ic)
@@ -1697,7 +1711,9 @@
 {
     /* not checking for PyCursesInitialised here since filter() must
        be called before initscr() */
+#ifdef REAL_NCURSES
     filter();
+#endif
     Py_INCREF(Py_None);
     return Py_None;
 }
@@ -1780,7 +1796,11 @@

     PyCursesInitialised;

+#ifdef REAL_NCURSES
     getsyx(y, x);
+#else
+    x=-1; y=-1;
+#endif

     return Py_BuildValue("(ii)", y, x);
 }
@@ -1855,7 +1875,7 @@
     return PyCursesCheckERR(halfdelay(tenths), "halfdelay");
 }

-#ifndef STRICT_SYSV_CURSES
+#if !defined(STRICT_SYSV_CURSES) && defined(REAL_NCURSES)
 /* No has_key! */
 static PyObject * PyCurses_has_key(PyObject *self, PyObject *args)
 {
@@ -2383,16 +2403,16 @@
 static PyObject *
 PyCurses_ResizeTerm(PyObject *self, PyObject *args)
 {
-    int lines;
-    int columns;
+    int linez;
+    int columnz;
     PyObject *result;

     PyCursesInitialised;

-    if (!PyArg_ParseTuple(args,"ii:resizeterm", &lines, &columns))
+    if (!PyArg_ParseTuple(args,"ii:resizeterm", &linez, &columnz))
         return NULL;

-    result = PyCursesCheckERR(resizeterm(lines, columns), "resizeterm");
+    result = PyCursesCheckERR(resizeterm(linez, columnz), "resizeterm");
     if (!result)
         return NULL;
     if (!update_lines_cols())
@@ -2425,6 +2445,7 @@
 }
 #endif /* HAVE_CURSES_RESIZE_TERM */

+#ifdef REAL_NCURSES
 static PyObject *
 PyCurses_setsyx(PyObject *self, PyObject *args)
 {
@@ -2444,6 +2465,7 @@
     Py_INCREF(Py_None);
     return Py_None;
 }
+#endif

 static PyObject *
 PyCurses_Start_Color(PyObject *self)
@@ -2546,8 +2568,11 @@
     PyCursesInitialised;

     if (!PyArg_ParseTuple(args,"i;fd",&fd)) return NULL;
-
+#ifdef REAL_NCURSES
     return PyCursesCheckERR(typeahead( fd ), "typeahead");
+#else
+    return PyCursesCheckERR(ERR, "typeahead");
+#endif
 }

 static PyObject *
@@ -2608,7 +2633,9 @@
         PyErr_SetString(PyExc_TypeError, "use_env requires 1 argument");
         return NULL;
     }
+#ifdef REAL_NCURSES
     use_env(flag);
+#endif
     Py_INCREF(Py_None);
     return Py_None;
 }
@@ -2662,7 +2689,7 @@
     {"has_colors",          (PyCFunction)PyCurses_has_colors, METH_NOARGS},
     {"has_ic",              (PyCFunction)PyCurses_has_ic, METH_NOARGS},
     {"has_il",              (PyCFunction)PyCurses_has_il, METH_NOARGS},
-#ifndef STRICT_SYSV_CURSES
+#if defined(REAL_NCURSES) && !defined(STRICT_SYSV_CURSES)
     {"has_key",             (PyCFunction)PyCurses_has_key, METH_VARARGS},
 #endif
     {"halfdelay",           (PyCFunction)PyCurses_HalfDelay, METH_VARARGS},
@@ -2678,7 +2705,9 @@
     {"keyname",             (PyCFunction)PyCurses_KeyName, METH_VARARGS},
 #endif
     {"killchar",            (PyCFunction)PyCurses_KillChar, METH_NOARGS},
+#ifdef REAL_NCURSES
     {"longname",            (PyCFunction)PyCurses_longname, METH_NOARGS},
+#endif
     {"meta",                (PyCFunction)PyCurses_Meta, METH_VARARGS},
 #ifdef NCURSES_MOUSE_VERSION
     {"mouseinterval",       (PyCFunction)PyCurses_MouseInterval, METH_VARARGS},
@@ -2708,12 +2737,16 @@
     {"resize_term",         (PyCFunction)PyCurses_Resize_Term, METH_VARARGS},
 #endif
     {"savetty",             (PyCFunction)PyCurses_savetty, METH_NOARGS},
+#ifdef REAL_NCURSES
     {"setsyx",              (PyCFunction)PyCurses_setsyx, METH_VARARGS},
+#endif
     {"setupterm",           (PyCFunction)PyCurses_setupterm,
      METH_VARARGS|METH_KEYWORDS},
     {"start_color",         (PyCFunction)PyCurses_Start_Color, METH_NOARGS},
     {"termattrs",           (PyCFunction)PyCurses_termattrs, METH_NOARGS},
+#ifdef REAL_NCURSES
     {"termname",            (PyCFunction)PyCurses_termname, METH_NOARGS},
+#endif
     {"tigetflag",           (PyCFunction)PyCurses_tigetflag, METH_VARARGS},
     {"tigetnum",            (PyCFunction)PyCurses_tigetnum, METH_VARARGS},
     {"tigetstr",            (PyCFunction)PyCurses_tigetstr, METH_VARARGS},


code:
--- Python-2.7.3.org/Modules/getpath.c	2012-04-09 23:07:34.000000000 +0000
+++ Python-2.7.3/Modules/getpath.c	2013-08-03 23:17:07.569000003 +0000
@@ -5,6 +5,8 @@

 #include <sys/types.h>
 #include <string.h>
+#include <stdio.h>
+#include <unistd.h>

 #ifdef __APPLE__
 #include <mach-o/dyld.h>
@@ -135,8 +137,13 @@
 reduce(char *dir)
 {
     size_t i = strlen(dir);
+    if(i == 1 && dir[0] == '/') {
+	dir[0] = 0;
+	return;
+    }
     while (i > 0 && dir[i] != SEP)
         --i;
+    if(i == 0 && dir[0] == '/') i = 1;
     dir[i] = '\0';
 }

@@ -267,7 +274,7 @@
     /* If PYTHONHOME is set, we believe it unconditionally */
     if (home) {
         char *delim;
-        strncpy(prefix, home, MAXPATHLEN);
+        snprintf(prefix, MAXPATHLEN, "%s", home);
         delim = strchr(prefix, DELIM);
         if (delim)
             *delim = '\0';
@@ -276,6 +283,11 @@
         return 1;
     }

+    if(!access(PREFIX "/bin/python", X_OK)) {
+       snprintf(prefix, sizeof prefix, "%s", PREFIX);
+       return 1;
+    }
+
     /* Check to see if argv[0] is in the build directory */
     strcpy(prefix, argv0_path);
     joinpath(prefix, "Modules/Setup");
@@ -290,7 +302,13 @@
             return -1;
     }

-    /* Search from argv0_path, until root is found */
+    /* Search from argv0_path, until root is found
+     * judging from the path of the currently running
+     * program about where the prefix is completely
+     * bogus unless we're running the python interpreter
+     * itself.
+     */
+    if(!strstr(argv0_path, "python")) goto skip_argv0_madness;
     copy_absolute(prefix, argv0_path);
     do {
         n = strlen(prefix);
@@ -301,9 +319,15 @@
         prefix[n] = '\0';
         reduce(prefix);
     } while (prefix[0]);
+    skip_argv0_madness:

     /* Look at configure's PREFIX */
-    strncpy(prefix, PREFIX, MAXPATHLEN);
+    if(strlen(PREFIX))
+	snprintf(prefix, MAXPATHLEN, "%s", PREFIX);
+    else {
+       prefix[0] = '/';
+       prefix[1] = 0;
+    }
     joinpath(prefix, lib_python);
     joinpath(prefix, LANDMARK);
     if (ismodule(prefix))
@@ -344,6 +368,7 @@
     }

     /* Search from argv0_path, until root is found */
+    if(!strstr(argv0_path, "python")) goto skip_argv0_madness;
     copy_absolute(exec_prefix, argv0_path);
     do {
         n = strlen(exec_prefix);
@@ -354,9 +379,16 @@
         exec_prefix[n] = '\0';
         reduce(exec_prefix);
     } while (exec_prefix[0]);
+    skip_argv0_madness:

     /* Look at configure's EXEC_PREFIX */
-    strncpy(exec_prefix, EXEC_PREFIX, MAXPATHLEN);
+    if(strlen(EXEC_PREFIX))
+        snprintf(exec_prefix, MAXPATHLEN, "%s", EXEC_PREFIX);
+    else {
+       exec_prefix[0] = '/';
+       exec_prefix[1] = 0;
+    }
+
     joinpath(exec_prefix, lib_python);
     joinpath(exec_prefix, "lib-dynload");
     if (isdir(exec_prefix))
@@ -574,6 +606,12 @@
     bufsz += strlen(zip_path) + 1;
     bufsz += strlen(exec_prefix) + 1;

+#define PYTHONSUCKS PREFIX "/lib/python" VERSION ":" \
+                    EXEC_PREFIX "/lib/python" VERSION "/lib-dynload:" \
+                    PREFIX "/lib/python" VERSION "/site-packages"
+
+    bufsz += strlen(PYTHONSUCKS) + 1;
+
     /* This is the only malloc call in this file */
     buf = (char *)PyMem_Malloc(bufsz);

@@ -592,10 +630,6 @@
         else
             buf[0] = '\0';

-        /* Next is the default zip path */
-        strcat(buf, zip_path);
-        strcat(buf, delimiter);
-
         /* Next goes merge of compile-time $PYTHONPATH with
          * dynamically located prefix.
          */
@@ -622,8 +656,17 @@
         }
         strcat(buf, delimiter);

+        /* Next is the default prefix path. if we don't add this,
+           python will stupidly search for modules only in it's *DESTDIR* instead of prefix
+           this is fundamentally incompatible with the way sabotage relocates
+           packages */
+        strcat(buf, PYTHONSUCKS);
+
         /* Finally, on goes the directory for dynamic-load modules */
-        strcat(buf, exec_prefix);
+	if(strlen(exec_prefix)) {
+		strcat(buf, delimiter);
+	        strcat(buf, exec_prefix);
+	}

         /* And publish the results */
         module_search_path = buf;


code:
--- qemu-1.7.0.org/util/qemu-openpty.c
+++ qemu-1.7.0/util/qemu-openpty.c
@@ -47,6 +47,8 @@
 #elif defined CONFIG_SOLARIS
 # include <termios.h>
 # include <stropts.h>
+#else
+# include <termios.h>
 #endif

 #ifdef __sun__


code:
--- qemu-1.7.0.org/linux-user/syscall.c
+++ qemu-1.7.0/linux-user/syscall.c
@@ -400,7 +400,7 @@
 #endif
 #define __NR_sys_ppoll __NR_ppoll
 _syscall5(int, sys_ppoll, struct pollfd *, fds, nfds_t, nfds,
-          struct timespec *, timeout, const __sigset_t *, sigmask,
+          struct timespec *, timeout, const sigset_t *, sigmask,
           size_t, sigsetsize)
 #endif


code:
--- qemu-1.3.0.org/linux-user/mmap.c	2012-12-09 18:21:47.509742992 +0000
+++ qemu-1.3.0/linux-user/mmap.c	2012-12-10 05:25:58.769544980 +0000
@@ -25,6 +25,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/mman.h>
+#include <sys/syscall.h>
 #include <linux/mman.h>
 #include <linux/unistd.h>


code:
--- qemu-1.3.0.org/linux-user/syscall.c	2012-12-06 17:56:51.185000003 +0000
+++ qemu-1.3.0/linux-user/syscall.c	2012-12-06 18:54:14.568000002 +0000
@@ -39,6 +39,7 @@
 #include <sys/resource.h>
 #include <sys/mman.h>
 #include <sys/swap.h>
+#include <sys/syscall.h>
 #include <signal.h>
 #include <sched.h>
 #ifdef __ia64__
@@ -552,7 +553,7 @@
 #endif
 #define __NR_sys_ppoll __NR_ppoll
 _syscall5(int, sys_ppoll, struct pollfd *, fds, nfds_t, nfds,
-          struct timespec *, timeout, const __sigset_t *, sigmask,
+          struct timespec *, timeout, const sigset_t *, sigmask,
           size_t, sigsetsize)
 #endif

@@ -584,7 +585,7 @@
 extern int flock(int, int);
 extern int setfsuid(int);
 extern int setfsgid(int);
-extern int setgroups(int, gid_t *);
+extern int setgroups(size_t, const gid_t *);

 /* ARM EABI and MIPS expect 64bit types aligned even on pairs or registers */
 #ifdef TARGET_ARM


code:
--- qtwebkit/Source/WTF/wtf/Assertions.cpp
+++ qtwebkit/Source/WTF/wtf/Assertions.cpp
@@ -64,7 +64,7 @@
 #include <windows.h>
 #endif

-#if (OS(DARWIN) || (OS(LINUX) && !defined(__UCLIBC__))) && !OS(ANDROID)
+#if OS(DARWIN) || (OS(LINUX) && defined(__GLIBC__) && !defined(__UCLIBC__)) && !OS(ANDROID)
 #include <cxxabi.h>
 #include <dlfcn.h>
 #include <execinfo.h>
@@ -242,7 +242,7 @@

 void WTFGetBacktrace(void** stack, int* size)
 {
-#if (OS(DARWIN) || (OS(LINUX) && !defined(__UCLIBC__))) && !OS(ANDROID)
+#if OS(DARWIN) || (OS(LINUX) && defined(__GLIBC__) && !defined(__UCLIBC__)) && !OS(ANDROID)
     *size = backtrace(stack, *size);
 #elif OS(WINDOWS) && !OS(WINCE)
     // The CaptureStackBackTrace function is available in XP, but it is not defined
--- qtwebengine/src/3rdparty/chromium/third_party/WebKit/Source/wtf/Assertions.cpp.orig	2015-05-11 17:52:11.308845782 +0200
+++ qtwebengine/src/3rdparty/chromium/third_party/WebKit/Source/wtf/Assertions.cpp	2015-05-11 17:52:54.731344269 +0200
@@ -65,7 +65,7 @@
 #define HAVE_ISDEBUGGERPRESENT 1
 #endif

-#if OS(MACOSX) || (OS(LINUX) && !defined(__UCLIBC__))
+#if OS(MACOSX) || (OS(LINUX) && defined(__GLIBC__))
 #include <cxxabi.h>
 #include <dlfcn.h>
 #include <execinfo.h>
@@ -228,7 +228,7 @@ void WTFReportArgumentAssertionFailure(c

 void WTFGetBacktrace(void** stack, int* size)
 {
-#if OS(MACOSX) || (OS(LINUX) && !defined(__UCLIBC__))
+#if OS(MACOSX) || (OS(LINUX) && defined(__GLIBC__))
     *size = backtrace(stack, *size);
 #elif OS(WIN)
     // The CaptureStackBackTrace function is available in XP, but it is not defined
@@ -266,7 +266,7 @@ FrameToNameScope::FrameToNameScope(void*
     : m_name(0)
     , m_cxaDemangled(0)
 {
-#if OS(MACOSX) || (OS(LINUX) && !defined(__UCLIBC__))
+#if OS(MACOSX) || (OS(LINUX) && defined(__GLIBC__))
     Dl_info info;
     if (!dladdr(addr, &info) || !info.dli_sname)
         return;
--- qtwebengine/src/3rdparty/chromium/third_party/libxml/src/threads.c.orig	2015-05-12 06:49:49.220140993 +0200
+++ qtwebengine/src/3rdparty/chromium/third_party/libxml/src/threads.c	2015-05-12 06:52:15.196605626 +0200
@@ -48,7 +48,7 @@

 static int libxml_is_threaded = -1;
 #ifdef __GNUC__
-#ifdef linux
+#ifdef __GLIBC__
 #if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (__GNUC__ > 3)
 extern int pthread_once (pthread_once_t *__once_control,
                          void (*__init_routine) (void))
@@ -88,7 +88,7 @@ extern int pthread_key_delete ()
 extern int pthread_cond_signal ()
 	   __attribute((weak));
 #endif
-#endif /* linux */
+#endif /* __GLIBC__ */
 #endif /* __GNUC__ */
 #endif /* HAVE_PTHREAD_H */

--- qtwebengine/src/3rdparty/chromium/third_party/webrtc/base/checks.cc	2015-06-29 22:07:59.000000000 +0200
+++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/base/checks.cc	2015-07-04 07:31:41.374531401 +0200
@@ -18,8 +18,10 @@

 #if defined(__GLIBCXX__) && !defined(__UCLIBC__)
 #include <cxxabi.h>
+#if defined(__GLIBC__)
 #include <execinfo.h>
 #endif
+#endif

 #if defined(WEBRTC_ANDROID)
 #define LOG_TAG "rtc"
@@ -55,7 +57,7 @@
 // to get usable symbols on Linux. This is copied from V8. Chromium has a more
 // advanced stace trace system; also more difficult to copy.
 void DumpBacktrace() {
-#if defined(__GLIBCXX__) && !defined(__UCLIBC__)
+#if defined(__GLIBCXX__) && !defined(__UCLIBC__) && defined(__GLIBC__)
   void* trace[100];
   int size = backtrace(trace, sizeof(trace) / sizeof(*trace));
   char** symbols = backtrace_symbols(trace, size);
--- qtwebengine/src/3rdparty/chromium/base/debug/stack_trace_posix.cc	2015-06-29 22:09:56.000000000 +0200
+++ qtwebengine/src/3rdparty/chromium/base/debug/stack_trace_posix.cc	2015-07-04 08:07:09.860525096 +0200
@@ -22,7 +22,7 @@
 #if defined(__GLIBCXX__)
 #include <cxxabi.h>
 #endif
-#if !defined(__UCLIBC__)
+#if defined(__GLIBC__)
 #include <execinfo.h>
 #endif

@@ -169,7 +169,7 @@

     handler->HandleOutput("\n");
   }
-#elif !defined(__UCLIBC__)
+#elif defined(__GLIBC__)
   bool printed = false;

   // Below part is async-signal unsafe (uses malloc), so execute it only
@@ -738,7 +738,7 @@
   // NOTE: This code MUST be async-signal safe (it's used by in-process
   // stack dumping signal handler). NO malloc or stdio is allowed here.

-#if !defined(__UCLIBC__)
+#if defined(__GLIBC__)
   // Though the backtrace API man page does not list any possible negative
   // return values, we take no chance.
   count_ = base::saturated_cast<size_t>(backtrace(trace_, arraysize(trace_)));


code:
The checks for OPENSSL_VERSION_NUMBER > 0x10002000 are used to
enable openssl specific macros and functions which libressl
obviously does not provide, thus add some additional tests
to disable that code for libressl.

--- qtbase/src/network/ssl/qsslcontext_openssl.cpp	2015-06-29 22:04:46.000000000 +0200
+++ qtbase/src/network/ssl/qsslcontext_openssl.cpp	2015-07-04 03:51:25.926570550 +0200
@@ -338,7 +338,7 @@

     const QVector<QSslEllipticCurve> qcurves = sslContext->sslConfiguration.ellipticCurves();
     if (!qcurves.isEmpty()) {
-#if OPENSSL_VERSION_NUMBER >= 0x10002000L && !defined(OPENSSL_NO_EC)
+#if OPENSSL_VERSION_NUMBER >= 0x10002000L && !defined(OPENSSL_NO_EC) && defined(SSL_CTRL_SET_CURVES)
         // Set the curves to be used
         if (q_SSLeay() >= 0x10002000L) {
             // SSL_CTX_ctrl wants a non-const pointer as last argument,
--- qtbase/src/network/ssl/qsslsocket_openssl_symbols.cpp	2015-06-29 22:04:46.000000000 +0200
+++ qtbase/src/network/ssl/qsslsocket_openssl_symbols.cpp	2015-07-04 03:58:29.430569295 +0200
@@ -406,7 +406,7 @@
 DEFINEFUNC(EC_KEY *, EC_KEY_new_by_curve_name, int nid, nid, return 0, return)
 DEFINEFUNC(void, EC_KEY_free, EC_KEY *ecdh, ecdh, return, DUMMYARG)
 DEFINEFUNC2(size_t, EC_get_builtin_curves, EC_builtin_curve * r, r, size_t nitems, nitems, return 0, return)
-#if OPENSSL_VERSION_NUMBER >= 0x10002000L
+#if (OPENSSL_VERSION_NUMBER >= 0x10002000L) && !defined(LIBRESSL_VERSION_NUMBER)
 DEFINEFUNC(int, EC_curve_nist2nid, const char *name, name, return 0, return)
 #endif // OPENSSL_VERSION_NUMBER >= 0x10002000L
 #endif // OPENSSL_NO_EC
--- qtbase/src/network/ssl/qsslellipticcurve_openssl.cpp	2015-07-04 04:05:26.110568061 +0200
+++ qtbase/src/network/ssl/qsslellipticcurve_openssl.cpp	2015-07-04 04:06:01.709567956 +0200
@@ -76,7 +76,7 @@

     int nid = q_OBJ_sn2nid(curveNameLatin1.data());

-#if OPENSSL_VERSION_NUMBER >= 0x10002000L
+#if (OPENSSL_VERSION_NUMBER >= 0x10002000L) && !defined(LIBRESSL_VERSION_NUMBER)
     if (nid == 0 && q_SSLeay() >= 0x10002000L)
         nid = q_EC_curve_nist2nid(curveNameLatin1.data());
 #endif // OPENSSL_VERSION_NUMBER >= 0x10002000L


code:
--- qtbase/src/corelib/codecs/qiconvcodec.cpp.orig
+++ qtbase/src/corelib/codecs/qiconvcodec.cpp
@@ -62,7 +62,7 @@
 #elif defined(Q_OS_AIX)
 #  define NO_BOM
 #  define UTF16 "UCS-2"
-#elif defined(Q_OS_FREEBSD) || defined(Q_OS_MAC)
+#elif defined(Q_OS_FREEBSD) || defined(Q_OS_MAC) || (defined(Q_OS_LINUX) && !defined(__GLIBC__))
 #  define NO_BOM
 #  if Q_BYTE_ORDER == Q_BIG_ENDIAN
 #    define UTF16 "UTF-16BE"


code:
In musl libc there is no struct mallinfo and no function mallinf()

--- qtwebengine/src/3rdparty/chromium/content/child/content_child_helpers.cc	2015-06-05 04:52:18.502230985 +0200
+++ qtwebengine/src/3rdparty/chromium/content/child/content_child_helpers.cc	2015-06-05 04:52:06.712231020 +0200
@@ -15,7 +15,7 @@

 namespace content {

-#if defined(OS_LINUX) || defined(OS_ANDROID)
+#if (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_ANDROID)
 size_t GetMemoryUsageKB() {
   struct mallinfo minfo = mallinfo();
   uint64_t mem_usage =


code:
The musl libc also has pthread_getattr_np()

--- qtwebengine/src/3rdparty/chromium/third_party/WebKit/Source/platform/heap/ThreadState.cpp	2015-06-29 22:08:50.000000000 +0200
+++ qtwebengine/src/3rdparty/chromium/third_party/WebKit/Source/platform/heap/ThreadState.cpp	2015-07-04 02:39:41.192583302 +0200
@@ -64,7 +64,7 @@

 static void* getStackStart()
 {
-#if defined(__GLIBC__) || OS(ANDROID) || OS(FREEBSD)
+#if defined(__GLIBC__) || OS(ANDROID) || OS(FREEBSD) || OS(LINUX_MUSL)
     pthread_attr_t attr;
     int error;
 #if OS(FREEBSD)


code:
The musl resolver does not define res_ninit() and res_nclose() functions
like glibc does. A wrapper for musl to mimick GLIBC's function should do
the trick.

--- qtwebengine/src/3rdparty/chromium/net/base/dns_reloader.cc	2015-06-03 12:34:26.979892244 +0200
+++ qtwebengine/src/3rdparty/chromium/net/base/dns_reloader.cc	2015-06-03 12:32:07.091899808 +0200
@@ -8,6 +8,9 @@
     !defined(OS_ANDROID)

 #include <resolv.h>
+#if defined(OS_LINUX) && !defined(__GLIBC__)
+#include "net/dns/resolv_compat.h"
+#endif

 #include "base/basictypes.h"
 #include "base/lazy_instance.h"
--- qtwebengine/src/3rdparty/chromium/net/dns/dns_config_service_posix.cc	2015-02-17 05:58:45.000000000 +0100
+++ qtwebengine/src/3rdparty/chromium/net/dns/dns_config_service_posix.cc	2015-06-04 22:22:01.104300355 +0200
@@ -21,6 +21,10 @@
 #include "net/dns/notify_watcher_mac.h"
 #include "net/dns/serial_worker.h"

+#if defined(OS_LINUX) && !defined(__GLIBC__)
+#include "net/dns/resolv_compat.h"
+#endif
+
 #if defined(OS_MACOSX) && !defined(OS_IOS)
 #include "net/dns/dns_config_watcher_mac.h"
 #endif


code:
There's a subtle difference in the internal name of siginfo_t fields
between glibc and musl. The structure itself is equivalent, so it
should suffice to add a macro to rename the field.

--- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc	2015-02-17 05:57:43.000000000 +0100
+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc	2015-06-03 08:20:25.032716427 +0200
@@ -22,6 +22,11 @@
 #include "sandbox/linux/services/android_ucontext.h"
 #endif

+// musl libc defines siginfo_t __si_fields instead of _sifields
+#if !defined(__GLIBC__)
+#define _sifields __si_fields
+#endif
+
 namespace {

 const int kCapacityIncrement = 20;


code:
--- qtbase/mkspecs/linux-g++/qplatformdefs.h.orig
+++ qtbase/mkspecs/linux-g++/qplatformdefs.h
@@ -86,11 +86,7 @@

 #undef QT_SOCKLEN_T

-#if defined(__GLIBC__) && (__GLIBC__ >= 2)
 #define QT_SOCKLEN_T            socklen_t
-#else
-#define QT_SOCKLEN_T            int
-#endif

 #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
 #define QT_SNPRINTF		::snprintf


code:
Fix a warning issued by musl libc headers

--- qtwebengine/src/3rdparty/chromium/base/files/file_util_posix.cc	2015-02-17 05:57:34.000000000 +0100
+++ qtwebengine/src/3rdparty/chromium/base/files/file_util_posix.cc	2015-06-05 12:20:48.831848404 +0200
@@ -12,7 +12,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <sys/errno.h>
+#include <errno.h>
 #include <sys/mman.h>
 #include <sys/param.h>
 #include <sys/stat.h>


code:
--- qtwebkit/Source/WTF/wtf/InlineASM.h.orig	2013-10-07 11:36:58.995128674 +0000
+++ qtwebkit/Source/WTF/wtf/InlineASM.h	2013-10-07 11:37:28.058792290 +0000
@@ -42,7 +42,7 @@
 #define THUMB_FUNC_PARAM(name)
 #endif

-#if (OS(LINUX) || OS(FREEBSD)) && CPU(X86_64)
+#if (OS(LINUX) || OS(FREEBSD)) && (CPU(X86_64) || defined(__PIC__))
 #define GLOBAL_REFERENCE(name) #name "@plt"
 #elif CPU(X86) && COMPILER(MINGW)
 #define GLOBAL_REFERENCE(name) "@" #name "@4"


code:
--- qttools/src/assistant/assistant/stdinlistener.cpp.org
+++ qttools/src/assistant/assistant/stdinlistener.cpp
@@ -34,6 +34,7 @@
 #include "stdinlistener.h"

 #include "tracer.h"
+#include <stdio.h>

 QT_BEGIN_NAMESPACE


code:
--- qt-everywhere-opensource-src-4.6.4.org/src/3rdparty/clucene/src/CLucene/util/Misc.cpp	2013-10-25 12:36:39.159114738 +0000
+++ qt-everywhere-opensource-src-4.6.4/src/3rdparty/clucene/src/CLucene/util/Misc.cpp	2013-10-25 19:20:45.228244399 +0000
@@ -20,6 +20,7 @@
 # endif
 #endif

+#undef _CL_HAVE_SYS_TIMEB_H
 #ifdef _CL_HAVE_SYS_TIMEB_H
 # include <sys/timeb.h>
 #endif
--- qt-everywhere-opensource-src-4.6.4.org/src/3rdparty/javascriptcore/JavaScriptCore/wtf/RefPtr.h	2013-10-25 12:36:38.840114749 +0000
+++ qt-everywhere-opensource-src-4.6.4/src/3rdparty/javascriptcore/JavaScriptCore/wtf/RefPtr.h	2013-10-25 19:18:15.880249760 +0000
@@ -24,6 +24,7 @@
 #include <algorithm>
 #include "AlwaysInline.h"
 #include "FastAllocBase.h"
+#include "PassRefPtr.h"

 namespace WTF {


code:
--- qt-everywhere-opensource-src-4.6.4.org/src/corelib/io/qurl.h	2013-10-25 12:36:38.698114754 +0000
+++ qt-everywhere-opensource-src-4.6.4/src/corelib/io/qurl.h	2013-10-25 16:55:40.577556862 +0000
@@ -65,6 +65,7 @@
     };

     // encoding / toString values
+#undef None
     enum FormattingOption {
         None = 0x0,
         RemoveScheme = 0x1,
--- qt-everywhere-opensource-src-4.6.4.org/src/gui/painting/qprinter.h	2013-10-25 12:36:39.198114736 +0000
+++ qt-everywhere-opensource-src-4.6.4/src/gui/painting/qprinter.h	2013-10-25 18:22:50.386369133 +0000
@@ -97,6 +97,9 @@
     enum PageOrder   { FirstPageFirst,
                        LastPageFirst };

+#undef Color
+#undef GrayScale
+
     enum ColorMode   { GrayScale,
                        Color };

--- qt-everywhere-opensource-src-4.6.4.org/src/corelib/io/qdir.h	2013-10-25 12:36:38.698114754 +0000
+++ qt-everywhere-opensource-src-4.6.4/src/corelib/io/qdir.h	2013-10-25 18:19:53.513375482 +0000
@@ -100,6 +100,19 @@
     typedef Filters FilterSpec;
 #endif

+#undef Name
+#undef Time
+#undef Size
+#undef Unsorted
+#undef SortByMask
+#undef DirsFirst
+#undef Reversed
+#undef IgnoreCase
+#undef DirsLast
+#undef LocaleAware
+#undef Type
+#undef NoSort
+
     enum SortFlag { Name        = 0x00,
                     Time        = 0x01,
                     Size        = 0x02,
--- qt-everywhere-opensource-src-4.6.4.org/src/corelib/io/qtextstream.h	2013-10-25 12:36:38.696114754 +0000
+++ qt-everywhere-opensource-src-4.6.4/src/corelib/io/qtextstream.h	2013-10-25 18:05:56.753405518 +0000
@@ -86,6 +86,7 @@
         AlignCenter,
         AlignAccountingStyle
     };
+#undef Ok
     enum Status {
         Ok,
         ReadPastEnd,
--- qt-everywhere-opensource-src-4.6.4.org/src/opengl/qglframebufferobject.cpp	2013-10-25 12:36:38.798114751 +0000
+++ qt-everywhere-opensource-src-4.6.4/src/opengl/qglframebufferobject.cpp	2013-10-25 18:29:00.921355832 +0000
@@ -39,10 +39,11 @@
 **
 ****************************************************************************/

+#include <qdebug.h>
+
 #include "qglframebufferobject.h"
 #include "qglframebufferobject_p.h"

-#include <qdebug.h>
 #include <private/qgl_p.h>
 #if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL)
 #include <private/qpaintengineex_opengl2_p.h>


code:
commit a31aa886f29ab49bb0aa757ce2253aa4e8ef3632
Author: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Date:   Tue Mar 16 13:43:02 2010 +0100

    Compile

    Fix typo in qabstractitemview.cpp

    Reviewed-by: Thierry

diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp
index fb6e418..dd9a7e6 100644
--- a/src/gui/itemviews/qabstractitemview.cpp
+++ b/src/gui/itemviews/qabstractitemview.cpp
@@ -2298,7 +2298,7 @@ void QAbstractItemView::keyPressEvent(QKeyEvent *event)
     case Qt::Key_Shift:
     case Qt::Key_Control:
     case Qt::Key_Delete:
-    case Qt::Key_BackSpace:
+    case Qt::Key_Backspace:
         event->ignore();
         break;
     case Qt::Key_Space:


code:
--- qt-x11-opensource-src-4.3.4.org/tools/porting/src/codemodel.h	2013-06-29 19:57:32.374000004 +0000
+++ qt-x11-opensource-src-4.3.4/tools/porting/src/codemodel.h	2013-06-29 20:28:44.278000004 +0000
@@ -96,7 +96,7 @@
 {
 public:
      void add(CollectedType *collectedItem)
-    { insert(collectedItem->name(), collectedItem); }
+    { this->insert(collectedItem->name(), collectedItem); }
 };

 typedef Collection<Scope> ScopeCollection;


code:
--- qt-everywhere-opensource-src-4.6.4.org/src/opengl/qgl_x11egl.cpp	2013-10-25 12:36:38.796114751 +0000
+++ qt-everywhere-opensource-src-4.6.4/src/opengl/qgl_x11egl.cpp	2013-10-25 17:07:16.989531864 +0000
@@ -320,8 +320,8 @@
                     vi = *chosenVisualInfo;
                 }
                 else {
-                    qWarning("Warning: EGL suggested using X visual ID %d for config %d, but this is not ARGB",
-                             nativeVisualId, (int)config);
+                    qWarning("Warning: EGL suggested using X visual ID %d for config %p, but this is not ARGB",
+                             nativeVisualId, config);
                     vi.visualid = 0;
                 }
             } else
@@ -333,14 +333,14 @@
 #endif
                     vi = *chosenVisualInfo;
                 } else
-                    qWarning("Warning: EGL suggested using X visual ID %d (%d bpp) for config %d (%d bpp), but the depths do not match!",
-                             nativeVisualId, chosenVisualInfo->depth, (int)config, eglConfigColorSize);
+                    qWarning("Warning: EGL suggested using X visual ID %d (%d bpp) for config %p (%d bpp), but the depths do not match!",
+                             nativeVisualId, chosenVisualInfo->depth, config, eglConfigColorSize);
             }
             XFree(chosenVisualInfo);
         }
         else {
-            qWarning("Warning: EGL suggested using X visual ID %d for config %d, but this seems to be invalid!",
-                     nativeVisualId, (int)config);
+            qWarning("Warning: EGL suggested using X visual ID %d for config %p, but this seems to be invalid!",
+                     nativeVisualId, config);
             vi.visualid = 0;
         }
     }
@@ -382,8 +382,8 @@
         int err;
         err = XMatchVisualInfo(x11Info.display(), x11Info.screen(), depth, TrueColor, &vi);
         if (err == 0) {
-            qWarning("Warning: Can't find an X visual which matches the EGL config(%d)'s depth (%d)!",
-                     (int)config, depth);
+            qWarning("Warning: Can't find an X visual which matches the EGL config(%p)'s depth (%d)!",
+                     config, depth);
             depth = x11Info.depth();
             err = XMatchVisualInfo(x11Info.display(), x11Info.screen(), depth, TrueColor, &vi);
             if (err == 0) {
@@ -613,7 +613,7 @@
             if (configCount > 0) {
                 // Got one
                 qDebug() << "Found an" << (hasAlpha ? "ARGB" : "RGB") << (readOnly ? "readonly" : "target" )
-                         << "config (" << int(*targetConfig) << ") to create a pixmap surface:";
+                         << "config (" << long(*targetConfig) << ") to create a pixmap surface:";

 //                QEglProperties configProps(*targetConfig);
 //                qDebug() << configProps.toString();
@@ -655,7 +655,7 @@
 //    qDebug("qt_createEGLSurfaceForPixmap() created surface 0x%x for pixmap 0x%x",
 //           pixmapSurface, pixmapData->handle());
     if (pixmapSurface == EGL_NO_SURFACE) {
-        qWarning() << "Failed to create a pixmap surface using config" << (int)pixmapConfig
+        qWarning() << "Failed to create a pixmap surface using config" << (long)pixmapConfig
                    << ":" << QEglContext::errorString(eglGetError());
         return false;
     }
--- qt-everywhere-opensource-src-4.6.4.org/src/opengl/qwindowsurface_gl.cpp	2013-10-25 12:36:38.796114751 +0000
+++ qt-everywhere-opensource-src-4.6.4/src/opengl/qwindowsurface_gl.cpp	2013-10-25 17:00:58.391545454 +0000
@@ -366,7 +366,7 @@
     if (ctxpriv->eglSurface == EGL_NO_SURFACE) {
         qWarning() << "hijackWindow() could not create EGL surface";
     }
-    qDebug("QGLWindowSurface - using EGLConfig %d", reinterpret_cast<int>(ctxpriv->eglContext->config()));
+    qDebug("QGLWindowSurface - using EGLConfig %p", reinterpret_cast<void*>(ctxpriv->eglContext->config()));
 #endif

     widgetPrivate->extraData()->glContext = ctx;


code:
--- qt-everywhere-opensource-src-4.6.4.org/src/corelib/codecs/qiconvcodec.cpp	2013-10-25 12:36:38.703114754 +0000
+++ qt-everywhere-opensource-src-4.6.4/src/corelib/codecs/qiconvcodec.cpp	2013-10-25 18:59:19.095290566 +0000
@@ -62,15 +62,15 @@
 #elif defined(Q_OS_AIX)
 #  define NO_BOM
 #  define UTF16 "UCS-2"
-#elif defined(Q_OS_FREEBSD) || defined(Q_OS_MAC)
+#elif defined(__GLIBC__)
+#  define UTF16 "UTF-16"
+#else
 #  define NO_BOM
 #  if Q_BYTE_ORDER == Q_BIG_ENDIAN
 #    define UTF16 "UTF-16BE"
 #  else
 #    define UTF16 "UTF-16LE"
 #  endif
-#else
-#  define UTF16 "UTF-16"
 #endif

 #if defined(Q_OS_MAC)


code:
commit 8a81562af30435f82255830489dca691031a5408
Author: aavit <qt-info@nokia.com>
Date:   Tue Feb 9 10:32:04 2010 +0100

    Use libpng API as recommended. Preparation for upgrade to libpng 1.4.0.

    The libpng doc advises against accessing the info_ptr structure
    directly, and in 1.4.0 the members are flagged as deprecated, so such
    access gives compilation warnings. This patch makes qpnghandler use
    the recommended access functions instead.

    Reviewed-by: Trond

diff --git a/src/gui/image/qpnghandler.cpp b/src/gui/image/qpnghandler.cpp
index d5406cb..bba54b9 100644
--- a/src/gui/image/qpnghandler.cpp
+++ b/src/gui/image/qpnghandler.cpp
@@ -50,8 +50,13 @@
 #include <qvariant.h>
 #include <qvector.h>

+#ifdef QT_USE_BUNDLED_LIBPNG
+#include <../../3rdparty/libpng/png.h>
+#include <../../3rdparty/libpng/pngconf.h>
+#else
 #include <png.h>
 #include <pngconf.h>
+#endif

 #ifdef Q_OS_WINCE
 #define CALLBACK_CALL_TYPE        __cdecl
@@ -162,11 +167,16 @@ void setup_qt(QImage& image, png_structp png_ptr, png_infop info_ptr, float scre
     png_uint_32 height;
     int bit_depth;
     int color_type;
+    png_bytep trans_alpha = 0;
+    png_color_16p trans_color_p = 0;
+    int num_trans;
+    png_colorp palette = 0;
+    int num_palette;
     png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, 0, 0, 0);

     if (color_type == PNG_COLOR_TYPE_GRAY) {
         // Black & White or 8-bit grayscale
-        if (bit_depth == 1 && info_ptr->channels == 1) {
+        if (bit_depth == 1 && png_get_channels(png_ptr, info_ptr) == 1) {
             png_set_invert_mono(png_ptr);
             png_read_update_info(png_ptr, info_ptr);
             if (image.size() != QSize(width, height) || image.format() != QImage::Format_Mono) {
@@ -207,20 +217,16 @@ void setup_qt(QImage& image, png_structp png_ptr, png_infop info_ptr, float scre
                 int c = i*255/(ncols-1);
                 image.setColor(i, qRgba(c,c,c,0xff));
             }
-            if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) {
-#if PNG_LIBPNG_VER_MAJOR < 1 || (PNG_LIBPNG_VER_MAJOR == 1 && PNG_LIBPNG_VER_MINOR < 4)
-                const int g = info_ptr->trans_values.gray;
-#else
-                const int g = info_ptr->trans_color.gray;
-#endif
+            if (png_get_tRNS(png_ptr, info_ptr, &trans_alpha, &num_trans, &trans_color_p) && trans_color_p) {
+                const int g = trans_color_p->gray;
                 if (g < ncols) {
                     image.setColor(g, 0);
                 }
             }
         }
     } else if (color_type == PNG_COLOR_TYPE_PALETTE
-               && png_get_valid(png_ptr, info_ptr, PNG_INFO_PLTE)
-               && info_ptr->num_palette <= 256)
+               && png_get_PLTE(png_ptr, info_ptr, &palette, &num_palette)
+               && num_palette <= 256)
     {
         // 1-bit and 8-bit color
         if (bit_depth != 1)
@@ -233,29 +239,26 @@ void setup_qt(QImage& image, png_structp png_ptr, png_infop info_ptr, float scre
             if (image.isNull())
                 return;
         }
-        image.setColorCount(info_ptr->num_palette);
+        png_get_PLTE(png_ptr, info_ptr, &palette, &num_palette);
+        image.setColorCount(num_palette);
         int i = 0;
-        if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) {
-            while (i < info_ptr->num_trans) {
+        if (png_get_tRNS(png_ptr, info_ptr, &trans_alpha, &num_trans, &trans_color_p) && trans_alpha) {
+            while (i < num_trans) {
                 image.setColor(i, qRgba(
-                    info_ptr->palette[i].red,
-                    info_ptr->palette[i].green,
-                    info_ptr->palette[i].blue,
-#if PNG_LIBPNG_VER_MAJOR < 1 || (PNG_LIBPNG_VER_MAJOR == 1 && PNG_LIBPNG_VER_MINOR < 4)
-                    info_ptr->trans[i]
-#else
-                    info_ptr->trans_alpha[i]
-#endif
+                    palette[i].red,
+                    palette[i].green,
+                    palette[i].blue,
+                    trans_alpha[i]
                    )
                );
                 i++;
             }
         }
-        while (i < info_ptr->num_palette) {
+        while (i < num_palette) {
             image.setColor(i, qRgba(
-                info_ptr->palette[i].red,
-                info_ptr->palette[i].green,
-                info_ptr->palette[i].blue,
+                palette[i].red,
+                palette[i].green,
+                palette[i].blue,
                 0xff
                )
            );
@@ -531,33 +534,36 @@ QImage::Format QPngHandlerPrivate::readImageFormat()
         QImage::Format format = QImage::Format_Invalid;
         png_uint_32 width, height;
         int bit_depth, color_type;
-        if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY) {
+        png_colorp palette;
+        int num_palette;
+        png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, 0, 0, 0);
+        if (color_type == PNG_COLOR_TYPE_GRAY) {
             // Black & White or 8-bit grayscale
-            if (info_ptr->bit_depth == 1 && info_ptr->channels == 1) {
+            if (bit_depth == 1 && png_get_channels(png_ptr, info_ptr) == 1) {
                 format = QImage::Format_Mono;
-            } else if (info_ptr->bit_depth == 16 && png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) {
+            } else if (bit_depth == 16 && png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) {
                 format = QImage::Format_ARGB32;
             } else {
                 format = QImage::Format_Indexed8;
             }
-        } else if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE
-                && png_get_valid(png_ptr, info_ptr, PNG_INFO_PLTE)
-                   && info_ptr->num_palette <= 256)
+        } else if (color_type == PNG_COLOR_TYPE_PALETTE
+                   && png_get_PLTE(png_ptr, info_ptr, &palette, &num_palette)
+                   && num_palette <= 256)
         {
             // 1-bit and 8-bit color
-            if (info_ptr->bit_depth != 1)
+            if (bit_depth != 1)
                 png_set_packing(png_ptr);
             png_read_update_info(png_ptr, info_ptr);
             png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, 0, 0, 0);
             format = bit_depth == 1 ? QImage::Format_Mono : QImage::Format_Indexed8;
         } else {
             // 32-bit
-            if (info_ptr->bit_depth == 16)
+            if (bit_depth == 16)
                 png_set_strip_16(png_ptr);

             format = QImage::Format_ARGB32;
             // Only add filler if no alpha, or we can get 5 channel data.
-            if (!(info_ptr->color_type & PNG_COLOR_MASK_ALPHA)
+            if (!(color_type & PNG_COLOR_MASK_ALPHA)
                 && !png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) {
                 // We want 4 bytes, but it isn't an alpha channel
                 format = QImage::Format_RGB32;
@@ -648,7 +654,7 @@ static void set_text(const QImage &image, png_structp png_ptr, png_infop info_pt
         text_ptr[i].text = qstrdup(value.constData());
         text_ptr[i].text_length = 0;
         text_ptr[i].itxt_length = value.size();
-        text_ptr[i].lang = "UTF-8";
+        text_ptr[i].lang = const_cast<char*>("UTF-8");
         text_ptr[i].lang_key = qstrdup(it.key().toUtf8().constData());
 #endif
         ++i;
@@ -735,64 +741,51 @@ bool Q_INTERNAL_WIN_NO_THROW QPNGImageWriter::writeImage(const QImage& image_in,
         png_set_compression_level(png_ptr, quality);
     }

-    if (gamma != 0.0) {
-        png_set_gAMA(png_ptr, info_ptr, 1.0/gamma);
-    }
-
     png_set_write_fn(png_ptr, (void*)this, qpiw_write_fn, qpiw_flush_fn);

-    info_ptr->channels =
-        (image.depth() == 32)
-        ? (image.format() == QImage::Format_RGB32 ? 3 : 4)
-        : 1;
-
     png_set_IHDR(png_ptr, info_ptr, image.width(), image.height(),
         image.depth() == 1 ? 1 : 8 /* per channel */,
         image.depth() == 32
             ? image.format() == QImage::Format_RGB32
                 ? PNG_COLOR_TYPE_RGB
                 : PNG_COLOR_TYPE_RGB_ALPHA
-            : PNG_COLOR_TYPE_PALETTE, 0, 0, 0);
+            : PNG_COLOR_TYPE_PALETTE, 0, 0, 0);  // also sets #channels

+    if (gamma != 0.0) {
+        png_set_gAMA(png_ptr, info_ptr, 1.0/gamma);
+    }

-    //png_set_sBIT(png_ptr, info_ptr, 8);
-    info_ptr->sig_bit.red = 8;
-    info_ptr->sig_bit.green = 8;
-    info_ptr->sig_bit.blue = 8;
+    png_color_8 sig_bit;
+    sig_bit.red = 8;
+    sig_bit.green = 8;
+    sig_bit.blue = 8;
+    sig_bit.alpha = image.hasAlphaChannel() ? 8 : 0;
+    png_set_sBIT(png_ptr, info_ptr, &sig_bit);

     if (image.format() == QImage::Format_MonoLSB)
        png_set_packswap(png_ptr);

-    png_colorp palette = 0;
-    png_bytep copy_trans = 0;
     if (image.colorCount()) {
         // Paletted
         int num_palette = image.colorCount();
-        palette = new png_color[num_palette];
-        png_set_PLTE(png_ptr, info_ptr, palette, num_palette);
-        int* trans = new int[num_palette];
+        png_color palette[num_palette];
+        png_byte trans[num_palette];
         int num_trans = 0;
         for (int i=0; i<num_palette; i++) {
-            QRgb rgb=image.color(i);
-            info_ptr->palette[i].red = qRed(rgb);
-            info_ptr->palette[i].green = qGreen(rgb);
-            info_ptr->palette[i].blue = qBlue(rgb);
-            trans[i] = rgb >> 24;
+            QRgb rgba=image.color(i);
+            palette[i].red = qRed(rgba);
+            palette[i].green = qGreen(rgba);
+            palette[i].blue = qBlue(rgba);
+            trans[i] = qAlpha(rgba);
             if (trans[i] < 255) {
                 num_trans = i+1;
             }
         }
+        png_set_PLTE(png_ptr, info_ptr, palette, num_palette);
+
         if (num_trans) {
-            copy_trans = new png_byte[num_trans];
-            for (int i=0; i<num_trans; i++)
-                copy_trans[i] = trans[i];
-            png_set_tRNS(png_ptr, info_ptr, copy_trans, num_trans, 0);
+            png_set_tRNS(png_ptr, info_ptr, trans, num_trans, 0);
         }
-        delete [] trans;
-    }
-
-    if (image.format() != QImage::Format_RGB32) {
-        info_ptr->sig_bit.alpha = 8;
     }

     // Swap ARGB to RGBA (normal PNG format) before saving on
@@ -868,11 +861,6 @@ bool Q_INTERNAL_WIN_NO_THROW QPNGImageWriter::writeImage(const QImage& image_in,
     png_write_end(png_ptr, info_ptr);
     frames_written++;

-    if (palette)
-        delete [] palette;
-    if (copy_trans)
-        delete [] copy_trans;
-
     png_destroy_write_struct(&png_ptr, &info_ptr);

     return true;
@@ -958,7 +946,8 @@ QVariant QPngHandler::option(ImageOption option) const
     else if (option == Description)
         return d->description;
     else if (option == Size)
-        return QSize(d->info_ptr->width, d->info_ptr->height);
+        return QSize(png_get_image_width(d->png_ptr, d->info_ptr),
+                     png_get_image_height(d->png_ptr, d->info_ptr));
     else if (option == ImageFormat)
         return d->readImageFormat();
     return 0;


code:
--- qt-everywhere-opensource-src-4.6.4.org/tools/linguist/linguist/mainwindow.cpp	2013-10-25 12:36:39.796114715 +0000
+++ qt-everywhere-opensource-src-4.6.4/tools/linguist/linguist/mainwindow.cpp	2013-10-25 19:36:14.497211042 +0000
@@ -2370,7 +2370,7 @@
             // because we get a lot of false positives.
             if (c != '&' && c != ' ' && QChar(c).isPrint()) {
                 const ushort *pp = p;
-                for (; *p < 256 && ::isalpha(*p); p++) ;
+                for (; *p < 256 && isalpha(*p); p++) ;
                 if (pp == p || *p != ';')
                     return true;
                 // This looks like a HTML &entity;, so ignore it. As a HTML string


code:
--- qt-everywhere-opensource-src-4.6.4.org/mkspecs/linux-g++/qplatformdefs.h	2013-10-25 12:36:38.475114762 +0000
+++ qt-everywhere-opensource-src-4.6.4/mkspecs/linux-g++/qplatformdefs.h	2013-10-25 12:37:11.830113565 +0000
@@ -150,11 +150,7 @@
 #define QT_SIGNAL_ARGS		int
 #define QT_SIGNAL_IGNORE	SIG_IGN

-#if defined(__GLIBC__) && (__GLIBC__ >= 2)
 #define QT_SOCKLEN_T		socklen_t
-#else
-#define QT_SOCKLEN_T		int
-#endif

 #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
 #define QT_SNPRINTF		::snprintf


code:
--- qt-everywhere-opensource-src-4.6.4.org/src/network/ssl/qsslsocket_openssl.cpp	2013-10-25 12:36:38.791114751 +0000
+++ qt-everywhere-opensource-src-4.6.4/src/network/ssl/qsslsocket_openssl.cpp	2013-10-25 12:47:06.423092222 +0000
@@ -827,11 +827,11 @@
             QString peerName = (verificationPeerName.isEmpty () ? q->peerName() : verificationPeerName);
             QString commonName = configuration.peerCertificate.subjectInfo(QSslCertificate::CommonName);

-            if (!isMatchingHostname(commonName.lower(), peerName.lower())) {
+            if (!isMatchingHostname(commonName.toLower(), peerName.toLower())) {
                 bool matched = false;
                 foreach (const QString &altName, configuration.peerCertificate
                          .alternateSubjectNames().values(QSsl::DnsEntry)) {
-                    if (isMatchingHostname(altName.lower(), peerName.lower())) {
+                    if (isMatchingHostname(altName.toLower(), peerName.toLower())) {
                         matched = true;
                         break;
                     }