From 3d7d909c9da0545eb6b9b98bf63335a76eea037b Mon Sep 17 00:00:00 2001
From: Mark H Weaver <mhw@netris.org>
Date: Fri, 19 Dec 2014 21:04:35 -0500
Subject: [PATCH] gnu: xf86-video-openchrome: Update to 0.3.3.

* gnu/packages/patches/xf86-video-openchrome-includes.patch: Remove.
* gnu/packages/patches/xf86-video-openchrome-glibc-2.20.patch: New file.
* gnu-system.am (dist_patch_DATA): Add it and remove the other.
* gnu/packages/xorg.scm (xf86-video-openchrome): Update to 0.3.3.
  Add one patch and remove the other.
---
 gnu-system.am                                 |  2 +-
 .../xf86-video-openchrome-glibc-2.20.patch    | 15 ++++++++
 .../xf86-video-openchrome-includes.patch      | 35 -------------------
 gnu/packages/xorg.scm                         |  9 ++---
 4 files changed, 21 insertions(+), 40 deletions(-)
 create mode 100644 gnu/packages/patches/xf86-video-openchrome-glibc-2.20.patch
 delete mode 100644 gnu/packages/patches/xf86-video-openchrome-includes.patch

diff --git a/gnu-system.am b/gnu-system.am
index eef557a36a2..105a8a213eb 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -468,7 +468,7 @@ dist_patch_DATA =						\
   gnu/packages/patches/xf86-video-mach64-glibc-2.20.patch	\
   gnu/packages/patches/xf86-video-mga-glibc-2.20.patch		\
   gnu/packages/patches/xf86-video-nv-remove-mibstore.patch	\
-  gnu/packages/patches/xf86-video-openchrome-includes.patch	\
+  gnu/packages/patches/xf86-video-openchrome-glibc-2.20.patch	\
   gnu/packages/patches/xfce4-panel-plugins.patch		\
   gnu/packages/patches/xmodmap-asprintf.patch
 
diff --git a/gnu/packages/patches/xf86-video-openchrome-glibc-2.20.patch b/gnu/packages/patches/xf86-video-openchrome-glibc-2.20.patch
new file mode 100644
index 00000000000..4ed7ab00bfd
--- /dev/null
+++ b/gnu/packages/patches/xf86-video-openchrome-glibc-2.20.patch
@@ -0,0 +1,15 @@
+Allow builds with glibc 2.20.
+Based on a patch by Peter Hutterer <peter.hutterer@who-t.net>.
+See <https://raw.githubusercontent.com/openembedded/oe-core/master/meta/recipes-graphics/xorg-driver/xf86-input-synaptics/always_include_xorg_server.h.patch>.
+
+--- xf86-video-openchrome-0.3.3/src/via_3d.h.~1~	2013-05-23 11:11:28.000000000 -0400
++++ xf86-video-openchrome-0.3.3/src/via_3d.h	2014-12-19 01:17:04.000953259 -0500
+@@ -24,6 +24,8 @@
+ #ifndef VIA_3D_H
+ #define VIA_3D_H
+ 
++#include <xorg-server.h>
++
+ #include "xf86.h"
+ #include "via_dmabuffer.h"
+ 
diff --git a/gnu/packages/patches/xf86-video-openchrome-includes.patch b/gnu/packages/patches/xf86-video-openchrome-includes.patch
deleted file mode 100644
index 3c795963877..00000000000
--- a/gnu/packages/patches/xf86-video-openchrome-includes.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-This follows the same rationale as xf86-input-synaptics-glibc-2.20.patch
-to allow building with glibc-2.20.
-diff -u -r xf86-video-openchrome-0.2.906.old/src/via_3d.h xf86-video-openchrome-0.2.906/src/via_3d.h
---- xf86-video-openchrome-0.2.906.old/src/via_3d.h	2014-11-23 14:04:58.000000000 +0100
-+++ xf86-video-openchrome-0.2.906/src/via_3d.h	2014-11-23 14:18:37.000000000 +0100
-@@ -24,6 +24,7 @@
- #ifndef VIA_3D_H
- #define VIA_3D_H
- 
-+#include "xorg-server.h"
- #include "xf86.h"
- #include "via_dmabuffer.h"
- 
-diff -u -r xf86-video-openchrome-0.2.906.old/src/via_driver.h xf86-video-openchrome-0.2.906/src/via_driver.h
---- xf86-video-openchrome-0.2.906.old/src/via_driver.h	2014-11-23 14:04:58.000000000 +0100
-+++ xf86-video-openchrome-0.2.906/src/via_driver.h	2014-11-23 14:21:43.000000000 +0100
-@@ -35,6 +35,7 @@
- #endif
- 
- #include "vgaHW.h"
-+#include "xorg-server.h"
- #include "xf86.h"
- 
- #if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 6 
-diff -u -r xf86-video-openchrome-0.2.906.old/src/via_timing.h xf86-video-openchrome-0.2.906/src/via_timing.h
---- xf86-video-openchrome-0.2.906.old/src/via_timing.h	2014-11-23 14:04:58.000000000 +0100
-+++ xf86-video-openchrome-0.2.906/src/via_timing.h	2014-11-23 14:20:50.000000000 +0100
-@@ -25,6 +25,7 @@
- #ifndef _TIMING_H_
- #define _TIMING_H_
- 
-+#include "xorg-server.h"
- #include "xf86.h"
- 
- /* Aspect ratio not CVT standard */
diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm
index 55db47e4436..d337c18c822 100644
--- a/gnu/packages/xorg.scm
+++ b/gnu/packages/xorg.scm
@@ -2766,18 +2766,19 @@ (define-public xf86-video-nv
 (define-public xf86-video-openchrome
   (package
     (name "xf86-video-openchrome")
-    (version "0.2.906")
+    (version "0.3.3")
     (source
       (origin
         (method url-fetch)
         (uri (string-append
-               "mirror://xorg/X11R7.7/src/everything/xf86-video-openchrome-"
+               "mirror://xorg/individual/driver/xf86-video-openchrome-"
                version
                ".tar.bz2"))
         (sha256
           (base32
-            "0hgzn1r7ig94xbr9dvq0bp1nxqlfp2ki8823jca3f22a2kf8wmg7"))
-        (patches (list (search-patch "xf86-video-openchrome-includes.patch")))))
+           "1v8j4i1r268n4fc5gq54zg1x50j0rhw71f3lba7411mcblg2z7p4"))
+        (patches (list
+                  (search-patch "xf86-video-openchrome-glibc-2.20.patch")))))
     (build-system gnu-build-system)
     (inputs `(("libx11" ,libx11)
               ("libxext" ,libxext)
-- 
GitLab