--- tools/gnome-session-check-accelerated-gl-helper.c.orig	2016-08-18 11:09:18.000000000 -0700
+++ tools/gnome-session-check-accelerated-gl-helper.c	2016-08-19 21:58:54.000000000 -0700
@@ -91,6 +91,75 @@
 
 #include "gnome-session-check-accelerated-common.h"
 
+#ifdef __APPLE__
+#include <Availability.h>
+#if __MAC_OS_X_VERSION_MIN_REQUIRED <= 1060
+
+static const int line_size = 128;
+
+static ssize_t
+getdelim (char **lineptr, size_t *n, int delim, FILE *stream);
+
+static ssize_t
+getline (char **lineptr, size_t *n, FILE *stream);
+
+static ssize_t
+getdelim (char **lineptr, size_t *n, int delim, FILE *stream)
+{
+  int indx = 0;
+  int c;
+
+  /* Sanity checks.  */
+  if (lineptr == NULL || n == NULL || stream == NULL)
+    return -1;
+
+  /* Allocate the line the first time.  */
+  if (*lineptr == NULL)
+    {
+      *lineptr = malloc (line_size);
+      if (*lineptr == NULL)
+        return -1;
+      *n = line_size;
+    }
+
+  /* Clear the line.  */
+  memset (*lineptr, '\0', *n);
+
+  while ((c = getc (stream)) != EOF)
+    {
+      /* Check if more memory is needed.  */
+      if (indx >= *n)
+        {
+          *lineptr = realloc (*lineptr, *n + line_size);
+          if (*lineptr == NULL)
+            {
+              return -1;
+            }
+          /* Clear the rest of the line.  */
+          memset(*lineptr + *n, '\0', line_size);
+          *n += line_size;
+        }
+
+      /* Push the result in the line.  */
+      (*lineptr)[indx++] = c;
+
+      /* Bail out.  */
+      if (c == delim)
+        {
+          break;
+        }
+    }
+  return (c == EOF) ? -1 : indx;
+}
+
+static ssize_t
+getline (char **lineptr, size_t *n, FILE *stream)
+{
+  return getdelim (lineptr, n, '\n', stream);
+}
+#endif
+#endif
+
 #define SIZE_UNSET 0
 #define SIZE_ERROR -1
 static int max_texture_size = SIZE_UNSET;
@@ -481,26 +550,42 @@
                 _print_error ("No X display.");
                 goto out;
         }
-
+/*
+ *  Mac OS X always fails these checks due to the following
+ *      - No composite extension
+ *      - No GLX_EXT_texture_from_pixmap support
+ *  This is mainly for gnome-shell which we don't support yet.
+ *  For now, print the error but allow gnome-session to
+ *  continue to start up.  We'll deal with any consequences
+ *  down the line.
+ */
         if (!_has_composite (display)) {
                 _print_error ("No composite extension.");
+#ifndef __APPLE__
                 goto out;
+#endif
         }
 
         renderer = _get_hardware_gl (display);
         if (!renderer) {
                 _print_error ("No hardware 3D support.");
+#ifndef __APPLE__
                 goto out;
+#endif
         }
 
         if (!_has_texture_from_pixmap (display)) {
                 _print_error ("No GLX_EXT_texture_from_pixmap support.");
+#ifndef __APPLE__
                 goto out;
+#endif
         }
 
         if (!_is_max_texture_size_big_enough (display)) {
                 _print_error ("GL_MAX_{TEXTURE,RENDERBUFFER}_SIZE is too small.");
+#ifndef __APPLE__
                 goto out;
+#endif
         }
 
         ret = has_llvmpipe ? HELPER_SOFTWARE_RENDERING : HELPER_ACCEL;
