diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,10 @@
 # Change Log
 All notable changes to this project will be documented in this file.
 
+## [0.1.6.1] - 2017-08-06
+### Fixed
+- Build process (`Stack.hs`) works with Cabal 1.X and Cabal 2.X
+
 ## [0.1.6.0] - 2017-03-25
 ### Fixed
 - `tools/libpath.sh` recognizes `stack`
@@ -70,6 +74,7 @@
 - Bindings to Libsass C API
 - Basic tests
 
+[0.1.6.1]: https://github.com/jakubfijalkowski/hlibsass/compare/v0.1.6.0...v0.1.6.1
 [0.1.6.0]: https://github.com/jakubfijalkowski/hlibsass/compare/v0.1.5.2...v0.1.6.0
 [0.1.5.2]: https://github.com/jakubfijalkowski/hlibsass/compare/v0.1.5.0...v0.1.5.2
 [0.1.5.0]: https://github.com/jakubfijalkowski/hlibsass/compare/v0.1.4.0...v0.1.5.0
diff --git a/Setup.hs b/Setup.hs
--- a/Setup.hs
+++ b/Setup.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
 import           Control.Monad                      (unless, when)
 import           Data.Char                          (toLower)
 import           Data.Maybe                         (fromJust, fromMaybe)
@@ -8,18 +9,30 @@
                                                      absoluteInstallDirs,
                                                      localPkgDescr)
 import           Distribution.Simple.Setup
-import           Distribution.Simple.Utils          (installExecutableFile,
+import           Distribution.Simple.Utils          (cabalVersion,
+                                                     installExecutableFile,
                                                      rawSystemExit,
-                                                     rawSystemStdout,
-                                                     cabalVersion)
+                                                     rawSystemStdout)
 import           Distribution.System
 import           System.Directory                   (getCurrentDirectory)
 
+#ifdef MIN_VERSION_Cabal
+#if MIN_VERSION_Cabal(2, 0, 0)
+import           Distribution.Version               (mkVersion)
+#else
+mkVersion :: [Int] -> Version
+mkVersion = flip Version []
+
+mkFlagName :: String -> FlagName
+mkFlagName = FlagName
+#endif
+#endif
+
 main = defaultMainWithHooks hooksFix
     where
         hooks = simpleUserHooks {
             preConf = makeLibsass
-          , confHook = (\a f -> confHook simpleUserHooks a f >>= updateExtraLibDirs)
+          , confHook = \a f -> confHook simpleUserHooks a f >>= updateExtraLibDirs
           , postConf = disablePostConfHooks
           , preBuild = updateLibDirs
           , postCopy = copyLibsass
@@ -28,7 +41,7 @@
         }
         -- Fix for Cabal-1.18 - it does not `copy` on `install`, so we `copy` on
         -- `install` manually. ;)
-        hooksFix = if cabalVersion < Version [1, 20, 0] []
+        hooksFix = if cabalVersion < mkVersion [1, 20, 0]
                        then hooks { postInst = installLibsass }
                        else hooks
 
@@ -120,6 +133,6 @@
     return emptyHookedBuildInfo
 
 getCabalFlag :: String -> ConfigFlags -> Bool
-getCabalFlag name flags = fromMaybe False (lookup (FlagName name') allFlags)
+getCabalFlag name flags = fromMaybe False (lookup (mkFlagName name') allFlags)
     where allFlags = configConfigurationsFlags flags
           name' = map toLower name
diff --git a/hlibsass.cabal b/hlibsass.cabal
--- a/hlibsass.cabal
+++ b/hlibsass.cabal
@@ -1,5 +1,5 @@
 name:                hlibsass
-version:             0.1.6.0
+version:             0.1.6.1
 license:             MIT
 license-file:        LICENSE
 author:              Jakub Fijałkowski <fiolek94@gmail.com>
