diff --git a/System/LibVirt/Foreign.chs b/System/LibVirt/Foreign.chs
--- a/System/LibVirt/Foreign.chs
+++ b/System/LibVirt/Foreign.chs
@@ -1,4 +1,5 @@
 {-# LANGUAGE ForeignFunctionInterface, StandaloneDeriving, DeriveDataTypeable, EmptyDataDecls #-}
+{-# LANGUAGE CPP #-}
 
 {# context lib="virt" prefix="vir" #}
 
@@ -684,7 +685,11 @@
   st <- newStream conn []
   {# call virStorageVolUpload #}
     (storageVolToPtr vol) (streamToPtr st) off len 0 >>= exceptionOnMinusOne
+#if MIN_VERSION_unix(2,8,0)
+  fd <- openFd path ReadOnly defaultFileFlags
+#else
   fd <- openFd path ReadOnly Nothing defaultFileFlags
+#endif
   alloca $ \fdptr -> do
     poke fdptr fd
     {# call virStreamSendAll #}
diff --git a/libvirt-hs.cabal b/libvirt-hs.cabal
--- a/libvirt-hs.cabal
+++ b/libvirt-hs.cabal
@@ -1,5 +1,6 @@
+Cabal-version:       3.4
 Name:                libvirt-hs
-Version:             0.2.2
+Version:             0.2.3
 
 Synopsis:            FFI bindings to libvirt virtualization API (http://libvirt.org)
 
@@ -7,7 +8,7 @@
 
 Homepage:            https://github.com/portnov/libvirt-hs
 
-License:             BSD3
+License:             BSD-3-Clause
 
 License-file:        LICENSE
 
@@ -27,7 +28,6 @@
 Extra-source-files:  Test.hs
 
 -- Constraint on the version of Cabal needed to build this package.
-Cabal-version:       >=1.6
 
 
 Library
@@ -41,9 +41,10 @@
                      , syb >= 0.1.0.2
                      , unix
   
-  Build-tools:         c2hs
+  Build-tool-depends: cpphs:c2hs
 
   pkgconfig-depends:   libvirt
+  default-language:    Haskell2010
 
 Source-repository head
   type: git
