diff --git a/Graphics/X11/ExtraTypes/XF86.hsc b/Graphics/X11/ExtraTypes/XF86.hsc
--- a/Graphics/X11/ExtraTypes/XF86.hsc
+++ b/Graphics/X11/ExtraTypes/XF86.hsc
@@ -19,6 +19,7 @@
 -- Presumably XFree86/X.org has copyright on the header but it's not
 -- explicit in the file.
 
+#include "HsAllKeysyms.h"
 
 module Graphics.X11.ExtraTypes.XF86
         (
@@ -911,8 +912,6 @@
         ) where
 
 import Graphics.X11.Types
-
-#include "HsAllKeysyms.h"
 
 #ifdef XF86XK_ModeLock
 xF86XK_ModeLock             :: KeySym
diff --git a/Setup.hs b/Setup.hs
--- a/Setup.hs
+++ b/Setup.hs
@@ -1,6 +1,2 @@
-module Main (main) where
-
 import Distribution.Simple
-
-main :: IO ()
-main = defaultMainWithHooks defaultUserHooks
+main = defaultMainWithHooks autoconfUserHooks
diff --git a/X11.cabal b/X11.cabal
--- a/X11.cabal
+++ b/X11.cabal
@@ -1,75 +1,81 @@
 name:               X11
-version:            1.9
+version:            1.9.1
+synopsis:           A binding to the X11 graphics library
+description:        A Haskell binding to the X11 graphics library. The binding is a direct
+                    translation of the C binding; for documentation of these calls, refer
+                    to \"The Xlib Programming Manual\", available online at
+                    <http://tronche.com/gui/x/xlib/>.
 license:            BSD3
 license-file:       LICENSE
-copyright:          Alastair Reid, 1999-2003, libraries@haskell.org 2003-2007, Don Stewart 2007-2009, Spencer Janssen 2007-2009, Daniel Wagner 2009-2011.
+copyright:          Alastair Reid, 1999-2003, libraries@haskell.org 2003-2007,
+                    Don Stewart 2007-2009, Spencer Janssen 2007-2009, Daniel Wagner 2009-2011.
 maintainer:         Daniel Wagner <daniel@wagner-home.com>
+tested-with:        GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2,
+                    GHC == 8.4.3, GHC == 8.6.5, GHC == 8.8.1
+category:           Graphics
 homepage:           https://github.com/xmonad/X11
 bug-reports:        https://github.com/xmonad/X11/issues
-category:           Graphics
-synopsis:           A binding to the X11 graphics library
-description:        A Haskell binding to the X11 graphics library.
-    The binding is a direct translation of the C binding; for
-    documentation of these calls, refer to "The Xlib Programming
-    Manual", available online at <http://tronche.com/gui/x/xlib/>.
-extra-source-files:
-    configure.ac configure
-    config.mk.in X11.buildinfo.in include/HsX11Config.h.in
-    include/HsXlib.h include/XlibExtras.h include/X11_extras_config.h.in
-    include/HsAllKeysyms.h
-extra-tmp-files:
-    config.log config.status autom4te.cache
-    config.mk X11.buildinfo include/HsX11Config.h
-    include/X11_extras_config.h
-Cabal-Version: >= 1.6
 build-type:         Configure
-tested-with: GHC==7.6.3, GHC==7.8.4, GHC==7.10.3, GHC==8.0.1
+extra-tmp-files:    config.log
+                    config.status
+                    autom4te.cache
+                    config.mk
+                    X11.buildinfo
+                    include/HsX11Config.h
+                    include/X11_extras_config.h
+extra-source-files: configure.ac
+                    configure
+                    config.mk.in
+                    X11.buildinfo.in
+                    include/HsX11Config.h.in
+                    include/HsXlib.h
+                    include/XlibExtras.h
+                    include/X11_extras_config.h.in
+                    include/HsAllKeysyms.h
+cabal-version:      >= 1.6
 
 source-repository head
   type:     git
   location: https://github.com/xmonad/X11
 
 library
-  exposed-modules:
-      Graphics.X11,
-      Graphics.X11.Types,
-      Graphics.X11.Xlib,
-      Graphics.X11.Xlib.Atom,
-      Graphics.X11.Xlib.Color,
-      Graphics.X11.Xlib.Context,
-      Graphics.X11.Xlib.Cursor,
-      Graphics.X11.Xlib.Display,
-      Graphics.X11.Xlib.Event,
-      Graphics.X11.Xlib.Font,
-      Graphics.X11.Xlib.Misc,
-      Graphics.X11.Xlib.Region,
-      Graphics.X11.Xlib.Screen,
-      Graphics.X11.Xlib.Types,
-      Graphics.X11.Xlib.Window,
-      Graphics.X11.Xlib.Image,
-      Graphics.X11.Xlib.Extras,
-      Graphics.X11.Xinerama
-      Graphics.X11.Xrandr
-      Graphics.X11.XScreenSaver
-      Graphics.X11.ExtraTypes,
-      Graphics.X11.ExtraTypes.AP,
-      Graphics.X11.ExtraTypes.DEC,
-      Graphics.X11.ExtraTypes.HP,
-      Graphics.X11.ExtraTypes.Sun
-      Graphics.X11.ExtraTypes.XF86,
-      Graphics.X11.ExtraTypes.XorgDefault
-  other-modules:
-      Graphics.X11.Xlib.Internal
-  c-sources:
-      cbits/fdset.c,
-      cbits/auxiliaries.c,
-      cbits/XUtils.c
-  extensions:         ForeignFunctionInterface, CPP
-  extra-libraries:    "X11", "Xrandr", "Xext"
-  include-dirs:       include
-  includes:           HsXlib.h, HsAllKeysyms.h
-  install-includes:   HsXlib.h, XlibExtras.h, HsAllKeysyms.h
-  build-depends: base >= 4 && < 5, data-default
-  ghc-options:        -funbox-strict-fields -Wall -fno-warn-unused-binds
+  exposed-modules:  Graphics.X11
+                    Graphics.X11.ExtraTypes
+                    Graphics.X11.ExtraTypes.AP
+                    Graphics.X11.ExtraTypes.DEC
+                    Graphics.X11.ExtraTypes.HP
+                    Graphics.X11.ExtraTypes.Sun
+                    Graphics.X11.ExtraTypes.XF86
+                    Graphics.X11.ExtraTypes.XorgDefault
+                    Graphics.X11.Types
+                    Graphics.X11.XScreenSaver
+                    Graphics.X11.Xinerama
+                    Graphics.X11.Xlib
+                    Graphics.X11.Xlib.Atom
+                    Graphics.X11.Xlib.Color
+                    Graphics.X11.Xlib.Context
+                    Graphics.X11.Xlib.Cursor
+                    Graphics.X11.Xlib.Display
+                    Graphics.X11.Xlib.Event
+                    Graphics.X11.Xlib.Extras
+                    Graphics.X11.Xlib.Font
+                    Graphics.X11.Xlib.Image
+                    Graphics.X11.Xlib.Misc
+                    Graphics.X11.Xlib.Region
+                    Graphics.X11.Xlib.Screen
+                    Graphics.X11.Xlib.Types
+                    Graphics.X11.Xlib.Window
+                    Graphics.X11.Xrandr
+  other-modules:    Graphics.X11.Xlib.Internal
+  build-depends:    base == 4.*, data-default
+  extensions:       CPP
+                    ForeignFunctionInterface
+  extra-libraries:  X11, Xrandr, Xext
+  c-sources:        cbits/fdset.c, cbits/auxiliaries.c, cbits/XUtils.c
+  includes:         HsXlib.h, HsAllKeysyms.h
+  install-includes: HsXlib.h, XlibExtras.h, HsAllKeysyms.h
+  include-dirs:     include
+  ghc-options:      -funbox-strict-fields -Wall -fno-warn-unused-binds
+
   if impl(ghc >= 7.10)
     ghc-options: -fno-warn-tabs
