diff --git a/var/spack/repos/builtin/packages/qt/package.py b/var/spack/repos/builtin/packages/qt/package.py
index 3f3defeb8cd7778d5075803a78642a8b39d3dd13..1505eff61a0ed88c54217720ae3457967b92c56d 100644
--- a/var/spack/repos/builtin/packages/qt/package.py
+++ b/var/spack/repos/builtin/packages/qt/package.py
@@ -71,7 +71,9 @@ class Qt(Package):
     # see https://github.com/Homebrew/homebrew-core/pull/5951
     patch('restore-pc-files.patch', when='@5.9: platform=darwin')
 
+    patch('qt3accept.patch', when='@3.3.8b')
     patch('qt3krell.patch', when='@3.3.8b+krellpatch')
+    patch('qt3ptrdiff.patch', when='@3.3.8b')
 
     # see https://bugreports.qt.io/browse/QTBUG-57656
     patch('QTBUG-57656.patch', when='@5.8.0')
@@ -125,9 +127,13 @@ class Qt(Package):
 
     # OpenGL hardware acceleration
     depends_on("mesa", when='@4:+opengl')
+
     depends_on("libxcb", when=sys.platform != 'darwin')
     depends_on("libx11", when=sys.platform != 'darwin')
 
+    if sys.platform != 'darwin':
+        depends_on("libxext", when='@3:4.99')
+
     # Webkit
     depends_on("flex", when='+webkit', type='build')
     depends_on("bison", when='+webkit', type='build')
@@ -368,6 +374,11 @@ def configure(self):
                 '-skip', 'webengine',
             ])
 
+        if '~opengl' in self.spec and self.spec.satisfies('@5.10:'):
+            config_args.extend([
+                '-skip', 'webglplugin',
+            ])
+
         configure('-no-eglfs',
                   '-no-directfb',
                   '-{0}gtk'.format('' if '+gtk' in self.spec else 'no-'),
diff --git a/var/spack/repos/builtin/packages/qt/qt3accept.patch b/var/spack/repos/builtin/packages/qt/qt3accept.patch
new file mode 100644
index 0000000000000000000000000000000000000000..32dfb9df08e0f514e4a6f8e47189d4e748c871d9
--- /dev/null
+++ b/var/spack/repos/builtin/packages/qt/qt3accept.patch
@@ -0,0 +1,38 @@
+--- qt-x11-free-3.3.8b/configure	2008-01-15 13:09:15.000000000 -0600
++++ qt-x11-free-3.3.8b-fixes/configure	2015-07-08 15:49:03.379560633 -0500
+@@ -2339,7 +2339,7 @@
+         else
+             echo "Do you accept the terms of the $TheLicense? \c"
+         fi
+-        read acceptance
++        acceptance=yes
+         echo
+ 	if [ "$acceptance" = yes ]; then
+ 	    break
+@@ -2397,7 +2397,7 @@
+ 	else
+ 	    echo "Do you accept the terms of $affix license? \c"
+ 	fi
+-	read acceptance
++        acceptance=yes
+ 	echo
+ 	if [ "$acceptance" = "yes" ]; then
+ 	    break
+@@ -2443,7 +2443,7 @@
+ 	else
+ 	    echo "Do you accept the terms of the license? \c"
+ 	fi
+-	read acceptance
++        acceptance=yes
+ 	echo
+ 	if [ "$acceptance" = "yes" ]; then
+ 	    break
+@@ -2524,7 +2524,7 @@
+ 	else
+ 	    echo "Do you accept the terms of the $Platform License? \c"
+ 	fi
+-	read acceptance
++        acceptance=yes
+ 	echo
+ 	if [ "$acceptance" = "yes" ]; then
+ 	    break
diff --git a/var/spack/repos/builtin/packages/qt/qt3krell.patch b/var/spack/repos/builtin/packages/qt/qt3krell.patch
index 3333eeacd4cd8e3f430ba02f4ca660c092cb1185..4f1c12e43e8cc48ba99b1d1529543a4fd08d1b3d 100644
--- a/var/spack/repos/builtin/packages/qt/qt3krell.patch
+++ b/var/spack/repos/builtin/packages/qt/qt3krell.patch
@@ -28,41 +28,3 @@
  #endif
  
  template <class T>
---- qt-x11-free-3.3.8b/configure	2008-01-15 13:09:15.000000000 -0600
-+++ qt-x11-free-3.3.8b-fixes/configure	2015-07-08 15:49:03.379560633 -0500
-@@ -2339,7 +2339,7 @@
-         else
-             echo "Do you accept the terms of the $TheLicense? \c"
-         fi
--        read acceptance
-+        acceptance=yes
-         echo
- 	if [ "$acceptance" = yes ]; then
- 	    break
-@@ -2397,7 +2397,7 @@
- 	else
- 	    echo "Do you accept the terms of $affix license? \c"
- 	fi
--	read acceptance
-+        acceptance=yes
- 	echo
- 	if [ "$acceptance" = "yes" ]; then
- 	    break
-@@ -2443,7 +2443,7 @@
- 	else
- 	    echo "Do you accept the terms of the license? \c"
- 	fi
--	read acceptance
-+        acceptance=yes
- 	echo
- 	if [ "$acceptance" = "yes" ]; then
- 	    break
-@@ -2524,7 +2524,7 @@
- 	else
- 	    echo "Do you accept the terms of the $Platform License? \c"
- 	fi
--	read acceptance
-+        acceptance=yes
- 	echo
- 	if [ "$acceptance" = "yes" ]; then
- 	    break
diff --git a/var/spack/repos/builtin/packages/qt/qt3ptrdiff.patch b/var/spack/repos/builtin/packages/qt/qt3ptrdiff.patch
new file mode 100644
index 0000000000000000000000000000000000000000..5043e4b5a8840042964a90243434ab178722f6e6
--- /dev/null
+++ b/var/spack/repos/builtin/packages/qt/qt3ptrdiff.patch
@@ -0,0 +1,20 @@
+--- a/src/tools/qmap.h	2008-01-16 06:09:13.000000000 +1100
++++ b/src/tools/qmap.h	2018-01-07 11:32:38.720893324 +1100
+@@ -52,6 +52,7 @@
+ #ifndef QT_NO_STL
+ #include <iterator>
+ #include <map>
++#include <stddef.h>
+ #endif
+ 
+ //#define QT_CHECK_MAP_RANGE
+--- a/src/tools/qvaluelist.h	2008-01-16 06:09:13.000000000 +1100
++++ b/src/tools/qvaluelist.h	2018-01-07 11:33:03.393206961 +1100
+@@ -50,6 +50,7 @@
+ #ifndef QT_NO_STL
+ #include <iterator>
+ #include <list>
++#include <stddef.h>
+ #endif
+ 
+ //#define QT_CHECK_VALUELIST_RANGE