diff --git a/music-util.cabal b/music-util.cabal
--- a/music-util.cabal
+++ b/music-util.cabal
@@ -1,6 +1,6 @@
 
 name:               music-util
-version:            0.6
+version:            0.7
 cabal-version:      >= 1.10
 author:             Hans Hoglund
 maintainer:         Hans Hoglund <hans@hanshoglund.se>
@@ -25,7 +25,10 @@
         containers,
         shelly,
         process,
-        graphviz,
+
+        -- If enabled, add HAS_GRAPHVIZ flag
+        -- graphviz,
+        
         fgl,
         Cabal           >= 1.16 && < 2
     hs-source-dirs:     src
diff --git a/src/music-util.hs b/src/music-util.hs
--- a/src/music-util.hs
+++ b/src/music-util.hs
@@ -1,5 +1,5 @@
 
-{-# LANGUAGE OverloadedStrings    #-}
+{-# LANGUAGE OverloadedStrings, CPP #-}
 
 import           Control.Applicative
 import           Control.Exception                     (SomeException, try)
@@ -7,8 +7,11 @@
 -- import qualified Data.Graph                            as OG
 
 import Data.Graph.Inductive hiding (run, run_)
+
+#ifdef HAS_GRAPHVIZ
 import Data.GraphViz
 import Data.GraphViz.Attributes.Complete
+#endif
 
 import System.Process (system)
 import qualified Data.List                             as List
@@ -83,6 +86,8 @@
     ]
 
 
+#ifdef HAS_GRAPHVIZ
+
 dependencyParams :: GraphvizParams Int String String () String
 dependencyParams = nonClusteredParams {
      globalAttributes = ga,
@@ -107,6 +112,8 @@
     where
         dg = graphToDot dependencyParams dependencies
 
+#endif
+
 getPackageDeps :: String -> [String]
 getPackageDeps l = l : concatMap getPackageDeps children
     where
@@ -189,7 +196,13 @@
 list :: [String] -> Sh ()
 list _ = mapM_ (echo . fromString) packages
 
-graph _ = showDependencyGraph
+graph :: [String] -> Sh ()
+graph _ = do
+#ifdef HAS_GRAPHVIZ
+    showDependencyGraph
+#else
+    fail "music-util compiled without Graphviz support"
+#endif
 
 forEach :: [String] -> Sh ()
 forEach cmdArgs = do
