summary refs log tree commit diff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2017-08-21 02:40:37 +0200
committerMarius Bakke <mbakke@fastmail.com>2017-08-21 02:40:37 +0200
commit2718a9cd096d0f5ae4b23cc0814a42aee5cf3c4d (patch)
tree334bed3ef9be203d77065a75380696c2537ede92 /gnu/packages/patches
parent9c4ce3afac2ad42c832dc7a9f0932744b5fd8892 (diff)
parente904de7ec1789e243e830b19187b5ef550b2eefa (diff)
downloadguix-2718a9cd096d0f5ae4b23cc0814a42aee5cf3c4d.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/bcftools-regidx-unsigned-char.patch16
-rw-r--r--gnu/packages/patches/graphicsmagick-CVE-2017-12935.patch28
-rw-r--r--gnu/packages/patches/graphicsmagick-CVE-2017-12936.patch16
-rw-r--r--gnu/packages/patches/graphicsmagick-CVE-2017-12937.patch28
-rw-r--r--gnu/packages/patches/lz4-fix-test-failures.patch136
-rw-r--r--gnu/packages/patches/newsbeuter-CVE-2017-12904.patch34
-rw-r--r--gnu/packages/patches/python-cython-fix-tests-32bit.patch27
-rw-r--r--gnu/packages/patches/python-pygit2-disable-network-tests.patch79
-rw-r--r--gnu/packages/patches/rpm-CVE-2014-8118.patch25
-rw-r--r--gnu/packages/patches/vinagre-revert-1.patch56
-rw-r--r--gnu/packages/patches/vinagre-revert-2.patch448
-rw-r--r--gnu/packages/patches/xf86-video-siliconmotion-fix-ftbfs.patch171
12 files changed, 826 insertions, 238 deletions
diff --git a/gnu/packages/patches/bcftools-regidx-unsigned-char.patch b/gnu/packages/patches/bcftools-regidx-unsigned-char.patch
new file mode 100644
index 0000000000..af5bc160f5
--- /dev/null
+++ b/gnu/packages/patches/bcftools-regidx-unsigned-char.patch
@@ -0,0 +1,16 @@
+Description: Fix test-regidx argument parsing on archs with unsigned char
+ On architectures where char is unsigned "c >= 0" was always true.
+Author: Adrian Bunk <bunk@debian.org>
+Bug-Debian: https://bugs.debian.org/865060
+
+--- a/test/test-regidx.c
++++ b/test/test-regidx.c
+@@ -336,7 +336,7 @@
+         {"seed",1,0,'s'},
+         {0,0,0,0}
+     };
+-    char c;
++    int c;
+     int seed = (int)time(NULL);
+     while ((c = getopt_long(argc, argv, "hvs:",loptions,NULL)) >= 0) 
+     {
diff --git a/gnu/packages/patches/graphicsmagick-CVE-2017-12935.patch b/gnu/packages/patches/graphicsmagick-CVE-2017-12935.patch
new file mode 100644
index 0000000000..2cb3d46f62
--- /dev/null
+++ b/gnu/packages/patches/graphicsmagick-CVE-2017-12935.patch
@@ -0,0 +1,28 @@
+This patch comes from http://hg.code.sf.net/p/graphicsmagick/code/rev/cd699a44f188.
+
+diff -ur a/coders/png.c b/coders/png.c
+--- a/coders/png.c	2017-07-04 17:32:08.000000000 -0400
++++ b/coders/png.c	2017-08-19 11:16:20.933969362 -0400
+@@ -4101,11 +4101,17 @@
+                   mng_info->image=image;
+                 }
+ 
+-              if ((mng_info->mng_width > 65535L) || (mng_info->mng_height
+-                                                     > 65535L))
+-                (void) ThrowException(&image->exception,ImageError,
+-                                      WidthOrHeightExceedsLimit,
+-                                      image->filename);
++              if ((mng_info->mng_width > 65535L) ||
++                  (mng_info->mng_height > 65535L))
++                {
++                  (void) LogMagickEvent(CoderEvent,GetMagickModule(),
++                      "  MNG width or height is too large: %lu, %lu",
++                      mng_info->mng_width,mng_info->mng_height);
++                  MagickFreeMemory(chunk);
++                  ThrowReaderException(CorruptImageError,
++                     ImproperImageHeader,image);
++                }
++
+               FormatString(page_geometry,"%lux%lu+0+0",mng_info->mng_width,
+                            mng_info->mng_height);
+               mng_info->frame.left=0;
diff --git a/gnu/packages/patches/graphicsmagick-CVE-2017-12936.patch b/gnu/packages/patches/graphicsmagick-CVE-2017-12936.patch
new file mode 100644
index 0000000000..7036f37438
--- /dev/null
+++ b/gnu/packages/patches/graphicsmagick-CVE-2017-12936.patch
@@ -0,0 +1,16 @@
+This patch comes from http://hg.code.sf.net/p/graphicsmagick/code/rev/be898b7c97bd.
+
+diff -ur a/coders/wmf.c b/coders/wmf.c
+--- a/coders/wmf.c	2016-09-05 15:20:23.000000000 -0400
++++ b/coders/wmf.c	2017-08-19 10:38:08.984187264 -0400
+@@ -2719,8 +2719,8 @@
+   if(image->exception.severity != UndefinedException)
+     ThrowException2(exception,
+                    CoderWarning,
+-                   ddata->image->exception.reason,
+-                   ddata->image->exception.description);
++                   image->exception.reason,
++                   image->exception.description);
+ 
+   if(logging)
+     (void) LogMagickEvent(CoderEvent,GetMagickModule(),"leave ReadWMFImage()");
diff --git a/gnu/packages/patches/graphicsmagick-CVE-2017-12937.patch b/gnu/packages/patches/graphicsmagick-CVE-2017-12937.patch
new file mode 100644
index 0000000000..71af9ffe59
--- /dev/null
+++ b/gnu/packages/patches/graphicsmagick-CVE-2017-12937.patch
@@ -0,0 +1,28 @@
+This patch comes from http://hg.code.sf.net/p/graphicsmagick/code/rev/95d00d55e978.
+
+diff -ur a/coders/sun.c b/coders/sun.c
+--- a/coders/sun.c	2016-05-30 13:19:54.000000000 -0400
++++ b/coders/sun.c	2017-08-18 18:00:00.191023610 -0400
+@@ -1,5 +1,5 @@
+ /*
+-% Copyright (C) 2003-2015 GraphicsMagick Group
++% Copyright (C) 2003-2017 GraphicsMagick Group
+ % Copyright (C) 2002 ImageMagick Studio
+ % Copyright 1991-1999 E. I. du Pont de Nemours and Company
+ %
+@@ -577,6 +577,7 @@
+           for (bit=7; bit >= 0; bit--)
+             {
+               index=((*p) & (0x01 << bit) ? 0x01 : 0x00);
++              VerifyColormapIndex(image,index);
+               indexes[x+7-bit]=index;
+               q[x+7-bit]=image->colormap[index];
+             }
+@@ -587,6 +588,7 @@
+             for (bit=7; bit >= (long) (8-(image->columns % 8)); bit--)
+               {
+                 index=((*p) & (0x01 << bit) ? 0x01 : 0x00);
++                VerifyColormapIndex(image,index);
+                 indexes[x+7-bit]=index;
+                 q[x+7-bit]=image->colormap[index];
+               }
diff --git a/gnu/packages/patches/lz4-fix-test-failures.patch b/gnu/packages/patches/lz4-fix-test-failures.patch
deleted file mode 100644
index d38357d402..0000000000
--- a/gnu/packages/patches/lz4-fix-test-failures.patch
+++ /dev/null
@@ -1,136 +0,0 @@
-These two patches fix some bugs in lz4's test suite:
-
-https://github.com/lz4/lz4/issues/308
-
-Patches copied from upstream source repository:
-
-https://github.com/lz4/lz4/commit/b89cac7b2e92b792af98bb0a12e4d14684d07629
-https://github.com/lz4/lz4/commit/0dfb0b9dad2a8cb7cc347d2139bf9b84de7e1481
-
-From b89cac7b2e92b792af98bb0a12e4d14684d07629 Mon Sep 17 00:00:00 2001
-From: Eric Siegerman <pub08-git@davor.org>
-Date: Tue, 14 Feb 2017 14:17:06 -0500
-Subject: [PATCH] Don't use "foo && false || true"
-
-Replace it with either:
-    test ! -f $FILE_THAT_SHOULD_NOT_EXIST
-or:
-    ! $COMMAND_THAT_SHOULD_FAIL
-
-as appropriate.
----
- tests/Makefile | 38 +++++++++++++++++++-------------------
- 1 file changed, 19 insertions(+), 19 deletions(-)
-
-diff --git a/tests/Makefile b/tests/Makefile
-index 77e6ae7..ebab278 100644
---- a/tests/Makefile
-+++ b/tests/Makefile
-@@ -236,17 +236,17 @@ test-lz4-basic: lz4 datagen unlz4 lz4cat
- 	./datagen -g256MB | $(LZ4) -vqB4D | $(LZ4) -t
- 	@echo "hello world" > tmp
- 	$(LZ4) --rm -f tmp
--	ls -ls tmp         && false || true   # must fail (--rm)
--	ls -ls tmp.lz4
--	$(PRGDIR)/lz4cat tmp.lz4              # must display hello world
--	ls -ls tmp.lz4
-+	test ! -f tmp                      # must fail (--rm)
-+	test   -f tmp.lz4
-+	$(PRGDIR)/lz4cat tmp.lz4           # must display hello world
-+	test   -f tmp.lz4
- 	$(PRGDIR)/unlz4 --rm tmp.lz4
--	ls -ls tmp
--	ls -ls tmp.lz4     && false || true   # must fail (--rm)
--	ls -ls tmp.lz4.lz4 && false || true   # must fail (unlz4)
--	$(PRGDIR)/lz4cat tmp                  # pass-through mode
--	ls -ls tmp
--	ls -ls tmp.lz4     && false || true   # must fail (lz4cat)
-+	test   -f tmp
-+	test ! -f tmp.lz4                  # must fail (--rm)
-+	test ! -f tmp.lz4.lz4              # must fail (unlz4)
-+	$(PRGDIR)/lz4cat tmp               # pass-through mode
-+	test   -f tmp
-+	test ! -f tmp.lz4                  # must fail (lz4cat)
- 	$(LZ4) tmp                         # creates tmp.lz4
- 	$(PRGDIR)/lz4cat < tmp.lz4 > tmp3  # checks lz4cat works with stdin (#285)
- 	$(DIFF) -q tmp tmp3
-@@ -262,22 +262,22 @@ test-lz4-hugefile: lz4 datagen
- 
- test-lz4-testmode: lz4 datagen
- 	@echo "\n ---- bench mode ----"
--	$(LZ4) -bi1
-+	  $(LZ4) -bi1
- 	@echo "\n ---- test mode ----"
--	./datagen | $(LZ4) -t             && false || true
--	./datagen | $(LZ4) -tf            && false || true
-+	! ./datagen | $(LZ4) -t
-+	! ./datagen | $(LZ4) -tf
- 	@echo "\n ---- pass-through mode ----"
--	./datagen | $(LZ4) -d  > $(VOID)  && false || true
--	./datagen | $(LZ4) -df > $(VOID)
-+	! ./datagen | $(LZ4) -d  > $(VOID)
-+	  ./datagen | $(LZ4) -df > $(VOID)
- 	@echo "Hello World !" > tmp1
- 	$(LZ4) -dcf tmp1
- 	@echo "from underground..." > tmp2
- 	$(LZ4) -dcfm tmp1 tmp2
- 	@echo "\n ---- test cli ----"
--	$(LZ4)     file-does-not-exist    && false || true
--	$(LZ4) -f  file-does-not-exist    && false || true
--	$(LZ4) -fm file1-dne file2-dne    && false || true
--	$(LZ4) -fm file1-dne file2-dne    && false || true
-+	! $(LZ4)     file-does-not-exist
-+	! $(LZ4) -f  file-does-not-exist
-+	! $(LZ4) -fm file1-dne file2-dne
-+	! $(LZ4) -fm file1-dne file2-dne
- 
- test-lz4-opt-parser: lz4 datagen
- 	@echo "\n ---- test opt-parser ----"
--- 
-2.12.2
-
-From 0dfb0b9dad2a8cb7cc347d2139bf9b84de7e1481 Mon Sep 17 00:00:00 2001
-From: "Dmitry V. Levin" <ldv@altlinux.org>
-Date: Sun, 5 Mar 2017 23:20:10 +0000
-Subject: [PATCH] Fix test-lz4-basic
-
-When no output filename is specified and stdout is not a terminal,
-lz4 doesn't attempt to guess an output filename and uses stdout for
-output.
-
-This change fixes test-lz4-basic when run without a terminal
-by specifying output filenames.
----
- tests/Makefile | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/tests/Makefile b/tests/Makefile
-index ebab278..d68c700 100644
---- a/tests/Makefile
-+++ b/tests/Makefile
-@@ -235,19 +235,19 @@ test-lz4-basic: lz4 datagen unlz4 lz4cat
- 	./datagen -g33M   | $(LZ4) --no-frame-crc | $(LZ4) -t
- 	./datagen -g256MB | $(LZ4) -vqB4D | $(LZ4) -t
- 	@echo "hello world" > tmp
--	$(LZ4) --rm -f tmp
-+	$(LZ4) --rm -f tmp tmp.lz4
- 	test ! -f tmp                      # must fail (--rm)
- 	test   -f tmp.lz4
- 	$(PRGDIR)/lz4cat tmp.lz4           # must display hello world
- 	test   -f tmp.lz4
--	$(PRGDIR)/unlz4 --rm tmp.lz4
-+	$(PRGDIR)/unlz4 --rm tmp.lz4 tmp
- 	test   -f tmp
- 	test ! -f tmp.lz4                  # must fail (--rm)
- 	test ! -f tmp.lz4.lz4              # must fail (unlz4)
- 	$(PRGDIR)/lz4cat tmp               # pass-through mode
- 	test   -f tmp
- 	test ! -f tmp.lz4                  # must fail (lz4cat)
--	$(LZ4) tmp                         # creates tmp.lz4
-+	$(LZ4) tmp tmp.lz4                 # creates tmp.lz4
- 	$(PRGDIR)/lz4cat < tmp.lz4 > tmp3  # checks lz4cat works with stdin (#285)
- 	$(DIFF) -q tmp tmp3
- 	$(PRGDIR)/lz4cat < tmp > tmp2      # checks lz4cat works with stdin (#285)
--- 
-2.12.2
-
diff --git a/gnu/packages/patches/newsbeuter-CVE-2017-12904.patch b/gnu/packages/patches/newsbeuter-CVE-2017-12904.patch
new file mode 100644
index 0000000000..8e90502469
--- /dev/null
+++ b/gnu/packages/patches/newsbeuter-CVE-2017-12904.patch
@@ -0,0 +1,34 @@
+Fix CVE-2017-12904:
+
+https://github.com/akrennmair/newsbeuter/issues/591
+https://cve.mitre.org/cgi-bin/cvename.cgi?name=2017-12904
+
+Patch copied from the Debian package of newsbeuter, version 2.9-5+deb9u1.
+
+Adapted from upstream source repository:
+
+https://github.com/akrennmair/newsbeuter/commit/96e9506ae9e252c548665152d1b8968297128307
+
+Description: Fix a RCE vulnerability in the bookmark command
+ Newsbeuter didn't properly escape the title and description fields before
+ passing them to the bookmarking program which could lead to remote code
+ execution using the shells command substitution functionality (e.g. "$()", ``,
+ etc)
+
+Origin: upstream, https://github.com/akrennmair/newsbeuter/commit/96e9506ae9e252c548665152d1b8968297128307
+Last-Update: 2017-08-18
+
+--- newsbeuter-2.9.orig/src/controller.cpp
++++ newsbeuter-2.9/src/controller.cpp
+@@ -1274,9 +1274,10 @@ std::string controller::bookmark(const s
+ 	std::string bookmark_cmd = cfg.get_configvalue("bookmark-cmd");
+ 	bool is_interactive = cfg.get_configvalue_as_bool("bookmark-interactive");
+ 	if (bookmark_cmd.length() > 0) {
+-		std::string cmdline = utils::strprintf("%s '%s' %s %s",
++		std::string cmdline = utils::strprintf("%s '%s' '%s' '%s'",
+ 		                                       bookmark_cmd.c_str(), utils::replace_all(url,"'", "%27").c_str(),
+-		                                       stfl::quote(title).c_str(), stfl::quote(description).c_str());
++		                                       utils::replace_all(title,"'", "%27").c_str(),
++		                                       utils::replace_all(description,"'", "%27").c_str());
+ 
+ 		LOG(LOG_DEBUG, "controller::bookmark: cmd = %s", cmdline.c_str());
diff --git a/gnu/packages/patches/python-cython-fix-tests-32bit.patch b/gnu/packages/patches/python-cython-fix-tests-32bit.patch
deleted file mode 100644
index 7ccc11dd4c..0000000000
--- a/gnu/packages/patches/python-cython-fix-tests-32bit.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-This fixes a test failure on 32-bit platforms.
-
-Upstream bug URL: https://github.com/cython/cython/issues/1548
-
-Patch copied from upstream source repository:
-
-https://github.com/cython/cython/commit/d92a718a26c9354fbf35f31a17de5c069865a447
-
-From d92a718a26c9354fbf35f31a17de5c069865a447 Mon Sep 17 00:00:00 2001
-From: Robert Bradshaw <robertwb@gmail.com>
-Date: Tue, 24 Jan 2017 16:57:00 -0800
-Subject: [PATCH] Normalize possible L suffix.
-
----
- tests/run/cpdef_enums.pyx | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/tests/run/cpdef_enums.pyx b/tests/run/cpdef_enums.pyx
-index 167c762..c264ec5 100644
---- a/tests/run/cpdef_enums.pyx
-+++ b/tests/run/cpdef_enums.pyx
-@@ -93,4 +93,4 @@ def verify_resolution_GH1533():
-     3
-     """
-     THREE = 100
--    return PyxEnum.THREE
-+    return int(PyxEnum.THREE)
diff --git a/gnu/packages/patches/python-pygit2-disable-network-tests.patch b/gnu/packages/patches/python-pygit2-disable-network-tests.patch
index e46d244807..5578e4c375 100644
--- a/gnu/packages/patches/python-pygit2-disable-network-tests.patch
+++ b/gnu/packages/patches/python-pygit2-disable-network-tests.patch
@@ -1,64 +1,43 @@
 Disable tests trying to look up remote servers.
 
 diff --git a/test/test_credentials.py b/test/test_credentials.py
-index 92482d9..9a281e5 100644
 --- a/test/test_credentials.py
 +++ b/test/test_credentials.py
-@@ -68,39 +68,5 @@ class CredentialCreateTest(utils.NoRepoTestCase):
+@@ -68,6 +68,7 @@ class CredentialCreateTest(utils.NoRepoTestCase):
          self.assertEqual((username, None, None, None), cred.credential_tuple)
  
  
--class CredentialCallback(utils.RepoTestCase):
--    def test_callback(self):
--        class MyCallbacks(pygit2.RemoteCallbacks):
--            @staticmethod
--            def credentials(url, username, allowed):
--                self.assertTrue(allowed & GIT_CREDTYPE_USERPASS_PLAINTEXT)
--                raise Exception("I don't know the password")
--
--        url = "https://github.com/github/github"
--        remote = self.repo.create_remote("github", url)
--
--        self.assertRaises(Exception, lambda: remote.fetch(callbacks=MyCallbacks()))
--
--    def test_bad_cred_type(self):
--        class MyCallbacks(pygit2.RemoteCallbacks):
--            @staticmethod
--            def credentials(url, username, allowed):
--                self.assertTrue(allowed & GIT_CREDTYPE_USERPASS_PLAINTEXT)
--                return Keypair("git", "foo.pub", "foo", "sekkrit")
--
--        url = "https://github.com/github/github"
--        remote = self.repo.create_remote("github", url)
--        self.assertRaises(TypeError, lambda: remote.fetch(callbacks=MyCallbacks()))
--
--class CallableCredentialTest(utils.RepoTestCase):
--
--    def test_user_pass(self):
--        credentials = UserPass("libgit2", "libgit2")
--        callbacks = pygit2.RemoteCallbacks(credentials=credentials)
--
--        url = "https://bitbucket.org/libgit2/testgitrepository.git"
--        remote = self.repo.create_remote("bb", url)
--        remote.fetch(callbacks=callbacks)
--
- if __name__ == '__main__':
-     unittest.main()
++@unittest.skipIf(True, "network tests are not supported in Guix")
+ class CredentialCallback(utils.RepoTestCase):
+     def test_callback(self):
+         class MyCallbacks(pygit2.RemoteCallbacks):
+@@ -92,6 +93,7 @@ class CredentialCallback(utils.RepoTestCase):
+         remote = self.repo.create_remote("github", url)
+         self.assertRaises(TypeError, lambda: remote.fetch(callbacks=MyCallbacks()))
+ 
++@unittest.skipIf(True, "network tests are not supported in Guix")
+ class CallableCredentialTest(utils.RepoTestCase):
+ 
+     def test_user_pass(self):
 diff --git a/test/test_repository.py b/test/test_repository.py
-index cfdf01e..c0d8de4 100644
 --- a/test/test_repository.py
 +++ b/test/test_repository.py
-@@ -538,13 +538,6 @@ class CloneRepositoryTest(utils.NoRepoTestCase):
+@@ -573,6 +573,7 @@ class CloneRepositoryTest(utils.NoRepoTestCase):
          self.assertTrue('refs/remotes/custom_remote/master' in repo.listall_references())
          self.assertIsNotNone(repo.remotes["custom_remote"])
  
--    def test_clone_with_credentials(self):
--        repo = clone_repository(
--            "https://bitbucket.org/libgit2/testgitrepository.git",
--            self._temp_dir, callbacks=pygit2.RemoteCallbacks(credentials=pygit2.UserPass("libgit2", "libgit2")))
--
--        self.assertFalse(repo.is_empty)
--
-     def test_clone_with_checkout_branch(self):
-         # create a test case which isolates the remote
-         test_repo = clone_repository('./test/data/testrepo.git',
++    @unittest.skipIf(True, "network tests are not supported in Guix")
+     def test_clone_with_credentials(self):
+         repo = clone_repository(
+             "https://bitbucket.org/libgit2/testgitrepository.git",
+diff --git a/test/test_submodule.py b/test/test_submodule.py
+--- a/test/test_submodule.py
++++ b/test/test_submodule.py
+@@ -42,6 +42,7 @@ SUBM_PATH = 'submodule'
+ SUBM_URL = 'https://github.com/libgit2/pygit2'
+ SUBM_HEAD_SHA = '819cbff552e46ac4b8d10925cc422a30aa04e78e'
+ 
++@unittest.skipIf(True, "network tests are not supported in Guix")
+ class SubmoduleTest(utils.SubmoduleRepoTestCase):
+ 
+     def test_lookup_submodule(self):
diff --git a/gnu/packages/patches/rpm-CVE-2014-8118.patch b/gnu/packages/patches/rpm-CVE-2014-8118.patch
deleted file mode 100644
index 5fdb0f0eb2..0000000000
--- a/gnu/packages/patches/rpm-CVE-2014-8118.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-Fix CVE-2014-8118 (integer overflow allowing arbitrary remote code
-execution via crafted CPIO header).
-
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-8118
-
-Source:
-https://bugzilla.redhat.com/attachment.cgi?id=962159&action=diff
-
-Adopted by Debian:
-http://anonscm.debian.org/cgit/collab-maint/rpm.git/plain/debian/patches/CVE-2014-8118.patch
-
-diff --git a/lib/cpio.c b/lib/cpio.c
-index 253ff0f..600633a 100644
---- a/lib/cpio.c
-+++ b/lib/cpio.c
-@@ -399,6 +399,9 @@ int rpmcpioHeaderRead(rpmcpio_t cpio, char ** path, int * fx)
- 
-     GET_NUM_FIELD(hdr.filesize, fsize);
-     GET_NUM_FIELD(hdr.namesize, nameSize);
-+    if (nameSize <= 0 || nameSize > 4096) {
-+        return RPMERR_BAD_HEADER;
-+    }
- 
-     char name[nameSize + 1];
-     read = Fread(name, nameSize, 1, cpio->fd);
diff --git a/gnu/packages/patches/vinagre-revert-1.patch b/gnu/packages/patches/vinagre-revert-1.patch
new file mode 100644
index 0000000000..5a983770b7
--- /dev/null
+++ b/gnu/packages/patches/vinagre-revert-1.patch
@@ -0,0 +1,56 @@
+Patch taken from Debian: revert changes that prevent building against freerdp
+version 1.1 branch.
+
+From 8ebc0685b85e0d1f70eb00171f2e7712de3d44bd Mon Sep 17 00:00:00 2001
+From: Michael Biebl <biebl@debian.org>
+Date: Thu, 22 Sep 2016 01:15:55 +0200
+Subject: [PATCH 1/2] Revert "Improve FreeRDP authentication failure handling"
+
+This reverts commit d7b4f88943e8615d252d27e1efc58cb64a9e1821.
+---
+ plugins/rdp/vinagre-rdp-tab.c | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/plugins/rdp/vinagre-rdp-tab.c b/plugins/rdp/vinagre-rdp-tab.c
+index b731f9b..8572bc3 100644
+--- a/plugins/rdp/vinagre-rdp-tab.c
++++ b/plugins/rdp/vinagre-rdp-tab.c
+@@ -1195,8 +1195,8 @@ open_freerdp (VinagreRdpTab *rdp_tab)
+   VinagreTab           *tab = VINAGRE_TAB (rdp_tab);
+   GtkWindow            *window = GTK_WINDOW (vinagre_tab_get_window (tab));
+   gboolean              success = TRUE;
++  gboolean              authentication_error = FALSE;
+   gboolean              cancelled = FALSE;
+-  guint                 authentication_errors = 0;
+ 
+   priv->events = g_queue_new ();
+ 
+@@ -1205,12 +1205,14 @@ open_freerdp (VinagreRdpTab *rdp_tab)
+ 
+   do
+     {
++      authentication_error = FALSE;
++
+       /* Run FreeRDP session */
+       success = freerdp_connect (priv->freerdp_session);
+       if (!success)
+         {
+-          authentication_errors += freerdp_get_last_error (priv->freerdp_session->context) == 0x20009 ||
+-                                   freerdp_get_last_error (priv->freerdp_session->context) == 0x2000c;
++          authentication_error = freerdp_get_last_error (priv->freerdp_session->context) == 0x20009 ||
++                                 freerdp_get_last_error (priv->freerdp_session->context) == 0x2000c;
+ 
+           cancelled = freerdp_get_last_error (priv->freerdp_session->context) == 0x2000b;
+ 
+@@ -1218,7 +1220,7 @@ open_freerdp (VinagreRdpTab *rdp_tab)
+           init_freerdp (rdp_tab);
+         }
+     }
+-  while (!success && authentication_errors < 3);
++  while (!success && authentication_error);
+ 
+   if (!success)
+     {
+-- 
+2.9.3
+
diff --git a/gnu/packages/patches/vinagre-revert-2.patch b/gnu/packages/patches/vinagre-revert-2.patch
new file mode 100644
index 0000000000..686ee203e4
--- /dev/null
+++ b/gnu/packages/patches/vinagre-revert-2.patch
@@ -0,0 +1,448 @@
+Patch taken from Debian: revert changes that prevent building against freerdp
+version 1.1 branch.
+
+From bb1828b6b7eb29bb037bcc687cf10f916ddc7561 Mon Sep 17 00:00:00 2001
+From: Michael Biebl <biebl@debian.org>
+Date: Thu, 22 Sep 2016 01:18:16 +0200
+Subject: [PATCH 2/2] Revert "Store credentials for RDP"
+
+This reverts commit 60dea279a24c7f0e398b89a0a60d45e80087ed1d.
+---
+ plugins/rdp/vinagre-rdp-connection.c |  22 +---
+ plugins/rdp/vinagre-rdp-plugin.c     |  29 +----
+ plugins/rdp/vinagre-rdp-tab.c        | 231 +++++++++++++++++------------------
+ 3 files changed, 123 insertions(+), 159 deletions(-)
+
+diff --git a/plugins/rdp/vinagre-rdp-connection.c b/plugins/rdp/vinagre-rdp-connection.c
+index f0ff02b..c5f6ed1 100644
+--- a/plugins/rdp/vinagre-rdp-connection.c
++++ b/plugins/rdp/vinagre-rdp-connection.c
+@@ -127,25 +127,9 @@ rdp_parse_item (VinagreConnection *conn, xmlNode *root)
+ static void
+ rdp_parse_options_widget (VinagreConnection *conn, GtkWidget *widget)
+ {
+-  const gchar *text;
+-  GtkWidget   *u_entry, *d_entry, *spin_button, *scaling_button;
+-  gboolean     scaling;
+-  guint        width, height;
+-
+-  d_entry = g_object_get_data (G_OBJECT (widget), "domain_entry");
+-  if (!d_entry)
+-    {
+-      g_warning ("Wrong widget passed to rdp_parse_options_widget()");
+-      return;
+-    }
+-
+-  text = gtk_entry_get_text (GTK_ENTRY (d_entry));
+-  vinagre_cache_prefs_set_string  ("rdp-connection", "domain", text);
+-
+-  g_object_set (conn,
+-		"domain", text != NULL && *text != '\0' ? text : NULL,
+-		NULL);
+-
++  GtkWidget *u_entry, *spin_button, *scaling_button;
++  gboolean   scaling;
++  guint      width, height;
+ 
+   u_entry = g_object_get_data (G_OBJECT (widget), "username_entry");
+   if (!u_entry)
+diff --git a/plugins/rdp/vinagre-rdp-plugin.c b/plugins/rdp/vinagre-rdp-plugin.c
+index 4751102..f41da37 100644
+--- a/plugins/rdp/vinagre-rdp-plugin.c
++++ b/plugins/rdp/vinagre-rdp-plugin.c
+@@ -100,7 +100,7 @@ vinagre_rdp_plugin_init (VinagreRdpPlugin *plugin)
+ static GtkWidget *
+ impl_get_connect_widget (VinagreProtocol *plugin, VinagreConnection *conn)
+ {
+-  GtkWidget *grid, *label, *u_entry, *d_entry, *spin_button, *check;
++  GtkWidget *grid, *label, *u_entry, *spin_button, *check;
+   gchar     *str;
+   gint       width, height;
+ 
+@@ -146,29 +146,10 @@ impl_get_connect_widget (VinagreProtocol *plugin, VinagreConnection *conn)
+   g_free (str);
+ 
+ 
+-  label = gtk_label_new_with_mnemonic (_("_Domain:"));
+-  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+-  gtk_grid_attach (GTK_GRID (grid), label, 0, 3, 1, 1);
+-  gtk_widget_set_margin_left (label, 12);
+-
+-  d_entry = gtk_entry_new ();
+-  /* Translators: This is the tooltip for the domain field in a RDP connection */
+-  gtk_widget_set_tooltip_text (d_entry, _("Optional."));
+-  g_object_set_data (G_OBJECT (grid), "domain_entry", d_entry);
+-  gtk_grid_attach (GTK_GRID (grid), d_entry, 1, 3, 1, 1);
+-  gtk_label_set_mnemonic_widget (GTK_LABEL (label), d_entry);
+-  str = g_strdup (VINAGRE_IS_CONNECTION (conn) ?
+-		  vinagre_connection_get_domain (conn) :
+-		  vinagre_cache_prefs_get_string  ("rdp-connection", "domain", ""));
+-  gtk_entry_set_text (GTK_ENTRY (d_entry), str);
+-  gtk_entry_set_activates_default (GTK_ENTRY (d_entry), TRUE);
+-  g_free (str);
+-
+-
+   /* Host width */
+   label = gtk_label_new_with_mnemonic (_("_Width:"));
+   gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+-  gtk_grid_attach (GTK_GRID (grid), label, 0, 4, 1, 1);
++  gtk_grid_attach (GTK_GRID (grid), label, 0, 3, 1, 1);
+   gtk_widget_set_margin_left (label, 12);
+ 
+   spin_button = gtk_spin_button_new_with_range (MIN_SIZE, MAX_SIZE, 1);
+@@ -176,7 +157,7 @@ impl_get_connect_widget (VinagreProtocol *plugin, VinagreConnection *conn)
+   gtk_widget_set_tooltip_text (spin_button, _("Set width of the remote desktop"));
+   gtk_spin_button_set_value (GTK_SPIN_BUTTON (spin_button), DEFAULT_WIDTH);
+   g_object_set_data (G_OBJECT (grid), "width_spin_button", spin_button);
+-  gtk_grid_attach (GTK_GRID (grid), spin_button, 1, 4, 1, 1);
++  gtk_grid_attach (GTK_GRID (grid), spin_button, 1, 3, 1, 1);
+   gtk_label_set_mnemonic_widget (GTK_LABEL (label), spin_button);
+   width = VINAGRE_IS_CONNECTION (conn) ?
+           vinagre_connection_get_width (conn) :
+@@ -188,7 +169,7 @@ impl_get_connect_widget (VinagreProtocol *plugin, VinagreConnection *conn)
+   /* Host height */
+   label = gtk_label_new_with_mnemonic (_("_Height:"));
+   gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+-  gtk_grid_attach (GTK_GRID (grid), label, 0, 5, 1, 1);
++  gtk_grid_attach (GTK_GRID (grid), label, 0, 4, 1, 1);
+   gtk_widget_set_margin_left (label, 12);
+ 
+   spin_button = gtk_spin_button_new_with_range (MIN_SIZE, MAX_SIZE, 1);
+@@ -196,7 +177,7 @@ impl_get_connect_widget (VinagreProtocol *plugin, VinagreConnection *conn)
+   gtk_widget_set_tooltip_text (spin_button, _("Set height of the remote desktop"));
+   gtk_spin_button_set_value (GTK_SPIN_BUTTON (spin_button), DEFAULT_HEIGHT);
+   g_object_set_data (G_OBJECT (grid), "height_spin_button", spin_button);
+-  gtk_grid_attach (GTK_GRID (grid), spin_button, 1, 5, 1, 1);
++  gtk_grid_attach (GTK_GRID (grid), spin_button, 1, 4, 1, 1);
+   gtk_label_set_mnemonic_widget (GTK_LABEL (label), spin_button);
+   height = VINAGRE_IS_CONNECTION (conn) ?
+            vinagre_connection_get_height (conn) :
+diff --git a/plugins/rdp/vinagre-rdp-tab.c b/plugins/rdp/vinagre-rdp-tab.c
+index 8572bc3..f3d9c08 100644
+--- a/plugins/rdp/vinagre-rdp-tab.c
++++ b/plugins/rdp/vinagre-rdp-tab.c
+@@ -70,8 +70,6 @@ struct _VinagreRdpTabPrivate
+   gboolean         scaling;
+   double           scale;
+   double           offset_x, offset_y;
+-
+-  guint            authentication_attempts;
+ };
+ 
+ G_DEFINE_TYPE (VinagreRdpTab, vinagre_rdp_tab, VINAGRE_TYPE_TAB)
+@@ -611,7 +609,6 @@ frdp_post_connect (freerdp *instance)
+                               0, 0,
+                               gdi->width, gdi->height);
+ 
+-  vinagre_tab_save_credentials_in_keyring (VINAGRE_TAB (rdp_tab));
+   vinagre_tab_add_recent_used (VINAGRE_TAB (rdp_tab));
+   vinagre_tab_set_state (VINAGRE_TAB (rdp_tab), VINAGRE_TAB_STATE_CONNECTED);
+ 
+@@ -862,76 +859,114 @@ frdp_mouse_moved (GtkWidget      *widget,
+   return TRUE;
+ }
+ 
++static void
++entry_text_changed_cb (GtkEntry   *entry,
++                       GtkBuilder *builder)
++{
++  const gchar *text;
++  GtkWidget   *widget;
++  gsize        username_length;
++  gsize        password_length;
++
++  widget = GTK_WIDGET (gtk_builder_get_object (builder, "username_entry"));
++  text = gtk_entry_get_text (GTK_ENTRY (widget));
++  username_length = strlen (text);
++
++  widget = GTK_WIDGET (gtk_builder_get_object (builder, "password_entry"));
++  text = gtk_entry_get_text (GTK_ENTRY (widget));
++  password_length = strlen (text);
++
++  widget = GTK_WIDGET (gtk_builder_get_object (builder, "ok_button"));
++  gtk_widget_set_sensitive (widget, password_length > 0 && username_length > 0);
++}
++
+ static gboolean
+ frdp_authenticate (freerdp  *instance,
+                    char    **username,
+                    char    **password,
+                    char    **domain)
+ {
+-  VinagreTab           *tab = VINAGRE_TAB (((frdpContext *) instance->context)->rdp_tab);
+-  VinagreRdpTab        *rdp_tab = VINAGRE_RDP_TAB (tab);
+-  VinagreRdpTabPrivate *priv = rdp_tab->priv;
+-  VinagreConnection    *conn = vinagre_tab_get_conn (tab);
+-  GtkWindow            *window = GTK_WINDOW (vinagre_tab_get_window (tab));
+-  gboolean              save_in_keyring = FALSE;
+-  gchar                *keyring_domain = NULL;
+-  gchar                *keyring_username = NULL;
+-  gchar                *keyring_password = NULL;
++  VinagreTab        *tab = VINAGRE_TAB (((frdpContext *) instance->context)->rdp_tab);
++  VinagreConnection *conn = vinagre_tab_get_conn (tab);
++  const gchar       *user_name;
++  const gchar       *domain_name;
++  GtkBuilder        *builder;
++  GtkWidget         *dialog;
++  GtkWidget         *widget;
++  GtkWidget         *username_entry;
++  GtkWidget         *password_entry;
++  GtkWidget         *domain_entry;
++  gboolean           save_credential_check_visible;
++  gboolean           domain_label_visible;
++  gboolean           domain_entry_visible;
++  gint               response;
+ 
+-  priv->authentication_attempts++;
++  builder = vinagre_utils_get_builder ();
+ 
+-  if (priv->authentication_attempts == 1)
+-    {
+-      vinagre_tab_find_credentials_in_keyring (tab, &keyring_domain, &keyring_username, &keyring_password);
+-      if (keyring_password != NULL && keyring_username != NULL)
+-        {
+-          *domain = keyring_domain;
+-          *username = keyring_username;
+-          *password = keyring_password;
++  dialog = GTK_WIDGET (gtk_builder_get_object (builder, "auth_required_dialog"));
++  gtk_window_set_modal ((GtkWindow *) dialog, TRUE);
++  gtk_window_set_transient_for ((GtkWindow *) dialog, GTK_WINDOW (vinagre_tab_get_window (tab)));
+ 
+-          return TRUE;
+-        }
+-      else
+-        {
+-          g_free (keyring_domain);
+-          g_free (keyring_username);
+-          g_free (keyring_password);
+-        }
++  widget = GTK_WIDGET (gtk_builder_get_object (builder, "host_label"));
++  gtk_label_set_text (GTK_LABEL (widget), vinagre_connection_get_host (conn));
++
++  username_entry = GTK_WIDGET (gtk_builder_get_object (builder, "username_entry"));
++  password_entry = GTK_WIDGET (gtk_builder_get_object (builder, "password_entry"));
++  domain_entry = GTK_WIDGET (gtk_builder_get_object (builder, "domain_entry"));
++
++  if (*username != NULL && *username[0] != '\0')
++    {
++      gtk_entry_set_text (GTK_ENTRY (username_entry), *username);
++      gtk_widget_grab_focus (password_entry);
+     }
+ 
+-  if (vinagre_utils_request_credential (window,
+-                                        "RDP",
+-                                        vinagre_connection_get_host (conn),
+-                                        vinagre_connection_get_domain (conn),
+-                                        vinagre_connection_get_username (conn),
+-                                        TRUE,
+-                                        TRUE,
+-                                        TRUE,
+-                                        20,
+-                                        domain,
+-                                        username,
+-                                        password,
+-                                        &save_in_keyring))
++  g_signal_connect (username_entry, "changed", G_CALLBACK (entry_text_changed_cb), builder);
++  g_signal_connect (password_entry, "changed", G_CALLBACK (entry_text_changed_cb), builder);
++
++
++  widget = GTK_WIDGET (gtk_builder_get_object (builder, "save_credential_check"));
++  save_credential_check_visible = gtk_widget_get_visible (widget);
++  gtk_widget_set_visible (widget, FALSE);
++
++  widget = GTK_WIDGET (gtk_builder_get_object (builder, "domain_label"));
++  domain_label_visible = gtk_widget_get_visible (widget);
++  gtk_widget_set_visible (widget, TRUE);
++
++  domain_entry_visible = gtk_widget_get_visible (domain_entry);
++  gtk_widget_set_visible (domain_entry, TRUE);
++
++
++  response = gtk_dialog_run (GTK_DIALOG (dialog));
++  gtk_widget_hide (dialog);
++
++
++  widget = GTK_WIDGET (gtk_builder_get_object (builder, "save_credential_check"));
++  gtk_widget_set_visible (widget, save_credential_check_visible);
++
++  widget = GTK_WIDGET (gtk_builder_get_object (builder, "domain_label"));
++  gtk_widget_set_visible (widget, domain_label_visible);
++
++  gtk_widget_set_visible (domain_entry, domain_entry_visible);
++
++
++  if (response == GTK_RESPONSE_OK)
+     {
+-      if (*domain && **domain != '\0')
+-        vinagre_connection_set_domain (conn, *domain);
++      domain_name = gtk_entry_get_text (GTK_ENTRY (domain_entry));
++      if (g_strcmp0 (*domain, domain_name) != 0)
++        *domain = g_strdup (domain_name);
+ 
+-      if (*username && **username != '\0')
+-        vinagre_connection_set_username (conn, *username);
++      user_name = gtk_entry_get_text (GTK_ENTRY (username_entry));
++      if (g_strcmp0 (*username, user_name) != 0)
++        *username = g_strdup (user_name);
+ 
+-      if (*password && **password != '\0')
+-        vinagre_connection_set_password (conn, *password);
++      *password = g_strdup (gtk_entry_get_text (GTK_ENTRY (password_entry)));
+ 
+-      vinagre_tab_set_save_credentials (tab, save_in_keyring);
++      return TRUE;
+     }
+   else
+     {
+-      vinagre_tab_remove_from_notebook (tab);
+-
+       return FALSE;
+     }
+-
+-  return TRUE;
+ }
+ 
+ static BOOL
+@@ -1028,25 +1063,30 @@ frdp_changed_certificate_verify (freerdp *instance,
+ #endif
+ 
+ static void
+-init_freerdp (VinagreRdpTab *rdp_tab)
++open_freerdp (VinagreRdpTab *rdp_tab)
+ {
+   VinagreRdpTabPrivate *priv = rdp_tab->priv;
+-  rdpSettings          *settings;
+   VinagreTab           *tab = VINAGRE_TAB (rdp_tab);
+   VinagreConnection    *conn = vinagre_tab_get_conn (tab);
+-  gboolean              scaling;
+-  gchar                *hostname;
+-  gint                  width, height;
+-  gint                  port;
++  rdpSettings          *settings;
++  GtkWindow            *window = GTK_WINDOW (vinagre_tab_get_window (tab));
++  gboolean              success = TRUE;
++  gboolean              fullscreen, scaling;
++  gchar                *hostname, *username;
++  gint                  port, width, height;
+ 
+   g_object_get (conn,
+                 "port", &port,
+                 "host", &hostname,
+                 "width", &width,
+                 "height", &height,
++                "fullscreen", &fullscreen,
+                 "scaling", &scaling,
++                "username", &username,
+                 NULL);
+ 
++  priv->events = g_queue_new ();
++
+   /* Setup FreeRDP session */
+   priv->freerdp_session = freerdp_new ();
+   priv->freerdp_session->PreConnect = frdp_pre_connect;
+@@ -1111,6 +1151,17 @@ init_freerdp (VinagreRdpTab *rdp_tab)
+   settings->port = port;
+ #endif
+ 
++  /* Set username */
++  username = g_strstrip (username);
++  if (username != NULL && username[0] != '\0')
++    {
++#if HAVE_FREERDP_1_1
++      settings->Username = g_strdup (username);
++#else
++      settings->username = g_strdup (username);
++#endif
++    }
++
+   /* Set keyboard layout */
+ #if HAVE_FREERDP_1_1
+   freerdp_keyboard_init (KBD_US);
+@@ -1120,24 +1171,6 @@ init_freerdp (VinagreRdpTab *rdp_tab)
+ 
+   /* Allow font smoothing by default */
+   settings->AllowFontSmoothing = TRUE;
+-}
+-
+-static void
+-init_display (VinagreRdpTab *rdp_tab)
+-{
+-  VinagreRdpTabPrivate *priv = rdp_tab->priv;
+-  VinagreTab           *tab = VINAGRE_TAB (rdp_tab);
+-  VinagreConnection    *conn = vinagre_tab_get_conn (tab);
+-  GtkWindow            *window = GTK_WINDOW (vinagre_tab_get_window (tab));
+-  gboolean              fullscreen, scaling;
+-  gint                  width, height;
+-
+-  g_object_get (conn,
+-                "width", &width,
+-                "height", &height,
+-                "fullscreen", &fullscreen,
+-                "scaling", &scaling,
+-                NULL);
+ 
+   /* Setup display for FreeRDP session */
+   priv->display = gtk_drawing_area_new ();
+@@ -1186,54 +1219,20 @@ init_display (VinagreRdpTab *rdp_tab)
+   priv->key_release_handler_id = g_signal_connect (GTK_WIDGET (tab), "key-release-event",
+                                                    G_CALLBACK (frdp_key_pressed),
+                                                    rdp_tab);
+-}
+-
+-static void
+-open_freerdp (VinagreRdpTab *rdp_tab)
+-{
+-  VinagreRdpTabPrivate *priv = rdp_tab->priv;
+-  VinagreTab           *tab = VINAGRE_TAB (rdp_tab);
+-  GtkWindow            *window = GTK_WINDOW (vinagre_tab_get_window (tab));
+-  gboolean              success = TRUE;
+-  gboolean              authentication_error = FALSE;
+-  gboolean              cancelled = FALSE;
+-
+-  priv->events = g_queue_new ();
+-
+-  init_freerdp (rdp_tab);
+-  init_display (rdp_tab);
+-
+-  do
+-    {
+-      authentication_error = FALSE;
+ 
+-      /* Run FreeRDP session */
+-      success = freerdp_connect (priv->freerdp_session);
+-      if (!success)
+-        {
+-          authentication_error = freerdp_get_last_error (priv->freerdp_session->context) == 0x20009 ||
+-                                 freerdp_get_last_error (priv->freerdp_session->context) == 0x2000c;
+-
+-          cancelled = freerdp_get_last_error (priv->freerdp_session->context) == 0x2000b;
+-
+-          freerdp_free (priv->freerdp_session);
+-          init_freerdp (rdp_tab);
+-        }
+-    }
+-  while (!success && authentication_error);
++  /* Run FreeRDP session */
++  success = freerdp_connect (priv->freerdp_session);
+ 
+   if (!success)
+     {
+       gtk_window_unfullscreen (window);
+-      if (!cancelled)
+-        vinagre_utils_show_error_dialog (_("Error connecting to host."),
+-                                         NULL,
+-                                         window);
++      vinagre_utils_show_error_dialog (_("Error connecting to host."),
++                                       NULL,
++                                       window);
+       g_idle_add ((GSourceFunc) idle_close, rdp_tab);
+     }
+   else
+     {
+-      priv->authentication_attempts = 0;
+       priv->update_id = g_idle_add ((GSourceFunc) update, rdp_tab);
+     }
+ }
+-- 
+2.9.3
+
diff --git a/gnu/packages/patches/xf86-video-siliconmotion-fix-ftbfs.patch b/gnu/packages/patches/xf86-video-siliconmotion-fix-ftbfs.patch
new file mode 100644
index 0000000000..8aeec455d7
--- /dev/null
+++ b/gnu/packages/patches/xf86-video-siliconmotion-fix-ftbfs.patch
@@ -0,0 +1,171 @@
+From eee8fd4c489a693344da0bba14cfa54c54610b89 Mon Sep 17 00:00:00 2001
+From: Maarten Lankhorst <maarten.lankhorst@ubuntu.com>
+Date: Thu, 9 Mar 2017 13:31:34 +0200
+Subject: [PATCH] Fix build against xorg server 1.17 on certain architectures
+
+Fixes at least arm64, likely also hppa, m68k, sh4.
+
+Signed-off-by: Maarten Lankhorst <maarten.lankhorst@ubuntu.com>
+---
+ src/regsmi.h       | 18 ++++++++++++++++++
+ src/smi.h          |  2 ++
+ src/smi_driver.c   | 19 +++++++++----------
+ src/smilynx_crtc.c |  6 +++---
+ src/smilynx_hw.c   |  5 ++---
+ 5 files changed, 34 insertions(+), 16 deletions(-)
+
+diff --git a/src/regsmi.h b/src/regsmi.h
+index 5dd0320..69205ba 100644
+--- a/src/regsmi.h
++++ b/src/regsmi.h
+@@ -64,8 +64,13 @@ VGAIN8_INDEX(SMIPtr pSmi, int indexPort, int dataPort, CARD8 index)
+ 	MMIO_OUT8(pSmi->IOBase, indexPort, index);
+ 	return(MMIO_IN8(pSmi->IOBase, dataPort));
+     } else {
++#ifdef XSERVER_LIBPCIACCESS
++	pci_io_write8(pSmi->io, indexPort, index);
++	return pci_io_read8(pSmi->io, dataPort);
++#else
+ 	outb(pSmi->PIOBase + indexPort, index);
+ 	return(inb(pSmi->PIOBase + dataPort));
++#endif
+     }
+ }
+ 
+@@ -76,8 +81,13 @@ VGAOUT8_INDEX(SMIPtr pSmi, int indexPort, int dataPort, CARD8 index, CARD8 data)
+ 	MMIO_OUT8(pSmi->IOBase, indexPort, index);
+ 	MMIO_OUT8(pSmi->IOBase, dataPort, data);
+     } else {
++#ifdef XSERVER_LIBPCIACCESS
++	pci_io_write8(pSmi->io, indexPort, index);
++	pci_io_write8(pSmi->io, dataPort, data);
++#else
+ 	outb(pSmi->PIOBase + indexPort, index);
+ 	outb(pSmi->PIOBase + dataPort, data);
++#endif
+     }
+ }
+ 
+@@ -87,7 +97,11 @@ VGAIN8(SMIPtr pSmi, int port)
+     if (pSmi->IOBase) {
+ 	return(MMIO_IN8(pSmi->IOBase, port));
+     } else {
++#ifdef XSERVER_LIBPCIACCESS
++	return pci_io_read8(pSmi->io, port);
++#else
+ 	return(inb(pSmi->PIOBase + port));
++#endif
+     }
+ }
+ 
+@@ -97,7 +111,11 @@ VGAOUT8(SMIPtr pSmi, int port, CARD8 data)
+     if (pSmi->IOBase) {
+ 	MMIO_OUT8(pSmi->IOBase, port, data);
+     } else {
++#ifdef XSERVER_LIBPCIACCESS
++	pci_io_write8(pSmi->io, port, data);
++#else
+ 	outb(pSmi->PIOBase + port, data);
++#endif
+     }
+ }
+ 
+diff --git a/src/smi.h b/src/smi.h
+index 2742c8d..1f20a2d 100644
+--- a/src/smi.h
++++ b/src/smi.h
+@@ -171,6 +171,8 @@ typedef struct
+     pciVideoPtr		PciInfo;	/* PCI info vars */
+ #ifndef XSERVER_LIBPCIACCESS
+     PCITAG		PciTag;
++#else
++    struct pci_io_handle *io;
+ #endif
+     int			Chipset;	/* Chip info, set using PCI
+ 					   above */
+diff --git a/src/smi_driver.c b/src/smi_driver.c
+index 8949cae..6bdf64d 100644
+--- a/src/smi_driver.c
++++ b/src/smi_driver.c
+@@ -446,6 +446,9 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
+ 	pSmi->PIOBase = hwp->PIOOffset;
+ #else
+ 	pSmi->PIOBase = 0;
++#ifdef XSERVER_LIBPCIACCESS
++	pSmi->io = hwp->io;
++#endif
+ #endif
+ 
+ 	xf86ErrorFVerb(VERBLEV, "\tSMI_PreInit vgaCRIndex=%x, vgaIOBase=%x, "
+@@ -2022,16 +2025,14 @@ SMI_EnableMmio(ScrnInfoPtr pScrn)
+ 	vgaHWSetStdFuncs(hwp);
+ 
+ 	/* Enable linear mode */
+-	outb(pSmi->PIOBase + VGA_SEQ_INDEX, 0x18);
+-	tmp = inb(pSmi->PIOBase + VGA_SEQ_DATA);
++	tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x18);
+ 	pSmi->SR18Value = tmp;					/* PDR#521 */
+-	outb(pSmi->PIOBase + VGA_SEQ_DATA, tmp | 0x11);
++	VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x18, tmp | 0x11);
+ 
+ 	/* Enable 2D/3D Engine and Video Processor */
+-	outb(pSmi->PIOBase + VGA_SEQ_INDEX, 0x21);
+-	tmp = inb(pSmi->PIOBase + VGA_SEQ_DATA);
++	tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21);
+ 	pSmi->SR21Value = tmp;					/* PDR#521 */
+-	outb(pSmi->PIOBase + VGA_SEQ_DATA, tmp & ~0x03);
++	VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21, tmp & ~0x03);
+     }
+ 
+     LEAVE();
+@@ -2050,12 +2051,10 @@ SMI_DisableMmio(ScrnInfoPtr pScrn)
+ 	vgaHWSetStdFuncs(hwp);
+ 
+ 	/* Disable 2D/3D Engine and Video Processor */
+-	outb(pSmi->PIOBase + VGA_SEQ_INDEX, 0x21);
+-	outb(pSmi->PIOBase + VGA_SEQ_DATA, pSmi->SR21Value);	/* PDR#521 */
++	VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21, pSmi->SR21Value);	/* PDR#521 */
+ 
+ 	/* Disable linear mode */
+-	outb(pSmi->PIOBase + VGA_SEQ_INDEX, 0x18);
+-	outb(pSmi->PIOBase + VGA_SEQ_DATA, pSmi->SR18Value);	/* PDR#521 */
++	VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x18, pSmi->SR18Value);	/* PDR#521 */
+     }
+ 
+     LEAVE();
+diff --git a/src/smilynx_crtc.c b/src/smilynx_crtc.c
+index fb7183c..f4d8b4e 100644
+--- a/src/smilynx_crtc.c
++++ b/src/smilynx_crtc.c
+@@ -619,9 +619,9 @@ SMILynx_CrtcModeSet_bios(xf86CrtcPtr crtc,
+     xf86ExecX86int10(pSmi->pInt10);
+ 
+     /* Enable linear mode. */
+-    outb(pSmi->PIOBase + VGA_SEQ_INDEX, 0x18);
+-    tmp = inb(pSmi->PIOBase + VGA_SEQ_DATA);
+-    outb(pSmi->PIOBase + VGA_SEQ_DATA, tmp | 0x01);
++    VGAOUT8(pSmi, VGA_SEQ_INDEX, 0x18);
++    tmp = VGAIN8(pSmi, VGA_SEQ_DATA);
++    VGAOUT8(pSmi, VGA_SEQ_DATA, tmp | 0x01);
+ 
+     /* Enable DPR/VPR registers. */
+     tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21);
+diff --git a/src/smilynx_hw.c b/src/smilynx_hw.c
+index b2ee8a5..40aa5a4 100644
+--- a/src/smilynx_hw.c
++++ b/src/smilynx_hw.c
+@@ -365,9 +365,8 @@ SMILynx_WriteMode(ScrnInfoPtr pScrn, vgaRegPtr vgaSavePtr, SMIRegPtr restore)
+ 	xf86ExecX86int10(pSmi->pInt10);
+ 
+ 	/* Enable linear mode. */
+-	outb(pSmi->PIOBase + VGA_SEQ_INDEX, 0x18);
+-	tmp = inb(pSmi->PIOBase + VGA_SEQ_DATA);
+-	outb(pSmi->PIOBase + VGA_SEQ_DATA, tmp | 0x01);
++	tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x18);
++	VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x18, tmp | 0x01);
+ 
+ 	/* Enable DPR/VPR registers. */
+ 	tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21);
+-- 
+2.7.4
+